Off-chain client SDK for Polkadot Bulletin Chain with PAPI integration.
import { AsyncBulletinClient } from '@parity/bulletin-sdk';
import { createClient } from 'polkadot-api';
import { getWsProvider } from 'polkadot-api/ws';
// Setup PAPI
const wsProvider = getWsProvider('ws://localhost:9944');
const papiClient = createClient(wsProvider);
const api = papiClient.getTypedApi(/* chain descriptors */);
// Create client
const client = new AsyncBulletinClient(api, signer);
// Store data using builder pattern
const result = await client.store(data).send();
console.log('Stored with CID:', result.cid.toString());See the examples directory for more usage patterns.
npm install @parity/bulletin-sdk
# or
yarn add @parity/bulletin-sdk# Install dependencies
npm install
# Build
npm run build
# Unit tests
npm run test:unit
# Integration tests (requires running node)
npm run test:integrationComplete documentation: docs/book
The SDK book contains:
- Detailed API reference
- Concepts (authorization, chunking, manifests)
- Usage examples and best practices
- PAPI integration guide
- Browser & Node.js usage
- CID calculation (Raw, DAG-PB, DAG-CBOR codecs)
- Automatic chunking (default 1 MiB, configurable)
- DAG-PB manifest generation (IPFS-compatible)
- Authorization management (
authorizeAccount,authorizePreimage) - Data renewal (
renew) - Progress tracking callbacks
- Builder pattern API
- Mock client for testing
- TypeScript types throughout
- Browser & Node.js compatible
GPL-3.0-or-later WITH Classpath-exception-2.0