@xchainjs/xchain-zcash
Version:
Custom Zcash client and utilities used by XChainJS clients
46 lines (45 loc) • 2.03 kB
TypeScript
import { TxHash } from '@xchainjs/xchain-client';
import { Address } from '@xchainjs/xchain-util';
import { TxParams, UtxoClientParams } from '@xchainjs/xchain-utxo';
import { Client } from './client';
/**
* Custom Bitcoin client extended to support keystore functionality
*/
declare class ClientKeystore extends Client {
constructor(params?: UtxoClientParams);
/**
* @deprecated This function eventually will be removed. Use getAddressAsync instead.
* Get the address associated with the given index.
* @param {number} index The index of the address.
* @returns {Address} The Bitcoin address.
* @throws {"index must be greater than zero"} Thrown if the index is less than zero.
* @throws {"Phrase must be provided"} Thrown if the phrase has not been set before.
*/
getAddress(index?: number): Address;
/**
* Get the current address asynchronously.
* @param {number} index The index of the address.
* @returns {Promise<Address>} A promise that resolves to the Bitcoin address.
* @throws {"Phrase must be provided"} Thrown if the phrase has not been set before.
*/
getAddressAsync(index?: number): Promise<string>;
/**
* @private
* Get the keys derived from the given phrase.
*
* @param {string} phrase The phrase to be used for generating the keys.
* @param {number} index The index of the address.
* @returns {Bitcoin.ECPair.ECPairInterface} The Bitcoin key pair.
* @throws {"Could not get private key from phrase"} Thrown if failed to create BTC keys from the given phrase.
*/
private getZecKeys;
/**
* Transfer ZEC.
*
* @param {TxParams&FeeRate} params The transfer options including the fee rate.
* @returns {Promise<TxHash|string>} A promise that resolves to the transaction hash or an error message.
* @throws {"memo too long"} Thrown if the memo is longer than 80 characters.
*/
transfer(params: TxParams): Promise<TxHash>;
}
export { ClientKeystore };