@morpho-org/morpho-sdk 6.5.0 → 7.0.0
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/MIGRATION-v6-to-v7.md +291 -0
- package/README.md +26 -12
- package/lib/cjs/abis.d.ts +1 -1
- package/lib/cjs/abis.js +3 -2
- package/lib/cjs/actions/bundles/common.d.ts +9 -5
- package/lib/cjs/actions/bundles/common.js +22 -13
- package/lib/cjs/actions/midnight/authorization.d.ts +3 -2
- package/lib/cjs/actions/midnight/authorization.js +3 -2
- package/lib/cjs/actions/midnight/cancelAndMake.d.ts +153 -0
- package/lib/cjs/actions/midnight/cancelAndMake.js +292 -0
- package/lib/cjs/actions/midnight/index.d.ts +3 -3
- package/lib/cjs/actions/midnight/index.js +3 -3
- package/lib/cjs/actions/midnight/repayWithdrawCollateral.d.ts +40 -23
- package/lib/cjs/actions/midnight/repayWithdrawCollateral.js +105 -69
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.d.ts +52 -27
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.js +128 -71
- package/lib/cjs/actions/midnight/takeBorrow.d.ts +40 -28
- package/lib/cjs/actions/midnight/takeBorrow.js +95 -54
- package/lib/cjs/actions/midnight/takeLend.d.ts +51 -27
- package/lib/cjs/actions/midnight/takeLend.js +111 -54
- package/lib/cjs/actions/midnight/takeRepayWithdrawCollateral.d.ts +97 -0
- package/lib/cjs/actions/midnight/takeRepayWithdrawCollateral.js +201 -0
- package/lib/cjs/actions/midnight/takeWithdraw.d.ts +69 -0
- package/lib/cjs/actions/midnight/takeWithdraw.js +153 -0
- package/lib/cjs/actions/midnight/types.d.ts +7 -26
- package/lib/cjs/actions/midnight/types.js +0 -13
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +2 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +3 -2
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +4 -4
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +5 -5
- package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +2 -2
- package/lib/cjs/actions/requirements/getRequirementsApproval.js +2 -2
- package/lib/cjs/actions/requirements/midnight/getMidnightApprovalRequirements.d.ts +24 -8
- package/lib/cjs/actions/requirements/midnight/getMidnightApprovalRequirements.js +24 -13
- package/lib/cjs/actions/requirements/midnight/getMidnightAuthorizationRequirement.d.ts +11 -7
- package/lib/cjs/actions/requirements/midnight/getMidnightAuthorizationRequirement.js +11 -7
- package/lib/cjs/actions/requirements/midnight/index.d.ts +0 -1
- package/lib/cjs/actions/requirements/midnight/index.js +0 -1
- package/lib/cjs/constants.d.ts +1 -1
- package/lib/cjs/constants.js +3 -1
- package/lib/cjs/entities/blue/blue.d.ts +10 -6
- package/lib/cjs/entities/blue/blue.js +5 -3
- package/lib/cjs/entities/index.d.ts +2 -2
- package/lib/cjs/entities/midnight/midnight.d.ts +582 -108
- package/lib/cjs/entities/midnight/midnight.js +981 -509
- package/lib/cjs/entities/midnight/types.d.ts +142 -60
- package/lib/cjs/entities/vaultV1/vaultV1.d.ts +2 -1
- package/lib/cjs/entities/vaultV1/vaultV1.js +1 -0
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +2 -1
- package/lib/cjs/entities/vaultV2/vaultV2.js +1 -0
- package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +11 -3
- package/lib/cjs/entities/vaultV2BlueReallocationData.js +119 -43
- package/lib/cjs/helpers/callback.d.ts +54 -0
- package/lib/cjs/helpers/callback.js +73 -0
- package/lib/cjs/helpers/constant.d.ts +10 -0
- package/lib/cjs/helpers/constant.js +11 -1
- package/lib/cjs/helpers/index.d.ts +3 -2
- package/lib/cjs/helpers/index.js +7 -1
- package/lib/cjs/helpers/signAndVerifyTypedData.d.ts +3 -3
- package/lib/cjs/helpers/signAndVerifyTypedData.js +3 -3
- package/lib/cjs/helpers/utilization.d.ts +13 -0
- package/lib/cjs/helpers/utilization.js +26 -1
- package/lib/cjs/helpers/validate.d.ts +43 -2
- package/lib/cjs/helpers/validate.js +60 -3
- package/lib/cjs/helpers/validateMidnightAuthorizationTarget.d.ts +1 -1
- package/lib/cjs/helpers/validateMidnightAuthorizationTarget.js +3 -7
- package/lib/cjs/helpers/validateRequirementSpender.d.ts +3 -3
- package/lib/cjs/helpers/validateRequirementSpender.js +4 -5
- package/lib/cjs/midnight/abis.d.ts +1 -1
- package/lib/cjs/midnight/abis.js +3 -2
- package/lib/cjs/midnight/types.d.ts +1 -1
- package/lib/cjs/types/action.d.ts +117 -89
- package/lib/cjs/types/action.js +1 -19
- package/lib/cjs/types/error.d.ts +126 -40
- package/lib/cjs/types/error.js +154 -49
- package/lib/cjs/types/sharedLiquidity.d.ts +17 -0
- package/lib/esm/abis.d.ts +1 -1
- package/lib/esm/abis.js +1 -1
- package/lib/esm/actions/bundles/common.d.ts +9 -5
- package/lib/esm/actions/bundles/common.js +22 -13
- package/lib/esm/actions/midnight/authorization.d.ts +3 -2
- package/lib/esm/actions/midnight/authorization.js +3 -2
- package/lib/esm/actions/midnight/cancelAndMake.d.ts +153 -0
- package/lib/esm/actions/midnight/cancelAndMake.js +288 -0
- package/lib/esm/actions/midnight/index.d.ts +3 -3
- package/lib/esm/actions/midnight/index.js +3 -3
- package/lib/esm/actions/midnight/repayWithdrawCollateral.d.ts +40 -23
- package/lib/esm/actions/midnight/repayWithdrawCollateral.js +108 -72
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.d.ts +52 -27
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.js +131 -74
- package/lib/esm/actions/midnight/takeBorrow.d.ts +40 -28
- package/lib/esm/actions/midnight/takeBorrow.js +98 -57
- package/lib/esm/actions/midnight/takeLend.d.ts +51 -27
- package/lib/esm/actions/midnight/takeLend.js +114 -57
- package/lib/esm/actions/midnight/takeRepayWithdrawCollateral.d.ts +97 -0
- package/lib/esm/actions/midnight/takeRepayWithdrawCollateral.js +197 -0
- package/lib/esm/actions/midnight/takeWithdraw.d.ts +69 -0
- package/lib/esm/actions/midnight/takeWithdraw.js +149 -0
- package/lib/esm/actions/midnight/types.d.ts +7 -26
- package/lib/esm/actions/midnight/types.js +1 -12
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +2 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +3 -2
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +4 -4
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +5 -5
- package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +2 -2
- package/lib/esm/actions/requirements/getRequirementsApproval.js +2 -2
- package/lib/esm/actions/requirements/midnight/getMidnightApprovalRequirements.d.ts +24 -8
- package/lib/esm/actions/requirements/midnight/getMidnightApprovalRequirements.js +25 -14
- package/lib/esm/actions/requirements/midnight/getMidnightAuthorizationRequirement.d.ts +11 -7
- package/lib/esm/actions/requirements/midnight/getMidnightAuthorizationRequirement.js +11 -7
- package/lib/esm/actions/requirements/midnight/index.d.ts +0 -1
- package/lib/esm/actions/requirements/midnight/index.js +0 -1
- package/lib/esm/constants.d.ts +1 -1
- package/lib/esm/constants.js +1 -1
- package/lib/esm/entities/blue/blue.d.ts +10 -6
- package/lib/esm/entities/blue/blue.js +5 -3
- package/lib/esm/entities/index.d.ts +2 -2
- package/lib/esm/entities/midnight/midnight.d.ts +582 -108
- package/lib/esm/entities/midnight/midnight.js +987 -515
- package/lib/esm/entities/midnight/types.d.ts +142 -60
- package/lib/esm/entities/vaultV1/vaultV1.d.ts +2 -1
- package/lib/esm/entities/vaultV1/vaultV1.js +1 -0
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +2 -1
- package/lib/esm/entities/vaultV2/vaultV2.js +1 -0
- package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +11 -3
- package/lib/esm/entities/vaultV2BlueReallocationData.js +120 -44
- package/lib/esm/helpers/callback.d.ts +54 -0
- package/lib/esm/helpers/callback.js +68 -0
- package/lib/esm/helpers/constant.d.ts +10 -0
- package/lib/esm/helpers/constant.js +10 -0
- package/lib/esm/helpers/index.d.ts +3 -2
- package/lib/esm/helpers/index.js +3 -2
- package/lib/esm/helpers/signAndVerifyTypedData.d.ts +3 -3
- package/lib/esm/helpers/signAndVerifyTypedData.js +3 -3
- package/lib/esm/helpers/utilization.d.ts +13 -0
- package/lib/esm/helpers/utilization.js +25 -1
- package/lib/esm/helpers/validate.d.ts +43 -2
- package/lib/esm/helpers/validate.js +58 -2
- package/lib/esm/helpers/validateMidnightAuthorizationTarget.d.ts +1 -1
- package/lib/esm/helpers/validateMidnightAuthorizationTarget.js +3 -7
- package/lib/esm/helpers/validateRequirementSpender.d.ts +3 -3
- package/lib/esm/helpers/validateRequirementSpender.js +4 -5
- package/lib/esm/midnight/abis.d.ts +1 -1
- package/lib/esm/midnight/abis.js +1 -1
- package/lib/esm/midnight/types.d.ts +1 -1
- package/lib/esm/types/action.d.ts +117 -89
- package/lib/esm/types/action.js +1 -18
- package/lib/esm/types/error.d.ts +126 -40
- package/lib/esm/types/error.js +135 -38
- package/lib/esm/types/sharedLiquidity.d.ts +17 -0
- package/package.json +9 -8
- package/lib/cjs/actions/midnight/cancelOffer.d.ts +0 -38
- package/lib/cjs/actions/midnight/cancelOffer.js +0 -73
- package/lib/cjs/actions/midnight/mempoolSubmitOffers.d.ts +0 -52
- package/lib/cjs/actions/midnight/mempoolSubmitOffers.js +0 -72
- package/lib/cjs/actions/midnight/setterRatifierRatifyRoot.d.ts +0 -40
- package/lib/cjs/actions/midnight/setterRatifierRatifyRoot.js +0 -59
- package/lib/cjs/actions/requirements/midnight/getSetterRatifierRatifyRootRequirement.d.ts +0 -42
- package/lib/cjs/actions/requirements/midnight/getSetterRatifierRatifyRootRequirement.js +0 -70
- package/lib/esm/actions/midnight/cancelOffer.d.ts +0 -38
- package/lib/esm/actions/midnight/cancelOffer.js +0 -69
- package/lib/esm/actions/midnight/mempoolSubmitOffers.d.ts +0 -52
- package/lib/esm/actions/midnight/mempoolSubmitOffers.js +0 -68
- package/lib/esm/actions/midnight/setterRatifierRatifyRoot.d.ts +0 -40
- package/lib/esm/actions/midnight/setterRatifierRatifyRoot.js +0 -55
- package/lib/esm/actions/requirements/midnight/getSetterRatifierRatifyRootRequirement.d.ts +0 -42
- package/lib/esm/actions/requirements/midnight/getSetterRatifierRatifyRootRequirement.js +0 -66
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type InputMarketParams } from "@morpho-org/blue-sdk";
|
|
2
|
+
import { type Address, type Hex } from "viem";
|
|
3
|
+
/**
|
|
4
|
+
* Computes the CREATE2 address of `owner`'s `BlueBuyCallback` for `salt`, as deployed or
|
|
5
|
+
* returned by the chain's `midnightBlueBuyCallbackFactory.createBlueBuyCallback(owner, salt)`.
|
|
6
|
+
*
|
|
7
|
+
* Use it to fill each offer's `callback` before calling `supplyBlueMakeLend`.
|
|
8
|
+
*
|
|
9
|
+
* @param params.chainId - Chain whose `midnightBlueBuyCallbackFactory`, `midnight` and `blue` are used.
|
|
10
|
+
* @param params.owner - Callback owner, the maker.
|
|
11
|
+
* @param params.salt - Callback salt.
|
|
12
|
+
* @returns The callback address, whether or not it is deployed yet.
|
|
13
|
+
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
14
|
+
* @throws {UnknownAddressError} when the chain has no `midnightBlueBuyCallbackFactory`, `midnight` or `blue` deployment.
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { getMidnightBlueBuyCallbackAddress } from "@morpho-org/morpho-sdk";
|
|
18
|
+
* import { ChainId } from "@morpho-org/morpho-ts";
|
|
19
|
+
* import { keccak256, toHex } from "viem";
|
|
20
|
+
* import type { Address } from "viem";
|
|
21
|
+
*
|
|
22
|
+
* const callbackFor = (maker: Address) =>
|
|
23
|
+
* getMidnightBlueBuyCallbackAddress({
|
|
24
|
+
* chainId: ChainId.EthMainnet,
|
|
25
|
+
* owner: maker,
|
|
26
|
+
* salt: keccak256(toHex("my-strategy")),
|
|
27
|
+
* });
|
|
28
|
+
* // `callbackFor(maker)` returns the maker's BlueBuyCallback address, deployed or not.
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare const getMidnightBlueBuyCallbackAddress: ({ chainId, owner, salt, }: {
|
|
32
|
+
readonly chainId: number;
|
|
33
|
+
readonly owner: Address;
|
|
34
|
+
readonly salt: Hex;
|
|
35
|
+
}) => Address;
|
|
36
|
+
/**
|
|
37
|
+
* Returns the `callbackData` every `supplyBlueMakeLend` offer must carry: `abi.encode(blueMarket)`.
|
|
38
|
+
*
|
|
39
|
+
* @param blueMarket - Morpho Blue market encoded as the callback data.
|
|
40
|
+
* @returns The ABI-encoded Morpho Blue market parameters.
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* import { getMidnightBlueBuyCallbackData } from "@morpho-org/morpho-sdk";
|
|
44
|
+
* import type { InputMarketParams as MarketParams } from "@morpho-org/blue-sdk";
|
|
45
|
+
* import type { Hex } from "viem";
|
|
46
|
+
*
|
|
47
|
+
* function getCallbackData(blueMarket: MarketParams) {
|
|
48
|
+
* const callbackData = getMidnightBlueBuyCallbackData(blueMarket);
|
|
49
|
+
* // callbackData satisfies Hex
|
|
50
|
+
* return callbackData;
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare const getMidnightBlueBuyCallbackData: (blueMarket: InputMarketParams) => Hex;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMidnightBlueBuyCallbackData = exports.getMidnightBlueBuyCallbackAddress = void 0;
|
|
4
|
+
const blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
5
|
+
const morpho_ts_1 = require("@morpho-org/morpho-ts");
|
|
6
|
+
const viem_1 = require("viem");
|
|
7
|
+
/**
|
|
8
|
+
* `BlueBuyCallback` creation bytecode from `morpho-org/midnight` commit
|
|
9
|
+
* `4603969e`, embedded in the `BlueBuyCallbackFactory` deployed on Ethereum, Base, Robinhood and Arc.
|
|
10
|
+
*/
|
|
11
|
+
const blueBuyCallbackBytecode = "0x60e0806040523461012657606081611611803803809161001f828561012a565b8339810103126101265761003281610161565b9061004b604061004460208401610161565b9201610161565b908260805260a0528060c05260018060a01b031690813b15610126576040516207767560ed1b81526001600160a01b03909116600482015260016024820152905f908290604490829084905af1801561011b5761010b575b60405161149b9081610176823960805181818160b4015281816102fc0152818161078201528181610dfd0152611004015260a0518181816102210152610dc3015260c051818181610103015281816102650152818161067c015281816108660152610f5e0152f35b5f6101159161012a565b5f6100a3565b6040513d5f823e3d90fd5b5f80fd5b601f909101601f19168101906001600160401b0382119082101761014d57604052565b634e487b7160e01b5f52604160045260245ffd5b51906001600160a01b03821682036101265756fe6080806040526004361015610012575f80fd5b5f905f3560e01c908163117803e314610fe7575080631c0bb54d14610d585780631e686318146107ef5780638069218f1461043d578063affed0e014610420578063bc25cf7714610289578063c011ff6414610245578063dc400c12146102015763eecea00014610081575f80fd5b346101a15760403660031901126101a15761009a61107c565b9060243591821515908184036101fd576001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036101ee576040516332f256cf60e11b81523060048201526001600160a01b038281166024830152939485947f000000000000000000000000000000000000000000000000000000000000000016939091602081604481885afa9081156101e35786916101b4575b5015150361014a57505050f35b823b156101af576040516207767560ed1b81526001600160a01b03929092166004830152151560248201529082908290604490829084905af180156101a4576101905750f35b8161019a91611044565b6101a15780f35b80fd5b6040513d84823e3d90fd5b505050fd5b6101d6915060203d6020116101dc575b6101ce8183611044565b810190611358565b5f61013d565b503d6101c4565b6040513d88823e3d90fd5b6330cd747160e01b8352600483fd5b8280fd5b50346101a157806003193601126101a15760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346101a157806003193601126101a15760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346101a15760203660031901126101a1576102a361107c565b6040516370a0823160e01b81523060048201526001600160a01b03821691602082602481865afa9182156104155784926103dd575b50803b156103ce5760405163a9059cbb60e01b602082019081526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660248301526044820184905285928392909190839061034881606481015b03601f198101835282611044565b51925af1610354611370565b90156103c65780519081159182156103ac575b50501561039d576040519081527f2ae72b44f59d038340fca5739135a1d51fc5ab720bb02d983e4c5ff4119ca7b860203392a380f35b630bc11c3f60e21b8352600483fd5b6103bf9250602080918301019101611358565b5f80610367565b602081519101fd5b633c11a9c560e21b8452600484fd5b9091506020813d60201161040d575b816103f960209383611044565b810103126104095751905f6102d8565b5f80fd5b3d91506103ec565b6040513d86823e3d90fd5b50346101a157806003193601126101a15760209054604051908152f35b503461040957366003190161010081126104095760a0136104095760405161046481611028565b61046c61107c565b8152602435906001600160a01b038216820361040957602081019182526044359182151583036104095760408201928352606082019160643583526084356080820190808252606060a3193601126104095742116107e05783515f54905f1982146107cc57600182015f55036107bd5760405160208101917f81d0284fb0e2cde18d0553b06189d6f7613c96a01bb5b5e7828eade6a0dcac9183526001600160a01b0384511660408301526001600160a01b038551166060830152865115156080830152855160a08301525160c082015260c0815261054c60e082611044565b51902060405160208101907f47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218825246604082015230606082015260608152610595608082611044565b5190209060405190602082019261190160f01b845260228301526042820152604281526105c3606282611044565b51902060a4359060ff82168092036104095760805f916020936040519182528482015260c435604082015260e435606082015282805260015afa1561073b576001600160a01b035f511680151591826107a9575b5081610776575b5015610767576106af91516040519081527fbae999fc435f6200224444d8535f1936f9abd69060fcaec680f690f1810ae36a60203392a280516040516332f256cf60e11b81523060048201526001600160a01b0391821660248201527f0000000000000000000000000000000000000000000000000000000000000000909116939092602090849081906044820190565b0381875afa92831561073b575f93610746575b5051151580921515036106d3578380f35b516001600160a01b031690823b15610409576040516207767560ed1b81526001600160a01b0392909216600483015215156024820152905f908290604490829084905af1801561073b57610728575b80808380f35b61073491505f90611044565b5f5f610722565b6040513d5f823e3d90fd5b61076091935060203d6020116101dc576101ce8183611044565b915f6106c2565b638baa579f60e01b5f5260045ffd5b90506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016145f61061e565b516001600160a01b0316811491505f610617565b633ab3447f60e11b5f5260045ffd5b634e487b7160e01b5f52601160045260245ffd5b630f05f5bf60e01b5f5260045ffd5b346104095760803660031901126104095760243567ffffffffffffffff8111610409576108209036906004016110a6565b50610829611066565b5060643567ffffffffffffffff81116104095761084d61085c91369060040161122a565b60208082518301019101611284565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169060a0812060405190632e3071cd60e11b8252600482015260c081602481865afa90811561073b575f91610ca8575b50608081016108ce6001600160801b038251164261134b565b9081151580610c92575b80610c7c575b610a82575b50506001600160801b03815116906001600160801b03604081602084015116920151169060a08420604051906349e2903160e11b82526004820152306024820152606081604481895afa90811561073b575f916109f9575b505160018401928385116107cc57620f424083018093116107cc576109766001600160a01b039361097160209661097c956113cc565b611470565b9461134b565b935116936024604051809681936370a0823160e01b835260048301525afa91821561073b575f926109c4575b6020935081811090821802186040519181811090821802188152f35b91506020833d6020116109f1575b816109df60209383611044565b810103126104095760209251916109a8565b3d91506109d2565b90506060813d606011610a7a575b81610a1460609383611044565b8101031261040957604051906060820182811067ffffffffffffffff821117610a6657610a5b91604091825280518452610a5060208201611337565b602085015201611337565b60408201528661093b565b634e487b7160e01b5f52604160045260245ffd5b3d9150610a07565b6060840151604051638c00bf6b60e01b8152906001600160a01b0316610aab60048301876112e6565b6001600160801b0385511660a483015260208501936001600160801b0385511660c48401526001600160801b0360408701948186511660e48601528160608901511661010486015251166101248401526020836101648160a08a01956001600160801b038751166101448301525afa92831561073b575f93610c46575b50610b8b6001600160801b0393610b85610b4f670de0b6b3a76400009487895116936113cc565b610b80671bc16d674ec80000610b6583806113cc565b046729a2241af62c0000610b7984836113cc565b04926113bf565b6113bf565b906113cc565b049282610ba3610b9a866113df565b8284511661139f565b16905281610bbc610bb3856113df565b8288511661139f565b16855251169081610bce575b506108e3565b670de0b6b3a764000091610be1916113cc565b04610bf6816001600160801b0385511661134b565b6001600160801b0383511691620f424083018093116107cc57600182018092116107cc57610c36610c3b926109716001600160801b0395610b9a946113cc565b6113df565b169052838080610bc8565b92506020833d602011610c74575b81610c6160209383611044565b8101031261040957915191610b8b610b28565b3d9150610c54565b506001600160a01b0360608501511615156108de565b506001600160801b0360408401511615156108d8565b905060c0813d60c011610d50575b81610cc360c09383611044565b81010312610409576040519060c0820182811067ffffffffffffffff821117610a6657610d459160a091604052610cf981611337565b8452610d0760208201611337565b6020850152610d1860408201611337565b6040850152610d2960608201611337565b6060850152610d3a60808201611337565b608085015201611337565b60a0820152836108b5565b3d9150610cb6565b346104095760e03660031901126104095760243567ffffffffffffffff811161040957610d899036906004016110a6565b60443560a435916001600160a01b0383168093036104095760c43567ffffffffffffffff811161040957610dc190369060040161122a565b7f0000000000000000000000000000000000000000000000000000000000000000936001600160a01b0385163303610fd8576001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001603610fc95780602080610e3593518301019101611284565b60406001600160a01b038251169201916001600160a01b0383511603610fba5782610f17575b505160405163095ea7b360e01b602082019081526001600160a01b03948516602483015260448201939093525f938493921691908390610e9e816064810161033a565b51925af1610eaa611370565b90156103c6578051908115918215610efd575b505015610eee5760206040517f7f87788ea698181ea4d28d1576d0ba4fc92c0dbe5bf75b43692af2ce91dbaea28152f35b631f55ddd960e21b5f5260045ffd5b610f109250602080918301019101611358565b8180610ebd565b604051635c2bea4960e01b815290610f339060048301906112e6565b8260a48201525f60c48201523060e482015230610104820152604081610124815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af1801561073b5715610e5b57604090819392933d8311610fb3575b610fa48183611044565b81010312610409579083610e5b565b503d610f9a565b63effb039160e01b5f5260045ffd5b631ec6e83760e21b5f5260045ffd5b631e6a35c760e01b5f5260045ffd5b34610409575f366003190112610409576020906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b60a0810190811067ffffffffffffffff821117610a6657604052565b90601f8019910116810190811067ffffffffffffffff821117610a6657604052565b604435906001600160a01b038216820361040957565b600435906001600160a01b038216820361040957565b35906001600160a01b038216820361040957565b919091610100818403126104095760405190610100820182811067ffffffffffffffff821117610a66576040528193813583526110e560208301611092565b60208401526110f660408301611092565b6040840152606082013567ffffffffffffffff811161040957820181601f820112156104095780359067ffffffffffffffff8211610a66576040519261114260208460051b0185611044565b82845260208085019360071b8301019181831161040957602001925b8284106111a6575050505060e080926111a19260608601526080810135608086015260a081013560a086015261119660c08201611092565b60c086015201611092565b910152565b6080848303126104095760405190608082019082821067ffffffffffffffff831117610a66576080926020926040526111de87611092565b81528287013583820152604087013560408201526111fe60608801611092565b606082015281520193019261115e565b67ffffffffffffffff8111610a6657601f01601f191660200190565b81601f82011215610409578035906112418261120e565b9261124f6040519485611044565b8284526020838301011161040957815f926020809301838601378301015290565b51906001600160a01b038216820361040957565b908160a09103126104095760806040519161129e83611028565b6112a781611270565b83526112b560208201611270565b60208401526112c660408201611270565b60408401526112d760608201611270565b60608401520151608082015290565b608080916001600160a01b0381511684526001600160a01b0360208201511660208501526001600160a01b0360408201511660408501526001600160a01b0360608201511660608501520151910152565b51906001600160801b038216820361040957565b919082039182116107cc57565b90816020910312610409575180151581036104095790565b3d1561139a573d906113818261120e565b9161138f6040519384611044565b82523d5f602084013e565b606090565b906001600160801b03809116911601906001600160801b0382116107cc57565b919082018092116107cc57565b818102929181159184041417156107cc57565b6040516113ed604082611044565b6014815260208101907f6d61782075696e7431323820657863656564656400000000000000000000000082526001600160801b0383116114355750506001600160801b031690565b60449060405192839162461bcd60e51b8352602060048401525180918160248501528484015e5f828201840152601f01601f19168101030190fd5b811561147a570490565b634e487b7160e01b5f52601260045260245ffdfea164736f6c6343000822000a";
|
|
12
|
+
/**
|
|
13
|
+
* Computes the CREATE2 address of `owner`'s `BlueBuyCallback` for `salt`, as deployed or
|
|
14
|
+
* returned by the chain's `midnightBlueBuyCallbackFactory.createBlueBuyCallback(owner, salt)`.
|
|
15
|
+
*
|
|
16
|
+
* Use it to fill each offer's `callback` before calling `supplyBlueMakeLend`.
|
|
17
|
+
*
|
|
18
|
+
* @param params.chainId - Chain whose `midnightBlueBuyCallbackFactory`, `midnight` and `blue` are used.
|
|
19
|
+
* @param params.owner - Callback owner, the maker.
|
|
20
|
+
* @param params.salt - Callback salt.
|
|
21
|
+
* @returns The callback address, whether or not it is deployed yet.
|
|
22
|
+
* @throws {UnsupportedChainIdError} when the chain is absent from the address registry.
|
|
23
|
+
* @throws {UnknownAddressError} when the chain has no `midnightBlueBuyCallbackFactory`, `midnight` or `blue` deployment.
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { getMidnightBlueBuyCallbackAddress } from "@morpho-org/morpho-sdk";
|
|
27
|
+
* import { ChainId } from "@morpho-org/morpho-ts";
|
|
28
|
+
* import { keccak256, toHex } from "viem";
|
|
29
|
+
* import type { Address } from "viem";
|
|
30
|
+
*
|
|
31
|
+
* const callbackFor = (maker: Address) =>
|
|
32
|
+
* getMidnightBlueBuyCallbackAddress({
|
|
33
|
+
* chainId: ChainId.EthMainnet,
|
|
34
|
+
* owner: maker,
|
|
35
|
+
* salt: keccak256(toHex("my-strategy")),
|
|
36
|
+
* });
|
|
37
|
+
* // `callbackFor(maker)` returns the maker's BlueBuyCallback address, deployed or not.
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
const getMidnightBlueBuyCallbackAddress = ({ chainId, owner, salt, }) => (0, viem_1.getContractAddress)({
|
|
41
|
+
opcode: "CREATE2",
|
|
42
|
+
from: (0, morpho_ts_1.getChainAddress)(chainId, "midnightBlueBuyCallbackFactory"),
|
|
43
|
+
salt,
|
|
44
|
+
bytecode: (0, viem_1.concatHex)([
|
|
45
|
+
blueBuyCallbackBytecode,
|
|
46
|
+
(0, viem_1.encodeAbiParameters)([{ type: "address" }, { type: "address" }, { type: "address" }], [
|
|
47
|
+
owner,
|
|
48
|
+
(0, morpho_ts_1.getChainAddress)(chainId, "midnight"),
|
|
49
|
+
(0, morpho_ts_1.getChainAddress)(chainId, "blue"),
|
|
50
|
+
]),
|
|
51
|
+
]),
|
|
52
|
+
});
|
|
53
|
+
exports.getMidnightBlueBuyCallbackAddress = getMidnightBlueBuyCallbackAddress;
|
|
54
|
+
/**
|
|
55
|
+
* Returns the `callbackData` every `supplyBlueMakeLend` offer must carry: `abi.encode(blueMarket)`.
|
|
56
|
+
*
|
|
57
|
+
* @param blueMarket - Morpho Blue market encoded as the callback data.
|
|
58
|
+
* @returns The ABI-encoded Morpho Blue market parameters.
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* import { getMidnightBlueBuyCallbackData } from "@morpho-org/morpho-sdk";
|
|
62
|
+
* import type { InputMarketParams as MarketParams } from "@morpho-org/blue-sdk";
|
|
63
|
+
* import type { Hex } from "viem";
|
|
64
|
+
*
|
|
65
|
+
* function getCallbackData(blueMarket: MarketParams) {
|
|
66
|
+
* const callbackData = getMidnightBlueBuyCallbackData(blueMarket);
|
|
67
|
+
* // callbackData satisfies Hex
|
|
68
|
+
* return callbackData;
|
|
69
|
+
* }
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
const getMidnightBlueBuyCallbackData = (blueMarket) => (0, viem_1.encodeAbiParameters)([blue_sdk_1.marketParamsAbi], [blueMarket]);
|
|
73
|
+
exports.getMidnightBlueBuyCallbackData = getMidnightBlueBuyCallbackData;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type Address } from "viem";
|
|
2
|
+
/** Maximum time between now and a Midnight taker-flow deadline, in seconds. */
|
|
3
|
+
export declare const MIDNIGHT_TAKE_MAX_DEADLINE_SECONDS = 3600n;
|
|
2
4
|
/** Maximum slippage tolerance: 10% */
|
|
3
5
|
export declare const MAX_SLIPPAGE_TOLERANCE: bigint;
|
|
4
6
|
/** Default maximum Vault V2 reallocation penalty: zero. */
|
|
@@ -15,6 +17,14 @@ export declare const DEFAULT_LLTV_BUFFER: bigint;
|
|
|
15
17
|
* `VaultV2BluePublicAllocatorOptions.capAccrualBuffer`.
|
|
16
18
|
*/
|
|
17
19
|
export declare const DEFAULT_CAP_ACCRUAL_BUFFER: bigint;
|
|
20
|
+
/**
|
|
21
|
+
* Default headroom, as a WAD-scaled share of a BluePublicAllocator target-market
|
|
22
|
+
* cap (1%), kept below that cap when an operation's reallocation would
|
|
23
|
+
* otherwise fill it. It absorbs other allocations to the same market between
|
|
24
|
+
* the quote and inclusion. Override with
|
|
25
|
+
* `VaultV2BluePublicAllocatorOptions.allocatorCapHeadroom`.
|
|
26
|
+
*/
|
|
27
|
+
export declare const DEFAULT_ALLOCATOR_CAP_HEADROOM: bigint;
|
|
18
28
|
/** Maximum absolute share price cap (100 RAY). Prevents absurd maxSharePrice values in repay. */
|
|
19
29
|
export declare const MAX_ABSOLUTE_SHARE_PRICE: bigint;
|
|
20
30
|
/**
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MAX_TOKEN_APPROVALS = exports.APPROVE_ONLY_ONCE_TOKENS = exports.DEFAULT_SUPPLY_TARGET_UTILIZATION = exports.DEFAULT_WITHDRAWAL_TARGET_UTILIZATION = exports.MAX_ABSOLUTE_SHARE_PRICE = exports.DEFAULT_CAP_ACCRUAL_BUFFER = exports.DEFAULT_LLTV_BUFFER = exports.MAX_REALLOCATION_PENALTY = exports.DEFAULT_MAX_REALLOCATION_PENALTY = exports.MAX_SLIPPAGE_TOLERANCE = void 0;
|
|
3
|
+
exports.MAX_TOKEN_APPROVALS = exports.APPROVE_ONLY_ONCE_TOKENS = exports.DEFAULT_SUPPLY_TARGET_UTILIZATION = exports.DEFAULT_WITHDRAWAL_TARGET_UTILIZATION = exports.MAX_ABSOLUTE_SHARE_PRICE = exports.DEFAULT_ALLOCATOR_CAP_HEADROOM = exports.DEFAULT_CAP_ACCRUAL_BUFFER = exports.DEFAULT_LLTV_BUFFER = exports.MAX_REALLOCATION_PENALTY = exports.DEFAULT_MAX_REALLOCATION_PENALTY = exports.MAX_SLIPPAGE_TOLERANCE = exports.MIDNIGHT_TAKE_MAX_DEADLINE_SECONDS = void 0;
|
|
4
4
|
const blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
5
5
|
const morpho_ts_1 = require("@morpho-org/morpho-ts");
|
|
6
6
|
const viem_1 = require("viem");
|
|
7
|
+
/** Maximum time between now and a Midnight taker-flow deadline, in seconds. */
|
|
8
|
+
exports.MIDNIGHT_TAKE_MAX_DEADLINE_SECONDS = 3600n;
|
|
7
9
|
/** Maximum slippage tolerance: 10% */
|
|
8
10
|
exports.MAX_SLIPPAGE_TOLERANCE = blue_sdk_1.MathLib.WAD / 10n;
|
|
9
11
|
/** Default maximum Vault V2 reallocation penalty: zero. */
|
|
@@ -20,6 +22,14 @@ exports.DEFAULT_LLTV_BUFFER = blue_sdk_1.MathLib.WAD / 200n;
|
|
|
20
22
|
* `VaultV2BluePublicAllocatorOptions.capAccrualBuffer`.
|
|
21
23
|
*/
|
|
22
24
|
exports.DEFAULT_CAP_ACCRUAL_BUFFER = morpho_ts_1.Time.s.from.h(2n);
|
|
25
|
+
/**
|
|
26
|
+
* Default headroom, as a WAD-scaled share of a BluePublicAllocator target-market
|
|
27
|
+
* cap (1%), kept below that cap when an operation's reallocation would
|
|
28
|
+
* otherwise fill it. It absorbs other allocations to the same market between
|
|
29
|
+
* the quote and inclusion. Override with
|
|
30
|
+
* `VaultV2BluePublicAllocatorOptions.allocatorCapHeadroom`.
|
|
31
|
+
*/
|
|
32
|
+
exports.DEFAULT_ALLOCATOR_CAP_HEADROOM = blue_sdk_1.MathLib.WAD / 100n;
|
|
23
33
|
/** Maximum absolute share price cap (100 RAY). Prevents absurd maxSharePrice values in repay. */
|
|
24
34
|
exports.MAX_ABSOLUTE_SHARE_PRICE = 100n * blue_sdk_1.MathLib.RAY;
|
|
25
35
|
/**
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { getMidnightBlueBuyCallbackAddress, getMidnightBlueBuyCallbackData, } from "./callback.js";
|
|
2
|
+
export { APPROVE_ONLY_ONCE_TOKENS, DEFAULT_ALLOCATOR_CAP_HEADROOM, DEFAULT_CAP_ACCRUAL_BUFFER, DEFAULT_LLTV_BUFFER, DEFAULT_MAX_REALLOCATION_PENALTY, DEFAULT_SUPPLY_TARGET_UTILIZATION, DEFAULT_WITHDRAWAL_TARGET_UTILIZATION, MAX_ABSOLUTE_SHARE_PRICE, MAX_REALLOCATION_PENALTY, MAX_SLIPPAGE_TOLERANCE, MAX_TOKEN_APPROVALS, MIDNIGHT_TAKE_MAX_DEADLINE_SECONDS, } from "./constant.js";
|
|
2
3
|
export { addTransactionMetadata } from "./metadata.js";
|
|
3
4
|
export { type PreviewVaultV2ForceWithdrawParams, previewVaultV2ForceWithdraw, type VaultV2ForceWithdrawPreview, } from "./previewVaultV2ForceWithdraw.js";
|
|
4
5
|
export { type PreviewVaultV2InKindRedeemParams, previewVaultV2InKindRedeem, type VaultV2InKindRedeemMarketPreview, } from "./previewVaultV2InKindRedeem.js";
|
|
5
6
|
export { grossFromNetAssets } from "./referralFee.js";
|
|
6
7
|
export { signAndVerifyTypedData } from "./signAndVerifyTypedData.js";
|
|
7
8
|
export { computeMinForceWithdrawSharePrice, computeVaultMaxShareAllowance, computeVaultMaxSharePrice, } from "./slippage.js";
|
|
8
|
-
export { validateAccrualPosition, validateChainId, validateMidnightMarketChainId, validateNativeAsset, validatePositionHealth, validatePositionHealthAfterWithdraw, validateRepayAmount, validateRepayShares, validateSlippageTolerance, validateUserAddress, validateWithdrawAmount, validateWithdrawShares, } from "./validate.js";
|
|
9
|
+
export { validateAccrualPosition, validateChainId, validateMidnightMarketChainId, validateMidnightNativeAmount, validateNativeAsset, validatePositionHealth, validatePositionHealthAfterWithdraw, validateRepayAmount, validateRepayShares, validateSlippageTolerance, validateUserAddress, validateWithdrawAmount, validateWithdrawShares, } from "./validate.js";
|
|
9
10
|
export { validateOfferSides } from "./validateOfferSides.js";
|
|
10
11
|
export { type RequirementSpenderKey, validateRequirementSpender, } from "./validateRequirementSpender.js";
|
|
11
12
|
export { computeVaultV2ForceWithdrawFeeSharesMinted, computeVaultV2ForceWithdrawMinSharesBurnt, computeVaultV2ForceWithdrawPlan, computeVaultV2ForceWithdrawSharesBurnt, resolveVaultV2ForceWithdrawEligibility, type VaultV2ForceWithdrawEligibility, type VaultV2ForceWithdrawPlan, } from "./vaultV2ForceWithdrawPlan.js";
|
package/lib/cjs/helpers/index.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveVaultV2ForceWithdrawEligibility = exports.computeVaultV2ForceWithdrawSharesBurnt = exports.computeVaultV2ForceWithdrawPlan = exports.computeVaultV2ForceWithdrawMinSharesBurnt = exports.computeVaultV2ForceWithdrawFeeSharesMinted = exports.validateRequirementSpender = exports.validateOfferSides = exports.validateWithdrawShares = exports.validateWithdrawAmount = exports.validateUserAddress = exports.validateSlippageTolerance = exports.validateRepayShares = exports.validateRepayAmount = exports.validatePositionHealthAfterWithdraw = exports.validatePositionHealth = exports.validateNativeAsset = exports.validateMidnightMarketChainId = exports.validateChainId = exports.validateAccrualPosition = exports.computeVaultMaxSharePrice = exports.computeVaultMaxShareAllowance = exports.computeMinForceWithdrawSharePrice = exports.signAndVerifyTypedData = exports.grossFromNetAssets = exports.previewVaultV2InKindRedeem = exports.previewVaultV2ForceWithdraw = exports.addTransactionMetadata = exports.MAX_TOKEN_APPROVALS = exports.MAX_SLIPPAGE_TOLERANCE = exports.MAX_REALLOCATION_PENALTY = exports.MAX_ABSOLUTE_SHARE_PRICE = exports.DEFAULT_WITHDRAWAL_TARGET_UTILIZATION = exports.DEFAULT_SUPPLY_TARGET_UTILIZATION = exports.DEFAULT_MAX_REALLOCATION_PENALTY = exports.DEFAULT_LLTV_BUFFER = exports.DEFAULT_CAP_ACCRUAL_BUFFER = exports.APPROVE_ONLY_ONCE_TOKENS = void 0;
|
|
3
|
+
exports.resolveVaultV2ForceWithdrawEligibility = exports.computeVaultV2ForceWithdrawSharesBurnt = exports.computeVaultV2ForceWithdrawPlan = exports.computeVaultV2ForceWithdrawMinSharesBurnt = exports.computeVaultV2ForceWithdrawFeeSharesMinted = exports.validateRequirementSpender = exports.validateOfferSides = exports.validateWithdrawShares = exports.validateWithdrawAmount = exports.validateUserAddress = exports.validateSlippageTolerance = exports.validateRepayShares = exports.validateRepayAmount = exports.validatePositionHealthAfterWithdraw = exports.validatePositionHealth = exports.validateNativeAsset = exports.validateMidnightNativeAmount = exports.validateMidnightMarketChainId = exports.validateChainId = exports.validateAccrualPosition = exports.computeVaultMaxSharePrice = exports.computeVaultMaxShareAllowance = exports.computeMinForceWithdrawSharePrice = exports.signAndVerifyTypedData = exports.grossFromNetAssets = exports.previewVaultV2InKindRedeem = exports.previewVaultV2ForceWithdraw = exports.addTransactionMetadata = exports.MIDNIGHT_TAKE_MAX_DEADLINE_SECONDS = exports.MAX_TOKEN_APPROVALS = exports.MAX_SLIPPAGE_TOLERANCE = exports.MAX_REALLOCATION_PENALTY = exports.MAX_ABSOLUTE_SHARE_PRICE = exports.DEFAULT_WITHDRAWAL_TARGET_UTILIZATION = exports.DEFAULT_SUPPLY_TARGET_UTILIZATION = exports.DEFAULT_MAX_REALLOCATION_PENALTY = exports.DEFAULT_LLTV_BUFFER = exports.DEFAULT_CAP_ACCRUAL_BUFFER = exports.DEFAULT_ALLOCATOR_CAP_HEADROOM = exports.APPROVE_ONLY_ONCE_TOKENS = exports.getMidnightBlueBuyCallbackData = exports.getMidnightBlueBuyCallbackAddress = void 0;
|
|
4
|
+
var callback_js_1 = require("./callback.js");
|
|
5
|
+
Object.defineProperty(exports, "getMidnightBlueBuyCallbackAddress", { enumerable: true, get: function () { return callback_js_1.getMidnightBlueBuyCallbackAddress; } });
|
|
6
|
+
Object.defineProperty(exports, "getMidnightBlueBuyCallbackData", { enumerable: true, get: function () { return callback_js_1.getMidnightBlueBuyCallbackData; } });
|
|
4
7
|
var constant_js_1 = require("./constant.js");
|
|
5
8
|
Object.defineProperty(exports, "APPROVE_ONLY_ONCE_TOKENS", { enumerable: true, get: function () { return constant_js_1.APPROVE_ONLY_ONCE_TOKENS; } });
|
|
9
|
+
Object.defineProperty(exports, "DEFAULT_ALLOCATOR_CAP_HEADROOM", { enumerable: true, get: function () { return constant_js_1.DEFAULT_ALLOCATOR_CAP_HEADROOM; } });
|
|
6
10
|
Object.defineProperty(exports, "DEFAULT_CAP_ACCRUAL_BUFFER", { enumerable: true, get: function () { return constant_js_1.DEFAULT_CAP_ACCRUAL_BUFFER; } });
|
|
7
11
|
Object.defineProperty(exports, "DEFAULT_LLTV_BUFFER", { enumerable: true, get: function () { return constant_js_1.DEFAULT_LLTV_BUFFER; } });
|
|
8
12
|
Object.defineProperty(exports, "DEFAULT_MAX_REALLOCATION_PENALTY", { enumerable: true, get: function () { return constant_js_1.DEFAULT_MAX_REALLOCATION_PENALTY; } });
|
|
@@ -12,6 +16,7 @@ Object.defineProperty(exports, "MAX_ABSOLUTE_SHARE_PRICE", { enumerable: true, g
|
|
|
12
16
|
Object.defineProperty(exports, "MAX_REALLOCATION_PENALTY", { enumerable: true, get: function () { return constant_js_1.MAX_REALLOCATION_PENALTY; } });
|
|
13
17
|
Object.defineProperty(exports, "MAX_SLIPPAGE_TOLERANCE", { enumerable: true, get: function () { return constant_js_1.MAX_SLIPPAGE_TOLERANCE; } });
|
|
14
18
|
Object.defineProperty(exports, "MAX_TOKEN_APPROVALS", { enumerable: true, get: function () { return constant_js_1.MAX_TOKEN_APPROVALS; } });
|
|
19
|
+
Object.defineProperty(exports, "MIDNIGHT_TAKE_MAX_DEADLINE_SECONDS", { enumerable: true, get: function () { return constant_js_1.MIDNIGHT_TAKE_MAX_DEADLINE_SECONDS; } });
|
|
15
20
|
var metadata_js_1 = require("./metadata.js");
|
|
16
21
|
Object.defineProperty(exports, "addTransactionMetadata", { enumerable: true, get: function () { return metadata_js_1.addTransactionMetadata; } });
|
|
17
22
|
var previewVaultV2ForceWithdraw_js_1 = require("./previewVaultV2ForceWithdraw.js");
|
|
@@ -30,6 +35,7 @@ var validate_js_1 = require("./validate.js");
|
|
|
30
35
|
Object.defineProperty(exports, "validateAccrualPosition", { enumerable: true, get: function () { return validate_js_1.validateAccrualPosition; } });
|
|
31
36
|
Object.defineProperty(exports, "validateChainId", { enumerable: true, get: function () { return validate_js_1.validateChainId; } });
|
|
32
37
|
Object.defineProperty(exports, "validateMidnightMarketChainId", { enumerable: true, get: function () { return validate_js_1.validateMidnightMarketChainId; } });
|
|
38
|
+
Object.defineProperty(exports, "validateMidnightNativeAmount", { enumerable: true, get: function () { return validate_js_1.validateMidnightNativeAmount; } });
|
|
33
39
|
Object.defineProperty(exports, "validateNativeAsset", { enumerable: true, get: function () { return validate_js_1.validateNativeAsset; } });
|
|
34
40
|
Object.defineProperty(exports, "validatePositionHealth", { enumerable: true, get: function () { return validate_js_1.validatePositionHealth; } });
|
|
35
41
|
Object.defineProperty(exports, "validatePositionHealthAfterWithdraw", { enumerable: true, get: function () { return validate_js_1.validatePositionHealthAfterWithdraw; } });
|
|
@@ -4,7 +4,7 @@ import type { Address, Hex, TypedDataDefinition, WalletClient } from "viem";
|
|
|
4
4
|
* `userAddress`, and returns the signature.
|
|
5
5
|
*
|
|
6
6
|
* Use inside requirement `sign(...)` callbacks before converting a signature
|
|
7
|
-
* into protocol calldata
|
|
7
|
+
* into protocol calldata. The verification step keeps
|
|
8
8
|
* wallet/account mismatches from reaching transaction builders.
|
|
9
9
|
*
|
|
10
10
|
* @param params - Signing and verification parameters.
|
|
@@ -22,8 +22,8 @@ import type { Address, Hex, TypedDataDefinition, WalletClient } from "viem";
|
|
|
22
22
|
*
|
|
23
23
|
* const signature = await signAndVerifyTypedData({
|
|
24
24
|
* client: walletClient,
|
|
25
|
-
* userAddress:
|
|
26
|
-
* typedData:
|
|
25
|
+
* userAddress: user,
|
|
26
|
+
* typedData: permitTypedData,
|
|
27
27
|
* });
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
@@ -10,7 +10,7 @@ const validate_js_1 = require("./validate.js");
|
|
|
10
10
|
* `userAddress`, and returns the signature.
|
|
11
11
|
*
|
|
12
12
|
* Use inside requirement `sign(...)` callbacks before converting a signature
|
|
13
|
-
* into protocol calldata
|
|
13
|
+
* into protocol calldata. The verification step keeps
|
|
14
14
|
* wallet/account mismatches from reaching transaction builders.
|
|
15
15
|
*
|
|
16
16
|
* @param params - Signing and verification parameters.
|
|
@@ -28,8 +28,8 @@ const validate_js_1 = require("./validate.js");
|
|
|
28
28
|
*
|
|
29
29
|
* const signature = await signAndVerifyTypedData({
|
|
30
30
|
* client: walletClient,
|
|
31
|
-
* userAddress:
|
|
32
|
-
* typedData:
|
|
31
|
+
* userAddress: user,
|
|
32
|
+
* typedData: permitTypedData,
|
|
33
33
|
* });
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
@@ -11,6 +11,19 @@ import { type BigIntish } from "@morpho-org/blue-sdk";
|
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
13
|
export declare const resolveCapAccrualBuffer: (value?: BigIntish) => bigint;
|
|
14
|
+
/**
|
|
15
|
+
* Resolves and validates the BluePublicAllocator cap headroom share.
|
|
16
|
+
* @internal
|
|
17
|
+
* @param value - Optional WAD-scaled share of the allocator cap.
|
|
18
|
+
* @returns A share between zero and WAD, defaulting to 1%.
|
|
19
|
+
* @throws {NegativeInputError} when the share is negative.
|
|
20
|
+
* @throws {InputExceedsMaxError} when the share exceeds WAD.
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const headroom = resolveAllocatorCapHeadroom(undefined);
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare const resolveAllocatorCapHeadroom: (value?: bigint) => bigint;
|
|
14
27
|
/**
|
|
15
28
|
* Resolves and validates a source withdrawal utilization ceiling.
|
|
16
29
|
* @internal
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveMaxWithdrawalUtilization = exports.resolveCapAccrualBuffer = void 0;
|
|
3
|
+
exports.resolveMaxWithdrawalUtilization = exports.resolveAllocatorCapHeadroom = exports.resolveCapAccrualBuffer = void 0;
|
|
4
4
|
const blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
5
5
|
const index_js_1 = require("../types/index.js");
|
|
6
6
|
const constant_js_1 = require("./constant.js");
|
|
@@ -22,6 +22,31 @@ const resolveCapAccrualBuffer = (value) => {
|
|
|
22
22
|
return buffer;
|
|
23
23
|
};
|
|
24
24
|
exports.resolveCapAccrualBuffer = resolveCapAccrualBuffer;
|
|
25
|
+
/**
|
|
26
|
+
* Resolves and validates the BluePublicAllocator cap headroom share.
|
|
27
|
+
* @internal
|
|
28
|
+
* @param value - Optional WAD-scaled share of the allocator cap.
|
|
29
|
+
* @returns A share between zero and WAD, defaulting to 1%.
|
|
30
|
+
* @throws {NegativeInputError} when the share is negative.
|
|
31
|
+
* @throws {InputExceedsMaxError} when the share exceeds WAD.
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const headroom = resolveAllocatorCapHeadroom(undefined);
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
const resolveAllocatorCapHeadroom = (value) => {
|
|
38
|
+
const headroom = value ?? constant_js_1.DEFAULT_ALLOCATOR_CAP_HEADROOM;
|
|
39
|
+
if (headroom < 0n)
|
|
40
|
+
throw new index_js_1.NegativeInputError("allocatorCapHeadroom", headroom);
|
|
41
|
+
if (headroom > blue_sdk_1.MathLib.WAD)
|
|
42
|
+
throw new index_js_1.InputExceedsMaxError({
|
|
43
|
+
field: "allocatorCapHeadroom",
|
|
44
|
+
value: headroom,
|
|
45
|
+
max: blue_sdk_1.MathLib.WAD,
|
|
46
|
+
});
|
|
47
|
+
return headroom;
|
|
48
|
+
};
|
|
49
|
+
exports.resolveAllocatorCapHeadroom = resolveAllocatorCapHeadroom;
|
|
25
50
|
/**
|
|
26
51
|
* Resolves and validates a source withdrawal utilization ceiling.
|
|
27
52
|
* @internal
|
|
@@ -70,8 +70,7 @@ export declare const validateMidnightMarketChainId: (market: MidnightMarketInput
|
|
|
70
70
|
* the provided user address.
|
|
71
71
|
*
|
|
72
72
|
* Used at `sign()` time by the shared `signAndVerifyTypedData` helper (which
|
|
73
|
-
* backs the permit, Permit2, Blue authorization
|
|
74
|
-
* signature flows) and by `encodeVaultSharesPermit`, to enforce builder =
|
|
73
|
+
* backs the permit, Permit2, and Blue authorization signature flows) and by `encodeVaultSharesPermit`, to enforce builder =
|
|
75
74
|
* signer: the signing flow is
|
|
76
75
|
* the only path where an account/address mismatch is a real security concern
|
|
77
76
|
* (rather than just an integrator footgun).
|
|
@@ -163,6 +162,48 @@ export declare const validateChainId: (clientChainId: number | undefined, expect
|
|
|
163
162
|
* @throws {NativeAmountOnNonWNativeAssetError} if the asset is not wNative.
|
|
164
163
|
*/
|
|
165
164
|
export declare const validateNativeAsset: (chainId: number, asset: Address) => void;
|
|
165
|
+
/**
|
|
166
|
+
* Validates native ETH funding against the wNative tokens pulled by a MidnightBundlesV2 action.
|
|
167
|
+
*
|
|
168
|
+
* @param params.chainId - Chain used to resolve wNative.
|
|
169
|
+
* @param params.nativeAmount - Optional native ETH sent as `value`; the bundle wraps it into the
|
|
170
|
+
* chain's wNative and transfers it to `msg.sender` before pulling. It may cover part or all of the
|
|
171
|
+
* maximum wNative amount this call can pull, but not more. Any wrapped native not pulled stays in
|
|
172
|
+
* the sender's wallet as wNative. The wNative approval to `MidnightBundlesV2` is still required
|
|
173
|
+
* for the full pulled amount.
|
|
174
|
+
* @param params.pulls - Token pulls performed by the bundle action.
|
|
175
|
+
* @returns The transaction `value` and the `wrappedNative` contract argument.
|
|
176
|
+
* @throws {NegativeInputError} when `nativeAmount` is negative.
|
|
177
|
+
* @throws {ChainWNativeMissingError} when wNative is not configured for the chain.
|
|
178
|
+
* @throws {NativeAmountOnNonWNativeAssetError} when pulls are non-empty and none use wNative.
|
|
179
|
+
* @throws {InputExceedsMaxError} when `nativeAmount` exceeds the maximum wNative pull, including
|
|
180
|
+
* when the call pulls none.
|
|
181
|
+
* @example
|
|
182
|
+
* ```ts
|
|
183
|
+
* import { getChainAddress } from "@morpho-org/morpho-ts";
|
|
184
|
+
* import { validateMidnightNativeAmount } from "@morpho-org/morpho-sdk";
|
|
185
|
+
*
|
|
186
|
+
* const wNative = getChainAddress(8453, "wNative");
|
|
187
|
+
* const funding = validateMidnightNativeAmount({
|
|
188
|
+
* chainId: 8453,
|
|
189
|
+
* nativeAmount: 1_000n,
|
|
190
|
+
* pulls: [{ token: wNative, assets: 2_000n }],
|
|
191
|
+
* });
|
|
192
|
+
* funding.value; // 1_000n
|
|
193
|
+
* funding.wrappedNative; // wNative
|
|
194
|
+
* ```
|
|
195
|
+
*/
|
|
196
|
+
export declare const validateMidnightNativeAmount: (params: {
|
|
197
|
+
readonly chainId: number;
|
|
198
|
+
readonly nativeAmount?: bigint;
|
|
199
|
+
readonly pulls: readonly {
|
|
200
|
+
readonly token: Address;
|
|
201
|
+
readonly assets: bigint;
|
|
202
|
+
}[];
|
|
203
|
+
}) => {
|
|
204
|
+
value: bigint;
|
|
205
|
+
wrappedNative: Address;
|
|
206
|
+
};
|
|
166
207
|
/** @internal Validates native funding against a vault's wrapped-native asset. */
|
|
167
208
|
export declare const validateNativeVaultAsset: (chainId: number, vaultAsset: Address) => void;
|
|
168
209
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateWithdrawShares = exports.validateWithdrawAmount = exports.validateSlippageTolerance = exports.validateVaultV2BlueReallocations = exports.validateRepayShares = exports.validateRepayAmount = exports.validatePositionHealthAfterWithdraw = exports.validateNativeVaultAsset = exports.validateNativeAsset = exports.validateChainId = exports.validatePositionHealth = exports.validateAccrualPosition = exports.validateMidnightMarketChainId = exports.validateReferralFee = exports.validateDeadline = exports.validateUint256Field = void 0;
|
|
3
|
+
exports.validateWithdrawShares = exports.validateWithdrawAmount = exports.validateSlippageTolerance = exports.validateVaultV2BlueReallocations = exports.validateRepayShares = exports.validateRepayAmount = exports.validatePositionHealthAfterWithdraw = exports.validateNativeVaultAsset = exports.validateMidnightNativeAmount = exports.validateNativeAsset = exports.validateChainId = exports.validatePositionHealth = exports.validateAccrualPosition = exports.validateMidnightMarketChainId = exports.validateReferralFee = exports.validateDeadline = exports.validateUint256Field = void 0;
|
|
4
4
|
exports.validateUserAddress = validateUserAddress;
|
|
5
5
|
const blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
6
6
|
const morpho_ts_1 = require("@morpho-org/morpho-ts");
|
|
@@ -113,8 +113,7 @@ exports.validateMidnightMarketChainId = validateMidnightMarketChainId;
|
|
|
113
113
|
* the provided user address.
|
|
114
114
|
*
|
|
115
115
|
* Used at `sign()` time by the shared `signAndVerifyTypedData` helper (which
|
|
116
|
-
* backs the permit, Permit2, Blue authorization
|
|
117
|
-
* signature flows) and by `encodeVaultSharesPermit`, to enforce builder =
|
|
116
|
+
* backs the permit, Permit2, and Blue authorization signature flows) and by `encodeVaultSharesPermit`, to enforce builder =
|
|
118
117
|
* signer: the signing flow is
|
|
119
118
|
* the only path where an account/address mismatch is a real security concern
|
|
120
119
|
* (rather than just an integrator footgun).
|
|
@@ -242,6 +241,64 @@ const validateNativeAsset = (chainId, asset) => {
|
|
|
242
241
|
}
|
|
243
242
|
};
|
|
244
243
|
exports.validateNativeAsset = validateNativeAsset;
|
|
244
|
+
/**
|
|
245
|
+
* Validates native ETH funding against the wNative tokens pulled by a MidnightBundlesV2 action.
|
|
246
|
+
*
|
|
247
|
+
* @param params.chainId - Chain used to resolve wNative.
|
|
248
|
+
* @param params.nativeAmount - Optional native ETH sent as `value`; the bundle wraps it into the
|
|
249
|
+
* chain's wNative and transfers it to `msg.sender` before pulling. It may cover part or all of the
|
|
250
|
+
* maximum wNative amount this call can pull, but not more. Any wrapped native not pulled stays in
|
|
251
|
+
* the sender's wallet as wNative. The wNative approval to `MidnightBundlesV2` is still required
|
|
252
|
+
* for the full pulled amount.
|
|
253
|
+
* @param params.pulls - Token pulls performed by the bundle action.
|
|
254
|
+
* @returns The transaction `value` and the `wrappedNative` contract argument.
|
|
255
|
+
* @throws {NegativeInputError} when `nativeAmount` is negative.
|
|
256
|
+
* @throws {ChainWNativeMissingError} when wNative is not configured for the chain.
|
|
257
|
+
* @throws {NativeAmountOnNonWNativeAssetError} when pulls are non-empty and none use wNative.
|
|
258
|
+
* @throws {InputExceedsMaxError} when `nativeAmount` exceeds the maximum wNative pull, including
|
|
259
|
+
* when the call pulls none.
|
|
260
|
+
* @example
|
|
261
|
+
* ```ts
|
|
262
|
+
* import { getChainAddress } from "@morpho-org/morpho-ts";
|
|
263
|
+
* import { validateMidnightNativeAmount } from "@morpho-org/morpho-sdk";
|
|
264
|
+
*
|
|
265
|
+
* const wNative = getChainAddress(8453, "wNative");
|
|
266
|
+
* const funding = validateMidnightNativeAmount({
|
|
267
|
+
* chainId: 8453,
|
|
268
|
+
* nativeAmount: 1_000n,
|
|
269
|
+
* pulls: [{ token: wNative, assets: 2_000n }],
|
|
270
|
+
* });
|
|
271
|
+
* funding.value; // 1_000n
|
|
272
|
+
* funding.wrappedNative; // wNative
|
|
273
|
+
* ```
|
|
274
|
+
*/
|
|
275
|
+
const validateMidnightNativeAmount = (params) => {
|
|
276
|
+
const { nativeAmount, chainId, pulls } = params;
|
|
277
|
+
if (nativeAmount === undefined || nativeAmount === 0n) {
|
|
278
|
+
return { value: 0n, wrappedNative: viem_1.zeroAddress };
|
|
279
|
+
}
|
|
280
|
+
if (nativeAmount < 0n) {
|
|
281
|
+
throw new index_js_1.NegativeInputError("nativeAmount", nativeAmount);
|
|
282
|
+
}
|
|
283
|
+
const { wNative } = (0, blue_sdk_1.getChainAddresses)(chainId);
|
|
284
|
+
if (!(0, morpho_ts_1.isDefined)(wNative)) {
|
|
285
|
+
throw new index_js_1.ChainWNativeMissingError(chainId);
|
|
286
|
+
}
|
|
287
|
+
const wNativePulled = pulls.reduce((total, pull) => (0, viem_1.isAddressEqual)(pull.token, wNative) ? total + pull.assets : total, 0n);
|
|
288
|
+
const firstPull = pulls[0];
|
|
289
|
+
if (firstPull && !pulls.some((pull) => (0, viem_1.isAddressEqual)(pull.token, wNative))) {
|
|
290
|
+
throw new index_js_1.NativeAmountOnNonWNativeAssetError(firstPull.token, wNative);
|
|
291
|
+
}
|
|
292
|
+
if (nativeAmount > wNativePulled) {
|
|
293
|
+
throw new index_js_1.InputExceedsMaxError({
|
|
294
|
+
field: "nativeAmount",
|
|
295
|
+
value: nativeAmount,
|
|
296
|
+
max: wNativePulled,
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
return { value: nativeAmount, wrappedNative: wNative };
|
|
300
|
+
};
|
|
301
|
+
exports.validateMidnightNativeAmount = validateMidnightNativeAmount;
|
|
245
302
|
/** @internal Validates native funding against a vault's wrapped-native asset. */
|
|
246
303
|
const validateNativeVaultAsset = (chainId, vaultAsset) => {
|
|
247
304
|
const { wNative } = (0, blue_sdk_1.getChainAddresses)(chainId);
|
|
@@ -5,7 +5,7 @@ import { type Address } from "viem";
|
|
|
5
5
|
* @param params - Authorization target validation parameters.
|
|
6
6
|
* @param params.chainId - Chain id used to resolve supported Midnight operators.
|
|
7
7
|
* @param params.authorized - Operator address receiving authorization.
|
|
8
|
-
* @returns Nothing after the operator matches
|
|
8
|
+
* @returns Nothing after the operator matches MidnightBundlesV2.
|
|
9
9
|
* @throws {UnsupportedMidnightAuthorizationTargetError} when `authorized` is not a supported operator.
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
@@ -10,17 +10,13 @@ const index_js_1 = require("../types/index.js");
|
|
|
10
10
|
* @param params - Authorization target validation parameters.
|
|
11
11
|
* @param params.chainId - Chain id used to resolve supported Midnight operators.
|
|
12
12
|
* @param params.authorized - Operator address receiving authorization.
|
|
13
|
-
* @returns Nothing after the operator matches
|
|
13
|
+
* @returns Nothing after the operator matches MidnightBundlesV2.
|
|
14
14
|
* @throws {UnsupportedMidnightAuthorizationTargetError} when `authorized` is not a supported operator.
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
17
17
|
const validateMidnightAuthorizationTarget = (params) => {
|
|
18
|
-
const {
|
|
19
|
-
const supportedTargets = [
|
|
20
|
-
midnightBundles,
|
|
21
|
-
ecrecoverRatifier,
|
|
22
|
-
setterRatifier,
|
|
23
|
-
].filter((target) => target != null);
|
|
18
|
+
const { midnightBundlesV2 } = (0, morpho_ts_1.getChainAddresses)(params.chainId);
|
|
19
|
+
const supportedTargets = midnightBundlesV2 == null ? [] : [midnightBundlesV2];
|
|
24
20
|
if (!supportedTargets.some((supported) => (0, viem_1.isAddressEqual)(params.authorized, supported))) {
|
|
25
21
|
throw new index_js_1.UnsupportedMidnightAuthorizationTargetError({
|
|
26
22
|
authorized: params.authorized,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Address } from "@morpho-org/blue-sdk";
|
|
2
2
|
/** Supported spender slots that can be validated against the chain address registry. */
|
|
3
|
-
export type RequirementSpenderKey = "permit2" | "midnight" | "
|
|
3
|
+
export type RequirementSpenderKey = "permit2" | "midnight" | "midnightBundlesV2" | "vaultExitBundlesV1" | "vaultBundlesV1" | "blueBundlesV1";
|
|
4
4
|
/**
|
|
5
5
|
* Validates that a requirement encoder spender matches one of the allowed chain addresses.
|
|
6
6
|
*
|
|
@@ -18,8 +18,8 @@ export type RequirementSpenderKey = "permit2" | "midnight" | "midnightBundles" |
|
|
|
18
18
|
*
|
|
19
19
|
* validateRequirementSpender({
|
|
20
20
|
* chainId: 8453,
|
|
21
|
-
* spender: getChainAddress(8453, "
|
|
22
|
-
* allowed: ["
|
|
21
|
+
* spender: getChainAddress(8453, "midnight"),
|
|
22
|
+
* allowed: ["midnight"],
|
|
23
23
|
* });
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
@@ -21,17 +21,17 @@ const index_js_1 = require("../types/index.js");
|
|
|
21
21
|
*
|
|
22
22
|
* validateRequirementSpender({
|
|
23
23
|
* chainId: 8453,
|
|
24
|
-
* spender: getChainAddress(8453, "
|
|
25
|
-
* allowed: ["
|
|
24
|
+
* spender: getChainAddress(8453, "midnight"),
|
|
25
|
+
* allowed: ["midnight"],
|
|
26
26
|
* });
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
29
|
const validateRequirementSpender = (params) => {
|
|
30
|
-
const { permit2, midnight,
|
|
30
|
+
const { permit2, midnight, midnightBundlesV2, bundles } = (0, blue_sdk_1.getChainAddresses)(params.chainId);
|
|
31
31
|
const addresses = {
|
|
32
32
|
permit2,
|
|
33
33
|
midnight,
|
|
34
|
-
|
|
34
|
+
midnightBundlesV2,
|
|
35
35
|
vaultExitBundlesV1: bundles?.vaultExitBundlesV1,
|
|
36
36
|
vaultBundlesV1: bundles?.vaultBundlesV1,
|
|
37
37
|
blueBundlesV1: bundles?.blueBundlesV1,
|
|
@@ -43,7 +43,6 @@ const validateRequirementSpender = (params) => {
|
|
|
43
43
|
chainId: params.chainId,
|
|
44
44
|
permit2,
|
|
45
45
|
midnight,
|
|
46
|
-
midnightBundles,
|
|
47
46
|
supportedSpenders,
|
|
48
47
|
});
|
|
49
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ecrecoverRatifierAbi, midnightAbi,
|
|
1
|
+
export { blueBuyCallbackFactoryAbi, ecrecoverRatifierAbi, midnightAbi, midnightBundlesV2Abi, priceRatifierV1Abi, rateRatifierV1Abi, setterRatifierAbi, } from "@morpho-org/midnight-sdk";
|
package/lib/cjs/midnight/abis.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setterRatifierAbi = exports.rateRatifierV1Abi = exports.priceRatifierV1Abi = exports.
|
|
3
|
+
exports.setterRatifierAbi = exports.rateRatifierV1Abi = exports.priceRatifierV1Abi = exports.midnightBundlesV2Abi = exports.midnightAbi = exports.ecrecoverRatifierAbi = exports.blueBuyCallbackFactoryAbi = void 0;
|
|
4
4
|
var midnight_sdk_1 = require("@morpho-org/midnight-sdk");
|
|
5
|
+
Object.defineProperty(exports, "blueBuyCallbackFactoryAbi", { enumerable: true, get: function () { return midnight_sdk_1.blueBuyCallbackFactoryAbi; } });
|
|
5
6
|
Object.defineProperty(exports, "ecrecoverRatifierAbi", { enumerable: true, get: function () { return midnight_sdk_1.ecrecoverRatifierAbi; } });
|
|
6
7
|
Object.defineProperty(exports, "midnightAbi", { enumerable: true, get: function () { return midnight_sdk_1.midnightAbi; } });
|
|
7
|
-
Object.defineProperty(exports, "
|
|
8
|
+
Object.defineProperty(exports, "midnightBundlesV2Abi", { enumerable: true, get: function () { return midnight_sdk_1.midnightBundlesV2Abi; } });
|
|
8
9
|
Object.defineProperty(exports, "priceRatifierV1Abi", { enumerable: true, get: function () { return midnight_sdk_1.priceRatifierV1Abi; } });
|
|
9
10
|
Object.defineProperty(exports, "rateRatifierV1Abi", { enumerable: true, get: function () { return midnight_sdk_1.rateRatifierV1Abi; } });
|
|
10
11
|
Object.defineProperty(exports, "setterRatifierAbi", { enumerable: true, get: function () { return midnight_sdk_1.setterRatifierAbi; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { BuildFixedRateOfferChainParams, DecodedEcrecoverRatifierData, DecodedPriceRatifierV1Data, DecodedRateRatifierV1Data, DecodedSetterRatifierData, DeploylessFetchParameters, EcrecoverRatificationTypedData, EcrecoverRatifierDataDigestParams, EcrecoverRatifierDataParams, EcrecoverRatifierDataRequest, EcrecoverRatifierDataVerificationParams, EcrecoverRatifierRatifyParams, EcrecoverRatifierRatifyRequest, EcrecoverRatifierRootDigestParams, EcrecoverRatifierSignRequest, EcrecoverRatifierTypedDataParams, EcrecoverRatifierTypedDataRequest, EcrecoverSignatureInput, FixedRateOfferChainLeg, GetRatifierInfoParams, MidnightCallParameters, MidnightFetchParams, PriceRatifierV1Leaf, PriceRatifierV1LeafStruct, PriceRatifierV1TreeDescriptor, PriceRatifierV1TreeInput, RateRatifierV1Leaf, RateRatifierV1LeafStruct, RateRatifierV1TreeDescriptor, RateRatifierV1TreeInput, RatifierInfo, SetterRatifierDataParams, SetterRatifierDataRequest, SetterRatifierDataVerificationParams, SetterRatifierRatifyRequest, VerifiedEcrecoverRatifierData, } from "@morpho-org/midnight-sdk";
|
|
1
|
+
export type { BuildFixedRateOfferChainParams, CollateralTransfer, DecodedEcrecoverRatifierData, DecodedPriceRatifierV1Data, DecodedRateRatifierV1Data, DecodedSetterRatifierData, DeploylessFetchParameters, EcrecoverRatificationTypedData, EcrecoverRatifierDataDigestParams, EcrecoverRatifierDataParams, EcrecoverRatifierDataRequest, EcrecoverRatifierDataVerificationParams, EcrecoverRatifierRatifyParams, EcrecoverRatifierRatifyRequest, EcrecoverRatifierRootDigestParams, EcrecoverRatifierSignRequest, EcrecoverRatifierTypedDataParams, EcrecoverRatifierTypedDataRequest, EcrecoverSignatureInput, FixedRateOfferChainLeg, GetRatifierInfoParams, GroupCancellation, MidnightCallParameters, MidnightFetchParams, PriceRatifierV1Leaf, PriceRatifierV1LeafStruct, PriceRatifierV1TreeDescriptor, PriceRatifierV1TreeInput, RateRatifierV1Leaf, RateRatifierV1LeafStruct, RateRatifierV1TreeDescriptor, RateRatifierV1TreeInput, RatifierInfo, SetterRatifierDataParams, SetterRatifierDataRequest, SetterRatifierDataVerificationParams, SetterRatifierRatifyRequest, VerifiedEcrecoverRatifierData, } from "@morpho-org/midnight-sdk";
|