MetaplexTokenMetaDataProgram.migrate constructor

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

Implementation

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