Wallet
Wallet
Wallet Class for managing all xchain-* wallets with a mnemonic seed.
Parameters
phrasemnemonic phrasethorchainQuerychainConfigsConfig by chain (optional, default{})thorchainCachean instance of the ThorchainCache (could be pointing to stagenet,testnet,mainnet)
getAllBalances
Fetch balances for all wallets
Returns any AllBalances[]
executeSwap
- **See: ThorchainAMM.doSwap() **
Executes a Swap from THORChainAMM.doSwap()
Parameters
swapobject with all the required details for a swap.
Returns any transaction details and explorer url
validateSwap
Validate swap object
Parameters
swapswap parameters
swapRuneTo
Function handles all swaps from Rune to asset
Parameters
swapswap parameters
Returns any tx submitted object
swapNonRune
Function handles all swaps from Non Rune
Parameters
swapswap object
Returns any TxSubmitted object
addLiquidity
Function handles liquidity Add BASED OFF https://dev.thorchain.or›g/thorchain-dev/network/memos
Parameters
paramsinput parameters needed to add liquidity
Returns any transaction details submitted
withdrawLiquidity
Function handles liquidity Withdraw
Parameters
paramsparameters required for liquidity position
Returns any object with tx response, url and wait time in seconds
addSavers
Parameters
assetAmountamount to addmemomemo requiredtoAddresswaitTimeSecondsexpected wait for the transaction to be processed
withdrawSavers
Parameters
assetAmountamount to withdrawmemomemo requiredtoAddresswaitTimeSecondsexpected wait for the transaction to be processed
registerThorname
Register a THORName with a default expirity of one year. By default chain and chainAddress is getting from wallet instance and is BTC. By default owner is getting from wallet
Parameters
paramsthornameName to registerchainChain to add aliaschainAddressAddress to add to chain aliasownerOwner address (rune address)preferredAssetreferred assetexpirityexpirity of the domain in MILLISECONDSisUpdatetrue only if the domain is already register and you want to update its data
Returns any memo and value of deposit
updateThorname
Register a THORName with a default expirity of one year. By default chain and chainAddress is getting from wallet instance and is BTC. By default owner is getting from wallet
Parameters
paramsthornameName to registerchainChain to add aliaschainAddressAddress to add to chain aliasownerOwner address (rune address)preferredAssetreferred assetexpirityexpirity of the domain in MILLISECONDS
Returns any memo and value of deposit
addAssetLP
Function handles liquidity add for all non rune assets
Parameters
paramsparameters for add liquidityconstructedMemomemo needed for thorchainassetClientpassing XchainClientinboundAsgardinbound Asgard address for the LPwaitTimeSecondswait time for the tx to be confirmed
Returns any tx object
withdrawAssetLP
Function handles liquidity Withdraw for Non rune assets
Parameters
paramsparameters for withdraw liquidityconstructedMemomemo needed for thorchain executionassetClientasset client to call transferinboundAsgarddestination addresswaitTimeSecondsreturn back estimated wait
Returns any tx object
addRuneLP
Function handles liquidity Add for Rune only
Parameters
paramsdeposit parametersmemomemo needed to withdraw lpthorchainClient
Returns any tx object
withdrawRuneLP
Function handles liquidity Withdraw for Rune only
Parameters
paramswithdraw parametersmemomemo needed to withdraw lpthorchainClient
Returns any tx object