@mihalex/farms-sdk-tests
Version:
141 lines (140 loc) • 5.16 kB
TypeScript
/// <reference types="node" />
import { PublicKey, Connection } from "@solana/web3.js";
import BN from "bn.js";
export interface UserStateFields {
userId: BN;
farmState: PublicKey;
owner: PublicKey;
/** User data to account for rewards */
legacyStake: BN;
/**
* 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;
padding: Array<BN>;
}
export interface UserStateJSON {
userId: string;
farmState: string;
owner: string;
/** User data to account for rewards */
legacyStake: string;
/**
* 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;
padding: Array<string>;
}
export declare class UserState {
readonly userId: BN;
readonly farmState: PublicKey;
readonly owner: PublicKey;
/** User data to account for rewards */
readonly legacyStake: BN;
/**
* 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 padding: 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;
}