aleph-indexer-sdk
Version:
TypeScript SDK for Aleph Indexer GraphQL API
41 lines (29 loc) • 2.06 kB
Markdown
```
██╗███╗ ██╗██████╗ ███████╗██╗ ██╗███████╗██████╗ ███████╗██████╗ ██╗ ██╗
██║████╗ ██║██╔══██╗██╔════╝╚██╗██╔╝██╔════╝██╔══██╗ ██╔════╝██╔══██╗██║ ██╔╝
██║██╔██╗ ██║██║ ██║█████╗ ╚███╔╝ █████╗ ██████╔╝ ███████╗██║ ██║█████╔╝
██║██║╚██╗██║██║ ██║██╔══╝ ██╔██╗ ██╔══╝ ██╔══██╗ ╚════██║██║ ██║██╔═██╗
██║██║ ╚████║██████╔╝███████╗██╔╝ ██╗███████╗██║ ██║ ███████║██████╔╝██║ ██╗
╚═╝╚═╝ ╚═══╝╚═════╝ ╚══════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚══════╝╚═════╝ ╚═╝ ╚═╝
```
TypeScript SDK for Aleph Indexer GraphQL API.
```bash
npm install aleph-indexer-sdk graphql-request
```
```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...' })
```
```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)
```