@kamino-finance/kliquidity-sdk
Version:
Typescript SDK for interacting with the Kamino Liquidity (kliquidity) protocol
78 lines • 4.39 kB
TypeScript
/**
* 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 { fetchEncodedAccount, fetchEncodedAccounts, type Account, type Address, type EncodedAccount, type FetchAccountConfig, type FetchAccountsConfig, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type MaybeAccount, type MaybeEncodedAccount, type ReadonlyUint8Array } from '@solana/kit';
import { type FeeInfo, type FeeInfoArgs, type UserRewardInfo, type UserRewardInfoArgs } from '../types';
export declare const POSITION_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
export declare function getPositionDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
export type Position = {
discriminator: ReadonlyUint8Array;
/** The LB pair of this position */
lbPair: Address;
/** Owner of the position. Client rely on this to to fetch their positions. */
owner: Address;
/** Liquidity shares of this position in bins (lower_bin_id <-> upper_bin_id). This is the same as LP concept. */
liquidityShares: Array<bigint>;
/** Farming reward information */
rewardInfos: Array<UserRewardInfo>;
/** Swap fee to claim information */
feeInfos: Array<FeeInfo>;
/** Lower bin ID */
lowerBinId: number;
/** Upper bin ID */
upperBinId: number;
/** Last updated timestamp */
lastUpdatedAt: bigint;
/** Total claimed token fee X */
totalClaimedFeeXAmount: bigint;
/** Total claimed token fee Y */
totalClaimedFeeYAmount: bigint;
/** Total claimed rewards */
totalClaimedRewards: Array<bigint>;
/** Reserved space for future use */
reserved: ReadonlyUint8Array;
};
export type PositionArgs = {
/** The LB pair of this position */
lbPair: Address;
/** Owner of the position. Client rely on this to to fetch their positions. */
owner: Address;
/** Liquidity shares of this position in bins (lower_bin_id <-> upper_bin_id). This is the same as LP concept. */
liquidityShares: Array<number | bigint>;
/** Farming reward information */
rewardInfos: Array<UserRewardInfoArgs>;
/** Swap fee to claim information */
feeInfos: Array<FeeInfoArgs>;
/** Lower bin ID */
lowerBinId: number;
/** Upper bin ID */
upperBinId: number;
/** Last updated timestamp */
lastUpdatedAt: number | bigint;
/** Total claimed token fee X */
totalClaimedFeeXAmount: number | bigint;
/** Total claimed token fee Y */
totalClaimedFeeYAmount: number | bigint;
/** Total claimed rewards */
totalClaimedRewards: Array<number | bigint>;
/** Reserved space for future use */
reserved: ReadonlyUint8Array;
};
/** Gets the encoder for {@link PositionArgs} account data. */
export declare function getPositionEncoder(): FixedSizeEncoder<PositionArgs>;
/** Gets the decoder for {@link Position} account data. */
export declare function getPositionDecoder(): FixedSizeDecoder<Position>;
/** Gets the codec for {@link Position} account data. */
export declare function getPositionCodec(): FixedSizeCodec<PositionArgs, Position>;
export declare function decodePosition<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<Position, TAddress>;
export declare function decodePosition<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<Position, TAddress>;
export declare function fetchPosition<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<Position, TAddress>>;
export declare function fetchMaybePosition<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<Position, TAddress>>;
export declare function fetchAllPosition(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<Position>[]>;
export declare function fetchAllMaybePosition(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<Position>[]>;
export declare function getPositionSize(): number;
//# sourceMappingURL=position.d.ts.map