@kamino-finance/kliquidity-sdk
Version:
Typescript SDK for interacting with the Kamino Liquidity (kliquidity) protocol
50 lines • 3.09 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 PositionRewardInfo, type PositionRewardInfoArgs } from '../types';
export declare const POSITION_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
export declare function getPositionDiscriminatorBytes(): ReadonlyUint8Array;
export type Position = {
discriminator: ReadonlyUint8Array;
whirlpool: Address;
positionMint: Address;
liquidity: bigint;
tickLowerIndex: number;
tickUpperIndex: number;
feeGrowthCheckpointA: bigint;
feeOwedA: bigint;
feeGrowthCheckpointB: bigint;
feeOwedB: bigint;
rewardInfos: Array<PositionRewardInfo>;
};
export type PositionArgs = {
whirlpool: Address;
positionMint: Address;
liquidity: number | bigint;
tickLowerIndex: number;
tickUpperIndex: number;
feeGrowthCheckpointA: number | bigint;
feeOwedA: number | bigint;
feeGrowthCheckpointB: number | bigint;
feeOwedB: number | bigint;
rewardInfos: Array<PositionRewardInfoArgs>;
};
/** 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