@algofi/js-sdk
Version:
The official Algofi JavaScript SDK
41 lines (40 loc) • 1.39 kB
TypeScript
import { Algodv2, Indexer } from "algosdk";
import AlgofiClient from "./algofiClient";
import ParsedTransaction, { TxnLoadMode } from "./parsedTransaction";
import BaseLendingUser from "./lending/baseLendingUser";
import BaseStakingUser from "./staking/baseStakingUser";
import BaseGovernanceUser from "./governance/baseGovernanceUser";
export default class AlgofiUser {
algofiClient: AlgofiClient;
algod: Algodv2;
indexer: Indexer;
address: string;
balances: {
[key: number]: number;
};
minBalance: number;
transactions: ParsedTransaction[];
lending: BaseLendingUser;
staking: BaseStakingUser;
governance: BaseGovernanceUser;
/**
* Constructor for the algofi client class.
*
* @param algofiClient - algofi client
* @param address - address for user
*/
constructor(algofiClient: AlgofiClient, address: string);
/**
* Function to load the states of all of the sub users on the algofi user
* class.
*/
loadState(): Promise<void>;
/**
* Function to determine whether someone is opted into an asset or not.
*
* @param assetId - asset id
* @returns whether or not the user is opted into the asset id.
*/
isOptedInToAsset(assetId: number): boolean;
getTransactionHistory(mode: TxnLoadMode): Promise<void>;
}