/** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ import { combineCodec, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from "@solana/kit"; import { getKeyDecoder, getKeyEncoder, type Key, type KeyArgs, } from "./index.ts"; /** On-chain header at the start of a RuleSet PDA, locating its revision map. */ export type RuleSetHeader = { /** Account discriminator (always `RuleSet`). */ key: Key; /** Byte offset of the revision map within the PDA. */ revMapVersionLocation: bigint; }; export type RuleSetHeaderArgs = { /** Account discriminator (always `RuleSet`). */ key: KeyArgs; /** Byte offset of the revision map within the PDA. */ revMapVersionLocation: number | bigint; }; export function getRuleSetHeaderEncoder(): FixedSizeEncoder { return getStructEncoder([ ["key", getKeyEncoder()], ["revMapVersionLocation", getU64Encoder()], ]); } export function getRuleSetHeaderDecoder(): FixedSizeDecoder { return getStructDecoder([ ["key", getKeyDecoder()], ["revMapVersionLocation", getU64Decoder()], ]); } export function getRuleSetHeaderCodec(): FixedSizeCodec< RuleSetHeaderArgs, RuleSetHeader > { return combineCodec(getRuleSetHeaderEncoder(), getRuleSetHeaderDecoder()); }