/**
 * 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, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, getU8Decoder, getU8Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type ReadonlyUint8Array } from '@solana/kit';

export type RebalanceRaw = { params: ReadonlyUint8Array; state: ReadonlyUint8Array; referencePriceType: number;  };

export type RebalanceRawArgs = RebalanceRaw;

export function getRebalanceRawEncoder(): FixedSizeEncoder<RebalanceRawArgs> {
    return getStructEncoder([['params', fixEncoderSize(getBytesEncoder(), 128)], ['state', fixEncoderSize(getBytesEncoder(), 256)], ['referencePriceType', getU8Encoder()]]);
}

export function getRebalanceRawDecoder(): FixedSizeDecoder<RebalanceRaw> {
    return getStructDecoder([['params', fixDecoderSize(getBytesDecoder(), 128)], ['state', fixDecoderSize(getBytesDecoder(), 256)], ['referencePriceType', getU8Decoder()]]);
}

export function getRebalanceRawCodec(): FixedSizeCodec<RebalanceRawArgs, RebalanceRaw> {
    return combineCodec(getRebalanceRawEncoder(), getRebalanceRawDecoder());
}