Skip to main content

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​
ParameterTypeDescription
chainChainChain to use for the client.
walletClient{ }The wallet client to use for wallet interactions.
publicClient{ }The public client to use for public interactions.
Returns​

ConcreteVaultHandler

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​
ParameterTypeDescription
spender`0x${string}`The spender of the token.
amountbigintThe 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​
ParameterTypeDescription
amountbigintThe 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​
ParameterTypeDescription
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​
ParameterTypeDescription
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​
ParameterTypeDescription
amountbigintThe 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​
ParameterTypeDescription
amountbigintThe 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​
ParameterTypeDescription
amountbigintThe 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​
ParameterTypeDescription
sharesbigintThe 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​
ParameterTypeDescription
assetsbigintThe 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​
ParameterTypeDescription
tokenctTACpufETHUniFi token to use for the handler.
Returns​

ConcreteVaultHandler

The handler.