@algofi/js-sdk
Version:
The official Algofi JavaScript SDK
41 lines (40 loc) • 1.36 kB
TypeScript
import { Algodv2, Transaction } from "algosdk";
import { Network } from "../../globals";
import AlgofiClient from "../../algofiClient";
import AlgofiUser from "../../algofiUser";
import ManagerConfig from "./managerConfig";
import MarketConfig from "./marketConfig";
import Manager from "./manager";
import Market from "./market";
import LendingUser from "./lendingUser";
export default class LendingClient {
algofiClient: AlgofiClient;
algod: Algodv2;
network: Network;
managerConfig: ManagerConfig;
manager: Manager;
marketConfigs: MarketConfig[];
markets: {
[key: number]: Market;
};
/**
* Constructor for the algofi lending client.
*
* @param algofiClient - an instance of an algofi client
*/
constructor(algofiClient: AlgofiClient);
/**
* Call load stat eand update all of the user's market and load it into the object.
*/
loadState(): Promise<void>;
/**
* Returns a lending user with the given address.
*
* @param address - the address that we want to get the lending user for
*/
getUser(address: string): LendingUser;
getClaimRewardsTxns(user: AlgofiUser): Promise<Transaction[]>;
isLendingTransaction(txn: object): boolean;
getTotalSupplied(): number;
getTotalBorrowed(): number;
}