listLatestTransactions Query
パラメータ
このメソッドはパラメータを受け付けません
返します
データ
オブジェクト
読み込み中...
取引
オブジェクト
読み込み中...
nodes
配列
読み込み中...
id
文字列
読み込み中...
inputs
配列
読み込み中...
__typename
文字列
読み込み中...
owner
文字列
読み込み中...
utxoId
文字列
読み込み中...
金額
文字列
読み込み中...
assetId
文字列
読み込み中...
outputs
配列
読み込み中...
__typename
文字列
読み込み中...
~へ
文字列
読み込み中...
金額
文字列
読み込み中...
assetId
文字列
読み込み中...
ステータス
オブジェクト
読み込み中...
__typename
文字列
読み込み中...
リクエスト
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 LatestTransactions { transactions(last: 5) { nodes { id 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 } } status { __typename ... on FailureStatus { reason programState { returnType } } } } } }"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 LatestTransactions { transactions(last: 5) { nodes { id 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 } } status { __typename ... on FailureStatus { reason programState { returnType } } } } } }"6}'
1const LATEST_TRANSACTIONS_QUERY = `2query LatestTransactions {3transactions(last: 5) {4nodes {5id6inputs {7__typename8... on InputCoin {9owner10utxoId11金額12assetId13}14... on InputContract {15utxoId16contractId17}18... on InputMessage {19sender20recipient21金額22データ23}24}25outputs {26__typename27... on CoinOutput {28~へ29金額30assetId31}32... on ContractOutput {33inputIndex34balanceRoot35stateRoot36}37... on ChangeOutput {38~へ39金額40assetId41}42... on VariableOutput {43~へ44金額45assetId46}47... on ContractCreated {48契約49stateRoot50}51}52status {53__typename54... on FailureStatus {55reason56programState {57returnType58}59}60}61}62}63}64`;6566const fetchLatestTransactions = async () => {67try {68const response = await fetch('https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql', {69method: 'POST',70headers: {71'Accept': 'application/json',72'Content-Type': 'application/json',73},74body: JSON.stringify({75query: LATEST_TRANSACTIONS_QUERY,76}),77});7879if (!response.ok) {80throw new Error(`HTTP error! status: ${response.status}`);81}8283const result = await response.json();84console.log('Latest Transactions:', result.data.transactions.nodes);85} catch (error) {86console.error('Error fetching latest transactions:', error);87}88};8990fetchLatestTransactions();91
1const LATEST_TRANSACTIONS_QUERY = `2query LatestTransactions {3transactions(last: 5) {4nodes {5id6inputs {7__typename8... on InputCoin {9owner10utxoId11金額12assetId13}14... on InputContract {15utxoId16contractId17}18... on InputMessage {19sender20recipient21金額22データ23}24}25outputs {26__typename27... on CoinOutput {28~へ29金額30assetId31}32... on ContractOutput {33inputIndex34balanceRoot35stateRoot36}37... on ChangeOutput {38~へ39金額40assetId41}42... on VariableOutput {43~へ44金額45assetId46}47... on ContractCreated {48契約49stateRoot50}51}52status {53__typename54... on FailureStatus {55reason56programState {57returnType58}59}60}61}62}63}64`;6566const fetchLatestTransactions = async () => {67try {68const response = await fetch('https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql', {69method: 'POST',70headers: {71'Accept': 'application/json',72'Content-Type': 'application/json',73},74body: JSON.stringify({75query: LATEST_TRANSACTIONS_QUERY,76}),77});7879if (!response.ok) {80throw new Error(`HTTP error! status: ${response.status}`);81}8283const result = await response.json();84console.log('Latest Transactions:', result.data.transactions.nodes);85} catch (error) {86console.error('Error fetching latest transactions:', error);87}88};8990fetchLatestTransactions();91
1const myHeaders = new Headers();2myHeaders.append("Accept", "application/json");3myHeaders.append("Content-Type", "application/json");45const raw = JSON.stringify({6"query": "query LatestTransactions { transactions(last: 5) { nodes { id 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 } } status { __typename ... on FailureStatus { reason programState { returnType } } } } } }"7});89const requestOptions = {10method: "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.catch((エラー) => コンソール.エラー(エラー));
1const myHeaders = new Headers();2myHeaders.append("Accept", "application/json");3myHeaders.append("Content-Type", "application/json");45const raw = JSON.stringify({6"query": "query LatestTransactions { transactions(last: 5) { nodes { id 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 } } status { __typename ... on FailureStatus { reason programState { returnType } } } } } }"7});89const requestOptions = {10method: "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.catch((エラー) => コンソール.エラー(エラー));
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_TRANSACTIONS_QUERY = gql`15query LatestTransactions {16transactions(last: 5) {17nodes {18id19inputs {20__typename21... on InputCoin {22owner23utxoId24金額25assetId26}27... on InputContract {28utxoId29contractId30}31... on InputMessage {32sender33recipient34金額35データ36}37}38outputs {39__typename40... on CoinOutput {41~へ42金額43assetId44}45... on ContractOutput {46inputIndex47balanceRoot48stateRoot49}50... on ChangeOutput {51~へ52金額53assetId54}55... on VariableOutput {56~へ57金額58assetId59}60... on ContractCreated {61契約62stateRoot63}64}65status {66__typename67... on FailureStatus {68reason69programState {70returnType71}72}73}74}75}76}77`;7879client.query({80query: LATEST_TRANSACTIONS_QUERY81})82.then(result => {83console.log('Latest Transactions:', JSON.stringify(result.data, null, 2));84})85.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_TRANSACTIONS_QUERY = gql`15query LatestTransactions {16transactions(last: 5) {17nodes {18id19inputs {20__typename21... on InputCoin {22owner23utxoId24金額25assetId26}27... on InputContract {28utxoId29contractId30}31... on InputMessage {32sender33recipient34金額35データ36}37}38outputs {39__typename40... on CoinOutput {41~へ42金額43assetId44}45... on ContractOutput {46inputIndex47balanceRoot48stateRoot49}50... on ChangeOutput {51~へ52金額53assetId54}55... on VariableOutput {56~へ57金額58assetId59}60... on ContractCreated {61契約62stateRoot63}64}65status {66__typename67... on FailureStatus {68reason69programState {70returnType71}72}73}74}75}76}77`;7879client.query({80query: LATEST_TRANSACTIONS_QUERY81})82.then(result => {83console.log('Latest Transactions:', JSON.stringify(result.data, null, 2));84})85.catch(error => console.error('Error:', error));
1import リクエスト2import json34url = "https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql"56ペイロード = json.dumps({7"query": "query LatestTransactions { transactions(last: 5) { nodes { id 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 } } status { __typename ... on FailureStatus { reason programState { returnType } } } } } }"8})9ヘッダー = {10「承諾」: 'application/json',11「Content-Type」: 'application/json'12}1314回答 = リクエスト.リクエスト("POST", url, headers=headers, データ=ペイロード)1516印刷(レスポンス.text)
1import リクエスト2import json34url = "https://docs-demo.fuel-mainnet.quiknode.pro/v1/graphql"56ペイロード = json.dumps({7"query": "query LatestTransactions { transactions(last: 5) { nodes { id 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 } } status { __typename ... on FailureStatus { reason programState { returnType } } } } } }"8})9ヘッダー = {10「承諾」: 'application/json',11「Content-Type」: 'application/json'12}1314回答 = リクエスト.リクエスト("POST", url, headers=headers, データ=ペイロード)1516印刷(レスポンス.text)
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)11request["Accept"] = "application/json"12リクエスト["Content-Type"] = "application/json"13リクエスト.本文 = JSON.dump({14"query": "query LatestTransactions { transactions(last: 5) { nodes { id 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 } } status { __typename ... on FailureStatus { reason programState { returnType } } } } } }"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)11request["Accept"] = "application/json"12リクエスト["Content-Type"] = "application/json"13リクエスト.本文 = JSON.dump({14"query": "query LatestTransactions { transactions(last: 5) { nodes { id 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 } } status { __typename ... on FailureStatus { reason programState { returnType } } } } } }"15})1617回答 = https.リクエスト(リクエスト)18レスポンスを格納する.read_body19