UNPKG

@kamino-finance/klend-sdk

Version:

Typescript SDK for interacting with the Kamino Lending (klend) protocol

143 lines 5.35 kB
import { PublicKey, Connection } from "@solana/web3.js"; import BN from "bn.js"; export interface UserStateFields { userId: BN; farmState: PublicKey; owner: PublicKey; /** Indicate if this user state is part of a delegated farm */ isFarmDelegated: number; padding0: Array<number>; /** * Rewards tally used for computation of gained rewards * (scaled from `Decimal` representation). */ rewardsTallyScaled: Array<BN>; /** Number of reward tokens ready for claim */ rewardsIssuedUnclaimed: Array<BN>; lastClaimTs: Array<BN>; /** * User stake deposited and usable, generating rewards and fees. * (scaled from `Decimal` representation). */ activeStakeScaled: BN; /** * User stake deposited but not usable and not generating rewards yet. * (scaled from `Decimal` representation). */ pendingDepositStakeScaled: BN; /** * After this timestamp, pending user stake can be moved to user stake * Initialized to now() + delayed user stake period */ pendingDepositStakeTs: BN; /** * User deposits unstaked, pending for withdrawal, not usable and not generating rewards. * (scaled from `Decimal` representation). */ pendingWithdrawalUnstakeScaled: BN; /** After this timestamp, user can withdraw their deposit. */ pendingWithdrawalUnstakeTs: BN; /** User bump used for account address validation */ bump: BN; /** Delegatee used for initialisation - useful to check against */ delegatee: PublicKey; lastStakeTs: BN; padding1: Array<BN>; } export interface UserStateJSON { userId: string; farmState: string; owner: string; /** Indicate if this user state is part of a delegated farm */ isFarmDelegated: number; padding0: Array<number>; /** * Rewards tally used for computation of gained rewards * (scaled from `Decimal` representation). */ rewardsTallyScaled: Array<string>; /** Number of reward tokens ready for claim */ rewardsIssuedUnclaimed: Array<string>; lastClaimTs: Array<string>; /** * User stake deposited and usable, generating rewards and fees. * (scaled from `Decimal` representation). */ activeStakeScaled: string; /** * User stake deposited but not usable and not generating rewards yet. * (scaled from `Decimal` representation). */ pendingDepositStakeScaled: string; /** * After this timestamp, pending user stake can be moved to user stake * Initialized to now() + delayed user stake period */ pendingDepositStakeTs: string; /** * User deposits unstaked, pending for withdrawal, not usable and not generating rewards. * (scaled from `Decimal` representation). */ pendingWithdrawalUnstakeScaled: string; /** After this timestamp, user can withdraw their deposit. */ pendingWithdrawalUnstakeTs: string; /** User bump used for account address validation */ bump: string; /** Delegatee used for initialisation - useful to check against */ delegatee: string; lastStakeTs: string; padding1: Array<string>; } export declare class UserState { readonly userId: BN; readonly farmState: PublicKey; readonly owner: PublicKey; /** Indicate if this user state is part of a delegated farm */ readonly isFarmDelegated: number; readonly padding0: Array<number>; /** * Rewards tally used for computation of gained rewards * (scaled from `Decimal` representation). */ readonly rewardsTallyScaled: Array<BN>; /** Number of reward tokens ready for claim */ readonly rewardsIssuedUnclaimed: Array<BN>; readonly lastClaimTs: Array<BN>; /** * User stake deposited and usable, generating rewards and fees. * (scaled from `Decimal` representation). */ readonly activeStakeScaled: BN; /** * User stake deposited but not usable and not generating rewards yet. * (scaled from `Decimal` representation). */ readonly pendingDepositStakeScaled: BN; /** * After this timestamp, pending user stake can be moved to user stake * Initialized to now() + delayed user stake period */ readonly pendingDepositStakeTs: BN; /** * User deposits unstaked, pending for withdrawal, not usable and not generating rewards. * (scaled from `Decimal` representation). */ readonly pendingWithdrawalUnstakeScaled: BN; /** After this timestamp, user can withdraw their deposit. */ readonly pendingWithdrawalUnstakeTs: BN; /** User bump used for account address validation */ readonly bump: BN; /** Delegatee used for initialisation - useful to check against */ readonly delegatee: PublicKey; readonly lastStakeTs: BN; readonly padding1: Array<BN>; static readonly discriminator: Buffer; static readonly layout: any; constructor(fields: UserStateFields); static fetch(c: Connection, address: PublicKey, programId?: PublicKey): Promise<UserState | null>; static fetchMultiple(c: Connection, addresses: PublicKey[], programId?: PublicKey): Promise<Array<UserState | null>>; static decode(data: Buffer): UserState; toJSON(): UserStateJSON; static fromJSON(obj: UserStateJSON): UserState; } //# sourceMappingURL=UserState.d.ts.map