UNPKG

@tangany/waas

Version:

node.js SDK for Tangany Wallet as a Service API

53 lines (52 loc) 2.4 kB
import { BlockchainWallet } from "./blockchain-wallet"; import { IAsyncBitcoinTransactionOutput, IBitcoinSweepResult, IBitcoinTransactionEstimation, IBtcRecipient, IBtcWalletBalance } from "./interfaces/bitcoin"; import { Waas } from "./waas"; import { Request } from "./request"; import { Wallet } from "./wallet"; /** * Represents a new Bitcoin wallet interface * @param instance - axios instance created by {@link Waas} * @param walletInstance - instance of Wallet class */ export declare class BtcWallet extends BlockchainWallet { private readonly baseUrl; constructor(waas: Waas, walletInstance: Wallet); /** * Returns wallet metrics for the Bitcoin blockchain (BTC balance, wallet address) * @see [docs]{@link https://docs.tangany.com/#ccedf387-e9f9-4118-985c-d434e762b6fe} */ get(): Promise<IBtcWalletBalance>; /** * Send BTC from the current wallet to the given recipients in an *asynchronous* manner. * @param recipients - Recipient configuration */ sendAsync(recipients: IBtcRecipient[] | IBtcRecipient): Promise<Request<IAsyncBitcoinTransactionOutput>>; /** * Estimate sending fee in BTC for given recipients * @param recipientsObject - a recipients configuration object * @param sweep - indicates if it is an estimation for a sweeping operation * @see [docs]{@link https://docs.tangany.com/#7272d8f1-38d5-4ee7-9c69-2154405bb83b} */ estimateFee(recipientsObject: IBtcRecipient[] | IBtcRecipient, sweep?: boolean): Promise<IBitcoinTransactionEstimation>; /** * Transfers all available funds minus the transaction fees to the specified wallet or address. * One of the two properties from the parameter object must be set. * If both are set, the specified address needs to belong to the wallet. * @param to - Definition of the target using a Bitcoin address * @param wallet - Definition of the target using a wallet name of the current key vault */ sweepAsync({ to, wallet }: { to?: string; wallet?: string; }): Promise<Request<IBitcoinSweepResult>>; /** * @deprecated do not use outside of unit tests */ __test_getRecipientsData: (...args: any) => IBtcRecipient | { list: IBtcRecipient[]; }; /** * convert recipients sdk argument to api data object */ private readonly getRecipientsData; }