UNPKG

@dolomite-exchange/dolomite-margin

Version:

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

26 lines 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LiquidatorProxyV1 = void 0; const Helpers_1 = require("../lib/Helpers"); class LiquidatorProxyV1 { constructor(contracts) { this.contracts = contracts; } get address() { return this.contracts.liquidatorProxyV1.options.address; } // ============ State-Changing Functions ============ async liquidate(accountOwner, accountNumber, liquidOwner, liquidNumber, minLiquidatorRatio, minValueLiquidated, owedPreferences, heldPreferences, options = {}) { return this.contracts.callContractFunction(this.contracts.liquidatorProxyV1.methods.liquidate({ owner: accountOwner, number: accountNumber.toFixed(0), }, { owner: liquidOwner, number: liquidNumber.toFixed(0), }, { value: Helpers_1.decimalToString(minLiquidatorRatio), }, minValueLiquidated.toFixed(0), owedPreferences.map(x => x.toFixed(0)), heldPreferences.map(x => x.toFixed(0))), options); } } exports.LiquidatorProxyV1 = LiquidatorProxyV1; //# sourceMappingURL=LiquidatorProxyV1.js.map