SdkRouter
SDK class encapsulating router functions.
Hierarchy
SdkShared
↳
SdkRouter
Methods
addLiquidityForRouter
▸ addLiquidityForRouter(params
): Promise
<TransactionRequest
>
Returns the transaction request for adding liquidity to a router.
Parameters
params
Object
addLiquidityForRouter parameters object.
params.amount
string
The amount of the token to add.
params.domainId
string
The domain ID.
params.router
string
The address of the router.
params.tokenAddress
string
The address of the token.
Returns
Promise
<TransactionRequest
>
providers.TransactionRequest object.
removeRouterLiquidity
▸ removeRouterLiquidity(params
): Promise
<TransactionRequest
>
Returns the transaction request for removing liquidity from a router.
Remarks
This function is permissioned to the router owner only.
Parameters
params
Object
removeRouterLiquidity parameters object.
params.amount
string
The amount of the token to add.
params.domainId
string
The domain ID.
params.recipient
string
The address where the removed funds will be delivered.
params.tokenAddress
string
The address of the token.
Returns
Promise
<TransactionRequest
>
providers.TransactionRequest object.
removeRouterLiquidityFor
▸ removeRouterLiquidityFor(params
): Promise
<TransactionRequest
>
Parameters
params
Object
params.amount
string
params.domainId
string
params.recipient
string
params.router
string
params.tokenAddress
string
Returns
Promise
<TransactionRequest
>
create
▸ Static
create(_config
): Promise
<SdkRouter
>
Create a singleton instance of the SdkRouter class.
Parameters
_config
Object
undefined
SdkConfig object.
_config.chains
Record
<string
, { providers: string[] }>
undefined
Chain config, at minimum with providers for each chain.
_config.signerAddress
string
undefined
Signer address for transactions.
_config.logLevel
"fatal"
| "error"
| "warn"
| "info"
| "debug"
| "trace"
| "silent"
"info"
(optional) Logging severity level.
_config.network
"testnet"
| "mainnet"
"mainnet"
(optional) Blockchain environment to interact with.
Returns
Promise
<SdkRouter
>
providers.TransactionRequest object.
Example
See the Deployments page for all domain IDs and asset addresses.
Last updated