English version: /en/doc/_generated/interfaces.html
Interfaces
TL;DR
- 外部I/Fは
Candid(canister直呼び)とHTTP JSON-RPC(gateway)の2系統。 - JSON-RPCは Ethereum完全互換ではなく、制限付き実装。
eth_sendRawTransactionは submit成功≠実行成功。eth_getTransactionReceipt.statusを成功条件にする。- pending/mempool は Ethereum互換APIとしては未対応。送信済み tx の追跡は canister
get_pending(tx_id)を使う。
1. Candid API(公開service)
公開定義: crates/ic-evm-wrapper/evm_canister.did
主要query
rpc_eth_chain_idrpc_eth_block_numberrpc_eth_get_block_by_numberrpc_eth_get_block_by_number_with_statusrpc_eth_get_transaction_by_eth_hashrpc_eth_get_transaction_by_tx_idrpc_eth_get_transaction_receipt_by_eth_hashrpc_eth_get_transaction_receipt_with_status_by_eth_hashrpc_eth_get_transaction_receipt_with_status_by_tx_idrpc_eth_get_balancerpc_eth_get_coderpc_eth_get_storage_atrpc_eth_call_objectrpc_eth_call_rawtxrpc_eth_estimate_gas_objectrpc_eth_get_logs_pagedrpc_eth_get_block_number_by_hashrpc_eth_gas_pricerpc_eth_max_priority_fee_per_gasrpc_eth_fee_historyexpected_nonce_by_addressget_receiptget_pendingexport_blocksget_ops_statushealthmetrics
主要update
rpc_eth_send_raw_transactionsubmit_ic_txset_block_gas_limitset_instruction_soft_limitset_prune_policyset_pruning_enabledset_log_filterprune_blocks
2. Gateway JSON-RPC
実装: tools/rpc-gateway/src/handlers.ts の handleRpc switch
実装済みメソッド
web3_clientVersionnet_versioneth_chainIdeth_blockNumbereth_gasPriceeth_maxPriorityFeePerGaseth_feeHistoryeth_syncingeth_getBlockByNumbereth_getTransactionByHasheth_getTransactionReceipteth_getBalanceeth_getTransactionCounteth_getCodeeth_getStorageAteth_getLogseth_calleth_estimateGaseth_sendRawTransaction
未対応(READMEの互換表)
eth_getBlockByHasheth_getTransactionByBlockHashAndIndexeth_getTransactionByBlockNumberAndIndexeth_getBlockTransactionCountByHasheth_getBlockTransactionCountByNumbereth_newFiltereth_getFilterChangeseth_uninstallFiltereth_subscribeeth_unsubscribeeth_pendingTransactions
3. 制約の正本
- 全体ポリシーの正本:
../rpc/overview.md - JSON-RPC差分の正本:
../compatibility/json-rpc-deviations.md - pending/mempool運用の正本:
../rpc/overview.mdの「Pending/Mempoolポリシー」
本ページは「インターフェース一覧」の要約に限定し、詳細な挙動差分は上記正本に集約する。
4. 返却・識別子の注意
- canister内部識別子:
tx_id - Ethereum互換識別子:
eth_tx_hash - Gateway
eth_sendRawTransactionは canister戻りtx_idからeth_tx_hashを解決して返す。
5. 型境界(代表)
RpcCallObjectView(Candid)EthBlockView/EthTxView/EthReceiptViewRpcBlockLookupView(NotFound/Found/Pruned)RpcReceiptLookupView(NotFound/Found/PossiblyPruned/Pruned)PendingStatusView(Queued/Included/Dropped/Unknown)
根拠
crates/ic-evm-wrapper/evm_canister.didtools/rpc-gateway/src/handlers.tstools/rpc-gateway/README.mdcrates/ic-evm-wrapper/src/lib.rs(get_pending,rpc_eth_send_raw_transaction)