Util

getDenom

Get denomination from Asset

Parameters

  • asset Asset

Returns string The denomination of the given asset.

getDenomWithChain

Get denomination with chainname from Asset

Parameters

  • asset Asset

Returns string The denomination with chainname of the given asset.

getAsset

Get Asset from denomination

Parameters

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

isBroadcastSuccess

Response guard for transaction broadcast

Parameters

  • response any The response from the node.

Returns boolean true or false.

isTransferEvent

Type guard for transfer event

Parameters

  • txEvent TxEvent The transaction event.

Returns boolean true or false.

isRecipient

Type guard for recipient attribute

Parameters

  • txEventAttribute TxEvent The transaction event attribute.

Returns boolean true or false.

isSender

Type guard for sender attribute

Parameters

  • txEventAttribute TxEvent The transaction event attribute.

Returns boolean true or false.

isAmount

Type guard for amount attribute

Parameters

  • txEventAttribute TxEvent The transaction event attribute.

Returns boolean true or false.

parseAmountString

Parse amount string to value and denomination

Parameters

  • amountStr string The amount string.

Returns (Balance | undefined) The balance parsed from the amount string.

getTxsFromHistory

Parse transaction type

Parameters

  • txs Array<TxResponse> The transaction response from the node.
  • mainAsset Asset Current main asset which depends on the network.

Returns Txs The parsed transaction result.

getDefaultFees

Get the default fee.

Returns Fees The default fee.

getPrefix

Get address prefix based on the network.

Parameters

Returns string The address prefix based on the network.*