/** * 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 UnlockResponseCollateral * @category generated */ export const unlockResponseCollateralStruct = new beet.BeetArgsStruct<{ instructionDiscriminator: number[] /* size: 8 */ }>( [['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)]], 'UnlockResponseCollateralInstructionArgs' ) /** * Accounts required by the _unlockResponseCollateral_ instruction * * @property [] protocol * @property [_writable_] rfq * @property [_writable_] response * @property [_writable_] takerCollateralInfo * @property [_writable_] makerCollateralInfo * @property [_writable_] takerCollateralTokens * @property [_writable_] makerCollateralTokens * @property [_writable_] protocolCollateralTokens * @category Instructions * @category UnlockResponseCollateral * @category generated */ export type UnlockResponseCollateralInstructionAccounts = { protocol: web3.PublicKey rfq: web3.PublicKey response: web3.PublicKey takerCollateralInfo: web3.PublicKey makerCollateralInfo: web3.PublicKey takerCollateralTokens: web3.PublicKey makerCollateralTokens: web3.PublicKey protocolCollateralTokens: web3.PublicKey tokenProgram?: web3.PublicKey anchorRemainingAccounts?: web3.AccountMeta[] } export const unlockResponseCollateralInstructionDiscriminator = [ 20, 42, 137, 216, 80, 82, 27, 254, ] /** * Creates a _UnlockResponseCollateral_ instruction. * * @param accounts that will be accessed while the instruction is processed * @category Instructions * @category UnlockResponseCollateral * @category generated */ export function createUnlockResponseCollateralInstruction( accounts: UnlockResponseCollateralInstructionAccounts, programId = new web3.PublicKey('FqAhTZg86EKEzeWMLtutVDRXJuLWrey7oDHr3Au6RFdo') ) { const [data] = unlockResponseCollateralStruct.serialize({ instructionDiscriminator: unlockResponseCollateralInstructionDiscriminator, }) const keys: web3.AccountMeta[] = [ { pubkey: accounts.protocol, isWritable: false, isSigner: false, }, { pubkey: accounts.rfq, isWritable: true, isSigner: false, }, { pubkey: accounts.response, isWritable: true, isSigner: false, }, { pubkey: accounts.takerCollateralInfo, isWritable: true, isSigner: false, }, { pubkey: accounts.makerCollateralInfo, isWritable: true, isSigner: false, }, { pubkey: accounts.takerCollateralTokens, isWritable: true, isSigner: false, }, { pubkey: accounts.makerCollateralTokens, isWritable: true, isSigner: false, }, { pubkey: accounts.protocolCollateralTokens, 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 }