Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,17 @@ export default {
"script",
{},
`
window.chatbaseConfig = {
chatbotId: "",
window.embeddedChatbotConfig = {
chatbotId: "EQaK-bS8IoS60vEkoYKQm",
domain: "www.chatbase.co"
}
`,
],
[
"script",
{
src: "https://www.chatbase.co/embed.min.js",
chatbotId: "EQaK-bS8IoS60vEkoYKQm",
id: "",
defer: true,
},
Expand Down
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