> 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

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](/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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
