JSON-RPC methods
Prism exposes the standard Ethereum JSON-RPC surface. Requests and responses are unmodified - the differences are in how each method is routed, cached and retried.
Three properties govern every method:
- Retryable - safe to replay on a different provider if the first attempt fails.
- Cacheable - the answer is deterministic for its parameters, so an identical request can be served without an upstream call.
- Deduplicated - identical requests already in flight are collapsed into one upstream call.
State & accounts
| Method | Retryable | Cached | Notes |
|---|---|---|---|
eth_getBalance | Yes | 2s at latest | Cached indefinitely at a specific block |
eth_getCode | Yes | Permanent at a block | Contract code at a mined block never changes |
eth_getStorageAt | Yes | 2s at latest | |
eth_getTransactionCount | Yes | No | Nonce reads always hit an upstream |
eth_call | Yes | 2s at latest | Deduplicated aggressively; the highest-volume method in most apps |
eth_estimateGas | Yes | No | Estimates track pending state |
Blocks
| Method | Retryable | Cached | Notes |
|---|---|---|---|
eth_blockNumber | Yes | 1s | Also used as the health probe |
eth_getBlockByNumber | Yes | Permanent when finalized | latest and pending are not cached |
eth_getBlockByHash | Yes | Permanent | A hash identifies one immutable block |
eth_getBlockReceipts | Yes | Permanent when finalized | |
eth_getBlockTransactionCountByNumber | Yes | Permanent when finalized |
Transactions
| Method | Retryable | Cached | Notes |
|---|---|---|---|
eth_sendRawTransaction | No | No | Sent to exactly one upstream. See below. |
eth_getTransactionByHash | Yes | Permanent once mined | |
eth_getTransactionReceipt | Yes | Permanent once mined | Not cached while pending |
eth_getTransactionByBlockHashAndIndex | Yes | Permanent |
Transaction submission
eth_sendRawTransaction is the one method Prism never retries. A timeout does not tell you whether the transaction reached the mempool, and replaying it on a second provider risks a duplicate submission. Prism returns the failure to you unchanged.
The correct client-side response to a submission timeout is to poll for the transaction hash you already computed locally - never to resubmit blindly:
import { keccak256 } from 'viem';
const hash = keccak256(signedTx);
try {
await client.request({ method: 'eth_sendRawTransaction', params: [signedTx] });
} catch (error) {
// The submission may still have landed. Check before resubmitting.
const receipt = await client.request({
method: 'eth_getTransactionReceipt',
params: [hash],
});
if (!receipt) throw error;
}Logs & filters
| Method | Retryable | Cached | Notes |
|---|---|---|---|
eth_getLogs | Yes | Permanent for finalized ranges | Range limits below |
eth_newFilter | No | No | Filters are provider-local; see caveat |
eth_getFilterChanges | No | No | Pinned to the provider that created the filter |
eth_uninstallFilter | No | No |
Poll-based filters bind you to one upstream - the provider that holds the filter - which forfeits failover for those calls. Prefer WebSocket subscriptions, or a bounded eth_getLogs loop.
eth_getLogs is capped at 10,000 blocks per request and 50,000 returned logs. Split wider scans:
async function getLogsInChunks(client, { address, fromBlock, toBlock, chunk = 10_000n }) {
const logs = [];
for (let start = fromBlock; start <= toBlock; start += chunk) {
const end = start + chunk - 1n > toBlock ? toBlock : start + chunk - 1n;
logs.push(...(await client.getLogs({ address, fromBlock: start, toBlock: end })));
}
return logs;
}Chain & fees
| Method | Retryable | Cached | Notes |
|---|---|---|---|
eth_chainId | Yes | Permanent | Answered at the edge |
net_version | Yes | Permanent | Answered at the edge |
eth_gasPrice | Yes | 2s | |
eth_maxPriorityFeePerGas | Yes | 2s | |
eth_feeHistory | Yes | 2s | |
web3_clientVersion | Yes | Permanent | Reports prism/1.0 |
Not exposed
eth_sign, eth_signTransaction, eth_accounts, eth_sendTransaction and the personal_* family require a node to hold keys. Prism holds none, so these return -32601. Sign in your application or wallet and submit through eth_sendRawTransaction.
Administrative namespaces - admin_*, miner_*, txpool_*, debug_* - are not exposed. trace_* and debug_traceTransaction are planned for the archive tier; see the roadmap.
Batching
Standard JSON-RPC batches are supported. Prism may route the entries of one batch to different providers and reassembles them in request order:
curl https://mainnet.prismrpc.co/v1/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '[
{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]},
{"jsonrpc":"2.0","id":2,"method":"eth_chainId","params":[]}
]'Batch limits are covered in rate limits & batching.
