ISwapRouter
Functions for swapping tokens via Bonsaiswap V3
Parameter Structs
Note that fee
is in hundredths of basis points (e.g. the fee
for a pool at the 0.3% tier is 3000; the fee
for a pool at the 0.01% tier is 100).
ExactInputSingleParams
ExactInputParams
ExactOutputSingleParams
ExactOutputParams
Functions
exactInputSingle
Swaps amountIn
of one token for as much as possible of another token
Parameters:
Name | Type | Description |
---|---|---|
| struct ISwapRouter.ExactInputSingleParams | The parameters necessary for the swap, encoded as |
Return Values:
Name | Type | Description |
---|---|---|
| struct ISwapRouter.ExactInputSingleParams | The amount of the received token |
exactInput
Swaps amountIn
of one token for as much as possible of another along the specified path
Parameters:
Name | Type | Description |
---|---|---|
| struct ISwapRouter.ExactInputParams | The parameters necessary for the multi-hop swap, encoded as |
Return Values:
Name | Type | Description |
---|---|---|
| struct ISwapRouter.ExactInputParams | The amount of the received token |
exactOutputSingle
Swaps as little as possible of one token for amountOut
of another token
Parameters:
Name | Type | Description |
---|---|---|
| struct ISwapRouter.ExactOutputSingleParams | The parameters necessary for the swap, encoded as |
Return Values:
Name | Type | Description |
---|---|---|
| struct ISwapRouter.ExactOutputSingleParams | The amount of the input token |
exactOutput
Swaps as little as possible of one token for amountOut
of another along the specified path (reversed)
Parameters:
Name | Type | Description |
---|---|---|
| struct ISwapRouter.ExactOutputParams | The parameters necessary for the multi-hop swap, encoded as |
Return Values:
Name | Type | Description |
---|---|---|
| struct ISwapRouter.ExactOutputParams | The amount of the input token |
Last updated