CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-web3-eth

Web3 module to interact with the Ethereum blockchain and smart contracts.

Agent Success

Agent success rate when using this tile

67%

Improvement

Agent success rate improvement when using this tile compared to baseline

0.99x

Baseline

Agent success rate without this tile

68%

Overview
Eval results
Files

task.mdevals/scenario-10/

Transaction Execution Helper

A helper module that previews, estimates, and sends Ethereum transactions over a provided RPC endpoint while surfacing clear lifecycle feedback.

Capabilities

Dry-run transaction preview

  • Returns decoded return data when a read-only simulation succeeds @test
  • Throws an error exposing the revert reason when the preview indicates failure @test

Gas estimation with safety buffer

  • Applies a configurable buffer to node-provided gas estimates and falls back to a manual limit when estimation is unavailable @test

Managed send and confirmation

  • Emits lifecycle callbacks in order (sending -> sent -> hash -> confirmation -> receipt) and resolves only after the required confirmations are observed @test

Implementation

@generates

API

export interface ProviderConfig {
  rpcUrl: string;
  defaultFrom?: string;
}

export interface TransactionInput {
  from?: string;
  to?: string;
  data?: string;
  value?: string | number;
  gas?: string | number;
  maxFeePerGas?: string | number;
  maxPriorityFeePerGas?: string | number;
  nonce?: number;
}

export interface GasBufferOptions {
  bufferMultiplier?: number; // e.g. 1.2 for 20% buffer
  fallbackGasLimit?: number;
  blockTag?: string | number;
}

export interface LifecycleHandlers {
  onSending?: (tx: TransactionInput) => void;
  onSent?: (tx: TransactionInput) => void;
  onHash?: (hash: string) => void;
  onConfirmation?: (info: { confirmations: number; receipt: unknown; latestBlockHash: string }) => void;
  onReceipt?: (receipt: unknown) => void;
}

export interface SendOptions {
  requiredConfirmations?: number;
  timeoutMs?: number;
  gasBufferMultiplier?: number;
  manualGasLimit?: number;
}

export type CallPreview = { raw: unknown; success: boolean };

export async function simulateTransaction(
  provider: ProviderConfig,
  transaction: TransactionInput
): Promise<CallPreview>;

export async function estimateGasWithBuffer(
  provider: ProviderConfig,
  transaction: TransactionInput,
  options?: GasBufferOptions
): Promise<number>;

export async function sendTransactionWithLifecycle(
  provider: ProviderConfig,
  transaction: TransactionInput,
  options?: SendOptions,
  handlers?: LifecycleHandlers
): Promise<{ hash: string; receipt: unknown }>;

export async function waitForConfirmations(
  provider: ProviderConfig,
  transactionHash: string,
  requiredConfirmations?: number,
  timeoutMs?: number
): Promise<{ confirmations: number; receipt: unknown }>;

Dependencies { .dependencies }

web3-eth { .dependency }

Used for performing read-only simulations, estimating gas, sending transactions, and polling for confirmations.

tessl i tessl/npm-web3-eth@4.8.0

tile.json