@defisaver/positions-sdk 2.1.127-dev → 2.1.127-midnight-1-dev
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/contracts.d.ts +1510 -0
- package/cjs/contracts.js +3 -2
- package/cjs/helpers/index.d.ts +1 -0
- package/cjs/helpers/index.js +2 -1
- package/cjs/helpers/morphoBlueHelpers/index.js +0 -1
- package/cjs/helpers/morphoMidnightHelpers/index.d.ts +50 -0
- package/cjs/helpers/morphoMidnightHelpers/index.js +170 -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 +4 -1
- package/cjs/markets/morphoMidnight/index.d.ts +16 -0
- package/cjs/markets/morphoMidnight/index.js +159 -0
- package/cjs/morphoBlue/index.d.ts +6 -8
- package/cjs/morphoBlue/index.js +40 -69
- package/cjs/morphoMidnight/index.d.ts +14 -0
- package/cjs/morphoMidnight/index.js +244 -0
- package/cjs/portfolio/discovery.js +4 -0
- package/cjs/portfolio/index.js +45 -1
- package/cjs/services/viem.d.ts +11 -11
- package/cjs/types/index.d.ts +1 -0
- package/cjs/types/index.js +1 -0
- package/cjs/types/morphoBlue.d.ts +0 -9
- package/cjs/types/morphoMidnight.d.ts +94 -0
- package/cjs/types/morphoMidnight.js +15 -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/contracts.d.ts +1510 -0
- package/esm/contracts.js +1 -0
- package/esm/helpers/index.d.ts +1 -0
- package/esm/helpers/index.js +1 -0
- package/esm/helpers/morphoBlueHelpers/index.js +0 -1
- package/esm/helpers/morphoMidnightHelpers/index.d.ts +50 -0
- package/esm/helpers/morphoMidnightHelpers/index.js +159 -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 +16 -0
- package/esm/markets/morphoMidnight/index.js +148 -0
- package/esm/morphoBlue/index.d.ts +6 -8
- package/esm/morphoBlue/index.js +39 -62
- package/esm/morphoMidnight/index.d.ts +14 -0
- package/esm/morphoMidnight/index.js +231 -0
- package/esm/portfolio/discovery.js +5 -1
- package/esm/portfolio/index.js +47 -3
- package/esm/services/viem.d.ts +11 -11
- package/esm/types/index.d.ts +1 -0
- package/esm/types/index.js +1 -0
- package/esm/types/morphoBlue.d.ts +0 -9
- package/esm/types/morphoMidnight.d.ts +94 -0
- package/esm/types/morphoMidnight.js +12 -0
- package/esm/types/portfolio.d.ts +4 -0
- package/package.json +1 -1
- package/src/config/contracts.ts +9 -0
- package/src/contracts.ts +1 -0
- package/src/helpers/index.ts +1 -0
- package/src/helpers/morphoBlueHelpers/index.ts +0 -1
- package/src/helpers/morphoMidnightHelpers/index.ts +219 -0
- package/src/index.ts +2 -0
- package/src/markets/index.ts +1 -0
- package/src/markets/morphoMidnight/index.ts +161 -0
- package/src/morphoBlue/index.ts +44 -101
- package/src/morphoMidnight/index.ts +261 -0
- package/src/portfolio/discovery.ts +6 -0
- package/src/portfolio/index.ts +46 -2
- package/src/types/index.ts +1 -0
- package/src/types/morphoBlue.ts +0 -11
- package/src/types/morphoMidnight.ts +110 -0
- package/src/types/portfolio.ts +4 -0
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": {
|