@rango-dev/ui 0.1.10-next.92 → 0.1.11-next.2

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 (96) hide show
  1. package/README.md +1 -181
  2. package/dist/components/Alert/LoadingFailedAlert.d.ts +2 -0
  3. package/dist/components/Alert/NotFoundAlert.d.ts +7 -0
  4. package/dist/components/Alert/index.d.ts +1 -0
  5. package/dist/components/BlockchainSelector/BlockchainSelector.d.ts +1 -1
  6. package/dist/components/Button/Button.d.ts +1 -1
  7. package/dist/components/Divider/Divider.d.ts +6 -0
  8. package/dist/components/Divider/index.d.ts +1 -0
  9. package/dist/components/Header/Header.d.ts +9 -0
  10. package/dist/components/Header/index.d.ts +1 -0
  11. package/dist/components/Icon/ArrowRightIcon.d.ts +3 -0
  12. package/dist/components/Icon/index.d.ts +1 -0
  13. package/dist/components/LiquiditySourceList/LiquiditySourceList.d.ts +3 -1
  14. package/dist/components/LiquiditySourcesSelector/LiquiditySourcesSelector.d.ts +2 -1
  15. package/dist/components/Modal/Modal.d.ts +0 -1
  16. package/dist/components/SelectableWalletList/mock.d.ts +1 -1
  17. package/dist/components/Settings/Settings.d.ts +2 -1
  18. package/dist/components/SwapContainer/SwapContainer.d.ts +1 -0
  19. package/dist/components/SwapDetail/Token.d.ts +16 -0
  20. package/dist/components/TokenList/TokenList.d.ts +2 -2
  21. package/dist/components/TokenSelector/TokenSelector.d.ts +4 -3
  22. package/dist/components/index.d.ts +2 -0
  23. package/dist/containers/ConfirmSwap/ConfirmSwap.d.ts +10 -17
  24. package/dist/containers/ConfirmSwap/ConfirmSwap.stories.d.ts +1 -0
  25. package/dist/containers/ConfirmSwap/mock.d.ts +3 -0
  26. package/dist/containers/History/History.d.ts +6 -1
  27. package/dist/containers/History/index.d.ts +1 -1
  28. package/dist/containers/History/types.d.ts +3 -24
  29. package/dist/containers/SwapHistory/SwapHistory.d.ts +16 -3
  30. package/dist/containers/SwapHistory/SwapMessages.d.ts +17 -0
  31. package/dist/containers/index.d.ts +0 -1
  32. package/dist/helper/index.d.ts +1 -0
  33. package/dist/types/meta.d.ts +1 -0
  34. package/dist/ui.cjs.development.js +1069 -857
  35. package/dist/ui.cjs.development.js.map +1 -1
  36. package/dist/ui.cjs.production.min.js +1 -1
  37. package/dist/ui.cjs.production.min.js.map +1 -1
  38. package/dist/ui.esm.js +1068 -859
  39. package/dist/ui.esm.js.map +1 -1
  40. package/package.json +3 -2
  41. package/src/components/Alert/Alert.tsx +33 -12
  42. package/src/components/Alert/LoadingFailedAlert.tsx +11 -0
  43. package/src/components/Alert/NotFoundAlert.tsx +19 -0
  44. package/src/components/Alert/index.ts +1 -0
  45. package/src/components/BestRoute/mock.ts +10 -0
  46. package/src/components/BlockchainSelector/BlockchainSelector.tsx +13 -19
  47. package/src/components/Button/Button.tsx +2 -1
  48. package/src/components/ConnectWalletsModal/mockData.ts +16 -0
  49. package/src/components/Divider/Divider.tsx +41 -0
  50. package/src/components/Divider/index.ts +1 -0
  51. package/src/components/Header/Header.tsx +39 -0
  52. package/src/components/Header/index.ts +1 -0
  53. package/src/components/Icon/ArrowRightIcon.tsx +31 -0
  54. package/src/components/Icon/index.ts +1 -0
  55. package/src/components/LiquiditySourceList/LiquiditySourceList.tsx +72 -22
  56. package/src/components/LiquiditySourcesSelector/LiquiditySourcesSelector.tsx +15 -10
  57. package/src/components/Modal/Modal.tsx +1 -6
  58. package/src/components/SecondaryPage/SecondaryPage.tsx +26 -52
  59. package/src/components/SelectableWalletList/SelectableWalletList.tsx +5 -0
  60. package/src/components/SelectableWalletList/mock.ts +4 -3
  61. package/src/components/Settings/Settings.tsx +30 -11
  62. package/src/components/StatusDrawer/StatusDrawer.tsx +1 -0
  63. package/src/components/StepDetail/StepDetail.tsx +1 -0
  64. package/src/components/SwapContainer/SwapContainer.tsx +21 -16
  65. package/src/components/SwapDetail/SwapDetail.tsx +77 -115
  66. package/src/components/SwapDetail/Token.tsx +68 -0
  67. package/src/components/SwapDetail/mock.ts +1 -0
  68. package/src/components/TextField/TextField.tsx +1 -0
  69. package/src/components/TokenList/TokenItem.tsx +4 -1
  70. package/src/components/TokenList/TokenList.tsx +18 -21
  71. package/src/components/TokenSelector/TokenSelector.tsx +38 -25
  72. package/src/components/Wallet/Wallet.tsx +1 -1
  73. package/src/components/index.ts +2 -0
  74. package/src/containers/ConfirmSwap/ConfirmSwap.stories.tsx +11 -2
  75. package/src/containers/ConfirmSwap/ConfirmSwap.tsx +103 -117
  76. package/src/containers/ConfirmSwap/mock.ts +79 -2
  77. package/src/containers/History/History.tsx +57 -38
  78. package/src/containers/History/index.ts +1 -1
  79. package/src/containers/History/mock.ts +1 -0
  80. package/src/containers/History/types.tsx +2 -30
  81. package/src/containers/SwapHistory/SwapHistory.tsx +313 -165
  82. package/src/containers/SwapHistory/SwapMessages.tsx +116 -0
  83. package/src/containers/SwapHistory/mock.ts +1 -0
  84. package/src/containers/index.ts +0 -1
  85. package/src/helper/index.ts +14 -0
  86. package/src/types/meta.ts +2 -0
  87. package/dist/containers/ConfirmWallets/ConfirmWallets.d.ts +0 -16
  88. package/dist/containers/ConfirmWallets/ConfirmWallets.stories.d.ts +0 -6
  89. package/dist/containers/ConfirmWallets/index.d.ts +0 -1
  90. package/dist/containers/ConfirmWallets/mock.d.ts +0 -5
  91. package/dist/helper/swaps.d.ts +0 -5
  92. package/src/containers/ConfirmWallets/ConfirmWallets.stories.tsx +0 -26
  93. package/src/containers/ConfirmWallets/ConfirmWallets.tsx +0 -143
  94. package/src/containers/ConfirmWallets/index.ts +0 -1
  95. package/src/containers/ConfirmWallets/mock.ts +0 -222
  96. package/src/helper/swaps.ts +0 -23
@@ -4,6 +4,7 @@ import { styled } from '../../theme';
4
4
 
5
5
  const InputContainer = styled('div', {
6
6
  backgroundColor: '$background',
7
+ padding: '1px',
7
8
  boxSizing: 'border-box',
8
9
  border: '1px solid $neutrals400',
9
10
  borderRadius: '$5',
@@ -40,6 +40,7 @@ export function TokenItem(props: PropTypes) {
40
40
  ...style,
41
41
  height: '48px',
42
42
  top: `${parseFloat(style?.top as string) + 0}px`,
43
+ padding: '0 4px',
43
44
  }}
44
45
  >
45
46
  <Button
@@ -62,7 +63,9 @@ export function TokenItem(props: PropTypes) {
62
63
  >
63
64
  <TokenNameContainer>
64
65
  <Typography variant="body1">{token.symbol}</Typography>
65
- <Typography variant="body2">{token.name}</Typography>
66
+ <Typography variant="caption" color="neutrals600">
67
+ {token.name}
68
+ </Typography>
66
69
  </TokenNameContainer>
67
70
  </Button>
68
71
  </div>
@@ -1,6 +1,6 @@
1
1
  import React, { forwardRef, useEffect, useState } from 'react';
2
2
  import { CommonProps } from 'react-window';
3
- import { Token } from 'rango-sdk';
3
+ import { Asset, Token } from 'rango-sdk';
4
4
  import { VirtualizedList } from '../VirtualizedList/VirtualizedList';
5
5
  import { TokenItem } from './TokenItem';
6
6
 
@@ -18,7 +18,7 @@ export interface PropTypes {
18
18
  searchedText: string;
19
19
  onChange: (token: TokenWithAmount) => void;
20
20
  multiSelect?: boolean;
21
- selectedList?: TokenWithAmount[] | 'all';
21
+ selectedList?: Asset[];
22
22
  }
23
23
 
24
24
  export function TokenList(props: PropTypes) {
@@ -33,7 +33,6 @@ export function TokenList(props: PropTypes) {
33
33
  const isSelected = (token: Token) => {
34
34
  if (multiSelect && selectedList) {
35
35
  return (
36
- selectedList === 'all' ||
37
36
  selectedList
38
37
  .map((item) => item.symbol + item.address)
39
38
  .indexOf(token.symbol + token.address) > -1
@@ -53,7 +52,7 @@ export function TokenList(props: PropTypes) {
53
52
 
54
53
  useEffect(() => {
55
54
  setTokens(list.slice(0, PAGE_SIZE));
56
- }, [searchedText]);
55
+ }, [searchedText, list]);
57
56
 
58
57
  useEffect(() => {
59
58
  setHasNextPage(list.length > tokens.length);
@@ -76,22 +75,20 @@ export function TokenList(props: PropTypes) {
76
75
  );
77
76
 
78
77
  return (
79
- <div style={{ height: '450px' }}>
80
- <VirtualizedList
81
- Item={({ index, style }) => (
82
- <TokenItem
83
- token={tokens[index]}
84
- style={style}
85
- onClick={changeSelected}
86
- selected={isSelected(tokens[index])}
87
- />
88
- )}
89
- hasNextPage={hasNextPage}
90
- itemCount={tokens.length}
91
- loadNextPage={loadNextPage}
92
- innerElementType={innerElementType}
93
- size={56}
94
- />
95
- </div>
78
+ <VirtualizedList
79
+ Item={({ index, style }) => (
80
+ <TokenItem
81
+ token={tokens[index]}
82
+ style={style}
83
+ onClick={changeSelected}
84
+ selected={isSelected(tokens[index])}
85
+ />
86
+ )}
87
+ hasNextPage={hasNextPage}
88
+ itemCount={tokens.length}
89
+ loadNextPage={loadNextPage}
90
+ innerElementType={innerElementType}
91
+ size={56}
92
+ />
96
93
  );
97
94
  }
@@ -3,16 +3,27 @@ import { containsText } from '../../helper';
3
3
  import { SecondaryPage } from '../SecondaryPage/SecondaryPage';
4
4
  import { TokenList } from '../TokenList';
5
5
  import { TokenWithAmount } from '../TokenList/TokenList';
6
+ import { LoadingStatus } from '../../types/meta';
7
+ import { Spinner } from '../Spinner';
8
+ import { LoadingFailedAlert } from '../Alert/LoadingFailedAlert';
9
+ import { NotFoundAlert } from '../Alert/NotFoundAlert';
10
+ import { styled } from '../../theme';
6
11
 
12
+ export const LoaderContainer = styled('div', {
13
+ display: 'flex',
14
+ justifyContent: 'center',
15
+ width: '100%',
16
+ paddingTop: '5%',
17
+ flex: 1,
18
+ });
7
19
  export interface PropTypes {
8
20
  list: TokenWithAmount[];
9
21
  type?: 'Source' | 'Destination';
10
22
  selected: TokenWithAmount | null;
11
23
  onChange: (token: TokenWithAmount) => void;
12
- hasHeader?: boolean;
13
- multiSelect?: boolean;
14
24
  onBack?: () => void;
15
- selectedList?: TokenWithAmount[] | 'all';
25
+ loadingStatus: LoadingStatus;
26
+ hasHeader?: boolean;
16
27
  }
17
28
 
18
29
  const filterTokens = (list: TokenWithAmount[], searchedFor: string) =>
@@ -24,35 +35,37 @@ const filterTokens = (list: TokenWithAmount[], searchedFor: string) =>
24
35
  );
25
36
 
26
37
  export function TokenSelector(props: PropTypes) {
27
- const {
28
- list,
29
- type,
30
- selected,
31
- onChange,
32
- hasHeader,
33
- multiSelect,
34
- selectedList,
35
- onBack,
36
- } = props;
38
+ const { list, type, selected, hasHeader, onChange, onBack, loadingStatus } =
39
+ props;
37
40
 
38
41
  return (
39
42
  <SecondaryPage
40
43
  textField={true}
41
- textFieldPlaceholder="Search Blockchain By Name"
42
- title={`Select ${type} Token`}
43
44
  hasHeader={hasHeader}
45
+ title={`Select ${type} Token`}
44
46
  onBack={onBack}
47
+ textFieldPlaceholder="Search Token By Name"
45
48
  >
46
- {(searchedFor) => (
47
- <TokenList
48
- searchedText={searchedFor}
49
- list={filterTokens(list, searchedFor)}
50
- selected={selected}
51
- selectedList={selectedList}
52
- multiSelect={multiSelect}
53
- onChange={onChange}
54
- />
55
- )}
49
+ {(searchedFor) => {
50
+ const filteredTokens = filterTokens(list, searchedFor);
51
+
52
+ return loadingStatus === 'loading' ? (
53
+ <LoaderContainer>
54
+ <Spinner size={24} />
55
+ </LoaderContainer>
56
+ ) : loadingStatus === 'failed' ? (
57
+ <LoadingFailedAlert />
58
+ ) : filteredTokens.length ? (
59
+ <TokenList
60
+ searchedText={searchedFor}
61
+ list={filteredTokens}
62
+ selected={selected}
63
+ onChange={onChange}
64
+ />
65
+ ) : (
66
+ <NotFoundAlert catergory="Token" searchedFor={searchedFor} />
67
+ );
68
+ }}
56
69
  </SecondaryPage>
57
70
  );
58
71
  }
@@ -42,7 +42,7 @@ export function Wallet(props: PropTypes) {
42
42
  return (
43
43
  <ExtendedButton
44
44
  type={state === WalletState.CONNECTED ? 'primary' : undefined}
45
- disabled={!state}
45
+ disabled={state == WalletState.CONNECTING}
46
46
  onClick={() => {
47
47
  if (state === WalletState.NOT_INSTALLED) {
48
48
  window.open(detectInstallLink(installLink), '_blank');
@@ -27,3 +27,5 @@ export * from './Radio';
27
27
  export * from './TokenList';
28
28
  export * from './common';
29
29
  export * from './Drawer';
30
+ export * from './Header';
31
+ export * from './Divider';
@@ -1,13 +1,22 @@
1
1
  import React from 'react';
2
2
  import { ComponentMeta } from '@storybook/react';
3
3
  import { ConfirmSwap, PropTypes } from './ConfirmSwap';
4
- import { bestRoute } from './mock';
4
+ import { exampleFor5Wallets, wallets } from './mock';
5
5
 
6
6
  export default {
7
7
  title: 'Containers/ConfirmSwap',
8
8
  component: ConfirmSwap,
9
+ argTypes: {
10
+ requiredWallets: {
11
+ defaultValue: ['BSC', 'OSMOSIS'],
12
+ },
13
+ },
9
14
  } as ComponentMeta<typeof ConfirmSwap>;
10
15
 
11
16
  export const Main = (props: PropTypes) => (
12
- <ConfirmSwap {...props} bestRoute={bestRoute} />
17
+ <ConfirmSwap {...props} selectableWallets={wallets} />
18
+ );
19
+
20
+ export const With5Wallets = (props: PropTypes) => (
21
+ <ConfirmSwap {...props} selectableWallets={exampleFor5Wallets} />
13
22
  );
@@ -1,125 +1,110 @@
1
- import React, { Fragment, PropsWithChildren, ReactNode } from 'react';
2
- import { Spacer } from '../../components';
3
- import { Alert } from '../../components/Alert';
1
+ import React, { PropsWithChildren, ReactNode } from 'react';
2
+ import { Alert, Spacer } from '../../components';
4
3
  import { Button } from '../../components/Button';
5
- import { RetryIcon, GasIcon } from '../../components/Icon';
6
- import { SecondaryPage } from '../../components/SecondaryPage/';
7
- import { StepDetail } from '../../components/StepDetail';
4
+ import { SecondaryPage } from '../../components/SecondaryPage/SecondaryPage';
5
+ import { SelectableWalletList } from '../../components/SelectableWalletList';
8
6
  import { Typography } from '../../components/Typography';
9
7
  import { styled } from '../../theme';
10
- import { BestRouteWithFee } from '../../types/swaps';
8
+ import { SelectableWallet } from '../../types';
11
9
 
12
10
  const MainContainer = styled('div', {
13
- overflow: 'hidden',
11
+ overflowY: 'auto',
14
12
  });
15
13
 
16
- export const Line = styled('div', {
17
- width: '0',
18
- marginLeft: '$12',
19
- height: '36px',
20
- border: '1px dashed $foreground',
21
- borderRadius: 'inherit',
22
- });
23
- export const SwapperContainer = styled('div', {
24
- display: 'flex',
25
- alignItems: 'center',
26
- marginLeft: '6px',
27
- });
28
- export const BodyError = styled('div', {
29
- height: '100%',
30
- display: 'flex',
31
- justifyContent: 'center',
32
- alignItems: 'center',
33
- });
34
- export const ErrorMsg = styled(Typography, {
35
- color: '$error',
36
- });
37
- export const Fee = styled('div', {
38
- display: 'flex',
39
- alignItems: 'center',
40
- });
41
- export const SwapperLogo = styled('img', {
42
- width: '$16',
43
- height: '$16',
44
- });
45
- export const RelativeContainer = styled('div', {
46
- position: 'relative',
14
+ const Section = styled('div', {
15
+ paddingBottom: '$32',
16
+ marginBottom: '$32',
17
+ borderBottom: '1px solid $neutrals400',
47
18
  });
48
19
 
49
- export const Footer = styled('div', {
20
+ const Footer = styled('div', {
50
21
  display: 'flex',
51
22
  alignItems: 'center',
52
23
  });
53
- export const Dot = styled('div', {
54
- width: '$8',
55
- height: '$8',
56
- backgroundColor: '$foreground',
57
- borderRadius: '4px',
58
- marginLeft: '$8',
59
- });
60
- export const ArrowDown = styled('div', {
61
- width: '0px',
62
- height: '0px',
63
- borderLeft: '5px solid transparent',
64
- borderRight: '5px solid transparent',
65
- borderTop: '5px solid $foreground',
66
- marginLeft: '$8',
67
- });
68
- export const UpdateIcon = styled(RetryIcon, {
69
- position: 'absolute',
70
- right: '0',
24
+
25
+ const AlertContainer = styled('div', {
26
+ padding: '$16 0',
71
27
  });
72
- export const StyledUpdateIcon = styled(UpdateIcon, {
73
- cursor: 'pointer',
28
+
29
+ const ConfirmButton = styled(Button, {
30
+ marginTop: '$16',
74
31
  });
75
32
 
76
- const BestRouteContainer = styled('div', {
77
- overflow: 'auto',
33
+ const Container = styled('div', {
34
+ paddingBottom: '$24',
35
+
36
+ '.title': {
37
+ paddingBottom: '$8',
38
+ display: 'flex',
39
+ alignItems: 'center',
40
+ },
41
+ '.num': {
42
+ backgroundColor: '$neutrals300',
43
+ display: 'inline-flex',
44
+ width: '24px',
45
+ height: '24px',
46
+ color: '$neutrals800',
47
+ borderRadius: '50%',
48
+ fontSize: '$14',
49
+ border: '1px solid $neutrals400',
50
+ justifyContent: 'center',
51
+ alignItems: 'center',
52
+ },
78
53
  });
79
54
 
80
55
  const Alerts = styled('div', { paddingBottom: '$16' });
56
+
81
57
  export interface PropTypes {
82
- bestRoute: BestRouteWithFee | null;
83
- onRefresh?: React.MouseEventHandler<SVGElement>;
84
- confirmButtonTitle: string;
85
- confirmButtonDisabled: boolean;
86
58
  onBack: () => void;
87
59
  onConfirm?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
60
+ confirmDisabled?: boolean;
88
61
  loading?: boolean;
62
+ requiredWallets: string[];
63
+ selectableWallets: SelectableWallet[];
64
+ onChange: (w: SelectableWallet) => void;
65
+ isExperimentalChain?: (wallet: string) => boolean;
66
+ handleConnectChain?: (wallet: string) => void;
67
+ previewInputs?: ReactNode;
68
+ previewRoutes?: ReactNode;
69
+ confirmButtonTitle: string;
89
70
  errors?: ReactNode[];
90
71
  warnings?: ReactNode[];
91
72
  extraMessages?: ReactNode;
92
73
  }
93
74
  export function ConfirmSwap(props: PropsWithChildren<PropTypes>) {
94
75
  const {
95
- bestRoute,
96
76
  onBack,
97
- onConfirm,
98
77
  loading,
78
+ onConfirm,
79
+ requiredWallets,
80
+ selectableWallets,
81
+ onChange,
82
+ confirmDisabled,
83
+ isExperimentalChain,
84
+ handleConnectChain,
85
+ confirmButtonTitle,
99
86
  errors,
100
87
  warnings,
101
88
  extraMessages,
102
- confirmButtonTitle,
103
- confirmButtonDisabled,
104
89
  } = props;
105
90
 
106
91
  return (
107
92
  <SecondaryPage
108
93
  textField={false}
109
- title="Swap"
94
+ title="Confirm Swap"
110
95
  onBack={onBack}
111
96
  Footer={
112
97
  <Footer>
113
- <Button
114
- type="primary"
98
+ <ConfirmButton
115
99
  fullWidth
116
100
  loading={loading}
101
+ type="primary"
117
102
  variant="contained"
118
103
  onClick={onConfirm}
119
- disabled={confirmButtonDisabled}
104
+ disabled={confirmDisabled}
120
105
  >
121
106
  {confirmButtonTitle}
122
- </Button>
107
+ </ConfirmButton>
123
108
  </Footer>
124
109
  }
125
110
  >
@@ -145,49 +130,50 @@ export function ConfirmSwap(props: PropsWithChildren<PropTypes>) {
145
130
  ))}
146
131
  </Alerts>
147
132
  </div>
148
- <BestRouteContainer>
149
- {bestRoute?.result?.swaps.map((swap, index) => (
150
- <Fragment key={index}>
151
- {index === 0 && (
152
- <RelativeContainer>
153
- <StepDetail
154
- logo={swap.from.logo}
155
- symbol={swap.from.symbol}
156
- chainLogo={swap.from.blockchainLogo}
157
- blockchain={swap.from.blockchain}
158
- amount={swap.fromAmount}
159
- />
160
- <Dot />
161
- </RelativeContainer>
133
+ {props.previewInputs || props.previewRoutes ? (
134
+ <Section>
135
+ {props.previewInputs}
136
+ {!!props.previewRoutes ? (
137
+ <Spacer size={16} direction="vertical" />
138
+ ) : null}
139
+ {props.previewRoutes}
140
+ </Section>
141
+ ) : null}
142
+
143
+ {requiredWallets.map((wallet, index) => {
144
+ const list = selectableWallets.filter((w) => wallet === w.chain);
145
+ return (
146
+ <Container key={index}>
147
+ <div className="title">
148
+ <div className="num">{index + 1}</div>
149
+ <Spacer size={8} />
150
+ <Typography variant="body2">Your {wallet} Wallet</Typography>
151
+ </div>
152
+ {list.length === 0 && (
153
+ <>
154
+ <AlertContainer>
155
+ <Alert type="error">
156
+ You need to connect a compatible wallet with {wallet}
157
+ </Alert>
158
+ </AlertContainer>
159
+ {isExperimentalChain?.(wallet) && (
160
+ <Button
161
+ variant="contained"
162
+ type="primary"
163
+ align="grow"
164
+ onClick={() => handleConnectChain?.(wallet)}
165
+ >
166
+ {`Add ${wallet} chain to Cosmos wallets`}
167
+ </Button>
168
+ )}
169
+ </>
170
+ )}
171
+ {list.length != 0 && (
172
+ <SelectableWalletList list={list} onChange={onChange} />
162
173
  )}
163
- <Line />
164
- <SwapperContainer>
165
- <SwapperLogo src={swap.swapperLogo} alt={swap.swapperId} />
166
- <div>
167
- <Typography ml={4} variant="caption">
168
- {swap.swapperType} from {swap.from.symbol} to{' '}
169
- {swap.to.symbol} via {swap.swapperId}{' '}
170
- </Typography>
171
- <Fee>
172
- <GasIcon />
173
- <Typography ml={4} variant="caption">
174
- ${swap.feeInUsd} estimated gas fee
175
- </Typography>
176
- </Fee>
177
- </div>
178
- </SwapperContainer>
179
- <Line />
180
- {index + 1 === bestRoute.result?.swaps.length && <ArrowDown />}
181
- <StepDetail
182
- logo={swap.to.logo}
183
- symbol={swap.to.symbol}
184
- chainLogo={swap.to.blockchainLogo}
185
- blockchain={swap.to.blockchain}
186
- amount={swap.toAmount}
187
- />
188
- </Fragment>
189
- ))}
190
- </BestRouteContainer>
174
+ </Container>
175
+ );
176
+ })}
191
177
  </MainContainer>
192
178
  </SecondaryPage>
193
179
  );
@@ -1,5 +1,8 @@
1
+ // @ts-nocheck
2
+ import { WalletType } from '@rango-dev/wallets-shared';
1
3
  import { RoutingResultType } from 'rango-sdk';
2
4
  import { BestRouteType } from '../../types/swaps';
5
+ import { SelectableWallet } from '../../types';
3
6
 
4
7
  export const bestRoute: BestRouteType = {
5
8
  from: { blockchain: 'BSC', symbol: 'BNB', address: null },
@@ -14,10 +17,12 @@ export const bestRoute: BestRouteType = {
14
17
  swapperId: 'AnySwap Aggregator',
15
18
  swapperType: 'AGGREGATOR',
16
19
  swapperLogo: 'https://api.rango.exchange/swappers/multichain.png',
20
+
17
21
  from: {
18
22
  symbol: 'BNB',
19
23
  logo: 'https://api.rango.exchange/i/Y3v1KW',
20
24
  blockchainLogo: 'https://api.rango.exchange/blockchains/binance.svg',
25
+
21
26
  address: null,
22
27
  blockchain: 'BSC',
23
28
  decimals: 18,
@@ -28,6 +33,7 @@ export const bestRoute: BestRouteType = {
28
33
  logo: 'https://api.rango.exchange/i/j9xgdC',
29
34
  blockchainLogo:
30
35
  'https://api.rango.exchange/blockchains/avax_cchain.svg',
36
+
31
37
  address: '0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab',
32
38
  blockchain: 'AVAX_CCHAIN',
33
39
  decimals: 18,
@@ -93,8 +99,8 @@ export const bestRoute: BestRouteType = {
93
99
  symbol: 'WETH.E',
94
100
  address: '0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab',
95
101
  },
96
- expenseType: 'DECREASE_FROM_OUTPUT',
97
102
  name: 'Network Fee',
103
+ expenseType: 'DECREASE_FROM_OUTPUT',
98
104
  amount:
99
105
  '0.00018619291780292721387591870688029381530892436558133340440690517425537109375',
100
106
  },
@@ -141,6 +147,77 @@ export const bestRoute: BestRouteType = {
141
147
  validationStatus: null,
142
148
  missingBlockchains: [],
143
149
  diagnosisMessages: [],
144
- processingLimitReached: false,
145
150
  walletNotSupportingFromBlockchain: false,
151
+ processingLimitReached: false,
146
152
  };
153
+
154
+ export const wallets: SelectableWallet[] = [
155
+ {
156
+ walletType: WalletType.META_MASK,
157
+ address: '0x5423e28219d6d568dcf62a8134d623e6f4a1c2df',
158
+ image: 'https://app.rango.exchange/wallets/metamask.svg',
159
+ chain: 'BSC',
160
+ selected: false,
161
+ },
162
+ {
163
+ walletType: WalletType.OKX,
164
+ address: '0x2702d89c1c8658b49c45dd460deebcc45faec03c',
165
+ image: 'https://app.rango.exchange/wallets/okx.png',
166
+ chain: 'BSC',
167
+ selected: false,
168
+ },
169
+
170
+ {
171
+ walletType: WalletType.KEPLR,
172
+ address: 'osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl',
173
+ image: 'https://app.rango.exchange/wallets/keplr.png',
174
+ chain: 'OSMOSIS',
175
+ selected: false,
176
+ },
177
+ ];
178
+
179
+ export const exampleFor5Wallets: SelectableWallet[] = [
180
+ {
181
+ walletType: WalletType.META_MASK,
182
+ address: '0x5423e28219d6d568dcf62a8134d623e6f4a1c2df',
183
+ image: 'https://app.rango.exchange/wallets/metamask.svg',
184
+ selected: false,
185
+ chain: 'BSC',
186
+ },
187
+ {
188
+ walletType: WalletType.OKX,
189
+ address: '0x2702d89c1c8658b49c45dd460deebcc45faec03c',
190
+ image: 'https://app.rango.exchange/wallets/okx.png',
191
+ selected: false,
192
+ chain: 'BSC',
193
+ },
194
+ {
195
+ walletType: WalletType.EXODUS,
196
+ address: '0x2702d89c1c8658b49c45dd460deebcc45faec03c',
197
+ image: 'https://app.rango.exchange/wallets/exodus.png',
198
+ selected: false,
199
+ chain: 'BSC',
200
+ },
201
+ {
202
+ walletType: WalletType.MATH,
203
+ address: '0x2702d89c1c8658b49c45dd460deebcc45faec03c',
204
+ image: 'https://app.rango.exchange/wallets/math-wallet.png',
205
+ selected: false,
206
+ chain: 'BSC',
207
+ },
208
+ {
209
+ walletType: WalletType.CLOVER,
210
+ address: '0x2702d89c1c8658b49c45dd460deebcc45faec03c',
211
+ image: 'https://app.rango.exchange/wallets/clover.jpeg',
212
+ selected: false,
213
+ chain: 'BSC',
214
+ },
215
+
216
+ {
217
+ walletType: WalletType.KEPLR,
218
+ address: 'osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl',
219
+ image: 'https://app.rango.exchange/wallets/keplr.png',
220
+ selected: false,
221
+ chain: 'OSMOSIS',
222
+ },
223
+ ];