UNPKG

@algofi/js-sdk

Version:

The official Algofi JavaScript SDK

37 lines (36 loc) 1.14 kB
import { Algodv2 } from "algosdk"; import AlgofiClient from "../../algofiClient"; import AlgofiUser from "../../algofiUser"; import { Network } from "../../globals"; import Staking from "./staking"; import StakingConfig from "./stakingConfig"; import StakingUser from "./stakingUser"; export default class StakingClient { algofiClient: AlgofiClient; algod: Algodv2; network: Network; stakingConfigs: StakingConfig[]; stakingContracts: { [key: number]: Staking; }; /** * Constructor for the staking client. * * @param algofiClient - algofi client */ constructor(algofiClient: AlgofiClient); /** * Function to load in all of the global states from the staking contracts and * store their state in the object. */ loadState(): Promise<void>; /** * Returns a staking user * * @param address - the address of the person we are generating the staking * user for * @returns a new staking user */ getUser(address: string): StakingUser; getUpdateUserTxns(user: AlgofiUser): Promise<any>; }