Getting Started
Connect EVM tooling to Onyx Mainnet safely.
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
Add Onyx programmatically
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://explorer.onyx.org"]
}]
});Before sending value
Last updated
