Cashu-TS - v4.5.1
    Preparing search index...

    Class OutputData

    Minimum interface for an output data object. OutputData helpers only require keyset id and keys. Custom implementations must satisfy this interface to be used with wallet operations.

    Implements

    Index

    Constructors

    Properties

    blindedMessage: SerializedBlindedMessage
    blindingFactor: bigint
    ephemeralE?: string
    secret: Uint8Array

    Methods

    • Parameters

      • amount: AmountLike
      • seed: Uint8Array
      • counter: number
      • keysetId: string

      Returns OutputData

      May throw if blinding factor is out of range. Caller should catch, increment counter, and retry per BIP32-style derivation.

    • Converts output data to a JSON-safe representation.

      Parameters

      Returns SerializedOutputData

      Pair with OutputData.deserialize to persist prepared melt change outputs (e.g. across a NUT-06 async melt's pending window) and reconstruct spendable change proofs via wallet.createMeltChangeProofs once the quote is paid.

      // Save while async melt is pending:
      const preview = await wallet.prepareMelt('bolt11', meltQuote, proofs);
      const stored = JSON.stringify(preview.outputData.map((o) => OutputData.serialize(o)));
      await wallet.completeMelt(preview, undefined, { preferAsync: true });

      // ... time passes, quote pays ...
      const restored = (JSON.parse(stored) as SerializedOutputData[]).map((s) =>
      OutputData.deserialize(s),
      );
      const change = wallet.createMeltChangeProofs(restored, paidQuote.change ?? []);