@nftx/subgraph
v4.0.1
Published
This package contains utilities for interacting with subgraphs, built on top of `@nftx/query`
Downloads
448
Readme
@nftx/subgraph
This package contains utilities for interacting with subgraphs, built on top of @nftx/query
import { createQuery, querySubgraph } from '@nftx/subgraph';
import type { NftxV3 } from '@nftx/types';
import { Network, NFTX_SUBGRAPH } from '@nftx/constants';
const query = createQuery<NftxV3.Query>()
.vaults.first(1000)
.where((w) => [w.vaultId.is('0'), w.shutdownDate.is(0)])
.select((vault) => [
vault.id,
vault.vaultId,
vault.is1155,
vault.token((token) => [token.id, token.name, token.symbol]),
]);
const data = await querySubgraph({
url: NFTX_SUBGRAPH[Network.Mainnet],
query,
});