OXN 支持标准以太坊 JSON-RPC 表面,行为差异下方注明。
账户与余额方法
| 方法 | 支持 | 备注 |
|---|
eth_accounts | ✅ | 返回已配置账户(公共 RPC 基本为空)。 |
eth_getBalance | ✅ | 标准。 |
eth_getTransactionCount | ✅ | 标准 nonce 查询。 |
eth_getCode | ✅ | 返回部署的字节码。 |
eth_getStorageAt | ✅ | 返回加密存储字节(密文)。 |
注意: eth_getStorageAt 返回存储里的加密值。想读解密后的状态,调用一个读取并返回值的 view 函数——运行时在 enclave 内解密。
区块方法
| 方法 | 支持 | 备注 |
|---|
eth_blockNumber | ✅ | 最新区块高度。 |
eth_getBlockByNumber | ✅ | 标准区块查询。 |
eth_getBlockByHash | ✅ | 标准。 |
eth_getBlockTransactionCountByNumber | ✅ | 标准。 |
eth_getBlockTransactionCountByHash | ✅ | 标准。 |
交易方法
| 方法 | 支持 | 备注 |
|---|
eth_sendRawTransaction | ✅ | 标准。data 可以是明文或加密 CBOR 信封。 |
eth_getTransactionByHash | ✅ | 加密交易返回加密的 data。 |
eth_getTransactionReceipt | ✅ | 标准。加密交易的日志是加密的。 |
eth_getTransactionByBlockNumberAndIndex | ✅ | 标准。 |
调用与估算
| 方法 | 支持 | 备注 |
|---|
eth_call | ✅ | 标准,加上签名查询和加密变体。见下文。 |
eth_estimateGas | 显式设置 gasLimit(推荐)。见 Gas 与手续费。 | |
eth_gasPrice | ✅ | 返回当前 gas 价格。测试网上 0 被接受。 |
eth_call 变体
单个 eth_call 方法服务三种模式:
- 明文调用。 标准参数——
data、from、to 等。返回明文结果。
- 加密调用。
data 是 CBOR 信封。返回加密响应。
- 签名查询。
data 是含内嵌签名的 CBOR 信封;信封内的 from 填充 msg.sender。
SDK 会根据你的调用方式(wrapped provider vs 裸 provider、是否附了 signer)选择正确模式。
日志与过滤器方法
| 方法 | 支持 | 备注 |
|---|
eth_getLogs | ✅ | 跨区块过滤。加密事件返回密文。 |
eth_newFilter | ✅ | 标准。 |
eth_newBlockFilter | ✅ | 标准。 |
eth_newPendingTransactionFilter | ✅ | 标准。 |
eth_getFilterChanges | ✅ | 标准。 |
eth_uninstallFilter | ✅ | 标准。 |
网络与客户端识别
| 方法 | 支持 | 备注 |
|---|
eth_chainId | ✅ | OXN 测试网返回 0xba(186)。 |
eth_syncing | ✅ | 公共 RPC 始终返回 false(完全同步)。 |
net_version | ✅ | 与 eth_chainId 相同的值,十进制。 |
net_listening | ✅ | 始终 true。 |
net_peerCount | ✅ | 返回节点上的 peer 数。 |
web3_clientVersion | ✅ | 节点软件版本字符串。 |
web3_sha3 | ✅ | 标准。 |
Debug 与 trace 方法
| 方法 | 支持 | 备注 |
|---|
debug_traceTransaction | 部分 | 高负载下公共 RPC 可能禁用。加密交易返回不透明 calldata。 |
debug_traceCall | 部分 | 同上。 |
不支持的
| 方法 | 原因 |
|---|
eth_signTransaction | 公共 RPC 不持有密钥。 |
eth_signTypedData_v4 | 公共 RPC 不持有密钥。 |
eth_getProof | 当前运行时未实现。 |
eth_gasPrice 中的 EIP-1559 maxFeePerGas / maxPriorityFeePerGas | OXN 用 legacy 费用模型。 |
eth_feeHistory | Legacy 费用模型——没有 base fee 历史。 |
下一步