UNPKG

@xchainjs/xchain-dash

Version:

Custom Dash client and utilities used by XChainJS clients

40 lines (39 loc) 1.88 kB
import { FeeRate, TxHash } from '@xchainjs/xchain-client'; import { Address } from '@xchainjs/xchain-util'; import { TxParams } from '@xchainjs/xchain-utxo'; import { ECPairInterface } from 'ecpair'; import { Client } from './client'; export declare class ClientKeystore extends Client { /** * Get the DASH address corresponding to the given index. * @deprecated This function will be removed eventually. Use getAddressAsync instead. * @param {number} index The index of the address. * @returns {Address} The DASH address. * @throws {"index must be greater than zero"} Thrown if index is less than zero. * @throws {"Phrase must be provided"} Thrown if phrase is not provided. * @throws {"Address not defined"} Thrown if address is not defined. */ getAddress(index?: number): Address; /** * Asynchronously get the DASH address corresponding to the given index. * @param {number} index The index of the address. * @returns {Promise<string>} A promise resolving to the DASH address. */ getAddressAsync(index?: number): Promise<string>; /** * Get the private and public keys for DASH. * @param {string} phrase The phrase used to derive keys. * @param {number} index The index for key derivation. * @returns {Dash.ECPairInterface} The DASH ECPairInterface object. * @throws {"Could not get private key from phrase"} Thrown if private key cannot be obtained from the phrase. */ getDashKeys(phrase: string, index?: number): ECPairInterface; /** * Asynchronously transfers assets between addresses. * @param {TxParams & { feeRate?: FeeRate }} params - Parameters for the transfer. * @returns {Promise<TxHash>} A promise resolving to the transaction hash. */ transfer(params: TxParams & { feeRate?: FeeRate; }): Promise<TxHash>; }