### Set up Node.js Project and Install SDK Source: https://www.quicknode.com/docs/vana/quickstart Initialize a new Node.js project and install the Quicknode SDK. This sets up your environment for interacting with Vana. ```bash mkdir vana-api-quickstart cd vana-api-quickstart npm init -y npm install @quicknode/sdk ``` -------------------------------- ### Get Address with Web3.py Source: https://www.quicknode.com/docs/ethereum/bb_getAddress This Python example uses the Web3.py library to make a request to the bb_getAddress method. Ensure Web3.py is installed in your environment. ```py from web3 import Web3, HTTPProvider w3 = Web3(HTTPProvider('https://docs-demo.quiknode.pro/')) response = w3.provider.make_request("bb_getAddress", ["0xEA60B5FAbf224041119e29cE4e75513BC73F5Edf",{"page":1,"size":1000,"fromHeight":0,"details":"txids"}]) print(response) ``` -------------------------------- ### Set up Node.js Project for JavaScript Quickstart Source: https://www.quicknode.com/docs/arbitrum-nova/quickstart Initialize a new Node.js project for the JavaScript quickstart example. ```bash mkdir arbitrum-nova-js-quickstart cd arbitrum-nova-js-quickstart npm init -y ``` -------------------------------- ### Get Headers by Height Range Source: https://www.quicknode.com/docs/celestia/header-getRangeByHeight This example demonstrates how to use the `header.GetRangeByHeight` method to retrieve block headers from a starting height to an ending height. ```APIDOC ## Get Headers by Height Range ### Description Retrieves a range of block headers from the Celestia network based on their height. ### Method POST ### Endpoint `https://docs-demo.celestia-mainnet.quiknode.pro/` ### Parameters This method accepts a JSON-RPC request object with the following parameters: - **id**: (integer) - Required - The request ID. - **jsonrpc**: (string) - Required - The JSON-RPC version, must be "2.0". - **method**: (string) - Required - The method name, must be "header.GetRangeByHeight". - **params**: (array) - Required - An array containing the method parameters. - **params[0]**: (object) - Required - An object containing header and commit details for the range. - **header**: (object) - Required - Header information. - **version**: (object) - Required - Version details. - **block**: (string) - Required - Block version. - **app**: (string) - Required - App version. - **chain_id**: (string) - Required - The chain ID. - **height**: (string) - Required - The current block height. - **time**: (string) - Required - Timestamp of the block. - **last_block_id**: (object) - Required - Information about the last block. - **hash**: (string) - Required - Hash of the last block. - **parts**: (object) - Required - Parts of the last block. - **total**: (integer) - Required - Total number of parts. - **hash**: (string) - Required - Hash of the parts. - **last_commit_hash**: (string) - Required - Hash of the last commit. - **data_hash**: (string) - Required - Hash of the block data. - **validators_hash**: (string) - Required - Hash of the validator set. - **next_validators_hash**: (string) - Required - Hash of the next validator set. - **consensus_hash**: (string) - Required - Hash of the consensus state. - **app_hash**: (string) - Required - Hash of the application state. - **last_results_hash**: (string) - Required - Hash of the last results. - **evidence_hash**: (string) - Required - Hash of the evidence. - **proposer_address**: (string) - Required - Address of the proposer. - **commit**: (object) - Required - Commit information. - **height**: (string) - Required - Height of the commit. - **round**: (integer) - Required - Round number. - **block_id**: (object) - Required - Block ID. - **hash**: (string) - Required - Hash of the block. - **parts**: (object) - Required - Parts of the block. - **total**: (integer) - Required - Total number of parts. - **hash**: (string) - Required - Hash of the parts. - **signatures**: (array) - Required - List of signatures. - **block_id_flag**: (integer) - Required - Flag for block ID. - **validator_address**: (string) - Required - Address of the validator. - **timestamp**: (string) - Required - Timestamp of the signature. - **signature**: (string) - Required - The signature. - **validator_set**: (object) - Required - Validator set information. - **validators**: (array) - Required - List of validators. - **address**: (string) - Required - Validator address. - **pub_key**: (object) - Required - Validator public key. - **type**: (string) - Required - Type of public key. - **value**: (string) - Required - Public key value. - **voting_power**: (string) - Required - Voting power. - **proposer_priority**: (string) - Required - Proposer priority. - **proposer**: (object) - Required - Proposer information. - **address**: (string) - Required - Proposer address. - **pub_key**: (object) - Required - Proposer public key. - **type**: (string) - Required - Type of public key. - **value**: (string) - Required - Public key value. - **voting_power**: (string) - Required - Voting power. - **proposer_priority**: (string) - Required - Proposer priority. - **dah**: (object) - Required - Data Availability Header. - **row_roots**: (array) - Required - Row roots. - **column_roots**: (array) - Required - Column roots. - **params[1]**: (integer) - Required - The ending height for the range. ### Request Example ```json { "id": 1, "jsonrpc": "2.0", "method": "header.GetRangeByHeight", "params": [ { "header": { "version": { "block": "11", "app": "2" }, "chain_id": "celestia", "height": "2683973", "time": "2024-10-31T04:35:36.787488335Z", "last_block_id": { "hash": "467DA96B5E2E2562F356AA904D0CCAFB684D16D5EB2EEB59E25270DBAEAF4971", "parts": { "total": 1, "hash": "64618AC65D7D9B9BDDA9171B5D6CFF5FE20B31ED658AE1A0E1E0EDFA0CF5F2B1" } }, "last_commit_hash": "0BB10A64DC33F133E786AF837E1AF4EC15477369E1C90F5F1A514A7C868CA417", "data_hash": "EE8E4CDB2648ABF3D6209657B20FA34E2B199FF53351D18D9E20171D3D9A796D", "validators_hash": "03099425596D5711C13C2106C16A74914D52DCB829742C6AE95159609CF22359", "next_validators_hash": "03099425596D5711C13C2106C16A74914D52DCB829742C6AE95159609CF22359", "consensus_hash": "C0B6A634B72AE9687EA53B6D277A73ABA1386BA3CFC6D0F26963602F7F6FFCD6", "app_hash": "68A329FB2B2E31F7F03CA490E1A8B18BAF6AAEBA0C8C1F37A3BCD386940B0A08", "last_results_hash": "57C6953BDF0C5FE4EC4B1C2D93B4BE605C0B708055858E8081A433B92B5FF479", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "AF157EF644055C9847F90FF896C95A848674EC38" }, "commit": { "height": "2683973", "round": 0, "block_id": { "hash": "E175F5BF91FEEDB11F382742982511A85FBE7D58F02132A5BA55D4E075CFAB13", "parts": { "total": 5, "hash": "4C27C95E0F6FAA078F62813155A94720FB202343043BCF8A92B45E4B72178A83" } }, "signatures": [ { "block_id_flag": 2, "validator_address": "95764047BDFFB5CCADFA635DC63365EEB65F00C2", "timestamp": "2024-10-31T04:35:42.775297752Z", "signature": "y55G6rn+9z/FU3wb3PsDT/a/YpBrpCC/waxbRg7B82yCH/FoQuUwsxgL50RdUN24VGilwGZQYTVbSsisFxGTAA==" } ] }, "validator_set": { "validators": [ { "address": "95764047BDFFB5CCADFA635DC63365EEB65F00C2", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "ZkOfeh3Y+qokXhYFPuNf9d1B7+Vn0jAC78Yy+X6eduM=" }, "voting_power": "47667032", "proposer_priority": "337796841" } ], "proposer": { "address": "AF157EF644055C9847F90FF896C95A848674EC38", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "xwbuyz6bUNd+Ef79w0ysCU4qgDru1OZTn/yHnPaw5JE=" }, "voting_power": "2265846", "proposer_priority": "-352043464" } }, "dah": { "row_roots": [ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFplbml0aBC9HyxAe20ZdXf/PoSaHQXZQlZAXAHEj5g5xj4egMK8" ], "column_roots": [ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////////tfL+UyW2AVPybgVuO7xwpCfCMftfY851hOZDiwkqXqy" ] } }, 2683976 ] } ``` ### Response #### Success Response (200) Returns a JSON-RPC response object containing an array of header objects within the specified height range. The exact structure of the header object is detailed in the `params[0]` description above. ``` -------------------------------- ### Get Finalized Block using web3.py Source: https://www.quicknode.com/docs/bnb-smart-chain/eth_getFinalizedBlock This example shows how to get the latest finalized block on BNB Smart Chain using the web3.py library. It requires the web3.py library to be installed and connected to the specified RPC endpoint. ```python from web3 import Web3, HTTPProvider w3 = Web3(HTTPProvider('https://docs-demo.bsc.quiknode.pro/')) response = w3.provider.make_request("eth_getFinalizedBlock", [16,False]) print(response) ``` -------------------------------- ### Set Up Node.js Project for Sei Source: https://www.quicknode.com/docs/sei/quickstart Initialize a new Node.js project and install the Quicknode SDK. Ensure Node.js is installed by running `node --version`. ```bash mkdir sei-api-quickstart cd sei-api-quickstart npm init -y ``` ```bash npm install @quicknode/sdk ``` ```bash touch index.js ``` -------------------------------- ### Set up Project and Install web3.py Source: https://www.quicknode.com/docs/plasma/quickstart Create a new directory for your web3.py project and install the web3.py library if it's not already present. ```bash mkdir plasma-web3py-quickstart cd plasma-web3py-quickstart pip install web3 ``` -------------------------------- ### Get Block by Number (web3.py) Source: https://www.quicknode.com/docs/scroll/eth_getBlockByNumber Illustrates fetching block information with the web3.py library. This example requires the web3.py library to be installed and an HTTPProvider configured. ```python from web3 import Web3, HTTPProvider w3 = Web3(HTTPProvider('https://docs-demo.scroll-mainnet.quiknode.pro/')) response = w3.provider.make_request("eth_getBlockByNumber", ["0x208da",False]) print(response) ``` -------------------------------- ### Set Up Node.js Project and Install SDK Source: https://www.quicknode.com/docs/soneium/quickstart Initialize a new Node.js project and install the Quicknode SDK. This sets up your environment for interacting with Soneium via the SDK. ```bash mkdir soneium-api-quickstart cd soneium-api-quickstart npm init -y npm install @quicknode/sdk ``` -------------------------------- ### Get Address with QuickNode SDK (QNSDK) Source: https://www.quicknode.com/docs/ethereum/bb_getAddress This JavaScript example uses the QuickNode SDK to fetch address details. Ensure you have the '@quicknode/sdk' package installed. ```js import { Core } from '@quicknode/sdk' const core = new Core({ endpointUrl: "https://docs-demo.quiknode.pro/", }) core.client .request({ method: 'bb_getAddress', params: ["0xEA60B5FAbf224041119e29cE4e75513BC73F5Edf",{"page":1,"size":1000,"fromHeight":0,"details":"txids"}] }) .then(res => console.log(res)) ``` -------------------------------- ### Get Address with Ethers.js Source: https://www.quicknode.com/docs/ethereum/bb_getAddress This JavaScript example uses the Ethers.js library to connect to an Ethereum provider and call the bb_getAddress method. Ensure you have Ethers.js installed. ```js import { ethers } from "ethers"; async function main() { const provider = new ethers.JsonRpcProvider("https://docs-demo.quiknode.pro/"); const response = await provider.send("bb_getAddress", [ "0xEA60B5FAbf224041119e29cE4e75513BC73F5Edf", { "page": 1, "size": 1000, "fromHeight": 0, "details": "txids" } ]); console.log(response); } main(); ``` -------------------------------- ### Node.js Project Setup and SDK Installation Source: https://www.quicknode.com/docs/sahara/quickstart Set up a new Node.js project and install the Quicknode SDK. This involves creating a directory, initializing npm, and installing the SDK package. ```bash mkdir sahara-api-quickstart cd sahara-api-quickstart npm init -y ``` ```bash npm install @quicknode/sdk ``` ```bash touch index.js ``` -------------------------------- ### Node.js Project Setup and SDK Installation Source: https://www.quicknode.com/docs/plasma/quickstart Set up a new Node.js project and install the Quicknode SDK. This involves initializing the project with npm and installing the necessary package. ```bash mkdir plasma-api-quickstart cd plasma-api-quickstart npm init -y npm install @quicknode/sdk touch index.js ``` -------------------------------- ### Get Bitcoin Balance History with Web3.py Source: https://www.quicknode.com/docs/bitcoin/bb_getbalancehistory This Python example uses the Web3.py library to make a request to the bb_getBalanceHistory method. Ensure Web3.py is installed. ```py from web3 import Web3, HTTPProvider w3 = Web3(HTTPProvider('https://docs-demo.btc.quiknode.pro/')) response = w3.provider.make_request("bb_getBalanceHistory", ["bc1qwfgdjyy95aay2686fn74h6a4nu9eev6np7q4fn204dkj3274frlqrskvx0",{"from":"1683684000","to":"1700042400","fiatcurrency":"usd","groupBy":3600}]) print(response) ``` -------------------------------- ### Set Up Go Project Source: https://www.quicknode.com/docs/zksync/quickstart Create a new directory and navigate into it for a Go project. ```bash mkdir zkSync-go-quickstart cd zkSync-go-quickstart ``` -------------------------------- ### Get Bitcoin Balance History with Ethers.js Source: https://www.quicknode.com/docs/bitcoin/bb_getbalancehistory This JavaScript example uses the Ethers.js library to call the bb_getBalanceHistory method. It requires the ethers library to be installed. ```js import { ethers } from "ethers"; async function main() { const provider = new ethers.JsonRpcProvider("https://docs-demo.btc.quiknode.pro/"); const response = await provider.send("bb_getBalanceHistory", [ "bc1qwfgdjyy95aay2686fn74h6a4nu9eev6np7q4fn204dkj3274frlqrskvx0", { "from": "1683684000", "to": "1700042400", "fiatcurrency": "usd", "groupBy": 3600 } ]); console.log(response); } main(); ``` -------------------------------- ### Get Headers by Height Range Source: https://www.quicknode.com/docs/celestia/header-getRangeByHeight This example demonstrates how to use the `header.GetRangeByHeight` JSON-RPC method to retrieve block headers from a starting height to an ending height. ```APIDOC ## GET /header/range ### Description Retrieves a range of block headers specified by their heights. ### Method POST ### Endpoint `https://docs-demo.celestia-mainnet.quiknode.pro/` ### Parameters #### Request Body - **id** (integer) - Required - JSON-RPC request ID. - **jsonrpc** (string) - Required - JSON-RPC version, must be "2.0". - **method** (string) - Required - The method to call, must be "header.GetRangeByHeight". - **params** (array) - Required - An array containing the parameters for the method. - **params[0]** (object) - Required - An object containing header details and commit information. - **header** (object) - Required - Header object. - **version** (object) - Required - Version information. - **block** (string) - Required - Block version. - **app** (string) - Required - App version. - **chain_id** (string) - Required - The ID of the blockchain. - **height** (string) - Required - The current block height. - **time** (string) - Required - Timestamp of the block. - **last_block_id** (object) - Required - Information about the last block. - **hash** (string) - Required - Hash of the last block. - **parts** (object) - Required - Parts information. - **total** (integer) - Required - Total number of parts. - **hash** (string) - Required - Hash of the parts. - **last_commit_hash** (string) - Required - Hash of the last commit. - **data_hash** (string) - Required - Hash of the data. - **validators_hash** (string) - Required - Hash of the validator set. - **next_validators_hash** (string) - Required - Hash of the next validator set. - **consensus_hash** (string) - Required - Hash of the consensus. - **app_hash** (string) - Required - Hash of the application state. - **last_results_hash** (string) - Required - Hash of the last results. - **evidence_hash** (string) - Required - Hash of the evidence. - **proposer_address** (string) - Required - Address of the proposer. - **commit** (object) - Required - Commit object. - **height** (string) - Required - Height of the commit. - **round** (integer) - Required - Round of the commit. - **block_id** (object) - Required - Block ID information. - **hash** (string) - Required - Hash of the block ID. - **parts** (object) - Required - Parts information. - **total** (integer) - Required - Total number of parts. - **hash** (string) - Required - Hash of the parts. - **signatures** (array) - Required - Array of signatures. - **block_id_flag** (integer) - Required - Flag for block ID. - **validator_address** (string) - Required - Address of the validator. - **timestamp** (string) - Required - Timestamp of the signature. - **signature** (string) - Required - The signature. - **validator_set** (object) - Required - Validator set information. - **validators** (array) - Required - Array of validators. - **address** (string) - Required - Address of the validator. - **pub_key** (object) - Required - Public key information. - **type** (string) - Required - Type of public key. - **value** (string) - Required - Value of the public key. - **voting_power** (string) - Required - Voting power of the validator. - **proposer_priority** (string) - Required - Proposer priority. - **proposer** (object) - Required - Proposer information. - **address** (string) - Required - Address of the proposer. - **pub_key** (object) - Required - Public key information. - **type** (string) - Required - Type of public key. - **value** (string) - Required - Value of the public key. - **voting_power** (string) - Required - Voting power of the proposer. - **proposer_priority** (string) - Required - Proposer priority. - **dah** (object) - Required - Data Availability Header. - **row_roots** (array) - Required - Array of row roots. - **column_roots** (array) - Required - Array of column roots. - **params[1]** (integer) - Required - The ending block height. ### Request Example ```json { "id": 1, "jsonrpc": "2.0", "method": "header.GetRangeByHeight", "params": [ { "header": { "version": { "block": "11", "app": "2" }, "chain_id": "celestia", "height": "2683973", "time": "2024-10-31T04:35:36.787488335Z", "last_block_id": { "hash": "467DA96B5E2E2562F356AA904D0CCAFB684D16D5EB2EEB59E25270DBAEAF4971", "parts": { "total": 1, "hash": "64618AC65D7D9B9BDDA9171B5D6CFF5FE20B31ED658AE1A0E1E0EDFA0CF5F2B1" } }, "last_commit_hash": "0BB10A64DC33F133E786AF837E1AF4EC15477369E1C90F5F1A514A7C868CA417", "data_hash": "EE8E4CDB2648ABF3D6209657B20FA34E2B199FF53351D18D9E20171D3D9A796D", "validators_hash": "03099425596D5711C13C2106C16A74914D52DCB829742C6AE95159609CF22359", "next_validators_hash": "03099425596D5711C13C2106C16A74914D52DCB829742C6AE95159609CF22359", "consensus_hash": "C0B6A634B72AE9687EA53B6D277A73ABA1386BA3CFC6D0F26963602F7F6FFCD6", "app_hash": "68A329FB2B2E31F7F03CA490E1A8B18BAF6AAEBA0C8C1F37A3BCD386940B0A08", "last_results_hash": "57C6953BDF0C5FE4EC4B1C2D93B4BE605C0B708055858E8081A433B92B5FF479", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "AF157EF644055C9847F90FF896C95A848674EC38" }, "commit": { "height": "2683973", "round": 0, "block_id": { "hash": "E175F5BF91FEEDB11F382742982511A85FBE7D58F02132A5BA55D4E075CFAB13", "parts": { "total": 5, "hash": "4C27C95E0F6FAA078F62813155A94720FB202343043BCF8A92B45E4B72178A83" } }, "signatures": [ { "block_id_flag": 2, "validator_address": "95764047BDFFB5CCADFA635DC63365EEB65F00C2", "timestamp": "2024-10-31T04:35:42.775297752Z", "signature": "y55G6rn+9z/FU3wb3PsDT/a/YpBrpCC/waxbRg7B82yCH/FoQuUwsxgL50RdUN24VGilwGZQYTVbSsisFxGTAA==" } ] }, "validator_set": { "validators": [ { "address": "95764047BDFFB5CCADFA635DC63365EEB65F00C2", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "ZkOfeh3Y+qokXhYFPuNf9d1B7+Vn0jAC78Yy+X6eduM=" }, "voting_power": "47667032", "proposer_priority": "337796841" } ], "proposer": { "address": "AF157EF644055C9847F90FF896C95A848674EC38", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "xwbuyz6bUNd+Ef79w0ysCU4qgDru1OZTn/yHnPaw5JE=" }, "voting_power": "2265846", "proposer_priority": "-352043464" } }, "dah": { "row_roots": [ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFplbml0aBC9HyxAe20ZdXf/PoSaHQXZQlZAXAHEj5g5xj4egMK8" ], "column_roots": [ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////////tfL+UyW2AVPybgVuO7xwpCfCMftfY851hOZDiwkqXqy" ] } }, 2683976 ] } ``` ### Response #### Success Response (200) - **result** (object) - Contains the requested headers. - **headers** (array) - An array of header objects. - **header** (object) - Header details. - **version** (object) - Version information. - **block** (string) - Block version. - **app** (string) - App version. - **chain_id** (string) - The ID of the blockchain. - **height** (string) - The current block height. - **time** (string) - Timestamp of the block. - **last_block_id** (object) - Information about the last block. - **hash** (string) - Hash of the last block. - **parts** (object) - Parts information. - **total** (integer) - Total number of parts. - **hash** (string) - Hash of the parts. - **last_commit_hash** (string) - Hash of the last commit. - **data_hash** (string) - Hash of the data. - **validators_hash** (string) - Hash of the validator set. - **next_validators_hash** (string) - Hash of the next validator set. - **consensus_hash** (string) - Hash of the consensus. - **app_hash** (string) - Hash of the application state. - **last_results_hash** (string) - Hash of the last results. - **evidence_hash** (string) - Hash of the evidence. - **proposer_address** (string) - Address of the proposer. - **commit** (object) - Commit object. - **height** (string) - Height of the commit. - **round** (integer) - Round of the commit. - **block_id** (object) - Block ID information. - **hash** (string) - Hash of the block ID. - **parts** (object) - Parts information. - **total** (integer) - Total number of parts. - **hash** (string) - Hash of the parts. - **signatures** (array) - Array of signatures. - **block_id_flag** (integer) - Flag for block ID. - **validator_address** (string) - Address of the validator. - **timestamp** (string) - Timestamp of the signature. - **signature** (string) - The signature. - **validator_set** (object) - Validator set information. - **validators** (array) - Array of validators. - **address** (string) - Address of the validator. - **pub_key** (object) - Public key information. - **type** (string) - Type of public key. - **value** (string) - Value of the public key. - **voting_power** (string) - Voting power of the validator. - **proposer_priority** (string) - Proposer priority. - **proposer** (object) - Proposer information. - **address** (string) - Address of the proposer. - **pub_key** (object) - Public key information. - **type** (string) - Type of public key. - **value** (string) - Value of the public key. - **voting_power** (string) - Voting power of the proposer. - **proposer_priority** (string) - Proposer priority. - **dah** (object) - Data Availability Header. - **row_roots** (array) - Array of row roots. - **column_roots** (array) - Array of column roots. - **jsonrpc** (string) - JSON-RPC version. - **id** (integer) - JSON-RPC request ID. #### Response Example ```json { "result": { "headers": [ { "header": { "version": { "block": "11", "app": "2" }, "chain_id": "celestia", "height": "2683973", "time": "2024-10-31T04:35:36.787488335Z", "last_block_id": { "hash": "467DA96B5E2E2562F356AA904D0CCAFB684D16D5EB2EEB59E25270DBAEAF4971", "parts": { "total": 1, "hash": "64618AC65D7D9B9BDDA9171B5D6CFF5FE20B31ED658AE1A0E1E0EDFA0CF5F2B1" } }, "last_commit_hash": "0BB10A64DC33F133E786AF837E1AF4EC15477369E1C90F5F1A514A7C868CA417", "data_hash": "EE8E4CDB2648ABF3D6209657B20FA34E2B199FF53351D18D9E20171D3D9A796D", "validators_hash": "03099425596D5711C13C2106C16A74914D52DCB829742C6AE95159609CF22359", "next_validators_hash": "03099425596D5711C13C2106C16A74914D52DCB829742C6AE95159609CF22359", "consensus_hash": "C0B6A634B72AE9687EA53B6D277A73ABA1386BA3CFC6D0F26963602F7F6FFCD6", "app_hash": "68A329FB2B2E31F7F03CA490E1A8B18BAF6AAEBA0C8C1F37A3BCD386940B0A08", "last_results_hash": "57C6953BDF0C5FE4EC4B1C2D93B4BE605C0B708055858E8081A433B92B5FF479", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "AF157EF644055C9847F90FF896C95A848674EC38" }, "commit": { "height": "2683973", "round": 0, "block_id": { "hash": "E175F5BF91FEEDB11F382742982511A85FBE7D58F02132A5BA55D4E075CFAB13", "parts": { "total": 5, "hash": "4C27C95E0F6FAA078F62813155A94720FB202343043BCF8A92B45E4B72178A83" } }, "signatures": [ { "block_id_flag": 2, "validator_address": "95764047BDFFB5CCADFA635DC63365EEB65F00C2", "timestamp": "2024-10-31T04:35:42.775297752Z", "signature": "y55G6rn+9z/FU3wb3PsDT/a/YpBrpCC/waxbRg7B82yCH/FoQuUwsxgL50RdUN24VGilwGZQYTVbSsisFxGTAA==" } ] }, "validator_set": { "validators": [ { "address": "95764047BDFFB5CCADFA635DC63365EEB65F00C2", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "ZkOfeh3Y+qokXhYFPuNf9d1B7+Vn0jAC78Yy+X6eduM=" }, "voting_power": "47667032", "proposer_priority": "337796841" } ], "proposer": { "address": "AF157EF644055C9847F90FF896C95A848674EC38", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "xwbuyz6bUNd+Ef79w0ysCU4qgDru1OZTn/yHnPaw5JE=" }, "voting_power": "2265846", "proposer_priority": "-352043464" } }, "dah": { "row_roots": [ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFplbml0aBC9HyxAe20ZdXf/PoSaHQXZQlZAXAHEj5g5xj4egMK8" ], "column_roots": [ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////////tfL+UyW2AVPybgVuO7xwpCfCMftfY851hOZDiwkqXqy" ] } } ], "jsonrpc": "2.0", "id": 1 } } ``` ``` -------------------------------- ### Set up Go Project Source: https://www.quicknode.com/docs/ink/quickstart Create a new directory and navigate into it for your Go project. ```bash mkdir ink-go-quickstart cd ink-go-quickstart ``` -------------------------------- ### Get Account Info using @solana/kit TypeScript Source: https://www.quicknode.com/docs/solana/getAccountInfo This TypeScript example uses the `@solana/kit` library to fetch account information asynchronously. Ensure you have the library installed. ```ts import { createSolanaRpc, address } from "@solana/kit"; (async () => { const searchAddress = address('7cVfgArCheMR6Cs4t6vz5rfnqd56vZq4ndaBrY5xkxXy'); const solanaRpc = createSolanaRpc("https://docs-demo.solana-mainnet.quiknode.pro/"); const { value: accountInfo } = await solanaRpc.getAccountInfo(searchAddress).send(); console.log(accountInfo); })(); ``` -------------------------------- ### Set Up Node.js Project for Quicknode SDK Source: https://www.quicknode.com/docs/0g/quickstart Initialize a new Node.js project and install the Quicknode SDK. ```bash mkdir 0g-api-quickstart cd 0g-api-quickstart npm init -y npm install @quicknode/sdk ``` -------------------------------- ### Get Address with Python Requests Source: https://www.quicknode.com/docs/ethereum/bb_getAddress This Python example uses the 'requests' library to send a POST request for address information. Ensure the 'requests' library is installed. ```py import requests import json url = "https://docs-demo.quiknode.pro/" payload = json.dumps({ "jsonrpc": "2.0", "method": "bb_getAddress", "params": [ "0xEA60B5FAbf224041119e29cE4e75513BC73F5Edf", { "page": 1, "size": 1000, "fromHeight": 0, "details": "txids" } ], "id": 1 }) headers = { 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` -------------------------------- ### Set up and Run Ethgo Project Source: https://www.quicknode.com/docs/ault/quickstart Instructions for initializing a Go module, installing the ethgo SDK, and creating a Go script to retrieve the latest block number via your QuickNode endpoint. ```bash mkdir Ault-ethgo-quickstart cd Ault-ethgo-quickstart ``` ```bash go mod init Ault-ethgo-quickstart go get github.com/umbracle/ethgo go mod tidy ``` ```go package main import ( "fmt" "log" "github.com/umbracle/ethgo/jsonrpc" ) func main() { client, err := jsonrpc.NewClient("YOUR_QUICKNODE_ENDPOINT_URL/") if err != nil { log.Fatalf("Failed to connect to Ethereum: %v", err) } blockNumber, err := client.Eth().BlockNumber() if err != nil { log.Fatalf("Failed to get latest block number: %v", err) } fmt.Printf("Latest block number (decimal): %d\n", blockNumber) fmt.Printf("Latest block number (hex): 0x%x\n", blockNumber) } ``` ```bash go run main.go ``` -------------------------------- ### Get Raw Block Data (Node.js) Source: https://www.quicknode.com/docs/bitcoincash/bb_getrawblock Example using the bitcoin-rpc-client library in Node.js to fetch raw block data. Ensure the library is installed and configured. ```javascript const client = require('bitcoin-rpc-client')({ host: 'localhost', port: 8332, user: 'user', password: 'password' }); client.getRawBlock('0000602093ea70b294aeef69db85981bd387285824fc5af732e487010000000000000000').then(result => { console.log(result); }).catch(err => { console.error(err); }); ``` -------------------------------- ### Make Setup Script Executable and Run Source: https://www.quicknode.com/docs/celestia/celestia-grpc/overview/go Commands to make the setup script executable and then run it to download all dependencies. ```bash chmod +x setup_celestia_protos.sh ``` ```bash sh setup_celestia_protos.sh ``` -------------------------------- ### Get Filter Changes using Web3.py Source: https://www.quicknode.com/docs/avalanche/eth_getFilterChanges This Python example uses the Web3.py library to set up a filter and then fetch changes. Make sure you have 'web3' installed. ```python from web3 import Web3, HTTPProvider w3 = Web3(HTTPProvider('https://docs-demo.avalanche-mainnet.quiknode.pro/ext/bc/C/rpc')) put_filter = w3.eth.filter({'fromBlock': 1000000, 'toBlock': 1000100, 'address': '0x6C8f2A135f6ed072DE4503Bd7C4999a1a17F824B'}) print(w3.eth.get_filter_changes(put_filter.filter_id)) ``` -------------------------------- ### Set Up Node.js Project and Install SDK Source: https://www.quicknode.com/docs/polygon/quickstart Initialize a new Node.js project and install the Quicknode SDK. This sets up your project for interacting with the Polygon blockchain via Quicknode. ```bash mkdir polygon-api-quickstart cd polygon-api-quickstart npm init -y npm install @quicknode/sdk ``` -------------------------------- ### Initialize Node.js Project and Install SDK Source: https://www.quicknode.com/docs/immutable-zkevm/quickstart Set up a new Node.js project and install the Quicknode SDK package. This is the first step for using the SDK to interact with Immutable zkEVM. ```bash mkdir immutable_zkevm-api-quickstart cd immutable_zkevm-api-quickstart npm init -y npm install @quicknode/sdk ``` -------------------------------- ### Get Filter Changes using Ethers.js Source: https://www.quicknode.com/docs/avalanche/eth_getFilterChanges This JavaScript example uses the Ethers.js library to create a filter and then fetch changes. It requires the 'ethers' package to be installed. ```javascript import { ethers } from "ethers"; const filter = { fromBlock: "0x1", toBlock: "0x2", address: "0x8888f1f195afa192cfee860698584c030f4c9db1", topics: [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", ], }; (async () => { const provider = new ethers.JsonRpcProvider( "https://docs-demo.avalanche-mainnet.quiknode.pro/ext/bc/C/rpc" ); const filterId = await provider.send("eth_newFilter", [filter]); console.log(filterId); const logs = await provider.send("eth_getFilterChanges", [filterId]); console.log(logs); })(); ``` -------------------------------- ### Get Filter Changes using ethereum.rb Source: https://www.quicknode.com/docs/avalanche/eth_getFilterChanges This Ruby example demonstrates how to create a filter and then retrieve changes using eth_getFilterChanges. Ensure you have the 'ethereum.rb' gem installed. ```ruby require 'ethereum.rb' client = Ethereum::HttpClient.new('https://docs-demo.avalanche-mainnet.quiknode.pro/ext/bc/C/rpc') filterId = client.eth_new_filter( { fromBlock: '0x1', toBlock: '0x2', address: '0x8888f1f195afa192cfee860698584c030f4c9db1', topics: ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b"] } ) puts filterId["result"] logs = client.eth_get_filter_changes(filterId["result"].to_s) puts logs["result"] ```