Untitled

V2_
mail@pastecode.io avatar
unknown
javascript
a month ago
741 B
1
Indexable
Never
var request = require('request');

// Add the Bearer token
var bearerToken = '*********************';

var options = {
    'method': 'POST',
    'url': 'https://streaming.bitquery.io/graphql',
    'headers': {
        'Content-Type': 'application/json',
        // Use the Bearer token variable here
        'Authorization': 'Bearer ' + bearerToken
    },
    body: JSON.stringify({
        "query": "query MyQuery {\n  EVM(dataset: combined, network: eth) {\n    Blocks(limit: {count: 1}, orderBy: {descending: Block_Number}) {\n      Block {\n        Number\n      }\n    }\n  }\n}\n"
    })
};

request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Leave a Comment