UNPKG

@kamino-finance/kliquidity-sdk

Version:

Typescript SDK for interacting with the Kamino Liquidity (kliquidity) protocol

26 lines (20 loc) 1.5 kB
/** * 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 { getRebalanceDriftStepDecoder, getRebalanceDriftStepEncoder, type RebalanceDriftStep, type RebalanceDriftStepArgs } from '.'; export type RebalanceDriftState = { step: RebalanceDriftStep; lastDriftTimestamp: bigint; lastMidTick: number; }; export type RebalanceDriftStateArgs = { step: RebalanceDriftStepArgs; lastDriftTimestamp: number | bigint; lastMidTick: number; }; export function getRebalanceDriftStateEncoder(): FixedSizeEncoder<RebalanceDriftStateArgs> { return getStructEncoder([['step', getRebalanceDriftStepEncoder()], ['lastDriftTimestamp', getU64Encoder()], ['lastMidTick', getI32Encoder()]]); } export function getRebalanceDriftStateDecoder(): FixedSizeDecoder<RebalanceDriftState> { return getStructDecoder([['step', getRebalanceDriftStepDecoder()], ['lastDriftTimestamp', getU64Decoder()], ['lastMidTick', getI32Decoder()]]); } export function getRebalanceDriftStateCodec(): FixedSizeCodec<RebalanceDriftStateArgs, RebalanceDriftState> { return combineCodec(getRebalanceDriftStateEncoder(), getRebalanceDriftStateDecoder()); }