listLatestBlocks Query
매개변수
블록
정수
필수
로딩 중...
반품
데이터
객체
로딩 중...
blocks
객체
로딩 중...
nodes
배열
로딩 중...
id
문자열
로딩 중...
거래
배열
로딩 중...
id
문자열
로딩 중...
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--헤더 'Content-Type: application/json' \4--데이터 '{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--데이터 '{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 {5id6transactions {7id8inputAssetIds9inputs {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 {51계약52stateRoot53}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 {5id6transactions {7id8inputAssetIds9inputs {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 {51계약52stateRoot53}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 = new Headers();2myHeaders.append("Accept", "application/json");3myHeaders.추가("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리디렉션: "팔로우"14};1516fetch("https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql", requestOptions)17.그런 다음((응답) => 응답.text())18.그런 다음((결과) => console.log(result))19.catchcatch ((오류) => console.오류(오류));
1const myHeaders = new Headers();2myHeaders.append("Accept", "application/json");3myHeaders.추가("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리디렉션: "팔로우"14};1516fetch("https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql", requestOptions)17.그런 다음((응답) => 응답.text())18.그런 다음((결과) => console.log(result))19.catchcatch ((오류) => console.오류(오류));
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'수락': 'application/json',10'Content-Type': 'application/json'11}12});1314const LATEST_BLOCKS_QUERY = gql`15query LatestBlocks {16blocks(last: 5) {17nodes {18id19transactions {20id21inputAssetIds22inputs {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 {64계약65stateRoot66}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'수락': 'application/json',10'Content-Type': 'application/json'11}12});1314const LATEST_BLOCKS_QUERY = gql`15query LatestBlocks {16blocks(last: 5) {17nodes {18id19transactions {20id21inputAssetIds22inputs {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 {64계약65stateRoot66}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));
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, 헤더=헤더, 데이터=페이로드)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, 헤더=헤더, 데이터=페이로드)1516인쇄(응답.text)17
1require "uri"2require "json"3require "net/http"45url = URI("https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql")67https = Net::HTTP.new(url.호스트, url.포트)8https.use_ssl = true910요청 = 순::HTTP::POST.새(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 = Net::HTTP.new(url.호스트, url.포트)8https.use_ssl = true910요청 = 순::HTTP::POST.새(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