// given a bolt11 meltQuote...
const { quote, change } = await wallet.ops.meltBolt11(meltQuote, myProofs).run();
meltQuote using myProofs// given a bolt12 meltQuote...
const { quote, change } = await wallet.ops
.meltBolt12(meltQuote, myProofs)
.asDeterministic() // counter=0 => auto-reserve
.onCountersReserved((info) => console.log('Reserved', info))
.run();
prepare()const preview = await wallet.ops.meltBolt11(meltQuote, myProofs).asDeterministic().prepare();
// Persist `preview` if you want to retry safely later.
const { quote, change } = await wallet.completeMelt(preview);
prepare() creates the MeltPreview and any NUT-08 blanks without paying yet.run() is equivalent to const preview = await prepare(); await wallet.completeMelt(preview).prefer_async)For mints that support NUT-06 async melts, .prepare() pairs with OutputData.serialize to
persist the change-output blanks while the payment is in flight, and wallet.createMeltChangeProofs
reconstructs change proofs once the quote is paid.
import { OutputData, type SerializedOutputData } from '@cashu/cashu-ts';
const preview = await wallet.ops.meltBolt11(meltQuote, myProofs).asDeterministic().prepare();
const stored = JSON.stringify(preview.outputData.map((o) => OutputData.serialize(o)));
await wallet.completeMelt(preview, undefined, true); // preferAsync = true
// ... later, once the quote is paid ...
const restored = (JSON.parse(stored) as SerializedOutputData[]).map((s) =>
OutputData.deserialize(s),
);
const change = wallet.createMeltChangeProofs(restored, paidQuote.change ?? []);
For custom payment methods (e.g., BACS, SWIFT), use the generic wallet methods directly:
wallet.createMeltQuote(method, ...), wallet.checkMeltQuote(method, ...),
wallet.meltProofs(method, ...), or the two-step wallet.prepareMelt(method, ...) /
wallet.completeMelt(...). See Melt Token – Custom Methods for examples.