@morpho-org/midnight-sdk 1.5.0 → 1.5.1-next.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/cjs/api/version.generated.d.ts +1 -1
- package/lib/cjs/api/version.generated.js +1 -1
- package/lib/cjs/market/Market.d.ts +6 -30
- package/lib/cjs/market/Market.js +6 -30
- package/lib/cjs/offers/OfferChainUtils.d.ts +6 -2
- package/lib/cjs/offers/OfferChainUtils.js +6 -2
- package/lib/cjs/position/Position.d.ts +5 -25
- package/lib/cjs/position/Position.js +5 -25
- package/lib/esm/api/version.generated.d.ts +1 -1
- package/lib/esm/api/version.generated.js +1 -1
- package/lib/esm/market/Market.d.ts +6 -30
- package/lib/esm/market/Market.js +6 -30
- package/lib/esm/offers/OfferChainUtils.d.ts +6 -2
- package/lib/esm/offers/OfferChainUtils.js +6 -2
- package/lib/esm/position/Position.d.ts +5 -25
- package/lib/esm/position/Position.js +5 -25
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** @internal Installed Midnight SDK package version. */
|
|
2
|
-
export declare const MIDNIGHT_SDK_VERSION = "1.5.0";
|
|
2
|
+
export declare const MIDNIGHT_SDK_VERSION = "1.5.1-next.0";
|
|
@@ -292,11 +292,7 @@ export type MarketInput = IMarketParams | IMarket;
|
|
|
292
292
|
* registerCustomAddresses({
|
|
293
293
|
* addresses: {
|
|
294
294
|
* 31337: {
|
|
295
|
-
*
|
|
296
|
-
* bundler3: {
|
|
297
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
298
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
299
|
-
* },
|
|
295
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
300
296
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
301
297
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
302
298
|
* },
|
|
@@ -412,11 +408,7 @@ export declare class Market {
|
|
|
412
408
|
* registerCustomAddresses({
|
|
413
409
|
* addresses: {
|
|
414
410
|
* 31337: {
|
|
415
|
-
*
|
|
416
|
-
* bundler3: {
|
|
417
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
418
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
419
|
-
* },
|
|
411
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
420
412
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
421
413
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
422
414
|
* },
|
|
@@ -467,11 +459,7 @@ export declare class Market {
|
|
|
467
459
|
* registerCustomAddresses({
|
|
468
460
|
* addresses: {
|
|
469
461
|
* 31337: {
|
|
470
|
-
*
|
|
471
|
-
* bundler3: {
|
|
472
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
473
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
474
|
-
* },
|
|
462
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
475
463
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
476
464
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
477
465
|
* },
|
|
@@ -522,11 +510,7 @@ export declare class Market {
|
|
|
522
510
|
* registerCustomAddresses({
|
|
523
511
|
* addresses: {
|
|
524
512
|
* 31337: {
|
|
525
|
-
*
|
|
526
|
-
* bundler3: {
|
|
527
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
528
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
529
|
-
* },
|
|
513
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
530
514
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
531
515
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
532
516
|
* },
|
|
@@ -577,11 +561,7 @@ export declare class Market {
|
|
|
577
561
|
* registerCustomAddresses({
|
|
578
562
|
* addresses: {
|
|
579
563
|
* 31337: {
|
|
580
|
-
*
|
|
581
|
-
* bundler3: {
|
|
582
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
583
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
584
|
-
* },
|
|
564
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
585
565
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
586
566
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
587
567
|
* },
|
|
@@ -633,11 +613,7 @@ export declare class Market {
|
|
|
633
613
|
* registerCustomAddresses({
|
|
634
614
|
* addresses: {
|
|
635
615
|
* 31337: {
|
|
636
|
-
*
|
|
637
|
-
* bundler3: {
|
|
638
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
639
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
640
|
-
* },
|
|
616
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
641
617
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
642
618
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
643
619
|
* },
|
package/lib/cjs/market/Market.js
CHANGED
|
@@ -191,11 +191,7 @@ exports.MarketParams = MarketParams;
|
|
|
191
191
|
* registerCustomAddresses({
|
|
192
192
|
* addresses: {
|
|
193
193
|
* 31337: {
|
|
194
|
-
*
|
|
195
|
-
* bundler3: {
|
|
196
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
197
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
198
|
-
* },
|
|
194
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
199
195
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
200
196
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
201
197
|
* },
|
|
@@ -324,11 +320,7 @@ class Market {
|
|
|
324
320
|
* registerCustomAddresses({
|
|
325
321
|
* addresses: {
|
|
326
322
|
* 31337: {
|
|
327
|
-
*
|
|
328
|
-
* bundler3: {
|
|
329
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
330
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
331
|
-
* },
|
|
323
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
332
324
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
333
325
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
334
326
|
* },
|
|
@@ -385,11 +377,7 @@ class Market {
|
|
|
385
377
|
* registerCustomAddresses({
|
|
386
378
|
* addresses: {
|
|
387
379
|
* 31337: {
|
|
388
|
-
*
|
|
389
|
-
* bundler3: {
|
|
390
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
391
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
392
|
-
* },
|
|
380
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
393
381
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
394
382
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
395
383
|
* },
|
|
@@ -445,11 +433,7 @@ class Market {
|
|
|
445
433
|
* registerCustomAddresses({
|
|
446
434
|
* addresses: {
|
|
447
435
|
* 31337: {
|
|
448
|
-
*
|
|
449
|
-
* bundler3: {
|
|
450
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
451
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
452
|
-
* },
|
|
436
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
453
437
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
454
438
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
455
439
|
* },
|
|
@@ -502,11 +486,7 @@ class Market {
|
|
|
502
486
|
* registerCustomAddresses({
|
|
503
487
|
* addresses: {
|
|
504
488
|
* 31337: {
|
|
505
|
-
*
|
|
506
|
-
* bundler3: {
|
|
507
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
508
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
509
|
-
* },
|
|
489
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
510
490
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
511
491
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
512
492
|
* },
|
|
@@ -562,11 +542,7 @@ class Market {
|
|
|
562
542
|
* registerCustomAddresses({
|
|
563
543
|
* addresses: {
|
|
564
544
|
* 31337: {
|
|
565
|
-
*
|
|
566
|
-
* bundler3: {
|
|
567
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
568
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
569
|
-
* },
|
|
545
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
570
546
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
571
547
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
572
548
|
* },
|
|
@@ -67,7 +67,8 @@ export declare namespace OfferChainUtils {
|
|
|
67
67
|
* Use before a make-borrow or supply-collateral-and-make-borrow flow when a
|
|
68
68
|
* borrower wants one displayed fixed borrow rate across a longer window. Map
|
|
69
69
|
* the returned legs to `Offer.create({ buy: false, ... })`, then group and
|
|
70
|
-
* submit them through the maker flow.
|
|
70
|
+
* submit them through the maker flow. Pass the same market tick spacing to
|
|
71
|
+
* `Offer.create` so leg validation uses the chain's grid.
|
|
71
72
|
*
|
|
72
73
|
* Borrow chains read their target rate at each leg's expiry edge. If a leg
|
|
73
74
|
* would need to extend past `chainEndTimestamp`, it is dropped rather than
|
|
@@ -97,6 +98,7 @@ export declare namespace OfferChainUtils {
|
|
|
97
98
|
* ...baseOffer,
|
|
98
99
|
* buy: false,
|
|
99
100
|
* tick: leg.tick,
|
|
101
|
+
* tickSpacing: market.tickSpacing,
|
|
100
102
|
* start: leg.startTimestamp,
|
|
101
103
|
* expiry: leg.expiryTimestamp,
|
|
102
104
|
* }),
|
|
@@ -110,7 +112,8 @@ export declare namespace OfferChainUtils {
|
|
|
110
112
|
* Use before a make-lend flow when a lender wants one displayed fixed lend
|
|
111
113
|
* rate across a longer window. Map the returned legs to
|
|
112
114
|
* `Offer.create({ buy: true, ... })`, then group and submit them through the
|
|
113
|
-
* maker flow.
|
|
115
|
+
* maker flow. Pass the same market tick spacing to `Offer.create` so leg
|
|
116
|
+
* validation uses the chain's grid.
|
|
114
117
|
*
|
|
115
118
|
* Lend chains read their target rate at each leg's start edge. The first leg
|
|
116
119
|
* may start before `chainStartTimestamp`; clamping that edge would move the
|
|
@@ -140,6 +143,7 @@ export declare namespace OfferChainUtils {
|
|
|
140
143
|
* ...baseOffer,
|
|
141
144
|
* buy: true,
|
|
142
145
|
* tick: leg.tick,
|
|
146
|
+
* tickSpacing: market.tickSpacing,
|
|
143
147
|
* start: leg.startTimestamp,
|
|
144
148
|
* expiry: leg.expiryTimestamp,
|
|
145
149
|
* }),
|
|
@@ -58,7 +58,8 @@ var OfferChainUtils;
|
|
|
58
58
|
* Use before a make-borrow or supply-collateral-and-make-borrow flow when a
|
|
59
59
|
* borrower wants one displayed fixed borrow rate across a longer window. Map
|
|
60
60
|
* the returned legs to `Offer.create({ buy: false, ... })`, then group and
|
|
61
|
-
* submit them through the maker flow.
|
|
61
|
+
* submit them through the maker flow. Pass the same market tick spacing to
|
|
62
|
+
* `Offer.create` so leg validation uses the chain's grid.
|
|
62
63
|
*
|
|
63
64
|
* Borrow chains read their target rate at each leg's expiry edge. If a leg
|
|
64
65
|
* would need to extend past `chainEndTimestamp`, it is dropped rather than
|
|
@@ -88,6 +89,7 @@ var OfferChainUtils;
|
|
|
88
89
|
* ...baseOffer,
|
|
89
90
|
* buy: false,
|
|
90
91
|
* tick: leg.tick,
|
|
92
|
+
* tickSpacing: market.tickSpacing,
|
|
91
93
|
* start: leg.startTimestamp,
|
|
92
94
|
* expiry: leg.expiryTimestamp,
|
|
93
95
|
* }),
|
|
@@ -204,7 +206,8 @@ var OfferChainUtils;
|
|
|
204
206
|
* Use before a make-lend flow when a lender wants one displayed fixed lend
|
|
205
207
|
* rate across a longer window. Map the returned legs to
|
|
206
208
|
* `Offer.create({ buy: true, ... })`, then group and submit them through the
|
|
207
|
-
* maker flow.
|
|
209
|
+
* maker flow. Pass the same market tick spacing to `Offer.create` so leg
|
|
210
|
+
* validation uses the chain's grid.
|
|
208
211
|
*
|
|
209
212
|
* Lend chains read their target rate at each leg's start edge. The first leg
|
|
210
213
|
* may start before `chainStartTimestamp`; clamping that edge would move the
|
|
@@ -234,6 +237,7 @@ var OfferChainUtils;
|
|
|
234
237
|
* ...baseOffer,
|
|
235
238
|
* buy: true,
|
|
236
239
|
* tick: leg.tick,
|
|
240
|
+
* tickSpacing: market.tickSpacing,
|
|
237
241
|
* start: leg.startTimestamp,
|
|
238
242
|
* expiry: leg.expiryTimestamp,
|
|
239
243
|
* }),
|
|
@@ -120,11 +120,7 @@ export interface IAccrualPosition extends Omit<IPosition, "marketId"> {
|
|
|
120
120
|
* registerCustomAddresses({
|
|
121
121
|
* addresses: {
|
|
122
122
|
* 31337: {
|
|
123
|
-
*
|
|
124
|
-
* bundler3: {
|
|
125
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
126
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
127
|
-
* },
|
|
123
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
128
124
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
129
125
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
130
126
|
* },
|
|
@@ -244,11 +240,7 @@ export declare class AccrualPosition extends Position implements IAccrualPositio
|
|
|
244
240
|
* registerCustomAddresses({
|
|
245
241
|
* addresses: {
|
|
246
242
|
* 31337: {
|
|
247
|
-
*
|
|
248
|
-
* bundler3: {
|
|
249
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
250
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
251
|
-
* },
|
|
243
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
252
244
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
253
245
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
254
246
|
* },
|
|
@@ -311,11 +303,7 @@ export declare class AccrualPosition extends Position implements IAccrualPositio
|
|
|
311
303
|
* registerCustomAddresses({
|
|
312
304
|
* addresses: {
|
|
313
305
|
* 31337: {
|
|
314
|
-
*
|
|
315
|
-
* bundler3: {
|
|
316
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
317
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
318
|
-
* },
|
|
306
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
319
307
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
320
308
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
321
309
|
* },
|
|
@@ -379,11 +367,7 @@ export declare class AccrualPosition extends Position implements IAccrualPositio
|
|
|
379
367
|
* registerCustomAddresses({
|
|
380
368
|
* addresses: {
|
|
381
369
|
* 31337: {
|
|
382
|
-
*
|
|
383
|
-
* bundler3: {
|
|
384
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
385
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
386
|
-
* },
|
|
370
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
387
371
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
388
372
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
389
373
|
* },
|
|
@@ -449,11 +433,7 @@ export declare class AccrualPosition extends Position implements IAccrualPositio
|
|
|
449
433
|
* registerCustomAddresses({
|
|
450
434
|
* addresses: {
|
|
451
435
|
* 31337: {
|
|
452
|
-
*
|
|
453
|
-
* bundler3: {
|
|
454
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
455
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
456
|
-
* },
|
|
436
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
457
437
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
458
438
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
459
439
|
* },
|
|
@@ -94,11 +94,7 @@ exports.Position = Position;
|
|
|
94
94
|
* registerCustomAddresses({
|
|
95
95
|
* addresses: {
|
|
96
96
|
* 31337: {
|
|
97
|
-
*
|
|
98
|
-
* bundler3: {
|
|
99
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
100
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
101
|
-
* },
|
|
97
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
102
98
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
103
99
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
104
100
|
* },
|
|
@@ -229,11 +225,7 @@ class AccrualPosition extends Position {
|
|
|
229
225
|
* registerCustomAddresses({
|
|
230
226
|
* addresses: {
|
|
231
227
|
* 31337: {
|
|
232
|
-
*
|
|
233
|
-
* bundler3: {
|
|
234
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
235
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
236
|
-
* },
|
|
228
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
237
229
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
238
230
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
239
231
|
* },
|
|
@@ -301,11 +293,7 @@ class AccrualPosition extends Position {
|
|
|
301
293
|
* registerCustomAddresses({
|
|
302
294
|
* addresses: {
|
|
303
295
|
* 31337: {
|
|
304
|
-
*
|
|
305
|
-
* bundler3: {
|
|
306
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
307
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
308
|
-
* },
|
|
296
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
309
297
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
310
298
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
311
299
|
* },
|
|
@@ -372,11 +360,7 @@ class AccrualPosition extends Position {
|
|
|
372
360
|
* registerCustomAddresses({
|
|
373
361
|
* addresses: {
|
|
374
362
|
* 31337: {
|
|
375
|
-
*
|
|
376
|
-
* bundler3: {
|
|
377
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
378
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
379
|
-
* },
|
|
363
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
380
364
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
381
365
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
382
366
|
* },
|
|
@@ -444,11 +428,7 @@ class AccrualPosition extends Position {
|
|
|
444
428
|
* registerCustomAddresses({
|
|
445
429
|
* addresses: {
|
|
446
430
|
* 31337: {
|
|
447
|
-
*
|
|
448
|
-
* bundler3: {
|
|
449
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
450
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
451
|
-
* },
|
|
431
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
452
432
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
453
433
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
454
434
|
* },
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** @internal Installed Midnight SDK package version. */
|
|
2
|
-
export declare const MIDNIGHT_SDK_VERSION = "1.5.0";
|
|
2
|
+
export declare const MIDNIGHT_SDK_VERSION = "1.5.1-next.0";
|
|
@@ -292,11 +292,7 @@ export type MarketInput = IMarketParams | IMarket;
|
|
|
292
292
|
* registerCustomAddresses({
|
|
293
293
|
* addresses: {
|
|
294
294
|
* 31337: {
|
|
295
|
-
*
|
|
296
|
-
* bundler3: {
|
|
297
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
298
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
299
|
-
* },
|
|
295
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
300
296
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
301
297
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
302
298
|
* },
|
|
@@ -412,11 +408,7 @@ export declare class Market {
|
|
|
412
408
|
* registerCustomAddresses({
|
|
413
409
|
* addresses: {
|
|
414
410
|
* 31337: {
|
|
415
|
-
*
|
|
416
|
-
* bundler3: {
|
|
417
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
418
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
419
|
-
* },
|
|
411
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
420
412
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
421
413
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
422
414
|
* },
|
|
@@ -467,11 +459,7 @@ export declare class Market {
|
|
|
467
459
|
* registerCustomAddresses({
|
|
468
460
|
* addresses: {
|
|
469
461
|
* 31337: {
|
|
470
|
-
*
|
|
471
|
-
* bundler3: {
|
|
472
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
473
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
474
|
-
* },
|
|
462
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
475
463
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
476
464
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
477
465
|
* },
|
|
@@ -522,11 +510,7 @@ export declare class Market {
|
|
|
522
510
|
* registerCustomAddresses({
|
|
523
511
|
* addresses: {
|
|
524
512
|
* 31337: {
|
|
525
|
-
*
|
|
526
|
-
* bundler3: {
|
|
527
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
528
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
529
|
-
* },
|
|
513
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
530
514
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
531
515
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
532
516
|
* },
|
|
@@ -577,11 +561,7 @@ export declare class Market {
|
|
|
577
561
|
* registerCustomAddresses({
|
|
578
562
|
* addresses: {
|
|
579
563
|
* 31337: {
|
|
580
|
-
*
|
|
581
|
-
* bundler3: {
|
|
582
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
583
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
584
|
-
* },
|
|
564
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
585
565
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
586
566
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
587
567
|
* },
|
|
@@ -633,11 +613,7 @@ export declare class Market {
|
|
|
633
613
|
* registerCustomAddresses({
|
|
634
614
|
* addresses: {
|
|
635
615
|
* 31337: {
|
|
636
|
-
*
|
|
637
|
-
* bundler3: {
|
|
638
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
639
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
640
|
-
* },
|
|
616
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
641
617
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
642
618
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
643
619
|
* },
|
package/lib/esm/market/Market.js
CHANGED
|
@@ -187,11 +187,7 @@ export class MarketParams {
|
|
|
187
187
|
* registerCustomAddresses({
|
|
188
188
|
* addresses: {
|
|
189
189
|
* 31337: {
|
|
190
|
-
*
|
|
191
|
-
* bundler3: {
|
|
192
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
193
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
194
|
-
* },
|
|
190
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
195
191
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
196
192
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
197
193
|
* },
|
|
@@ -320,11 +316,7 @@ export class Market {
|
|
|
320
316
|
* registerCustomAddresses({
|
|
321
317
|
* addresses: {
|
|
322
318
|
* 31337: {
|
|
323
|
-
*
|
|
324
|
-
* bundler3: {
|
|
325
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
326
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
327
|
-
* },
|
|
319
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
328
320
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
329
321
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
330
322
|
* },
|
|
@@ -381,11 +373,7 @@ export class Market {
|
|
|
381
373
|
* registerCustomAddresses({
|
|
382
374
|
* addresses: {
|
|
383
375
|
* 31337: {
|
|
384
|
-
*
|
|
385
|
-
* bundler3: {
|
|
386
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
387
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
388
|
-
* },
|
|
376
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
389
377
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
390
378
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
391
379
|
* },
|
|
@@ -441,11 +429,7 @@ export class Market {
|
|
|
441
429
|
* registerCustomAddresses({
|
|
442
430
|
* addresses: {
|
|
443
431
|
* 31337: {
|
|
444
|
-
*
|
|
445
|
-
* bundler3: {
|
|
446
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
447
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
448
|
-
* },
|
|
432
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
449
433
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
450
434
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
451
435
|
* },
|
|
@@ -498,11 +482,7 @@ export class Market {
|
|
|
498
482
|
* registerCustomAddresses({
|
|
499
483
|
* addresses: {
|
|
500
484
|
* 31337: {
|
|
501
|
-
*
|
|
502
|
-
* bundler3: {
|
|
503
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
504
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
505
|
-
* },
|
|
485
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
506
486
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
507
487
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
508
488
|
* },
|
|
@@ -558,11 +538,7 @@ export class Market {
|
|
|
558
538
|
* registerCustomAddresses({
|
|
559
539
|
* addresses: {
|
|
560
540
|
* 31337: {
|
|
561
|
-
*
|
|
562
|
-
* bundler3: {
|
|
563
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
564
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
565
|
-
* },
|
|
541
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
566
542
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
567
543
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
568
544
|
* },
|
|
@@ -67,7 +67,8 @@ export declare namespace OfferChainUtils {
|
|
|
67
67
|
* Use before a make-borrow or supply-collateral-and-make-borrow flow when a
|
|
68
68
|
* borrower wants one displayed fixed borrow rate across a longer window. Map
|
|
69
69
|
* the returned legs to `Offer.create({ buy: false, ... })`, then group and
|
|
70
|
-
* submit them through the maker flow.
|
|
70
|
+
* submit them through the maker flow. Pass the same market tick spacing to
|
|
71
|
+
* `Offer.create` so leg validation uses the chain's grid.
|
|
71
72
|
*
|
|
72
73
|
* Borrow chains read their target rate at each leg's expiry edge. If a leg
|
|
73
74
|
* would need to extend past `chainEndTimestamp`, it is dropped rather than
|
|
@@ -97,6 +98,7 @@ export declare namespace OfferChainUtils {
|
|
|
97
98
|
* ...baseOffer,
|
|
98
99
|
* buy: false,
|
|
99
100
|
* tick: leg.tick,
|
|
101
|
+
* tickSpacing: market.tickSpacing,
|
|
100
102
|
* start: leg.startTimestamp,
|
|
101
103
|
* expiry: leg.expiryTimestamp,
|
|
102
104
|
* }),
|
|
@@ -110,7 +112,8 @@ export declare namespace OfferChainUtils {
|
|
|
110
112
|
* Use before a make-lend flow when a lender wants one displayed fixed lend
|
|
111
113
|
* rate across a longer window. Map the returned legs to
|
|
112
114
|
* `Offer.create({ buy: true, ... })`, then group and submit them through the
|
|
113
|
-
* maker flow.
|
|
115
|
+
* maker flow. Pass the same market tick spacing to `Offer.create` so leg
|
|
116
|
+
* validation uses the chain's grid.
|
|
114
117
|
*
|
|
115
118
|
* Lend chains read their target rate at each leg's start edge. The first leg
|
|
116
119
|
* may start before `chainStartTimestamp`; clamping that edge would move the
|
|
@@ -140,6 +143,7 @@ export declare namespace OfferChainUtils {
|
|
|
140
143
|
* ...baseOffer,
|
|
141
144
|
* buy: true,
|
|
142
145
|
* tick: leg.tick,
|
|
146
|
+
* tickSpacing: market.tickSpacing,
|
|
143
147
|
* start: leg.startTimestamp,
|
|
144
148
|
* expiry: leg.expiryTimestamp,
|
|
145
149
|
* }),
|
|
@@ -55,7 +55,8 @@ export var OfferChainUtils;
|
|
|
55
55
|
* Use before a make-borrow or supply-collateral-and-make-borrow flow when a
|
|
56
56
|
* borrower wants one displayed fixed borrow rate across a longer window. Map
|
|
57
57
|
* the returned legs to `Offer.create({ buy: false, ... })`, then group and
|
|
58
|
-
* submit them through the maker flow.
|
|
58
|
+
* submit them through the maker flow. Pass the same market tick spacing to
|
|
59
|
+
* `Offer.create` so leg validation uses the chain's grid.
|
|
59
60
|
*
|
|
60
61
|
* Borrow chains read their target rate at each leg's expiry edge. If a leg
|
|
61
62
|
* would need to extend past `chainEndTimestamp`, it is dropped rather than
|
|
@@ -85,6 +86,7 @@ export var OfferChainUtils;
|
|
|
85
86
|
* ...baseOffer,
|
|
86
87
|
* buy: false,
|
|
87
88
|
* tick: leg.tick,
|
|
89
|
+
* tickSpacing: market.tickSpacing,
|
|
88
90
|
* start: leg.startTimestamp,
|
|
89
91
|
* expiry: leg.expiryTimestamp,
|
|
90
92
|
* }),
|
|
@@ -201,7 +203,8 @@ export var OfferChainUtils;
|
|
|
201
203
|
* Use before a make-lend flow when a lender wants one displayed fixed lend
|
|
202
204
|
* rate across a longer window. Map the returned legs to
|
|
203
205
|
* `Offer.create({ buy: true, ... })`, then group and submit them through the
|
|
204
|
-
* maker flow.
|
|
206
|
+
* maker flow. Pass the same market tick spacing to `Offer.create` so leg
|
|
207
|
+
* validation uses the chain's grid.
|
|
205
208
|
*
|
|
206
209
|
* Lend chains read their target rate at each leg's start edge. The first leg
|
|
207
210
|
* may start before `chainStartTimestamp`; clamping that edge would move the
|
|
@@ -231,6 +234,7 @@ export var OfferChainUtils;
|
|
|
231
234
|
* ...baseOffer,
|
|
232
235
|
* buy: true,
|
|
233
236
|
* tick: leg.tick,
|
|
237
|
+
* tickSpacing: market.tickSpacing,
|
|
234
238
|
* start: leg.startTimestamp,
|
|
235
239
|
* expiry: leg.expiryTimestamp,
|
|
236
240
|
* }),
|
|
@@ -120,11 +120,7 @@ export interface IAccrualPosition extends Omit<IPosition, "marketId"> {
|
|
|
120
120
|
* registerCustomAddresses({
|
|
121
121
|
* addresses: {
|
|
122
122
|
* 31337: {
|
|
123
|
-
*
|
|
124
|
-
* bundler3: {
|
|
125
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
126
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
127
|
-
* },
|
|
123
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
128
124
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
129
125
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
130
126
|
* },
|
|
@@ -244,11 +240,7 @@ export declare class AccrualPosition extends Position implements IAccrualPositio
|
|
|
244
240
|
* registerCustomAddresses({
|
|
245
241
|
* addresses: {
|
|
246
242
|
* 31337: {
|
|
247
|
-
*
|
|
248
|
-
* bundler3: {
|
|
249
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
250
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
251
|
-
* },
|
|
243
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
252
244
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
253
245
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
254
246
|
* },
|
|
@@ -311,11 +303,7 @@ export declare class AccrualPosition extends Position implements IAccrualPositio
|
|
|
311
303
|
* registerCustomAddresses({
|
|
312
304
|
* addresses: {
|
|
313
305
|
* 31337: {
|
|
314
|
-
*
|
|
315
|
-
* bundler3: {
|
|
316
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
317
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
318
|
-
* },
|
|
306
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
319
307
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
320
308
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
321
309
|
* },
|
|
@@ -379,11 +367,7 @@ export declare class AccrualPosition extends Position implements IAccrualPositio
|
|
|
379
367
|
* registerCustomAddresses({
|
|
380
368
|
* addresses: {
|
|
381
369
|
* 31337: {
|
|
382
|
-
*
|
|
383
|
-
* bundler3: {
|
|
384
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
385
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
386
|
-
* },
|
|
370
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
387
371
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
388
372
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
389
373
|
* },
|
|
@@ -449,11 +433,7 @@ export declare class AccrualPosition extends Position implements IAccrualPositio
|
|
|
449
433
|
* registerCustomAddresses({
|
|
450
434
|
* addresses: {
|
|
451
435
|
* 31337: {
|
|
452
|
-
*
|
|
453
|
-
* bundler3: {
|
|
454
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
455
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
456
|
-
* },
|
|
436
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
457
437
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
458
438
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
459
439
|
* },
|
|
@@ -90,11 +90,7 @@ export class Position {
|
|
|
90
90
|
* registerCustomAddresses({
|
|
91
91
|
* addresses: {
|
|
92
92
|
* 31337: {
|
|
93
|
-
*
|
|
94
|
-
* bundler3: {
|
|
95
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
96
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
97
|
-
* },
|
|
93
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
98
94
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
99
95
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
100
96
|
* },
|
|
@@ -225,11 +221,7 @@ export class AccrualPosition extends Position {
|
|
|
225
221
|
* registerCustomAddresses({
|
|
226
222
|
* addresses: {
|
|
227
223
|
* 31337: {
|
|
228
|
-
*
|
|
229
|
-
* bundler3: {
|
|
230
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
231
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
232
|
-
* },
|
|
224
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
233
225
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
234
226
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
235
227
|
* },
|
|
@@ -297,11 +289,7 @@ export class AccrualPosition extends Position {
|
|
|
297
289
|
* registerCustomAddresses({
|
|
298
290
|
* addresses: {
|
|
299
291
|
* 31337: {
|
|
300
|
-
*
|
|
301
|
-
* bundler3: {
|
|
302
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
303
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
304
|
-
* },
|
|
292
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
305
293
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
306
294
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
307
295
|
* },
|
|
@@ -368,11 +356,7 @@ export class AccrualPosition extends Position {
|
|
|
368
356
|
* registerCustomAddresses({
|
|
369
357
|
* addresses: {
|
|
370
358
|
* 31337: {
|
|
371
|
-
*
|
|
372
|
-
* bundler3: {
|
|
373
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
374
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
375
|
-
* },
|
|
359
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
376
360
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
377
361
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
378
362
|
* },
|
|
@@ -440,11 +424,7 @@ export class AccrualPosition extends Position {
|
|
|
440
424
|
* registerCustomAddresses({
|
|
441
425
|
* addresses: {
|
|
442
426
|
* 31337: {
|
|
443
|
-
*
|
|
444
|
-
* bundler3: {
|
|
445
|
-
* bundler3: "0x0000000000000000000000000000000000000002",
|
|
446
|
-
* generalAdapter1: "0x0000000000000000000000000000000000000003",
|
|
447
|
-
* },
|
|
427
|
+
* blue: "0x0000000000000000000000000000000000000001",
|
|
448
428
|
* adaptiveCurveIrm: "0x0000000000000000000000000000000000000004",
|
|
449
429
|
* midnight: "0x0000000000000000000000000000000000001000",
|
|
450
430
|
* },
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morpho-org/midnight-sdk",
|
|
3
3
|
"description": "Viem-based package for Morpho Midnight that exports protocol utilities, fetch helpers, and Midnight API utilities under a dedicated API subpath.",
|
|
4
|
-
"version": "1.5.0",
|
|
4
|
+
"version": "1.5.1-next.0",
|
|
5
5
|
"author": "Morpho Association <contact@morpho.org>",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Rubilmax <rmilon@gmail.com>"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"lib"
|
|
44
44
|
],
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@morpho-org/morpho-ts": "^2.8.0",
|
|
46
|
+
"@morpho-org/morpho-ts": "^2.8.0 || ^3.0.0",
|
|
47
47
|
"viem": "^2.0.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"typescript": "7.0.2",
|
|
52
52
|
"viem": "^2.55.10",
|
|
53
53
|
"vitest": "^4.1.10",
|
|
54
|
-
"@morpho-org/morpho-ts": "^
|
|
54
|
+
"@morpho-org/morpho-ts": "^3.0.0-next.0",
|
|
55
55
|
"@morpho-org/test": "^2.10.0"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|