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

# Dukungan JSON-RPC

Endpoint EVM Rome menggunakan JSON-RPC Ethereum standar. Foundry, Hardhat, ethers, viem, dan MetaMask berfungsi dengan Rome sama seperti di rantai EVM mana pun. Halaman ini mencantumkan apa yang didukung dan beberapa perilaku khusus Rome yang perlu diketahui.

## Metode yang didukung

**Inti (state & eksekusi):** `eth_chainId`, `eth_blockNumber`, `eth_getBalance`, `eth_getCode`, `eth_getStorageAt`, `eth_getTransactionCount`, `eth_call`, `eth_estimateGas`, `eth_gasPrice`, `eth_maxPriorityFeePerGas`, `eth_feeHistory`.

**Blok & transaksi:** `eth_getBlockByNumber`, `eth_getBlockByHash`, `eth_getBlockReceipts`, `eth_getTransactionByHash`, `eth_getTransactionReceipt`, `eth_sendRawTransaction`, varian berdasarkan indeks/count blok.

**Log & filter:** `eth_getLogs`, `eth_newFilter`, `eth_newBlockFilter`, `eth_getFilterChanges`, `eth_getFilterLogs`, `eth_uninstallFilter`.

**Langganan WebSocket:** `eth_subscribe` / `eth_unsubscribe` (`newHeads`, `logs`). Lihat [Langganan WebSocket](/id/panduan-pengembang/websocket-subscriptions.md).

**Net / web3:** `net_version`, `net_listening`, `net_peerCount`, `web3_clientVersion`.

### Tidak didukung

`debug_traceTransaction` / `trace_*` (pelacakan transaksi), `eth_getProof`, `eth_createAccessList`, `eth_blobBaseFee` (tidak ada transaksi blob), `txpool_*` (tidak ada mempool publik). `newPendingTransactions` langganan diterima tetapi tidak pernah memancarkan apa pun.

## Metode ekstensi Rome

Selain RPC Ethereum standar, proxy mengekspos `rome_*` metode:

| Metode                         | Tujuan                                                                      |
| ------------------------------ | --------------------------------------------------------------------------- |
| `rome_emulateTx`               | Emulasikan transaksi secara off-chain (mengembalikan hasil eksekusi Solana) |
| `rome_emulateTxWithPayer`      | Emulasikan terhadap payer tertentu                                          |
| `rome_emulateCallAccounts`     | Emulasikan dan kembalikan akun Solana yang disentuh oleh sebuah call        |
| `rome_emulateRegRollup`        | Emulasikan pendaftaran rollup                                               |
| `rome_getResources`            | Laporkan status kumpulan resource proxy (payer, holder)                     |
| `rome_mintId`                  | Resolusi mint SPL di balik pembungkus ERC-20                                |
| `rome_buildInfo`               | Info build proxy + program on-chain                                         |
| `rome_isCompatible`            | Periksa kompatibilitas proxy/program                                        |
| `rome_solanaTxForEvmTx`        | Dapatkan transaksi Solana untuk hash tx EVM                                 |
| `rome_sendUnsignedTransaction` | Kirim transaksi tanpa tanda tangan (alur synthetic-sender)                  |

## Perilaku khusus Rome

### Gas berasal dari Solana — estimasikan, jangan hardcode

Rome mengukur eksekusi dalam compute unit Solana, yang ditampilkan sebagai gas EVM. Konsekuensi praktis:

* **Selalu biarkan alat Anda mengestimasi gas.** `forge create`, `cast`, dan panggilan Hardhat `eth_estimateGas` di-chain dan mendapatkan nilai yang tepat secara otomatis.
* **Jangan hardcode `21000` untuk transfer native.** Transfer ke alamat yang belum ada biayanya lebih dari 21000 (karena membuat akun penerima). Estimasi menangani ini; gas limit yang di-hardcode akan gagal untuk penerima baru. `21000` gas limit

### `forge script --broadcast` memerlukan `--skip-simulation`

`forge script` menetapkan gas limit broadcast-nya dari **simulasi lokal** simulasi, yang menyediakan terlalu sedikit untuk model gas Rome. Tambahkan `--skip-simulation` agar Foundry menggunakan `eth_estimateGas` sebagai gantinya:

```bash
forge script script/Deploy.s.sol:Deploy \
  --rpc-url <RPC> --private-key $PRIVATE_KEY --broadcast --skip-simulation
```

`forge create`, `cast send`, dan Hardhat tidak terpengaruh — mereka sudah mengestimasi di-chain.

### `eth_getLogs` dibatasi rentang (\~12.000 blok)

Seperti Infura, Alchemy, dan RPC produksi lainnya, `eth_getLogs` menolak rentang blok yang terlalu lebar (error `-32005`). Batasi kueri Anda:

```javascript
const latest = await provider.getBlockNumber();
const logs = await contract.queryFilter(filter, latest - 5000, latest);
```

Sebuah `queryFilter` tanpa rentang memindai seluruh riwayat dan akan melampaui batas — berikan sebuah `fromBlock`/`toBlock`. Penegasan event berbasis receipt (mis. menunggu tx dan membaca log-nya) tidak terpengaruh.

### Biaya

`eth_gasPrice` mengembalikan harga nyata yang berasal dari oracle; dompet (termasuk MetaMask) menggunakannya dan menampilkan biaya yang benar. Field biaya yang dikirim diterima secara permisif — baik transaksi legacy maupun EIP-1559 berjalan dengan default alat standar.


---

# 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.rome.builders/id/referensi/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.
