queryLedgerState_stakePools - Cardano
Example code for the queryLedgerState_stakePools JSON-RPC method. Complete guide on how to use queryLedgerState_stakePools JSON-RPC in GetBlock Web3 documentation.
Parameters
Parameter
Type
Required
Description
Request
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "queryLedgerState/stakePools",
"params": {
"stakePools": []
},
"id": "getblock.io"
}'const response = await fetch(
'https://go.getblock.io/<ACCESS-TOKEN>/',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"jsonrpc": "2.0", "method": "queryLedgerState/stakePools", "params": {"stakePools": []}, "id": "getblock.io"})
}
);
console.log(await response.json());import requests
response = requests.post(
'https://go.getblock.io/<ACCESS-TOKEN>/',
headers={'Content-Type': 'application/json'},
json={"jsonrpc": "2.0", "method": "queryLedgerState/stakePools", "params": {"stakePools": []}, "id": "getblock.io"}
)
print(response.json())Response
{
"jsonrpc": "2.0",
"method": "queryLedgerState/stakePools",
"result": {
"pool1abc...": {
"id": "pool1abc...",
"cost": {
"ada": {
"lovelace": 340000000
}
},
"margin": "3/100",
"pledge": {
"ada": {
"lovelace": 100000000000
}
}
}
},
"id": "getblock.io"
}Response Parameters
Field
Type
Description
Use Cases
Error Handling
Error Code
Message
Description
Was this helpful?