/** * 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'; /** * @category Instructions * @category CreateStore * @category generated */ export type CreateStoreInstructionArgs = { name: string; description: string; }; /** * @category Instructions * @category CreateStore * @category generated */ const createStoreStruct = new beet.FixableBeetArgsStruct< CreateStoreInstructionArgs & { instructionDiscriminator: number[] /* size: 8 */; } >( [ ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], ['name', beet.utf8String], ['description', beet.utf8String], ], 'CreateStoreInstructionArgs', ); /** * Accounts required by the _createStore_ instruction * @category Instructions * @category CreateStore * @category generated */ export type CreateStoreInstructionAccounts = { admin: web3.PublicKey; store: web3.PublicKey; }; const createStoreInstructionDiscriminator = [132, 152, 9, 27, 112, 19, 95, 83]; /** * Creates a _CreateStore_ 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 CreateStore * @category generated */ export function createCreateStoreInstruction( accounts: CreateStoreInstructionAccounts, args: CreateStoreInstructionArgs, ) { const { admin, store } = accounts; const [data] = createStoreStruct.serialize({ instructionDiscriminator: createStoreInstructionDiscriminator, ...args, }); const keys: web3.AccountMeta[] = [ { pubkey: admin, isWritable: true, isSigner: true, }, { pubkey: store, isWritable: true, isSigner: true, }, { pubkey: web3.SystemProgram.programId, isWritable: false, isSigner: false, }, ]; const ix = new web3.TransactionInstruction({ programId: new web3.PublicKey('SaLeTjyUa5wXHnGuewUSyJ5JWZaHwz3TxqUntCE9czo'), keys, data, }); return ix; }