UNPKG

@dolomite-exchange/dolomite-margin

Version:

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

26 lines 1.97 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BorrowPositionProxyV1 = void 0; class BorrowPositionProxyV1 { constructor(contracts) { this.contracts = contracts; } // ============ View Functions ============ async dolomiteMargin() { return this.contracts.callConstantContractFunction(this.contracts.borrowPositionProxyV1.methods.DOLOMITE_MARGIN()); } async openBorrowPosition(fromAccountNumber, toAccountNumber, marketId, amountWei, balanceCheckFlag, options = {}) { return this.contracts.callContractFunction(this.contracts.borrowPositionProxyV1.methods.openBorrowPosition(fromAccountNumber.toFixed(), toAccountNumber.toFixed(), marketId.toFixed(), amountWei.toFixed(), balanceCheckFlag), options); } async closeBorrowPosition(borrowAccountNumber, toAccountNumber, marketIds, options = {}) { return this.contracts.callContractFunction(this.contracts.borrowPositionProxyV1.methods.closeBorrowPosition(borrowAccountNumber.toFixed(), toAccountNumber.toFixed(), marketIds.map(marketId => marketId.toFixed())), options); } async transferBetweenAccounts(fromAccountNumber, toAccountNumber, marketId, amountWei, balanceCheckFlag, options = {}) { return this.contracts.callContractFunction(this.contracts.borrowPositionProxyV1.methods.transferBetweenAccounts(fromAccountNumber.toFixed(), toAccountNumber.toFixed(), marketId.toFixed(), amountWei.toFixed(), balanceCheckFlag), options); } async repayAllForBorrowPosition(fromAccountNumber, borrowAccountNumber, marketId, balanceCheckFlag, options = {}) { return this.contracts.callContractFunction(this.contracts.borrowPositionProxyV1.methods.repayAllForBorrowPosition(fromAccountNumber.toFixed(), borrowAccountNumber.toFixed(), marketId.toFixed(), balanceCheckFlag), options); } } exports.BorrowPositionProxyV1 = BorrowPositionProxyV1; //# sourceMappingURL=BorrowPositionProxyV1.js.map