<!-- Question: How do I connect to Paxeer and read a balance? -->
<!-- Source: https://docs.paxeer.app/a/read-a-balance (reviewed answer, corpus 837d42000759) -->

# Connect and read a balance

Point any Ethereum JSON-RPC client at a node endpoint, confirm it reports chain ID `0x7d`, then read the balance. Read-only queries work without a signer or a PAX balance.

**Verify the chain before signing**

| Setting | Value |
| --- | --- |
| EVM chain ID | 125 / `0x7d` |
| Consensus identifier | `hyperpax_125-1` |
| Native gas coin | `uhpx` (bond denom); bank metadata displays PAX at exponent 6 over `uhpx`. EVM amounts use wei, tracked as a sub-`uhpx` remainder. |

1. **Verify the endpoint**

   Set `PAXEER_RPC_URL` to your EVM endpoint. The result must be `0x7d`, which is decimal 125. You can send the same request from here.
   
   **Ask the endpoint for its chain ID**
   
   ```sh
   : "${PAXEER_RPC_URL:?Set your Paxeer EVM RPC URL}"
   curl --fail-with-body --silent --show-error "$PAXEER_RPC_URL"   -H 'Content-Type: application/json'   --data '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'
   ```
   
   **`eth_chainId`** — node JSON-RPC
   
   Documented in: [Agent runtime › Submission and receipt recovery](https://docs.paxeer.app/agent-runtime#submission-and-receipt-recovery), [Build a Frontend › Define Paxeer once](https://docs.paxeer.app/building-a-frontend#define-paxeer-once), [Network Parameters › Chain Identifiers](https://docs.paxeer.app/network-parameters#chain-identifiers)

2. **Read the native balance**

   `cast balance` returns native base units by default. The last command in this block only encodes calldata; it does not submit a transaction.
   
   **Inspect an account with Cast**
   
   ```sh
   cast block-number --rpc-url "$PAXEER_RPC_URL"
   cast balance "$ACCOUNT_ADDRESS" --rpc-url "$PAXEER_RPC_URL"
   cast nonce "$ACCOUNT_ADDRESS" --rpc-url "$PAXEER_RPC_URL"
   cast code "$CONTRACT_ADDRESS" --rpc-url "$PAXEER_RPC_URL"
   cast call "$CONTRACT_ADDRESS" 'balanceOf(address)(uint256)' "$ACCOUNT_ADDRESS"   --rpc-url "$PAXEER_RPC_URL"
   cast calldata 'transfer(address,uint256)' "$ACCOUNT_ADDRESS" 42
   ```
   
   **`eth_getBalance`** — node JSON-RPC
   
   Documented in: [Developer funding and allocations › Response verification and recovery](https://docs.paxeer.app/developer-funding#response-verification-and-recovery), [JSON-RPC API › Key eth_ Methods](https://docs.paxeer.app/json-rpc#key-eth-methods), [XDK developer toolkit › Choose your integration plane](https://docs.paxeer.app/xdk#choose-your-integration-plane)

3. **Read a token balance at one block**

   Install `viem`, save the example as `read-token.mjs`, set `TOKEN_ADDRESS` and `ACCOUNT_ADDRESS`, then run it. The reads run concurrently at the same block.
   
   **read-token.mjs**
   
   ```js
   import { createPublicClient, formatUnits, getAddress, http, parseAbi } from "viem";
   
   const rpcUrl = process.env.PAXEER_RPC_URL;
   if (!rpcUrl) throw new Error("Set PAXEER_RPC_URL");
   const token = getAddress(process.env.TOKEN_ADDRESS ?? "");
   const account = getAddress(process.env.ACCOUNT_ADDRESS ?? "");
   const client = createPublicClient({ transport: http(rpcUrl) });
   if (await client.getChainId() !== 125) throw new Error("Unexpected chain ID");
   
   const blockNumber = await client.getBlockNumber();
   const abi = parseAbi([
     "function decimals() view returns (uint8)",
     "function symbol() view returns (string)",
     "function balanceOf(address owner) view returns (uint256)",
   ]);
   const [decimals, symbol, balance] = await Promise.all([
     client.readContract({ address: token, abi, functionName: "decimals", blockNumber }),
     client.readContract({ address: token, abi, functionName: "symbol", blockNumber }),
     client.readContract({ address: token, abi, functionName: "balanceOf", args: [account], blockNumber }),
   ]);
   console.log({ block: blockNumber.toString(), symbol, balance: formatUnits(balance, decimals) });
   ```

> **Check the body, not only the status:** HTTP 200 can still contain a JSON-RPC `error`. The consensus RPC server exposes routes such as `/status`; it is not interchangeable with the EVM JSON-RPC listener.

**Read next**

- [Public RPC endpoints](https://docs.paxeer.app/public-rpc): The LayerX kernel inside paxd executes and orders each transaction and builds each block; validators check and commit each block on EVM chain ID 125.
- [Query the EVM](https://docs.paxeer.app/querying-evm): Read Paxeer balances, contract state, receipts, and bounded event ranges with JSON-RPC, Cast, and viem.
- [Python Quickstart](https://docs.paxeer.app/python): Connect to Paxeer with web3.py, read PAX balances and ERC-20 state, and inspect transaction receipts without a signing key.
- [Build a Frontend](https://docs.paxeer.app/building-a-frontend): Connect a browser wallet to Paxeer with React and viem, show PAX balances, and read contracts at a consistent block.

---

Sources: [Public RPC endpoints › Verify the chain before signing](https://docs.paxeer.app/public-rpc#verify-the-chain-before-signing) · [Query the EVM › Verify the endpoint](https://docs.paxeer.app/querying-evm#verify-the-endpoint) · [Agent runtime › Submission and receipt recovery](https://docs.paxeer.app/agent-runtime#submission-and-receipt-recovery) · [Build a Frontend › Define Paxeer once](https://docs.paxeer.app/building-a-frontend#define-paxeer-once) · [Query the EVM › Inspect accounts and contracts with Cast](https://docs.paxeer.app/querying-evm#inspect-accounts-and-contracts-with-cast) · [Developer funding and allocations › Response verification and recovery](https://docs.paxeer.app/developer-funding#response-verification-and-recovery) · [JSON-RPC API › Key eth_ Methods](https://docs.paxeer.app/json-rpc#key-eth-methods) · [Query the EVM › Read token data at one block](https://docs.paxeer.app/querying-evm#read-token-data-at-one-block)
