diff --git a/suite-common/graph/package.json b/suite-common/graph/package.json index 2f531b89813c..2abfb65cab7a 100644 --- a/suite-common/graph/package.json +++ b/suite-common/graph/package.json @@ -17,7 +17,6 @@ "@suite-common/fiat-services": "workspace:*", "@suite-common/suite-config": "workspace:*", "@suite-common/suite-utils": "workspace:*", - "@suite-common/transaction-cache-engine": "workspace:*", "@suite-common/wallet-config": "workspace:*", "@suite-common/wallet-core": "workspace:*", "@suite-common/wallet-types": "workspace:*", diff --git a/suite-common/graph/tsconfig.json b/suite-common/graph/tsconfig.json index 0e9ce0365050..d5d5f476302e 100644 --- a/suite-common/graph/tsconfig.json +++ b/suite-common/graph/tsconfig.json @@ -5,7 +5,6 @@ { "path": "../fiat-services" }, { "path": "../suite-config" }, { "path": "../suite-utils" }, - { "path": "../transaction-cache-engine" }, { "path": "../wallet-config" }, { "path": "../wallet-core" }, { "path": "../wallet-types" }, diff --git a/suite-common/transaction-cache-engine/package.json b/suite-common/transaction-cache-engine/package.json deleted file mode 100644 index 3f1b13a69f25..000000000000 --- a/suite-common/transaction-cache-engine/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@suite-common/transaction-cache-engine", - "version": "1.0.0", - "main": "src/index", - "license": "See LICENSE.md in repo root", - "private": true, - "sideEffects": false, - "scripts": { - "depcheck": "yarn g:depcheck", - "type-check": "yarn g:tsc --build", - "lint:js": "yarn g:eslint '**/*.{ts,tsx,js}'", - "test:unit": "yarn g:jest -c ../../jest.config.base.js" - }, - "dependencies": { - "@mobily/ts-belt": "^3.13.1", - "@suite-common/wallet-config": "workspace:*", - "@trezor/connect": "workspace:*", - "@trezor/utils": "workspace:*" - } -} diff --git a/suite-common/transaction-cache-engine/src/MemoryStorage.ts b/suite-common/transaction-cache-engine/src/MemoryStorage.ts deleted file mode 100644 index 89d08912e739..000000000000 --- a/suite-common/transaction-cache-engine/src/MemoryStorage.ts +++ /dev/null @@ -1,101 +0,0 @@ -/* eslint-disable require-await */ -import { A, F, pipe } from '@mobily/ts-belt'; - -import { AccountTransaction } from '@trezor/connect'; - -import { AccountUniqueKey, AccountUniqueParams, TransactionCacheEngineStorage } from './types'; -import { getAccountUniqueKey } from './utils/asyncUtils'; - -/** - * This class is used to store accounts and transactions in memory. Mostly for debugging purposes. It's not recommended to use it in production, use some storage that persists data instead. - */ -export class MemoryStorage implements TransactionCacheEngineStorage { - accounts: Record = {}; - accountTransactions: Record = {}; - - constructor() { - this.init(); - } - - async init() { - // TODO: init storage - } - - async accountExist(account: AccountUniqueParams) { - const accountUniqueKey = getAccountUniqueKey(account); - - return !!this.accounts[accountUniqueKey]; - } - - async saveAccount(account: AccountUniqueParams) { - if (await this.accountExist(account)) { - return; - } - const accountUniqueKey = getAccountUniqueKey(account); - this.accounts[accountUniqueKey] = account; - } - - async removeAccount({ coin, descriptor }: AccountUniqueParams) { - const accountUniqueKey = getAccountUniqueKey({ coin, descriptor }); - - delete this.accountTransactions[accountUniqueKey]; - delete this.accounts[accountUniqueKey]; - } - - async saveTransactions({ - account, - transactions, - }: { - account: AccountUniqueParams; - transactions: AccountTransaction[]; - }) { - if (!(await this.accountExist(account))) { - throw new Error( - `Adding transactions for account that does not exist ${JSON.stringify(account)}`, - ); - } - - const accountUniqueKey = getAccountUniqueKey(account); - const existingTransactions = this.accountTransactions[accountUniqueKey] || []; - - this.accountTransactions[accountUniqueKey] = pipe( - transactions, - A.filter(({ txid }) => !existingTransactions.find(t => t.txid === txid)), - A.concat(existingTransactions), - F.toMutable, - ); - } - - async getNumberOfExistingTransactions({ - coin, - descriptor, - txids, - }: AccountUniqueParams & { - txids: string[]; - }): Promise { - const existingTxids = this.getAccountTxids({ coin, descriptor }); - - return txids.filter(txid => existingTxids.includes(txid)).length; - } - - async getAccounts(): Promise { - // This function should return all accounts that are saved in the storage. - return Object.values(this.accounts); - } - - async getTransactions({ - coin, - descriptor, - }: AccountUniqueParams): Promise { - const accountUniqueKey = getAccountUniqueKey({ coin, descriptor }); - - return this.accountTransactions[accountUniqueKey] || []; - } - - private getAccountTxids(account: AccountUniqueParams) { - const accountUniqueKey = getAccountUniqueKey(account); - const transactions = this.accountTransactions[accountUniqueKey] || []; - - return transactions.map(t => t.txid); - } -} diff --git a/suite-common/transaction-cache-engine/src/TransactionCacheEngine.ts b/suite-common/transaction-cache-engine/src/TransactionCacheEngine.ts deleted file mode 100644 index 5b66595b7678..000000000000 --- a/suite-common/transaction-cache-engine/src/TransactionCacheEngine.ts +++ /dev/null @@ -1,312 +0,0 @@ -/* eslint-disable require-await */ -import { A, D, pipe } from '@mobily/ts-belt'; - -import TrezorConnect, { AccountInfo, AccountTransaction } from '@trezor/connect'; -import { getNetworkType } from '@suite-common/wallet-config'; -import { createDeferred } from '@trezor/utils'; - -import { - EnsureSingleRunningInstance, - TrackRunningTransactionFetches, - WaitUntilFetchIsFinished, - getAccountUniqueKey, -} from './utils/asyncUtils'; -import { AccountUniqueKey, AccountUniqueParams, TransactionCacheEngineStorage } from './types'; -import { getAccountBalanceHistory } from './utils/balanceHistory'; - -const DEBUG_ENABLED = false; -const debugLog = (...args: any[]) => { - if (DEBUG_ENABLED) { - // eslint-disable-next-line no-console - console.log(...args); - } -}; - -const TRANSACTION_ADD_ACCOUNT_PAGE_SIZE = 100; -const TRANSACTION_POLL_PAGE_SIZE = 3; -const TRANSACTION_INIT_PAGE_SIZE = 5; -const TRANSACTION_POLL_INTERVAL_MS = 60_000; - -export class TransactionCacheEngine { - private initPromise = createDeferred(); - private storage: TransactionCacheEngineStorage; - private periodicFetchesTimeoutIds: Record> = {}; - - constructor({ storage }: { storage: TransactionCacheEngineStorage }) { - this.storage = storage; - } - - public async init() { - // Init must be called after connect init is finished, otherwise it will fetch XRP account forever. Maybe bug in connect? - debugLog('Initializing TransactionCacheEngine'); - - const accounts = await this.storage.getAccounts(); - - // Refetch transactions that happened when app was closed. - // Used allSettled because we don't need to care if some fetches will fail on init. We will fetch them by periodic checks. - await Promise.allSettled( - accounts.map(account => - this.fetchAndSaveAllMissingAccountTransactions({ - ...account, - pageSize: TRANSACTION_INIT_PAGE_SIZE, - }), - ), - ); - - this.initPromise.resolve(); - - accounts.forEach(account => this.watchForNewTransactions(account)); - } - - private awaitInit() { - return this.initPromise.promise; - } - - @EnsureSingleRunningInstance() - @TrackRunningTransactionFetches() - async addAccount({ coin, descriptor }: AccountUniqueParams) { - await this.awaitInit(); - if (await this.accountExists({ coin, descriptor })) { - return; - } - - await this.storage.saveAccount({ coin, descriptor }); - await this.fetchAndSaveAllMissingAccountTransactions({ - coin, - descriptor, - pageSize: TRANSACTION_ADD_ACCOUNT_PAGE_SIZE, - }); - this.watchForNewTransactions({ coin, descriptor }); - } - - async accountExists({ coin, descriptor }: AccountUniqueParams) { - await this.awaitInit(); - - return this.storage.accountExist({ coin, descriptor }); - } - - async removeAccount({ coin, descriptor }: AccountUniqueParams) { - await this.awaitInit(); - await this.storage.removeAccount({ coin, descriptor }); - await this.stopWatchingForNewTransactions({ coin, descriptor }); - } - - @WaitUntilFetchIsFinished() - public async getTransactions({ coin, descriptor }: AccountUniqueParams) { - debugLog(`getTransactions for ${coin} - ${descriptor}`); - await this.awaitInit(); - - return this.storage.getTransactions({ coin, descriptor }); - } - - @EnsureSingleRunningInstance() - private async fetchAndSaveAllMissingAccountTransactions({ - coin, - descriptor, - pageSize, - }: AccountUniqueParams & { pageSize: number }) { - await this.awaitInit(); - debugLog(`Fetching transactions for ${coin} - ${descriptor}`, { pageSize }); - if (!(await this.accountExists({ coin, descriptor }))) { - throw new Error( - 'Account not registered. Please register it first using TransactionCacheEngine.addAccount', - ); - } - - const allTransactions: AccountTransaction[] = []; - - let page = 0; - // marker is used instead of page for ripple (cursor based pagination) - let marker: AccountInfo['marker'] | undefined; - const networkType = getNetworkType(coin); - - while (true) { - page += 1; - - debugLog( - `Fetching transactions for ${coin} - ${descriptor} page ${page}, marker ${marker}`, - ); - - const result = await TrezorConnect.getAccountInfo({ - coin, - descriptor, - // TODO add identity when used for eth-like coins - details: 'txs', - page, - pageSize, - ...(marker ? { marker } : {}), // set marker only if it is not undefined (ripple), otherwise it fails on marker validation - }); - if (!result.success) { - throw new Error(result.payload.error); - } - - debugLog( - `Fetched ${result.payload.history.transactions?.length} transactions for ${coin} - ${descriptor} page ${page}`, - ); - - marker = result.payload.marker; - - const pageTransactions = result.payload.history.transactions ?? []; - - allTransactions.push(...pageTransactions); - - const txids = pageTransactions.map(tx => tx.txid); - const numberOfExistingTransactions = await this.storage.getNumberOfExistingTransactions( - { - coin, - descriptor, - txids, - }, - ); - - // We check if all transactions from latest page are already saved in the storage. - // If yes, We have fetched all transactions that are not already saved in the storage. - if (numberOfExistingTransactions === txids.length) { - break; - } - - if ( - networkType !== 'ripple' && - result.payload.page?.total === result.payload.page?.index - ) { - break; - } - - if (networkType === 'ripple' && !result.payload.marker) { - break; - } - } - - if (!(await this.accountExists({ coin, descriptor }))) { - console.warn('Account was removed while fetching transactions', coin, descriptor); - - return; - } - - debugLog( - `Sending ${allTransactions.length} transactions to storage for ${coin} - ${descriptor}`, - ); - await this.storage.saveTransactions({ - account: { coin, descriptor }, - transactions: allTransactions, - }); - } - - @WaitUntilFetchIsFinished() - async getAccountBalanceHistory(account: AccountUniqueParams) { - if (!(await this.accountExists(account))) { - await this.addAccount(account); - await this.fetchAndSaveAllMissingAccountTransactions({ - ...account, - pageSize: TRANSACTION_INIT_PAGE_SIZE, - }); - } - - const transactions = await this.getTransactions(account); - - return getAccountBalanceHistory({ transactions, coin: account.coin }); - } - - private watchForNewTransactions({ coin, descriptor }: AccountUniqueParams) { - debugLog(`Watching for new transactions for ${coin} - ${descriptor}`); - - // We need to start periodic check first, because it's subscribing to new transactions isn't always reliable, but it's useful because it's instant. - this.startPeriodicallyCheckNewTransactions({ coin, descriptor }); - - // We don't need to pass specific account here, because it's easier to just resubscribe to all accounts. - this.subscribeToNewTransactionsAllAccounts(); - } - - private stopWatchingForNewTransactions({ coin, descriptor }: AccountUniqueParams) { - debugLog(`Stop watching for new transactions for ${coin} - ${descriptor}`); - - this.stopPeriodicallyCheckNewTransactions({ coin, descriptor }); - this.unsubscribeFromNewTransactions({ coin, descriptor }); - } - - private async startPeriodicallyCheckNewTransactions({ coin, descriptor }: AccountUniqueParams) { - debugLog(`Start periodic check for new transactions for ${coin} - ${descriptor}`); - - const accountKey = getAccountUniqueKey({ coin, descriptor }); - - const isCheckAlreadyRunning = !!this.periodicFetchesTimeoutIds[accountKey]; - const isAccountRegistered = await this.accountExists({ coin, descriptor }); - - if (!isAccountRegistered || isCheckAlreadyRunning) { - debugLog( - `Periodic fetch of new transactions for ${coin} - ${descriptor} is already running`, - ); - - return; - } - - this.periodicFetchesTimeoutIds[accountKey] = setTimeout(async () => { - try { - await this.fetchAndSaveAllMissingAccountTransactions({ - coin, - descriptor, - pageSize: TRANSACTION_POLL_PAGE_SIZE, - }); - } catch (error) { - // We don't need to handle this error, because it will just run again in next interval. - debugLog( - `Periodic fetch of new transactions error for ${coin} - ${descriptor} =>`, - error, - ); - } - - if (!this.periodicFetchesTimeoutIds[accountKey]) { - // Account was removed while fetching transactions. - return; - } - - delete this.periodicFetchesTimeoutIds[accountKey]; - await this.startPeriodicallyCheckNewTransactions({ coin, descriptor }); - }, TRANSACTION_POLL_INTERVAL_MS); - } - - private async stopPeriodicallyCheckNewTransactions({ coin, descriptor }: AccountUniqueParams) { - debugLog(`Stop periodic check for new transactions for ${coin} - ${descriptor}`); - - const accountKey = getAccountUniqueKey({ coin, descriptor }); - const timeoutId = this.periodicFetchesTimeoutIds[accountKey]; - - if (timeoutId) { - clearTimeout(timeoutId); - delete this.periodicFetchesTimeoutIds[accountKey]; - } - } - - private async subscribeToNewTransactionsAllAccounts() { - await this.awaitInit(); - - const accounts = await this.storage.getAccounts(); - const accountsByCoin = A.groupBy(accounts, account => account.coin); - - pipe( - accountsByCoin, - D.keys, - A.forEach(coin => { - const accountDescriptors = accountsByCoin[coin]?.map(({ descriptor }) => ({ - descriptor, - })); - - TrezorConnect.blockchainSubscribe({ - accounts: accountDescriptors, - coin, - // TODO add identity when used for eth-like coins - }); - }), - ); - } - - private async unsubscribeFromNewTransactions({ coin, descriptor }: AccountUniqueParams) { - await this.awaitInit(); - - TrezorConnect.blockchainUnsubscribe({ - accounts: [{ descriptor }], - coin, - // TODO add identity when used for eth-like coins - }); - } -} diff --git a/suite-common/transaction-cache-engine/src/index.ts b/suite-common/transaction-cache-engine/src/index.ts deleted file mode 100644 index 5605652a1d89..000000000000 --- a/suite-common/transaction-cache-engine/src/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { TransactionCacheEngine } from './TransactionCacheEngine'; -import { MemoryStorage } from './MemoryStorage'; - -const TransactionCacheEngineInstance = new TransactionCacheEngine({ - storage: new MemoryStorage(), -}); - -export { TransactionCacheEngineInstance as TransactionCacheEngine }; -export type { AccountUniqueParams, AccountBalanceHistory } from './types'; diff --git a/suite-common/transaction-cache-engine/src/tests/TransactionCacheEngine.test.ts b/suite-common/transaction-cache-engine/src/tests/TransactionCacheEngine.test.ts deleted file mode 100644 index 7c7c2a4f2ee6..000000000000 --- a/suite-common/transaction-cache-engine/src/tests/TransactionCacheEngine.test.ts +++ /dev/null @@ -1,144 +0,0 @@ -import TrezorConnect from '@trezor/connect'; - -import { TransactionCacheEngine } from '../TransactionCacheEngine'; -import { MemoryStorage } from '../MemoryStorage'; -import { accountBalanceHistoryResult as btcAccountBalanceHistoryResult } from './__fixtures__/btc'; -import { AccountBalanceHistory, AccountUniqueParams } from '../types'; -import { accountBalanceHistoryResult as rippleAccountBalanceHistoryResult } from './__fixtures__/xrp'; - -jest.mock('@trezor/connect', () => { - // eslint-disable-next-line @typescript-eslint/no-var-requires - const { connectGetAccountInfoMock } = require('./__fixtures__'); - const { DeviceModelInternal } = jest.requireActual('@trezor/connect'); - - return { - __esModule: true, - default: { - init: jest.fn(() => Promise.resolve()), - getAccountInfo: jest.fn(connectGetAccountInfoMock), - blockchainSubscribe: jest.fn(() => Promise.resolve()), - blockchainUnsubscribe: jest.fn(() => Promise.resolve()), - }, - DeviceModelInternal, - }; -}); - -const converBalanceHistoryToString = (balanceHistory: AccountBalanceHistory[]) => - balanceHistory.map(item => ({ - ...item, - received: item.received.toString(), - sent: item.sent.toString(), - sentToSelf: item.sentToSelf.toString(), - })); - -describe('TransactionCacheEngine', () => { - it('should add an account', async () => { - const engine = new TransactionCacheEngine({ - storage: new MemoryStorage(), - }); - await engine.init(); - const account: AccountUniqueParams = { - coin: 'btc', - descriptor: 'xpub', - }; - await engine.addAccount(account); - expect(await engine.accountExists(account)).toBe(true); - // should call getAccountInfo and blockchainSubscribe - expect(TrezorConnect.getAccountInfo).toHaveBeenCalled(); - expect(TrezorConnect.blockchainSubscribe).toHaveBeenCalled(); - }); - - it('should remove an account', async () => { - const engine = new TransactionCacheEngine({ - storage: new MemoryStorage(), - }); - await engine.init(); - const account: AccountUniqueParams = { - coin: 'btc', - descriptor: 'xpub', - }; - await engine.addAccount(account); - expect(await engine.accountExists(account)).toBe(true); - await engine.removeAccount(account); - expect(await engine.accountExists(account)).toBe(false); - // should call blockchainUnsubscribe - expect(TrezorConnect.blockchainUnsubscribe).toHaveBeenCalled(); - }); - - it('should get transactions', async () => { - const engine = new TransactionCacheEngine({ - storage: new MemoryStorage(), - }); - await engine.init(); - const account: AccountUniqueParams = { - coin: 'btc', - descriptor: 'xpub', - }; - await engine.addAccount(account); - const transactions = await engine.getTransactions(account); - const expectedTransactions = await TrezorConnect.getAccountInfo({ - ...account, - page: 1, - pageSize: 99999999, - }); - expect(transactions).toMatchObject( - (expectedTransactions.payload as any).history.transactions, - ); - }); - - it('should get transactions without awaited addAccount', async () => { - const engine = new TransactionCacheEngine({ - storage: new MemoryStorage(), - }); - await engine.init(); - const account: AccountUniqueParams = { - coin: 'btc', - descriptor: 'xpub', - }; - engine.addAccount(account); - // get transaction should wait for addAccount even without await - const transactions = await engine.getTransactions(account); - const expectedTransactions = await TrezorConnect.getAccountInfo({ - ...account, - page: 1, - pageSize: 99999999, - }); - expect(transactions).toMatchObject( - (expectedTransactions.payload as any).history.transactions, - ); - }); - - it('should getAccoutBalanceHistory for bitcoin', async () => { - const engine = new TransactionCacheEngine({ - storage: new MemoryStorage(), - }); - await engine.init(); - const account: AccountUniqueParams = { - coin: 'btc', - descriptor: 'xpub', - }; - await engine.addAccount(account); - const balanceHistory = await engine.getAccountBalanceHistory(account); - - expect(converBalanceHistoryToString(balanceHistory)).toMatchObject( - (await btcAccountBalanceHistoryResult).payload, - ); - }); - - it('should getAccoutBalanceHistory for ripple', async () => { - const engine = new TransactionCacheEngine({ - storage: new MemoryStorage(), - }); - await engine.init(); - const account: AccountUniqueParams = { - coin: 'xrp', - descriptor: 'xpub', - }; - await engine.addAccount(account); - const balanceHistory = await engine.getAccountBalanceHistory(account); - - expect(converBalanceHistoryToString(balanceHistory)).toMatchObject( - converBalanceHistoryToString(rippleAccountBalanceHistoryResult), - ); - }); -}); diff --git a/suite-common/transaction-cache-engine/src/tests/__fixtures__/btc.ts b/suite-common/transaction-cache-engine/src/tests/__fixtures__/btc.ts deleted file mode 100644 index 1c3405e8b9ae..000000000000 --- a/suite-common/transaction-cache-engine/src/tests/__fixtures__/btc.ts +++ /dev/null @@ -1,2569 +0,0 @@ -import { - AccountInfo, - Response as ConnectResponse, - BlockchainAccountBalanceHistory, -} from '@trezor/connect'; - -export const accountInfoResult: ConnectResponse = { - // @ts-expect-error wrong types in Trezor Connect - id: 1, - success: true, - payload: { - descriptor: - 'zpub6rjNNddoAVvuYaD6WPdxiqFEToQHgrERjWMg7kM9gGGk6rhPMWNEmL5X745FGqBq8Wp136LfA3A7UjRGEYdJrf8dUfshzNrb5rvaryNfVJf', - balance: '269404', - availableBalance: '269404', - empty: false, - addresses: { - change: [ - { - address: 'bc1qdy0jxh83s5ddtw6dctjr8jwpcl7fjn9z3cjlux', - path: "m/84'/0'/0'/1/0", - transfers: 2, - balance: '0', - sent: '516088', - received: '516088', - }, - { - address: 'bc1qnwvem4f238u6dkz7zn53an4h2ealr390h7284t', - path: "m/84'/0'/0'/1/1", - transfers: 2, - balance: '0', - sent: '464814', - received: '464814', - }, - { - address: 'bc1qxm4qkadavwptrdlp9p80rmxn7dlhfvte050ewl', - path: "m/84'/0'/0'/1/2", - transfers: 2, - balance: '0', - sent: '433756', - received: '433756', - }, - { - address: 'bc1qux7xuufl8l4wh8r0lf2mye2mq28qyjwucfntdf', - path: "m/84'/0'/0'/1/3", - transfers: 2, - balance: '0', - sent: '478724', - received: '478724', - }, - { - address: 'bc1qgumedq8968wxv8dfqapnqa9s9uzmhwqca7gl8j', - path: "m/84'/0'/0'/1/4", - transfers: 2, - balance: '0', - sent: '446278', - received: '446278', - }, - { - address: 'bc1q5znx6jmsy740wp66t5meau44jux4ek7hp9x3k0', - path: "m/84'/0'/0'/1/5", - transfers: 2, - balance: '0', - sent: '383982', - received: '383982', - }, - { - address: 'bc1qvgq6anu0eyqaln06jzd0ljf8qt6sh26xaehyf6', - path: "m/84'/0'/0'/1/6", - transfers: 2, - balance: '0', - sent: '133800', - received: '133800', - }, - { - address: 'bc1qj477aj92qsttes0c5kgw9u4avkjh8w46kpf2ae', - path: "m/84'/0'/0'/1/7", - transfers: 2, - balance: '0', - sent: '24800', - received: '24800', - }, - { - address: 'bc1q7uupvkequzlh3twll87prax2nxy5m5leynl5yn', - path: "m/84'/0'/0'/1/8", - transfers: 2, - balance: '0', - sent: '142047', - received: '142047', - }, - { - address: 'bc1qx89rjquukmfgpxa5y0gmaqvuhhr7flychflhc4', - path: "m/84'/0'/0'/1/9", - transfers: 2, - balance: '0', - sent: '194211', - received: '194211', - }, - { - address: 'bc1qqrueed2uvj42qql0qmn2rhwpum3k6mrhflc98f', - path: "m/84'/0'/0'/1/10", - transfers: 2, - balance: '0', - sent: '37813', - received: '37813', - }, - { - address: 'bc1qt5mjvp7nt4lpq77s4c3trvyre2smtcxz4zmmjs', - path: "m/84'/0'/0'/1/11", - transfers: 2, - balance: '0', - sent: '19580', - received: '19580', - }, - { - address: 'bc1qnx3gypazcwf2u9gmpgdjt0ujmy9apc4nn57nt2', - path: "m/84'/0'/0'/1/12", - transfers: 2, - balance: '0', - sent: '30899', - received: '30899', - }, - { - address: 'bc1qp4u0adgvrd83lyte6ewcgd3kj4u0fcd34ysmz8', - path: "m/84'/0'/0'/1/13", - transfers: 2, - balance: '0', - sent: '38275', - received: '38275', - }, - { - address: 'bc1qxc3x3u4xxrsjsqd5fpkrg6u5njumqgxr8h3knt', - path: "m/84'/0'/0'/1/14", - transfers: 1, - balance: '6248', - sent: '0', - received: '6248', - }, - { - address: 'bc1qn347dq7mfjpxrjv08e0urw3jzj78ak6kg4ypy8', - path: "m/84'/0'/0'/1/15", - transfers: 0, - }, - { - address: 'bc1qchxyjcyhfp8c05dyc3znxtsv2mp94a3eqwmn9m', - path: "m/84'/0'/0'/1/16", - transfers: 0, - }, - { - address: 'bc1q9r4mm39w28kfah4unwwuhh0te3484s0yxzh4dv', - path: "m/84'/0'/0'/1/17", - transfers: 0, - }, - { - address: 'bc1q7tdkd4eaefz0vgs8mk3nvhjey0djphc8q72wak', - path: "m/84'/0'/0'/1/18", - transfers: 0, - }, - { - address: 'bc1qnmy2x3lvye33ptayk0s24kqgqlh7jhz7ewdg8q', - path: "m/84'/0'/0'/1/19", - transfers: 0, - }, - { - address: 'bc1q63qwde35nkr5aq48zj78nm97tn2gfq4raa7t35', - path: "m/84'/0'/0'/1/20", - transfers: 0, - }, - { - address: 'bc1qzny4s85smla26s9h2gkmadpdfckkzj97cp5usk', - path: "m/84'/0'/0'/1/21", - transfers: 0, - }, - { - address: 'bc1q2xsfhplmu0dqlzya2x3tnd34vhme2xwfks6xdl', - path: "m/84'/0'/0'/1/22", - transfers: 0, - }, - { - address: 'bc1q3wxufj54uuemv6p58fk9r463zwm6kpevlfdtvx', - path: "m/84'/0'/0'/1/23", - transfers: 0, - }, - { - address: 'bc1qgs7g9xlkcr6mep0y4uvjscynlcqpxeph7ek0xz', - path: "m/84'/0'/0'/1/24", - transfers: 0, - }, - { - address: 'bc1qqc2svuzqe9v99a3c6rhe7v9986z5eh29klxsf7', - path: "m/84'/0'/0'/1/25", - transfers: 0, - }, - { - address: 'bc1qqfz97l7xrma88fwwjsgk5p7uynxk4405wrywqj', - path: "m/84'/0'/0'/1/26", - transfers: 0, - }, - { - address: 'bc1qlv52cufzjufl8tuy9620q8gms06l4l65e8decd', - path: "m/84'/0'/0'/1/27", - transfers: 0, - }, - { - address: 'bc1qlas477vtkq9wpawl9zsvmll883majpjul5c35h', - path: "m/84'/0'/0'/1/28", - transfers: 0, - }, - { - address: 'bc1qwds3y8zf04r7u4vkln6x8k6ajnsrkqc9mtet5k', - path: "m/84'/0'/0'/1/29", - transfers: 0, - }, - { - address: 'bc1ql88eh8gnf43klhy2axdw9zfnrz7gdg9puncqmw', - path: "m/84'/0'/0'/1/30", - transfers: 0, - }, - { - address: 'bc1qfg8t8al0sw744etk5j3ux9zlq7e72jzc9teul9', - path: "m/84'/0'/0'/1/31", - transfers: 0, - }, - { - address: 'bc1qsjfq9vppg693ucy2quf8auxh2g04squnzt0h04', - path: "m/84'/0'/0'/1/32", - transfers: 0, - }, - { - address: 'bc1qg72ut0hnghjw3sspxj4z4xh6rau22e936cxjaz', - path: "m/84'/0'/0'/1/33", - transfers: 0, - }, - { - address: 'bc1qdhnmc9jkfqtwpk4kx9ax4dkevqrpect388ykay', - path: "m/84'/0'/0'/1/34", - transfers: 0, - }, - ], - used: [ - { - address: 'bc1qfqnh5gxudypnleshwhh5lal5339tkvr5fsxjtl', - path: "m/84'/0'/0'/0/0", - transfers: 2, - balance: '0', - sent: '521229', - received: '521229', - }, - { - address: 'bc1qa5e54k3p2cw3dmzdvzc0ehgg3wtvrv74lrtngj', - path: "m/84'/0'/0'/0/1", - transfers: 2, - balance: '0', - sent: '5000', - received: '5000', - }, - { - address: 'bc1qph5vk20vl5sjltxus0s82gwug0vum5hkganr2g', - path: "m/84'/0'/0'/0/2", - transfers: 2, - balance: '0', - sent: '30807', - received: '30807', - }, - { - address: 'bc1q569v8dpu2w9mfy0vxch8zfcg68s782kvh0f5cr', - path: "m/84'/0'/0'/0/3", - transfers: 2, - balance: '0', - sent: '11433', - received: '11433', - }, - { - address: 'bc1qapt7c0lncw6w2lzh2c275d2zq6t4z7h38swaqv', - path: "m/84'/0'/0'/0/4", - transfers: 2, - balance: '0', - sent: '8410', - received: '8410', - }, - { - address: 'bc1qm8gyv254t3nf45x7wc2luwjlueymrlem9da40z', - path: "m/84'/0'/0'/0/5", - transfers: 2, - balance: '0', - sent: '489024', - received: '489024', - }, - { - address: 'bc1qn7kj622yfrn695qv9rqcaxpwlltnfynxd0zt0z', - path: "m/84'/0'/0'/0/6", - transfers: 2, - balance: '0', - sent: '20608', - received: '20608', - }, - { - address: 'bc1q9vj2rrrqxuqs6quzj9havx0mj9ctuhwykyzmcx', - path: "m/84'/0'/0'/0/7", - transfers: 2, - balance: '0', - sent: '2798', - received: '2798', - }, - { - address: 'bc1quk722fnq5rc30rc5xlc9w68zye8kwzv84k6lkz', - path: "m/84'/0'/0'/0/8", - transfers: 2, - balance: '0', - sent: '31391', - received: '31391', - }, - { - address: 'bc1q8de0s529sqvm660tk4df9j4z5jdcnsxafp2033', - path: "m/84'/0'/0'/0/9", - transfers: 2, - balance: '0', - sent: '61964', - received: '61964', - }, - { - address: 'bc1qfdr7yzhqmlltpwws5l9fr8f7h85mtq9pfcg9es', - path: "m/84'/0'/0'/0/10", - transfers: 2, - balance: '0', - sent: '110000', - received: '110000', - }, - { - address: 'bc1qhacn6m7usslzdvym7pynmerktep0e8a4ty35f9', - path: "m/84'/0'/0'/0/11", - transfers: 1, - balance: '138577', - sent: '0', - received: '138577', - }, - { - address: 'bc1qvslap5yajxcm67y2u3dacpxv2lcm4g962hlk5j', - path: "m/84'/0'/0'/0/12", - transfers: 1, - balance: '124579', - sent: '0', - received: '124579', - }, - ], - unused: [ - { - address: 'bc1qt448h2ye6zgmtanfemrge9wc9mrlnhyd9xaplw', - path: "m/84'/0'/0'/0/13", - transfers: 0, - }, - { - address: 'bc1qrlry5t94hunm3n987ed6ttmt3vec4w84s2r2ae', - path: "m/84'/0'/0'/0/14", - transfers: 0, - }, - { - address: 'bc1qu658qmq8qcz0fjpnfk83h03wgh3dl60jxktxtn', - path: "m/84'/0'/0'/0/15", - transfers: 0, - }, - { - address: 'bc1qrqtlsqmjea9tc4hrklg05ham8a5nvkpwtxqth0', - path: "m/84'/0'/0'/0/16", - transfers: 0, - }, - { - address: 'bc1q39xgkh7jdnh7ktg78agjpzf39fal44d080tqmf', - path: "m/84'/0'/0'/0/17", - transfers: 0, - }, - { - address: 'bc1qswfckxm5k4p7efv33kp4ler6l5lq52j4n0jkms', - path: "m/84'/0'/0'/0/18", - transfers: 0, - }, - { - address: 'bc1q4q8lnnr4n9kz223asxkzfw2692lke9n2vl2pw9', - path: "m/84'/0'/0'/0/19", - transfers: 0, - }, - { - address: 'bc1q885fl6xney7ngzuruy27ef0v45zl3ne3h48kzn', - path: "m/84'/0'/0'/0/20", - transfers: 0, - }, - { - address: 'bc1q23mcw6fe5snl6ekj3sayqfcp5hseqcxhqvyp7d', - path: "m/84'/0'/0'/0/21", - transfers: 0, - }, - { - address: 'bc1q8nl7j0gm3hfkms7uzafh7w20gs9c0pk6ta37zz', - path: "m/84'/0'/0'/0/22", - transfers: 0, - }, - { - address: 'bc1qel9ymh6htgc8p6e692240pw328lwpy6jweu57z', - path: "m/84'/0'/0'/0/23", - transfers: 0, - }, - { - address: 'bc1qerh39usxfkvucutm2jpjj6wqkj5w7e38e492yd', - path: "m/84'/0'/0'/0/24", - transfers: 0, - }, - { - address: 'bc1q9xl28t2azhv7nmpyg0tk4au0n5hje0v572k5gu', - path: "m/84'/0'/0'/0/25", - transfers: 0, - }, - { - address: 'bc1qawzfpzqumjjg6fwfmev6alxexxpv4qcvcqyu7k', - path: "m/84'/0'/0'/0/26", - transfers: 0, - }, - { - address: 'bc1qxcyd7qdgqu8sjxkg976paj62kfmh6f6m74hwcu', - path: "m/84'/0'/0'/0/27", - transfers: 0, - }, - { - address: 'bc1qtdphqhugra7efyzpjjlmm6qpqywpl4d6krw057', - path: "m/84'/0'/0'/0/28", - transfers: 0, - }, - { - address: 'bc1qahrpeqgpgfrz9fcvnn89zmjuayfdnw24e2a5hz', - path: "m/84'/0'/0'/0/29", - transfers: 0, - }, - { - address: 'bc1qajmj79dmeq6q34hewfacay48ynla6uja8sr8xz', - path: "m/84'/0'/0'/0/30", - transfers: 0, - }, - { - address: 'bc1qg8q94kvwerujw8uw2a0anprlm5cak899s9w0et', - path: "m/84'/0'/0'/0/31", - transfers: 0, - }, - { - address: 'bc1qcv30a4frpvr04ns9fqa8v5vv0u6ddtwhhskzm4', - path: "m/84'/0'/0'/0/32", - transfers: 0, - }, - ], - }, - history: { - addrTxCount: 53, - total: 26, - unconfirmed: 0, - transactions: [ - { - type: 'recv', - txid: 'c7a677368e3391b51880237522cde0f60cca83029ea0bb747507ffb673f47d26', - hex: '010000000001028f630a99bea05b73cf50912d8ad84ff5c2e7e6eddb2fc0a39229080c9f6757770100000000fdffffffd563440dcc851800064f6db858a8f88fa766c8d3a98e77653222cfb42e4884c30100000000fdffffff026592000000000000160014081d874b6bc8bf232f316241b49a5050dff33e28a3e6010000000000160014643fd0d09d91b1bd788ae45bdc04cc57f1baa0ba02483045022100ee49cc7d0b503a133fc256a39726c89498d7a3cd2fccae0e9458e5323d7955d202203e0665e5b312775dd1515f5a2211cbd1784034a4cc75be2e214292823f882309012102208549bd4c50b2fc358cbb9f28fbd4427fc5f06f75a17d57c43ddee6aebcc7380247304402202efd1fd461c8ddf244a02b8a6a2f6380dcdd681ec9cc1f4f24f35a2b21e684dd02200f6c49076b2feca5a6696f6c141ec222f6d30580fe8a2eb3339055cb02f88a260121031f15b5d66c3b6eea150c35a3ca6ec3c3fbb268f504ec638d76d3de3313537af700000000', - blockTime: 1698402008, - blockHeight: 814047, - blockHash: '00000000000000000000640e1a146dc74cef173a7feb8926cca43acad7000b85', - amount: '124579', - fee: '836', - vsize: 209, - feeRate: '4', - targets: [ - { - n: 1, - addresses: ['bc1qvslap5yajxcm67y2u3dacpxv2lcm4g962hlk5j'], - isAddress: true, - amount: '124579', - isAccountTarget: true, - }, - ], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: '7757679f0c082992a3c02fdbede6e7c2f54fd88a2d9150cf735ba0be990a638f', - vout: 1, - sequence: 4294967293, - n: 0, - addresses: ['bc1qet4d85kpw0tg4xwlp0q4fnxmyuuhy3t4nu05xl'], - isAddress: true, - value: '114147', - }, - { - txid: 'c384482eb4cf223265778ea9d3c866a78ff8a858b86d4f06001885cc0d4463d5', - vout: 1, - sequence: 4294967293, - n: 1, - addresses: ['bc1qckx26an6w8wagwjy50kn63ncww0kdl8pdsmvx6'], - isAddress: true, - value: '48745', - }, - ], - vout: [ - { - value: '37477', - n: 0, - hex: '0014081d874b6bc8bf232f316241b49a5050dff33e28', - addresses: ['bc1qpqwcwjmtezljxte3vfqmfxjs2r0lx03gsqgvjx'], - isAddress: true, - }, - { - value: '124579', - n: 1, - hex: '0014643fd0d09d91b1bd788ae45bdc04cc57f1baa0ba', - addresses: ['bc1qvslap5yajxcm67y2u3dacpxv2lcm4g962hlk5j'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - ], - size: 371, - totalInput: '162892', - totalOutput: '162056', - }, - }, - { - type: 'recv', - txid: '4bb76ff13fa81f9d127fa6d215f315d0d32770379b16663fbb99800f396809eb', - hex: '010000000001090a39b46ce86c54214ee39b330df960f9ee4b14cbacd355b96bb84f75f5d3d702a900000000ffffffff10961176df6f4072b458d81aa2bf99fbc5992451afaa121244a55d995b3fa70d9400000000ffffffff10961176df6f4072b458d81aa2bf99fbc5992451afaa121244a55d995b3fa70dc300000000ffffffff5e3edae1de94fa58f2a7e7ab79b670b0dc2cd79be33b40b7fc0a90d90f7f4f1af800000000ffffffff5a35fb939a72d11f17ae8666f4f3c8236e012bfa07a5e8e9fafc771895270942a300000000ffffffff5a35fb939a72d11f17ae8666f4f3c8236e012bfa07a5e8e9fafc771895270942bd00000000ffffffff5a35fb939a72d11f17ae8666f4f3c8236e012bfa07a5e8e9fafc771895270942c000000000ffffffff5a35fb939a72d11f17ae8666f4f3c8236e012bfa07a5e8e9fafc771895270942ef00000000ffffffff5a35fb939a72d11f17ae8666f4f3c8236e012bfa07a5e8e9fafc7718952709421001000000ffffffff01511d020000000000160014bf713d6fdc843e26b09bf0493de4765e42fc9fb5014060e4c336ea9b03d19a8e735d10ef7781d54ee4290a861cf74c98d99ddf1e7b460fae69c7f2f610ae8769103ceeb9e645aa683b5d35f239688b4bf9c78dfe54570140752801247d4034f9c1a7d5ad89c16a83b660b85940f6dc016c0911155477ee2888f12f4d4aeff421422bda77b633920290a6328610c40eaf534ec7acb59d918a01402bf194ffb0eefe4e54a2bcf8e504aee9ba6db428f7e3334590aced1d3c0cf5fdd581060e5cd34289405f50d4e0b7c65ce97a94487c4a20ec0c4735d757c9b06901400628f4cee31eb4f287a80ecbecfd70ee0b27189658643fbc03711457564411c95588340cea6b0469732bcd92350f8543ca203751d5efe0ac547e28de6e1ebc5c0140e6a057bd75e03ee80d49d12bd0f8e674c201ac2cd1868a1f659762fb2739c6888d6fc836c8b99e267987a1e6cd9361b0a3289e7c4a59793353d4fa77182b57b901408f61ee6c9b98b54eb82cfd54ce24950d1cadaeaeb082630f4c9009bc406b31b83d874b45f1cd231cc55f11b2b671c9087633ed58af24126aaa05f016e1fba46e0140ca8cd0bf5def25bf8319a6dd8045d4ba043f83fc7e64cf8ead9e7b1cf7a72699ee66aa146d34c9ae31bd77a7cc458214f4d1a276ad0e664de4d08538b16f81a501402176608b1015bad8b03ba8f6f8054ee098486e9df5708c8e49f0f2d2ec9abf1d30a8911b7f46679339b0a39b64e9cdac390e5e7329e565ba5a93bee56414e8610140167c8c73a23d535c12b18faec63090c476664e2a31f941d79e93903bec2f52080618f3248013480745a015c31457ee105fcf69fe73d409870c70c58b039e33ad00000000', - blockTime: 1694515520, - blockHeight: 807321, - blockHash: '00000000000000000001e773bcd9163ef84a4c00b8c4f9766de14ee80e4ab75e', - amount: '138577', - fee: '8944', - vsize: 559, - feeRate: '16', - targets: [ - { - n: 0, - addresses: ['bc1qhacn6m7usslzdvym7pynmerktep0e8a4ty35f9'], - isAddress: true, - amount: '138577', - isAccountTarget: true, - }, - ], - tokens: [], - internalTransfers: [], - details: { - vin: [ - { - txid: '02d7d3f5754fb86bb955d3accb144beef960f90d339be34e21546ce86cb4390a', - vout: 169, - sequence: 4294967295, - n: 0, - addresses: [ - 'bc1pvjt5t3k4zknqxxh2hsf8xq2mayadhgzkphe6vduqarnapajmlakshc79ag', - ], - isAddress: true, - value: '20000', - }, - { - txid: '0da73f5b995da5441212aaaf512499c5fb99bfa21ad858b472406fdf76119610', - vout: 148, - sequence: 4294967295, - n: 1, - addresses: [ - 'bc1p5gakveh2zfk662ecyzysyc32aht46jd8dg47za0grj3a6mug0fpshtct4w', - ], - isAddress: true, - value: '20000', - }, - { - txid: '0da73f5b995da5441212aaaf512499c5fb99bfa21ad858b472406fdf76119610', - vout: 195, - sequence: 4294967295, - n: 2, - addresses: [ - 'bc1ps8uyq2m3weswxw2naxwzv2smam746lhrhrg35xs2357a06hqr96smjrgkk', - ], - isAddress: true, - value: '8192', - }, - { - txid: '1a4f7f0fd9900afcb7403be39bd72cdcb070b679abe7a7f258fa94dee1da3e5e', - vout: 248, - sequence: 4294967295, - n: 3, - addresses: [ - 'bc1pan5f46twn4aw22fxn4ukhcsy8hrnnqwfk9h2jglfljty2zuxxpnqw3eyr4', - ], - isAddress: true, - value: '10000', - }, - { - txid: '420927951877fcfae9e8a507fa2b016e23c8f3f46686ae171fd1729a93fb355a', - vout: 163, - sequence: 4294967295, - n: 4, - addresses: [ - 'bc1psm8v3aqsl76mejq2dnpkx98n5ktwfaqtssvpsg5paplneyy9v64shpmwzd', - ], - isAddress: true, - value: '32768', - }, - { - txid: '420927951877fcfae9e8a507fa2b016e23c8f3f46686ae171fd1729a93fb355a', - vout: 189, - sequence: 4294967295, - n: 5, - addresses: [ - 'bc1p5qgscx6cc9f7820yvdwavqx8gmqa0j5s6uyh4jnxduaryyjsa20qg8z55l', - ], - isAddress: true, - value: '20000', - }, - { - txid: '420927951877fcfae9e8a507fa2b016e23c8f3f46686ae171fd1729a93fb355a', - vout: 192, - sequence: 4294967295, - n: 6, - addresses: [ - 'bc1pezl4cmm67l9m7e4cp92ztwcwly60p94sd6uhk6hvdmf7zescry6q8qqcul', - ], - isAddress: true, - value: '20000', - }, - { - txid: '420927951877fcfae9e8a507fa2b016e23c8f3f46686ae171fd1729a93fb355a', - vout: 239, - sequence: 4294967295, - n: 7, - addresses: [ - 'bc1p3ftsehy9m65hmhhypgus3ctws5hmpm3rqmj8899dvw83xgufvk3sgt77dg', - ], - isAddress: true, - value: '10000', - }, - { - txid: '420927951877fcfae9e8a507fa2b016e23c8f3f46686ae171fd1729a93fb355a', - vout: 272, - sequence: 4294967295, - n: 8, - addresses: [ - 'bc1pkhagxsv0jlhqxftwnnxdyu3c24jmntsqqq4cd52mhdz2ze52trmsvlu2p7', - ], - isAddress: true, - value: '6561', - }, - ], - vout: [ - { - value: '138577', - n: 0, - hex: '0014bf713d6fdc843e26b09bf0493de4765e42fc9fb5', - addresses: ['bc1qhacn6m7usslzdvym7pynmerktep0e8a4ty35f9'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - ], - size: 1006, - totalInput: '147521', - totalOutput: '138577', - }, - }, - { - type: 'sent', - txid: 'f7e8570d9770927e02d82012788483b5ba53df6c5321bba2bed657732c1fd74e', - hex: '020000000001029d515d0e816d1b2053343eb50a2c7a8f0ad86ce7099493176ed986d141f2c9f7010000000000000000e482f09db0f7ee048c24e804d8c38063442aee31169e33fd0a879c9527a0209d0000000000000000000260ea00000000000017a91498dfd8bb88b3c9a7898a1f793783772fd4a914df876818000000000000160014362268f2a630e12801b4486c346b949cb9b020c302483045022100b405ad8b10d3e595c0dbc3e377b3fcc46f0829b6c9f5e448bc7cdfd46295911d02205c443aa7ce54951486c0e3791195e866b185fe9a16322283bd1125afd099b518012103e47d5b705779280fe0d73b0d2b086a3784c137dc9097d68aa12fa4229523780e02473044022046cc1f31c6481cb40383abc8a21c10ee20f4dbf6fb4a0834a070c8fec51059a002204341c85e964aa8bffcc2594d05585e33cbbec102a02c8333b9f585623067170d012103db0f60aa416edc4f611ab4e043c059b4dea64c24352ba9c4aa0caba5c02793bb00000000', - blockTime: 1694466639, - blockHeight: 807236, - blockHash: '00000000000000000002a4d9ecfd0c8bcd8b08aed453d3c6fba68ef9bb856d3c', - amount: '60000', - fee: '2926', - vsize: 210, - feeRate: '13.93', - targets: [ - { - n: 0, - addresses: ['3FdLnqWdpZQBL3Ku5rjEqVRCAjXPHNk9bF'], - isAddress: true, - amount: '60000', - }, - ], - tokens: [], - internalTransfers: [], - details: { - vin: [ - { - txid: 'f7c9f241d186d96e17939409e76cd80a8f7a2c0ab53e3453201b6d810e5d519d', - vout: 1, - n: 0, - addresses: ['bc1qnx3gypazcwf2u9gmpgdjt0ujmy9apc4nn57nt2'], - isAddress: true, - isOwn: true, - value: '30899', - isAccountOwned: true, - }, - { - txid: '9d20a027959c870afd339e1631ee2a446380c3d804e8248c04eef7b09df082e4', - n: 1, - addresses: ['bc1qp4u0adgvrd83lyte6ewcgd3kj4u0fcd34ysmz8'], - isAddress: true, - isOwn: true, - value: '38275', - isAccountOwned: true, - }, - ], - vout: [ - { - value: '60000', - n: 0, - spent: true, - spentTxId: - 'baf0c48a15639a7323d1dee5911ec49bf1a76d54561a66de7ab9055aa1a0e593', - spentHeight: 807238, - hex: 'a91498dfd8bb88b3c9a7898a1f793783772fd4a914df87', - addresses: ['3FdLnqWdpZQBL3Ku5rjEqVRCAjXPHNk9bF'], - isAddress: true, - }, - { - value: '6248', - n: 1, - hex: '0014362268f2a630e12801b4486c346b949cb9b020c3', - addresses: ['bc1qxc3x3u4xxrsjsqd5fpkrg6u5njumqgxr8h3knt'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - ], - size: 372, - totalInput: '69174', - totalOutput: '66248', - }, - }, - { - type: 'sent', - txid: '9d20a027959c870afd339e1631ee2a446380c3d804e8248c04eef7b09df082e4', - hex: '010000000001019d515d0e816d1b2053343eb50a2c7a8f0ad86ce7099493176ed986d141f2c9f70000000000fdffffff0283950000000000001600140d78feb50c1b4f1f9179d65d8436369578f4e1b13312010000000000225120525d82bd65dca93aa0ec69b55d6a184ed6733c9468b44c89101bb125d342e5400248304502210086cfff94a9d9254733c4dc1708d7d19ebf4a6f4980c88c056b28d8fd782fa53a022055c2d2ff4edb559e0b9f8f24d450535daa5797149491420526952a3bb9f7443e01210394e7a86ae7899141ab33f13bae6d6b517bd4ac1e8aa2d75bba4ba9f0c2f4e9f900000000', - blockTime: 1680694226, - blockHeight: 784046, - blockHash: '000000000000000000002e0d8e1543711aa265c06fa20e82d78ad1397d9cdf93', - amount: '70195', - fee: '1530', - vsize: 153, - feeRate: '10', - targets: [ - { - n: 1, - addresses: [ - 'bc1p2fwc90t9mj5n4g8vdx6466scfmt8x0y5dz6yezgsrwcjt56zu4qqme6nry', - ], - isAddress: true, - amount: '70195', - }, - ], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: 'f7c9f241d186d96e17939409e76cd80a8f7a2c0ab53e3453201b6d810e5d519d', - sequence: 4294967293, - n: 0, - addresses: ['bc1qfdr7yzhqmlltpwws5l9fr8f7h85mtq9pfcg9es'], - isAddress: true, - isOwn: true, - value: '110000', - isAccountOwned: true, - }, - ], - vout: [ - { - value: '38275', - n: 0, - spent: true, - spentTxId: - 'f7e8570d9770927e02d82012788483b5ba53df6c5321bba2bed657732c1fd74e', - spentIndex: 1, - spentHeight: 807236, - hex: '00140d78feb50c1b4f1f9179d65d8436369578f4e1b1', - addresses: ['bc1qp4u0adgvrd83lyte6ewcgd3kj4u0fcd34ysmz8'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - { - value: '70195', - n: 1, - spent: true, - spentTxId: - '02d7d3f5754fb86bb955d3accb144beef960f90d339be34e21546ce86cb4390a', - spentIndex: 155, - spentHeight: 786113, - hex: '5120525d82bd65dca93aa0ec69b55d6a184ed6733c9468b44c89101bb125d342e540', - addresses: [ - 'bc1p2fwc90t9mj5n4g8vdx6466scfmt8x0y5dz6yezgsrwcjt56zu4qqme6nry', - ], - isAddress: true, - }, - ], - size: 235, - totalInput: '110000', - totalOutput: '108470', - }, - }, - { - type: 'joint', - txid: 'f7c9f241d186d96e17939409e76cd80a8f7a2c0ab53e3453201b6d810e5d519d', - hex: '02000000000104fc010735320cd926e548fbbb78c96757af37f5f4734d8b79a0ab24cf9cc107190000000000fdffffff06d974d60cb70a4b257edb49d4e2995a87f843c203e28390d89b817d8b42da020000000017160014c2054b73d83d718da052c918c148e7478c3a4827fdffffffbb491eaef6969a0b4956d8a3b7f271deb1f89f4f4d53b008e05f3c5de8b6ccb80000000000fdfffffface1e18e23039f9d1748bed70d2d414cc80c93aca93599f3f03351fa249a52c60000000000fdffffff02b0ad0100000000001600144b47e20ae0dffeb0b9d0a7ca919d3eb9e9b580a1b37800000000000016001499a28207a2c392ae151b0a1b25bf92d90bd0e2b3024830450221008ba355e38b406b242f3229b2148f1df40c29f580a64c10a9406f94d41ac8a917022025c94f3c517107689ffdb531934320de6dfb95780bc4c2fdec25601dbb712f2401210347927f6022fb727ca47edf7081c34bebd83ef17bff987e4e12ebb3f14753a7be02483045022100a03af84e089a819b430d8b03d61532d3165cd25dbc49f3d964989030a38541aa0220688b77e2f16247c0636f9193b7f76efc5b577abaf369795c71f2a8fc61f2aaca01210219cde6d2fd75a962db09f972f861596c9ec0fd79793941b0ddeddd17bc19fa1602483045022100c0f9cf5d0ed103c99dd5b24a3000d8e2e5b8cda1aa492381f6955edef8f7e4cb02202b57fef43fbc61ecb34399c8708b93861727b79bd959694b853bea0bbf992b58012103c48d387af7bc3b6da370465bb2749ec12c705ea6b1b0fd789af30b3b76ea784302483045022100b886c9bac90450bfb53257f341e10669bb45662a6c6d2f2a00ae51894015163b02200e7e893c4684138c4cc036c0241a376170aa4e1edf978b21d02f88c66e6325680121031844841c87c4edffb29165090f906a5beeade32ecb4ffb127878dc30d89c963100000000', - blockTime: 1680515463, - blockHeight: 783739, - blockHash: '000000000000000000048c58d1080ca97e124d0b34e923695bc4c1bc3b310086', - amount: '97913', - fee: '2583', - vsize: 368, - feeRate: '7.02', - targets: [], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: '1907c19ccf24aba0798b4d73f4f537af5767c978bbfb48e526d90c32350701fc', - sequence: 4294967293, - n: 0, - addresses: ['bc1qn7kj622yfrn695qv9rqcaxpwlltnfynxd0zt0z'], - isAddress: true, - isOwn: true, - value: '20608', - isAccountOwned: true, - }, - { - txid: '02da428b7d819bd89083e203c243f8875a99e2d449db7e254b0ab70cd674d906', - sequence: 4294967293, - n: 1, - addresses: ['3QWhTErhEM4C78DNiSaTK18P79NbRbrMw7'], - isAddress: true, - value: '100496', - hex: '160014c2054b73d83d718da052c918c148e7478c3a4827', - }, - { - txid: 'b8ccb6e85d3c5fe008b0534d4f9ff8b1de71f2b7a3d856490b9a96f6ae1e49bb', - sequence: 4294967293, - n: 2, - addresses: ['bc1qt5mjvp7nt4lpq77s4c3trvyre2smtcxz4zmmjs'], - isAddress: true, - isOwn: true, - value: '19580', - isAccountOwned: true, - }, - { - txid: 'c6529a24fa5133f0f39935a9ac930cc84c412d0dd7be48179d9f03238ee1e1ac', - sequence: 4294967293, - n: 3, - addresses: ['bc1q9vj2rrrqxuqs6quzj9havx0mj9ctuhwykyzmcx'], - isAddress: true, - isOwn: true, - value: '2798', - isAccountOwned: true, - }, - ], - vout: [ - { - value: '110000', - n: 0, - spent: true, - spentTxId: - '9d20a027959c870afd339e1631ee2a446380c3d804e8248c04eef7b09df082e4', - spentHeight: 784046, - hex: '00144b47e20ae0dffeb0b9d0a7ca919d3eb9e9b580a1', - addresses: ['bc1qfdr7yzhqmlltpwws5l9fr8f7h85mtq9pfcg9es'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - { - value: '30899', - n: 1, - spent: true, - spentTxId: - 'f7e8570d9770927e02d82012788483b5ba53df6c5321bba2bed657732c1fd74e', - spentHeight: 807236, - hex: '001499a28207a2c392ae151b0a1b25bf92d90bd0e2b3', - addresses: ['bc1qnx3gypazcwf2u9gmpgdjt0ujmy9apc4nn57nt2'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - ], - size: 693, - totalInput: '143482', - totalOutput: '140899', - }, - }, - { - type: 'sent', - txid: 'b8ccb6e85d3c5fe008b0534d4f9ff8b1de71f2b7a3d856490b9a96f6ae1e49bb', - hex: '010000000001026e5c4a0bdb38857525c6f23859f3d0f982569a29c4df42b398aa80741aa0c6850000000000fdffffffc22a43cc03d322e59cc5163d825313239bf8901dd4db05540d31352fff0e97c90000000000fdffffff027c4c0000000000001600145d372607d35d7e107bd0ae22b1b083caa1b5e0c2ab9c000000000000160014faa6bd82b2f82885029101cb8f27cd57a11a432502473044022006aed2c3791c1061bfa3c86c3af030a0c15bf3874ba95458e5ad38300a337dae02206b9f4389b7c7e2103f9686799178d720a4d34afd3e418daaa104a3e387d1d9fa012102306443a5d7796ee7fd186bed9764e32bc1cbf68996a893327705d195d71ff26b02483045022100834337e78d57d2221e5be4128b738189ac1da3eeb930e85d6a8ff9b3e1b20356022002d8afe4610db8fe2d5a06b0e286e071cc3185e4c8787b111d0607653d6ee69e0121033c28cdd727e05dbb70ce4e767f60076de8960ad021ba6563006501075de834eb00000000', - blockTime: 1679482960, - blockHeight: 781958, - blockHash: '00000000000000000003111b544a1ed4663b2a0597dfa8420b2d2970226cdd1d', - amount: '40107', - fee: '2926', - vsize: 209, - feeRate: '14', - targets: [ - { - n: 1, - addresses: ['bc1ql2ntmq4jlq5g2q53q89c7f7d27s35se96jq6kw'], - isAddress: true, - amount: '40107', - }, - ], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: '85c6a01a7480aa98b342dfc4299a5682f9d0f35938f2c625758538db0b4a5c6e', - sequence: 4294967293, - n: 0, - addresses: ['bc1qj477aj92qsttes0c5kgw9u4avkjh8w46kpf2ae'], - isAddress: true, - isOwn: true, - value: '24800', - isAccountOwned: true, - }, - { - txid: 'c9970eff2f35310d5405dbd41d90f89b231353823d16c59ce522d303cc432ac2', - sequence: 4294967293, - n: 1, - addresses: ['bc1qqrueed2uvj42qql0qmn2rhwpum3k6mrhflc98f'], - isAddress: true, - isOwn: true, - value: '37813', - isAccountOwned: true, - }, - ], - vout: [ - { - value: '19580', - n: 0, - spent: true, - spentTxId: - 'f7c9f241d186d96e17939409e76cd80a8f7a2c0ab53e3453201b6d810e5d519d', - spentIndex: 2, - spentHeight: 783739, - hex: '00145d372607d35d7e107bd0ae22b1b083caa1b5e0c2', - addresses: ['bc1qt5mjvp7nt4lpq77s4c3trvyre2smtcxz4zmmjs'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - { - value: '40107', - n: 1, - spent: true, - spentTxId: - '017889b069d3baa1dd6c3f455619b92dbb22c4d403ba3e63605aa2bcb477f715', - spentHeight: 781960, - hex: '0014faa6bd82b2f82885029101cb8f27cd57a11a4325', - addresses: ['bc1ql2ntmq4jlq5g2q53q89c7f7d27s35se96jq6kw'], - isAddress: true, - }, - ], - size: 371, - totalInput: '62613', - totalOutput: '59687', - }, - }, - { - type: 'sent', - txid: 'c9970eff2f35310d5405dbd41d90f89b231353823d16c59ce522d303cc432ac2', - hex: '01000000000101380022e28490f72f9bbc4762abef652bd307e56f3133605f5c18f90b1d97193b0100000000fdffffff02b59300000000000016001400f99cb55c64aaa003ef06e6a1ddc1e6e36d6c77368b01000000000022512079b41b262fba5106a9ae5b7add5d693aa3b6b1c6eea0090e262bfe2ca88459c602483045022100f172c5300045022408c545de789a654a8ab29f17fd0dc8aacf5c3c3a8c0da5d90220051a36eb0ca92c8f8bcb7c8127feaf77e38d17a826e181533999c61f9b3f6f7f0121036c551b93b49c8781332021e81bd0d29042d531808eb0dcd070d76a5386357cdc00000000', - blockTime: 1678187959, - blockHeight: 779723, - blockHash: '00000000000000000004628fb5258215350f427e1d9a91f68d54e668a61da01e', - amount: '101174', - fee: '3060', - vsize: 153, - feeRate: '20', - targets: [ - { - n: 1, - addresses: [ - 'bc1p0x6pkf30hfgsd2dwtdad6htf823mdvwxa6sqjr3x90lze2yyt8rquu87jv', - ], - isAddress: true, - amount: '101174', - }, - ], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: '3b19971d0bf9185c5f6033316fe507d32b65efab6247bc9b2ff79084e2220038', - vout: 1, - sequence: 4294967293, - n: 0, - addresses: ['bc1q7uupvkequzlh3twll87prax2nxy5m5leynl5yn'], - isAddress: true, - isOwn: true, - value: '142047', - isAccountOwned: true, - }, - ], - vout: [ - { - value: '37813', - n: 0, - spent: true, - spentTxId: - 'b8ccb6e85d3c5fe008b0534d4f9ff8b1de71f2b7a3d856490b9a96f6ae1e49bb', - spentIndex: 1, - spentHeight: 781958, - hex: '001400f99cb55c64aaa003ef06e6a1ddc1e6e36d6c77', - addresses: ['bc1qqrueed2uvj42qql0qmn2rhwpum3k6mrhflc98f'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - { - value: '101174', - n: 1, - spent: true, - spentTxId: - 'f08445e4e9443045a2fbf3453d6c78543000e70a90b87e380758b298872d691d', - spentIndex: 198, - spentHeight: 779733, - hex: '512079b41b262fba5106a9ae5b7add5d693aa3b6b1c6eea0090e262bfe2ca88459c6', - addresses: [ - 'bc1p0x6pkf30hfgsd2dwtdad6htf823mdvwxa6sqjr3x90lze2yyt8rquu87jv', - ], - isAddress: true, - }, - ], - size: 235, - totalInput: '142047', - totalOutput: '138987', - }, - }, - { - type: 'sent', - txid: '3b19971d0bf9185c5f6033316fe507d32b65efab6247bc9b2ff79084e2220038', - hex: '01000000000101a15d73425bc1df20448eabb73d6c971a0577701e82fc5d4227ecf63971d516320100000000fdffffff0298c400000000000022002051e9b6a96e48ecebb410a16bd9f71dca79e37b4dd5fb3247be4767cf47a6db58df2a020000000000160014f738165b20e0bf78addff9fc11f4ca99894dd3f902483045022100fcd0f8aacaf03831f2ef0bfd7b055d59fb26bf714ff862e6c13dcc349b8d7ce00220570b372adc6d5c6375fe46a834d4551ec740a4cea42aef11ffceb3c9becdcfa501210202b60cad353c4953ef2b18950d56047976fd2a08cfc8d33201e608b4d523bdbb00000000', - blockTime: 1678101937, - blockHeight: 779581, - blockHash: '0000000000000000000029b84ba6aa21b42c302c01dd12ca00aef75c3428b527', - amount: '50328', - fee: '1836', - vsize: 153, - feeRate: '12', - targets: [ - { - n: 0, - addresses: [ - 'bc1q285md2twfrkwhdqs594anacaefu7x76d6hany3a7ganu73axmdvqc42dng', - ], - isAddress: true, - amount: '50328', - }, - ], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: '3216d57139f6ec27425dfc821e7077051a976c3db7ab8e4420dfc15b42735da1', - vout: 1, - sequence: 4294967293, - n: 0, - addresses: ['bc1qx89rjquukmfgpxa5y0gmaqvuhhr7flychflhc4'], - isAddress: true, - isOwn: true, - value: '194211', - isAccountOwned: true, - }, - ], - vout: [ - { - value: '50328', - n: 0, - spent: true, - spentTxId: - 'c1db7ead350be3eb81823ec809ec206b397b7e823754238ec13d9e87189c8c5e', - spentIndex: 4, - spentHeight: 789283, - hex: '002051e9b6a96e48ecebb410a16bd9f71dca79e37b4dd5fb3247be4767cf47a6db58', - addresses: [ - 'bc1q285md2twfrkwhdqs594anacaefu7x76d6hany3a7ganu73axmdvqc42dng', - ], - isAddress: true, - }, - { - value: '142047', - n: 1, - spent: true, - spentTxId: - 'c9970eff2f35310d5405dbd41d90f89b231353823d16c59ce522d303cc432ac2', - spentHeight: 779723, - hex: '0014f738165b20e0bf78addff9fc11f4ca99894dd3f9', - addresses: ['bc1q7uupvkequzlh3twll87prax2nxy5m5leynl5yn'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - ], - size: 235, - totalInput: '194211', - totalOutput: '192375', - }, - }, - { - type: 'recv', - txid: '3216d57139f6ec27425dfc821e7077051a976c3db7ab8e4420dfc15b42735da1', - hex: '020000000001016e5c4a0bdb38857525c6f23859f3d0f982569a29c4df42b398aa80741aa0c6850100000000ffffffff02cf090000000000001600146a9c1084ff561a298cfaf3e4a0e59bb9c9d04eada3f602000000000016001431ca39039cb6d2809bb423d1be819cbdc7e4fc98040047304402203547dc0ac248dcae4f85ba611f917cf83b35338bb923ea39360cffe4b439a22e02202ca8e86b1d60ecfa67e468a5c5b5d32baa28431a05afa3b11a20ae3a6dd4a0f10147304402202db372e2ed907630c858f1bf2e907a96592c46a1cb85dd8aa37bdadb14cd50c902205ab0fe616e7515aa43d3ba94e77eead564ca6370349c9789e4ab031848f4c2a101475221031b2071ec55090b22d921d631333f7a10e076c9a2282a2bdc0707ce3ed0b572df21038f9ac250ea00ceb876cd3c89bb6efc7e25f3f8533b9857830b162775ccfc3f0252ae00000000', - blockTime: 1677839961, - blockHeight: 779104, - blockHash: '00000000000000000005fee975c65305f2f5f5ff81a10ea9751fd47c435737a0', - amount: '194211', - fee: '3278', - vsize: 168, - feeRate: '19.51', - targets: [ - { - n: 1, - addresses: ['bc1qx89rjquukmfgpxa5y0gmaqvuhhr7flychflhc4'], - isAddress: true, - amount: '194211', - isAccountTarget: true, - }, - ], - tokens: [], - internalTransfers: [], - details: { - vin: [ - { - txid: '85c6a01a7480aa98b342dfc4299a5682f9d0f35938f2c625758538db0b4a5c6e', - vout: 1, - sequence: 4294967295, - n: 0, - addresses: [ - 'bc1qvfhr9tywxrzahnujcnpgnv229z6nmh4pmrsntj3gua0a402mlnqsh9nuph', - ], - isAddress: true, - value: '200000', - }, - ], - vout: [ - { - value: '2511', - n: 0, - spent: true, - spentTxId: - '21c646e07354157945ef124f3b35522c3f59e58d44ecb5984ba27ecf6d99f261', - spentIndex: 13, - spentHeight: 782836, - hex: '00146a9c1084ff561a298cfaf3e4a0e59bb9c9d04ead', - addresses: ['bc1qd2wppp8l2cdznr8670j2pevmh8yaqn4dln6snn'], - isAddress: true, - }, - { - value: '194211', - n: 1, - spent: true, - spentTxId: - '3b19971d0bf9185c5f6033316fe507d32b65efab6247bc9b2ff79084e2220038', - spentHeight: 779581, - hex: '001431ca39039cb6d2809bb423d1be819cbdc7e4fc98', - addresses: ['bc1qx89rjquukmfgpxa5y0gmaqvuhhr7flychflhc4'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - ], - size: 333, - totalInput: '200000', - totalOutput: '196722', - }, - }, - { - type: 'sent', - txid: '85c6a01a7480aa98b342dfc4299a5682f9d0f35938f2c625758538db0b4a5c6e', - hex: '02000000000103f73998995cf8016e10b0ca663e77d9e4ca3a8a36332b3dccb7f9a46f2c257f720000000000feffffffe7b016ebafffa606f43771105ccab04dedb883f6a6bae867dbaaf33fb3919c9a0000000000feffffffb075e38bf10dea4d6a50ded51d75f5cc1095d95012a945184c24a54b7ea647e10000000000feffffff02e060000000000000160014957deec8aa0416bcc1f8a590e2f2bd65a573baba400d030000000000220020626e32ac8e30c5dbcf92c4c289b14a28b53ddea1d8e135ca28e75fdabd5bfcc1024830450221008d9de906d1ee6a8c63907af93e691167297af2bd4880fbc0c75dd67f50ce206302201596e29da77af9536c9fd38c2a36c8ce917e53da4170104fa1532663977f997b0121023ee0b49539cf5c377d839898536fb0a674ac2def3d0ef387bd04bc8fed5194a102483045022100a7b914f5ce1c02a06ba3fca0a06044863521c6d18ba16ee9d30ff177131a2f05022050563218860c3c3a626709f5697d648eda66339fcddeaff738a1a30bc56413730121026799042915cc9a3a42a63cabbb692da03e0728994835c453a594b83f0b1f5ab502483045022100f880af70de523acfbfe0cae6dbec3eff5efd721edb283b559881fda47cb0895a0220795aebe021926e3a9abe57775385cc6c90c3e6a6874bb24b8b2d3b829b9ec51e012103e71f90b80f03af5110bf2d6345191c04987660c870ed4208155de3acdd9271ba18d50b00', - blockTime: 1675784738, - blockHeight: 775449, - blockHash: '00000000000000000000a296cd481886ab5b3bdb3f06e21d47148e90a751e25b', - lockTime: 775448, - amount: '200000', - fee: '2355', - vsize: 289, - feeRate: '8.15', - targets: [ - { - n: 1, - addresses: [ - 'bc1qvfhr9tywxrzahnujcnpgnv229z6nmh4pmrsntj3gua0a402mlnqsh9nuph', - ], - isAddress: true, - amount: '200000', - }, - ], - tokens: [], - internalTransfers: [], - details: { - vin: [ - { - txid: '727f252c6fa4f9b7cc3d2b33368a3acae4d9773e66cab0106e01f85c999839f7', - sequence: 4294967294, - n: 0, - addresses: ['bc1quk722fnq5rc30rc5xlc9w68zye8kwzv84k6lkz'], - isAddress: true, - isOwn: true, - value: '31391', - isAccountOwned: true, - }, - { - txid: '9a9c91b33ff3aadb67e8baa6f683b8ed4db0ca5c107137f406a6ffafeb16b0e7', - sequence: 4294967294, - n: 1, - addresses: ['bc1q8de0s529sqvm660tk4df9j4z5jdcnsxafp2033'], - isAddress: true, - isOwn: true, - value: '61964', - isAccountOwned: true, - }, - { - txid: 'e147a67e4ba5244c1845a91250d99510ccf5751dd5de506a4dea0df18be375b0', - sequence: 4294967294, - n: 2, - addresses: ['bc1qvgq6anu0eyqaln06jzd0ljf8qt6sh26xaehyf6'], - isAddress: true, - isOwn: true, - value: '133800', - isAccountOwned: true, - }, - ], - vout: [ - { - value: '24800', - n: 0, - spent: true, - spentTxId: - 'b8ccb6e85d3c5fe008b0534d4f9ff8b1de71f2b7a3d856490b9a96f6ae1e49bb', - spentHeight: 781958, - hex: '0014957deec8aa0416bcc1f8a590e2f2bd65a573baba', - addresses: ['bc1qj477aj92qsttes0c5kgw9u4avkjh8w46kpf2ae'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - { - value: '200000', - n: 1, - spent: true, - spentTxId: - '3216d57139f6ec27425dfc821e7077051a976c3db7ab8e4420dfc15b42735da1', - spentHeight: 779104, - hex: '0020626e32ac8e30c5dbcf92c4c289b14a28b53ddea1d8e135ca28e75fdabd5bfcc1', - addresses: [ - 'bc1qvfhr9tywxrzahnujcnpgnv229z6nmh4pmrsntj3gua0a402mlnqsh9nuph', - ], - isAddress: true, - }, - ], - size: 533, - totalInput: '227155', - totalOutput: '224800', - }, - }, - { - type: 'sent', - txid: 'e147a67e4ba5244c1845a91250d99510ccf5751dd5de506a4dea0df18be375b0', - hex: '02000000000101db7226648d11ccd906b9514b50adcea289fb3b83f8fc6314bc7515ceaf1892b60100000000fdffffff02a80a0200000000001600146201aecf8fc901dfcdfa909affc92702f50bab4690d0030000000000160014bfd229be6cabf111ca3722078168e36c789a477d02483045022100eaf36792d0e8c95874702e05d49ac235a7a031ba5700ed77ffd422d0b5cd994902206dca0bf783a4038bc0037b1d40fa9cdc2ec5f79923bdbbd913e74c470b7b9ea7012102178fc506a986d95a6b118a22eb1e414e7fa050391966ff35123885f7660aded4c0d00b00', - blockTime: 1675087005, - blockHeight: 774339, - blockHash: '00000000000000000006d3423ed87843cf4cf4563d079ed798cb3e2a0666daf3', - lockTime: 774336, - amount: '250000', - fee: '182', - vsize: 141, - feeRate: '1.29', - targets: [ - { - n: 1, - addresses: ['bc1qhlfzn0nv40c3rj3hygrcz68rd3uf53makrw3wu'], - isAddress: true, - amount: '250000', - }, - ], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: 'b69218afce1575bc1463fcf8833bfb89a2cead504b51b906d9cc118d642672db', - vout: 1, - sequence: 4294967293, - n: 0, - addresses: ['bc1q5znx6jmsy740wp66t5meau44jux4ek7hp9x3k0'], - isAddress: true, - isOwn: true, - value: '383982', - isAccountOwned: true, - }, - ], - vout: [ - { - value: '133800', - n: 0, - spent: true, - spentTxId: - '85c6a01a7480aa98b342dfc4299a5682f9d0f35938f2c625758538db0b4a5c6e', - spentIndex: 2, - spentHeight: 775449, - hex: '00146201aecf8fc901dfcdfa909affc92702f50bab46', - addresses: ['bc1qvgq6anu0eyqaln06jzd0ljf8qt6sh26xaehyf6'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - { - value: '250000', - n: 1, - spent: true, - spentTxId: - 'a3ead64609f5684d115eed1a7ed1169721edb4582a22233b2b07288501eef3bd', - spentHeight: 774356, - hex: '0014bfd229be6cabf111ca3722078168e36c789a477d', - addresses: ['bc1qhlfzn0nv40c3rj3hygrcz68rd3uf53makrw3wu'], - isAddress: true, - }, - ], - size: 223, - totalInput: '383982', - totalOutput: '383800', - }, - }, - { - type: 'recv', - txid: '9a9c91b33ff3aadb67e8baa6f683b8ed4db0ca5c107137f406a6ffafeb16b0e7', - hex: '02000000000101db7226648d11ccd906b9514b50adcea289fb3b83f8fc6314bc7515ceaf1892b60000000000fdffffff010cf20000000000001600143b72f851458019bd69ebb55a92caa2a49b89c0dd0400473044022069fd5b54c95e07c95b5c75c27559c9c73df90b5415130dfe4c50e0a0a1ff130f0220744fd50ecf41f5a2b24a864fb1760984bc0771c5bea58d2d0826163f84e1a3c901473044022056d5833c3310b5c541d821d226d8094ce73d117b18069b41d3e8734799e2e031022049d4da1167e5ced72f9cf89536fc38f5efc484adbb0378dc02e13955d451b03a0147522102ba8f64fcdf219a8c6304a0269640e5224eec7f6865848e75a813cd62c67cedc5210301c848a60f7564930355f17f62811cbe7452cb52b163d6b973232749379682a752ae24c40b00', - blockTime: 1673263501, - blockHeight: 771110, - blockHash: '00000000000000000006703ea31d9a5e05dc665f6a45b3ce08650a735cea8196', - lockTime: 771108, - amount: '61964', - fee: '179', - vsize: 137, - feeRate: '1.31', - targets: [ - { - n: 0, - addresses: ['bc1q8de0s529sqvm660tk4df9j4z5jdcnsxafp2033'], - isAddress: true, - amount: '61964', - isAccountTarget: true, - }, - ], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: 'b69218afce1575bc1463fcf8833bfb89a2cead504b51b906d9cc118d642672db', - sequence: 4294967293, - n: 0, - addresses: [ - 'bc1qyf932z68hj4s3zcgrg622fqnj04h50sqymsf5h45khaqkpk7qm9sfd9wrq', - ], - isAddress: true, - value: '62143', - }, - ], - vout: [ - { - value: '61964', - n: 0, - spent: true, - spentTxId: - '85c6a01a7480aa98b342dfc4299a5682f9d0f35938f2c625758538db0b4a5c6e', - spentIndex: 1, - spentHeight: 775449, - hex: '00143b72f851458019bd69ebb55a92caa2a49b89c0dd', - addresses: ['bc1q8de0s529sqvm660tk4df9j4z5jdcnsxafp2033'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - ], - size: 302, - totalInput: '62143', - totalOutput: '61964', - }, - }, - { - type: 'sent', - txid: 'b69218afce1575bc1463fcf8833bfb89a2cead504b51b906d9cc118d642672db', - hex: '01000000000101bdf8c2dae0cb81d9b4bb71f5d18a48facc1e9b9a33609bd02785b5ba7dbc12e00100000000fdffffff02bff2000000000000220020224b150b47bcab088b081a34a5241393eb7a3e0026e09a5eb4b5fa0b06de06cbeedb050000000000160014a0a66d4b7027aaf7075a5d379ef2b5970d5cdbd70247304402207182ce148ba5060cbdffaf70280dc406bda96466835b91c7a49b268b25606ce202202e006eeafe4a253cb6255be4d321ea8c26ed18bc7484bdd45bc680c311823624012103f8acf91bf3d97248b9a7fc6869372f77e976004943cbfc0d4bc0198f206e24a100000000', - blockTime: 1673253283, - blockHeight: 771093, - blockHash: '00000000000000000007e51f2a3a2057c49ec41e01539ee6b2c59c171af5252f', - amount: '62143', - fee: '153', - vsize: 153, - feeRate: '1', - targets: [ - { - n: 0, - addresses: [ - 'bc1qyf932z68hj4s3zcgrg622fqnj04h50sqymsf5h45khaqkpk7qm9sfd9wrq', - ], - isAddress: true, - amount: '62143', - }, - ], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: 'e012bc7dbab58527d09b60339a9b1eccfa488ad1f571bbb4d981cbe0dac2f8bd', - vout: 1, - sequence: 4294967293, - n: 0, - addresses: ['bc1qgumedq8968wxv8dfqapnqa9s9uzmhwqca7gl8j'], - isAddress: true, - isOwn: true, - value: '446278', - isAccountOwned: true, - }, - ], - vout: [ - { - value: '62143', - n: 0, - spent: true, - spentTxId: - '9a9c91b33ff3aadb67e8baa6f683b8ed4db0ca5c107137f406a6ffafeb16b0e7', - spentHeight: 771110, - hex: '0020224b150b47bcab088b081a34a5241393eb7a3e0026e09a5eb4b5fa0b06de06cb', - addresses: [ - 'bc1qyf932z68hj4s3zcgrg622fqnj04h50sqymsf5h45khaqkpk7qm9sfd9wrq', - ], - isAddress: true, - }, - { - value: '383982', - n: 1, - spent: true, - spentTxId: - 'e147a67e4ba5244c1845a91250d99510ccf5751dd5de506a4dea0df18be375b0', - spentHeight: 774339, - hex: '0014a0a66d4b7027aaf7075a5d379ef2b5970d5cdbd7', - addresses: ['bc1q5znx6jmsy740wp66t5meau44jux4ek7hp9x3k0'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - ], - size: 234, - totalInput: '446278', - totalOutput: '446125', - }, - }, - { - type: 'recv', - txid: '727f252c6fa4f9b7cc3d2b33368a3acae4d9773e66cab0106e01f85c999839f7', - hex: '02000000000101bdf8c2dae0cb81d9b4bb71f5d18a48facc1e9b9a33609bd02785b5ba7dbc12e00000000000fdffffff019f7a000000000000160014e5bca52660a0f1178f1437f05768e2264f67098704004730440220053cd9bc83403524590429e1466aafe744f02093fff6088ffeda3f4a323048c002203082b83fe3562cb0d35d1be451d11ceefd87714ed3e9445f190ccc45a759757d0147304402205dc2d069b370746f63b06b05e9836139fe953d11be62b0bf3809ff8242721df702204b7cfc05a7d194b0f18bc5a67d198d6396077872363e6f572151a7743c6d646e01475221035854f197b47765ee004bbdceb11cf2318637df049c9f9bec9eeef501e06fe1152103f9c2483ba111f98f01a51e748c75b3ab37429288c31526ee15453482631aed2152ae9ac00b00', - blockTime: 1672763404, - blockHeight: 770205, - blockHash: '0000000000000000000182e2c3b45a8d980f36b801296556c8d53df098ba6c02', - lockTime: 770202, - amount: '31391', - fee: '290', - vsize: 137, - feeRate: '2.12', - targets: [ - { - n: 0, - addresses: ['bc1quk722fnq5rc30rc5xlc9w68zye8kwzv84k6lkz'], - isAddress: true, - amount: '31391', - isAccountTarget: true, - }, - ], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: 'e012bc7dbab58527d09b60339a9b1eccfa488ad1f571bbb4d981cbe0dac2f8bd', - sequence: 4294967293, - n: 0, - addresses: [ - 'bc1q34p2df0jhgyfued9kfy2z7z4979wdzktsvg8skcq5mel993pat9q6jts5u', - ], - isAddress: true, - value: '31681', - }, - ], - vout: [ - { - value: '31391', - n: 0, - spent: true, - spentTxId: - '85c6a01a7480aa98b342dfc4299a5682f9d0f35938f2c625758538db0b4a5c6e', - spentHeight: 775449, - hex: '0014e5bca52660a0f1178f1437f05768e2264f670987', - addresses: ['bc1quk722fnq5rc30rc5xlc9w68zye8kwzv84k6lkz'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - ], - size: 302, - totalInput: '31681', - totalOutput: '31391', - }, - }, - { - type: 'sent', - txid: 'e012bc7dbab58527d09b60339a9b1eccfa488ad1f571bbb4d981cbe0dac2f8bd', - hex: '01000000000101b51ed1bc7cc4141246e372475a99e0dcdafa4d7ededf6790da7137779188a2460100000000fdffffff02c17b0000000000002200208d42a6a5f2ba089e65a5b248a178552f8ae68acb8310785b00a6f3f29621eaca46cf06000000000016001447379680e5d1dc661da907433074b02f05bbb81802483045022100ca6ccdaacd08eeb424c7cf294a0fed0fc32a66654ba254a4fa29d465845b19af02200799ea12e76f22001df074aa8fb1ab51c890f457ced93b544daec133d0befbde01210394d2bdc7b7dd5c42ac4c9554b93df9d90759bfaa9aed2e0e547ac22ade692baf00000000', - blockTime: 1672762602, - blockHeight: 770203, - blockHash: '00000000000000000001da294c9384eb80ff90799f64ab47c5009a6d24b445b1', - amount: '31681', - fee: '765', - vsize: 153, - feeRate: '5', - targets: [ - { - n: 0, - addresses: [ - 'bc1q34p2df0jhgyfued9kfy2z7z4979wdzktsvg8skcq5mel993pat9q6jts5u', - ], - isAddress: true, - amount: '31681', - }, - ], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: '46a28891773771da9067dfde7e4dfadadce0995a4772e3461214c47cbcd11eb5', - vout: 1, - sequence: 4294967293, - n: 0, - addresses: ['bc1qux7xuufl8l4wh8r0lf2mye2mq28qyjwucfntdf'], - isAddress: true, - isOwn: true, - value: '478724', - isAccountOwned: true, - }, - ], - vout: [ - { - value: '31681', - n: 0, - spent: true, - spentTxId: - '727f252c6fa4f9b7cc3d2b33368a3acae4d9773e66cab0106e01f85c999839f7', - spentHeight: 770205, - hex: '00208d42a6a5f2ba089e65a5b248a178552f8ae68acb8310785b00a6f3f29621eaca', - addresses: [ - 'bc1q34p2df0jhgyfued9kfy2z7z4979wdzktsvg8skcq5mel993pat9q6jts5u', - ], - isAddress: true, - }, - { - value: '446278', - n: 1, - spent: true, - spentTxId: - 'b69218afce1575bc1463fcf8833bfb89a2cead504b51b906d9cc118d642672db', - spentHeight: 771093, - hex: '001447379680e5d1dc661da907433074b02f05bbb818', - addresses: ['bc1qgumedq8968wxv8dfqapnqa9s9uzmhwqca7gl8j'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - ], - size: 235, - totalInput: '478724', - totalOutput: '477959', - }, - }, - { - type: 'sent', - txid: '46a28891773771da9067dfde7e4dfadadce0995a4772e3461214c47cbcd11eb5', - hex: '0100000000010184ec7921fb57e050bdf5cb557c740ad7fe5b8c6964818468c0d0e2a2aaa39a1e0000000000fdffffff02af27000000000000160014f72408fcbf19726b366c6357efaf793b5288a74a044e070000000000160014e1bc6e713f3feaeb9c6ffa55b2655b028e0249dc02483045022100bfd45899cc26fedafc48da83875d7e8df01e61797da1ed8b9308791f2cb08dfc02205efb7b354ea981071db39d566b5709ee5adc1f8ab4cb32064ad0941a780c7515012103998fa363f7e2f2488a55f70d0f61c9e2fd3c6117383f6af8f72abcbcdde4912b00000000', - blockTime: 1671124142, - blockHeight: 767548, - blockHash: '0000000000000000000068d2e2126ef7490e4ab49a23e36742e334ba82e69dbb', - amount: '10159', - fee: '141', - vsize: 141, - feeRate: '1', - targets: [ - { - n: 0, - addresses: ['bc1q7ujq3l9lr9exkdnvvdt7ltme8dfg3f62czww5v'], - isAddress: true, - amount: '10159', - }, - ], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: '1e9aa3aaa2e2d0c068848164698c5bfed70a747c55cbf5bd50e057fb2179ec84', - sequence: 4294967293, - n: 0, - addresses: ['bc1qm8gyv254t3nf45x7wc2luwjlueymrlem9da40z'], - isAddress: true, - isOwn: true, - value: '489024', - isAccountOwned: true, - }, - ], - vout: [ - { - value: '10159', - n: 0, - hex: '0014f72408fcbf19726b366c6357efaf793b5288a74a', - addresses: ['bc1q7ujq3l9lr9exkdnvvdt7ltme8dfg3f62czww5v'], - isAddress: true, - }, - { - value: '478724', - n: 1, - spent: true, - spentTxId: - 'e012bc7dbab58527d09b60339a9b1eccfa488ad1f571bbb4d981cbe0dac2f8bd', - spentHeight: 770203, - hex: '0014e1bc6e713f3feaeb9c6ffa55b2655b028e0249dc', - addresses: ['bc1qux7xuufl8l4wh8r0lf2mye2mq28qyjwucfntdf'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - ], - size: 223, - totalInput: '489024', - totalOutput: '488883', - }, - }, - { - type: 'recv', - txid: 'c6529a24fa5133f0f39935a9ac930cc84c412d0dd7be48179d9f03238ee1e1ac', - hex: '0100000000010162d4dd8faa6aa2380dd6eb3eb8694b76b401cf5c42869470da76ea8ab9c796a90000000000fdffffff01ee0a0000000000001600142b24a18c6037010d0382916fd619fb9170be5dc402483045022100c2de18ad962a5008cb72bad9b720ef942bfaa1b4ef23a2751046a0dbf17b7a8002205de25c0fcffbab789dd915bb7e1a649963f67c8cdd4dcb59e3419d2ebed28941012102177b8d8797a1a87764064b2ac09b72220128e23b482aa2199064b67eb852846100000000', - blockTime: 1671107422, - blockHeight: 767516, - blockHash: '000000000000000000076794a44bb5208940b9a020acbe238537b26f731f7fbf', - amount: '2798', - fee: '330', - vsize: 110, - feeRate: '3', - targets: [ - { - n: 0, - addresses: ['bc1q9vj2rrrqxuqs6quzj9havx0mj9ctuhwykyzmcx'], - isAddress: true, - amount: '2798', - isAccountTarget: true, - }, - ], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: 'a996c7b98aea76da709486425ccf01b4764b69b83eebd60d38a26aaa8fddd462', - sequence: 4294967293, - n: 0, - addresses: ['bc1qr0vhxdfvk023rrvd7znd9v5d6xz5zxlp0qzd98'], - isAddress: true, - value: '3128', - }, - ], - vout: [ - { - value: '2798', - n: 0, - spent: true, - spentTxId: - 'f7c9f241d186d96e17939409e76cd80a8f7a2c0ab53e3453201b6d810e5d519d', - spentIndex: 3, - spentHeight: 783739, - hex: '00142b24a18c6037010d0382916fd619fb9170be5dc4', - addresses: ['bc1q9vj2rrrqxuqs6quzj9havx0mj9ctuhwykyzmcx'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - ], - size: 192, - totalInput: '3128', - totalOutput: '2798', - }, - }, - { - type: 'recv', - txid: '1907c19ccf24aba0798b4d73f4f537af5767c978bbfb48e526d90c32350701fc', - hex: '0100000000010406dddb21e2e9d316cd75ca1b577d092fd00d083d39b1e1ddc144612f920fb62b0100000000fdffffffd3bee16729645b55c9dbeb9b60e905a68ea8ad9459c535b08cf2230a6254bc5c0100000000fdffffff62d4dd8faa6aa2380dd6eb3eb8694b76b401cf5c42869470da76ea8ab9c796a90100000000fdffffff6bf1a375ec5dcfd05593cd42a65f2ab068725703c20849c6cf51db957a91e7fa0000000000fdffffff0180500000000000001600149fad2d294448e7a2d00c28c18e982effd73492660247304402205a20b3ad7fa0a3178eafaae03ad0b62a2eab6b98e6f550e7671055c70855b64a02205172b4eba36a1562ee3e943e2d77ea15c37b7d1f7548ae8454570d30dc8462750121020fd3eb8a0e457a083f70cf4023961605b5c0600c3a935fc489bf83ab2c6d0d9b0247304402201c35b6cb91b1b0b5a40e3e3ab70984a2b6eeded470d9aad634224b0af4ec39c702207e9948145d5d8a53ee0e9c489095684cd45f144a2eaaeec4168d0e1e170e3885012103492889b1babe7339dc1bb3c207d43e73dfd5c39f4f447cd4db162a5bfa694cd2024830450221009ce2deb54bc3978fcb6fed541b7c87d8bd7ccc22bf0ac2a0a861af96ffb578f302204c65b0f438269eada314f6f214973e133dbffd9d26e9c2043ce2b4d3ec91daf60121039f7bd2e9fff9c2bc749bec4dc41d4c02241ce9100fb56b4b1f4266220d7a4f6302483045022100ad409839897805fe09b1b65db4fc22f7d9a23b970d17dd3e92e2a886e0221ee30220153e52c77190d1c6b9a64ea3639f8b7519596cdc988701fdf9b064a6f1fffde8012103a912be2cca2bcfec2168241e9b40c83fbb0c6fdd9168da8af197f2731be7d0bf00000000', - blockTime: 1671107422, - blockHeight: 767516, - blockHash: '000000000000000000076794a44bb5208940b9a020acbe238537b26f731f7fbf', - amount: '20608', - fee: '942', - vsize: 313, - feeRate: '3.01', - targets: [ - { - n: 0, - addresses: ['bc1qn7kj622yfrn695qv9rqcaxpwlltnfynxd0zt0z'], - isAddress: true, - amount: '20608', - isAccountTarget: true, - }, - ], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: '2bb60f922f6144c1dde1b1393d080dd02f097d571bca75cd16d3e9e221dbdd06', - vout: 1, - sequence: 4294967293, - n: 0, - addresses: ['bc1q59xd6fxe83yyzak708gywqvxuwcu2y3d654aa5'], - isAddress: true, - value: '8615', - }, - { - txid: '5cbc54620a23f28cb035c55994ada88ea605e9609bebdbc9555b642967e1bed3', - vout: 1, - sequence: 4294967293, - n: 1, - addresses: ['bc1qjs9u65ajwa90vy99r3c0stns2sz2gvxjue730m'], - isAddress: true, - value: '5565', - }, - { - txid: 'a996c7b98aea76da709486425ccf01b4764b69b83eebd60d38a26aaa8fddd462', - vout: 1, - sequence: 4294967293, - n: 2, - addresses: ['bc1qtnph3g3wcqtvfutqrjcdqyj5wh563tgl3wpqkt'], - isAddress: true, - value: '5663', - }, - { - txid: 'fae7917a95db51cfc64908c203577268b02a5fa642cd9355d0cf5dec75a3f16b', - sequence: 4294967293, - n: 3, - addresses: ['bc1q8efpng2qmx475jkq5h69qmt989c4a4ey0dsvjj'], - isAddress: true, - value: '1707', - }, - ], - vout: [ - { - value: '20608', - n: 0, - spent: true, - spentTxId: - 'f7c9f241d186d96e17939409e76cd80a8f7a2c0ab53e3453201b6d810e5d519d', - spentHeight: 783739, - hex: '00149fad2d294448e7a2d00c28c18e982effd7349266', - addresses: ['bc1qn7kj622yfrn695qv9rqcaxpwlltnfynxd0zt0z'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - ], - size: 637, - totalInput: '21550', - totalOutput: '20608', - }, - }, - { - type: 'self', - txid: '1e9aa3aaa2e2d0c068848164698c5bfed70a747c55cbf5bd50e057fb2179ec84', - hex: '010000000001057f6b968295c8060d57d8f109cb840950f16afdd43830e492ba0a8736fb5814350000000000fdffffff5ca9586b55e6a9fb33295ea64e790dad71cca8ffd17d596c796c66ea9c81ef4e0100000000fdffffff4da3ded389128a27b6f8a61fc8ffa8e2bf1c1d88016441e8f3cc40c1ee28ac950000000000fdffffffb5599ab24f27584df7f56f9573bc1bfea152fc7e72d534cca44ea50d108b68a30100000000fdffffff6bf1a375ec5dcfd05593cd42a65f2ab068725703c20849c6cf51db957a91e7fa0100000000fdffffff014076070000000000160014d9d0462a955c669ad0de7615fe3a5fe649b1ff3b02473044022059e293ff574ce4d515281f2963626ccbf69e3c699bfc26537c930a3d6557932802203666fa7442123f80a2231588998689da483d8b61491ca0f21a1e9e1b10ddbff601210317372f5b00563795efba30d936dc197e16d9b0536972612df0999cfbc6c261d4024730440220035a9939e3e36656feb764ce8e1d0b59ba1d3ba7de82e2bc95ab7505cad2ae4d022045889cca580b22a7f81f9729ef57cbf9627a8e33ef81e027323c095036603228012102ac7f3d0ed8462e37b0326ac78fe5bce9ae9e9a031f345c8c024ae18b7c8b158702473044022039ccd45700451f63d1f30fe5b7c48f831fa775bdb199317071b73dc5a943254a022079a670c68b040145457256f29a4082ddbc20df753671d61e884d9ee3d4636b30012102532398a1a57d3f36f636c5ecc547cd1c609476bcd56c714298a02a32d1de8c850247304402200f2e1c0456fd15c29cbaa659b00fc0b0bffb62618ffbac5a210d498e4d355c78022050ae3b29e40b426bd6a84145ddaa5fce56d81e9bc4c1606973676ff30276f8820121039362807a8d61f99f66ddc6f4e93a24fdabb4daf64077c87be32149953248b0080247304402200c747e7c50dced78c2a526004d430a9e0d1e48a6af23e2f98765b47869bbe35802202882d41868a68a33018306c45ec11eecca0ce567ece0912043e00354abf5e7c2012103ec7d5f349965c42491f92e5b86b9278dca9d99157d81805d1945a4634bb5fd9a00000000', - blockTime: 1671047702, - blockHeight: 767426, - blockHash: '00000000000000000003f34b5f178ba0641864059ccfb9a54c4bf09c9644db67', - amount: '382', - fee: '382', - vsize: 381, - feeRate: '1', - targets: [ - { - n: 0, - addresses: ['bc1qm8gyv254t3nf45x7wc2luwjlueymrlem9da40z'], - isAddress: true, - amount: '489024', - isAccountTarget: true, - }, - ], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: '351458fb36870aba92e43038d4fd6af1500984cb09f1d8570d06c89582966b7f', - sequence: 4294967293, - n: 0, - addresses: ['bc1qph5vk20vl5sjltxus0s82gwug0vum5hkganr2g'], - isAddress: true, - isOwn: true, - value: '30807', - isAccountOwned: true, - }, - { - txid: '4eef819cea666c796c597dd1ffa8cc71ad0d794ea65e2933fba9e6556b58a95c', - vout: 1, - sequence: 4294967293, - n: 1, - addresses: ['bc1qxm4qkadavwptrdlp9p80rmxn7dlhfvte050ewl'], - isAddress: true, - isOwn: true, - value: '433756', - isAccountOwned: true, - }, - { - txid: '95ac28eec140ccf3e8416401881d1cbfe2a8ffc81fa6f8b6278a1289d3dea34d', - sequence: 4294967293, - n: 2, - addresses: ['bc1qa5e54k3p2cw3dmzdvzc0ehgg3wtvrv74lrtngj'], - isAddress: true, - isOwn: true, - value: '5000', - isAccountOwned: true, - }, - { - txid: 'a3688b100da54ea4cc34d5727efc52a1fe1bbc73956ff5f74d58274fb29a59b5', - vout: 1, - sequence: 4294967293, - n: 3, - addresses: ['bc1q569v8dpu2w9mfy0vxch8zfcg68s782kvh0f5cr'], - isAddress: true, - isOwn: true, - value: '11433', - isAccountOwned: true, - }, - { - txid: 'fae7917a95db51cfc64908c203577268b02a5fa642cd9355d0cf5dec75a3f16b', - vout: 1, - sequence: 4294967293, - n: 4, - addresses: ['bc1qapt7c0lncw6w2lzh2c275d2zq6t4z7h38swaqv'], - isAddress: true, - isOwn: true, - value: '8410', - isAccountOwned: true, - }, - ], - vout: [ - { - value: '489024', - n: 0, - spent: true, - spentTxId: - '46a28891773771da9067dfde7e4dfadadce0995a4772e3461214c47cbcd11eb5', - spentHeight: 767548, - hex: '0014d9d0462a955c669ad0de7615fe3a5fe649b1ff3b', - addresses: ['bc1qm8gyv254t3nf45x7wc2luwjlueymrlem9da40z'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - ], - size: 783, - totalInput: '489406', - totalOutput: '489024', - }, - }, - { - type: 'recv', - txid: 'fae7917a95db51cfc64908c203577268b02a5fa642cd9355d0cf5dec75a3f16b', - hex: '01000000000101b5599ab24f27584df7f56f9573bc1bfea152fc7e72d534cca44ea50d108b68a30000000000fdffffff02ab060000000000001600143e5219a140d9abea4ac0a5f4506d6539715ed724da20000000000000160014e857ec3ff3c3b4e57c575615ea35420697517af102483045022100eeae2896302f8dcefef3ac1da5eda84f55fbfdfefe9996421ad81aceb543054c022076c56a220c09d45210a837f6f8384468a01b0573b6cd51b15fbd203ac3792aba0121025c8f61cfd31b2812c78f2b3b1c6472387a0d32da53030bfb4b98ac5424226e3900000000', - blockTime: 1671010442, - blockHeight: 767365, - blockHash: '00000000000000000001c0ca2b5cb4aeb75a0de95d36372fa10dc54805b3b246', - amount: '8410', - fee: '282', - vsize: 141, - feeRate: '2', - targets: [ - { - n: 1, - addresses: ['bc1qapt7c0lncw6w2lzh2c275d2zq6t4z7h38swaqv'], - isAddress: true, - amount: '8410', - isAccountTarget: true, - }, - ], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: 'a3688b100da54ea4cc34d5727efc52a1fe1bbc73956ff5f74d58274fb29a59b5', - sequence: 4294967293, - n: 0, - addresses: ['bc1qqwyz2r8arwg3zx28kmlmr3ve7xud4see2paqkv'], - isAddress: true, - value: '10399', - }, - ], - vout: [ - { - value: '1707', - n: 0, - spent: true, - spentTxId: - '1907c19ccf24aba0798b4d73f4f537af5767c978bbfb48e526d90c32350701fc', - spentIndex: 3, - spentHeight: 767516, - hex: '00143e5219a140d9abea4ac0a5f4506d6539715ed724', - addresses: ['bc1q8efpng2qmx475jkq5h69qmt989c4a4ey0dsvjj'], - isAddress: true, - }, - { - value: '8410', - n: 1, - spent: true, - spentTxId: - '1e9aa3aaa2e2d0c068848164698c5bfed70a747c55cbf5bd50e057fb2179ec84', - spentIndex: 4, - spentHeight: 767426, - hex: '0014e857ec3ff3c3b4e57c575615ea35420697517af1', - addresses: ['bc1qapt7c0lncw6w2lzh2c275d2zq6t4z7h38swaqv'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - ], - size: 223, - totalInput: '10399', - totalOutput: '10117', - }, - }, - { - type: 'recv', - txid: 'a3688b100da54ea4cc34d5727efc52a1fe1bbc73956ff5f74d58274fb29a59b5', - hex: '010000000001025bd30e30899e49699ea4070502140e97a49f52aef14a0179552b2149cd6480580000000000fdffffff195b21720f3f9b6fb6c66de3db5a772bf5cd7060abaf711dd493158d88ad15eb0100000000fdffffff029f280000000000001600140388250cfd1b91111947b6ffb1c599f1b8dac339a92c000000000000160014a68ac3b43c538bb491ec362e712708d1e1e3aacc02483045022100d1fe35b19f6460350bfc32c7002b8240fab8e3ae3a6f1f21bdc4fef2d1cd5d2b0220506e4ee5670db44dd82b6007b193f71e6976622b0b80febe9667cb5e75904ab9012102c2b455b3921bde55fb4c29605c985b739fea59fc5ab238b80a60a401af4ad05202483045022100ae5a0ff9f876a23c31c58e28101e845141d83c1deffd5c02acdce430ca763ff40220046dc4dbdaf5cc0e85f234462ab163fe422794fff5dd4b7f3d155135e3a60744012102074cabb8928e1f7ff46bc1223e17a3f3b523b3115a44d58f1cbf7c8d943fe2a700000000', - blockTime: 1670939471, - blockHeight: 767220, - blockHash: '0000000000000000000774d2b00ffd464f6bf2d4502f34ac6dff99f0fee6b300', - amount: '11433', - fee: '627', - vsize: 209, - feeRate: '3', - targets: [ - { - n: 1, - addresses: ['bc1q569v8dpu2w9mfy0vxch8zfcg68s782kvh0f5cr'], - isAddress: true, - amount: '11433', - isAccountTarget: true, - }, - ], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: '588064cd49212b5579014af1ae529fa4970e14020507a49e69499e89300ed35b', - sequence: 4294967293, - n: 0, - addresses: ['bc1q7p7jygzj277vqde9qwnnfww32cyyd5m3qz8aam'], - isAddress: true, - value: '10712', - }, - { - txid: 'eb15ad888d1593d41d71afab6070cdf52b775adbe36dc6b66f9b3f0f72215b19', - vout: 1, - sequence: 4294967293, - n: 1, - addresses: ['bc1q2qynn6qjk89g68fuag4vpkgxwmjvu0s5ehunre'], - isAddress: true, - value: '11747', - }, - ], - vout: [ - { - value: '10399', - n: 0, - spent: true, - spentTxId: - 'fae7917a95db51cfc64908c203577268b02a5fa642cd9355d0cf5dec75a3f16b', - spentHeight: 767365, - hex: '00140388250cfd1b91111947b6ffb1c599f1b8dac339', - addresses: ['bc1qqwyz2r8arwg3zx28kmlmr3ve7xud4see2paqkv'], - isAddress: true, - }, - { - value: '11433', - n: 1, - spent: true, - spentTxId: - '1e9aa3aaa2e2d0c068848164698c5bfed70a747c55cbf5bd50e057fb2179ec84', - spentIndex: 3, - spentHeight: 767426, - hex: '0014a68ac3b43c538bb491ec362e712708d1e1e3aacc', - addresses: ['bc1q569v8dpu2w9mfy0vxch8zfcg68s782kvh0f5cr'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - ], - size: 372, - totalInput: '22459', - totalOutput: '21832', - }, - }, - { - type: 'recv', - txid: '351458fb36870aba92e43038d4fd6af1500984cb09f1d8570d06c89582966b7f', - hex: '020000000001015ca9586b55e6a9fb33295ea64e790dad71cca8ffd17d596c796c66ea9c81ef4e0000000000fdffffff0157780000000000001600140de8cb29ecfd212facdc83e07521dc43d9cdd2f6024730440220296ed78dd0185a43f30fb87a914342dbb18ca75c6f8f8bb245a67b663b026994022034e6870924e4e1881538a1da5494b742fbb95a8b26154857a9e230971a65f29a012103c83676d90bf9ec305d37ea14a5a34660036f93b90ab0efc1e1ec771e4ddd6beec7b00b00', - blockTime: 1670375884, - blockHeight: 766214, - blockHash: '000000000000000000044c1ec9dd567179b8f8394c2c33b105b1e1efb1a8dcd7', - lockTime: 766151, - amount: '30807', - fee: '110', - vsize: 110, - feeRate: '1', - targets: [ - { - n: 0, - addresses: ['bc1qph5vk20vl5sjltxus0s82gwug0vum5hkganr2g'], - isAddress: true, - amount: '30807', - isAccountTarget: true, - }, - ], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: '4eef819cea666c796c597dd1ffa8cc71ad0d794ea65e2933fba9e6556b58a95c', - sequence: 4294967293, - n: 0, - addresses: ['bc1qed83uzy60fjp80453v0pvwc4zkk23c27k57lh2'], - isAddress: true, - value: '30917', - }, - ], - vout: [ - { - value: '30807', - n: 0, - spent: true, - spentTxId: - '1e9aa3aaa2e2d0c068848164698c5bfed70a747c55cbf5bd50e057fb2179ec84', - spentHeight: 767426, - hex: '00140de8cb29ecfd212facdc83e07521dc43d9cdd2f6', - addresses: ['bc1qph5vk20vl5sjltxus0s82gwug0vum5hkganr2g'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - ], - size: 191, - totalInput: '30917', - totalOutput: '30807', - }, - }, - { - type: 'sent', - txid: '4eef819cea666c796c597dd1ffa8cc71ad0d794ea65e2933fba9e6556b58a95c', - hex: '01000000000101d96b319d6d586ac76965cb5f3a5a3bbc2e456cb14f611bb41d29afa7fbe7407a0100000000fdffffff02c578000000000000160014cb4f1e089a7a6413beb48b1e163b1515aca8e15e5c9e06000000000016001436ea0b75bd6382b1b7e1284ef1ecd3f37f74b17902473044022013c2133adeeba3963e2811464a97b6e9284f2530cd5b24feebacf0e0c765773f022026bb1c3eca5b5a04ccba9fa33aeba9ed6324983b74973cac28e8f25e0f9382c9012103b04a8e6d3cadc2169403afadbb9ca5a5739010ab43166e3513c189e973613f1e00000000', - blockTime: 1670332769, - blockHeight: 766149, - blockHash: '000000000000000000016e4193014dd008ac6f8c7377d6245f5e4df7d5c08f1a', - amount: '30917', - fee: '141', - vsize: 141, - feeRate: '1', - targets: [ - { - n: 0, - addresses: ['bc1qed83uzy60fjp80453v0pvwc4zkk23c27k57lh2'], - isAddress: true, - amount: '30917', - }, - ], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: '7a40e7fba7af291db41b614fb16c452ebc3b5a3a5fcb6569c76a586d9d316bd9', - vout: 1, - sequence: 4294967293, - n: 0, - addresses: ['bc1qnwvem4f238u6dkz7zn53an4h2ealr390h7284t'], - isAddress: true, - isOwn: true, - value: '464814', - isAccountOwned: true, - }, - ], - vout: [ - { - value: '30917', - n: 0, - spent: true, - spentTxId: - '351458fb36870aba92e43038d4fd6af1500984cb09f1d8570d06c89582966b7f', - spentHeight: 766214, - hex: '0014cb4f1e089a7a6413beb48b1e163b1515aca8e15e', - addresses: ['bc1qed83uzy60fjp80453v0pvwc4zkk23c27k57lh2'], - isAddress: true, - }, - { - value: '433756', - n: 1, - spent: true, - spentTxId: - '1e9aa3aaa2e2d0c068848164698c5bfed70a747c55cbf5bd50e057fb2179ec84', - spentIndex: 1, - spentHeight: 767426, - hex: '001436ea0b75bd6382b1b7e1284ef1ecd3f37f74b179', - addresses: ['bc1qxm4qkadavwptrdlp9p80rmxn7dlhfvte050ewl'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - ], - size: 222, - totalInput: '464814', - totalOutput: '464673', - }, - }, - { - type: 'sent', - txid: '7a40e7fba7af291db41b614fb16c452ebc3b5a3a5fcb6569c76a586d9d316bd9', - hex: '010000000001014da3ded389128a27b6f8a61fc8ffa8e2bf1c1d88016441e8f3cc40c1ee28ac950100000000fdffffff02bdc70000000000001600147430184afc7a623c1d3c4a503c1f291e0a1069a1ae170700000000001600149b999dd52a89f9a6d85e14e91eceb7567bf1c4af0247304402202f46ea92089ff01ec893bc7359ca7a5dc6b0ece4ca9b2c5d5241365c2871a8c70220251048a99cfa87e937be38800609ca51fbf01e5156e04f81d4ee25730cf23475012103e2f912160c27828f9b03a9cc420211e6ddafb900114979b6b85cf7fe9d874cbf00000000', - blockTime: 1666697866, - blockHeight: 760240, - blockHash: '00000000000000000001c89705ee1d86ecd6fc8fdb5f4418b81bbcd68912f8de', - amount: '51133', - fee: '141', - vsize: 141, - feeRate: '1', - targets: [ - { - n: 0, - addresses: ['bc1qwscpsjhu0f3rc8fuffgrc8efrc9pq6dpsrzgyr'], - isAddress: true, - amount: '51133', - }, - ], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: '95ac28eec140ccf3e8416401881d1cbfe2a8ffc81fa6f8b6278a1289d3dea34d', - vout: 1, - sequence: 4294967293, - n: 0, - addresses: ['bc1qdy0jxh83s5ddtw6dctjr8jwpcl7fjn9z3cjlux'], - isAddress: true, - isOwn: true, - value: '516088', - isAccountOwned: true, - }, - ], - vout: [ - { - value: '51133', - n: 0, - spent: true, - spentTxId: - 'd1ad78bc1e26740eb8c1e26a9113a21019f531c0b96c81bac357d2ad7bb476ee', - spentHeight: 765507, - hex: '00147430184afc7a623c1d3c4a503c1f291e0a1069a1', - addresses: ['bc1qwscpsjhu0f3rc8fuffgrc8efrc9pq6dpsrzgyr'], - isAddress: true, - }, - { - value: '464814', - n: 1, - spent: true, - spentTxId: - '4eef819cea666c796c597dd1ffa8cc71ad0d794ea65e2933fba9e6556b58a95c', - spentHeight: 766149, - hex: '00149b999dd52a89f9a6d85e14e91eceb7567bf1c4af', - addresses: ['bc1qnwvem4f238u6dkz7zn53an4h2ealr390h7284t'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - ], - size: 222, - totalInput: '516088', - totalOutput: '515947', - }, - }, - { - type: 'self', - txid: '95ac28eec140ccf3e8416401881d1cbfe2a8ffc81fa6f8b6278a1289d3dea34d', - hex: '010000000001015e5abd383ab28645b6ebac0be75b5356e361b3ba327a908106fde8faf55adcdf0000000000fdffffff028813000000000000160014ed334ada21561d16ec4d60b0fcdd088b96c1b3d5f8df070000000000160014691f235cf1851ad5bb4dc2e433c9c1c7fc994ca20247304402200b2b619cf4503a12ab9b31fcbe824da09b6a26bea411cc9380b1ffc794e16c1502206cb59e034c6d129504ae0bd9e87f7eb2220feeb4ee8ea66d7ffe2718c165e9fc01210259fe244932ce581b2f7e0f0edbd04cc076679ea8ba384047197279ec6be0d3cc00000000', - blockTime: 1666021435, - blockHeight: 759095, - blockHash: '00000000000000000007d6d93fd9680e6bbef9d376d8bef3f08212a33517e47f', - amount: '141', - fee: '141', - vsize: 141, - feeRate: '1', - targets: [ - { - n: 0, - addresses: ['bc1qa5e54k3p2cw3dmzdvzc0ehgg3wtvrv74lrtngj'], - isAddress: true, - amount: '5000', - isAccountTarget: true, - }, - ], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: 'dfdc5af5fae8fd0681907a32bab361e356535be70bacebb64586b23a38bd5a5e', - sequence: 4294967293, - n: 0, - addresses: ['bc1qfqnh5gxudypnleshwhh5lal5339tkvr5fsxjtl'], - isAddress: true, - isOwn: true, - value: '521229', - isAccountOwned: true, - }, - ], - vout: [ - { - value: '5000', - n: 0, - spent: true, - spentTxId: - '1e9aa3aaa2e2d0c068848164698c5bfed70a747c55cbf5bd50e057fb2179ec84', - spentIndex: 2, - spentHeight: 767426, - hex: '0014ed334ada21561d16ec4d60b0fcdd088b96c1b3d5', - addresses: ['bc1qa5e54k3p2cw3dmzdvzc0ehgg3wtvrv74lrtngj'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - { - value: '516088', - n: 1, - spent: true, - spentTxId: - '7a40e7fba7af291db41b614fb16c452ebc3b5a3a5fcb6569c76a586d9d316bd9', - spentHeight: 760240, - hex: '0014691f235cf1851ad5bb4dc2e433c9c1c7fc994ca2', - addresses: ['bc1qdy0jxh83s5ddtw6dctjr8jwpcl7fjn9z3cjlux'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - ], - size: 222, - totalInput: '521229', - totalOutput: '521088', - }, - }, - { - type: 'recv', - txid: 'dfdc5af5fae8fd0681907a32bab361e356535be70bacebb64586b23a38bd5a5e', - hex: '0100000000010194bb5d9ce91d5d17fb4f72ea5a21c39c3a9ba441aaff7f4a1ce6591a544660db0100000000fdffffff010df407000000000016001448277a20dc69033fe61775ef4ff7f48c4abb3074024730440220454307189f1d3a15a36396558ff5bed9cf0559017e0bbd4eb8c51b6907dc038e02204db9c143325e29269ec4c0fec8146ae0d3bbc835486e5e23fd7b55261c06e73101210211ae160a5a57cd0e21ec6ba695d6511161eae0929c0a332b5f1e6e494b56341c00000000', - blockTime: 1665666497, - blockHeight: 758471, - blockHash: '0000000000000000000751d6abf5434290e196be8e53905ba4d07a12faceb718', - amount: '521229', - fee: '880', - vsize: 110, - feeRate: '8', - targets: [ - { - n: 0, - addresses: ['bc1qfqnh5gxudypnleshwhh5lal5339tkvr5fsxjtl'], - isAddress: true, - amount: '521229', - isAccountTarget: true, - }, - ], - tokens: [], - internalTransfers: [], - rbf: true, - details: { - vin: [ - { - txid: 'db6046541a59e61c4a7fffaa41a49b3a9cc3215aea724ffb175d1de99c5dbb94', - vout: 1, - sequence: 4294967293, - n: 0, - addresses: ['bc1qeu4u5sredlsjvw7yhkrpvm79479yrcz9dl2r70'], - isAddress: true, - value: '522109', - }, - ], - vout: [ - { - value: '521229', - n: 0, - spent: true, - spentTxId: - '95ac28eec140ccf3e8416401881d1cbfe2a8ffc81fa6f8b6278a1289d3dea34d', - spentHeight: 759095, - hex: '001448277a20dc69033fe61775ef4ff7f48c4abb3074', - addresses: ['bc1qfqnh5gxudypnleshwhh5lal5339tkvr5fsxjtl'], - isAddress: true, - isOwn: true, - isAccountOwned: true, - }, - ], - size: 191, - totalInput: '522109', - totalOutput: '521229', - }, - }, - ], - }, - page: { index: 1, size: 100, total: 1 }, - utxo: [ - { - txid: 'c7a677368e3391b51880237522cde0f60cca83029ea0bb747507ffb673f47d26', - vout: 1, - amount: '124579', - blockHeight: 814047, - address: 'bc1qvslap5yajxcm67y2u3dacpxv2lcm4g962hlk5j', - path: "m/84'/0'/0'/0/12", - confirmations: 3888, - }, - { - txid: '4bb76ff13fa81f9d127fa6d215f315d0d32770379b16663fbb99800f396809eb', - vout: 0, - amount: '138577', - blockHeight: 807321, - address: 'bc1qhacn6m7usslzdvym7pynmerktep0e8a4ty35f9', - path: "m/84'/0'/0'/0/11", - confirmations: 10614, - }, - { - txid: 'f7e8570d9770927e02d82012788483b5ba53df6c5321bba2bed657732c1fd74e', - vout: 1, - amount: '6248', - blockHeight: 807236, - address: 'bc1qxc3x3u4xxrsjsqd5fpkrg6u5njumqgxr8h3knt', - path: "m/84'/0'/0'/1/14", - confirmations: 10699, - }, - ], - }, -}; - -export const accountBalanceHistoryResult: ConnectResponse = { - // @ts-expect-error - id: 1, - success: true, - payload: [ - { - time: 1665666497, - txs: 1, - received: '521229', - sent: '0', - sentToSelf: '0', - }, - { - time: 1666021435, - txs: 1, - received: '521088', - sent: '521229', - sentToSelf: '521088', - }, - { - time: 1666697866, - txs: 1, - received: '464814', - sent: '516088', - sentToSelf: '464814', - }, - { - time: 1670332769, - txs: 1, - received: '433756', - sent: '464814', - sentToSelf: '433756', - }, - { - time: 1670375884, - txs: 1, - received: '30807', - sent: '0', - sentToSelf: '0', - }, - { - time: 1670939471, - txs: 1, - received: '11433', - sent: '0', - sentToSelf: '0', - }, - { - time: 1671010442, - txs: 1, - received: '8410', - sent: '0', - sentToSelf: '0', - }, - { - time: 1671047702, - txs: 1, - received: '489024', - sent: '489406', - sentToSelf: '489024', - }, - { - time: 1671107422, - txs: 2, - received: '23406', - sent: '0', - sentToSelf: '0', - }, - { - time: 1671124142, - txs: 1, - received: '478724', - sent: '489024', - sentToSelf: '478724', - }, - { - time: 1672762602, - txs: 1, - received: '446278', - sent: '478724', - sentToSelf: '446278', - }, - { - time: 1672763404, - txs: 1, - received: '31391', - sent: '0', - sentToSelf: '0', - }, - { - time: 1673253283, - txs: 1, - received: '383982', - sent: '446278', - sentToSelf: '383982', - }, - { - time: 1673263501, - txs: 1, - received: '61964', - sent: '0', - sentToSelf: '0', - }, - { - time: 1675087005, - txs: 1, - received: '133800', - sent: '383982', - sentToSelf: '133800', - }, - { - time: 1675784738, - txs: 1, - received: '24800', - sent: '227155', - sentToSelf: '24800', - }, - { - time: 1677839961, - txs: 1, - received: '194211', - sent: '0', - sentToSelf: '0', - }, - { - time: 1678101937, - txs: 1, - received: '142047', - sent: '194211', - sentToSelf: '142047', - }, - { - time: 1678187959, - txs: 1, - received: '37813', - sent: '142047', - sentToSelf: '37813', - }, - { - time: 1679482960, - txs: 1, - received: '19580', - sent: '62613', - sentToSelf: '19580', - }, - { - time: 1680515463, - txs: 1, - received: '140899', - sent: '42986', - sentToSelf: '140899', - }, - { - time: 1680694226, - txs: 1, - received: '38275', - sent: '110000', - sentToSelf: '38275', - }, - { - time: 1694466639, - txs: 1, - received: '6248', - sent: '69174', - sentToSelf: '6248', - }, - { - time: 1694515520, - txs: 1, - received: '138577', - sent: '0', - sentToSelf: '0', - }, - { - time: 1698402008, - txs: 1, - received: '124579', - sent: '0', - sentToSelf: '0', - }, - ], -}; diff --git a/suite-common/transaction-cache-engine/src/tests/__fixtures__/index.ts b/suite-common/transaction-cache-engine/src/tests/__fixtures__/index.ts deleted file mode 100644 index 89a14523e60c..000000000000 --- a/suite-common/transaction-cache-engine/src/tests/__fixtures__/index.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { AccountInfo, Response as ConnectResponse, Params } from '@trezor/connect'; -import { GetAccountInfo } from '@trezor/connect/src/types/api/getAccountInfo'; - -import { accountInfoResult as btcAccountInfoResult } from './btc'; -import { accountInfoResult as xrpAccountInfoResult } from './xrp'; - -const paginateAccountInfoResult = ( - { pageSize, page }: { pageSize: number; page: number }, - accountInfoResult: AccountInfo, -) => { - const startIndex = (page - 1) * pageSize; - const endIndex = startIndex + pageSize; - - const { transactions } = accountInfoResult.history; - - if (!transactions) return accountInfoResult; - - const paginatedTransactions = transactions.slice(startIndex, endIndex); - - return { - ...accountInfoResult, - history: { - ...accountInfoResult.history, - page, - - transactions: paginatedTransactions, - }, - page: { - ...accountInfoResult.page, - index: page, - size: pageSize, - total: Math.ceil(transactions.length / pageSize), - }, - }; -}; - -const results: Record> = { - btc: btcAccountInfoResult, - xrp: xrpAccountInfoResult, -}; - -export const connectGetAccountInfoMock = async ({ - page, - pageSize, - coin, -}: Params) => { - const mockResult = await results[coin]; - if (!mockResult) throw new Error(`Mock result for coin ${coin} not found`); - - if (coin === 'xrp') return xrpAccountInfoResult; - - if (!page || !pageSize) throw new Error(`Page or pageSize not provided`); - - if (mockResult.success === false) return mockResult; - - const paginatedAccountInfoResult = paginateAccountInfoResult( - { page, pageSize }, - mockResult.payload, - ); - - return { - success: true, - payload: paginatedAccountInfoResult, - }; -}; diff --git a/suite-common/transaction-cache-engine/src/tests/__fixtures__/xrp.ts b/suite-common/transaction-cache-engine/src/tests/__fixtures__/xrp.ts deleted file mode 100644 index 405975c879a5..000000000000 --- a/suite-common/transaction-cache-engine/src/tests/__fixtures__/xrp.ts +++ /dev/null @@ -1,356 +0,0 @@ -import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { AccountInfo, Response as ConnectResponse } from '@trezor/connect'; - -import { AccountBalanceHistory } from '../../types'; - -export const accountInfoResult: ConnectResponse = { - // @ts-expect-error - id: 1, - success: true, - payload: { - descriptor: 'r9TCDt3HmszcsnPrUrnvpynvLgaGQom9x3', - balance: '18746129', - availableBalance: '8746129', - empty: false, - history: { - total: -1, - unconfirmed: 0, - transactions: [ - { - type: 'recv', - txid: '272F7A5993908EF025A01AB4FEC934EB9AE04911C968D5E5BB6B842ACF0DAACA', - blockTime: 1690884741, - blockHeight: 81541871, - blockHash: '272F7A5993908EF025A01AB4FEC934EB9AE04911C968D5E5BB6B842ACF0DAACA', - amount: '5248', - fee: '12', - targets: [ - { - addresses: ['r9TCDt3HmszcsnPrUrnvpynvLgaGQom9x3'], - isAddress: true, - amount: '5248', - n: 0, - }, - ], - tokens: [], - internalTransfers: [], - details: { - vin: [], - vout: [], - size: 0, - totalInput: '0', - totalOutput: '0', - }, - }, - { - type: 'sent', - txid: 'BDD71EE034AB7B900BAF0D18115E0C4DB6C753CB5DA70587148AE3A008513909', - blockTime: 1690884611, - blockHeight: 81541837, - blockHash: 'BDD71EE034AB7B900BAF0D18115E0C4DB6C753CB5DA70587148AE3A008513909', - amount: '5260', - fee: '12', - targets: [ - { - addresses: ['rnp3Ysasm5DRFbg2nekLkGfCFL9UfkGKDf'], - isAddress: true, - amount: '5260', - n: 0, - }, - ], - tokens: [], - internalTransfers: [], - details: { - vin: [], - vout: [], - size: 0, - totalInput: '0', - totalOutput: '0', - }, - }, - { - type: 'sent', - txid: 'A8D9F385CB3DDCF39545A7DC610E18A510F6B19716CCE69BC8105C9C58C71192', - blockTime: 1688971822, - blockHeight: 81042493, - blockHash: 'A8D9F385CB3DDCF39545A7DC610E18A510F6B19716CCE69BC8105C9C58C71192', - amount: '8100000', - fee: '12', - targets: [ - { - addresses: ['rKKbNYZRqwPgZYkFWvqNUFBuscEyiFyCE'], - isAddress: true, - amount: '8100000', - n: 0, - }, - ], - tokens: [], - internalTransfers: [], - details: { - vin: [], - vout: [], - size: 0, - totalInput: '0', - totalOutput: '0', - }, - }, - { - type: 'recv', - txid: '5E930BC11C345A720675CEBD06EB142D434DC96F9E975751AF5CFC2434205051', - blockTime: 1683270151, - blockHeight: 79563186, - blockHash: '5E930BC11C345A720675CEBD06EB142D434DC96F9E975751AF5CFC2434205051', - amount: '10037222', - fee: '300000', - targets: [ - { - addresses: ['r9TCDt3HmszcsnPrUrnvpynvLgaGQom9x3'], - isAddress: true, - amount: '10037222', - n: 0, - }, - ], - tokens: [], - internalTransfers: [], - details: { - vin: [], - vout: [], - size: 0, - totalInput: '0', - totalOutput: '0', - }, - }, - { - type: 'sent', - txid: 'C5AA574FEFCCBFE1346591FF7105C7E0CE2842CB8B1B29F14FED1CBDF6692507', - blockTime: 1681478740, - blockHeight: 79098686, - blockHash: 'C5AA574FEFCCBFE1346591FF7105C7E0CE2842CB8B1B29F14FED1CBDF6692507', - amount: '7400000', - fee: '12', - targets: [ - { - addresses: ['rKKbNYZRqwPgZYkFWvqNUFBuscEyiFyCE'], - isAddress: true, - amount: '7400000', - n: 0, - }, - ], - tokens: [], - internalTransfers: [], - details: { - vin: [], - vout: [], - size: 0, - totalInput: '0', - totalOutput: '0', - }, - }, - { - type: 'recv', - txid: '9E50E46FF87C6C724C0EC3FFE9A1210173E68CD041AC2A0189076CB07D1D3B08', - blockTime: 1680675650, - blockHeight: 78891212, - blockHash: '9E50E46FF87C6C724C0EC3FFE9A1210173E68CD041AC2A0189076CB07D1D3B08', - amount: '6682802', - fee: '300000', - targets: [ - { - addresses: ['r9TCDt3HmszcsnPrUrnvpynvLgaGQom9x3'], - isAddress: true, - amount: '6682802', - n: 0, - }, - ], - tokens: [], - internalTransfers: [], - details: { - vin: [], - vout: [], - size: 0, - totalInput: '0', - totalOutput: '0', - }, - }, - { - type: 'sent', - txid: 'A0040ED514AEFC01C43C1D1DC38E09F6ADFD188DA3A3ECAEED844184AEB21909', - blockTime: 1678792680, - blockHeight: 78409260, - blockHash: 'A0040ED514AEFC01C43C1D1DC38E09F6ADFD188DA3A3ECAEED844184AEB21909', - amount: '8400000', - fee: '12', - targets: [ - { - addresses: ['rKKbNYZRqwPgZYkFWvqNUFBuscEyiFyCE'], - isAddress: true, - amount: '8400000', - n: 0, - }, - ], - tokens: [], - internalTransfers: [], - details: { - vin: [], - vout: [], - size: 0, - totalInput: '0', - totalOutput: '0', - }, - }, - { - type: 'recv', - txid: '2ED9CFC0457842DD8F23C3554A7B0A6FE0270DF08BE5C67ED901C8D6BF9144D7', - blockTime: 1677679962, - blockHeight: 78125378, - blockHash: '2ED9CFC0457842DD8F23C3554A7B0A6FE0270DF08BE5C67ED901C8D6BF9144D7', - amount: '7285344', - fee: '300000', - targets: [ - { - addresses: ['r9TCDt3HmszcsnPrUrnvpynvLgaGQom9x3'], - isAddress: true, - amount: '7285344', - n: 0, - }, - ], - tokens: [], - internalTransfers: [], - details: { - vin: [], - vout: [], - size: 0, - totalInput: '0', - totalOutput: '0', - }, - }, - { - type: 'sent', - txid: '3F4CC4990D2240BB5A59CB2EDA03B0937C4E65A82F5B8AEDA21F092E0D54219F', - blockTime: 1675264280, - blockHeight: 77510183, - blockHash: '3F4CC4990D2240BB5A59CB2EDA03B0937C4E65A82F5B8AEDA21F092E0D54219F', - amount: '8000000', - fee: '12', - targets: [ - { - addresses: ['rKKbNYZRqwPgZYkFWvqNUFBuscEyiFyCE'], - isAddress: true, - amount: '8000000', - n: 0, - }, - ], - tokens: [], - internalTransfers: [], - details: { - vin: [], - vout: [], - size: 0, - totalInput: '0', - totalOutput: '0', - }, - }, - { - type: 'sent', - txid: 'B829BEBB6A9E705FC130E546F2994BFEC945046B2EAEFA6470D335EC37A37481', - blockTime: 1672924140, - blockHeight: 76912409, - blockHash: 'B829BEBB6A9E705FC130E546F2994BFEC945046B2EAEFA6470D335EC37A37481', - amount: '6190000', - fee: '12', - targets: [ - { - addresses: ['rKKbNYZRqwPgZYkFWvqNUFBuscEyiFyCE'], - isAddress: true, - amount: '6190000', - n: 0, - }, - ], - tokens: [], - internalTransfers: [], - details: { - vin: [], - vout: [], - size: 0, - totalInput: '0', - totalOutput: '0', - }, - }, - { - type: 'recv', - txid: '6F56CC52F278859927D50525603F2F7AA9A3CD63BA359255F02E6DBE00A01E71', - blockTime: 1672923931, - blockHeight: 76912357, - blockHash: '6F56CC52F278859927D50525603F2F7AA9A3CD63BA359255F02E6DBE00A01E71', - amount: '5612406', - fee: '300000', - targets: [ - { - addresses: ['r9TCDt3HmszcsnPrUrnvpynvLgaGQom9x3'], - isAddress: true, - amount: '5612406', - n: 0, - }, - ], - tokens: [], - internalTransfers: [], - details: { - vin: [], - vout: [], - size: 0, - totalInput: '0', - totalOutput: '0', - }, - }, - { - type: 'recv', - txid: '9301B0F27C6DAC6DFA2BDCF9DB959FB4534466F71F5F92510903CA9E6853E10B', - blockTime: 1656677000, - blockHeight: 72710665, - blockHash: '9301B0F27C6DAC6DFA2BDCF9DB959FB4534466F71F5F92510903CA9E6853E10B', - amount: '27218439', - fee: '12', - targets: [ - { - addresses: ['r9TCDt3HmszcsnPrUrnvpynvLgaGQom9x3'], - isAddress: true, - amount: '27218439', - n: 0, - }, - ], - tokens: [], - internalTransfers: [], - details: { - vin: [], - vout: [], - size: 0, - totalInput: '0', - totalOutput: '0', - }, - }, - ], - }, - misc: { sequence: 72710671, reserve: '10000000' }, - }, -}; - -// This NOT result from Blockbook but actually result of code in this package. No one knows if it's really correct. -export const accountBalanceHistoryResult: AccountBalanceHistory[] = [ - { time: 1656677000, txs: 1, received: '27218439', sent: '0', sentToSelf: '0' }, - { time: 1672923931, txs: 1, received: '5612406', sent: '0', sentToSelf: '0' }, - { time: 1672924140, txs: 1, received: '0', sent: '6190000', sentToSelf: '0' }, - { time: 1675264280, txs: 1, received: '0', sent: '8000000', sentToSelf: '0' }, - { time: 1677679962, txs: 1, received: '7285344', sent: '0', sentToSelf: '0' }, - { time: 1678792680, txs: 1, received: '0', sent: '8400000', sentToSelf: '0' }, - { time: 1680675650, txs: 1, received: '6682802', sent: '0', sentToSelf: '0' }, - { time: 1681478740, txs: 1, received: '0', sent: '7400000', sentToSelf: '0' }, - { time: 1683270151, txs: 1, received: '10037222', sent: '0', sentToSelf: '0' }, - { time: 1688971822, txs: 1, received: '0', sent: '8100000', sentToSelf: '0' }, - { time: 1690884611, txs: 1, received: '0', sent: '5260', sentToSelf: '0' }, - { time: 1690884741, txs: 1, received: '5248', sent: '0', sentToSelf: '0' }, -].map(item => ({ - ...item, - received: new BigNumber(item.received), - sent: new BigNumber(item.sent), - sentToSelf: new BigNumber(item.sentToSelf), -})); diff --git a/suite-common/transaction-cache-engine/src/types.ts b/suite-common/transaction-cache-engine/src/types.ts deleted file mode 100644 index e145d31cdec9..000000000000 --- a/suite-common/transaction-cache-engine/src/types.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { NetworkSymbol } from '@suite-common/wallet-config'; -import { AccountTransaction, AccountInfo } from '@trezor/connect'; - -export type AccountUniqueKey = `${NetworkSymbol}-${AccountInfo['descriptor']}` & { - __accountKey: 'AccountKey'; -}; - -export type AccountUniqueParams = { - coin: NetworkSymbol; - descriptor: AccountInfo['descriptor']; -}; - -export type AccountBalanceHistory = { - time: number; - txs: number; - received: BigNumber; - sent: BigNumber; - sentToSelf: BigNumber; -}; - -export interface TransactionCacheEngineStorage { - init(): Promise; - accountExist(accountParams: AccountUniqueParams): Promise; - saveAccount(accountParams: AccountUniqueParams): Promise; - removeAccount(accountParams: AccountUniqueParams): Promise; - saveTransactions(params: { - account: AccountUniqueParams; - transactions: AccountTransaction[]; - }): Promise; - getNumberOfExistingTransactions( - params: { - txids: string[]; - } & AccountUniqueParams, - ): Promise; - getAccounts(): Promise; - getTransactions(params: AccountUniqueParams): Promise; -} diff --git a/suite-common/transaction-cache-engine/src/utils/asyncUtils.ts b/suite-common/transaction-cache-engine/src/utils/asyncUtils.ts deleted file mode 100644 index ce8cf84402f1..000000000000 --- a/suite-common/transaction-cache-engine/src/utils/asyncUtils.ts +++ /dev/null @@ -1,146 +0,0 @@ -/* eslint-disable require-await */ -/* eslint-disable @typescript-eslint/no-use-before-define */ - -import { AccountUniqueKey, AccountUniqueParams } from '../types'; - -/** - * @description This function will retry the promiseFn until it returns a response with success: true which is Trezor Connect specific. - */ -export function retryConnectPromise( - promiseFn: () => Promise, - maxRetries = Infinity, - timeout = 1000, -): Promise { - return new Promise((resolve, reject) => { - let attempts = 0; - - const executePromise = () => { - attempts++; - promiseFn() - .then(response => { - if (response.success) { - resolve(response); - } else { - retryOrReject(); - } - }) - .catch(retryOrReject); - }; - - const retryOrReject = () => { - if (attempts < maxRetries) { - setTimeout(executePromise, timeout); - } else { - reject(new Error('Max retries reached')); - } - }; - - executePromise(); - }); -} - -/** - * @description This function will ensure that there is only one ongoing promise for a given function with given arguments. - * If there is an ongoing promise, it will return the same promise. - */ - -export function ensureSingleRunningInstance Promise>( - func: T, -): T { - const ongoingPromises = new Map>(); - - return function (this: any, ...args: Parameters): ReturnType { - const key = JSON.stringify(args); - if (!ongoingPromises.has(key)) { - const promise = func.apply(this, args).finally(() => { - ongoingPromises.delete(key); - }); - ongoingPromises.set(key, promise); - } - - return ongoingPromises.get(key) as ReturnType; - } as unknown as T; -} - -/** - * @description This decorator will ensure that there is only one ongoing promise for a given function with given arguments. - * If there is an ongoing promise, it will return the same promise. - * This decorator can be used only on methods. - */ -export function EnsureSingleRunningInstance() { - return function Promise>( - originalMethod: T, - _context: ClassMethodDecoratorContext, - ) { - const replacementMethod = async function ( - this: any, - ...args: any[] - ): Promise> { - return ensureSingleRunningInstance(originalMethod).apply(this, args) as ReturnType; - } as unknown as T; - - return replacementMethod; - }; -} - -// Use global variable to keep track of currently running transaction fetches. -// It would be better to use something that works in context of class instance, but it's quite hard to that in decorators. -// We won't use more that one instance anyway so it's fine. -const transactionFetchesPromises = new Map>(); - -/** - * @description This decorator keep track of currently running transactions fetches. - * We need to know that because we need to wait for them to finish in other methods like getTransactions etc. - */ -export function TrackRunningTransactionFetches() { - return function ( - originalMethod: (args: AccountUniqueParams & any) => Promise, - _context: ClassMethodDecoratorContext, - ) { - function replacementMethod(this: any, args: AccountUniqueParams) { - const key = getAccountUniqueKey(args); - if (!transactionFetchesPromises.has(key)) { - const operation = originalMethod - .apply(this, [args]) - .finally(() => transactionFetchesPromises.delete(key)); - transactionFetchesPromises.set(key, operation); - - return operation; - } - - return transactionFetchesPromises.get(key)!; - } - - return replacementMethod; - }; -} - -/** - * @description This decorator will wait until all transaction fetches for that account are finished and then call method. - */ -export function WaitUntilFetchIsFinished() { - return function (originalMethod: any, _context: ClassMethodDecoratorContext) { - async function replacementMethod(this: any, args: AccountUniqueParams) { - const key = getAccountUniqueKey(args); - if (transactionFetchesPromises.has(key)) { - try { - await transactionFetchesPromises.get(key); - } catch (error) { - // Ignoring the error as per original logic - } - } - - return originalMethod.call(this, args); - } - - return replacementMethod; - }; -} - -/** - * @description This function will return a unique key for a given account. - * This key can be used to identify the account in the storage/cache etc. - */ -export function getAccountUniqueKey({ coin, descriptor }: AccountUniqueParams): AccountUniqueKey { - return `${coin}-${descriptor}` as AccountUniqueKey; -} diff --git a/suite-common/transaction-cache-engine/src/utils/balanceHistory.ts b/suite-common/transaction-cache-engine/src/utils/balanceHistory.ts deleted file mode 100644 index ada81ff3476e..000000000000 --- a/suite-common/transaction-cache-engine/src/utils/balanceHistory.ts +++ /dev/null @@ -1,132 +0,0 @@ -import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { AccountTransaction } from '@trezor/connect'; -import { NetworkSymbol, getNetworkType } from '@suite-common/wallet-config'; - -import { AccountBalanceHistory } from '../types'; - -const getAccountBalanceHistoryBTC = ({ - transactions, -}: { - transactions: AccountTransaction[]; -}): AccountBalanceHistory[] => { - const summaryMap = new Map(); - - transactions.forEach(tx => { - let ownInputIndex: number = -1; - let sentSat = new BigNumber(0); - let sentToSelfSat = new BigNumber(0); - let receivedSat = new BigNumber(0); - let countSentToSelf = false; - const { blockTime } = tx; - - if (!blockTime) { - return; - } - - for (let i = 0; i < tx.details.vin.length; i++) { - const tai = tx.details.vin[i]; - if (tai?.isOwn && tai.value) { - const taiValue = new BigNumber(tai.value); - if (ownInputIndex < 0) { - ownInputIndex = i; - } - - sentSat = sentSat.plus(taiValue); - if (ownInputIndex === i) { - countSentToSelf = true; - } - } - } - - for (let i = 0; i < tx.details.vout.length; i++) { - const tao = tx.details.vout[i]; - if (tao?.isOwn && tao.value) { - const taoValue = new BigNumber(tao.value); - receivedSat = receivedSat.plus(taoValue); - - if (countSentToSelf) { - sentToSelfSat = sentToSelfSat.plus(taoValue); - } - } - } - - if (summaryMap.has(blockTime)) { - const summary = summaryMap.get(blockTime)!; - summary.txs += 1; - summary.received = summary.received.plus(receivedSat); - summary.sent = summary.sent.plus(sentSat); - summary.sentToSelf = summary.sentToSelf.plus(sentToSelfSat); - } else { - summaryMap.set(blockTime, { - time: blockTime, - txs: 1, - received: receivedSat, - sent: sentSat, - sentToSelf: sentToSelfSat, - }); - } - }); - - return Array.from(summaryMap.values()).sort((a, b) => a.time - b.time); -}; - -const getAccountBalanceHistoryRipple = ({ - transactions, -}: { - transactions: AccountTransaction[]; -}): AccountBalanceHistory[] => { - const summaryMap = new Map(); - - transactions.forEach(tx => { - const { blockTime } = tx; - let sentDrops = new BigNumber(0); - let receivedDrops = new BigNumber(0); - - if (!blockTime) { - return; - } - - const amount = new BigNumber(tx.amount); - - if (tx.type === 'sent') { - sentDrops = amount; - } else if (tx.type === 'recv') { - receivedDrops = amount; - } - - if (summaryMap.has(blockTime)) { - const summary = summaryMap.get(blockTime)!; - summary.txs += 1; - summary.received = amount.plus(receivedDrops); - summary.sent = amount.plus(sentDrops); - } else { - summaryMap.set(blockTime, { - time: blockTime, - txs: 1, - received: receivedDrops, - sent: sentDrops, - sentToSelf: new BigNumber(0), - }); - } - }); - - return Array.from(summaryMap.values()).sort((a, b) => a.time - b.time); -}; - -export const getAccountBalanceHistory = ({ - transactions, - coin, -}: { - transactions: AccountTransaction[]; - coin: NetworkSymbol; -}): AccountBalanceHistory[] => { - const networkType = getNetworkType(coin); - switch (networkType) { - case 'bitcoin': - return getAccountBalanceHistoryBTC({ transactions }); - case 'ripple': - return getAccountBalanceHistoryRipple({ transactions }); - default: - throw new Error(`getAccountBalanceHistory: Unsupported network ${coin}`); - } -}; diff --git a/suite-common/transaction-cache-engine/src/utils/tests/asyncUtils.test.ts b/suite-common/transaction-cache-engine/src/utils/tests/asyncUtils.test.ts deleted file mode 100644 index c1a3f9da3395..000000000000 --- a/suite-common/transaction-cache-engine/src/utils/tests/asyncUtils.test.ts +++ /dev/null @@ -1,94 +0,0 @@ -/* eslint-disable require-await */ -import { retryConnectPromise, ensureSingleRunningInstance } from '../asyncUtils'; - -describe('retryPromise', () => { - let mockFunction: jest.Mock; - - beforeEach(() => { - mockFunction = jest.fn(); - }); - - afterEach(() => {}); - - test('should resolve successfully when promise succeeds', async () => { - mockFunction.mockResolvedValueOnce({ success: true }); - const result = await retryConnectPromise(mockFunction, 3, 1000); - expect(result).toEqual({ success: true }); - expect(mockFunction).toHaveBeenCalledTimes(1); - }); - - test('should retry until success is true', async () => { - mockFunction - .mockResolvedValueOnce({ success: false }) - .mockResolvedValueOnce({ success: false }) - .mockResolvedValueOnce({ success: true }); - - const promise = await retryConnectPromise(mockFunction, 5, 100); - - expect(mockFunction).toHaveBeenCalledTimes(3); - expect(promise).toEqual({ success: true }); - }); - - test('should retry on promise rejection and then resolve', async () => { - mockFunction.mockRejectedValueOnce(new Error('Error')).mockResolvedValue({ success: true }); - - const promise = await retryConnectPromise(mockFunction, 5, 100); - - expect(promise).toEqual({ success: true }); - expect(mockFunction).toHaveBeenCalledTimes(2); - }); - - test('should stop retrying after maximum retries are reached', async () => { - mockFunction.mockRejectedValue(new Error('Error')); - - const promise = retryConnectPromise(mockFunction, 3, 100); - - await expect(promise).rejects.toThrow(); - expect(mockFunction).toHaveBeenCalledTimes(3); - }); -}); - -describe('ensureSingleRunningInstance', () => { - // Mock function that returns a promise - const mockAsyncFunction = jest.fn( - (arg: number) => - new Promise(resolve => { - setTimeout(() => resolve(arg), 100); - }), - ); - - const singleMockAsyncFunction = ensureSingleRunningInstance(mockAsyncFunction); - - beforeEach(() => { - mockAsyncFunction.mockClear(); - }); - - test('should return a promise', async () => { - const result = singleMockAsyncFunction(1); - expect(result).toBeInstanceOf(Promise); - }); - - test('should return same promise for concurrent calls with same arguments', () => { - const promise1 = singleMockAsyncFunction(1); - const promise2 = singleMockAsyncFunction(1); - expect(promise1).toBe(promise2); - }); - - test('should return different promises for calls with different arguments', () => { - const promise1 = singleMockAsyncFunction(1); - const promise2 = singleMockAsyncFunction(2); - expect(promise1).not.toBe(promise2); - }); - - test('should resolve promises correctly', async () => { - const result = await singleMockAsyncFunction(1); - expect(result).toBe(1); - }); - - test('should clear the ongoing promise map after resolution', async () => { - const promise1 = singleMockAsyncFunction(1); - await promise1; - const promise2 = singleMockAsyncFunction(1); - expect(promise1).not.toBe(promise2); - }); -}); diff --git a/suite-common/transaction-cache-engine/tsconfig.json b/suite-common/transaction-cache-engine/tsconfig.json deleted file mode 100644 index 32fefa32c693..000000000000 --- a/suite-common/transaction-cache-engine/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "libDev", - "noUncheckedIndexedAccess": true, - "noUnusedLocals": false - }, - "references": [ - { "path": "../wallet-config" }, - { "path": "../../packages/connect" }, - { "path": "../../packages/utils" } - ] -} diff --git a/suite-native/accounts/package.json b/suite-native/accounts/package.json index 9a4b67bf1d4f..b1d88ea60e3f 100644 --- a/suite-native/accounts/package.json +++ b/suite-native/accounts/package.json @@ -17,7 +17,6 @@ "@suite-common/formatters": "workspace:*", "@suite-common/icons": "workspace:*", "@suite-common/redux-utils": "workspace:*", - "@suite-common/transaction-cache-engine": "workspace:*", "@suite-common/validators": "workspace:*", "@suite-common/wallet-config": "workspace:*", "@suite-common/wallet-core": "workspace:*", diff --git a/suite-native/accounts/src/hooks/useTransactionCache.ts b/suite-native/accounts/src/hooks/useTransactionCache.ts deleted file mode 100644 index 60acdb768cff..000000000000 --- a/suite-native/accounts/src/hooks/useTransactionCache.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { useEffect } from 'react'; -import { useSelector } from 'react-redux'; - -import { TransactionCacheEngine } from '@suite-common/transaction-cache-engine'; -import { selectAccounts } from '@suite-common/wallet-core'; - -export const useTransactionCache = () => { - const accounts = useSelector(selectAccounts); - - useEffect(() => { - accounts.forEach(account => { - // TODO: add support for other coins - if (account.networkType === 'ripple') { - TransactionCacheEngine.addAccount({ - coin: account.symbol, - descriptor: account.descriptor, - }); - } - }); - }, [accounts]); -}; diff --git a/suite-native/accounts/src/index.ts b/suite-native/accounts/src/index.ts index 947c9735c0e2..d0409b35fb2d 100644 --- a/suite-native/accounts/src/index.ts +++ b/suite-native/accounts/src/index.ts @@ -7,6 +7,4 @@ export * from './components/SelectableNetworkItem'; export * from './components/GroupedAccountsList'; export * from './hooks/useAccountLabelForm'; export * from './selectors'; -export * from './transactionCacheMiddleware'; -export * from './hooks/useTransactionCache'; export * from './hooks/useAccountAlerts'; diff --git a/suite-native/accounts/src/transactionCacheMiddleware.ts b/suite-native/accounts/src/transactionCacheMiddleware.ts deleted file mode 100644 index 0bc3e0795a34..000000000000 --- a/suite-native/accounts/src/transactionCacheMiddleware.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { TransactionCacheEngine } from '@suite-common/transaction-cache-engine'; -import { createMiddlewareWithExtraDeps } from '@suite-common/redux-utils'; -import { accountsActions } from '@suite-common/wallet-core'; - -export const prepareTransactionCacheMiddleware = createMiddlewareWithExtraDeps( - (action, { next }) => { - if (accountsActions.removeAccount.match(action)) { - action.payload.forEach(account => { - TransactionCacheEngine.removeAccount({ - coin: account.symbol, - descriptor: account.descriptor, - }); - }); - } - - return next(action); - }, -); diff --git a/suite-native/accounts/tsconfig.json b/suite-native/accounts/tsconfig.json index 1bfd2aeb4da8..9fd3724ecd22 100644 --- a/suite-native/accounts/tsconfig.json +++ b/suite-native/accounts/tsconfig.json @@ -9,9 +9,6 @@ { "path": "../../suite-common/redux-utils" }, - { - "path": "../../suite-common/transaction-cache-engine" - }, { "path": "../../suite-common/validators" }, diff --git a/suite-native/app/package.json b/suite-native/app/package.json index 85a072ee8a3e..81d031843ca4 100644 --- a/suite-native/app/package.json +++ b/suite-native/app/package.json @@ -36,7 +36,6 @@ "@suite-common/redux-utils": "workspace:*", "@suite-common/suite-constants": "workspace:*", "@suite-common/token-definitions": "workspace:*", - "@suite-common/transaction-cache-engine": "workspace:*", "@suite-common/wallet-core": "workspace:*", "@suite-native/accounts": "workspace:*", "@suite-native/alerts": "workspace:*", diff --git a/suite-native/app/src/App.tsx b/suite-native/app/src/App.tsx index 69c1dd11732f..0c812503b658 100644 --- a/suite-native/app/src/App.tsx +++ b/suite-native/app/src/App.tsx @@ -11,7 +11,6 @@ import { FormatterProvider } from '@suite-common/formatters'; import { NavigationContainerWithAnalytics } from '@suite-native/navigation'; import { FeatureMessageScreen, MessageSystemBannerRenderer } from '@suite-native/message-system'; import { IntlProvider } from '@suite-native/intl'; -import { useTransactionCache } from '@suite-native/accounts'; import { isDebugEnv } from '@suite-native/config'; import { RootStackNavigator } from './navigation/RootStackNavigator'; @@ -41,7 +40,6 @@ const AppComponent = () => { const isConnectInitialized = useSelector(selectIsConnectInitialized); useReportAppInitToAnalytics(APP_STARTED_TIMESTAMP); - useTransactionCache(); useEffect(() => { if (!isConnectInitialized) { diff --git a/suite-native/app/src/initActions.ts b/suite-native/app/src/initActions.ts index d988620209fa..6762fa3a8514 100644 --- a/suite-native/app/src/initActions.ts +++ b/suite-native/app/src/initActions.ts @@ -11,7 +11,6 @@ import { selectFiatCurrencyCode } from '@suite-native/settings'; import { initMessageSystemThunk } from '@suite-common/message-system'; import { setIsAppReady, setIsConnectInitialized } from '@suite-native/state/src/appSlice'; import { periodicCheckTokenDefinitionsThunk } from '@suite-common/token-definitions'; -import { TransactionCacheEngine } from '@suite-common/transaction-cache-engine'; let isAlreadyInitialized = false; @@ -32,8 +31,6 @@ export const applicationInit = createThunk( await dispatch(connectInitThunk()); - TransactionCacheEngine.init(); - dispatch(setIsConnectInitialized(true)); dispatch(initBlockchainThunk()); diff --git a/suite-native/app/tsconfig.json b/suite-native/app/tsconfig.json index a27f84004b94..9cfdb3170bde 100644 --- a/suite-native/app/tsconfig.json +++ b/suite-native/app/tsconfig.json @@ -24,9 +24,6 @@ { "path": "../../suite-common/token-definitions" }, - { - "path": "../../suite-common/transaction-cache-engine" - }, { "path": "../../suite-common/wallet-core" }, diff --git a/suite-native/state/src/store.ts b/suite-native/state/src/store.ts index 322d71d8e17f..967235b71251 100644 --- a/suite-native/state/src/store.ts +++ b/suite-native/state/src/store.ts @@ -5,7 +5,6 @@ import { prepareFiatRatesMiddleware } from '@suite-common/wallet-core'; import { messageSystemMiddleware } from '@suite-native/message-system'; import { prepareButtonRequestMiddleware, prepareDeviceMiddleware } from '@suite-native/device'; import { prepareDiscoveryMiddleware } from '@suite-native/discovery'; -import { prepareTransactionCacheMiddleware } from '@suite-native/accounts'; import { blockchainMiddleware } from '@suite-native/blockchain'; import { extraDependencies } from './extraDependencies'; @@ -18,13 +17,12 @@ const middlewares: Middleware[] = [ prepareDeviceMiddleware(extraDependencies), prepareButtonRequestMiddleware(extraDependencies), prepareDiscoveryMiddleware(extraDependencies), - prepareTransactionCacheMiddleware(extraDependencies), ]; const enhancers: Array> = []; if (__DEV__) { - enhancers.push(devToolsEnhancer({ maxAge: 150, trace: true })!); + enhancers.push(devToolsEnhancer({ maxAge: 150 })!); } export const initStore = async () => diff --git a/tsconfig.json b/tsconfig.json index 64f885eefe45..9aed61da9638 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -32,9 +32,6 @@ { "path": "suite-common/token-definitions" }, - { - "path": "suite-common/transaction-cache-engine" - }, { "path": "suite-common/validators" }, { "path": "suite-common/wallet-config" }, { diff --git a/yarn.lock b/yarn.lock index 0fdcf14f3f3d..ae44f3a95b43 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8602,7 +8602,6 @@ __metadata: "@suite-common/fiat-services": "workspace:*" "@suite-common/suite-config": "workspace:*" "@suite-common/suite-utils": "workspace:*" - "@suite-common/transaction-cache-engine": "workspace:*" "@suite-common/wallet-config": "workspace:*" "@suite-common/wallet-core": "workspace:*" "@suite-common/wallet-types": "workspace:*" @@ -8817,17 +8816,6 @@ __metadata: languageName: unknown linkType: soft -"@suite-common/transaction-cache-engine@workspace:*, @suite-common/transaction-cache-engine@workspace:suite-common/transaction-cache-engine": - version: 0.0.0-use.local - resolution: "@suite-common/transaction-cache-engine@workspace:suite-common/transaction-cache-engine" - dependencies: - "@mobily/ts-belt": "npm:^3.13.1" - "@suite-common/wallet-config": "workspace:*" - "@trezor/connect": "workspace:*" - "@trezor/utils": "workspace:*" - languageName: unknown - linkType: soft - "@suite-common/validators@workspace:*, @suite-common/validators@workspace:suite-common/validators": version: 0.0.0-use.local resolution: "@suite-common/validators@workspace:suite-common/validators" @@ -8947,7 +8935,6 @@ __metadata: "@suite-common/formatters": "workspace:*" "@suite-common/icons": "workspace:*" "@suite-common/redux-utils": "workspace:*" - "@suite-common/transaction-cache-engine": "workspace:*" "@suite-common/validators": "workspace:*" "@suite-common/wallet-config": "workspace:*" "@suite-common/wallet-core": "workspace:*" @@ -9027,7 +9014,6 @@ __metadata: "@suite-common/redux-utils": "workspace:*" "@suite-common/suite-constants": "workspace:*" "@suite-common/token-definitions": "workspace:*" - "@suite-common/transaction-cache-engine": "workspace:*" "@suite-common/wallet-core": "workspace:*" "@suite-native/accounts": "workspace:*" "@suite-native/alerts": "workspace:*"