@morpho-org/morpho-sdk 6.0.0-next.0 → 6.0.0-next.1
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-v5-to-v6.md +206 -3
- package/README.md +81 -41
- package/lib/cjs/abis.d.ts +210 -0
- package/lib/cjs/abis.js +142 -2
- package/lib/cjs/actions/blue/borrow.d.ts +1 -1
- package/lib/cjs/actions/blue/borrow.js +1 -1
- package/lib/cjs/actions/blue/common.d.ts +6 -19
- package/lib/cjs/actions/blue/common.js +25 -138
- package/lib/cjs/actions/blue/refinance.d.ts +1 -1
- package/lib/cjs/actions/blue/refinance.js +1 -1
- package/lib/cjs/actions/blue/repay.d.ts +3 -3
- package/lib/cjs/actions/blue/repay.js +1 -1
- package/lib/cjs/actions/blue/repayWithdrawCollateral.d.ts +3 -3
- package/lib/cjs/actions/blue/repayWithdrawCollateral.js +1 -1
- package/lib/cjs/actions/blue/supply.d.ts +3 -3
- package/lib/cjs/actions/blue/supply.js +1 -1
- package/lib/cjs/actions/blue/supplyCollateral.d.ts +3 -3
- package/lib/cjs/actions/blue/supplyCollateral.js +1 -1
- package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +3 -3
- package/lib/cjs/actions/blue/supplyCollateralBorrow.js +1 -1
- package/lib/cjs/actions/blue/withdraw.d.ts +1 -1
- package/lib/cjs/actions/blue/withdraw.js +1 -1
- package/lib/cjs/actions/blue/withdrawCollateral.d.ts +1 -1
- package/lib/cjs/actions/blue/withdrawCollateral.js +1 -1
- package/lib/cjs/actions/bundles/common.d.ts +200 -0
- package/lib/cjs/actions/bundles/common.js +469 -0
- package/lib/cjs/actions/bundles/index.d.ts +3 -0
- package/lib/cjs/actions/bundles/index.js +23 -0
- package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.d.ts +76 -0
- package/lib/cjs/actions/bundles/resolveBundlesTokenRequirements.js +125 -0
- package/lib/cjs/actions/index.d.ts +1 -0
- package/lib/cjs/actions/index.js +1 -0
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.d.ts +2 -2
- package/lib/cjs/actions/midnight/supplyCollateralTakeBorrow.js +2 -2
- package/lib/cjs/actions/midnight/takeBorrow.d.ts +2 -2
- package/lib/cjs/actions/midnight/takeBorrow.js +2 -2
- package/lib/cjs/actions/midnight/takeLend.d.ts +2 -2
- package/lib/cjs/actions/midnight/takeLend.js +2 -2
- package/lib/cjs/actions/requirements/blue/getUnusedPermit2Nonce.d.ts +1 -1
- package/lib/cjs/actions/requirements/blue/getUnusedPermit2Nonce.js +1 -1
- package/lib/cjs/actions/requirements/blue/index.d.ts +0 -1
- package/lib/cjs/actions/requirements/blue/index.js +0 -1
- package/lib/cjs/actions/requirements/encode/encodeBlueSignatureAuthorization.js +1 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.d.ts +1 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +2 -1
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.d.ts +3 -3
- package/lib/cjs/actions/requirements/encode/encodeErc20Permit.js +10 -4
- package/lib/{esm/actions/requirements/encode/encodeErc20Permit2TransferFrom.d.ts → cjs/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts} +12 -12
- package/lib/cjs/actions/requirements/encode/{encodeErc20Permit2TransferFrom.js → encodeErc20Permit2SignatureTransfer.js} +13 -13
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.d.ts +4 -4
- package/lib/cjs/actions/requirements/encode/encodeVaultSharesPermit.js +6 -5
- package/lib/cjs/actions/requirements/encode/index.d.ts +1 -1
- package/lib/cjs/actions/requirements/encode/index.js +1 -1
- package/lib/cjs/actions/requirements/getRequirementsApproval.d.ts +4 -3
- package/lib/cjs/actions/requirements/getRequirementsApproval.js +4 -3
- package/lib/cjs/actions/signatures/getTokenRequirementActions.js +2 -2
- package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +22 -30
- package/lib/cjs/actions/signatures/getVaultExitBundlesV1PermitStruct.js +18 -66
- package/lib/cjs/actions/vaultV1/deposit.d.ts +73 -57
- package/lib/cjs/actions/vaultV1/deposit.js +110 -109
- package/lib/cjs/actions/vaultV1/migrateToV2.d.ts +43 -66
- package/lib/cjs/actions/vaultV1/migrateToV2.js +91 -104
- package/lib/cjs/actions/vaultV1/redeem.d.ts +30 -23
- package/lib/cjs/actions/vaultV1/redeem.js +56 -33
- package/lib/cjs/actions/vaultV1/withdraw.d.ts +58 -24
- package/lib/cjs/actions/vaultV1/withdraw.js +86 -34
- package/lib/cjs/actions/vaultV2/deposit.d.ts +74 -57
- package/lib/cjs/actions/vaultV2/deposit.js +111 -109
- package/lib/cjs/actions/vaultV2/redeem.d.ts +30 -24
- package/lib/cjs/actions/vaultV2/redeem.js +56 -34
- package/lib/cjs/actions/vaultV2/withdraw.d.ts +58 -25
- package/lib/cjs/actions/vaultV2/withdraw.js +86 -35
- package/lib/cjs/entities/blue/blue.d.ts +19 -19
- package/lib/cjs/entities/blue/blue.js +3 -1
- package/lib/cjs/entities/index.d.ts +1 -0
- package/lib/cjs/entities/index.js +15 -0
- package/lib/cjs/entities/midnight/midnight.d.ts +2 -2
- package/lib/cjs/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.d.ts → entities/requirements/getBundlesTokenRequirements.d.ts} +21 -14
- package/lib/cjs/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.js → entities/requirements/getBundlesTokenRequirements.js} +61 -65
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.d.ts +28 -0
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.js +74 -0
- package/lib/cjs/entities/requirements/index.d.ts +1 -0
- package/lib/cjs/entities/requirements/index.js +17 -0
- package/lib/cjs/entities/vaultV1/vaultV1.d.ts +348 -98
- package/lib/cjs/entities/vaultV1/vaultV1.js +322 -120
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +221 -68
- package/lib/cjs/entities/vaultV2/vaultV2.js +219 -77
- package/lib/cjs/helpers/index.d.ts +2 -1
- package/lib/cjs/helpers/index.js +5 -1
- package/lib/cjs/helpers/referralFee.d.ts +21 -0
- package/lib/cjs/helpers/referralFee.js +35 -0
- package/lib/cjs/helpers/slippage.d.ts +90 -1
- package/lib/cjs/helpers/slippage.js +123 -0
- package/lib/cjs/helpers/validate.d.ts +2 -0
- package/lib/cjs/helpers/validate.js +12 -1
- package/lib/cjs/helpers/validateRequirementSpender.d.ts +1 -1
- package/lib/cjs/helpers/validateRequirementSpender.js +1 -0
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/types/action.d.ts +179 -70
- package/lib/cjs/types/action.js +12 -12
- package/lib/cjs/types/error.d.ts +62 -14
- package/lib/cjs/types/error.js +88 -22
- package/lib/esm/abis.d.ts +210 -0
- package/lib/esm/abis.js +140 -0
- package/lib/esm/actions/blue/borrow.d.ts +1 -1
- package/lib/esm/actions/blue/borrow.js +1 -1
- package/lib/esm/actions/blue/common.d.ts +6 -19
- package/lib/esm/actions/blue/common.js +27 -140
- package/lib/esm/actions/blue/refinance.d.ts +1 -1
- package/lib/esm/actions/blue/refinance.js +1 -1
- package/lib/esm/actions/blue/repay.d.ts +3 -3
- package/lib/esm/actions/blue/repay.js +1 -1
- package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +3 -3
- package/lib/esm/actions/blue/repayWithdrawCollateral.js +1 -1
- package/lib/esm/actions/blue/supply.d.ts +3 -3
- package/lib/esm/actions/blue/supply.js +1 -1
- package/lib/esm/actions/blue/supplyCollateral.d.ts +3 -3
- package/lib/esm/actions/blue/supplyCollateral.js +1 -1
- package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +3 -3
- package/lib/esm/actions/blue/supplyCollateralBorrow.js +1 -1
- package/lib/esm/actions/blue/withdraw.d.ts +1 -1
- package/lib/esm/actions/blue/withdraw.js +1 -1
- package/lib/esm/actions/blue/withdrawCollateral.d.ts +1 -1
- package/lib/esm/actions/blue/withdrawCollateral.js +1 -1
- package/lib/esm/actions/bundles/common.d.ts +200 -0
- package/lib/esm/actions/bundles/common.js +457 -0
- package/lib/esm/actions/bundles/index.d.ts +3 -0
- package/lib/esm/actions/bundles/index.js +2 -0
- package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.d.ts +76 -0
- package/lib/esm/actions/bundles/resolveBundlesTokenRequirements.js +121 -0
- package/lib/esm/actions/index.d.ts +1 -0
- package/lib/esm/actions/index.js +1 -0
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.d.ts +2 -2
- package/lib/esm/actions/midnight/supplyCollateralTakeBorrow.js +2 -2
- package/lib/esm/actions/midnight/takeBorrow.d.ts +2 -2
- package/lib/esm/actions/midnight/takeBorrow.js +2 -2
- package/lib/esm/actions/midnight/takeLend.d.ts +2 -2
- package/lib/esm/actions/midnight/takeLend.js +2 -2
- package/lib/esm/actions/requirements/blue/getUnusedPermit2Nonce.d.ts +1 -1
- package/lib/esm/actions/requirements/blue/getUnusedPermit2Nonce.js +1 -1
- package/lib/esm/actions/requirements/blue/index.d.ts +0 -1
- package/lib/esm/actions/requirements/blue/index.js +0 -1
- package/lib/esm/actions/requirements/encode/encodeBlueSignatureAuthorization.js +1 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.d.ts +1 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +2 -1
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.d.ts +3 -3
- package/lib/esm/actions/requirements/encode/encodeErc20Permit.js +10 -4
- package/lib/{cjs/actions/requirements/encode/encodeErc20Permit2TransferFrom.d.ts → esm/actions/requirements/encode/encodeErc20Permit2SignatureTransfer.d.ts} +12 -12
- package/lib/esm/actions/requirements/encode/{encodeErc20Permit2TransferFrom.js → encodeErc20Permit2SignatureTransfer.js} +11 -11
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.d.ts +4 -4
- package/lib/esm/actions/requirements/encode/encodeVaultSharesPermit.js +6 -5
- package/lib/esm/actions/requirements/encode/index.d.ts +1 -1
- package/lib/esm/actions/requirements/encode/index.js +1 -1
- package/lib/esm/actions/requirements/getRequirementsApproval.d.ts +4 -3
- package/lib/esm/actions/requirements/getRequirementsApproval.js +4 -3
- package/lib/esm/actions/signatures/getTokenRequirementActions.js +3 -3
- package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.d.ts +22 -30
- package/lib/esm/actions/signatures/getVaultExitBundlesV1PermitStruct.js +19 -67
- package/lib/esm/actions/vaultV1/deposit.d.ts +73 -57
- package/lib/esm/actions/vaultV1/deposit.js +112 -111
- package/lib/esm/actions/vaultV1/migrateToV2.d.ts +43 -66
- package/lib/esm/actions/vaultV1/migrateToV2.js +93 -106
- package/lib/esm/actions/vaultV1/redeem.d.ts +30 -23
- package/lib/esm/actions/vaultV1/redeem.js +56 -33
- package/lib/esm/actions/vaultV1/withdraw.d.ts +58 -24
- package/lib/esm/actions/vaultV1/withdraw.js +86 -34
- package/lib/esm/actions/vaultV2/deposit.d.ts +74 -57
- package/lib/esm/actions/vaultV2/deposit.js +113 -111
- package/lib/esm/actions/vaultV2/redeem.d.ts +30 -24
- package/lib/esm/actions/vaultV2/redeem.js +56 -34
- package/lib/esm/actions/vaultV2/withdraw.d.ts +58 -25
- package/lib/esm/actions/vaultV2/withdraw.js +86 -35
- package/lib/esm/entities/blue/blue.d.ts +19 -19
- package/lib/esm/entities/blue/blue.js +4 -2
- package/lib/esm/entities/index.d.ts +1 -0
- package/lib/esm/entities/index.js +1 -0
- package/lib/esm/entities/midnight/midnight.d.ts +2 -2
- package/lib/esm/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.d.ts → entities/requirements/getBundlesTokenRequirements.d.ts} +21 -14
- package/lib/esm/{actions/requirements/blue/getBlueBundlesV1TokenRequirements.js → entities/requirements/getBundlesTokenRequirements.js} +51 -55
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.d.ts +28 -0
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.js +70 -0
- package/lib/esm/entities/requirements/index.d.ts +1 -0
- package/lib/esm/entities/requirements/index.js +1 -0
- package/lib/esm/entities/vaultV1/vaultV1.d.ts +348 -98
- package/lib/esm/entities/vaultV1/vaultV1.js +326 -124
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +221 -68
- package/lib/esm/entities/vaultV2/vaultV2.js +222 -80
- package/lib/esm/helpers/index.d.ts +2 -1
- package/lib/esm/helpers/index.js +2 -1
- package/lib/esm/helpers/referralFee.d.ts +21 -0
- package/lib/esm/helpers/referralFee.js +31 -0
- package/lib/esm/helpers/slippage.d.ts +90 -1
- package/lib/esm/helpers/slippage.js +122 -2
- package/lib/esm/helpers/validate.d.ts +2 -0
- package/lib/esm/helpers/validate.js +11 -1
- package/lib/esm/helpers/validateRequirementSpender.d.ts +1 -1
- package/lib/esm/helpers/validateRequirementSpender.js +1 -0
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/types/action.d.ts +179 -70
- package/lib/esm/types/action.js +11 -11
- package/lib/esm/types/error.d.ts +62 -14
- package/lib/esm/types/error.js +80 -16
- package/package.json +3 -3
package/lib/cjs/abis.d.ts
CHANGED
|
@@ -326,6 +326,216 @@ export declare const vaultExitBundlesV1Abi: readonly [{
|
|
|
326
326
|
readonly outputs: readonly [];
|
|
327
327
|
readonly stateMutability: "nonpayable";
|
|
328
328
|
}];
|
|
329
|
+
/**
|
|
330
|
+
* Pinned ABI for the VaultBundlesV1 entrypoints used by Vault V1 and Vault V2 actions.
|
|
331
|
+
*
|
|
332
|
+
* Sourced from `morpho-org/bundles` commit
|
|
333
|
+
* `f27e7bcf744310303e24faa522b71d702e696686`.
|
|
334
|
+
*/
|
|
335
|
+
export declare const vaultBundlesV1Abi: readonly [{
|
|
336
|
+
readonly type: "error";
|
|
337
|
+
readonly name: "AlreadyInitiated";
|
|
338
|
+
readonly inputs: readonly [];
|
|
339
|
+
}, {
|
|
340
|
+
readonly type: "error";
|
|
341
|
+
readonly name: "DeadlinePassed";
|
|
342
|
+
readonly inputs: readonly [];
|
|
343
|
+
}, {
|
|
344
|
+
readonly type: "error";
|
|
345
|
+
readonly name: "InconsistentAssets";
|
|
346
|
+
readonly inputs: readonly [];
|
|
347
|
+
}, {
|
|
348
|
+
readonly type: "error";
|
|
349
|
+
readonly name: "NotExactlyOneZero";
|
|
350
|
+
readonly inputs: readonly [];
|
|
351
|
+
}, {
|
|
352
|
+
readonly type: "error";
|
|
353
|
+
readonly name: "PctExceeded";
|
|
354
|
+
readonly inputs: readonly [];
|
|
355
|
+
}, {
|
|
356
|
+
readonly type: "error";
|
|
357
|
+
readonly name: "SlippageExceeded";
|
|
358
|
+
readonly inputs: readonly [];
|
|
359
|
+
}, {
|
|
360
|
+
readonly type: "function";
|
|
361
|
+
readonly name: "initiator";
|
|
362
|
+
readonly inputs: readonly [];
|
|
363
|
+
readonly outputs: readonly [{
|
|
364
|
+
readonly name: "";
|
|
365
|
+
readonly type: "address";
|
|
366
|
+
readonly internalType: "address";
|
|
367
|
+
}];
|
|
368
|
+
readonly stateMutability: "view";
|
|
369
|
+
}, {
|
|
370
|
+
readonly type: "function";
|
|
371
|
+
readonly name: "vaultBundlesV1Deposit";
|
|
372
|
+
readonly inputs: readonly [{
|
|
373
|
+
readonly name: "vault";
|
|
374
|
+
readonly type: "address";
|
|
375
|
+
readonly internalType: "address";
|
|
376
|
+
}, {
|
|
377
|
+
readonly name: "assets";
|
|
378
|
+
readonly type: "uint256";
|
|
379
|
+
readonly internalType: "uint256";
|
|
380
|
+
}, {
|
|
381
|
+
readonly name: "maxSharePriceE27";
|
|
382
|
+
readonly type: "uint256";
|
|
383
|
+
readonly internalType: "uint256";
|
|
384
|
+
}, {
|
|
385
|
+
readonly name: "assetPermit";
|
|
386
|
+
readonly type: "tuple";
|
|
387
|
+
readonly internalType: "struct TokenPermit";
|
|
388
|
+
readonly components: readonly [{
|
|
389
|
+
readonly name: "kind";
|
|
390
|
+
readonly type: "uint8";
|
|
391
|
+
readonly internalType: "enum PermitKind";
|
|
392
|
+
}, {
|
|
393
|
+
readonly name: "data";
|
|
394
|
+
readonly type: "bytes";
|
|
395
|
+
readonly internalType: "bytes";
|
|
396
|
+
}];
|
|
397
|
+
}, {
|
|
398
|
+
readonly name: "referralFeePct";
|
|
399
|
+
readonly type: "uint256";
|
|
400
|
+
readonly internalType: "uint256";
|
|
401
|
+
}, {
|
|
402
|
+
readonly name: "referralFeeRecipient";
|
|
403
|
+
readonly type: "address";
|
|
404
|
+
readonly internalType: "address";
|
|
405
|
+
}, {
|
|
406
|
+
readonly name: "deadline";
|
|
407
|
+
readonly type: "uint256";
|
|
408
|
+
readonly internalType: "uint256";
|
|
409
|
+
}];
|
|
410
|
+
readonly outputs: readonly [];
|
|
411
|
+
readonly stateMutability: "payable";
|
|
412
|
+
}, {
|
|
413
|
+
readonly type: "function";
|
|
414
|
+
readonly name: "vaultBundlesV1Withdraw";
|
|
415
|
+
readonly inputs: readonly [{
|
|
416
|
+
readonly name: "vault";
|
|
417
|
+
readonly type: "address";
|
|
418
|
+
readonly internalType: "address";
|
|
419
|
+
}, {
|
|
420
|
+
readonly name: "assets";
|
|
421
|
+
readonly type: "uint256";
|
|
422
|
+
readonly internalType: "uint256";
|
|
423
|
+
}, {
|
|
424
|
+
readonly name: "shares";
|
|
425
|
+
readonly type: "uint256";
|
|
426
|
+
readonly internalType: "uint256";
|
|
427
|
+
}, {
|
|
428
|
+
readonly name: "sharesPermit";
|
|
429
|
+
readonly type: "tuple";
|
|
430
|
+
readonly internalType: "struct Permit";
|
|
431
|
+
readonly components: readonly [{
|
|
432
|
+
readonly name: "value";
|
|
433
|
+
readonly type: "uint256";
|
|
434
|
+
readonly internalType: "uint256";
|
|
435
|
+
}, {
|
|
436
|
+
readonly name: "nonce";
|
|
437
|
+
readonly type: "uint256";
|
|
438
|
+
readonly internalType: "uint256";
|
|
439
|
+
}, {
|
|
440
|
+
readonly name: "deadline";
|
|
441
|
+
readonly type: "uint256";
|
|
442
|
+
readonly internalType: "uint256";
|
|
443
|
+
}, {
|
|
444
|
+
readonly name: "v";
|
|
445
|
+
readonly type: "uint8";
|
|
446
|
+
readonly internalType: "uint8";
|
|
447
|
+
}, {
|
|
448
|
+
readonly name: "r";
|
|
449
|
+
readonly type: "bytes32";
|
|
450
|
+
readonly internalType: "bytes32";
|
|
451
|
+
}, {
|
|
452
|
+
readonly name: "s";
|
|
453
|
+
readonly type: "bytes32";
|
|
454
|
+
readonly internalType: "bytes32";
|
|
455
|
+
}];
|
|
456
|
+
}, {
|
|
457
|
+
readonly name: "referralFeePct";
|
|
458
|
+
readonly type: "uint256";
|
|
459
|
+
readonly internalType: "uint256";
|
|
460
|
+
}, {
|
|
461
|
+
readonly name: "referralFeeRecipient";
|
|
462
|
+
readonly type: "address";
|
|
463
|
+
readonly internalType: "address";
|
|
464
|
+
}, {
|
|
465
|
+
readonly name: "deadline";
|
|
466
|
+
readonly type: "uint256";
|
|
467
|
+
readonly internalType: "uint256";
|
|
468
|
+
}];
|
|
469
|
+
readonly outputs: readonly [];
|
|
470
|
+
readonly stateMutability: "nonpayable";
|
|
471
|
+
}, {
|
|
472
|
+
readonly type: "function";
|
|
473
|
+
readonly name: "vaultBundlesV1Migrate";
|
|
474
|
+
readonly inputs: readonly [{
|
|
475
|
+
readonly name: "sourceVault";
|
|
476
|
+
readonly type: "address";
|
|
477
|
+
readonly internalType: "address";
|
|
478
|
+
}, {
|
|
479
|
+
readonly name: "destVault";
|
|
480
|
+
readonly type: "address";
|
|
481
|
+
readonly internalType: "address";
|
|
482
|
+
}, {
|
|
483
|
+
readonly name: "assetsWithdrawn";
|
|
484
|
+
readonly type: "uint256";
|
|
485
|
+
readonly internalType: "uint256";
|
|
486
|
+
}, {
|
|
487
|
+
readonly name: "sharesRedeemed";
|
|
488
|
+
readonly type: "uint256";
|
|
489
|
+
readonly internalType: "uint256";
|
|
490
|
+
}, {
|
|
491
|
+
readonly name: "destMaxSharePriceE27";
|
|
492
|
+
readonly type: "uint256";
|
|
493
|
+
readonly internalType: "uint256";
|
|
494
|
+
}, {
|
|
495
|
+
readonly name: "sharesPermit";
|
|
496
|
+
readonly type: "tuple";
|
|
497
|
+
readonly internalType: "struct Permit";
|
|
498
|
+
readonly components: readonly [{
|
|
499
|
+
readonly name: "value";
|
|
500
|
+
readonly type: "uint256";
|
|
501
|
+
readonly internalType: "uint256";
|
|
502
|
+
}, {
|
|
503
|
+
readonly name: "nonce";
|
|
504
|
+
readonly type: "uint256";
|
|
505
|
+
readonly internalType: "uint256";
|
|
506
|
+
}, {
|
|
507
|
+
readonly name: "deadline";
|
|
508
|
+
readonly type: "uint256";
|
|
509
|
+
readonly internalType: "uint256";
|
|
510
|
+
}, {
|
|
511
|
+
readonly name: "v";
|
|
512
|
+
readonly type: "uint8";
|
|
513
|
+
readonly internalType: "uint8";
|
|
514
|
+
}, {
|
|
515
|
+
readonly name: "r";
|
|
516
|
+
readonly type: "bytes32";
|
|
517
|
+
readonly internalType: "bytes32";
|
|
518
|
+
}, {
|
|
519
|
+
readonly name: "s";
|
|
520
|
+
readonly type: "bytes32";
|
|
521
|
+
readonly internalType: "bytes32";
|
|
522
|
+
}];
|
|
523
|
+
}, {
|
|
524
|
+
readonly name: "referralFeePct";
|
|
525
|
+
readonly type: "uint256";
|
|
526
|
+
readonly internalType: "uint256";
|
|
527
|
+
}, {
|
|
528
|
+
readonly name: "referralFeeRecipient";
|
|
529
|
+
readonly type: "address";
|
|
530
|
+
readonly internalType: "address";
|
|
531
|
+
}, {
|
|
532
|
+
readonly name: "deadline";
|
|
533
|
+
readonly type: "uint256";
|
|
534
|
+
readonly internalType: "uint256";
|
|
535
|
+
}];
|
|
536
|
+
readonly outputs: readonly [];
|
|
537
|
+
readonly stateMutability: "nonpayable";
|
|
538
|
+
}];
|
|
329
539
|
/** ABI for the Bundler3 multicall contract. */
|
|
330
540
|
export declare const bundler3Abi: readonly [{
|
|
331
541
|
readonly type: "function";
|
package/lib/cjs/abis.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.blueBundlesV1Abi = void 0;
|
|
3
|
+
exports.compoundV2MigrationAdapterAbi = exports.aaveV3OptimizerMigrationAdapterAbi = exports.aaveV3MigrationAdapterAbi = exports.aaveV2MigrationAdapterAbi = exports.erc20WrapperAdapterAbi = exports.paraswapAdapterAbi = exports.ethereumGeneralAdapter1Abi = exports.generalAdapter1Abi = exports.coreAdapterAbi = exports.bundler3Abi = exports.vaultBundlesV1Abi = exports.vaultExitBundlesV1Abi = exports.setterRatifierAbi = exports.midnightSetterRatifierAbi = exports.midnightBundlesAbi = exports.midnightAbi = exports.ecrecoverRatifierAbi = exports.midnightEcrecoverRatifierAbi = exports.wstEthAbi = exports.wrappedBackedTokenAbi = exports.whitelistControllerAggregatorV2Abi = exports.vaultV2FactoryAbi = exports.vaultV2BluePublicAllocatorAbi = exports.vaultV2Abi = exports.vaultV1PublicAllocatorAbi = exports.vaultV1AdapterFactoryAbi = exports.vaultV1AdapterAbi = exports.publicAllocatorAbi = exports.preLiquidationFactoryAbi = exports.bluePreLiquidationFactoryAbi = exports.preLiquidationAbi = exports.bluePreLiquidationAbi = exports.permit2Abi = exports.permissionedErc20WrapperAbi = exports.morphoVaultV1AdapterFactoryAbi = exports.morphoVaultV1AdapterAbi = exports.morphoMarketV1AdapterV2FactoryAbi = exports.morphoMarketV1AdapterV2Abi = exports.morphoMarketV1AdapterFactoryAbi = exports.morphoMarketV1AdapterAbi = exports.metaMorphoFactoryAbi = exports.metaMorphoAbi = exports.erc5267Abi = exports.erc2612Abi = exports.blueOracleAbi = exports.blueAbi = exports.adaptiveCurveIrmAbi = exports.blueAdaptiveCurveIrmAbi = exports.marketParamsAbi = exports.blueMarketParamsAbi = void 0;
|
|
4
|
+
exports.blueBundlesV1Abi = exports.compoundV3MigrationAdapterAbi = void 0;
|
|
5
5
|
var blue_sdk_1 = require("@morpho-org/blue-sdk");
|
|
6
6
|
Object.defineProperty(exports, "blueMarketParamsAbi", { enumerable: true, get: function () { return blue_sdk_1.marketParamsAbi; } });
|
|
7
7
|
/** @deprecated Use `blueMarketParamsAbi` or the raw `/blue/abis` subpath. */
|
|
@@ -215,6 +215,146 @@ exports.vaultExitBundlesV1Abi = [
|
|
|
215
215
|
stateMutability: "nonpayable",
|
|
216
216
|
},
|
|
217
217
|
];
|
|
218
|
+
/**
|
|
219
|
+
* Pinned ABI for the VaultBundlesV1 entrypoints used by Vault V1 and Vault V2 actions.
|
|
220
|
+
*
|
|
221
|
+
* Sourced from `morpho-org/bundles` commit
|
|
222
|
+
* `f27e7bcf744310303e24faa522b71d702e696686`.
|
|
223
|
+
*/
|
|
224
|
+
exports.vaultBundlesV1Abi = [
|
|
225
|
+
{ type: "error", name: "AlreadyInitiated", inputs: [] },
|
|
226
|
+
{ type: "error", name: "DeadlinePassed", inputs: [] },
|
|
227
|
+
{ type: "error", name: "InconsistentAssets", inputs: [] },
|
|
228
|
+
{ type: "error", name: "NotExactlyOneZero", inputs: [] },
|
|
229
|
+
{ type: "error", name: "PctExceeded", inputs: [] },
|
|
230
|
+
{ type: "error", name: "SlippageExceeded", inputs: [] },
|
|
231
|
+
{
|
|
232
|
+
type: "function",
|
|
233
|
+
name: "initiator",
|
|
234
|
+
inputs: [],
|
|
235
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
236
|
+
stateMutability: "view",
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
type: "function",
|
|
240
|
+
name: "vaultBundlesV1Deposit",
|
|
241
|
+
inputs: [
|
|
242
|
+
{ name: "vault", type: "address", internalType: "address" },
|
|
243
|
+
{ name: "assets", type: "uint256", internalType: "uint256" },
|
|
244
|
+
{
|
|
245
|
+
name: "maxSharePriceE27",
|
|
246
|
+
type: "uint256",
|
|
247
|
+
internalType: "uint256",
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: "assetPermit",
|
|
251
|
+
type: "tuple",
|
|
252
|
+
internalType: "struct TokenPermit",
|
|
253
|
+
components: [
|
|
254
|
+
{ name: "kind", type: "uint8", internalType: "enum PermitKind" },
|
|
255
|
+
{ name: "data", type: "bytes", internalType: "bytes" },
|
|
256
|
+
],
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
name: "referralFeePct",
|
|
260
|
+
type: "uint256",
|
|
261
|
+
internalType: "uint256",
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
name: "referralFeeRecipient",
|
|
265
|
+
type: "address",
|
|
266
|
+
internalType: "address",
|
|
267
|
+
},
|
|
268
|
+
{ name: "deadline", type: "uint256", internalType: "uint256" },
|
|
269
|
+
],
|
|
270
|
+
outputs: [],
|
|
271
|
+
stateMutability: "payable",
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
type: "function",
|
|
275
|
+
name: "vaultBundlesV1Withdraw",
|
|
276
|
+
inputs: [
|
|
277
|
+
{ name: "vault", type: "address", internalType: "address" },
|
|
278
|
+
{ name: "assets", type: "uint256", internalType: "uint256" },
|
|
279
|
+
{ name: "shares", type: "uint256", internalType: "uint256" },
|
|
280
|
+
{
|
|
281
|
+
name: "sharesPermit",
|
|
282
|
+
type: "tuple",
|
|
283
|
+
internalType: "struct Permit",
|
|
284
|
+
components: [
|
|
285
|
+
{ name: "value", type: "uint256", internalType: "uint256" },
|
|
286
|
+
{ name: "nonce", type: "uint256", internalType: "uint256" },
|
|
287
|
+
{ name: "deadline", type: "uint256", internalType: "uint256" },
|
|
288
|
+
{ name: "v", type: "uint8", internalType: "uint8" },
|
|
289
|
+
{ name: "r", type: "bytes32", internalType: "bytes32" },
|
|
290
|
+
{ name: "s", type: "bytes32", internalType: "bytes32" },
|
|
291
|
+
],
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
name: "referralFeePct",
|
|
295
|
+
type: "uint256",
|
|
296
|
+
internalType: "uint256",
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
name: "referralFeeRecipient",
|
|
300
|
+
type: "address",
|
|
301
|
+
internalType: "address",
|
|
302
|
+
},
|
|
303
|
+
{ name: "deadline", type: "uint256", internalType: "uint256" },
|
|
304
|
+
],
|
|
305
|
+
outputs: [],
|
|
306
|
+
stateMutability: "nonpayable",
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
type: "function",
|
|
310
|
+
name: "vaultBundlesV1Migrate",
|
|
311
|
+
inputs: [
|
|
312
|
+
{ name: "sourceVault", type: "address", internalType: "address" },
|
|
313
|
+
{ name: "destVault", type: "address", internalType: "address" },
|
|
314
|
+
{
|
|
315
|
+
name: "assetsWithdrawn",
|
|
316
|
+
type: "uint256",
|
|
317
|
+
internalType: "uint256",
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
name: "sharesRedeemed",
|
|
321
|
+
type: "uint256",
|
|
322
|
+
internalType: "uint256",
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
name: "destMaxSharePriceE27",
|
|
326
|
+
type: "uint256",
|
|
327
|
+
internalType: "uint256",
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
name: "sharesPermit",
|
|
331
|
+
type: "tuple",
|
|
332
|
+
internalType: "struct Permit",
|
|
333
|
+
components: [
|
|
334
|
+
{ name: "value", type: "uint256", internalType: "uint256" },
|
|
335
|
+
{ name: "nonce", type: "uint256", internalType: "uint256" },
|
|
336
|
+
{ name: "deadline", type: "uint256", internalType: "uint256" },
|
|
337
|
+
{ name: "v", type: "uint8", internalType: "uint8" },
|
|
338
|
+
{ name: "r", type: "bytes32", internalType: "bytes32" },
|
|
339
|
+
{ name: "s", type: "bytes32", internalType: "bytes32" },
|
|
340
|
+
],
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
name: "referralFeePct",
|
|
344
|
+
type: "uint256",
|
|
345
|
+
internalType: "uint256",
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
name: "referralFeeRecipient",
|
|
349
|
+
type: "address",
|
|
350
|
+
internalType: "address",
|
|
351
|
+
},
|
|
352
|
+
{ name: "deadline", type: "uint256", internalType: "uint256" },
|
|
353
|
+
],
|
|
354
|
+
outputs: [],
|
|
355
|
+
stateMutability: "nonpayable",
|
|
356
|
+
},
|
|
357
|
+
];
|
|
218
358
|
/** ABI for the Bundler3 multicall contract. */
|
|
219
359
|
exports.bundler3Abi = [
|
|
220
360
|
{
|
|
@@ -60,7 +60,7 @@ export interface BlueBorrowParams {
|
|
|
60
60
|
* @throws {ReallocationWithdrawalOnTargetMarketError} when a source is the target market.
|
|
61
61
|
* @throws {ReallocationLoanTokenMismatchError} when a source market uses another loan token.
|
|
62
62
|
* @throws {DepositOwnerMismatchError} when the signed authorization owner differs from `userAddress`.
|
|
63
|
-
* @throws {
|
|
63
|
+
* @throws {BundlesRequirementSignatureMismatchError} when authorization cannot be bound safely.
|
|
64
64
|
* @throws {UnsupportedChainIdError} when the chain is absent from the registry.
|
|
65
65
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
66
66
|
* @example
|
|
@@ -33,7 +33,7 @@ const supplyCollateralBorrow_js_1 = require("./supplyCollateralBorrow.js");
|
|
|
33
33
|
* @throws {ReallocationWithdrawalOnTargetMarketError} when a source is the target market.
|
|
34
34
|
* @throws {ReallocationLoanTokenMismatchError} when a source market uses another loan token.
|
|
35
35
|
* @throws {DepositOwnerMismatchError} when the signed authorization owner differs from `userAddress`.
|
|
36
|
-
* @throws {
|
|
36
|
+
* @throws {BundlesRequirementSignatureMismatchError} when authorization cannot be bound safely.
|
|
37
37
|
* @throws {UnsupportedChainIdError} when the chain is absent from the registry.
|
|
38
38
|
* @throws {UnknownAddressError} when BlueBundlesV1 is not registered.
|
|
39
39
|
* @example
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MarketParams } from "@morpho-org/blue-sdk";
|
|
2
2
|
import { type Address, type Hex } from "viem";
|
|
3
|
-
import { type AuthorizationRequirementSignature, type BaseAction, type
|
|
3
|
+
import { type AuthorizationRequirementSignature, type BaseAction, type BundlesTokenRequirementSignature, type Metadata, type RequirementSignature, type Transaction, type VaultV2BlueReallocation } from "../../types/index.js";
|
|
4
|
+
import { type BundlesTokenPermit } from "../bundles/index.js";
|
|
4
5
|
/** @internal */
|
|
5
6
|
export interface BlueBundlesV1CommonParams {
|
|
6
7
|
chainId: number;
|
|
@@ -15,21 +16,7 @@ export interface NormalizedBlueBundlesV1CommonParams {
|
|
|
15
16
|
referralFeePct: bigint;
|
|
16
17
|
referralFeeRecipient: Address;
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
-
* BlueBundlesV1 token-permit discriminator carried in the encoded permit struct: `none` (0) skips
|
|
20
|
-
* the pull, `erc2612` (1) is an ERC-2612 permit, `permit2TransferFrom` (2) is a Permit2
|
|
21
|
-
* SignatureTransfer. Named so a transposed literal can't silently route a permit to the wrong branch.
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
declare const BLUE_BUNDLES_V1_TOKEN_PERMIT_KIND: {
|
|
25
|
-
readonly none: 0;
|
|
26
|
-
readonly erc2612: 1;
|
|
27
|
-
readonly permit2TransferFrom: 2;
|
|
28
|
-
};
|
|
29
|
-
interface BlueBundlesV1TokenPermit {
|
|
30
|
-
kind: (typeof BLUE_BUNDLES_V1_TOKEN_PERMIT_KIND)[keyof typeof BLUE_BUNDLES_V1_TOKEN_PERMIT_KIND];
|
|
31
|
-
data: Hex;
|
|
32
|
-
}
|
|
19
|
+
type BlueBundlesV1TokenPermit = BundlesTokenPermit;
|
|
33
20
|
interface BlueBundlesV1SignedAuthorization {
|
|
34
21
|
signature: {
|
|
35
22
|
v: number;
|
|
@@ -47,7 +34,7 @@ export declare const validateBlueBundlesV1NativeFunding: (params: {
|
|
|
47
34
|
token: Address;
|
|
48
35
|
fundedAmount: bigint;
|
|
49
36
|
nativeAmount?: bigint;
|
|
50
|
-
requirementSignature?:
|
|
37
|
+
requirementSignature?: BundlesTokenRequirementSignature;
|
|
51
38
|
}) => bigint;
|
|
52
39
|
/** @internal */
|
|
53
40
|
export declare const getBlueBundlesV1TokenPermit: (params: {
|
|
@@ -55,7 +42,7 @@ export declare const getBlueBundlesV1TokenPermit: (params: {
|
|
|
55
42
|
userAddress: Address;
|
|
56
43
|
token: Address;
|
|
57
44
|
amount: bigint;
|
|
58
|
-
requirementSignature?:
|
|
45
|
+
requirementSignature?: BundlesTokenRequirementSignature;
|
|
59
46
|
}) => BlueBundlesV1TokenPermit;
|
|
60
47
|
/** @internal */
|
|
61
48
|
export declare const getBlueBundlesV1SignedAuthorization: (params: {
|
|
@@ -86,7 +73,7 @@ export declare const selectBlueBundlesV1RequirementSignatures: (signatures: read
|
|
|
86
73
|
token?: boolean;
|
|
87
74
|
authorization?: boolean;
|
|
88
75
|
}) => {
|
|
89
|
-
token?:
|
|
76
|
+
token?: BundlesTokenRequirementSignature;
|
|
90
77
|
authorization?: AuthorizationRequirementSignature;
|
|
91
78
|
};
|
|
92
79
|
/** @internal */
|