Skip to content

Latest commit

 

History

History
77 lines (56 loc) · 1.71 KB

File metadata and controls

77 lines (56 loc) · 1.71 KB

Bulletin SDK for TypeScript

Off-chain client SDK for Polkadot Bulletin Chain with PAPI integration.

Quick Start

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.

Installation

npm install @parity/bulletin-sdk
# or
yarn add @parity/bulletin-sdk

Build & Test

# Install dependencies
npm install

# Build
npm run build

# Unit tests
npm run test:unit

# Integration tests (requires running node)
npm run test:integration

Documentation

Complete 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

Features

  • 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

License

GPL-3.0-or-later WITH Classpath-exception-2.0