prismRPCDocs

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

MethodRetryableCachedNotes
eth_getBalanceYes2s at latestCached indefinitely at a specific block
eth_getCodeYesPermanent at a blockContract code at a mined block never changes
eth_getStorageAtYes2s at latest
eth_getTransactionCountYesNoNonce reads always hit an upstream
eth_callYes2s at latestDeduplicated aggressively; the highest-volume method in most apps
eth_estimateGasYesNoEstimates track pending state

Blocks

MethodRetryableCachedNotes
eth_blockNumberYes1sAlso used as the health probe
eth_getBlockByNumberYesPermanent when finalizedlatest and pending are not cached
eth_getBlockByHashYesPermanentA hash identifies one immutable block
eth_getBlockReceiptsYesPermanent when finalized
eth_getBlockTransactionCountByNumberYesPermanent when finalized

Transactions

MethodRetryableCachedNotes
eth_sendRawTransactionNoNoSent to exactly one upstream. See below.
eth_getTransactionByHashYesPermanent once mined
eth_getTransactionReceiptYesPermanent once minedNot cached while pending
eth_getTransactionByBlockHashAndIndexYesPermanent

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:

ts
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

MethodRetryableCachedNotes
eth_getLogsYesPermanent for finalized rangesRange limits below
eth_newFilterNoNoFilters are provider-local; see caveat
eth_getFilterChangesNoNoPinned to the provider that created the filter
eth_uninstallFilterNoNo

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:

ts
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

MethodRetryableCachedNotes
eth_chainIdYesPermanentAnswered at the edge
net_versionYesPermanentAnswered at the edge
eth_gasPriceYes2s
eth_maxPriorityFeePerGasYes2s
eth_feeHistoryYes2s
web3_clientVersionYesPermanentReports 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:

bash
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.