UNPKG

@ajna-finance/sdk

Version:

A typescript SDK that can be used to create Dapps in Ajna ecosystem.

25 lines 1.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PoolUtils = void 0; const tslib_1 = require("tslib"); const pool_info_utils_1 = require("../contracts/pool-info-utils"); /** * Utilities which can be applied to any pool. */ class PoolUtils { constructor(provider) { this.setup = (signer) => { this.contract = (0, pool_info_utils_1.getPoolInfoUtilsContract)(signer); }; this.priceToIndex = (price) => tslib_1.__awaiter(this, void 0, void 0, function* () { return yield (0, pool_info_utils_1.priceToIndex)(this.contract, price); }); this.indexToPrice = (index) => tslib_1.__awaiter(this, void 0, void 0, function* () { return yield (0, pool_info_utils_1.indexToPrice)(this.contract, index); }); this.provider = provider; this.contract = (0, pool_info_utils_1.getPoolInfoUtilsContract)(this.provider); } } exports.PoolUtils = PoolUtils; //# sourceMappingURL=PoolUtils.js.map