@rango-dev/ui 0.1.10-next.89 → 0.1.10-next.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/TokenSelector/TokenSelector.d.ts +1 -1
- package/dist/containers/ConfirmSwap/ConfirmSwap.d.ts +2 -2
- package/dist/containers/ConfirmWallets/ConfirmWallets.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/swaps.d.ts +8 -1
- package/dist/types/wallet.d.ts +1 -0
- package/dist/ui.cjs.development.js +12 -8
- package/dist/ui.cjs.development.js.map +1 -1
- package/dist/ui.cjs.production.min.js +1 -1
- package/dist/ui.cjs.production.min.js.map +1 -1
- package/dist/ui.esm.js +12 -8
- package/dist/ui.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/TokenSelector/TokenSelector.tsx +1 -1
- package/src/containers/ConfirmSwap/ConfirmSwap.tsx +16 -12
- package/src/containers/ConfirmWallets/ConfirmWallets.tsx +3 -3
- package/src/containers/SwapHistory/SwapHistory.tsx +1 -1
- package/src/types/index.ts +2 -0
- package/src/types/{swaps.tsx → swaps.ts} +8 -0
- package/src/types/wallet.ts +1 -0
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ import { TokenWithAmount } from '../TokenList/TokenList';
|
|
|
7
7
|
export interface PropTypes {
|
|
8
8
|
list: TokenWithAmount[];
|
|
9
9
|
type?: 'Source' | 'Destination';
|
|
10
|
-
selected
|
|
10
|
+
selected: TokenWithAmount | null;
|
|
11
11
|
onChange: (token: TokenWithAmount) => void;
|
|
12
12
|
hasHeader?: boolean;
|
|
13
13
|
multiSelect?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BestRouteResponse } from 'rango-sdk';
|
|
2
1
|
import React, { Fragment, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { Spacer } from '../../components';
|
|
3
3
|
import { Alert } from '../../components/Alert';
|
|
4
4
|
import { Button } from '../../components/Button';
|
|
5
5
|
import { RetryIcon, GasIcon } from '../../components/Icon';
|
|
@@ -7,6 +7,7 @@ import { SecondaryPage } from '../../components/SecondaryPage/';
|
|
|
7
7
|
import { StepDetail } from '../../components/StepDetail';
|
|
8
8
|
import { Typography } from '../../components/Typography';
|
|
9
9
|
import { styled } from '../../theme';
|
|
10
|
+
import { BestRouteWithFee } from '../../types/swaps';
|
|
10
11
|
|
|
11
12
|
const MainContainer = styled('div', {
|
|
12
13
|
overflow: 'hidden',
|
|
@@ -77,9 +78,8 @@ const BestRouteContainer = styled('div', {
|
|
|
77
78
|
});
|
|
78
79
|
|
|
79
80
|
const Alerts = styled('div', { paddingBottom: '$16' });
|
|
80
|
-
|
|
81
81
|
export interface PropTypes {
|
|
82
|
-
bestRoute:
|
|
82
|
+
bestRoute: BestRouteWithFee | null;
|
|
83
83
|
onRefresh?: React.MouseEventHandler<SVGElement>;
|
|
84
84
|
confirmButtonTitle: string;
|
|
85
85
|
confirmButtonDisabled: boolean;
|
|
@@ -130,15 +130,20 @@ export function ConfirmSwap(props: PropsWithChildren<PropTypes>) {
|
|
|
130
130
|
{extraMessages || null}
|
|
131
131
|
<Alerts>
|
|
132
132
|
{errors?.map((error, index) => (
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
<>
|
|
134
|
+
<Spacer direction="vertical" />
|
|
135
|
+
<Alert type="error" key={index}>
|
|
136
|
+
{error}
|
|
137
|
+
</Alert>
|
|
138
|
+
</>
|
|
136
139
|
))}
|
|
137
|
-
{/* {error && warnings && <Spacer direction="vertical" size={16} />} */}
|
|
138
140
|
{warnings?.map((warning, index) => (
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
<>
|
|
142
|
+
<Spacer direction="vertical" />
|
|
143
|
+
<Alert type="warning" key={index}>
|
|
144
|
+
{warning}
|
|
145
|
+
</Alert>
|
|
146
|
+
</>
|
|
142
147
|
))}
|
|
143
148
|
</Alerts>
|
|
144
149
|
</div>
|
|
@@ -168,8 +173,7 @@ export function ConfirmSwap(props: PropsWithChildren<PropTypes>) {
|
|
|
168
173
|
<Fee>
|
|
169
174
|
<GasIcon />
|
|
170
175
|
<Typography ml={4} variant="caption">
|
|
171
|
-
{
|
|
172
|
-
fee
|
|
176
|
+
${swap.feeInUsd} estimated gas fee
|
|
173
177
|
</Typography>
|
|
174
178
|
</Fee>
|
|
175
179
|
</div>
|
|
@@ -22,7 +22,7 @@ const ConfirmButton = styled(Button, {
|
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
export interface PropTypes {
|
|
25
|
-
swap: BestRouteResponse;
|
|
25
|
+
swap: BestRouteResponse | null;
|
|
26
26
|
fromAmount: string;
|
|
27
27
|
toAmount: string;
|
|
28
28
|
onBack: () => void;
|
|
@@ -51,8 +51,8 @@ export function ConfirmWallets(props: PropsWithChildren<PropTypes>) {
|
|
|
51
51
|
toAmount,
|
|
52
52
|
} = props;
|
|
53
53
|
|
|
54
|
-
const firstStep = swap
|
|
55
|
-
const lastStep = swap
|
|
54
|
+
const firstStep = swap?.result?.swaps[0];
|
|
55
|
+
const lastStep = swap?.result?.swaps[swap.result?.swaps.length - 1];
|
|
56
56
|
|
|
57
57
|
return (
|
|
58
58
|
<SecondaryPage
|
package/src/types/index.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BestRouteResponse,
|
|
3
3
|
BlockchainValidationStatus,
|
|
4
|
+
SimulationResult,
|
|
5
|
+
SwapResult,
|
|
4
6
|
WalletRequiredAssets,
|
|
5
7
|
} from 'rango-sdk';
|
|
6
8
|
export type SwapStatus = 'running' | 'failed' | 'success';
|
|
@@ -34,3 +36,9 @@ export type SwapSavedSettings = {
|
|
|
34
36
|
export type SimulationAssetAndAmount = WalletRequiredAssets;
|
|
35
37
|
export type SimulationValidationStatus = BlockchainValidationStatus;
|
|
36
38
|
export type BestRouteType = BestRouteResponse;
|
|
39
|
+
|
|
40
|
+
export type BestRouteWithFee = Omit<BestRouteResponse, 'result'> & {
|
|
41
|
+
result: Omit<SimulationResult, 'swaps'> & {
|
|
42
|
+
swaps: (SwapResult & { feeInUsd?: string })[];
|
|
43
|
+
};
|
|
44
|
+
};
|