listLatestBlocks Query
पैरामीटर
block
पूर्णांक
आवश्यक
लोड हो रहा है...
रिटर्न
डेटा
वस्तु
लोड हो रहा है...
blocks
वस्तु
लोड हो रहा है...
nodes
सरणी
लोड हो रहा है...
पहचान
डोरी
लोड हो रहा है...
transactions
सरणी
लोड हो रहा है...
पहचान
डोरी
लोड हो रहा है...
inputAssetIds
सरणी
लोड हो रहा है...
inputs
सरणी
लोड हो रहा है...
__typename
डोरी
लोड हो रहा है...
owner
डोरी
लोड हो रहा है...
utxoId
डोरी
लोड हो रहा है...
मात्रा
डोरी
लोड हो रहा है...
assetId
डोरी
लोड हो रहा है...
outputs
सरणी
लोड हो रहा है...
__typename
डोरी
लोड हो रहा है...
inputIndex
डोरी
लोड हो रहा है...
balanceRoot
डोरी
लोड हो रहा है...
stateRoot
डोरी
लोड हो रहा है...
को
डोरी
लोड हो रहा है...
मात्रा
डोरी
लोड हो रहा है...
assetId
डोरी
लोड हो रहा है...
अनुरोध
1curl --location 'https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql' \2--header 'Accept: application/json' \3--header 'Content-Type: application/json' \4--data '{5"query": "query LatestBlocks { blocks(last: 5) { nodes { id transactions { id inputAssetIds inputs { __typename ... on InputCoin { owner utxoId amount assetId } ... on InputContract { utxoId contractId } ... on InputMessage { sender recipient amount data } } outputs { __typename ... on CoinOutput { to amount assetId } ... on ContractOutput { inputIndex balanceRoot stateRoot } ... on ChangeOutput { to amount assetId } ... on VariableOutput { to amount assetId } ... on ContractCreated { contract stateRoot } } } } } }"6}'
1curl --location 'https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql' \2--header 'Accept: application/json' \3--header 'Content-Type: application/json' \4--data '{5"query": "query LatestBlocks { blocks(last: 5) { nodes { id transactions { id inputAssetIds inputs { __typename ... on InputCoin { owner utxoId amount assetId } ... on InputContract { utxoId contractId } ... on InputMessage { sender recipient amount data } } outputs { __typename ... on CoinOutput { to amount assetId } ... on ContractOutput { inputIndex balanceRoot stateRoot } ... on ChangeOutput { to amount assetId } ... on VariableOutput { to amount assetId } ... on ContractCreated { contract stateRoot } } } } } }"6}'
1const LATEST_BLOCKS_QUERY = `2query LatestBlocks {3blocks(last: 5) {4nodes {5पहचान6transactions {7पहचान8inputAssetIds9inputs {10__typename11... on InputCoin {12owner13utxoId14मात्रा15assetId16}17... on InputContract {18utxoId19contractId20}21... on InputMessage {22sender23recipient24मात्रा25डेटा26}27}28outputs {29__typename30... on CoinOutput {31को32मात्रा33assetId34}35... on ContractOutput {36inputIndex37balanceRoot38stateRoot39}40... on ChangeOutput {41को42मात्रा43assetId44}45... on VariableOutput {46को47मात्रा48assetId49}50... on ContractCreated {51contract52stateRoot53}54}55}56}57}58}59`;6061const fetchLatestBlocks = async () => {62try {63const response = await fetch('https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql', {64method: 'POST',65headers: {66'Accept': 'application/json',67'Content-Type': 'application/json',68},69body: JSON.stringify({70query: LATEST_BLOCKS_QUERY,71}),72});7374if (!response.ok) {75throw new Error(`HTTP error! status: ${response.status}`);76}7778const result = await response.json();79console.log('Latest Blocks:', result.data.blocks.nodes);80} catch (error) {81console.error('Error fetching latest blocks:', error);82}83} ;8485fetchLatestBlocks();86
1const LATEST_BLOCKS_QUERY = `2query LatestBlocks {3blocks(last: 5) {4nodes {5पहचान6transactions {7पहचान8inputAssetIds9inputs {10__typename11... on InputCoin {12owner13utxoId14मात्रा15assetId16}17... on InputContract {18utxoId19contractId20}21... on InputMessage {22sender23recipient24मात्रा25डेटा26}27}28outputs {29__typename30... on CoinOutput {31को32मात्रा33assetId34}35... on ContractOutput {36inputIndex37balanceRoot38stateRoot39}40... on ChangeOutput {41को42मात्रा43assetId44}45... on VariableOutput {46को47मात्रा48assetId49}50... on ContractCreated {51contract52stateRoot53}54}55}56}57}58}59`;6061const fetchLatestBlocks = async () => {62try {63const response = await fetch('https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql', {64method: 'POST',65headers: {66'Accept': 'application/json',67'Content-Type': 'application/json',68},69body: JSON.stringify({70query: LATEST_BLOCKS_QUERY,71}),72});7374if (!response.ok) {75throw new Error(`HTTP error! status: ${response.status}`);76}7778const result = await response.json();79console.log('Latest Blocks:', result.data.blocks.nodes);80} catch (error) {81console.error('Error fetching latest blocks:', error);82}83} ;8485fetchLatestBlocks();86
1const myHeaders = नया हेडर ( ) ;2myHeaders.append("Accept", "application/json");3myHeaders.append ( "Content- Type " , "application/json" ) ;45स्थिर कच्चा = JSON.stringify ( {6"query": "query LatestBlocks { blocks(last: 5) { nodes { id transactions { id inputAssetIds inputs { __typename ... on InputCoin { owner utxoId amount assetId } ... on InputContract { utxoId contractId } ... on InputMessage { sender recipient amount data } } outputs { __typename ... on CoinOutput { to amount assetId } ... on ContractOutput { inputIndex balanceRoot stateRoot } ... on ChangeOutput { to amount assetId } ... on VariableOutput { to amount assetId } ... on ContractCreated { contract stateRoot } } } } } }"7} ) ;89const requestOptions = {10तरीका : "डाक" ,11हेडर : मेरे हेडर ,12शरीर : कच्चा ,13पुनर्निर्देशन : "अनुसरण करना"14} ;1516fetch("https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql", requestOptions)17फिर ( ( प्रतिक्रिया ) = > प्रतिक्रिया.पाठ ( ) )18फिर ( ( परिणाम ) => कंसोल.लॉग ( परिणाम )19. कैच ( ( त्रुटि ) => कंसोल.त्रुटि ( त्रुटि ) ) ;
1const myHeaders = नया हेडर ( ) ;2myHeaders.append("Accept", "application/json");3myHeaders.append ( "Content- Type " , "application/json" ) ;45स्थिर कच्चा = JSON.stringify ( {6"query": "query LatestBlocks { blocks(last: 5) { nodes { id transactions { id inputAssetIds inputs { __typename ... on InputCoin { owner utxoId amount assetId } ... on InputContract { utxoId contractId } ... on InputMessage { sender recipient amount data } } outputs { __typename ... on CoinOutput { to amount assetId } ... on ContractOutput { inputIndex balanceRoot stateRoot } ... on ChangeOutput { to amount assetId } ... on VariableOutput { to amount assetId } ... on ContractCreated { contract stateRoot } } } } } }"7} ) ;89const requestOptions = {10तरीका : "डाक" ,11हेडर : मेरे हेडर ,12शरीर : कच्चा ,13पुनर्निर्देशन : "अनुसरण करना"14} ;1516fetch("https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql", requestOptions)17फिर ( ( प्रतिक्रिया ) = > प्रतिक्रिया.पाठ ( ) )18फिर ( ( परिणाम ) => कंसोल.लॉग ( परिणाम )19. कैच ( ( त्रुटि ) => कंसोल.त्रुटि ( त्रुटि ) ) ;
1const { ApolloClient, InMemoryCache, gql } = require('@apollo/client/core');2const fetch = require('cross-fetch');34const client = new ApolloClient({5uri: 'https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql',6cache: new InMemoryCache(),7fetch: fetch,8headers: {9'Accept': 'application/json',10'Content-Type': 'application/json'11}12} ) ;1314const LATEST_BLOCKS_QUERY = gql`15query LatestBlocks {16blocks(last: 5) {17nodes {18पहचान19transactions {20पहचान21inputAssetIds22inputs {23__typename24... on InputCoin {25owner26utxoId27मात्रा28assetId29}30... on InputContract {31utxoId32contractId33}34... on InputMessage {35sender36recipient37मात्रा38डेटा39}40}41outputs {42__typename43... on CoinOutput {44को45मात्रा46assetId47}48... on ContractOutput {49inputIndex50balanceRoot51stateRoot52}53... on ChangeOutput {54को55मात्रा56assetId57}58... on VariableOutput {59को60मात्रा61assetId62}63... on ContractCreated {64contract65stateRoot66}67}68}69}70}71}72`;7374client.query({75query: LATEST_BLOCKS_QUERY76} )77.then(result => {78console.log('Latest Blocks:', JSON.stringify(result.data, null, 2));79} )80.catch(error => console.error('Error:', error));
1const { ApolloClient, InMemoryCache, gql } = require('@apollo/client/core');2const fetch = require('cross-fetch');34const client = new ApolloClient({5uri: 'https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql',6cache: new InMemoryCache(),7fetch: fetch,8headers: {9'Accept': 'application/json',10'Content-Type': 'application/json'11}12} ) ;1314const LATEST_BLOCKS_QUERY = gql`15query LatestBlocks {16blocks(last: 5) {17nodes {18पहचान19transactions {20पहचान21inputAssetIds22inputs {23__typename24... on InputCoin {25owner26utxoId27मात्रा28assetId29}30... on InputContract {31utxoId32contractId33}34... on InputMessage {35sender36recipient37मात्रा38डेटा39}40}41outputs {42__typename43... on CoinOutput {44को45मात्रा46assetId47}48... on ContractOutput {49inputIndex50balanceRoot51stateRoot52}53... on ChangeOutput {54को55मात्रा56assetId57}58... on VariableOutput {59को60मात्रा61assetId62}63... on ContractCreated {64contract65stateRoot66}67}68}69}70}71}72`;7374client.query({75query: LATEST_BLOCKS_QUERY76} )77.then(result => {78console.log('Latest Blocks:', JSON.stringify(result.data, null, 2));79} )80.catch(error => console.error('Error:', error));
1आयात अनुरोध2आयात करें json34url = "https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql"56पेलोड = json . डंप्स ( {7"query": "query LatestBlocks { blocks(last: 5) { nodes { id transactions { id inputAssetIds inputs { __typename ... on InputCoin { owner utxoId amount assetId } ... on InputContract { utxoId contractId } ... on InputMessage { sender recipient amount data } } outputs { __typename ... on CoinOutput { to amount assetId } ... on ContractOutput { inputIndex balanceRoot stateRoot } ... on ChangeOutput { to amount assetId } ... on VariableOutput { to amount assetId } ... on ContractCreated { contract stateRoot } } } } } }"8} )9हेडर = {10'Accept': 'application/json',11'सामग्री प्रकार' : 'एप्लिकेशन/जेसन'12}1314प्रतिक्रिया = अनुरोध.अनुरोध ( " POST " , यूआरएल , हेडर = हेडर , डेटा = पेलोड )1516प्रिंट ( प्रतिक्रिया . पाठ )17
1आयात अनुरोध2आयात करें json34url = "https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql"56पेलोड = json . डंप्स ( {7"query": "query LatestBlocks { blocks(last: 5) { nodes { id transactions { id inputAssetIds inputs { __typename ... on InputCoin { owner utxoId amount assetId } ... on InputContract { utxoId contractId } ... on InputMessage { sender recipient amount data } } outputs { __typename ... on CoinOutput { to amount assetId } ... on ContractOutput { inputIndex balanceRoot stateRoot } ... on ChangeOutput { to amount assetId } ... on VariableOutput { to amount assetId } ... on ContractCreated { contract stateRoot } } } } } }"8} )9हेडर = {10'Accept': 'application/json',11'सामग्री प्रकार' : 'एप्लिकेशन/जेसन'12}1314प्रतिक्रिया = अनुरोध.अनुरोध ( " POST " , यूआरएल , हेडर = हेडर , डेटा = पेलोड )1516प्रिंट ( प्रतिक्रिया . पाठ )17
1ज़रूरत होना "उरी"2ज़रूरत होना "जेसन"3ज़रूरत होना "नेट/http"45url = URI("https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql")67https = Net :: HTTP . new ( url . host , url . port )8https . use_ssl = सत्य910अनुरोध = नेट :: एचटीटीपी :: पोस्ट.नया ( यूआरएल )11request["Accept"] = "application/json"12अनुरोध [ "सामग्री-प्रकार" ] = "एप्लिकेशन/जेसन"13अनुरोध.बॉडी = JSON . डंप ( {14"query": "query LatestBlocks { blocks(last: 5) { nodes { id transactions { id inputAssetIds inputs { __typename ... on InputCoin { owner utxoId amount assetId } ... on InputContract { utxoId contractId } ... on InputMessage { sender recipient amount data } } outputs { __typename ... on CoinOutput { to amount assetId } ... on ContractOutput { inputIndex balanceRoot stateRoot } ... on ChangeOutput { to amount assetId } ... on VariableOutput { to amount assetId } ... on ContractCreated { contract stateRoot } } } } } }"15} )1617प्रतिक्रिया = https . अनुरोध ( अनुरोध )18puts response . read_body19
1ज़रूरत होना "उरी"2ज़रूरत होना "जेसन"3ज़रूरत होना "नेट/http"45url = URI("https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql")67https = Net :: HTTP . new ( url . host , url . port )8https . use_ssl = सत्य910अनुरोध = नेट :: एचटीटीपी :: पोस्ट.नया ( यूआरएल )11request["Accept"] = "application/json"12अनुरोध [ "सामग्री-प्रकार" ] = "एप्लिकेशन/जेसन"13अनुरोध.बॉडी = JSON . डंप ( {14"query": "query LatestBlocks { blocks(last: 5) { nodes { id transactions { id inputAssetIds inputs { __typename ... on InputCoin { owner utxoId amount assetId } ... on InputContract { utxoId contractId } ... on InputMessage { sender recipient amount data } } outputs { __typename ... on CoinOutput { to amount assetId } ... on ContractOutput { inputIndex balanceRoot stateRoot } ... on ChangeOutput { to amount assetId } ... on VariableOutput { to amount assetId } ... on ContractCreated { contract stateRoot } } } } } }"15} )1617प्रतिक्रिया = https . अनुरोध ( अनुरोध )18puts response . read_body19
अब तक कोई खाता नहीं है?
कुछ ही सेकंड में अपना क्विकनोड एंडपॉइंट बनाएं और निर्माण शुरू करें।
मुफ़्त में शुरुआत करें