Casper RPC
How to use it
// yarn add @tatumio/tatum
import { TatumSDK, Casper, Network } from '@tatumio/tatum'
const tatum = await TatumSDK.init<Casper>({ network: Network.CASPER })
const blockHash = 'a4b607420ae737f9cd474af73c9f5e908f61edd2e57d48371d15835127b46aaf'
const result = await tatum.rpc.stateGetAuctionInfo({ hash: blockHash })
await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs
Request Example
curl --location 'https://api.tatum.io/v3/blockchain/node/casper-mainnet/' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {API_KEY}' \
--data '{
"id": 1,
"jsonrpc": "2.0",
"method": "state_get_auction_info",
"params": [
{
"Hash": "a4b607420ae737f9cd474af73c9f5e908f61edd2e57d48371d15835127b46aaf"
}
]
}'
Overview
state_get_auction_info
is an RPC method on the Casper blockchain that retrieves auction information at a specific block hash.
Parameters
The state_get_auction_info
method accepts the following parameters:
block_identifier
: An object specifying the block identifier, which includes:Hash
: The hash of the block to query. Example:"a4b607420ae737f9cd474af73c9f5e908f61edd2e57d48371d15835127b46aaf"
Return Object
The state_get_auction_info
method returns an object with the following fields:
api_version
: The API version. Example:"1.5.6"
auction_state
: An object containing the auction state information.
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"api_version": "1.5.6",
"auction_state": {
"state_root_hash": "a4b607420ae737f9cd474af73c9f5e908f61edd2e57d48371d15835127b46aaf",
"block_height": 123456,
"era_validators": [
{
"era_id": 10,
"validator_weights": [
{
"public_key": "01abc...",
"weight": "1000000000000000000"
}
]
}
],
...
}
}
}
Notes
- This method returns the auction information at the specified block hash.
- Ensure to replace the block hash with the actual value you intend to query.
For more detailed information, refer to the official Casper documentation.