/**
 * 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, getArrayDecoder, getArrayEncoder, getStructDecoder, getStructEncoder, type Codec, type Decoder, type Encoder } from '@solana/kit';
import { getRemainingAccountsSliceDecoder, getRemainingAccountsSliceEncoder, type RemainingAccountsSlice, type RemainingAccountsSliceArgs } from '.';

export type RemainingAccountsInfo = { slices: Array<RemainingAccountsSlice>;  };

export type RemainingAccountsInfoArgs = { slices: Array<RemainingAccountsSliceArgs>;  };

export function getRemainingAccountsInfoEncoder(): Encoder<RemainingAccountsInfoArgs> {
    return getStructEncoder([['slices', getArrayEncoder(getRemainingAccountsSliceEncoder())]]);
}

export function getRemainingAccountsInfoDecoder(): Decoder<RemainingAccountsInfo> {
    return getStructDecoder([['slices', getArrayDecoder(getRemainingAccountsSliceDecoder())]]);
}

export function getRemainingAccountsInfoCodec(): Codec<RemainingAccountsInfoArgs, RemainingAccountsInfo> {
    return combineCodec(getRemainingAccountsInfoEncoder(), getRemainingAccountsInfoDecoder());
}