/**
 * 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, type Codec, type Decoder, type Encoder } from '@solana/kit';
import { getRebalanceAutodriftStepDecoder, getRebalanceAutodriftStepEncoder, getRebalanceAutodriftWindowDecoder, getRebalanceAutodriftWindowEncoder, type RebalanceAutodriftStep, type RebalanceAutodriftStepArgs, type RebalanceAutodriftWindow, type RebalanceAutodriftWindowArgs } from '.';

export type RebalanceAutodriftState = { lastWindow: RebalanceAutodriftWindow; currentWindow: RebalanceAutodriftWindow; step: RebalanceAutodriftStep;  };

export type RebalanceAutodriftStateArgs = { lastWindow: RebalanceAutodriftWindowArgs; currentWindow: RebalanceAutodriftWindowArgs; step: RebalanceAutodriftStepArgs;  };

export function getRebalanceAutodriftStateEncoder(): Encoder<RebalanceAutodriftStateArgs> {
    return getStructEncoder([['lastWindow', getRebalanceAutodriftWindowEncoder()], ['currentWindow', getRebalanceAutodriftWindowEncoder()], ['step', getRebalanceAutodriftStepEncoder()]]);
}

export function getRebalanceAutodriftStateDecoder(): Decoder<RebalanceAutodriftState> {
    return getStructDecoder([['lastWindow', getRebalanceAutodriftWindowDecoder()], ['currentWindow', getRebalanceAutodriftWindowDecoder()], ['step', getRebalanceAutodriftStepDecoder()]]);
}

export function getRebalanceAutodriftStateCodec(): Codec<RebalanceAutodriftStateArgs, RebalanceAutodriftState> {
    return combineCodec(getRebalanceAutodriftStateEncoder(), getRebalanceAutodriftStateDecoder());
}