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

    Class MintBuilder<M, HasPrivKey>

    Builder for minting proofs from a quote.

    Bolt12 requires privkey by default, bolt11 only for locked quotes. The compiler will throw an error if bolt12 and privkey() is omitted: MintBuilder<"bolt12", false>' is not assignable...

    Use this builder for the typed, first-class mint methods. For arbitrary or future mint methods, use the generic wallet.prepareMint(method, …) / wallet.completeMint() flow.

    const proofs = await wallet.ops
    .mintBolt11(100, quote)
    .asDeterministic() // counter 0 auto reserves
    .onCountersReserved((info) => console.log(info))
    .privkey('sk')
    .run();

    Type Parameters

    • M extends MintMethod
    • HasPrivKey extends boolean = M extends "bolt12" ? false : true
    Index

    Constructors

    Methods

    • Use deterministic outputs for the minted proofs.

      Parameters

      • counter: number = 0

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

      • Optionaldenoms: AmountLike[]

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

      Returns MintBuilder<M, HasPrivKey>

      If denoms specified, proofsWeHave() will have no effect.

    • Execute minting against the quote.

      Parameters

      Returns Promise<Proof[]>

      The newly minted proofs.

      This is equivalent to const preview = await prepare(); await wallet.completeMint(preview). This method can only be called for bolt12 quotes when .privkey() is set.