SdkRouter
Last updated
Last updated
SDK class encapsulating router functions.
SdkShared
↳ SdkRouter
▸ addLiquidityForRouter(params
): Promise
<TransactionRequest
>
Returns the transaction request for adding liquidity to a router.
Parameters
Name | Type | Description |
---|---|---|
Returns
Promise
<TransactionRequest
>
providers.TransactionRequest object.
▸ 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
Returns
Promise
<TransactionRequest
>
providers.TransactionRequest object.
▸ removeRouterLiquidityFor(params
): Promise
<TransactionRequest
>
Parameters
Returns
Promise
<TransactionRequest
>
▸ Static
create(_config
): Promise
<SdkRouter
>
Create a singleton instance of the SdkRouter class.
Parameters
Returns
Promise
<SdkRouter
>
providers.TransactionRequest object.
Example
See the Deployments page for all domain IDs and asset addresses.
Name | Type | Description |
---|---|---|
Name | Type |
---|---|
Name | Type | Default value | Description |
---|---|---|---|
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.
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.
params
Object
params.amount
string
params.domainId
string
params.recipient
string
params.router
string
params.tokenAddress
string
_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.