Wallet
constructor
Constructor to create a Wallet
Parameters
phrasestring mnemonic phrasenetworkNetwork mnemonic phrasechainConfigsChainConfigs Config by chain. If it isn not set, each client uses its default params (optional, default{})
Returns any Wallet
getAddress
Get chain address
Parameters
chainChain
Returns any the chain address
validateAddress
Check if address is valid
Parameters
chainChain in which the address has to be validaddressstring to validate
Returns any true if it is a valid address, otherwise, false
transfer
Make a transaction
Parameters
txParamsTxParams to make the transfertxParams.assettxParams.amounttxParams.recipienttxParams.memotxParams.walletIndex
Returns any the transaction hash
deposit
Make a deposit
Parameters
depositParamsDepositParamdepositParams.assetdepositParams.amountdepositParams.memo
- Throws Error if can not make deposit with the asset
Returns any the hash of the deposit
isApproved
Check if an spenderAddress is allowed to spend in name of another address certain asset amount
Parameters
assetAsset to checkamountBaseAmount to checkfromAddressstring owner of the amount asset-
spenderAddressstring spender to check if it is allowed to spend - Throws Error if asset is a non ERC20 asset
Returns any true if the spenderAddress is allowed to spend the amount, otherwise, false
getExplorerTxUrl
Get transaction url
Parameters
chainChain of the transactionhashstring of the transaction
Returns any the transaction url
getGasFeeRates
Get feeRates
Parameters
-
chainChain of which return the feeRates -
Throws Error if gas fee rates can not be returned from the chain
Returns any the gas fee rates
getChainWallet
Get chain wallet
Parameters
-
chainChain of which return the wallet -
Throws Error wallet can not be retrieve from chain
Returns any the chain wallet
getChainClient
Get chain client
Parameters
-
chainChain of which return the client -
Throws Error if client does not exist
Returns any the chain client
isERC20Asset
Check if asset is ERC20
Parameters
assetAsset to check
Returns any true if asset is ERC20, otherwise, false
isEVMChain
Check if asset chain is EVM
Parameters
chainChain to check
Returns any true if chain is EVM, otherwise, false