UNPKG

@xchainjs/xchain-thorchain

Version:

Custom Thorchain client and utilities used by XChainJS clients

70 lines (69 loc) 3.4 kB
import Transport from '@ledgerhq/hw-transport'; import { Client, ThorchainClientParams } from './client'; import { DepositParam, TxParams } from './types'; /** * Thorchain Ledger client */ export declare class ClientLedger extends Client { private app; constructor(params: ThorchainClientParams & { transport: Transport; }); /** * Asynchronous version of getAddress method. * @param {number} index Derivation path index of the address to be generated. * @param {boolean} verify True to check the address against the Ledger device, otherwise false * @returns {string} A promise that resolves to the generated address. */ getAddressAsync(index?: number, verify?: boolean): Promise<string>; /** * @deprecated * Asynchronous version of getAddress method. Not supported for ledger client * @throws {Error} Not supported method */ getAddress(): string; /** * Transfers RUNE or synth token * * @param {TxParams} params The transfer options. * @param {number} params.walletIndex Optional - The index to use to generate the address from the transaction will be done. * If it is not set, address associated with index 0 will be used * @param {asset} params.asset Optional - The asset that will be deposit. If it is not set, Thorchain native asset will be * used * @param {BaseAmount} params.amount The amount that will be transfer * @param {string} params.recipient Recipient of the transfer * @param {string} params.memo Optional - The memo associated with the transfer * @returns {TxHash} The transaction hash. */ transfer(params: TxParams): Promise<string>; /** * Make a deposit * * @param {number} param.walletIndex Optional - The index to use to generate the address from the transaction will be done. * If it is not set, address associated with index 0 will be used * @param {Asset} param.asset Optional - The asset that will be deposit. If it is not set, Thorchain native asset will be * used * @param {BaseAmount} param.amount The amount that will be deposit * @param {string} param.memo Optional - The memo associated with the deposit * @param {BigNumber} param.gasLimit Optional - The limit amount of gas allowed to spend in the deposit. If not set, default * value of 600000000 will be used * @returns {string} The deposit hash */ deposit({ walletIndex, asset, amount, memo, gasLimit, }: DepositParam): Promise<string>; /** * @deprecated * Create a transaction and sign it without broadcasting it * * @param {TxParams} params The transfer options. * @param {number} params.walletIndex Optional - The index to use to generate the address from the transaction will be done. * If it is not set, address associated with index 0 will be used * @param {asset} params.asset Optional - The asset that will be deposit. If it is not set, Thorchain native asset will be * used * @param {BaseAmount} params.amount The amount that will be transfer * @param {string} params.recipient Recipient of the transfer * @param {string} params.memo Optional - The memo associated with the transfer * @returns {TxHash} The transaction hash. */ transferOffline(params: TxParams): Promise<string>; private getProtocolAminoMessages; }