Wallet
Wallet
Wallet Class for managing all xchain-* wallets with a mnemonic seed.
Parameters
phrase
mnemonic phrasethorchainQuery
chainConfigs
Config by chain (optional, default{}
)thorchainCache
an 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
swap
object with all the required details for a swap.
Returns any transaction details and explorer url
validateSwap
Validate swap object
Parameters
swap
swap parameters
swapRuneTo
Function handles all swaps from Rune to asset
Parameters
swap
swap parameters
Returns any tx submitted object
swapNonRune
Function handles all swaps from Non Rune
Parameters
swap
swap object
Returns any TxSubmitted object
addLiquidity
Function handles liquidity Add BASED OFF https://dev.thorchain.or›g/thorchain-dev/network/memos
Parameters
params
input parameters needed to add liquidity
Returns any transaction details submitted
withdrawLiquidity
Function handles liquidity Withdraw
Parameters
params
parameters required for liquidity position
Returns any object with tx response, url and wait time in seconds
addSavers
Parameters
assetAmount
amount to addmemo
memo requiredtoAddress
waitTimeSeconds
expected wait for the transaction to be processed
withdrawSavers
Parameters
assetAmount
amount to withdrawmemo
memo requiredtoAddress
waitTimeSeconds
expected 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
params
thorname
Name to registerchain
Chain to add aliaschainAddress
Address to add to chain aliasowner
Owner address (rune address)preferredAsset
referred assetexpirity
expirity of the domain in MILLISECONDSisUpdate
true 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
params
thorname
Name to registerchain
Chain to add aliaschainAddress
Address to add to chain aliasowner
Owner address (rune address)preferredAsset
referred assetexpirity
expirity of the domain in MILLISECONDS
Returns any memo and value of deposit
addAssetLP
Function handles liquidity add for all non rune assets
Parameters
params
parameters for add liquidityconstructedMemo
memo needed for thorchainassetClient
passing XchainClientinboundAsgard
inbound Asgard address for the LPwaitTimeSeconds
wait time for the tx to be confirmed
Returns any tx object
withdrawAssetLP
Function handles liquidity Withdraw for Non rune assets
Parameters
params
parameters for withdraw liquidityconstructedMemo
memo needed for thorchain executionassetClient
asset client to call transferinboundAsgard
destination addresswaitTimeSeconds
return back estimated wait
Returns any tx object
addRuneLP
Function handles liquidity Add for Rune only
Parameters
params
deposit parametersmemo
memo needed to withdraw lpthorchainClient
Returns any tx object
withdrawRuneLP
Function handles liquidity Withdraw for Rune only
Parameters
params
withdraw parametersmemo
memo needed to withdraw lpthorchainClient
Returns any tx object