Get Summary Inclusion Data
Returns the summary range (and ethereum transaction hash if the summary is published) which includes the passed block number.
await api.query.getSummaryData(blockNumber)
important
You can get the AVN_GATEWAY_URL here.
REQUEST PARAMS
blockNumber
[optional] - a string representing the block number to check (if none is passed the current finalized block is used).
RESULT FIELDS
blockNumber
- the passed or current finalized block number range - 2 element array with start and end block numbers of the summary (if the block falls within a summary range).ethTxHash
- Ethereum transaction hash of the published summary (if the summary root has been checked in by that point).
- Example
- Example Result
- JSON-RPC
- JSON-RPC Output
const AVN_API = require("avn-api");
const AVN_GATEWAY_URL = "<node_url>";
const options = {
suri: "<account_suri>",
};
const API = new AVN_API(AVN_GATEWAY_URL, options);
const blockNumber = "1234"
async function main() {
await api.init();
let result = await api.query.getSummaryData(blockNumber)
console.log(result);
}
(async () => {
await main();
})();
{
"blockNumber": "1234",
"summaryRange": ["0", "28800"],
"ethTxHash": "0x32c40ef26710a2ed40d2b14ef9a92aab859cb35a92a279d6bc3fbb6fea84089f"
}
REQUEST
POST <https://AVN_GATEWAY_URL/query>
HEADERS
Content-Type: application/json Authorization': bearer <awtToken>
JSON-RPC Example
curl https://AVN_GATEWAY_URL/query \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: bearer <awtToken>" \
-d '{"jsonrpc":"2.0", "method":"getSummaryData", "params":{"blockNumber":"1234"}, "id":1}'
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockNumber": "1234",
"summaryRange": ["0", "28800"],
"ethTxHash": "0x32c40ef26710a2ed40d2b14ef9a92aab859cb35a92a279d6bc3fbb6fea84089f"
}
}