Skip to Content
Supported ChainStarknet

Starknet API

Access Starknet blockchain data through the Spectrum API. Starknet is a permissionless ZK-rollup that runs the Cairo VM and settles to Ethereum.

PropertyValue
Slugstarknet
TypeCairo VM (ZK-rollup)
Native TokenSTRK
Address FormatFelt-252 hex (0x..., up to 64 hex chars)

Available methods

MethodDescription
getBlockHeightLatest Starknet block number
getBlockByNumberBlock by number
getBlockByHashBlock by hash
getBlockTransactionsTransactions in a block (via starknet_getBlockWithTxs)
getTransactionByHashTransaction lookup by hash
getReceiptTransaction receipt (accepts both EVM and Starknet chains)
getBalanceNative ETH balance (and ERC-20 balances via getTokenBalance)
getTokenBalanceCairo ERC-20 balance
rpcProxyRaw Starknet JSON-RPC passthrough
getChainHealthStarknet node health check

Quick start

curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
  -H "Content-Type: application/json" \
{
  "jsonrpc": "2.0",
  "method": "getBlockHeight",
  "params": {
    "chain": "starknet"
  },
  "id": 1
}
{ "jsonrpc": "2.0", "result": { "chain": "starknet", "height": 1234567 }, "id": 1 }

Get a Starknet native ETH balance

Starknet addresses are felt-252 hex values that share Ethereum’s 0x prefix but are up to 64 hex characters wide.

curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
  -H "Content-Type: application/json" \
{
  "jsonrpc": "2.0",
  "method": "getBalance",
  "params": {
    "chain": "starknet",
    "address": "0x04681402a7ab16c41f7e5d091f0b0fb5b8df3f1f1c1cba1f8b8a2f5d3c6f8a72"
  },
  "id": 1
}

SDK

import { Spectrum } from "@spectrumnodes/sdk"; const spectrum = new Spectrum({ api: "https://your-endpoint.simplystaking.xyz/YOUR_API_KEY/", }); const block = await spectrum.core.getBlockHeight("starknet"); const balance = await spectrum.tokens.getBalance( "starknet", "0x04681402a7ab16c41f7e5d091f0b0fb5b8df3f1f1c1cba1f8b8a2f5d3c6f8a72", ); // Raw starknet_call passthrough const result = await spectrum.rpc.call("starknet", "starknet_call", [ { contract_address: "0x...", entry_point_selector: "0x...", calldata: [], }, "latest", ]);

JSON-RPC passthrough

The rpcProxy endpoint exposes the full Starknet JSON-RPC surface (starknet_getBlockWithTxs, starknet_call, starknet_estimateFee, starknet_traceTransaction, starknet_getEvents, etc.). For safety, transaction-submission methods are blocked at the gateway:

  • starknet_addDeclareTransaction
  • starknet_addDeployAccountTransaction
  • starknet_addInvokeTransaction

If you need to submit transactions, sign and broadcast through your own infrastructure.

Endpoint differences from EVM chains

  • Block height comes from starknet_blockNumber rather than eth_blockNumber.
  • Addresses are felt-252 values. They share the 0x prefix with EVM but can be up to 64 hex characters and do not follow EIP-55 checksumming.
  • Receipts are normalized via the shared getTransactionReceipt dispatcher. The response shape mirrors Starknet’s starknet_getTransactionReceipt, not EVM logs.
  • Native balance is read from the STRK ERC-20 contract on Starknet; getTokenBalance reads any Cairo ERC-20.
  • Logs/transfers indexer, ENS, NFTs, ERC-20 metadata, getCode, gas estimation, and simulateCall are not supported. Use the JSON-RPC passthrough with starknet_call for contract reads.