Polkadot Apps
    Preparing search index...

    Ergonomic entry point for Bulletin Chain operations.

    Bundles a typed Bulletin API (from chain-client) and an IPFS gateway URL so callers don't need to re-pass them on every call.

    Both upload and query paths auto-resolve based on the environment:

    • Uploads — inside a host container the host preimage API signs and submits automatically; standalone falls back to a dev signer.
    • Queries (fetchBytes/fetchJson) — inside a host container the host preimage lookup (with caching) is used; standalone falls back to direct IPFS gateway HTTP fetch.
    const bulletin = await BulletinClient.create("paseo");
    // Auto-resolved signer (preimage in host, dev signer standalone):
    const result = await bulletin.upload(fileBytes);
    // Auto-resolved query (host lookup in container, gateway standalone):
    const metadata = await bulletin.fetchJson<Metadata>(result.cid);
    Index

    Properties

    gateway: string

    Methods

    • Check whether an account is authorized to store data on the Bulletin Chain.

      Use as a pre-flight check before upload to provide clear UX instead of letting the transaction fail mid-execution.

      Parameters

      • address: string

        SS58-encoded account address to check.

      Returns Promise<AuthorizationStatus>

      Authorization status with remaining quota.

      checkAuthorization for the standalone function equivalent.

    • Check if a CID exists on the gateway.

      Parameters

      • cid: string

      Returns Promise<boolean>

    • Fetch raw bytes by CID.

      Auto-resolves query path: host preimage lookup inside a container, direct IPFS gateway fetch standalone.

      Parameters

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • Build the full gateway URL for a CID.

      Parameters

      • cid: string

      Returns string

    • Upload data to the Bulletin Chain.

      Parameters

      • data: Uint8Array

        Raw bytes to store.

      • Optionalsigner: PolkadotSigner

        Optional signer. When omitted, auto-resolved (preimage in host, dev signer standalone).

      • Optionaloptions: Omit<UploadOptions, "gateway">

        Upload options (timeout, waitFor, status callback).

      Returns Promise<UploadResult>

    • Compute CID without uploading. Static — no instance needed.

      Parameters

      • data: Uint8Array

      Returns string

    • Reconstruct a CID from a 0x-prefixed hex hash. Static — no instance needed.

      Useful for converting on-chain hashes back to CIDs for IPFS gateway lookups. Pass optional hash algorithm and codec to match the on-chain CID configuration.

      Parameters

      Returns string

      hashToCid for full documentation.