MetaplexTokenMetaDataProgram.useV1 constructor

MetaplexTokenMetaDataProgram.useV1({
  1. required SolAddress authority,
  2. required SolAddress mint,
  3. required SolAddress metadata,
  4. required SolAddress payer,
  5. required SolAddress sysvarInstructions,
  6. required MetaplexTokenMetaDataUseV1Layout layout,
  7. SolAddress? delegateRecord,
  8. SolAddress? token,
  9. SolAddress? edition,
  10. SolAddress systemProgram = SystemProgramConst.programId,
  11. SolAddress? splTokenProgram,
  12. SolAddress? authorizationRulesProgram,
  13. SolAddress? authorizationRules,
})

Implementation

factory MetaplexTokenMetaDataProgram.useV1({
  required SolAddress authority,
  required SolAddress mint,
  required SolAddress metadata,
  required SolAddress payer,
  required SolAddress sysvarInstructions,
  required MetaplexTokenMetaDataUseV1Layout layout,
  SolAddress? delegateRecord,
  SolAddress? token,
  SolAddress? edition,
  SolAddress systemProgram = SystemProgramConst.programId,
  SolAddress? splTokenProgram,
  SolAddress? authorizationRulesProgram,
  SolAddress? authorizationRules,
}) {
  return MetaplexTokenMetaDataProgram(keys: [
    authority.toSigner(),
    delegateRecord?.toWritable() ??
        MetaplexTokenMetaDataProgramConst.programId.toReadOnly(),
    token?.toWritable() ??
        MetaplexTokenMetaDataProgramConst.programId.toReadOnly(),
    mint.toReadOnly(),
    metadata.toWritable(),
    edition?.toWritable() ??
        MetaplexTokenMetaDataProgramConst.programId.toReadOnly(),
    payer.toSigner(),
    systemProgram.toReadOnly(),
    sysvarInstructions.toReadOnly(),
    splTokenProgram?.toReadOnly() ??
        MetaplexTokenMetaDataProgramConst.programId.toReadOnly(),
    authorizationRulesProgram?.toReadOnly() ??
        MetaplexTokenMetaDataProgramConst.programId.toReadOnly(),
    authorizationRules?.toReadOnly() ??
        MetaplexTokenMetaDataProgramConst.programId.toReadOnly(),
  ], programId: MetaplexTokenMetaDataProgramConst.programId, layout: layout);
}