MetaplexTokenMetaDataProgram.mintV1 constructor

MetaplexTokenMetaDataProgram.mintV1({
  1. required SolAddress token,
  2. required SolAddress mint,
  3. required SolAddress authority,
  4. required SolAddress payer,
  5. required SolAddress sysvarInstructions,
  6. required SolAddress splTokenProgram,
  7. required SolAddress splAtaProgram,
  8. required SolAddress metadata,
  9. required MetaplexTokenMetaDataMintV1Layout layout,
  10. SolAddress systemProgram = SystemProgramConst.programId,
  11. SolAddress? tokenOwner,
  12. SolAddress? masterEdition,
  13. SolAddress? tokenRecord,
  14. SolAddress? delegateRecord,
  15. SolAddress? authorizationRulesProgram,
  16. SolAddress? authorizationRules,
})

Implementation

factory MetaplexTokenMetaDataProgram.mintV1({
  required SolAddress token,
  required SolAddress mint,
  required SolAddress authority,
  required SolAddress payer,
  required SolAddress sysvarInstructions,
  required SolAddress splTokenProgram,
  required SolAddress splAtaProgram,
  required SolAddress metadata,
  required MetaplexTokenMetaDataMintV1Layout layout,
  SolAddress systemProgram = SystemProgramConst.programId,
  SolAddress? tokenOwner,
  SolAddress? masterEdition,
  SolAddress? tokenRecord,
  SolAddress? delegateRecord,
  SolAddress? authorizationRulesProgram,
  SolAddress? authorizationRules,
}) {
  return MetaplexTokenMetaDataProgram(keys: [
    token.toWritable(),
    tokenOwner?.toReadOnly() ??
        MetaplexTokenMetaDataProgramConst.programId.toReadOnly(),
    metadata.toReadOnly(),
    masterEdition?.toWritable() ??
        MetaplexTokenMetaDataProgramConst.programId.toReadOnly(),
    tokenRecord?.toWritable() ??
        MetaplexTokenMetaDataProgramConst.programId.toReadOnly(),
    mint.toWritable(),
    authority.toSigner(),
    delegateRecord?.toReadOnly() ??
        MetaplexTokenMetaDataProgramConst.programId.toReadOnly(),
    payer.toSignerAndWritable(),
    systemProgram.toReadOnly(),
    sysvarInstructions.toReadOnly(),
    splTokenProgram.toReadOnly(),
    splAtaProgram.toReadOnly(),
    authorizationRulesProgram?.toWritable() ??
        MetaplexTokenMetaDataProgramConst.programId.toReadOnly(),
    authorizationRules?.toWritable() ??
        MetaplexTokenMetaDataProgramConst.programId.toReadOnly(),
  ], programId: MetaplexTokenMetaDataProgramConst.programId, layout: layout);
}