Skip to content

Commit

Permalink
feat(frontend): review adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
DenysKarmazynDFINITY committed Sep 27, 2024
1 parent 7d24114 commit 0ae13b2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/frontend/src/btc/schedulers/btc-wallet.scheduler.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { getBtcBalance } from '$lib/api/signer.api';
import { WALLET_TIMER_INTERVAL_MILLIS } from '$lib/constants/app.constants';
import { SchedulerTimer, type Scheduler, type SchedulerJobData } from '$lib/schedulers/scheduler';
import type { BitcoinTransaction } from '$lib/types/blockchain';
import type {
PostMessageDataRequestBtc,
PostMessageDataResponseWallet
} from '$lib/types/post-message';
import { assertNonNullish } from '@dfinity/utils';
import { assertNonNullish, jsonReplacer } from '@dfinity/utils';

export class BtcWalletScheduler implements Scheduler<PostMessageDataRequestBtc> {
private timer = new SchedulerTimer('syncBtcWalletStatus');
Expand Down Expand Up @@ -44,14 +45,16 @@ export class BtcWalletScheduler implements Scheduler<PostMessageDataRequestBtc>
network: bitcoinNetwork
});

// TODO: Fetch and parse transactions
const transactions: BitcoinTransaction[] = [];

this.postMessageWallet({
wallet: {
balance: {
data: balance,
certified: true
},
// TODO: Send parsed transactions
newTransactions: ''
newTransactions: JSON.stringify(transactions, jsonReplacer)
}
});
};
Expand Down

0 comments on commit 0ae13b2

Please sign in to comment.