> 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/ko/reference/json-rpc.md).

# JSON-RPC 지원

Rome EVM 엔드포인트에서 지원되는 Ethereum JSON-RPC 메서드와 Rome 고유 동작 — Foundry, Hardhat, ethers, viem, MetaMask용.

Rome EVM 엔드포인트는 표준 Ethereum JSON-RPC를 사용합니다. Foundry, Hardhat, ethers, viem, MetaMask는 다른 EVM 체인에서처럼 Rome에서도 동일하게 작동합니다. 이 페이지는 지원되는 항목과 알아둘 만한 Rome 고유 동작 몇 가지를 정리합니다.

## 지원되는 메서드

**핵심(상태 및 실행):** `eth_chainId`, `eth_blockNumber`, `eth_getBalance`, `eth_getCode`, `eth_getStorageAt`, `eth_getTransactionCount`, `eth_call`, `eth_estimateGas`, `eth_gasPrice`, `eth_maxPriorityFeePerGas`, `eth_feeHistory`.

**블록 및 트랜잭션:** `eth_getBlockByNumber`, `eth_getBlockByHash`, `eth_getBlockReceipts`, `eth_getTransactionByHash`, `eth_getTransactionReceipt`, `eth_sendRawTransaction`, block-by-index/count 변형.

**로그 및 필터:** `eth_getLogs`, `eth_newFilter`, `eth_newBlockFilter`, `eth_getFilterChanges`, `eth_getFilterLogs`, `eth_uninstallFilter`.

**WebSocket 구독:** `eth_subscribe` / `eth_unsubscribe` (`newHeads`, `logs`). [WebSocket 구독](/ko/developer-guides/websocket-subscriptions.md).

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

**간단한 introspection 메서드:** `rpc_modules` (나열 `debug`, `eth`, `net`, `rome`, `rpc`, `txpool`, `web3`), `eth_syncing` (항상 `false`), `eth_accounts` (항상 빈 목록), `eth_getUncleCountByBlockNumber`, `eth_getUncleCountByBlockHash`, `eth_getUncleByBlockNumberAndIndex` 및 `eth_getUncleByBlockHashAndIndex` (uncle이 없으므로 개수는 `0x0` 이며 조회 결과는 `null`), `eth_newPendingTransactionFilter` (수락되지만 공개 mempool이 없어서 해시를 반환하지 않음), 그리고 `txpool_status`, 항상 반환하는 `{"pending":"0x0","queued":"0x0"}` 공개 mempool이 없기 때문입니다.

**추적:** `debug_traceRomeTransaction` 트랜잭션 해시를 받아 여러 호출을 하나의 배치로 묶은 트랜잭션의 서브 호출별 및 CPI별 분해 결과를 반환합니다. 일반 트랜잭션은 반환 `null`, 또한 아직 알 수 없거나 색인되지 않은 해시도 그렇습니다.

### 지원되지 않음

`debug_traceTransaction` / `trace_*` (Ethereum 스타일의 트랜잭션 추적; 이들은 반환 `-32601`), `eth_getProof`, `eth_createAccessList`, `eth_blobBaseFee` (blob 트랜잭션이 없으므로), 그리고 `txpool_*` 다음 이외의 메서드: `txpool_status` (공개 mempool이 없음). `newPendingTransactions` 구독은 수락되지만 이벤트를 내보내지 않습니다.

## Rome 확장 메서드

표준 Ethereum RPC 외에도 프록시는 다음을 제공합니다 `rome_*` 메서드:

| 메서드                               | 목적                                                                                                                                      |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `rome_emulateTx`                  | 오프체인에서 트랜잭션을 에뮬레이션합니다( Solana 실행 결과를 반환)                                                                                                |
| `rome_emulateTxWithPayer`         | 특정 payer를 대상으로 에뮬레이션                                                                                                                    |
| `rome_emulateCallAccounts`        | 에뮬레이션하고 호출이 건드리는 Solana 계정을 반환                                                                                                          |
| `rome_emulateRegRollup`           | 롤업 등록을 에뮬레이션                                                                                                                            |
| `rome_getResources`               | 프록시 리소스 풀 상태(payer, holder)를 보고                                                                                                         |
| `rome_mintId`                     | ERC-20 래퍼 뒤의 SPL 민트를 확인                                                                                                                 |
| `rome_buildInfo`                  | 프록시 빌드 + 온체인 프로그램 정보                                                                                                                    |
| `rome_isCompatible`               | 프록시/프로그램 호환성 확인                                                                                                                         |
| `rome_solanaTxForEvmTx`           | EVM 트랜잭션 해시에 해당하는 Solana 트랜잭션(들)을 가져옴                                                                                                   |
| `rome_sendUnsignedTransaction`    | 서명되지 않은 트랜잭션을 제출합니다(synthetic-sender 흐름)                                                                                                |
| `rome_composeUnsignedAtomicV1`    | Solana 지갑의 Ed25519 서명으로 승인된 서명되지 않은 EIP-1559 본문에 대해 하나의 Solana v1 트랜잭션을 구성합니다. 지갑이 서명하고 앱이 이를 브로드캐스트합니다. 호출이 하나의 원자적 트랜잭션에 맞지 않으면 거부합니다 |
| `rome_composeUnsignedIterativeV1` | 동일하지만 모든 레그를 반환합니다(들어맞으면 원자적, 아니면 반복 레그); 지갑이 각각에 서명하고 이를 제출합니다 `rome_submitSignedV1Plan`                                               |
| `rome_submitSignedV1Plan`         | 서명된 플랜을 브로드캐스트합니다(최대 64개 레그); 프록시는 전송만 담당하고, 지갑이 계속 수수료 payer입니다                                                                        |
| `rome_relayUnsignedV1`            | 지갑 서명 한 번으로 프록시의 payer가 레그를 구동합니다; synthetic이 Rome 가스를 지불합니다(먼저 다음으로 자금을 넣으세요 `rome_composeExternalDepositV1`). EVM 트랜잭션 해시를 반환합니다      |
| `rome_composeExternalDepositV1`   | 지갑이 서명한 하나의 트랜잭션으로 지갑의 토큰에서 synthetic의 네이티브 가스 잔액을 충전합니다                                                                                |

## Rome 고유 동작

### 가스는 Solana에서 파생됩니다 — 추정하고 하드코딩하지 마세요

Rome은 실행을 Solana 컴퓨트 유닛으로 계량해 EVM 가스로 표시합니다. 쓰기 작업 비용의 대부분은 Solana 계정을 만드는 데서 나옵니다: 한 번도 사용되지 않은 수신자, 새 토큰 계정, 배포된 계약. 이 계정들은 추정치에 포함됩니다. 실용적 영향:

* **사용하세요 `eth_estimateGas`, 그리고 절대 하드코딩하지 마세요 `21000`.** 표준 도구(`forge create`, `cast`, Hardhat, ethers, viem, MetaMask)는 이미 이를 호출해 사용할 수 있는 값을 얻습니다. Solana 프로그램을 건드리는 호출의 경우 여유분을 더하세요(SDK의 `submitRomeTx` 1.3배로 패딩하며) 추정 자체가 revert되면 가스 상한을 설정하세요. 하드코딩된 `21000` limit은 쓰기 작업이 계정을 생성할 때마다 실패합니다. 예를 들어 한 번도 사용되지 않은 주소로의 전송이 그렇습니다.
* **Rome은 실제로 사용된 가스만 청구합니다.** 아래 측정에서 사용된 가스는 추정치를 넘지 않았으므로, 실제 작업보다 높은 추정치는 차액을 더 지불하게 하지 않습니다.
* **도구가 추가하는 여유분은 그대로 두세요.** 상태는 추정 시점과 트랜잭션이 확정되는 순간 사이에 바뀔 수 있으며, Solana CPI를 발생시키는 호출의 추정치는 낮게 나올 수 있습니다. SDK의 `submitRomeTx` 추정치를 여유분으로 1.3배 패딩합니다.

Hadrian에서 측정했으며, 당시 가스 가격은 약 10.4 gwei였습니다:

| 쓰기                                          | `eth_estimateGas` | 사용된 가스    |
| ------------------------------------------- | ----------------- | --------- |
| 한 번도 사용되지 않은 주소로의 네이티브 전송                   | 1,086,961         | 1,086,961 |
| 기존 주소로의 네이티브 전송                             | 21,000            | 10,001    |
| 한 번도 사용되지 않은 주소로의 wUSDC 전송                  | 2,544,921         | 2,544,921 |
| 가스를 wUSDC로 감싸기(`withdraw_to_ata`)           | 21,000            | 10,001    |
| 래퍼 권한 부여(`approve_spl` Helper precompile에서) | 21,000            | 10,001    |
| 10바이트 계약 배포                                 | 1,147,921         | 1,147,921 |

이것들은 한 체인에서의 단일 측정값일 뿐 한도가 아닙니다. 숫자는 호출이 어떤 계정을 생성해야 하는지에 따라 달라지므로, 이를 복사하지 말고 각 쓰기 작업을 추정하세요.

### `forge script --broadcast` 필요합니다 `--skip-simulation`

`forge script` 브로드캐스트 가스 한도를 다음 값에서 설정합니다: **로컬** 시뮬레이션은 Rome의 가스 모델에 비해 할당이 부족합니다. 다음을 추가하세요 `--skip-simulation` 그래서 Foundry가 체인의 `eth_estimateGas` 대신 사용하도록:

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

`forge create`, `cast send`, 그리고 Hardhat는 영향을 받지 않습니다 — 이미 온체인에서 추정하기 때문입니다.

### `eth_getLogs` 범위가 제한됩니다(\~12,000 블록)

Infura, Alchemy 및 기타 프로덕션 RPC와 마찬가지로, `eth_getLogs` 지나치게 넓은 블록 범위는 거부합니다(오류 `-32005`). 쿼리 범위를 제한하세요:

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

하나의 `queryFilter` 범위를 지정하지 않으면 모든 기록을 스캔하게 되어 한도를 초과합니다 — 명시적인 `fromBlock`/`toBlock`. 영수증 기반 이벤트 검증(예: 트랜잭션을 기다렸다가 로그를 읽는 것)은 영향을 받지 않습니다.

### 수수료

`eth_gasPrice` 실제 오라클 기반 가격을 반환합니다; 지갑들(MetaMask 포함)은 이를 사용해 올바른 수수료를 표시합니다. 제출된 fee 필드는 관대한 방식으로 허용됩니다 — legacy 및 EIP-1559 트랜잭션 모두 표준 도구 기본값으로 확정됩니다.


---

# 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.rome.builders/ko/reference/json-rpc.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.
