/** * 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 beet from '@convergence-rfq/beet' import * as web3 from '@solana/web3.js' /** * @category Instructions * @category CloseProtocolState * @category generated */ export const closeProtocolStateStruct = new beet.BeetArgsStruct<{ instructionDiscriminator: number[] /* size: 8 */ }>( [['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)]], 'CloseProtocolStateInstructionArgs' ) /** * Accounts required by the _closeProtocolState_ instruction * * @property [_writable_, **signer**] authority * @property [_writable_] protocol * @category Instructions * @category CloseProtocolState * @category generated */ export type CloseProtocolStateInstructionAccounts = { authority: web3.PublicKey protocol: web3.PublicKey anchorRemainingAccounts?: web3.AccountMeta[] } export const closeProtocolStateInstructionDiscriminator = [ 72, 193, 206, 44, 229, 139, 196, 186, ] /** * Creates a _CloseProtocolState_ instruction. * * @param accounts that will be accessed while the instruction is processed * @category Instructions * @category CloseProtocolState * @category generated */ export function createCloseProtocolStateInstruction( accounts: CloseProtocolStateInstructionAccounts, programId = new web3.PublicKey('FqAhTZg86EKEzeWMLtutVDRXJuLWrey7oDHr3Au6RFdo') ) { const [data] = closeProtocolStateStruct.serialize({ instructionDiscriminator: closeProtocolStateInstructionDiscriminator, }) const keys: web3.AccountMeta[] = [ { pubkey: accounts.authority, isWritable: true, isSigner: true, }, { pubkey: accounts.protocol, isWritable: true, 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 }