@bigmi/core
Version:
TypeScript library for Bitcoin apps.
35 lines (34 loc) • 1.47 kB
TypeScript
import { Transaction } from 'bitcoinjs-lib';
import type { Chain } from '../types/chain.js';
import type { Client } from '../types/client.js';
import type { UTXOTransaction } from '../types/transaction.js';
import type { Transport } from '../types/transport.js';
export type ReplacementReason = 'cancelled' | 'replaced' | 'repriced';
export type ReplacementReturnType = {
reason: ReplacementReason;
replacedTransaction: Transaction;
transaction: UTXOTransaction;
};
export type WaitForTransactionReceiptReturnType = UTXOTransaction;
export type WithRetryParameters = {
delay?: ((config: {
count: number;
error: Error;
}) => number) | number | undefined;
retryCount?: number | undefined;
};
export type WaitForTransactionReceiptParameters = {
txId: string;
txHex: string;
senderAddress?: string;
confirmations?: number | undefined;
onReplaced?: ((response: ReplacementReturnType) => void) | undefined;
pollingInterval?: number | undefined;
retryCount?: number;
retryDelay?: ((config: {
count: number;
error: Error;
}) => number) | number;
timeout?: number | undefined;
};
export declare function waitForTransaction<chain extends Chain | undefined>(client: Client<Transport, chain>, { confirmations, txId, txHex, senderAddress, onReplaced, pollingInterval, retryCount, retryDelay, timeout, }: WaitForTransactionReceiptParameters): Promise<WaitForTransactionReceiptReturnType>;