githubEdit

eth_accounts - Polygon

Example code for the eth_accounts json-rpc method. Сomplete guide on how to use eth_accounts json-rpc in GetBlock.io Web3 documentation.

The eth_accounts method returns a list of addresses owned by the client node. Since GetBlock provides access to shared infrastructure rather than personal nodes, this method typically returns an empty array, as account management is not handled by the RPC endpoint.

This method is part of the Polygon JSON-RPC Core API and is useful for checking if any accounts are available for signing transactions directly through the node.

Parameters

  • None

Request

curl
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_accounts",
    "params": [],
    "id": "getblock.io"
}'

Response

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": []
}

Response Parameters

Field
Type
Description

jsonrpc

string

JSON-RPC version (2.0)

id

string

Request identifier

result

array

List of account addresses (typically empty for shared nodes)

Use Case

The eth_accounts method is typically used for:

  • Checking if the connected node manages any accounts

  • Verifying node configuration for account-based operations

  • Determining available signers for transaction signing

  • Development and debugging purposes

circle-info

Note: When using GetBlock's shared infrastructure, this method will return an empty array since account private keys are not stored on the shared nodes. For transaction signing, use external wallet solutions or the eth_sendRawTransaction method with pre-signed transactions.

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid ACCESS-TOKEN

-32600

Invalid Request

Malformed request body

Web3 Integration

Last updated

Was this helpful?