@cashu/cashu-ts
    Preparing search index...

    Class MeltBuilder

    Builder for melting proofs to pay a Lightning invoice or BOLT12 offer.

    Supports both BOLT11 and BOLT12. You can optionally receive a callback when NUT-08 blanks are created for async melts.

    // Basic BOLT11 melt
    await wallet.ops.meltBolt11(quote, proofs).run();

    // BOLT12 melt with deterministic change and NUT-08 blanks callback
    await wallet.ops
    .meltBolt12(quote12, proofs)
    .asDeterministic() // counter 0 auto reserves
    .onChangeOutputsCreated((blanks) => {
    // Persist blanks and retry later with wallet.completeMelt(blanks)
    })
    .onCountersReserved((info) => console.log('Reserved', info))
    .run();
    Index

    Constructors

    Methods

    • Use deterministic outputs for change.

      Parameters

      • counter: number = 0

        Starting counter. Zero means auto reserve using the wallet’s CounterSource.

      • Optionaldenoms: number[]

        Optional custom split. Can be partial if you only need SOME specific amounts.

      Returns MeltBuilder

    • Use random blinding for change outputs.

      Parameters

      • Optionaldenoms: number[]

        Optional custom split. Can be partial if you only need SOME specific amounts.

      Returns MeltBuilder

    • Receive a callback when NUT-08 blanks (0-sat change outputs) are created for async melts.

      Parameters

      • cb: (blanks: MeltBlanks) => void

        Callback invoked with the created blanks payload.

      Returns MeltBuilder

      You can persist these blanks and later call wallet.completeMelt(blanks) to finalize and recover change once the invoice/offer is paid.