findMintCounterPda static method

ProgramDerivedAddress findMintCounterPda({
  1. required int id,
  2. required SolAddress user,
  3. required SolAddress candyGuard,
  4. required SolAddress candyMachine,
  5. SolAddress programId = MetaplexCandyMachineCoreProgramConst.candyGuardProgramId,
})

Implementation

static ProgramDerivedAddress findMintCounterPda(
    // A unique identifier in the context of a Candy Machine/Candy Guard combo
    {required int id,

    /// The address of the wallet trying to mint
    required SolAddress user,

    /// The address of the Candy Guard account
    required SolAddress candyGuard,

    /// The address of the Candy Machine account
    required SolAddress candyMachine,
    SolAddress programId =
        MetaplexCandyMachineCoreProgramConst.candyGuardProgramId}) {
  return ProgramDerivedAddress.find(seedBytes: [
    "mint_limit".codeUnits,
    LayoutConst.u8().serialize(id),
    user.toBytes(),
    candyGuard.toBytes(),
    candyMachine.toBytes()
  ], programId: programId);
}