@spec.dev/query
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Spec Query Client

JavaScript client for querying Spec's shared tables.

Installation

$ npm install @spec.dev/query

Quickstart

import { SpecQueryClient } from '@spec.dev/query'

// Client to query Spec's shared tables.
const client = new SpecQueryClient({ 
    apiKey: process.env.PROJECT_API_KEY
})

// Basic query for a specific block.
const { data } = await client.query('ethereum.blocks', {
    where: { number: 1000000 }
})

// Streaming query for all lens profiles.
await client.stream('lens.profiles', {}, async batch => {
    // batches of 1000 records.
})

License

MIT

Package Sidebar

Install

npm i @spec.dev/query

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

66.2 kB

Total Files

75

Last publish

Collaborators

  • whittlbc