@arklabs/wallet-sdk
Version:
Bitcoin wallet SDK with Taproot and Ark integration
37 lines (36 loc) • 1.14 kB
TypeScript
import type { NetworkName } from "../networks";
import { Coin } from "../wallet";
export declare const ESPLORA_URL: Record<NetworkName, string>;
export type ExplorerTransaction = {
txid: string;
vout: {
scriptpubkey_address: string;
value: bigint;
}[];
status: {
confirmed: boolean;
block_time: number;
};
};
export interface OnchainProvider {
getCoins(address: string): Promise<Coin[]>;
getFeeRate(): Promise<number>;
broadcastTransaction(txHex: string): Promise<string>;
getTxOutspends(txid: string): Promise<{
spent: boolean;
txid: string;
}[]>;
getTransactions(address: string): Promise<ExplorerTransaction[]>;
}
export declare class EsploraProvider implements OnchainProvider {
private baseUrl;
constructor(baseUrl: string);
getCoins(address: string): Promise<Coin[]>;
getFeeRate(): Promise<number>;
broadcastTransaction(txHex: string): Promise<string>;
getTxOutspends(txid: string): Promise<{
spent: boolean;
txid: string;
}[]>;
getTransactions(address: string): Promise<ExplorerTransaction[]>;
}