UNPKG

@byzantine/vault-sdk

Version:

Byzantine Vault SDK for creating and managing vaults on Ethereum for restaking strategies

69 lines (68 loc) 2.86 kB
import { ethers } from "ethers"; export declare class WithdrawClient { 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 queued withdrawal requests for a specific staker * @param vaultAddress The address of the vault * @param stakerAddress Address of the staker * @returns Array of withdrawal request IDs */ getQueuedWithdrawalRequests(vaultAddress: string, stakerAddress: string): Promise<string[]>; /** * Check if a withdrawal request is claimable * @param vaultAddress The address of the vault * @param requestId The ID of the withdrawal request * @returns True if the request is claimable */ isClaimable(vaultAddress: string, requestId: string): Promise<boolean>; /** * Withdraw assets from a vault * @param vaultAddress The address of the vault * @param amount The amount of assets to withdraw * @returns Transaction response */ withdrawFromVault(vaultAddress: string, amount: bigint): Promise<ethers.TransactionResponse>; /** * Redeem shares from a vault * @param vaultAddress The address of the vault * @param shares The amount of shares to redeem * @returns Transaction response */ redeemSharesFromVault(vaultAddress: string, shares: bigint): Promise<ethers.TransactionResponse>; /** * Request withdrawal of native ETH from the vault * @param vaultAddress The address of the vault * @param assets The amount of assets to withdraw (use 0 for all available) * @returns Transaction response */ requestNativeWithdrawal(vaultAddress: string, assets: bigint): Promise<ethers.TransactionResponse>; /** * Redeem shares for native ETH from the vault * @param vaultAddress The address of the vault * @param shares The amount of shares to redeem (use 0 for all available) * @returns Transaction response */ redeemNativeShares(vaultAddress: string, shares: bigint): Promise<ethers.TransactionResponse>; /** * Complete a withdrawal request * @param vaultAddress The address of the vault * @param requestId The ID of the withdrawal request * @returns Transaction response */ completeWithdrawal(vaultAddress: string, requestId: string): Promise<ethers.TransactionResponse>; /** * Get a withdrawal request * @param vaultAddress The address of the vault * @param requestId The ID of the withdrawal request * @returns The withdrawal request */ getWithdrawalRequest(vaultAddress: string, requestId: string): Promise<ethers.TransactionResponse>; }