UNPKG

@xchainjs/xchain-cosmos

Version:

Custom Cosmos client and utilities used by XChainJS clients

34 lines (33 loc) 1.41 kB
import { Client, CosmosClientParams } from './client'; import { TxParams } from './types'; export declare class ClientKeystore extends Client { constructor(params?: CosmosClientParams); /** * Asynchronous version of getAddress method. * @param {number} index Derivation path index of the address to be generated. * @returns {string} A promise that resolves to the generated address. */ getAddressAsync(index?: number): Promise<string>; /** * Get the address derived from the provided phrase. * @param {number | undefined} walletIndex The index of the address derivation path. Default is 0. * @returns {string} The user address at the specified walletIndex. */ getAddress(walletIndex?: number | undefined): string; transfer(params: TxParams): Promise<string>; /** * Hashes a buffer using SHA256 followed by RIPEMD160 or RMD160. * @param {Uint8Array} buffer The buffer to hash * @returns {Uint8Array} The hashed buffer */ private hash160; /** * Sign a transaction making a round robin over the clients urls provided to the client * * @param {string} sender Sender address * @param {DecodedTxRaw} unsignedTx Unsigned transaction * @param {DirectSecp256k1HdWallet} signer Signer * @returns {DeliverTxResponse} The transaction broadcasted */ private roundRobinSignAndBroadcast; }