Web3 module to interact with the Ethereum blockchain and smart contracts.
67
A module that surfaces EIP-1559 fee suggestions and simple historical fee insights from an Ethereum node.
type "eip1559", maxFeePerGas "38000000000", maxPriorityFeePerGas "2000000000", and baseFeePerGas "30000000000". @testtype "legacy" with both maxFeePerGas and maxPriorityFeePerGas set to "15000000000". @testbaseFeeMedian "24000000000", rewardAtPercentile "2000000000", oldestBlock matching the window start, and newestBlock matching the latest block number. @test@generates
All fee values are returned as decimal strings representing wei.
export interface FeeRecommendation {
type: "eip1559" | "legacy";
maxFeePerGas: string;
maxPriorityFeePerGas: string;
baseFeePerGas?: string;
}
export interface FeeWindowSummary {
baseFeeMedian: string;
rewardAtPercentile: string;
oldestBlock: number;
newestBlock: number;
}
export async function recommendNextBlockFees(targetMultiplier?: number): Promise<FeeRecommendation>;
export async function summarizeRecentFees(blockCount: number, percentile: number): Promise<FeeWindowSummary>;
export async function isPrioritySufficient(candidateTipWei: string): Promise<boolean>;Ethereum JSON-RPC client used for fee and gas discovery operations.
Install with Tessl CLI
npx tessl i tessl/npm-web3-ethdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10