> For the complete documentation index, see [llms.txt](https://docs.onyx.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.onyx.org/apis/evm-json-rpc.md).

# EVM JSON-RPC

Supported EVM JSON-RPC usage on Onyx Mainnet.

Mainnet endpoint: `https://rpc.onyx.org`

## Common methods

The public relay supports the EVM methods commonly needed by wallets, exchanges, and applications, including:

* Network and blocks: `eth_chainId`, `net_version`, `eth_blockNumber`, `eth_getBlockByNumber`, `eth_getBlockByHash`
* Accounts and state: `eth_getBalance`, `eth_getTransactionCount`, `eth_getCode`, `eth_getStorageAt`
* Transactions: `eth_sendRawTransaction`, `eth_getTransactionByHash`, `eth_getTransactionReceipt`
* Contracts and fees: `eth_call`, `eth_estimateGas`, `eth_gasPrice`, `eth_maxPriorityFeePerGas`
* Events: `eth_getLogs` and supported filter/subscription methods

Onyx does not promise support for every Ethereum client extension, debug method, pending-pool behavior, or future RPC method. Probe the exact method set your application requires and handle `method not found` or `method not supported` responses.

## Example

```bash
curl -sS https://rpc.onyx.org \
  -H 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
```

## Onyx-specific considerations

* Native XCN is returned in 18-decimal RPC units but settles at 8-decimal ledger precision.
* `eth_estimateGas` must be used for transfers because the recipient account may need to be created.
* Read the current gas price; do not use fixed price tiers copied from another network. See [Network Fees](https://docs.onyx.org/developer-guide/network-fees.md) for Onyx's fee calculation and USD denomination.
* Public capacity and throttling can change. Back off on transient errors and arrange dedicated service before depending on a specific SLA.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.onyx.org/apis/evm-json-rpc.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
