UNPKG

@dolomite-exchange/dolomite-margin

Version:

Ethereum Smart Contracts and TypeScript library used for the DolomiteMargin trading protocol

32 lines 1.47 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.OracleSentinel = void 0; const bignumber_js_1 = __importDefault(require("bignumber.js")); class OracleSentinel { constructor(contracts, oracleSentinelAddress) { this.contracts = contracts; this.oracleSentinel = this.contracts.getOracleSentinel(oracleSentinelAddress); } get address() { return this.oracleSentinel.options.address; } async ownerSetGracePeriodDuration(gracePeriod, options) { return this.contracts.callContractFunction(this.oracleSentinel.methods.ownerSetGracePeriod(gracePeriod.toFixed()), options); } // ============ Getter Functions ============ async gracePeriod(options) { const value = await this.contracts.callConstantContractFunction(this.oracleSentinel.methods.gracePeriod(), options); return new bignumber_js_1.default(value); } async isBorrowAllowed(options) { return this.contracts.callConstantContractFunction(this.oracleSentinel.methods.isBorrowAllowed(), options); } async isLiquidationAllowed(options) { return this.contracts.callConstantContractFunction(this.oracleSentinel.methods.isLiquidationAllowed(), options); } } exports.OracleSentinel = OracleSentinel; //# sourceMappingURL=OracleSentinel.js.map