RPC API

This documentation provides detailed information about the JSON-RPC methods supported by pod.

Overview

Pod implements a JSON-RPC API that allows interaction with the network. While many methods align with the Ethereum JSON-RPC specification (methods prefixed with eth_), pod includes additional metadata (pod_metadata attribute) and pod-specific functionality (methods prefixed with pod_).


Base URL

The API endpoint is accessible at https://rpc.v1.dev.pod.network.

https://rpc.v1.dev.pod.network

Common Response Fields

All successful responses include:

FieldDescription
jsonrpcAlways “2.0”
idThe request ID
resultThe method-specific response data
pod_metadataAdditional POD-specific information (location varies by method)

Parameters must match the JSON-RPC 2.0 specification.

{ "jsonrpc": "2.0", "method": "method_name", "params": [], "id": 1 }

Error Handling

Error responses follow the JSON-RPC 2.0 specification.

Error Codes

Code
32700Parse error
32600Invalid Request
32601Method not found
32602Invalid params
32603Internal error
32000Server error (various)

Error responses follow the JSON-RPC 2.0 specification:

{ "jsonrpc": "2.0", "error": { "code": -32000, "message": "Error message" }, "id": 1 }

Get Block Number

Returns the latest past perfection pod timestamp in microseconds.

Parameters

None

Response

KeyTypeDescription
statusCodeintegerHTTP status code
response.jsonrpcstringsame value as request
response.idintegerunique value as request
response.resultstringlatest block number
use reqwest::Client; use serde_json::{json, Value}; async fn main() -> Result<(), Box> { let block_number = pod_provider.get_block_number().await?; println!("{}", block_number); Ok(()) }
curl -L \ --request POST \ --url 'https://rpc.v1.dev.pod.network/' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }'
await fetch('https://rpc.v1.dev.pod.network/', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'eth_blockNumber', params: [], id: 1 }) });

Example Response:

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

Get Chain Id

Returns the chain ID of the current network.

Parameters

None

Response

KeyTypeDescription
statusCodeintegerHTTP status code
response.jsonrpcstringsame value as request
response.idintegerunique value as request
response.resultstringChain ID in hexadecimal format, always 0x50d
use reqwest::Client; use serde_json::{json, Value}; async fn main() -> Result<(), Box> { let chain_id = pod_provider.get_chain_id().await?; println!("{}", chain_id); Ok(()) }
curl -L \ --request POST \ --url 'https://rpc.v1.dev.pod.network/' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1 }'
await fetch('https://rpc.v1.dev.pod.network/', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'eth_chainId', params: [], id: 1 }) });

Example Response:

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

Get Gas Estimation

Estimates gas needed for a transaction.

Parameters

ParameterTypeDescription
objectobjectTransaction call object with the following fields:
fromstring(optional) 20-byte address of sender
tostring20-byte address of recipient
gasstring(optional) Gas provided for transaction execution
gasPricestring(optional) Gas price in wei
valuestring(optional) Value in wei
datastring(optional) Contract code or encoded function call data

Note: Only Legacy transactions are supported

Response

KeyTypeDescription
statusCodeintegerHTTP status code
response.jsonrpcstringsame value as request
response.idintegerunique value as request
response.resultstringestimated gas in hexadecimal format
use reqwest::Client; use serde_json::{json, Value}; async fn main() -> Result<(), Box> { let recipient_address = Address::from_word(b256!("0x000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045")); let transfer_amount = U256::from(1_000_000); // 1 million wei let tx = PodTransactionRequest::default() .with_to(recipient_address) .with_value(transfer_amount); let gas_estimation = pod_provider.estimate_gas(&tx).await?; println!("{}", gas_estimation); Ok(()) }
curl -X POST https://rpc.v1.dev.pod.network \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{ "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "to": "0xbe0eb53f46cd790cd13851d5eff43d12404d33e8" }], "id": 1 }'
await fetch('https://rpc.v1.dev.pod.network/', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'eth_estimateGas', params: [ { from: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045', to: '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8' } ], id: 1 }) });

Example Response:

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

Get Gas Price

Returns the current gas price.

Parameters

None

Response

KeyTypeDescription
statusCodeintegerHTTP status code
response.jsonrpcstringsame value as request
response.idintegerunique value as request
response.resultstringCurrent gas price in wei (hexadecimal format)
use reqwest::Client; use serde_json::{json, Value}; async fn main() -> Result<(), Box> { let gas_price = pod_provider.get_gas_price().await?; println!("{}", gas_price); Ok(()) }
curl -X POST https://rpc.v1.dev.pod.network \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }'
await fetch('https://rpc.v1.dev.pod.network/', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'eth_gasPrice', params: [], id: 1 }) });

Example Response:

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

Get Balance

Returns the balance of a given address.

Parameters

ParameterTypeDescription
string 1string20-byte address to check balance for
string 2stringPast perfect timestamp to query, specified in seconds(hexadecimal format). Can also be the tags: earliest, finalized or latest.

Note: Currently returns the current balance regardless of timestamp

Response

KeyTypeDescription
statusCodeintegerHTTP status code
response.jsonrpcstringsame value as request
response.idintegerunique value as request
response.resultstringbalance in hexadecimal format
use reqwest::Client; use serde_json::{json, Value}; async fn main() -> Result<(), Box> { let address = Address::from_word(b256!("0x000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045")); let balance = pod_provider.get_balance(address).await?; println!("{}", balance); Ok(()) }
curl -X POST https://rpc.v1.dev.pod.network \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": [ "0x13791790Bef192d14712D627f13A55c4ABEe52a4", "0x1" ], "id": 1 }'
await fetch('https://rpc.v1.dev.pod.network/', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'eth_getBalance', params: [ '0x13791790Bef192d14712D627f13A55c4ABEe52a4', '0x1' ], id: 1 }) });
use reqwest::Client; use serde_json::{json, Value}; async fn main() -> Result<(), Box> { let client = Client::new(); let response = client .post("https://rpc.v1.dev.pod.network/") .header("Content-Type", "application/json") .json(&json!({ "jsonrpc": "2.0", "method": "eth_getBalance", "params": [ "0x13791790Bef192d14712D627f13A55c4ABEe52a4", "0x1" ], "id": 1 })) .send() .await?; let result: Value = response.json().await?; println!("{}", result); Ok(()) }

Example Response:

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

Get Block by Hash

Returns information about a block by its hash. Returns an empty block structure for compatibility.

Parameters

ParameterTypeDescription
element 1stringBlock hash
element 2booleanIf true, returns full transaction objects; if false, returns transaction hashes

Response

KeyTypeDescription
statusCodeintegerHTTP status code
response.jsonrpcstringsame value as request
response.idintegerunique value as request
response.resultobjectblock information
KeyTypeDescription
resultobjectblock information
result.numberstring0
result.mixHashstring0x0 followed by 64 zeros
result.hashstringRequested block hash
result.parentHashstring0x0 followed by 64 zeros
result.noncestring0x0000000000000000
result.sha3Unclesstring0x0 followed by 64 zeros
result.logsBloomstring0x0 followed by 256 zeros
result.transactionsRootstring0x0 followed by 64 zeros
result.stateRootstring0x0 followed by 64 zeros
result.receiptsRootstring0x0 followed by 64 zeros
result.minerstring0x0 followed by 40 zeros
result.difficultystring0x0000000000000000
result.extraDatastring0x0 followed by 40 zeros
result.sizestring0x0
result.gasLimitstring0x0
result.gasUsedstring0x0
result.timestampstring0x0
result.transactionsarrayEmpty array
result.unclesarrayEmpty array
use reqwest::Client; use serde_json::{json, Value}; async fn main() -> Result<(), Box> { let block = pod_provider .get_block_by_hash( b256!("0x000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045"), BlockTransactionsKind::Full, ) .await?; println!("{}", block); Ok(()) }
curl -X POST https://rpc.v1.dev.pod.network \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": [ "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", false ], "id": 1 }'
await fetch('https://rpc.v1.dev.pod.network/', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'eth_getBlockByHash', params: ['0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', false], id: 1 }) });

Example Response:

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

Get Block by Number

Returns information about a block by its number. Returns an empty block structure for compatibility.

Parameters

ParameterTypeDescription
element 1stringBlock number in hexadecimal format
element 2booleanIf true, returns full transaction objects; if false, returns transaction hashes

Response

KeyTypeDescription
statusCodeintegerHTTP status code
response.jsonrpcstringsame value as request
response.idintegerunique value as request
response.resultobjectblock information
KeyTypeDescription
resultobjectblock information
result.numberstringRequested block number
result.mixHashstring0x0 followed by 64 zeros
result.hashstring0x0 followed by 64 zeros
result.parentHashstring0x0 followed by 64 zeros
result.noncestring0x0000000000000000
result.sha3Unclesstring0x0 followed by 64 zeros
result.logsBloomstring0x0 followed by 256 zeros
result.transactionsRootstring0x0 followed by 64 zeros
result.stateRootstring0x0 followed by 64 zeros
result.receiptsRootstring0x0 followed by 64 zeros
result.minerstring0x0 followed by 40 zeros
result.difficultystring0x0000000000000000
result.extraDatastring0x0 followed by 40 zeros
result.sizestring0x0
result.gasLimitstring0x0
result.gasUsedstring0x0
result.timestampstring0x0
result.transactionsarrayEmpty array
result.unclesarrayEmpty array
use reqwest::Client; use serde_json::{json, Value}; async fn main() -> Result<(), Box> { let block = pod_provider .get_block_by_number( BlockNumberOrTag::Number(1), BlockTransactionsKind::Full, ) .await?; println!("{}", block); Ok(()) }
curl -X POST https://rpc.v1.dev.pod.network \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": [ "0x1", false ], "id": 1 }'
await fetch('https://rpc.v1.dev.pod.network/', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'eth_getBlockByNumber', params: ['0x1', false], id: 1 }) });

Example Response:

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

Get Logs

Returns an array of event logs matching the given filter criteria.

Parameters

ParameterTypeDescription
fromBlockstring(optional) From block timestamp specified in seconds in hexadecimal format. Can also be the tags: earliest, finalized or latest.
toBlockstring(optional) To block timestamp specified in seconds in hexadecimal format. Can also be the tags: earliest, finalized or latest.
addressstring(optional) Contract address
topicsarray(optional) Array of topic filters (up to 4 topics):
- Each topic can be either a string or null
- Topics are ordered and must match in sequence
- Null values match any topic
minimum_attestationsnumber(optional) Minimum number of attestations required for the log to be returned

Response

KeyTypeDescription
statusCodeintegerHTTP status code
response.jsonrpcstringsame value as request
response.idintegerunique value as request
response.resultarrayArray of log objects
KeyTypeDescription
objectblock information
addressstringAddress from which this log originated
blockNumberstringBlock number in hexadecimal format, supported for completeness, the block number returned is 1
blockHashstringBlock hash. Supported for completeness, the block hash returned is the 0 hash
transactionHashstringTransaction hash
transactionIndexstringTransaction index
logIndexstringLog index
topicsarrayArray of indexed log parameters
datastringContains non-indexed log parameters
pod_metadataobjectAdditional pod-specific information including attestations
use reqwest::Client; use serde_json::{json, Value}; async fn main() -> Result<(), Box> { let topic = U256::from_str( &"0x71a5674c44b823bc0df08201dfeb2e8bdf698cd684fd2bbaa79adcf2c99fc186".to_string(), )?; let filter = Filter::new() .address(Address::from_str( "0x1234567890123456789012345678901234567890", )?) .topic2(topic); let verifiable_logs = pod_provider.get_verifiable_logs(&filter).await?; println!("{:?}", verifiable_logs); for v_log in &verifiable_logs { let is_valid = v_log.verify(&committee)?; println!("{:?}", is_valid); } Ok(()) }
curl -X POST https://rpc.v1.dev.pod.network \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{ "address": "0x1234567890123456789012345678901234567890", "topics": [ "0x71a5674c44b823bc0df08201dfeb2e8bdf698cd684fd2bbaa79adcf2c99fc186" ], "fromBlock": "0x1", "toBlock": "latest" }], "id": 1 }'
await fetch('https://rpc.v1.dev.pod.network/', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'eth_getLogs', params: [ { address: '0x1234567890123456789012345678901234567890', topics: ['0x71a5674c44b823bc0df08201dfeb2e8bdf698cd684fd2bbaa79adcf2c99fc186'], fromBlock: '0x1', toBlock: 'latest' } ], id: 1 }) });

Example Response:

{ "jsonrpc": "2.0", "result": [], "id": 1 }

Get Transaction by Hash

Returns information about a transaction by its hash.

Parameters

ParameterTypeDescription
string 1string32-byte transaction hash

Response

KeyTypeDescription
statusCodeintegerHTTP status code
response.jsonrpcstringsame value as request
response.idintegerunique value as request
response.resultobjectTransaction object, or null if no transaction was found
KeyTypeDescription
objectblock information
hashstring32-byte transaction hash
noncestringNumber of transactions sent by the sender prior to this one
blockHashstring32-byte block hash, or null if pending
blockNumberstringBlock number, or null if pending
transactionIndexstringInteger index position in the block, or null if pending
fromstring20-byte address of the sender
tostring20-byte address of the recipient, or null for contract creation
valuestringValue transferred in wei
gasPricestringGas price in wei
gasstringGas provided for transaction execution
inputstringContract code or encoded function call data
vstringECDSA recovery ID
rstringECDSA signature r
sstringECDSA signature s
pod_metadataobjectAdditional pod-specific information
use reqwest::Client; use serde_json::{json, Value}; async fn main() -> Result<(), Box> { let tx = pod_provider .get_transaction_by_hash( b256!("0xf74e07ff80dc54c7e894396954326fe13f07d176746a6a29d0ea34922b856402"), ) .await?; println!("{:?}", tx); Ok(()) }
curl -X POST https://rpc.v1.dev.pod.network \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": [ "0xf74e07ff80dc54c7e894396954326fe13f07d176746a6a29d0ea34922b856402" ], "id": 1 }'
await fetch('https://rpc.v1.dev.pod.network/', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'eth_getTransactionByHash', params: [ '0xf74e07ff80dc54c7e894396954326fe13f07d176746a6a29d0ea34922b856402' ], id: 1 }) });

Example Response:

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

Get Transaction Count

Returns the number of transactions sent from an address.

Parameters

ParameterTypeDescription
[1]string20-byte address
[2]stringPast perfect timestamp in seconds (hexadecimal format). Can also be the tags: earliest, finalized or latest.

Note: Currently returns the current transaction count regardless of timestamp

Response

KeyTypeDescription
statusCodeintegerHTTP status code
response.jsonrpcstringsame value as request
response.idintegerunique value as request
response.resultstringNumber of transactions sent by the sender prior to this one
use reqwest::Client; use serde_json::{json, Value}; async fn main() -> Result<(), Box> { let address = Address::from_word(b256!("0x000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045")); let txs = pod_provider .get_transaction_count( address, ) .await?; println!("{}", txs); Ok(()) }
curl -X POST https://rpc.v1.dev.pod.network \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": [ "0x13791790Bef192d14712D627f13A55c4ABEe52a4", "latest" ], "id": 1 }'
await fetch('https://rpc.v1.dev.pod.network/', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'eth_getTransactionCount', params: ['0x13791790Bef192d14712D627f13A55c4ABEe52a4', 'latest'], id: 1 }) });

Example Response:

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

Get Transaction Receipt

Returns the receipt of a transaction by transaction hash.

Parameters

ParameterTypeDescription
string 1string32-byte transaction hash

Response

KeyTypeDescription
statusCodeintegerHTTP status code
response.jsonrpcstringsame value as request
response.idintegerunique value as request
response.resultobjectA transaction receipt object with pod-specific metadata, or null if no receipt was found.
KeyTypeDescription
objectStandard Ethereum receipt fields
pod_metadataobjectContains pod-specific data including attestations
use reqwest::Client; use serde_json::{json, Value}; async fn main() -> Result<(), Box> { let tx_receipt = pod_provider .get_transaction_receipt( b256!("0xf74e07ff80dc54c7e894396954326fe13f07d176746a6a29d0ea34922b856402"), ) .await?; println!("{:?}", tx_receipt); let committee = pod_provider.get_committee().await?; let verification = tx_receipt.verify(&committee)?; println!("{:?}", verification); Ok(()) }
curl -X POST https://rpc.v1.dev.pod.network \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": [ "0xf74e07ff80dc54c7e894396954326fe13f07d176746a6a29d0ea34922b856402" ], "id": 1 }'
await fetch('https://rpc.v1.dev.pod.network/', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'eth_getTransactionReceipt', params: [ '0xf74e07ff80dc54c7e894396954326fe13f07d176746a6a29d0ea34922b856402' ], id: 1 }) });

Example Response:

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

Get Network Id

Returns the current network ID.

Parameters

None

Response

KeyTypeDescription
statusCodeintegerHTTP status code
response.jsonrpcstringsame value as request
response.idintegerunique value as request
response.resultstringThe network ID in decimal format
use reqwest::Client; use serde_json::{json, Value}; async fn main() -> Result<(), Box> { let network_id = pod_provider.network_id().await?; println!("{:?}", network_id); Ok(()) }
# Using eth_networkId curl -X POST https://rpc.v1.dev.pod.network \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "eth_networkId", "params": [], "id": 1 }'
await fetch('https://rpc.v1.dev.pod.network/', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'eth_networkId', params: [], id: 1 }) });
use reqwest::Client; use serde_json::{json, Value}; async fn main() -> Result<(), Box> { let rpc_url = "ws://rpc.v1.dev.pod.network:8545"; let ws_url = Url::parse(&rpc_url)?; let ws = WsConnect::new(ws_url); let pod_provider = PodProviderBuilder::new() .with_recommended_fillers() .on_ws(ws) .await?; let net_version = pod_provider.get_net_version().await?; println!("{:?}", net_version); Ok(()) }
# Using net_version alias curl -X POST https://rpc.v1.dev.pod.network \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }'
await fetch('https://rpc.v1.dev.pod.network/', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'net_version', params: [], id: 1 }) });

Example Response:

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

Send Raw Transaction

Submits a pre-signed transaction for broadcast to the POD network.

Parameters

ParameterTypeDescription
[1]stringSigned transaction data in hex format
[2]u64(optional) Timeout in milliseconds. Default is 0 milliseconds. The timeout allows the client to wait for the confirmation of the transaction instead of returning the hash immediately.

Response

KeyTypeDescription
statusCodeintegerHTTP status code
response.jsonrpcstringsame value as request
response.idintegerunique value as request
response.resultstring32-byte transaction hash (or zero hash if transaction is not yet available)
use reqwest::Client; use serde_json::{json, Value}; async fn main() -> Result<(), Box> { let tx_data_hex = "0xf8658001830493e0945fbdb2315678afecb367f032d93f642f64180aa3830f424080820a3da00f49d94d0d83d905d6372b3548d7e922d58c69e611a296d2ca3c9f762b9b5051a073e5602f6889390a284f421cc5184d05ec82923e64e86ff37e437f0600930d26"; let tx = pod_provider .send_raw_transaction(tx_data_hex.as_ref()) .await?; println!("{:?}", tx); Ok(()) }
curl -X POST https://rpc.v1.dev.pod.network \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": [ "0xf8658001830493e0945fbdb2315678afecb367f032d93f642f64180aa3830f424080820a3da00f49d94d0d83d905d6372b3548d7e922d58c69e611a296d2ca3c9f762b9b5051a073e5602f6889390a284f421cc5184d05ec82923e64e86ff37e437f0600930d26" ], "id": 1 }'
await fetch('https://rpc.v1.dev.pod.network/', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'eth_sendRawTransaction', params: [ '0xf8658001830493e0945fbdb2315678afecb367f032d93f642f64180aa3830f424080820a3da00f49d94d0d83d905d6372b3548d7e922d58c69e611a296d2ca3c9f762b9b5051a073e5602f6889390a284f421cc5184d05ec82923e64e86ff37e437f0600930d26' ], id: 1 }) });

Example Response:

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

Subscribe

Creates a subscription for specific events. This endpoint streams the new events, for historical data use the other endpoints (pod_listReceipts, pod_pastPerfectTime, eth_getLogs). Each subscription type has different parameter requirements.

Parameters

ParameterTypeDescription
[0]stringSubscription type (required): logs, pod_receipts, pod_pastPerfectTime
[1]objectParameters object (varies by subscription type)

Subscription Types and Parameters:

{ "address": "0x1234567890123456789012345678901234567890", "topics": ["0x71a5674c44b823bc0df08201dfeb2e8bdf698cd684fd2bbaa79adcf2c99fc186"], "fromBlock": "0x1", "toBlock": "latest", "minAttestations": 3 }
{ // optional account to filter receipts by (matches either sender or recipient) "address": "0x13791790Bef192d14712D627f13A55c4ABEe52a4", // Timestamp in microseconds "since": 1687245924000000 }
1687245924000000 // Timestamp in microseconds

Response

TypeDescription
stringSubscription ID
wscat -c ws://rpc.v1.dev.pod.network \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "eth_subscribe", "params": ["", ], "id": 1 }'
const socket = new WebSocket('ws://rpc.v1.dev.pod.network'); socket.onopen = () => { socket.send( JSON.stringify({ jsonrpc: '2.0', method: 'eth_subscribe', params: [ 'logs', { address: '0x1234567890123456789012345678901234567890', topics: ['0x71a5674c44b823bc0df08201dfeb2e8bdf698cd684fd2bbaa79adcf2c99fc186'], fromBlock: '0x1', toBlock: 'latest' } ], id: 1 }) ); }; socket.onmessage = (event) => { const response = JSON.parse(event.data); console.log('Received:', response); }; socket.onerror = (error) => { console.error('WebSocket Error:', error); }; socket.onclose = () => { console.log('WebSocket connection closed'); };
use tokio::net::TcpStream; use tokio_tungstenite::{connect_async, tungstenite::protocol::Message, WebSocketStream, MaybeTlsStream}; use futures_util::{StreamExt, SinkExt}; use serde_json::json; async fn main() -> Result<(), Box> { let (ws_stream, _) = connect_async("ws://rpc.v1.dev.pod.network").await?; let (mut write, mut read) = ws_stream.split(); // Subscribe to logs let subscribe_msg = json!({ "jsonrpc": "2.0", "method": "eth_subscribe", "params": ["logs", { "address": "0x1234567890123456789012345678901234567890", "topics": ["0x71a5674c44b823bc0df08201dfeb2e8bdf698cd684fd2bbaa79adcf2c99fc186"] }], "id": 1 }); write.send(Message::Text(subscribe_msg.to_string())).await?; // Process incoming messages while let Some(msg) = read.next().await { let msg = msg?; if let Message::Text(text) = msg { println!("Received: {}", text); } } Ok(()) }
{ "jsonrpc": "2.0", "id": 1, "result": "0xcd0c3e8af590364c09d0fa6a1210faf5" }

Subscription Messages

Each subscription type returns different data in its subscription messages.

{ "jsonrpc": "2.0", "method": "eth_subscription", "params": { "subscription": "0xcd0c3e8af590364c09d0fa6a1210faf5", "result": { "address": "0x1234567890123456789012345678901234567890", "topics": ["0x71a5674c44b823bc0df08201dfeb2e8bdf698cd684fd2bbaa79adcf2c99fc186"], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", "pod_metadata": { "proof": { "generalized_index": "5", "path": [ "0x17e9064016f07fc958206a993067e187e4f5d314191a42b92fb30a749c03836d", "0xa9cdde087f3cc534a93b1f728c5108c3f89b4505e07805691e40b0f6d4ffda22" ] }, "receipt_root": "0xd0180358d6fa534054f22b12235af25558bbdd2d84e26396cae1fbacdc9122bf", "signatures": [ { "r": "0xa319f330b99ffd9ae9bf1d26dffc4643e2853d073e1100ef6aeced9b5cf0a5b4", "s": "0xef0980560aaa17c6c107096c494c304e30adf7f4985141ebe17e9c4e7c967bb", "v": "0x0", "yParity": "0x0" } ] } } } }
{ "jsonrpc": "2.0", "method": "eth_subscription", "params": { "subscription": "0xcd0c3e8af590364c09d0fa6a1210faf5", "result": { "certified": { "actual_gas_used": 21000, "logs": [], "status": true, "tx": { "signature": { "r": "0x23feb2e5d0d64ee34aa10b4140a321452ba3306a51ce562b1fcf218d041ca8ab", "s": "0x7d62195ff365ec9887729675e2dbccb7c4127fe2e90717de3f61eb9f4b541d5d", "v": "0x1", "yParity": "0x1" }, "signed": { "call_data": "", "gas_limit": 300000, "gas_price": 1, "nonce": 0, "to": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "value": "0xde0b6b3a7640000" }, "signer": "0xb8aa43999c2b3cbb10fbe2092432f98d8f35dcd7" } }, "signatures": [ { "r": "0x52ca8bbfe8cda5060e8ebc001dbdbbf4fa2017ffc4debcfbf19df537cdb2595d", "s": "0x1e8ceee2a6cc129194acccb0013be717836e2ca86d33146dbac67ebfc5495019", "v": "0x1", "yParity": "0x1" } ], "tx_hash": "0x4e5a4d444cf0614340425e18fd644d225c06514f933fa3814f4d407778c7859b" } } }
{ "jsonrpc": "2.0", "method": "eth_subscription", "params": { "subscription": "0xcd0c3e8af590364c09d0fa6a1210faf5", "result": "0x67505ef7" } }

Error Handling

Error CodeMessageDescription
-32602Invalid subscription typeThe requested subscription type is not supported
-32602Invalid parameters for subscriptionThe parameters provided for the subscription are invalid
-32602Missing required parametersRequired parameters for the subscription are missing
{ "jsonrpc": "2.0", "error": { "code": -32602, "message": "invalid parameters, expected [\"pod_receipts\", {\"address\":
, \"since\": }]" }, "id": 1 }

Get Committee

Lists the validator public keys that are part of the committee.

Parameters

None

Response

KeyTypeDescription
statusCodeintegerHTTP status code
response.jsonrpcstringsame value as request
response.idintegerunique value as request
response.resultobjectResponse object
KeyTypeDescription
object
quorum_sizeintegerNumber of required attestations
replicasarrayArray of validator public keys
use reqwest::Client; use serde_json::{json, Value}; async fn main() -> Result<(), Box> { let committee = pod_provider.get_committee().await?; println!("{}", committee); Ok(()) }
curl -X POST https://rpc.v1.dev.pod.network \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "pod_getCommittee", "params": {}, "id": 1 }'
await fetch('https://rpc.v1.dev.pod.network/', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'pod_getCommittee', params: {}, id: 1 }) });
{ "jsonrpc": "2.0", "result": { "quorum_size": 3, "replicas": [ "01f63ebcf3e22985abef399b43966f409bba8c02a61141de1a96398b5ed0a4f5002eb5e9083d0f8bc5bfcf75f43fbe34dfc037492025d18e42942f9ed6c4b00205e30c48e09b4c030cfa588ea4ec104bd9977173d8ef7c16021fb5edf727c38a2e2f2605c8a87f80b7900b64be0cbad48239d0cf4c09375753d4fb0b7036abcc", "2f8848f3696c99d7bdc1c1fcda5792577afb5bcd93cfd4c7b6a20f99c4c2bf950d55a3057171c1d87add3d690d62206b398121e5e1335bd598f7728225b8c9d0001dd768a50542e7bbdaadd69f4739054a6b1a600a5545dc0603766ec50ad85b28f99ce9c100112a0020d106b8723567b23b6e0ac1ec7559b686e1c18607ff83", "0b6dfa0424d710ac6158c0055be1cf0a4c21df3c3a9ca3d5e8d3e580674bc35400caf4585df58ad603e527bcfc026669c9dcaf03ec8c80f278886d34a6cae2b405f64057067f53ae226c48a555a1d10aeec46ac92b5c98f36974206f0ff84f2413ec4b4de5bc56e5ddd5c1f5d768f1ecf748cb44bea6de4c55306e2bfd8c2fee", "2abae2b0ca5c77d515c841cada5e825f169ff15dd392ac9aaebaf37ea23e04bd0158439d7925b770e46fd9b4e8158e6acb5784a91f261e35ea6605b8c4c9473923c961214b8a7b44e4dc58932d2b475943746439a100aea7eadda30022e78d312bdf55f96f6adbd12844c2df41b8e680994af83725a168c1d038575a032ec9e1" ] }, "id": 2 }

List Confirmed Receipts

Retrieves confirmed transaction receipts after a specified timestamp. Allows filtering receipts by originating or destination address.

Parameters

KeyTypeDescription
object
sincestringTimestamp specified in microseconds representing the start of the range to query
addressstring(optional) Address to filter receipts by (matches from or to fields)
paginationobject(optional) Pagination object
pagination.cursorstring(optional) Cursor to start the query from
pagination.limitinteger(optional) Maximum number of receipts to return
pagination.newest_firstboolean(optional) Whether to start the query from the most recent receipts

Note: If cursor is provided, newest_first must NOT be provided.

Response

KeyTypeDescription
statusCodeintegerHTTP status code
response.jsonrpcstringsame value as request
response.idintegerunique value as request
response.resultobjectResponse object
KeyTypeDescription
objectPagination Response Object
itemsarrayList of transaction receipts with metadata
next_cursorstringCursor to start the next query from. null if there are no more items to fetch
curl -X POST https://rpc.v1.dev.pod.network \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "pod_listReceipts", "params": { "since": 0 }, "id": 1 }'
await fetch('https://rpc.v1.dev.pod.network/', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'pod_listReceipts', params: { since: 0 }, id: 1 }) });
use reqwest::Client; use serde_json::{json, Value}; async fn main() -> Result<(), Box> { let client = Client::new(); let response = client .post("https://rpc.v1.dev.pod.network/") .header("Content-Type", "application/json") .json(&json!({ "jsonrpc": "2.0", "method": "pod_listReceipts", "params": { "since": 0 }, "id": 1 })) .send() .await?; let result: Value = response.json().await?; println!("{}", result); Ok(()) }
{ "jsonrpc": "2.0", "id": 1, "result": { "items": [ { "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0x1", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x3b9aca00", "from": "0xb8aa43999c2b3cbb10fbe2092432f98d8f35dcd7", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "pod_metadata": { "attestations": [ { "public_key": "0x7d5761b7b49fc7bfdd499e3ae908a4acfe0807e6", "signature": { "r": "0x30262c9f183a9f7219d260affbf6c8f92bff24a094d63ff9ed3c7366076f7bd7", "s": "0x6a6ff240bbab35626d6f4ea2a27a2d9d739f9305a5f1bcabe0eaf1e14364390a", "v": "0x0", "yParity": "0x0" }, "timestamp": 1740419698722233 }, { "public_key": "0xd64c0a2a1bae8390f4b79076ceae7b377b5761a3", "signature": { "r": "0x45a87fdf1455b5f93660c5e265767325afbd1e0cfa327970a63e188290625f9d", "s": "0x65343279465e0f1e43729b669589c2c80d12e95a72a5a52c63b70b3abf1ebef5", "v": "0x1", "yParity": "0x1" }, "timestamp": 1740419698722014 }, { "public_key": "0x06ad294f74dc98be290e03797e745cf0d9c03da2", "signature": { "r": "0xf9d7f79e339b68f75eb6d172dc68539a1d0750c555979f998cb8a9211fdc1511", "s": "0x7239b2efc00415dd5866bf564366272af8fb4738c7697fec50628b9969521493", "v": "0x1", "yParity": "0x1" }, "timestamp": 1740419698721922 }, { "public_key": "0x8646d958225301a00a6cb7b6609fa23bab87da7c", "signature": { "r": "0x8c8256bea8c0e919618abd973646d344e8ffe3c50c0757ce902d28659f1524b4", "s": "0x3b76b3818666a418572cc465d30638533d4bd987bfb5dd0550a311521f167719", "v": "0x1", "yParity": "0x1" }, "timestamp": 1740419698722052 } ] }, "status": "0x1", "to": "0x13791790bef192d14712d627f13a55c4abee52a4", "transactionHash": "0xfa71ee80b1bc58e00f4fe11ae1de362201de43ff65e849dcb5d8b92e0be71e87", "transactionIndex": "0x0", "type": "0x0" } ], "next_cursor": "Y3I6MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAxNzQwNDE5Njk3MjQ3NTczXzB4NzRjOWM0MTFkZDJjMDg0ZWE4NmZjOThjMDUwYWU0OTI4YTgzZjVlN2I3N2UyN2NkYTA5NWFiYmY0YTk1ZjJmY3xjcjowMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBfMHgwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw" } }

Best practices

For optimal client usage:

  1. Always check for and handle the None case when querying transactions or receipts. the specific error types provided by the SDK for precise error handling.
  2. Implement appropriate retry logic and timeouts for handling transient failures.
  3. Maintain a single client instance when possible to improve resource utilization.
  4. Check attestations when required by your application’s security requirements.

Security Considerations

When developing applications using the pod Rust SDK:

  1. Never expose private keys or sensitive credentials in your application code.
  2. Verify transaction receipts and attestations before considering transactions final.
  3. Implement appropriate timeouts and circuit breakers for network operations.
  4. Monitor and log suspicious activity or unexpected errors.
 

Resources

For additional resources and troubleshooting search for issues on our GitHub repository or submit a new issue.