@acurast/indexer
v0.0.2
Published
JSON-RPC client for the [Acurast Indexer](https://indexer.acurast.com).
Readme
@acurast/indexer
JSON-RPC client for the Acurast Indexer.
Query blocks, extrinsics, events, jobs, epochs, storage snapshots, metrics, and commitments.
Installation
npm install @acurast/indexerUsage
v2 RPC client (recommended)
import { AcurastRpcIndexer } from '@acurast/indexer'
const indexer = new AcurastRpcIndexer({
apiKey: 'YOUR_API_KEY',
// baseUrl: 'https://indexer.acurast.com', // optional
})
const blocks = await indexer.getBlocks({ limit: 10 })
const commitments = await indexer.getCommitments({ limit: 50 })Raw v1 client
import { createRawIndexer } from '@acurast/indexer'
const raw = createRawIndexer({ baseUrl: 'https://indexer.acurast.com', apiKey: 'YOUR_API_KEY' })Helpers
computeJobDetailsFromExtrinsics(extrinsics) derives a job's status, schedule, replicas, and report stats from a list of extrinsics.
License
ISC — Papers AG
