Utils

isMsgSend

Type guard for MsgSend

Parameters

  • msg Msg

Returns boolean true or false.

isMsgMultiSend

Type guard for MsgMultiSend

Parameters

  • msg Msg

Returns boolean true or false.

getDenom

Get denomination from Asset - currently ATOM supported only

Parameters

  • asset Asset

Returns string The denomination of the given asset.

getAsset

Get Asset from denomination

Parameters

Returns (Asset | null) The asset of the given denomination.

getCoinAmount

Parses amount from ICoin[]

Parameters

  • coins
  • coinst Array<ICoin> List of coins

Returns BaseAmount Coin amount

getCoinsByAsset

Filters ICoin[] by given Asset

Parameters

  • coins
  • asset Asset Asset to filter coins
  • coinst Array<ICoin> List of coins

Returns Array<ICoin> Filtered list

getTxsFromHistory

Parses transaction history

Parameters

  • txs Array<TxResponse> The transaction response from the node.
  • asset Asset Asset to get history of transactions from

Returns Array<Tx> List of transactions

getQueryString

Get Query String

Parameters

  • params
  • APIQueryParam

Returns string The query string.

getDefaultFees

Get the default fee.

Returns Fees The default fee.

getPrefix

Get address prefix based on the network.

Returns string The address prefix based on the network.*

getDefaultClientUrls

Default client urls

Returns ClientUrls The client urls for Cosmos.

getDefaultChainIds

Default chain ids

Returns ChainIds Chain ids for Cosmos.

getChainId

Helper to get Cosmos' chain id

Parameters

getChainIds

Helper to get Cosmos' chain id for all networks

Parameters

  • urls ClientUrl urls (use getDefaultClientUrl() if you don't need to use custom urls)