UNPKG

@algofi/lend

Version:

The official JavaScript SDK for the Algofi Lending Protocol

78 lines (77 loc) 2.26 kB
import algosdk from "algosdk"; import { Market } from "./market"; import { Manager } from "./manager"; export declare class RewardsProgram { algod: algosdk.Algodv2; latestRewardsTime: number; rewardsProgramNumber: number; rewardsAmount: number; rewardsPerSecond: number; rewardsAssetId: number; rewardsSecondaryRatio: number; rewardsSecondaryAssetId: number; /** * Constructor for RewardsProgram class * * @param algodClient - algod client * @param managerState - state of manager application we are interested in */ constructor(algodClient: algosdk.Algodv2, managerState: {}); /** * Return a list of current rewards assets * * @returns rewards asset list */ getRewardsAssetIds(): number[]; /** * Return latest rewards time * * @returns latest rewards time */ getLatestRewardsTime(): number; /** * Return rewards program number * * @returns rewards program number */ getRewardsProgramNumber(): number; /** * Return rewards amount * * @returns rewards amount */ getRewardsAmount(): number; /** * Return rewards per second * * @returns rewards per second */ getRewardsPerSecond(): number; /** * Return rewards asset id * * @returns rewards asset id */ getRewardsAssetId(): number; /** * Returns rewards secondary ratio * * @returns rewards secondary ratio */ getRewardsSecondaryRatio(): number; /** * Return rewards secondary asset id * * @returns rewards secondary asset id */ getRewardsSecondaryAssetId(): number; /** * Return the projected claimable rewards for a given storage address * * @param storageAddress - storage address of unrealized rewards * @param manager - manager for unrealized rewards * @param markets - list of markets for unrealized rewards * @returns two element list of primary and secondary unrealized rewards */ getStorageUnrealizedRewards(storageAddress: string, manager: Manager, markets: Market[]): Promise<number[]>; }