Skip to content

Commit

Permalink
chore: remove get Transactions indexers API
Browse files Browse the repository at this point in the history
  • Loading branch information
davidp94 committed Apr 16, 2024
1 parent 7ee2e96 commit 25cb157
Showing 1 changed file with 0 additions and 165 deletions.
165 changes: 0 additions & 165 deletions indexers/indexers-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,171 +152,6 @@ await fetch(GRAPHQL_ENDPOINT, {

<div ref="refGetBalance"/>

## 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
});
```

:::

<div ref="refGetTransaction"/>

## Get Gas Fee

::: code-group
Expand Down

0 comments on commit 25cb157

Please sign in to comment.