@byzantine/vault-sdk
Version:
Byzantine Vault SDK for creating and managing vaults on Ethereum for restaking strategies
63 lines (62 loc) • 2.46 kB
TypeScript
import { ethers } from "ethers";
export declare class DepositClient {
private provider;
private signer?;
constructor(provider: ethers.Provider, signer?: ethers.Signer);
/**
* Get the vault contract instance
* @param vaultAddress The address of the vault
* @returns The vault contract instance
*/
private getVaultContract;
/**
* Get the asset address of a vault
* @param vaultAddress The address of the vault
* @returns The asset address
*/
getVaultAsset(vaultAddress: string): Promise<string>;
/**
* Get the balance of assets in a user's wallet
* @param assetAddress The address of the asset
* @param userAddress The address of the user
* @returns The user's wallet balance
*/
getUserWalletBalance(assetAddress: string, userAddress: string): Promise<bigint>;
/**
* Get the balance of a user in a vault
* @param vaultAddress The address of the vault
* @param userAddress The address of the user
* @returns The user's vault balance
*/
getUserVaultBalance(vaultAddress: string, userAddress: string): Promise<bigint>;
/**
* Get the total value locked in a vault
* @param vaultAddress The address of the vault
* @returns The total value locked
*/
getVaultTVL(vaultAddress: string): Promise<bigint>;
/**
* Get the allowance of a user for a vault
* @param assetAddress The address of the asset
* @param userAddress The address of the user
* @param vaultAddress The address of the vault
* @returns The user's allowance
*/
getUserAllowance(assetAddress: string, userAddress: string, vaultAddress: string): Promise<bigint>;
/**
* Approve a vault to spend user's tokens
* @param assetAddress The address of the asset
* @param vaultAddress The address of the vault
* @param amount The amount to approve
* @returns Transaction response
*/
approveVault(assetAddress: string, vaultAddress: string, amount: bigint): Promise<ethers.TransactionResponse>;
/**
* Deposit assets into a vault
* @param vaultAddress The address of the vault
* @param amount The amount to deposit
* @param autoApprove Whether to automatically approve if needed, true by default
* @returns Transaction response
*/
depositToVault(vaultAddress: string, amount: bigint, autoApprove?: boolean): Promise<ethers.TransactionResponse>;
}