MetaplexBubblegumProgram.delegate constructor

MetaplexBubblegumProgram.delegate({
  1. required SolAddress treeAuthority,
  2. required SolAddress leafOwner,
  3. required SolAddress previousLeafDelegate,
  4. required SolAddress newLeafDelegate,
  5. required SolAddress merkleTree,
  6. required SolAddress logWrapper,
  7. required SolAddress compressionProgram,
  8. required MetaplexBubblegumDelegateLayout layout,
  9. List<AccountMeta> anchorRemainingAccounts = const [],
  10. SolAddress systemProgram = SystemProgramConst.programId,
})

Implementation

factory MetaplexBubblegumProgram.delegate({
  required SolAddress treeAuthority,
  required SolAddress leafOwner,
  required SolAddress previousLeafDelegate,
  required SolAddress newLeafDelegate,
  required SolAddress merkleTree,
  required SolAddress logWrapper,
  required SolAddress compressionProgram,
  required MetaplexBubblegumDelegateLayout layout,
  List<AccountMeta> anchorRemainingAccounts = const [],
  SolAddress systemProgram = SystemProgramConst.programId,
}) {
  return MetaplexBubblegumProgram(keys: [
    treeAuthority.toReadOnly(),
    leafOwner.toSigner(),
    previousLeafDelegate.toReadOnly(),
    newLeafDelegate.toReadOnly(),
    merkleTree.toWritable(),
    logWrapper.toReadOnly(),
    compressionProgram.toReadOnly(),
    systemProgram.toReadOnly(),
    ...anchorRemainingAccounts
  ], programId: MetaplexBubblegumProgramConst.programId, layout: layout);
}