MetaplexTokenMetaDataProgram.createV1 constructor

MetaplexTokenMetaDataProgram.createV1({
  1. required SolAddress metadata,
  2. SolAddress? masterEdition,
  3. required SolAddress mint,
  4. required SolAddress authority,
  5. required SolAddress payer,
  6. required SolAddress updateAuthority,
  7. required MetaplexTokenMetaDataCreateV1Layout layout,
  8. SolAddress systemProgram = SystemProgramConst.programId,
  9. SolAddress tokenProgram = SPLTokenProgramConst.tokenProgramId,
  10. SolAddress sysvarInstructions = SystemProgramConst.sysvarInstructionsPubkey,
})

Implementation

factory MetaplexTokenMetaDataProgram.createV1({
  required SolAddress metadata,
  SolAddress? masterEdition,
  required SolAddress mint,
  required SolAddress authority,
  required SolAddress payer,
  required SolAddress updateAuthority,
  required MetaplexTokenMetaDataCreateV1Layout layout,
  SolAddress systemProgram = SystemProgramConst.programId,
  SolAddress tokenProgram = SPLTokenProgramConst.tokenProgramId,
  SolAddress sysvarInstructions = SystemProgramConst.sysvarInstructionsPubkey,
}) {
  return MetaplexTokenMetaDataProgram(keys: [
    metadata.toWritable(),
    masterEdition?.toWritable() ??
        MetaplexTokenMetaDataProgramConst.programId.toReadOnly(),
    mint.toWritable(),
    authority.toSigner(),
    payer.toSignerAndWritable(),
    updateAuthority.toReadOnly(),
    systemProgram.toReadOnly(),
    sysvarInstructions.toReadOnly(),
    tokenProgram.toReadOnly(),
  ], programId: MetaplexTokenMetaDataProgramConst.programId, layout: layout);
}