/**
 * 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, getAddressDecoder, getAddressEncoder, getStructDecoder, getStructEncoder, getU128Decoder, getU128Encoder, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from '@solana/kit';

export type WhirlpoolRewardInfo = { 
/** Reward token mint. */
mint: Address; 
/** Reward vault token account. */
vault: Address; 
/** Authority account that has permission to initialize the reward and set emissions. */
authority: Address; 
/** Q64.64 number that indicates how many tokens per second are earned per unit of liquidity. */
emissionsPerSecondX64: bigint; 
/**
 * Q64.64 number that tracks the total tokens earned per unit of liquidity since the reward
 * emissions were turned on.
 */
growthGlobalX64: bigint;  };

export type WhirlpoolRewardInfoArgs = { 
/** Reward token mint. */
mint: Address; 
/** Reward vault token account. */
vault: Address; 
/** Authority account that has permission to initialize the reward and set emissions. */
authority: Address; 
/** Q64.64 number that indicates how many tokens per second are earned per unit of liquidity. */
emissionsPerSecondX64: number | bigint; 
/**
 * Q64.64 number that tracks the total tokens earned per unit of liquidity since the reward
 * emissions were turned on.
 */
growthGlobalX64: number | bigint;  };

export function getWhirlpoolRewardInfoEncoder(): FixedSizeEncoder<WhirlpoolRewardInfoArgs> {
    return getStructEncoder([['mint', getAddressEncoder()], ['vault', getAddressEncoder()], ['authority', getAddressEncoder()], ['emissionsPerSecondX64', getU128Encoder()], ['growthGlobalX64', getU128Encoder()]]);
}

export function getWhirlpoolRewardInfoDecoder(): FixedSizeDecoder<WhirlpoolRewardInfo> {
    return getStructDecoder([['mint', getAddressDecoder()], ['vault', getAddressDecoder()], ['authority', getAddressDecoder()], ['emissionsPerSecondX64', getU128Decoder()], ['growthGlobalX64', getU128Decoder()]]);
}

export function getWhirlpoolRewardInfoCodec(): FixedSizeCodec<WhirlpoolRewardInfoArgs, WhirlpoolRewardInfo> {
    return combineCodec(getWhirlpoolRewardInfoEncoder(), getWhirlpoolRewardInfoDecoder());
}