> 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/developer-guide/getting-started.md).

# Getting Started

Connect EVM tooling to Onyx Mainnet safely.

Onyx Mainnet accepts signed EVM transactions through JSON-RPC on Chain ID `327`.

```javascript
import { JsonRpcProvider } from "ethers";

const provider = new JsonRpcProvider("https://rpc.onyx.org", 327);
const network = await provider.getNetwork();

if (network.chainId !== 327n) throw new Error("Wrong network");
console.log(await provider.getBlockNumber());
```

## Mainnet endpoints

| Service             | URL                        |
| ------------------- | -------------------------- |
| JSON-RPC            | `https://rpc.onyx.org`     |
| Explorer            | <https://onyxscan.org>     |
| Markets and OpenAPI | `https://markets.onyx.org` |

End users can also add Onyx with one click from [Onyx Scan](https://onyxscan.org) (bottom-left **Add Onyx Network** button). See [Quick Start](https://docs.onyx.org/readme/quick-start.md).

## Add Onyx programmatically

For wallet dApps and browser providers, request the chain with EIP-3085:

```javascript
await window.ethereum.request({
  method: "wallet_addEthereumChain",
  params: [{
    chainId: "0x147",
    chainName: "Onyx Mainnet",
    nativeCurrency: { name: "XCN", symbol: "XCN", decimals: 18 },
    rpcUrls: ["https://rpc.onyx.org"],
    blockExplorerUrls: ["https://onyxscan.org"]
  }]
});
```

Verify the network before signing:

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

The result must be `0x147` (decimal `327`).

## Before sending value

1. Verify `eth_chainId` returns `0x147`.
2. Use `eth_estimateGas` for every transaction, especially transfers to unused addresses.
3. Use the gas price returned by the RPC. See [Network Fees](https://docs.onyx.org/developer-guide/network-fees.md) for the current snapshot, calculation, and USD denomination.
4. Keep native XCN values aligned to the ledger's 8-decimal precision.
5. Wait for a successful transaction receipt and reconcile balances through an independent read path.

Onyx supports the commonly used EVM read, transaction, contract-call, log, and subscription methods documented in [EVM JSON-RPC](https://docs.onyx.org/apis/evm-json-rpc.md). It does not claim complete parity with every Ethereum client extension.


---

# 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/developer-guide/getting-started.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.
