UNPKG

@kamino-finance/kliquidity-sdk

Version:

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

25 lines (19 loc) 1.25 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, getStructDecoder, getStructEncoder, getU128Decoder, getU128Encoder, getU64Decoder, getU64Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from '@solana/kit'; export type PositionRewardInfo = { growthInsideLastX64: bigint; rewardAmountOwed: bigint; }; export type PositionRewardInfoArgs = { growthInsideLastX64: number | bigint; rewardAmountOwed: number | bigint; }; export function getPositionRewardInfoEncoder(): FixedSizeEncoder<PositionRewardInfoArgs> { return getStructEncoder([['growthInsideLastX64', getU128Encoder()], ['rewardAmountOwed', getU64Encoder()]]); } export function getPositionRewardInfoDecoder(): FixedSizeDecoder<PositionRewardInfo> { return getStructDecoder([['growthInsideLastX64', getU128Decoder()], ['rewardAmountOwed', getU64Decoder()]]); } export function getPositionRewardInfoCodec(): FixedSizeCodec<PositionRewardInfoArgs, PositionRewardInfo> { return combineCodec(getPositionRewardInfoEncoder(), getPositionRewardInfoDecoder()); }