@t402/smart-router 1.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,679 @@
1
+ import { z } from 'zod';
2
+ import { c as Route, b as RouteStep, C as ChainId } from '../types-C0ey6WqI.js';
3
+ import { c as GasOracle } from '../gas-CNpJzuy5.js';
4
+
5
+ /**
6
+ * Transaction status
7
+ */
8
+ declare const TransactionStatus: z.ZodEnum<["pending", "submitted", "confirmed", "failed", "replaced"]>;
9
+ type TransactionStatus = z.infer<typeof TransactionStatus>;
10
+ /**
11
+ * MEV protection strategy
12
+ */
13
+ declare const MevProtectionStrategy: z.ZodEnum<["none", "flashbots", "private_mempool", "timing", "splitting"]>;
14
+ type MevProtectionStrategy = z.infer<typeof MevProtectionStrategy>;
15
+ /**
16
+ * Transaction request
17
+ */
18
+ declare const TransactionRequest: z.ZodObject<{
19
+ to: z.ZodString;
20
+ data: z.ZodString;
21
+ value: z.ZodDefault<z.ZodString>;
22
+ gasLimit: z.ZodString;
23
+ maxFeePerGas: z.ZodOptional<z.ZodString>;
24
+ maxPriorityFeePerGas: z.ZodOptional<z.ZodString>;
25
+ gasPrice: z.ZodOptional<z.ZodString>;
26
+ nonce: z.ZodOptional<z.ZodNumber>;
27
+ chainId: z.ZodNumber;
28
+ }, "strip", z.ZodTypeAny, {
29
+ value: string;
30
+ to: string;
31
+ data: string;
32
+ gasLimit: string;
33
+ chainId: number;
34
+ maxFeePerGas?: string | undefined;
35
+ maxPriorityFeePerGas?: string | undefined;
36
+ gasPrice?: string | undefined;
37
+ nonce?: number | undefined;
38
+ }, {
39
+ to: string;
40
+ data: string;
41
+ gasLimit: string;
42
+ chainId: number;
43
+ value?: string | undefined;
44
+ maxFeePerGas?: string | undefined;
45
+ maxPriorityFeePerGas?: string | undefined;
46
+ gasPrice?: string | undefined;
47
+ nonce?: number | undefined;
48
+ }>;
49
+ type TransactionRequest = z.infer<typeof TransactionRequest>;
50
+ /**
51
+ * Signed transaction
52
+ */
53
+ declare const SignedTransaction: z.ZodObject<{
54
+ raw: z.ZodString;
55
+ hash: z.ZodString;
56
+ from: z.ZodString;
57
+ to: z.ZodString;
58
+ nonce: z.ZodNumber;
59
+ gasLimit: z.ZodString;
60
+ value: z.ZodString;
61
+ }, "strip", z.ZodTypeAny, {
62
+ value: string;
63
+ to: string;
64
+ gasLimit: string;
65
+ nonce: number;
66
+ raw: string;
67
+ hash: string;
68
+ from: string;
69
+ }, {
70
+ value: string;
71
+ to: string;
72
+ gasLimit: string;
73
+ nonce: number;
74
+ raw: string;
75
+ hash: string;
76
+ from: string;
77
+ }>;
78
+ type SignedTransaction = z.infer<typeof SignedTransaction>;
79
+ /**
80
+ * Transaction receipt
81
+ */
82
+ declare const TransactionReceipt: z.ZodObject<{
83
+ hash: z.ZodString;
84
+ status: z.ZodEnum<["pending", "submitted", "confirmed", "failed", "replaced"]>;
85
+ blockNumber: z.ZodOptional<z.ZodNumber>;
86
+ blockHash: z.ZodOptional<z.ZodString>;
87
+ gasUsed: z.ZodOptional<z.ZodString>;
88
+ effectiveGasPrice: z.ZodOptional<z.ZodString>;
89
+ logs: z.ZodOptional<z.ZodArray<z.ZodObject<{
90
+ address: z.ZodString;
91
+ topics: z.ZodArray<z.ZodString, "many">;
92
+ data: z.ZodString;
93
+ }, "strip", z.ZodTypeAny, {
94
+ address: string;
95
+ data: string;
96
+ topics: string[];
97
+ }, {
98
+ address: string;
99
+ data: string;
100
+ topics: string[];
101
+ }>, "many">>;
102
+ timestamp: z.ZodNumber;
103
+ }, "strip", z.ZodTypeAny, {
104
+ status: "pending" | "submitted" | "confirmed" | "failed" | "replaced";
105
+ timestamp: number;
106
+ hash: string;
107
+ blockNumber?: number | undefined;
108
+ blockHash?: string | undefined;
109
+ gasUsed?: string | undefined;
110
+ effectiveGasPrice?: string | undefined;
111
+ logs?: {
112
+ address: string;
113
+ data: string;
114
+ topics: string[];
115
+ }[] | undefined;
116
+ }, {
117
+ status: "pending" | "submitted" | "confirmed" | "failed" | "replaced";
118
+ timestamp: number;
119
+ hash: string;
120
+ blockNumber?: number | undefined;
121
+ blockHash?: string | undefined;
122
+ gasUsed?: string | undefined;
123
+ effectiveGasPrice?: string | undefined;
124
+ logs?: {
125
+ address: string;
126
+ data: string;
127
+ topics: string[];
128
+ }[] | undefined;
129
+ }>;
130
+ type TransactionReceipt = z.infer<typeof TransactionReceipt>;
131
+ /**
132
+ * Execution step result
133
+ */
134
+ declare const ExecutionStepResult: z.ZodObject<{
135
+ stepId: z.ZodString;
136
+ status: z.ZodEnum<["pending", "submitted", "confirmed", "failed", "replaced"]>;
137
+ transaction: z.ZodOptional<z.ZodObject<{
138
+ hash: z.ZodString;
139
+ status: z.ZodEnum<["pending", "submitted", "confirmed", "failed", "replaced"]>;
140
+ blockNumber: z.ZodOptional<z.ZodNumber>;
141
+ blockHash: z.ZodOptional<z.ZodString>;
142
+ gasUsed: z.ZodOptional<z.ZodString>;
143
+ effectiveGasPrice: z.ZodOptional<z.ZodString>;
144
+ logs: z.ZodOptional<z.ZodArray<z.ZodObject<{
145
+ address: z.ZodString;
146
+ topics: z.ZodArray<z.ZodString, "many">;
147
+ data: z.ZodString;
148
+ }, "strip", z.ZodTypeAny, {
149
+ address: string;
150
+ data: string;
151
+ topics: string[];
152
+ }, {
153
+ address: string;
154
+ data: string;
155
+ topics: string[];
156
+ }>, "many">>;
157
+ timestamp: z.ZodNumber;
158
+ }, "strip", z.ZodTypeAny, {
159
+ status: "pending" | "submitted" | "confirmed" | "failed" | "replaced";
160
+ timestamp: number;
161
+ hash: string;
162
+ blockNumber?: number | undefined;
163
+ blockHash?: string | undefined;
164
+ gasUsed?: string | undefined;
165
+ effectiveGasPrice?: string | undefined;
166
+ logs?: {
167
+ address: string;
168
+ data: string;
169
+ topics: string[];
170
+ }[] | undefined;
171
+ }, {
172
+ status: "pending" | "submitted" | "confirmed" | "failed" | "replaced";
173
+ timestamp: number;
174
+ hash: string;
175
+ blockNumber?: number | undefined;
176
+ blockHash?: string | undefined;
177
+ gasUsed?: string | undefined;
178
+ effectiveGasPrice?: string | undefined;
179
+ logs?: {
180
+ address: string;
181
+ data: string;
182
+ topics: string[];
183
+ }[] | undefined;
184
+ }>>;
185
+ actualOutput: z.ZodOptional<z.ZodString>;
186
+ error: z.ZodOptional<z.ZodString>;
187
+ startedAt: z.ZodNumber;
188
+ completedAt: z.ZodOptional<z.ZodNumber>;
189
+ }, "strip", z.ZodTypeAny, {
190
+ status: "pending" | "submitted" | "confirmed" | "failed" | "replaced";
191
+ stepId: string;
192
+ startedAt: number;
193
+ transaction?: {
194
+ status: "pending" | "submitted" | "confirmed" | "failed" | "replaced";
195
+ timestamp: number;
196
+ hash: string;
197
+ blockNumber?: number | undefined;
198
+ blockHash?: string | undefined;
199
+ gasUsed?: string | undefined;
200
+ effectiveGasPrice?: string | undefined;
201
+ logs?: {
202
+ address: string;
203
+ data: string;
204
+ topics: string[];
205
+ }[] | undefined;
206
+ } | undefined;
207
+ actualOutput?: string | undefined;
208
+ error?: string | undefined;
209
+ completedAt?: number | undefined;
210
+ }, {
211
+ status: "pending" | "submitted" | "confirmed" | "failed" | "replaced";
212
+ stepId: string;
213
+ startedAt: number;
214
+ transaction?: {
215
+ status: "pending" | "submitted" | "confirmed" | "failed" | "replaced";
216
+ timestamp: number;
217
+ hash: string;
218
+ blockNumber?: number | undefined;
219
+ blockHash?: string | undefined;
220
+ gasUsed?: string | undefined;
221
+ effectiveGasPrice?: string | undefined;
222
+ logs?: {
223
+ address: string;
224
+ data: string;
225
+ topics: string[];
226
+ }[] | undefined;
227
+ } | undefined;
228
+ actualOutput?: string | undefined;
229
+ error?: string | undefined;
230
+ completedAt?: number | undefined;
231
+ }>;
232
+ type ExecutionStepResult = z.infer<typeof ExecutionStepResult>;
233
+ /**
234
+ * Route execution result
235
+ */
236
+ declare const ExecutionResult: z.ZodObject<{
237
+ routeId: z.ZodString;
238
+ status: z.ZodEnum<["pending", "partial", "completed", "failed", "reverted"]>;
239
+ steps: z.ZodArray<z.ZodObject<{
240
+ stepId: z.ZodString;
241
+ status: z.ZodEnum<["pending", "submitted", "confirmed", "failed", "replaced"]>;
242
+ transaction: z.ZodOptional<z.ZodObject<{
243
+ hash: z.ZodString;
244
+ status: z.ZodEnum<["pending", "submitted", "confirmed", "failed", "replaced"]>;
245
+ blockNumber: z.ZodOptional<z.ZodNumber>;
246
+ blockHash: z.ZodOptional<z.ZodString>;
247
+ gasUsed: z.ZodOptional<z.ZodString>;
248
+ effectiveGasPrice: z.ZodOptional<z.ZodString>;
249
+ logs: z.ZodOptional<z.ZodArray<z.ZodObject<{
250
+ address: z.ZodString;
251
+ topics: z.ZodArray<z.ZodString, "many">;
252
+ data: z.ZodString;
253
+ }, "strip", z.ZodTypeAny, {
254
+ address: string;
255
+ data: string;
256
+ topics: string[];
257
+ }, {
258
+ address: string;
259
+ data: string;
260
+ topics: string[];
261
+ }>, "many">>;
262
+ timestamp: z.ZodNumber;
263
+ }, "strip", z.ZodTypeAny, {
264
+ status: "pending" | "submitted" | "confirmed" | "failed" | "replaced";
265
+ timestamp: number;
266
+ hash: string;
267
+ blockNumber?: number | undefined;
268
+ blockHash?: string | undefined;
269
+ gasUsed?: string | undefined;
270
+ effectiveGasPrice?: string | undefined;
271
+ logs?: {
272
+ address: string;
273
+ data: string;
274
+ topics: string[];
275
+ }[] | undefined;
276
+ }, {
277
+ status: "pending" | "submitted" | "confirmed" | "failed" | "replaced";
278
+ timestamp: number;
279
+ hash: string;
280
+ blockNumber?: number | undefined;
281
+ blockHash?: string | undefined;
282
+ gasUsed?: string | undefined;
283
+ effectiveGasPrice?: string | undefined;
284
+ logs?: {
285
+ address: string;
286
+ data: string;
287
+ topics: string[];
288
+ }[] | undefined;
289
+ }>>;
290
+ actualOutput: z.ZodOptional<z.ZodString>;
291
+ error: z.ZodOptional<z.ZodString>;
292
+ startedAt: z.ZodNumber;
293
+ completedAt: z.ZodOptional<z.ZodNumber>;
294
+ }, "strip", z.ZodTypeAny, {
295
+ status: "pending" | "submitted" | "confirmed" | "failed" | "replaced";
296
+ stepId: string;
297
+ startedAt: number;
298
+ transaction?: {
299
+ status: "pending" | "submitted" | "confirmed" | "failed" | "replaced";
300
+ timestamp: number;
301
+ hash: string;
302
+ blockNumber?: number | undefined;
303
+ blockHash?: string | undefined;
304
+ gasUsed?: string | undefined;
305
+ effectiveGasPrice?: string | undefined;
306
+ logs?: {
307
+ address: string;
308
+ data: string;
309
+ topics: string[];
310
+ }[] | undefined;
311
+ } | undefined;
312
+ actualOutput?: string | undefined;
313
+ error?: string | undefined;
314
+ completedAt?: number | undefined;
315
+ }, {
316
+ status: "pending" | "submitted" | "confirmed" | "failed" | "replaced";
317
+ stepId: string;
318
+ startedAt: number;
319
+ transaction?: {
320
+ status: "pending" | "submitted" | "confirmed" | "failed" | "replaced";
321
+ timestamp: number;
322
+ hash: string;
323
+ blockNumber?: number | undefined;
324
+ blockHash?: string | undefined;
325
+ gasUsed?: string | undefined;
326
+ effectiveGasPrice?: string | undefined;
327
+ logs?: {
328
+ address: string;
329
+ data: string;
330
+ topics: string[];
331
+ }[] | undefined;
332
+ } | undefined;
333
+ actualOutput?: string | undefined;
334
+ error?: string | undefined;
335
+ completedAt?: number | undefined;
336
+ }>, "many">;
337
+ actualOutput: z.ZodOptional<z.ZodString>;
338
+ totalGasUsed: z.ZodOptional<z.ZodString>;
339
+ totalGasCost: z.ZodOptional<z.ZodString>;
340
+ error: z.ZodOptional<z.ZodString>;
341
+ startedAt: z.ZodNumber;
342
+ completedAt: z.ZodOptional<z.ZodNumber>;
343
+ }, "strip", z.ZodTypeAny, {
344
+ status: "pending" | "failed" | "partial" | "completed" | "reverted";
345
+ steps: {
346
+ status: "pending" | "submitted" | "confirmed" | "failed" | "replaced";
347
+ stepId: string;
348
+ startedAt: number;
349
+ transaction?: {
350
+ status: "pending" | "submitted" | "confirmed" | "failed" | "replaced";
351
+ timestamp: number;
352
+ hash: string;
353
+ blockNumber?: number | undefined;
354
+ blockHash?: string | undefined;
355
+ gasUsed?: string | undefined;
356
+ effectiveGasPrice?: string | undefined;
357
+ logs?: {
358
+ address: string;
359
+ data: string;
360
+ topics: string[];
361
+ }[] | undefined;
362
+ } | undefined;
363
+ actualOutput?: string | undefined;
364
+ error?: string | undefined;
365
+ completedAt?: number | undefined;
366
+ }[];
367
+ startedAt: number;
368
+ routeId: string;
369
+ totalGasCost?: string | undefined;
370
+ actualOutput?: string | undefined;
371
+ error?: string | undefined;
372
+ completedAt?: number | undefined;
373
+ totalGasUsed?: string | undefined;
374
+ }, {
375
+ status: "pending" | "failed" | "partial" | "completed" | "reverted";
376
+ steps: {
377
+ status: "pending" | "submitted" | "confirmed" | "failed" | "replaced";
378
+ stepId: string;
379
+ startedAt: number;
380
+ transaction?: {
381
+ status: "pending" | "submitted" | "confirmed" | "failed" | "replaced";
382
+ timestamp: number;
383
+ hash: string;
384
+ blockNumber?: number | undefined;
385
+ blockHash?: string | undefined;
386
+ gasUsed?: string | undefined;
387
+ effectiveGasPrice?: string | undefined;
388
+ logs?: {
389
+ address: string;
390
+ data: string;
391
+ topics: string[];
392
+ }[] | undefined;
393
+ } | undefined;
394
+ actualOutput?: string | undefined;
395
+ error?: string | undefined;
396
+ completedAt?: number | undefined;
397
+ }[];
398
+ startedAt: number;
399
+ routeId: string;
400
+ totalGasCost?: string | undefined;
401
+ actualOutput?: string | undefined;
402
+ error?: string | undefined;
403
+ completedAt?: number | undefined;
404
+ totalGasUsed?: string | undefined;
405
+ }>;
406
+ type ExecutionResult = z.infer<typeof ExecutionResult>;
407
+ /**
408
+ * Execution options
409
+ */
410
+ declare const ExecutionOptions: z.ZodObject<{
411
+ gasSpeed: z.ZodDefault<z.ZodEnum<["slow", "standard", "fast", "instant"]>>;
412
+ maxGasPrice: z.ZodOptional<z.ZodString>;
413
+ mevProtection: z.ZodDefault<z.ZodEnum<["none", "flashbots", "private_mempool", "timing", "splitting"]>>;
414
+ flashbotsRelay: z.ZodOptional<z.ZodString>;
415
+ maxRetries: z.ZodDefault<z.ZodNumber>;
416
+ retryDelay: z.ZodDefault<z.ZodNumber>;
417
+ timeout: z.ZodDefault<z.ZodNumber>;
418
+ simulate: z.ZodDefault<z.ZodBoolean>;
419
+ autoApprove: z.ZodDefault<z.ZodBoolean>;
420
+ approvalBuffer: z.ZodDefault<z.ZodString>;
421
+ }, "strip", z.ZodTypeAny, {
422
+ gasSpeed: "slow" | "standard" | "fast" | "instant";
423
+ mevProtection: "none" | "flashbots" | "private_mempool" | "timing" | "splitting";
424
+ maxRetries: number;
425
+ retryDelay: number;
426
+ timeout: number;
427
+ simulate: boolean;
428
+ autoApprove: boolean;
429
+ approvalBuffer: string;
430
+ maxGasPrice?: string | undefined;
431
+ flashbotsRelay?: string | undefined;
432
+ }, {
433
+ gasSpeed?: "slow" | "standard" | "fast" | "instant" | undefined;
434
+ maxGasPrice?: string | undefined;
435
+ mevProtection?: "none" | "flashbots" | "private_mempool" | "timing" | "splitting" | undefined;
436
+ flashbotsRelay?: string | undefined;
437
+ maxRetries?: number | undefined;
438
+ retryDelay?: number | undefined;
439
+ timeout?: number | undefined;
440
+ simulate?: boolean | undefined;
441
+ autoApprove?: boolean | undefined;
442
+ approvalBuffer?: string | undefined;
443
+ }>;
444
+ type ExecutionOptions = z.infer<typeof ExecutionOptions>;
445
+ /**
446
+ * Simulation result
447
+ */
448
+ declare const SimulationResult: z.ZodObject<{
449
+ success: z.ZodBoolean;
450
+ gasUsed: z.ZodString;
451
+ output: z.ZodOptional<z.ZodString>;
452
+ error: z.ZodOptional<z.ZodString>;
453
+ logs: z.ZodArray<z.ZodObject<{
454
+ address: z.ZodString;
455
+ topics: z.ZodArray<z.ZodString, "many">;
456
+ data: z.ZodString;
457
+ }, "strip", z.ZodTypeAny, {
458
+ address: string;
459
+ data: string;
460
+ topics: string[];
461
+ }, {
462
+ address: string;
463
+ data: string;
464
+ topics: string[];
465
+ }>, "many">;
466
+ stateChanges: z.ZodOptional<z.ZodArray<z.ZodObject<{
467
+ address: z.ZodString;
468
+ key: z.ZodString;
469
+ before: z.ZodString;
470
+ after: z.ZodString;
471
+ }, "strip", z.ZodTypeAny, {
472
+ key: string;
473
+ address: string;
474
+ before: string;
475
+ after: string;
476
+ }, {
477
+ key: string;
478
+ address: string;
479
+ before: string;
480
+ after: string;
481
+ }>, "many">>;
482
+ }, "strip", z.ZodTypeAny, {
483
+ gasUsed: string;
484
+ logs: {
485
+ address: string;
486
+ data: string;
487
+ topics: string[];
488
+ }[];
489
+ success: boolean;
490
+ error?: string | undefined;
491
+ output?: string | undefined;
492
+ stateChanges?: {
493
+ key: string;
494
+ address: string;
495
+ before: string;
496
+ after: string;
497
+ }[] | undefined;
498
+ }, {
499
+ gasUsed: string;
500
+ logs: {
501
+ address: string;
502
+ data: string;
503
+ topics: string[];
504
+ }[];
505
+ success: boolean;
506
+ error?: string | undefined;
507
+ output?: string | undefined;
508
+ stateChanges?: {
509
+ key: string;
510
+ address: string;
511
+ before: string;
512
+ after: string;
513
+ }[] | undefined;
514
+ }>;
515
+ type SimulationResult = z.infer<typeof SimulationResult>;
516
+ /**
517
+ * Fallback route
518
+ */
519
+ interface FallbackRoute {
520
+ route: Route;
521
+ reason: string;
522
+ priority: number;
523
+ }
524
+ /**
525
+ * Execution context for tracking state
526
+ */
527
+ interface ExecutionContext {
528
+ routeId: string;
529
+ sender: string;
530
+ currentStep: number;
531
+ completedSteps: ExecutionStepResult[];
532
+ options: ExecutionOptions;
533
+ startedAt: number;
534
+ fallbackRoutes: FallbackRoute[];
535
+ }
536
+
537
+ /**
538
+ * Transaction builder configuration
539
+ */
540
+ interface BuilderConfig {
541
+ defaultGasBuffer?: number;
542
+ }
543
+ /**
544
+ * Transaction builder - converts route steps to executable transactions
545
+ */
546
+ declare class TransactionBuilder {
547
+ private gasOracle;
548
+ private config;
549
+ constructor(gasOracle: GasOracle, config?: BuilderConfig);
550
+ /**
551
+ * Build all transactions for a route
552
+ */
553
+ buildRoute(route: Route, sender: string, options: ExecutionOptions): Promise<TransactionRequest[]>;
554
+ /**
555
+ * Build a single step transaction
556
+ */
557
+ buildStep(step: RouteStep, sender: string, options: ExecutionOptions): Promise<TransactionRequest>;
558
+ /**
559
+ * Build approval transaction if needed
560
+ */
561
+ buildApproval(tokenAddress: string, spender: string, amount: string, _chainId: string, infinite?: boolean): {
562
+ data: string;
563
+ to: string;
564
+ };
565
+ /**
566
+ * Build transfer transaction
567
+ */
568
+ buildTransfer(tokenAddress: string, recipient: string, amount: string): {
569
+ data: string;
570
+ to: string;
571
+ };
572
+ /**
573
+ * Estimate required approvals for a route
574
+ */
575
+ getRequiredApprovals(route: Route, _sender: string): Array<{
576
+ token: string;
577
+ spender: string;
578
+ amount: string;
579
+ }>;
580
+ private buildCalldata;
581
+ private buildTransferCalldata;
582
+ private buildApproveCalldata;
583
+ private buildSwapCalldata;
584
+ private buildBridgeCalldata;
585
+ private buildWrapCalldata;
586
+ private buildUnwrapCalldata;
587
+ private applyGasBuffer;
588
+ }
589
+ /**
590
+ * Builder error codes
591
+ */
592
+ type BuilderErrorCode = 'UNSUPPORTED_CHAIN' | 'UNKNOWN_STEP_TYPE' | 'INVALID_CALLDATA';
593
+ /**
594
+ * Custom error for builder operations
595
+ */
596
+ declare class BuilderError extends Error {
597
+ code: BuilderErrorCode;
598
+ constructor(message: string, code: BuilderErrorCode);
599
+ }
600
+
601
+ /**
602
+ * MEV protection configuration
603
+ */
604
+ interface MevProtectionConfig {
605
+ flashbotsRelay?: string;
606
+ privateRpcUrls?: Record<ChainId, string>;
607
+ simulationRpc?: string;
608
+ maxBundleSize?: number;
609
+ }
610
+ /**
611
+ * Bundle submission result
612
+ */
613
+ interface BundleResult {
614
+ bundleHash: string;
615
+ submitted: boolean;
616
+ simulationResult?: SimulationResult;
617
+ error?: string;
618
+ }
619
+ /**
620
+ * MEV protection service
621
+ */
622
+ declare class MevProtection {
623
+ private config;
624
+ constructor(config?: MevProtectionConfig);
625
+ /**
626
+ * Apply MEV protection to a transaction
627
+ */
628
+ protect(_tx: TransactionRequest, signedTx: SignedTransaction, strategy: MevProtectionStrategy, chain: ChainId): Promise<{
629
+ method: string;
630
+ endpoint?: string;
631
+ bundleHash?: string;
632
+ }>;
633
+ /**
634
+ * Submit transaction bundle to Flashbots
635
+ */
636
+ submitBundle(signedTxs: SignedTransaction[], targetBlock: number, _chain: ChainId): Promise<BundleResult>;
637
+ /**
638
+ * Simulate transaction without executing
639
+ */
640
+ simulate(tx: TransactionRequest, _chain: ChainId): Promise<SimulationResult>;
641
+ /**
642
+ * Estimate MEV risk for a transaction
643
+ */
644
+ estimateMevRisk(tx: TransactionRequest, _chain: ChainId): {
645
+ riskLevel: 'low' | 'medium' | 'high';
646
+ estimatedMevCost: string;
647
+ recommendations: string[];
648
+ };
649
+ /**
650
+ * Get optimal block for transaction submission
651
+ */
652
+ getOptimalSubmissionTime(_chain: ChainId): {
653
+ targetBlock: number;
654
+ delay: number;
655
+ reason: string;
656
+ };
657
+ /**
658
+ * Check if Flashbots is available for a chain
659
+ */
660
+ isFlashbotsAvailable(chain: ChainId): boolean;
661
+ /**
662
+ * Get private RPC URL for a chain
663
+ */
664
+ getPrivateRpcUrl(chain: ChainId): string | undefined;
665
+ private useFlashbots;
666
+ private usePrivateMempool;
667
+ private useTimingProtection;
668
+ private generateBundleHash;
669
+ private simpleHash;
670
+ }
671
+ /**
672
+ * Create MEV-protected transaction options
673
+ */
674
+ declare function createMevProtectedOptions(chain: ChainId, value: string): {
675
+ strategy: MevProtectionStrategy;
676
+ reason: string;
677
+ };
678
+
679
+ export { type BuilderConfig, BuilderError, type BuilderErrorCode, type BundleResult, type ExecutionContext, ExecutionOptions, ExecutionResult, ExecutionStepResult, type FallbackRoute, MevProtection, type MevProtectionConfig, MevProtectionStrategy, SignedTransaction, SimulationResult, TransactionBuilder, TransactionReceipt, TransactionRequest, TransactionStatus, createMevProtectedOptions };
@@ -0,0 +1,31 @@
1
+ import {
2
+ BuilderError,
3
+ ExecutionOptions,
4
+ ExecutionResult,
5
+ ExecutionStepResult,
6
+ MevProtection,
7
+ MevProtectionStrategy,
8
+ SignedTransaction,
9
+ SimulationResult,
10
+ TransactionBuilder,
11
+ TransactionReceipt,
12
+ TransactionRequest,
13
+ TransactionStatus,
14
+ createMevProtectedOptions
15
+ } from "../chunk-XKFKUWJY.js";
16
+ export {
17
+ BuilderError,
18
+ ExecutionOptions,
19
+ ExecutionResult,
20
+ ExecutionStepResult,
21
+ MevProtection,
22
+ MevProtectionStrategy,
23
+ SignedTransaction,
24
+ SimulationResult,
25
+ TransactionBuilder,
26
+ TransactionReceipt,
27
+ TransactionRequest,
28
+ TransactionStatus,
29
+ createMevProtectedOptions
30
+ };
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}