@chaindex/priorityfee
v0.1.3
Published
TypeScript SDK for the Chaindex Priority Fee API
Downloads
13
Readme
@chaindex/priorityfee
TypeScript SDK for the Chaindex Priority Fee API.
Install
npm install @chaindex/priorityfee
# or
pnpm add @chaindex/priorityfeeQuick Start
import { HttpClient } from '@chaindex/priorityfee'
const client = new HttpClient({ apiKey: 'your-api-key' })
const rolling = await client.rolling.get({ duration: '15m', detail: 'full' })
console.log(rolling)WebSocket
import { WsClient } from '@chaindex/priorityfee'
const ws = new WsClient({ apiKey: 'your-api-key' })
const sub = await ws.subscribeRolling(
{ duration: '15m', detail: 'full' },
{
onData: (data) => console.log(data),
onError: (err) => console.error(err),
},
)
// Later: sub.unsubscribe()API Overview
The HttpClient exposes the following resources:
| Resource | Description |
| ----------------- | ------------------------------ |
| client.block | Per-block priority fee data |
| client.rolling | Rolling window aggregations |
| client.tumbling | Tumbling window aggregations |
The WsClient supports real-time subscriptions via subscribeBlock, subscribeRolling, and subscribeDemo.
Requirements
- Node.js >= 22
