@liberfi.io/ui-trade 0.1.4 → 0.1.6
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/README.md +235 -47
- package/dist/index.d.mts +217 -41
- package/dist/index.d.ts +217 -41
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -11
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,53 @@
|
|
|
1
1
|
import * as _liberfi_io_types from '@liberfi.io/types';
|
|
2
2
|
import { Chain, API, Token, Portfolio } from '@liberfi.io/types';
|
|
3
|
+
import * as jotai_family from 'jotai-family';
|
|
4
|
+
import * as jotai from 'jotai';
|
|
5
|
+
import * as jotai_utils from 'jotai/utils';
|
|
3
6
|
import { WalletAdapter } from '@liberfi.io/wallet-connector';
|
|
4
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
8
|
import { ReactNode } from 'react';
|
|
6
9
|
import { PredefinedToken } from '@liberfi.io/utils';
|
|
7
10
|
|
|
11
|
+
interface AmountPresetState {
|
|
12
|
+
amount: number | undefined;
|
|
13
|
+
preset: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Construct an atomFamily key for instant-trade amount + preset state.
|
|
17
|
+
*
|
|
18
|
+
* @param id - Business identifier (e.g. `"token-detail"`).
|
|
19
|
+
* @param chain - Target chain.
|
|
20
|
+
* @param tokenAddress - Payment token address.
|
|
21
|
+
* @param prefix - Storage key prefix. Defaults to `"liberfi."`.
|
|
22
|
+
*/
|
|
23
|
+
declare function instantTradeAmountKey(id: string, chain: Chain, tokenAddress: string, prefix?: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Atom family for instant-trade amount and preset index, persisted via `atomWithStorage`.
|
|
26
|
+
*
|
|
27
|
+
* Each atom is keyed by a string built with {@link instantTradeAmountKey}.
|
|
28
|
+
* The storage key includes `id`, `chain`, and `tokenAddress` so the same token
|
|
29
|
+
* on different chains (e.g. USDC on Solana vs Ethereum) has separate persisted values.
|
|
30
|
+
*/
|
|
31
|
+
declare const instantTradeAmountAtomFamily: jotai_family.AtomFamily<string, jotai.WritableAtom<AmountPresetState, [AmountPresetState | typeof jotai_utils.RESET | ((prev: AmountPresetState) => AmountPresetState | typeof jotai_utils.RESET)], void>>;
|
|
32
|
+
|
|
33
|
+
interface UseInstantTradeAmountParams {
|
|
34
|
+
/** Business identifier (e.g. `"token-detail"`). */
|
|
35
|
+
id: string;
|
|
36
|
+
/** Target chain. */
|
|
37
|
+
chain: Chain;
|
|
38
|
+
/** Payment token address. */
|
|
39
|
+
tokenAddress: string;
|
|
40
|
+
/** Storage key prefix. Must match the prefix used by the corresponding AmountPresetInputWidget. Defaults to `"liberfi."`. */
|
|
41
|
+
storageKeyPrefix?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Read the persisted instant-trade amount and preset index for a given id / chain / token.
|
|
45
|
+
*
|
|
46
|
+
* The value is sourced from the same `atomWithStorage` atom family that
|
|
47
|
+
* {@link AmountPresetInputWidget} writes to, so it stays in sync automatically.
|
|
48
|
+
*/
|
|
49
|
+
declare function useInstantTradeAmount({ id, chain, tokenAddress, storageKeyPrefix, }: UseInstantTradeAmountParams): AmountPresetState;
|
|
50
|
+
|
|
8
51
|
/**
|
|
9
52
|
* Input parameters for the `swap()` function returned by {@link useSwap}.
|
|
10
53
|
*
|
|
@@ -67,27 +110,29 @@ interface UseSwapRoutePollingOptions {
|
|
|
67
110
|
interface TradePresetValues {
|
|
68
111
|
/** Slippage tolerance, 0-100 (percent). `null` = use default. */
|
|
69
112
|
slippage: number | null;
|
|
70
|
-
/** Priority fee in
|
|
113
|
+
/** Priority fee in SOL. `null` = use default. (Solana only) */
|
|
71
114
|
priorityFee: number | null;
|
|
72
|
-
/**
|
|
73
|
-
tipFee: number | null;
|
|
74
|
-
/** Whether automatic fee estimation is enabled. */
|
|
115
|
+
/** Whether automatic fee estimation is enabled. (Solana only) */
|
|
75
116
|
autoFee: boolean;
|
|
76
|
-
/** Maximum fee cap when auto-fee is on (
|
|
117
|
+
/** Maximum fee cap when auto-fee is on, in SOL. (Solana only) */
|
|
77
118
|
maxAutoFee: number | null;
|
|
119
|
+
/** Gas fee in Gwei. `null` = use default. (EVM only) */
|
|
120
|
+
gasFee: number | null;
|
|
121
|
+
/** Tip/bribe fee in native token units. `null` = not applicable. (Solana, BSC) */
|
|
122
|
+
tipFee: number | null;
|
|
78
123
|
/** Anti-MEV protection level. */
|
|
79
124
|
antiMev: "off" | "reduced" | "secure";
|
|
80
125
|
/** Custom RPC endpoint URL. `null` = use default. */
|
|
81
126
|
customRPC: string | null;
|
|
82
127
|
}
|
|
83
128
|
/** Default preset values matching Solana-typical settings. */
|
|
84
|
-
declare const
|
|
129
|
+
declare const DEFAULT_SOL_TRADE_PRESET: TradePresetValues;
|
|
85
130
|
/** Default preset values for EVM chains (gas fee in Gwei). */
|
|
86
131
|
declare const DEFAULT_EVM_TRADE_PRESET: TradePresetValues;
|
|
87
132
|
/** Default preset values for BSC (gas in Gwei + tip in BNB). */
|
|
88
133
|
declare const DEFAULT_BSC_TRADE_PRESET: TradePresetValues;
|
|
89
|
-
/**
|
|
90
|
-
declare
|
|
134
|
+
/** Returns default quick-buy amounts for the given token symbol. */
|
|
135
|
+
declare function getDefaultBuyAmounts(symbol: string): number[];
|
|
91
136
|
/** Default quick-sell percentages. */
|
|
92
137
|
declare const DEFAULT_SELL_PERCENTAGES: number[];
|
|
93
138
|
/** Confirmation status of a tracked transaction. */
|
|
@@ -102,6 +147,42 @@ interface UseTxConfirmationOptions {
|
|
|
102
147
|
timeout?: number;
|
|
103
148
|
}
|
|
104
149
|
|
|
150
|
+
type PresetDirection = "buy" | "sell";
|
|
151
|
+
/**
|
|
152
|
+
* Construct an atomFamily key from chain, direction, preset index and prefix.
|
|
153
|
+
*
|
|
154
|
+
* @param chain - Target chain.
|
|
155
|
+
* @param direction - Trade direction: `"buy"` or `"sell"`.
|
|
156
|
+
* @param index - Preset index (0, 1, or 2).
|
|
157
|
+
* @param prefix - Storage key prefix. Defaults to `"liberfi."`.
|
|
158
|
+
*/
|
|
159
|
+
declare function presetKey(chain: Chain, direction: PresetDirection, index: number, prefix?: string): string;
|
|
160
|
+
/**
|
|
161
|
+
* Atom family for trade preset values, persisted via `atomWithStorage`.
|
|
162
|
+
*
|
|
163
|
+
* Each atom is keyed by a string built with {@link presetKey}.
|
|
164
|
+
* Default values are chain-specific via `getDefaultPresetForChain`.
|
|
165
|
+
*/
|
|
166
|
+
declare const presetAtomFamily: jotai_family.AtomFamily<string, jotai.WritableAtom<TradePresetValues, [typeof jotai_utils.RESET | TradePresetValues | ((prev: TradePresetValues) => typeof jotai_utils.RESET | TradePresetValues)], void>>;
|
|
167
|
+
|
|
168
|
+
interface UsePresetValuesParams {
|
|
169
|
+
/** Target chain. */
|
|
170
|
+
chain: Chain;
|
|
171
|
+
/** Trade direction. */
|
|
172
|
+
direction: PresetDirection;
|
|
173
|
+
/** Preset index (0, 1, or 2). Defaults to 0. */
|
|
174
|
+
presetIndex?: number;
|
|
175
|
+
/** Storage key prefix. Must match the prefix used by the corresponding PresetFormWidget. Defaults to `"liberfi."`. */
|
|
176
|
+
storageKeyPrefix?: string;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Read the current {@link TradePresetValues} for a given chain / direction / preset index.
|
|
180
|
+
*
|
|
181
|
+
* The value is sourced from the same `atomWithStorage` atom family that
|
|
182
|
+
* {@link PresetFormWidget} writes to, so it stays in sync automatically.
|
|
183
|
+
*/
|
|
184
|
+
declare function usePresetValues({ chain, direction, presetIndex, storageKeyPrefix, }: UsePresetValuesParams): TradePresetValues;
|
|
185
|
+
|
|
105
186
|
/**
|
|
106
187
|
* Hook that orchestrates the full swap flow: route -> sign -> send.
|
|
107
188
|
*
|
|
@@ -418,8 +499,6 @@ interface InstantTradeUIProps {
|
|
|
418
499
|
onCustomAmountsEdit: (amounts: (number | null)[]) => void;
|
|
419
500
|
onCustomPercentagesEdit: (pcts: (number | null)[]) => void;
|
|
420
501
|
tokenSymbol?: string;
|
|
421
|
-
nativeSymbol?: string;
|
|
422
|
-
nativeDecimals?: number;
|
|
423
502
|
nativeBalance?: string;
|
|
424
503
|
tokenBalance?: string;
|
|
425
504
|
amountConversion?: string;
|
|
@@ -467,18 +546,48 @@ interface InstantTradeProviderProps {
|
|
|
467
546
|
onSettingsChange?: (settings: InstantTradeSettings) => void;
|
|
468
547
|
children: ReactNode;
|
|
469
548
|
}
|
|
470
|
-
/** Props for {@link
|
|
471
|
-
interface
|
|
549
|
+
/** Props for {@link AmountPresetInputUI}. */
|
|
550
|
+
interface AmountPresetInputUIProps {
|
|
551
|
+
/** Payment token (provides symbol, decimals, and icon). */
|
|
552
|
+
token: PredefinedToken;
|
|
553
|
+
/** Target chain — used by preset tooltips to show chain-specific features. */
|
|
554
|
+
chain: Chain;
|
|
555
|
+
/** Current amount value. */
|
|
472
556
|
amount?: number;
|
|
557
|
+
/** Called when the amount changes. */
|
|
473
558
|
onAmountChange: (amount?: number) => void;
|
|
559
|
+
/** Currently selected preset index (0, 1, or 2). Defaults to 0. */
|
|
474
560
|
preset?: number;
|
|
561
|
+
/** Called when the user selects a different preset. */
|
|
475
562
|
onPresetChange?: (preset: number) => void;
|
|
476
|
-
/** Called when
|
|
563
|
+
/** Called when the user clicks the already-selected preset (e.g. open settings). */
|
|
477
564
|
onPresetClick?: (preset: number) => void;
|
|
478
|
-
|
|
565
|
+
/** Preset configurations for tooltip display. Falls back to chain defaults when omitted. */
|
|
566
|
+
presetValues?: TradePresetValues[];
|
|
567
|
+
/** Controls overall component size. Defaults to `"sm"`. */
|
|
568
|
+
size?: "sm" | "md" | "lg";
|
|
569
|
+
radius?: "full" | "lg" | "md" | "sm" | "none";
|
|
570
|
+
className?: string;
|
|
571
|
+
}
|
|
572
|
+
/** Props for {@link AmountPresetInputWidget}. */
|
|
573
|
+
interface AmountPresetInputWidgetProps {
|
|
574
|
+
/** Business identifier used as part of the storage key (e.g. `"token-detail"`, `"watchlist"`). */
|
|
575
|
+
id: string;
|
|
576
|
+
/** Target chain. */
|
|
577
|
+
chain: Chain;
|
|
578
|
+
/** Payment token (provides symbol, decimals, address for storage key, and icon). */
|
|
579
|
+
token: PredefinedToken;
|
|
580
|
+
/** Storage key prefix. Must match the prefix used by the corresponding PresetFormWidget. Defaults to `"liberfi."`. */
|
|
581
|
+
storageKeyPrefix?: string;
|
|
582
|
+
/** Notification callback when the amount changes (does not control state). */
|
|
583
|
+
onAmountChange?: (amount?: number) => void;
|
|
584
|
+
/** Notification callback when a different preset is selected (does not control state). */
|
|
585
|
+
onPresetChange?: (preset: number) => void;
|
|
586
|
+
/** Called when the user clicks the already-selected preset (e.g. open settings). */
|
|
587
|
+
onPresetClick?: (preset: number) => void;
|
|
588
|
+
/** Controls overall component size. Defaults to `"sm"`. */
|
|
589
|
+
size?: "sm" | "md" | "lg";
|
|
479
590
|
radius?: "full" | "lg" | "md" | "sm";
|
|
480
|
-
size?: "sm" | "lg";
|
|
481
|
-
fullWidth?: boolean;
|
|
482
591
|
className?: string;
|
|
483
592
|
}
|
|
484
593
|
/** Props for {@link InstantTradeButton}. */
|
|
@@ -490,19 +599,46 @@ interface InstantTradeButtonProps {
|
|
|
490
599
|
interface PresetFormUIProps {
|
|
491
600
|
value: TradePresetValues;
|
|
492
601
|
onChange: (value: TradePresetValues) => void;
|
|
493
|
-
/** Target chain — determines which fields are shown
|
|
602
|
+
/** Target chain — determines which fields are shown and native token info. */
|
|
494
603
|
chain: Chain;
|
|
495
|
-
|
|
496
|
-
nativeDecimals?: number;
|
|
604
|
+
disableAnimation?: boolean;
|
|
497
605
|
className?: string;
|
|
498
606
|
}
|
|
499
607
|
/** Props for {@link PresetFormWidget}. */
|
|
500
608
|
interface PresetFormWidgetProps {
|
|
501
|
-
|
|
502
|
-
onChange: (value: TradePresetValues) => void;
|
|
609
|
+
/** Target chain — determines default values and visible fields. */
|
|
503
610
|
chain: Chain;
|
|
611
|
+
/** Preset index (0, 1, or 2). Defaults to 0. */
|
|
612
|
+
presetIndex?: number;
|
|
613
|
+
/** Storage key prefix. Defaults to `"liberfi."`. */
|
|
614
|
+
storageKeyPrefix?: string;
|
|
615
|
+
/** Notification callback when value changes (does not control state). */
|
|
616
|
+
onChange?: (direction: "buy" | "sell", value: TradePresetValues) => void;
|
|
617
|
+
disableAnimation?: boolean;
|
|
504
618
|
className?: string;
|
|
505
619
|
}
|
|
620
|
+
/** Props for {@link MultiPresetFormWidget}. */
|
|
621
|
+
interface MultiPresetFormWidgetProps {
|
|
622
|
+
/** Target chain — determines default values and visible fields. */
|
|
623
|
+
chain: Chain;
|
|
624
|
+
/** Storage key prefix. Defaults to `"liberfi."`. */
|
|
625
|
+
storageKeyPrefix?: string;
|
|
626
|
+
/** Notification callback when value changes (does not control state). */
|
|
627
|
+
onChange?: (presetIndex: number, direction: "buy" | "sell", value: TradePresetValues) => void;
|
|
628
|
+
disableAnimation?: boolean;
|
|
629
|
+
className?: string;
|
|
630
|
+
}
|
|
631
|
+
/** Params passed when opening the preset-form modal via `useAsyncModal`. */
|
|
632
|
+
interface PresetFormModalParams {
|
|
633
|
+
/** Available chains to switch between. */
|
|
634
|
+
chains: Chain[];
|
|
635
|
+
/** Default chain when no param is passed on open. Defaults to first item in `chains`. */
|
|
636
|
+
defaultChain?: Chain;
|
|
637
|
+
/** Storage key prefix. Defaults to `"liberfi."`. */
|
|
638
|
+
storageKeyPrefix?: string;
|
|
639
|
+
/** Notification callback when any preset value changes. */
|
|
640
|
+
onChange?: (chain: Chain, presetIndex: number, direction: "buy" | "sell", value: TradePresetValues) => void;
|
|
641
|
+
}
|
|
506
642
|
|
|
507
643
|
/** Buy-side trade settings. */
|
|
508
644
|
interface BuySettings {
|
|
@@ -556,12 +692,46 @@ declare function useInstantTradeScript(params: UseInstantTradeScriptParams): Use
|
|
|
556
692
|
declare function InstantTradeWidget({ chain, tokenAddress, onSwapSubmitted, onSwapError, settings, onSettingsChange, headerExtra, className, }: InstantTradeWidgetProps): react_jsx_runtime.JSX.Element;
|
|
557
693
|
|
|
558
694
|
/**
|
|
559
|
-
*
|
|
695
|
+
* Amount + preset input widget — atom-backed orchestration layer.
|
|
696
|
+
*
|
|
697
|
+
* Persists `{ amount, preset }` via `atomWithStorage`, keyed by
|
|
698
|
+
* `id + chain + token.address`. Reads preset values from
|
|
699
|
+
* {@link presetAtomFamily} for tooltip display.
|
|
700
|
+
*
|
|
701
|
+
* For a pure presentational input without persistence, use {@link AmountPresetInputUI}.
|
|
702
|
+
*/
|
|
703
|
+
declare function AmountPresetInputWidget({ id, chain, token, storageKeyPrefix, onAmountChange, onPresetChange, onPresetClick, size, radius, className, }: AmountPresetInputWidgetProps): react_jsx_runtime.JSX.Element;
|
|
704
|
+
|
|
705
|
+
/**
|
|
706
|
+
* Preset form widget — atom-backed orchestration layer with Buy/Sell tabs.
|
|
707
|
+
*
|
|
708
|
+
* State is persisted via `atomWithStorage` (keyed by prefix + chain + direction + preset index).
|
|
709
|
+
* Pass `storageKeyPrefix` to customize the storage key prefix.
|
|
710
|
+
*
|
|
711
|
+
* For a pure presentational form without persistence, use {@link PresetFormUI}.
|
|
712
|
+
*/
|
|
713
|
+
declare function PresetFormWidget({ chain, presetIndex, storageKeyPrefix, onChange, disableAnimation, className, }: PresetFormWidgetProps): react_jsx_runtime.JSX.Element;
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* Multi preset form widget.
|
|
560
717
|
*
|
|
561
|
-
*
|
|
562
|
-
*
|
|
718
|
+
* Combines preset index tabs,
|
|
719
|
+
* and a persisted {@link PresetFormWidget} into a single self-contained editor.
|
|
563
720
|
*/
|
|
564
|
-
declare function
|
|
721
|
+
declare function MultiPresetFormWidget({ chain, storageKeyPrefix, onChange, disableAnimation, className, }: MultiPresetFormWidgetProps): react_jsx_runtime.JSX.Element;
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* Async-modal wrapper for multi-chain preset editing.
|
|
725
|
+
*
|
|
726
|
+
* Place this component once in the tree (e.g. layout). Open it from anywhere
|
|
727
|
+
* via `useAsyncModal("preset").onOpen({ params: { chains, defaultChain, storageKeyPrefix, onChange } })`.
|
|
728
|
+
*
|
|
729
|
+
* Header: title + chain switcher.
|
|
730
|
+
* Body: multi-preset form.
|
|
731
|
+
*/
|
|
732
|
+
declare function PresetFormModal({ id }: {
|
|
733
|
+
id?: string;
|
|
734
|
+
}): react_jsx_runtime.JSX.Element;
|
|
565
735
|
|
|
566
736
|
/**
|
|
567
737
|
* Pure presentational component for the instant trade form.
|
|
@@ -569,7 +739,15 @@ declare function PresetFormWidget({ value, onChange, chain, className, }: Preset
|
|
|
569
739
|
* Receives all data and callbacks via props — no API calls, no context access.
|
|
570
740
|
* Consumers can replace this component while reusing `useInstantTradeScript`.
|
|
571
741
|
*/
|
|
572
|
-
declare function InstantTradeUI({ chain, direction, onDirectionChange, amount, onAmountChange, customAmounts, customPercentages, onQuickAmountClick, onQuickPercentageClick, onCustomAmountsEdit, onCustomPercentagesEdit, tokenSymbol,
|
|
742
|
+
declare function InstantTradeUI({ chain, direction, onDirectionChange, amount, onAmountChange, customAmounts, customPercentages, onQuickAmountClick, onQuickPercentageClick, onCustomAmountsEdit, onCustomPercentagesEdit, tokenSymbol, nativeBalance, tokenBalance, amountConversion, preset, onPresetChange, presetValues, onPresetSettingsChange, showSettings, onPresetClick, submitText, isDisabled, isLoading, onSubmit, className, headerExtra, }: InstantTradeUIProps): react_jsx_runtime.JSX.Element;
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* Compact amount input with preset selector buttons (presentational).
|
|
746
|
+
*
|
|
747
|
+
* Designed for inline/header usage (e.g. token detail page).
|
|
748
|
+
* Receives all data via props — no context dependency.
|
|
749
|
+
*/
|
|
750
|
+
declare function AmountPresetInputUI({ token, chain, amount, onAmountChange, preset, onPresetChange, onPresetClick, presetValues, radius, size, className, }: AmountPresetInputUIProps): react_jsx_runtime.JSX.Element;
|
|
573
751
|
|
|
574
752
|
/**
|
|
575
753
|
* Pure presentational preset-settings form.
|
|
@@ -582,15 +760,7 @@ declare function InstantTradeUI({ chain, direction, onDirectionChange, amount, o
|
|
|
582
760
|
* - Ethereum: gas fee (Gwei) only
|
|
583
761
|
* - BSC: gas fee (Gwei) + tip fee (BNB)
|
|
584
762
|
*/
|
|
585
|
-
declare function PresetFormUI({ value, onChange, chain,
|
|
586
|
-
|
|
587
|
-
/**
|
|
588
|
-
* Compact amount input with preset selector buttons.
|
|
589
|
-
*
|
|
590
|
-
* Designed for inline/header usage (e.g. token detail page).
|
|
591
|
-
* Must be rendered inside an {@link InstantTradeProvider}.
|
|
592
|
-
*/
|
|
593
|
-
declare function InstantTradeAmountInput({ amount, onAmountChange, preset, onPresetChange, onPresetClick, variant, radius, size, fullWidth, className, }: InstantTradeAmountInputProps): react_jsx_runtime.JSX.Element;
|
|
763
|
+
declare function PresetFormUI({ value, onChange, chain, disableAnimation, className, }: PresetFormUIProps): react_jsx_runtime.JSX.Element;
|
|
594
764
|
|
|
595
765
|
/**
|
|
596
766
|
* Trade execution button that reads state from {@link InstantTradeProvider}.
|
|
@@ -601,9 +771,12 @@ declare function InstantTradeAmountInput({ amount, onAmountChange, preset, onPre
|
|
|
601
771
|
declare function InstantTradeButton({ className, children, }: InstantTradeButtonProps): react_jsx_runtime.JSX.Element;
|
|
602
772
|
|
|
603
773
|
type AntiMevOption = "off" | "reduced" | "secure";
|
|
774
|
+
type FeeType = "priorityFee" | "gasFee";
|
|
604
775
|
interface ChainPresetFeatures {
|
|
605
|
-
/**
|
|
606
|
-
|
|
776
|
+
/** Native token symbol (e.g. "SOL", "ETH", "BNB") */
|
|
777
|
+
nativeSymbol: string;
|
|
778
|
+
/** Semantic fee type — UI maps this to a translated label via i18n key. */
|
|
779
|
+
feeType: FeeType;
|
|
607
780
|
/** Unit displayed for the fee input (e.g. "SOL", "Gwei") */
|
|
608
781
|
feeUnit: string;
|
|
609
782
|
/** Decimal places for the fee input */
|
|
@@ -614,6 +787,10 @@ interface ChainPresetFeatures {
|
|
|
614
787
|
tipFeeUnit: string;
|
|
615
788
|
/** Decimal places for the tip fee input */
|
|
616
789
|
tipFeeDecimals: number;
|
|
790
|
+
/** Whether this chain supports automatic fee estimation */
|
|
791
|
+
showAutoFee: boolean;
|
|
792
|
+
/** Whether this chain supports custom RPC endpoint */
|
|
793
|
+
showCustomRPC: boolean;
|
|
617
794
|
/**
|
|
618
795
|
* Available anti-MEV protection levels for this chain.
|
|
619
796
|
* - Solana: ["off", "reduced", "secure"]
|
|
@@ -629,8 +806,7 @@ interface ChainPresetFeatures {
|
|
|
629
806
|
* - BSC: gas fee (Gwei) + tip fee (BNB)
|
|
630
807
|
* - Other EVM: gas fee (Gwei), same as Ethereum by default
|
|
631
808
|
*/
|
|
632
|
-
declare function getChainPresetFeatures(chain: Chain
|
|
633
|
-
declare function isSolanaChain(chain: Chain): boolean;
|
|
809
|
+
declare function getChainPresetFeatures(chain: Chain): ChainPresetFeatures;
|
|
634
810
|
/** Returns chain-appropriate default preset values. */
|
|
635
811
|
declare function getDefaultPresetForChain(chain: Chain): TradePresetValues;
|
|
636
812
|
|
|
@@ -641,6 +817,6 @@ declare global {
|
|
|
641
817
|
};
|
|
642
818
|
}
|
|
643
819
|
}
|
|
644
|
-
declare const _default: "0.1.
|
|
820
|
+
declare const _default: "0.1.6";
|
|
645
821
|
|
|
646
|
-
export { type AntiMevOption, type BuySettings, type ChainPresetFeatures, DEFAULT_BSC_TRADE_PRESET,
|
|
822
|
+
export { AmountPresetInputUI, type AmountPresetInputUIProps, AmountPresetInputWidget, type AmountPresetInputWidgetProps, type AmountPresetState, type AntiMevOption, type BuySettings, type ChainPresetFeatures, DEFAULT_BSC_TRADE_PRESET, DEFAULT_EVM_TRADE_PRESET, DEFAULT_INSTANT_TRADE_SETTINGS, DEFAULT_SELL_PERCENTAGES, DEFAULT_SOL_TRADE_PRESET, type FeeType, InstantTradeButton, type InstantTradeButtonProps, type InstantTradeContextValue, InstantTradeProvider, type InstantTradeProviderProps, type InstantTradeSettings, InstantTradeUI, type InstantTradeUIProps, InstantTradeWidget, type InstantTradeWidgetProps, MultiPresetFormWidget, type MultiPresetFormWidgetProps, type PresetDirection, PresetFormModal, type PresetFormModalParams, 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 UseInstantTradeAmountParams, type UseInstantTradeScriptParams, type UseInstantTradeScriptResult, type UsePresetValuesParams, type UseSwapOptions, type UseSwapRoutePollingOptions, type UseSwapScriptParams, type UseSwapScriptResult, type UseTxConfirmationOptions, getChainPresetFeatures, getDefaultBuyAmounts, getDefaultPresetForChain, instantTradeAmountAtomFamily, instantTradeAmountKey, presetAtomFamily, presetKey, useInstantTrade, useInstantTradeAmount, useInstantTradeScript, usePresetValues, useSwap, useSwapRoutePolling, useSwapScript, useTxConfirmation, _default as version };
|