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

# JSON-RPC

EVM JSON-RPC reference — supported methods, examples, and SVPChain-specific notes.

SVPChain implements the standard Ethereum JSON-RPC interface. If your code talks to Ethereum, Arbitrum, or BNB Chain, it talks to SVPChain.

* **Endpoint (testnet):** `https://svp-dataseeds-testnet.svpchain.org`
* **Endpoint (mainnet):** `https://svp-dataseeds.svpchain.org`
* Full list and alternates: [Networks](/svpchain-docs/chain/networks.md).

### Common methods

#### Chain and block info

| Method                     | Description                                                |
| -------------------------- | ---------------------------------------------------------- |
| `eth_chainId`              | Chain ID — `0x9d5` (2517) testnet, `0x9d6` (2518) mainnet. |
| `eth_blockNumber`          | Latest block number.                                       |
| `eth_getBlockByNumber`     | Block by number, optionally with full tx objects.          |
| `eth_getBlockByHash`       | Block by hash.                                             |
| `eth_gasPrice`             | Suggested legacy gas price.                                |
| `eth_feeHistory`           | Base fee history (EIP-1559).                               |
| `eth_maxPriorityFeePerGas` | Suggested priority tip.                                    |

#### Account and state

| Method                    | Description                            |
| ------------------------- | -------------------------------------- |
| `eth_getBalance`          | Native `SVP` balance, in wei (`asvp`). |
| `eth_getTransactionCount` | Account nonce.                         |
| `eth_getCode`             | Contract bytecode at an address.       |
| `eth_getStorageAt`        | Raw storage slot read.                 |
| `eth_call`                | Read-only contract call.               |
| `eth_estimateGas`         | Estimate gas for a tx.                 |

#### Transactions

| Method                      | Description                   |
| --------------------------- | ----------------------------- |
| `eth_sendRawTransaction`    | Submit a signed tx.           |
| `eth_getTransactionByHash`  | Lookup by tx hash.            |
| `eth_getTransactionReceipt` | Receipt with logs and status. |

#### Logs and events

| Method                                   | Description                       |
| ---------------------------------------- | --------------------------------- |
| `eth_getLogs`                            | Filtered logs over a block range. |
| `eth_newFilter` / `eth_getFilterChanges` | Polling-style log filter.         |

For subscriptions (`eth_subscribe`), see [WebSocket](/svpchain-docs/build/websocket.md).

### Examples

#### Get the current block height

```sh
curl -s -X POST https://svp-dataseeds-testnet.svpchain.org \
  -H 'Content-Type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
# → {"jsonrpc":"2.0","id":1,"result":"0x12a05f"}
```

#### Get a balance

```sh
curl -s -X POST https://svp-dataseeds-testnet.svpchain.org \
  -H 'Content-Type: application/json' \
  --data '{
    "jsonrpc":"2.0","id":1,"method":"eth_getBalance",
    "params":["0xYourAddress","latest"]
  }'
```

The returned `result` is hex-encoded wei (`asvp`). Divide by `10^18` for `SVP`.

#### Call a contract

```sh
# balanceOf(address) selector + 32-byte padded address
curl -s -X POST https://svp-dataseeds-testnet.svpchain.org \
  -H 'Content-Type: application/json' \
  --data '{
    "jsonrpc":"2.0","id":1,"method":"eth_call",
    "params":[{
      "to":"0xToken...",
      "data":"0x70a08231000000000000000000000000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    },"latest"]
  }'
```

#### Submit a signed transaction

```sh
curl -s -X POST https://svp-dataseeds-testnet.svpchain.org \
  -H 'Content-Type: application/json' \
  --data '{
    "jsonrpc":"2.0","id":1,"method":"eth_sendRawTransaction",
    "params":["0xf86c80850430e23400825208..."]
  }'
```

### SVPChain-specific notes

* **Gas pricing.** Min gas price is `2 Gwei`. Submitting below this returns `tx underpriced`. EIP-1559 fields (`maxFeePerGas`, `maxPriorityFeePerGas`) are honored — default base fee is around `1.9 Gwei`.
* **Finality.** A tx in any committed block is final immediately. There is no "wait N confirmations" rule — receipt available means done.
* **Native CLOB events.** The on-chain order book emits **Cosmos** tx events, not EVM logs. Use Cosmos REST/gRPC or CometBFT block events to index CLOB activity. See [Indexing & events](/svpchain-docs/build/indexing-and-events.md).
* **Pending tx.** Public RPC nodes do not always reveal mempool contents. Run your own node if you need reliable `pending` semantics.

### Practical checklist

* Set explicit timeouts on every request — 5–10s for reads, 30s+ for `eth_call` against heavy contracts.
* Retry idempotent reads with exponential backoff and capped attempts.
* For sustained or production traffic, [run your own node](/svpchain-docs/chain/run-a-node.md) instead of relying on the public endpoint.
* For sustained traffic, [run your own node](/svpchain-docs/chain/run-a-node.md).

### Next steps

<table data-view="cards"><thead><tr><th>Related</th><th data-card-target data-type="content-ref">Link</th></tr></thead><tbody><tr><td>Subscribe to new blocks and logs</td><td><a href="/svpchain-docs/build/websocket.md">WebSocket</a></td></tr><tr><td>Indexing patterns</td><td><a href="/svpchain-docs/build/indexing-and-events.md">Indexing &amp; events</a></td></tr><tr><td>Run your own RPC node</td><td><a href="/svpchain-docs/chain/run-a-node.md">Run a node</a></td></tr></tbody></table>


---

# 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://svpchain.gitbook.io/svpchain-docs/build/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.
