VaultClient wraps the ERC-4626 AgentBankVaultV2 contract. Access it via client.vault on the AgentBankClient.
Methods
deposit
Deposit assets into the vault and receive shares.DepositParams):
Returns:
Promise<Hash> — transaction hash
withdraw
Withdraw a specific asset amount from the vault (burns the required shares).Promise<Hash>
redeem
Burn a specific number of shares and receive the proportional assets.Promise<Hash>
getShares
Get the vault share balance for any address.Promise<string> — formatted share balance
getTVL
Get total assets locked in the vault.Promise<string>
getAPY
Estimate current APY from share price appreciation (simplified model).This is a simplified heuristic based on current share price vs 1:1 ratio. For production, integrate with off-chain oracle data or historical share price comparison.
Promise<string> — APY percentage with 4 decimal places
getUnderlyingAsset
Get the address of the vault’s underlying asset.Promise<Address>