跳到主要内容

Sei JSON-RPC API Reference

Sei's EVM layer provides full compatibility with Ethereum JSON-RPC specification, allowing you to use familiar Ethereum tools and libraries while benefiting from Sei's parallelized execution and sub-second finality.

Base URL

https://api.blockeden.xyz/sei/<your-api-key>

Standard EVM Methods

Account Methods

eth_getBalance

Get the balance of an account at a given block.

Parameters:

  1. address (string) - 20-byte address to check for balance
  2. blockNumber (string) - Block number in hex, or "latest", "earliest", "pending"

Returns: Balance in wei as a hex string

curl -X POST https://api.blockeden.xyz/sei/<your-api-key> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": ["0x742D5Cc6bF2442E8C7c74c7b4Be6AB9d6f10f5B4", "latest"],
"id": 1
}'

Response:

{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1bc16d674ec80000"
}

eth_getTransactionCount

Get the number of transactions sent from an address (nonce).

Parameters:

  1. address (string) - 20-byte address
  2. blockNumber (string) - Block number in hex, or "latest", "earliest", "pending"

Returns: Transaction count as hex string

curl -X POST https://api.blockeden.xyz/sei/<your-api-key> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getTransactionCount",
"params": ["0x742D5Cc6bF2442E8C7c74c7b4Be6AB9d6f10f5B4", "latest"],
"id": 1
}'

eth_getCode

Get the code at a given address.

Parameters:

  1. address (string) - 20-byte address
  2. blockNumber (string) - Block number in hex, or "latest", "earliest", "pending"

Returns: Code as hex string

curl -X POST https://api.blockeden.xyz/sei/<your-api-key> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getCode",
"params": ["0xA0b86a33E6c0e4A2a2a5FB1C6A6D6a30BF8b6B3a", "latest"],
"id": 1
}'

Block Methods

eth_blockNumber

Get the current block number.

Parameters: None

Returns: Current block number as hex string

curl -X POST https://api.blockeden.xyz/sei/<your-api-key> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}'

Response:

{
"jsonrpc": "2.0",
"id": 1,
"result": "0x4b7"
}

eth_getBlockByNumber

Get block information by block number.

Parameters:

  1. blockNumber (string) - Block number in hex, or "latest", "earliest", "pending"
  2. fullTransactions (boolean) - If true, returns full transaction objects; if false, only hashes

Returns: Block object or null

curl -X POST https://api.blockeden.xyz/sei/<your-api-key> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBlockByNumber",
"params": ["latest", true],
"id": 1
}'

eth_getBlockByHash

Get block information by block hash.

Parameters:

  1. blockHash (string) - 32-byte block hash
  2. fullTransactions (boolean) - If true, returns full transaction objects; if false, only hashes

Returns: Block object or null

curl -X POST https://api.blockeden.xyz/sei/<your-api-key> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": ["0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", false],
"id": 1
}'

Transaction Methods

eth_getTransactionByHash

Get transaction information by transaction hash.

Parameters:

  1. transactionHash (string) - 32-byte transaction hash

Returns: Transaction object or null

curl -X POST https://api.blockeden.xyz/sei/<your-api-key> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getTransactionByHash",
"params": ["0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"],
"id": 1
}'

eth_getTransactionReceipt

Get transaction receipt by transaction hash.

Parameters:

  1. transactionHash (string) - 32-byte transaction hash

Returns: Transaction receipt object or null

curl -X POST https://api.blockeden.xyz/sei/<your-api-key> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getTransactionReceipt",
"params": ["0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"],
"id": 1
}'

Response Example:

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
"blockNumber": "0x5bad55",
"contractAddress": null,
"cumulativeGasUsed": "0xb90b0",
"from": "0x398137383b3d25c92898c656696e41950e47316b",
"gasUsed": "0x1383f",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"status": "0x1",
"to": "0x06012c8cf97bead5deae237070f9587f8e7a266d",
"transactionHash": "0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b",
"transactionIndex": "0x41"
}
}

eth_sendRawTransaction

Submit a signed transaction to the network.

Parameters:

  1. signedTransaction (string) - Signed transaction data as hex string

Returns: Transaction hash

curl -X POST https://api.blockeden.xyz/sei/<your-api-key> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_sendRawTransaction",
"params": ["0xf86c808504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a04f4c17305743700648bc4f6cd3038ec6f6af0df73e31757d8a17c7e9e1f3c7fd2a053a8ffdc8ab1f4b5a1e4d9b4a2c3a6b4a6e1e8c4b4d6c6d6e1b4a6e1e8c4b4"],
"id": 1
}'

Smart Contract Interaction

eth_call

Execute a smart contract function call without creating a transaction.

Parameters:

  1. callObject (object) - Call parameters
    • to (string) - Contract address
    • data (string) - Encoded function call data
    • from (string, optional) - Sender address
    • gas (string, optional) - Gas limit
    • gasPrice (string, optional) - Gas price
    • value (string, optional) - Value to send
  2. blockNumber (string) - Block number in hex, or "latest", "earliest", "pending"

Returns: Return value of the call

curl -X POST https://api.blockeden.xyz/sei/<your-api-key> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0xA0b86a33E6c0e4A2a2a5FB1C6A6D6a30BF8b6B3a",
"data": "0x70a08231000000000000000000000000742D5Cc6bF2442E8C7c74c7b4Be6AB9d6f10f5B4"
},
"latest"
],
"id": 1
}'

eth_estimateGas

Estimate gas needed for a transaction.

Parameters:

  1. transactionObject (object) - Transaction parameters
    • to (string, optional) - Recipient address
    • from (string, optional) - Sender address
    • data (string, optional) - Transaction data
    • value (string, optional) - Value to send
    • gas (string, optional) - Gas limit
    • gasPrice (string, optional) - Gas price

Returns: Estimated gas amount as hex string

curl -X POST https://api.blockeden.xyz/sei/<your-api-key> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_estimateGas",
"params": [
{
"to": "0x742D5Cc6bF2442E8C7c74c7b4Be6AB9d6f10f5B4",
"value": "0xde0b6b3a7640000"
}
],
"id": 1
}'

Gas and Fee Methods

eth_gasPrice

Get current gas price.

Parameters: None

Returns: Current gas price in wei as hex string

curl -X POST https://api.blockeden.xyz/sei/<your-api-key> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_gasPrice",
"params": [],
"id": 1
}'

eth_feeHistory

Get fee history for a range of blocks (EIP-1559).

Parameters:

  1. blockCount (string) - Number of blocks to return fee history for
  2. newestBlock (string) - Block number in hex, or "latest", "earliest", "pending"
  3. rewardPercentiles (array) - Array of percentiles to return (0-100)

Returns: Fee history object

curl -X POST https://api.blockeden.xyz/sei/<your-api-key> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_feeHistory",
"params": ["10", "latest", [25, 50, 75]],
"id": 1
}'

eth_maxPriorityFeePerGas

Get suggested max priority fee per gas for EIP-1559 transactions.

Parameters: None

Returns: Suggested max priority fee per gas as hex string

curl -X POST https://api.blockeden.xyz/sei/<your-api-key> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_maxPriorityFeePerGas",
"params": [],
"id": 1
}'

Event and Log Methods

eth_getLogs

Get logs matching a filter.

Parameters:

  1. filterObject (object) - Filter parameters
    • fromBlock (string, optional) - Starting block
    • toBlock (string, optional) - Ending block
    • address (string|array, optional) - Contract address(es)
    • topics (array, optional) - Array of topic filters
    • blockHash (string, optional) - Block hash (cannot be used with fromBlock/toBlock)

Returns: Array of log objects

curl -X POST https://api.blockeden.xyz/sei/<your-api-key> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getLogs",
"params": [
{
"fromBlock": "0x1",
"toBlock": "latest",
"address": "0xA0b86a33E6c0e4A2a2a5FB1C6A6D6a30BF8b6B3a",
"topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]
}
],
"id": 1
}'

Response Example:

{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"address": "0xa0b86a33e6c0e4a2a2a5fb1c6a6d6a30bf8b6b3a",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000742d5cc6bf2442e8c7c74c7b4be6ab9d6f10f5b4",
"0x000000000000000000000000a0b86a33e6c0e4a2a2a5fb1c6a6d6a30bf8b6b3a"
],
"data": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000",
"blockNumber": "0x4b7",
"transactionHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"transactionIndex": "0x0",
"blockHash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"logIndex": "0x0",
"removed": false
}
]
}

Network Information

eth_chainId

Get the chain ID of the current network.

Parameters: None

Returns: Chain ID as hex string

curl -X POST https://api.blockeden.xyz/sei/<your-api-key> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_chainId",
"params": [],
"id": 1
}'

Response:

{
"jsonrpc": "2.0",
"id": 1,
"result": "0x531"
}

net_version

Get the network ID.

Parameters: None

Returns: Network ID as string

curl -X POST https://api.blockeden.xyz/sei/<your-api-key> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "net_version",
"params": [],
"id": 1
}'

web3_clientVersion

Get the client version.

Parameters: None

Returns: Client version string

curl -X POST https://api.blockeden.xyz/sei/<your-api-key> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "web3_clientVersion",
"params": [],
"id": 1
}'

Sei-Specific Features

Parallelized Execution

Sei's EVM supports optimistic parallelization, meaning independent transactions can execute in parallel for better performance:

# These transactions may execute in parallel if they don't conflict
curl -X POST https://api.blockeden.xyz/sei/<your-api-key> \
-H "Content-Type: application/json" \
-d '[
{
"jsonrpc": "2.0",
"method": "eth_sendRawTransaction",
"params": ["0x...tx1..."],
"id": 1
},
{
"jsonrpc": "2.0",
"method": "eth_sendRawTransaction",
"params": ["0x...tx2..."],
"id": 2
}
]'

Sub-Second Finality

Transactions on Sei typically confirm in ~400ms:

// Transaction confirmation is much faster than Ethereum
const txResponse = await provider.sendTransaction(tx);
const receipt = await txResponse.wait(); // Usually completes in <1 second

Batch Requests

You can send multiple RPC calls in a single HTTP request:

curl -X POST https://api.blockeden.xyz/sei/<your-api-key> \
-H "Content-Type: application/json" \
-d '[
{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
},
{
"jsonrpc": "2.0",
"method": "eth_gasPrice",
"params": [],
"id": 2
},
{
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": ["0x742D5Cc6bF2442E8C7c74c7b4Be6AB9d6f10f5B4", "latest"],
"id": 3
}
]'

Error Handling

Standard JSON-RPC Error Codes

CodeMessageDescription
-32700Parse errorInvalid JSON
-32600Invalid RequestJSON-RPC request is invalid
-32601Method not foundMethod does not exist
-32602Invalid paramsInvalid method parameters
-32603Internal errorInternal JSON-RPC error

Sei-Specific Error Codes

CodeMessageDescription
-32000Transaction revertedSmart contract execution failed
-32001Insufficient fundsAccount balance too low
-32002Nonce too lowTransaction nonce already used
-32003Gas limit exceededTransaction ran out of gas

Example Error Response

{
"jsonrpc": "2.0",
"error": {
"code": -32602,
"message": "Invalid params",
"data": "Invalid address format"
},
"id": 1
}

Rate Limits

BlockEden.xyz implements fair usage policies:

  • Free Tier: 100 requests/second
  • Pro Tier: 1,000 requests/second
  • Enterprise: Custom limits

Rate limit headers in responses:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 99
X-RateLimit-Reset: 1640995200

Network Configuration

Mainnet (Pacific-1)

  • Chain ID: 1329
  • Currency Symbol: SEI
  • Currency Decimals: 18
  • RPC URL: https://api.blockeden.xyz/sei/<your-api-key>
  • Explorer: https://seitrace.com

WebSocket Subscriptions

Real-time event subscriptions are available via WebSocket:

const ws = new WebSocket('wss://api.blockeden.xyz/sei/<your-api-key>');

// Subscribe to new blocks
ws.send(JSON.stringify({
jsonrpc: '2.0',
method: 'eth_subscribe',
params: ['newHeads'],
id: 1
}));

// Subscribe to pending transactions
ws.send(JSON.stringify({
jsonrpc: '2.0',
method: 'eth_subscribe',
params: ['newPendingTransactions'],
id: 2
}));

// Subscribe to contract events
ws.send(JSON.stringify({
jsonrpc: '2.0',
method: 'eth_subscribe',
params: ['logs', {
address: '0xA0b86a33E6c0e4A2a2a5FB1C6A6D6a30BF8b6B3a',
topics: ['0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef']
}],
id: 3
}));

Performance Tips

1. Use Batch Requests

Combine multiple calls to reduce latency:

const batch = [
{ jsonrpc: '2.0', method: 'eth_blockNumber', params: [], id: 1 },
{ jsonrpc: '2.0', method: 'eth_gasPrice', params: [], id: 2 }
];

2. Leverage Sei's Speed

Take advantage of sub-second finality for better UX:

// No need for long confirmation waits
const receipt = await txResponse.wait(1); // Usually completes quickly

3. Use WebSockets for Real-time Data

Avoid polling by using WebSocket subscriptions for live updates.

Next Steps

Resources