UNPKG

@kamino-finance/kliquidity-sdk

Version:

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

25 lines (19 loc) 2.15 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, getAddressDecoder, getAddressEncoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from '@solana/kit'; export type KaminoRewardInfo = { decimals: bigint; rewardVault: Address; rewardMint: Address; rewardCollateralId: bigint; lastIssuanceTs: bigint; rewardPerSecond: bigint; amountUncollected: bigint; amountIssuedCumulative: bigint; amountAvailable: bigint; }; export type KaminoRewardInfoArgs = { decimals: number | bigint; rewardVault: Address; rewardMint: Address; rewardCollateralId: number | bigint; lastIssuanceTs: number | bigint; rewardPerSecond: number | bigint; amountUncollected: number | bigint; amountIssuedCumulative: number | bigint; amountAvailable: number | bigint; }; export function getKaminoRewardInfoEncoder(): FixedSizeEncoder<KaminoRewardInfoArgs> { return getStructEncoder([['decimals', getU64Encoder()], ['rewardVault', getAddressEncoder()], ['rewardMint', getAddressEncoder()], ['rewardCollateralId', getU64Encoder()], ['lastIssuanceTs', getU64Encoder()], ['rewardPerSecond', getU64Encoder()], ['amountUncollected', getU64Encoder()], ['amountIssuedCumulative', getU64Encoder()], ['amountAvailable', getU64Encoder()]]); } export function getKaminoRewardInfoDecoder(): FixedSizeDecoder<KaminoRewardInfo> { return getStructDecoder([['decimals', getU64Decoder()], ['rewardVault', getAddressDecoder()], ['rewardMint', getAddressDecoder()], ['rewardCollateralId', getU64Decoder()], ['lastIssuanceTs', getU64Decoder()], ['rewardPerSecond', getU64Decoder()], ['amountUncollected', getU64Decoder()], ['amountIssuedCumulative', getU64Decoder()], ['amountAvailable', getU64Decoder()]]); } export function getKaminoRewardInfoCodec(): FixedSizeCodec<KaminoRewardInfoArgs, KaminoRewardInfo> { return combineCodec(getKaminoRewardInfoEncoder(), getKaminoRewardInfoDecoder()); }