@rango-dev/ui 0.24.0 → 0.24.1-next.0
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/CHANGELOG.md +0 -4
- package/dist/index.js +6 -6
- package/dist/index.js.map +4 -4
- package/dist/translations/en.d.ts.map +1 -1
- package/dist/translations/es.d.ts.map +1 -1
- package/dist/translations/fr.d.ts.map +1 -1
- package/dist/translations/ja.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Alert/Alert.styles.d.ts +157 -0
- package/dist/widget/ui/src/components/Alert/Alert.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Button/Button.d.ts +54 -54
- package/dist/widget/ui/src/components/Button/Button.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Checkbox/Checkbox.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ListItem/ListItem.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts +158 -0
- package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.d.ts +4 -0
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.d.ts.map +1 -0
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.styles.d.ts +629 -0
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.styles.d.ts.map +1 -0
- package/dist/widget/ui/src/components/{RouteCost/RouteCost.types.d.ts → QuoteCost/QuoteCost.types.d.ts} +1 -1
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.types.d.ts.map +1 -0
- package/dist/widget/ui/src/components/QuoteCost/index.d.ts +2 -0
- package/dist/widget/ui/src/components/QuoteCost/index.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Radio/Radio.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/RoutesOverview/RoutesOverview.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts +16 -2
- package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SelectableCategoryList/index.d.ts +1 -0
- package/dist/widget/ui/src/components/SelectableCategoryList/index.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Skeleton/Skeleton.types.d.ts +1 -1
- package/dist/widget/ui/src/components/Skeleton/Skeleton.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/StepDetails/StepDetails.d.ts.map +1 -1
- package/dist/widget/ui/src/components/StepDetails/StepDetails.styles.d.ts +7 -1
- package/dist/widget/ui/src/components/StepDetails/StepDetails.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/StepDetails/StepDetails.types.d.ts +16 -2
- package/dist/widget/ui/src/components/StepDetails/StepDetails.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/StepDetails/index.d.ts +1 -1
- package/dist/widget/ui/src/components/StepDetails/index.d.ts.map +1 -1
- package/dist/widget/ui/src/components/StepDetails/mock.d.ts +1 -1
- package/dist/widget/ui/src/components/StepDetails/mock.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SwapListItem/mock.d.ts +1 -1
- package/dist/widget/ui/src/components/SwapListItem/mock.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Switch/Switch.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/TextField/TextField.d.ts.map +1 -1
- package/dist/widget/ui/src/components/TokenAmount/TokenAmount.d.ts.map +1 -1
- package/dist/widget/ui/src/components/TokenAmount/TokenAmount.styles.d.ts +471 -1
- package/dist/widget/ui/src/components/TokenAmount/TokenAmount.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts +2 -2
- package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Wallet/Wallet.types.d.ts +3 -17
- package/dist/widget/ui/src/components/Wallet/Wallet.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/common/Image.d.ts +157 -0
- package/dist/widget/ui/src/components/common/Image.d.ts.map +1 -1
- package/dist/widget/ui/src/components/common/index.d.ts +1 -1
- package/dist/widget/ui/src/components/common/index.d.ts.map +1 -1
- package/dist/widget/ui/src/components/index.d.ts +1 -2
- package/dist/widget/ui/src/components/index.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/BlockchainSelector/BlockchainSelector.d.ts +3 -3
- package/dist/widget/ui/src/containers/BlockchainSelector/BlockchainSelector.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.d.ts +1 -1
- package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.stories.d.ts +2 -2
- package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.stories.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapHistory/mock.d.ts +1 -1
- package/dist/widget/ui/src/containers/SwapHistory/mock.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts +1313 -54
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts +2 -0
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/TokenSection.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts +525 -54
- package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts +2 -2
- package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts.map +1 -1
- package/dist/widget/ui/src/icons/CosmosCategory.d.ts +5 -0
- package/dist/widget/ui/src/icons/CosmosCategory.d.ts.map +1 -0
- package/dist/widget/ui/src/icons/EvmCategory.d.ts +5 -0
- package/dist/widget/ui/src/icons/EvmCategory.d.ts.map +1 -0
- package/dist/widget/ui/src/icons/Icons.stories.d.ts +1 -1
- package/dist/widget/ui/src/icons/Language.d.ts +5 -0
- package/dist/widget/ui/src/icons/Language.d.ts.map +1 -0
- package/dist/widget/ui/src/icons/OtherCategory.d.ts +5 -0
- package/dist/widget/ui/src/icons/OtherCategory.d.ts.map +1 -0
- package/dist/widget/ui/src/icons/UtxoCategory.d.ts +5 -0
- package/dist/widget/ui/src/icons/UtxoCategory.d.ts.map +1 -0
- package/dist/widget/ui/src/icons/index.d.ts +5 -0
- package/dist/widget/ui/src/icons/index.d.ts.map +1 -1
- package/dist/widget/ui/src/index.d.ts +0 -1
- package/dist/widget/ui/src/index.d.ts.map +1 -1
- package/dist/widget/ui/src/types/index.d.ts +0 -1
- package/dist/widget/ui/src/types/index.d.ts.map +1 -1
- package/dist/widget/ui/src/types/swaps.d.ts +1 -27
- package/dist/widget/ui/src/types/swaps.d.ts.map +1 -1
- package/dist/widget/ui/src/{helper → utils}/index.d.ts +0 -3
- package/dist/widget/ui/src/utils/index.d.ts.map +1 -0
- package/package.json +7 -6
- package/src/components/Alert/Alert.styles.ts +9 -12
- package/src/components/Alert/Alert.tsx +2 -2
- package/src/components/BlockchainsChip/BlockchainsChip.styles.ts +2 -1
- package/src/components/Button/Button.styles.tsx +1 -0
- package/src/components/Checkbox/Checkbox.styles.ts +5 -1
- package/src/components/ListItem/ListItem.styles.ts +9 -0
- package/src/components/ListItem/ListItem.tsx +1 -1
- package/src/components/ListItemButton/ListItemButton.styles.ts +1 -0
- package/src/components/PriceImpact/PriceImpact.styles.ts +9 -1
- package/src/components/PriceImpact/PriceImpact.tsx +5 -5
- package/src/components/QuoteCost/QuoteCost.styles.ts +29 -0
- package/src/components/{RouteCost/RouteCost.tsx → QuoteCost/QuoteCost.tsx} +14 -10
- package/src/components/QuoteCost/index.ts +1 -0
- package/src/components/Radio/Radio.styles.tsx +5 -2
- package/src/components/RoutesOverview/RoutesOverview.tsx +6 -2
- package/src/components/SelectableCategoryList/SelectableCategoryList.helpers.ts +40 -13
- package/src/components/SelectableCategoryList/SelectableCategoryList.tsx +47 -46
- package/src/components/SelectableCategoryList/index.ts +1 -0
- package/src/components/SelectableWalletList/SelectableWalletList.tsx +1 -1
- package/src/components/Skeleton/Skeleton.tsx +3 -2
- package/src/components/Skeleton/Skeleton.types.ts +1 -1
- package/src/components/StepDetails/StepDetails.stories.tsx +1 -1
- package/src/components/StepDetails/StepDetails.styles.ts +36 -28
- package/src/components/StepDetails/StepDetails.tsx +11 -7
- package/src/components/StepDetails/StepDetails.types.ts +17 -2
- package/src/components/StepDetails/index.ts +1 -1
- package/src/components/StepDetails/mock.ts +1 -1
- package/src/components/SvgIcon/SvgIcon.style.ts +1 -1
- package/src/components/SwapListItem/mock.ts +21 -6
- package/src/components/Switch/Switch.styles.tsx +8 -6
- package/src/components/TextField/TextField.tsx +3 -5
- package/src/components/TokenAmount/TokenAmount.styles.ts +12 -10
- package/src/components/TokenAmount/TokenAmount.tsx +23 -17
- package/src/components/Tooltip/Tooltip.styles.ts +8 -5
- package/src/components/Tooltip/Tooltip.tsx +2 -3
- package/src/components/Wallet/Wallet.styles.ts +1 -1
- package/src/components/Wallet/Wallet.types.ts +3 -23
- package/src/components/common/Image.tsx +1 -2
- package/src/components/common/index.ts +1 -1
- package/src/components/index.ts +1 -2
- package/src/containers/BlockchainSelector/BlockchainSelector.tsx +9 -8
- package/src/containers/SwapHistory/SwapHistory.stories.tsx +5 -2
- package/src/containers/SwapHistory/SwapHistory.tsx +1 -1
- package/src/containers/SwapHistory/mock.ts +24 -8
- package/src/containers/SwapInput/SwapInput.styles.ts +78 -27
- package/src/containers/SwapInput/SwapInput.tsx +37 -29
- package/src/containers/SwapInput/SwapInput.types.ts +2 -0
- package/src/containers/SwapInput/TokenSection.styles.ts +27 -12
- package/src/containers/SwapInput/TokenSection.tsx +15 -6
- package/src/containers/TokenSelector/TokenSelector.tsx +8 -10
- package/src/icons/CosmosCategory.tsx +137 -0
- package/src/icons/EvmCategory.tsx +74 -0
- package/src/icons/Language.tsx +55 -0
- package/src/icons/OtherCategory.tsx +72 -0
- package/src/icons/UtxoCategory.tsx +44 -0
- package/src/icons/index.ts +5 -0
- package/src/index.ts +0 -1
- package/src/theme.ts +4 -4
- package/src/types/index.ts +0 -1
- package/src/types/swaps.ts +0 -38
- package/src/utils/index.ts +23 -0
- package/dist/widget/ui/src/components/BestRoute/BestRoute.d.ts +0 -4
- package/dist/widget/ui/src/components/BestRoute/BestRoute.d.ts.map +0 -1
- package/dist/widget/ui/src/components/BestRoute/BestRoute.stories.d.ts +0 -7
- package/dist/widget/ui/src/components/BestRoute/BestRoute.stories.d.ts.map +0 -1
- package/dist/widget/ui/src/components/BestRoute/BestRoute.styles.d.ts +0 -1429
- package/dist/widget/ui/src/components/BestRoute/BestRoute.styles.d.ts.map +0 -1
- package/dist/widget/ui/src/components/BestRoute/BestRoute.types.d.ts +0 -34
- package/dist/widget/ui/src/components/BestRoute/BestRoute.types.d.ts.map +0 -1
- package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.d.ts +0 -4
- package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.d.ts.map +0 -1
- package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.styles.d.ts +0 -319
- package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.styles.d.ts.map +0 -1
- package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.types.d.ts +0 -6
- package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.types.d.ts.map +0 -1
- package/dist/widget/ui/src/components/BestRoute/RouteSummary.d.ts +0 -12
- package/dist/widget/ui/src/components/BestRoute/RouteSummary.d.ts.map +0 -1
- package/dist/widget/ui/src/components/BestRoute/RouteSummary.styles.d.ts +0 -158
- package/dist/widget/ui/src/components/BestRoute/RouteSummary.styles.d.ts.map +0 -1
- package/dist/widget/ui/src/components/BestRoute/index.d.ts +0 -5
- package/dist/widget/ui/src/components/BestRoute/index.d.ts.map +0 -1
- package/dist/widget/ui/src/components/BestRoute/mock.d.ts +0 -3
- package/dist/widget/ui/src/components/BestRoute/mock.d.ts.map +0 -1
- package/dist/widget/ui/src/components/RouteCost/RouteCost.d.ts +0 -4
- package/dist/widget/ui/src/components/RouteCost/RouteCost.d.ts.map +0 -1
- package/dist/widget/ui/src/components/RouteCost/RouteCost.styles.d.ts +0 -158
- package/dist/widget/ui/src/components/RouteCost/RouteCost.styles.d.ts.map +0 -1
- package/dist/widget/ui/src/components/RouteCost/RouteCost.types.d.ts.map +0 -1
- package/dist/widget/ui/src/components/RouteCost/index.d.ts +0 -2
- package/dist/widget/ui/src/components/RouteCost/index.d.ts.map +0 -1
- package/dist/widget/ui/src/containers/History/types.d.ts +0 -2
- package/dist/widget/ui/src/containers/History/types.d.ts.map +0 -1
- package/dist/widget/ui/src/helper/index.d.ts.map +0 -1
- package/src/components/BestRoute/BestRoute.stories.tsx +0 -17
- package/src/components/BestRoute/BestRoute.styles.ts +0 -213
- package/src/components/BestRoute/BestRoute.tsx +0 -176
- package/src/components/BestRoute/BestRoute.types.ts +0 -32
- package/src/components/BestRoute/BestRouteSkeleton.styles.ts +0 -110
- package/src/components/BestRoute/BestRouteSkeleton.tsx +0 -112
- package/src/components/BestRoute/BestRouteSkeleton.types.ts +0 -5
- package/src/components/BestRoute/RouteSummary.styles.ts +0 -15
- package/src/components/BestRoute/RouteSummary.tsx +0 -48
- package/src/components/BestRoute/index.ts +0 -4
- package/src/components/BestRoute/mock.ts +0 -142
- package/src/components/RouteCost/RouteCost.styles.ts +0 -20
- package/src/components/RouteCost/index.ts +0 -1
- package/src/containers/History/types.tsx +0 -1
- package/src/helper/index.ts +0 -99
- /package/src/components/{RouteCost/RouteCost.types.ts → QuoteCost/QuoteCost.types.ts} +0 -0
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { darkTheme, styled } from '../../theme';
|
|
2
|
-
|
|
3
|
-
export const Container = styled('div', {
|
|
4
|
-
$$color: '$colors$neutral100',
|
|
5
|
-
[`.${darkTheme} &`]: {
|
|
6
|
-
$$color: '$colors$neutral300',
|
|
7
|
-
},
|
|
8
|
-
backgroundColor: '$$color',
|
|
9
|
-
borderBottomLeftRadius: '$xm',
|
|
10
|
-
borderBottomRightRadius: '$xm',
|
|
11
|
-
padding: '$15 ',
|
|
12
|
-
'& .cost-and-tag': {
|
|
13
|
-
display: 'flex',
|
|
14
|
-
justifyContent: 'space-between',
|
|
15
|
-
alignItems: 'center',
|
|
16
|
-
height: '22px',
|
|
17
|
-
},
|
|
18
|
-
variants: {
|
|
19
|
-
rounded: {
|
|
20
|
-
true: {
|
|
21
|
-
borderRadius: '$xm',
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
'& .cost': {
|
|
26
|
-
display: 'flex',
|
|
27
|
-
},
|
|
28
|
-
'& .basic-summary': {
|
|
29
|
-
padding: '$15 $0 14px $0',
|
|
30
|
-
},
|
|
31
|
-
'& .output': {
|
|
32
|
-
padding: '$6 $0 $15 $0',
|
|
33
|
-
display: 'flex',
|
|
34
|
-
flexDirection: 'column',
|
|
35
|
-
},
|
|
36
|
-
'& .output__token-info': {
|
|
37
|
-
display: 'flex',
|
|
38
|
-
justifyContent: 'start',
|
|
39
|
-
alignItems: 'center',
|
|
40
|
-
paddingBottom: '$5',
|
|
41
|
-
},
|
|
42
|
-
'& .route-summary': {
|
|
43
|
-
display: 'flex',
|
|
44
|
-
justifyContent: 'space-between',
|
|
45
|
-
alignItems: 'end',
|
|
46
|
-
},
|
|
47
|
-
'& .route-summary__separator': {
|
|
48
|
-
height: '$28',
|
|
49
|
-
marginLeft: '13px',
|
|
50
|
-
borderLeft: '1px solid $neutral700',
|
|
51
|
-
},
|
|
52
|
-
'& .token-amount': {
|
|
53
|
-
display: 'flex',
|
|
54
|
-
justifyContent: 'space-between',
|
|
55
|
-
},
|
|
56
|
-
'& .token-amount__label': {
|
|
57
|
-
display: 'flex',
|
|
58
|
-
flexDirection: 'column',
|
|
59
|
-
alignItems: 'start',
|
|
60
|
-
},
|
|
61
|
-
'& .chains': {
|
|
62
|
-
paddingTop: '$2',
|
|
63
|
-
},
|
|
64
|
-
'& .swap-preview': {
|
|
65
|
-
padding: '$15 $0 $15 $0',
|
|
66
|
-
},
|
|
67
|
-
'& .steps': {
|
|
68
|
-
paddingLeft: '$8',
|
|
69
|
-
},
|
|
70
|
-
'& .step__title': {
|
|
71
|
-
display: 'flex',
|
|
72
|
-
alignItems: 'center',
|
|
73
|
-
},
|
|
74
|
-
'& .step__content': {
|
|
75
|
-
display: 'flex',
|
|
76
|
-
alignItems: 'start',
|
|
77
|
-
},
|
|
78
|
-
'& .step__tokens': {
|
|
79
|
-
paddingTop: '$5',
|
|
80
|
-
paddingBottom: '$10',
|
|
81
|
-
display: 'flex',
|
|
82
|
-
alignItems: 'center',
|
|
83
|
-
},
|
|
84
|
-
'& .step__token-info': {
|
|
85
|
-
display: 'flex',
|
|
86
|
-
alignItems: 'center',
|
|
87
|
-
},
|
|
88
|
-
'& .step__icon-container': {
|
|
89
|
-
margin: '$0 $2',
|
|
90
|
-
padding: '$4',
|
|
91
|
-
display: 'flex',
|
|
92
|
-
justifyContent: 'center',
|
|
93
|
-
alignItems: 'center',
|
|
94
|
-
},
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
export const StepSeparator = styled('div', {
|
|
98
|
-
borderLeft: '1px dashed black',
|
|
99
|
-
minHeight: ' 64px',
|
|
100
|
-
margin: '0px 11.5px',
|
|
101
|
-
alignSelf: 'stretch',
|
|
102
|
-
variants: {
|
|
103
|
-
hideSeparator: {
|
|
104
|
-
true: {
|
|
105
|
-
minHeight: 'unset',
|
|
106
|
-
height: '0',
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
});
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import type { PropTypes } from './BestRouteSkeleton.types';
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
|
|
5
|
-
import { NextIcon } from '../../icons';
|
|
6
|
-
import { ChainToken } from '../ChainToken';
|
|
7
|
-
import { Divider } from '../Divider';
|
|
8
|
-
import { Skeleton } from '../Skeleton';
|
|
9
|
-
|
|
10
|
-
import { Container, StepSeparator } from './BestRouteSkeleton.styles';
|
|
11
|
-
|
|
12
|
-
function StepSkeleton(props: { separator?: boolean }) {
|
|
13
|
-
const { separator = true } = props;
|
|
14
|
-
return (
|
|
15
|
-
<>
|
|
16
|
-
<div className="step__title">
|
|
17
|
-
<Skeleton height={22} width={22} variant="circular" />
|
|
18
|
-
<Divider direction="horizontal" size={8} />
|
|
19
|
-
<Skeleton height={15} width={148} variant="rounded" />
|
|
20
|
-
</div>
|
|
21
|
-
<div className="step__content">
|
|
22
|
-
<StepSeparator hideSeparator={!separator} />
|
|
23
|
-
<div className="step__tokens">
|
|
24
|
-
<div className="step__token-info">
|
|
25
|
-
<ChainToken size="small" loading chainImage="" tokenImage="" />
|
|
26
|
-
<Divider direction="horizontal" size={8} />
|
|
27
|
-
<Skeleton height={12} width={76} variant="rounded" />
|
|
28
|
-
</div>
|
|
29
|
-
<div className="step__icon-container">
|
|
30
|
-
<NextIcon color="gray" size={16} />
|
|
31
|
-
</div>
|
|
32
|
-
<div className="step__token-info">
|
|
33
|
-
<ChainToken size="small" loading chainImage="" tokenImage="" />
|
|
34
|
-
<Divider direction="horizontal" size={8} />
|
|
35
|
-
<Skeleton height={12} width={76} variant="rounded" />
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
</>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function BestRouteSkeleton(props: PropTypes) {
|
|
44
|
-
const { type, expanded, tag = false } = props;
|
|
45
|
-
const routeSummary = (
|
|
46
|
-
<div className="route-summary">
|
|
47
|
-
<div className="token-amount">
|
|
48
|
-
<ChainToken loading size="medium" chainImage="" tokenImage="" />
|
|
49
|
-
<Divider size={8} direction="horizontal" />
|
|
50
|
-
<div className="token-amount__label">
|
|
51
|
-
<Skeleton height={10} width={60} variant="rounded" />
|
|
52
|
-
<Divider size={4} />
|
|
53
|
-
<Skeleton height={15} width={148} variant="rounded" />
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
<Skeleton height={12} width={64} variant="rounded" />
|
|
57
|
-
</div>
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<Container>
|
|
62
|
-
<div className="cost-and-tag">
|
|
63
|
-
<div className="cost">
|
|
64
|
-
<Skeleton width={60} height={10} variant="rounded" />
|
|
65
|
-
<Divider size={4} direction="horizontal" />
|
|
66
|
-
<Skeleton width={60} height={10} variant="rounded" />
|
|
67
|
-
<Divider size={4} direction="horizontal" />
|
|
68
|
-
<Skeleton width={60} height={10} variant="rounded" />
|
|
69
|
-
</div>
|
|
70
|
-
{tag && <Skeleton height={22} width={100} variant="rounded" />}
|
|
71
|
-
</div>
|
|
72
|
-
{type === 'basic' && (
|
|
73
|
-
<div className="basic-summary">
|
|
74
|
-
<Skeleton height={15} width={148} variant="rounded" />
|
|
75
|
-
</div>
|
|
76
|
-
)}
|
|
77
|
-
{type === 'list-item' && (
|
|
78
|
-
<div className="output">
|
|
79
|
-
<div className="output__token-info">
|
|
80
|
-
<ChainToken loading size="medium" chainImage="" tokenImage="" />
|
|
81
|
-
<Divider direction="horizontal" size={4} />
|
|
82
|
-
<Skeleton height={15} width={150} variant="rounded" />
|
|
83
|
-
</div>
|
|
84
|
-
<Divider size={4} />
|
|
85
|
-
<Skeleton height={10} width={184} variant="rounded" />
|
|
86
|
-
</div>
|
|
87
|
-
)}
|
|
88
|
-
{type === 'swap-preview' && (
|
|
89
|
-
<>
|
|
90
|
-
<Divider size={4} />
|
|
91
|
-
<div className="swap-preview">
|
|
92
|
-
{routeSummary}
|
|
93
|
-
<div className="route-summary__separator" />
|
|
94
|
-
{routeSummary}
|
|
95
|
-
</div>
|
|
96
|
-
</>
|
|
97
|
-
)}
|
|
98
|
-
<div className="chains">
|
|
99
|
-
<Skeleton height={15} width={321} variant="rounded" />
|
|
100
|
-
</div>
|
|
101
|
-
|
|
102
|
-
{expanded && (
|
|
103
|
-
<div className="steps">
|
|
104
|
-
<Divider size={20} />
|
|
105
|
-
<StepSkeleton />
|
|
106
|
-
<StepSkeleton />
|
|
107
|
-
<StepSkeleton separator={false} />
|
|
108
|
-
</div>
|
|
109
|
-
)}
|
|
110
|
-
</Container>
|
|
111
|
-
);
|
|
112
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { styled } from '../../theme';
|
|
2
|
-
|
|
3
|
-
export const Container = styled('div', {
|
|
4
|
-
position: 'relative',
|
|
5
|
-
display: 'flex',
|
|
6
|
-
flexDirection: 'column',
|
|
7
|
-
width: '100%',
|
|
8
|
-
'& .separator': {
|
|
9
|
-
height: '14px',
|
|
10
|
-
marginLeft: '14px',
|
|
11
|
-
position: 'absolute',
|
|
12
|
-
borderLeft: '1px solid $foreground',
|
|
13
|
-
top: '42%',
|
|
14
|
-
},
|
|
15
|
-
});
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { Step } from './BestRoute.types';
|
|
2
|
-
import type { PriceImpactWarningLevel } from '../PriceImpact';
|
|
3
|
-
|
|
4
|
-
import React from 'react';
|
|
5
|
-
|
|
6
|
-
import { TokenAmount } from '../TokenAmount';
|
|
7
|
-
|
|
8
|
-
import { Container } from './RouteSummary.styles';
|
|
9
|
-
|
|
10
|
-
type PropTypes = {
|
|
11
|
-
from: Step['from'];
|
|
12
|
-
to: Step['to'];
|
|
13
|
-
percentageChange?: string | null;
|
|
14
|
-
warningLevel: PriceImpactWarningLevel;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export function RouteSummary(props: PropTypes) {
|
|
18
|
-
const { from, to, percentageChange, warningLevel } = props;
|
|
19
|
-
return (
|
|
20
|
-
<Container>
|
|
21
|
-
<TokenAmount
|
|
22
|
-
direction="horizontal"
|
|
23
|
-
label="Swap input"
|
|
24
|
-
type="input"
|
|
25
|
-
price={{ value: from.price.value, usdValue: from.price.usdValue }}
|
|
26
|
-
token={{
|
|
27
|
-
displayName: from.token.displayName,
|
|
28
|
-
image: from.token.image,
|
|
29
|
-
}}
|
|
30
|
-
chain={{ image: from.chain.image }}
|
|
31
|
-
/>
|
|
32
|
-
<div className="separator" />
|
|
33
|
-
<TokenAmount
|
|
34
|
-
direction="horizontal"
|
|
35
|
-
label="Estimated output"
|
|
36
|
-
type="output"
|
|
37
|
-
price={{ value: to.price.value, usdValue: to.price.usdValue }}
|
|
38
|
-
token={{
|
|
39
|
-
displayName: to.token.displayName,
|
|
40
|
-
image: to.token.image,
|
|
41
|
-
}}
|
|
42
|
-
chain={{ image: to.chain.image }}
|
|
43
|
-
percentageChange={percentageChange}
|
|
44
|
-
warningLevel={warningLevel}
|
|
45
|
-
/>
|
|
46
|
-
</Container>
|
|
47
|
-
);
|
|
48
|
-
}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import type { BestRouteProps } from './BestRoute.types';
|
|
2
|
-
|
|
3
|
-
export const route1: BestRouteProps = {
|
|
4
|
-
type: 'list-item',
|
|
5
|
-
recommended: true,
|
|
6
|
-
input: { value: '1', usdValue: '30000' },
|
|
7
|
-
output: { value: '3161.441024', usdValue: '26.890' },
|
|
8
|
-
steps: [
|
|
9
|
-
{
|
|
10
|
-
swapper: {
|
|
11
|
-
displayName: 'MayaProtocol',
|
|
12
|
-
image: 'https://api.rango.exchange/swappers/maya.jpg',
|
|
13
|
-
},
|
|
14
|
-
from: {
|
|
15
|
-
token: {
|
|
16
|
-
displayName: 'BTC',
|
|
17
|
-
image: 'https://api.rango.exchange/tokens/BTC/BTC.png',
|
|
18
|
-
},
|
|
19
|
-
chain: {
|
|
20
|
-
displayName: 'BTC',
|
|
21
|
-
image: 'https://api.rango.exchange/tokens/BTC/BTC.png',
|
|
22
|
-
},
|
|
23
|
-
price: {
|
|
24
|
-
value: '1.00000000',
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
to: {
|
|
28
|
-
chain: {
|
|
29
|
-
displayName: 'ETH',
|
|
30
|
-
image: 'https://api.rango.exchange/blockchains/ethereum.svg',
|
|
31
|
-
},
|
|
32
|
-
token: {
|
|
33
|
-
displayName: 'ETH',
|
|
34
|
-
|
|
35
|
-
image: 'https://api.rango.exchange/tokens/ETH/ETH.png',
|
|
36
|
-
},
|
|
37
|
-
price: {
|
|
38
|
-
value: '14.863736725876758517',
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
swapper: {
|
|
44
|
-
displayName: 'Satellite',
|
|
45
|
-
image: 'https://api.rango.exchange/swappers/satellite.png',
|
|
46
|
-
},
|
|
47
|
-
from: {
|
|
48
|
-
token: {
|
|
49
|
-
displayName: 'ETH',
|
|
50
|
-
image: 'https://api.rango.exchange/tokens/ETH/ETH.png',
|
|
51
|
-
},
|
|
52
|
-
chain: {
|
|
53
|
-
displayName: 'ETH',
|
|
54
|
-
image: 'https://api.rango.exchange/blockchains/ethereum.svg',
|
|
55
|
-
},
|
|
56
|
-
price: { value: '14.863736725876758517' },
|
|
57
|
-
},
|
|
58
|
-
to: {
|
|
59
|
-
token: {
|
|
60
|
-
displayName: 'ETH',
|
|
61
|
-
image: 'https://api.rango.exchange/tokens/COSMOS/ETH.png',
|
|
62
|
-
},
|
|
63
|
-
chain: {
|
|
64
|
-
displayName: 'OSMOSIS',
|
|
65
|
-
image: 'https://api.rango.exchange/blockchains/osmosis.svg',
|
|
66
|
-
},
|
|
67
|
-
price: {
|
|
68
|
-
value: '14.825674725876758517',
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
swapper: {
|
|
74
|
-
displayName: 'Osmosis',
|
|
75
|
-
image: 'https://api.rango.exchange/swappers/osmosis.png',
|
|
76
|
-
},
|
|
77
|
-
from: {
|
|
78
|
-
token: {
|
|
79
|
-
displayName: 'ETH',
|
|
80
|
-
image: 'https://api.rango.exchange/tokens/COSMOS/ETH.png',
|
|
81
|
-
},
|
|
82
|
-
chain: {
|
|
83
|
-
displayName: 'OSMOSIS',
|
|
84
|
-
image: 'https://api.rango.exchange/blockchains/osmosis.svg',
|
|
85
|
-
},
|
|
86
|
-
price: {
|
|
87
|
-
value: '14.825674725876758517',
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
to: {
|
|
91
|
-
token: {
|
|
92
|
-
displayName: 'ATOM',
|
|
93
|
-
image: 'https://api.rango.exchange/tokens/COSMOS/ATOM.png',
|
|
94
|
-
},
|
|
95
|
-
chain: {
|
|
96
|
-
displayName: 'OSMOSIS',
|
|
97
|
-
image: 'https://api.rango.exchange/blockchains/osmosis.svg',
|
|
98
|
-
},
|
|
99
|
-
price: {
|
|
100
|
-
value: '3161.441024',
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
swapper: {
|
|
106
|
-
displayName: 'IBC',
|
|
107
|
-
image: 'https://api.rango.exchange/swappers/IBC.png',
|
|
108
|
-
},
|
|
109
|
-
from: {
|
|
110
|
-
token: {
|
|
111
|
-
displayName: 'ATOM',
|
|
112
|
-
image: 'https://api.rango.exchange/tokens/COSMOS/ATOM.png',
|
|
113
|
-
},
|
|
114
|
-
chain: {
|
|
115
|
-
displayName: 'OSMOSIS',
|
|
116
|
-
image: 'https://api.rango.exchange/blockchains/osmosis.svg',
|
|
117
|
-
},
|
|
118
|
-
price: {
|
|
119
|
-
value: '3161.441024',
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
to: {
|
|
123
|
-
token: {
|
|
124
|
-
displayName: 'ATOM',
|
|
125
|
-
image: 'https://api.rango.exchange/tokens/COSMOS/ATOM.png',
|
|
126
|
-
},
|
|
127
|
-
chain: {
|
|
128
|
-
displayName: 'COSMOS',
|
|
129
|
-
image: 'https://api.rango.exchange/blockchains/cosmos.svg',
|
|
130
|
-
},
|
|
131
|
-
price: {
|
|
132
|
-
value: '3161.441024',
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
],
|
|
137
|
-
|
|
138
|
-
percentageChange: '7.51',
|
|
139
|
-
warningLevel: 'high',
|
|
140
|
-
totalFee: '9.90',
|
|
141
|
-
totalTime: '23:00',
|
|
142
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { styled } from '../../theme';
|
|
2
|
-
|
|
3
|
-
export const Container = styled('div', {
|
|
4
|
-
borderRadius: '$xs',
|
|
5
|
-
display: 'flex',
|
|
6
|
-
justifyContent: 'start',
|
|
7
|
-
alignItems: 'center',
|
|
8
|
-
paddingBottom: '$10',
|
|
9
|
-
'& .item': {
|
|
10
|
-
display: 'flex',
|
|
11
|
-
alignItems: 'center',
|
|
12
|
-
},
|
|
13
|
-
'& .icon': {
|
|
14
|
-
width: '$16',
|
|
15
|
-
height: '$16',
|
|
16
|
-
display: 'flex',
|
|
17
|
-
justifyContent: 'center',
|
|
18
|
-
alignItems: 'center',
|
|
19
|
-
},
|
|
20
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { RouteCost } from './RouteCost';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
|
package/src/helper/index.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
2
|
-
|
|
3
|
-
export function containsText(text: string, searchText: string): boolean {
|
|
4
|
-
return text.toLowerCase().indexOf(searchText.toLowerCase()) > -1;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export function getConciseAddress(
|
|
8
|
-
address: string | null,
|
|
9
|
-
maxChars = 8,
|
|
10
|
-
ellipsisLength = 3
|
|
11
|
-
): string | null {
|
|
12
|
-
if (!address) {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
if (address.length < 2 * maxChars + ellipsisLength) {
|
|
16
|
-
return address;
|
|
17
|
-
}
|
|
18
|
-
const start = Math.ceil((address.length - maxChars) / 2);
|
|
19
|
-
const end = address.length - maxChars;
|
|
20
|
-
return `${address.substr(start, maxChars)}${'.'.repeat(
|
|
21
|
-
ellipsisLength
|
|
22
|
-
)}${address.substr(end)}`;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const hexToRgb = (hex: string) =>
|
|
26
|
-
((value) =>
|
|
27
|
-
value.length === 3
|
|
28
|
-
? value.split('').map((c) => parseInt(c.repeat(2), 16))
|
|
29
|
-
: (value.match(/.{1,2}/g) || []).map((v) => parseInt(v, 16)))(
|
|
30
|
-
hex.replace('#', '')
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
const isHexTooDark = (hexColor: string) =>
|
|
34
|
-
(([r, g, b]) => 0.2126 * r + 0.7152 * g + 0.0722 * b < 40)(
|
|
35
|
-
hexToRgb(hexColor)
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
const isHexTooLight = (hexColor: string) =>
|
|
39
|
-
(([r, g, b]) => (r * 299 + g * 587 + b * 114) / 1000 > 155)(
|
|
40
|
-
hexToRgb(hexColor)
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
const colorShade = (col: string, amt: number) => {
|
|
44
|
-
col = col.replace(/^#/, '');
|
|
45
|
-
if (col.length === 3) {
|
|
46
|
-
col = col[0] + col[0] + col[1] + col[1] + col[2] + col[2];
|
|
47
|
-
}
|
|
48
|
-
let [r, g, b]: any = col.match(/.{2}/g);
|
|
49
|
-
[r, g, b] = [
|
|
50
|
-
parseInt(r, 16) + amt,
|
|
51
|
-
parseInt(g, 16) + amt,
|
|
52
|
-
parseInt(b, 16) + amt,
|
|
53
|
-
];
|
|
54
|
-
|
|
55
|
-
r = Math.max(Math.min(255, r), 0).toString(16);
|
|
56
|
-
g = Math.max(Math.min(255, g), 0).toString(16);
|
|
57
|
-
b = Math.max(Math.min(255, b), 0).toString(16);
|
|
58
|
-
|
|
59
|
-
const rr = (r.length < 2 ? '0' : '') + r;
|
|
60
|
-
const gg = (g.length < 2 ? '0' : '') + g;
|
|
61
|
-
const bb = (b.length < 2 ? '0' : '') + b;
|
|
62
|
-
|
|
63
|
-
return `#${rr}${gg}${bb}`;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const generateRangeColors = (
|
|
67
|
-
name: string,
|
|
68
|
-
mode: 'light' | 'dark',
|
|
69
|
-
color?: string
|
|
70
|
-
) => {
|
|
71
|
-
let colors = { [name]: color };
|
|
72
|
-
if (color) {
|
|
73
|
-
let c = color;
|
|
74
|
-
if (isHexTooDark(color) || mode === 'dark') {
|
|
75
|
-
for (let i = 1; i < 10; i++) {
|
|
76
|
-
colors = {
|
|
77
|
-
...colors,
|
|
78
|
-
[name + i * 100]:
|
|
79
|
-
name === 'neutral'
|
|
80
|
-
? colorShade(c, i * 15)
|
|
81
|
-
: colorShade(color, i * 5),
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (isHexTooLight(color) || mode === 'light') {
|
|
86
|
-
for (let i = 1; i < 10; i++) {
|
|
87
|
-
c = colorShade(c, -(i * 5));
|
|
88
|
-
colors = {
|
|
89
|
-
...colors,
|
|
90
|
-
[name + i * 100]:
|
|
91
|
-
name === 'neutral'
|
|
92
|
-
? colorShade(c, -(i * 5))
|
|
93
|
-
: colorShade(color, -(i * 5)),
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return colors;
|
|
99
|
-
};
|
|
File without changes
|