Class: WardenBestRate
Warden Best Rate for getting quote and swapping.
Constructors
constructor
▸ new WardenBestRate(provider
, networkName
, options?
)
Create new instance of WardenBestRate
Parameters
Methods
approve
▸ approve(signer
, src
, allowedAmount?
, overrides?
): Promise
<ContractTransaction
>
Set Allowance of a token to be spendable by WardenSwap contract
Parameters
Returns
Promise
<ContractTransaction
>
ethers' contract transaction (no wait)
getDepositAddresses
▸ getDepositAddresses(srcDestRouteTuples
, dexManager?
): string
[]
Get deposit addresses indicating the first hop to be used for starting the trade. This information is required by Wardenswap contract
Parameters
Returns
string
[]
a list of deposit addresses with the same order as the input
getQuote
▸ getQuote(src
, dest
, amountIn
, gasPrice
, opts?
): Promise
<QuoteResult
>
Get the best rate of a token pair with given amount
Parameters
Returns
Promise
<QuoteResult
>
Trading routes which provide the best rate
swap
▸ swap(signer
, src
, dest
, amountIn
, minDestAmount
, quoteResult
, partnerId?
, metaData?
, receiver?
, overrides?
): Promise
<ContractTransaction
>
Send a swap transaction to WardenSwap based on given quote
Parameters
Returns
Promise
<ContractTransaction
>
ethers' contract transaction (no wait)
Last updated