contracts/handlers/concrete-vault-handler
Classes
ConcreteVaultHandler
Defined in: lib/contracts/handlers/concrete-vault-handler.ts:21
Handler for the ConcreteMultStrategyVault contract for a given token (pufETH) exposing
methods to interact with the contract.
Constructors
Constructor
new ConcreteVaultHandler(
chain,walletClient,publicClient):ConcreteVaultHandler
Defined in: lib/contracts/handlers/concrete-vault-handler.ts:34
Create the handler for processing UniFi tokens.
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/concrete-vault-handler.ts:80
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.
deposit()
deposit(
amount):Promise<`0x${string}`>
Defined in: lib/contracts/handlers/concrete-vault-handler.ts:123
Deposit an amount of the token.
Parameters
| Parameter | Type | Description |
|---|---|---|
amount | bigint | The amount to deposit. |
Returns
Promise<`0x${string}`>
The transaction.
getAllowance()
getAllowance(
owner,spender):Promise<bigint>
Defined in: lib/contracts/handlers/concrete-vault-handler.ts:94
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/concrete-vault-handler.ts:104
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/concrete-vault-handler.ts:60
Get the contract.
Returns
object
The viem contract.
getTotalSupply()
getTotalSupply():
Promise<bigint>
Defined in: lib/contracts/handlers/concrete-vault-handler.ts:113
Get the total supply of the token.
Returns
Promise<bigint>
The total supply.
previewDeposit()
previewDeposit(
amount):Promise<bigint>
Defined in: lib/contracts/handlers/concrete-vault-handler.ts:172
Provides a preview of the number of shares that would be minted for a given deposit amount, after fees.
Parameters
| Parameter | Type | Description |
|---|---|---|
amount | bigint | The amount to deposit. |
Returns
Promise<bigint>
The preview.
previewRedeem()
previewRedeem(
amount):Promise<bigint>
Defined in: lib/contracts/handlers/concrete-vault-handler.ts:195
Provides a preview of the amount of assets that would be redeemed for a specific number of shares, after withdrawal fees. Subtracts the withdrawal fee from the share amount to determine the net shares for asset conversion.
Parameters
| Parameter | Type | Description |
|---|---|---|
amount | bigint | The amount to redeem. |
Returns
Promise<bigint>
The preview.
previewWithdraw()
previewWithdraw(
amount):Promise<bigint>
Defined in: lib/contracts/handlers/concrete-vault-handler.ts:182
Provides a preview of the number of shares that would be burned for a given withdrawal amount, after fees.
Parameters
| Parameter | Type | Description |
|---|---|---|
amount | bigint | The amount to withdraw. |
Returns
Promise<bigint>
The preview.
redeem()
redeem(
shares,receiver?,owner?):Promise<`0x${string}`>
Defined in: lib/contracts/handlers/concrete-vault-handler.ts:152
Redeem the given amount of shares (ctTACpufETH) so the receiver gets the assets (pufETH).
Parameters
| Parameter | Type | Description |
|---|---|---|
shares | bigint | The amount of shares (ctTACpufETH) to redeem. |
receiver? | `0x${string}` | The optional receiver of the assets. |
owner? | `0x${string}` | The optional owner of the shares. |
Returns
Promise<`0x${string}`>
The transaction.
withdraw()
withdraw(
assets):Promise<`0x${string}`>
Defined in: lib/contracts/handlers/concrete-vault-handler.ts:136
Withdraw the given amount of assets (pufETH) to the receiver.
Parameters
| Parameter | Type | Description |
|---|---|---|
assets | bigint | The amount of assets (pufETH) to withdraw. |
Returns
Promise<`0x${string}`>
The transaction.
withToken()
withToken(
token):ConcreteVaultHandler
Defined in: lib/contracts/handlers/concrete-vault-handler.ts:50
Set the UniFi token to use for executing transactions on the contract.
Parameters
| Parameter | Type | Description |
|---|---|---|
token | ctTACpufETH | UniFi token to use for the handler. |
Returns
The handler.