@swapkit/thorchain
Plugin implementing Thorchain support for swaps, liquidity providing, network deposits, bonds, node management, THORNames management and more
Getting started
Installation
Integration
Implementation with @swapkit/core
Methods
swap(params: GenericSwapParams | SwapWithRouteParams): string
Swaps assets over cross-chain Thorchain network. Used with routes returned from SwapKitApi.getSwapQuote
addLiquidity(params: AddLiquidityParams) => Promise<{ runeTx: string | void; assetTx: string | void; }>
Performs two transactions to deposit RUNE and asset to THORChain Liquidity Pool
addLiquidityPart(params: AddLiquidityPartParams) => Promise<string>
Performs transaction to deposit RUNE or asset to THORChain Liquidity Pool
deposit(params: CoreTxParams & { router?: string; }) => Promise<string>
Performs deposit to THORChain pool transaction. Can use custom memo.
loan(params: LoanParams) => Promise<string>
Performs transaction to open or close loan.
savings(params: SavingsParams) => Promise<string>
Performs transaction to deposit or withdraw provided asset from THORChain Savers
withdraw(params: WithdrawParasm) => Promise<string>
Performs transaction to register, extend THORName
registerThorname(params: RegisterTHORNameParams): string
Performs transaction to register, extend THORName
createLiquidity({ runeAssetValue: AssetValue; assetValue: AssetValue }) => Promise<{ runeTx: string; assetTx: string }>
Performs 2 transactions to create new THORChain Liquidity Pool
nodeAction(params: NodeActionParams): Promise<string>
Performs deposit to protocol with convenient method wrapping and structuring proper memo
getInboundDataByChain(chain: Chain): Promise<InboundAddressesItem>
Returns inbound info of given chain
approveAssetValue(params: ApproveParams): Promise<string | true>
Performs approval transaction or returns true if given asset doesn't need approval
isAssetValueApproved(params: ApproveParams): Promise<boolean>
Checks if given asset needs approval. Additionally validates provided amount against approved contract spending.
Types
AddLiquidityPartParams
AddLiquidityParams
ApproveParams
CoreTxParams
LoanParams
NodeActionParams
SwapWithRouteParams
SavingParams
SwapWithRouteParams
RegisterTHORNameParams
WithdrawParams
Last updated