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%
Utility functions for offline signing of Ethereum personal messages, EIP-712 typed data, and EIP-1559 transactions using a provided private key.
"Authenticate me" with private key 0x4c0883a69102937d6231471b5dbb6204fe512961708279b6f0e6a5c4f8b9e3fa returns a 65-byte hex signature and the prefixed message hash; recovering the signer yields 0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1. @testprimaryType: "Mail", domain { name: "Mail", version: "1", chainId: 1, verifyingContract: "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC" }, types Person(name,string; wallet,address) and Mail(from,Person; to,Person; contents,string), and message { from: { name: "Cow", wallet: "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826" }, to: { name: "Bob", wallet: "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB" }, contents: "Hello, Bob!" } using the same private key returns a signature that verifies to 0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1 and exposes the typed data digest. @testprimaryType or domain.chainId are rejected with explicit validation errors before signing. @testto: 0x000000000000000000000000000000000000dEaD, value: 0x2386f26fc10000 (0.01 ETH), nonce: 7, gasLimit: 0x5208, maxFeePerGas: 0x59682f00, maxPriorityFeePerGas: 0x3b9aca00, chainId: 1, and no data using the same private key produces a type-2 raw transaction whose decoded sender is 0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1 and transaction hash matches the signed payload. @testgasLimit or either fee cap are rejected with explicit errors instead of producing a malformed raw transaction. @test@generates
export type HexString = `0x${string}`;
export interface PersonalSignResult {
address: HexString;
messageHash: HexString;
signature: HexString;
}
export interface TypedDataDomain {
name: string;
version: string;
chainId: number;
verifyingContract: HexString;
}
export interface TypedDataType {
name: string;
type: string;
}
export interface TypedDataPayload {
domain: TypedDataDomain;
primaryType: string;
types: Record<string, TypedDataType[]>;
message: Record<string, unknown>;
}
export interface TypedSignResult {
address: HexString;
digest: HexString;
signature: HexString;
}
export interface TransactionEnvelope {
privateKey: HexString;
to: HexString;
value: HexString;
nonce: number;
gasLimit: HexString;
maxFeePerGas: HexString;
maxPriorityFeePerGas: HexString;
chainId: number;
data?: HexString;
}
export interface TransactionSignResult {
from: HexString;
rawTransaction: HexString;
transactionHash: HexString;
}
export function signPersonalMessage(input: { privateKey: HexString; message: string | Uint8Array }): Promise<PersonalSignResult>;
export function signTypedData(input: { privateKey: HexString; payload: TypedDataPayload }): Promise<TypedSignResult>;
export function signTransactionEnvelope(input: TransactionEnvelope): Promise<TransactionSignResult>;Provides Ethereum signing, hashing, and transaction encoding utilities needed for personal messages, EIP-712 typed data, and EIP-1559 envelopes.
tessl i tessl/npm-web3-eth@4.8.0docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10