Skip to main content

contracts/handlers/concrete-vault-handler

Classes

ConcreteVaultHandler

Handler for the ConcreteMultStrategyVault contract for a given token (pufETH) exposing methods to interact with the contract.

Constructors

new ConcreteVaultHandler()

new ConcreteVaultHandler(chain, walletClient, publicClient): ConcreteVaultHandler

Create the handler for processing UniFi tokens.

Parameters
ParameterTypeDescription
chainChainChain to use for the client.
walletClientobjectThe wallet client to use for wallet interactions.
publicClientobjectThe public client to use for public interactions.
Returns

ConcreteVaultHandler

Source

lib/contracts/handlers/concrete-vault-handler.ts:34

Properties

PropertyModifierTypeDescription
chainprivateChainChain to use for the client.
publicClientprivateobjectThe public client to use for public interactions.
tokenprivatectTACpufETH-
viemChainprivateChain-
walletClientprivateobjectThe wallet client to use for wallet interactions.

Methods

approve()

approve(spender, amount): Promise<`0x${string}`>

Approve a spender to spend the token.

Parameters
ParameterTypeDescription
spender`0x${string}`The spender of the token.
amountbigintThe amount to approve.
Returns

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/concrete-vault-handler.ts:80

deposit()

deposit(amount): Promise<`0x${string}`>

Deposit an amount of the token.

Parameters
ParameterTypeDescription
amountbigintThe amount to deposit.
Returns

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/concrete-vault-handler.ts:123

getAllowance()

getAllowance(owner, spender): Promise<bigint>

Get the allowance of the owner for the spender.

Parameters
ParameterTypeDescription
owner`0x${string}`The owner of the allowance.
spender`0x${string}`The spender of the allowance.
Returns

Promise<bigint>

The allowance.

Source

lib/contracts/handlers/concrete-vault-handler.ts:94

getBalance()

getBalance(address): Promise<bigint>

Get the balance for the address.

Parameters
ParameterTypeDescription
address`0x${string}`The address to get the balance of.
Returns

Promise<bigint>

The balance.

Source

lib/contracts/handlers/concrete-vault-handler.ts:104

getContract()

getContract(): object

Get the contract.

Returns

object

The viem contract.

Source

lib/contracts/handlers/concrete-vault-handler.ts:60

getTotalSupply()

getTotalSupply(): Promise<bigint>

Get the total supply of the token.

Returns

Promise<bigint>

The total supply.

Source

lib/contracts/handlers/concrete-vault-handler.ts:113

previewDeposit()

previewDeposit(amount): Promise<bigint>

Provides a preview of the number of shares that would be minted for a given deposit amount, after fees.

Parameters
ParameterTypeDescription
amountbigintThe amount to deposit.
Returns

Promise<bigint>

The preview.

Source

lib/contracts/handlers/concrete-vault-handler.ts:149

previewRedeem()

previewRedeem(amount): Promise<bigint>

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
ParameterTypeDescription
amountbigintThe amount to redeem.
Returns

Promise<bigint>

The preview.

Source

lib/contracts/handlers/concrete-vault-handler.ts:172

previewWithdraw()

previewWithdraw(amount): Promise<bigint>

Provides a preview of the number of shares that would be burned for a given withdrawal amount, after fees.

Parameters
ParameterTypeDescription
amountbigintThe amount to withdraw.
Returns

Promise<bigint>

The preview.

Source

lib/contracts/handlers/concrete-vault-handler.ts:159

withToken()

withToken(token): ConcreteVaultHandler

Set the UniFi token to use for executing transactions on the contract.

Parameters
ParameterTypeDescription
tokenctTACpufETHUniFi token to use for the handler.
Returns

ConcreteVaultHandler

The handler.

Source

lib/contracts/handlers/concrete-vault-handler.ts:50

withdraw()

withdraw(amount): Promise<`0x${string}`>

Withdraw an amount of the token.

Parameters
ParameterTypeDescription
amountbigintThe amount to withdraw.
Returns

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/concrete-vault-handler.ts:136