@portal-hq/web 3.7.0 → 3.8.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/lifi-types.d.ts CHANGED
@@ -1,1236 +1,55 @@
1
1
  /**
2
- * Li.Fi Types - Translated from portal-android Kotlin types
3
- */
4
-
5
- /**
6
- * The way the resulting quote should be ordered
7
- */
8
- export type LifiQuoteOrder = 'FASTEST' | 'CHEAPEST'
9
-
10
- /**
11
- * Used to request a quote for a transfer of one token to another, cross chain or not
12
- */
13
- export interface LifiQuoteRequest {
14
- /**
15
- * The sending chain. Can be the chain id or chain key (required)
16
- */
17
- fromChain: string
18
- /**
19
- * The receiving chain. Can be the chain id or chain key (required)
20
- */
21
- toChain: string
22
- /**
23
- * The token that should be transferred. Can be the address or the symbol (required)
24
- */
25
- fromToken: string
26
- /**
27
- * The token that should be transferred to. Can be the address or the symbol (required)
28
- */
29
- toToken: string
30
- /**
31
- * The sending wallet address (required)
32
- */
33
- fromAddress: string
34
- /**
35
- * The amount that should be sent including all decimals (e.g. 1000000 for 1 USDC (6 decimals)) (required)
36
- */
37
- fromAmount: string
38
- /**
39
- * The receiving wallet address. If none is provided, the fromAddress will be used
40
- */
41
- toAddress?: string
42
- /**
43
- * Which kind of route should be preferred (FASTEST or CHEAPEST)
44
- */
45
- order?: LifiQuoteOrder
46
- /**
47
- * The maximum allowed slippage for the transaction as a decimal value. 0.005 represents 0.5%. Range: 0 <= x <= 1
48
- */
49
- slippage?: number
50
- /**
51
- * A string containing tracking information about the integrator of the API
52
- */
53
- integrator?: string
54
- /**
55
- * The percent of the integrator's fee that is taken from every transaction. 0.02 represents 2%. Range: 0 <= x < 1
56
- */
57
- fee?: number
58
- /**
59
- * A string containing tracking information about the referrer of the integrator
60
- */
61
- referrer?: string
62
- /**
63
- * List of bridges that are allowed for this transaction
64
- */
65
- allowBridges?: string[]
66
- /**
67
- * List of exchanges that are allowed for this transaction
68
- */
69
- allowExchanges?: string[]
70
- /**
71
- * List of bridges that are not allowed for this transaction
72
- */
73
- denyBridges?: string[]
74
- /**
75
- * List of exchanges that are not allowed for this transaction
76
- */
77
- denyExchanges?: string[]
78
- /**
79
- * List of bridges that should be preferred for this transaction
80
- */
81
- preferBridges?: string[]
82
- /**
83
- * List of exchanges that should be preferred for this transaction
84
- */
85
- preferExchanges?: string[]
86
- /**
87
- * Whether swaps or other contract calls should be allowed as part of the destination transaction of a bridge transfer (default: true)
88
- */
89
- allowDestinationCall?: boolean
90
- /**
91
- * The amount of the token to convert to gas on the destination side
92
- */
93
- fromAmountForGas?: string
94
- /**
95
- * The price impact threshold above which routes are hidden. As an example, one should specify 0.15 (15%) to hide routes with more than 15% price impact. The default is 10%.
96
- */
97
- maxPriceImpact?: number
98
- /**
99
- * Timing setting to wait for a certain amount of swap rates. Format: "minWaitTime-${minWaitTimeMs}-${startingExpectedResults}-${reduceEveryMs}"
100
- */
101
- swapStepTimingStrategies?: string[]
102
- /**
103
- * Timing setting to wait for a certain amount of routes to be generated before choosing the best one. Format: "minWaitTime-${minWaitTimeMs}-${startingExpectedResults}-${reduceEveryMs}"
104
- */
105
- routeTimingStrategies?: string[]
106
- /**
107
- * Parameter to skip transaction simulation. The quote will be returned faster but the transaction gas limit won't be accurate.
108
- */
109
- skipSimulation?: boolean
110
- }
111
-
112
- /**
113
- * Response containing a quote from the Lifi integration
114
- */
115
- export interface LifiQuoteResponse {
116
- data?: LifiQuoteData
117
- error?: string
118
- }
119
-
120
- export interface LifiQuoteData {
121
- rawResponse: LifiStep
122
- }
123
-
124
- /**
125
- * Error response when unable to find a quote for the requested transfer (404)
126
- */
127
- export interface LifiQuoteErrorResponse {
128
- /**
129
- * The error message
130
- */
131
- message: string
132
- /**
133
- * Error details containing unavailable routes information
134
- */
135
- errors?: LifiUnavailableRoutes
136
- }
137
-
138
- /**
139
- * The way the resulting routes should be ordered
140
- */
141
- export type LifiRoutesOrder = 'FASTEST' | 'CHEAPEST'
142
-
143
- /**
144
- * Type of timing strategy
145
- */
146
- export type LifiTimingStrategyType = 'minWaitTime'
147
-
148
- /**
149
- * Describes a desired any-to-any transfer and contains all information necessary to calculate the most efficient routes
150
- */
151
- export interface LifiRoutesRequest {
152
- /**
153
- * The sending chain id (required)
154
- */
155
- fromChainId: string
156
- /**
157
- * The amount that should be transferred including all decimals (e.g. 1000000 for 1 USDC (6 decimals)) (required)
158
- */
159
- fromAmount: string
160
- /**
161
- * The address of the sending Token (required)
162
- */
163
- fromTokenAddress: string
164
- /**
165
- * The id of the receiving chain (required)
166
- */
167
- toChainId: string
168
- /**
169
- * The address of the receiving Token (required)
170
- */
171
- toTokenAddress: string
172
- /**
173
- * Optional configuration for the routes
174
- */
175
- options?: LifiRoutesRequestOptions
176
- /**
177
- * The sending wallet address
178
- */
179
- fromAddress?: string
180
- /**
181
- * The receiving wallet address
182
- */
183
- toAddress?: string
184
- /**
185
- * The amount of the token to convert to gas on the destination side
186
- */
187
- fromAmountForGas?: string
188
- }
189
-
190
- /**
191
- * Optional configuration for the routes
192
- */
193
- export interface LifiRoutesRequestOptions {
194
- /**
195
- * Facilitates transfer insurance via insurace.io, ensuring secure and insured transfer of assets (deprecated)
196
- */
197
- insurance?: boolean
198
- /**
199
- * Custom string the developer who integrates LiFi can set
200
- */
201
- integrator?: string
202
- /**
203
- * The maximum allowed slippage
204
- */
205
- slippage?: number
206
- /**
207
- * Object configuring the bridges that should or should not be taken into consideration for the possibilities
208
- */
209
- bridges?: LifiToolsConfiguration
210
- /**
211
- * Object configuring the exchanges that should or should not be taken into consideration for the possibilities
212
- */
213
- exchanges?: LifiToolsConfiguration
214
- /**
215
- * The way the resulting routes should be ordered
216
- */
217
- order?: LifiRoutesOrder
218
- /**
219
- * Whether chain switches should be allowed in the routes (default: false)
220
- */
221
- allowSwitchChain?: boolean
222
- /**
223
- * Defines if we should return routes with a cross-chain bridge protocol (Connext, etc.) destination calls or not (default: true)
224
- */
225
- allowDestinationCall?: boolean
226
- /**
227
- * Integrators can set a wallet address as referrer to track them
228
- */
229
- referrer?: string
230
- /**
231
- * The percent of the integrator's fee that is taken from every transaction. The maximum fee amount should be less than 100%. Required range: 0 <= x < 1
232
- */
233
- fee?: number
234
- /**
235
- * The price impact threshold above which routes are hidden. As an example, one should specify 0.15 (15%) to hide routes with more than 15% price impact. The default is 10%.
236
- */
237
- maxPriceImpact?: number
238
- /**
239
- * Timing settings for route and swap steps
240
- */
241
- timing?: LifiTimingOptions
242
- }
243
-
244
- /**
245
- * Configuration for bridges or exchanges (allow, deny, prefer)
246
- */
247
- export interface LifiToolsConfiguration {
248
- /**
249
- * Allowed tools
250
- */
251
- allow?: string[]
252
- /**
253
- * Forbidden tools
254
- */
255
- deny?: string[]
256
- /**
257
- * Preferred tools
258
- */
259
- prefer?: string[]
260
- }
261
-
262
- /**
263
- * Timing options for routes and swap steps
264
- */
265
- export interface LifiTimingOptions {
266
- /**
267
- * Timing setting to wait for a certain amount of swap rates
268
- */
269
- swapStepTimingStrategies?: LifiTimingStrategy[]
270
- /**
271
- * Timing setting to wait for a certain amount of routes to be generated before choosing the best one
272
- */
273
- routeTimingStrategies?: LifiTimingStrategy[]
274
- }
275
-
276
- /**
277
- * Timing strategy configuration
278
- */
279
- export interface LifiTimingStrategy {
280
- /**
281
- * The timing strategy type
282
- */
283
- strategy?: LifiTimingStrategyType
284
- /**
285
- * Minimum wait time in milliseconds (range: 0 <= x <= 15000)
286
- */
287
- minWaitTimeMs?: number
288
- /**
289
- * Starting expected results (range: 0 <= x <= 100)
290
- */
291
- startingExpectedResults?: number
292
- /**
293
- * Reduce every milliseconds (range: 0 <= x <= 15000)
294
- */
295
- reduceEveryMs?: number
296
- }
297
-
298
- /**
299
- * Response containing routes from the Lifi integration
300
- */
301
- export interface LifiRoutesResponse {
302
- data?: LifiRoutesData
303
- error?: string
304
- }
305
-
306
- export interface LifiRoutesData {
307
- rawResponse: LifiRoutesRawResponse
308
- }
309
-
310
- /**
311
- * - Note: `routes` is required, `unavailableRoutes` is optional
312
- */
313
- export interface LifiRoutesRawResponse {
314
- /**
315
- * List of possible routes for the given transfer (required)
316
- */
317
- routes: LifiRoute[]
318
- /**
319
- * Routes that are unavailable for the given transfer (optional)
320
- */
321
- unavailableRoutes?: LifiUnavailableRoutes
322
- }
323
-
324
- /**
325
- * A route that can be used to realize a token transfer
326
- */
327
- export interface LifiRoute {
328
- /**
329
- * Unique identifier of the route
330
- */
331
- id: string
332
- /**
333
- * The id of the sending chain
334
- */
335
- fromChainId: string
336
- /**
337
- * The amount that should be transferred in USD
338
- */
339
- fromAmountUSD: string
340
- /**
341
- * The amount that should be transferred including all decimals
342
- */
343
- fromAmount: string
344
- /**
345
- * The sending Token
346
- */
347
- fromToken: LifiToken
348
- /**
349
- * The id of the receiving chain
350
- */
351
- toChainId: string
352
- /**
353
- * The estimated resulting amount of the toToken in USD as float with two decimals
354
- */
355
- toAmountUSD: string
356
- /**
357
- * The estimated resulting amount of the toToken including all decimals
358
- */
359
- toAmount: string
360
- /**
361
- * The minimal resulting amount of the toToken including all decimals
362
- */
363
- toAmountMin: string
364
- /**
365
- * The Token that should be transferred to
366
- */
367
- toToken: LifiToken
368
- /**
369
- * The steps required to fulfill the transfer
370
- */
371
- steps: LifiStep[]
372
- /**
373
- * Aggregation of the underlying gas costs in USD
374
- */
375
- gasCostUSD?: string
376
- /**
377
- * The sending wallet address
378
- */
379
- fromAddress?: string
380
- /**
381
- * The receiving wallet address
382
- */
383
- toAddress?: string
384
- /**
385
- * Whether a chain switch is part of the route
386
- */
387
- containsSwitchChain?: boolean
388
- /**
389
- * Tags associated with the route (e.g., "RECOMMENDED", "CHEAPEST", "FASTEST")
390
- */
391
- tags?: string[]
392
- }
393
-
394
- /**
395
- * Token information
396
- */
397
- export interface LifiToken {
398
- /**
399
- * Address of the token
400
- */
401
- address: string
402
- /**
403
- * Symbol of the token
404
- */
405
- symbol: string
406
- /**
407
- * Number of decimals the token uses
408
- */
409
- decimals: number
410
- /**
411
- * Id of the token's chain
412
- */
413
- chainId: string
414
- /**
415
- * Name of the token
416
- */
417
- name: string
418
- /**
419
- * Identifier for the token
420
- */
421
- coinKey?: string
422
- /**
423
- * Logo of the token
424
- */
425
- logoURI?: string
426
- /**
427
- * Token price in USD
428
- */
429
- priceUSD?: string
430
- }
431
-
432
- /**
433
- * Type of step in a route
434
- */
435
- export type LifiStepType = 'swap' | 'cross' | 'lifi' | 'protocol'
436
-
437
- /**
438
- * Step in a route
439
- */
440
- export interface LifiStep {
441
- /**
442
- * Unique identifier of the step
443
- */
444
- id: string
445
- /**
446
- * The type of the step (swap, cross, or lifi)
447
- */
448
- type: LifiStepType
449
- /**
450
- * The tool used for this step. E.g. relay
451
- */
452
- tool: string
453
- /**
454
- * The action of the step
455
- */
456
- action: LifiAction
457
- /**
458
- * The details of the tool used for this step. E.g. relay
459
- */
460
- toolDetails?: LifiToolDetails
461
- /**
462
- * The estimation for the step
463
- */
464
- estimate?: LifiEstimate
465
- /**
466
- * Internal steps included in this step
467
- */
468
- includedSteps?: LifiInternalStep[]
469
- /**
470
- * A string containing tracking information about the integrator of the API
471
- */
472
- integrator?: string
473
- /**
474
- * A string containing tracking information about the referrer of the integrator
475
- */
476
- referrer?: string
477
- /**
478
- * An object containing status information about the execution: https://docs.li.fi/api-reference/advanced/populate-a-step-with-transaction-data#body-execution
479
- */
480
- execution?: any
481
- /**
482
- * An ether.js TransactionRequest that can be triggered using a wallet provider
483
- */
484
- transactionRequest?: LifiTransactionRequest
485
- /**
486
- * The unique transaction ID for tracking
487
- */
488
- transactionId?: string
489
- /**
490
- * Aggregation of the underlying gas costs in USD
491
- */
492
- gasCostUSD?: string
493
- /**
494
- * The sending wallet address
495
- */
496
- fromAddress?: string
497
- /**
498
- * The receiving wallet address
499
- */
500
- toAddress?: string
501
- /**
502
- * Whether a chain switch is part of the route
503
- */
504
- containsSwitchChain?: boolean
505
- }
506
-
507
- export interface LifiTransactionRequest {
508
- chainId?: string
509
- data: string
510
- from?: string
511
- gasLimit?: string
512
- gasPrice?: string
513
- to?: string
514
- value?: string
515
- }
516
-
517
- /**
518
- * Tool details
519
- */
520
- export interface LifiToolDetails {
521
- /**
522
- * The tool key
523
- */
524
- key?: string
525
- /**
526
- * The tool name
527
- */
528
- name?: string
529
- /**
530
- * The tool logo URL
531
- */
532
- logoURI?: string
533
- /**
534
- * The tool website URL
535
- */
536
- webUrl?: string
537
- }
538
-
539
- /**
540
- * Action within a step
541
- */
542
- export interface LifiAction {
543
- /**
544
- * The id of the chain where the transfer should start
545
- */
546
- fromChainId: string
547
- /**
548
- * The amount that should be transferred including all decimals
549
- */
550
- fromAmount: string
551
- /**
552
- * The sending token
553
- */
554
- fromToken: LifiToken
555
- /**
556
- * The id of the chain where the transfer should end
557
- */
558
- toChainId: string
559
- /**
560
- * The token that should be transferred to
561
- */
562
- toToken: LifiToken
563
- /**
564
- * The maximum allowed slippage
565
- */
566
- slippage?: number
567
- /**
568
- * The sending wallet address
569
- */
570
- fromAddress?: string
571
- /**
572
- * The receiving wallet address
573
- */
574
- toAddress?: string
575
- /**
576
- * The amount of gas to be consumed on the destination chain
577
- */
578
- destinationGasConsumption?: string
579
- }
580
-
581
- /**
582
- * Estimate for a step
583
- */
584
- export interface LifiEstimate {
585
- /**
586
- * The tool that is being used for this step
587
- */
588
- tool: string
589
- /**
590
- * The amount that should be transferred including all decimals
591
- */
592
- fromAmount: string
593
- /**
594
- * The estimated resulting amount of the toToken including all decimals
595
- */
596
- toAmount: string
597
- /**
598
- * The minimal outcome of the transfer including all decimals
599
- */
600
- toAmountMin: string
601
- /**
602
- * The contract address for the approval
603
- */
604
- approvalAddress: string
605
- /**
606
- * The time needed to complete the following step (in seconds)
607
- */
608
- executionDuration: number
609
- /**
610
- * The amount that should be transferred in USD equivalent
611
- */
612
- fromAmountUSD?: string
613
- /**
614
- * The estimated resulting amount of the toToken in USD equivalent
615
- */
616
- toAmountUSD?: string
617
- /**
618
- * Fees included in the transfer
619
- */
620
- feeCosts?: LifiFeeCost[]
621
- /**
622
- * Gas costs included in the transfer
623
- */
624
- gasCosts?: LifiGasCost[]
625
- /**
626
- * Arbitrary data that depends on the used tool
627
- */
628
- data?: LifiEstimateData
629
- }
630
-
631
- /**
632
- * Fee cost information
633
- */
634
- export interface LifiFeeCost {
635
- /**
636
- * Name of the fee
637
- */
638
- name: string
639
- /**
640
- * Percentage of how much fees are taken
641
- */
642
- percentage: string
643
- /**
644
- * The Token in which the fees are taken
645
- */
646
- token: LifiToken
647
- /**
648
- * The amount of fees in USD
649
- */
650
- amountUSD: string
651
- /**
652
- * Whether fee is included into transfer's fromAmount
653
- */
654
- included: boolean
655
- /**
656
- * Description of the fee costs
657
- */
658
- description?: string
659
- /**
660
- * The amount of fees
661
- */
662
- amount?: string
663
- /**
664
- * Fee split details between integrator and Li.Fi
665
- */
666
- feeSplit?: LifiFeeSplit
667
- }
668
-
669
- /**
670
- * Fee split between integrator and Li.Fi
671
- */
672
- export interface LifiFeeSplit {
673
- /**
674
- * The integrator's portion of the fee
675
- */
676
- integratorFee?: string
677
- /**
678
- * The Li.Fi portion of the fee
679
- */
680
- lifiFee?: string
681
- }
682
-
683
- /**
684
- * Type of gas cost
685
- */
686
- export type LifiGasCostType = 'SUM' | 'APPROVE' | 'SEND'
687
-
688
- /**
689
- * Gas cost information
690
- */
691
- export interface LifiGasCost {
692
- /**
693
- * Can be one of SUM, APPROVE or SEND
694
- */
695
- type: LifiGasCostType
696
- /**
697
- * Amount of the gas cost
698
- */
699
- amount: string
700
- /**
701
- * The used gas token
702
- */
703
- token: LifiToken
704
- /**
705
- * Suggested current standard price for the chain
706
- */
707
- price?: string
708
- /**
709
- * Estimation how much gas will be needed
710
- */
711
- estimate?: string
712
- /**
713
- * Suggested gas limit
714
- */
715
- limit?: string
716
- /**
717
- * Amount of the gas cost in USD
718
- */
719
- amountUSD?: string
720
- }
721
-
722
- /**
723
- * Estimate data (arbitrary data that depends on the tool)
724
- */
725
- export interface LifiEstimateData {
726
- /**
727
- * Bid information for the transfer
728
- */
729
- bid?: LifiBid
730
- /**
731
- * Bid signature
732
- */
733
- bidSignature?: string
734
- /**
735
- * Gas fee in receiving token
736
- */
737
- gasFeeInReceivingToken?: string
738
- /**
739
- * Total fee
740
- */
741
- totalFee?: string
742
- /**
743
- * Meta transaction relayer fee
744
- */
745
- metaTxRelayerFee?: string
746
- /**
747
- * Router fee
748
- */
749
- routerFee?: string
750
- }
751
-
752
- /**
753
- * Bid information
754
- */
755
- export interface LifiBid {
756
- /**
757
- * User address
758
- */
759
- user?: string
760
- /**
761
- * Router address
762
- */
763
- router?: string
764
- /**
765
- * Initiator address
766
- */
767
- initiator?: string
768
- /**
769
- * Sending chain ID
770
- */
771
- sendingChainId?: string
772
- /**
773
- * Sending asset ID (token address)
774
- */
775
- sendingAssetId?: string
776
- /**
777
- * Amount to send
778
- */
779
- amount?: string
780
- /**
781
- * Receiving chain ID
782
- */
783
- receivingChainId?: string
784
- /**
785
- * Receiving asset ID (token address)
786
- */
787
- receivingAssetId?: string
788
- /**
789
- * Amount to receive
790
- */
791
- amountReceived?: string
792
- /**
793
- * Receiving address
794
- */
795
- receivingAddress?: string
796
- /**
797
- * Transaction ID
798
- */
799
- transactionId?: string
800
- /**
801
- * Expiry timestamp
802
- */
803
- expiry?: number
804
- /**
805
- * Call data hash
806
- */
807
- callDataHash?: string
808
- /**
809
- * Call to address
810
- */
811
- callTo?: string
812
- /**
813
- * Encrypted call data
814
- */
815
- encryptedCallData?: string
816
- /**
817
- * Sending chain transaction manager address
818
- */
819
- sendingChainTxManagerAddress?: string
820
- /**
821
- * Receiving chain transaction manager address
822
- */
823
- receivingChainTxManagerAddress?: string
824
- /**
825
- * Bid expiry timestamp
826
- */
827
- bidExpiry?: number
828
- }
829
-
830
- /**
831
- * Internal step (used in includedSteps)
832
- */
833
- export interface LifiInternalStep {
834
- /**
835
- * Unique identifier of the step
836
- */
837
- id: string
838
- /**
839
- * The type of the step (swap, cross, or lifi)
840
- */
841
- type: LifiStepType
842
- /**
843
- * The tool used for this step. E.g. allbridge
844
- */
845
- tool: string
846
- /**
847
- * The details of the tool used for this step. E.g. allbridge
848
- */
849
- toolDetails: LifiToolDetails
850
- /**
851
- * Object describing what happens in a Step
852
- */
853
- action: LifiAction
854
- /**
855
- * An estimate for the current transfer
856
- */
857
- estimate: LifiEstimate
858
- }
859
-
860
- /**
861
- * Unavailable routes information
862
- */
863
- export interface LifiUnavailableRoutes {
864
- /**
865
- * An object containing information about routes that were intentionally filtered out
866
- */
867
- filteredOut?: LifiFilteredRoute[]
868
- /**
869
- * An object containing information about failed routes
870
- */
871
- failed?: LifiFailedRoute[]
872
- }
873
-
874
- /**
875
- * Filtered out route
876
- */
877
- export interface LifiFilteredRoute {
878
- /**
879
- * The complete representation of the attempted route (e.g., "100:USDC-hop-137:USDC-137:USDC~137:SUSHI")
880
- */
881
- overallPath?: string
882
- /**
883
- * Our best attempt at describing the failure
884
- */
885
- reason?: string
886
- }
887
-
888
- /**
889
- * Failed route
890
- */
891
- export interface LifiFailedRoute {
892
- /**
893
- * The complete representation of the attempted route (e.g., "100:USDC-hop-137:USDC-137:USDC~137:SUSHI")
894
- */
895
- overallPath?: string
896
- /**
897
- * An object with all subpaths that generated one or more errors
898
- */
899
- subpaths?: Record<string, LifiSubpathError>
900
- }
901
-
902
- /**
903
- * Subpath error information
904
- */
905
- export interface LifiSubpathError {
906
- /**
907
- * The type of error that occurred
908
- */
909
- errorType?: LifiErrorType
910
- /**
911
- * The error code
912
- */
913
- code?: LifiErrorCode
914
- /**
915
- * Object describing what happens in a Step
916
- */
917
- action?: LifiAction
918
- /**
919
- * The tool that emitted the error
920
- */
921
- tool?: string
922
- /**
923
- * A human-readable message describing the error
924
- */
925
- message?: string
926
- }
927
-
928
- /**
929
- * Error type
930
- */
931
- export type LifiErrorType = 'NO_QUOTE'
932
-
933
- /**
934
- * Error code
935
- */
936
- export type LifiErrorCode =
937
- | 'NO_POSSIBLE_ROUTE'
938
- | 'INSUFFICIENT_LIQUIDITY'
939
- | 'TOOL_TIMEOUT'
940
- | 'UNKNOWN_ERROR'
941
- | 'RPC_ERROR'
942
- | 'AMOUNT_TOO_LOW'
943
- | 'AMOUNT_TOO_HIGH'
944
- | 'FEES_HIGHER_THAN_AMOUNT'
945
- | 'DIFFERENT_RECIPIENT_NOT_SUPPORTED'
946
- | 'TOOL_SPECIFIC_ERROR'
947
- | 'CANNOT_GUARANTEE_MIN_AMOUNT'
948
- | 'RATE_LIMIT_EXCEEDED'
949
-
950
- /**
951
- * Bridging tools supported for status check
952
- */
953
- export type LifiStatusBridge =
954
- | 'hop'
955
- | 'cbridge'
956
- | 'celercircle'
957
- | 'optimism'
958
- | 'polygon'
959
- | 'arbitrum'
960
- | 'avalanche'
961
- | 'across'
962
- | 'gnosis'
963
- | 'omni'
964
- | 'relay'
965
- | 'celerim'
966
- | 'symbiosis'
967
- | 'thorswap'
968
- | 'squid'
969
- | 'allbridge'
970
- | 'mayan'
971
- | 'debridge'
972
- | 'chainflip'
973
-
974
- /**
975
- * Used to check the status of a cross chain transfer
976
- */
977
- export interface LifiStatusRequest {
978
- /**
979
- * The transaction hash on the sending chain, destination chain or lifi step id (required)
980
- */
981
- txHash: string
982
- /**
983
- * The bridging tool used for the transfer
984
- */
985
- bridge?: LifiStatusBridge
986
- /**
987
- * The sending chain. Can be the chain id or chain key
988
- */
989
- fromChain?: string
990
- /**
991
- * The receiving chain. Can be the chain id or chain key
992
- */
993
- toChain?: string
994
- }
995
-
996
- /**
997
- * Response containing the status of a cross chain transfer from the Lifi integration
998
- */
999
- export interface LifiStatusResponse {
1000
- data?: LifiStatusData
1001
- error?: string
1002
- }
1003
-
1004
- export interface LifiStatusData {
1005
- rawResponse: LifiStatusRawResponse
1006
- }
1007
-
1008
- /**
1009
- * The current status of the transfer
1010
- */
1011
- export type LifiTransferStatus =
1012
- | 'NOT_FOUND'
1013
- | 'INVALID'
1014
- | 'PENDING'
1015
- | 'DONE'
1016
- | 'FAILED'
1017
-
1018
- /**
1019
- * A more specific substatus for PENDING and DONE statuses
1020
- */
1021
- export type LifiTransferSubstatus =
1022
- | 'WAIT_SOURCE_CONFIRMATIONS'
1023
- | 'WAIT_DESTINATION_TRANSACTION'
1024
- | 'BRIDGE_NOT_AVAILABLE'
1025
- | 'CHAIN_NOT_AVAILABLE'
1026
- | 'REFUND_IN_PROGRESS'
1027
- | 'UNKNOWN_ERROR'
1028
- | 'COMPLETED'
1029
- | 'PARTIAL'
1030
- | 'REFUNDED'
1031
-
1032
- /**
1033
- * Contains the current status of a cross chain transfer
1034
- */
1035
- export interface LifiStatusRawResponse {
1036
- /**
1037
- * The transaction on the sending chain (required)
1038
- */
1039
- sending: LifiTransactionInfo
1040
- /**
1041
- * The transaction on the receiving chain (can be partial with just chainId)
1042
- */
1043
- receiving?: LifiReceivingInfo
1044
- /**
1045
- * An array of fee costs for the transaction
1046
- */
1047
- feeCosts?: LifiFeeCost[]
1048
- /**
1049
- * The current status of the transfer (required)
1050
- */
1051
- status: LifiTransferStatus
1052
- /**
1053
- * A more specific substatus (available for PENDING and DONE statuses)
1054
- */
1055
- substatus?: LifiTransferSubstatus
1056
- /**
1057
- * A message that describes the substatus
1058
- */
1059
- substatusMessage?: string
1060
- /**
1061
- * The tool used for this transfer (required)
1062
- */
1063
- tool: string
1064
- /**
1065
- * The ID of this transfer (NOT a transaction hash)
1066
- */
1067
- transactionId?: string
1068
- /**
1069
- * The address of the sender
1070
- */
1071
- fromAddress?: string
1072
- /**
1073
- * The address of the receiver
1074
- */
1075
- toAddress?: string
1076
- /**
1077
- * The link to the Li.Fi explorer
1078
- */
1079
- lifiExplorerLink?: string
1080
- /**
1081
- * The link to the bridge explorer
1082
- */
1083
- bridgeExplorerLink?: string
1084
- /**
1085
- * The transaction metadata which includes integrator's string, etc.
1086
- */
1087
- metadata?: LifiMetadata
1088
- }
1089
-
1090
- /**
1091
- * Receiving chain information (can be partial or full transaction info)
1092
- */
1093
- export interface LifiReceivingInfo {
1094
- /**
1095
- * The id of the chain
1096
- */
1097
- chainId?: string
1098
- /**
1099
- * Full transaction information (if available)
1100
- */
1101
- txHash?: string
1102
- txLink?: string
1103
- token?: LifiToken
1104
- amount?: string
1105
- gasToken?: LifiToken
1106
- gasAmount?: string
1107
- gasAmountUSD?: string
1108
- gasPrice?: string
1109
- gasUsed?: string
1110
- timestamp?: number
1111
- value?: string
1112
- includedSteps?: LifiIncludedSwapStep[]
1113
- }
1114
-
1115
- /**
1116
- * Transaction information
1117
- */
1118
- export interface LifiTransactionInfo {
1119
- /**
1120
- * The hash of the transaction (required)
1121
- */
1122
- txHash: string
1123
- /**
1124
- * Link to a block explorer showing the transaction (required)
1125
- */
1126
- txLink: string
1127
- /**
1128
- * The amount of the transaction (required)
1129
- */
1130
- amount: string
1131
- /**
1132
- * The amount of the transaction in USD
1133
- */
1134
- amountUSD?: string
1135
- /**
1136
- * Information about the token (required)
1137
- */
1138
- token: LifiToken
1139
- /**
1140
- * The id of the chain (required)
1141
- */
1142
- chainId: string
1143
- /**
1144
- * The token in which gas was paid
1145
- */
1146
- gasToken?: LifiToken
1147
- /**
1148
- * The amount of the gas that was paid
1149
- */
1150
- gasAmount?: string
1151
- /**
1152
- * The amount of the gas that was paid in USD
1153
- */
1154
- gasAmountUSD?: string
1155
- /**
1156
- * The price of the gas
1157
- */
1158
- gasPrice?: string
1159
- /**
1160
- * The amount of the gas that was used
1161
- */
1162
- gasUsed?: string
1163
- /**
1164
- * The transaction timestamp
1165
- */
1166
- timestamp?: number
1167
- /**
1168
- * The transaction value
1169
- */
1170
- value?: string
1171
- /**
1172
- * An array of swap or protocol steps included in the Li.Fi transaction
1173
- */
1174
- includedSteps?: LifiIncludedSwapStep[]
1175
- }
1176
-
1177
- /**
1178
- * Included swap or protocol step in the status response
1179
- */
1180
- export interface LifiIncludedSwapStep {
1181
- /**
1182
- * The tool used for this step
1183
- */
1184
- tool?: string
1185
- /**
1186
- * The details of the tool used for this step (e.g. `1inch` or `feeProtocol`)
1187
- */
1188
- toolDetails?: LifiToolDetails
1189
- /**
1190
- * The amount that was sent to the tool
1191
- */
1192
- fromAmount?: string
1193
- /**
1194
- * The token that was sent to the tool
1195
- */
1196
- fromToken?: LifiToken
1197
- /**
1198
- * The amount that was received from the tool
1199
- */
1200
- toAmount?: string
1201
- /**
1202
- * The token that was received from the tool
1203
- */
1204
- toToken?: LifiToken
1205
- /**
1206
- * The amount that was sent to the bridge
1207
- */
1208
- bridgedAmount?: string
1209
- }
1210
-
1211
- /**
1212
- * Transaction metadata
1213
- */
1214
- export interface LifiMetadata {
1215
- /**
1216
- * Integrator ID
1217
- */
1218
- integrator?: string
1219
- }
1220
-
1221
- /**
1222
- * Request for step transaction - type alias for LifiStep
1223
- */
1224
- export type LifiStepTransactionRequest = LifiStep
1225
-
1226
- /**
1227
- * Response containing a step with transaction data from the Lifi integration
1228
- */
1229
- export interface LifiStepTransactionResponse {
1230
- data?: LifiStepTransactionData
1231
- error?: string
1232
- }
1233
-
1234
- export interface LifiStepTransactionData {
1235
- rawResponse: LifiStep
1236
- }
2
+ * Re-export all Lifi types from shared types
3
+ */
4
+ export type {
5
+ LifiQuoteOrder,
6
+ LifiQuoteRequest,
7
+ LifiQuoteResponse,
8
+ LifiQuoteData,
9
+ LifiQuoteErrorResponse,
10
+ LifiRoutesOrder,
11
+ LifiTimingStrategyType,
12
+ LifiRoutesRequest,
13
+ LifiRoutesRequestOptions,
14
+ LifiToolsConfiguration,
15
+ LifiTimingOptions,
16
+ LifiTimingStrategy,
17
+ LifiRoutesResponse,
18
+ LifiRoutesData,
19
+ LifiRoutesRawResponse,
20
+ LifiRoute,
21
+ LifiToken,
22
+ LifiStepType,
23
+ LifiStep,
24
+ LifiTransactionRequest,
25
+ LifiToolDetails,
26
+ LifiAction,
27
+ LifiEstimate,
28
+ LifiFeeCost,
29
+ LifiFeeSplit,
30
+ LifiGasCostType,
31
+ LifiGasCost,
32
+ LifiEstimateData,
33
+ LifiBid,
34
+ LifiInternalStep,
35
+ LifiUnavailableRoutes,
36
+ LifiFilteredRoute,
37
+ LifiFailedRoute,
38
+ LifiSubpathError,
39
+ LifiErrorType,
40
+ LifiErrorCode,
41
+ LifiStatusBridge,
42
+ LifiStatusRequest,
43
+ LifiStatusResponse,
44
+ LifiStatusData,
45
+ LifiTransferStatus,
46
+ LifiTransferSubstatus,
47
+ LifiStatusRawResponse,
48
+ LifiReceivingInfo,
49
+ LifiTransactionInfo,
50
+ LifiIncludedSwapStep,
51
+ LifiMetadata,
52
+ LifiStepTransactionRequest,
53
+ LifiStepTransactionResponse,
54
+ LifiStepTransactionData,
55
+ } from './src/shared/types/lifi'