/** * 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 RevertPreparation * @category generated */ export type RevertPreparationInstructionArgs = { input: number[] /* size: 3 */ } /** * @category Instructions * @category RevertPreparation * @category generated */ export const revertPreparationStruct = new beet.BeetArgsStruct< RevertPreparationInstructionArgs & { instructionDiscriminator: number[] /* size: 8 */ } >( [ ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], ['input', beet.uniformFixedSizeArray(beet.u8, 3)], ], 'RevertPreparationInstructionArgs' ) /** * Accounts required by the _revertPreparation_ instruction * * @property [**signer**] protocol * @property [] rfq * @property [] response * @property [_writable_] escrow * @property [_writable_] tokens * @category Instructions * @category RevertPreparation * @category generated */ export type RevertPreparationInstructionAccounts = { protocol: web3.PublicKey rfq: web3.PublicKey response: web3.PublicKey escrow: web3.PublicKey tokens: web3.PublicKey tokenProgram?: web3.PublicKey anchorRemainingAccounts?: web3.AccountMeta[] } export const revertPreparationInstructionDiscriminator = [ 32, 185, 171, 189, 112, 246, 209, 149, ] /** * Creates a _RevertPreparation_ 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 RevertPreparation * @category generated */ export function createRevertPreparationInstruction( accounts: RevertPreparationInstructionAccounts, args: RevertPreparationInstructionArgs, programId = new web3.PublicKey('HpmyVA3t3uNGgdx86AuwZww7gnAWB57vepnk3732vEr9') ) { const [data] = revertPreparationStruct.serialize({ instructionDiscriminator: revertPreparationInstructionDiscriminator, ...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.escrow, isWritable: true, isSigner: false, }, { pubkey: accounts.tokens, 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 }