@morpho-dev/router 0.0.13 → 0.0.14

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.
@@ -0,0 +1,10 @@
1
+ CREATE TABLE "consumed_per_user_and_nonce" (
2
+ "id" serial PRIMARY KEY NOT NULL,
3
+ "chain_id" bigint NOT NULL,
4
+ "offering" varchar(42) NOT NULL,
5
+ "nonce" bigint NOT NULL,
6
+ "consumed" bigint NOT NULL,
7
+ "created_at" timestamp DEFAULT now() NOT NULL
8
+ );
9
+ --> statement-breakpoint
10
+ CREATE INDEX "consumed_per_user_and_nonce_chain_id_offering_nonce_created_at_idx" ON "consumed_per_user_and_nonce" USING btree ("chain_id","offering","nonce","created_at" desc);
@@ -0,0 +1,635 @@
1
+ {
2
+ "id": "4fddb7ea-8963-44a8-bff8-b1c6534d1ba1",
3
+ "prevId": "8add77c9-a05e-4f44-8cdd-3a1ef70bce84",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.consumed_per_user_and_nonce": {
8
+ "name": "consumed_per_user_and_nonce",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "serial",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "chain_id": {
18
+ "name": "chain_id",
19
+ "type": "bigint",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "offering": {
24
+ "name": "offering",
25
+ "type": "varchar(42)",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "nonce": {
30
+ "name": "nonce",
31
+ "type": "bigint",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "consumed": {
36
+ "name": "consumed",
37
+ "type": "bigint",
38
+ "primaryKey": false,
39
+ "notNull": true
40
+ },
41
+ "created_at": {
42
+ "name": "created_at",
43
+ "type": "timestamp",
44
+ "primaryKey": false,
45
+ "notNull": true,
46
+ "default": "now()"
47
+ }
48
+ },
49
+ "indexes": {
50
+ "consumed_per_user_and_nonce_chain_id_offering_nonce_created_at_idx": {
51
+ "name": "consumed_per_user_and_nonce_chain_id_offering_nonce_created_at_idx",
52
+ "columns": [
53
+ {
54
+ "expression": "chain_id",
55
+ "isExpression": false,
56
+ "asc": true,
57
+ "nulls": "last"
58
+ },
59
+ {
60
+ "expression": "offering",
61
+ "isExpression": false,
62
+ "asc": true,
63
+ "nulls": "last"
64
+ },
65
+ {
66
+ "expression": "nonce",
67
+ "isExpression": false,
68
+ "asc": true,
69
+ "nulls": "last"
70
+ },
71
+ {
72
+ "expression": "\"created_at\" desc",
73
+ "asc": true,
74
+ "isExpression": true,
75
+ "nulls": "last"
76
+ }
77
+ ],
78
+ "isUnique": false,
79
+ "concurrently": false,
80
+ "method": "btree",
81
+ "with": {}
82
+ }
83
+ },
84
+ "foreignKeys": {},
85
+ "compositePrimaryKeys": {},
86
+ "uniqueConstraints": {},
87
+ "policies": {},
88
+ "checkConstraints": {},
89
+ "isRLSEnabled": false
90
+ },
91
+ "public.offer_collaterals": {
92
+ "name": "offer_collaterals",
93
+ "schema": "",
94
+ "columns": {
95
+ "id": {
96
+ "name": "id",
97
+ "type": "serial",
98
+ "primaryKey": true,
99
+ "notNull": true
100
+ },
101
+ "offer_hash": {
102
+ "name": "offer_hash",
103
+ "type": "varchar(66)",
104
+ "primaryKey": false,
105
+ "notNull": true
106
+ },
107
+ "asset": {
108
+ "name": "asset",
109
+ "type": "varchar(42)",
110
+ "primaryKey": false,
111
+ "notNull": true
112
+ },
113
+ "oracle": {
114
+ "name": "oracle",
115
+ "type": "varchar(42)",
116
+ "primaryKey": false,
117
+ "notNull": true
118
+ },
119
+ "lltv": {
120
+ "name": "lltv",
121
+ "type": "bigint",
122
+ "primaryKey": false,
123
+ "notNull": true
124
+ }
125
+ },
126
+ "indexes": {
127
+ "offer_collaterals_offer_hash_idx": {
128
+ "name": "offer_collaterals_offer_hash_idx",
129
+ "columns": [
130
+ {
131
+ "expression": "offer_hash",
132
+ "isExpression": false,
133
+ "asc": true,
134
+ "nulls": "last"
135
+ }
136
+ ],
137
+ "isUnique": false,
138
+ "concurrently": false,
139
+ "method": "btree",
140
+ "with": {}
141
+ },
142
+ "offer_collaterals_asset_idx": {
143
+ "name": "offer_collaterals_asset_idx",
144
+ "columns": [
145
+ {
146
+ "expression": "asset",
147
+ "isExpression": false,
148
+ "asc": true,
149
+ "nulls": "last"
150
+ }
151
+ ],
152
+ "isUnique": false,
153
+ "concurrently": false,
154
+ "method": "btree",
155
+ "with": {}
156
+ },
157
+ "offer_collaterals_oracle_idx": {
158
+ "name": "offer_collaterals_oracle_idx",
159
+ "columns": [
160
+ {
161
+ "expression": "oracle",
162
+ "isExpression": false,
163
+ "asc": true,
164
+ "nulls": "last"
165
+ }
166
+ ],
167
+ "isUnique": false,
168
+ "concurrently": false,
169
+ "method": "btree",
170
+ "with": {}
171
+ },
172
+ "offer_collaterals_tuple_idx": {
173
+ "name": "offer_collaterals_tuple_idx",
174
+ "columns": [
175
+ {
176
+ "expression": "asset",
177
+ "isExpression": false,
178
+ "asc": true,
179
+ "nulls": "last"
180
+ },
181
+ {
182
+ "expression": "oracle",
183
+ "isExpression": false,
184
+ "asc": true,
185
+ "nulls": "last"
186
+ },
187
+ {
188
+ "expression": "lltv",
189
+ "isExpression": false,
190
+ "asc": true,
191
+ "nulls": "last"
192
+ }
193
+ ],
194
+ "isUnique": false,
195
+ "concurrently": false,
196
+ "method": "btree",
197
+ "with": {}
198
+ }
199
+ },
200
+ "foreignKeys": {
201
+ "offer_collaterals_offer_hash_offers_hash_fk": {
202
+ "name": "offer_collaterals_offer_hash_offers_hash_fk",
203
+ "tableFrom": "offer_collaterals",
204
+ "tableTo": "offers",
205
+ "columnsFrom": ["offer_hash"],
206
+ "columnsTo": ["hash"],
207
+ "onDelete": "cascade",
208
+ "onUpdate": "no action"
209
+ }
210
+ },
211
+ "compositePrimaryKeys": {},
212
+ "uniqueConstraints": {},
213
+ "policies": {},
214
+ "checkConstraints": {},
215
+ "isRLSEnabled": false
216
+ },
217
+ "public.offer_status": {
218
+ "name": "offer_status",
219
+ "schema": "",
220
+ "columns": {
221
+ "id": {
222
+ "name": "id",
223
+ "type": "serial",
224
+ "primaryKey": true,
225
+ "notNull": true
226
+ },
227
+ "offer_hash": {
228
+ "name": "offer_hash",
229
+ "type": "varchar(66)",
230
+ "primaryKey": false,
231
+ "notNull": true
232
+ },
233
+ "status": {
234
+ "name": "status",
235
+ "type": "text",
236
+ "primaryKey": false,
237
+ "notNull": true
238
+ },
239
+ "metadata": {
240
+ "name": "metadata",
241
+ "type": "jsonb",
242
+ "primaryKey": false,
243
+ "notNull": false
244
+ },
245
+ "created_at": {
246
+ "name": "created_at",
247
+ "type": "timestamp",
248
+ "primaryKey": false,
249
+ "notNull": true,
250
+ "default": "now()"
251
+ }
252
+ },
253
+ "indexes": {
254
+ "offer_status_offer_hash_created_at_idx": {
255
+ "name": "offer_status_offer_hash_created_at_idx",
256
+ "columns": [
257
+ {
258
+ "expression": "offer_hash",
259
+ "isExpression": false,
260
+ "asc": true,
261
+ "nulls": "last"
262
+ },
263
+ {
264
+ "expression": "\"created_at\" desc",
265
+ "asc": true,
266
+ "isExpression": true,
267
+ "nulls": "last"
268
+ }
269
+ ],
270
+ "isUnique": false,
271
+ "concurrently": false,
272
+ "method": "btree",
273
+ "with": {}
274
+ },
275
+ "offer_status_status_idx": {
276
+ "name": "offer_status_status_idx",
277
+ "columns": [
278
+ {
279
+ "expression": "status",
280
+ "isExpression": false,
281
+ "asc": true,
282
+ "nulls": "last"
283
+ }
284
+ ],
285
+ "isUnique": false,
286
+ "concurrently": false,
287
+ "method": "btree",
288
+ "with": {}
289
+ }
290
+ },
291
+ "foreignKeys": {
292
+ "offer_status_offer_hash_offers_hash_fk": {
293
+ "name": "offer_status_offer_hash_offers_hash_fk",
294
+ "tableFrom": "offer_status",
295
+ "tableTo": "offers",
296
+ "columnsFrom": ["offer_hash"],
297
+ "columnsTo": ["hash"],
298
+ "onDelete": "cascade",
299
+ "onUpdate": "no action"
300
+ }
301
+ },
302
+ "compositePrimaryKeys": {},
303
+ "uniqueConstraints": {},
304
+ "policies": {},
305
+ "checkConstraints": {},
306
+ "isRLSEnabled": false
307
+ },
308
+ "public.offers": {
309
+ "name": "offers",
310
+ "schema": "",
311
+ "columns": {
312
+ "hash": {
313
+ "name": "hash",
314
+ "type": "varchar(66)",
315
+ "primaryKey": true,
316
+ "notNull": true
317
+ },
318
+ "offering": {
319
+ "name": "offering",
320
+ "type": "varchar(42)",
321
+ "primaryKey": false,
322
+ "notNull": true
323
+ },
324
+ "assets": {
325
+ "name": "assets",
326
+ "type": "bigint",
327
+ "primaryKey": false,
328
+ "notNull": true
329
+ },
330
+ "rate": {
331
+ "name": "rate",
332
+ "type": "bigint",
333
+ "primaryKey": false,
334
+ "notNull": true
335
+ },
336
+ "maturity": {
337
+ "name": "maturity",
338
+ "type": "integer",
339
+ "primaryKey": false,
340
+ "notNull": true
341
+ },
342
+ "expiry": {
343
+ "name": "expiry",
344
+ "type": "integer",
345
+ "primaryKey": false,
346
+ "notNull": true
347
+ },
348
+ "start": {
349
+ "name": "start",
350
+ "type": "integer",
351
+ "primaryKey": false,
352
+ "notNull": true
353
+ },
354
+ "nonce": {
355
+ "name": "nonce",
356
+ "type": "bigint",
357
+ "primaryKey": false,
358
+ "notNull": true
359
+ },
360
+ "buy": {
361
+ "name": "buy",
362
+ "type": "boolean",
363
+ "primaryKey": false,
364
+ "notNull": true
365
+ },
366
+ "chain_id": {
367
+ "name": "chain_id",
368
+ "type": "bigint",
369
+ "primaryKey": false,
370
+ "notNull": true
371
+ },
372
+ "loan_token": {
373
+ "name": "loan_token",
374
+ "type": "varchar(42)",
375
+ "primaryKey": false,
376
+ "notNull": true
377
+ },
378
+ "callback_address": {
379
+ "name": "callback_address",
380
+ "type": "varchar(42)",
381
+ "primaryKey": false,
382
+ "notNull": true
383
+ },
384
+ "callback_data": {
385
+ "name": "callback_data",
386
+ "type": "text",
387
+ "primaryKey": false,
388
+ "notNull": true
389
+ },
390
+ "callback_gas_limit": {
391
+ "name": "callback_gas_limit",
392
+ "type": "bigint",
393
+ "primaryKey": false,
394
+ "notNull": true
395
+ },
396
+ "signature": {
397
+ "name": "signature",
398
+ "type": "varchar(132)",
399
+ "primaryKey": false,
400
+ "notNull": false
401
+ },
402
+ "created_at": {
403
+ "name": "created_at",
404
+ "type": "timestamp",
405
+ "primaryKey": false,
406
+ "notNull": true,
407
+ "default": "now()"
408
+ }
409
+ },
410
+ "indexes": {
411
+ "offers_offering_idx": {
412
+ "name": "offers_offering_idx",
413
+ "columns": [
414
+ {
415
+ "expression": "offering",
416
+ "isExpression": false,
417
+ "asc": true,
418
+ "nulls": "last"
419
+ }
420
+ ],
421
+ "isUnique": false,
422
+ "concurrently": false,
423
+ "method": "btree",
424
+ "with": {}
425
+ },
426
+ "offers_buy_idx": {
427
+ "name": "offers_buy_idx",
428
+ "columns": [
429
+ {
430
+ "expression": "buy",
431
+ "isExpression": false,
432
+ "asc": true,
433
+ "nulls": "last"
434
+ }
435
+ ],
436
+ "isUnique": false,
437
+ "concurrently": false,
438
+ "method": "btree",
439
+ "with": {}
440
+ },
441
+ "offers_chain_id_idx": {
442
+ "name": "offers_chain_id_idx",
443
+ "columns": [
444
+ {
445
+ "expression": "chain_id",
446
+ "isExpression": false,
447
+ "asc": true,
448
+ "nulls": "last"
449
+ }
450
+ ],
451
+ "isUnique": false,
452
+ "concurrently": false,
453
+ "method": "btree",
454
+ "with": {}
455
+ },
456
+ "offers_loan_token_idx": {
457
+ "name": "offers_loan_token_idx",
458
+ "columns": [
459
+ {
460
+ "expression": "loan_token",
461
+ "isExpression": false,
462
+ "asc": true,
463
+ "nulls": "last"
464
+ }
465
+ ],
466
+ "isUnique": false,
467
+ "concurrently": false,
468
+ "method": "btree",
469
+ "with": {}
470
+ },
471
+ "offers_maturity_idx": {
472
+ "name": "offers_maturity_idx",
473
+ "columns": [
474
+ {
475
+ "expression": "maturity",
476
+ "isExpression": false,
477
+ "asc": true,
478
+ "nulls": "last"
479
+ }
480
+ ],
481
+ "isUnique": false,
482
+ "concurrently": false,
483
+ "method": "btree",
484
+ "with": {}
485
+ },
486
+ "offers_expiry_idx": {
487
+ "name": "offers_expiry_idx",
488
+ "columns": [
489
+ {
490
+ "expression": "expiry",
491
+ "isExpression": false,
492
+ "asc": true,
493
+ "nulls": "last"
494
+ }
495
+ ],
496
+ "isUnique": false,
497
+ "concurrently": false,
498
+ "method": "btree",
499
+ "with": {}
500
+ },
501
+ "offers_rate_idx": {
502
+ "name": "offers_rate_idx",
503
+ "columns": [
504
+ {
505
+ "expression": "rate",
506
+ "isExpression": false,
507
+ "asc": true,
508
+ "nulls": "last"
509
+ }
510
+ ],
511
+ "isUnique": false,
512
+ "concurrently": false,
513
+ "method": "btree",
514
+ "with": {}
515
+ },
516
+ "offers_assets_idx": {
517
+ "name": "offers_assets_idx",
518
+ "columns": [
519
+ {
520
+ "expression": "assets",
521
+ "isExpression": false,
522
+ "asc": true,
523
+ "nulls": "last"
524
+ }
525
+ ],
526
+ "isUnique": false,
527
+ "concurrently": false,
528
+ "method": "btree",
529
+ "with": {}
530
+ },
531
+ "offers_rate_hash_idx": {
532
+ "name": "offers_rate_hash_idx",
533
+ "columns": [
534
+ {
535
+ "expression": "rate",
536
+ "isExpression": false,
537
+ "asc": true,
538
+ "nulls": "last"
539
+ },
540
+ {
541
+ "expression": "hash",
542
+ "isExpression": false,
543
+ "asc": true,
544
+ "nulls": "last"
545
+ }
546
+ ],
547
+ "isUnique": false,
548
+ "concurrently": false,
549
+ "method": "btree",
550
+ "with": {}
551
+ },
552
+ "offers_maturity_hash_idx": {
553
+ "name": "offers_maturity_hash_idx",
554
+ "columns": [
555
+ {
556
+ "expression": "maturity",
557
+ "isExpression": false,
558
+ "asc": true,
559
+ "nulls": "last"
560
+ },
561
+ {
562
+ "expression": "hash",
563
+ "isExpression": false,
564
+ "asc": true,
565
+ "nulls": "last"
566
+ }
567
+ ],
568
+ "isUnique": false,
569
+ "concurrently": false,
570
+ "method": "btree",
571
+ "with": {}
572
+ },
573
+ "offers_expiry_hash_idx": {
574
+ "name": "offers_expiry_hash_idx",
575
+ "columns": [
576
+ {
577
+ "expression": "expiry",
578
+ "isExpression": false,
579
+ "asc": true,
580
+ "nulls": "last"
581
+ },
582
+ {
583
+ "expression": "hash",
584
+ "isExpression": false,
585
+ "asc": true,
586
+ "nulls": "last"
587
+ }
588
+ ],
589
+ "isUnique": false,
590
+ "concurrently": false,
591
+ "method": "btree",
592
+ "with": {}
593
+ },
594
+ "offers_assets_hash_idx": {
595
+ "name": "offers_assets_hash_idx",
596
+ "columns": [
597
+ {
598
+ "expression": "assets",
599
+ "isExpression": false,
600
+ "asc": true,
601
+ "nulls": "last"
602
+ },
603
+ {
604
+ "expression": "hash",
605
+ "isExpression": false,
606
+ "asc": true,
607
+ "nulls": "last"
608
+ }
609
+ ],
610
+ "isUnique": false,
611
+ "concurrently": false,
612
+ "method": "btree",
613
+ "with": {}
614
+ }
615
+ },
616
+ "foreignKeys": {},
617
+ "compositePrimaryKeys": {},
618
+ "uniqueConstraints": {},
619
+ "policies": {},
620
+ "checkConstraints": {},
621
+ "isRLSEnabled": false
622
+ }
623
+ },
624
+ "enums": {},
625
+ "schemas": {},
626
+ "sequences": {},
627
+ "roles": {},
628
+ "policies": {},
629
+ "views": {},
630
+ "_meta": {
631
+ "columns": {},
632
+ "schemas": {},
633
+ "tables": {}
634
+ }
635
+ }
@@ -57,6 +57,13 @@
57
57
  "when": 1753357382942,
58
58
  "tag": "0007_rename-offering",
59
59
  "breakpoints": true
60
+ },
61
+ {
62
+ "idx": 8,
63
+ "version": "7",
64
+ "when": 1753972618101,
65
+ "tag": "0008_add-consumed-relation",
66
+ "breakpoints": true
60
67
  }
61
68
  ]
62
- }
69
+ }