Untitled

V2_
 avatar
unknown
javascript
a year ago
741 B
4
Indexable
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);
});
Editor is loading...
Leave a Comment