RPC API
Super AI Chain 对外提供标准以太坊 JSON-RPC,归档节点另开放 BSC debug_* 命名空间。
接口
| 协议 | URL |
|---|---|
| HTTPS JSON-RPC | https://rpc-testnet.superaichain.ai |
| WebSocket | wss://wss-testnet.superaichain.ai |
| 浏览器 | https://scan-testnet.superaichain.ai |
查询 Chain ID
curl -s https://rpc-testnet.superaichain.ai \
-X POST -H 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'
# -> {"jsonrpc":"2.0","id":1,"result":"0x2290"} # 0x2290 = 8848
常用方法
# latest block number
curl -s https://rpc-testnet.superaichain.ai -X POST -H 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'
# balance
curl -s https://rpc-testnet.superaichain.ai -X POST -H 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":1,"method":"eth_getBalance","params":["0xYourAddress","latest"]}'
WebSocket 订阅
import { createPublicClient, webSocket } from 'viem';
const client = createPublicClient({ transport: webSocket('wss://wss-testnet.superaichain.ai') });
const unwatch = client.watchBlocks({ onBlock: (b) => console.log(b.number) });
追踪(归档节点)
归档 RPC 节点提供 debug_traceTransaction 及相关方法 — 浏览器的内部交易视图依赖它们。
速率限制
公共接口在网关做限流和方法过滤。重负载(索引器、机器人)请自建节点或申请独立接口。