@rango-dev/ui 0.1.10-next.91 → 0.1.10

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 (116) hide show
  1. package/README.md +1 -181
  2. package/dist/components/Alert/Alert.d.ts +3 -2
  3. package/dist/components/Alert/LoadingFailedAlert.d.ts +2 -0
  4. package/dist/components/Alert/NotFoundAlert.d.ts +7 -0
  5. package/dist/components/Alert/index.d.ts +1 -0
  6. package/dist/components/BlockchainSelector/BlockchainSelector.d.ts +1 -1
  7. package/dist/components/Button/Button.d.ts +3 -3
  8. package/dist/components/Divider/Divider.d.ts +6 -0
  9. package/dist/components/Divider/index.d.ts +1 -0
  10. package/dist/components/Header/Header.d.ts +9 -0
  11. package/dist/components/Header/index.d.ts +1 -0
  12. package/dist/components/Icon/ArrowRightIcon.d.ts +3 -0
  13. package/dist/components/Icon/ChevronRightIcon.d.ts +3 -0
  14. package/dist/components/Icon/DisconnectIcon.d.ts +3 -0
  15. package/dist/components/Icon/index.d.ts +3 -0
  16. package/dist/components/Icon/types.d.ts +1 -1
  17. package/dist/components/LiquiditySourceList/LiquiditySourceList.d.ts +3 -1
  18. package/dist/components/LiquiditySourcesSelector/LiquiditySourcesSelector.d.ts +2 -1
  19. package/dist/components/SelectableWalletList/mock.d.ts +1 -1
  20. package/dist/components/Settings/Settings.d.ts +2 -1
  21. package/dist/components/Spacer/Spacer.d.ts +1 -1
  22. package/dist/components/SwapContainer/SwapContainer.d.ts +1 -0
  23. package/dist/components/SwapDetail/Token.d.ts +16 -0
  24. package/dist/components/TextField/TextField.stories.d.ts +1 -1
  25. package/dist/components/TokenSelector/TokenSelector.d.ts +3 -0
  26. package/dist/components/Typography/Typography.d.ts +3 -2
  27. package/dist/components/index.d.ts +2 -0
  28. package/dist/containers/ConfirmSwap/ConfirmSwap.d.ts +10 -17
  29. package/dist/containers/ConfirmSwap/ConfirmSwap.stories.d.ts +1 -0
  30. package/dist/containers/ConfirmSwap/mock.d.ts +3 -0
  31. package/dist/containers/History/History.d.ts +6 -1
  32. package/dist/containers/History/index.d.ts +1 -1
  33. package/dist/containers/History/types.d.ts +3 -24
  34. package/dist/containers/SwapHistory/SwapHistory.d.ts +16 -3
  35. package/dist/containers/SwapHistory/SwapMessages.d.ts +17 -0
  36. package/dist/containers/index.d.ts +0 -1
  37. package/dist/helper/index.d.ts +1 -0
  38. package/dist/types/meta.d.ts +1 -0
  39. package/dist/ui.cjs.development.js +1455 -1033
  40. package/dist/ui.cjs.development.js.map +1 -1
  41. package/dist/ui.cjs.production.min.js +1 -1
  42. package/dist/ui.cjs.production.min.js.map +1 -1
  43. package/dist/ui.esm.js +1463 -1046
  44. package/dist/ui.esm.js.map +1 -1
  45. package/package.json +3 -2
  46. package/src/components/Alert/Alert.tsx +63 -39
  47. package/src/components/Alert/LoadingFailedAlert.tsx +11 -0
  48. package/src/components/Alert/NotFoundAlert.tsx +19 -0
  49. package/src/components/Alert/index.ts +1 -0
  50. package/src/components/BestRoute/BestRoute.tsx +28 -19
  51. package/src/components/BestRoute/mock.ts +10 -0
  52. package/src/components/BlockchainSelector/BlockchainSelector.tsx +13 -21
  53. package/src/components/Button/Button.stories.tsx +1 -1
  54. package/src/components/Button/Button.tsx +36 -23
  55. package/src/components/Chip/Chip.tsx +7 -4
  56. package/src/components/ConnectWalletsModal/mockData.ts +16 -0
  57. package/src/components/Divider/Divider.tsx +41 -0
  58. package/src/components/Divider/index.ts +1 -0
  59. package/src/components/Header/Header.tsx +39 -0
  60. package/src/components/Header/index.ts +1 -0
  61. package/src/components/Icon/ArrowRightIcon.tsx +31 -0
  62. package/src/components/Icon/ChevronRightIcon.tsx +29 -0
  63. package/src/components/Icon/DisconnectIcon.tsx +31 -0
  64. package/src/components/Icon/HistoryIcon.tsx +12 -18
  65. package/src/components/Icon/RetryIcon.tsx +13 -13
  66. package/src/components/Icon/SettingIcon.tsx +6 -14
  67. package/src/components/Icon/index.ts +3 -0
  68. package/src/components/Icon/types.tsx +1 -1
  69. package/src/components/LiquiditySourceList/LiquiditySourceList.tsx +104 -30
  70. package/src/components/LiquiditySourcesSelector/LiquiditySourcesSelector.tsx +16 -11
  71. package/src/components/Radio/Radio.tsx +5 -4
  72. package/src/components/SecondaryPage/SecondaryPage.tsx +26 -52
  73. package/src/components/SelectableWalletList/SelectableWalletList.tsx +5 -1
  74. package/src/components/SelectableWalletList/mock.ts +4 -3
  75. package/src/components/Settings/Settings.tsx +47 -12
  76. package/src/components/Spacer/Spacer.tsx +31 -1
  77. package/src/components/StatusDrawer/StatusDrawer.tsx +1 -0
  78. package/src/components/StepDetail/StepDetail.tsx +19 -7
  79. package/src/components/SwapContainer/SwapContainer.tsx +22 -17
  80. package/src/components/SwapDetail/SwapDetail.tsx +77 -115
  81. package/src/components/SwapDetail/Token.tsx +68 -0
  82. package/src/components/SwapDetail/mock.ts +1 -0
  83. package/src/components/Switch/Switch.tsx +7 -5
  84. package/src/components/TextField/TextField.tsx +3 -1
  85. package/src/components/TokenList/TokenItem.tsx +4 -1
  86. package/src/components/TokenList/TokenList.tsx +16 -18
  87. package/src/components/TokenSelector/TokenSelector.tsx +47 -10
  88. package/src/components/Typography/Typography.stories.tsx +4 -0
  89. package/src/components/Typography/Typography.tsx +20 -9
  90. package/src/components/Wallet/State.tsx +2 -3
  91. package/src/components/Wallet/Wallet.tsx +33 -6
  92. package/src/components/index.ts +2 -0
  93. package/src/containers/ConfirmSwap/ConfirmSwap.stories.tsx +11 -2
  94. package/src/containers/ConfirmSwap/ConfirmSwap.tsx +103 -119
  95. package/src/containers/ConfirmSwap/mock.ts +79 -2
  96. package/src/containers/History/History.tsx +57 -38
  97. package/src/containers/History/index.ts +1 -1
  98. package/src/containers/History/mock.ts +1 -0
  99. package/src/containers/History/types.tsx +2 -30
  100. package/src/containers/SwapHistory/SwapHistory.tsx +309 -165
  101. package/src/containers/SwapHistory/SwapMessages.tsx +116 -0
  102. package/src/containers/SwapHistory/mock.ts +1 -0
  103. package/src/containers/index.ts +0 -1
  104. package/src/helper/index.ts +14 -0
  105. package/src/theme.ts +4 -2
  106. package/src/types/meta.ts +2 -0
  107. package/dist/containers/ConfirmWallets/ConfirmWallets.d.ts +0 -18
  108. package/dist/containers/ConfirmWallets/ConfirmWallets.stories.d.ts +0 -6
  109. package/dist/containers/ConfirmWallets/index.d.ts +0 -1
  110. package/dist/containers/ConfirmWallets/mock.d.ts +0 -5
  111. package/dist/helper/swaps.d.ts +0 -5
  112. package/src/containers/ConfirmWallets/ConfirmWallets.stories.tsx +0 -26
  113. package/src/containers/ConfirmWallets/ConfirmWallets.tsx +0 -118
  114. package/src/containers/ConfirmWallets/index.ts +0 -1
  115. package/src/containers/ConfirmWallets/mock.ts +0 -222
  116. package/src/helper/swaps.ts +0 -23
package/src/theme.ts CHANGED
@@ -44,6 +44,8 @@ const theme = {
44
44
  error300: '#FF3333',
45
45
  error500: '#FF0000',
46
46
  error700: '#E60000',
47
+ // Only use this color when you are going to use white for both dark and light theme.
48
+ white: '#fff',
47
49
  },
48
50
  space: {
49
51
  2: '2px',
@@ -98,8 +100,8 @@ const theme = {
98
100
  borderWidths: {},
99
101
  borderStyles: {},
100
102
  radii: {
101
- 5: '5px',
102
- 10: '10px',
103
+ 5: '8px',
104
+ 10: '12px',
103
105
  },
104
106
  shadows: {
105
107
  s: '0px 3px 5px 3px #f0f2f5, 0px 6px 10px 3px #f0f2f5, 0px 1px 18px 3px #f0f2f5',
package/src/types/meta.ts CHANGED
@@ -18,3 +18,5 @@ export interface LiquiditySource {
18
18
  type: 'BRIDGE' | 'AGGREGATOR' | 'DEX';
19
19
  selected: boolean;
20
20
  }
21
+
22
+ export type LoadingStatus = 'loading' | 'success' | 'failed';
@@ -1,18 +0,0 @@
1
- import { BestRouteResponse } from 'rango-sdk';
2
- import React, { PropsWithChildren } from 'react';
3
- import { SelectableWallet } from '../../types';
4
- export interface PropTypes {
5
- swap: BestRouteResponse | null;
6
- fromAmount: string;
7
- toAmount: string;
8
- onBack: () => void;
9
- onConfirm?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
10
- confirmDisabled?: boolean;
11
- loading?: boolean;
12
- requiredWallets: string[];
13
- selectableWallets: SelectableWallet[];
14
- onChange: (w: SelectableWallet) => void;
15
- isExperimentalChain?: (wallet: string) => boolean;
16
- handleConnectChain?: (wallet: string) => void;
17
- }
18
- export declare function ConfirmWallets(props: PropsWithChildren<PropTypes>): JSX.Element;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import { PropTypes } from './ConfirmWallets';
3
- declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, React.PropsWithChildren<PropTypes>>;
4
- export default _default;
5
- export declare const Main: (props: PropTypes) => JSX.Element;
6
- export declare const With5Wallets: (props: PropTypes) => JSX.Element;
@@ -1 +0,0 @@
1
- export { ConfirmWallets } from './ConfirmWallets';
@@ -1,5 +0,0 @@
1
- import { BestRouteType } from '../../types/swaps';
2
- import { SelectableWallet } from './types';
3
- export declare const bestRoute: BestRouteType;
4
- export declare const wallets: SelectableWallet[];
5
- export declare const exampleFor5Wallets: SelectableWallet[];
@@ -1,5 +0,0 @@
1
- import { PendingSwap } from '../containers/History/types';
2
- export declare function groupingOfSwaps(list: PendingSwap[]): {
3
- title: string;
4
- swaps: PendingSwap[];
5
- }[];
@@ -1,26 +0,0 @@
1
- import React from 'react';
2
- import { ComponentMeta } from '@storybook/react';
3
- import { ConfirmWallets, PropTypes } from './ConfirmWallets';
4
- import { bestRoute, exampleFor5Wallets, wallets } from './mock';
5
-
6
- export default {
7
- title: 'Containers/ConfirmWallets',
8
- component: ConfirmWallets,
9
- argTypes: {
10
- requiredWallets: {
11
- defaultValue: ['BSC', 'OSMOSIS'],
12
- },
13
- },
14
- } as ComponentMeta<typeof ConfirmWallets>;
15
-
16
- export const Main = (props: PropTypes) => (
17
- <ConfirmWallets {...props} swap={bestRoute} selectableWallets={wallets} />
18
- );
19
-
20
- export const With5Wallets = (props: PropTypes) => (
21
- <ConfirmWallets
22
- {...props}
23
- swap={bestRoute}
24
- selectableWallets={exampleFor5Wallets}
25
- />
26
- );
@@ -1,118 +0,0 @@
1
- import { BestRouteResponse } from 'rango-sdk';
2
- import React, { PropsWithChildren } from 'react';
3
- import { Alert } from '../../components';
4
- import { Button } from '../../components/Button';
5
- import { SecondaryPage } from '../../components/SecondaryPage/SecondaryPage';
6
- import { SelectableWalletList } from '../../components/SelectableWalletList';
7
- import { Typography } from '../../components/Typography';
8
- import { styled } from '../../theme';
9
- import { SelectableWallet } from '../../types';
10
-
11
- const Footer = styled('div', {
12
- display: 'flex',
13
- alignItems: 'center',
14
- });
15
-
16
- const AlertContainer = styled('div', {
17
- padding: '$16 0',
18
- });
19
-
20
- const ConfirmButton = styled(Button, {
21
- marginTop: '$16',
22
- });
23
-
24
- export interface PropTypes {
25
- swap: BestRouteResponse | null;
26
- fromAmount: string;
27
- toAmount: string;
28
- onBack: () => void;
29
- onConfirm?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
30
- confirmDisabled?: boolean;
31
- loading?: boolean;
32
- requiredWallets: string[];
33
- selectableWallets: SelectableWallet[];
34
- onChange: (w: SelectableWallet) => void;
35
- isExperimentalChain?: (wallet: string) => boolean;
36
- handleConnectChain?: (wallet: string) => void;
37
- }
38
- export function ConfirmWallets(props: PropsWithChildren<PropTypes>) {
39
- const {
40
- onBack,
41
- loading,
42
- onConfirm,
43
- swap,
44
- requiredWallets,
45
- selectableWallets,
46
- onChange,
47
- confirmDisabled,
48
- isExperimentalChain,
49
- handleConnectChain,
50
- fromAmount,
51
- toAmount,
52
- } = props;
53
-
54
- const firstStep = swap?.result?.swaps[0];
55
- const lastStep = swap?.result?.swaps[swap.result?.swaps.length - 1];
56
-
57
- return (
58
- <SecondaryPage
59
- textField={false}
60
- title="Confirm Swap"
61
- onBack={onBack}
62
- Footer={
63
- <Footer>
64
- <ConfirmButton
65
- fullWidth
66
- loading={loading}
67
- type="primary"
68
- variant="contained"
69
- onClick={onConfirm}
70
- disabled={confirmDisabled}
71
- >
72
- Confirm
73
- </ConfirmButton>
74
- </Footer>
75
- }
76
- >
77
- <>
78
- <Typography variant="h6" mb={12}>
79
- Confirm swap {fromAmount} {firstStep?.from.symbol} (
80
- {firstStep?.from.blockchain}) to {toAmount} {lastStep?.to.symbol} (on
81
- {lastStep?.to.blockchain})
82
- </Typography>
83
- {requiredWallets.map((wallet, index) => {
84
- const list = selectableWallets.filter((w) => wallet === w.chain);
85
- return (
86
- <div key={index}>
87
- <Typography variant="body2" mb={12} mt={12}>
88
- {index + 1}) Your {wallet} Wallet
89
- </Typography>
90
- {list.length === 0 && (
91
- <>
92
- <AlertContainer>
93
- <Alert type="error">
94
- <Typography variant="body2">{`You should connect a ${wallet} supported wallet`}</Typography>
95
- </Alert>
96
- </AlertContainer>
97
- {isExperimentalChain?.(wallet) && (
98
- <Button
99
- variant="contained"
100
- type="primary"
101
- align="grow"
102
- onClick={() => handleConnectChain?.(wallet)}
103
- >
104
- {`Add ${wallet} chain to Cosmos wallets`}
105
- </Button>
106
- )}
107
- </>
108
- )}
109
- {list.length != 0 && (
110
- <SelectableWalletList list={list} onChange={onChange} />
111
- )}
112
- </div>
113
- );
114
- })}
115
- </>
116
- </SecondaryPage>
117
- );
118
- }
@@ -1 +0,0 @@
1
- export { ConfirmWallets } from './ConfirmWallets';
@@ -1,222 +0,0 @@
1
- import { WalletType } from '@rango-dev/wallets-shared';
2
- import { RoutingResultType } from 'rango-sdk';
3
- import { BestRouteType } from '../../types/swaps';
4
- import { SelectableWallet } from './types';
5
-
6
- export const bestRoute: BestRouteType = {
7
- from: { blockchain: 'BSC', symbol: 'BNB', address: null },
8
- to: { blockchain: 'AVAX_CCHAIN', symbol: 'AVAX', address: null },
9
- requestAmount: '0.3',
10
- requestId: '228529e3-27d7-4fa9-ab84-bb2b90eade6f',
11
- result: {
12
- resultType: RoutingResultType.OK,
13
- outputAmount: '5.685715974132648891',
14
- swaps: [
15
- {
16
- swapperId: 'AnySwap Aggregator',
17
- swapperType: 'AGGREGATOR',
18
- swapperLogo: 'https://api.rango.exchange/swappers/multichain.png',
19
-
20
- from: {
21
- symbol: 'BNB',
22
- logo: 'https://api.rango.exchange/i/Y3v1KW',
23
- blockchainLogo: 'https://api.rango.exchange/blockchains/binance.svg',
24
-
25
- address: null,
26
- blockchain: 'BSC',
27
- decimals: 18,
28
- usdPrice: 279.2738558274085,
29
- },
30
- to: {
31
- symbol: 'WETH.E',
32
- logo: 'https://api.rango.exchange/i/j9xgdC',
33
- blockchainLogo:
34
- 'https://api.rango.exchange/blockchains/avax_cchain.svg',
35
-
36
- address: '0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab',
37
- blockchain: 'AVAX_CCHAIN',
38
- decimals: 18,
39
- usdPrice: 1329.24,
40
- },
41
- fromAmount: '0.300000000000000000',
42
- fromAmountPrecision: null,
43
- fromAmountMinValue: '0.047579322466294684272760',
44
- fromAmountMaxValue: '79302.26195302606417382090',
45
- fromAmountRestrictionType: 'INCLUSIVE',
46
- toAmount: '0.062064305934309070',
47
- fee: [
48
- {
49
- asset: { blockchain: 'BSC', symbol: 'BNB', address: null },
50
- expenseType: 'FROM_SOURCE_WALLET',
51
- amount: '0.001388002000000000',
52
- name: 'Network Fee',
53
- },
54
- ],
55
- estimatedTimeInSeconds: 300,
56
- swapChainType: 'INTRA_CHAIN',
57
- routes: null,
58
- recommendedSlippage: null,
59
- timeStat: { min: 162, avg: 260, max: 467 },
60
- includesDestinationTx: false,
61
- maxRequiredSign: 1,
62
- warnings: [],
63
- },
64
- {
65
- swapperId: 'PangolinSwap',
66
- swapperLogo: 'https://api.rango.exchange/swappers/pangolin.png',
67
- swapperType: 'DEX',
68
- from: {
69
- symbol: 'WETH.E',
70
- logo: 'https://api.rango.exchange/i/j9xgdC',
71
- address: '0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab',
72
- blockchain: 'AVAX_CCHAIN',
73
- decimals: 18,
74
- usdPrice: 1329.24,
75
- blockchainLogo:
76
- 'https://api.rango.exchange/blockchains/avax_cchain.svg',
77
- },
78
- to: {
79
- symbol: 'AVAX',
80
- logo: 'https://api.rango.exchange/i/kX4edQ',
81
- address: null,
82
- blockchain: 'AVAX_CCHAIN',
83
- decimals: 18,
84
- usdPrice: 12.5,
85
- blockchainLogo:
86
- 'https://api.rango.exchange/blockchains/avax_cchain.svg',
87
- },
88
- fromAmount: '0.062064305934309070',
89
- fromAmountPrecision: null,
90
- fromAmountMinValue: null,
91
- fromAmountMaxValue: null,
92
- fromAmountRestrictionType: 'EXCLUSIVE',
93
- toAmount: '5.685715974132648891',
94
- fee: [
95
- {
96
- asset: {
97
- blockchain: 'AVAX_CCHAIN',
98
- symbol: 'WETH.E',
99
- address: '0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab',
100
- },
101
- name: 'Network Fee',
102
- expenseType: 'DECREASE_FROM_OUTPUT',
103
- amount:
104
- '0.00018619291780292721387591870688029381530892436558133340440690517425537109375',
105
- },
106
- {
107
- asset: { blockchain: 'AVAX_CCHAIN', symbol: 'AVAX', address: null },
108
- expenseType: 'FROM_SOURCE_WALLET',
109
- amount: '0.005370022532678750',
110
- name: 'Network Fee',
111
- },
112
- ],
113
- estimatedTimeInSeconds: 45,
114
- swapChainType: 'INTER_CHAIN',
115
- routes: [
116
- {
117
- nodes: [
118
- {
119
- nodes: [
120
- {
121
- marketName: 'PangolinSwap',
122
- marketId: 'PangolinSwap',
123
- percent: 1.0,
124
- },
125
- ],
126
- from: 'WETH.e',
127
- fromLogo: '',
128
- fromAddress: '0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab',
129
- fromBlockchain: 'AVAX_CCHAIN',
130
- to: 'WAVAX',
131
- toLogo: '',
132
- toAddress: '0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7',
133
- toBlockchain: 'AVAX_CCHAIN',
134
- },
135
- ],
136
- },
137
- ],
138
- recommendedSlippage: null,
139
- timeStat: { min: 6, avg: 39, max: 317 },
140
- includesDestinationTx: false,
141
- maxRequiredSign: 1,
142
- warnings: [],
143
- },
144
- ],
145
- },
146
- validationStatus: null,
147
- missingBlockchains: [],
148
- diagnosisMessages: [],
149
- walletNotSupportingFromBlockchain: false,
150
- processingLimitReached: false,
151
- };
152
-
153
- export const wallets: SelectableWallet[] = [
154
- {
155
- walletType: WalletType.META_MASK,
156
- address: '0x5423e28219d6d568dcf62a8134d623e6f4a1c2df',
157
- image: 'https://app.rango.exchange/wallets/metamask.svg',
158
- chain: 'BSC',
159
- selected: false,
160
- },
161
- {
162
- walletType: WalletType.OKX,
163
- address: '0x2702d89c1c8658b49c45dd460deebcc45faec03c',
164
- image: 'https://app.rango.exchange/wallets/okx.png',
165
- chain: 'BSC',
166
- selected: false,
167
- },
168
-
169
- {
170
- walletType: WalletType.KEPLR,
171
- address: 'osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl',
172
- image: 'https://app.rango.exchange/wallets/keplr.png',
173
- chain: 'OSMOSIS',
174
- selected: false,
175
- },
176
- ];
177
-
178
- export const exampleFor5Wallets: SelectableWallet[] = [
179
- {
180
- walletType: WalletType.META_MASK,
181
- address: '0x5423e28219d6d568dcf62a8134d623e6f4a1c2df',
182
- image: 'https://app.rango.exchange/wallets/metamask.svg',
183
- selected: false,
184
- chain: 'BSC',
185
- },
186
- {
187
- walletType: WalletType.OKX,
188
- address: '0x2702d89c1c8658b49c45dd460deebcc45faec03c',
189
- image: 'https://app.rango.exchange/wallets/okx.png',
190
- selected: false,
191
- chain: 'BSC',
192
- },
193
- {
194
- walletType: WalletType.EXODUS,
195
- address: '0x2702d89c1c8658b49c45dd460deebcc45faec03c',
196
- image: 'https://app.rango.exchange/wallets/exodus.png',
197
- selected: false,
198
- chain: 'BSC',
199
- },
200
- {
201
- walletType: WalletType.MATH,
202
- address: '0x2702d89c1c8658b49c45dd460deebcc45faec03c',
203
- image: 'https://app.rango.exchange/wallets/math-wallet.png',
204
- selected: false,
205
- chain: 'BSC',
206
- },
207
- {
208
- walletType: WalletType.CLOVER,
209
- address: '0x2702d89c1c8658b49c45dd460deebcc45faec03c',
210
- image: 'https://app.rango.exchange/wallets/clover.jpeg',
211
- selected: false,
212
- chain: 'BSC',
213
- },
214
-
215
- {
216
- walletType: WalletType.KEPLR,
217
- address: 'osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl',
218
- image: 'https://app.rango.exchange/wallets/keplr.png',
219
- selected: false,
220
- chain: 'OSMOSIS',
221
- },
222
- ];
@@ -1,23 +0,0 @@
1
- import { PendingSwap } from '../containers/History/types';
2
-
3
- export function groupingOfSwaps(list: PendingSwap[]) {
4
- return list.reduce(
5
- (acc: Array<{ title: string; swaps: PendingSwap[] }>, swap) => {
6
- const categoryIndex = acc.findIndex(
7
- (item) =>
8
- (swap.status === 'running' && item.title == 'Active Swaps') ||
9
- (swap.status !== 'running' && item.title == 'Recent Swaps')
10
- );
11
- if (categoryIndex > -1) {
12
- acc[categoryIndex].swaps.push(swap);
13
- } else {
14
- acc.push({
15
- title: swap.status === 'running' ? 'Active Swaps' : 'Recent Swaps',
16
- swaps: [swap],
17
- });
18
- }
19
- return acc;
20
- },
21
- []
22
- );
23
- }