@algofi/js-sdk
Version:
The official Algofi JavaScript SDK
34 lines (33 loc) • 1.05 kB
TypeScript
import { Algodv2 } from "algosdk";
import AlgofiClient from "../../algofiClient";
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 the staking contracts from the config and update their
* internal object state with what is represented on chain.
*/
loadState(): Promise<void>;
/**
* Function to create a v1 staking user from an address.
*
* @param address - address of user
* @returns a constructed v1 staking user.
*/
getUser(address: string): StakingUser;
}