/** * 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, getBooleanDecoder, getBooleanEncoder, getStructDecoder, getStructEncoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from "@solana/kit"; export type Permissions = { allowSwap: boolean; allowAddLiquidity: boolean; allowRemoveLiquidity: boolean; allowIncreasePosition: boolean; allowDecreasePosition: boolean; allowCollateralWithdrawal: boolean; allowLiquidatePosition: boolean; }; export type PermissionsArgs = Permissions; export function getPermissionsEncoder(): FixedSizeEncoder { return getStructEncoder([ ["allowSwap", getBooleanEncoder()], ["allowAddLiquidity", getBooleanEncoder()], ["allowRemoveLiquidity", getBooleanEncoder()], ["allowIncreasePosition", getBooleanEncoder()], ["allowDecreasePosition", getBooleanEncoder()], ["allowCollateralWithdrawal", getBooleanEncoder()], ["allowLiquidatePosition", getBooleanEncoder()], ]); } export function getPermissionsDecoder(): FixedSizeDecoder { return getStructDecoder([ ["allowSwap", getBooleanDecoder()], ["allowAddLiquidity", getBooleanDecoder()], ["allowRemoveLiquidity", getBooleanDecoder()], ["allowIncreasePosition", getBooleanDecoder()], ["allowDecreasePosition", getBooleanDecoder()], ["allowCollateralWithdrawal", getBooleanDecoder()], ["allowLiquidatePosition", getBooleanDecoder()], ]); } export function getPermissionsCodec(): FixedSizeCodec< PermissionsArgs, Permissions > { return combineCodec(getPermissionsEncoder(), getPermissionsDecoder()); }