kETHVault sub-class
The following readme describes all the functions and their parameters exposed by the kETHVault
class of the KETH SDK.
deposit function
This function allows the user to deposit the underlying asset.
Input Parameters
underlying: The underlying asset adddress
amount: The underlying asset amount
recipient: The recipient address
sell: If true then autosell is enabled
value: ETH value to be deposited if underlying asset is ETH, 0 by default
referralAddress: Optional address provided for extracting referral claims later, indexed on transaction level
Provide
referralAddress
when you need to credit an account that was a part of making the deposit transaction happen. This address is provided as a part of the calldata on transaction level.
Using deposit function
await sdk.kETHVault.deposit(underlying, amount, recipient, sell, value, referralAddress);
Return Parameter
Transaction details if the transaction is successful.
totalAssets function
This function returns the total assets value of vault in ETH
Using totalAssets function
await sdk.kETHVault.totalAssets();
Return Parameter
Returns the total assets value of vault in ETH.
withdraw function
This function allows the user to burn their kETH and get their deposited ETH and dETH back.
Input Parameters
share: The kETH amount to be burnt recipient: The recipient address
Using withdraw function
await sdk.kETHVault.withdraw(share, recipient);
Return Parameter
Transaction details if the transaction is successful.