Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
refactor: Add editor config
Browse files Browse the repository at this point in the history
  • Loading branch information
Erb3 committed Apr 23, 2023
2 parents 53edbc5 + 3c2e7e2 commit 6df9ba4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
end_of_line = lf
insert_final_newline = false
indent_size = 2
indent_style = space
charset = utf-8
trim_trailing_whitespace = true
9 changes: 6 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { KristApi, calculateAddress } from 'krist';
import kristLib from "krist";
import fs from 'fs';

const {KristApi, calculateAddress} = kristLib
const krist = new KristApi({
userAgent: "KristSplit by PC_Cat | Operator: ??? | github.com/Erb3/Kristsplit"
});
Expand Down Expand Up @@ -30,7 +32,7 @@ const ws = krist.createWsClient({
initialSubscriptions: ['transactions'],
});

ws.on('transaction', async ({ transaction }) => {
ws.on('transaction', async ({transaction}) => {
if (!registeredSplits[transaction.to]) {
return;
}
Expand All @@ -55,7 +57,8 @@ ws.on('transaction', async ({ transaction }) => {

if (left !== 0 && splits.leftOvers === 'REFUND') {
console.log('Refunding leftovers: ' + left);
krist.makeTransaction(transaction.from, left, {

await krist.makeTransaction(transaction.from, left, {
walletFormat: splits.privatekeyFormat,
privatekey: splits.privatekey,
metadata: 'Powered by=KristSplit;donate=true;message=Here is the leftovers that could not be split!',
Expand Down

0 comments on commit 6df9ba4

Please sign in to comment.