Polkadot Apps
    Preparing search index...

    Low-level transport interface for statement store communication.

    Two built-in implementations:

    • HostTransport — uses the Host API's native binary protocol (inside containers).
    • RpcTransport — uses @novasamatech/sdk-statement over @polkadot-api/substrate-client (outside containers).

    Most consumers should use StatementStoreClient instead of this interface directly.

    interface StatementTransport {
        destroy(): void;
        query?(
            filter: SdkTopicFilter,
        ): Promise<
            Partial<
                {
                    channel: SizedHex<32>;
                    data: Uint8Array;
                    decryptionKey: SizedHex<32>;
                    expiry: bigint;
                    proof: Proof;
                    topics: SizedHex<32>[];
                },
            >[],
        >;
        signAndSubmit(
            statement: Statement,
            credentials: ConnectionCredentials,
        ): Promise<void>;
        subscribe(
            filter: SdkTopicFilter,
            onStatements: (
                statements: Partial<
                    {
                        channel: SizedHex<32>;
                        data: Uint8Array;
                        decryptionKey: SizedHex<32>;
                        expiry: bigint;
                        proof: Proof;
                        topics: SizedHex<32>[];
                    },
                >[],
            ) => void,
            onError: (error: Error) => void,
        ): Unsubscribable;
    }
    Index

    Methods

    • Query existing statements from the store.

      Only available on RpcTransport (the host API subscription replays initial state). Returns undefined on HostTransport.

      Parameters

      Returns Promise<
          Partial<
              {
                  channel: SizedHex<32>;
                  data: Uint8Array;
                  decryptionKey: SizedHex<32>;
                  expiry: bigint;
                  proof: Proof;
                  topics: SizedHex<32>[];
              },
          >[],
      >

    • Sign and submit a statement.

      • Host mode: delegates to the host API's createProof then submit.
      • Local mode: signs locally using getStatementSigner from sdk-statement, then submits.

      Parameters

      • statement: Statement

        The unsigned statement to sign and submit.

      • credentials: ConnectionCredentials

        Signing credentials (host accountId or local signer).

      Returns Promise<void>

    • Subscribe to statements matching a topic filter.

      Parameters

      • filter: SdkTopicFilter

        sdk-statement topic filter.

      • onStatements: (
            statements: Partial<
                {
                    channel: SizedHex<32>;
                    data: Uint8Array;
                    decryptionKey: SizedHex<32>;
                    expiry: bigint;
                    proof: Proof;
                    topics: SizedHex<32>[];
                },
            >[],
        ) => void

        Called with batches of received statements.

      • onError: (error: Error) => void

        Called when the subscription encounters an error.

      Returns Unsubscribable

      A handle to unsubscribe.