@mento-protocol/mento-sdk 3.0.0-beta.17 → 3.0.0-beta.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/abis/activePool.d.ts +2 -0
- package/dist/core/abis/activePool.d.ts.map +1 -0
- package/dist/core/abis/activePool.js +14 -0
- package/dist/core/abis/activePool.js.map +1 -0
- package/dist/core/abis/addressesRegistry.d.ts +2 -0
- package/dist/core/abis/addressesRegistry.d.ts.map +1 -0
- package/dist/core/abis/addressesRegistry.js +26 -0
- package/dist/core/abis/addressesRegistry.js.map +1 -0
- package/dist/core/abis/borrowerOperations.d.ts +9 -0
- package/dist/core/abis/borrowerOperations.d.ts.map +1 -0
- package/dist/core/abis/borrowerOperations.js +89 -0
- package/dist/core/abis/borrowerOperations.js.map +1 -0
- package/dist/core/abis/hintHelpers.d.ts +2 -0
- package/dist/core/abis/hintHelpers.d.ts.map +1 -0
- package/dist/core/abis/hintHelpers.js +14 -0
- package/dist/core/abis/hintHelpers.js.map +1 -0
- package/dist/core/abis/index.d.ts +10 -0
- package/dist/core/abis/index.d.ts.map +1 -1
- package/dist/core/abis/index.js +10 -0
- package/dist/core/abis/index.js.map +1 -1
- package/dist/core/abis/multiTroveGetter.d.ts +8 -0
- package/dist/core/abis/multiTroveGetter.d.ts.map +1 -0
- package/dist/core/abis/multiTroveGetter.js +15 -0
- package/dist/core/abis/multiTroveGetter.js.map +1 -0
- package/dist/core/abis/priceFeed.d.ts +7 -0
- package/dist/core/abis/priceFeed.d.ts.map +1 -0
- package/dist/core/abis/priceFeed.js +16 -0
- package/dist/core/abis/priceFeed.js.map +1 -0
- package/dist/core/abis/sortedTroves.d.ts +2 -0
- package/dist/core/abis/sortedTroves.d.ts.map +1 -0
- package/dist/core/abis/sortedTroves.js +15 -0
- package/dist/core/abis/sortedTroves.js.map +1 -0
- package/dist/core/abis/systemParams.d.ts +2 -0
- package/dist/core/abis/systemParams.d.ts.map +1 -0
- package/dist/core/abis/systemParams.js +14 -0
- package/dist/core/abis/systemParams.js.map +1 -0
- package/dist/core/abis/troveManager.d.ts +2 -0
- package/dist/core/abis/troveManager.d.ts.map +1 -0
- package/dist/core/abis/troveManager.js +27 -0
- package/dist/core/abis/troveManager.js.map +1 -0
- package/dist/core/abis/troveNFT.d.ts +2 -0
- package/dist/core/abis/troveNFT.d.ts.map +1 -0
- package/dist/core/abis/troveNFT.js +9 -0
- package/dist/core/abis/troveNFT.js.map +1 -0
- package/dist/core/constants/borrowConstants.d.ts +10 -0
- package/dist/core/constants/borrowConstants.d.ts.map +1 -0
- package/dist/core/constants/borrowConstants.js +16 -0
- package/dist/core/constants/borrowConstants.js.map +1 -0
- package/dist/core/constants/borrowRegistries.d.ts +7 -0
- package/dist/core/constants/borrowRegistries.d.ts.map +1 -0
- package/dist/core/constants/borrowRegistries.js +31 -0
- package/dist/core/constants/borrowRegistries.js.map +1 -0
- package/dist/core/constants/index.d.ts +2 -0
- package/dist/core/constants/index.d.ts.map +1 -1
- package/dist/core/constants/index.js +2 -0
- package/dist/core/constants/index.js.map +1 -1
- package/dist/core/types/borrow.d.ts +87 -0
- package/dist/core/types/borrow.d.ts.map +1 -0
- package/dist/core/types/borrow.js +3 -0
- package/dist/core/types/borrow.js.map +1 -0
- package/dist/core/types/index.d.ts +1 -0
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/core/types/index.js +1 -0
- package/dist/core/types/index.js.map +1 -1
- package/dist/core/types/liquidity.d.ts +10 -10
- package/dist/core/types/liquidity.d.ts.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -5
- package/dist/index.js.map +1 -1
- package/dist/services/borrow/BorrowService.d.ts +54 -0
- package/dist/services/borrow/BorrowService.d.ts.map +1 -0
- package/dist/services/borrow/BorrowService.js +129 -0
- package/dist/services/borrow/BorrowService.js.map +1 -0
- package/dist/services/borrow/borrowHelpers.d.ts +4 -0
- package/dist/services/borrow/borrowHelpers.d.ts.map +1 -0
- package/dist/services/borrow/borrowHelpers.js +13 -0
- package/dist/services/borrow/borrowHelpers.js.map +1 -0
- package/dist/services/borrow/borrowMath.d.ts +13 -0
- package/dist/services/borrow/borrowMath.d.ts.map +1 -0
- package/dist/services/borrow/borrowMath.js +129 -0
- package/dist/services/borrow/borrowMath.js.map +1 -0
- package/dist/services/borrow/index.d.ts +2 -0
- package/dist/services/borrow/index.d.ts.map +1 -0
- package/dist/services/borrow/index.js +18 -0
- package/dist/services/borrow/index.js.map +1 -0
- package/dist/services/borrow/internal/borrowApprovalService.d.ts +14 -0
- package/dist/services/borrow/internal/borrowApprovalService.d.ts.map +1 -0
- package/dist/services/borrow/internal/borrowApprovalService.js +53 -0
- package/dist/services/borrow/internal/borrowApprovalService.js.map +1 -0
- package/dist/services/borrow/internal/borrowContextStore.d.ts +11 -0
- package/dist/services/borrow/internal/borrowContextStore.d.ts.map +1 -0
- package/dist/services/borrow/internal/borrowContextStore.js +40 -0
- package/dist/services/borrow/internal/borrowContextStore.js.map +1 -0
- package/dist/services/borrow/internal/borrowErc20.d.ts +5 -0
- package/dist/services/borrow/internal/borrowErc20.d.ts.map +1 -0
- package/dist/services/borrow/internal/borrowErc20.js +43 -0
- package/dist/services/borrow/internal/borrowErc20.js.map +1 -0
- package/dist/services/borrow/internal/borrowHints.d.ts +7 -0
- package/dist/services/borrow/internal/borrowHints.d.ts.map +1 -0
- package/dist/services/borrow/internal/borrowHints.js +31 -0
- package/dist/services/borrow/internal/borrowHints.js.map +1 -0
- package/dist/services/borrow/internal/borrowPositionParser.d.ts +4 -0
- package/dist/services/borrow/internal/borrowPositionParser.d.ts.map +1 -0
- package/dist/services/borrow/internal/borrowPositionParser.js +87 -0
- package/dist/services/borrow/internal/borrowPositionParser.js.map +1 -0
- package/dist/services/borrow/internal/borrowReadService.d.ts +28 -0
- package/dist/services/borrow/internal/borrowReadService.d.ts.map +1 -0
- package/dist/services/borrow/internal/borrowReadService.js +218 -0
- package/dist/services/borrow/internal/borrowReadService.js.map +1 -0
- package/dist/services/borrow/internal/borrowRegistryReader.d.ts +5 -0
- package/dist/services/borrow/internal/borrowRegistryReader.d.ts.map +1 -0
- package/dist/services/borrow/internal/borrowRegistryReader.js +96 -0
- package/dist/services/borrow/internal/borrowRegistryReader.js.map +1 -0
- package/dist/services/borrow/internal/borrowTransactionService.d.ts +23 -0
- package/dist/services/borrow/internal/borrowTransactionService.d.ts.map +1 -0
- package/dist/services/borrow/internal/borrowTransactionService.js +276 -0
- package/dist/services/borrow/internal/borrowTransactionService.js.map +1 -0
- package/dist/services/borrow/internal/borrowTypes.d.ts +15 -0
- package/dist/services/borrow/internal/borrowTypes.d.ts.map +1 -0
- package/dist/services/borrow/internal/borrowTypes.js +3 -0
- package/dist/services/borrow/internal/borrowTypes.js.map +1 -0
- package/dist/services/borrow/internal/borrowValidation.d.ts +13 -0
- package/dist/services/borrow/internal/borrowValidation.d.ts.map +1 -0
- package/dist/services/borrow/internal/borrowValidation.js +96 -0
- package/dist/services/borrow/internal/borrowValidation.js.map +1 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +1 -0
- package/dist/services/index.js.map +1 -1
- package/dist/services/liquidity/LiquidityService.d.ts +10 -10
- package/dist/services/liquidity/LiquidityService.js +10 -10
- package/dist/services/liquidity/basicLiquidity.d.ts.map +1 -1
- package/dist/services/liquidity/basicLiquidity.js +6 -8
- package/dist/services/liquidity/basicLiquidity.js.map +1 -1
- package/dist/services/liquidity/liquidityHelpers.d.ts +1 -2
- package/dist/services/liquidity/liquidityHelpers.d.ts.map +1 -1
- package/dist/services/liquidity/liquidityHelpers.js +0 -4
- package/dist/services/liquidity/liquidityHelpers.js.map +1 -1
- package/dist/services/liquidity/zapHelpers.d.ts +9 -4
- package/dist/services/liquidity/zapHelpers.d.ts.map +1 -1
- package/dist/services/liquidity/zapHelpers.js +9 -4
- package/dist/services/liquidity/zapHelpers.js.map +1 -1
- package/dist/services/liquidity/zapIn.d.ts.map +1 -1
- package/dist/services/liquidity/zapIn.js +13 -9
- package/dist/services/liquidity/zapIn.js.map +1 -1
- package/dist/services/liquidity/zapOut.d.ts.map +1 -1
- package/dist/services/liquidity/zapOut.js +6 -4
- package/dist/services/liquidity/zapOut.js.map +1 -1
- package/dist/services/pools/PoolService.d.ts +13 -0
- package/dist/services/pools/PoolService.d.ts.map +1 -1
- package/dist/services/pools/PoolService.js +20 -2
- package/dist/services/pools/PoolService.js.map +1 -1
- package/dist/services/quotes/QuoteService.js.map +1 -1
- package/dist/services/swap/SwapService.d.ts +5 -5
- package/dist/services/swap/SwapService.d.ts.map +1 -1
- package/dist/services/swap/SwapService.js +7 -6
- package/dist/services/swap/SwapService.js.map +1 -1
- package/dist/utils/deadline.d.ts +21 -0
- package/dist/utils/deadline.d.ts.map +1 -0
- package/dist/utils/deadline.js +26 -0
- package/dist/utils/deadline.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/pathEncoder.d.ts +5 -0
- package/dist/utils/pathEncoder.d.ts.map +1 -1
- package/dist/utils/pathEncoder.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activePool.d.ts","sourceRoot":"","sources":["../../../src/core/abis/activePool.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,EAQtB,GAAG,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ACTIVE_POOL_ABI = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
exports.ACTIVE_POOL_ABI = (0, viem_1.parseAbi)([
|
|
6
|
+
'function getCollBalance() view returns (uint256)',
|
|
7
|
+
'function getBoldDebt() view returns (uint256)',
|
|
8
|
+
'function aggWeightedDebtSum() view returns (uint256)',
|
|
9
|
+
'function aggRecordedDebt() view returns (uint256)',
|
|
10
|
+
'function calcPendingAggInterest() view returns (uint256)',
|
|
11
|
+
'function hasBeenShutDown() view returns (bool)',
|
|
12
|
+
'function shutdownTime() view returns (uint256)',
|
|
13
|
+
]);
|
|
14
|
+
//# sourceMappingURL=activePool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activePool.js","sourceRoot":"","sources":["../../../src/core/abis/activePool.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAElB,QAAA,eAAe,GAAG,IAAA,eAAQ,EAAC;IACtC,kDAAkD;IAClD,+CAA+C;IAC/C,sDAAsD;IACtD,mDAAmD;IACnD,0DAA0D;IAC1D,gDAAgD;IAChD,gDAAgD;CACjD,CAAQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addressesRegistry.d.ts","sourceRoot":"","sources":["../../../src/core/abis/addressesRegistry.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,EAoB7B,GAAG,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ADDRESSES_REGISTRY_ABI = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
exports.ADDRESSES_REGISTRY_ABI = (0, viem_1.parseAbi)([
|
|
6
|
+
'function collToken() view returns (address)',
|
|
7
|
+
'function borrowerOperations() view returns (address)',
|
|
8
|
+
'function troveManager() view returns (address)',
|
|
9
|
+
'function troveNFT() view returns (address)',
|
|
10
|
+
'function metadataNFT() view returns (address)',
|
|
11
|
+
'function stabilityPool() view returns (address)',
|
|
12
|
+
'function priceFeed() view returns (address)',
|
|
13
|
+
'function activePool() view returns (address)',
|
|
14
|
+
'function defaultPool() view returns (address)',
|
|
15
|
+
'function gasPoolAddress() view returns (address)',
|
|
16
|
+
'function collSurplusPool() view returns (address)',
|
|
17
|
+
'function sortedTroves() view returns (address)',
|
|
18
|
+
'function interestRouter() view returns (address)',
|
|
19
|
+
'function hintHelpers() view returns (address)',
|
|
20
|
+
'function multiTroveGetter() view returns (address)',
|
|
21
|
+
'function collateralRegistry() view returns (address)',
|
|
22
|
+
'function boldToken() view returns (address)',
|
|
23
|
+
'function gasToken() view returns (address)',
|
|
24
|
+
'function liquidityStrategy() view returns (address)',
|
|
25
|
+
]);
|
|
26
|
+
//# sourceMappingURL=addressesRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addressesRegistry.js","sourceRoot":"","sources":["../../../src/core/abis/addressesRegistry.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAElB,QAAA,sBAAsB,GAAG,IAAA,eAAQ,EAAC;IAC7C,6CAA6C;IAC7C,sDAAsD;IACtD,gDAAgD;IAChD,4CAA4C;IAC5C,+CAA+C;IAC/C,iDAAiD;IACjD,6CAA6C;IAC7C,8CAA8C;IAC9C,+CAA+C;IAC/C,kDAAkD;IAClD,mDAAmD;IACnD,gDAAgD;IAChD,kDAAkD;IAClD,+CAA+C;IAC/C,oDAAoD;IACpD,sDAAsD;IACtD,6CAA6C;IAC7C,4CAA4C;IAC5C,qDAAqD;CACtD,CAAQ,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BorrowerOperations ABI for Bold protocol trove operations
|
|
3
|
+
*
|
|
4
|
+
* Note: `as any` is used because viem's parseAbi returns a complex readonly tuple type
|
|
5
|
+
* that can cause type verbosity. This doesn't compromise type safety - viem's
|
|
6
|
+
* readContract/writeContract still infer types correctly from the ABI at usage sites.
|
|
7
|
+
*/
|
|
8
|
+
export declare const BORROWER_OPERATIONS_ABI: any;
|
|
9
|
+
//# sourceMappingURL=borrowerOperations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"borrowerOperations.d.ts","sourceRoot":"","sources":["../../../src/core/abis/borrowerOperations.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,EAmF9B,GAAG,CAAA"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BORROWER_OPERATIONS_ABI = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
/**
|
|
6
|
+
* BorrowerOperations ABI for Bold protocol trove operations
|
|
7
|
+
*
|
|
8
|
+
* Note: `as any` is used because viem's parseAbi returns a complex readonly tuple type
|
|
9
|
+
* that can cause type verbosity. This doesn't compromise type safety - viem's
|
|
10
|
+
* readContract/writeContract still infer types correctly from the ABI at usage sites.
|
|
11
|
+
*/
|
|
12
|
+
exports.BORROWER_OPERATIONS_ABI = (0, viem_1.parseAbi)([
|
|
13
|
+
// Core trove operations
|
|
14
|
+
'function openTrove(address _owner, uint256 _ownerIndex, uint256 _ETHAmount, uint256 _boldAmount, uint256 _upperHint, uint256 _lowerHint, uint256 _annualInterestRate, uint256 _maxUpfrontFee, address _addManager, address _removeManager, address _receiver) returns (uint256)',
|
|
15
|
+
'function openTroveAndJoinInterestBatchManager((address owner, uint256 ownerIndex, uint256 collAmount, uint256 boldAmount, uint256 upperHint, uint256 lowerHint, address interestBatchManager, uint256 maxUpfrontFee, address addManager, address removeManager, address receiver) _params) returns (uint256)',
|
|
16
|
+
'function addColl(uint256 _troveId, uint256 _ETHAmount)',
|
|
17
|
+
'function withdrawColl(uint256 _troveId, uint256 _amount)',
|
|
18
|
+
'function withdrawBold(uint256 _troveId, uint256 _amount, uint256 _maxUpfrontFee)',
|
|
19
|
+
'function repayBold(uint256 _troveId, uint256 _amount)',
|
|
20
|
+
'function closeTrove(uint256 _troveId)',
|
|
21
|
+
'function adjustTrove(uint256 _troveId, uint256 _collChange, bool _isCollIncrease, uint256 _debtChange, bool isDebtIncrease, uint256 _maxUpfrontFee)',
|
|
22
|
+
'function adjustZombieTrove(uint256 _troveId, uint256 _collChange, bool _isCollIncrease, uint256 _boldChange, bool _isDebtIncrease, uint256 _upperHint, uint256 _lowerHint, uint256 _maxUpfrontFee)',
|
|
23
|
+
'function adjustTroveInterestRate(uint256 _troveId, uint256 _newAnnualInterestRate, uint256 _upperHint, uint256 _lowerHint, uint256 _maxUpfrontFee)',
|
|
24
|
+
'function applyPendingDebt(uint256 _troveId, uint256 _lowerHint, uint256 _upperHint)',
|
|
25
|
+
'function claimCollateral()',
|
|
26
|
+
// Batch manager operations
|
|
27
|
+
'function setInterestBatchManager(uint256 _troveId, address _newBatchManager, uint256 _upperHint, uint256 _lowerHint, uint256 _maxUpfrontFee)',
|
|
28
|
+
'function removeFromBatch(uint256 _troveId, uint256 _newAnnualInterestRate, uint256 _upperHint, uint256 _lowerHint, uint256 _maxUpfrontFee)',
|
|
29
|
+
'function switchBatchManager(uint256 _troveId, uint256 _removeUpperHint, uint256 _removeLowerHint, address _newBatchManager, uint256 _addUpperHint, uint256 _addLowerHint, uint256 _maxUpfrontFee)',
|
|
30
|
+
// Individual delegate
|
|
31
|
+
'function setInterestIndividualDelegate(uint256 _troveId, address _delegate, uint128 _minInterestRate, uint128 _maxInterestRate, uint256 _newAnnualInterestRate, uint256 _upperHint, uint256 _lowerHint, uint256 _maxUpfrontFee, uint256 _minInterestRateChangePeriod)',
|
|
32
|
+
'function removeInterestIndividualDelegate(uint256 _troveId)',
|
|
33
|
+
// View functions
|
|
34
|
+
'function hasBeenShutDown() view returns (bool)',
|
|
35
|
+
'function interestBatchManagerOf(uint256 _troveId) view returns (address)',
|
|
36
|
+
'function getInterestBatchManager(address _account) view returns ((uint128 minInterestRate, uint128 maxInterestRate, uint256 minInterestRateChangePeriod))',
|
|
37
|
+
'function checkBatchManagerExists(address _batchManager) view returns (bool)',
|
|
38
|
+
'function getInterestIndividualDelegateOf(uint256 _troveId) view returns ((address account, uint128 minInterestRate, uint128 maxInterestRate, uint256 minInterestRateChangePeriod))',
|
|
39
|
+
// Inherited view functions from LiquityBase
|
|
40
|
+
'function getEntireBranchDebt() view returns (uint256)',
|
|
41
|
+
'function getEntireBranchColl() view returns (uint256)',
|
|
42
|
+
'function systemParams() view returns (address)',
|
|
43
|
+
'function CCR() view returns (uint256)',
|
|
44
|
+
'function MCR() view returns (uint256)',
|
|
45
|
+
// Custom errors (BorrowerOperations.sol)
|
|
46
|
+
'error IsShutDown()',
|
|
47
|
+
'error TCRNotBelowSCR()',
|
|
48
|
+
'error ZeroAdjustment()',
|
|
49
|
+
'error NotOwnerNorInterestManager()',
|
|
50
|
+
'error TroveInBatch()',
|
|
51
|
+
'error TroveNotInBatch()',
|
|
52
|
+
'error InterestNotInRange()',
|
|
53
|
+
'error BatchInterestRateChangePeriodNotPassed()',
|
|
54
|
+
'error DelegateInterestRateChangePeriodNotPassed()',
|
|
55
|
+
'error TroveExists()',
|
|
56
|
+
'error TroveNotOpen()',
|
|
57
|
+
'error TroveNotActive()',
|
|
58
|
+
'error TroveNotZombie()',
|
|
59
|
+
'error TroveWithZeroDebt()',
|
|
60
|
+
'error UpfrontFeeTooHigh()',
|
|
61
|
+
'error ICRBelowMCR()',
|
|
62
|
+
'error ICRBelowMCRPlusBCR()',
|
|
63
|
+
'error RepaymentNotMatchingCollWithdrawal()',
|
|
64
|
+
'error TCRBelowCCR()',
|
|
65
|
+
'error DebtBelowMin()',
|
|
66
|
+
'error CollWithdrawalTooHigh()',
|
|
67
|
+
'error NotEnoughBoldBalance()',
|
|
68
|
+
'error InterestRateTooLow()',
|
|
69
|
+
'error InterestRateTooHigh()',
|
|
70
|
+
'error InterestRateNotNew()',
|
|
71
|
+
'error InvalidInterestBatchManager()',
|
|
72
|
+
'error BatchManagerExists()',
|
|
73
|
+
'error BatchManagerNotNew()',
|
|
74
|
+
'error NewFeeNotLower()',
|
|
75
|
+
'error CallerNotTroveManager()',
|
|
76
|
+
'error CallerNotPriceFeed()',
|
|
77
|
+
'error CallerNotSelf()',
|
|
78
|
+
'error MinGeMax()',
|
|
79
|
+
'error AnnualManagementFeeTooHigh()',
|
|
80
|
+
'error MinInterestRateChangePeriodTooLow()',
|
|
81
|
+
'error NewOracleFailureDetected()',
|
|
82
|
+
'error BatchSharesRatioTooLow()',
|
|
83
|
+
// Custom errors (inherited from AddRemoveManagers)
|
|
84
|
+
'error EmptyManager()',
|
|
85
|
+
'error NotBorrower()',
|
|
86
|
+
'error NotOwnerNorAddManager()',
|
|
87
|
+
'error NotOwnerNorRemoveManager()',
|
|
88
|
+
]);
|
|
89
|
+
//# sourceMappingURL=borrowerOperations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"borrowerOperations.js","sourceRoot":"","sources":["../../../src/core/abis/borrowerOperations.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAE/B;;;;;;GAMG;AACU,QAAA,uBAAuB,GAAG,IAAA,eAAQ,EAAC;IAC9C,wBAAwB;IACxB,iRAAiR;IACjR,8SAA8S;IAC9S,wDAAwD;IACxD,0DAA0D;IAC1D,kFAAkF;IAClF,uDAAuD;IACvD,uCAAuC;IACvC,qJAAqJ;IACrJ,oMAAoM;IACpM,oJAAoJ;IACpJ,qFAAqF;IACrF,4BAA4B;IAE5B,2BAA2B;IAC3B,8IAA8I;IAC9I,4IAA4I;IAC5I,mMAAmM;IAEnM,sBAAsB;IACtB,uQAAuQ;IACvQ,6DAA6D;IAE7D,iBAAiB;IACjB,gDAAgD;IAChD,0EAA0E;IAC1E,2JAA2J;IAC3J,6EAA6E;IAC7E,oLAAoL;IAEpL,4CAA4C;IAC5C,uDAAuD;IACvD,uDAAuD;IAEvD,gDAAgD;IAChD,uCAAuC;IACvC,uCAAuC;IAEvC,yCAAyC;IACzC,oBAAoB;IACpB,wBAAwB;IACxB,wBAAwB;IACxB,oCAAoC;IACpC,sBAAsB;IACtB,yBAAyB;IACzB,4BAA4B;IAC5B,gDAAgD;IAChD,mDAAmD;IACnD,qBAAqB;IACrB,sBAAsB;IACtB,wBAAwB;IACxB,wBAAwB;IACxB,2BAA2B;IAC3B,2BAA2B;IAC3B,qBAAqB;IACrB,4BAA4B;IAC5B,4CAA4C;IAC5C,qBAAqB;IACrB,sBAAsB;IACtB,+BAA+B;IAC/B,8BAA8B;IAC9B,4BAA4B;IAC5B,6BAA6B;IAC7B,4BAA4B;IAC5B,qCAAqC;IACrC,4BAA4B;IAC5B,4BAA4B;IAC5B,wBAAwB;IACxB,+BAA+B;IAC/B,4BAA4B;IAC5B,uBAAuB;IACvB,kBAAkB;IAClB,oCAAoC;IACpC,2CAA2C;IAC3C,kCAAkC;IAClC,gCAAgC;IAEhC,mDAAmD;IACnD,sBAAsB;IACtB,qBAAqB;IACrB,+BAA+B;IAC/B,kCAAkC;CACnC,CAAQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hintHelpers.d.ts","sourceRoot":"","sources":["../../../src/core/abis/hintHelpers.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,EAQvB,GAAG,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HINT_HELPERS_ABI = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
exports.HINT_HELPERS_ABI = (0, viem_1.parseAbi)([
|
|
6
|
+
'function getApproxHint(uint256 _collIndex, uint256 _interestRate, uint256 _numTrials, uint256 _inputRandomSeed) view returns (uint256 hintId, uint256 diff, uint256 latestRandomSeed)',
|
|
7
|
+
'function predictOpenTroveUpfrontFee(uint256 _collIndex, uint256 _borrowedAmount, uint256 _interestRate) view returns (uint256)',
|
|
8
|
+
'function predictAdjustTroveUpfrontFee(uint256 _collIndex, uint256 _troveId, uint256 _debtIncrease) view returns (uint256)',
|
|
9
|
+
'function predictAdjustInterestRateUpfrontFee(uint256 _collIndex, uint256 _troveId, uint256 _newInterestRate) view returns (uint256)',
|
|
10
|
+
'function forcePredictAdjustInterestRateUpfrontFee(uint256 _collIndex, uint256 _troveId, uint256 _newInterestRate) view returns (uint256)',
|
|
11
|
+
'function predictAdjustBatchInterestRateUpfrontFee(uint256 _collIndex, address _batchAddress, uint256 _newInterestRate) view returns (uint256)',
|
|
12
|
+
'function predictJoinBatchInterestRateUpfrontFee(uint256 _collIndex, uint256 _troveId, address _batchAddress) view returns (uint256)',
|
|
13
|
+
]);
|
|
14
|
+
//# sourceMappingURL=hintHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hintHelpers.js","sourceRoot":"","sources":["../../../src/core/abis/hintHelpers.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAElB,QAAA,gBAAgB,GAAG,IAAA,eAAQ,EAAC;IACvC,uLAAuL;IACvL,gIAAgI;IAChI,2HAA2H;IAC3H,qIAAqI;IACrI,0IAA0I;IAC1I,+IAA+I;IAC/I,qIAAqI;CACtI,CAAQ,CAAA"}
|
|
@@ -9,4 +9,14 @@ export * from './virtualPoolFactory';
|
|
|
9
9
|
export * from './virtualPool';
|
|
10
10
|
export * from './router';
|
|
11
11
|
export * from './breakerbox';
|
|
12
|
+
export * from './borrowerOperations';
|
|
13
|
+
export * from './troveManager';
|
|
14
|
+
export * from './hintHelpers';
|
|
15
|
+
export * from './sortedTroves';
|
|
16
|
+
export * from './activePool';
|
|
17
|
+
export * from './multiTroveGetter';
|
|
18
|
+
export * from './troveNFT';
|
|
19
|
+
export * from './priceFeed';
|
|
20
|
+
export * from './addressesRegistry';
|
|
21
|
+
export * from './systemParams';
|
|
12
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/abis/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,QAAQ,CAAA;AACtB,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/abis/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,QAAQ,CAAA;AACtB,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,gBAAgB,CAAA"}
|
package/dist/core/abis/index.js
CHANGED
|
@@ -25,4 +25,14 @@ __exportStar(require("./virtualPoolFactory"), exports);
|
|
|
25
25
|
__exportStar(require("./virtualPool"), exports);
|
|
26
26
|
__exportStar(require("./router"), exports);
|
|
27
27
|
__exportStar(require("./breakerbox"), exports);
|
|
28
|
+
__exportStar(require("./borrowerOperations"), exports);
|
|
29
|
+
__exportStar(require("./troveManager"), exports);
|
|
30
|
+
__exportStar(require("./hintHelpers"), exports);
|
|
31
|
+
__exportStar(require("./sortedTroves"), exports);
|
|
32
|
+
__exportStar(require("./activePool"), exports);
|
|
33
|
+
__exportStar(require("./multiTroveGetter"), exports);
|
|
34
|
+
__exportStar(require("./troveNFT"), exports);
|
|
35
|
+
__exportStar(require("./priceFeed"), exports);
|
|
36
|
+
__exportStar(require("./addressesRegistry"), exports);
|
|
37
|
+
__exportStar(require("./systemParams"), exports);
|
|
28
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/abis/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,4CAAyB;AACzB,kDAA+B;AAC/B,8CAA2B;AAC3B,2CAAwB;AACxB,gDAA6B;AAC7B,yCAAsB;AACtB,uDAAoC;AACpC,gDAA6B;AAC7B,2CAAwB;AACxB,+CAA4B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/abis/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,4CAAyB;AACzB,kDAA+B;AAC/B,8CAA2B;AAC3B,2CAAwB;AACxB,gDAA6B;AAC7B,yCAAsB;AACtB,uDAAoC;AACpC,gDAA6B;AAC7B,2CAAwB;AACxB,+CAA4B;AAC5B,uDAAoC;AACpC,iDAA8B;AAC9B,gDAA6B;AAC7B,iDAA8B;AAC9B,+CAA4B;AAC5B,qDAAkC;AAClC,6CAA0B;AAC1B,8CAA2B;AAC3B,sDAAmC;AACnC,iDAA8B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MultiTroveGetter ABI for batch trove queries
|
|
3
|
+
*
|
|
4
|
+
* Source: MultiTroveGetter.sol
|
|
5
|
+
* Note: Both functions require `_collIndex` as first param — SDK passes `0n`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const MULTI_TROVE_GETTER_ABI: any;
|
|
8
|
+
//# sourceMappingURL=multiTroveGetter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiTroveGetter.d.ts","sourceRoot":"","sources":["../../../src/core/abis/multiTroveGetter.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAG7B,GAAG,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MULTI_TROVE_GETTER_ABI = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
/**
|
|
6
|
+
* MultiTroveGetter ABI for batch trove queries
|
|
7
|
+
*
|
|
8
|
+
* Source: MultiTroveGetter.sol
|
|
9
|
+
* Note: Both functions require `_collIndex` as first param — SDK passes `0n`.
|
|
10
|
+
*/
|
|
11
|
+
exports.MULTI_TROVE_GETTER_ABI = (0, viem_1.parseAbi)([
|
|
12
|
+
'function getMultipleSortedTroves(uint256 _collIndex, int256 _startIdx, uint256 _count) view returns ((uint256 id, uint256 entireDebt, uint256 entireColl, uint256 redistBoldDebtGain, uint256 redistCollGain, uint256 accruedInterest, uint256 recordedDebt, uint256 annualInterestRate, uint256 accruedBatchManagementFee, uint256 lastInterestRateAdjTime, uint256 stake, uint256 lastDebtUpdateTime, address interestBatchManager, uint256 batchDebtShares, uint256 snapshotETH, uint256 snapshotBoldDebt)[])',
|
|
13
|
+
'function getDebtPerInterestRateAscending(uint256 _collIndex, uint256 _startId, uint256 _maxIterations) view returns ((address interestBatchManager, uint256 interestRate, uint256 debt)[] data, uint256 currId)',
|
|
14
|
+
]);
|
|
15
|
+
//# sourceMappingURL=multiTroveGetter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiTroveGetter.js","sourceRoot":"","sources":["../../../src/core/abis/multiTroveGetter.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAE/B;;;;;GAKG;AACU,QAAA,sBAAsB,GAAG,IAAA,eAAQ,EAAC;IAC7C,kfAAkf;IAClf,iNAAiN;CAClN,CAAQ,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deliberate frontend-read shim:
|
|
3
|
+
* `fetchPrice` is non-view in source contracts, but marked `view` here so it can
|
|
4
|
+
* be called via `readContract`/`eth_call` without write simulation.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PRICE_FEED_ABI: any;
|
|
7
|
+
//# sourceMappingURL=priceFeed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"priceFeed.d.ts","sourceRoot":"","sources":["../../../src/core/abis/priceFeed.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAKrB,GAAG,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PRICE_FEED_ABI = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
/**
|
|
6
|
+
* Deliberate frontend-read shim:
|
|
7
|
+
* `fetchPrice` is non-view in source contracts, but marked `view` here so it can
|
|
8
|
+
* be called via `readContract`/`eth_call` without write simulation.
|
|
9
|
+
*/
|
|
10
|
+
exports.PRICE_FEED_ABI = (0, viem_1.parseAbi)([
|
|
11
|
+
'function fetchPrice() view returns (uint256)',
|
|
12
|
+
'function lastValidPrice() view returns (uint256)',
|
|
13
|
+
'function isL2SequencerUp() view returns (bool)',
|
|
14
|
+
'function isShutdown() view returns (bool)',
|
|
15
|
+
]);
|
|
16
|
+
//# sourceMappingURL=priceFeed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"priceFeed.js","sourceRoot":"","sources":["../../../src/core/abis/priceFeed.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAE/B;;;;GAIG;AACU,QAAA,cAAc,GAAG,IAAA,eAAQ,EAAC;IACrC,8CAA8C;IAC9C,kDAAkD;IAClD,gDAAgD;IAChD,2CAA2C;CAC5C,CAAQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortedTroves.d.ts","sourceRoot":"","sources":["../../../src/core/abis/sortedTroves.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,EASxB,GAAG,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SORTED_TROVES_ABI = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
exports.SORTED_TROVES_ABI = (0, viem_1.parseAbi)([
|
|
6
|
+
'function findInsertPosition(uint256 _annualInterestRate, uint256 _prevId, uint256 _nextId) view returns (uint256, uint256)',
|
|
7
|
+
'function getSize() view returns (uint256)',
|
|
8
|
+
'function getFirst() view returns (uint256)',
|
|
9
|
+
'function getLast() view returns (uint256)',
|
|
10
|
+
'function getNext(uint256 _id) view returns (uint256)',
|
|
11
|
+
'function getPrev(uint256 _id) view returns (uint256)',
|
|
12
|
+
'function contains(uint256 _id) view returns (bool)',
|
|
13
|
+
'function isEmpty() view returns (bool)',
|
|
14
|
+
]);
|
|
15
|
+
//# sourceMappingURL=sortedTroves.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortedTroves.js","sourceRoot":"","sources":["../../../src/core/abis/sortedTroves.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAElB,QAAA,iBAAiB,GAAG,IAAA,eAAQ,EAAC;IACxC,4HAA4H;IAC5H,2CAA2C;IAC3C,4CAA4C;IAC5C,2CAA2C;IAC3C,sDAAsD;IACtD,sDAAsD;IACtD,oDAAoD;IACpD,wCAAwC;CACzC,CAAQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"systemParams.d.ts","sourceRoot":"","sources":["../../../src/core/abis/systemParams.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,EAQxB,GAAG,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SYSTEM_PARAMS_ABI = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
exports.SYSTEM_PARAMS_ABI = (0, viem_1.parseAbi)([
|
|
6
|
+
'function CCR() view returns (uint256)',
|
|
7
|
+
'function MCR() view returns (uint256)',
|
|
8
|
+
'function SCR() view returns (uint256)',
|
|
9
|
+
'function BCR() view returns (uint256)',
|
|
10
|
+
'function MIN_DEBT() view returns (uint256)',
|
|
11
|
+
'function ETH_GAS_COMPENSATION() view returns (uint256)',
|
|
12
|
+
'function MIN_ANNUAL_INTEREST_RATE() view returns (uint256)',
|
|
13
|
+
]);
|
|
14
|
+
//# sourceMappingURL=systemParams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"systemParams.js","sourceRoot":"","sources":["../../../src/core/abis/systemParams.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAElB,QAAA,iBAAiB,GAAG,IAAA,eAAQ,EAAC;IACxC,uCAAuC;IACvC,uCAAuC;IACvC,uCAAuC;IACvC,uCAAuC;IACvC,4CAA4C;IAC5C,wDAAwD;IACxD,4DAA4D;CAC7D,CAAQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"troveManager.d.ts","sourceRoot":"","sources":["../../../src/core/abis/troveManager.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,EAsBxB,GAAG,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TROVE_MANAGER_ABI = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
exports.TROVE_MANAGER_ABI = (0, viem_1.parseAbi)([
|
|
6
|
+
'function getLatestTroveData(uint256 _troveId) view returns ((uint256 entireDebt, uint256 entireColl, uint256 redistBoldDebtGain, uint256 redistCollGain, uint256 accruedInterest, uint256 recordedDebt, uint256 annualInterestRate, uint256 weightedRecordedDebt, uint256 accruedBatchManagementFee, uint256 lastInterestRateAdjTime))',
|
|
7
|
+
'function getTroveStatus(uint256 _troveId) view returns (uint8)',
|
|
8
|
+
'function getTroveAnnualInterestRate(uint256 _troveId) view returns (uint256)',
|
|
9
|
+
'function Troves(uint256 _id) view returns (uint256 debt, uint256 coll, uint256 stake, uint8 status, uint64 arrayIndex, uint64 lastDebtUpdateTime, uint64 lastInterestRateAdjTime, uint256 annualInterestRate, address interestBatchManager, uint256 batchDebtShares)',
|
|
10
|
+
'function getCurrentICR(uint256 _troveId, uint256 _price) view returns (uint256)',
|
|
11
|
+
'function getTroveIdsCount() view returns (uint256)',
|
|
12
|
+
'function getTroveFromTroveIdsArray(uint256 _index) view returns (uint256)',
|
|
13
|
+
'function shutdownTime() view returns (uint256)',
|
|
14
|
+
// Custom errors
|
|
15
|
+
'error EmptyData()',
|
|
16
|
+
'error NothingToLiquidate()',
|
|
17
|
+
'error CallerNotBorrowerOperations()',
|
|
18
|
+
'error CallerNotCollateralRegistry()',
|
|
19
|
+
'error OnlyOneTroveLeft()',
|
|
20
|
+
'error NotShutDown()',
|
|
21
|
+
'error ZeroAmount()',
|
|
22
|
+
'error NotEnoughBoldBalance()',
|
|
23
|
+
'error MinCollNotReached(uint256 _coll)',
|
|
24
|
+
'error BatchSharesRatioTooHigh()',
|
|
25
|
+
'error L2SequencerDown()',
|
|
26
|
+
]);
|
|
27
|
+
//# sourceMappingURL=troveManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"troveManager.js","sourceRoot":"","sources":["../../../src/core/abis/troveManager.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAElB,QAAA,iBAAiB,GAAG,IAAA,eAAQ,EAAC;IACxC,wUAAwU;IACxU,gEAAgE;IAChE,8EAA8E;IAC9E,sQAAsQ;IACtQ,iFAAiF;IACjF,oDAAoD;IACpD,2EAA2E;IAC3E,gDAAgD;IAEhD,gBAAgB;IAChB,mBAAmB;IACnB,4BAA4B;IAC5B,qCAAqC;IACrC,qCAAqC;IACrC,0BAA0B;IAC1B,qBAAqB;IACrB,oBAAoB;IACpB,8BAA8B;IAC9B,wCAAwC;IACxC,iCAAiC;IACjC,yBAAyB;CAC1B,CAAQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"troveNFT.d.ts","sourceRoot":"","sources":["../../../src/core/abis/troveNFT.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,EAGpB,GAAG,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TROVE_NFT_ABI = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
exports.TROVE_NFT_ABI = (0, viem_1.parseAbi)([
|
|
6
|
+
'function balanceOf(address owner) view returns (uint256)',
|
|
7
|
+
'function ownerOf(uint256 tokenId) view returns (address)',
|
|
8
|
+
]);
|
|
9
|
+
//# sourceMappingURL=troveNFT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"troveNFT.js","sourceRoot":"","sources":["../../../src/core/abis/troveNFT.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAElB,QAAA,aAAa,GAAG,IAAA,eAAQ,EAAC;IACpC,0DAA0D;IAC1D,0DAA0D;CAC3D,CAAQ,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const MAX_ANNUAL_INTEREST_RATE = 2500000000000000000n;
|
|
2
|
+
export declare const UPFRONT_INTEREST_PERIOD = 604800;
|
|
3
|
+
export declare const INTEREST_RATE_ADJ_COOLDOWN = 604800;
|
|
4
|
+
export declare const MAX_LTV_ALLOWED_RATIO = 916n;
|
|
5
|
+
export declare const LTV_RISK_MEDIUM = 540n;
|
|
6
|
+
export declare const LTV_RISK_HIGH = 730n;
|
|
7
|
+
export declare const REDEMPTION_RISK_MEDIUM = 50n;
|
|
8
|
+
export declare const REDEMPTION_RISK_LOW = 600n;
|
|
9
|
+
export declare const COLL_INDEX = 0n;
|
|
10
|
+
//# sourceMappingURL=borrowConstants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"borrowConstants.d.ts","sourceRoot":"","sources":["../../../src/core/constants/borrowConstants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,wBAAwB,uBAA6B,CAAA;AAClE,eAAO,MAAM,uBAAuB,SAAU,CAAA;AAC9C,eAAO,MAAM,0BAA0B,SAAU,CAAA;AAGjD,eAAO,MAAM,qBAAqB,OAAO,CAAA;AACzC,eAAO,MAAM,eAAe,OAAO,CAAA;AACnC,eAAO,MAAM,aAAa,OAAO,CAAA;AACjC,eAAO,MAAM,sBAAsB,MAAM,CAAA;AACzC,eAAO,MAAM,mBAAmB,OAAO,CAAA;AAGvC,eAAO,MAAM,UAAU,KAAK,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.COLL_INDEX = exports.REDEMPTION_RISK_LOW = exports.REDEMPTION_RISK_MEDIUM = exports.LTV_RISK_HIGH = exports.LTV_RISK_MEDIUM = exports.MAX_LTV_ALLOWED_RATIO = exports.INTEREST_RATE_ADJ_COOLDOWN = exports.UPFRONT_INTEREST_PERIOD = exports.MAX_ANNUAL_INTEREST_RATE = void 0;
|
|
4
|
+
// Compile-time constants from Constants.sol
|
|
5
|
+
exports.MAX_ANNUAL_INTEREST_RATE = 2500000000000000000n; // 250%
|
|
6
|
+
exports.UPFRONT_INTEREST_PERIOD = 604800; // 7 days in seconds
|
|
7
|
+
exports.INTEREST_RATE_ADJ_COOLDOWN = 604800; // 7 days in seconds
|
|
8
|
+
// UI-level constants from Bold frontend (constants.ts)
|
|
9
|
+
exports.MAX_LTV_ALLOWED_RATIO = 916n; // 91.6% (per-mille)
|
|
10
|
+
exports.LTV_RISK_MEDIUM = 540n; // 54% of maxLtv
|
|
11
|
+
exports.LTV_RISK_HIGH = 730n; // 73% of maxLtv
|
|
12
|
+
exports.REDEMPTION_RISK_MEDIUM = 50n; // 5% of total debt
|
|
13
|
+
exports.REDEMPTION_RISK_LOW = 600n; // 60% of total debt
|
|
14
|
+
// Single branch index for Mento
|
|
15
|
+
exports.COLL_INDEX = 0n;
|
|
16
|
+
//# sourceMappingURL=borrowConstants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"borrowConstants.js","sourceRoot":"","sources":["../../../src/core/constants/borrowConstants.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC/B,QAAA,wBAAwB,GAAG,oBAA0B,CAAA,CAAC,OAAO;AAC7D,QAAA,uBAAuB,GAAG,MAAO,CAAA,CAAC,oBAAoB;AACtD,QAAA,0BAA0B,GAAG,MAAO,CAAA,CAAC,oBAAoB;AAEtE,uDAAuD;AAC1C,QAAA,qBAAqB,GAAG,IAAI,CAAA,CAAC,oBAAoB;AACjD,QAAA,eAAe,GAAG,IAAI,CAAA,CAAC,gBAAgB;AACvC,QAAA,aAAa,GAAG,IAAI,CAAA,CAAC,gBAAgB;AACrC,QAAA,sBAAsB,GAAG,GAAG,CAAA,CAAC,mBAAmB;AAChD,QAAA,mBAAmB,GAAG,IAAI,CAAA,CAAC,oBAAoB;AAE5D,gCAAgC;AACnB,QAAA,UAAU,GAAG,EAAE,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Known AddressesRegistry contracts per chain, keyed by debt token symbol.
|
|
3
|
+
* Each registry is the entry point for one Bold deployment.
|
|
4
|
+
*/
|
|
5
|
+
export declare const borrowRegistries: Record<number, Record<string, string>>;
|
|
6
|
+
export declare function getBorrowRegistry(chainId: number, debtTokenSymbol: string): string;
|
|
7
|
+
//# sourceMappingURL=borrowRegistries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"borrowRegistries.d.ts","sourceRoot":"","sources":["../../../src/core/constants/borrowRegistries.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQnE,CAAA;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,CAalF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.borrowRegistries = void 0;
|
|
4
|
+
exports.getBorrowRegistry = getBorrowRegistry;
|
|
5
|
+
const chainId_1 = require("./chainId");
|
|
6
|
+
/**
|
|
7
|
+
* Known AddressesRegistry contracts per chain, keyed by debt token symbol.
|
|
8
|
+
* Each registry is the entry point for one Bold deployment.
|
|
9
|
+
*/
|
|
10
|
+
exports.borrowRegistries = {
|
|
11
|
+
// TODO: Consider making the key for the address registry strongly typed (TokenSymbol)
|
|
12
|
+
[chainId_1.ChainId.CELO]: {
|
|
13
|
+
GBPm: '0x7C88934470A7297C7B63654d78ccC6B61eEf79E1',
|
|
14
|
+
},
|
|
15
|
+
[chainId_1.ChainId.CELO_SEPOLIA]: {
|
|
16
|
+
// GBPm: '0x...', // TODO: Add deployed registry address
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
function getBorrowRegistry(chainId, debtTokenSymbol) {
|
|
20
|
+
const registries = exports.borrowRegistries[chainId];
|
|
21
|
+
if (!registries) {
|
|
22
|
+
throw new Error(`No borrow registries found for chain ID ${chainId}`);
|
|
23
|
+
}
|
|
24
|
+
const registry = registries[debtTokenSymbol];
|
|
25
|
+
if (!registry) {
|
|
26
|
+
const available = Object.keys(registries).join(', ') || 'none';
|
|
27
|
+
throw new Error(`No borrow registry found for "${debtTokenSymbol}" on chain ${chainId}. Available: ${available}`);
|
|
28
|
+
}
|
|
29
|
+
return registry;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=borrowRegistries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"borrowRegistries.js","sourceRoot":"","sources":["../../../src/core/constants/borrowRegistries.ts"],"names":[],"mappings":";;;AAgBA,8CAaC;AA7BD,uCAAmC;AAEnC;;;GAGG;AACU,QAAA,gBAAgB,GAA2C;IACtE,sFAAsF;IACtF,CAAC,iBAAO,CAAC,IAAI,CAAC,EAAE;QACd,IAAI,EAAE,4CAA4C;KACnD;IACD,CAAC,iBAAO,CAAC,YAAY,CAAC,EAAE;IACtB,yDAAyD;KAC1D;CACF,CAAA;AAED,SAAgB,iBAAiB,CAAC,OAAe,EAAE,eAAuB;IACxE,MAAM,UAAU,GAAG,wBAAgB,CAAC,OAAO,CAAC,CAAA;IAC5C,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,2CAA2C,OAAO,EAAE,CAAC,CAAA;IACvE,CAAC;IACD,MAAM,QAAQ,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA;IAC5C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,CAAA;QAC9D,MAAM,IAAI,KAAK,CACb,iCAAiC,eAAe,cAAc,OAAO,gBAAgB,SAAS,EAAE,CACjG,CAAA;IACH,CAAC;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA"}
|
|
@@ -20,4 +20,6 @@ __exportStar(require("./contractNames"), exports);
|
|
|
20
20
|
__exportStar(require("./protocolAddresses"), exports);
|
|
21
21
|
__exportStar(require("./mentoAddresses"), exports);
|
|
22
22
|
__exportStar(require("./aaveConfig"), exports);
|
|
23
|
+
__exportStar(require("./borrowConstants"), exports);
|
|
24
|
+
__exportStar(require("./borrowRegistries"), exports);
|
|
23
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,4CAAyB;AACzB,kDAA+B;AAC/B,sDAAmC;AACnC,mDAAgC;AAChC,+CAA4B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,4CAAyB;AACzB,kDAA+B;AAC/B,sDAAmC;AACnC,mDAAgC;AAChC,+CAA4B;AAC5B,oDAAiC;AACjC,qDAAkC"}
|