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-2/

Network Identity Reporter

Build a utility that summarizes an Ethereum node's identity and network status from a given provider.

Capabilities

Summarizes node identity and sync state

Hex responses should be normalized to base-10 values for the snapshot (protocolVersion as a string, chainId as a number).

  • With a provider that returns protocol version 0x41, chain id 0x1, node description Geth/v1.13.6, and reports not syncing, produce a snapshot containing protocolVersion '65', chainId 1, nodeInfo Geth/v1.13.6, and syncing set to false. @test
  • When the provider reports syncing with starting block 1, current block 5, and highest block 10, return a snapshot where syncing is that progress object and the chain id and protocol version fields are still populated. @test
  • If the provider cannot supply identity details (e.g., rejects the request), reject with an Error that includes the phrase "network identity unavailable" rather than returning partial data. @test

Implementation

@generates

API

export type SyncState =
  | false
  | {
      startingBlock: number;
      currentBlock: number;
      highestBlock: number;
    };

export interface NetworkSnapshot {
  protocolVersion: string;
  chainId: number;
  nodeInfo: string;
  syncing: SyncState;
}

export type ProviderLike = string | object;

/**
 * Builds a network identity snapshot from the provided endpoint or provider instance.
 */
export async function getNetworkSnapshot(provider: ProviderLike): Promise<NetworkSnapshot>;

Dependencies { .dependencies }

web3-eth { .dependency }

Ethereum RPC helper used to retrieve protocol version, chain identity, node metadata, and syncing status.

tessl i tessl/npm-web3-eth@4.8.0

tile.json