diff --git a/src/frontend/src/btc/schedulers/btc-wallet.scheduler.ts b/src/frontend/src/btc/schedulers/btc-wallet.scheduler.ts index 2b4a943d02..c7bff73ecd 100644 --- a/src/frontend/src/btc/schedulers/btc-wallet.scheduler.ts +++ b/src/frontend/src/btc/schedulers/btc-wallet.scheduler.ts @@ -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 { private timer = new SchedulerTimer('syncBtcWalletStatus'); @@ -44,14 +45,16 @@ export class BtcWalletScheduler implements Scheduler 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) } }); };