UNPKG

@tangany/waas

Version:

node.js SDK for Tangany Wallet as a Service API

36 lines (35 loc) 1.48 kB
import { IBitcoinTransaction, IBtcStatus } from "./interfaces/bitcoin"; import { Waas } from "./waas"; import { IWaasMethod } from "./waas-method"; export declare class Bitcoin implements IWaasMethod { waas: Waas; private readonly transactionHash?; /** * Instantiates a new Bitcoin interface * @param waas - {@link Waas} instance * @param [transactionHash] - Bitcoin transaction hash */ constructor(waas: Waas, transactionHash?: string | undefined); get txHash(): string | undefined; /** * Returns the status for a Bitcoin transaction * @see [docs]{@link https://docs.tangany.com/#e9f7074c-50ea-432c-8835-1d278ad68f1c} */ get(): Promise<IBitcoinTransaction>; /** * Establish a sticky session with a Bitcoin full node by fetching and setting affinity cookies for the current Waas instance */ fetchAffinityCookie(): Promise<void>; /** * Helper: resolves when transaction is mined and rejects on errors or timeout * Attention: method polls the API frequently and may result in high quota usage * @param [timeout] - reject timeout in ms * @param [ms] - milliseconds delay between api polling attempts */ wait(timeout?: number, ms?: number): Promise<IBitcoinTransaction>; /** * Get status and information about Bitcoin full-node. * The status unavailable is returned if info properties could not be received. */ getStatus(): Promise<IBtcStatus>; }