@xchainjs/xchain-litecoin
Version:
Custom Litecoin client and utilities used by XChainJS clients
51 lines (50 loc) • 2.1 kB
TypeScript
import { FeeRate, TxHash } from '@xchainjs/xchain-client';
import { Address } from '@xchainjs/xchain-util';
import { TxParams } from '@xchainjs/xchain-utxo';
import { Client } from './client';
export declare class ClientKeystore extends Client {
/**
* [DEPRECATED] Retrieves the address at the specified index.
*
* @deprecated Use `getAddressAsync` instead.
* @param {number} index The index of the address.
* @returns {Address} The address at the specified index.
* @throws {Error} Thrown when the index is less than zero.
* @throws {Error} Thrown when the phrase has not been set.
* @throws {Error} Thrown when the address cannot be defined.
*/
getAddress(index?: number): Address;
/**
* Retrieves the current address asynchronously.
*
* Generates a network-specific key-pair by first converting the buffer to a Wallet-Import-Format (WIF)
* The address is then decoded into type P2WPKH and returned.
*
* @returns {Address} A promise that resolves to the current address
*
* @throws {"Phrase must be provided"} Thrown if phrase has not been set before.
* @throws {"Address not defined"} Thrown if failed creating account from phrase.
*/
getAddressAsync(walletIndex?: number): Promise<Address>;
/**
* Transfers Litecoin (LTC) from one address to another.
*
* @param {TxParams & { feeRate?: FeeRate }} params The transfer options.
* @returns {Promise<TxHash>} A promise that resolves to the transaction hash.
*/
transfer(params: TxParams & {
feeRate?: FeeRate;
}): Promise<TxHash>;
/**
* @private
* [PRIVATE] Retrieves the private key.
*
* Private function to get keyPair from the this.phrase
*
* @param {string} phrase The phrase used to generate the private key.
* @returns {ECPairInterface} The privkey generated from the given phrase
*
* @throws {"Could not get private key from phrase"} Throws an error if failed creating LTC keys from the given phrase
* */
private getLtcKeys;
}