/** * 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 '@metaplex-foundation/beet' import * as web3 from '@solana/web3.js' import { OwnerSetConfigParams, ownerSetConfigParamsBeet, } from '../types/OwnerSetConfigParams' /** * @category Instructions * @category OwnerSetConfig * @category generated */ export type OwnerSetConfigInstructionArgs = { params: OwnerSetConfigParams } /** * @category Instructions * @category OwnerSetConfig * @category generated */ export const ownerSetConfigStruct = new beet.FixableBeetArgsStruct< OwnerSetConfigInstructionArgs & { instructionDiscriminator: number[] /* size: 8 */ } >( [ ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], ['params', ownerSetConfigParamsBeet], ], 'OwnerSetConfigInstructionArgs' ) /** * Accounts required by the _ownerSetConfig_ instruction * * @property [**signer**] owner * @property [_writable_] config * @category Instructions * @category OwnerSetConfig * @category generated */ export type OwnerSetConfigInstructionAccounts = { owner: web3.PublicKey config: web3.PublicKey anchorRemainingAccounts?: web3.AccountMeta[] } export const ownerSetConfigInstructionDiscriminator = [ 99, 197, 129, 19, 164, 164, 183, 123, ] /** * Creates a _OwnerSetConfig_ 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 OwnerSetConfig * @category generated */ export function createOwnerSetConfigInstruction( accounts: OwnerSetConfigInstructionAccounts, args: OwnerSetConfigInstructionArgs, programId: web3.PublicKey ) { const [data] = ownerSetConfigStruct.serialize({ instructionDiscriminator: ownerSetConfigInstructionDiscriminator, ...args, }) const keys: web3.AccountMeta[] = [ { pubkey: accounts.owner, isWritable: false, isSigner: true, }, { pubkey: accounts.config, 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 } /** * Creates a _OwnerSetConfig_ instructionAccounts. * * @param accounts that will be accessed while the instruction is processed * @category Instructions * @category OwnerSetConfig * @category generated */ export function createOwnerSetConfigInstructionAccounts( accounts: OwnerSetConfigInstructionAccounts, programId: web3.PublicKey ) { const keys: web3.AccountMeta[] = [ { pubkey: accounts.owner, isWritable: false, isSigner: true, }, { pubkey: accounts.config, isWritable: true, isSigner: false, }, ] if (accounts.anchorRemainingAccounts != null) { for (const acc of accounts.anchorRemainingAccounts) { keys.push(acc) } } return keys }