mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
GITBOOK-242: Updated get datatoken information
This commit is contained in:
parent
1ea6904099
commit
2239ff66ca
@ -45,7 +45,7 @@
|
|||||||
* [Get data NFTs](developers/using-ocean-subgraph/list-data-nfts.md)
|
* [Get data NFTs](developers/using-ocean-subgraph/list-data-nfts.md)
|
||||||
* [Get data NFT Information](developers/using-ocean-subgraph/get-data-nft-information.md)
|
* [Get data NFT Information](developers/using-ocean-subgraph/get-data-nft-information.md)
|
||||||
* [Get datatokens](developers/using-ocean-subgraph/list-datatokens.md)
|
* [Get datatokens](developers/using-ocean-subgraph/list-datatokens.md)
|
||||||
* [Get Datatoken Information](developers/using-ocean-subgraph/get-datatoken-information.md)
|
* [Get datatoken Information](developers/using-ocean-subgraph/get-datatoken-information.md)
|
||||||
* [List Fixed Rate Exchanges](developers/using-ocean-subgraph/list-fixed-rate-exchanges.md)
|
* [List Fixed Rate Exchanges](developers/using-ocean-subgraph/list-fixed-rate-exchanges.md)
|
||||||
* [Ocean.py](developers/ocean.py/README.md)
|
* [Ocean.py](developers/ocean.py/README.md)
|
||||||
* [Page 1](developers/ocean.py/page-1.md)
|
* [Page 1](developers/ocean.py/page-1.md)
|
||||||
|
@ -12,15 +12,19 @@ Now that you are familiar with the process of retrieving a list of data NFTs
|
|||||||
|
|
||||||
The result of the following GraphQL query returns the information about a particular data NFT. In this example, `0x1c161d721e6d99f58d47f709cdc77025056c544c`.
|
The result of the following GraphQL query returns the information about a particular data NFT. In this example, `0x1c161d721e6d99f58d47f709cdc77025056c544c`.
|
||||||
|
|
||||||
PS: In this example, the query is executed on the Ocean subgraph deployed on the mainnet. If you want to change the network, please refer to [this table](../ocean-subgraph/#ocean-subgraph-deployments).
|
_PS: In this example, the query is executed on the Ocean subgraph deployed on the mainnet. If you want to change the network, please refer to_ [_this table_](../ocean-subgraph/#ocean-subgraph-deployments)_._
|
||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
{% tab title="Query" %}
|
{% tab title="Javascript" %}
|
||||||
Copy the query to fetch the information about a data NFT in the Ocean Subgraph [GraphiQL interface](https://v4.subgraph.mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql). If you want to fetch the information about another NFT, replace the `id` with the address of your choice.
|
The javascript below can be used to run the query and fetch the information of a data NFT. If you wish to change the network, replace the variable's value `network` as needed. Change the value of the variable `datanftAddress` with the address of your choice.
|
||||||
|
|
||||||
```graphql
|
```runkit nodeVersion="18.x.x"
|
||||||
{
|
var axios = require('axios');
|
||||||
nft (id:"0x1c161d721e6d99f58d47f709cdc77025056c544c", subgraphError:deny){
|
|
||||||
|
const datanftAddress = "0x1c161d721e6d99f58d47f709cdc77025056c544c";
|
||||||
|
|
||||||
|
const query = `{
|
||||||
|
nft (id:"${datanftAddress}", subgraphError:deny){
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
symbol
|
symbol
|
||||||
@ -41,7 +45,25 @@ Copy the query to fetch the information about a data NFT in the Ocean Subgraph [
|
|||||||
template
|
template
|
||||||
orderCount
|
orderCount
|
||||||
}
|
}
|
||||||
}
|
}`
|
||||||
|
|
||||||
|
const network = "mainnet"
|
||||||
|
var config = {
|
||||||
|
method: 'post',
|
||||||
|
url: `https://v4.subgraph.${network}.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph`,
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
data: JSON.stringify({ "query": query })
|
||||||
|
};
|
||||||
|
|
||||||
|
axios(config)
|
||||||
|
.then(function (response) {
|
||||||
|
let result = JSON.stringify(response.data)
|
||||||
|
console.log(result)
|
||||||
|
})
|
||||||
|
.catch(function (error) {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
|
||||||
```
|
```
|
||||||
{% endtab %}
|
{% endtab %}
|
||||||
|
|
||||||
@ -103,16 +125,12 @@ print(json.dumps(result, indent=4, sort_keys=True))
|
|||||||
</strong></code></pre>
|
</strong></code></pre>
|
||||||
{% endtab %}
|
{% endtab %}
|
||||||
|
|
||||||
{% tab title="Javascript" %}
|
{% tab title="Query" %}
|
||||||
The javascript below can be used to run the query and fetch the information of a data NFT. If you wish to change the network, replace the variable's value `network` as needed. Change the value of the variable `datanftAddress` with the address of your choice.
|
Copy the query to fetch the information about a data NFT in the Ocean Subgraph [GraphiQL interface](https://v4.subgraph.mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql). If you want to fetch the information about another NFT, replace the `id` with the address of your choice.
|
||||||
|
|
||||||
```runkit nodeVersion="18.x.x"
|
```graphql
|
||||||
var axios = require('axios');
|
{
|
||||||
|
nft (id:"0x1c161d721e6d99f58d47f709cdc77025056c544c", subgraphError:deny){
|
||||||
const datanftAddress = "0x1c161d721e6d99f58d47f709cdc77025056c544c";
|
|
||||||
|
|
||||||
const query = `{
|
|
||||||
nft (id:"${datanftAddress}", subgraphError:deny){
|
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
symbol
|
symbol
|
||||||
@ -133,25 +151,7 @@ const query = `{
|
|||||||
template
|
template
|
||||||
orderCount
|
orderCount
|
||||||
}
|
}
|
||||||
}`
|
}
|
||||||
|
|
||||||
const network = "mainnet"
|
|
||||||
var config = {
|
|
||||||
method: 'post',
|
|
||||||
url: `https://v4.subgraph.${network}.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph`,
|
|
||||||
headers: { "Content-Type": "application/json" },
|
|
||||||
data: JSON.stringify({ "query": query })
|
|
||||||
};
|
|
||||||
|
|
||||||
axios(config)
|
|
||||||
.then(function (response) {
|
|
||||||
let result = JSON.stringify(response.data)
|
|
||||||
console.log(result)
|
|
||||||
})
|
|
||||||
.catch(function (error) {
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
|
|
||||||
```
|
```
|
||||||
{% endtab %}
|
{% endtab %}
|
||||||
{% endtabs %}
|
{% endtabs %}
|
||||||
|
@ -1,16 +1,30 @@
|
|||||||
# Get Datatoken Information
|
---
|
||||||
|
description: >-
|
||||||
|
Explore the Power of Querying: Unveiling In-Depth Details of Individual
|
||||||
|
Datatokens
|
||||||
|
---
|
||||||
|
|
||||||
The result of following GraphQL query returns the information about a particular datatoken. Here, `0x122d10d543bc600967b4db0f45f80cb1ddee43eb` is the address of the datatoken.
|
# Get datatoken Information
|
||||||
|
|
||||||
{% hint style="info" %}
|
To fetch detailed information about a specific datatoken, you can utilize the power of GraphQL queries. By constructing a query tailored to your needs, you can access key parameters such as the datatoken's ID, name, symbol, total supply, creator, and associated dataTokenAddress. This allows you to gain a deeper understanding of the datatoken's characteristics and properties. With this information at your disposal, you can make informed decisions, analyze market trends, and explore the vast potential of datatokens within the Ocean ecosystem. Harness the capabilities of GraphQL and unlock a wealth of datatoken insights.
|
||||||
Copy the query in the [GraphiQL interface](https://v4.subgraph.mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) to fetch the results from the mainnet. For other networks use [this table](../ocean-subgraph/#ocean-subgraph-graphiql).
|
|
||||||
{% endhint %}
|
|
||||||
|
|
||||||
#### Query
|
|
||||||
|
|
||||||
```graphql
|
|
||||||
{
|
The result of the following GraphQL query returns the information about a particular datatoken. Here, `0x122d10d543bc600967b4db0f45f80cb1ddee43eb` is the address of the datatoken.
|
||||||
token(id:"0x122d10d543bc600967b4db0f45f80cb1ddee43eb", subgraphError: deny){
|
|
||||||
|
_PS: In this example, the query is executed on the Ocean subgraph deployed on the mainnet. If you want to change the network, please refer to_ [_this table_](../ocean-subgraph/#ocean-subgraph-deployments)_._
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab title="Javascript" %}
|
||||||
|
The javascript below can be used to run the query and fetch the information of a datatoken. If you wish to change the network, replace the variable's value `network` as needed. Change the value of the variable `datatokenAddress` with the address of your choice.
|
||||||
|
|
||||||
|
```runkit nodeVersion="18.x.x"
|
||||||
|
var axios = require('axios');
|
||||||
|
|
||||||
|
const datatokenAddress = "0x122d10d543bc600967b4db0f45f80cb1ddee43eb";
|
||||||
|
|
||||||
|
const query = `{
|
||||||
|
token(id:"${datatokenAddress}", subgraphError: deny){
|
||||||
id
|
id
|
||||||
symbol
|
symbol
|
||||||
nft {
|
nft {
|
||||||
@ -43,14 +57,30 @@ Copy the query in the [GraphiQL interface](https://v4.subgraph.mainnet.oceanprot
|
|||||||
price
|
price
|
||||||
active
|
active
|
||||||
}
|
}
|
||||||
}
|
}`
|
||||||
|
|
||||||
|
const network = "mainnet"
|
||||||
|
var config = {
|
||||||
|
method: 'post',
|
||||||
|
url: `https://v4.subgraph.${network}.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph`,
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
data: JSON.stringify({ "query": query })
|
||||||
|
};
|
||||||
|
|
||||||
|
axios(config)
|
||||||
|
.then(function (response) {
|
||||||
|
let result = JSON.stringify(response.data)
|
||||||
|
console.log(result);
|
||||||
|
})
|
||||||
|
.catch(function (error) {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
|
||||||
```
|
```
|
||||||
|
{% endtab %}
|
||||||
|
|
||||||
#### Code
|
|
||||||
|
|
||||||
{% tabs %}
|
|
||||||
{% tab title="Python" %}
|
{% tab title="Python" %}
|
||||||
The python script below can be used to run the the query. If you wish to change the network, then replace the value of variable `base_url` as needed. Change the value of the variable `datatoken_address` with the address of the datatoken of your choice.
|
The Python script below can be used to run the query and fetch a datatoken information. If you wish to change the network, replace the variable's value `base_url` as needed. Change the value of the variable `datatoken_address` with the address of the datatoken of your choice.
|
||||||
|
|
||||||
**Create script**
|
**Create script**
|
||||||
|
|
||||||
@ -119,19 +149,10 @@ print(json.dumps(result, indent=4, sort_keys=True))
|
|||||||
</strong></code></pre>
|
</strong></code></pre>
|
||||||
{% endtab %}
|
{% endtab %}
|
||||||
|
|
||||||
{% tab title="Javascript" %}
|
{% tab title="Query" %}
|
||||||
The javascript below can be used to run the the query. If you wish to change the network, then replace the value of variable `baseUrl` as needed. Change the value of the variable `datatokenAddress` with the address of the datatoken of your choice.
|
```
|
||||||
|
{
|
||||||
**Create script**
|
token(id:"0x122d10d543bc600967b4db0f45f80cb1ddee43eb", subgraphError: deny){
|
||||||
|
|
||||||
{% code title="datatokenInfo.js" %}
|
|
||||||
```javascript
|
|
||||||
var axios = require('axios');
|
|
||||||
|
|
||||||
const datatokenAddress = "0x122d10d543bc600967b4db0f45f80cb1ddee43eb";
|
|
||||||
|
|
||||||
const query = `{
|
|
||||||
token(id:"${datatokenAddress}", subgraphError: deny){
|
|
||||||
id
|
id
|
||||||
symbol
|
symbol
|
||||||
nft {
|
nft {
|
||||||
@ -164,35 +185,7 @@ const query = `{
|
|||||||
price
|
price
|
||||||
active
|
active
|
||||||
}
|
}
|
||||||
}`
|
}
|
||||||
|
|
||||||
const baseUrl = "https://v4.subgraph.mainnet.oceanprotocol.com"
|
|
||||||
const route = "/subgraphs/name/oceanprotocol/ocean-subgraph"
|
|
||||||
|
|
||||||
const url = `${baseUrl}${route}`
|
|
||||||
|
|
||||||
var config = {
|
|
||||||
method: 'post',
|
|
||||||
url: url,
|
|
||||||
headers: { "Content-Type": "application/json" },
|
|
||||||
data: JSON.stringify({ "query": query })
|
|
||||||
};
|
|
||||||
|
|
||||||
axios(config)
|
|
||||||
.then(function (response) {
|
|
||||||
console.log(JSON.stringify(response.data));
|
|
||||||
})
|
|
||||||
.catch(function (error) {
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
|
|
||||||
```
|
|
||||||
{% endcode %}
|
|
||||||
|
|
||||||
**Execute script**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
node datatokenInfo.js
|
|
||||||
```
|
```
|
||||||
{% endtab %}
|
{% endtab %}
|
||||||
{% endtabs %}
|
{% endtabs %}
|
||||||
|
@ -16,15 +16,17 @@ There are several options available to see this query in action. Below, you will
|
|||||||
2. Execute the query in Python by following the code snippet.
|
2. Execute the query in Python by following the code snippet.
|
||||||
3. Execute the query in JavaScript by clicking on the "Run" button of the Javascript tab.
|
3. Execute the query in JavaScript by clicking on the "Run" button of the Javascript tab.
|
||||||
|
|
||||||
PS: In these examples, the query is executed on the Ocean subgraph deployed on the mainnet. If you want to change the network, please refer to [this table](../ocean-subgraph/#ocean-subgraph-deployments).
|
_PS: In these examples, the query is executed on the Ocean subgraph deployed on the mainnet. If you want to change the network, please refer to_ [_this table_](../ocean-subgraph/#ocean-subgraph-deployments)_._
|
||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
{% tab title="Query" %}
|
{% tab title="Javascript" %}
|
||||||
Copy the query to fetch a list of data NFTs in the Ocean Subgraph [GraphiQL interface](https://v4.subgraph.mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql).
|
The javascript below can be used to run the query and retrieve a list of NFTs. If you wish to change the network, then replace the value of `network` variable as needed.
|
||||||
|
|
||||||
```graphql
|
```runkit nodeVersion="18.x.x"
|
||||||
{
|
const axios = require('axios')
|
||||||
nfts (skip:0, first: 10, subgraphError:degraphny){
|
|
||||||
|
const query = `{
|
||||||
|
nfts (skip:0, first: 10, subgraphError:deny){
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
symbol
|
symbol
|
||||||
@ -35,7 +37,21 @@ Copy the query to fetch a list of data NFTs in the Ocean Subgraph [GraphiQL inte
|
|||||||
block
|
block
|
||||||
transferable
|
transferable
|
||||||
}
|
}
|
||||||
|
}`
|
||||||
|
|
||||||
|
const network = "mainnet"
|
||||||
|
const config = {
|
||||||
|
method: 'post',
|
||||||
|
url: `https://v4.subgraph.${network}.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph`,
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
data: JSON.stringify({ query: query })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const response = await axios(config)
|
||||||
|
for (let nft of response.data.data.nfts) {
|
||||||
|
console.log(' id:' + nft.id + ' name: ' + nft.name + ' address: ' + nft.address)
|
||||||
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
{% endtab %}
|
{% endtab %}
|
||||||
|
|
||||||
@ -87,14 +103,12 @@ python list_dataNFTs.py
|
|||||||
```
|
```
|
||||||
{% endtab %}
|
{% endtab %}
|
||||||
|
|
||||||
{% tab title="Javascript" %}
|
{% tab title="Query" %}
|
||||||
The javascript below can be used to run the query and retrieve a list of NFTs. If you wish to change the network, then replace the value of `network` variable as needed.
|
Copy the query to fetch a list of data NFTs in the Ocean Subgraph [GraphiQL interface](https://v4.subgraph.mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql).
|
||||||
|
|
||||||
```runkit nodeVersion="18.x.x"
|
```graphql
|
||||||
const axios = require('axios')
|
{
|
||||||
|
nfts (skip:0, first: 10, subgraphError:degraphny){
|
||||||
const query = `{
|
|
||||||
nfts (skip:0, first: 10, subgraphError:deny){
|
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
symbol
|
symbol
|
||||||
@ -105,21 +119,7 @@ const query = `{
|
|||||||
block
|
block
|
||||||
transferable
|
transferable
|
||||||
}
|
}
|
||||||
}`
|
|
||||||
|
|
||||||
const network = "mainnet"
|
|
||||||
const config = {
|
|
||||||
method: 'post',
|
|
||||||
url: `https://v4.subgraph.${network}.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph`,
|
|
||||||
headers: { 'Content-Type': 'application/json' },
|
|
||||||
data: JSON.stringify({ query: query })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await axios(config)
|
|
||||||
for (let nft of response.data.data.nfts) {
|
|
||||||
console.log(' id:' + nft.id + ' name: ' + nft.name + ' address: ' + nft.address)
|
|
||||||
}
|
|
||||||
|
|
||||||
```
|
```
|
||||||
{% endtab %}
|
{% endtab %}
|
||||||
{% endtabs %}
|
{% endtabs %}
|
||||||
|
@ -4,20 +4,20 @@ description: 'Discover the World of datatokens: Retrieving a List of datatokens'
|
|||||||
|
|
||||||
# Get datatokens
|
# Get datatokens
|
||||||
|
|
||||||
The result of following GraphQL query returns the information about datatokens.
|
With your newfound knowledge of fetching data NFTs and retrieving the associated information, fetching a list of datatokens will be a breeze :ocean:. Building upon your understanding, let's now delve into the process of retrieving a list of datatokens. By applying similar techniques and leveraging the power of GraphQL queries, you'll be able to effortlessly navigate the landscape of datatokens and access the wealth of information they hold. So, let's dive right in and unlock the potential of exploring datatokens with ease and efficiency.
|
||||||
|
|
||||||
{% hint style="info" %}
|
|
||||||
Copy the query in the [GraphiQL interface](https://v4.subgraph.mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) to fetch the results from the mainnet. For other networks use [this table](../ocean-subgraph/#ocean-subgraph-graphiql).
|
|
||||||
{% endhint %}
|
|
||||||
|
|
||||||
#### Query
|
|
||||||
|
|
||||||
#### Code
|
_PS: In this example, the query is executed on the Ocean subgraph deployed on the mainnet. If you want to change the network, please refer to_ [_this table_](../ocean-subgraph/#ocean-subgraph-deployments)_._
|
||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
{% tab title="Query" %}
|
{% tab title="Javascript" %}
|
||||||
```graphql
|
The javascript below can be used to run the query. If you wish to change the network, replace the variable's value `network` as needed. 
|
||||||
{
|
|
||||||
|
```runkit nodeVersion="18.x.x"
|
||||||
|
var axios = require('axios');
|
||||||
|
|
||||||
|
const query = `{
|
||||||
tokens(skip:0, first: 2, subgraphError: deny){
|
tokens(skip:0, first: 2, subgraphError: deny){
|
||||||
id
|
id
|
||||||
symbol
|
symbol
|
||||||
@ -46,12 +46,30 @@ Copy the query in the [GraphiQL interface](https://v4.subgraph.mainnet.oceanprot
|
|||||||
lastPriceValue
|
lastPriceValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`
|
||||||
|
|
||||||
|
const network = "mainnet"
|
||||||
|
var config = {
|
||||||
|
method: 'post',
|
||||||
|
url: `https://v4.subgraph.${network}.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph`,
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
data: JSON.stringify({ "query": query })
|
||||||
|
};
|
||||||
|
|
||||||
|
axios(config)
|
||||||
|
.then(function (response) {
|
||||||
|
let result = JSON.stringify(response.data)
|
||||||
|
console.log(result);
|
||||||
|
})
|
||||||
|
.catch(function (error) {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
|
||||||
```
|
```
|
||||||
{% endtab %}
|
{% endtab %}
|
||||||
|
|
||||||
{% tab title="Python" %}
|
{% tab title="Python" %}
|
||||||
The python script below can be used to run the the query. If you wish to change the network, then replace the value of variable `base_url` as needed.
|
The Python script below can be used to run the query and fetch a list of datatokens. If you wish to change the network, then replace the value of the variable `base_url` as needed.
|
||||||
|
|
||||||
**Create script**
|
**Create script**
|
||||||
|
|
||||||
@ -115,16 +133,11 @@ python list_all_tokens.py
|
|||||||
```
|
```
|
||||||
{% endtab %}
|
{% endtab %}
|
||||||
|
|
||||||
{% tab title="Javascript" %}
|
{% tab title="Query" %}
|
||||||
The javascript below can be used to run the the query. If you wish to change the network, then replace the value of variable `baseUrl` as needed.
|
Copy the query to fetch a list of datatokens in the Ocean Subgraph [GraphiQL interface](https://v4.subgraph.mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql). 
|
||||||
|
|
||||||
**Create script**
|
```graphql
|
||||||
|
{
|
||||||
{% code title="listAllTokens.js" %}
|
|
||||||
```javascript
|
|
||||||
var axios = require('axios');
|
|
||||||
|
|
||||||
const query = `{
|
|
||||||
tokens(skip:0, first: 2, subgraphError: deny){
|
tokens(skip:0, first: 2, subgraphError: deny){
|
||||||
id
|
id
|
||||||
symbol
|
symbol
|
||||||
@ -153,34 +166,7 @@ const query = `{
|
|||||||
lastPriceValue
|
lastPriceValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}`
|
}
|
||||||
|
|
||||||
const baseUrl = "https://v4.subgraph.mainnet.oceanprotocol.com"
|
|
||||||
const route = "/subgraphs/name/oceanprotocol/ocean-subgraph"
|
|
||||||
|
|
||||||
const url = `${baseUrl}${route}`
|
|
||||||
|
|
||||||
var config = {
|
|
||||||
method: 'post',
|
|
||||||
url: url,
|
|
||||||
headers: { "Content-Type": "application/json" },
|
|
||||||
data: JSON.stringify({ "query": query })
|
|
||||||
};
|
|
||||||
|
|
||||||
axios(config)
|
|
||||||
.then(function (response) {
|
|
||||||
console.log(JSON.stringify(response.data));
|
|
||||||
})
|
|
||||||
.catch(function (error) {
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
```
|
|
||||||
{% endcode %}
|
|
||||||
|
|
||||||
**Execute script**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
node listAllTokens.js
|
|
||||||
```
|
```
|
||||||
{% endtab %}
|
{% endtab %}
|
||||||
{% endtabs %}
|
{% endtabs %}
|
||||||
|
Loading…
Reference in New Issue
Block a user