Client
Extends xchain_client_1.BaseXChainClient
Custom Cosmos client
Parameters
paramsXChainClientParamsparams.network(optional, defaultxchain_client_1.Network.Mainnet)params.phraseparams.clientUrls(optional, defaultutils_1.getDefaultClientUrls())params.chainIds(optional, defaultutils_1.getDefaultChainIds())params.rootDerivationPaths(optional, defaultutils_1.getDefaultRootDerivationPaths())
setNetwork
Updates current network.
Parameters
networkNetwork
Returns void
getExplorerUrl
Get the explorer url.
Returns string The explorer url.
getExplorerAddressUrl
Get the explorer url for the given address.
Parameters
addressAddress
Returns string The explorer url for the given address.
getExplorerTxUrl
Get the explorer url for the given transaction id.
Parameters
txIDstring
Returns string The explorer url for the given transaction id.
getAddress
Parameters
index(optional, default0)
Meta
- deprecated: this function eventually will be removed use getAddressAsync instead
getAddressAsync
Get the current address.
Parameters
-
index(optional, default0) -
Throws Error Thrown if phrase has not been set before. A phrase is needed to create a wallet and to derive an address from it.
Returns Address The current address.
validateAddress
Validate the given address.
Parameters
addressAddress
Returns boolean true or false
getBalance
Get the balance of a given address.
Parameters
addressAddress By default, it will return the balance of the current wallet. (optional)assetsassetAsset If not set, it will return all assets available. (optional)
Returns Array<Balance> The balance of the address.
getAssetInfo
Returns any asset info
getTransactions
Get transaction history of a given address and asset with pagination options. If asset is not set, history will include ATOM txs only By default it will return the transaction history of the current wallet.
Parameters
paramsTxHistoryParams The options to get transaction history. (optional)
Returns TxsPage The transaction history.
getTransactionData
Get the transaction details of a given transaction id. Supports ATOM txs only.
Parameters
txIdstring The transaction id.
Returns Tx The transaction details of the given transaction id.
transfer
Transfer balances.
Parameters
paramsTxParams The transfer options.params.walletIndex(optional, default0)params.asset(optional, defaultconst_1.AssetATOM)params.amountparams.recipientparams.memoparams.gasLimit(optional, defaultnew bignumber_js_1.default(const_1.DEFAULT_GAS_LIMIT))params.feeAmount(optional, defaultconst_1.DEFAULT_FEE)
Returns TxHash The transaction hash.
transferOffline
Transfer offline balances.
Parameters
paramsTxOfflineParams The transfer offline options.params.walletIndexparams.asset(optional, defaultconst_1.AssetATOM)params.amountparams.recipientparams.memoparams.from_account_numberparams.from_sequenceparams.gasLimit(optional, defaultnew bignumber_js_1.default(const_1.DEFAULT_GAS_LIMIT))params.feeAmount(optional, defaultconst_1.DEFAULT_FEE)
Returns string The signed transaction bytes.
getFees
Returns fees. It tries to get chain fees from THORChain inbound_addresses first If it fails, it returns DEFAULT fees.
Returns Fees Current fees
prepareTx
Prepare transfer.
Parameters
paramsTxParams&Address&BaseAmount&BigNumber The transfer options.params.senderparams.recipientparams.amountparams.memoparams.asset(optional, defaultconst_1.AssetATOM)params.feeAmount(optional, defaultconst_1.DEFAULT_FEE)params.gasLimit(optional, defaultnew bignumber_js_1.default(const_1.DEFAULT_GAS_LIMIT))
Returns PreparedTx The raw unsigned transaction.