swappers sub-class
The following readme describes all the functions and their parameters exposed by the swappers
class of the KETH SDK. This sub-class exposes the swap functions on the different swapper contracts induvidually as a part of a single class.
swapETHToDETH function
This function allows the user to swap ETH for dETH.
Input Parameters
amountIn: The input token amount
value: ETH value to be deposited, equal to amountIn
minAmountOut: The minimum output token amount, 0 by default
callData: Optional extra calldata to be attached
Using swapETHToDETH function
await sdk.swappers.swapETHToDETH(amountIn, value, minAmountOut, callData);
Return Parameter
Transaction details if the transaction is successful.
swapETHToGiantLP function
This function allows the user to swap ETH for GiantLP.
Input Parameters
amountIn: The input token amount
value: ETH value to be deposited, equal to amountIn
minAmountOut: The minimum output token amount, 0 by default
callData: Optional extra calldata to be attached
Using swapETHToGiantLP function
await sdk.swappers.swapETHToGiantLP(amountIn, value, minAmountOut, callData);
Return Parameter
Transaction details if the transaction is successful.
swapGiantLPToDETH function
This function allows the user to swap GiantLP for dETH.
Input Parameters
amountIn: The input token amount
minAmountOut: The minimum output token amount, 0 by default
callData: Optional extra calldata to be attached
Using swapGiantLPToDETH function
await sdk.swappers.swapGiantLPToDETH(amountIn, minAmountOut, callData);
Return Parameter
Transaction details if the transaction is successful.
swapRETHToDETH function
This function allows the user to swap RETH for dETH.
Input Parameters
amountIn: The input token amount
minAmountOut: The minimum output token amount, 0 by default
callData: Optional extra calldata to be attached
Using swapRETHToDETH function
await sdk.swappers.swapRETHToDETH(amountIn, minAmountOut, callData);
Return Parameter
Transaction details if the transaction is successful.
swapRETHToETH function
This function allows the user to swap RETH for ETH.
Input Parameters
amountIn: The input token amount
minAmountOut: The minimum output token amount, 0 by default
callData: Optional extra calldata to be attached
Using swapRETHToETH function
await sdk.swappers.swapRETHToETH(amountIn, minAmountOut, callData);
Return Parameter
Transaction details if the transaction is successful.
swapRETHToGiantLP function
This function allows the user to swap RETH for GiantLP.
Input Parameters
amountIn: The input token amount
minAmountOut: The minimum output token amount, 0 by default
callData: Optional extra calldata to be attached
Using swapRETHToGiantLP function
await sdk.swappers.swapRETHToGiantLP(amountIn, minAmountOut, callData);
Return Parameter
Transaction details if the transaction is successful.
swapWstETHToDETH function
This function allows the user to swap WstETH for dETH.
Input Parameters
amountIn: The input token amount
minAmountOut: The minimum output token amount, 0 by default
callData: Optional extra calldata to be attached
Using swapWstETHToDETH function
await sdk.swappers.swapWstETHToDETH(amountIn, minAmountOut, callData);
Return Parameter
Transaction details if the transaction is successful.
swapWstETHToETH function
This function allows the user to swap WstETH for ETH.
Input Parameters
amountIn: The input token amount
minAmountOut: The minimum output token amount, 0 by default
callData: Optional extra calldata to be attached
Using swapWstETHToETH function
await sdk.swappers.swapWstETHToETH(amountIn, minAmountOut, callData);
Return Parameter
Transaction details if the transaction is successful.
swapWstETHToGiantLP function
This function allows the user to swap WstETH for GiantLP.
Input Parameters
amountIn: The input token amount
minAmountOut: The minimum output token amount, 0 by default
callData: Optional extra calldata to be attached
Using swapWstETHToGiantLP function
await sdk.swappers.swapWstETHToGiantLP(amountIn, minAmountOut, callData);
Return Parameter
Transaction details if the transaction is successful.
swapYETHToDETH function
This function allows the user to swap yETH for dETH.
Input Parameters
amountIn: The input token amount
minAmountOut: The minimum output token amount, 0 by default
callData: Optional extra calldata to be attached
Using swapYETHToDETH function
await sdk.swappers.swapYETHToDETH(amountIn, minAmountOut, callData);
Return Parameter
Transaction details if the transaction is successful.
swapYETHToETH function
This function allows the user to swap yETH for ETH.
Input Parameters
amountIn: The input token amount
minAmountOut: The minimum output token amount, 0 by default
callData: Optional extra calldata to be attached
Using swapYETHToETH function
await sdk.swappers.swapYETHToETH(amountIn, minAmountOut, callData);
Return Parameter
Transaction details if the transaction is successful.
swapYETHToGiantLP
This function allows the user to swap yETH for GiantLP.
Input Parameters
amountIn: The input token amount
minAmountOut: The minimum output token amount, 0 by default
callData: Optional extra calldata to be attached
Using swapYETHToGiantLP function
await sdk.swappers.swapYETHToGiantLP(amountIn, minAmountOut, callData);
Return Parameter
Transaction details if the transaction is successful.