UNPKG

aleph-indexer-sdk

Version:

TypeScript SDK for Aleph Indexer GraphQL API

41 lines (29 loc) 2.06 kB
``` ██╗███╗ ██╗██████╗ ███████╗██╗ ██╗███████╗██████╗ ███████╗██████╗ ██╗ ██╗ ██║████╗ ██║██╔══██╗██╔════╝╚██╗██╔╝██╔════╝██╔══██╗ ██╔════╝██╔══██╗██║ ██╔╝ ██║██╔██╗ ██║██║ ██║█████╗ ╚███╔╝ █████╗ ██████╔╝ ███████╗██║ ██║█████╔╝ ██║██║╚██╗██║██║ ██║██╔══╝ ██╔██╗ ██╔══╝ ██╔══██╗ ╚════██║██║ ██║██╔═██╗ ██║██║ ╚████║██████╔╝███████╗██╔╝ ██╗███████╗██║ ██║ ███████║██████╔╝██║ ██╗ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚══════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚══════╝╚═════╝ ╚═╝ ╚═╝ ``` # Indexer SDK TypeScript SDK for Aleph Indexer GraphQL API. ## Install ```bash npm install aleph-indexer-sdk graphql-request ``` ## Usage ### SDK Client ```typescript import { AlephIndexerClient } from 'aleph-indexer-sdk' const client = new AlephIndexerClient('http://localhost:8080/v1/graphql') const vaults = await client.GetAllVaults() const managerVaults = await client.GetVaultsByManager({ manager: '0x123...' }) ``` ### Custom Queries ```typescript import { GraphQLClient } from 'graphql-request' import { GetAllVaultsDocument, type GetAllVaultsQuery } from 'aleph-indexer-sdk' const client = new GraphQLClient('http://localhost:8080/v1/graphql') const result = await client.request<GetAllVaultsQuery>(GetAllVaultsDocument) ```