Client

Extends xchain_client_1.BaseXChainClient

Generic implementation of the XChainClient interface chains built with cosmos-sdk (https://docs.cosmos.network/) using the dependencies of the official @cosmjs monorepo.

Parameters

  • params CosmosSdkClientParams client configuration (prefix, decimal, fees, urls…)

getFees

This function returns the fee object in a generalised way for a simple transfer function. In this case this funcion use the default fee defined in the constructor.

Returns Fees fees estimation for average, fast and fastests scenarios.

getAddress

Parameters

  • walletIndex

Meta

  • deprecated: this function eventually will be removed use getAddressAsync instead

getAddressAsync

Get an address derived from the phrase defined in the constructor.

Parameters

  • index (optional, default 0)
  • walletIndex (number | undefined) derivation path index of address that will be generated

Returns string user address at index defined on walletIndex

validateAddress

Validate the address format.

Parameters

  • address string address to be validated

Returns boolean represents whether the address is valid or invalid

getBalance

Obtains all the balances of the address passed as parameter for all the assets of the network. For the moment for this client the assets parameter is ignored. Do not hesitate to open a PR if you need it and it is not yet available.

Parameters

  • address string address to be validated
  • _assets (Array<Asset> | undefined) IGNORED FOR THIS IMPLEMENTATION

Returns Array<Balance> array of balances

getTransactions

Get transactions filtered using params

Parameters

  • params (TxHistoryParams | undefined) Only param address IS SUPPORTED FOR THIS CLIENT, new feature will be added in the future

Returns TxsPage array of balances

getTransactionData

Get transaction info using txId

Parameters

  • txId string Idetifier of transaction
  • _assetAddress

Returns Tx Transaction data

prepareTx

Prepare transfer.

Parameters

  • params TxParams&Address The transfer options.
    • params.sender
    • params.recipient
    • params.asset
    • params.amount
    • params.memo

Returns PreparedTx The raw unsigned transaction.