Web3 module to interact with the Ethereum blockchain and smart contracts.
67
Create a helper that prepares an EIP-1559 style transaction payload with tuned fees and an access list derived from the call data. The helper should make fee choices based on live network data while allowing a caller-provided multiplier and fallback tip.
maxFeePerGas and maxPriorityFeePerGas (hex strings, wei) @testfrom, to, and data, then estimates gas using that list; returned gas and accessList reflect the generated values (hex gas value, access list entries with addresses and storage keys) @test@generates
/**
* Prepares an EIP-1559 transaction payload with tuned fees and access list support.
* @param {Object} options
* @param {string} options.rpcUrl - HTTP(s) endpoint for an Ethereum-compatible node.
* @param {string} options.from - Sender address (checksummed or lowercase).
* @param {string} options.to - Target contract or account address.
* @param {string} options.data - Calldata for the target method.
* @param {number} [options.baseFeeMultiplier=1.1] - Multiplier applied to the latest base fee per gas.
* @param {string} [options.priorityFeeFallback] - Fallback tip in wei (hex string) when the network does not return a suggested tip.
* @returns {Promise<{ from: string; to: string; data: string; accessList: Array<{ address: string; storageKeys: string[] }>; gas: string; maxFeePerGas: string; maxPriorityFeePerGas: string; }>} Prepared transaction fields using EIP-1559 pricing and generated access list.
*/
async function prepareEip1559Transaction(options) {}Provides Ethereum RPC fee discovery, access list creation, and gas estimation support.
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