/**
 * 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, getI32Decoder, getI32Encoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from '@solana/kit';
import { getDriftDirectionDecoder, getDriftDirectionEncoder, type DriftDirection, type DriftDirectionArgs } from '.';

export type RebalanceDriftParams = { startMidTick: number; ticksBelowMid: number; ticksAboveMid: number; secondsPerTick: bigint; direction: DriftDirection;  };

export type RebalanceDriftParamsArgs = { startMidTick: number; ticksBelowMid: number; ticksAboveMid: number; secondsPerTick: number | bigint; direction: DriftDirectionArgs;  };

export function getRebalanceDriftParamsEncoder(): FixedSizeEncoder<RebalanceDriftParamsArgs> {
    return getStructEncoder([['startMidTick', getI32Encoder()], ['ticksBelowMid', getI32Encoder()], ['ticksAboveMid', getI32Encoder()], ['secondsPerTick', getU64Encoder()], ['direction', getDriftDirectionEncoder()]]);
}

export function getRebalanceDriftParamsDecoder(): FixedSizeDecoder<RebalanceDriftParams> {
    return getStructDecoder([['startMidTick', getI32Decoder()], ['ticksBelowMid', getI32Decoder()], ['ticksAboveMid', getI32Decoder()], ['secondsPerTick', getU64Decoder()], ['direction', getDriftDirectionDecoder()]]);
}

export function getRebalanceDriftParamsCodec(): FixedSizeCodec<RebalanceDriftParamsArgs, RebalanceDriftParams> {
    return combineCodec(getRebalanceDriftParamsEncoder(), getRebalanceDriftParamsDecoder());
}