JSON-RPC API
CelesChain exposes a JSON-RPC 2.0 interface that is fully EVM compatible. Any tooling that works with Ethereum JSON-RPC (for example, ethers.js, web3.js, Hardhat, Foundry) can be used to interact with CelesChain with little or no change.
Base RPC endpoints for examples in this page:
HTTPS RPC testnet:
https://rpc-testnet.celeschain.xyzWebSocket RPC testnet:
wss://rpc-testnet.celeschain.xyz
This section documents common RPC methods, Celes specific behaviors, examples, and best practices for production use.
General notes
All numeric values follow Ethereum conventions: hex string with
0xprefix.Block identifiers:
latest,earliest,pending, or a hex block number.Gas price semantics: Celes uses a bridged native gas token model.
eth_gasPrice,eth_feeHistoryandeth_maxPriorityFeePerGasreturn estimates denominated in the chain native gas unit. When calculating gas for a cross-environment flow, account for Base settlement costs separately.EVM compatibility: full support for standard eth_* methods plus a small set of extended methods useful for rollup and debugging scenarios.
Subscriptions: supported over WebSocket with
eth_subscribeandeth_unsubscribe. Use WS for streaming new heads, logs and pending transactions.
Common ETH methods
eth_chainId
Returns the chain ID.
Request
Response
eth_blockNumber
Returns the latest block number.
Request
Response
eth_getBlockByNumber
Get block by number. fullTransactionObjects true returns transaction objects, false returns tx hashes.
Request
Response
eth_getTransactionByHash
Get transaction by hash.
Request
Response
eth_getTransactionReceipt
Get transaction receipt.
Request
Response
eth_call
Execute a read only call without broadcasting a transaction.
Request
Response
eth_sendRawTransaction
Submit a signed raw transaction to the network.
Request
Response
eth_estimateGas
Estimate gas for a transaction. Always run before preparing gas settings.
Request
Response
eth_gasPrice and eth_maxPriorityFeePerGas
Return gas price and priority fee estimates. On CelesChain these reflect the bridged gas token economics.
Request
Response
Note
If your transaction must be posted to Base as part of settlement flows, estimate additional settlement cost separately.
Extended and rollup specific methods
CelesChain exposes a small set of extra methods useful for rollup operations and debugging. These are implemented where applicable; behavior follows the semantics used by many modular rollup stacks.
eth_getBlockReceipts
Return transaction receipts for all transactions in a block.
Request
Response
Use case
Useful for services that need all receipts for a block for indexing or faster reorg handling.
eth_getAccount
Return enriched account information for rollup scenarios.
Request
Response
Use case
Quick account snapshot for explorers and indexing services.
Debug trace methods
CelesChain supports debug tracing endpoints for deep inspection.
debug_traceTransactionreplay a single transaction with a tracer.debug_traceBlockByNumberanddebug_traceBlockByHashtrace all transactions in a block.trace_filtersupports trace filtering over a block range.
These methods require elevated node privileges on some providers. Use them for detailed diagnostics, MEV research, and analytics.
Example
Subscription methods (WebSocket)
Use WebSocket endpoint for real time streaming.
eth_subscribe
Request
Response
When a new head arrives, you will receive push messages with the block header.
eth_unsubscribe
Request
Response
Example integrations
cURL: get latest block number
ethers.js: connect and get chain id
ethers.js: subscribe to new heads (via WebSocket)
Send raw tx with curl
Error handling and response codes
JSON-RPC error object will follow the 2.0 spec. Inspect
error.codeanderror.message.Common error causes:
Invalid parameters.
Insufficient gas or funds.
Node not synced.
Rate limit exceeded.
When you receive a transient error, implement exponential backoff and retry for idempotent operations. For non idempotent operations such as
eth_sendRawTransaction, do not retry blindly without checking the transaction hash first.
Best practices and recommendations
Use WebSocket subscriptions for real time monitoring and notifications.
Batch calls using
eth_batchsemantics in your client where supported. If your provider does not support batching natively, run parallel RPC requests carefully.Use
eth_estimateGasbefore sending transactions. Then add a safety buffer to the gas limit.For front end applications, prefer
eth_callfor read only queries to avoid paying gas and keep UI responsive.When indexing blocks, prefer
eth_getBlockReceiptsandeth_getLogsfor efficient retrieval of receipts and logs.Account for settlement cost to Base when designing user flows that require posting checkpoints or cross-chain settlement.
Use idempotent nonce management for programmatic transaction submission. When possible, use the account nonce from
eth_getTransactionCountwithpendingto handle pending transactions.
Rate limits and usage
Providers may enforce rate limits on public RPC endpoints. If you operate production workloads, host a dedicated node or request an enterprise endpoint.
For heavy indexing or analytics work, use archived node endpoints or a specialized indexing service rather than the public RPC.
Appendix: common parameters and formats
Hex integers: 0x prefixed, no leading zeros unless zero.
Addresses: 0x prefixed, 20 bytes lowercase checksum optional.
Bytes data: 0x prefixed hex.
Block numbers:
"latest","earliest","pending"or hex number string.
Last updated
