listLatestBlocks Query
パラメータ
ブロック
整数
必須
読み込み中...
返品
データ
オブジェクト
読み込み中...
ブロック
オブジェクト
読み込み中...
ノード
配列
読み込み中...
id
文字列
読み込み中...
取引
配列
読み込み中...
id
文字列
読み込み中...
inputAssetIds
配列
読み込み中...
入力
配列
読み込み中...
__typename
文字列
読み込み中...
所有者
文字列
読み込み中...
utxoId
文字列
読み込み中...
金額
文字列
読み込み中...
assetId
文字列
読み込み中...
出力
配列
読み込み中...
__typename
文字列
読み込み中...
inputIndex
文字列
読み込み中...
balanceRoot
文字列
読み込み中...
stateRoot
文字列
読み込み中...
~へ
文字列
読み込み中...
金額
文字列
読み込み中...
assetId
文字列
読み込み中...
リクエスト
1curl --location 'https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql' \2--header 'Accept: application/json' \3--ヘッダー '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--ヘッダー '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 {5id6トランザクション {7id8inputAssetIds9inputs {10__typename11... InputCoin において {12所有者13utxoId14金額15assetId16}17... InputContract について {18utxoId19contractId20}21... InputMessage が発生したとき {22送信者23受取人24金額25データ26}27}28outputs {29__typename30... CoinOutput において {31~へ32金額33assetId34}35... ContractOutput において {36inputIndex37balanceRoot38stateRoot39}40... ChangeOutput において {41~へ42金額43assetId44}45... VariableOutput について {46~へ47金額48assetId49}50... ContractCreated イベントで {51契約52stateRoot53}54}55}56}57}58}59`;6061const fetchLatestBlocks = async () => {62試す {63const response = await fetch('https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql', {64メソッド: 'POST',65headers: {66「承諾」: 'application/json',67「Content-Type」: 'application/json',68},69body: JSON.stringify({70query: LATEST_BLOCKS_QUERY,71}),72});7374もし (!レスポンス.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 (エラー) {81console.error('Error fetching latest blocks:', error);82}83};8485fetchLatestBlocks();86
1const LATEST_BLOCKS_QUERY = `2query LatestBlocks {3blocks(last: 5) {4nodes {5id6トランザクション {7id8inputAssetIds9inputs {10__typename11... InputCoin において {12所有者13utxoId14金額15assetId16}17... InputContract について {18utxoId19contractId20}21... InputMessage が発生したとき {22送信者23受取人24金額25データ26}27}28outputs {29__typename30... CoinOutput において {31~へ32金額33assetId34}35... ContractOutput において {36inputIndex37balanceRoot38stateRoot39}40... ChangeOutput において {41~へ42金額43assetId44}45... VariableOutput について {46~へ47金額48assetId49}50... ContractCreated イベントで {51契約52stateRoot53}54}55}56}57}58}59`;6061const fetchLatestBlocks = async () => {62試す {63const response = await fetch('https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql', {64メソッド: 'POST',65headers: {66「承諾」: 'application/json',67「Content-Type」: 'application/json',68},69body: JSON.stringify({70query: LATEST_BLOCKS_QUERY,71}),72});7374もし (!レスポンス.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 (エラー) {81console.error('Error fetching latest blocks:', error);82}83};8485fetchLatestBlocks();86
1const myHeaders = new Headers();2myHeaders.append("Accept", "application/json");3myHeaders.append("Content-Type", "application/json");45const raw = 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メソッド: "POST",11ヘッダー: myHeaders,12本文: raw,13リダイレクト: "follow"14};1516fetch(「https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql」, requestOptions)17.その後((レスポンス) => レスポンス.text())18.その後((結果) => コンソール.log(result))19.catchcatch((エラー) => コンソール.エラー(エラー));
1const myHeaders = new Headers();2myHeaders.append("Accept", "application/json");3myHeaders.append("Content-Type", "application/json");45const raw = 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メソッド: "POST",11ヘッダー: myHeaders,12本文: raw,13リダイレクト: "follow"14};1516fetch(「https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql」, requestOptions)17.その後((レスポンス) => レスポンス.text())18.その後((結果) => コンソール.log(result))19.catchcatch((エラー) => コンソール.エラー(エラー));
1const { ApolloClient, InMemoryCache, gql } = require('@apollo/client/core');2const fetch = require('cross-fetch');34const クライアント = new ApolloClient({5uri: 『https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql』,6キャッシュ: new InMemoryCache:(),7fetch: fetch,8headers: {9「承諾」: 'application/json',10「Content-Type」: 'application/json'11}12});1314const LATEST_BLOCKS_QUERY = gql`15query LatestBlocks {16blocks(last: 5) {17ノード {18id19transactions {20id21inputAssetIds22inputs {23__typename24... on InputCoin {25所有者26utxoId27金額28assetId29}30... on InputContract {31utxoId32contractId33}34... on InputMessage {35送信者36受取人37金額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 {64契約65stateRoot66}67}68}69}70}71}72`;7374クライアント.クエリ({75query: LATEST_BLOCKS_QUERY76})77.その後(結果 => {78console.log('Latest Blocks:', JSON.stringify(result.data, null, 2));79})80.catchcatch(エラー => console.error('エラー:', エラー));
1const { ApolloClient, InMemoryCache, gql } = require('@apollo/client/core');2const fetch = require('cross-fetch');34const クライアント = new ApolloClient({5uri: 『https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql』,6キャッシュ: new InMemoryCache:(),7fetch: fetch,8headers: {9「承諾」: 'application/json',10「Content-Type」: 'application/json'11}12});1314const LATEST_BLOCKS_QUERY = gql`15query LatestBlocks {16blocks(last: 5) {17ノード {18id19transactions {20id21inputAssetIds22inputs {23__typename24... on InputCoin {25所有者26utxoId27金額28assetId29}30... on InputContract {31utxoId32contractId33}34... on InputMessage {35送信者36受取人37金額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 {64契約65stateRoot66}67}68}69}70}71}72`;7374クライアント.クエリ({75query: LATEST_BLOCKS_QUERY76})77.その後(結果 => {78console.log('Latest Blocks:', JSON.stringify(result.data, null, 2));79})80.catchcatch(エラー => console.error('エラー:', エラー));
1import リクエスト2import json34url = "https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql"56ペイロード = json.dumps({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「承諾」: 'application/json',11「Content-Type」: 'application/json'12}1314回答 = リクエスト.リクエスト("POST", url, headers=headers, データ=ペイロード)1516印刷(レスポンス.text)17
1import リクエスト2import json34url = "https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql"56ペイロード = json.dumps({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「承諾」: 'application/json',11「Content-Type」: 'application/json'12}1314回答 = リクエスト.リクエスト("POST", url, headers=headers, データ=ペイロード)1516印刷(レスポンス.text)17
1require "uri"2require "json"3require "net/http"45url = URI("https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql")67https = ネット::HTTP.new(url.ホスト, url.ポート)8https.use_ssl = true910リクエスト = ネット::HTTP::POST.new(URL)11リクエスト[「承諾」] = "application/json"12リクエスト["Content-Type"] = "application/json"13リクエスト.本文 = JSON.dump({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.リクエスト(リクエスト)18レスポンスを格納する.read_body19
1require "uri"2require "json"3require "net/http"45url = URI("https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql")67https = ネット::HTTP.new(url.ホスト, url.ポート)8https.use_ssl = true910リクエスト = ネット::HTTP::POST.new(URL)11リクエスト[「承諾」] = "application/json"12リクエスト["Content-Type"] = "application/json"13リクエスト.本文 = JSON.dump({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.リクエスト(リクエスト)18レスポンスを格納する.read_body19