Skip to content

Commit

Permalink
add exchange notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
ordinariusprof committed Mar 23, 2024
1 parent 245801d commit b1609ba
Show file tree
Hide file tree
Showing 4 changed files with 697 additions and 1,547 deletions.
2 changes: 2 additions & 0 deletions model/exchanges/kraken.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ class KrakenTumbler {
withdrawalAmount,
);
if (res.error.length > 0) {
this.notificationService.sendMessage('stopped: error calling kraken api', 'verbose');
console.error('error calling kraken api', res.error);
return false;
}

this.notificationService.sendMessage(`successful withdrawal ${withdrawalAmount} ${this.withdrawCurrency} to wallet ${this.withdrawWallet}`, 'verbose');
console.log('succeful withdrawal from kraken', res.result);

return true;
Expand Down
2 changes: 2 additions & 0 deletions model/exchanges/okcoin.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ class OkcoinTumbler {
console.log('response from okcoin', res);

if (res.msg) {
this.notificationService.sendMessage('stopped: error calling okcoin api', 'verbose');
console.error('error calling okcoin api', res.msg);
return false;
}

console.log('successful withdrawal from okcoin');
this.notificationService.sendMessage(`successful withdrawal ${withdrawalAmount} ${this.withdrawCurrency} to wallet ${this.withdrawWallet}`, 'verbose');
return true;
};
}
Expand Down
2 changes: 2 additions & 0 deletions model/satminer.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class Satminer {

extractSatsAndRotateFunds = async () => {
console.log('scanning for rare sats...');
this.notificationService.sendMessage(`starting a new cycle.`, 'verbose');

const fees = await this.wallet.estimateFee();
const { fastestFee } = fees;
Expand All @@ -150,6 +151,7 @@ class Satminer {
const { specialRanges, tx, message } = satextractorRes;

if (message && message.includes('Address is empty')) {
this.notificationService.sendMessage(`${this.tumblerAddress} is currently empty.`, 'verbose');
console.log('tumbler wallet is empty');
return false;
} else if (specialRanges.length === 0) {
Expand Down
Loading

0 comments on commit b1609ba

Please sign in to comment.