@defisaver/positions-sdk 2.1.144-dev → 2.1.145
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/cjs/config/contracts.d.ts +249 -0
- package/cjs/config/contracts.js +11 -1
- package/cjs/constants/index.d.ts +1 -0
- package/cjs/constants/index.js +2 -1
- package/cjs/contracts.d.ts +1510 -0
- package/cjs/contracts.js +3 -2
- package/cjs/fluid/index.js +6 -2
- package/cjs/helpers/fluidHelpers/index.js +5 -4
- package/cjs/helpers/index.d.ts +1 -0
- package/cjs/helpers/index.js +2 -1
- package/cjs/helpers/morphoMidnightHelpers/headroom.d.ts +48 -0
- package/cjs/helpers/morphoMidnightHelpers/headroom.js +52 -0
- package/cjs/helpers/morphoMidnightHelpers/index.d.ts +113 -0
- package/cjs/helpers/morphoMidnightHelpers/index.js +298 -0
- package/cjs/helpers/morphoMidnightHelpers/rate.d.ts +15 -0
- package/cjs/helpers/morphoMidnightHelpers/rate.js +62 -0
- package/cjs/helpers/morphoMidnightHelpers/tenor.d.ts +129 -0
- package/cjs/helpers/morphoMidnightHelpers/tenor.js +254 -0
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +3 -1
- package/cjs/markets/index.d.ts +1 -0
- package/cjs/markets/index.js +6 -1
- package/cjs/markets/morphoMidnight/index.d.ts +60 -0
- package/cjs/markets/morphoMidnight/index.js +659 -0
- package/cjs/morphoMidnight/index.d.ts +14 -0
- package/cjs/morphoMidnight/index.js +261 -0
- package/cjs/portfolio/discovery.js +4 -0
- package/cjs/portfolio/index.js +44 -0
- package/cjs/services/viem.d.ts +11 -11
- package/cjs/staking/eligibility.d.ts +15 -1
- package/cjs/staking/eligibility.js +12 -1
- package/cjs/staking/staking.js +18 -22
- package/cjs/types/index.d.ts +1 -0
- package/cjs/types/index.js +1 -0
- package/cjs/types/morphoMidnight.d.ts +141 -0
- package/cjs/types/morphoMidnight.js +47 -0
- package/cjs/types/portfolio.d.ts +4 -0
- package/esm/config/contracts.d.ts +249 -0
- package/esm/config/contracts.js +9 -0
- package/esm/constants/index.d.ts +1 -0
- package/esm/constants/index.js +1 -0
- package/esm/contracts.d.ts +1510 -0
- package/esm/contracts.js +1 -0
- package/esm/fluid/index.js +6 -2
- package/esm/helpers/fluidHelpers/index.js +6 -5
- package/esm/helpers/index.d.ts +1 -0
- package/esm/helpers/index.js +1 -0
- package/esm/helpers/morphoMidnightHelpers/headroom.d.ts +48 -0
- package/esm/helpers/morphoMidnightHelpers/headroom.js +45 -0
- package/esm/helpers/morphoMidnightHelpers/index.d.ts +113 -0
- package/esm/helpers/morphoMidnightHelpers/index.js +271 -0
- package/esm/helpers/morphoMidnightHelpers/rate.d.ts +15 -0
- package/esm/helpers/morphoMidnightHelpers/rate.js +50 -0
- package/esm/helpers/morphoMidnightHelpers/tenor.d.ts +129 -0
- package/esm/helpers/morphoMidnightHelpers/tenor.js +238 -0
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -1
- package/esm/markets/index.d.ts +1 -0
- package/esm/markets/index.js +1 -0
- package/esm/markets/morphoMidnight/index.d.ts +60 -0
- package/esm/markets/morphoMidnight/index.js +631 -0
- package/esm/morphoMidnight/index.d.ts +14 -0
- package/esm/morphoMidnight/index.js +248 -0
- package/esm/portfolio/discovery.js +5 -1
- package/esm/portfolio/index.js +45 -1
- package/esm/services/viem.d.ts +11 -11
- package/esm/staking/eligibility.d.ts +15 -1
- package/esm/staking/eligibility.js +10 -0
- package/esm/staking/staking.js +19 -23
- package/esm/types/index.d.ts +1 -0
- package/esm/types/index.js +1 -0
- package/esm/types/morphoMidnight.d.ts +141 -0
- package/esm/types/morphoMidnight.js +44 -0
- package/esm/types/portfolio.d.ts +4 -0
- package/package.json +1 -1
- package/src/config/contracts.ts +9 -0
- package/src/constants/index.ts +1 -0
- package/src/contracts.ts +1 -0
- package/src/fluid/index.ts +6 -2
- package/src/helpers/fluidHelpers/index.ts +6 -5
- package/src/helpers/index.ts +1 -0
- package/src/helpers/morphoMidnightHelpers/headroom.ts +82 -0
- package/src/helpers/morphoMidnightHelpers/index.ts +485 -0
- package/src/helpers/morphoMidnightHelpers/rate.ts +71 -0
- package/src/helpers/morphoMidnightHelpers/tenor.ts +407 -0
- package/src/index.ts +2 -0
- package/src/markets/index.ts +3 -0
- package/src/markets/morphoMidnight/index.ts +675 -0
- package/src/morphoMidnight/index.ts +276 -0
- package/src/portfolio/discovery.ts +6 -0
- package/src/portfolio/index.ts +44 -0
- package/src/staking/eligibility.ts +29 -2
- package/src/staking/staking.ts +20 -22
- package/src/types/index.ts +1 -0
- package/src/types/morphoMidnight.ts +163 -0
- package/src/types/portfolio.ts +4 -0
package/cjs/staking/staking.js
CHANGED
|
@@ -201,17 +201,15 @@ const calculateNetApy = ({ usedAssets, assetsData, optionalData, }) => {
|
|
|
201
201
|
acc.supplyInterest = new decimal_js_1.default(acc.supplyInterest).add(supplyInterest.toString()).toString();
|
|
202
202
|
if (assetData.supplyIncentives) {
|
|
203
203
|
for (const supplyIncentive of assetData.supplyIncentives) {
|
|
204
|
-
const { apy
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
acc.incentiveUsd = new decimal_js_1.default(acc.incentiveUsd).add(incentiveInterest).toString();
|
|
214
|
-
}
|
|
204
|
+
const { apy } = supplyIncentive;
|
|
205
|
+
const { isEligible, eligibleUSDAmount } = (0, eligibility_1.getIncentiveEligibility)({
|
|
206
|
+
incentive: supplyIncentive,
|
|
207
|
+
usedAssets,
|
|
208
|
+
defaultEligibleUSDAmount: amount,
|
|
209
|
+
optionalData,
|
|
210
|
+
});
|
|
211
|
+
const incentiveInterest = isEligible ? (0, exports.calculateInterestEarned)(eligibleUSDAmount, apy, 'year', true) : '0';
|
|
212
|
+
acc.incentiveUsd = new decimal_js_1.default(acc.incentiveUsd).add(incentiveInterest).toString();
|
|
215
213
|
}
|
|
216
214
|
}
|
|
217
215
|
}
|
|
@@ -223,17 +221,15 @@ const calculateNetApy = ({ usedAssets, assetsData, optionalData, }) => {
|
|
|
223
221
|
acc.borrowInterest = new decimal_js_1.default(acc.borrowInterest).sub(borrowInterest.toString()).toString();
|
|
224
222
|
if (assetData.borrowIncentives) {
|
|
225
223
|
for (const borrowIncentive of assetData.borrowIncentives) {
|
|
226
|
-
const { apy
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
acc.incentiveUsd = new decimal_js_1.default(acc.incentiveUsd).add(incentiveInterest).toString();
|
|
236
|
-
}
|
|
224
|
+
const { apy } = borrowIncentive;
|
|
225
|
+
const { isEligible, eligibleUSDAmount } = (0, eligibility_1.getIncentiveEligibility)({
|
|
226
|
+
incentive: borrowIncentive,
|
|
227
|
+
usedAssets,
|
|
228
|
+
defaultEligibleUSDAmount: amount,
|
|
229
|
+
optionalData,
|
|
230
|
+
});
|
|
231
|
+
const incentiveInterest = isEligible ? (0, exports.calculateInterestEarned)(eligibleUSDAmount, apy, 'year', true) : '0';
|
|
232
|
+
acc.incentiveUsd = new decimal_js_1.default(acc.incentiveUsd).add(incentiveInterest).toString();
|
|
237
233
|
}
|
|
238
234
|
}
|
|
239
235
|
}
|
package/cjs/types/index.d.ts
CHANGED
package/cjs/types/index.js
CHANGED
|
@@ -22,6 +22,7 @@ __exportStar(require("./liquity"), exports);
|
|
|
22
22
|
__exportStar(require("./liquityV2"), exports);
|
|
23
23
|
__exportStar(require("./maker"), exports);
|
|
24
24
|
__exportStar(require("./morphoBlue"), exports);
|
|
25
|
+
__exportStar(require("./morphoMidnight"), exports);
|
|
25
26
|
__exportStar(require("./llamaLend"), exports);
|
|
26
27
|
__exportStar(require("./fluid"), exports);
|
|
27
28
|
__exportStar(require("./portfolio"), exports);
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { EthAddress, IncentiveData, LeverageType, MMUsedAssets, NetworkNumber } from './common';
|
|
2
|
+
export declare enum MorphoMidnightVersions {
|
|
3
|
+
MorphoMidnightCbBTCUSDC_860_20260731_Base = "morphomidnightcbbtcusdc_860_20260731_base",
|
|
4
|
+
MorphoMidnightCbBTCUSDC_860_20260828_Base = "morphomidnightcbbtcusdc_860_20260828_base",
|
|
5
|
+
MorphoMidnightCbBTCUSDC_860_20260925_Base = "morphomidnightcbbtcusdc_860_20260925_base",
|
|
6
|
+
MorphoMidnightCbBTCUSDC_860_20261030_Base = "morphomidnightcbbtcusdc_860_20261030_base",
|
|
7
|
+
MorphoMidnightCbBTCUSDC_860_20261127_Base = "morphomidnightcbbtcusdc_860_20261127_base",
|
|
8
|
+
MorphoMidnightCbBTCUSDC_860_20261225_Base = "morphomidnightcbbtcusdc_860_20261225_base",
|
|
9
|
+
MorphoMidnightTenorCbBTCUSDC_20260827_Base = "morphomidnighttenorcbbtcusdc_20260827_base",
|
|
10
|
+
MorphoMidnightTenorCbBTCUSDC_20260924_Base = "morphomidnighttenorcbbtcusdc_20260924_base",
|
|
11
|
+
MorphoMidnightTenorCbBTCUSDC_20261022_Base = "morphomidnighttenorcbbtcusdc_20261022_base",
|
|
12
|
+
MorphoMidnightTenorCbBTCUSDC_20261119_Base = "morphomidnighttenorcbbtcusdc_20261119_base",
|
|
13
|
+
MorphoMidnightTenorCbBTCUSDC_20261217_Base = "morphomidnighttenorcbbtcusdc_20261217_base",
|
|
14
|
+
MorphoMidnightTenorWETHUSDC_20260827_Base = "morphomidnighttenorwethusdc_20260827_base",
|
|
15
|
+
MorphoMidnightTenorWETHUSDC_20260924_Base = "morphomidnighttenorwethusdc_20260924_base",
|
|
16
|
+
MorphoMidnightTenorWETHUSDC_20261022_Base = "morphomidnighttenorwethusdc_20261022_base",
|
|
17
|
+
MorphoMidnightTenorWETHUSDC_20261119_Base = "morphomidnighttenorwethusdc_20261119_base",
|
|
18
|
+
MorphoMidnightTenorWETHUSDC_20261217_Base = "morphomidnighttenorwethusdc_20261217_base",
|
|
19
|
+
MorphoMidnightTenorCbETHWETH_20260827_Base = "morphomidnighttenorcbethweth_20260827_base",
|
|
20
|
+
MorphoMidnightTenorCbETHWETH_20260924_Base = "morphomidnighttenorcbethweth_20260924_base",
|
|
21
|
+
MorphoMidnightTenorCbETHWETH_20261022_Base = "morphomidnighttenorcbethweth_20261022_base",
|
|
22
|
+
MorphoMidnightTenorCbETHWETH_20261119_Base = "morphomidnighttenorcbethweth_20261119_base",
|
|
23
|
+
MorphoMidnightTenorCbETHWETH_20261217_Base = "morphomidnighttenorcbethweth_20261217_base"
|
|
24
|
+
}
|
|
25
|
+
export type MorphoMidnightCurator = 'Morpho' | 'Tenor';
|
|
26
|
+
export interface MorphoMidnightCollateralParams {
|
|
27
|
+
token: EthAddress;
|
|
28
|
+
lltv: number | string;
|
|
29
|
+
liquidationCursor: number | string;
|
|
30
|
+
oracle: EthAddress;
|
|
31
|
+
}
|
|
32
|
+
export interface MorphoMidnightMarketData {
|
|
33
|
+
chainIds: NetworkNumber[];
|
|
34
|
+
label: string;
|
|
35
|
+
shortLabel: string;
|
|
36
|
+
url: string;
|
|
37
|
+
value: MorphoMidnightVersions;
|
|
38
|
+
midnight: EthAddress;
|
|
39
|
+
loanToken: EthAddress;
|
|
40
|
+
collaterals: MorphoMidnightCollateralParams[];
|
|
41
|
+
/**
|
|
42
|
+
* Tenor's curated markets list the curator's own vault share token next to the real collateral.
|
|
43
|
+
*/
|
|
44
|
+
hiddenCollaterals?: MorphoMidnightCollateralParams[];
|
|
45
|
+
maturity: number;
|
|
46
|
+
rcfThreshold: number | string;
|
|
47
|
+
enterGate: EthAddress;
|
|
48
|
+
liquidatorGate: EthAddress;
|
|
49
|
+
marketId: string;
|
|
50
|
+
protocolName: string;
|
|
51
|
+
curator: MorphoMidnightCurator;
|
|
52
|
+
}
|
|
53
|
+
export interface MorphoMidnightAssetData {
|
|
54
|
+
symbol: string;
|
|
55
|
+
address: string;
|
|
56
|
+
price: string;
|
|
57
|
+
supplyRate: string;
|
|
58
|
+
borrowRate: string;
|
|
59
|
+
supplyIncentives: IncentiveData[];
|
|
60
|
+
borrowIncentives: IncentiveData[];
|
|
61
|
+
totalSupply?: string;
|
|
62
|
+
totalBorrow?: string;
|
|
63
|
+
canBeSupplied?: boolean;
|
|
64
|
+
canBeBorrowed?: boolean;
|
|
65
|
+
lltv?: string;
|
|
66
|
+
}
|
|
67
|
+
export type MorphoMidnightAssetsData = {
|
|
68
|
+
[key: string]: MorphoMidnightAssetData;
|
|
69
|
+
};
|
|
70
|
+
export interface MorphoMidnightMarketInfo {
|
|
71
|
+
id: string;
|
|
72
|
+
loanToken: string;
|
|
73
|
+
collaterals: string[];
|
|
74
|
+
maturity: number;
|
|
75
|
+
isMatured: boolean;
|
|
76
|
+
totalUnits: string;
|
|
77
|
+
withdrawable: string;
|
|
78
|
+
totalDebt: string;
|
|
79
|
+
lossFactor: string;
|
|
80
|
+
tickSpacing: number;
|
|
81
|
+
utillization: string;
|
|
82
|
+
assetsData: MorphoMidnightAssetsData;
|
|
83
|
+
}
|
|
84
|
+
export type MorphoMidnightBookSide = 'bids' | 'asks';
|
|
85
|
+
export interface MorphoMidnightBookOffer {
|
|
86
|
+
rate: string;
|
|
87
|
+
liquidity: string;
|
|
88
|
+
}
|
|
89
|
+
export interface MorphoMidnightParsedBook {
|
|
90
|
+
bestRate: string;
|
|
91
|
+
totalLiquidity: string;
|
|
92
|
+
offers: MorphoMidnightBookOffer[];
|
|
93
|
+
}
|
|
94
|
+
export interface MorphoMidnightAggregatedPositionData {
|
|
95
|
+
suppliedUsd: string;
|
|
96
|
+
suppliedCollateralUsd: string;
|
|
97
|
+
borrowedUsd: string;
|
|
98
|
+
borrowLimitUsd: string;
|
|
99
|
+
liquidationLimitUsd: string;
|
|
100
|
+
leftToBorrowUsd: string;
|
|
101
|
+
leftToBorrow: string;
|
|
102
|
+
netApy: string;
|
|
103
|
+
incentiveUsd: string;
|
|
104
|
+
totalInterestUsd: string;
|
|
105
|
+
ltv: string;
|
|
106
|
+
ratio: string;
|
|
107
|
+
healthRatio: string;
|
|
108
|
+
leveragedType: LeverageType;
|
|
109
|
+
leveragedAsset?: string;
|
|
110
|
+
currentVolatilePairRatio?: string;
|
|
111
|
+
liquidationPrice?: string;
|
|
112
|
+
minCollRatio?: string;
|
|
113
|
+
collLiquidationRatio?: string;
|
|
114
|
+
exposure: string;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* How much weight `borrowRate` / `debtBase` / `debtInterest` carry on a given position. They fall back to
|
|
118
|
+
* `'0'` / `debt` / `'0'`, which is indistinguishable from a real 0%-interest position, so anything
|
|
119
|
+
* displaying them has to read this to know whether it is looking at a number or at a placeholder.
|
|
120
|
+
*
|
|
121
|
+
* - `Available` — reported and reconciled against the on-chain debt (also lenders and debt-free positions,
|
|
122
|
+
* which have nothing to report).
|
|
123
|
+
* - `Pending` — the indexer has not caught up with the chain yet: it does not know the position, or its
|
|
124
|
+
* split describes a different debt. Refetching resolves it; `getMorphoMidnightUserBorrowInfo` failing
|
|
125
|
+
* outright lands here too, since the next call may well succeed.
|
|
126
|
+
*/
|
|
127
|
+
export declare enum MorphoMidnightBorrowInfoStatus {
|
|
128
|
+
Available = "available",
|
|
129
|
+
Pending = "pending"
|
|
130
|
+
}
|
|
131
|
+
export interface MorphoMidnightPositionData extends MorphoMidnightAggregatedPositionData {
|
|
132
|
+
usedAssets: MMUsedAssets;
|
|
133
|
+
credit: string;
|
|
134
|
+
debt: string;
|
|
135
|
+
borrowRate: string;
|
|
136
|
+
debtBase: string;
|
|
137
|
+
debtInterest: string;
|
|
138
|
+
borrowInfoStatus: MorphoMidnightBorrowInfoStatus;
|
|
139
|
+
maturity: number;
|
|
140
|
+
isMatured: boolean;
|
|
141
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MorphoMidnightBorrowInfoStatus = exports.MorphoMidnightVersions = void 0;
|
|
4
|
+
var MorphoMidnightVersions;
|
|
5
|
+
(function (MorphoMidnightVersions) {
|
|
6
|
+
// BASE
|
|
7
|
+
// Fixed-term markets are disambiguated by maturity (YYYYMMDD), so the same pair recurs across dates.
|
|
8
|
+
// Sourced from the official listing at https://markets.morpho.org/fixed/base (see sitemap.xml).
|
|
9
|
+
MorphoMidnightVersions["MorphoMidnightCbBTCUSDC_860_20260731_Base"] = "morphomidnightcbbtcusdc_860_20260731_base";
|
|
10
|
+
MorphoMidnightVersions["MorphoMidnightCbBTCUSDC_860_20260828_Base"] = "morphomidnightcbbtcusdc_860_20260828_base";
|
|
11
|
+
MorphoMidnightVersions["MorphoMidnightCbBTCUSDC_860_20260925_Base"] = "morphomidnightcbbtcusdc_860_20260925_base";
|
|
12
|
+
MorphoMidnightVersions["MorphoMidnightCbBTCUSDC_860_20261030_Base"] = "morphomidnightcbbtcusdc_860_20261030_base";
|
|
13
|
+
MorphoMidnightVersions["MorphoMidnightCbBTCUSDC_860_20261127_Base"] = "morphomidnightcbbtcusdc_860_20261127_base";
|
|
14
|
+
MorphoMidnightVersions["MorphoMidnightCbBTCUSDC_860_20261225_Base"] = "morphomidnightcbbtcusdc_860_20261225_base";
|
|
15
|
+
// Tenor-hosted Midnight markets (same core, different order book)
|
|
16
|
+
MorphoMidnightVersions["MorphoMidnightTenorCbBTCUSDC_20260827_Base"] = "morphomidnighttenorcbbtcusdc_20260827_base";
|
|
17
|
+
MorphoMidnightVersions["MorphoMidnightTenorCbBTCUSDC_20260924_Base"] = "morphomidnighttenorcbbtcusdc_20260924_base";
|
|
18
|
+
MorphoMidnightVersions["MorphoMidnightTenorCbBTCUSDC_20261022_Base"] = "morphomidnighttenorcbbtcusdc_20261022_base";
|
|
19
|
+
MorphoMidnightVersions["MorphoMidnightTenorCbBTCUSDC_20261119_Base"] = "morphomidnighttenorcbbtcusdc_20261119_base";
|
|
20
|
+
MorphoMidnightVersions["MorphoMidnightTenorCbBTCUSDC_20261217_Base"] = "morphomidnighttenorcbbtcusdc_20261217_base";
|
|
21
|
+
MorphoMidnightVersions["MorphoMidnightTenorWETHUSDC_20260827_Base"] = "morphomidnighttenorwethusdc_20260827_base";
|
|
22
|
+
MorphoMidnightVersions["MorphoMidnightTenorWETHUSDC_20260924_Base"] = "morphomidnighttenorwethusdc_20260924_base";
|
|
23
|
+
MorphoMidnightVersions["MorphoMidnightTenorWETHUSDC_20261022_Base"] = "morphomidnighttenorwethusdc_20261022_base";
|
|
24
|
+
MorphoMidnightVersions["MorphoMidnightTenorWETHUSDC_20261119_Base"] = "morphomidnighttenorwethusdc_20261119_base";
|
|
25
|
+
MorphoMidnightVersions["MorphoMidnightTenorWETHUSDC_20261217_Base"] = "morphomidnighttenorwethusdc_20261217_base";
|
|
26
|
+
MorphoMidnightVersions["MorphoMidnightTenorCbETHWETH_20260827_Base"] = "morphomidnighttenorcbethweth_20260827_base";
|
|
27
|
+
MorphoMidnightVersions["MorphoMidnightTenorCbETHWETH_20260924_Base"] = "morphomidnighttenorcbethweth_20260924_base";
|
|
28
|
+
MorphoMidnightVersions["MorphoMidnightTenorCbETHWETH_20261022_Base"] = "morphomidnighttenorcbethweth_20261022_base";
|
|
29
|
+
MorphoMidnightVersions["MorphoMidnightTenorCbETHWETH_20261119_Base"] = "morphomidnighttenorcbethweth_20261119_base";
|
|
30
|
+
MorphoMidnightVersions["MorphoMidnightTenorCbETHWETH_20261217_Base"] = "morphomidnighttenorcbethweth_20261217_base";
|
|
31
|
+
})(MorphoMidnightVersions || (exports.MorphoMidnightVersions = MorphoMidnightVersions = {}));
|
|
32
|
+
/**
|
|
33
|
+
* How much weight `borrowRate` / `debtBase` / `debtInterest` carry on a given position. They fall back to
|
|
34
|
+
* `'0'` / `debt` / `'0'`, which is indistinguishable from a real 0%-interest position, so anything
|
|
35
|
+
* displaying them has to read this to know whether it is looking at a number or at a placeholder.
|
|
36
|
+
*
|
|
37
|
+
* - `Available` — reported and reconciled against the on-chain debt (also lenders and debt-free positions,
|
|
38
|
+
* which have nothing to report).
|
|
39
|
+
* - `Pending` — the indexer has not caught up with the chain yet: it does not know the position, or its
|
|
40
|
+
* split describes a different debt. Refetching resolves it; `getMorphoMidnightUserBorrowInfo` failing
|
|
41
|
+
* outright lands here too, since the next call may well succeed.
|
|
42
|
+
*/
|
|
43
|
+
var MorphoMidnightBorrowInfoStatus;
|
|
44
|
+
(function (MorphoMidnightBorrowInfoStatus) {
|
|
45
|
+
MorphoMidnightBorrowInfoStatus["Available"] = "available";
|
|
46
|
+
MorphoMidnightBorrowInfoStatus["Pending"] = "pending";
|
|
47
|
+
})(MorphoMidnightBorrowInfoStatus || (exports.MorphoMidnightBorrowInfoStatus = MorphoMidnightBorrowInfoStatus = {}));
|
package/cjs/types/portfolio.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { LiquityTroveInfo } from './liquity';
|
|
|
8
8
|
import { LlamaLendUserData, LlamaLendVersionsType } from './llamaLend';
|
|
9
9
|
import { CdpData } from './maker';
|
|
10
10
|
import { MorphoBluePositionData, MorphoBlueVersions } from './morphoBlue';
|
|
11
|
+
import { MorphoMidnightPositionData, MorphoMidnightVersions } from './morphoMidnight';
|
|
11
12
|
import { SparkPositionData, SparkVersions } from './spark';
|
|
12
13
|
export interface PortfolioProtocolData<T> {
|
|
13
14
|
error: string;
|
|
@@ -20,6 +21,9 @@ export interface PortfolioPositionsDataForAddress {
|
|
|
20
21
|
morphoBlue: {
|
|
21
22
|
[key in MorphoBlueVersions]?: PortfolioProtocolData<MorphoBluePositionData>;
|
|
22
23
|
};
|
|
24
|
+
morphoMidnight: {
|
|
25
|
+
[key in MorphoMidnightVersions]?: PortfolioProtocolData<MorphoMidnightPositionData>;
|
|
26
|
+
};
|
|
23
27
|
compoundV3: {
|
|
24
28
|
[key in CompoundVersions]?: PortfolioProtocolData<CompoundV3PositionData>;
|
|
25
29
|
};
|
|
@@ -87015,6 +87015,255 @@ export declare const MorphoBlueView: {
|
|
|
87015
87015
|
};
|
|
87016
87016
|
};
|
|
87017
87017
|
};
|
|
87018
|
+
export declare const MidnightView: {
|
|
87019
|
+
readonly abi: readonly [{
|
|
87020
|
+
readonly inputs: readonly [{
|
|
87021
|
+
readonly internalType: "bytes32";
|
|
87022
|
+
readonly name: "_id";
|
|
87023
|
+
readonly type: "bytes32";
|
|
87024
|
+
}];
|
|
87025
|
+
readonly name: "getMarketInfo";
|
|
87026
|
+
readonly outputs: readonly [{
|
|
87027
|
+
readonly components: readonly [{
|
|
87028
|
+
readonly internalType: "bytes32";
|
|
87029
|
+
readonly name: "id";
|
|
87030
|
+
readonly type: "bytes32";
|
|
87031
|
+
}, {
|
|
87032
|
+
readonly internalType: "uint128";
|
|
87033
|
+
readonly name: "totalUnits";
|
|
87034
|
+
readonly type: "uint128";
|
|
87035
|
+
}, {
|
|
87036
|
+
readonly internalType: "uint128";
|
|
87037
|
+
readonly name: "lossFactor";
|
|
87038
|
+
readonly type: "uint128";
|
|
87039
|
+
}, {
|
|
87040
|
+
readonly internalType: "uint128";
|
|
87041
|
+
readonly name: "withdrawable";
|
|
87042
|
+
readonly type: "uint128";
|
|
87043
|
+
}, {
|
|
87044
|
+
readonly internalType: "uint128";
|
|
87045
|
+
readonly name: "continuousFeeCredit";
|
|
87046
|
+
readonly type: "uint128";
|
|
87047
|
+
}, {
|
|
87048
|
+
readonly internalType: "uint16[7]";
|
|
87049
|
+
readonly name: "settlementFees";
|
|
87050
|
+
readonly type: "uint16[7]";
|
|
87051
|
+
}, {
|
|
87052
|
+
readonly internalType: "uint32";
|
|
87053
|
+
readonly name: "continuousFee";
|
|
87054
|
+
readonly type: "uint32";
|
|
87055
|
+
}, {
|
|
87056
|
+
readonly internalType: "uint8";
|
|
87057
|
+
readonly name: "tickSpacing";
|
|
87058
|
+
readonly type: "uint8";
|
|
87059
|
+
}, {
|
|
87060
|
+
readonly internalType: "uint256[]";
|
|
87061
|
+
readonly name: "prices";
|
|
87062
|
+
readonly type: "uint256[]";
|
|
87063
|
+
}];
|
|
87064
|
+
readonly internalType: "struct MidnightView.MarketInfo";
|
|
87065
|
+
readonly name: "info";
|
|
87066
|
+
readonly type: "tuple";
|
|
87067
|
+
}];
|
|
87068
|
+
readonly stateMutability: "view";
|
|
87069
|
+
readonly type: "function";
|
|
87070
|
+
}, {
|
|
87071
|
+
readonly inputs: readonly [{
|
|
87072
|
+
readonly internalType: "bytes32";
|
|
87073
|
+
readonly name: "_id";
|
|
87074
|
+
readonly type: "bytes32";
|
|
87075
|
+
}, {
|
|
87076
|
+
readonly internalType: "address";
|
|
87077
|
+
readonly name: "_user";
|
|
87078
|
+
readonly type: "address";
|
|
87079
|
+
}];
|
|
87080
|
+
readonly name: "getPositionInfo";
|
|
87081
|
+
readonly outputs: readonly [{
|
|
87082
|
+
readonly components: readonly [{
|
|
87083
|
+
readonly internalType: "uint128";
|
|
87084
|
+
readonly name: "credit";
|
|
87085
|
+
readonly type: "uint128";
|
|
87086
|
+
}, {
|
|
87087
|
+
readonly internalType: "uint128";
|
|
87088
|
+
readonly name: "pendingFee";
|
|
87089
|
+
readonly type: "uint128";
|
|
87090
|
+
}, {
|
|
87091
|
+
readonly internalType: "uint128";
|
|
87092
|
+
readonly name: "debt";
|
|
87093
|
+
readonly type: "uint128";
|
|
87094
|
+
}, {
|
|
87095
|
+
readonly internalType: "uint128";
|
|
87096
|
+
readonly name: "collateralBitmap";
|
|
87097
|
+
readonly type: "uint128";
|
|
87098
|
+
}, {
|
|
87099
|
+
readonly internalType: "uint128[]";
|
|
87100
|
+
readonly name: "collateral";
|
|
87101
|
+
readonly type: "uint128[]";
|
|
87102
|
+
}, {
|
|
87103
|
+
readonly internalType: "uint256";
|
|
87104
|
+
readonly name: "ratio";
|
|
87105
|
+
readonly type: "uint256";
|
|
87106
|
+
}];
|
|
87107
|
+
readonly internalType: "struct MidnightView.PositionInfo";
|
|
87108
|
+
readonly name: "pos";
|
|
87109
|
+
readonly type: "tuple";
|
|
87110
|
+
}];
|
|
87111
|
+
readonly stateMutability: "view";
|
|
87112
|
+
readonly type: "function";
|
|
87113
|
+
}, {
|
|
87114
|
+
readonly inputs: readonly [{
|
|
87115
|
+
readonly internalType: "bytes32";
|
|
87116
|
+
readonly name: "_id";
|
|
87117
|
+
readonly type: "bytes32";
|
|
87118
|
+
}, {
|
|
87119
|
+
readonly internalType: "address";
|
|
87120
|
+
readonly name: "_user";
|
|
87121
|
+
readonly type: "address";
|
|
87122
|
+
}];
|
|
87123
|
+
readonly name: "getRatio";
|
|
87124
|
+
readonly outputs: readonly [{
|
|
87125
|
+
readonly internalType: "uint256";
|
|
87126
|
+
readonly name: "ratio";
|
|
87127
|
+
readonly type: "uint256";
|
|
87128
|
+
}];
|
|
87129
|
+
readonly stateMutability: "view";
|
|
87130
|
+
readonly type: "function";
|
|
87131
|
+
}, {
|
|
87132
|
+
readonly inputs: readonly [{
|
|
87133
|
+
readonly components: readonly [{
|
|
87134
|
+
readonly internalType: "uint256";
|
|
87135
|
+
readonly name: "chainId";
|
|
87136
|
+
readonly type: "uint256";
|
|
87137
|
+
}, {
|
|
87138
|
+
readonly internalType: "address";
|
|
87139
|
+
readonly name: "midnight";
|
|
87140
|
+
readonly type: "address";
|
|
87141
|
+
}, {
|
|
87142
|
+
readonly internalType: "address";
|
|
87143
|
+
readonly name: "loanToken";
|
|
87144
|
+
readonly type: "address";
|
|
87145
|
+
}, {
|
|
87146
|
+
readonly components: readonly [{
|
|
87147
|
+
readonly internalType: "address";
|
|
87148
|
+
readonly name: "token";
|
|
87149
|
+
readonly type: "address";
|
|
87150
|
+
}, {
|
|
87151
|
+
readonly internalType: "uint256";
|
|
87152
|
+
readonly name: "lltv";
|
|
87153
|
+
readonly type: "uint256";
|
|
87154
|
+
}, {
|
|
87155
|
+
readonly internalType: "uint256";
|
|
87156
|
+
readonly name: "liquidationCursor";
|
|
87157
|
+
readonly type: "uint256";
|
|
87158
|
+
}, {
|
|
87159
|
+
readonly internalType: "address";
|
|
87160
|
+
readonly name: "oracle";
|
|
87161
|
+
readonly type: "address";
|
|
87162
|
+
}];
|
|
87163
|
+
readonly internalType: "struct CollateralParams[]";
|
|
87164
|
+
readonly name: "collateralParams";
|
|
87165
|
+
readonly type: "tuple[]";
|
|
87166
|
+
}, {
|
|
87167
|
+
readonly internalType: "uint256";
|
|
87168
|
+
readonly name: "maturity";
|
|
87169
|
+
readonly type: "uint256";
|
|
87170
|
+
}, {
|
|
87171
|
+
readonly internalType: "uint256";
|
|
87172
|
+
readonly name: "rcfThreshold";
|
|
87173
|
+
readonly type: "uint256";
|
|
87174
|
+
}, {
|
|
87175
|
+
readonly internalType: "address";
|
|
87176
|
+
readonly name: "enterGate";
|
|
87177
|
+
readonly type: "address";
|
|
87178
|
+
}, {
|
|
87179
|
+
readonly internalType: "address";
|
|
87180
|
+
readonly name: "liquidatorGate";
|
|
87181
|
+
readonly type: "address";
|
|
87182
|
+
}];
|
|
87183
|
+
readonly internalType: "struct Market";
|
|
87184
|
+
readonly name: "_market";
|
|
87185
|
+
readonly type: "tuple";
|
|
87186
|
+
}];
|
|
87187
|
+
readonly name: "toId";
|
|
87188
|
+
readonly outputs: readonly [{
|
|
87189
|
+
readonly internalType: "bytes32";
|
|
87190
|
+
readonly name: "id";
|
|
87191
|
+
readonly type: "bytes32";
|
|
87192
|
+
}];
|
|
87193
|
+
readonly stateMutability: "pure";
|
|
87194
|
+
readonly type: "function";
|
|
87195
|
+
}, {
|
|
87196
|
+
readonly inputs: readonly [{
|
|
87197
|
+
readonly internalType: "bytes32";
|
|
87198
|
+
readonly name: "_id";
|
|
87199
|
+
readonly type: "bytes32";
|
|
87200
|
+
}];
|
|
87201
|
+
readonly name: "toMarket";
|
|
87202
|
+
readonly outputs: readonly [{
|
|
87203
|
+
readonly components: readonly [{
|
|
87204
|
+
readonly internalType: "uint256";
|
|
87205
|
+
readonly name: "chainId";
|
|
87206
|
+
readonly type: "uint256";
|
|
87207
|
+
}, {
|
|
87208
|
+
readonly internalType: "address";
|
|
87209
|
+
readonly name: "midnight";
|
|
87210
|
+
readonly type: "address";
|
|
87211
|
+
}, {
|
|
87212
|
+
readonly internalType: "address";
|
|
87213
|
+
readonly name: "loanToken";
|
|
87214
|
+
readonly type: "address";
|
|
87215
|
+
}, {
|
|
87216
|
+
readonly components: readonly [{
|
|
87217
|
+
readonly internalType: "address";
|
|
87218
|
+
readonly name: "token";
|
|
87219
|
+
readonly type: "address";
|
|
87220
|
+
}, {
|
|
87221
|
+
readonly internalType: "uint256";
|
|
87222
|
+
readonly name: "lltv";
|
|
87223
|
+
readonly type: "uint256";
|
|
87224
|
+
}, {
|
|
87225
|
+
readonly internalType: "uint256";
|
|
87226
|
+
readonly name: "liquidationCursor";
|
|
87227
|
+
readonly type: "uint256";
|
|
87228
|
+
}, {
|
|
87229
|
+
readonly internalType: "address";
|
|
87230
|
+
readonly name: "oracle";
|
|
87231
|
+
readonly type: "address";
|
|
87232
|
+
}];
|
|
87233
|
+
readonly internalType: "struct CollateralParams[]";
|
|
87234
|
+
readonly name: "collateralParams";
|
|
87235
|
+
readonly type: "tuple[]";
|
|
87236
|
+
}, {
|
|
87237
|
+
readonly internalType: "uint256";
|
|
87238
|
+
readonly name: "maturity";
|
|
87239
|
+
readonly type: "uint256";
|
|
87240
|
+
}, {
|
|
87241
|
+
readonly internalType: "uint256";
|
|
87242
|
+
readonly name: "rcfThreshold";
|
|
87243
|
+
readonly type: "uint256";
|
|
87244
|
+
}, {
|
|
87245
|
+
readonly internalType: "address";
|
|
87246
|
+
readonly name: "enterGate";
|
|
87247
|
+
readonly type: "address";
|
|
87248
|
+
}, {
|
|
87249
|
+
readonly internalType: "address";
|
|
87250
|
+
readonly name: "liquidatorGate";
|
|
87251
|
+
readonly type: "address";
|
|
87252
|
+
}];
|
|
87253
|
+
readonly internalType: "struct Market";
|
|
87254
|
+
readonly name: "market";
|
|
87255
|
+
readonly type: "tuple";
|
|
87256
|
+
}];
|
|
87257
|
+
readonly stateMutability: "view";
|
|
87258
|
+
readonly type: "function";
|
|
87259
|
+
}];
|
|
87260
|
+
readonly networks: {
|
|
87261
|
+
readonly "8453": {
|
|
87262
|
+
readonly address: "0x3aa272f329E8B562A3bA56Bb6979a44D23A28839";
|
|
87263
|
+
readonly createdBlock: 48932293;
|
|
87264
|
+
};
|
|
87265
|
+
};
|
|
87266
|
+
};
|
|
87018
87267
|
export declare const FeedRegistry: {
|
|
87019
87268
|
readonly abi: readonly [{
|
|
87020
87269
|
readonly anonymous: false;
|
package/esm/config/contracts.js
CHANGED
|
@@ -1111,6 +1111,15 @@ export const MorphoBlueView = {
|
|
|
1111
1111
|
}
|
|
1112
1112
|
},
|
|
1113
1113
|
};
|
|
1114
|
+
export const MidnightView = {
|
|
1115
|
+
"abi": [{ "inputs": [{ "internalType": "bytes32", "name": "_id", "type": "bytes32" }], "name": "getMarketInfo", "outputs": [{ "components": [{ "internalType": "bytes32", "name": "id", "type": "bytes32" }, { "internalType": "uint128", "name": "totalUnits", "type": "uint128" }, { "internalType": "uint128", "name": "lossFactor", "type": "uint128" }, { "internalType": "uint128", "name": "withdrawable", "type": "uint128" }, { "internalType": "uint128", "name": "continuousFeeCredit", "type": "uint128" }, { "internalType": "uint16[7]", "name": "settlementFees", "type": "uint16[7]" }, { "internalType": "uint32", "name": "continuousFee", "type": "uint32" }, { "internalType": "uint8", "name": "tickSpacing", "type": "uint8" }, { "internalType": "uint256[]", "name": "prices", "type": "uint256[]" }], "internalType": "struct MidnightView.MarketInfo", "name": "info", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "_id", "type": "bytes32" }, { "internalType": "address", "name": "_user", "type": "address" }], "name": "getPositionInfo", "outputs": [{ "components": [{ "internalType": "uint128", "name": "credit", "type": "uint128" }, { "internalType": "uint128", "name": "pendingFee", "type": "uint128" }, { "internalType": "uint128", "name": "debt", "type": "uint128" }, { "internalType": "uint128", "name": "collateralBitmap", "type": "uint128" }, { "internalType": "uint128[]", "name": "collateral", "type": "uint128[]" }, { "internalType": "uint256", "name": "ratio", "type": "uint256" }], "internalType": "struct MidnightView.PositionInfo", "name": "pos", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "_id", "type": "bytes32" }, { "internalType": "address", "name": "_user", "type": "address" }], "name": "getRatio", "outputs": [{ "internalType": "uint256", "name": "ratio", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "components": [{ "internalType": "uint256", "name": "chainId", "type": "uint256" }, { "internalType": "address", "name": "midnight", "type": "address" }, { "internalType": "address", "name": "loanToken", "type": "address" }, { "components": [{ "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "lltv", "type": "uint256" }, { "internalType": "uint256", "name": "liquidationCursor", "type": "uint256" }, { "internalType": "address", "name": "oracle", "type": "address" }], "internalType": "struct CollateralParams[]", "name": "collateralParams", "type": "tuple[]" }, { "internalType": "uint256", "name": "maturity", "type": "uint256" }, { "internalType": "uint256", "name": "rcfThreshold", "type": "uint256" }, { "internalType": "address", "name": "enterGate", "type": "address" }, { "internalType": "address", "name": "liquidatorGate", "type": "address" }], "internalType": "struct Market", "name": "_market", "type": "tuple" }], "name": "toId", "outputs": [{ "internalType": "bytes32", "name": "id", "type": "bytes32" }], "stateMutability": "pure", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "_id", "type": "bytes32" }], "name": "toMarket", "outputs": [{ "components": [{ "internalType": "uint256", "name": "chainId", "type": "uint256" }, { "internalType": "address", "name": "midnight", "type": "address" }, { "internalType": "address", "name": "loanToken", "type": "address" }, { "components": [{ "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "lltv", "type": "uint256" }, { "internalType": "uint256", "name": "liquidationCursor", "type": "uint256" }, { "internalType": "address", "name": "oracle", "type": "address" }], "internalType": "struct CollateralParams[]", "name": "collateralParams", "type": "tuple[]" }, { "internalType": "uint256", "name": "maturity", "type": "uint256" }, { "internalType": "uint256", "name": "rcfThreshold", "type": "uint256" }, { "internalType": "address", "name": "enterGate", "type": "address" }, { "internalType": "address", "name": "liquidatorGate", "type": "address" }], "internalType": "struct Market", "name": "market", "type": "tuple" }], "stateMutability": "view", "type": "function" }],
|
|
1116
|
+
"networks": {
|
|
1117
|
+
"8453": {
|
|
1118
|
+
"address": "0x3aa272f329E8B562A3bA56Bb6979a44D23A28839",
|
|
1119
|
+
"createdBlock": 48932293,
|
|
1120
|
+
}
|
|
1121
|
+
},
|
|
1122
|
+
};
|
|
1114
1123
|
export const FeedRegistry = {
|
|
1115
1124
|
"abi": [{ "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }], "name": "OwnershipTransferRequested", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }], "name": "OwnershipTransferred", "type": "event" }, { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }, { "internalType": "address", "name": "aggregator", "type": "address" }], "name": "confirmFeed", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }], "name": "decimals", "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }], "name": "description", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getAccessController", "outputs": [{ "internalType": "contract AccessControllerInterface", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }, { "internalType": "uint256", "name": "roundId", "type": "uint256" }], "name": "getAnswer", "outputs": [{ "internalType": "int256", "name": "answer", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }], "name": "getCurrentPhaseId", "outputs": [{ "internalType": "uint16", "name": "currentPhaseId", "type": "uint16" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }], "name": "getFeed", "outputs": [{ "internalType": "contract AggregatorV2V3Interface", "name": "aggregator", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }, { "internalType": "uint80", "name": "roundId", "type": "uint80" }], "name": "getNextRoundId", "outputs": [{ "internalType": "uint80", "name": "nextRoundId", "type": "uint80" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }, { "internalType": "uint16", "name": "phaseId", "type": "uint16" }], "name": "getPhase", "outputs": [{ "components": [{ "internalType": "uint16", "name": "phaseId", "type": "uint16" }, { "internalType": "uint80", "name": "startingAggregatorRoundId", "type": "uint80" }, { "internalType": "uint80", "name": "endingAggregatorRoundId", "type": "uint80" }], "internalType": "struct FeedRegistryInterface.Phase", "name": "phase", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }, { "internalType": "uint16", "name": "phaseId", "type": "uint16" }], "name": "getPhaseFeed", "outputs": [{ "internalType": "contract AggregatorV2V3Interface", "name": "aggregator", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }, { "internalType": "uint16", "name": "phaseId", "type": "uint16" }], "name": "getPhaseRange", "outputs": [{ "internalType": "uint80", "name": "startingRoundId", "type": "uint80" }, { "internalType": "uint80", "name": "endingRoundId", "type": "uint80" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }, { "internalType": "uint80", "name": "roundId", "type": "uint80" }], "name": "getPreviousRoundId", "outputs": [{ "internalType": "uint80", "name": "previousRoundId", "type": "uint80" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }], "name": "getProposedFeed", "outputs": [{ "internalType": "contract AggregatorV2V3Interface", "name": "proposedAggregator", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }, { "internalType": "uint80", "name": "_roundId", "type": "uint80" }], "name": "getRoundData", "outputs": [{ "internalType": "uint80", "name": "roundId", "type": "uint80" }, { "internalType": "int256", "name": "answer", "type": "int256" }, { "internalType": "uint256", "name": "startedAt", "type": "uint256" }, { "internalType": "uint256", "name": "updatedAt", "type": "uint256" }, { "internalType": "uint80", "name": "answeredInRound", "type": "uint80" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }, { "internalType": "uint80", "name": "roundId", "type": "uint80" }], "name": "getRoundFeed", "outputs": [{ "internalType": "contract AggregatorV2V3Interface", "name": "aggregator", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }, { "internalType": "uint256", "name": "roundId", "type": "uint256" }], "name": "getTimestamp", "outputs": [{ "internalType": "uint256", "name": "timestamp", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "aggregator", "type": "address" }], "name": "isFeedEnabled", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }], "name": "latestAnswer", "outputs": [{ "internalType": "int256", "name": "answer", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }], "name": "latestRound", "outputs": [{ "internalType": "uint256", "name": "roundId", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }], "name": "latestRoundData", "outputs": [{ "internalType": "uint80", "name": "roundId", "type": "uint80" }, { "internalType": "int256", "name": "answer", "type": "int256" }, { "internalType": "uint256", "name": "startedAt", "type": "uint256" }, { "internalType": "uint256", "name": "updatedAt", "type": "uint256" }, { "internalType": "uint80", "name": "answeredInRound", "type": "uint80" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }], "name": "latestTimestamp", "outputs": [{ "internalType": "uint256", "name": "timestamp", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }, { "internalType": "address", "name": "aggregator", "type": "address" }], "name": "proposeFeed", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }, { "internalType": "uint80", "name": "roundId", "type": "uint80" }], "name": "proposedGetRoundData", "outputs": [{ "internalType": "uint80", "name": "id", "type": "uint80" }, { "internalType": "int256", "name": "answer", "type": "int256" }, { "internalType": "uint256", "name": "startedAt", "type": "uint256" }, { "internalType": "uint256", "name": "updatedAt", "type": "uint256" }, { "internalType": "uint80", "name": "answeredInRound", "type": "uint80" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }], "name": "proposedLatestRoundData", "outputs": [{ "internalType": "uint80", "name": "id", "type": "uint80" }, { "internalType": "int256", "name": "answer", "type": "int256" }, { "internalType": "uint256", "name": "startedAt", "type": "uint256" }, { "internalType": "uint256", "name": "updatedAt", "type": "uint256" }, { "internalType": "uint80", "name": "answeredInRound", "type": "uint80" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "contract AccessControllerInterface", "name": "_accessController", "type": "address" }], "name": "setAccessController", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "to", "type": "address" }], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "typeAndVersion", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "pure", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }], "name": "version", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }],
|
|
1116
1125
|
"networks": {
|
package/esm/constants/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare const SECONDS_PER_WEEK: number;
|
|
|
6
6
|
export declare const AVG_BLOCK_TIME = 12;
|
|
7
7
|
export declare const BLOCKS_IN_A_YEAR: number;
|
|
8
8
|
export declare const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
9
|
+
export declare const ZERO_BYTES32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
9
10
|
export declare const WAD = 1000000000000000000;
|
|
10
11
|
export declare const USD_QUOTE = "0x0000000000000000000000000000000000000348";
|
|
11
12
|
export declare const borrowOperations: string[];
|
package/esm/constants/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export const SECONDS_PER_WEEK = 7 * SECONDS_PER_DAY;
|
|
|
6
6
|
export const AVG_BLOCK_TIME = 12;
|
|
7
7
|
export const BLOCKS_IN_A_YEAR = SECONDS_PER_YEAR / AVG_BLOCK_TIME;
|
|
8
8
|
export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
9
|
+
export const ZERO_BYTES32 = '0x0000000000000000000000000000000000000000000000000000000000000000';
|
|
9
10
|
export const WAD = 1e18;
|
|
10
11
|
export const USD_QUOTE = '0x0000000000000000000000000000000000000348';
|
|
11
12
|
export const borrowOperations = ['borrow', 'payback'];
|