API Methods

The OpenGPU API provides JSON-RPC 2.0 interface methods for blockchain interaction.

Block Information

  • eth_blockNumber: Retrieves the most recent block number

  • eth_getBlockByHash: Returns block data by hash identifier

  • eth_getBlockByNumber: Returns block data by block number

  • eth_getBlockTransactionCountByHash: Gets transaction count for a block via hash

  • eth_getBlockTransactionCountByNumber: Gets transaction count for a block via number

Transaction Methods

  • eth_getTransactionByHash: Retrieves transaction details by hash

  • eth_getTransactionByBlockHashAndIndex: Gets transaction by block hash and position

  • eth_getTransactionByBlockNumberAndIndex: Gets transaction by block number and position

  • eth_getTransactionCount: Returns account transaction count

  • eth_getTransactionReceipt: Retrieves transaction receipt details

  • eth_sendRawTransaction: Submits signed transaction to network

Account & Balance

  • eth_getBalance: Returns account balance in wei

  • eth_getCode: Retrieves contract bytecode at address

Storage & State

  • eth_getStorageAt: Returns storage value at address and position

  • eth_getProof: Generates Merkle proof for account state

Execution

  • eth_call: Executes message call without transaction creation

  • eth_estimateGas: Calculates gas required for transaction

Network Information

  • eth_gasPrice: Returns current gas price in wei

  • eth_chainId: Returns chain identifier

  • eth_syncing: Returns synchronization status or false

  • eth_getLogs: Retrieves contract event logs

Utility

  • net_version: Returns network version

  • web3_clientVersion: Returns client implementation version

  • web3_sha3: Computes Keccak-256 hash

Request/Response Format

All methods use standard JSON-RPC 2.0 structure with jsonrpc, method, params, and id fields. Responses include jsonrpc, id, and result or error fields.

Last updated