@algofi/js-sdk
Version:
The official Algofi JavaScript SDK
25 lines (24 loc) • 798 B
TypeScript
import { Algodv2 } from "algosdk";
export default class Oracle {
algod: Algodv2;
appId: number;
priceFieldName: string;
scaleFactor: number;
underlyingAssetDecimals: number;
rawPrice: number;
price: number;
/**
* Constructor for the oracle object
*
* @param algod - algod client
* @param appId - appid of the oracle
* @param priceFieldName - price field name
* @param scaleFactor - scale factor for the asset price
* @param underlyingAssetDecimals - decimals for the asset
*/
constructor(algod: Algodv2, appId: number, priceFieldName: string, scaleFactor: number, underlyingAssetDecimals: number);
/**
* Sets raw price after getting global state.
*/
loadPrice(): Promise<void>;
}