MetaplexTokenEntanglerProgram.swap constructor
MetaplexTokenEntanglerProgram.swap({
- required SolAddress treasuryMint,
- required SolAddress payer,
- required SolAddress paymentAccount,
- required SolAddress paymentTransferAuthority,
- required SolAddress token,
- required SolAddress tokenMint,
- required SolAddress replacementTokenMetadata,
- required SolAddress replacementTokenMint,
- required SolAddress replacementToken,
- required SolAddress transferAuthority,
- required SolAddress tokenAEscrow,
- required SolAddress tokenBEscrow,
- required SolAddress entangledPair,
- SolAddress tokenProgram = SPLTokenProgramConst.tokenProgramId,
- SolAddress systemProgram = SystemProgramConst.programId,
- SolAddress associatedTokenProgramId = AssociatedTokenAccountProgramConst.associatedTokenProgramId,
- SolAddress rent = SystemProgramConst.sysvarRentPubkey,
Implementation
factory MetaplexTokenEntanglerProgram.swap(
{required SolAddress treasuryMint,
required SolAddress payer,
required SolAddress paymentAccount,
required SolAddress paymentTransferAuthority,
required SolAddress token,
required SolAddress tokenMint,
required SolAddress replacementTokenMetadata,
required SolAddress replacementTokenMint,
required SolAddress replacementToken,
required SolAddress transferAuthority,
required SolAddress tokenAEscrow,
required SolAddress tokenBEscrow,
required SolAddress entangledPair,
SolAddress tokenProgram = SPLTokenProgramConst.tokenProgramId,
SolAddress systemProgram = SystemProgramConst.programId,
SolAddress associatedTokenProgramId =
AssociatedTokenAccountProgramConst.associatedTokenProgramId,
SolAddress rent = SystemProgramConst.sysvarRentPubkey}) {
return MetaplexTokenEntanglerProgram(
keys: [
treasuryMint.toReadOnly(),
payer.toSigner(),
paymentAccount.toWritable(),
paymentTransferAuthority.toReadOnly(),
token.toWritable(),
tokenMint.toReadOnly(),
replacementTokenMetadata.toReadOnly(),
replacementTokenMint.toReadOnly(),
replacementToken.toWritable(),
transferAuthority.toSigner(),
tokenAEscrow.toWritable(),
tokenBEscrow.toWritable(),
entangledPair.toWritable(),
tokenProgram.toReadOnly(),
systemProgram.toReadOnly(),
associatedTokenProgramId.toReadOnly(),
rent.toReadOnly()
],
programId: MetaplexTokenEntanglerProgramConst.programId,
layout: const MetaplexTokenEntanglerSwapLayout());
}