@rango-dev/widget-embedded 0.43.1-next.2 → 0.43.1-next.4
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/components/BlockchainList/BlockchainList.d.ts.map +1 -1
- package/dist/components/BlockchainSelectorButton/BlockchainSelectorButton.d.ts.map +1 -1
- package/dist/components/BlockchainsSection/BlockchainsSection.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
- package/dist/components/CustomDestination/CustomDestination.d.ts.map +1 -1
- package/dist/components/CustomDestination/CustomDestination.styles.d.ts +1 -0
- package/dist/components/CustomDestination/CustomDestination.styles.d.ts.map +1 -1
- package/dist/components/CustomTokenModal/CustomTokenModal.d.ts.map +1 -1
- package/dist/components/FilterSelector/FilterSelectorContent.d.ts.map +1 -1
- package/dist/components/HeaderButtons/NotificationsBadge.d.ts.map +1 -1
- package/dist/components/HistoryGroupedList/HistoryGroupedList.d.ts.map +1 -1
- package/dist/components/NoResult/NoResult.d.ts.map +1 -1
- package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
- package/dist/components/Quote/Quote.d.ts.map +1 -1
- package/dist/components/Quote/Quote.types.d.ts +2 -1
- package/dist/components/Quote/Quote.types.d.ts.map +1 -1
- package/dist/components/Quote/QuoteCostDetails.d.ts.map +1 -1
- package/dist/components/Quote/QuoteSummary.d.ts.map +1 -1
- package/dist/components/Quote/QuoteTrigger.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/SlippageWariningModal.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts.map +1 -1
- package/dist/components/Quotes/Quotes.d.ts.map +1 -1
- package/dist/components/Quotes/SelectStrategy.d.ts.map +1 -1
- package/dist/components/RefreshModal/RefreshModal.d.ts.map +1 -1
- package/dist/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/components/Slippage/Slippage.d.ts.map +1 -1
- package/dist/components/StatefulConnectModal/StatefulConnectModal.d.ts +1 -0
- package/dist/components/StatefulConnectModal/StatefulConnectModal.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.d.ts.map +1 -1
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.d.ts.map +1 -1
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.d.ts.map +1 -1
- package/dist/components/SwitchFromAndTo/SwitchFromAndTo.d.ts.map +1 -1
- package/dist/components/WalletStatefulConnect/DerivationPath.d.ts.map +1 -1
- package/dist/components/WalletStatefulConnect/ExperimentalChain.d.ts +1 -0
- package/dist/components/WalletStatefulConnect/ExperimentalChain.d.ts.map +1 -1
- package/dist/components/WalletStatefulConnect/NamespaceDetachedItem.d.ts.map +1 -1
- package/dist/components/WalletStatefulConnect/NamespaceListItem.d.ts.map +1 -1
- package/dist/components/WalletStatefulConnect/Namespaces.d.ts.map +1 -1
- package/dist/components/common/ActivateTabModal/ActivateTabModal.d.ts.map +1 -1
- package/dist/containers/Inputs/Inputs.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +1 -0
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
- package/dist/containers/Settings/Lists.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +3 -3
- package/dist/pages/AddCustomTokenPage.d.ts.map +1 -1
- package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
- package/dist/pages/CustomTokensPage.d.ts.map +1 -1
- package/dist/pages/HistoryPage.d.ts.map +1 -1
- package/dist/pages/Home.d.ts.map +1 -1
- package/dist/pages/LanguagePage.d.ts.map +1 -1
- package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
- package/dist/pages/SelectBlockchainPage.d.ts.map +1 -1
- package/dist/pages/SelectSwapItemPage/SelectSwapItemsPage.d.ts.map +1 -1
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/store/slices/wallets.d.ts +1 -0
- package/dist/store/slices/wallets.d.ts.map +1 -1
- package/dist/types/config.d.ts +1 -1
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/widget-embedded.build.json +1 -1
- package/package.json +7 -7
- package/src/components/BlockchainList/BlockchainList.tsx +4 -1
- package/src/components/BlockchainList/LoadingBlockchainList.tsx +1 -1
- package/src/components/BlockchainSelectorButton/BlockchainSelectorButton.tsx +2 -1
- package/src/components/BlockchainsSection/BlockchainsSection.tsx +8 -2
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +8 -1
- package/src/components/ConfirmWalletsModal/WalletList.tsx +9 -1
- package/src/components/CustomDestination/CustomDestination.tsx +2 -1
- package/src/components/CustomTokenModal/CustomTokenModal.tsx +1 -0
- package/src/components/FilterSelector/FilterSelectorContent.tsx +1 -0
- package/src/components/HeaderButtons/InProgressTransactionBadge.tsx +1 -1
- package/src/components/HeaderButtons/NotificationsBadge.tsx +5 -1
- package/src/components/HistoryGroupedList/HistoryGroupedList.tsx +1 -0
- package/src/components/ImportCustomToken/ImportCustomToken.tsx +1 -1
- package/src/components/NoResult/NoResult.tsx +2 -1
- package/src/components/NotificationContent/NotificationContent.tsx +1 -0
- package/src/components/Quote/Quote.tsx +8 -2
- package/src/components/Quote/Quote.types.ts +2 -1
- package/src/components/Quote/QuoteCostDetails.tsx +9 -3
- package/src/components/Quote/QuoteSummary.tsx +2 -0
- package/src/components/Quote/QuoteTrigger.tsx +1 -0
- package/src/components/QuoteWarningsAndErrors/HighValueLossWarningModal.tsx +1 -0
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.tsx +1 -0
- package/src/components/QuoteWarningsAndErrors/SlippageWariningModal.tsx +1 -0
- package/src/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.tsx +1 -0
- package/src/components/Quotes/Quotes.tsx +1 -0
- package/src/components/Quotes/SelectStrategy.tsx +1 -0
- package/src/components/RefreshModal/RefreshModal.tsx +2 -0
- package/src/components/SearchInput/SearchInput.tsx +7 -2
- package/src/components/Slippage/Slippage.tsx +3 -0
- package/src/components/StatefulConnectModal/StatefulConnectModal.tsx +2 -0
- package/src/components/SwapDetails/SwapDetails.tsx +2 -1
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.tsx +2 -0
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.tsx +9 -1
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.tsx +8 -1
- package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +2 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +1 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +1 -0
- package/src/components/SwitchFromAndTo/SwitchFromAndTo.tsx +1 -0
- package/src/components/WalletStatefulConnect/DerivationPath.tsx +2 -0
- package/src/components/WalletStatefulConnect/Detached.tsx +1 -1
- package/src/components/WalletStatefulConnect/ExperimentalChain.tsx +3 -1
- package/src/components/WalletStatefulConnect/NamespaceDetachedItem.tsx +3 -2
- package/src/components/WalletStatefulConnect/NamespaceListItem.tsx +4 -1
- package/src/components/WalletStatefulConnect/Namespaces.tsx +1 -0
- package/src/components/WalletStatefulConnect/SupportedChainsList.tsx +1 -1
- package/src/components/common/ActivateTabModal/ActivateTabModal.tsx +1 -0
- package/src/containers/ExpandedQuotes/ExpandedQuotes.tsx +1 -1
- package/src/containers/Inputs/Inputs.tsx +2 -0
- package/src/containers/QuoteInfo/QuoteInfo.tsx +2 -1
- package/src/containers/QuoteInfo/QuoteInfo.types.ts +1 -0
- package/src/containers/Settings/Lists.tsx +13 -3
- package/src/pages/AddCustomTokenPage.tsx +7 -1
- package/src/pages/ConfirmSwapPage.tsx +9 -1
- package/src/pages/CustomTokensPage.tsx +2 -0
- package/src/pages/HistoryPage.tsx +2 -0
- package/src/pages/Home.tsx +1 -0
- package/src/pages/LanguagePage.tsx +2 -0
- package/src/pages/LiquiditySourcePage.tsx +6 -1
- package/src/pages/SelectBlockchainPage.tsx +1 -0
- package/src/pages/SelectSwapItemPage/SelectSwapItemsPage.tsx +1 -0
- package/src/pages/SettingsPage.tsx +1 -0
- package/src/pages/WalletsPage.tsx +1 -0
- package/src/store/slices/wallets.ts +2 -0
- package/src/types/config.ts +1 -1
- package/src/utils/swap.ts +2 -1
|
@@ -40,6 +40,7 @@ export function SwapDetailsAlerts(props: SwapAlertsProps) {
|
|
|
40
40
|
return (
|
|
41
41
|
<Fragment key={key}>
|
|
42
42
|
<Alert
|
|
43
|
+
id="widget-swap-details-tx-alert"
|
|
43
44
|
type={
|
|
44
45
|
lastUrl
|
|
45
46
|
? (loading && 'loading') || (error && 'error') || 'success'
|
|
@@ -65,7 +66,13 @@ export function SwapDetailsAlerts(props: SwapAlertsProps) {
|
|
|
65
66
|
</Fragment>
|
|
66
67
|
);
|
|
67
68
|
})}
|
|
68
|
-
{waitingProgress &&
|
|
69
|
+
{waitingProgress && (
|
|
70
|
+
<Alert
|
|
71
|
+
id="widget-swap-details-loading-alert"
|
|
72
|
+
type="loading"
|
|
73
|
+
title={message.shortMessage}
|
|
74
|
+
/>
|
|
75
|
+
)}
|
|
69
76
|
{step.status !== 'failed' && hasWarning && (
|
|
70
77
|
<WarningAlert
|
|
71
78
|
switchNetwork={switchNetwork}
|
|
@@ -44,6 +44,7 @@ export function SwapDetailsCompleteModal(props: CompleteModalPropTypes) {
|
|
|
44
44
|
<WatermarkedModal
|
|
45
45
|
open={open}
|
|
46
46
|
onClose={onClose}
|
|
47
|
+
id="widget-swap-details-complete-modal"
|
|
47
48
|
container={
|
|
48
49
|
document.getElementById(WIDGET_UI_ID.SWAP_BOX_ID) || document.body
|
|
49
50
|
}>
|
|
@@ -52,6 +53,7 @@ export function SwapDetailsCompleteModal(props: CompleteModalPropTypes) {
|
|
|
52
53
|
<TokenAmount
|
|
53
54
|
direction="vertical"
|
|
54
55
|
tooltipContainer={getContainer()}
|
|
56
|
+
id="widget-swap-details-complete-modal-success-token-amount-container"
|
|
55
57
|
type="output"
|
|
56
58
|
centerAlign={true}
|
|
57
59
|
price={{
|
|
@@ -100,6 +100,7 @@ export function DerivationPath(props: PropTypes) {
|
|
|
100
100
|
{i18n.t('Choose Derivation Path Template')}
|
|
101
101
|
</InputLabel>
|
|
102
102
|
<Select
|
|
103
|
+
id="widget-derivation-path-template-select"
|
|
103
104
|
value={selectedDerivationPathId || ''}
|
|
104
105
|
options={derivationPaths.map((derivationPath) => ({
|
|
105
106
|
value: derivationPath.id,
|
|
@@ -116,6 +117,7 @@ export function DerivationPath(props: PropTypes) {
|
|
|
116
117
|
: i18n.t('Enter Index')}
|
|
117
118
|
</InputLabel>
|
|
118
119
|
<TextField
|
|
120
|
+
id="widget-derivation-path-template-input"
|
|
119
121
|
type={isCustomOptionSelected ? 'text' : 'number'}
|
|
120
122
|
variant="contained"
|
|
121
123
|
value={derivationPathIndex}
|
|
@@ -25,7 +25,7 @@ export function Detached(props: PropTypes) {
|
|
|
25
25
|
icon={<Image src={targetWallet.image} size={45} />}
|
|
26
26
|
/>
|
|
27
27
|
<Divider size={20} />
|
|
28
|
-
<NamespaceList>
|
|
28
|
+
<NamespaceList id="widget-detached-namespace-list" as={'ul'}>
|
|
29
29
|
{targetWallet.needsNamespace?.data.map((namespace, index, array) => (
|
|
30
30
|
<React.Fragment key={namespace.id}>
|
|
31
31
|
{namespace.unsupported ? (
|
|
@@ -5,13 +5,15 @@ import React from 'react';
|
|
|
5
5
|
interface PropTypes {
|
|
6
6
|
displayName?: string;
|
|
7
7
|
onConfirm: () => void;
|
|
8
|
+
id: string;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export function ExperimentalChain(props: PropTypes) {
|
|
11
|
-
const { displayName, onConfirm } = props;
|
|
12
|
+
const { displayName, onConfirm, id } = props;
|
|
12
13
|
|
|
13
14
|
return (
|
|
14
15
|
<MessageBox
|
|
16
|
+
id={id}
|
|
15
17
|
title={i18n.t({
|
|
16
18
|
id: 'Add {blockchainDisplayName} Chain',
|
|
17
19
|
values: { blockchainDisplayName: displayName },
|
|
@@ -97,7 +97,7 @@ export const NamespaceDetachedItem = function NamespaceDetachedItem(
|
|
|
97
97
|
size={40}
|
|
98
98
|
/>
|
|
99
99
|
<NamespaceItemInnerContent>
|
|
100
|
-
<NamespaceDetachedItemInfo>
|
|
100
|
+
<NamespaceDetachedItemInfo className="widget-namespace-detached-item-info-div">
|
|
101
101
|
<Typography variant="label" size="large">
|
|
102
102
|
{namespace.label}
|
|
103
103
|
</Typography>
|
|
@@ -124,6 +124,7 @@ export const NamespaceDetachedItem = function NamespaceDetachedItem(
|
|
|
124
124
|
)}
|
|
125
125
|
{!namespaceState.connected && error && (
|
|
126
126
|
<NamespaceItemErrorDropdownToggle
|
|
127
|
+
className="widget-namespace-detached-item-error-toggle-btn"
|
|
127
128
|
onClick={() =>
|
|
128
129
|
setErrorIsExpanded((errorIsExpanded) => !errorIsExpanded)
|
|
129
130
|
}>
|
|
@@ -167,7 +168,7 @@ export const NamespaceDetachedItem = function NamespaceDetachedItem(
|
|
|
167
168
|
{!namespaceState.connected && !!error && errorIsExpanded && (
|
|
168
169
|
<>
|
|
169
170
|
<Divider size={4} />
|
|
170
|
-
<NamespaceItemError>
|
|
171
|
+
<NamespaceItemError id="widget-namespace-item-error-div">
|
|
171
172
|
<Typography variant="body" size="small" color="neutral700">
|
|
172
173
|
{(error.cause as Error)?.message || error.message}
|
|
173
174
|
</Typography>
|
|
@@ -21,7 +21,10 @@ export function NamespaceListItem(props: NamespaceItemPropTypes) {
|
|
|
21
21
|
const supportedChains = namespace.getSupportedChains(blockchains);
|
|
22
22
|
const showSupportedChains = supportedChains.length > 1;
|
|
23
23
|
return (
|
|
24
|
-
<NamespaceItemContainer
|
|
24
|
+
<NamespaceItemContainer
|
|
25
|
+
onClick={onClick}
|
|
26
|
+
clickable
|
|
27
|
+
className="widget-namespace-list-item">
|
|
25
28
|
<NamespaceItemContent>
|
|
26
29
|
<NamespaceLogo
|
|
27
30
|
src={getBlockchainLogo(blockchains, namespace.id)}
|
|
@@ -15,7 +15,7 @@ const SUPPORTED_CHAINS_MAX_DISPLAYED_NUMBER = 3;
|
|
|
15
15
|
export function SupportedChainsList(props: PropTypes) {
|
|
16
16
|
const { chains } = props;
|
|
17
17
|
return (
|
|
18
|
-
<SupportedChainsContainer>
|
|
18
|
+
<SupportedChainsContainer id="widget-supported-chains-container">
|
|
19
19
|
{chains
|
|
20
20
|
.slice(0, SUPPORTED_CHAINS_MAX_DISPLAYED_NUMBER)
|
|
21
21
|
.map((chain, index) => (
|
|
@@ -47,7 +47,7 @@ export function ExpandedQuotes(props: PropTypes) {
|
|
|
47
47
|
return (
|
|
48
48
|
<Container
|
|
49
49
|
expandMode={config?.variant === 'full-expanded' ? 'full' : 'default'}
|
|
50
|
-
className={`${containerClass} ${LayoutContainer()}`}
|
|
50
|
+
className={`${containerClass} ${LayoutContainer()} widget-expanded-quotes-container`}
|
|
51
51
|
id={WIDGET_UI_ID.EXPANDED_BOX_ID}>
|
|
52
52
|
<Header
|
|
53
53
|
title={i18n.t('Routes')}
|
|
@@ -78,6 +78,7 @@ export function Inputs(props: PropTypes) {
|
|
|
78
78
|
<FromContainer>
|
|
79
79
|
<SwapInput
|
|
80
80
|
label={i18n.t('From')}
|
|
81
|
+
id="widget-swap-from"
|
|
81
82
|
mode="From"
|
|
82
83
|
onInputChange={setInputAmount}
|
|
83
84
|
onInputBlur={sanitizeInputAmount}
|
|
@@ -133,6 +134,7 @@ export function Inputs(props: PropTypes) {
|
|
|
133
134
|
sharpBottomStyle={!isExpandable && (!!selectedQuote || fetchingQuote)}
|
|
134
135
|
label={i18n.t('To')}
|
|
135
136
|
mode="To"
|
|
137
|
+
id="widget-swap-to-input"
|
|
136
138
|
fetchingQuote={fetchingQuote}
|
|
137
139
|
chain={{
|
|
138
140
|
displayName: toBlockchain?.displayName || '',
|
|
@@ -23,6 +23,7 @@ export function QuoteInfo(props: PropTypes) {
|
|
|
23
23
|
onClick,
|
|
24
24
|
showModalFee,
|
|
25
25
|
selected,
|
|
26
|
+
id,
|
|
26
27
|
onClickAllRoutes,
|
|
27
28
|
fullExpandedMode = false,
|
|
28
29
|
container,
|
|
@@ -50,7 +51,7 @@ export function QuoteInfo(props: PropTypes) {
|
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
return showQuote ? (
|
|
53
|
-
<QuoteContainer onClick={() => onClick?.(quote)}>
|
|
54
|
+
<QuoteContainer onClick={() => onClick?.(quote)} id={id}>
|
|
54
55
|
<Quote
|
|
55
56
|
quote={quote}
|
|
56
57
|
error={error}
|
|
@@ -73,6 +73,7 @@ const themesList = [
|
|
|
73
73
|
const getThemeIcon = (theme: ThemeMode) => {
|
|
74
74
|
const iconProps: SvgIconProps = { color: 'gray', size: 16 };
|
|
75
75
|
|
|
76
|
+
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
|
|
76
77
|
switch (theme) {
|
|
77
78
|
case 'auto':
|
|
78
79
|
return <AutoThemeIcon {...iconProps} />;
|
|
@@ -131,6 +132,7 @@ export function SettingsLists() {
|
|
|
131
132
|
).length;
|
|
132
133
|
|
|
133
134
|
const handleSwapperEndItem = (totalSelected: number, total: number) => {
|
|
135
|
+
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
|
|
134
136
|
switch (fetchStatus) {
|
|
135
137
|
case 'loading':
|
|
136
138
|
return <Skeleton variant="text" size="medium" width={50} />;
|
|
@@ -230,7 +232,7 @@ export function SettingsLists() {
|
|
|
230
232
|
const infiniteApprovalItem = {
|
|
231
233
|
id: 'widget-setting-infinite-approval-item-btn',
|
|
232
234
|
title: (
|
|
233
|
-
|
|
235
|
+
<React.Fragment>
|
|
234
236
|
<Typography variant="title" size="xmedium">
|
|
235
237
|
{i18n.t('Infinite approval')}
|
|
236
238
|
</Typography>
|
|
@@ -251,7 +253,7 @@ export function SettingsLists() {
|
|
|
251
253
|
}>
|
|
252
254
|
<InfoIcon color="gray" />
|
|
253
255
|
</Tooltip>
|
|
254
|
-
|
|
256
|
+
</React.Fragment>
|
|
255
257
|
),
|
|
256
258
|
start: <InfinityIcon color="gray" size={16} />,
|
|
257
259
|
end: <Switch checked={infiniteApprove} />,
|
|
@@ -272,6 +274,7 @@ export function SettingsLists() {
|
|
|
272
274
|
container={getContainer()}
|
|
273
275
|
items={themesList}
|
|
274
276
|
value={theme}
|
|
277
|
+
className="widget-setting-theme-item-tabs-container"
|
|
275
278
|
onChange={(item) => setTheme(item.id as ThemeMode)}
|
|
276
279
|
type="primary"
|
|
277
280
|
borderRadius="small"
|
|
@@ -298,7 +301,14 @@ export function SettingsLists() {
|
|
|
298
301
|
|
|
299
302
|
return (
|
|
300
303
|
<List
|
|
301
|
-
type={
|
|
304
|
+
type={
|
|
305
|
+
<ListItemButton
|
|
306
|
+
className="widget-settings-list-item-btn"
|
|
307
|
+
hasDivider
|
|
308
|
+
id="_"
|
|
309
|
+
onClick={() => console.log()}
|
|
310
|
+
/>
|
|
311
|
+
}
|
|
302
312
|
items={settingItems}
|
|
303
313
|
/>
|
|
304
314
|
);
|
|
@@ -93,6 +93,7 @@ export function AddCustomTokenPage() {
|
|
|
93
93
|
<Divider size={10} />
|
|
94
94
|
<TextField
|
|
95
95
|
fullWidth
|
|
96
|
+
id="widget-add-custom-token-token-address-input"
|
|
96
97
|
disabled={!blockchain}
|
|
97
98
|
variant="contained"
|
|
98
99
|
placeholder={i18n.t('Enter token address')}
|
|
@@ -107,7 +108,12 @@ export function AddCustomTokenPage() {
|
|
|
107
108
|
{!isValidAddress && !!address && (
|
|
108
109
|
<>
|
|
109
110
|
<Divider size={4} />
|
|
110
|
-
<Alert
|
|
111
|
+
<Alert
|
|
112
|
+
id="widget-add-custom-token-invalid-address-alert"
|
|
113
|
+
type="error"
|
|
114
|
+
variant="alarm"
|
|
115
|
+
title="Invalid Address"
|
|
116
|
+
/>
|
|
111
117
|
</>
|
|
112
118
|
)}
|
|
113
119
|
</div>
|
|
@@ -199,7 +199,14 @@ export function ConfirmSwapPage() {
|
|
|
199
199
|
const quoteError = confirmSwapResult.error;
|
|
200
200
|
const alerts = [];
|
|
201
201
|
if (dbErrorMessage) {
|
|
202
|
-
alerts.push(
|
|
202
|
+
alerts.push(
|
|
203
|
+
<Alert
|
|
204
|
+
id="widget-confirm-swap-db-error-alert"
|
|
205
|
+
type="error"
|
|
206
|
+
variant="alarm"
|
|
207
|
+
title={dbErrorMessage}
|
|
208
|
+
/>
|
|
209
|
+
);
|
|
203
210
|
}
|
|
204
211
|
|
|
205
212
|
if (quoteWarning || quoteError) {
|
|
@@ -304,6 +311,7 @@ export function ConfirmSwapPage() {
|
|
|
304
311
|
<QuoteInfo
|
|
305
312
|
quote={selectedQuote}
|
|
306
313
|
type="swap-preview"
|
|
314
|
+
id="widget-confirm-swap-quote-container"
|
|
307
315
|
expanded
|
|
308
316
|
tagHidden
|
|
309
317
|
error={confirmSwapResult.error}
|
|
@@ -94,6 +94,7 @@ export function CustomTokensPage() {
|
|
|
94
94
|
{!!customTokens.length ? (
|
|
95
95
|
<>
|
|
96
96
|
<SearchInput
|
|
97
|
+
id="widget-custom-tokens-search-token-input"
|
|
97
98
|
value={searchedFor}
|
|
98
99
|
setValue={setSearchedFor}
|
|
99
100
|
fullWidth
|
|
@@ -152,6 +153,7 @@ export function CustomTokensPage() {
|
|
|
152
153
|
</Content>
|
|
153
154
|
<WatermarkedModal
|
|
154
155
|
open={isDeleteModalOpen}
|
|
156
|
+
id="widget-custom-tokens-delete-modal"
|
|
155
157
|
dismissible
|
|
156
158
|
onClose={() => setIsDeleteModalOpen(false)}
|
|
157
159
|
container={getContainer()}>
|
|
@@ -159,6 +159,7 @@ export function HistoryPage() {
|
|
|
159
159
|
fullWidth
|
|
160
160
|
variant="contained"
|
|
161
161
|
placeholder={i18n.t('Search Transaction')}
|
|
162
|
+
id="widget-history-search-transaction-input"
|
|
162
163
|
autoFocus
|
|
163
164
|
onChange={handleSearch}
|
|
164
165
|
style={{ height: 36 }}
|
|
@@ -211,6 +212,7 @@ export function HistoryPage() {
|
|
|
211
212
|
<WatermarkedModal
|
|
212
213
|
open={openClearModal}
|
|
213
214
|
onClose={onCloseModal}
|
|
215
|
+
id="widget-history-clear-modal"
|
|
214
216
|
container={getContainer()}>
|
|
215
217
|
<Divider size={20} />
|
|
216
218
|
<MessageBox
|
package/src/pages/Home.tsx
CHANGED
|
@@ -45,6 +45,7 @@ export function LanguagePage() {
|
|
|
45
45
|
<PageContainer>
|
|
46
46
|
<Alert
|
|
47
47
|
type="warning"
|
|
48
|
+
id="widget-language-machine-translation-alarm-alert"
|
|
48
49
|
variant="alarm"
|
|
49
50
|
title="Warning: We are using machine translation, so the translations may be inaccurate."
|
|
50
51
|
/>
|
|
@@ -54,6 +55,7 @@ export function LanguagePage() {
|
|
|
54
55
|
type={
|
|
55
56
|
<ListItemButton
|
|
56
57
|
title={i18n.t('language')}
|
|
58
|
+
className="widget-language-list-item-btn"
|
|
57
59
|
id="_"
|
|
58
60
|
onClick={() => console.log()}
|
|
59
61
|
/>
|
|
@@ -70,6 +70,7 @@ export function LiquiditySourcePage({ sourceType }: PropTypes) {
|
|
|
70
70
|
|
|
71
71
|
const list = liquiditySources.map((sourceItem) => {
|
|
72
72
|
const { selected, groupTitle, logo, id, ...restSourceItem } = sourceItem;
|
|
73
|
+
|
|
73
74
|
return {
|
|
74
75
|
id: `widget-setting-liquidity-source-${replaceSpacesWithDash(
|
|
75
76
|
id.toLowerCase()
|
|
@@ -129,6 +130,7 @@ export function LiquiditySourcePage({ sourceType }: PropTypes) {
|
|
|
129
130
|
<SearchInput
|
|
130
131
|
value={searchedFor}
|
|
131
132
|
setValue={setSearchedFor}
|
|
133
|
+
id="widget-liquidity-source-search-input"
|
|
132
134
|
fullWidth
|
|
133
135
|
color="light"
|
|
134
136
|
variant="contained"
|
|
@@ -148,7 +150,9 @@ export function LiquiditySourcePage({ sourceType }: PropTypes) {
|
|
|
148
150
|
</NotFoundContainer>
|
|
149
151
|
) : (
|
|
150
152
|
fetchStatus === 'success' && (
|
|
151
|
-
<LiquiditySourceList
|
|
153
|
+
<LiquiditySourceList
|
|
154
|
+
disabled={campaignMode}
|
|
155
|
+
className="widget-liquidity-source-list">
|
|
152
156
|
{filteredList.map((sourceItem) => {
|
|
153
157
|
const { groupTitle, ...otherProps } = sourceItem;
|
|
154
158
|
|
|
@@ -158,6 +162,7 @@ export function LiquiditySourcePage({ sourceType }: PropTypes) {
|
|
|
158
162
|
style={{ height: '61px' }}
|
|
159
163
|
{...otherProps}
|
|
160
164
|
selected={false}
|
|
165
|
+
className="widget-liquidity-source-list-item-btn"
|
|
161
166
|
hasDivider
|
|
162
167
|
/>
|
|
163
168
|
</React.Fragment>
|
|
@@ -42,6 +42,7 @@ export function SettingsPage() {
|
|
|
42
42
|
<Alert
|
|
43
43
|
type="info"
|
|
44
44
|
variant="alarm"
|
|
45
|
+
id="widget-settings-campaign-mode-alert"
|
|
45
46
|
title={i18n.t(
|
|
46
47
|
"Currently, you're in campaign mode with restrictions on liquidity sources. Would you like to switch out of this mode and make use of all available liquidity sources?"
|
|
47
48
|
)}
|
|
@@ -60,6 +60,7 @@ interface DeprecatedTokenBalance {
|
|
|
60
60
|
rawAmount: string;
|
|
61
61
|
decimal: number | null;
|
|
62
62
|
amount: string;
|
|
63
|
+
isSupported: boolean;
|
|
63
64
|
logo: string | null;
|
|
64
65
|
usdPrice: number | null;
|
|
65
66
|
}
|
|
@@ -807,6 +808,7 @@ export const createWalletsSlice = keepLastUpdated<AppStoreState, WalletsSlice>(
|
|
|
807
808
|
rawAmount: balance.amount,
|
|
808
809
|
decimal: balance.decimals,
|
|
809
810
|
amount: amount.toString(),
|
|
811
|
+
isSupported: !!token,
|
|
810
812
|
logo: token?.image || null,
|
|
811
813
|
usdPrice: token?.usdPrice || null,
|
|
812
814
|
});
|
package/src/types/config.ts
CHANGED
|
@@ -200,7 +200,7 @@ export type TonConnectConfig = {
|
|
|
200
200
|
* exchange.It can also used to limit source swap blockchains/tokens to some limited ones.
|
|
201
201
|
* @property {TrezorManifest} trezorManifest - Trezor Connect Manifest requires that you,
|
|
202
202
|
* as a Trezor Connect integrator,share your e-mail and application url.
|
|
203
|
-
* @property {TonConnectConfig} tonConnect - Configuration for TON Connect
|
|
203
|
+
* @property {TonConnectConfig} tonConnect - Configuration for the TON Connect provider.
|
|
204
204
|
* @property {BlockchainAndTokenConfig} to - The "to" property is an optional property of type
|
|
205
205
|
* "BlockchainAndTokenConfig" that specifies the default blockchain and token to which the user wants to
|
|
206
206
|
* exchange.It can also used to limit destination swap blockchains/tokens to some limited ones.
|
package/src/utils/swap.ts
CHANGED
|
@@ -305,8 +305,9 @@ export function getTotalFeeInUsd(
|
|
|
305
305
|
|
|
306
306
|
export function getUsdFee(fee: SwapFee): BigNumber {
|
|
307
307
|
let totalFeeInUsd = ZERO;
|
|
308
|
+
const price = new BigNumber(fee.price || 0);
|
|
308
309
|
totalFeeInUsd = totalFeeInUsd.plus(
|
|
309
|
-
new BigNumber(fee.amount).multipliedBy(
|
|
310
|
+
new BigNumber(fee.amount).multipliedBy(price)
|
|
310
311
|
);
|
|
311
312
|
|
|
312
313
|
return totalFeeInUsd;
|