@morpho-org/blue-sdk 4.8.0 → 4.9.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/lib/addresses.d.ts +639 -5
- package/lib/addresses.js +322 -9
- package/lib/chain.d.ts +233 -1
- package/lib/token/VaultToken.d.ts +2 -2
- package/lib/vault/Vault.js +2 -2
- package/package.json +1 -1
package/lib/addresses.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.unwrappedTokensMapping = exports.addresses = exports.addressesRegistry = exports.convexWrapperTokens = exports.getPermissionedCoinbaseTokens = exports.permissionedCoinbaseTokens = exports.permissionedBackedTokens = exports.permissionedWrapperTokens = exports.erc20WrapperTokens = exports.getChainAddresses = exports.NATIVE_ADDRESS = void 0;
|
|
6
|
+
exports.unwrappedTokensMapping = exports.deployments = exports.addresses = exports.addressesRegistry = exports.convexWrapperTokens = exports.getPermissionedCoinbaseTokens = exports.permissionedCoinbaseTokens = exports.permissionedBackedTokens = exports.permissionedWrapperTokens = exports.erc20WrapperTokens = exports.getChainAddresses = exports.NATIVE_ADDRESS = void 0;
|
|
7
7
|
exports.getUnwrappedToken = getUnwrappedToken;
|
|
8
8
|
exports.registerCustomAddresses = registerCustomAddresses;
|
|
9
9
|
const morpho_ts_1 = require("@morpho-org/morpho-ts");
|
|
@@ -37,10 +37,25 @@ const _addressesRegistry = {
|
|
|
37
37
|
aaveV3EtherFiMigrationAdapter: "0x4011dc6581fA05F9B0c7A12AdCd676e2b1a59ca3",
|
|
38
38
|
aaveV3OptimizerMigrationAdapter: "0x9e2ea2d5785598a163D569D795f286F5C55ad972",
|
|
39
39
|
},
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
42
|
+
*/
|
|
40
43
|
aaveV3OptimizerBundler: "0x16F38d2E764E7BeBF625a8E995b34968226D2F9c",
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
46
|
+
*/
|
|
41
47
|
aaveV2Bundler: "0xb3dCc75DB379925edFd3007511A8CE0cB4aa8e76",
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
50
|
+
*/
|
|
42
51
|
aaveV3Bundler: "0x98ccB155E86bb478d514a827d16f58c6912f9BDC",
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
54
|
+
*/
|
|
43
55
|
compoundV3Bundler: "0x3a0e2E9FB9c95fBc843daF166276C90B6C479558",
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
58
|
+
*/
|
|
44
59
|
compoundV2Bundler: "0x26bF52a84360Ad3d01d7CDc28FC2dDC04d8c8647",
|
|
45
60
|
adaptiveCurveIrm: "0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC",
|
|
46
61
|
publicAllocator: "0xfd32fA2ca22c76dD6E550706Ad913FC6CE91c75D",
|
|
@@ -96,8 +111,17 @@ const _addressesRegistry = {
|
|
|
96
111
|
compoundV3MigrationAdapter: "0x85D4812Ef92c040d4270eD8547b6835e41FbbB70",
|
|
97
112
|
aaveV3CoreMigrationAdapter: "0xb27Aa2a964eAd5ed661D86974b37e4fB995b36f5",
|
|
98
113
|
},
|
|
114
|
+
/**
|
|
115
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
116
|
+
*/
|
|
99
117
|
compoundV2Bundler: "0x123f3167a416cA19365dE03a65e0AF3532af7223",
|
|
118
|
+
/**
|
|
119
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
120
|
+
*/
|
|
100
121
|
aaveV3Bundler: "0xcAe2929baBc60Be34818EaA5F40bF69265677108",
|
|
122
|
+
/**
|
|
123
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
124
|
+
*/
|
|
101
125
|
compoundV3Bundler: "0x1f8076e2EB6f10b12e6886f30D4909A91969F7dA",
|
|
102
126
|
adaptiveCurveIrm: "0x46415998764C29aB2a25CbeA6254146D50D22687",
|
|
103
127
|
publicAllocator: "0xA090dD1a701408Df1d4d0B85b716c87565f90467",
|
|
@@ -189,7 +213,7 @@ const _addressesRegistry = {
|
|
|
189
213
|
publicAllocator: "0x37a888192165fC39884f87c64E2476BfD2C09675",
|
|
190
214
|
metaMorphoFactory: "0x27D4Af0AC9E7FDfA6D0853236f249CC27AE79488",
|
|
191
215
|
chainlinkOracleFactory: "0x39d8622C607A691D7705E8842fbB12E3c38dCD41",
|
|
192
|
-
preLiquidationFactory: "
|
|
216
|
+
preLiquidationFactory: "0x373ccddcd3F09D2e1430B3F2b290B9bF56Ae7336",
|
|
193
217
|
wNative: "0xFC00000000000000000000000000000000000006",
|
|
194
218
|
},
|
|
195
219
|
[chain_js_1.ChainId.ScrollMainnet]: {
|
|
@@ -389,6 +413,288 @@ const _addressesRegistry = {
|
|
|
389
413
|
wNative: "0x5555555555555555555555555555555555555555",
|
|
390
414
|
},
|
|
391
415
|
};
|
|
416
|
+
const _deployments = {
|
|
417
|
+
[chain_js_1.ChainId.EthMainnet]: {
|
|
418
|
+
morpho: 18883124n,
|
|
419
|
+
permit2: 15986406n,
|
|
420
|
+
bundler3: {
|
|
421
|
+
bundler3: 21643807n,
|
|
422
|
+
generalAdapter1: 21872136n,
|
|
423
|
+
paraswapAdapter: 21643807n,
|
|
424
|
+
erc20WrapperAdapter: 21872136n,
|
|
425
|
+
compoundV2MigrationAdapter: 21643807n,
|
|
426
|
+
compoundV3MigrationAdapter: 21643807n,
|
|
427
|
+
aaveV2MigrationAdapter: 21643807n,
|
|
428
|
+
aaveV3CoreMigrationAdapter: 21643807n,
|
|
429
|
+
aaveV3PrimeMigrationAdapter: 21643807n,
|
|
430
|
+
aaveV3EtherFiMigrationAdapter: 21643807n,
|
|
431
|
+
aaveV3OptimizerMigrationAdapter: 21643807n,
|
|
432
|
+
},
|
|
433
|
+
adaptiveCurveIrm: 18883124n,
|
|
434
|
+
publicAllocator: 19375099n,
|
|
435
|
+
metaMorphoFactory: 21439510n,
|
|
436
|
+
chainlinkOracleFactory: 19375066n,
|
|
437
|
+
preLiquidationFactory: 21414664n,
|
|
438
|
+
},
|
|
439
|
+
[chain_js_1.ChainId.BaseMainnet]: {
|
|
440
|
+
morpho: 13977148n,
|
|
441
|
+
permit2: 1425180n,
|
|
442
|
+
bundler3: {
|
|
443
|
+
bundler3: 25161671n,
|
|
444
|
+
generalAdapter1: 26539234n,
|
|
445
|
+
paraswapAdapter: 25161671n,
|
|
446
|
+
erc20WrapperAdapter: 26539234n,
|
|
447
|
+
compoundV3MigrationAdapter: 25161671n,
|
|
448
|
+
aaveV3CoreMigrationAdapter: 25161671n,
|
|
449
|
+
},
|
|
450
|
+
adaptiveCurveIrm: 13977152n,
|
|
451
|
+
publicAllocator: 13979545n,
|
|
452
|
+
metaMorphoFactory: 23928808n,
|
|
453
|
+
chainlinkOracleFactory: 13978286n,
|
|
454
|
+
preLiquidationFactory: 23779056n,
|
|
455
|
+
},
|
|
456
|
+
[chain_js_1.ChainId.PolygonMainnet]: {
|
|
457
|
+
morpho: 66931042n,
|
|
458
|
+
bundler3: {
|
|
459
|
+
bundler3: 68074185n,
|
|
460
|
+
generalAdapter1: 68074185n,
|
|
461
|
+
paraswapAdapter: 68074185n,
|
|
462
|
+
compoundV3MigrationAdapter: 68690465n,
|
|
463
|
+
aaveV2MigrationAdapter: 68690465n,
|
|
464
|
+
aaveV3CoreMigrationAdapter: 68690465n,
|
|
465
|
+
},
|
|
466
|
+
permit2: 35701901n,
|
|
467
|
+
adaptiveCurveIrm: 66931042n,
|
|
468
|
+
publicAllocator: 66931042n,
|
|
469
|
+
metaMorphoFactory: 66931042n,
|
|
470
|
+
chainlinkOracleFactory: 66931042n,
|
|
471
|
+
preLiquidationFactory: 68074185n,
|
|
472
|
+
},
|
|
473
|
+
[chain_js_1.ChainId.ArbitrumMainnet]: {
|
|
474
|
+
morpho: 296446593n,
|
|
475
|
+
bundler3: {
|
|
476
|
+
bundler3: 307326238n,
|
|
477
|
+
generalAdapter1: 307326238n,
|
|
478
|
+
paraswapAdapter: 307326988n,
|
|
479
|
+
aaveV3CoreMigrationAdapter: 358694526n,
|
|
480
|
+
compoundV3MigrationAdapter: 358693964n,
|
|
481
|
+
},
|
|
482
|
+
permit2: 38692735n,
|
|
483
|
+
adaptiveCurveIrm: 296446593n,
|
|
484
|
+
publicAllocator: 296446593n,
|
|
485
|
+
metaMorphoFactory: 296447195n,
|
|
486
|
+
chainlinkOracleFactory: 296447195n,
|
|
487
|
+
preLiquidationFactory: 307326238n,
|
|
488
|
+
},
|
|
489
|
+
[chain_js_1.ChainId.OptimismMainnet]: {
|
|
490
|
+
morpho: 130770075n,
|
|
491
|
+
bundler3: {
|
|
492
|
+
bundler3: 132139369n,
|
|
493
|
+
generalAdapter1: 132139369n,
|
|
494
|
+
paraswapAdapter: 132139438n,
|
|
495
|
+
},
|
|
496
|
+
permit2: 38854427n,
|
|
497
|
+
adaptiveCurveIrm: 130770075n,
|
|
498
|
+
publicAllocator: 130770075n,
|
|
499
|
+
metaMorphoFactory: 130770189n,
|
|
500
|
+
chainlinkOracleFactory: 130770189n,
|
|
501
|
+
preLiquidationFactory: 132139369n,
|
|
502
|
+
},
|
|
503
|
+
[chain_js_1.ChainId.WorldChainMainnet]: {
|
|
504
|
+
morpho: 9025669n,
|
|
505
|
+
bundler3: {
|
|
506
|
+
bundler3: 10273494n,
|
|
507
|
+
generalAdapter1: 10273494n,
|
|
508
|
+
},
|
|
509
|
+
adaptiveCurveIrm: 9025669n,
|
|
510
|
+
publicAllocator: 9025669n,
|
|
511
|
+
metaMorphoFactory: 9025733n,
|
|
512
|
+
chainlinkOracleFactory: 9025733n,
|
|
513
|
+
preLiquidationFactory: 10273494n,
|
|
514
|
+
},
|
|
515
|
+
[chain_js_1.ChainId.FraxtalMainnet]: {
|
|
516
|
+
morpho: 15317931n,
|
|
517
|
+
bundler3: {
|
|
518
|
+
bundler3: 16536231n,
|
|
519
|
+
generalAdapter1: 16536231n,
|
|
520
|
+
},
|
|
521
|
+
adaptiveCurveIrm: 15317931n,
|
|
522
|
+
publicAllocator: 15317931n,
|
|
523
|
+
metaMorphoFactory: 15318007n,
|
|
524
|
+
chainlinkOracleFactory: 15318007n,
|
|
525
|
+
preLiquidationFactory: 16536231n,
|
|
526
|
+
},
|
|
527
|
+
[chain_js_1.ChainId.ScrollMainnet]: {
|
|
528
|
+
morpho: 12842868n,
|
|
529
|
+
bundler3: {
|
|
530
|
+
bundler3: 13504587n,
|
|
531
|
+
generalAdapter1: 13504587n,
|
|
532
|
+
},
|
|
533
|
+
adaptiveCurveIrm: 12842868n,
|
|
534
|
+
publicAllocator: 12842868n,
|
|
535
|
+
metaMorphoFactory: 12842903n,
|
|
536
|
+
chainlinkOracleFactory: 12842903n,
|
|
537
|
+
preLiquidationFactory: 13504587n,
|
|
538
|
+
},
|
|
539
|
+
[chain_js_1.ChainId.InkMainnet]: {
|
|
540
|
+
morpho: 4078776n,
|
|
541
|
+
bundler3: {
|
|
542
|
+
bundler3: 6385077n,
|
|
543
|
+
generalAdapter1: 6385077n,
|
|
544
|
+
},
|
|
545
|
+
adaptiveCurveIrm: 4078776n,
|
|
546
|
+
publicAllocator: 4078776n,
|
|
547
|
+
metaMorphoFactory: 4078830n,
|
|
548
|
+
chainlinkOracleFactory: 4078830n,
|
|
549
|
+
preLiquidationFactory: 6385077n,
|
|
550
|
+
},
|
|
551
|
+
[chain_js_1.ChainId.Unichain]: {
|
|
552
|
+
morpho: 9139027n,
|
|
553
|
+
bundler3: {
|
|
554
|
+
bundler3: 9381237n,
|
|
555
|
+
generalAdapter1: 9381237n,
|
|
556
|
+
paraswapAdapter: 20872902n,
|
|
557
|
+
compoundV3MigrationAdapter: 22019479n,
|
|
558
|
+
},
|
|
559
|
+
adaptiveCurveIrm: 9139027n,
|
|
560
|
+
publicAllocator: 9139027n,
|
|
561
|
+
metaMorphoFactory: 9316789n,
|
|
562
|
+
chainlinkOracleFactory: 9316789n,
|
|
563
|
+
preLiquidationFactory: 9381237n,
|
|
564
|
+
},
|
|
565
|
+
[chain_js_1.ChainId.SonicMainnet]: {
|
|
566
|
+
morpho: 9100931n,
|
|
567
|
+
bundler3: {
|
|
568
|
+
bundler3: 9102286n,
|
|
569
|
+
generalAdapter1: 9102286n,
|
|
570
|
+
},
|
|
571
|
+
adaptiveCurveIrm: 9100931n,
|
|
572
|
+
publicAllocator: 9100931n,
|
|
573
|
+
metaMorphoFactory: 9101319n,
|
|
574
|
+
chainlinkOracleFactory: 9101319n,
|
|
575
|
+
preLiquidationFactory: 9102286n,
|
|
576
|
+
},
|
|
577
|
+
[chain_js_1.ChainId.HemiMainnet]: {
|
|
578
|
+
morpho: 1188872n,
|
|
579
|
+
bundler3: {
|
|
580
|
+
bundler3: 1188907n,
|
|
581
|
+
generalAdapter1: 1188907n,
|
|
582
|
+
},
|
|
583
|
+
adaptiveCurveIrm: 1188872n,
|
|
584
|
+
publicAllocator: 1188872n,
|
|
585
|
+
metaMorphoFactory: 1188885n,
|
|
586
|
+
chainlinkOracleFactory: 1188885n,
|
|
587
|
+
preLiquidationFactory: 1188907n,
|
|
588
|
+
},
|
|
589
|
+
[chain_js_1.ChainId.ModeMainnet]: {
|
|
590
|
+
morpho: 19983370n,
|
|
591
|
+
bundler3: {
|
|
592
|
+
bundler3: 19983599n,
|
|
593
|
+
generalAdapter1: 19983599n,
|
|
594
|
+
},
|
|
595
|
+
adaptiveCurveIrm: 19983370n,
|
|
596
|
+
publicAllocator: 19983370n,
|
|
597
|
+
metaMorphoFactory: 19983443n,
|
|
598
|
+
chainlinkOracleFactory: 19983443n,
|
|
599
|
+
preLiquidationFactory: 19983599n,
|
|
600
|
+
},
|
|
601
|
+
[chain_js_1.ChainId.CornMainnet]: {
|
|
602
|
+
morpho: 251401n,
|
|
603
|
+
bundler3: {
|
|
604
|
+
bundler3: 253107n,
|
|
605
|
+
generalAdapter1: 253107n,
|
|
606
|
+
},
|
|
607
|
+
adaptiveCurveIrm: 251401n,
|
|
608
|
+
publicAllocator: 251401n,
|
|
609
|
+
metaMorphoFactory: 253027n,
|
|
610
|
+
chainlinkOracleFactory: 253027n,
|
|
611
|
+
preLiquidationFactory: 253107n,
|
|
612
|
+
},
|
|
613
|
+
[chain_js_1.ChainId.PlumeMainnet]: {
|
|
614
|
+
morpho: 765994n,
|
|
615
|
+
bundler3: {
|
|
616
|
+
bundler3: 789925n,
|
|
617
|
+
generalAdapter1: 789925n,
|
|
618
|
+
},
|
|
619
|
+
adaptiveCurveIrm: 765994n,
|
|
620
|
+
publicAllocator: 765994n,
|
|
621
|
+
metaMorphoFactory: 766078n,
|
|
622
|
+
chainlinkOracleFactory: 766078n,
|
|
623
|
+
preLiquidationFactory: 789925n,
|
|
624
|
+
},
|
|
625
|
+
[chain_js_1.ChainId.CampMainnet]: {
|
|
626
|
+
morpho: 4804080n,
|
|
627
|
+
bundler3: {
|
|
628
|
+
bundler3: 4804690n,
|
|
629
|
+
generalAdapter1: 4804690n,
|
|
630
|
+
},
|
|
631
|
+
adaptiveCurveIrm: 4804080n,
|
|
632
|
+
publicAllocator: 4804080n,
|
|
633
|
+
metaMorphoFactory: 4804270n,
|
|
634
|
+
chainlinkOracleFactory: 4804270n,
|
|
635
|
+
preLiquidationFactory: 4804690n,
|
|
636
|
+
},
|
|
637
|
+
[chain_js_1.ChainId.KatanaMainnet]: {
|
|
638
|
+
morpho: 2741069n,
|
|
639
|
+
bundler3: {
|
|
640
|
+
bundler3: 2741993n,
|
|
641
|
+
generalAdapter1: 2741993n,
|
|
642
|
+
},
|
|
643
|
+
adaptiveCurveIrm: 2741069n,
|
|
644
|
+
publicAllocator: 2741069n,
|
|
645
|
+
metaMorphoFactory: 2741420n,
|
|
646
|
+
chainlinkOracleFactory: 2741420n,
|
|
647
|
+
preLiquidationFactory: 2741993n,
|
|
648
|
+
},
|
|
649
|
+
[chain_js_1.ChainId.EtherlinkMainnet]: {
|
|
650
|
+
morpho: 21047448n,
|
|
651
|
+
bundler3: {
|
|
652
|
+
bundler3: 21050766n,
|
|
653
|
+
generalAdapter1: 21050766n,
|
|
654
|
+
},
|
|
655
|
+
adaptiveCurveIrm: 21047448n,
|
|
656
|
+
publicAllocator: 21047448n,
|
|
657
|
+
metaMorphoFactory: 21050315n,
|
|
658
|
+
chainlinkOracleFactory: 21050315n,
|
|
659
|
+
preLiquidationFactory: 21050766n,
|
|
660
|
+
},
|
|
661
|
+
[chain_js_1.ChainId.TacMainnet]: {
|
|
662
|
+
morpho: 853025n,
|
|
663
|
+
bundler3: {
|
|
664
|
+
bundler3: 978967n,
|
|
665
|
+
generalAdapter1: 978967n,
|
|
666
|
+
},
|
|
667
|
+
adaptiveCurveIrm: 853025n,
|
|
668
|
+
publicAllocator: 853025n,
|
|
669
|
+
metaMorphoFactory: 978654n,
|
|
670
|
+
chainlinkOracleFactory: 978654n,
|
|
671
|
+
preLiquidationFactory: 978967n,
|
|
672
|
+
},
|
|
673
|
+
[chain_js_1.ChainId.LiskMainnet]: {
|
|
674
|
+
morpho: 15731231n,
|
|
675
|
+
bundler3: {
|
|
676
|
+
bundler3: 15731595n,
|
|
677
|
+
generalAdapter1: 15731595n,
|
|
678
|
+
},
|
|
679
|
+
adaptiveCurveIrm: 15731231n,
|
|
680
|
+
publicAllocator: 15731231n,
|
|
681
|
+
metaMorphoFactory: 15731333n,
|
|
682
|
+
chainlinkOracleFactory: 15731333n,
|
|
683
|
+
preLiquidationFactory: 15731595n,
|
|
684
|
+
},
|
|
685
|
+
[chain_js_1.ChainId.HyperliquidMainnet]: {
|
|
686
|
+
morpho: 1988429n,
|
|
687
|
+
bundler3: {
|
|
688
|
+
bundler3: 1988956n,
|
|
689
|
+
generalAdapter1: 1988956n,
|
|
690
|
+
},
|
|
691
|
+
adaptiveCurveIrm: 1988429n,
|
|
692
|
+
publicAllocator: 1988429n,
|
|
693
|
+
metaMorphoFactory: 1988677n,
|
|
694
|
+
chainlinkOracleFactory: 1988677n,
|
|
695
|
+
preLiquidationFactory: 1988956n,
|
|
696
|
+
},
|
|
697
|
+
};
|
|
392
698
|
const getChainAddresses = (chainId) => {
|
|
393
699
|
const chainAddresses = exports.addresses[chainId];
|
|
394
700
|
if (chainAddresses == null)
|
|
@@ -535,6 +841,7 @@ exports.convexWrapperTokens = {
|
|
|
535
841
|
};
|
|
536
842
|
exports.addressesRegistry = (0, morpho_ts_1.deepFreeze)(_addressesRegistry);
|
|
537
843
|
exports.addresses = exports.addressesRegistry;
|
|
844
|
+
exports.deployments = (0, morpho_ts_1.deepFreeze)(_deployments);
|
|
538
845
|
exports.unwrappedTokensMapping = (0, morpho_ts_1.deepFreeze)(_unwrappedTokensMapping);
|
|
539
846
|
/**
|
|
540
847
|
* Registers custom addresses and unwrapped token mappings to extend
|
|
@@ -544,8 +851,11 @@ exports.unwrappedTokensMapping = (0, morpho_ts_1.deepFreeze)(_unwrappedTokensMap
|
|
|
544
851
|
* @param options.unwrappedTokens - A mapping of chain IDs to token address maps,
|
|
545
852
|
* where each entry maps wrapped tokens to their unwrapped equivalents.
|
|
546
853
|
* @param options.addresses - Custom address entries to merge into the default registry.
|
|
547
|
-
*
|
|
548
|
-
*
|
|
854
|
+
* Can be a subset of `ChainAddresses` if chain is already known.
|
|
855
|
+
* Must provide all required addresses if chain is unknown.
|
|
856
|
+
* @param options.deployments - Custom deployment entries to merge into the default registry.
|
|
857
|
+
* Can be a subset of `ChainDeployments` if chain is already known.
|
|
858
|
+
* Must provide all required deployments if chain is unknown.
|
|
549
859
|
*
|
|
550
860
|
* @throws {Error} If attempting to override an existing address.
|
|
551
861
|
*
|
|
@@ -561,16 +871,19 @@ exports.unwrappedTokensMapping = (0, morpho_ts_1.deepFreeze)(_unwrappedTokensMap
|
|
|
561
871
|
* });
|
|
562
872
|
* ```
|
|
563
873
|
*/
|
|
564
|
-
function registerCustomAddresses({ unwrappedTokens, addresses: customAddresses, } = {}) {
|
|
874
|
+
function registerCustomAddresses({ unwrappedTokens, addresses: customAddresses, deployments: customDeployments, } = {}) {
|
|
875
|
+
const customizer = (type) =>
|
|
565
876
|
// biome-ignore lint/suspicious/noExplicitAny: type is not trivial and not important here
|
|
566
|
-
|
|
877
|
+
(objValue, srcValue, key) => {
|
|
567
878
|
if (objValue !== undefined &&
|
|
568
879
|
!(0, lodash_isplainobject_1.default)(objValue) &&
|
|
569
880
|
objValue !== srcValue)
|
|
570
|
-
throw new Error(`Cannot override existing
|
|
881
|
+
throw new Error(`Cannot override existing ${type}: ${key}`);
|
|
571
882
|
};
|
|
572
883
|
if (customAddresses)
|
|
573
|
-
exports.addresses = exports.addressesRegistry = (0, morpho_ts_1.deepFreeze)((0, lodash_mergewith_1.default)({}, exports.addressesRegistry, customAddresses, customizer));
|
|
884
|
+
exports.addresses = exports.addressesRegistry = (0, morpho_ts_1.deepFreeze)((0, lodash_mergewith_1.default)({}, exports.addressesRegistry, customAddresses, customizer("address")));
|
|
885
|
+
if (customDeployments)
|
|
886
|
+
exports.deployments = (0, morpho_ts_1.deepFreeze)((0, lodash_mergewith_1.default)({}, exports.deployments, customDeployments, customizer("deployment")));
|
|
574
887
|
if (unwrappedTokens)
|
|
575
|
-
exports.unwrappedTokensMapping = (0, morpho_ts_1.deepFreeze)((0, lodash_mergewith_1.default)({}, exports.unwrappedTokensMapping, unwrappedTokens, customizer));
|
|
888
|
+
exports.unwrappedTokensMapping = (0, morpho_ts_1.deepFreeze)((0, lodash_mergewith_1.default)({}, exports.unwrappedTokensMapping, unwrappedTokens, customizer("unwrapped token")));
|
|
576
889
|
}
|
package/lib/chain.d.ts
CHANGED
|
@@ -37,5 +37,237 @@ export declare namespace ChainUtils {
|
|
|
37
37
|
const getExplorerUrl: (chainId: ChainId) => string;
|
|
38
38
|
const getExplorerAddressUrl: (chainId: ChainId, address: string) => string;
|
|
39
39
|
const getExplorerTransactionUrl: (chainId: ChainId, tx: string) => string;
|
|
40
|
-
const CHAIN_METADATA:
|
|
40
|
+
const CHAIN_METADATA: {
|
|
41
|
+
1: {
|
|
42
|
+
name: string;
|
|
43
|
+
id: ChainId.EthMainnet;
|
|
44
|
+
nativeCurrency: {
|
|
45
|
+
name: string;
|
|
46
|
+
symbol: string;
|
|
47
|
+
decimals: number;
|
|
48
|
+
};
|
|
49
|
+
explorerUrl: string;
|
|
50
|
+
identifier: string;
|
|
51
|
+
};
|
|
52
|
+
8453: {
|
|
53
|
+
name: string;
|
|
54
|
+
id: ChainId.BaseMainnet;
|
|
55
|
+
nativeCurrency: {
|
|
56
|
+
name: string;
|
|
57
|
+
symbol: string;
|
|
58
|
+
decimals: number;
|
|
59
|
+
};
|
|
60
|
+
explorerUrl: string;
|
|
61
|
+
identifier: string;
|
|
62
|
+
};
|
|
63
|
+
137: {
|
|
64
|
+
name: string;
|
|
65
|
+
id: ChainId.PolygonMainnet;
|
|
66
|
+
nativeCurrency: {
|
|
67
|
+
name: string;
|
|
68
|
+
symbol: string;
|
|
69
|
+
decimals: number;
|
|
70
|
+
};
|
|
71
|
+
explorerUrl: string;
|
|
72
|
+
identifier: string;
|
|
73
|
+
};
|
|
74
|
+
42161: {
|
|
75
|
+
name: string;
|
|
76
|
+
id: ChainId.ArbitrumMainnet;
|
|
77
|
+
nativeCurrency: {
|
|
78
|
+
name: string;
|
|
79
|
+
symbol: string;
|
|
80
|
+
decimals: number;
|
|
81
|
+
};
|
|
82
|
+
explorerUrl: string;
|
|
83
|
+
identifier: string;
|
|
84
|
+
};
|
|
85
|
+
10: {
|
|
86
|
+
name: string;
|
|
87
|
+
id: ChainId.OptimismMainnet;
|
|
88
|
+
nativeCurrency: {
|
|
89
|
+
name: string;
|
|
90
|
+
symbol: string;
|
|
91
|
+
decimals: number;
|
|
92
|
+
};
|
|
93
|
+
explorerUrl: string;
|
|
94
|
+
identifier: string;
|
|
95
|
+
};
|
|
96
|
+
480: {
|
|
97
|
+
name: string;
|
|
98
|
+
id: ChainId.WorldChainMainnet;
|
|
99
|
+
nativeCurrency: {
|
|
100
|
+
name: string;
|
|
101
|
+
symbol: string;
|
|
102
|
+
decimals: number;
|
|
103
|
+
};
|
|
104
|
+
explorerUrl: string;
|
|
105
|
+
identifier: string;
|
|
106
|
+
};
|
|
107
|
+
252: {
|
|
108
|
+
name: string;
|
|
109
|
+
id: ChainId.FraxtalMainnet;
|
|
110
|
+
nativeCurrency: {
|
|
111
|
+
name: string;
|
|
112
|
+
symbol: string;
|
|
113
|
+
decimals: number;
|
|
114
|
+
};
|
|
115
|
+
explorerUrl: string;
|
|
116
|
+
identifier: string;
|
|
117
|
+
};
|
|
118
|
+
534352: {
|
|
119
|
+
name: string;
|
|
120
|
+
id: ChainId.ScrollMainnet;
|
|
121
|
+
nativeCurrency: {
|
|
122
|
+
name: string;
|
|
123
|
+
symbol: string;
|
|
124
|
+
decimals: number;
|
|
125
|
+
};
|
|
126
|
+
explorerUrl: string;
|
|
127
|
+
identifier: string;
|
|
128
|
+
};
|
|
129
|
+
57073: {
|
|
130
|
+
name: string;
|
|
131
|
+
id: ChainId.InkMainnet;
|
|
132
|
+
nativeCurrency: {
|
|
133
|
+
name: string;
|
|
134
|
+
symbol: string;
|
|
135
|
+
decimals: number;
|
|
136
|
+
};
|
|
137
|
+
explorerUrl: string;
|
|
138
|
+
identifier: string;
|
|
139
|
+
};
|
|
140
|
+
130: {
|
|
141
|
+
name: string;
|
|
142
|
+
id: ChainId.Unichain;
|
|
143
|
+
nativeCurrency: {
|
|
144
|
+
name: string;
|
|
145
|
+
symbol: string;
|
|
146
|
+
decimals: number;
|
|
147
|
+
};
|
|
148
|
+
explorerUrl: string;
|
|
149
|
+
identifier: string;
|
|
150
|
+
};
|
|
151
|
+
146: {
|
|
152
|
+
name: string;
|
|
153
|
+
id: ChainId.SonicMainnet;
|
|
154
|
+
nativeCurrency: {
|
|
155
|
+
name: string;
|
|
156
|
+
symbol: string;
|
|
157
|
+
decimals: number;
|
|
158
|
+
};
|
|
159
|
+
explorerUrl: string;
|
|
160
|
+
identifier: string;
|
|
161
|
+
};
|
|
162
|
+
43111: {
|
|
163
|
+
name: string;
|
|
164
|
+
id: ChainId.HemiMainnet;
|
|
165
|
+
nativeCurrency: {
|
|
166
|
+
name: string;
|
|
167
|
+
symbol: string;
|
|
168
|
+
decimals: number;
|
|
169
|
+
};
|
|
170
|
+
explorerUrl: string;
|
|
171
|
+
identifier: string;
|
|
172
|
+
};
|
|
173
|
+
34443: {
|
|
174
|
+
name: string;
|
|
175
|
+
id: ChainId.ModeMainnet;
|
|
176
|
+
nativeCurrency: {
|
|
177
|
+
name: string;
|
|
178
|
+
symbol: string;
|
|
179
|
+
decimals: number;
|
|
180
|
+
};
|
|
181
|
+
explorerUrl: string;
|
|
182
|
+
identifier: string;
|
|
183
|
+
};
|
|
184
|
+
21000000: {
|
|
185
|
+
name: string;
|
|
186
|
+
id: ChainId.CornMainnet;
|
|
187
|
+
nativeCurrency: {
|
|
188
|
+
name: string;
|
|
189
|
+
symbol: string;
|
|
190
|
+
decimals: number;
|
|
191
|
+
};
|
|
192
|
+
explorerUrl: string;
|
|
193
|
+
identifier: string;
|
|
194
|
+
};
|
|
195
|
+
98866: {
|
|
196
|
+
name: string;
|
|
197
|
+
id: ChainId.PlumeMainnet;
|
|
198
|
+
nativeCurrency: {
|
|
199
|
+
name: string;
|
|
200
|
+
symbol: string;
|
|
201
|
+
decimals: number;
|
|
202
|
+
};
|
|
203
|
+
explorerUrl: string;
|
|
204
|
+
identifier: string;
|
|
205
|
+
};
|
|
206
|
+
123420001114: {
|
|
207
|
+
name: string;
|
|
208
|
+
id: ChainId.CampMainnet;
|
|
209
|
+
nativeCurrency: {
|
|
210
|
+
name: string;
|
|
211
|
+
symbol: string;
|
|
212
|
+
decimals: number;
|
|
213
|
+
};
|
|
214
|
+
explorerUrl: string;
|
|
215
|
+
identifier: string;
|
|
216
|
+
};
|
|
217
|
+
747474: {
|
|
218
|
+
name: string;
|
|
219
|
+
id: ChainId.KatanaMainnet;
|
|
220
|
+
nativeCurrency: {
|
|
221
|
+
name: string;
|
|
222
|
+
symbol: string;
|
|
223
|
+
decimals: number;
|
|
224
|
+
};
|
|
225
|
+
explorerUrl: string;
|
|
226
|
+
identifier: string;
|
|
227
|
+
};
|
|
228
|
+
42793: {
|
|
229
|
+
name: string;
|
|
230
|
+
id: ChainId.EtherlinkMainnet;
|
|
231
|
+
nativeCurrency: {
|
|
232
|
+
name: string;
|
|
233
|
+
symbol: string;
|
|
234
|
+
decimals: number;
|
|
235
|
+
};
|
|
236
|
+
explorerUrl: string;
|
|
237
|
+
identifier: string;
|
|
238
|
+
};
|
|
239
|
+
239: {
|
|
240
|
+
name: string;
|
|
241
|
+
id: ChainId.TacMainnet;
|
|
242
|
+
nativeCurrency: {
|
|
243
|
+
name: string;
|
|
244
|
+
symbol: string;
|
|
245
|
+
decimals: number;
|
|
246
|
+
};
|
|
247
|
+
explorerUrl: string;
|
|
248
|
+
identifier: string;
|
|
249
|
+
};
|
|
250
|
+
1135: {
|
|
251
|
+
name: string;
|
|
252
|
+
id: ChainId.LiskMainnet;
|
|
253
|
+
nativeCurrency: {
|
|
254
|
+
name: string;
|
|
255
|
+
symbol: string;
|
|
256
|
+
decimals: number;
|
|
257
|
+
};
|
|
258
|
+
explorerUrl: string;
|
|
259
|
+
identifier: string;
|
|
260
|
+
};
|
|
261
|
+
999: {
|
|
262
|
+
name: string;
|
|
263
|
+
id: ChainId.HyperliquidMainnet;
|
|
264
|
+
nativeCurrency: {
|
|
265
|
+
name: string;
|
|
266
|
+
symbol: string;
|
|
267
|
+
decimals: number;
|
|
268
|
+
};
|
|
269
|
+
explorerUrl: string;
|
|
270
|
+
identifier: string;
|
|
271
|
+
};
|
|
272
|
+
};
|
|
41
273
|
}
|
|
@@ -18,6 +18,6 @@ export declare class VaultToken extends WrappedToken implements IVaultToken {
|
|
|
18
18
|
*/
|
|
19
19
|
totalAssets: bigint;
|
|
20
20
|
constructor(config: IVaultConfig, { totalAssets, totalSupply }: IVaultToken);
|
|
21
|
-
protected _wrap(amount: bigint, rounding
|
|
22
|
-
protected _unwrap(amount: bigint, rounding
|
|
21
|
+
protected _wrap(amount: bigint, rounding: RoundingDirection): bigint;
|
|
22
|
+
protected _unwrap(amount: bigint, rounding: RoundingDirection): bigint;
|
|
23
23
|
}
|
package/lib/vault/Vault.js
CHANGED
|
@@ -95,10 +95,10 @@ class Vault extends index_js_3.VaultToken {
|
|
|
95
95
|
get totalInterest() {
|
|
96
96
|
return index_js_2.MathLib.zeroFloorSub(this.totalAssets, this.lastTotalAssets);
|
|
97
97
|
}
|
|
98
|
-
toAssets(shares, rounding) {
|
|
98
|
+
toAssets(shares, rounding = "Down") {
|
|
99
99
|
return this._unwrap(shares, rounding);
|
|
100
100
|
}
|
|
101
|
-
toShares(assets, rounding) {
|
|
101
|
+
toShares(assets, rounding = "Up") {
|
|
102
102
|
return this._wrap(assets, rounding);
|
|
103
103
|
}
|
|
104
104
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morpho-org/blue-sdk",
|
|
3
3
|
"description": "Framework-agnostic package that defines Morpho-related entity classes (such as `Market`, `Token`, `Vault`).",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.9.0",
|
|
5
5
|
"author": "Morpho Association <contact@morpho.org>",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Rubilmax <rmilon@gmail.com>"
|