@hyperbridge/sdk 2.7.2 → 2.8.2

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.
@@ -1,1511 +1,8 @@
1
- import { z as PackedUserOperation } from './IntentGatewayV2-MxUcNZNs.cjs';
2
- export { bo as IntentGatewayV2, b9 as decodeERC7821ExecuteBatch, ba as decodeUserOpScale, bb as encodeERC7821ExecuteBatch, bd as encodeUserOpScale } from './IntentGatewayV2-MxUcNZNs.cjs';
3
- import '@polkadot/api';
4
- import '@polkadot/keyring/types';
1
+ export { br as AggregationLogger, bs as BidNonceKeyFn, bt as BidSignature, bu as ENTRY_POINT_V08_ADDRESS, bv as FILL_ORDER_ABI, bw as FetchLike, bx as FillData, by as HexString, bz as IntentGatewayV2, bA as LpBalance, bB as OrderCommitmentFn, bC as PhantomAggregation, bD as PhantomLegAggregation, bE as PhantomLegBidder, bF as RecoverBidSigner, bG as RpcBidInfo, bH as SolverBalanceReader, bI as YieldVaultMap, bJ as aggregatePhantomBids, ba as decodeAcceptedSourceChains, bb as decodeERC7821ExecuteBatch, bc as decodeUserOpScale, bd as encodeAcceptedSourceChains, be as encodeERC7821ExecuteBatch, bg as encodeUserOpScale, bK as extractFillData, bL as fetchBidsForOrder, bM as memoizedSolverBalance, bN as orderCommitmentFromDecoded, bO as recoverBidSignerViem, bP as setAggregationFetch, bQ as splitBidSignature, bR as weightedMedian, bS as zipFillLegs } from './intents-helpers-D_km9I2f.cjs';
5
2
  import 'consola';
6
3
  import 'decimal.js';
7
4
  import 'graphql-request';
8
5
  import 'viem';
9
6
  import 'viem/chains';
10
-
11
- type HexString = `0x${string}`;
12
- /**
13
- * ERC-4337 v0.8 EntryPoint, the contract whose userOpHash a bid's solver signature is taken over.
14
- * Canonical across every EVM chain we support, which is why it is a constant here rather than
15
- * something callers pass in (chain.ts carries the same address per chain as `EntryPointV08`).
16
- */
17
- declare const ENTRY_POINT_V08_ADDRESS: "0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108";
18
- /** Minimal fetch shape used by the JSON-RPC POSTs below. */
19
- type FetchLike = (url: string, init: any) => Promise<{
20
- json(): Promise<any>;
21
- }>;
22
- declare function setAggregationFetch(fetchImpl: FetchLike): void;
23
- declare const FILL_ORDER_ABI: readonly [{
24
- readonly type: "constructor";
25
- readonly inputs: readonly [{
26
- readonly name: "admin";
27
- readonly type: "address";
28
- readonly internalType: "address";
29
- }];
30
- readonly stateMutability: "nonpayable";
31
- }, {
32
- readonly type: "receive";
33
- readonly stateMutability: "payable";
34
- }, {
35
- readonly type: "function";
36
- readonly name: "DOMAIN_SEPARATOR";
37
- readonly inputs: readonly [];
38
- readonly outputs: readonly [{
39
- readonly name: "";
40
- readonly type: "bytes32";
41
- readonly internalType: "bytes32";
42
- }];
43
- readonly stateMutability: "view";
44
- }, {
45
- readonly type: "function";
46
- readonly name: "SELECT_SOLVER_TYPEHASH";
47
- readonly inputs: readonly [];
48
- readonly outputs: readonly [{
49
- readonly name: "";
50
- readonly type: "bytes32";
51
- readonly internalType: "bytes32";
52
- }];
53
- readonly stateMutability: "view";
54
- }, {
55
- readonly type: "function";
56
- readonly name: "_destinationProtocolFees";
57
- readonly inputs: readonly [{
58
- readonly name: "";
59
- readonly type: "bytes32";
60
- readonly internalType: "bytes32";
61
- }];
62
- readonly outputs: readonly [{
63
- readonly name: "";
64
- readonly type: "uint256";
65
- readonly internalType: "uint256";
66
- }];
67
- readonly stateMutability: "view";
68
- }, {
69
- readonly type: "function";
70
- readonly name: "_filled";
71
- readonly inputs: readonly [{
72
- readonly name: "";
73
- readonly type: "bytes32";
74
- readonly internalType: "bytes32";
75
- }];
76
- readonly outputs: readonly [{
77
- readonly name: "";
78
- readonly type: "address";
79
- readonly internalType: "address";
80
- }];
81
- readonly stateMutability: "view";
82
- }, {
83
- readonly type: "function";
84
- readonly name: "_instances";
85
- readonly inputs: readonly [{
86
- readonly name: "";
87
- readonly type: "bytes32";
88
- readonly internalType: "bytes32";
89
- }];
90
- readonly outputs: readonly [{
91
- readonly name: "";
92
- readonly type: "address";
93
- readonly internalType: "address";
94
- }];
95
- readonly stateMutability: "view";
96
- }, {
97
- readonly type: "function";
98
- readonly name: "_nonce";
99
- readonly inputs: readonly [];
100
- readonly outputs: readonly [{
101
- readonly name: "";
102
- readonly type: "uint256";
103
- readonly internalType: "uint256";
104
- }];
105
- readonly stateMutability: "view";
106
- }, {
107
- readonly type: "function";
108
- readonly name: "_orders";
109
- readonly inputs: readonly [{
110
- readonly name: "";
111
- readonly type: "bytes32";
112
- readonly internalType: "bytes32";
113
- }, {
114
- readonly name: "";
115
- readonly type: "address";
116
- readonly internalType: "address";
117
- }];
118
- readonly outputs: readonly [{
119
- readonly name: "";
120
- readonly type: "uint256";
121
- readonly internalType: "uint256";
122
- }];
123
- readonly stateMutability: "view";
124
- }, {
125
- readonly type: "function";
126
- readonly name: "_partialFills";
127
- readonly inputs: readonly [{
128
- readonly name: "";
129
- readonly type: "bytes32";
130
- readonly internalType: "bytes32";
131
- }, {
132
- readonly name: "";
133
- readonly type: "bytes32";
134
- readonly internalType: "bytes32";
135
- }];
136
- readonly outputs: readonly [{
137
- readonly name: "";
138
- readonly type: "uint256";
139
- readonly internalType: "uint256";
140
- }];
141
- readonly stateMutability: "view";
142
- }, {
143
- readonly type: "function";
144
- readonly name: "calculateCommitmentSlotHash";
145
- readonly inputs: readonly [{
146
- readonly name: "commitment";
147
- readonly type: "bytes32";
148
- readonly internalType: "bytes32";
149
- }];
150
- readonly outputs: readonly [{
151
- readonly name: "";
152
- readonly type: "bytes";
153
- readonly internalType: "bytes";
154
- }];
155
- readonly stateMutability: "pure";
156
- }, {
157
- readonly type: "function";
158
- readonly name: "cancelOrder";
159
- readonly inputs: readonly [{
160
- readonly name: "order";
161
- readonly type: "tuple";
162
- readonly internalType: "struct Order";
163
- readonly components: readonly [{
164
- readonly name: "user";
165
- readonly type: "bytes32";
166
- readonly internalType: "bytes32";
167
- }, {
168
- readonly name: "source";
169
- readonly type: "bytes";
170
- readonly internalType: "bytes";
171
- }, {
172
- readonly name: "destination";
173
- readonly type: "bytes";
174
- readonly internalType: "bytes";
175
- }, {
176
- readonly name: "deadline";
177
- readonly type: "uint256";
178
- readonly internalType: "uint256";
179
- }, {
180
- readonly name: "nonce";
181
- readonly type: "uint256";
182
- readonly internalType: "uint256";
183
- }, {
184
- readonly name: "fees";
185
- readonly type: "uint256";
186
- readonly internalType: "uint256";
187
- }, {
188
- readonly name: "session";
189
- readonly type: "address";
190
- readonly internalType: "address";
191
- }, {
192
- readonly name: "predispatch";
193
- readonly type: "tuple";
194
- readonly internalType: "struct DispatchInfo";
195
- readonly components: readonly [{
196
- readonly name: "assets";
197
- readonly type: "tuple[]";
198
- readonly internalType: "struct TokenInfo[]";
199
- readonly components: readonly [{
200
- readonly name: "token";
201
- readonly type: "bytes32";
202
- readonly internalType: "bytes32";
203
- }, {
204
- readonly name: "amount";
205
- readonly type: "uint256";
206
- readonly internalType: "uint256";
207
- }];
208
- }, {
209
- readonly name: "call";
210
- readonly type: "bytes";
211
- readonly internalType: "bytes";
212
- }];
213
- }, {
214
- readonly name: "inputs";
215
- readonly type: "tuple[]";
216
- readonly internalType: "struct TokenInfo[]";
217
- readonly components: readonly [{
218
- readonly name: "token";
219
- readonly type: "bytes32";
220
- readonly internalType: "bytes32";
221
- }, {
222
- readonly name: "amount";
223
- readonly type: "uint256";
224
- readonly internalType: "uint256";
225
- }];
226
- }, {
227
- readonly name: "output";
228
- readonly type: "tuple";
229
- readonly internalType: "struct PaymentInfo";
230
- readonly components: readonly [{
231
- readonly name: "beneficiary";
232
- readonly type: "bytes32";
233
- readonly internalType: "bytes32";
234
- }, {
235
- readonly name: "assets";
236
- readonly type: "tuple[]";
237
- readonly internalType: "struct TokenInfo[]";
238
- readonly components: readonly [{
239
- readonly name: "token";
240
- readonly type: "bytes32";
241
- readonly internalType: "bytes32";
242
- }, {
243
- readonly name: "amount";
244
- readonly type: "uint256";
245
- readonly internalType: "uint256";
246
- }];
247
- }, {
248
- readonly name: "call";
249
- readonly type: "bytes";
250
- readonly internalType: "bytes";
251
- }];
252
- }];
253
- }, {
254
- readonly name: "options";
255
- readonly type: "tuple";
256
- readonly internalType: "struct CancelOptions";
257
- readonly components: readonly [{
258
- readonly name: "relayerFee";
259
- readonly type: "uint256";
260
- readonly internalType: "uint256";
261
- }, {
262
- readonly name: "height";
263
- readonly type: "uint64";
264
- readonly internalType: "uint64";
265
- }];
266
- }];
267
- readonly outputs: readonly [];
268
- readonly stateMutability: "payable";
269
- }, {
270
- readonly type: "function";
271
- readonly name: "eip712Domain";
272
- readonly inputs: readonly [];
273
- readonly outputs: readonly [{
274
- readonly name: "fields";
275
- readonly type: "bytes1";
276
- readonly internalType: "bytes1";
277
- }, {
278
- readonly name: "name";
279
- readonly type: "string";
280
- readonly internalType: "string";
281
- }, {
282
- readonly name: "version";
283
- readonly type: "string";
284
- readonly internalType: "string";
285
- }, {
286
- readonly name: "chainId";
287
- readonly type: "uint256";
288
- readonly internalType: "uint256";
289
- }, {
290
- readonly name: "verifyingContract";
291
- readonly type: "address";
292
- readonly internalType: "address";
293
- }, {
294
- readonly name: "salt";
295
- readonly type: "bytes32";
296
- readonly internalType: "bytes32";
297
- }, {
298
- readonly name: "extensions";
299
- readonly type: "uint256[]";
300
- readonly internalType: "uint256[]";
301
- }];
302
- readonly stateMutability: "view";
303
- }, {
304
- readonly type: "function";
305
- readonly name: "fillOrder";
306
- readonly inputs: readonly [{
307
- readonly name: "order";
308
- readonly type: "tuple";
309
- readonly internalType: "struct Order";
310
- readonly components: readonly [{
311
- readonly name: "user";
312
- readonly type: "bytes32";
313
- readonly internalType: "bytes32";
314
- }, {
315
- readonly name: "source";
316
- readonly type: "bytes";
317
- readonly internalType: "bytes";
318
- }, {
319
- readonly name: "destination";
320
- readonly type: "bytes";
321
- readonly internalType: "bytes";
322
- }, {
323
- readonly name: "deadline";
324
- readonly type: "uint256";
325
- readonly internalType: "uint256";
326
- }, {
327
- readonly name: "nonce";
328
- readonly type: "uint256";
329
- readonly internalType: "uint256";
330
- }, {
331
- readonly name: "fees";
332
- readonly type: "uint256";
333
- readonly internalType: "uint256";
334
- }, {
335
- readonly name: "session";
336
- readonly type: "address";
337
- readonly internalType: "address";
338
- }, {
339
- readonly name: "predispatch";
340
- readonly type: "tuple";
341
- readonly internalType: "struct DispatchInfo";
342
- readonly components: readonly [{
343
- readonly name: "assets";
344
- readonly type: "tuple[]";
345
- readonly internalType: "struct TokenInfo[]";
346
- readonly components: readonly [{
347
- readonly name: "token";
348
- readonly type: "bytes32";
349
- readonly internalType: "bytes32";
350
- }, {
351
- readonly name: "amount";
352
- readonly type: "uint256";
353
- readonly internalType: "uint256";
354
- }];
355
- }, {
356
- readonly name: "call";
357
- readonly type: "bytes";
358
- readonly internalType: "bytes";
359
- }];
360
- }, {
361
- readonly name: "inputs";
362
- readonly type: "tuple[]";
363
- readonly internalType: "struct TokenInfo[]";
364
- readonly components: readonly [{
365
- readonly name: "token";
366
- readonly type: "bytes32";
367
- readonly internalType: "bytes32";
368
- }, {
369
- readonly name: "amount";
370
- readonly type: "uint256";
371
- readonly internalType: "uint256";
372
- }];
373
- }, {
374
- readonly name: "output";
375
- readonly type: "tuple";
376
- readonly internalType: "struct PaymentInfo";
377
- readonly components: readonly [{
378
- readonly name: "beneficiary";
379
- readonly type: "bytes32";
380
- readonly internalType: "bytes32";
381
- }, {
382
- readonly name: "assets";
383
- readonly type: "tuple[]";
384
- readonly internalType: "struct TokenInfo[]";
385
- readonly components: readonly [{
386
- readonly name: "token";
387
- readonly type: "bytes32";
388
- readonly internalType: "bytes32";
389
- }, {
390
- readonly name: "amount";
391
- readonly type: "uint256";
392
- readonly internalType: "uint256";
393
- }];
394
- }, {
395
- readonly name: "call";
396
- readonly type: "bytes";
397
- readonly internalType: "bytes";
398
- }];
399
- }];
400
- }, {
401
- readonly name: "options";
402
- readonly type: "tuple";
403
- readonly internalType: "struct FillOptions";
404
- readonly components: readonly [{
405
- readonly name: "relayerFee";
406
- readonly type: "uint256";
407
- readonly internalType: "uint256";
408
- }, {
409
- readonly name: "nativeDispatchFee";
410
- readonly type: "uint256";
411
- readonly internalType: "uint256";
412
- }, {
413
- readonly name: "outputs";
414
- readonly type: "tuple[]";
415
- readonly internalType: "struct TokenInfo[]";
416
- readonly components: readonly [{
417
- readonly name: "token";
418
- readonly type: "bytes32";
419
- readonly internalType: "bytes32";
420
- }, {
421
- readonly name: "amount";
422
- readonly type: "uint256";
423
- readonly internalType: "uint256";
424
- }];
425
- }];
426
- }];
427
- readonly outputs: readonly [];
428
- readonly stateMutability: "payable";
429
- }, {
430
- readonly type: "function";
431
- readonly name: "host";
432
- readonly inputs: readonly [];
433
- readonly outputs: readonly [{
434
- readonly name: "";
435
- readonly type: "address";
436
- readonly internalType: "address";
437
- }];
438
- readonly stateMutability: "view";
439
- }, {
440
- readonly type: "function";
441
- readonly name: "instance";
442
- readonly inputs: readonly [{
443
- readonly name: "stateMachineId";
444
- readonly type: "bytes";
445
- readonly internalType: "bytes";
446
- }];
447
- readonly outputs: readonly [{
448
- readonly name: "";
449
- readonly type: "address";
450
- readonly internalType: "address";
451
- }];
452
- readonly stateMutability: "view";
453
- }, {
454
- readonly type: "function";
455
- readonly name: "onAccept";
456
- readonly inputs: readonly [{
457
- readonly name: "incoming";
458
- readonly type: "tuple";
459
- readonly internalType: "struct IncomingPostRequest";
460
- readonly components: readonly [{
461
- readonly name: "request";
462
- readonly type: "tuple";
463
- readonly internalType: "struct PostRequest";
464
- readonly components: readonly [{
465
- readonly name: "source";
466
- readonly type: "bytes";
467
- readonly internalType: "bytes";
468
- }, {
469
- readonly name: "dest";
470
- readonly type: "bytes";
471
- readonly internalType: "bytes";
472
- }, {
473
- readonly name: "nonce";
474
- readonly type: "uint64";
475
- readonly internalType: "uint64";
476
- }, {
477
- readonly name: "from";
478
- readonly type: "bytes";
479
- readonly internalType: "bytes";
480
- }, {
481
- readonly name: "to";
482
- readonly type: "bytes";
483
- readonly internalType: "bytes";
484
- }, {
485
- readonly name: "timeoutTimestamp";
486
- readonly type: "uint64";
487
- readonly internalType: "uint64";
488
- }, {
489
- readonly name: "body";
490
- readonly type: "bytes";
491
- readonly internalType: "bytes";
492
- }];
493
- }, {
494
- readonly name: "relayer";
495
- readonly type: "address";
496
- readonly internalType: "address";
497
- }];
498
- }];
499
- readonly outputs: readonly [];
500
- readonly stateMutability: "nonpayable";
501
- }, {
502
- readonly type: "function";
503
- readonly name: "onGetResponse";
504
- readonly inputs: readonly [{
505
- readonly name: "incoming";
506
- readonly type: "tuple";
507
- readonly internalType: "struct IncomingGetResponse";
508
- readonly components: readonly [{
509
- readonly name: "response";
510
- readonly type: "tuple";
511
- readonly internalType: "struct GetResponse";
512
- readonly components: readonly [{
513
- readonly name: "request";
514
- readonly type: "tuple";
515
- readonly internalType: "struct GetRequest";
516
- readonly components: readonly [{
517
- readonly name: "source";
518
- readonly type: "bytes";
519
- readonly internalType: "bytes";
520
- }, {
521
- readonly name: "dest";
522
- readonly type: "bytes";
523
- readonly internalType: "bytes";
524
- }, {
525
- readonly name: "nonce";
526
- readonly type: "uint64";
527
- readonly internalType: "uint64";
528
- }, {
529
- readonly name: "from";
530
- readonly type: "bytes";
531
- readonly internalType: "bytes";
532
- }, {
533
- readonly name: "timeoutTimestamp";
534
- readonly type: "uint64";
535
- readonly internalType: "uint64";
536
- }, {
537
- readonly name: "keys";
538
- readonly type: "bytes[]";
539
- readonly internalType: "bytes[]";
540
- }, {
541
- readonly name: "height";
542
- readonly type: "uint64";
543
- readonly internalType: "uint64";
544
- }, {
545
- readonly name: "context";
546
- readonly type: "bytes";
547
- readonly internalType: "bytes";
548
- }];
549
- }, {
550
- readonly name: "values";
551
- readonly type: "tuple[]";
552
- readonly internalType: "struct StorageValue[]";
553
- readonly components: readonly [{
554
- readonly name: "key";
555
- readonly type: "bytes";
556
- readonly internalType: "bytes";
557
- }, {
558
- readonly name: "value";
559
- readonly type: "bytes";
560
- readonly internalType: "bytes";
561
- }];
562
- }];
563
- }, {
564
- readonly name: "relayer";
565
- readonly type: "address";
566
- readonly internalType: "address";
567
- }];
568
- }];
569
- readonly outputs: readonly [];
570
- readonly stateMutability: "nonpayable";
571
- }, {
572
- readonly type: "function";
573
- readonly name: "onGetTimeout";
574
- readonly inputs: readonly [{
575
- readonly name: "";
576
- readonly type: "tuple";
577
- readonly internalType: "struct GetRequestTimeout";
578
- readonly components: readonly [{
579
- readonly name: "request";
580
- readonly type: "tuple";
581
- readonly internalType: "struct GetRequest";
582
- readonly components: readonly [{
583
- readonly name: "source";
584
- readonly type: "bytes";
585
- readonly internalType: "bytes";
586
- }, {
587
- readonly name: "dest";
588
- readonly type: "bytes";
589
- readonly internalType: "bytes";
590
- }, {
591
- readonly name: "nonce";
592
- readonly type: "uint64";
593
- readonly internalType: "uint64";
594
- }, {
595
- readonly name: "from";
596
- readonly type: "bytes";
597
- readonly internalType: "bytes";
598
- }, {
599
- readonly name: "timeoutTimestamp";
600
- readonly type: "uint64";
601
- readonly internalType: "uint64";
602
- }, {
603
- readonly name: "keys";
604
- readonly type: "bytes[]";
605
- readonly internalType: "bytes[]";
606
- }, {
607
- readonly name: "height";
608
- readonly type: "uint64";
609
- readonly internalType: "uint64";
610
- }, {
611
- readonly name: "context";
612
- readonly type: "bytes";
613
- readonly internalType: "bytes";
614
- }];
615
- }, {
616
- readonly name: "relayer";
617
- readonly type: "address";
618
- readonly internalType: "address";
619
- }];
620
- }];
621
- readonly outputs: readonly [];
622
- readonly stateMutability: "nonpayable";
623
- }, {
624
- readonly type: "function";
625
- readonly name: "onPostRequestTimeout";
626
- readonly inputs: readonly [{
627
- readonly name: "";
628
- readonly type: "tuple";
629
- readonly internalType: "struct PostRequestTimeout";
630
- readonly components: readonly [{
631
- readonly name: "request";
632
- readonly type: "tuple";
633
- readonly internalType: "struct PostRequest";
634
- readonly components: readonly [{
635
- readonly name: "source";
636
- readonly type: "bytes";
637
- readonly internalType: "bytes";
638
- }, {
639
- readonly name: "dest";
640
- readonly type: "bytes";
641
- readonly internalType: "bytes";
642
- }, {
643
- readonly name: "nonce";
644
- readonly type: "uint64";
645
- readonly internalType: "uint64";
646
- }, {
647
- readonly name: "from";
648
- readonly type: "bytes";
649
- readonly internalType: "bytes";
650
- }, {
651
- readonly name: "to";
652
- readonly type: "bytes";
653
- readonly internalType: "bytes";
654
- }, {
655
- readonly name: "timeoutTimestamp";
656
- readonly type: "uint64";
657
- readonly internalType: "uint64";
658
- }, {
659
- readonly name: "body";
660
- readonly type: "bytes";
661
- readonly internalType: "bytes";
662
- }];
663
- }, {
664
- readonly name: "relayer";
665
- readonly type: "address";
666
- readonly internalType: "address";
667
- }];
668
- }];
669
- readonly outputs: readonly [];
670
- readonly stateMutability: "nonpayable";
671
- }, {
672
- readonly type: "function";
673
- readonly name: "params";
674
- readonly inputs: readonly [];
675
- readonly outputs: readonly [{
676
- readonly name: "";
677
- readonly type: "tuple";
678
- readonly internalType: "struct Params";
679
- readonly components: readonly [{
680
- readonly name: "host";
681
- readonly type: "address";
682
- readonly internalType: "address";
683
- }, {
684
- readonly name: "dispatcher";
685
- readonly type: "address";
686
- readonly internalType: "address";
687
- }, {
688
- readonly name: "solverSelection";
689
- readonly type: "bool";
690
- readonly internalType: "bool";
691
- }, {
692
- readonly name: "surplusShareBps";
693
- readonly type: "uint256";
694
- readonly internalType: "uint256";
695
- }, {
696
- readonly name: "protocolFeeBps";
697
- readonly type: "uint256";
698
- readonly internalType: "uint256";
699
- }, {
700
- readonly name: "priceOracle";
701
- readonly type: "address";
702
- readonly internalType: "address";
703
- }];
704
- }];
705
- readonly stateMutability: "view";
706
- }, {
707
- readonly type: "function";
708
- readonly name: "placeOrder";
709
- readonly inputs: readonly [{
710
- readonly name: "order";
711
- readonly type: "tuple";
712
- readonly internalType: "struct Order";
713
- readonly components: readonly [{
714
- readonly name: "user";
715
- readonly type: "bytes32";
716
- readonly internalType: "bytes32";
717
- }, {
718
- readonly name: "source";
719
- readonly type: "bytes";
720
- readonly internalType: "bytes";
721
- }, {
722
- readonly name: "destination";
723
- readonly type: "bytes";
724
- readonly internalType: "bytes";
725
- }, {
726
- readonly name: "deadline";
727
- readonly type: "uint256";
728
- readonly internalType: "uint256";
729
- }, {
730
- readonly name: "nonce";
731
- readonly type: "uint256";
732
- readonly internalType: "uint256";
733
- }, {
734
- readonly name: "fees";
735
- readonly type: "uint256";
736
- readonly internalType: "uint256";
737
- }, {
738
- readonly name: "session";
739
- readonly type: "address";
740
- readonly internalType: "address";
741
- }, {
742
- readonly name: "predispatch";
743
- readonly type: "tuple";
744
- readonly internalType: "struct DispatchInfo";
745
- readonly components: readonly [{
746
- readonly name: "assets";
747
- readonly type: "tuple[]";
748
- readonly internalType: "struct TokenInfo[]";
749
- readonly components: readonly [{
750
- readonly name: "token";
751
- readonly type: "bytes32";
752
- readonly internalType: "bytes32";
753
- }, {
754
- readonly name: "amount";
755
- readonly type: "uint256";
756
- readonly internalType: "uint256";
757
- }];
758
- }, {
759
- readonly name: "call";
760
- readonly type: "bytes";
761
- readonly internalType: "bytes";
762
- }];
763
- }, {
764
- readonly name: "inputs";
765
- readonly type: "tuple[]";
766
- readonly internalType: "struct TokenInfo[]";
767
- readonly components: readonly [{
768
- readonly name: "token";
769
- readonly type: "bytes32";
770
- readonly internalType: "bytes32";
771
- }, {
772
- readonly name: "amount";
773
- readonly type: "uint256";
774
- readonly internalType: "uint256";
775
- }];
776
- }, {
777
- readonly name: "output";
778
- readonly type: "tuple";
779
- readonly internalType: "struct PaymentInfo";
780
- readonly components: readonly [{
781
- readonly name: "beneficiary";
782
- readonly type: "bytes32";
783
- readonly internalType: "bytes32";
784
- }, {
785
- readonly name: "assets";
786
- readonly type: "tuple[]";
787
- readonly internalType: "struct TokenInfo[]";
788
- readonly components: readonly [{
789
- readonly name: "token";
790
- readonly type: "bytes32";
791
- readonly internalType: "bytes32";
792
- }, {
793
- readonly name: "amount";
794
- readonly type: "uint256";
795
- readonly internalType: "uint256";
796
- }];
797
- }, {
798
- readonly name: "call";
799
- readonly type: "bytes";
800
- readonly internalType: "bytes";
801
- }];
802
- }];
803
- }, {
804
- readonly name: "graffiti";
805
- readonly type: "bytes32";
806
- readonly internalType: "bytes32";
807
- }];
808
- readonly outputs: readonly [];
809
- readonly stateMutability: "payable";
810
- }, {
811
- readonly type: "function";
812
- readonly name: "quote";
813
- readonly inputs: readonly [{
814
- readonly name: "request";
815
- readonly type: "tuple";
816
- readonly internalType: "struct DispatchPost";
817
- readonly components: readonly [{
818
- readonly name: "dest";
819
- readonly type: "bytes";
820
- readonly internalType: "bytes";
821
- }, {
822
- readonly name: "to";
823
- readonly type: "bytes";
824
- readonly internalType: "bytes";
825
- }, {
826
- readonly name: "body";
827
- readonly type: "bytes";
828
- readonly internalType: "bytes";
829
- }, {
830
- readonly name: "timeout";
831
- readonly type: "uint64";
832
- readonly internalType: "uint64";
833
- }, {
834
- readonly name: "fee";
835
- readonly type: "uint256";
836
- readonly internalType: "uint256";
837
- }, {
838
- readonly name: "payer";
839
- readonly type: "address";
840
- readonly internalType: "address";
841
- }];
842
- }];
843
- readonly outputs: readonly [{
844
- readonly name: "";
845
- readonly type: "uint256";
846
- readonly internalType: "uint256";
847
- }];
848
- readonly stateMutability: "view";
849
- }, {
850
- readonly type: "function";
851
- readonly name: "quote";
852
- readonly inputs: readonly [{
853
- readonly name: "request";
854
- readonly type: "tuple";
855
- readonly internalType: "struct DispatchGet";
856
- readonly components: readonly [{
857
- readonly name: "dest";
858
- readonly type: "bytes";
859
- readonly internalType: "bytes";
860
- }, {
861
- readonly name: "height";
862
- readonly type: "uint64";
863
- readonly internalType: "uint64";
864
- }, {
865
- readonly name: "keys";
866
- readonly type: "bytes[]";
867
- readonly internalType: "bytes[]";
868
- }, {
869
- readonly name: "timeout";
870
- readonly type: "uint64";
871
- readonly internalType: "uint64";
872
- }, {
873
- readonly name: "fee";
874
- readonly type: "uint256";
875
- readonly internalType: "uint256";
876
- }, {
877
- readonly name: "context";
878
- readonly type: "bytes";
879
- readonly internalType: "bytes";
880
- }, {
881
- readonly name: "payer";
882
- readonly type: "address";
883
- readonly internalType: "address";
884
- }];
885
- }];
886
- readonly outputs: readonly [{
887
- readonly name: "";
888
- readonly type: "uint256";
889
- readonly internalType: "uint256";
890
- }];
891
- readonly stateMutability: "view";
892
- }, {
893
- readonly type: "function";
894
- readonly name: "select";
895
- readonly inputs: readonly [{
896
- readonly name: "options";
897
- readonly type: "tuple";
898
- readonly internalType: "struct SelectOptions";
899
- readonly components: readonly [{
900
- readonly name: "commitment";
901
- readonly type: "bytes32";
902
- readonly internalType: "bytes32";
903
- }, {
904
- readonly name: "solver";
905
- readonly type: "address";
906
- readonly internalType: "address";
907
- }, {
908
- readonly name: "signature";
909
- readonly type: "bytes";
910
- readonly internalType: "bytes";
911
- }];
912
- }];
913
- readonly outputs: readonly [{
914
- readonly name: "";
915
- readonly type: "address";
916
- readonly internalType: "address";
917
- }];
918
- readonly stateMutability: "nonpayable";
919
- }, {
920
- readonly type: "function";
921
- readonly name: "init";
922
- readonly inputs: readonly [{
923
- readonly name: "p";
924
- readonly type: "tuple";
925
- readonly internalType: "struct Params";
926
- readonly components: readonly [{
927
- readonly name: "host";
928
- readonly type: "address";
929
- readonly internalType: "address";
930
- }, {
931
- readonly name: "dispatcher";
932
- readonly type: "address";
933
- readonly internalType: "address";
934
- }, {
935
- readonly name: "solverSelection";
936
- readonly type: "bool";
937
- readonly internalType: "bool";
938
- }, {
939
- readonly name: "surplusShareBps";
940
- readonly type: "uint256";
941
- readonly internalType: "uint256";
942
- }, {
943
- readonly name: "protocolFeeBps";
944
- readonly type: "uint256";
945
- readonly internalType: "uint256";
946
- }, {
947
- readonly name: "priceOracle";
948
- readonly type: "address";
949
- readonly internalType: "address";
950
- }];
951
- }, {
952
- readonly name: "deployments";
953
- readonly type: "tuple[]";
954
- readonly internalType: "struct Deployment[]";
955
- readonly components: readonly [{
956
- readonly name: "chain";
957
- readonly type: "bytes";
958
- readonly internalType: "bytes";
959
- }, {
960
- readonly name: "gateway";
961
- readonly type: "address";
962
- readonly internalType: "address";
963
- }];
964
- }];
965
- readonly outputs: readonly [];
966
- readonly stateMutability: "nonpayable";
967
- }, {
968
- readonly type: "event";
969
- readonly name: "DestinationProtocolFeeUpdated";
970
- readonly inputs: readonly [{
971
- readonly name: "chain";
972
- readonly type: "string";
973
- readonly indexed: false;
974
- readonly internalType: "string";
975
- }, {
976
- readonly name: "feeBps";
977
- readonly type: "uint256";
978
- readonly indexed: false;
979
- readonly internalType: "uint256";
980
- }];
981
- readonly anonymous: false;
982
- }, {
983
- readonly type: "event";
984
- readonly name: "DustCollected";
985
- readonly inputs: readonly [{
986
- readonly name: "token";
987
- readonly type: "address";
988
- readonly indexed: false;
989
- readonly internalType: "address";
990
- }, {
991
- readonly name: "amount";
992
- readonly type: "uint256";
993
- readonly indexed: false;
994
- readonly internalType: "uint256";
995
- }];
996
- readonly anonymous: false;
997
- }, {
998
- readonly type: "event";
999
- readonly name: "DustSwept";
1000
- readonly inputs: readonly [{
1001
- readonly name: "token";
1002
- readonly type: "address";
1003
- readonly indexed: false;
1004
- readonly internalType: "address";
1005
- }, {
1006
- readonly name: "amount";
1007
- readonly type: "uint256";
1008
- readonly indexed: false;
1009
- readonly internalType: "uint256";
1010
- }, {
1011
- readonly name: "beneficiary";
1012
- readonly type: "address";
1013
- readonly indexed: false;
1014
- readonly internalType: "address";
1015
- }];
1016
- readonly anonymous: false;
1017
- }, {
1018
- readonly type: "event";
1019
- readonly name: "EIP712DomainChanged";
1020
- readonly inputs: readonly [];
1021
- readonly anonymous: false;
1022
- }, {
1023
- readonly type: "event";
1024
- readonly name: "EscrowRefunded";
1025
- readonly inputs: readonly [{
1026
- readonly name: "commitment";
1027
- readonly type: "bytes32";
1028
- readonly indexed: true;
1029
- readonly internalType: "bytes32";
1030
- }, {
1031
- readonly name: "tokens";
1032
- readonly type: "tuple[]";
1033
- readonly indexed: false;
1034
- readonly internalType: "struct TokenInfo[]";
1035
- readonly components: readonly [{
1036
- readonly name: "token";
1037
- readonly type: "bytes32";
1038
- readonly internalType: "bytes32";
1039
- }, {
1040
- readonly name: "amount";
1041
- readonly type: "uint256";
1042
- readonly internalType: "uint256";
1043
- }];
1044
- }];
1045
- readonly anonymous: false;
1046
- }, {
1047
- readonly type: "event";
1048
- readonly name: "EscrowReleased";
1049
- readonly inputs: readonly [{
1050
- readonly name: "commitment";
1051
- readonly type: "bytes32";
1052
- readonly indexed: true;
1053
- readonly internalType: "bytes32";
1054
- }, {
1055
- readonly name: "tokens";
1056
- readonly type: "tuple[]";
1057
- readonly indexed: false;
1058
- readonly internalType: "struct TokenInfo[]";
1059
- readonly components: readonly [{
1060
- readonly name: "token";
1061
- readonly type: "bytes32";
1062
- readonly internalType: "bytes32";
1063
- }, {
1064
- readonly name: "amount";
1065
- readonly type: "uint256";
1066
- readonly internalType: "uint256";
1067
- }];
1068
- }];
1069
- readonly anonymous: false;
1070
- }, {
1071
- readonly type: "event";
1072
- readonly name: "DeploymentAdded";
1073
- readonly inputs: readonly [{
1074
- readonly name: "chain";
1075
- readonly type: "string";
1076
- readonly indexed: false;
1077
- readonly internalType: "string";
1078
- }, {
1079
- readonly name: "gateway";
1080
- readonly type: "address";
1081
- readonly indexed: false;
1082
- readonly internalType: "address";
1083
- }];
1084
- readonly anonymous: false;
1085
- }, {
1086
- readonly type: "event";
1087
- readonly name: "OrderFilled";
1088
- readonly inputs: readonly [{
1089
- readonly name: "commitment";
1090
- readonly type: "bytes32";
1091
- readonly indexed: true;
1092
- readonly internalType: "bytes32";
1093
- }, {
1094
- readonly name: "filler";
1095
- readonly type: "address";
1096
- readonly indexed: false;
1097
- readonly internalType: "address";
1098
- }, {
1099
- readonly name: "outputs";
1100
- readonly type: "tuple[]";
1101
- readonly indexed: false;
1102
- readonly internalType: "struct TokenInfo[]";
1103
- readonly components: readonly [{
1104
- readonly name: "token";
1105
- readonly type: "bytes32";
1106
- readonly internalType: "bytes32";
1107
- }, {
1108
- readonly name: "amount";
1109
- readonly type: "uint256";
1110
- readonly internalType: "uint256";
1111
- }];
1112
- }, {
1113
- readonly name: "inputs";
1114
- readonly type: "tuple[]";
1115
- readonly indexed: false;
1116
- readonly internalType: "struct TokenInfo[]";
1117
- readonly components: readonly [{
1118
- readonly name: "token";
1119
- readonly type: "bytes32";
1120
- readonly internalType: "bytes32";
1121
- }, {
1122
- readonly name: "amount";
1123
- readonly type: "uint256";
1124
- readonly internalType: "uint256";
1125
- }];
1126
- }];
1127
- readonly anonymous: false;
1128
- }, {
1129
- readonly type: "event";
1130
- readonly name: "OrderPlaced";
1131
- readonly inputs: readonly [{
1132
- readonly name: "user";
1133
- readonly type: "bytes32";
1134
- readonly indexed: false;
1135
- readonly internalType: "bytes32";
1136
- }, {
1137
- readonly name: "source";
1138
- readonly type: "string";
1139
- readonly indexed: false;
1140
- readonly internalType: "string";
1141
- }, {
1142
- readonly name: "destination";
1143
- readonly type: "string";
1144
- readonly indexed: false;
1145
- readonly internalType: "string";
1146
- }, {
1147
- readonly name: "deadline";
1148
- readonly type: "uint256";
1149
- readonly indexed: false;
1150
- readonly internalType: "uint256";
1151
- }, {
1152
- readonly name: "nonce";
1153
- readonly type: "uint256";
1154
- readonly indexed: false;
1155
- readonly internalType: "uint256";
1156
- }, {
1157
- readonly name: "fees";
1158
- readonly type: "uint256";
1159
- readonly indexed: false;
1160
- readonly internalType: "uint256";
1161
- }, {
1162
- readonly name: "session";
1163
- readonly type: "address";
1164
- readonly indexed: false;
1165
- readonly internalType: "address";
1166
- }, {
1167
- readonly name: "beneficiary";
1168
- readonly type: "bytes32";
1169
- readonly indexed: false;
1170
- readonly internalType: "bytes32";
1171
- }, {
1172
- readonly name: "predispatch";
1173
- readonly type: "tuple[]";
1174
- readonly indexed: false;
1175
- readonly internalType: "struct TokenInfo[]";
1176
- readonly components: readonly [{
1177
- readonly name: "token";
1178
- readonly type: "bytes32";
1179
- readonly internalType: "bytes32";
1180
- }, {
1181
- readonly name: "amount";
1182
- readonly type: "uint256";
1183
- readonly internalType: "uint256";
1184
- }];
1185
- }, {
1186
- readonly name: "inputs";
1187
- readonly type: "tuple[]";
1188
- readonly indexed: false;
1189
- readonly internalType: "struct TokenInfo[]";
1190
- readonly components: readonly [{
1191
- readonly name: "token";
1192
- readonly type: "bytes32";
1193
- readonly internalType: "bytes32";
1194
- }, {
1195
- readonly name: "amount";
1196
- readonly type: "uint256";
1197
- readonly internalType: "uint256";
1198
- }];
1199
- }, {
1200
- readonly name: "outputs";
1201
- readonly type: "tuple[]";
1202
- readonly indexed: false;
1203
- readonly internalType: "struct TokenInfo[]";
1204
- readonly components: readonly [{
1205
- readonly name: "token";
1206
- readonly type: "bytes32";
1207
- readonly internalType: "bytes32";
1208
- }, {
1209
- readonly name: "amount";
1210
- readonly type: "uint256";
1211
- readonly internalType: "uint256";
1212
- }];
1213
- }];
1214
- readonly anonymous: false;
1215
- }, {
1216
- readonly type: "event";
1217
- readonly name: "ParamsUpdated";
1218
- readonly inputs: readonly [{
1219
- readonly name: "previous";
1220
- readonly type: "tuple";
1221
- readonly indexed: false;
1222
- readonly internalType: "struct Params";
1223
- readonly components: readonly [{
1224
- readonly name: "host";
1225
- readonly type: "address";
1226
- readonly internalType: "address";
1227
- }, {
1228
- readonly name: "dispatcher";
1229
- readonly type: "address";
1230
- readonly internalType: "address";
1231
- }, {
1232
- readonly name: "solverSelection";
1233
- readonly type: "bool";
1234
- readonly internalType: "bool";
1235
- }, {
1236
- readonly name: "surplusShareBps";
1237
- readonly type: "uint256";
1238
- readonly internalType: "uint256";
1239
- }, {
1240
- readonly name: "protocolFeeBps";
1241
- readonly type: "uint256";
1242
- readonly internalType: "uint256";
1243
- }, {
1244
- readonly name: "priceOracle";
1245
- readonly type: "address";
1246
- readonly internalType: "address";
1247
- }];
1248
- }, {
1249
- readonly name: "current";
1250
- readonly type: "tuple";
1251
- readonly indexed: false;
1252
- readonly internalType: "struct Params";
1253
- readonly components: readonly [{
1254
- readonly name: "host";
1255
- readonly type: "address";
1256
- readonly internalType: "address";
1257
- }, {
1258
- readonly name: "dispatcher";
1259
- readonly type: "address";
1260
- readonly internalType: "address";
1261
- }, {
1262
- readonly name: "solverSelection";
1263
- readonly type: "bool";
1264
- readonly internalType: "bool";
1265
- }, {
1266
- readonly name: "surplusShareBps";
1267
- readonly type: "uint256";
1268
- readonly internalType: "uint256";
1269
- }, {
1270
- readonly name: "protocolFeeBps";
1271
- readonly type: "uint256";
1272
- readonly internalType: "uint256";
1273
- }, {
1274
- readonly name: "priceOracle";
1275
- readonly type: "address";
1276
- readonly internalType: "address";
1277
- }];
1278
- }];
1279
- readonly anonymous: false;
1280
- }, {
1281
- readonly type: "event";
1282
- readonly name: "PartialFill";
1283
- readonly inputs: readonly [{
1284
- readonly name: "commitment";
1285
- readonly type: "bytes32";
1286
- readonly indexed: true;
1287
- readonly internalType: "bytes32";
1288
- }, {
1289
- readonly name: "filler";
1290
- readonly type: "address";
1291
- readonly indexed: false;
1292
- readonly internalType: "address";
1293
- }, {
1294
- readonly name: "outputs";
1295
- readonly type: "tuple[]";
1296
- readonly indexed: false;
1297
- readonly internalType: "struct TokenInfo[]";
1298
- readonly components: readonly [{
1299
- readonly name: "token";
1300
- readonly type: "bytes32";
1301
- readonly internalType: "bytes32";
1302
- }, {
1303
- readonly name: "amount";
1304
- readonly type: "uint256";
1305
- readonly internalType: "uint256";
1306
- }];
1307
- }, {
1308
- readonly name: "inputs";
1309
- readonly type: "tuple[]";
1310
- readonly indexed: false;
1311
- readonly internalType: "struct TokenInfo[]";
1312
- readonly components: readonly [{
1313
- readonly name: "token";
1314
- readonly type: "bytes32";
1315
- readonly internalType: "bytes32";
1316
- }, {
1317
- readonly name: "amount";
1318
- readonly type: "uint256";
1319
- readonly internalType: "uint256";
1320
- }];
1321
- }];
1322
- readonly anonymous: false;
1323
- }, {
1324
- readonly type: "error";
1325
- readonly name: "Cancelled";
1326
- readonly inputs: readonly [];
1327
- }, {
1328
- readonly type: "error";
1329
- readonly name: "UnknownInstance";
1330
- readonly inputs: readonly [];
1331
- }, {
1332
- readonly type: "error";
1333
- readonly name: "ECDSAInvalidSignature";
1334
- readonly inputs: readonly [];
1335
- }, {
1336
- readonly type: "error";
1337
- readonly name: "ECDSAInvalidSignatureLength";
1338
- readonly inputs: readonly [{
1339
- readonly name: "length";
1340
- readonly type: "uint256";
1341
- readonly internalType: "uint256";
1342
- }];
1343
- }, {
1344
- readonly type: "error";
1345
- readonly name: "ECDSAInvalidSignatureS";
1346
- readonly inputs: readonly [{
1347
- readonly name: "s";
1348
- readonly type: "bytes32";
1349
- readonly internalType: "bytes32";
1350
- }];
1351
- }, {
1352
- readonly type: "error";
1353
- readonly name: "Expired";
1354
- readonly inputs: readonly [];
1355
- }, {
1356
- readonly type: "error";
1357
- readonly name: "Filled";
1358
- readonly inputs: readonly [];
1359
- }, {
1360
- readonly type: "error";
1361
- readonly name: "InsufficientNativeToken";
1362
- readonly inputs: readonly [];
1363
- }, {
1364
- readonly type: "error";
1365
- readonly name: "InvalidInput";
1366
- readonly inputs: readonly [];
1367
- }, {
1368
- readonly type: "error";
1369
- readonly name: "InvalidShortString";
1370
- readonly inputs: readonly [];
1371
- }, {
1372
- readonly type: "error";
1373
- readonly name: "NotExpired";
1374
- readonly inputs: readonly [];
1375
- }, {
1376
- readonly type: "error";
1377
- readonly name: "SafeERC20FailedOperation";
1378
- readonly inputs: readonly [{
1379
- readonly name: "token";
1380
- readonly type: "address";
1381
- readonly internalType: "address";
1382
- }];
1383
- }, {
1384
- readonly type: "error";
1385
- readonly name: "StringTooLong";
1386
- readonly inputs: readonly [{
1387
- readonly name: "str";
1388
- readonly type: "string";
1389
- readonly internalType: "string";
1390
- }];
1391
- }, {
1392
- readonly type: "error";
1393
- readonly name: "Unauthorized";
1394
- readonly inputs: readonly [];
1395
- }, {
1396
- readonly type: "error";
1397
- readonly name: "UnauthorizedCall";
1398
- readonly inputs: readonly [];
1399
- }, {
1400
- readonly type: "error";
1401
- readonly name: "UnexpectedCall";
1402
- readonly inputs: readonly [];
1403
- }, {
1404
- readonly type: "error";
1405
- readonly name: "UnknownOrder";
1406
- readonly inputs: readonly [];
1407
- }, {
1408
- readonly type: "error";
1409
- readonly name: "WrongChain";
1410
- readonly inputs: readonly [];
1411
- }];
1412
- /** ERC-4626 vaults per chain, keyed by chain id then lowercase underlying token address. */
1413
- type YieldVaultMap = Record<string, Record<string, string[]>>;
1414
- interface FillData {
1415
- order: Record<string, unknown>;
1416
- options: Record<string, unknown>;
1417
- outputToken: HexString;
1418
- solverAmount: bigint;
1419
- }
1420
- interface RpcBidInfo {
1421
- commitment: string;
1422
- filler: string;
1423
- user_op: string;
1424
- }
1425
- /** One solver's measured liquidity for a configured token on one chain at this snapshot. */
1426
- interface LpBalance {
1427
- solver: string;
1428
- /** State machine id of the chain the balance was measured on (e.g. EVM-8453). */
1429
- chain: string;
1430
- tokenAddress: HexString;
1431
- balance: bigint;
1432
- }
1433
- /** The aggregated result for a single phantom order's bid window. */
1434
- interface PhantomAggregation {
1435
- lowestPrice: bigint;
1436
- highestPrice: bigint;
1437
- medianPrice: bigint;
1438
- bidCount: number;
1439
- lpBalances: LpBalance[];
1440
- }
1441
- interface AggregationLogger {
1442
- warn: (payload: unknown, message: string) => void;
1443
- }
1444
- declare function weightedMedian(entries: {
1445
- price: bigint;
1446
- weight: bigint;
1447
- }[]): bigint;
1448
- declare function extractFillData(callData: HexString, gatewayAddress: string): FillData | null;
1449
- /** Derives the 192-bit bid nonce key binding a bid to an (order, sessionKey) pair. */
1450
- type BidNonceKeyFn = (commitment: HexString, sessionKey: HexString) => bigint;
1451
- /** Recomputes an order's commitment from the contract-shaped order decoded out of a bid's calldata. */
1452
- type OrderCommitmentFn = (order: Record<string, unknown>) => HexString | null;
1453
- /**
1454
- * Default (viem) {@link OrderCommitmentFn}. The order comes straight out of `fillOrder`'s ABI
1455
- * decode, so it is already contract-shaped and re-encoding it reproduces `keccak256(abi.encode(order))`
1456
- * — the same commitment IntentGatewayV2 computes on-chain. Returns null when it cannot be computed,
1457
- * which callers treat as unverifiable (fail closed).
1458
- */
1459
- declare function orderCommitmentFromDecoded(order: Record<string, unknown>): HexString | null;
1460
- interface BidSignature {
1461
- /** The order commitment the solver signature is bound to. */
1462
- commitment: HexString;
1463
- /** The solver's 65-byte ECDSA signature over the userOpHash. */
1464
- solverSignature: HexString;
1465
- }
1466
- /** Splits a bid userOp's signature into its commitment and solver signature; null if malformed. */
1467
- declare function splitBidSignature(signature: HexString): BidSignature | null;
1468
- /** Recovers the address that produced a bid's solver signature, or null if it cannot be recovered. */
1469
- type RecoverBidSigner = (userOp: PackedUserOperation, entryPoint: HexString, chainId: bigint, solverSignature: HexString) => Promise<HexString | null>;
1470
- /**
1471
- * Default {@link RecoverBidSigner}: recovers over the EntryPoint v0.8 userOpHash, the digest
1472
- * SolverAccount itself validates against. viem-based, so Node consumers get it for free while the
1473
- * indexer injects an ethers equivalent (see the note at the top of this file).
1474
- */
1475
- declare const recoverBidSignerViem: RecoverBidSigner;
1476
- declare function fetchBidsForOrder(nodeUrl: string, commitment: string): Promise<RpcBidInfo[]>;
1477
- /**
1478
- * Aggregates every bid for a phantom order into a single price/liquidity snapshot.
1479
- *
1480
- * Fetches the live bids via `intents_getBidsForOrder` and reads each filler's quoted output amount.
1481
- * Only bids that {@link isVerifiedSolverBid} accepts are counted — a bid from anyone who is not one
1482
- * of our delegated solvers, or whose signature was not produced for this order, is dropped rather
1483
- * than allowed to move the price. The liquidity-weighted median then weights every surviving quote by
1484
- * the solver's balance of the output token on the destination chain, so a solver that can't actually
1485
- * deliver size carries little or no weight — which is why no fill simulation is needed to filter
1486
- * unfillable quotes. For each bidding solver it also records a full liquidity sweep — every
1487
- * configured yield-vault token on every supported chain (raw ERC-20 + vault positions). Returns
1488
- * `null` when no bid survives verification.
1489
- *
1490
- * `extractFill` decodes a bid's ERC-7821 calldata into the fill's order/output and `recoverSigner`
1491
- * recovers its solver signature; both default to the viem implementations, but the indexer injects
1492
- * VM2-safe variants (viem's keccak throws in the SubQuery sandbox).
1493
- */
1494
- declare function aggregatePhantomBids(params: {
1495
- nodeUrl: string;
1496
- /** RPC URL per supported EVM chain (stateMachineId -> url); must include the destination chain. */
1497
- evmRpcUrls: Record<string, string>;
1498
- chain: string;
1499
- gatewayAddress: string;
1500
- commitment: string;
1501
- yieldVaults: YieldVaultMap;
1502
- /** SolverAccount on `chain` that our solvers delegate to; bids from anyone else are dropped. */
1503
- solverAccount: string;
1504
- extractFill?: (callData: HexString, gatewayAddress: string) => FillData | null;
1505
- recoverSigner?: RecoverBidSigner;
1506
- bidNonceKey?: BidNonceKeyFn;
1507
- orderCommitment?: OrderCommitmentFn;
1508
- logger?: AggregationLogger;
1509
- }): Promise<PhantomAggregation | null>;
1510
-
1511
- export { type AggregationLogger, type BidNonceKeyFn, type BidSignature, ENTRY_POINT_V08_ADDRESS, FILL_ORDER_ABI, type FetchLike, type FillData, type HexString, type LpBalance, type OrderCommitmentFn, type PhantomAggregation, type RecoverBidSigner, type RpcBidInfo, type YieldVaultMap, aggregatePhantomBids, extractFillData, fetchBidsForOrder, orderCommitmentFromDecoded, recoverBidSignerViem, setAggregationFetch, splitBidSignature, weightedMedian };
7
+ import '@polkadot/api';
8
+ import '@polkadot/keyring/types';