UNPKG

@byzantine/vault-sdk

Version:

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

34 lines (33 loc) 1.28 kB
/** * Contract Error Handler Utility * * Helper functions to standardize contract error handling across the SDK */ import { ethers, TransactionResponse } from "ethers"; /** * Execute a contract method with proper error handling * Uses staticCall to get meaningful errors before executing transaction * * @param contract - Ethers contract instance * @param method - Method name to call * @param args - Arguments to pass to the method * @returns Promise resolving to transaction response */ export declare function executeContractMethod(contract: ethers.Contract, method: string, ...args: any[]): Promise<TransactionResponse>; /** * Execute a read-only contract method with proper error handling * * @param contract - Ethers contract instance * @param method - Method name to call * @param args - Arguments to pass to the method * @returns Promise resolving to the method's return value */ export declare function callContractMethod<T>(contract: ethers.Contract, method: string, ...args: any[]): Promise<T>; /** * Format a contract error into a more meaningful message * * @param method - Contract method name * @param error - Error object * @returns Error with improved message */ export declare function formatContractError(method: string, error: any): Error;