@morpho-org/morpho-sdk 10.0.2 → 10.1.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/README.md +6 -2
- package/lib/cjs/actions/blue/borrow.d.ts +2 -1
- package/lib/cjs/actions/blue/borrow.internal.d.ts +13 -0
- package/lib/cjs/actions/blue/borrow.internal.js +35 -0
- package/lib/cjs/actions/blue/borrow.js +4 -16
- package/lib/cjs/actions/blue/common.d.ts +50 -28
- package/lib/cjs/actions/blue/common.js +21 -34
- package/lib/cjs/actions/blue/encode.d.ts +23 -0
- package/lib/cjs/actions/blue/encode.js +171 -0
- package/lib/cjs/actions/blue/refinance.d.ts +3 -2
- package/lib/cjs/actions/blue/refinance.internal.d.ts +42 -0
- package/lib/cjs/actions/blue/refinance.internal.js +62 -0
- package/lib/cjs/actions/blue/refinance.js +5 -63
- package/lib/cjs/actions/blue/refinanceValidation.d.ts +4 -5
- package/lib/cjs/actions/blue/refinanceValidation.js +1 -3
- package/lib/cjs/actions/blue/repay.d.ts +1 -1
- package/lib/cjs/actions/blue/repay.internal.d.ts +13 -0
- package/lib/cjs/actions/blue/repay.internal.js +38 -0
- package/lib/cjs/actions/blue/repay.js +2 -17
- package/lib/cjs/actions/blue/repayWithdrawCollateral.d.ts +2 -2
- package/lib/cjs/actions/blue/repayWithdrawCollateral.internal.d.ts +61 -0
- package/lib/cjs/actions/blue/repayWithdrawCollateral.internal.js +112 -0
- package/lib/cjs/actions/blue/repayWithdrawCollateral.js +3 -116
- package/lib/cjs/actions/blue/signatures.d.ts +30 -0
- package/lib/cjs/actions/blue/signatures.js +90 -0
- package/lib/cjs/actions/blue/supply.d.ts +1 -1
- package/lib/cjs/actions/blue/supply.internal.d.ts +32 -0
- package/lib/cjs/actions/blue/supply.internal.js +101 -0
- package/lib/cjs/actions/blue/supply.js +2 -67
- package/lib/cjs/actions/blue/supplyCollateral.d.ts +1 -1
- package/lib/cjs/actions/blue/supplyCollateral.internal.d.ts +13 -0
- package/lib/cjs/actions/blue/supplyCollateral.internal.js +37 -0
- package/lib/cjs/actions/blue/supplyCollateral.js +2 -17
- package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +4 -3
- package/lib/cjs/actions/blue/supplyCollateralBorrow.internal.d.ts +63 -0
- package/lib/cjs/actions/blue/supplyCollateralBorrow.internal.js +94 -0
- package/lib/cjs/actions/blue/supplyCollateralBorrow.js +5 -106
- package/lib/cjs/actions/blue/withdraw.d.ts +4 -3
- package/lib/cjs/actions/blue/withdraw.internal.d.ts +56 -0
- package/lib/cjs/actions/blue/withdraw.internal.js +84 -0
- package/lib/cjs/actions/blue/withdraw.js +5 -78
- package/lib/cjs/actions/blue/withdrawBuyCallback.d.ts +2 -2
- package/lib/cjs/actions/blue/withdrawBuyCallback.internal.d.ts +20 -0
- package/lib/cjs/actions/blue/withdrawBuyCallback.internal.js +58 -0
- package/lib/cjs/actions/blue/withdrawBuyCallback.js +2 -39
- package/lib/cjs/actions/blue/withdrawCollateral.internal.d.ts +16 -0
- package/lib/cjs/actions/blue/withdrawCollateral.internal.js +39 -0
- package/lib/cjs/actions/blue/withdrawCollateral.js +2 -17
- package/lib/cjs/actions/bundles/common.d.ts +9 -0
- package/lib/cjs/actions/bundles/common.js +18 -6
- package/lib/cjs/actions/bundles/index.d.ts +1 -1
- package/lib/cjs/actions/bundles/index.js +3 -16
- package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.d.ts +14 -0
- package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.js +59 -60
- package/lib/cjs/actions/midnight/cancelAndMake.d.ts +22 -1
- package/lib/cjs/actions/midnight/cancelAndMake.js +46 -87
- package/lib/cjs/actions/midnight/cancelOffers.d.ts +11 -0
- package/lib/cjs/actions/midnight/cancelOffers.js +22 -4
- package/lib/cjs/actions/midnight/encode.d.ts +36 -0
- package/lib/cjs/actions/midnight/encode.js +554 -0
- package/lib/cjs/actions/midnight/index.d.ts +14 -13
- package/lib/cjs/actions/midnight/index.js +29 -13
- package/lib/cjs/actions/midnight/parse.d.ts +35 -0
- package/lib/cjs/actions/midnight/parse.js +73 -0
- package/lib/cjs/actions/midnight/parseCollateralBatch.d.ts +58 -0
- package/lib/cjs/actions/midnight/parseCollateralBatch.js +216 -0
- package/lib/cjs/actions/midnight/redeem.d.ts +16 -3
- package/lib/cjs/actions/midnight/redeem.js +22 -51
- package/lib/cjs/actions/midnight/repayWithdrawCollateral.d.ts +13 -0
- package/lib/cjs/actions/midnight/repayWithdrawCollateral.js +42 -67
- package/lib/cjs/actions/midnight/supplyCollateral.d.ts +40 -5
- package/lib/cjs/actions/midnight/supplyCollateral.js +60 -54
- package/lib/cjs/actions/midnight/supplyCollateralBatch.d.ts +3 -3
- package/lib/cjs/actions/midnight/supplyCollateralBatch.js +3 -62
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.d.ts +24 -0
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.js +39 -66
- package/lib/cjs/actions/midnight/supplyCollateralWithNative.d.ts +77 -0
- package/lib/cjs/actions/midnight/supplyCollateralWithNative.js +142 -0
- package/lib/cjs/actions/midnight/takeBorrow.d.ts +17 -2
- package/lib/cjs/actions/midnight/takeBorrow.js +25 -55
- package/lib/cjs/actions/midnight/takeLend.d.ts +21 -1
- package/lib/cjs/actions/midnight/takeLend.js +30 -57
- package/lib/cjs/actions/midnight/takeRepayWithdrawCollateral.d.ts +22 -2
- package/lib/cjs/actions/midnight/takeRepayWithdrawCollateral.js +34 -61
- package/lib/cjs/actions/midnight/takeWithdraw.d.ts +17 -2
- package/lib/cjs/actions/midnight/takeWithdraw.js +78 -115
- package/lib/cjs/actions/midnight/withdrawCollateral.d.ts +16 -3
- package/lib/cjs/actions/midnight/withdrawCollateral.js +25 -56
- package/lib/cjs/actions/midnight/withdrawCollateralBatch.d.ts +3 -3
- package/lib/cjs/actions/midnight/withdrawCollateralBatch.js +3 -71
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +13 -0
- package/lib/cjs/actions/requirements/blue/getBlueAuthorizationRequirement.js +39 -19
- package/lib/cjs/actions/requirements/blue/index.d.ts +1 -1
- package/lib/cjs/actions/requirements/blue/index.js +3 -15
- package/lib/cjs/actions/requirements/chainCheck.d.ts +5 -0
- package/lib/cjs/actions/requirements/chainCheck.js +10 -0
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +10 -0
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +40 -27
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +11 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +36 -17
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +14 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +44 -9
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +10 -0
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +61 -24
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.d.ts +10 -0
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.js +25 -4
- package/lib/cjs/actions/requirements/encode/index.d.ts +5 -5
- package/lib/cjs/actions/requirements/encode/index.js +11 -19
- package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +26 -11
- package/lib/cjs/actions/requirements/getRequirementsApproval.js +40 -12
- package/lib/cjs/actions/requirements/index.d.ts +1 -1
- package/lib/cjs/actions/requirements/index.js +3 -1
- package/lib/cjs/actions/requirements/midnight/getMidnightApprovalRequirements.d.ts +11 -0
- package/lib/cjs/actions/requirements/midnight/getMidnightApprovalRequirements.js +34 -19
- package/lib/cjs/actions/requirements/midnight/getMidnightAuthorizationRequirement.d.ts +11 -0
- package/lib/cjs/actions/requirements/midnight/getMidnightAuthorizationRequirement.js +26 -12
- package/lib/cjs/actions/requirements/midnight/index.d.ts +2 -2
- package/lib/cjs/actions/requirements/midnight/index.js +5 -16
- package/lib/cjs/actions/vaultV1/deposit.d.ts +21 -0
- package/lib/cjs/actions/vaultV1/deposit.js +46 -10
- package/lib/cjs/actions/vaultV1/inKindRedeem.d.ts +18 -1
- package/lib/cjs/actions/vaultV1/inKindRedeem.js +36 -16
- package/lib/cjs/actions/vaultV1/index.d.ts +5 -5
- package/lib/cjs/actions/vaultV1/index.js +11 -19
- package/lib/cjs/actions/vaultV1/migrateToV2.d.ts +21 -0
- package/lib/cjs/actions/vaultV1/migrateToV2.js +49 -11
- package/lib/cjs/actions/vaultV1/redeem.d.ts +19 -0
- package/lib/cjs/actions/vaultV1/redeem.js +28 -7
- package/lib/cjs/actions/vaultV1/withdraw.d.ts +19 -0
- package/lib/cjs/actions/vaultV1/withdraw.js +28 -7
- package/lib/cjs/actions/vaultV2/deposit.d.ts +21 -0
- package/lib/cjs/actions/vaultV2/deposit.js +46 -10
- package/lib/cjs/actions/vaultV2/forceRedeem.d.ts +20 -2
- package/lib/cjs/actions/vaultV2/forceRedeem.js +39 -8
- package/lib/cjs/actions/vaultV2/forceWithdraw.d.ts +23 -1
- package/lib/cjs/actions/vaultV2/forceWithdraw.js +36 -14
- package/lib/cjs/actions/vaultV2/inKindRedeem.d.ts +18 -1
- package/lib/cjs/actions/vaultV2/inKindRedeem.js +35 -15
- package/lib/cjs/actions/vaultV2/index.d.ts +6 -6
- package/lib/cjs/actions/vaultV2/index.js +13 -20
- package/lib/cjs/actions/vaultV2/redeem.d.ts +19 -0
- package/lib/cjs/actions/vaultV2/redeem.js +28 -7
- package/lib/cjs/actions/vaultV2/withdraw.d.ts +19 -0
- package/lib/cjs/actions/vaultV2/withdraw.js +28 -7
- package/lib/cjs/entities/blue/blue.d.ts +35 -8
- package/lib/cjs/entities/blue/blue.js +467 -406
- package/lib/cjs/entities/midnight/midnight.d.ts +117 -41
- package/lib/cjs/entities/midnight/midnight.js +472 -843
- package/lib/cjs/entities/midnight/parse.d.ts +74 -0
- package/lib/cjs/entities/midnight/parse.js +336 -0
- package/lib/cjs/entities/midnight/prepare.d.ts +47 -0
- package/lib/cjs/entities/midnight/prepare.js +293 -0
- package/lib/cjs/entities/midnight/publication.d.ts +7 -3
- package/lib/cjs/entities/midnight/publication.js +10 -7
- package/lib/cjs/entities/midnight/types.d.ts +7 -0
- package/lib/cjs/entities/requirements/assertContractCode.d.ts +10 -5
- package/lib/cjs/entities/requirements/assertContractCode.js +24 -15
- package/lib/cjs/entities/requirements/getBundlesTokenRequirements.d.ts +15 -0
- package/lib/cjs/entities/requirements/getBundlesTokenRequirements.js +59 -51
- package/lib/cjs/entities/requirements/getErc2612Permit.d.ts +7 -3
- package/lib/cjs/entities/requirements/getErc2612Permit.js +20 -4
- package/lib/cjs/entities/requirements/getUnusedPermit2Nonce.d.ts +15 -0
- package/lib/cjs/entities/requirements/getUnusedPermit2Nonce.js +24 -7
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.d.ts +14 -0
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.js +27 -7
- package/lib/cjs/entities/requirements/getVaultV1InKindRedeemRequirements.js +4 -3
- package/lib/cjs/entities/requirements/getVaultV2ForceWithdrawRequirements.js +4 -3
- package/lib/cjs/entities/requirements/getVaultV2InKindRedeemRequirements.js +4 -3
- package/lib/cjs/entities/requirements/index.d.ts +2 -2
- package/lib/cjs/entities/requirements/index.js +5 -16
- package/lib/cjs/entities/requirements/validateNativeRequirements.d.ts +21 -0
- package/lib/cjs/entities/requirements/validateNativeRequirements.js +37 -0
- package/lib/cjs/entities/vaultV1/inKindRedeemQuote.d.ts +2 -2
- package/lib/cjs/entities/vaultV1/inKindRedeemQuote.js +1 -7
- package/lib/cjs/entities/vaultV1/vaultV1.d.ts +17 -40
- package/lib/cjs/entities/vaultV1/vaultV1.js +228 -159
- package/lib/cjs/entities/vaultV2/forceWithdrawQuote.d.ts +4 -0
- package/lib/cjs/entities/vaultV2/forceWithdrawQuote.js +9 -4
- package/lib/cjs/entities/vaultV2/inKindRedeemQuote.d.ts +2 -2
- package/lib/cjs/entities/vaultV2/inKindRedeemQuote.js +1 -7
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +21 -52
- package/lib/cjs/entities/vaultV2/vaultV2.js +226 -150
- package/lib/cjs/helpers/parse.d.ts +33 -0
- package/lib/cjs/helpers/parse.js +71 -0
- package/lib/cjs/helpers/parseMidnight.d.ts +48 -0
- package/lib/cjs/helpers/parseMidnight.js +95 -0
- package/lib/cjs/helpers/parseMidnightMaker.d.ts +44 -0
- package/lib/cjs/helpers/parseMidnightMaker.js +154 -0
- package/lib/cjs/helpers/validate.d.ts +3 -2
- package/lib/cjs/helpers/validate.js +4 -0
- package/lib/cjs/helpers/validateMidnightCancelAndMakePublication.d.ts +8 -0
- package/lib/cjs/helpers/validateMidnightCancelAndMakePublication.js +4 -4
- package/lib/cjs/helpers/validateMidnightPublication.d.ts +17 -1
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/transactionPlan/blue/refinance.js +17 -9
- package/lib/cjs/transactionPlan/blue/repay.js +2 -1
- package/lib/cjs/transactionPlan/blue/repayWithdrawCollateral.js +23 -4
- package/lib/cjs/transactionPlan/blue/supplyCollateralBorrow.js +2 -2
- package/lib/cjs/transactionPlan/blue/withdraw.d.ts +2 -2
- package/lib/cjs/transactionPlan/blue/withdraw.js +3 -3
- package/lib/cjs/transactionPlan/blue/withdrawCollateral.js +6 -2
- package/lib/cjs/transactionPlan/validation.d.ts +1 -1
- package/lib/cjs/transactionPlan/validation.js +3 -0
- package/lib/cjs/transactionPlan/vaultv1/deposit.d.ts +2 -2
- package/lib/cjs/transactionPlan/vaultv1/deposit.js +2 -2
- package/lib/cjs/types/action.d.ts +13 -2
- package/lib/cjs/types/error.d.ts +20 -2
- package/lib/cjs/types/error.js +32 -3
- package/lib/cjs/version.d.ts +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/actions/blue/borrow.d.ts +2 -1
- package/lib/esm/actions/blue/borrow.internal.d.ts +13 -0
- package/lib/esm/actions/blue/borrow.internal.js +30 -0
- package/lib/esm/actions/blue/borrow.js +4 -16
- package/lib/esm/actions/blue/common.d.ts +50 -28
- package/lib/esm/actions/blue/common.js +21 -33
- package/lib/esm/actions/blue/encode.d.ts +23 -0
- package/lib/esm/actions/blue/encode.js +164 -0
- package/lib/esm/actions/blue/refinance.d.ts +3 -2
- package/lib/esm/actions/blue/refinance.internal.d.ts +42 -0
- package/lib/esm/actions/blue/refinance.internal.js +56 -0
- package/lib/esm/actions/blue/refinance.js +5 -63
- package/lib/esm/actions/blue/refinanceValidation.d.ts +4 -5
- package/lib/esm/actions/blue/refinanceValidation.js +2 -4
- package/lib/esm/actions/blue/repay.d.ts +1 -1
- package/lib/esm/actions/blue/repay.internal.d.ts +13 -0
- package/lib/esm/actions/blue/repay.internal.js +33 -0
- package/lib/esm/actions/blue/repay.js +2 -17
- package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +2 -2
- package/lib/esm/actions/blue/repayWithdrawCollateral.internal.d.ts +61 -0
- package/lib/esm/actions/blue/repayWithdrawCollateral.internal.js +104 -0
- package/lib/esm/actions/blue/repayWithdrawCollateral.js +3 -116
- package/lib/esm/actions/blue/signatures.d.ts +30 -0
- package/lib/esm/actions/blue/signatures.js +82 -0
- package/lib/esm/actions/blue/supply.d.ts +1 -1
- package/lib/esm/actions/blue/supply.internal.d.ts +32 -0
- package/lib/esm/actions/blue/supply.internal.js +95 -0
- package/lib/esm/actions/blue/supply.js +2 -67
- package/lib/esm/actions/blue/supplyCollateral.d.ts +1 -1
- package/lib/esm/actions/blue/supplyCollateral.internal.d.ts +13 -0
- package/lib/esm/actions/blue/supplyCollateral.internal.js +32 -0
- package/lib/esm/actions/blue/supplyCollateral.js +2 -17
- package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +4 -3
- package/lib/esm/actions/blue/supplyCollateralBorrow.internal.d.ts +63 -0
- package/lib/esm/actions/blue/supplyCollateralBorrow.internal.js +87 -0
- package/lib/esm/actions/blue/supplyCollateralBorrow.js +5 -106
- package/lib/esm/actions/blue/withdraw.d.ts +4 -3
- package/lib/esm/actions/blue/withdraw.internal.d.ts +56 -0
- package/lib/esm/actions/blue/withdraw.internal.js +77 -0
- package/lib/esm/actions/blue/withdraw.js +5 -78
- package/lib/esm/actions/blue/withdrawBuyCallback.d.ts +2 -2
- package/lib/esm/actions/blue/withdrawBuyCallback.internal.d.ts +20 -0
- package/lib/esm/actions/blue/withdrawBuyCallback.internal.js +53 -0
- package/lib/esm/actions/blue/withdrawBuyCallback.js +2 -39
- package/lib/esm/actions/blue/withdrawCollateral.internal.d.ts +16 -0
- package/lib/esm/actions/blue/withdrawCollateral.internal.js +34 -0
- package/lib/esm/actions/blue/withdrawCollateral.js +2 -17
- package/lib/esm/actions/bundles/common.d.ts +9 -0
- package/lib/esm/actions/bundles/common.js +15 -4
- package/lib/esm/actions/bundles/index.d.ts +1 -1
- package/lib/esm/actions/bundles/index.js +1 -1
- package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.d.ts +14 -0
- package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.js +58 -61
- package/lib/esm/actions/midnight/cancelAndMake.d.ts +22 -1
- package/lib/esm/actions/midnight/cancelAndMake.js +43 -85
- package/lib/esm/actions/midnight/cancelOffers.d.ts +11 -0
- package/lib/esm/actions/midnight/cancelOffers.js +18 -2
- package/lib/esm/actions/midnight/encode.d.ts +36 -0
- package/lib/esm/actions/midnight/encode.js +539 -0
- package/lib/esm/actions/midnight/index.d.ts +14 -13
- package/lib/esm/actions/midnight/index.js +14 -13
- package/lib/esm/actions/midnight/parse.d.ts +35 -0
- package/lib/esm/actions/midnight/parse.js +68 -0
- package/lib/esm/actions/midnight/parseCollateralBatch.d.ts +58 -0
- package/lib/esm/actions/midnight/parseCollateralBatch.js +209 -0
- package/lib/esm/actions/midnight/redeem.d.ts +16 -3
- package/lib/esm/actions/midnight/redeem.js +20 -50
- package/lib/esm/actions/midnight/repayWithdrawCollateral.d.ts +13 -0
- package/lib/esm/actions/midnight/repayWithdrawCollateral.js +38 -64
- package/lib/esm/actions/midnight/supplyCollateral.d.ts +40 -5
- package/lib/esm/actions/midnight/supplyCollateral.js +57 -53
- package/lib/esm/actions/midnight/supplyCollateralBatch.d.ts +3 -3
- package/lib/esm/actions/midnight/supplyCollateralBatch.js +3 -62
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.d.ts +24 -0
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.js +33 -61
- package/lib/esm/actions/midnight/supplyCollateralWithNative.d.ts +77 -0
- package/lib/esm/actions/midnight/supplyCollateralWithNative.js +137 -0
- package/lib/esm/actions/midnight/takeBorrow.d.ts +17 -2
- package/lib/esm/actions/midnight/takeBorrow.js +20 -51
- package/lib/esm/actions/midnight/takeLend.d.ts +21 -1
- package/lib/esm/actions/midnight/takeLend.js +26 -54
- package/lib/esm/actions/midnight/takeRepayWithdrawCollateral.d.ts +22 -2
- package/lib/esm/actions/midnight/takeRepayWithdrawCollateral.js +30 -58
- package/lib/esm/actions/midnight/takeWithdraw.d.ts +17 -2
- package/lib/esm/actions/midnight/takeWithdraw.js +76 -114
- package/lib/esm/actions/midnight/withdrawCollateral.d.ts +16 -3
- package/lib/esm/actions/midnight/withdrawCollateral.js +23 -55
- package/lib/esm/actions/midnight/withdrawCollateralBatch.d.ts +3 -3
- package/lib/esm/actions/midnight/withdrawCollateralBatch.js +3 -71
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.d.ts +13 -0
- package/lib/esm/actions/requirements/blue/getBlueAuthorizationRequirement.js +36 -18
- package/lib/esm/actions/requirements/blue/index.d.ts +1 -1
- package/lib/esm/actions/requirements/blue/index.js +1 -1
- package/lib/esm/actions/requirements/chainCheck.d.ts +5 -0
- package/lib/esm/actions/requirements/chainCheck.js +6 -0
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.d.ts +10 -0
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +36 -25
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +11 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +33 -16
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +14 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +41 -8
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts +10 -0
- package/lib/esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.js +59 -24
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.d.ts +10 -0
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.js +21 -2
- package/lib/esm/actions/requirements/encode/index.d.ts +5 -5
- package/lib/esm/actions/requirements/encode/index.js +5 -5
- package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +26 -11
- package/lib/esm/actions/requirements/getRequirementsApproval.js +38 -12
- package/lib/esm/actions/requirements/index.d.ts +1 -1
- package/lib/esm/actions/requirements/index.js +1 -1
- package/lib/esm/actions/requirements/midnight/getMidnightApprovalRequirements.d.ts +11 -0
- package/lib/esm/actions/requirements/midnight/getMidnightApprovalRequirements.js +31 -18
- package/lib/esm/actions/requirements/midnight/getMidnightAuthorizationRequirement.d.ts +11 -0
- package/lib/esm/actions/requirements/midnight/getMidnightAuthorizationRequirement.js +22 -10
- package/lib/esm/actions/requirements/midnight/index.d.ts +2 -2
- package/lib/esm/actions/requirements/midnight/index.js +2 -2
- package/lib/esm/actions/vaultV1/deposit.d.ts +21 -0
- package/lib/esm/actions/vaultV1/deposit.js +43 -9
- package/lib/esm/actions/vaultV1/inKindRedeem.d.ts +18 -1
- package/lib/esm/actions/vaultV1/inKindRedeem.js +33 -15
- package/lib/esm/actions/vaultV1/index.d.ts +5 -5
- package/lib/esm/actions/vaultV1/index.js +5 -5
- package/lib/esm/actions/vaultV1/migrateToV2.d.ts +21 -0
- package/lib/esm/actions/vaultV1/migrateToV2.js +47 -11
- package/lib/esm/actions/vaultV1/redeem.d.ts +19 -0
- package/lib/esm/actions/vaultV1/redeem.js +26 -7
- package/lib/esm/actions/vaultV1/withdraw.d.ts +19 -0
- package/lib/esm/actions/vaultV1/withdraw.js +26 -7
- package/lib/esm/actions/vaultV2/deposit.d.ts +21 -0
- package/lib/esm/actions/vaultV2/deposit.js +43 -9
- package/lib/esm/actions/vaultV2/forceRedeem.d.ts +20 -2
- package/lib/esm/actions/vaultV2/forceRedeem.js +35 -6
- package/lib/esm/actions/vaultV2/forceWithdraw.d.ts +23 -1
- package/lib/esm/actions/vaultV2/forceWithdraw.js +33 -13
- package/lib/esm/actions/vaultV2/inKindRedeem.d.ts +18 -1
- package/lib/esm/actions/vaultV2/inKindRedeem.js +32 -14
- package/lib/esm/actions/vaultV2/index.d.ts +6 -6
- package/lib/esm/actions/vaultV2/index.js +6 -6
- package/lib/esm/actions/vaultV2/redeem.d.ts +19 -0
- package/lib/esm/actions/vaultV2/redeem.js +26 -7
- package/lib/esm/actions/vaultV2/withdraw.d.ts +19 -0
- package/lib/esm/actions/vaultV2/withdraw.js +26 -7
- package/lib/esm/entities/blue/blue.d.ts +35 -8
- package/lib/esm/entities/blue/blue.js +449 -388
- package/lib/esm/entities/midnight/midnight.d.ts +117 -41
- package/lib/esm/entities/midnight/midnight.js +455 -826
- package/lib/esm/entities/midnight/parse.d.ts +74 -0
- package/lib/esm/entities/midnight/parse.js +320 -0
- package/lib/esm/entities/midnight/prepare.d.ts +47 -0
- package/lib/esm/entities/midnight/prepare.js +282 -0
- package/lib/esm/entities/midnight/publication.d.ts +7 -3
- package/lib/esm/entities/midnight/publication.js +7 -3
- package/lib/esm/entities/midnight/types.d.ts +7 -0
- package/lib/esm/entities/requirements/assertContractCode.d.ts +10 -5
- package/lib/esm/entities/requirements/assertContractCode.js +24 -15
- package/lib/esm/entities/requirements/getBundlesTokenRequirements.d.ts +15 -0
- package/lib/esm/entities/requirements/getBundlesTokenRequirements.js +53 -47
- package/lib/esm/entities/requirements/getErc2612Permit.d.ts +7 -3
- package/lib/esm/entities/requirements/getErc2612Permit.js +19 -4
- package/lib/esm/entities/requirements/getUnusedPermit2Nonce.d.ts +15 -0
- package/lib/esm/entities/requirements/getUnusedPermit2Nonce.js +20 -5
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.d.ts +14 -0
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.js +23 -5
- package/lib/esm/entities/requirements/getVaultV1InKindRedeemRequirements.js +4 -3
- package/lib/esm/entities/requirements/getVaultV2ForceWithdrawRequirements.js +4 -3
- package/lib/esm/entities/requirements/getVaultV2InKindRedeemRequirements.js +4 -3
- package/lib/esm/entities/requirements/index.d.ts +2 -2
- package/lib/esm/entities/requirements/index.js +2 -2
- package/lib/esm/entities/requirements/validateNativeRequirements.d.ts +21 -0
- package/lib/esm/entities/requirements/validateNativeRequirements.js +33 -0
- package/lib/esm/entities/vaultV1/inKindRedeemQuote.d.ts +2 -2
- package/lib/esm/entities/vaultV1/inKindRedeemQuote.js +1 -7
- package/lib/esm/entities/vaultV1/vaultV1.d.ts +17 -40
- package/lib/esm/entities/vaultV1/vaultV1.js +208 -139
- package/lib/esm/entities/vaultV2/forceWithdrawQuote.d.ts +4 -0
- package/lib/esm/entities/vaultV2/forceWithdrawQuote.js +10 -5
- package/lib/esm/entities/vaultV2/inKindRedeemQuote.d.ts +2 -2
- package/lib/esm/entities/vaultV2/inKindRedeemQuote.js +1 -7
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +21 -52
- package/lib/esm/entities/vaultV2/vaultV2.js +209 -133
- package/lib/esm/helpers/parse.d.ts +33 -0
- package/lib/esm/helpers/parse.js +61 -0
- package/lib/esm/helpers/parseMidnight.d.ts +48 -0
- package/lib/esm/helpers/parseMidnight.js +80 -0
- package/lib/esm/helpers/parseMidnightMaker.d.ts +44 -0
- package/lib/esm/helpers/parseMidnightMaker.js +147 -0
- package/lib/esm/helpers/validate.d.ts +3 -2
- package/lib/esm/helpers/validate.js +5 -1
- package/lib/esm/helpers/validateMidnightCancelAndMakePublication.d.ts +8 -0
- package/lib/esm/helpers/validateMidnightCancelAndMakePublication.js +2 -2
- package/lib/esm/helpers/validateMidnightPublication.d.ts +17 -1
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/transactionPlan/blue/refinance.js +18 -10
- package/lib/esm/transactionPlan/blue/repay.js +3 -2
- package/lib/esm/transactionPlan/blue/repayWithdrawCollateral.js +24 -5
- package/lib/esm/transactionPlan/blue/supplyCollateralBorrow.js +2 -2
- package/lib/esm/transactionPlan/blue/withdraw.d.ts +2 -2
- package/lib/esm/transactionPlan/blue/withdraw.js +3 -3
- package/lib/esm/transactionPlan/blue/withdrawCollateral.js +6 -2
- package/lib/esm/transactionPlan/validation.d.ts +1 -1
- package/lib/esm/transactionPlan/validation.js +3 -0
- package/lib/esm/transactionPlan/vaultv1/deposit.d.ts +2 -2
- package/lib/esm/transactionPlan/vaultv1/deposit.js +2 -2
- package/lib/esm/types/action.d.ts +13 -2
- package/lib/esm/types/error.d.ts +20 -2
- package/lib/esm/types/error.js +27 -0
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.js +1 -1
- package/package.json +3 -3
|
@@ -6,30 +6,24 @@ const blue_sdk_viem_1 = require("@morpho-org/blue-sdk-viem");
|
|
|
6
6
|
const morpho_ts_1 = require("@morpho-org/morpho-ts");
|
|
7
7
|
const viem_1 = require("viem");
|
|
8
8
|
const common_js_1 = require("../../actions/bundles/common.js");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
9
|
+
const chainCheck_js_1 = require("../../actions/requirements/chainCheck.js");
|
|
10
|
+
const deposit_js_1 = require("../../actions/vaultV1/deposit.js");
|
|
11
|
+
const inKindRedeem_js_1 = require("../../actions/vaultV1/inKindRedeem.js");
|
|
12
|
+
const migrateToV2_js_1 = require("../../actions/vaultV1/migrateToV2.js");
|
|
13
|
+
const redeem_js_1 = require("../../actions/vaultV1/redeem.js");
|
|
14
|
+
const withdraw_js_1 = require("../../actions/vaultV1/withdraw.js");
|
|
15
|
+
const index_js_1 = require("../../helpers/index.js");
|
|
12
16
|
const metadata_js_1 = require("../../helpers/metadata.js");
|
|
17
|
+
const parse_js_1 = require("../../helpers/parse.js");
|
|
13
18
|
const validate_js_1 = require("../../helpers/validate.js");
|
|
14
|
-
const
|
|
19
|
+
const index_js_2 = require("../../types/index.js");
|
|
15
20
|
const assertContractCode_js_1 = require("../requirements/assertContractCode.js");
|
|
21
|
+
const getBundlesTokenRequirements_js_1 = require("../requirements/getBundlesTokenRequirements.js");
|
|
16
22
|
const getVaultBundlesSharesRequirements_js_1 = require("../requirements/getVaultBundlesSharesRequirements.js");
|
|
17
23
|
const getVaultV1InKindRedeemRequirements_js_1 = require("../requirements/getVaultV1InKindRedeemRequirements.js");
|
|
18
|
-
const
|
|
24
|
+
const validateNativeRequirements_js_1 = require("../requirements/validateNativeRequirements.js");
|
|
19
25
|
const inKindRedeemQuote_js_1 = require("./inKindRedeemQuote.js");
|
|
20
26
|
const migrateToV2Quote_js_1 = require("./migrateToV2Quote.js");
|
|
21
|
-
function getMigrationAmounts(params) {
|
|
22
|
-
const assets = "assets" in params ? params.assets : undefined;
|
|
23
|
-
const shares = "shares" in params ? params.shares : undefined;
|
|
24
|
-
if ((assets == null) === (shares == null)) {
|
|
25
|
-
throw new index_js_3.AmountAndSharesExclusiveError();
|
|
26
|
-
}
|
|
27
|
-
const selectedAmount = assets ?? shares ?? 0n;
|
|
28
|
-
if (selectedAmount <= 0n) {
|
|
29
|
-
throw new index_js_3.NonPositiveInputError(assets == null ? "shares" : "assets", selectedAmount);
|
|
30
|
-
}
|
|
31
|
-
return { assets, shares };
|
|
32
|
-
}
|
|
33
27
|
/** Binds a viem client to a Vault V1 (MetaMorpho) vault's action builders. */
|
|
34
28
|
class MorphoVaultV1 {
|
|
35
29
|
client;
|
|
@@ -42,7 +36,10 @@ class MorphoVaultV1 {
|
|
|
42
36
|
this.chainId = chainId;
|
|
43
37
|
}
|
|
44
38
|
async getData(parameters) {
|
|
45
|
-
|
|
39
|
+
return this.getDataWithChainCheck((0, chainCheck_js_1.createChainCheck)(this.client.viemClient, this.chainId), parameters);
|
|
40
|
+
}
|
|
41
|
+
async getDataWithChainCheck(chainCheck, parameters) {
|
|
42
|
+
await chainCheck();
|
|
46
43
|
return (0, blue_sdk_viem_1.fetchAccrualVault)(this.vault, this.client.viemClient, {
|
|
47
44
|
...parameters,
|
|
48
45
|
deployless: this.client.options.supportDeployless,
|
|
@@ -56,28 +53,32 @@ class MorphoVaultV1 {
|
|
|
56
53
|
*
|
|
57
54
|
* @param roles - Registry labels to resolve and check.
|
|
58
55
|
*/
|
|
59
|
-
async assertWriteTargets(roles) {
|
|
56
|
+
async assertWriteTargets(roles, chainCheck) {
|
|
60
57
|
const targets = [];
|
|
61
58
|
for (const role of roles) {
|
|
62
59
|
const address = (0, morpho_ts_1.getChainAddress)(this.chainId, role);
|
|
63
60
|
targets.push({ role, address });
|
|
64
61
|
}
|
|
65
|
-
await (0, assertContractCode_js_1.assertRegistryTargetsHaveCode)(this.client.viemClient, this.chainId, targets);
|
|
62
|
+
await (0, assertContractCode_js_1.assertRegistryTargetsHaveCode)(this.client.viemClient, this.chainId, targets, chainCheck);
|
|
66
63
|
}
|
|
67
64
|
/** {@inheritDoc VaultV1Actions.deposit} */
|
|
68
65
|
deposit(params) {
|
|
66
|
+
return this.buildDeposit(this.parseDeposit(params));
|
|
67
|
+
}
|
|
68
|
+
/** Owns the complete raw deposit boundary, including snapshot-derived price protection. */
|
|
69
|
+
parseDeposit(params) {
|
|
69
70
|
const suppliedNow = params.now;
|
|
70
71
|
const metadata = (0, metadata_js_1.resolveTransactionMetadata)(this.client.options.metadata, suppliedNow);
|
|
71
72
|
const { userAddress, vaultData } = params;
|
|
72
73
|
const { asset: vaultAsset } = vaultData;
|
|
73
|
-
(0,
|
|
74
|
+
(0, index_js_1.validateChainId)(this.client.viemClient.chain?.id, this.chainId);
|
|
74
75
|
if (!(0, viem_1.isAddressEqual)(vaultData.address, this.vault)) {
|
|
75
|
-
throw new
|
|
76
|
+
throw new index_js_2.VaultAddressMismatchError(this.vault, vaultData.address);
|
|
76
77
|
}
|
|
77
78
|
const createdAt = suppliedNow ?? morpho_ts_1.Time.timestamp();
|
|
78
79
|
const deadline = params.deadline ?? createdAt + morpho_ts_1.Time.s.from.h(2n);
|
|
79
80
|
if (deadline <= createdAt) {
|
|
80
|
-
throw new
|
|
81
|
+
throw new index_js_2.ExpiredDeadlineError(deadline, createdAt);
|
|
81
82
|
}
|
|
82
83
|
const common = (0, common_js_1.normalizeBundlesCommonParams)({
|
|
83
84
|
deadline,
|
|
@@ -85,49 +86,82 @@ class MorphoVaultV1 {
|
|
|
85
86
|
referralFeeRecipient: params.referralFeeRecipient,
|
|
86
87
|
});
|
|
87
88
|
const funding = (0, common_js_1.resolveBundlesFunding)(params);
|
|
88
|
-
//
|
|
89
|
-
(0,
|
|
89
|
+
// Enforce ABI and native-asset bounds at the constructor, before lazy requirements.
|
|
90
|
+
(0, parse_js_1.parseUint256)(funding.value > 0n ? "nativeAmount" : "amount", funding.assets);
|
|
90
91
|
if (funding.value > 0n) {
|
|
91
|
-
// The native path must target the chain's registered wrapped-native asset.
|
|
92
92
|
(0, validate_js_1.validateNativeVaultAsset)(this.chainId, vaultAsset);
|
|
93
93
|
}
|
|
94
94
|
const referralFeeAssets = (0, common_js_1.getBundlesReferralFeeAssets)(funding.assets, common.referralFeePct);
|
|
95
|
-
const maxSharePrice = (0,
|
|
95
|
+
const maxSharePrice = (0, index_js_1.computeVaultMaxSharePrice)({
|
|
96
96
|
vaultData,
|
|
97
97
|
deadline,
|
|
98
98
|
assets: funding.assets - referralFeeAssets,
|
|
99
99
|
slippageTolerance: params.slippageTolerance ?? blue_sdk_1.DEFAULT_SLIPPAGE_TOLERANCE,
|
|
100
100
|
});
|
|
101
101
|
const spender = (0, morpho_ts_1.getChainAddress)(this.chainId, "bundles.vaultBundlesV1");
|
|
102
|
+
if (maxSharePrice <= 0n) {
|
|
103
|
+
throw new index_js_2.NonPositiveInputError("maxSharePrice", maxSharePrice);
|
|
104
|
+
}
|
|
105
|
+
// A computed price must still fit the contract's ABI.
|
|
106
|
+
(0, parse_js_1.parseUint256)("maxSharePrice", maxSharePrice);
|
|
107
|
+
const parsed = {
|
|
108
|
+
vault: { chainId: this.chainId, address: this.vault, asset: vaultAsset },
|
|
109
|
+
userAddress,
|
|
110
|
+
funding,
|
|
111
|
+
maxSharePrice,
|
|
112
|
+
common,
|
|
113
|
+
metadata,
|
|
114
|
+
};
|
|
115
|
+
return {
|
|
116
|
+
suppliedNow,
|
|
117
|
+
parsed,
|
|
118
|
+
spender,
|
|
119
|
+
vaultAsset,
|
|
120
|
+
userAddress,
|
|
121
|
+
funding,
|
|
122
|
+
deadline,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
buildDeposit(input) {
|
|
126
|
+
const { parsed, spender, vaultAsset, userAddress, funding, deadline } = input;
|
|
102
127
|
let pendingRequirements;
|
|
103
128
|
return Object.freeze({
|
|
104
129
|
getRequirements: async (requirementOptions) => {
|
|
105
|
-
const now = suppliedNow ?? morpho_ts_1.Time.timestamp();
|
|
130
|
+
const now = input.suppliedNow ?? morpho_ts_1.Time.timestamp();
|
|
106
131
|
if (deadline <= now) {
|
|
107
|
-
throw new
|
|
132
|
+
throw new index_js_2.ExpiredDeadlineError(deadline, now);
|
|
133
|
+
}
|
|
134
|
+
const chainCheck = (0, chainCheck_js_1.createChainCheck)(this.client.viemClient, this.chainId);
|
|
135
|
+
if (funding.value > 0n) {
|
|
136
|
+
// Native funding skips the token resolver's chain validation.
|
|
137
|
+
await (0, validateNativeRequirements_js_1.validateNativeRequirements)(this.client.viemClient, {
|
|
138
|
+
chainId: this.chainId,
|
|
139
|
+
chainCheck,
|
|
140
|
+
assertWriteTargets: () => this.assertWriteTargets(["bundles.vaultBundlesV1"], chainCheck),
|
|
141
|
+
});
|
|
142
|
+
return [];
|
|
143
|
+
}
|
|
144
|
+
await this.assertWriteTargets(["bundles.vaultBundlesV1"], chainCheck);
|
|
145
|
+
const tokenInput = (0, getBundlesTokenRequirements_js_1.parseGetBundlesTokenRequirements)(this.client.viemClient, {
|
|
146
|
+
token: vaultAsset,
|
|
147
|
+
spender,
|
|
148
|
+
amount: funding.assets,
|
|
149
|
+
owner: userAddress,
|
|
150
|
+
chainId: this.chainId,
|
|
151
|
+
deadline,
|
|
152
|
+
supportSignature: this.client.options.supportSignature,
|
|
153
|
+
supportDeployless: this.client.options.supportDeployless,
|
|
154
|
+
useSimplePermit: requirementOptions?.useSimplePermit,
|
|
155
|
+
now,
|
|
156
|
+
});
|
|
157
|
+
// Check each non-no-op invocation before sharing an in-flight state read.
|
|
158
|
+
if (tokenInput.amount > 0n) {
|
|
159
|
+
await chainCheck();
|
|
108
160
|
}
|
|
109
161
|
if (pendingRequirements != null) {
|
|
110
162
|
return await pendingRequirements;
|
|
111
163
|
}
|
|
112
|
-
|
|
113
|
-
// allowance/nonce reads.
|
|
114
|
-
const pending = (async () => {
|
|
115
|
-
await this.assertWriteTargets(["bundles.vaultBundlesV1"]);
|
|
116
|
-
return funding.value > 0n
|
|
117
|
-
? []
|
|
118
|
-
: (0, index_js_4.getBundlesTokenRequirements)(this.client.viemClient, {
|
|
119
|
-
token: vaultAsset,
|
|
120
|
-
spender,
|
|
121
|
-
amount: funding.assets,
|
|
122
|
-
owner: userAddress,
|
|
123
|
-
chainId: this.chainId,
|
|
124
|
-
deadline,
|
|
125
|
-
supportSignature: this.client.options.supportSignature,
|
|
126
|
-
supportDeployless: this.client.options.supportDeployless,
|
|
127
|
-
useSimplePermit: requirementOptions?.useSimplePermit,
|
|
128
|
-
now,
|
|
129
|
-
});
|
|
130
|
-
})();
|
|
164
|
+
const pending = (0, getBundlesTokenRequirements_js_1.getParsedBundlesTokenRequirements)({ viemClient: this.client.viemClient, chainCheck }, tokenInput);
|
|
131
165
|
pendingRequirements = pending;
|
|
132
166
|
try {
|
|
133
167
|
return await pending;
|
|
@@ -142,45 +176,30 @@ class MorphoVaultV1 {
|
|
|
142
176
|
buildTx: (signatures) => {
|
|
143
177
|
// The pure deposit action rejects a token signature supplied alongside native funding.
|
|
144
178
|
const requirementSignature = (0, common_js_1.selectBundlesTokenRequirementSignature)(signatures, { spender, amount: funding.assets, deadline });
|
|
145
|
-
return (0,
|
|
146
|
-
vault: {
|
|
147
|
-
chainId: this.chainId,
|
|
148
|
-
address: this.vault,
|
|
149
|
-
asset: vaultAsset,
|
|
150
|
-
},
|
|
151
|
-
args: {
|
|
152
|
-
...(funding.value > 0n
|
|
153
|
-
? { nativeAmount: funding.assets }
|
|
154
|
-
: { amount: funding.assets }),
|
|
155
|
-
maxSharePrice,
|
|
156
|
-
userAddress,
|
|
157
|
-
requirementSignature,
|
|
158
|
-
referralFeePct: common.referralFeePct,
|
|
159
|
-
referralFeeRecipient: common.referralFeeRecipient,
|
|
160
|
-
deadline,
|
|
161
|
-
},
|
|
162
|
-
metadata,
|
|
163
|
-
});
|
|
179
|
+
return (0, deposit_js_1.buildVaultV1Deposit)(parsed, { requirementSignature });
|
|
164
180
|
},
|
|
165
181
|
});
|
|
166
182
|
}
|
|
167
183
|
withdraw(params) {
|
|
184
|
+
return this.buildWithdraw(this.parseWithdraw(params));
|
|
185
|
+
}
|
|
186
|
+
parseWithdraw(params) {
|
|
168
187
|
const suppliedNow = params.now;
|
|
169
188
|
const metadata = (0, metadata_js_1.resolveTransactionMetadata)(this.client.options.metadata, suppliedNow);
|
|
170
189
|
const { amount, userAddress, vaultData } = params;
|
|
171
|
-
(0,
|
|
190
|
+
(0, index_js_1.validateChainId)(this.client.viemClient.chain?.id, this.chainId);
|
|
172
191
|
if (!(0, viem_1.isAddressEqual)(vaultData.address, this.vault)) {
|
|
173
|
-
throw new
|
|
192
|
+
throw new index_js_2.VaultAddressMismatchError(this.vault, vaultData.address);
|
|
174
193
|
}
|
|
175
194
|
if (amount <= 0n) {
|
|
176
|
-
throw new
|
|
195
|
+
throw new index_js_2.NonPositiveInputError("amount", amount);
|
|
177
196
|
}
|
|
178
197
|
// Reject values outside the ABI range before resolving any requirements.
|
|
179
|
-
(0,
|
|
198
|
+
const parsedAmount = (0, parse_js_1.parseUint256)("amount", amount);
|
|
180
199
|
const createdAt = suppliedNow ?? morpho_ts_1.Time.timestamp();
|
|
181
200
|
const deadline = params.deadline ?? createdAt + morpho_ts_1.Time.s.from.h(2n);
|
|
182
201
|
if (deadline <= createdAt) {
|
|
183
|
-
throw new
|
|
202
|
+
throw new index_js_2.ExpiredDeadlineError(deadline, createdAt);
|
|
184
203
|
}
|
|
185
204
|
const common = (0, common_js_1.normalizeBundlesCommonParams)({
|
|
186
205
|
deadline,
|
|
@@ -188,24 +207,43 @@ class MorphoVaultV1 {
|
|
|
188
207
|
referralFeeRecipient: params.referralFeeRecipient,
|
|
189
208
|
});
|
|
190
209
|
const slippageTolerance = params.slippageTolerance ?? blue_sdk_1.DEFAULT_SLIPPAGE_TOLERANCE;
|
|
191
|
-
(0,
|
|
210
|
+
(0, index_js_1.validateSlippageTolerance)(slippageTolerance);
|
|
192
211
|
// Resolve the spender eagerly so an unregistered VaultBundlesV1 fails at handle creation.
|
|
193
212
|
const spender = (0, morpho_ts_1.getChainAddress)(this.chainId, "bundles.vaultBundlesV1");
|
|
194
|
-
const requiredShareAllowance = (0,
|
|
213
|
+
const requiredShareAllowance = (0, index_js_1.computeVaultMaxShareAllowance)({
|
|
195
214
|
vaultData,
|
|
196
215
|
deadline,
|
|
197
216
|
assets: amount,
|
|
198
217
|
slippageTolerance,
|
|
199
218
|
});
|
|
219
|
+
const parsed = {
|
|
220
|
+
vault: { chainId: this.chainId, address: this.vault },
|
|
221
|
+
args: { amount: parsedAmount, userAddress, ...common },
|
|
222
|
+
common,
|
|
223
|
+
metadata,
|
|
224
|
+
};
|
|
225
|
+
return {
|
|
226
|
+
suppliedNow,
|
|
227
|
+
parsed,
|
|
228
|
+
spender,
|
|
229
|
+
vaultData,
|
|
230
|
+
userAddress,
|
|
231
|
+
requiredShareAllowance,
|
|
232
|
+
deadline,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
buildWithdraw(input) {
|
|
236
|
+
const { parsed, spender, vaultData, userAddress, requiredShareAllowance, deadline, } = input;
|
|
200
237
|
return Object.freeze({
|
|
201
238
|
getRequirements: async () => {
|
|
202
|
-
const now = suppliedNow ?? morpho_ts_1.Time.timestamp();
|
|
239
|
+
const now = input.suppliedNow ?? morpho_ts_1.Time.timestamp();
|
|
203
240
|
if (deadline <= now) {
|
|
204
|
-
throw new
|
|
241
|
+
throw new index_js_2.ExpiredDeadlineError(deadline, now);
|
|
205
242
|
}
|
|
206
|
-
|
|
243
|
+
const chainCheck = (0, chainCheck_js_1.createChainCheck)(this.client.viemClient, this.chainId);
|
|
244
|
+
await this.assertWriteTargets(["bundles.vaultBundlesV1"], chainCheck);
|
|
207
245
|
// Re-read the live share allowance on every call instead of caching the resolved requirements.
|
|
208
|
-
return (0, getVaultBundlesSharesRequirements_js_1.
|
|
246
|
+
return (0, getVaultBundlesSharesRequirements_js_1.getParsedVaultBundlesSharesRequirements)({ viemClient: this.client.viemClient, chainCheck }, (0, getVaultBundlesSharesRequirements_js_1.parseVaultBundlesSharesRequirements)(this.client.viemClient, {
|
|
209
247
|
vaultData,
|
|
210
248
|
version: "vaultV1",
|
|
211
249
|
owner: userAddress,
|
|
@@ -214,7 +252,7 @@ class MorphoVaultV1 {
|
|
|
214
252
|
deadline,
|
|
215
253
|
supportSignature: this.client.options.supportSignature,
|
|
216
254
|
now,
|
|
217
|
-
});
|
|
255
|
+
}));
|
|
218
256
|
},
|
|
219
257
|
buildTx: (signatures) => {
|
|
220
258
|
const permit = (0, common_js_1.selectBundlesSharesPermitSignature)(signatures, {
|
|
@@ -222,34 +260,26 @@ class MorphoVaultV1 {
|
|
|
222
260
|
amount: requiredShareAllowance,
|
|
223
261
|
deadline,
|
|
224
262
|
});
|
|
225
|
-
return (0,
|
|
226
|
-
vault: { chainId: this.chainId, address: this.vault },
|
|
227
|
-
args: {
|
|
228
|
-
amount,
|
|
229
|
-
userAddress,
|
|
230
|
-
requirementSignature: permit,
|
|
231
|
-
referralFeePct: common.referralFeePct,
|
|
232
|
-
referralFeeRecipient: common.referralFeeRecipient,
|
|
233
|
-
deadline,
|
|
234
|
-
},
|
|
235
|
-
metadata,
|
|
236
|
-
});
|
|
263
|
+
return (0, withdraw_js_1.buildVaultV1Withdraw)(parsed, { requirementSignature: permit });
|
|
237
264
|
},
|
|
238
265
|
});
|
|
239
266
|
}
|
|
240
267
|
/** {@inheritDoc VaultV1Actions.redeem} */
|
|
241
268
|
redeem(params) {
|
|
269
|
+
return this.buildRedeem(this.parseRedeem(params));
|
|
270
|
+
}
|
|
271
|
+
parseRedeem(params) {
|
|
242
272
|
const suppliedNow = params.now;
|
|
243
273
|
const metadata = (0, metadata_js_1.resolveTransactionMetadata)(this.client.options.metadata, suppliedNow);
|
|
244
|
-
(0,
|
|
274
|
+
(0, index_js_1.validateChainId)(this.client.viemClient.chain?.id, this.chainId);
|
|
245
275
|
const { shares, userAddress } = params;
|
|
246
276
|
if (shares <= 0n) {
|
|
247
|
-
throw new
|
|
277
|
+
throw new index_js_2.NonPositiveInputError("shares", shares);
|
|
248
278
|
}
|
|
249
279
|
const createdAt = suppliedNow ?? morpho_ts_1.Time.timestamp();
|
|
250
280
|
const deadline = params.deadline ?? createdAt + morpho_ts_1.Time.s.from.h(2n);
|
|
251
281
|
if (deadline <= createdAt) {
|
|
252
|
-
throw new
|
|
282
|
+
throw new index_js_2.ExpiredDeadlineError(deadline, createdAt);
|
|
253
283
|
}
|
|
254
284
|
const common = (0, common_js_1.normalizeBundlesCommonParams)({
|
|
255
285
|
deadline,
|
|
@@ -257,15 +287,26 @@ class MorphoVaultV1 {
|
|
|
257
287
|
referralFeeRecipient: params.referralFeeRecipient,
|
|
258
288
|
});
|
|
259
289
|
const spender = (0, morpho_ts_1.getChainAddress)(this.chainId, "bundles.vaultBundlesV1");
|
|
290
|
+
const parsed = {
|
|
291
|
+
vault: { chainId: this.chainId, address: this.vault },
|
|
292
|
+
args: { shares: (0, parse_js_1.parseUint256)("shares", shares), userAddress, ...common },
|
|
293
|
+
common,
|
|
294
|
+
metadata,
|
|
295
|
+
};
|
|
296
|
+
return { suppliedNow, parsed, spender, shares, userAddress, deadline };
|
|
297
|
+
}
|
|
298
|
+
buildRedeem(input) {
|
|
299
|
+
const { parsed, spender, shares, userAddress, deadline } = input;
|
|
260
300
|
return Object.freeze({
|
|
261
301
|
getRequirements: async () => {
|
|
262
|
-
const now = suppliedNow ?? morpho_ts_1.Time.timestamp();
|
|
302
|
+
const now = input.suppliedNow ?? morpho_ts_1.Time.timestamp();
|
|
263
303
|
if (deadline <= now) {
|
|
264
|
-
throw new
|
|
304
|
+
throw new index_js_2.ExpiredDeadlineError(deadline, now);
|
|
265
305
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
306
|
+
const chainCheck = (0, chainCheck_js_1.createChainCheck)(this.client.viemClient, this.chainId);
|
|
307
|
+
await this.assertWriteTargets(["bundles.vaultBundlesV1"], chainCheck);
|
|
308
|
+
return (0, getVaultBundlesSharesRequirements_js_1.getParsedVaultBundlesSharesRequirements)({ viemClient: this.client.viemClient, chainCheck }, (0, getVaultBundlesSharesRequirements_js_1.parseVaultBundlesSharesRequirements)(this.client.viemClient, {
|
|
309
|
+
vaultData: await this.getDataWithChainCheck(chainCheck),
|
|
269
310
|
version: "vaultV1",
|
|
270
311
|
owner: userAddress,
|
|
271
312
|
chainId: this.chainId,
|
|
@@ -273,7 +314,7 @@ class MorphoVaultV1 {
|
|
|
273
314
|
deadline,
|
|
274
315
|
supportSignature: this.client.options.supportSignature,
|
|
275
316
|
now,
|
|
276
|
-
});
|
|
317
|
+
}));
|
|
277
318
|
},
|
|
278
319
|
buildTx: (signatures) => {
|
|
279
320
|
const permit = (0, common_js_1.selectBundlesSharesPermitSignature)(signatures, {
|
|
@@ -281,29 +322,19 @@ class MorphoVaultV1 {
|
|
|
281
322
|
amount: shares,
|
|
282
323
|
deadline,
|
|
283
324
|
});
|
|
284
|
-
return (0,
|
|
285
|
-
vault: { chainId: this.chainId, address: this.vault },
|
|
286
|
-
args: {
|
|
287
|
-
shares,
|
|
288
|
-
userAddress,
|
|
289
|
-
requirementSignature: permit,
|
|
290
|
-
referralFeePct: common.referralFeePct,
|
|
291
|
-
referralFeeRecipient: common.referralFeeRecipient,
|
|
292
|
-
deadline,
|
|
293
|
-
},
|
|
294
|
-
metadata,
|
|
295
|
-
});
|
|
325
|
+
return (0, redeem_js_1.buildVaultV1Redeem)(parsed, { requirementSignature: permit });
|
|
296
326
|
},
|
|
297
327
|
});
|
|
298
328
|
}
|
|
299
329
|
/** {@inheritDoc VaultV1Actions.inKindRedeem} */
|
|
300
330
|
inKindRedeem(params) {
|
|
301
|
-
|
|
331
|
+
return this.buildInKindRedeem(this.parseInKindRedeem(params));
|
|
332
|
+
}
|
|
333
|
+
parseInKindRedeem({ now: suppliedNow, amount, marketParamsList, vaultData, userAddress, deadline: deadlineOverride, }) {
|
|
302
334
|
const metadata = (0, metadata_js_1.resolveTransactionMetadata)(this.client.options.metadata, suppliedNow);
|
|
303
|
-
|
|
304
|
-
(0, index_js_2.validateChainId)(this.client.viemClient.chain?.id, this.chainId);
|
|
335
|
+
(0, index_js_1.validateChainId)(this.client.viemClient.chain?.id, this.chainId);
|
|
305
336
|
if (!(0, viem_1.isAddressEqual)(vaultData.address, this.vault)) {
|
|
306
|
-
throw new
|
|
337
|
+
throw new index_js_2.VaultAddressMismatchError(this.vault, vaultData.address);
|
|
307
338
|
}
|
|
308
339
|
const { deadline, marketParamsListSnapshot, requiredShareAllowance, vaultExitBundlesV1, } = (0, inKindRedeemQuote_js_1.computeVaultV1InKindRedeemQuote)({
|
|
309
340
|
amount,
|
|
@@ -313,6 +344,29 @@ class MorphoVaultV1 {
|
|
|
313
344
|
now: suppliedNow ?? morpho_ts_1.Time.timestamp(),
|
|
314
345
|
chainId: this.chainId,
|
|
315
346
|
});
|
|
347
|
+
const parsed = {
|
|
348
|
+
vault: { chainId: this.chainId, address: this.vault },
|
|
349
|
+
args: {
|
|
350
|
+
amount,
|
|
351
|
+
marketParamsList: marketParamsListSnapshot,
|
|
352
|
+
userAddress,
|
|
353
|
+
deadline,
|
|
354
|
+
},
|
|
355
|
+
metadata,
|
|
356
|
+
};
|
|
357
|
+
return {
|
|
358
|
+
suppliedNow,
|
|
359
|
+
parsed,
|
|
360
|
+
deadline,
|
|
361
|
+
userAddress,
|
|
362
|
+
vaultData,
|
|
363
|
+
vaultExitBundlesV1,
|
|
364
|
+
amount,
|
|
365
|
+
requiredShareAllowance,
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
buildInKindRedeem(input) {
|
|
369
|
+
const { parsed, deadline, userAddress, vaultData, vaultExitBundlesV1, amount, requiredShareAllowance, } = input;
|
|
316
370
|
return {
|
|
317
371
|
getRequirements: () => (0, getVaultV1InKindRedeemRequirements_js_1.getVaultV1InKindRedeemRequirements)(this.client.viemClient, {
|
|
318
372
|
vaultData,
|
|
@@ -323,7 +377,7 @@ class MorphoVaultV1 {
|
|
|
323
377
|
requiredShareAllowance,
|
|
324
378
|
supportSignature: this.client.options.supportSignature,
|
|
325
379
|
amount,
|
|
326
|
-
now: suppliedNow,
|
|
380
|
+
now: input.suppliedNow,
|
|
327
381
|
}),
|
|
328
382
|
buildTx: (signatures) => {
|
|
329
383
|
const permit = (0, common_js_1.selectBundlesSharesPermitSignature)(signatures, {
|
|
@@ -331,54 +385,59 @@ class MorphoVaultV1 {
|
|
|
331
385
|
amount: requiredShareAllowance,
|
|
332
386
|
deadline,
|
|
333
387
|
});
|
|
334
|
-
return (0,
|
|
335
|
-
|
|
336
|
-
args: {
|
|
337
|
-
amount,
|
|
338
|
-
marketParamsList: marketParamsListSnapshot,
|
|
339
|
-
userAddress,
|
|
340
|
-
deadline,
|
|
341
|
-
requirementSignature: permit,
|
|
342
|
-
},
|
|
343
|
-
metadata,
|
|
388
|
+
return (0, inKindRedeem_js_1.buildVaultV1InKindRedeem)(parsed, {
|
|
389
|
+
requirementSignature: permit,
|
|
344
390
|
});
|
|
345
391
|
},
|
|
346
392
|
};
|
|
347
393
|
}
|
|
348
394
|
/** {@inheritDoc VaultV1Actions.migrateToV2} */
|
|
349
395
|
migrateToV2(params) {
|
|
396
|
+
return this.buildMigrateToV2(this.parseMigrateToV2(params));
|
|
397
|
+
}
|
|
398
|
+
parseMigrateToV2(params) {
|
|
350
399
|
const suppliedNow = params.now;
|
|
351
400
|
const metadata = (0, metadata_js_1.resolveTransactionMetadata)(this.client.options.metadata, suppliedNow);
|
|
352
|
-
(0,
|
|
401
|
+
(0, index_js_1.validateChainId)(this.client.viemClient.chain?.id, this.chainId);
|
|
353
402
|
if (!(0, viem_1.isAddressEqual)(params.sourceVault.address, this.vault)) {
|
|
354
|
-
throw new
|
|
403
|
+
throw new index_js_2.VaultAddressMismatchError(this.vault, params.sourceVault.address);
|
|
355
404
|
}
|
|
356
405
|
if (!(0, viem_1.isAddressEqual)(params.sourceVault.asset, params.targetVault.asset)) {
|
|
357
|
-
throw new
|
|
406
|
+
throw new index_js_2.VaultAssetMismatchError(params.sourceVault.asset, params.targetVault.asset);
|
|
358
407
|
}
|
|
359
408
|
if ((0, viem_1.isAddressEqual)(this.vault, params.targetVault.address)) {
|
|
360
|
-
throw new
|
|
409
|
+
throw new index_js_2.SameVaultMigrationError(this.vault);
|
|
410
|
+
}
|
|
411
|
+
const assets = "assets" in params ? params.assets : undefined;
|
|
412
|
+
const shares = "shares" in params ? params.shares : undefined;
|
|
413
|
+
if ((assets == null) === (shares == null)) {
|
|
414
|
+
throw new index_js_2.AmountAndSharesExclusiveError();
|
|
415
|
+
}
|
|
416
|
+
const selected = assets ?? shares ?? 0n;
|
|
417
|
+
if (selected <= 0n) {
|
|
418
|
+
throw new index_js_2.NonPositiveInputError(assets == null ? "shares" : "assets", selected);
|
|
361
419
|
}
|
|
362
|
-
const { assets, shares } = getMigrationAmounts(params);
|
|
363
420
|
const slippageTolerance = params.slippageTolerance ?? blue_sdk_1.DEFAULT_SLIPPAGE_TOLERANCE;
|
|
364
|
-
(0,
|
|
421
|
+
(0, index_js_1.validateSlippageTolerance)(slippageTolerance);
|
|
365
422
|
const createdAt = suppliedNow ?? morpho_ts_1.Time.timestamp();
|
|
366
423
|
const deadline = params.deadline ?? createdAt + morpho_ts_1.Time.s.from.h(2n);
|
|
367
424
|
if (deadline <= createdAt) {
|
|
368
|
-
throw new
|
|
425
|
+
throw new index_js_2.ExpiredDeadlineError(deadline, createdAt);
|
|
369
426
|
}
|
|
370
427
|
const common = (0, common_js_1.normalizeBundlesCommonParams)({
|
|
371
428
|
deadline,
|
|
372
429
|
referralFeePct: params.referralFeePct,
|
|
373
430
|
referralFeeRecipient: params.referralFeeRecipient,
|
|
374
431
|
});
|
|
432
|
+
// Only the destination receives a deposit; the source vault is an exit.
|
|
433
|
+
// V1 redeem accrues market interest and performance fees before converting shares.
|
|
375
434
|
const { maxSharePriceVaultV2, requiredShareAllowance } = (0, migrateToV2Quote_js_1.computeVaultV1MigrateToV2Quote)({
|
|
376
435
|
sourceVault: params.sourceVault,
|
|
377
436
|
targetVault: params.targetVault,
|
|
378
|
-
...(assets == null ? { shares:
|
|
437
|
+
...(assets == null ? { shares: selected } : { assets: selected }),
|
|
379
438
|
referralFeePct: common.referralFeePct,
|
|
380
|
-
deadline,
|
|
381
439
|
slippageTolerance,
|
|
440
|
+
deadline,
|
|
382
441
|
now: createdAt,
|
|
383
442
|
});
|
|
384
443
|
const spender = (0, morpho_ts_1.getChainAddress)(this.chainId, "bundles.vaultBundlesV1");
|
|
@@ -397,15 +456,41 @@ class MorphoVaultV1 {
|
|
|
397
456
|
extensions: [...domain.extensions],
|
|
398
457
|
}),
|
|
399
458
|
});
|
|
459
|
+
if (maxSharePriceVaultV2 <= 0n) {
|
|
460
|
+
throw new index_js_2.NonPositiveInputError("maxSharePriceVaultV2", maxSharePriceVaultV2);
|
|
461
|
+
}
|
|
462
|
+
// Preserve destination positivity before the source and destination ABI bounds.
|
|
463
|
+
(0, parse_js_1.parseUint256)(assets == null ? "shares" : "assets", selected);
|
|
464
|
+
(0, parse_js_1.parseUint256)("maxSharePriceVaultV2", maxSharePriceVaultV2);
|
|
465
|
+
const parsed = {
|
|
466
|
+
vault: { chainId: this.chainId, address: this.vault, asset: sourceAsset },
|
|
467
|
+
args: { targetVault: targetAddress, targetAsset, userAddress, ...common },
|
|
468
|
+
bounds: { assets, shares, maxSharePriceVaultV2 },
|
|
469
|
+
common,
|
|
470
|
+
metadata,
|
|
471
|
+
};
|
|
472
|
+
return {
|
|
473
|
+
suppliedNow,
|
|
474
|
+
parsed,
|
|
475
|
+
deadline,
|
|
476
|
+
sourceToken,
|
|
477
|
+
userAddress,
|
|
478
|
+
requiredShareAllowance,
|
|
479
|
+
spender,
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
buildMigrateToV2(input) {
|
|
483
|
+
const { parsed, deadline, sourceToken, userAddress, requiredShareAllowance, spender, } = input;
|
|
400
484
|
return Object.freeze({
|
|
401
485
|
getRequirements: async () => {
|
|
402
|
-
const now = suppliedNow ?? morpho_ts_1.Time.timestamp();
|
|
486
|
+
const now = input.suppliedNow ?? morpho_ts_1.Time.timestamp();
|
|
403
487
|
if (deadline <= now) {
|
|
404
|
-
throw new
|
|
488
|
+
throw new index_js_2.ExpiredDeadlineError(deadline, now);
|
|
405
489
|
}
|
|
406
|
-
|
|
490
|
+
const chainCheck = (0, chainCheck_js_1.createChainCheck)(this.client.viemClient, this.chainId);
|
|
491
|
+
await this.assertWriteTargets(["bundles.vaultBundlesV1"], chainCheck);
|
|
407
492
|
// Re-read the live share allowance on every call instead of caching the resolved requirements.
|
|
408
|
-
return (0, getVaultBundlesSharesRequirements_js_1.
|
|
493
|
+
return (0, getVaultBundlesSharesRequirements_js_1.getParsedVaultBundlesSharesRequirements)({ viemClient: this.client.viemClient, chainCheck }, (0, getVaultBundlesSharesRequirements_js_1.parseVaultBundlesSharesRequirements)(this.client.viemClient, {
|
|
409
494
|
vaultData: sourceToken,
|
|
410
495
|
version: "vaultV1",
|
|
411
496
|
owner: userAddress,
|
|
@@ -414,7 +499,7 @@ class MorphoVaultV1 {
|
|
|
414
499
|
deadline,
|
|
415
500
|
supportSignature: this.client.options.supportSignature,
|
|
416
501
|
now,
|
|
417
|
-
});
|
|
502
|
+
}));
|
|
418
503
|
},
|
|
419
504
|
buildTx: (signatures) => {
|
|
420
505
|
const permit = (0, common_js_1.selectBundlesSharesPermitSignature)(signatures, {
|
|
@@ -422,24 +507,8 @@ class MorphoVaultV1 {
|
|
|
422
507
|
amount: requiredShareAllowance,
|
|
423
508
|
deadline,
|
|
424
509
|
});
|
|
425
|
-
return (0,
|
|
426
|
-
|
|
427
|
-
chainId: this.chainId,
|
|
428
|
-
address: this.vault,
|
|
429
|
-
asset: sourceAsset,
|
|
430
|
-
},
|
|
431
|
-
args: {
|
|
432
|
-
targetVault: targetAddress,
|
|
433
|
-
targetAsset,
|
|
434
|
-
...(assets == null ? { shares: shares ?? 0n } : { assets }),
|
|
435
|
-
maxSharePriceVaultV2,
|
|
436
|
-
userAddress,
|
|
437
|
-
requirementSignature: permit,
|
|
438
|
-
referralFeePct: common.referralFeePct,
|
|
439
|
-
referralFeeRecipient: common.referralFeeRecipient,
|
|
440
|
-
deadline,
|
|
441
|
-
},
|
|
442
|
-
metadata,
|
|
510
|
+
return (0, migrateToV2_js_1.buildVaultV1MigrateToV2)(parsed, {
|
|
511
|
+
requirementSignature: permit,
|
|
443
512
|
});
|
|
444
513
|
},
|
|
445
514
|
});
|
|
@@ -22,4 +22,8 @@ export declare function computeVaultV2ForceWithdrawQuote({ exitAssets, vaultData
|
|
|
22
22
|
adapter: `0x${string}`;
|
|
23
23
|
minSharePriceE27: bigint;
|
|
24
24
|
requiredShareAllowance: bigint;
|
|
25
|
+
referral: {
|
|
26
|
+
readonly referralFeePct: bigint;
|
|
27
|
+
readonly referralFeeRecipient: Address;
|
|
28
|
+
};
|
|
25
29
|
};
|