send-crypto
Version:
A minimal JavaScript library / wallet for sending crypto assets
45 lines (44 loc) • 2.18 kB
TypeScript
import BigNumber from "bignumber.js";
import { PromiEvent } from "../../lib/promiEvent";
import { UTXO } from "../../lib/utxo";
import { Asset, Handler } from "../../types/types";
interface AddressOptions {
}
interface BalanceOptions extends AddressOptions {
address?: string;
confirmations?: number;
}
interface TxOptions extends BalanceOptions {
fee?: number;
subtractFee?: boolean;
}
export declare const _apiFallbacks: {
fetchUTXO: (testnet: boolean, txHash: string, vOut: number) => ((() => Promise<UTXO>) | undefined)[];
fetchUTXOs: (testnet: boolean, address: string, confirmations: number) => ((() => Promise<readonly UTXO[]>) | undefined)[];
fetchTXs: (testnet: boolean, address: string, confirmations?: number) => ((() => Promise<readonly UTXO[]>) | undefined)[];
broadcastTransaction: (testnet: boolean, hex: string) => ((() => Promise<string>) | undefined)[];
};
export declare class BCHHandler implements Handler {
private readonly privateKey;
private readonly testnet;
private readonly decimals;
static getUTXOs: (testnet: boolean, options: {
address: string;
confirmations?: number;
}) => Promise<readonly UTXO[]>;
static getUTXO: (testnet: boolean, txHash: string, vOut: number) => Promise<UTXO>;
static getTransactions: (testnet: boolean, options: {
address: string;
confirmations?: number;
}) => Promise<readonly UTXO[]>;
constructor(privateKey: string, network: string);
readonly handlesAsset: (asset: Asset) => boolean;
readonly address: (asset: Asset, options?: AddressOptions | undefined) => Promise<string>;
readonly getBalance: (asset: Asset, options?: BalanceOptions | undefined) => Promise<BigNumber>;
readonly getBalanceInSats: (asset: Asset, options?: BalanceOptions | undefined) => Promise<BigNumber>;
readonly send: (to: string, value: BigNumber, asset: Asset, options?: TxOptions | undefined) => PromiEvent<string>;
readonly sendSats: (to: string, valueIn: BigNumber, asset: Asset, options?: TxOptions | undefined) => PromiEvent<string>;
private readonly _getConfirmations;
private readonly _bitgoNetwork;
}
export {};