Utils

xchainNetworkToEths

XChainNetwork -> EthNetwork

Parameters

  • network XChainNetwork

Returns EthNetwork

ethNetworkToXchains

EthNetwork -> XChainNetwork

Parameters

  • network EthNetwork

Returns XChainNetwork

validateAddress

Validate the given address.

Parameters

  • address Address

Returns boolean true or false

getTokenAddress

Get token address from asset.

Parameters

  • asset Asset

Returns (string | null) The token address.

validateSymbol

Check if the symbol is valid.

Parameters

Returns boolean true or false.

getTxFromTokenTransaction

Get transactions from token tx

Parameters

  • tx TokenTransactionInfo

Returns (Tx | null) The parsed transaction.

getTxFromEthTransaction

Get transactions from ETH transaction

Parameters

  • tx ETHTransactionInfo

Returns Tx The parsed transaction.

getFee

Calculate fees by multiplying .

Parameters

  • $0 Object
    • $0.gasPrice
    • $0.gasLimit

Returns Fees The default gas price.

getDefaultFees

Get the default fees.

Parameters

  • asset

Returns Fees The default gas price.

getDefaultGasPrices

Get the default gas price.

Parameters

  • asset

Returns Fees The default gas prices.

getPrefix

Get address prefix based on the network.

Returns string The address prefix based on the network.*