contracts/handlers/lagoon-vault-handler
Classes
LagoonVaultHandler
Defined in: lib/contracts/handlers/lagoon-vault-handler.ts:18
Handler for the LagoonVault contract exposing methods to interact
with the contract.
Constructors
Constructor
new LagoonVaultHandler(
chain,walletClient,publicClient):LagoonVaultHandler
Defined in: lib/contracts/handlers/lagoon-vault-handler.ts:30
Create the handler for processing Lagoon vault.
Parameters
| Parameter | Type | Description |
|---|---|---|
chain | Chain | Chain to use for the client. |
walletClient | { } | The wallet client to use for wallet interactions. |
publicClient | { } | The public client to use for public interactions. |
Returns
Methods
approve()
approve(
spender,amount):Promise<`0x${string}`>
Defined in: lib/contracts/handlers/lagoon-vault-handler.ts:63
Approve a spender to spend the token.
Parameters
| Parameter | Type | Description |
|---|---|---|
spender | `0x${string}` | The spender of the token. |
amount | bigint | The amount to approve. |
Returns
Promise<`0x${string}`>
The transaction.
claimableDepositRequest()
claimableDepositRequest(
requestId,controller):Promise<bigint>
Defined in: lib/contracts/handlers/lagoon-vault-handler.ts:360
Get the claimable deposit request for the request id and controller.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
requestId | bigint | 0n | The request id. Use 0 as wild card. |
controller | `0x${string}` | undefined | The controller. Usually the depositor or user who initiated the deposit. |
Returns
Promise<bigint>
The claimable deposit request.
claimableRedeemRequest()
claimableRedeemRequest(
requestId,controller):Promise<bigint>
Defined in: lib/contracts/handlers/lagoon-vault-handler.ts:375
Get the claimable redeem request for the request id and controller.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
requestId | bigint | 0n | The request id. Use 0 as wild card. |
controller | `0x${string}` | undefined | The controller. Usually the redeemer or user who initiated the redeem. |
Returns
Promise<bigint>
The claimable redeem request.
claimSharesAndRequestRedeem()
claimSharesAndRequestRedeem(
shares):Promise<`0x${string}`>
Defined in: lib/contracts/handlers/lagoon-vault-handler.ts:389
Claim shares and request a redeem of an amount of the shares (tacpufETH) so the receiver gets the assets (pufETH).
Parameters
| Parameter | Type | Description |
|---|---|---|
shares | bigint | The amount of shares (tacpufETH) to claim. |
Returns
Promise<`0x${string}`>
The transaction.
claimSharesOnBehalf()
claimSharesOnBehalf(
controllers):Promise<`0x${string}`>
Defined in: lib/contracts/handlers/lagoon-vault-handler.ts:402
Claim shares on behalf of multiple controllers.
Parameters
| Parameter | Type | Description |
|---|---|---|
controllers | `0x${string}`[] | The controllers to claim shares on behalf of. |
Returns
Promise<`0x${string}`>
The transaction.
convertToAssets()
convertToAssets(
shares,requestId?):Promise<never>
Defined in: lib/contracts/handlers/lagoon-vault-handler.ts:329
Convert an amount of the shares (tacpufETH) to the assets (pufETH).
Parameters
| Parameter | Type | Description |
|---|---|---|
shares | bigint | The amount of shares (tacpufETH) to convert. |
requestId? | bigint | An optional request id for the conversion. |
Returns
Promise<never>
The amount of assets (pufETH).
convertToShares()
convertToShares(
assets,requestId?):Promise<never>
Defined in: lib/contracts/handlers/lagoon-vault-handler.ts:344
Convert an amount of the assets (pufETH) to the shares (tacpufETH).
Parameters
| Parameter | Type | Description |
|---|---|---|
assets | bigint | The amount of assets (pufETH) to convert. |
requestId? | bigint | An optional request id for the conversion. |
Returns
Promise<never>
The amount of shares (tacpufETH).
deposit()
deposit(
amount,receiver,controller?):Promise<`0x${string}`>
Defined in: lib/contracts/handlers/lagoon-vault-handler.ts:129
Deposit an amount of the assets (pufETH) to the vault to get shares (tacpufETH).
Parameters
| Parameter | Type | Description |
|---|---|---|
amount | bigint | The amount to deposit. |
receiver | `0x${string}` | The receiver of the tacpufETH. |
controller? | `0x${string}` | The optional controller of the deposit. Set to the receiver if not sure. |
Returns
Promise<`0x${string}`>
The transaction.
getAllowance()
getAllowance(
owner,spender):Promise<bigint>
Defined in: lib/contracts/handlers/lagoon-vault-handler.ts:77
Get the allowance of the owner for the spender.
Parameters
| Parameter | Type | Description |
|---|---|---|
owner | `0x${string}` | The owner of the allowance. |
spender | `0x${string}` | The spender of the allowance. |
Returns
Promise<bigint>
The allowance.
getBalance()
getBalance(
address):Promise<bigint>
Defined in: lib/contracts/handlers/lagoon-vault-handler.ts:87
Get the balance for the address.
Parameters
| Parameter | Type | Description |
|---|---|---|
address | `0x${string}` | The address to get the balance of. |
Returns
Promise<bigint>
The balance.
getContract()
getContract():
object
Defined in: lib/contracts/handlers/lagoon-vault-handler.ts:43
Get the contract.
Returns
object
The viem contract.
getTotalSupply()
getTotalSupply():
Promise<bigint>
Defined in: lib/contracts/handlers/lagoon-vault-handler.ts:96
Get the total supply of the token.
Returns
Promise<bigint>
The total supply.
isTotalAssetsValid()
isTotalAssetsValid():
Promise<boolean>
Defined in: lib/contracts/handlers/lagoon-vault-handler.ts:106
Check if the total assets are valid. Used for checking if synchronous deposit is possible.
Returns
Promise<boolean>
True if the total assets are valid, false otherwise.