/** * This code was GENERATED using the solita package. * Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality. * * See: https://github.com/metaplex-foundation/solita */ import * as splToken from '@solana/spl-token' import * as beet from '@convergence-rfq/beet' import * as web3 from '@solana/web3.js' /** * @category Instructions * @category CleanUp * @category generated */ export type CleanUpInstructionArgs = { input: number[] /* size: 2 */ } /** * @category Instructions * @category CleanUp * @category generated */ export const cleanUpStruct = new beet.BeetArgsStruct< CleanUpInstructionArgs & { instructionDiscriminator: number[] /* size: 8 */ } >( [ ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], ['input', beet.uniformFixedSizeArray(beet.u8, 2)], ], 'CleanUpInstructionArgs' ) /** * Accounts required by the _cleanUp_ instruction * * @property [**signer**] protocol * @property [] rfq * @property [] response * @property [_writable_] firstToPrepare * @property [_writable_] escrow * @property [_writable_] backupReceiver * @category Instructions * @category CleanUp * @category generated */ export type CleanUpInstructionAccounts = { protocol: web3.PublicKey rfq: web3.PublicKey response: web3.PublicKey firstToPrepare: web3.PublicKey escrow: web3.PublicKey backupReceiver: web3.PublicKey tokenProgram?: web3.PublicKey anchorRemainingAccounts?: web3.AccountMeta[] } export const cleanUpInstructionDiscriminator = [ 8, 182, 195, 138, 85, 137, 221, 250, ] /** * Creates a _CleanUp_ instruction. * * @param accounts that will be accessed while the instruction is processed * @param args to provide as instruction data to the program * * @category Instructions * @category CleanUp * @category generated */ export function createCleanUpInstruction( accounts: CleanUpInstructionAccounts, args: CleanUpInstructionArgs, programId = new web3.PublicKey('HpmyVA3t3uNGgdx86AuwZww7gnAWB57vepnk3732vEr9') ) { const [data] = cleanUpStruct.serialize({ instructionDiscriminator: cleanUpInstructionDiscriminator, ...args, }) const keys: web3.AccountMeta[] = [ { pubkey: accounts.protocol, isWritable: false, isSigner: true, }, { pubkey: accounts.rfq, isWritable: false, isSigner: false, }, { pubkey: accounts.response, isWritable: false, isSigner: false, }, { pubkey: accounts.firstToPrepare, isWritable: true, isSigner: false, }, { pubkey: accounts.escrow, isWritable: true, isSigner: false, }, { pubkey: accounts.backupReceiver, isWritable: true, isSigner: false, }, { pubkey: accounts.tokenProgram ?? splToken.TOKEN_PROGRAM_ID, isWritable: false, isSigner: false, }, ] if (accounts.anchorRemainingAccounts != null) { for (const acc of accounts.anchorRemainingAccounts) { keys.push(acc) } } const ix = new web3.TransactionInstruction({ programId, keys, data, }) return ix }