OptionalephemeralE: stringOptionalephemeralStaticcreateOptionalcustomSplit: AmountLike[]StaticcreateOptionalcustomSplit: AmountLike[]StaticcreateOptionalcustomSplit: AmountLike[]StaticcreateStaticcreateStaticcreateStaticdeserializeReconstructs concrete OutputData from its JSON-safe representation.
CTSError If any field fails validation (non-canonical blindingFactor, malformed hex secret/ephemeralE, or an Amount that cannot be parsed).
OutputData.serialize for the persist/restore lifecycle example.
StaticserializeConverts output data to a JSON-safe representation.
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 ?? []);
StaticsumCalculates the sum of amounts in an array of OutputDataLike objects.
Array of OutputDataLike objects.
The total sum of amounts.
Minimum interface for an output data object. OutputData helpers only require keyset
idandkeys. Custom implementations must satisfy this interface to be used with wallet operations.