Cashu-TS - v4.0.0-rc3
    Preparing search index...

    Type Alias SigAllApiExperimental

    Helpers for SigAll multi-party signing coordination.

    type SigAllApi = {
        computeDigests: (
            inputs: Pick<Proof, "secret" | "C">[],
            outputs: SerializedBlindedMessage[],
            quoteId?: string,
        ) => SigAllDigests;
        deserializePackage: (
            input: string,
            options?: { validateDigest?: boolean },
        ) => SigAllSigningPackage;
        extractMeltPackage: <TQuote extends Pick<MeltQuoteBaseResponse, "quote">>(
            preview: MeltPreview<TQuote>,
        ) => SigAllSigningPackage;
        extractSwapPackage: (preview: SwapPreview) => SigAllSigningPackage;
        mergeMeltPackage: <TQuote extends Pick<MeltQuoteBaseResponse, "quote">>(
            pkg: SigAllSigningPackage,
            preview: MeltPreview<TQuote>,
        ) => MeltPreview<TQuote>;
        mergeSwapPackage: (
            pkg: SigAllSigningPackage,
            preview: SwapPreview,
        ) => SwapPreview;
        serializePackage: (pkg: SigAllSigningPackage) => string;
        signDigest: (hexDigest: string, privkey: string) => string;
        signPackage: (
            pkg: SigAllSigningPackage,
            privkey: string,
        ) => SigAllSigningPackage;
    }
    Index

    Properties

    computeDigests: (
        inputs: Pick<Proof, "secret" | "C">[],
        outputs: SerializedBlindedMessage[],
        quoteId?: string,
    ) => SigAllDigests

    Computes legacy and current SIG_ALL formats.

    Type Declaration

      • (
            inputs: Pick<Proof, "secret" | "C">[],
            outputs: SerializedBlindedMessage[],
            quoteId?: string,
        ): SigAllDigests
      • Parameters

        • inputs: Pick<Proof, "secret" | "C">[]

          Proof array.

        • outputs: SerializedBlindedMessage[]

          Array of SerializedBlindMessage (NUT-00 BlindMessages).

        • OptionalquoteId: string

          Optional quote ID for melt transactions.

        Returns SigAllDigests

        Object with legacy, and current digests (all hex strings)

    Returns hex-encoded SHA256 digests for each format to support multi-format signing.

    deserializePackage: (
        input: string,
        options?: { validateDigest?: boolean },
    ) => SigAllSigningPackage

    Accepts a sigallA-prefixed base64url string and rehydrates it into a SigAllSigningPackage.

    extractMeltPackage: <TQuote extends Pick<MeltQuoteBaseResponse, "quote">>(
        preview: MeltPreview<TQuote>,
    ) => SigAllSigningPackage

    Extracts a signing package from a MeltPreview for multi-party SIG_ALL coordination.

    Type Declaration

    extractSwapPackage: (preview: SwapPreview) => SigAllSigningPackage

    Extracts a signing package from a SwapPreview for multi-party SIG_ALL coordination.

    Type Declaration

    This creates a minimal, serializable package that can be passed to other signers. Secrets and blinding factors are NOT included - only what's needed to reconstruct the exact SIG_ALL message and produce signatures.

    mergeMeltPackage: <TQuote extends Pick<MeltQuoteBaseResponse, "quote">>(
        pkg: SigAllSigningPackage,
        preview: MeltPreview<TQuote>,
    ) => MeltPreview<TQuote>

    Merges signatures from a signing package back into a MeltPreview.

    Type Declaration

    mergeSwapPackage: (
        pkg: SigAllSigningPackage,
        preview: SwapPreview,
    ) => SwapPreview

    Merges signatures from a signing package back into a SwapPreview.

    Type Declaration

    Injects collected signatures into the first proof's witness for mint submission. Call this after all parties have signed.

    serializePackage: (pkg: SigAllSigningPackage) => string

    Type Declaration

    Produces a deterministic JSON representation, base64url-encodes it and prefixes with sigallA for transport.

    • Field order is fixed and version field is always included for compatibility.
    • This enables consistent hashing and verification of package integrity.
    signDigest: (hexDigest: string, privkey: string) => string

    Signs a hex-encoded digest with a Schnorr key.

    signPackage: (
        pkg: SigAllSigningPackage,
        privkey: string,
    ) => SigAllSigningPackage

    Signs a SigAllSigningPackage and returns it with signatures attached.

    Type Declaration

    Collects signatures by signing legacy and current SIG_ALL formats for backward compatibility. Multiple parties can call this sequentially to aggregate signatures for multi-party signing.