MetaplexTokenMetaDataProgram.transferV1 constructor

MetaplexTokenMetaDataProgram.transferV1({
  1. required SolAddress token,
  2. required SolAddress tokenOwner,
  3. required SolAddress destination,
  4. required SolAddress destinationOwner,
  5. required SolAddress mint,
  6. required SolAddress metadata,
  7. required SolAddress authority,
  8. required SolAddress payer,
  9. required SolAddress sysvarInstructions,
  10. required SolAddress splTokenProgram,
  11. required SolAddress splAtaProgram,
  12. required MetaplexTokenMetaDataTransferV1Layout layout,
  13. SolAddress? edition,
  14. SolAddress? ownerTokenRecord,
  15. SolAddress? destinationTokenRecord,
  16. SolAddress systemProgram = SystemProgramConst.programId,
  17. SolAddress? authorizationRulesProgram,
  18. SolAddress? authorizationRules,
})

Implementation

factory MetaplexTokenMetaDataProgram.transferV1({
  required SolAddress token,
  required SolAddress tokenOwner,
  required SolAddress destination,
  required SolAddress destinationOwner,
  required SolAddress mint,
  required SolAddress metadata,
  required SolAddress authority,
  required SolAddress payer,
  required SolAddress sysvarInstructions,
  required SolAddress splTokenProgram,
  required SolAddress splAtaProgram,
  required MetaplexTokenMetaDataTransferV1Layout layout,
  SolAddress? edition,
  SolAddress? ownerTokenRecord,
  SolAddress? destinationTokenRecord,
  SolAddress systemProgram = SystemProgramConst.programId,
  SolAddress? authorizationRulesProgram,
  SolAddress? authorizationRules,
}) {
  return MetaplexTokenMetaDataProgram(keys: [
    token.toWritable(),
    tokenOwner.toReadOnly(),
    destination.toWritable(),
    destinationOwner.toReadOnly(),
    mint.toReadOnly(),
    metadata.toWritable(),
    edition?.toReadOnly() ??
        MetaplexTokenMetaDataProgramConst.programId.toReadOnly(),
    ownerTokenRecord?.toWritable() ??
        MetaplexTokenMetaDataProgramConst.programId.toReadOnly(),
    destinationTokenRecord?.toWritable() ??
        MetaplexTokenMetaDataProgramConst.programId.toReadOnly(),
    authority.toSigner(),
    payer.toSignerAndWritable(),
    systemProgram.toReadOnly(),
    sysvarInstructions.toReadOnly(),
    splTokenProgram.toReadOnly(),
    splAtaProgram.toReadOnly(),
    authorizationRulesProgram?.toReadOnly() ??
        MetaplexTokenMetaDataProgramConst.programId.toReadOnly(),
    authorizationRules?.toReadOnly() ??
        MetaplexTokenMetaDataProgramConst.programId.toReadOnly(),
  ], programId: MetaplexTokenMetaDataProgramConst.programId, layout: layout);
}