@intuweb3/sdk
Version:
INTU SDK - Modern blockchain interaction toolkit
29 lines (28 loc) • 966 B
TypeScript
interface RpcEndpoint {
url: string;
priority: number;
isFallback: boolean;
}
interface BatchRpcCall {
method: string;
params: any[];
id: string;
}
declare class RpcOptimizer {
private gasPriceCache;
private readonly CACHE_DURATION;
private readonly MAX_RETRIES;
private readonly BASE_DELAY;
private readonly RPC_ENDPOINTS;
isMetaMaskProvider(provider: any): boolean;
getCachedGasPrice(provider: any, chainId: number): Promise<bigint>;
clearGasPriceCache(): void;
batchRpcCalls(provider: any, calls: BatchRpcCall[], chainId: number): Promise<any[]>;
private makeRpcCall;
private callWithFallback;
private retryWithBackoff;
getOptimizedGasEstimate(contract: any, method: string, params: any[], from: string, chainId: number, provider: any): Promise<bigint>;
getEndpointInfo(chainId: number): RpcEndpoint[];
}
export declare const rpcOptimizer: RpcOptimizer;
export default rpcOptimizer;