### Install Python Requests Library Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ipfs/getting-started Command to install the 'requests' package, a prerequisite for running Python code examples that interact with the IPFS REST API. ```bash python -m pip install requests ``` -------------------------------- ### Install Python Requests Package Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/storage/getting-started Command to install the 'requests' package for Python, which is necessary to run Python code examples for the IPFS REST API. ```Python python -m pip install requests ``` -------------------------------- ### Install Python Requests Package Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ethereum/crypto-market-data-api/overview Install the 'requests' package for Python, which is required to run the Python code examples provided in this documentation. Use pip, Python's package installer, to add the library. ```Python python -m pip install requests ``` -------------------------------- ### Check Ruby Installation Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/vana To run our Ruby code examples, you'll need to have Ruby installed. You can follow this official installation document for more information. Check if you have it by running the following: ```bash ruby -v ``` -------------------------------- ### Verify Ruby Installation Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ethereum/goldrush-wallet-api/overview This command outputs the installed version of Ruby. Ruby is a prerequisite for running the Ruby code examples presented in this documentation. ```bash ruby -v ``` -------------------------------- ### Check Ruby Installation Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ethereum/crypto-market-data-api/overview Verify the installed version of Ruby. Ruby is required to run the Ruby code examples provided in this documentation. This command displays the currently installed Ruby version. ```Ruby ruby -v ``` -------------------------------- ### Install QuickNode SDK package Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/quicknode-sdk/getting-started Installs the QuickNode SDK package using either npm or yarn. This package requires Node.js v16 or higher to function correctly. ```Bash npm install @quicknode/sdk ``` ```Bash yarn add @quicknode/sdk ``` -------------------------------- ### Check Ruby Installation Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/marketplace-addons/goldrush-wallet-api/overview Verify if Ruby is installed on your system and check its version. Ruby is required to run the Ruby code examples for the GoldRush Wallet API. ```Ruby ruby -v ``` -------------------------------- ### Check Node.js Installation Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ethereum/crypto-market-data-api/overview Verify the installed version of Node.js. Node.js v18 and up is required to run the JavaScript code examples. This command displays the currently installed Node.js version. ```JavaScript node -v ``` -------------------------------- ### Install Python Requests Package Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/avalanche/goldrush-wallet-api/overview This command uses pip, Python's package installer, to install the 'requests' library, which is required for running Python code examples that interact with web services. ```bash python -m pip install requests ``` -------------------------------- ### Verify Ruby Installation Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/avalanche/goldrush-wallet-api/overview This command checks the installed version of Ruby, confirming its presence on your system for executing Ruby code examples. ```bash ruby -v ``` -------------------------------- ### Install Python Requests Package Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/vana To run our Python code examples, you'll need to have Python installed as well as the requests package. You can install this package with the following command: ```bash python -m pip install requests ``` -------------------------------- ### Example Response for /eth/v1/events RPC Call Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ethereum/eth-v1-events An example JSON response demonstrating the successful connection message received after initiating a subscription to the /eth/v1/events RPC method. This indicates the client is now connected to the event stream. ```JSON { "Connected": "to https://docs-demo.quiknode.pro/eth/v1/events?topics=head" } ``` -------------------------------- ### Call state_queryStorageAt RPC Method Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/polkadot/state_queryStorageAt Examples demonstrating how to call the state_queryStorageAt RPC method using various programming languages to retrieve storage entries from a QuickNode endpoint. ```curl curl https://docs-demo.dot-mainnet.quiknode.pro/ \ -X POST \ -H "Content-Type: application/json" \ --data '{"method":"state_queryStorageAt","params":[["0x1a736d37504c2e3fb73dad160c55b2918ee7418a6531173d60d1f6a82d8f4d51c16ee72ac33a6a9e5e887792c26526f9cc080000"]],"id":1,"jsonrpc":"2.0"}' ``` ```javascript var myHeaders = new Headers(); myHeaders.append("Content-Type", "application/json"); var raw = JSON.stringify({ "method": "state_queryStorageAt", "params": [ [ "0x1a736d37504c2e3fb73dad160c55b2918ee7418a6531173d60d1f6a82d8f4d51c16ee72ac33a6a9e5e887792c26526f9cc080000" ] ], "id": 1, "jsonrpc": "2.0" }); var requestOptions = { method: 'POST', headers: myHeaders, body: raw, redirect: 'follow' }; fetch("https://docs-demo.dot-mainnet.quiknode.pro/", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error)); ``` ```python import requests import json url = "https://docs-demo.dot-mainnet.quiknode.pro/" payload = json.dumps({ "method": "state_queryStorageAt", "params": [ [ "0x1a736d37504c2e3fb73dad160c55b2918ee7418a6531173d60d1f6a82d8f4d51c16ee72ac33a6a9e5e887792c26526f9cc080000" ] ], "id": 1, "jsonrpc": "2.0" }) headers = { 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://docs-demo.dot-mainnet.quiknode.pro/") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "method": "state_queryStorageAt", "params": [ [ "0x1a736d37504c2e3fb73dad160c55b2918ee7418a6531173d60d1f6a82d8f4d51c16ee72ac33a6a9e5e887792c26526f9cc080000" ] ], "id": 1, "jsonrpc": "2.0" }) response = https.request(request) puts response.read_body ``` -------------------------------- ### Subscribe to newHeads using wscat Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/kaia/eth_subscribe Example of how to use `wscat` to establish a WebSocket connection and subscribe to `newHeads` events using the `eth_subscribe` method. ```Shell wscat -c \ # wait for connection {"id":1,"jsonrpc":"2.0","method":"eth_subscribe","params":["newHeads"]} ``` -------------------------------- ### Install Python Requests Package Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/marketplace-addons/goldrush-wallet-api/overview Install the 'requests' package for Python, which is required to run the Python code examples for the GoldRush Wallet API. This command uses pip, Python's package installer. ```Python python -m pip install requests ``` -------------------------------- ### Verify Node.js Installation Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ethereum/goldrush-wallet-api/overview This command displays the currently installed version of Node.js. Node.js version 18 or higher is required to execute the JavaScript code examples provided in this documentation. ```bash node -v ``` -------------------------------- ### Check Node.js Installation Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/vana To run our JavaScript code examples, you'll need to have Node v18 and up installed. You can follow this official document to install the latest, stable version of Node globally. Check if you have it by running the following: ```bash node -v ``` -------------------------------- ### Solana Digital Asset Metadata JSON Example Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/solana/searchAssets A comprehensive JSON example illustrating the structure of metadata for a Solana-based digital asset. It includes fields for asset identification, royalty distribution, creator addresses and shares, ownership delegation and model, and supply parameters such as print limits and edition nonce. ```JSON { "asset_hash": "", "tree": "", "seq": 0, "leaf_id": 0, "grouping": [ { "group_key": "collection", "group_value": "BUjZjAS2vbbb65g7Z1Ca9ZRVYoJscURG5L3AkVvHP9ac" } ], "royalty": { "royalty_model": "creators", "target": null, "percent": 0.042, "basis_points": 420, "primary_sale_happened": true, "locked": false }, "creators": [ { "address": "D3XrkNZz6wx6cofot7Zohsf2KSsu2ArngNk8VqU9cTY3", "share": 0, "verified": true }, { "address": "3pMvTLUA9NzZQd4gi725p89mvND1wRNQM3C8XEv1hTdA", "share": 100, "verified": true } ], "ownership": { "frozen": true, "delegated": true, "delegate": "GUruvq96THGCtNrMqHy2BH84AC2CG2QoeefxtYc9dRFs", "ownership_model": "single", "owner": "CHBELQKe6iP1mV6AnJo4tFGF5WiRe9hnQ6oK5fbbPGeJ" }, "supply": { "print_max_supply": 0, "print_current_supply": 0, "edition_nonce": 255 }, "mutable": true, "burnt": false } ``` -------------------------------- ### Code Examples: Get Block Root API Request Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ethereum/eth-v1-beacon-blocks-block_id-root These code snippets demonstrate how to programmatically make a GET request to the /eth/v1/beacon/blocks/{block_id}/root endpoint. Examples are provided for various programming languages, showing how to set headers and handle the API call. ```curl curl -X GET \ "https://docs-demo.quiknode.pro/eth/v1/beacon/blocks/head/root" \ -H "accept: application/json" ``` ```JavaScript var myHeaders = new Headers(); myHeaders.append("accept", "application/json"); var requestOptions = { method: 'GET', headers: myHeaders, redirect: 'follow' }; fetch("https://docs-demo.quiknode.pro/eth/v1/beacon/blocks/head/root", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error)); ``` ```Python import requests url = "https://docs-demo.quiknode.pro/eth/v1/beacon/blocks/head/root" payload={} headers = { 'accept': 'application/json' } response = requests.request("GET", url, headers=headers, data=payload) print(response.text) ``` ```Ruby require "uri" require "net/http" url = URI("https://docs-demo.quiknode.pro/eth/v1/beacon/blocks/head/root") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Get.new(url) request["accept"] = "application/json" response = https.request(request) puts response.read_body ``` -------------------------------- ### Example Response for Node Syncing Status Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ethereum/eth-v1-node-syncing An example JSON response returned by the /eth/v1/node/syncing RPC method, showing the structure and typical values for node synchronization data. ```json { "data": { "is_syncing": false, "is_optimistic": false, "el_offline": false, "head_slot": "11579199", "sync_distance": "0" } } ``` -------------------------------- ### Example JSON Response for Node Peers Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ethereum/eth-v1-node-peers An example JSON response illustrating the typical data format and content returned by the /eth/v1/node/peers endpoint, including various peer states and details. ```JSON { "data": [ { "peer_id": "16Uiu2HAkyPk7XQdd3KLA22r4mseXoDurW3Vab6PesXms38YD9RLm", "enr": null, "last_seen_p2p_address": "/ip4/87.91.153.252/tcp/8041", "state": "connected", "direction": "inbound" }, { "peer_id": "16Uiu2HAmNqdAybeiKGrRszshfcBYPzw6JaoUqUt8LBQ8TEsHzH3Q", "enr": null, "last_seen_p2p_address": "/ip4/88.211.204.108/tcp/4001", "state": "disconnected", "direction": "inbound" }, { "peer_id": "16Uiu2HAmP6CDNiXDPnM1PgMNkEiVYAPX9i6D9YP7KqD3NBy5vNbr", "enr": "enr:-Ma4QCQdGWZOIHvg5TDFhomHzvBhzPco2YPb7iWYHniVXEPmft5dE2B1UfCo6OiGc1jEbdWWsOBrhDFZhnHM_YBiPF-CBPGHYXR0bmV0c4gBAAAAAAAAgIRldGgykGqVoakEAAAA__________-CaWSCdjSCaXCEAyQeaIRxdWljgiMpiXNlY3AyNTZrMaEDmwnNu0AoBHvrhWSUx396XrJ01WsomWUPLu8ReM29OmGIc3luY25ldHMAg3RjcIIjKIN1ZHCCIyg", "last_seen_p2p_address": "/ip4/3.36.30.104/tcp/9000/p2p/16Uiu2HAmP6CDNiXDPnM1PgMNkEiVYAPX9i6D9YP7KqD3NBy5vNbr", "state": "connected", "direction": "outbound" }, { "peer_id": "16Uiu2HAm4GijyV26ZsPTxL5uHq7kPQ7VY2RpUT8PCsV4X6jVVf3y", "enr": null, "last_seen_p2p_address": "/ip4/95.165.29.246/tcp/42024", "state": "disconnected", "direction": "inbound" }, { "peer_id": "16Uiu2HAkvRAGMErq8wz6cdmMiBr2idE4r5A88z2oEkq832dhnegm", "enr": null, "last_seen_p2p_address": "/ip4/50.246.200.118/tcp/55030", "state": "disconnected", "direction": "inbound" }, { "peer_id": "16Uiu2HAmLKLgCWrthmaVWPiesVUf7z71ifmRXUgn5fEra4n9C6LX", "enr": null, "last_seen_p2p_address": "/ip4/158.220.120.42/tcp/36532", "state": "disconnected", "direction": "inbound" }, { "peer_id": "16Uiu2HAm3v4J3aJNgW1gSqzLNiwnrXtyLLwGxcTX5A6uYCmz4Kn2", "enr": null, "last_seen_p2p_address": "/ip4/135.125.67.55/tcp/4001", "state": "disconnected", "direction": "inbound" }, { "peer_id": "16Uiu2HAmDqdWiFZz1US5h1P6HgkWDgk7yHzmt5RfKLTHeE6xBq1m", "enr": null, "last_seen_p2p_address": "/ip4/213.32.24.210/tcp/40286", "state": "disconnected", "direction": "inbound" }, { "peer_id": "16Uiu2HAkw1RmjjE4KCFq58hhNzk32BjzE4jvzcq7PNUi9iWWZG3e", "enr": null, "last_seen_p2p_address": "/ip4/72.215.3.210/tcp/18172", "state": "disconnected", "direction": "inbound" }, { "peer_id": "16Uiu2HAmVkj4LUG2M2grXHtyf9DAvLLZ88Vqp9zfobCzDdiUuaTy", "enr": null, "last_seen_p2p_address": "/ip4/208.91.111.152/tcp/13000", "state": "disconnected", "direction": "inbound" }, { "peer_id": "16Uiu2HAmFzNqQqBXgjUBDGGLbs7N7VGmrkgXW4VrZcgabLx7piH8", "enr": null, "last_seen_p2p_address": "/ip4/93.203.33.5/tcp/40108", "state": "disconnected", "direction": "inbound" }, { "peer_id": "16Uiu2HAmJNDvfdGQczdELgbFPazdTuNDqS1M8Cn73g44WW52yays", "enr": null, "last_seen_p2p_address": "/ip4/104.157.101.104/tcp/44392", "state": "disconnected", "direction": "inbound" }, { "peer_id": "16Uiu2HAmCMfEcFoKwePW8S2e9KJBTtGZmzfg6AU8wQvr7YW6JoNi", "enr": null, "last_seen_p2p_address": "/ip4/135.181.221.62/tcp/59080", "state": "disconnected", "direction": "inbound" }, { "peer_id": "16Uiu2HAmAqVjVuSaY7bMa9TahZt7PT97JDxWyL2hLfgVcDvAAFfj", "enr": null, ``` -------------------------------- ### Setup Environment and Install Dependencies for Webhook Projects Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/streams/destinations/webhooks/deploy These commands guide you through setting up the project directory and installing necessary dependencies for each language. This includes creating virtual environments for Python and managing gems for Ruby. ```Shell mkdir go-webhook cd go-webhook ``` ```Shell mkdir python-webhook cd python-webhook python3 -m venv venv source venv/bin/activate pip install flask ``` ```Shell mkdir ruby-webhook cd ruby-webhook echo "source 'https://rubygems.org'" > Gemfile echo "gem 'sinatra'" >> Gemfile bundle install ``` -------------------------------- ### Subscribe to Beacon Node Events using /eth/v1/events RPC Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ethereum/eth-v1-events Demonstrates how to subscribe to beacon node events, specifically 'head' events, using the /eth/v1/events RPC method. Examples are provided for cURL, JavaScript, Python, and Ruby, showing how to make the GET request and handle the event stream. ```cURL curl -X GET \ "https://docs-demo.quiknode.pro/eth/v1/events?topics=head" \ -H "accept: text/event-stream" ``` ```JavaScript const EventSource = require("eventsource"); let url = "https://docs-demo.quiknode.pro/eth/v1/events?topics=head" let eventSourceInitDict = {headers: {'Accept': 'text/event-stream'}}; async function main() { let es = new EventSource(url, eventSourceInitDict); es.addEventListener('head', function (e) { console.log(e.data) }) } main(); ``` ```Python import json import sseclient import requests url = "https://docs-demo.quiknode.pro/eth/v1/events?topics=head" response = requests.get(url, stream=True, headers={'Accept': 'text/event-stream'}) client = sseclient.SSEClient(response); for event in client.events(): subscriptionData = json.loads(event.data) print(json.dumps(subscriptionData, indent=2)) ``` ```Ruby require "uri" require "net/http" url = URI("https://docs-demo.quiknode.pro/eth/v1/events?topics=head") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Get.new(url) request["accept"] = "text/event-stream" response = https.request(request) puts response.read_body ``` -------------------------------- ### Get Node Syncing Status via RPC Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ethereum/eth-v1-node-syncing Examples demonstrating how to make a GET request to the /eth/v1/node/syncing RPC endpoint to retrieve the current synchronization status of an Ethereum node. ```curl curl --location 'https://docs-demo.quiknode.pro/eth/v1/node/syncing' \ --header 'Content-Type: application/json' ``` ```javascript const myHeaders = new Headers(); myHeaders.append("Content-Type", "application/json"); const requestOptions = { method: "GET", headers: myHeaders, redirect: "follow" }; fetch("https://docs-demo.quiknode.pro/eth/v1/node/syncing", requestOptions) .then((response) => response.text()) .then((result) => console.log(result)) .catch((error) => console.error(error)); ``` ```python import requests import json url = "https://docs-demo.quiknode.pro/eth/v1/node/syncing" payload = {} headers = { 'Content-Type': 'application/json' } response = requests.request("GET", url, headers=headers, data=payload) print(response.text) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://docs-demo.quiknode.pro/eth/v1/node/syncing") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Get.new(url) request["Content-Type"] = "application/json" response = https.request(request) puts response.read_body ``` -------------------------------- ### Example JSON Response for Validator Balances Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ethereum/eth-v1-beacon-states-state_id-validator_balances An example of the JSON response returned by the /eth/v1/beacon/states/{state_id}/validator_balances endpoint, showing the structure for execution optimism, finalization status, and data for validator index and balance. ```json { "execution_optimistic": false, "finalized": false, "data": [ { "index": "91343", "balance": "0" } ] } ``` -------------------------------- ### Verify cURL Installation Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ipfs/getting-started Command-line instruction to check if cURL, a tool for transferring data with URLs, is installed on a *nix based system. ```bash curl -h ``` -------------------------------- ### Call system_chain RPC Method Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/polkadot/system_chain Examples demonstrating how to send a JSON-RPC request to the QuickNode endpoint to retrieve the chain name using different programming languages and tools. ```curl curl https://docs-demo.dot-mainnet.quiknode.pro/ \ -X POST \ -H "Content-Type: application/json" \ --data '{"method":"system_chain","params":[],"id":1,"jsonrpc":"2.0"}' ``` ```javascript var myHeaders = new Headers(); myHeaders.append("Content-Type", "application/json"); var raw = JSON.stringify({ "method": "system_chain", "params": [], "id": 1, "jsonrpc": "2.0" }); var requestOptions = { method: 'POST', headers: myHeaders, body: raw, redirect: 'follow' }; fetch("https://docs-demo.dot-mainnet.quiknode.pro/", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error)); ``` ```python import requests import json url = "https://docs-demo.dot-mainnet.quiknode.pro/" payload = json.dumps({ "method": "system_chain", "params": [], "id": 1, "jsonrpc": "2.0" }) headers = { 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://docs-demo.dot-mainnet.quiknode.pro/") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "method": "system_chain", "params": [], "id": 1, "jsonrpc": "2.0" }) response = https.request(request) puts response.read_body ``` -------------------------------- ### Example Response for Simulate Bundle RPC Call Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/solana/simulateBundle This JSON object provides an example response structure for a Solana RPC `simulateBundle` call. It details the execution context, logs, account state changes before and after execution, consumed compute units, and any return data from the program. ```JSON { "jsonrpc": "2.0", "id": 1, "result": { "context": { "apiVersion": "1.16.3", "slot": 202851945 }, "err": null, "logs": [ "Program 11111111111111111111111111111111 invoke [1]", "Program 11111111111111111111111111111111 success", "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]", "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success" ], "preExecutionAccounts": [ { "lamports": 1000000000, "owner": "11111111111111111111111111111111", "data": "", "executable": false, "rentEpoch": 371 } ], "postExecutionAccounts": [ { "lamports": 998000000, "owner": "11111111111111111111111111111111", "data": "", "executable": false, "rentEpoch": 371 } ], "unitsConsumed": 200000, "returnData": { "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", "data": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASjD8=" } } } ``` -------------------------------- ### Check cURL Installation Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ethereum/crypto-market-data-api/overview Verify if cURL is installed on your system by running the help command. cURL is a command-line tool for transferring data with URLs, commonly available on *nix based systems. ```cURL curl -h ``` -------------------------------- ### QuickNode Function Response Example Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/functions/functions-library/compute-contract-deployments This JSON object represents the typical response structure from the QuickNode Function, providing the network, the analyzed block number, and the total count of contract deployments found within that block. ```json { "network": "ethereum-mainnet", "blockNumber": 21503215, "numContractDeployments": 5 } ``` -------------------------------- ### Initiate API Request in Rust (Partial) Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/solana/searchAssets This partial Rust snippet demonstrates the initial setup for making an asynchronous HTTP request using `reqwest`. It includes importing necessary modules and initializing a `HeaderMap`. ```Rust use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut headers = header::HeaderMap::new(); ``` -------------------------------- ### QuickNode SDK Core Quickstart Example Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/quicknode-sdk/Core/Overview This snippet demonstrates how to quickly initialize the QuickNode SDK Core class using an endpoint URL and make a basic RPC call to retrieve the latest block information. ```javascript import { Core } from '@quicknode/sdk; const core = new Core({ endpointUrl: "https://my-endpoint-name.quiknode.pro/myauthtoken/", }); core.client.getBlock().then((res) => console.log(res)); ``` -------------------------------- ### Initialize QuickNode SDK Core and make an RPC call Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/quicknode-sdk/getting-started Demonstrates how to initialize the QuickNode SDK's Core class with an endpoint URL from your QuickNode account. It then shows how to make a basic RPC call, such as getBlock, which automatically communicates with the correct chain determined from the endpoint URL. ```TypeScript import { Core } from '@quicknode/sdk' // if you are using CommonJS, use this line instead: // const { Core } = require('@quicknode/sdk') const core = new Core({ endpointUrl: "https://my-endpoint-name.quiknode.pro/myauthtoken/", }) // getBlock() is communicating with ethereum sepolia network core.client.getBlock().then((res) => console.log(res)); ``` -------------------------------- ### Check Ruby Version Installation Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ipfs/getting-started This command verifies if Ruby is installed on your system and displays its version. It is a necessary step before running any Ruby code examples provided in the documentation. ```Ruby ruby -v ``` -------------------------------- ### Sample JSON-RPC Response for Search Assets Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/solana/searchAssets This JSON snippet illustrates the expected structure of a successful response from the `searchAssets` JSON-RPC method. It includes details such as total results, limit, cursor for pagination, and an array of `items`, each representing an an asset with its interface, ID, content (including metadata and files), authorities, compression status, grouping, royalty, creators, ownership, supply, mutability, and burnt status. ```JSON { "jsonrpc": "2.0", "result": { "total": 10, "limit": 10, "cursor": "JDfuX7zZvZmRGT1JtR7ugbLqqfvsuNXAanNG3RcteDR7", "items": [ { "interface": "Custom", "id": "JEH7cJxAKdprFG5AvdsY2c4ZqojxLBjFmw19zADV6oK5", "content": { "$schema": "https://schema.metaplex.com/nft1.0.json", "json_uri": "https://famousfoxes.com/metadata/7045.json", "files": [ { "uri": "https://famousfoxes.com/hd/7045.png", "mime": "image/png" } ], "metadata": { "attributes": [ { "value": "Amaranth", "trait_type": "Background" }, { "value": "Hoodie Green", "trait_type": "Outfit" }, { "value": "Natural", "trait_type": "Skin" }, { "value": "Smile", "trait_type": "Mouth" }, { "value": "None", "trait_type": "Head" }, { "value": "Blank", "trait_type": "Eyes" } ], "description": "The Famous Fox Federation, an independent organization of the most fabulously famous foxes on the Blockchain.", "name": "Fox #7045", "symbol": "FFF" }, "links": { "image": "https://famousfoxes.com/hd/7045.png", "external_url": "https://famousfoxes.com" } }, "authorities": [ { "address": "3pMvTLUA9NzZQd4gi725p89mvND1wRNQM3C8XEv1hTdA", "scopes": [ "full" ] } ], "compression": { "eligible": false, "compressed": false, "data_hash": "", "creator_hash": "", "asset_hash": "", "tree": "", "seq": 0, "leaf_id": 0 }, "grouping": [ { "group_key": "collection", "group_value": "BUjZjAS2vbbb65g7Z1Ca9ZRVYoJscURG5L3AkVvHP9ac" } ], "royalty": { "royalty_model": "creators", "target": null, "percent": 0.042, "basis_points": 420, "primary_sale_happened": true, "locked": false }, "creators": [ { "address": "D3XrkNZz6wx6cofot7Zohsf2KSsu2ArngNk8VqU9cTY3", "share": 0, "verified": true }, { "address": "3pMvTLUA9NzZQd4gi725p89mvND1wRNQM3C8XEv1hTdA", "share": 100, "verified": true } ], "ownership": { "frozen": true, "delegated": true, "delegate": "EyiXmcBXxDV2syys241KeuaQcZkv5ge18r1dBEMNS4Rr", "ownership_model": "single", "owner": "3ZxvgtSZXeDTfZNBq6Awi7xsCLXcP95ZSDHt51SKgypX" }, "supply": { "print_max_supply": 0, "print_current_supply": 0, "edition_nonce": 255 }, "mutable": true, "burnt": false }, { "interface": "Custom", "id": "JEEqUNmR1EDmDrwZUL3L49cciBQUP264BrNAkyGS3Zoc", "content": { "$schema": "https://schema.metaplex.com/nft1.0.json", "json_uri": "https://famousfoxes.com/metadata/5978.json", "files": [ { "uri": "https://famousfoxes.com/hd/5978.png", "mime": "image/png" } ], "metadata": { "attributes": [ { "value": "Orange", "trait_type": "Background" }, { "value": "Sweater Light", "trait_type": "Outfit" }, { "value": "Natural", "trait_type": "Skin" }, { "value": "Smirk", "trait_type": "Mouth" }, { "value": "Sportsband", "trait_type": "Head" }, { "value": "Mutated", "trait_type": "Eyes" } ``` -------------------------------- ### Install TypeScript Globally Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/solana/yellowstone-grpc/overview/typescript Before running TypeScript code examples, Node.js is required. This command installs TypeScript globally on your system, enabling the `tsc` command for compilation. ```Shell npm install -g typescript ``` -------------------------------- ### Check Node.js Installation Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/marketplace-addons/goldrush-wallet-api/overview Verify if Node.js is installed on your system and check its version. Node.js v18 and up is required to run the JavaScript code examples for the GoldRush Wallet API. ```JavaScript node -v ``` -------------------------------- ### Run Local Webhook Server Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/streams/destinations/webhooks/deploy These commands show how to start the previously created webhook server locally. Ensure all dependencies are installed and the server file is in the current directory before execution. ```Shell node server.js ``` ```Shell go run main.go ``` ```Shell python app.py ``` -------------------------------- ### Check Node.js Version Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ipfs/getting-started Command-line instruction to verify the installed Node.js version, required for executing JavaScript code examples. ```bash node -v ``` -------------------------------- ### Substrate API Sidecar Documentation Reference Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/polkadot/system_chain Reference to the Substrate API Sidecar documentation, which provides a RESTful interface for interacting with Substrate-based chains like Polkadot, simplifying common operations. ```APIDOC Substrate API Sidecar: accounts-accountId-asset-approvals ``` -------------------------------- ### Install Python 'requests' Library Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ethereum/goldrush-wallet-api/overview This command uses pip, Python's package installer, to install the 'requests' library. The 'requests' library is essential for making HTTP requests in Python and is a prerequisite for running the Python code examples. ```bash python -m pip install requests ``` -------------------------------- ### Check Node.js Version for JavaScript Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/avalanche/goldrush-wallet-api/overview This command verifies the installed version of Node.js, ensuring it meets the minimum requirement (v18 and up) for running JavaScript code examples. ```bash node -v ``` -------------------------------- ### /eth/v1/events RPC Method API Documentation Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ethereum/eth-v1-events Detailed API documentation for the /eth/v1/events RPC method, outlining its required parameters and the comprehensive structure of the data returned. This method facilitates real-time subscriptions to various beacon node event types. ```APIDOC /eth/v1/events RPC Method Parameters: topics: Type: string Required: REQUIRED Description: The event types to subscribe to. The available values: head, block, attestation, voluntary_exit, finalized_checkpoint, chain_reorg, contribution_and_proof. Returns: data: Description: The object with the following values: slot: Type: string Description: The corresponding slot block: Type: string Description: The information about the specified block state: Type: string Description: The activation state current_duty_dependent_root: Type: string Description: The current duty dependent root previous_duty_dependent_root: Type: string Description: The previous duty dependent root epoch_transition: Type: boolean Description: The epoch transition execution_optimistic: Type: boolean Description: It's true if the response references an unverified execution payload. The optimistic information may be invalidated at a later time. If the field is not present, assume the false value ``` -------------------------------- ### Check Node.js Version Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/storage/getting-started Command to verify the installed Node.js version. Node.js v18 and up is required to run JavaScript code examples for the IPFS REST API. ```JavaScript node -v ``` -------------------------------- ### eth_subscribe API Documentation Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/kaia/eth_subscribe Details the parameters and return values for the `eth_subscribe` method, which allows clients to subscribe to various blockchain events. ```APIDOC eth_subscribe: Parameters: subscription name: Type: string Description: The type of event you want to subscribe to (i.e., newHeads, logs). Supported Subscription Types: newHeads: Description: It fires a notification each time a new header is appended to the chain, including chain reorganizations. logs: Description: It returns logs that are included in new imported blocks and match the given filter criteria. data: Type: object Description: The arguments such as an address, multiple addresses, and topics. Note, only logs that are created from these addresses or match the specified topics will return logs. Returns: result: Type: string (hex encoded subscription ID) Description: The hex encoded subscription ID. This ID will be attached to all received events and can also be used to cancel the subscription using eth_unsubscribe. ``` -------------------------------- ### Example: Get Burnchain Rewards with cURL Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/stacks/v1/extended-v1-burnchain-rewards Demonstrates how to make a GET request to the `/extended/v1/burnchain/rewards` endpoint using cURL to retrieve burnchain reward data. ```bash curl -X 'GET' \ 'https://docs-demo.stacks-mainnet.quiknode.pro/extended/v1/burnchain/rewards' \ -H 'Content-Type: application/json' ``` -------------------------------- ### system_chain RPC Method API Reference Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/polkadot/system_chain Provides details on the `system_chain` RPC method, including its parameters and the structure of its return value. ```APIDOC system_chain RPC Method: Parameters: This method does not accept any parameters. Returns: result: string Description: The name of the chain ``` -------------------------------- ### Initialize Web3 Provider for QuickNode Endpoint in Python Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/fuse/eth_call Shows how to initialize a Web3.py provider connected to a QuickNode endpoint, which is a prerequisite for making further RPC calls to the blockchain. ```python from web3 import Web3, HTTPProvider w3 = Web3(HTTPProvider('https://docs-demo.fuse-flash.quiknode.pro/')) ``` -------------------------------- ### Verify Ruby Installation Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/starknet Checks the installed version of Ruby, which is required to run Ruby code examples. Users should consult the official Ruby installation documentation for detailed setup instructions. ```Bash ruby -v ``` -------------------------------- ### Quicknode API Documentation Structure and Endpoints Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ethereum/eth-v1-node-syncing This snippet outlines the hierarchical structure of Quicknode's API documentation, listing major API categories and providing a detailed enumeration of endpoints available under the Ethereum Beacon API. It serves as a reference for navigating the various functionalities offered by Quicknode's infrastructure. ```APIDOC Core API: Ethereum JSON-RPC API Beacon API: /eth/v1/beacon/blocks/{block_id}/attestations /eth/v1/beacon/blocks/{block_id}/root /eth/v1/beacon/blob_sidecars/{{block_id}} /eth/v1/beacon/genesis /eth/v1/beacon/headers /eth/v1/beacon/headers/{block_id} /eth/v1/beacon/pool/voluntary_exits /eth/v1/beacon/states/{state_id}/committees /eth/v1/beacon/states/{state_id}/finality_checkpoints /eth/v1/beacon/states/{state_id}/fork /eth/v1/beacon/states/{state_id}/pending_consolidations /eth/v1/beacon/states/{state_id}/root /eth/v1/beacon/states/{state_id}/sync_committees /eth/v1/beacon/states/{state_id}/validator_balances /eth/v1/beacon/states/{state_id}/validators /eth/v1/beacon/states/{state_id}/validators/{validator_id} /eth/v1/beacon/rewards/sync_committee/{block_id} /eth/v1/beacon/rewards/blocks/{block_id} /eth/v1/beacon/rewards/attestations/{epoch} /eth/v1/config/deposit_contract /eth/v1/config/fork_schedule /eth/v1/config/spec /eth/v1/events /eth/v1/node/peer_count /eth/v1/node/peers /eth/v1/node/syncing /eth/v1/node/version /eth/v1/validator/aggregate_attestation /eth/v1/validator/blinded_blocks/{slot} /eth/v1/validator/duties/attester/{epoch} /eth/v1/validator/duties/proposer/{epoch} /eth/v1/validator/duties/sync/{epoch} /eth/v1/validator/sync_committee_contribution /eth/v2/beacon/blocks/{block_id} /eth/v2/debug/beacon/states/{state_id} Erigon JSON RPC API Trace API Debug API Otterscan JSON-RPC API Token API NFT API Marketplace Add-Ons Error Codes ``` -------------------------------- ### Verify Ruby Installation Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/console-api Checks the installed version of Ruby, which is required to run Ruby code examples. Refer to the official Ruby installation documentation for more details on setup. ```bash ruby -v ``` -------------------------------- ### Make Generic RPC Call with QuickNode SDK (JavaScript) Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/fuse/eth_call This JavaScript example shows how to use the QuickNode SDK to perform a generic RPC call. It initializes the SDK with an endpoint URL and then uses the `client.call` method to send a transaction-like request, logging the response. ```JavaScript import { Core } from '@quicknode/sdk' const core = new Core({ endpointUrl: "https://docs-demo.fuse-flash.quiknode.pro/", }) core.client .call({ account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', }) .then(res => console.log(res)) ``` -------------------------------- ### Quicknode Ethereum Beacon API Endpoints Reference Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ethereum/eth-v1-events A comprehensive list of available endpoints for the Quicknode Ethereum Beacon API, detailing various operations related to blocks, states, rewards, configuration, node information, and validator duties. This reference helps developers understand the available API calls for interacting with the Ethereum Beacon Chain. ```APIDOC Beacon API Endpoints: - /eth/v1/beacon/blocks/{block_id}/attestations - /eth/v1/beacon/blocks/{block_id}/root - /eth/v1/beacon/blob_sidecars/{{block_id}} - /eth/v1/beacon/genesis - /eth/v1/beacon/headers - /eth/v1/beacon/headers/{block_id} - /eth/v1/beacon/pool/voluntary_exits - /eth/v1/beacon/states/{state_id}/committees - /eth/v1/beacon/states/{state_id}/finality_checkpoints - /eth/v1/beacon/states/{state_id}/fork - /eth/v1/beacon/states/{state_id}/pending_consolidations - /eth/v1/beacon/states/{state_id}/root - /eth/v1/beacon/states/{state_id}/sync_committees - /eth/v1/beacon/states/{state_id}/validator_balances - /eth/v1/beacon/states/{state_id}/validators - /eth/v1/beacon/states/{state_id}/validators/{validator_id} - /eth/v1/beacon/rewards/sync_committee/{block_id} - /eth/v1/beacon/rewards/blocks/{block_id} - /eth/v1/beacon/rewards/attestations/{epoch} - /eth/v1/config/deposit_contract - /eth/v1/config/fork_schedule - /eth/v1/config/spec - /eth/v1/events - /eth/v1/node/peer_count - /eth/v1/node/peers - /eth/v1/node/syncing - /eth/v1/node/version - /eth/v1/validator/aggregate_attestation - /eth/v1/validator/blinded_blocks/{slot} - /eth/v1/validator/duties/attester/{epoch} - /eth/v1/validator/duties/proposer/{epoch} - /eth/v1/validator/duties/sync/{epoch} - /eth/v1/validator/sync_committee_contribution - /eth/v2/beacon/blocks/{block_id} - /eth/v2/debug/beacon/states/{state_id} ``` -------------------------------- ### Verify cURL Installation Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/avalanche/goldrush-wallet-api/overview This command checks if cURL is installed on your system and displays its help message, confirming its availability for transferring data with URLs. ```bash curl -h ``` -------------------------------- ### Check cURL Installation Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/storage/getting-started Command to verify if cURL is installed on a *nix based system. cURL is a command-line tool for transferring data with URLs. ```cURL curl -h ``` -------------------------------- ### API Parameters for Asset Search and Retrieval Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/solana/searchAssets This section details the various parameters available for querying and filtering assets, including options for sorting, pagination, and additional data retrieval. ```APIDOC negate: boolean Description: Whether the search criteria should be inverted conditionType: string Description: Indicates whether to retrieve all or any asset that matches the search criteria. Possible Values: "all", "any" interface: string Description: The interface of the asset. Possible Values: "V1_NFT", "V1_PRINT", "LEGACY_NFT", "V2_NFT", "FungibleAsset", "FungibleToken", "Custom", "Identity", "Executable", "ProgrammableNFT", "MplCoreAsset", "MplCoreCollection" ownerAddress: string Description: The address of the owner ownerType: string Description: Type of ownership. Possible Values: "single", "token" creatorAddress: string Description: The address of the creator creatorVerified: boolean Description: Whether the creator is be verified authorityAddress: string Description: The address of the authority grouping: array of arrays Description: The group (key, value) pairs delegateAddress: string Description: The address of the delegate frozen: boolean Description: Whether the asset is frozen supply: integer Description: The supply of the asset supplyMint: string Description: The address of the supply mint compressed: boolean Description: Whether the asset is compressed compressible: boolean Description: Whether an asset is compressible royaltyTargetType: string Description: Type of royalty. Possible Values: "creators", "fanout", "single" royaltyTarget: string Description: The address for royalties royaltyAmount: integer Description: The royalties amount burnt: boolean Description: Whether the asset is burnt options: object Description: Optional flags which can be used to return additional information about an asset Properties: showFungible: boolean Description: Whether to return token_info object about an asset showCollectionMetadata: boolean Description: Whether to return the collection metadata sortBy: object Description: Sorting Criteria. Properties: sortBy: string Description: The criteria to sort by - can be one of "created", "updated", "recentAction", "none" Possible Values: "created", "updated", "recentAction", "none" sortDirection: string Description: Can be one of "asc", "desc" Possible Values: "asc", "desc" limit: integer Description: The maximum number of assets to retrieve cursor: string Description: The cursor from which to continue returning paginated results page: integer Description: The index of the page to retrieve. The page parameter starts at 1 before: string Description: Retrieve assets before the specified id after: string Description: Retrieve assets after the specified id jsonUri: string Description: The value for the JSON URI ``` -------------------------------- ### Install QuickNode SDK Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/avalanche To run the QuickNode SDK code examples, you need to have the QuickNode SDK installed. This command installs the SDK using npm. ```npm npm install @quicknode/sdk ``` -------------------------------- ### Ethereum JSON-RPC API Reference Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/ethereum/eth-v1-beacon-blocks-block_id-attestations An overview of the standard Ethereum JSON-RPC API methods available through Quicknode. This section links to the detailed documentation for methods like eth_accounts. ```APIDOC Refer to the detailed documentation for specific methods: /docs/ethereum/eth_accounts ``` -------------------------------- ### Install Yellowstone gRPC Node.js Package Source: https://www.quicknode.com/docs/marketplace-addons/getting-started/solana/yellowstone-grpc/overview/typescript This command installs the `@triton-one/yellowstone-grpc` package, which is necessary for interacting with the Yellowstone gRPC Geyser Plugin in Node.js and TypeScript projects. ```Shell npm install @triton-one/yellowstone-grpc ```