@liberfi.io/ui-trade 0.1.1 → 0.1.3

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/dist/index.d.mts CHANGED
@@ -1,5 +1,9 @@
1
- import { Chain, API } from '@liberfi.io/types';
1
+ import * as _liberfi_io_types from '@liberfi.io/types';
2
+ import { Chain, API, Token, Portfolio } from '@liberfi.io/types';
2
3
  import { WalletAdapter } from '@liberfi.io/wallet-connector';
4
+ import * as react_jsx_runtime from 'react/jsx-runtime';
5
+ import { ReactNode } from 'react';
6
+ import { PredefinedToken } from '@liberfi.io/utils';
3
7
 
4
8
  /**
5
9
  * Input parameters for the `swap()` function returned by {@link useSwap}.
@@ -50,6 +54,38 @@ interface UseSwapOptions {
50
54
  /** Called when an error occurs at any phase of the swap flow. */
51
55
  onError?: (error: Error, phase: SwapPhase) => void;
52
56
  }
57
+ /** Options for the {@link useSwapRoutePolling} hook. */
58
+ interface UseSwapRoutePollingOptions {
59
+ /** Polling interval in ms. Defaults to 12000 (12s). */
60
+ interval?: number;
61
+ /** Pause polling (e.g. during swap execution). */
62
+ paused?: boolean;
63
+ /** Called when a route fetch fails. */
64
+ onError?: (error: Error) => void;
65
+ }
66
+ /** Configuration values for a single trade preset (slippage, fees, MEV). */
67
+ interface TradePresetValues {
68
+ /** Slippage tolerance, 0-100 (percent). `null` = use default. */
69
+ slippage: number | null;
70
+ /** Priority fee in native token units. `null` = use default. */
71
+ priorityFee: number | null;
72
+ /** Tip fee in native token units. `null` = use default. */
73
+ tipFee: number | null;
74
+ /** Whether automatic fee estimation is enabled. */
75
+ autoFee: boolean;
76
+ /** Maximum fee cap when auto-fee is on (native token units). */
77
+ maxAutoFee: number | null;
78
+ /** Anti-MEV protection level. */
79
+ antiMev: "off" | "reduced" | "secure";
80
+ /** Custom RPC endpoint URL. `null` = use default. */
81
+ customRPC: string | null;
82
+ }
83
+ /** Default preset values matching Solana-typical settings. */
84
+ declare const DEFAULT_TRADE_PRESET: TradePresetValues;
85
+ /** Default quick-buy amounts (native token units). */
86
+ declare const DEFAULT_BUY_AMOUNTS: number[];
87
+ /** Default quick-sell percentages. */
88
+ declare const DEFAULT_SELL_PERCENTAGES: number[];
53
89
  /** Confirmation status of a tracked transaction. */
54
90
  type TxConfirmationStatus = "idle" | "pending" | "confirmed" | "failed";
55
91
  /** Options for the {@link useTxConfirmation} hook. */
@@ -77,6 +113,21 @@ declare function useSwap(options?: UseSwapOptions): {
77
113
  isSwapping: boolean;
78
114
  };
79
115
 
116
+ /**
117
+ * Hook that polls for swap route quotes at a configurable interval.
118
+ *
119
+ * Built on top of `useSwapRouteQuery` (TanStack Query) — automatically
120
+ * deduplicates requests, caches results, and invalidates when params change.
121
+ *
122
+ * Polling pauses when `paused` is true (e.g. during swap execution) or
123
+ * when required params are missing.
124
+ */
125
+ declare function useSwapRoutePolling(params: Partial<API.SwapParams>, options?: UseSwapRoutePollingOptions): {
126
+ route: _liberfi_io_types.SwapRoute | undefined;
127
+ isRouting: boolean;
128
+ error: Error | null;
129
+ };
130
+
80
131
  interface TrackedTx {
81
132
  chain: Chain;
82
133
  txHash: string;
@@ -104,6 +155,439 @@ declare function useTxConfirmation(options?: UseTxConfirmationOptions): {
104
155
  transactions: Map<string, TrackedTx>;
105
156
  };
106
157
 
158
+ /** Parameters for {@link useSwapScript}. */
159
+ interface UseSwapScriptParams {
160
+ /** Target chain */
161
+ chain: Chain;
162
+ /** Initial from-token address */
163
+ from?: string;
164
+ /** Initial to-token address */
165
+ to?: string;
166
+ /** Called when the swap completes (success or failure) */
167
+ onComplete?: (result: {
168
+ success: boolean;
169
+ txHash?: string;
170
+ }) => void;
171
+ }
172
+ /** Return value of {@link useSwapScript}. */
173
+ interface UseSwapScriptResult {
174
+ /** Currently selected from-token address */
175
+ fromTokenAddress: string;
176
+ /** Currently selected to-token address */
177
+ toTokenAddress: string;
178
+ /** Update the from-token address */
179
+ setFromTokenAddress: (addr: string) => void;
180
+ /** Update the to-token address */
181
+ setToTokenAddress: (addr: string) => void;
182
+ /** From-token metadata (name, symbol, decimals, price, ...) */
183
+ fromToken: Token | null;
184
+ /** To-token metadata */
185
+ toToken: Token | null;
186
+ /** User's from-token balance */
187
+ fromBalance: Portfolio | null;
188
+ /** User's to-token balance */
189
+ toBalance: Portfolio | null;
190
+ /** Human-readable amount entered by the user */
191
+ amount: string | undefined;
192
+ /** Update the amount */
193
+ setAmount: (v: string | undefined) => void;
194
+ /** Set amount to half of the from-token balance */
195
+ setHalfAmount: () => void;
196
+ /** Set amount to the full from-token balance */
197
+ setMaxAmount: () => void;
198
+ /** Amount converted to smallest unit using token decimals */
199
+ amountInDecimals: string | undefined;
200
+ /** Amount converted to USD using token price */
201
+ amountInUsd: string | undefined;
202
+ /** Formatted output amount from the route (human-readable) */
203
+ outputAmount: string | undefined;
204
+ /** Output amount converted to USD using to-token price */
205
+ outputAmountInUsd: string | undefined;
206
+ /** Current swap route quote */
207
+ route: API.SwapRoute | undefined;
208
+ /** Whether a route is currently being fetched */
209
+ isRouting: boolean;
210
+ /** Route fetch error, if any */
211
+ routeError: Error | null;
212
+ /** Execute the swap (route -> sign -> send) */
213
+ swap: () => Promise<void>;
214
+ /** Whether a swap is currently in progress */
215
+ isSwapping: boolean;
216
+ /** Confirmation status of the most recent transaction */
217
+ txStatus: TxConfirmationStatus;
218
+ /** Whether initial data (tokens, balances) is still loading */
219
+ isLoading: boolean;
220
+ }
221
+ /** Props for {@link SwapWidget}. */
222
+ interface SwapWidgetProps {
223
+ /** Target chain */
224
+ chain: Chain;
225
+ /** Initial from-token address */
226
+ from?: string;
227
+ /** Initial to-token address */
228
+ to?: string;
229
+ /** Called when the swap completes (success or failure) */
230
+ onComplete?: (result: {
231
+ success: boolean;
232
+ txHash?: string;
233
+ }) => void;
234
+ /** External style customization */
235
+ className?: string;
236
+ }
237
+ /** Props for {@link SwapUI}. */
238
+ interface SwapUIProps {
239
+ /** From-token metadata */
240
+ fromToken: Token | null;
241
+ /** To-token metadata */
242
+ toToken: Token | null;
243
+ /** User's from-token balance */
244
+ fromBalance: Portfolio | null;
245
+ /** User's to-token balance */
246
+ toBalance: Portfolio | null;
247
+ /** Human-readable amount */
248
+ amount: string | undefined;
249
+ /** Amount in USD */
250
+ amountInUsd: string | undefined;
251
+ /** Amount change handler */
252
+ onAmountChange: (v: string | undefined) => void;
253
+ /** Set amount to half of the from-token balance */
254
+ onHalfAmount?: () => void;
255
+ /** Set amount to the full from-token balance */
256
+ onMaxAmount?: () => void;
257
+ /** Formatted output amount (human-readable) */
258
+ outputAmount: string | undefined;
259
+ /** Output amount in USD */
260
+ outputAmountInUsd: string | undefined;
261
+ /** From-token selection handler */
262
+ onFromTokenSelect: (addr: string) => void;
263
+ /** To-token selection handler */
264
+ onToTokenSelect: (addr: string) => void;
265
+ /** Current swap route quote */
266
+ route: API.SwapRoute | undefined;
267
+ /** Whether a route is being fetched */
268
+ isRouting: boolean;
269
+ /** Route error */
270
+ routeError: Error | null;
271
+ /** Open preview modal before swap */
272
+ onPreview: () => void;
273
+ /** Whether a swap is in progress */
274
+ isSwapping: boolean;
275
+ /** External style customization */
276
+ className?: string;
277
+ }
278
+ /** Props for {@link SwapPreviewModal}. */
279
+ interface SwapPreviewModalProps {
280
+ /** Whether the modal is open */
281
+ isOpen: boolean;
282
+ /** Modal open/close change handler */
283
+ onOpenChange: (isOpen: boolean) => void;
284
+ /** From-token metadata */
285
+ fromToken: Token | null;
286
+ /** To-token metadata */
287
+ toToken: Token | null;
288
+ /** User's from-token balance */
289
+ fromBalance: Portfolio | null;
290
+ /** Input amount (human-readable) */
291
+ inputAmount: string | undefined;
292
+ /** Input amount in USD */
293
+ inputAmountInUsd: string | undefined;
294
+ /** Output amount (human-readable) */
295
+ outputAmount: string | undefined;
296
+ /** Output amount in USD */
297
+ outputAmountInUsd: string | undefined;
298
+ /** Current swap route */
299
+ route: API.SwapRoute | undefined;
300
+ /** Whether a route is being fetched */
301
+ isRouting: boolean;
302
+ /** Route error */
303
+ routeError: Error | null;
304
+ /** Confirm swap handler */
305
+ onConfirm: () => void;
306
+ /** Whether a swap is in progress */
307
+ isSwapping: boolean;
308
+ }
309
+
310
+ /**
311
+ * Script hook that encapsulates all data fetching and state management
312
+ * for the swap form.
313
+ *
314
+ * Pure TypeScript — no JSX, no UI imports.
315
+ */
316
+ declare function useSwapScript(params: UseSwapScriptParams): UseSwapScriptResult;
317
+
318
+ /**
319
+ * Swap widget — thin orchestration layer.
320
+ *
321
+ * Calls `useSwapScript` to fetch all data, renders `SwapUI` for the form
322
+ * and `SwapPreviewModal` for pre-swap confirmation.
323
+ *
324
+ * For custom UIs, use `useSwapScript` directly with your own presentation.
325
+ */
326
+ declare function SwapWidget({ chain, from, to, onComplete, className, }: SwapWidgetProps): react_jsx_runtime.JSX.Element;
327
+
328
+ /**
329
+ * Pure presentational component for the swap form.
330
+ *
331
+ * Receives all data and callbacks via props — no API calls, no subscriptions.
332
+ * Consumers can replace this component entirely while reusing `useSwapScript`.
333
+ */
334
+ declare function SwapUI({ fromToken, toToken, fromBalance, toBalance, amount, amountInUsd, onAmountChange, onHalfAmount, onMaxAmount, outputAmount, outputAmountInUsd, onFromTokenSelect, onToTokenSelect, route, isRouting, routeError, onPreview, isSwapping, className, }: SwapUIProps): react_jsx_runtime.JSX.Element;
335
+
336
+ /**
337
+ * Modal that previews swap details before confirmation.
338
+ *
339
+ * Pure presentational — all data and callbacks received via props.
340
+ * Shows from/to token cards, expandable route plan details,
341
+ * and a confirm button.
342
+ */
343
+ declare function SwapPreviewModal({ isOpen, onOpenChange, fromToken, toToken, fromBalance, inputAmount, inputAmountInUsd, outputAmount, outputAmountInUsd, route, isRouting, routeError, onConfirm, isSwapping, }: SwapPreviewModalProps): react_jsx_runtime.JSX.Element;
344
+
345
+ /** Parameters for {@link useInstantTradeScript}. */
346
+ interface UseInstantTradeScriptParams {
347
+ /** Target chain */
348
+ chain: Chain;
349
+ /** Address of the token being traded (the non-native side) */
350
+ tokenAddress: string;
351
+ /** Called when a swap transaction is successfully submitted */
352
+ onSwapSubmitted?: (result: SwapResult) => void;
353
+ /** Called when a swap error occurs at any phase */
354
+ onSwapError?: (error: Error, phase: SwapPhase) => void;
355
+ }
356
+ /** Return value of {@link useInstantTradeScript}. */
357
+ interface UseInstantTradeScriptResult {
358
+ chain: Chain;
359
+ tokenAddress: string;
360
+ nativeToken: PredefinedToken | undefined;
361
+ tokenInfo: Token | null;
362
+ nativeBalance: Portfolio | null;
363
+ tokenBalance: Portfolio | null;
364
+ direction: "buy" | "sell";
365
+ setDirection: (d: "buy" | "sell") => void;
366
+ amount: number | undefined;
367
+ setAmount: (v: number | undefined) => void;
368
+ buyPreset: number;
369
+ setBuyPreset: (p: number) => void;
370
+ sellPreset: number;
371
+ setSellPreset: (p: number) => void;
372
+ currentPresetValues: TradePresetValues;
373
+ settings: InstantTradeSettings;
374
+ updateBuySettings: (s: BuySettings) => void;
375
+ updateSellSettings: (s: SellSettings) => void;
376
+ showSettings: boolean;
377
+ handlePresetClick: (preset: number) => void;
378
+ swap: () => Promise<void>;
379
+ isSwapping: boolean;
380
+ submitText: string;
381
+ isDisabled: boolean;
382
+ isLoading: boolean;
383
+ }
384
+ /** Props for {@link InstantTradeWidget}. */
385
+ interface InstantTradeWidgetProps {
386
+ /** Target chain */
387
+ chain: Chain;
388
+ /** Address of the token being traded */
389
+ tokenAddress: string;
390
+ /** Called when a swap transaction is submitted */
391
+ onSwapSubmitted?: (result: SwapResult) => void;
392
+ /** Called on swap error */
393
+ onSwapError?: (error: Error, phase: SwapPhase) => void;
394
+ /** Controlled settings (omit for localStorage fallback) */
395
+ settings?: InstantTradeSettings;
396
+ /** Called when settings change */
397
+ onSettingsChange?: (settings: InstantTradeSettings) => void;
398
+ /** Slot rendered next to trade-type tabs (e.g. wallet switcher) */
399
+ headerExtra?: ReactNode;
400
+ /** External style customization */
401
+ className?: string;
402
+ }
403
+ /** Props for {@link InstantTradeUI}. */
404
+ interface InstantTradeUIProps {
405
+ direction: "buy" | "sell";
406
+ onDirectionChange: (d: "buy" | "sell") => void;
407
+ amount: number | undefined;
408
+ onAmountChange: (v: number | undefined) => void;
409
+ customAmounts: (number | null)[];
410
+ customPercentages: (number | null)[];
411
+ onQuickAmountClick: (v: number) => void;
412
+ onQuickPercentageClick: (percent: number) => void;
413
+ onCustomAmountsEdit: (amounts: (number | null)[]) => void;
414
+ onCustomPercentagesEdit: (pcts: (number | null)[]) => void;
415
+ tokenSymbol?: string;
416
+ nativeSymbol?: string;
417
+ nativeDecimals?: number;
418
+ nativeBalance?: string;
419
+ tokenBalance?: string;
420
+ amountConversion?: string;
421
+ preset: number;
422
+ onPresetChange: (p: number) => void;
423
+ presetValues: TradePresetValues;
424
+ onPresetSettingsChange: (v: TradePresetValues) => void;
425
+ showSettings: boolean;
426
+ onPresetClick: (preset: number) => void;
427
+ submitText: string;
428
+ isDisabled: boolean;
429
+ isLoading: boolean;
430
+ onSubmit: () => void;
431
+ className?: string;
432
+ headerExtra?: ReactNode;
433
+ }
434
+ /** Value exposed by {@link InstantTradeContext}. */
435
+ interface InstantTradeContextValue {
436
+ chain: Chain;
437
+ tokenAddress: string;
438
+ nativeToken: PredefinedToken | undefined;
439
+ direction: "buy" | "sell";
440
+ setDirection: (d: "buy" | "sell") => void;
441
+ /** Quick-trade amount (native token units for buy, token units for sell). */
442
+ amount: number | undefined;
443
+ setAmount: (v: number | undefined) => void;
444
+ buyPreset: number;
445
+ setBuyPreset: (p: number) => void;
446
+ sellPreset: number;
447
+ setSellPreset: (p: number) => void;
448
+ settings: InstantTradeSettings;
449
+ updateBuySettings: (s: BuySettings) => void;
450
+ updateSellSettings: (s: SellSettings) => void;
451
+ currentPresetValues: TradePresetValues;
452
+ }
453
+ /** Props for {@link InstantTradeProvider}. */
454
+ interface InstantTradeProviderProps {
455
+ /** Target chain */
456
+ chain: Chain;
457
+ /** Address of the token being traded */
458
+ tokenAddress: string;
459
+ /** Controlled settings (omit for built-in localStorage persistence) */
460
+ settings?: InstantTradeSettings;
461
+ /** Called when settings change */
462
+ onSettingsChange?: (settings: InstantTradeSettings) => void;
463
+ children: ReactNode;
464
+ }
465
+ /** Props for {@link InstantTradeAmountInput}. */
466
+ interface InstantTradeAmountInputProps {
467
+ amount?: number;
468
+ onAmountChange: (amount?: number) => void;
469
+ preset?: number;
470
+ onPresetChange?: (preset: number) => void;
471
+ /** Called when an already-selected preset is clicked (e.g. open settings) */
472
+ onPresetClick?: (preset: number) => void;
473
+ variant?: "default" | "bordered";
474
+ radius?: "full" | "lg" | "md" | "sm";
475
+ size?: "sm" | "lg";
476
+ fullWidth?: boolean;
477
+ className?: string;
478
+ }
479
+ /** Props for {@link InstantTradeButton}. */
480
+ interface InstantTradeButtonProps {
481
+ className?: string;
482
+ children?: ReactNode;
483
+ }
484
+ /** Props for {@link PresetFormUI}. */
485
+ interface PresetFormUIProps {
486
+ value: TradePresetValues;
487
+ onChange: (value: TradePresetValues) => void;
488
+ nativeSymbol?: string;
489
+ nativeDecimals?: number;
490
+ className?: string;
491
+ }
492
+ /** Props for {@link PresetFormWidget}. */
493
+ interface PresetFormWidgetProps {
494
+ value: TradePresetValues;
495
+ onChange: (value: TradePresetValues) => void;
496
+ chain: Chain;
497
+ className?: string;
498
+ }
499
+
500
+ /** Buy-side trade settings. */
501
+ interface BuySettings {
502
+ /** Four customizable quick-amount buttons (native token units) */
503
+ customAmounts: (number | null)[];
504
+ /** Three preset configurations */
505
+ presets: TradePresetValues[];
506
+ }
507
+ /** Sell-side trade settings. */
508
+ interface SellSettings {
509
+ /** Four customizable quick-percentage buttons (0-100) */
510
+ customPercentages: (number | null)[];
511
+ /** Three preset configurations */
512
+ presets: TradePresetValues[];
513
+ }
514
+ /** Combined buy + sell settings for instant trade. */
515
+ interface InstantTradeSettings {
516
+ buy: BuySettings;
517
+ sell: SellSettings;
518
+ }
519
+
520
+ declare const DEFAULT_INSTANT_TRADE_SETTINGS: InstantTradeSettings;
521
+ /** Access the nearest {@link InstantTradeProvider}. Throws if none found. */
522
+ declare function useInstantTrade(): InstantTradeContextValue;
523
+ /**
524
+ * Provides instant-trade state to descendant components.
525
+ *
526
+ * Settings follow a controlled / uncontrolled pattern:
527
+ * - **Controlled**: pass `settings` + `onSettingsChange` props.
528
+ * - **Uncontrolled** (default): settings auto-persist to localStorage keyed by chain.
529
+ */
530
+ declare function InstantTradeProvider({ chain, tokenAddress, settings: controlledSettings, onSettingsChange, children, }: InstantTradeProviderProps): react_jsx_runtime.JSX.Element;
531
+
532
+ /**
533
+ * Script hook that encapsulates all data and state for the instant trade form.
534
+ *
535
+ * Must be used inside an {@link InstantTradeProvider}.
536
+ * Pure TypeScript — no JSX, no UI imports.
537
+ */
538
+ declare function useInstantTradeScript(params: UseInstantTradeScriptParams): UseInstantTradeScriptResult;
539
+
540
+ /**
541
+ * Full instant-trade widget — thin orchestration layer.
542
+ *
543
+ * Wraps `InstantTradeProvider`, calls `useInstantTradeScript` to get all data,
544
+ * and renders `InstantTradeUI` as the presentational layer.
545
+ *
546
+ * For custom UIs, use `useInstantTradeScript` directly inside an
547
+ * `InstantTradeProvider` with your own presentation.
548
+ */
549
+ declare function InstantTradeWidget({ chain, tokenAddress, onSwapSubmitted, onSwapError, settings, onSettingsChange, headerExtra, className, }: InstantTradeWidgetProps): react_jsx_runtime.JSX.Element;
550
+
551
+ /**
552
+ * Preset form widget — thin orchestration layer.
553
+ *
554
+ * Manages local state initialized from `value`, resolves chain-specific
555
+ * native token info, and syncs changes upward via `onChange`.
556
+ */
557
+ declare function PresetFormWidget({ value, onChange, chain, className, }: PresetFormWidgetProps): react_jsx_runtime.JSX.Element;
558
+
559
+ /**
560
+ * Pure presentational component for the instant trade form.
561
+ *
562
+ * Receives all data and callbacks via props — no API calls, no context access.
563
+ * Consumers can replace this component while reusing `useInstantTradeScript`.
564
+ */
565
+ declare function InstantTradeUI({ direction, onDirectionChange, amount, onAmountChange, customAmounts, customPercentages, onQuickAmountClick, onQuickPercentageClick, onCustomAmountsEdit, onCustomPercentagesEdit, tokenSymbol, nativeSymbol, nativeDecimals, nativeBalance, tokenBalance, amountConversion, preset, onPresetChange, presetValues, onPresetSettingsChange, showSettings, onPresetClick, submitText, isDisabled, isLoading, onSubmit, className, headerExtra, }: InstantTradeUIProps): react_jsx_runtime.JSX.Element;
566
+
567
+ /**
568
+ * Pure presentational preset-settings form.
569
+ *
570
+ * Renders inputs for slippage, priority fee, tip fee, auto fee,
571
+ * max auto fee, anti-MEV and custom RPC. All data via props.
572
+ */
573
+ declare function PresetFormUI({ value, onChange, nativeSymbol, nativeDecimals, className, }: PresetFormUIProps): react_jsx_runtime.JSX.Element;
574
+
575
+ /**
576
+ * Compact amount input with preset selector buttons.
577
+ *
578
+ * Designed for inline/header usage (e.g. token detail page).
579
+ * Must be rendered inside an {@link InstantTradeProvider}.
580
+ */
581
+ declare function InstantTradeAmountInput({ amount, onAmountChange, preset, onPresetChange, onPresetClick, variant, radius, size, fullWidth, className, }: InstantTradeAmountInputProps): react_jsx_runtime.JSX.Element;
582
+
583
+ /**
584
+ * Trade execution button that reads state from {@link InstantTradeProvider}.
585
+ *
586
+ * Resolves wallet, token addresses, converts amounts, applies preset
587
+ * settings, and calls `useSwap` from the SDK.
588
+ */
589
+ declare function InstantTradeButton({ className, children, }: InstantTradeButtonProps): react_jsx_runtime.JSX.Element;
590
+
107
591
  declare global {
108
592
  interface Window {
109
593
  __LIBERFI_VERSION__?: {
@@ -111,6 +595,6 @@ declare global {
111
595
  };
112
596
  }
113
597
  }
114
- declare const _default: "0.1.1";
598
+ declare const _default: "0.1.3";
115
599
 
116
- export { type SwapInput, type SwapPhase, type SwapResult, type TxConfirmationStatus, type UseSwapOptions, type UseTxConfirmationOptions, useSwap, useTxConfirmation, _default as version };
600
+ export { type BuySettings, DEFAULT_BUY_AMOUNTS, DEFAULT_INSTANT_TRADE_SETTINGS, DEFAULT_SELL_PERCENTAGES, DEFAULT_TRADE_PRESET, InstantTradeAmountInput, type InstantTradeAmountInputProps, InstantTradeButton, type InstantTradeButtonProps, type InstantTradeContextValue, InstantTradeProvider, type InstantTradeProviderProps, type InstantTradeSettings, InstantTradeUI, type InstantTradeUIProps, InstantTradeWidget, type InstantTradeWidgetProps, PresetFormUI, type PresetFormUIProps, PresetFormWidget, type PresetFormWidgetProps, type SellSettings, type SwapInput, type SwapPhase, SwapPreviewModal, type SwapPreviewModalProps, type SwapResult, SwapUI, type SwapUIProps, SwapWidget, type SwapWidgetProps, type TradePresetValues, type TxConfirmationStatus, type UseInstantTradeScriptParams, type UseInstantTradeScriptResult, type UseSwapOptions, type UseSwapRoutePollingOptions, type UseSwapScriptParams, type UseSwapScriptResult, type UseTxConfirmationOptions, useInstantTrade, useInstantTradeScript, useSwap, useSwapRoutePolling, useSwapScript, useTxConfirmation, _default as version };