@rango-dev/widget-embedded 0.33.4-next.1 → 0.33.4-next.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.
Files changed (92) hide show
  1. package/dist/components/BlockchainList/BlockchainList.d.ts.map +1 -1
  2. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
  3. package/dist/components/CustomDestination/CustomDestination.d.ts.map +1 -1
  4. package/dist/components/CustomTokenModal/CustomTokenModal.d.ts.map +1 -1
  5. package/dist/components/FilterSelector/FilterSelector.d.ts.map +1 -1
  6. package/dist/components/FilterSelector/FilterSelectorContent.d.ts.map +1 -1
  7. package/dist/components/HeaderButtons/BackButton.d.ts.map +1 -1
  8. package/dist/components/HeaderButtons/CancelButton.d.ts.map +1 -1
  9. package/dist/components/HeaderButtons/HeaderButtons.d.ts.map +1 -1
  10. package/dist/components/HeaderButtons/RefreshButton.d.ts.map +1 -1
  11. package/dist/components/HeaderButtons/WalletButton.d.ts.map +1 -1
  12. package/dist/components/NoResult/NoResult.d.ts.map +1 -1
  13. package/dist/components/Quote/QuoteCostDetails.d.ts.map +1 -1
  14. package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts.map +1 -1
  15. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts.map +1 -1
  16. package/dist/components/QuoteWarningsAndErrors/SlippageWariningModal.d.ts.map +1 -1
  17. package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts.map +1 -1
  18. package/dist/components/Quotes/Quotes.d.ts.map +1 -1
  19. package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
  20. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.d.ts.map +1 -1
  21. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.d.ts.map +1 -1
  22. package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -1
  23. package/dist/components/SwapDetailsModal/SwapDetailsModal.Cancel.d.ts.map +1 -1
  24. package/dist/components/SwapDetailsModal/SwapDetailsModal.Delete.d.ts.map +1 -1
  25. package/dist/components/TokenList/TokenList.d.ts.map +1 -1
  26. package/dist/components/WalletStatefulConnect/DerivationPath.d.ts.map +1 -1
  27. package/dist/components/WalletStatefulConnect/ExperimentalChain.d.ts.map +1 -1
  28. package/dist/components/WalletStatefulConnect/Namespaces.d.ts.map +1 -1
  29. package/dist/components/common/ActivateTabAlert/ActivateTabAlert.d.ts.map +1 -1
  30. package/dist/components/common/ActivateTabModal/ActivateTabModal.d.ts.map +1 -1
  31. package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts.map +1 -1
  32. package/dist/hooks/useFetchCustomToken.d.ts +1 -1
  33. package/dist/hooks/useFetchCustomToken.d.ts.map +1 -1
  34. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts.map +1 -1
  35. package/dist/index.js +2 -2
  36. package/dist/index.js.map +3 -3
  37. package/dist/pages/AddCustomTokenPage.d.ts.map +1 -1
  38. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  39. package/dist/pages/CustomTokensPage.d.ts.map +1 -1
  40. package/dist/pages/HistoryPage.d.ts.map +1 -1
  41. package/dist/pages/Home.d.ts.map +1 -1
  42. package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
  43. package/dist/pages/SettingsPage.d.ts.map +1 -1
  44. package/dist/test-utils/fixtures.d.ts.map +1 -1
  45. package/dist/utils/quote.d.ts.map +1 -1
  46. package/dist/widget-embedded.build.json +1 -1
  47. package/package.json +10 -10
  48. package/src/components/BlockchainList/BlockchainList.tsx +2 -1
  49. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +3 -0
  50. package/src/components/CustomDestination/CustomDestination.tsx +8 -2
  51. package/src/components/CustomTokenModal/CustomTokenModal.tsx +1 -0
  52. package/src/components/FilterSelector/FilterSelector.tsx +1 -0
  53. package/src/components/FilterSelector/FilterSelectorContent.tsx +5 -1
  54. package/src/components/HeaderButtons/BackButton.tsx +5 -1
  55. package/src/components/HeaderButtons/CancelButton.tsx +5 -1
  56. package/src/components/HeaderButtons/HeaderButtons.tsx +14 -3
  57. package/src/components/HeaderButtons/RefreshButton.tsx +1 -0
  58. package/src/components/HeaderButtons/WalletButton.tsx +5 -1
  59. package/src/components/NoResult/NoResult.tsx +1 -0
  60. package/src/components/Quote/QuoteCostDetails.tsx +4 -1
  61. package/src/components/QuoteWarningsAndErrors/HighValueLossWarningModal.tsx +1 -0
  62. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.tsx +1 -0
  63. package/src/components/QuoteWarningsAndErrors/SlippageWariningModal.tsx +2 -0
  64. package/src/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.tsx +1 -0
  65. package/src/components/Quotes/Quotes.tsx +6 -1
  66. package/src/components/SwapDetails/SwapDetails.tsx +3 -0
  67. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.tsx +2 -0
  68. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.tsx +1 -0
  69. package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +8 -1
  70. package/src/components/SwapDetailsModal/SwapDetailsModal.Cancel.tsx +7 -1
  71. package/src/components/SwapDetailsModal/SwapDetailsModal.Delete.tsx +7 -1
  72. package/src/components/TokenList/TokenList.tsx +1 -0
  73. package/src/components/WalletStatefulConnect/DerivationPath.tsx +1 -0
  74. package/src/components/WalletStatefulConnect/ExperimentalChain.tsx +1 -0
  75. package/src/components/WalletStatefulConnect/Namespaces.tsx +1 -0
  76. package/src/components/common/ActivateTabAlert/ActivateTabAlert.tsx +1 -0
  77. package/src/components/common/ActivateTabModal/ActivateTabModal.tsx +1 -0
  78. package/src/containers/Settings/Lists.tsx +6 -6
  79. package/src/hooks/useConfirmSwap/useConfirmSwap.ts +4 -0
  80. package/src/hooks/useFetchConfirmQuote.ts +1 -1
  81. package/src/hooks/useFetchCustomToken.ts +13 -17
  82. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.ts +135 -4
  83. package/src/pages/AddCustomTokenPage.tsx +5 -1
  84. package/src/pages/ConfirmSwapPage.tsx +2 -0
  85. package/src/pages/CustomTokensPage.tsx +4 -0
  86. package/src/pages/HistoryPage.tsx +3 -0
  87. package/src/pages/Home.tsx +2 -0
  88. package/src/pages/LanguagePage.tsx +1 -1
  89. package/src/pages/LiquiditySourcePage.tsx +16 -3
  90. package/src/pages/SettingsPage.tsx +5 -1
  91. package/src/test-utils/fixtures.ts +1 -0
  92. package/src/utils/quote.ts +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.33.4-next.1",
3
+ "version": "0.33.4-next.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -25,23 +25,23 @@
25
25
  "@lingui/core": "4.2.1",
26
26
  "@lingui/react": "4.2.1",
27
27
  "@rango-dev/logging-core": "^0.6.0",
28
- "@rango-dev/provider-all": "^0.37.4-next.1",
28
+ "@rango-dev/provider-all": "^0.37.4-next.2",
29
29
  "@rango-dev/queue-manager-core": "^0.27.0",
30
- "@rango-dev/queue-manager-rango-preset": "^0.37.1-next.3",
30
+ "@rango-dev/queue-manager-rango-preset": "^0.37.1-next.4",
31
31
  "@rango-dev/queue-manager-react": "^0.27.0",
32
- "@rango-dev/signer-solana": "^0.32.1-next.1",
33
- "@rango-dev/ui": "^0.39.1-next.6",
34
- "@rango-dev/wallets-core": "^0.38.1-next.1",
35
- "@rango-dev/wallets-react": "^0.23.1-next.3",
36
- "@rango-dev/wallets-shared": "^0.37.1-next.3",
32
+ "@rango-dev/signer-solana": "^0.32.1-next.2",
33
+ "@rango-dev/ui": "^0.39.1-next.8",
34
+ "@rango-dev/wallets-core": "^0.38.1-next.2",
35
+ "@rango-dev/wallets-react": "^0.23.1-next.4",
36
+ "@rango-dev/wallets-shared": "^0.37.1-next.4",
37
37
  "bignumber.js": "^9.1.1",
38
38
  "copy-to-clipboard": "^3.3.3",
39
39
  "dayjs": "^1.11.7",
40
40
  "ethers": "^6.13.2",
41
41
  "immer": "^9.0.19",
42
42
  "mitt": "^3.0.0",
43
- "rango-sdk": "^0.1.49",
44
- "rango-types": "^0.1.69",
43
+ "rango-sdk": "^0.1.57",
44
+ "rango-types": "^0.1.74",
45
45
  "react-i18next": "^12.2.0",
46
46
  "react-router-dom": "^6.8.0",
47
47
  "values.js": "2.1.1",
@@ -48,6 +48,7 @@ export function BlockchainList(props: PropTypes) {
48
48
  {blockchains.map((item) => (
49
49
  <ListItemButton
50
50
  key={`${item.name}-${item.chainId}`}
51
+ className={`widget-blockchain-list-item-btn`}
51
52
  hasDivider
52
53
  onClick={() => onChange(item)}
53
54
  start={<Image src={item.logo} size={30} />}
@@ -56,7 +57,7 @@ export function BlockchainList(props: PropTypes) {
56
57
  {item.displayName}
57
58
  </Typography>
58
59
  }
59
- id={item.chainId as string}
60
+ id={item.name}
60
61
  />
61
62
  ))}
62
63
  </List>
@@ -331,6 +331,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
331
331
  footer: (
332
332
  <ConfirmButton>
333
333
  <Button
334
+ id="widget-confirm-wallet-modal-confirm-btn"
334
335
  loading={loading}
335
336
  disabled={isConfirmSwapDisabled(
336
337
  loading,
@@ -355,6 +356,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
355
356
  header: (
356
357
  <ShowMoreHeader>
357
358
  <NavigateBack
359
+ id="widget-confirm-wallet-modal-navigate-back-icon-btn"
358
360
  variant="ghost"
359
361
  onClick={setShowMoreWalletFor.bind(null, '')}>
360
362
  <ChevronLeftIcon size={16} />
@@ -383,6 +385,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
383
385
  type="error"
384
386
  description={<BalanceErrors messages={balanceWarnings ?? []} />}>
385
387
  <Button
388
+ id="widget-confirm-wallet-modal-proceed-anyway-btn"
386
389
  variant="outlined"
387
390
  size="large"
388
391
  type="primary"
@@ -63,13 +63,19 @@ export function CustomDestination(props: PropTypes) {
63
63
  const renderSuffix = () => {
64
64
  if (customDestination) {
65
65
  return (
66
- <IconButton onClick={handleClear} variant="ghost">
66
+ <IconButton
67
+ id="widget-custom-destination-close-icon-btn"
68
+ onClick={handleClear}
69
+ variant="ghost">
67
70
  <CloseIcon size={12} color="gray" />
68
71
  </IconButton>
69
72
  );
70
73
  } else if (!isFirefox) {
71
74
  return (
72
- <IconButton onClick={handlePaste} variant="ghost">
75
+ <IconButton
76
+ id="widget-custom-destination-paste-icon-btn"
77
+ onClick={handlePaste}
78
+ variant="ghost">
73
79
  <PasteIcon size={16} />
74
80
  </IconButton>
75
81
  );
@@ -80,6 +80,7 @@ export function CustomTokenModal(props: PropTypes) {
80
80
  <Divider size={10} />
81
81
 
82
82
  <Button
83
+ id="widget-custom-token-modal-import-btn"
83
84
  variant="contained"
84
85
  size="large"
85
86
  type="primary"
@@ -28,6 +28,7 @@ export function FilterSelector(props: FilterSelectorPropTypes) {
28
28
  />
29
29
  }>
30
30
  <FilterButton
31
+ id="widget-filter-selector-filter-icon-btn"
31
32
  variant="default"
32
33
  isSelect={!!filterBy}
33
34
  onClick={() => onOpenChange(!props.open)}>
@@ -25,7 +25,11 @@ export function FilterSelectorContent(props: PropTypes) {
25
25
  <Typography size="small" variant="body">
26
26
  {i18n.t('Status')}
27
27
  </Typography>
28
- <Button variant="ghost" size="xxsmall" onClick={() => onClickItem('')}>
28
+ <Button
29
+ id="widget-filter-selector-reset-btn"
30
+ variant="ghost"
31
+ size="xxsmall"
32
+ onClick={() => onClickItem('')}>
29
33
  {i18n.t('Reset')}
30
34
  </Button>
31
35
  </div>
@@ -7,7 +7,11 @@ import { HeaderButton } from './HeaderButtons.styles';
7
7
 
8
8
  function BackButton(props: PropTypes) {
9
9
  return (
10
- <HeaderButton variant="ghost" size="small" onClick={props.onClick}>
10
+ <HeaderButton
11
+ id="widget-header-back-icon-btn"
12
+ variant="ghost"
13
+ size="small"
14
+ onClick={props.onClick}>
11
15
  <ChevronLeftIcon color="black" size={16} />
12
16
  </HeaderButton>
13
17
  );
@@ -9,7 +9,11 @@ import { SuffixContainer } from './HeaderButtons.styles';
9
9
  function CancelButton(props: PropTypes) {
10
10
  return (
11
11
  <SuffixContainer>
12
- <Button variant="ghost" onClick={props.onClick} size="xsmall">
12
+ <Button
13
+ id="widget-header-cancel-btn"
14
+ variant="ghost"
15
+ onClick={props.onClick}
16
+ size="xsmall">
13
17
  <Typography variant="label" size="medium" color="error500">
14
18
  {i18n.t('Cancel')}
15
19
  </Typography>
@@ -61,7 +61,10 @@ export function HeaderButtons(props: HeaderButtonsPropTypes) {
61
61
  container={getContainer()}
62
62
  side="top"
63
63
  content={i18n.t('Notifications')}>
64
- <HeaderButton size="small" variant="ghost">
64
+ <HeaderButton
65
+ id="widget-header-notification-icon-btn"
66
+ size="small"
67
+ variant="ghost">
65
68
  <NotificationsIcon size={18} color="black" />
66
69
  <NotificationsBadge />
67
70
  </HeaderButton>
@@ -74,7 +77,11 @@ export function HeaderButtons(props: HeaderButtonsPropTypes) {
74
77
  container={getContainer()}
75
78
  side="top"
76
79
  content={i18n.t('Settings')}>
77
- <HeaderButton size="small" variant="ghost" onClick={onClickSettings}>
80
+ <HeaderButton
81
+ id="widget-header-setting-icon-btn"
82
+ size="small"
83
+ variant="ghost"
84
+ onClick={onClickSettings}>
78
85
  <SettingsIcon size={18} color="black" />
79
86
  </HeaderButton>
80
87
  </Tooltip>
@@ -84,7 +91,11 @@ export function HeaderButtons(props: HeaderButtonsPropTypes) {
84
91
  container={getContainer()}
85
92
  side="top"
86
93
  content={i18n.t('History')}>
87
- <HeaderButton size="small" variant="ghost" onClick={onClickHistory}>
94
+ <HeaderButton
95
+ id="widget-header-history-icon-btn"
96
+ size="small"
97
+ variant="ghost"
98
+ onClick={onClickHistory}>
88
99
  <TransactionIcon size={18} color="black" />
89
100
  <InProgressTransactionBadge />
90
101
  </HeaderButton>
@@ -61,6 +61,7 @@ function RefreshButton({ onClick }: { onClick: (() => void) | undefined }) {
61
61
 
62
62
  return (
63
63
  <HeaderButton
64
+ id="widget-header-refresh-icon-btn"
64
65
  variant="ghost"
65
66
  size="small"
66
67
  style={{ paddingTop: 0, paddingBottom: 0 }}
@@ -32,7 +32,11 @@ function WalletButton(props: PropTypes) {
32
32
 
33
33
  return (
34
34
  <Tooltip container={props.container} side="bottom" content={content}>
35
- <HeaderButton variant="ghost" size="small" onClick={props.onClick}>
35
+ <HeaderButton
36
+ id="widget-header-wallet-icon-btn"
37
+ variant="ghost"
38
+ size="small"
39
+ onClick={props.onClick}>
36
40
  {props.isConnected && <ConnectedIcon />}
37
41
  <WalletIcon size={18} color="black" />
38
42
  </HeaderButton>
@@ -68,6 +68,7 @@ export function NoResult(props: PropTypes) {
68
68
  info.alert.action && (
69
69
  <Button
70
70
  size="xsmall"
71
+ id="widget-no-result-alert-btn"
71
72
  type={info.alert.type}
72
73
  prefix={
73
74
  <PrefixIcon>
@@ -91,7 +91,10 @@ export function QuoteCostDetails(props: QuoteCostDetailsProps) {
91
91
  {i18n.t('Gas & Fee Explanation')}
92
92
  </Typography>
93
93
 
94
- <IconButton onClick={() => setOpen(false)} variant="ghost">
94
+ <IconButton
95
+ id="widget-quote-cost-details-modal-close-icon-btn"
96
+ onClick={() => setOpen(false)}
97
+ variant="ghost">
95
98
  <CloseIcon color="gray" size={14} />
96
99
  </IconButton>
97
100
  </ModalHeader>
@@ -78,6 +78,7 @@ export function HighValueLossWarningModal(props: Props) {
78
78
  <WatermarkedModal
79
79
  footer={
80
80
  <Button
81
+ id="widget-high-value-loss-warning-modal-confirm-btn"
81
82
  type="primary"
82
83
  size="large"
83
84
  prefix={<WarningIcon />}
@@ -71,6 +71,7 @@ export function QuoteWarningsAndErrors(props: PropTypes) {
71
71
  {...(alertInfo.action === 'change-settings' && {
72
72
  action: (
73
73
  <Button
74
+ id="widget-quote-warning-error-change-settings-btn"
74
75
  size="xxsmall"
75
76
  type={alertInfo.alertType}
76
77
  onClick={onChangeSettings}>
@@ -35,6 +35,7 @@ export function SlippageWarningModal(props: PropsTypes) {
35
35
  prefix={
36
36
  <Button
37
37
  size="small"
38
+ id="widget-slippage-warning-modal-change-settings-btn"
38
39
  variant="ghost"
39
40
  onClick={() => navigate('../' + navigationRoutes.settings)}>
40
41
  <Typography variant="label" size="medium" color="$neutral900">
@@ -67,6 +68,7 @@ export function SlippageWarningModal(props: PropsTypes) {
67
68
  <Divider size={18} />
68
69
  <Divider size={32} />
69
70
  <Button
71
+ id="widget-slippage-warning-modal-confirm-anyway-btn"
70
72
  size="large"
71
73
  type="primary"
72
74
  variant="contained"
@@ -21,6 +21,7 @@ export function UnknownPriceWarningModal(props: Props) {
21
21
  <WatermarkedModal
22
22
  footer={
23
23
  <Button
24
+ id="widget-unknown-price-warning-modal-confirm-btn"
24
25
  type="primary"
25
26
  size="large"
26
27
  prefix={<WarningIcon />}
@@ -49,6 +49,7 @@ export function Quotes(props: PropTypes) {
49
49
  }
50
50
  const mergedQuote: SelectedQuote = {
51
51
  requestAmount: quotes.requestAmount, // Assuming quotes is an array
52
+ validationStatus: null,
52
53
  ...quote,
53
54
  };
54
55
 
@@ -112,7 +113,11 @@ export function Quotes(props: PropTypes) {
112
113
  container={container}
113
114
  selected={selectedQuote?.requestId === quote.requestId}
114
115
  tagHidden={false}
115
- quote={{ ...quote, requestAmount: quotes.requestAmount }}
116
+ quote={{
117
+ ...quote,
118
+ requestAmount: quotes.requestAmount,
119
+ validationStatus: null,
120
+ }}
116
121
  loading={loading}
117
122
  error={quoteError?.options || null}
118
123
  warning={quoteWarning}
@@ -272,6 +272,7 @@ export function SwapDetails(props: SwapDetailsProps) {
272
272
  suffix: swap.status !== 'running' && (
273
273
  <SuffixContainer>
274
274
  <Button
275
+ id="widget-swap-details-delete-btn"
275
276
  variant="ghost"
276
277
  type="error"
277
278
  size="xsmall"
@@ -288,6 +289,7 @@ export function SwapDetails(props: SwapDetailsProps) {
288
289
  !showCompletedModal && (
289
290
  <Button
290
291
  fullWidth
292
+ id="widget-swap-details-try-again-btn"
291
293
  variant="contained"
292
294
  type="primary"
293
295
  size="large"
@@ -325,6 +327,7 @@ export function SwapDetails(props: SwapDetailsProps) {
325
327
  alignOffset={-16}
326
328
  align="end">
327
329
  <IconButton
330
+ id="widget-swap-details-done-copy-icon-btn"
328
331
  variant="ghost"
329
332
  onClick={handleCopy.bind(null, requestId || '')}>
330
333
  {isCopied ? (
@@ -14,6 +14,7 @@ export function WarningAlert(props: WaningAlertsProps) {
14
14
  title={message.shortMessage}
15
15
  action={
16
16
  <Button
17
+ id="widget-swap-details-warning-alert-change-network-btn"
17
18
  size="xxsmall"
18
19
  type="warning"
19
20
  onClick={() => {
@@ -37,6 +38,7 @@ export function WarningAlert(props: WaningAlertsProps) {
37
38
  title={message.shortMessage}
38
39
  action={
39
40
  <Button
41
+ id="widget-swap-details-warning-alert-connect-wallet-btn"
40
42
  size="xxsmall"
41
43
  type="warning"
42
44
  onClick={() => {
@@ -53,6 +53,7 @@ export function SwapDetailsAlerts(props: SwapAlertsProps) {
53
53
  action={
54
54
  explorerUrl.url && (
55
55
  <IconButton
56
+ id="widget-swap-details-tx-link-icon-btn"
56
57
  variant="ghost"
57
58
  size="xsmall"
58
59
  onClick={() => window.open(explorerUrl.url, '_blank')}>
@@ -75,6 +75,7 @@ export function SwapDetailsCompleteModal(props: CompleteModalPropTypes) {
75
75
  <Divider size={32} />
76
76
  {status === 'success' && (
77
77
  <Button
78
+ id="widget-swap-details-modal-done-btn"
78
79
  variant="contained"
79
80
  type="primary"
80
81
  size="large"
@@ -92,6 +93,7 @@ export function SwapDetailsCompleteModal(props: CompleteModalPropTypes) {
92
93
  <>
93
94
  <Button
94
95
  variant="contained"
96
+ id="widget-swap-detail-modal-diagnosis-btn"
95
97
  type="primary"
96
98
  size="large"
97
99
  onClick={() => window.open(diagnosisUrl, '_blank')}>
@@ -100,7 +102,12 @@ export function SwapDetailsCompleteModal(props: CompleteModalPropTypes) {
100
102
  <Divider size={12} />
101
103
  </>
102
104
  )}
103
- <Button variant="outlined" type="primary" size="large" onClick={onClose}>
105
+ <Button
106
+ id="widget-swap-details-modal-see-details-btn"
107
+ variant="outlined"
108
+ type="primary"
109
+ size="large"
110
+ onClick={onClose}>
104
111
  <Typography variant="title" size="medium" color="primary">
105
112
  {i18n.t('See Details')}
106
113
  </Typography>
@@ -16,13 +16,19 @@ export const CancelContent = ({ onCancel, onClose }: CancelContentProps) => {
16
16
  <Divider size={32} />
17
17
  <Button
18
18
  variant="contained"
19
+ id="widget-swap-details-modal-cancel-swap-yes-btn"
19
20
  type="primary"
20
21
  size="large"
21
22
  onClick={onCancel}>
22
23
  {i18n.t('Yes, Cancel it')}
23
24
  </Button>
24
25
  <Divider size={12} />
25
- <Button variant="outlined" type="primary" size="large" onClick={onClose}>
26
+ <Button
27
+ id="widget-swap-details-modal-cancel-swap-no-btn"
28
+ variant="outlined"
29
+ type="primary"
30
+ size="large"
31
+ onClick={onClose}>
26
32
  {i18n.t('No, Continue')}
27
33
  </Button>
28
34
  </>
@@ -15,6 +15,7 @@ export const DeleteContent = ({ onDelete, onClose }: DeleteContentProps) => {
15
15
  />
16
16
  <Divider size={32} />
17
17
  <Button
18
+ id="widget-swap-details-modal-delete-swap-yes-btn"
18
19
  variant="contained"
19
20
  type="primary"
20
21
  size="large"
@@ -22,7 +23,12 @@ export const DeleteContent = ({ onDelete, onClose }: DeleteContentProps) => {
22
23
  {i18n.t('Yes, Delete it')}
23
24
  </Button>
24
25
  <Divider size={12} />
25
- <Button variant="outlined" type="primary" size="large" onClick={onClose}>
26
+ <Button
27
+ id="widget-swap-details-modal-delete-swap-no-btn"
28
+ variant="outlined"
29
+ type="primary"
30
+ size="large"
31
+ onClick={onClose}>
26
32
  <Typography variant="title" size="medium" color="primary">
27
33
  {i18n.t('No, Cancel')}
28
34
  </Typography>
@@ -202,6 +202,7 @@ export function TokenList(props: PropTypes) {
202
202
  tab-index={index}
203
203
  key={`${token.symbol}${token.address}`}
204
204
  id={`${token.symbol}${token.address}`}
205
+ className={`widget-token-list-item-btn`}
205
206
  hasDivider
206
207
  onClick={() => onChange && onChange(tokens[index])}
207
208
  start={
@@ -143,6 +143,7 @@ export function DerivationPath(props: PropTypes) {
143
143
  </InputsContainer>
144
144
 
145
145
  <Button
146
+ id="widget-derivation-path-confirm-btn"
146
147
  type="primary"
147
148
  onClick={handleConfirm}
148
149
  disabled={
@@ -24,6 +24,7 @@ export function ExperimentalChain(props: PropTypes) {
24
24
  <Divider size={18} />
25
25
  <Divider size={32} />
26
26
  <Button
27
+ id="widget-experimental-chain-confirm-btn"
27
28
  onClick={onConfirm}
28
29
  variant="outlined"
29
30
  type="primary"
@@ -109,6 +109,7 @@ export function Namespaces(props: PropTypes) {
109
109
  )}
110
110
  </NamespaceList>
111
111
  <Button
112
+ id="widget-name-space-confirm-btn"
112
113
  type="primary"
113
114
  disabled={!selectedNamespaces.length}
114
115
  onClick={() => props.onConfirm(selectedNamespaces)}>
@@ -9,6 +9,7 @@ export function ActivateTabAlert(props: PropTypes) {
9
9
  <Alert
10
10
  action={
11
11
  <Button
12
+ id="widget-active-tab-btn"
12
13
  onClick={props.onActivateTab}
13
14
  variant="contained"
14
15
  size="xxsmall"
@@ -24,6 +24,7 @@ export function ActivateTabModal(props: PropTypes) {
24
24
  )}>
25
25
  <Divider size={20} />
26
26
  <Button
27
+ id="widget-modal-confirm-activate-tab-btn"
27
28
  variant="contained"
28
29
  size="large"
29
30
  type="primary"
@@ -150,7 +150,7 @@ export function SettingsLists() {
150
150
  };
151
151
 
152
152
  const bridgeItem = {
153
- id: 'bridge-item',
153
+ id: 'widget-setting-bridge-item-btn',
154
154
  title: (
155
155
  <Typography variant="title" size="xmedium">
156
156
  {i18n.t('Bridges')}
@@ -168,7 +168,7 @@ export function SettingsLists() {
168
168
  };
169
169
 
170
170
  const exchangeItem = {
171
- id: 'exchange-item',
171
+ id: 'widget-setting-exchange-item-btn',
172
172
  title: (
173
173
  <Typography variant="title" size="xmedium">
174
174
  {i18n.t('Exchanges')}
@@ -189,7 +189,7 @@ export function SettingsLists() {
189
189
  };
190
190
 
191
191
  const customTokensItem = {
192
- id: 'custom-tokens-item',
192
+ id: 'widget-setting-custom-tokens-item-btn',
193
193
  title: (
194
194
  <Typography variant="title" size="xmedium">
195
195
  {i18n.t('Custom Tokens')}
@@ -208,7 +208,7 @@ export function SettingsLists() {
208
208
  onClick: () => navigate(navigationRoutes.customTokens),
209
209
  };
210
210
  const languageItem = {
211
- id: 'language-item',
211
+ id: 'widget-setting-language-item-btn',
212
212
  title: (
213
213
  <Typography variant="title" size="xmedium">
214
214
  {i18n.t('Language')}
@@ -228,7 +228,7 @@ export function SettingsLists() {
228
228
  };
229
229
 
230
230
  const infiniteApprovalItem = {
231
- id: 'infinite-approval-item',
231
+ id: 'widget-setting-infinite-approval-item-btn',
232
232
  title: (
233
233
  <>
234
234
  <Typography variant="title" size="xmedium">
@@ -259,7 +259,7 @@ export function SettingsLists() {
259
259
  };
260
260
 
261
261
  const themeItem = {
262
- id: 'theme-item',
262
+ id: 'widget-setting-theme-item-btn',
263
263
  type: <ListItem />,
264
264
  title: (
265
265
  <Typography variant="title" size="xmedium">
@@ -71,6 +71,10 @@ export function useConfirmSwap(): ConfirmSwap {
71
71
  return await fetchQuote(requestBody, true).then((response) => {
72
72
  const { result } = response;
73
73
 
74
+ if (!result) {
75
+ throw new Error('Error fetching updated route');
76
+ }
77
+
74
78
  throwErrorIfResponseIsNotValid({
75
79
  diagnosisMessages: result.diagnosisMessages,
76
80
  requestId: result.requestId,
@@ -14,7 +14,7 @@ export function useFetchConfirmQuote(): UseFetchResult<
14
14
  ConfirmRouteResponse
15
15
  >({
16
16
  request: async (requestBody, options) =>
17
- await httpService().confirmRouteRequest(requestBody, options),
17
+ await httpService().confirmRoute(requestBody, options),
18
18
  });
19
19
 
20
20
  return { fetch, loading, cancelFetch };
@@ -3,8 +3,8 @@ import type { Token } from 'rango-sdk';
3
3
  import { i18n } from '@lingui/core';
4
4
  import { useState } from 'react';
5
5
 
6
+ import { httpService } from '../services/httpService';
6
7
  import { useAppStore } from '../store/AppStore';
7
- import { getConfig } from '../utils/configs';
8
8
 
9
9
  type ErrorType = {
10
10
  title: string;
@@ -18,7 +18,7 @@ interface UseFetchCustomToken {
18
18
  }: {
19
19
  blockchain: string;
20
20
  tokenAddress: string;
21
- }) => Promise<Token>;
21
+ }) => Promise<Token | undefined>;
22
22
  loading: boolean;
23
23
  error?: ErrorType;
24
24
  }
@@ -77,27 +77,23 @@ export function useFetchCustomToken(): UseFetchCustomToken {
77
77
  return undefined;
78
78
  }
79
79
 
80
- const res = await fetch(
81
- `${getConfig('BASE_URL')}/meta/token?apiKey=${getConfig(
82
- 'API_KEY'
83
- )}&blockchain=${blockchain}&address=${tokenAddress}`
84
- );
85
- const contentType = res.headers.get('content-type');
86
- const response =
87
- contentType &&
88
- contentType.includes('application/json') &&
89
- (await res.json());
90
- if (!response || response.error) {
80
+ const response = await httpService().getCustomToken({
81
+ blockchain,
82
+ address: tokenAddress,
83
+ });
84
+
85
+ if (!response || !response.token || response.error) {
91
86
  const errorMessage = produceErrorMessage('not-found', blockchain);
92
87
  setError(errorMessage);
93
88
  return undefined;
94
89
  }
95
90
 
96
91
  // Check if token is already in the system
92
+ const token = response.token;
97
93
  const isTokenFound = findToken({
98
- blockchain: response.blockchain,
99
- address: response.address,
100
- symbol: response.symbol,
94
+ blockchain: token.blockchain,
95
+ address: token.address,
96
+ symbol: token.symbol,
101
97
  });
102
98
  if (isTokenFound) {
103
99
  const errorMessage = produceErrorMessage('token-exist');
@@ -105,7 +101,7 @@ export function useFetchCustomToken(): UseFetchCustomToken {
105
101
  return undefined;
106
102
  }
107
103
 
108
- return response;
104
+ return token;
109
105
  } catch (error: any) {
110
106
  setError(undefined);
111
107
  throw new Error(error.message);