/** * This code was AUTOGENERATED using the kinobi library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun kinobi to update it. * * @see https://github.com/kinobi-so/kinobi */ import { Context, TransactionBuilder, transactionBuilder, } from '@metaplex-foundation/umi'; import { Serializer, bytes, mapSerializer, struct, } from '@metaplex-foundation/umi/serializers'; import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners, } from '../shared'; // Data. export type RevertCallInstructionData = { discriminator: Uint8Array }; export type RevertCallInstructionDataArgs = {}; export function getRevertCallInstructionDataSerializer(): Serializer< RevertCallInstructionDataArgs, RevertCallInstructionData > { return mapSerializer< RevertCallInstructionDataArgs, any, RevertCallInstructionData >( struct([['discriminator', bytes({ size: 8 })]], { description: 'RevertCallInstructionData', }), (value) => ({ ...value, discriminator: new Uint8Array([124, 243, 145, 116, 106, 203, 93, 114]), }) ) as Serializer; } // Instruction. export function revertCall( context: Pick ): TransactionBuilder { // Program ID. const programId = context.programs.getPublicKey( 'simpleMessagelib', '6GsmxMTHAAiFKfemuM4zBjumTjNSX5CAiw4xSSXM2Toy' ); // Accounts. const resolvedAccounts = {} satisfies ResolvedAccountsWithIndices; // Accounts in order. const orderedAccounts: ResolvedAccount[] = Object.values( resolvedAccounts as ResolvedAccountsWithIndices ); // Keys and Signers. const [keys, signers] = getAccountMetasAndSigners( orderedAccounts, 'programId', programId ); // Data. const data = getRevertCallInstructionDataSerializer().serialize({}); // Bytes Created On Chain. const bytesCreatedOnChain = 0; return transactionBuilder([ { instruction: { keys, programId, data }, signers, bytesCreatedOnChain }, ]); }