diff --git a/indexers/indexers-api.md b/indexers/indexers-api.md index b4dcbcd74..fd1638594 100644 --- a/indexers/indexers-api.md +++ b/indexers/indexers-api.md @@ -152,171 +152,6 @@ await fetch(GRAPHQL_ENDPOINT, {
-## Get Activity History - -::: code-group - -```javascript [EVM Chain] -const GRAPHQL_ENDPOINT = "https://gql-router.xdefi.services/graphql"; -const query = `query GetTransactions($address: String!, $first: Int, $after: String) { - ${chain.key} { // [!code highlight] - transactions(address: $address, first: $first, after: $after) { - edges { - node { - blockNumber - hash - status - timestamp - transfers { - amount { - value - } - fromAddress - toAddress - } - } - } - pageInfo { - hasNextPage - hasPreviousPage - } - } - } -}`; - -await fetch(GRAPHQL_ENDPOINT, { - method: "POST", - headers: { - "Content-Type": "application/json", - "apollographql-client-name": "docs-indexers-api", - "apollographql-client-version": "v1.0", - }, - body: JSON.stringify({ - query, - variables: { - address: address // Input address // [!code highlight] - first: 1, - after: null, - }, - }), -}) - .then((response) => response.json()) - .then((result) => { - console.log(result); - // Do something with the result - }); -``` - -```javascript [CosmosChain] -const GRAPHQL_ENDPOINT = "https://gql-router.xdefi.services/graphql"; -const query = `query GetTransactions($address: String!, $first: Int, $after: String) { - ${chain.key} { // [!code highlight] - transactions(address: $address, first: $first, after: $after) { - edges { - node { - blockHeight - hash - signers - status - timestamp - transfers { - amount { - value - } - fromAddress - toAddress - } - } - } - pageInfo { - hasPreviousPage - hasNextPage - } - } - } -}`; - -await fetch(GRAPHQL_ENDPOINT, { - method: "POST", - headers: { - "Content-Type": "application/json", - "apollographql-client-name": "docs-indexers-api", - "apollographql-client-version": "v1.0", - }, - body: JSON.stringify({ - query, - variables: { - address: address // Input address // [!code highlight] - first: 1, - after: null, - }, - }), -}) - .then((response) => response.json()) - .then((result) => { - console.log(result); - // Do something with the result - }); -``` - -```javascript [Other Chain] -const GRAPHQL_ENDPOINT = "https://gql-router.xdefi.services/graphql"; -const query = `query GetTransactions($address: String!, $first: Int!, $after: String) { - ${chain.key} { // [!code highlight] - transactionsV3(address: $address, first: $first, after: $after) { - edges { - node { - blockNumber - hash - status - timestamp - inputs { - amount { - value - } - address - } - outputs { - amount { - value - } - address - } - } - } - pageInfo { - hasNextPage - hasPreviousPage - } - } - } -}`; - -await fetch(GRAPHQL_ENDPOINT, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - query, - variables: { - address: address // Input address // [!code highlight] - first: 1, - after: null, - }, - }), -}) - .then((response) => response.json()) - .then((result) => { - console.log(result); - // Do something with the result - }); -``` - -::: - -
- ## Get Gas Fee ::: code-group