Cashu-TS - v3.7.2
    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
    .mint(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.

    • Prepare the mint.

      Parameters

      Returns Promise<MintPreview>

      A MintPreview containing the payload and output data needed to complete the mint.

      Call wallet.completeMint(MintPreview) to complete the mint. This method can only be called for bolt12 quotes when .privkey() is set.

    • 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.