/** * 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, getU16Decoder, getU16Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from "@solana/kit"; /** * Reference-oracle config for `OracleType::PythLazerEMA`. * * Stored in `oracle_mappings.generic[index]` for an EMA entry. The EMA value * itself lives in the source `PythLazer` entry's `dated_price.generic_data`, * populated by `update_price` whenever the spot refresh payload includes an * `EmaPrice` property. See `get_ema_price`. */ export type PythLazerEmaRefData = { /** Token index of the source `PythLazer` entry to read the EMA from. */ sourceEntry: number; }; export type PythLazerEmaRefDataArgs = PythLazerEmaRefData; export function getPythLazerEmaRefDataEncoder(): FixedSizeEncoder { return getStructEncoder([["sourceEntry", getU16Encoder()]]); } export function getPythLazerEmaRefDataDecoder(): FixedSizeDecoder { return getStructDecoder([["sourceEntry", getU16Decoder()]]); } export function getPythLazerEmaRefDataCodec(): FixedSizeCodec< PythLazerEmaRefDataArgs, PythLazerEmaRefData > { return combineCodec( getPythLazerEmaRefDataEncoder(), getPythLazerEmaRefDataDecoder(), ); }