UNPKG

@algofi/js-sdk

Version:

The official Algofi JavaScript SDK

28 lines (27 loc) 862 B
import { Algodv2 } from "algosdk"; import Staking from "./staking"; export default class UserStakingState { algod: Algodv2; staking: Staking; storageAddress: string; totalStaked: number; rewardsProgramNumber: number; rewardsCoefficient: number; unclaimedRewards: number; unclaimedSecondaryRewards: number; rewardsPerYear: number; secondaryRewardsPerYear: number; /** * Constructor for the v1 user staking state object. * * @param algod - algod client * @param staking - staking * @param storageAddress - storage address */ constructor(algod: Algodv2, staking: Staking, storageAddress: string); /** * Function to get the local states of the staking contract and update the * information in the object. */ loadState(): Promise<void>; }