@rango-dev/ui 0.1.10-next.92 → 0.1.11-next.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.
- package/README.md +1 -181
- package/dist/components/Alert/LoadingFailedAlert.d.ts +2 -0
- package/dist/components/Alert/NotFoundAlert.d.ts +7 -0
- package/dist/components/Alert/index.d.ts +1 -0
- package/dist/components/BlockchainSelector/BlockchainSelector.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Divider/Divider.d.ts +6 -0
- package/dist/components/Divider/index.d.ts +1 -0
- package/dist/components/Header/Header.d.ts +9 -0
- package/dist/components/Header/index.d.ts +1 -0
- package/dist/components/Icon/ArrowRightIcon.d.ts +3 -0
- package/dist/components/Icon/index.d.ts +1 -0
- package/dist/components/Icon/types.d.ts +1 -0
- package/dist/components/LiquiditySourceList/LiquiditySourceList.d.ts +3 -1
- package/dist/components/LiquiditySourcesSelector/LiquiditySourcesSelector.d.ts +2 -1
- package/dist/components/Modal/Modal.d.ts +0 -1
- package/dist/components/SelectableWalletList/mock.d.ts +1 -1
- package/dist/components/Settings/Settings.d.ts +2 -1
- package/dist/components/StepDetail/StepDetail.d.ts +3 -1
- package/dist/components/SwapContainer/SwapContainer.d.ts +1 -0
- package/dist/components/SwapDetail/Token.d.ts +17 -0
- package/dist/components/TextField/TextField.d.ts +1 -1
- package/dist/components/TokenList/TokenList.d.ts +2 -2
- package/dist/components/TokenSelector/TokenSelector.d.ts +4 -3
- package/dist/components/Typography/Typography.d.ts +1 -1
- package/dist/components/common/Image.d.ts +6 -0
- package/dist/components/common/index.d.ts +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/containers/ConfirmSwap/ConfirmSwap.d.ts +14 -19
- package/dist/containers/ConfirmSwap/ConfirmSwap.stories.d.ts +1 -0
- package/dist/containers/ConfirmSwap/mock.d.ts +3 -0
- package/dist/containers/History/History.d.ts +5 -7
- package/dist/containers/History/SwapsGroup.d.ts +13 -0
- package/dist/containers/History/index.d.ts +1 -0
- package/dist/containers/History/types.d.ts +3 -24
- package/dist/containers/SwapHistory/SwapHistory.d.ts +16 -3
- package/dist/containers/SwapHistory/SwapMessages.d.ts +17 -0
- package/dist/containers/index.d.ts +0 -1
- package/dist/helper/index.d.ts +3 -1
- package/dist/types/meta.d.ts +1 -0
- package/dist/ui.cjs.development.js +1137 -837
- 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 +1134 -839
- package/dist/ui.esm.js.map +1 -1
- package/package.json +3 -2
- package/src/components/Alert/Alert.tsx +33 -12
- package/src/components/Alert/LoadingFailedAlert.tsx +11 -0
- package/src/components/Alert/NotFoundAlert.tsx +19 -0
- package/src/components/Alert/index.ts +1 -0
- package/src/components/BestRoute/BestRoute.tsx +2 -5
- package/src/components/BestRoute/mock.ts +10 -0
- package/src/components/BlockchainSelector/BlockchainSelector.tsx +31 -34
- package/src/components/BlockchainsList/BlockchainsList.tsx +8 -6
- package/src/components/Button/Button.tsx +2 -1
- package/src/components/ConnectWalletsModal/mockData.ts +16 -0
- package/src/components/Divider/Divider.tsx +41 -0
- package/src/components/Divider/index.ts +1 -0
- package/src/components/Drawer/Drawer.tsx +1 -1
- package/src/components/Header/Header.tsx +39 -0
- package/src/components/Header/index.ts +1 -0
- package/src/components/Icon/ArrowRightIcon.tsx +31 -0
- package/src/components/Icon/common.ts +10 -0
- package/src/components/Icon/index.ts +1 -0
- package/src/components/Icon/types.tsx +1 -0
- package/src/components/LiquiditySourceList/LiquiditySourceList.tsx +81 -27
- package/src/components/LiquiditySourcesSelector/LiquiditySourcesSelector.tsx +15 -10
- package/src/components/Modal/Modal.tsx +1 -6
- package/src/components/SecondaryPage/SecondaryPage.tsx +26 -52
- package/src/components/SelectableWalletList/SelectableWalletList.tsx +7 -1
- package/src/components/SelectableWalletList/mock.ts +4 -3
- package/src/components/Settings/Settings.tsx +34 -14
- package/src/components/StatusDrawer/StatusDrawer.tsx +1 -0
- package/src/components/StepDetail/StepDetail.tsx +46 -12
- package/src/components/SwapContainer/SwapContainer.tsx +21 -17
- package/src/components/SwapDetail/SwapDetail.tsx +71 -117
- package/src/components/SwapDetail/Token.tsx +73 -0
- package/src/components/SwapDetail/mock.ts +1 -0
- package/src/components/TextField/TextField.tsx +9 -0
- package/src/components/TokenList/TokenItem.tsx +12 -6
- package/src/components/TokenList/TokenList.tsx +18 -21
- package/src/components/TokenSelector/TokenSelector.tsx +38 -25
- package/src/components/Typography/Typography.tsx +8 -0
- package/src/components/Wallet/Wallet.tsx +9 -6
- package/src/components/common/Image.tsx +27 -0
- package/src/components/common/index.ts +1 -0
- package/src/components/index.ts +2 -0
- package/src/containers/ConfirmSwap/ConfirmSwap.stories.tsx +11 -2
- package/src/containers/ConfirmSwap/ConfirmSwap.tsx +111 -125
- package/src/containers/ConfirmSwap/mock.ts +79 -2
- package/src/containers/History/History.tsx +33 -57
- package/src/containers/History/SwapsGroup.tsx +59 -0
- package/src/containers/History/index.ts +1 -0
- package/src/containers/History/mock.ts +1 -0
- package/src/containers/History/types.tsx +2 -30
- package/src/containers/SwapHistory/SwapHistory.tsx +306 -177
- package/src/containers/SwapHistory/SwapMessages.tsx +116 -0
- package/src/containers/SwapHistory/mock.ts +1 -0
- package/src/containers/index.ts +0 -1
- package/src/helper/index.ts +31 -2
- package/src/types/meta.ts +2 -0
- package/dist/containers/ConfirmWallets/ConfirmWallets.d.ts +0 -16
- package/dist/containers/ConfirmWallets/ConfirmWallets.stories.d.ts +0 -6
- package/dist/containers/ConfirmWallets/index.d.ts +0 -1
- package/dist/containers/ConfirmWallets/mock.d.ts +0 -5
- package/dist/helper/swaps.d.ts +0 -5
- package/src/containers/ConfirmWallets/ConfirmWallets.stories.tsx +0 -26
- package/src/containers/ConfirmWallets/ConfirmWallets.tsx +0 -143
- package/src/containers/ConfirmWallets/index.ts +0 -1
- package/src/containers/ConfirmWallets/mock.ts +0 -222
- package/src/helper/swaps.ts +0 -23
|
@@ -7,14 +7,14 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var React__default = _interopDefault(React);
|
|
9
9
|
var RadixTooltip = require('@radix-ui/react-tooltip');
|
|
10
|
+
var reactWindow = require('react-window');
|
|
11
|
+
var InfiniteLoader = _interopDefault(require('react-window-infinite-loader'));
|
|
12
|
+
var AutoSizer = _interopDefault(require('react-virtualized-auto-sizer'));
|
|
10
13
|
var RadixCheckbox = require('@radix-ui/react-checkbox');
|
|
11
14
|
var reactDom = require('react-dom');
|
|
12
15
|
var walletsShared = require('@rango-dev/wallets-shared');
|
|
13
16
|
var RadixSwitch = require('@radix-ui/react-switch');
|
|
14
17
|
var RadioGroup = require('@radix-ui/react-radio-group');
|
|
15
|
-
var reactWindow = require('react-window');
|
|
16
|
-
var InfiniteLoader = _interopDefault(require('react-window-infinite-loader'));
|
|
17
|
-
var AutoSizer = _interopDefault(require('react-virtualized-auto-sizer'));
|
|
18
18
|
var reactColor = require('react-color');
|
|
19
19
|
|
|
20
20
|
function _extends() {
|
|
@@ -225,6 +225,11 @@ var SvgWithStrokeColor = /*#__PURE__*/styled('svg', {
|
|
|
225
225
|
}, _white["." + darkTheme + " &"] = {
|
|
226
226
|
$$color: '$colors$foreground'
|
|
227
227
|
}, _white.stroke = '$$color', _white)
|
|
228
|
+
},
|
|
229
|
+
disabled: {
|
|
230
|
+
"true": {
|
|
231
|
+
stroke: '$neutrals400'
|
|
232
|
+
}
|
|
228
233
|
}
|
|
229
234
|
}
|
|
230
235
|
});
|
|
@@ -254,6 +259,11 @@ var SvgWithFillColor = /*#__PURE__*/styled('svg', {
|
|
|
254
259
|
}, _white2["." + darkTheme + " &"] = {
|
|
255
260
|
$$color: '$colors$foreground'
|
|
256
261
|
}, _white2.fill = '$$color', _white2)
|
|
262
|
+
},
|
|
263
|
+
disabled: {
|
|
264
|
+
"true": {
|
|
265
|
+
stroke: '$neutrals400'
|
|
266
|
+
}
|
|
257
267
|
}
|
|
258
268
|
}
|
|
259
269
|
});
|
|
@@ -871,11 +881,42 @@ ChevronRightIcon.toString = function () {
|
|
|
871
881
|
};
|
|
872
882
|
|
|
873
883
|
var _excluded$m = ["size", "color"];
|
|
874
|
-
var
|
|
884
|
+
var ArrowRightIcon = function ArrowRightIcon(_ref) {
|
|
875
885
|
var _ref$size = _ref.size,
|
|
876
886
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
877
887
|
color = _ref.color,
|
|
878
888
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$m);
|
|
889
|
+
return React.createElement(SvgWithStrokeColor, Object.assign({
|
|
890
|
+
width: size,
|
|
891
|
+
height: size,
|
|
892
|
+
viewBox: "0 0 24 24",
|
|
893
|
+
color: color,
|
|
894
|
+
fill: "none",
|
|
895
|
+
stroke: "currentColor",
|
|
896
|
+
"stroke-width": "2",
|
|
897
|
+
"stroke-linecap": "round",
|
|
898
|
+
"stroke-linejoin": "round",
|
|
899
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
900
|
+
className: "_icon"
|
|
901
|
+
}, props), React.createElement("line", {
|
|
902
|
+
x1: "5",
|
|
903
|
+
y1: "12",
|
|
904
|
+
x2: "19",
|
|
905
|
+
y2: "12"
|
|
906
|
+
}), React.createElement("polyline", {
|
|
907
|
+
points: "12 5 19 12 12 19"
|
|
908
|
+
}));
|
|
909
|
+
};
|
|
910
|
+
ArrowRightIcon.toString = function () {
|
|
911
|
+
return '._icon';
|
|
912
|
+
};
|
|
913
|
+
|
|
914
|
+
var _excluded$n = ["size", "color"];
|
|
915
|
+
var RetryRightIcon = function RetryRightIcon(_ref) {
|
|
916
|
+
var _ref$size = _ref.size,
|
|
917
|
+
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
918
|
+
color = _ref.color,
|
|
919
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$n);
|
|
879
920
|
return React.createElement(SvgWithStrokeColor, Object.assign({
|
|
880
921
|
width: size,
|
|
881
922
|
height: size,
|
|
@@ -895,12 +936,12 @@ RetryRightIcon.toString = function () {
|
|
|
895
936
|
return '._icon';
|
|
896
937
|
};
|
|
897
938
|
|
|
898
|
-
var _excluded$
|
|
939
|
+
var _excluded$o = ["size", "color"];
|
|
899
940
|
var RetryLeftIcon = function RetryLeftIcon(_ref) {
|
|
900
941
|
var _ref$size = _ref.size,
|
|
901
942
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
902
943
|
color = _ref.color,
|
|
903
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
944
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$o);
|
|
904
945
|
return React.createElement(SvgWithStrokeColor, Object.assign({
|
|
905
946
|
width: size,
|
|
906
947
|
height: size,
|
|
@@ -920,12 +961,12 @@ RetryLeftIcon.toString = function () {
|
|
|
920
961
|
return '._icon';
|
|
921
962
|
};
|
|
922
963
|
|
|
923
|
-
var _excluded$
|
|
964
|
+
var _excluded$p = ["size", "color"];
|
|
924
965
|
var TryAgainIcon = function TryAgainIcon(_ref) {
|
|
925
966
|
var _ref$size = _ref.size,
|
|
926
967
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
927
968
|
color = _ref.color,
|
|
928
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
969
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$p);
|
|
929
970
|
return React.createElement(SvgWithStrokeColor, Object.assign({
|
|
930
971
|
width: size,
|
|
931
972
|
height: size,
|
|
@@ -945,12 +986,12 @@ TryAgainIcon.toString = function () {
|
|
|
945
986
|
return '._icon';
|
|
946
987
|
};
|
|
947
988
|
|
|
948
|
-
var _excluded$
|
|
989
|
+
var _excluded$q = ["size", "color"];
|
|
949
990
|
var VerticalSwapIcon = function VerticalSwapIcon(_ref) {
|
|
950
991
|
var _ref$size = _ref.size,
|
|
951
992
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
952
993
|
color = _ref.color,
|
|
953
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
994
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
|
|
954
995
|
return React.createElement(SvgWithStrokeColor, Object.assign({
|
|
955
996
|
width: size,
|
|
956
997
|
height: size,
|
|
@@ -976,12 +1017,12 @@ VerticalSwapIcon.toString = function () {
|
|
|
976
1017
|
return '._icon';
|
|
977
1018
|
};
|
|
978
1019
|
|
|
979
|
-
var _excluded$
|
|
1020
|
+
var _excluded$r = ["size", "color"];
|
|
980
1021
|
var HorizontalSwapIcon = function HorizontalSwapIcon(_ref) {
|
|
981
1022
|
var _ref$size = _ref.size,
|
|
982
1023
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
983
1024
|
color = _ref.color,
|
|
984
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1025
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$r);
|
|
985
1026
|
return React.createElement(SvgWithStrokeColor, Object.assign({
|
|
986
1027
|
width: size,
|
|
987
1028
|
height: size,
|
|
@@ -1007,13 +1048,13 @@ HorizontalSwapIcon.toString = function () {
|
|
|
1007
1048
|
return '._icon';
|
|
1008
1049
|
};
|
|
1009
1050
|
|
|
1010
|
-
var _excluded$
|
|
1051
|
+
var _excluded$s = ["color", "size"];
|
|
1011
1052
|
var RetryIcon = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
|
|
1012
1053
|
var _ref$color = _ref.color,
|
|
1013
1054
|
color = _ref$color === void 0 ? 'black' : _ref$color,
|
|
1014
1055
|
_ref$size = _ref.size,
|
|
1015
1056
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1016
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1057
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
|
1017
1058
|
return React.createElement(SvgWithStrokeColor, Object.assign({
|
|
1018
1059
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1019
1060
|
width: size,
|
|
@@ -1038,12 +1079,12 @@ RetryIcon.toString = function () {
|
|
|
1038
1079
|
return '._icon';
|
|
1039
1080
|
};
|
|
1040
1081
|
|
|
1041
|
-
var _excluded$
|
|
1082
|
+
var _excluded$t = ["size", "color"];
|
|
1042
1083
|
var WalletIcon = function WalletIcon(_ref) {
|
|
1043
1084
|
var _ref$size = _ref.size,
|
|
1044
1085
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1045
1086
|
color = _ref.color,
|
|
1046
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1087
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$t);
|
|
1047
1088
|
return React.createElement(SvgWithFillColor, Object.assign({
|
|
1048
1089
|
width: size,
|
|
1049
1090
|
height: size,
|
|
@@ -1070,12 +1111,12 @@ WalletIcon.toString = function () {
|
|
|
1070
1111
|
return '._icon';
|
|
1071
1112
|
};
|
|
1072
1113
|
|
|
1073
|
-
var _excluded$
|
|
1114
|
+
var _excluded$u = ["size", "color"];
|
|
1074
1115
|
var AddWalletIcon = function AddWalletIcon(_ref) {
|
|
1075
1116
|
var _ref$size = _ref.size,
|
|
1076
1117
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1077
1118
|
color = _ref.color,
|
|
1078
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1119
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$u);
|
|
1079
1120
|
return React.createElement(SvgWithFillColor, Object.assign({
|
|
1080
1121
|
width: size,
|
|
1081
1122
|
height: size,
|
|
@@ -1110,12 +1151,12 @@ AddWalletIcon.toString = function () {
|
|
|
1110
1151
|
return '._icon';
|
|
1111
1152
|
};
|
|
1112
1153
|
|
|
1113
|
-
var _excluded$
|
|
1154
|
+
var _excluded$v = ["size", "color"];
|
|
1114
1155
|
var DeleteWalletIcon = function DeleteWalletIcon(_ref) {
|
|
1115
1156
|
var _ref$size = _ref.size,
|
|
1116
1157
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1117
1158
|
color = _ref.color,
|
|
1118
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1159
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$v);
|
|
1119
1160
|
return React.createElement(SvgWithFillColor, Object.assign({
|
|
1120
1161
|
width: size,
|
|
1121
1162
|
height: size,
|
|
@@ -1150,12 +1191,12 @@ DeleteWalletIcon.toString = function () {
|
|
|
1150
1191
|
return '._icon';
|
|
1151
1192
|
};
|
|
1152
1193
|
|
|
1153
|
-
var _excluded$
|
|
1194
|
+
var _excluded$w = ["size", "color"];
|
|
1154
1195
|
var CheckWalletIcon = function CheckWalletIcon(_ref) {
|
|
1155
1196
|
var _ref$size = _ref.size,
|
|
1156
1197
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1157
1198
|
color = _ref.color,
|
|
1158
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1199
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$w);
|
|
1159
1200
|
return React.createElement(SvgWithFillColor, Object.assign({
|
|
1160
1201
|
width: size,
|
|
1161
1202
|
height: size,
|
|
@@ -1186,12 +1227,12 @@ CheckWalletIcon.toString = function () {
|
|
|
1186
1227
|
return '._icon';
|
|
1187
1228
|
};
|
|
1188
1229
|
|
|
1189
|
-
var _excluded$
|
|
1230
|
+
var _excluded$x = ["size", "color"];
|
|
1190
1231
|
var SwapWalletIcon = function SwapWalletIcon(_ref) {
|
|
1191
1232
|
var _ref$size = _ref.size,
|
|
1192
1233
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1193
1234
|
color = _ref.color,
|
|
1194
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1235
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$x);
|
|
1195
1236
|
return React.createElement(SvgWithFillColor, Object.assign({
|
|
1196
1237
|
width: size,
|
|
1197
1238
|
height: size,
|
|
@@ -1226,13 +1267,13 @@ SwapWalletIcon.toString = function () {
|
|
|
1226
1267
|
return '._icon';
|
|
1227
1268
|
};
|
|
1228
1269
|
|
|
1229
|
-
var _excluded$
|
|
1270
|
+
var _excluded$y = ["color", "size"];
|
|
1230
1271
|
var DisconnectIcon = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
|
|
1231
1272
|
var _ref$color = _ref.color,
|
|
1232
1273
|
color = _ref$color === void 0 ? 'black' : _ref$color,
|
|
1233
1274
|
_ref$size = _ref.size,
|
|
1234
1275
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1235
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1276
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$y);
|
|
1236
1277
|
return React.createElement(SvgWithStrokeColor, Object.assign({
|
|
1237
1278
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1238
1279
|
width: size,
|
|
@@ -1262,12 +1303,12 @@ DisconnectIcon.toString = function () {
|
|
|
1262
1303
|
return '._icon';
|
|
1263
1304
|
};
|
|
1264
1305
|
|
|
1265
|
-
var _excluded$
|
|
1306
|
+
var _excluded$z = ["size", "color"];
|
|
1266
1307
|
var BagIcon = function BagIcon(_ref) {
|
|
1267
1308
|
var _ref$size = _ref.size,
|
|
1268
1309
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1269
1310
|
color = _ref.color,
|
|
1270
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1311
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$z);
|
|
1271
1312
|
return React.createElement(SvgWithStrokeColor, Object.assign({
|
|
1272
1313
|
width: size,
|
|
1273
1314
|
height: size,
|
|
@@ -1297,11 +1338,11 @@ BagIcon.toString = function () {
|
|
|
1297
1338
|
return '._icon';
|
|
1298
1339
|
};
|
|
1299
1340
|
|
|
1300
|
-
var _excluded$
|
|
1341
|
+
var _excluded$A = ["size"];
|
|
1301
1342
|
var TimeIcon = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
|
|
1302
1343
|
var _ref$size = _ref.size,
|
|
1303
1344
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1304
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1345
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$A);
|
|
1305
1346
|
return React.createElement(SvgWithStrokeColor, Object.assign({
|
|
1306
1347
|
width: size,
|
|
1307
1348
|
height: size,
|
|
@@ -1334,12 +1375,12 @@ CloseIcon.toString = function () {
|
|
|
1334
1375
|
return '._icon';
|
|
1335
1376
|
};
|
|
1336
1377
|
|
|
1337
|
-
var _excluded$
|
|
1378
|
+
var _excluded$B = ["size", "color"];
|
|
1338
1379
|
var SignatureIcon = function SignatureIcon(_ref) {
|
|
1339
1380
|
var _ref$size = _ref.size,
|
|
1340
1381
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1341
1382
|
color = _ref.color,
|
|
1342
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1383
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$B);
|
|
1343
1384
|
return React.createElement(SvgWithFillColor, Object.assign({
|
|
1344
1385
|
width: size,
|
|
1345
1386
|
height: size,
|
|
@@ -1360,12 +1401,12 @@ SignatureIcon.toString = function () {
|
|
|
1360
1401
|
return '._icon';
|
|
1361
1402
|
};
|
|
1362
1403
|
|
|
1363
|
-
var _excluded$
|
|
1404
|
+
var _excluded$C = ["size", "color"];
|
|
1364
1405
|
var CopyIcon = function CopyIcon(_ref) {
|
|
1365
1406
|
var _ref$size = _ref.size,
|
|
1366
1407
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1367
1408
|
color = _ref.color,
|
|
1368
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1409
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$C);
|
|
1369
1410
|
return React.createElement(SvgWithFillColor, Object.assign({
|
|
1370
1411
|
width: size,
|
|
1371
1412
|
height: size,
|
|
@@ -1391,7 +1432,7 @@ CopyIcon.toString = function () {
|
|
|
1391
1432
|
return '._icon';
|
|
1392
1433
|
};
|
|
1393
1434
|
|
|
1394
|
-
var _excluded$
|
|
1435
|
+
var _excluded$D = ["children", "className", "color"];
|
|
1395
1436
|
var TypographyContainer = /*#__PURE__*/styled('span', {
|
|
1396
1437
|
margin: 0,
|
|
1397
1438
|
display: 'inline-block',
|
|
@@ -1451,6 +1492,13 @@ var TypographyContainer = /*#__PURE__*/styled('span', {
|
|
|
1451
1492
|
fontSize: '$18'
|
|
1452
1493
|
}
|
|
1453
1494
|
},
|
|
1495
|
+
title: {
|
|
1496
|
+
fontSize: '$14',
|
|
1497
|
+
fontWeight: '$500',
|
|
1498
|
+
'@md': {
|
|
1499
|
+
fontSize: '$15'
|
|
1500
|
+
}
|
|
1501
|
+
},
|
|
1454
1502
|
body1: {
|
|
1455
1503
|
fontSize: '$14',
|
|
1456
1504
|
fontWeight: '$400',
|
|
@@ -1558,7 +1606,7 @@ function Typography(_ref) {
|
|
|
1558
1606
|
var children = _ref.children,
|
|
1559
1607
|
className = _ref.className,
|
|
1560
1608
|
color = _ref.color,
|
|
1561
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1609
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$D);
|
|
1562
1610
|
var customCss = color ? {
|
|
1563
1611
|
color: color.startsWith('$') ? color : "$" + color
|
|
1564
1612
|
} : {
|
|
@@ -1618,6 +1666,14 @@ var StepContainer = /*#__PURE__*/styled('div', {
|
|
|
1618
1666
|
textAlign: 'center',
|
|
1619
1667
|
justifyContent: 'center'
|
|
1620
1668
|
}
|
|
1669
|
+
},
|
|
1670
|
+
success: {
|
|
1671
|
+
"true": {
|
|
1672
|
+
filter: 'none'
|
|
1673
|
+
},
|
|
1674
|
+
"false": {
|
|
1675
|
+
filter: 'grayscale(100%)'
|
|
1676
|
+
}
|
|
1621
1677
|
}
|
|
1622
1678
|
}
|
|
1623
1679
|
});
|
|
@@ -1637,18 +1693,24 @@ var Detail = /*#__PURE__*/styled('div', {
|
|
|
1637
1693
|
}
|
|
1638
1694
|
});
|
|
1639
1695
|
var SubTitle = /*#__PURE__*/styled(Typography, {
|
|
1640
|
-
color: '$neutrals600'
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1696
|
+
color: '$neutrals600',
|
|
1697
|
+
display: 'block',
|
|
1698
|
+
paddingLeft: '$8'
|
|
1699
|
+
});
|
|
1700
|
+
function StepDetail(props) {
|
|
1701
|
+
var logo = props.logo,
|
|
1702
|
+
chainLogo = props.chainLogo,
|
|
1703
|
+
amount = props.amount,
|
|
1704
|
+
symbol = props.symbol,
|
|
1705
|
+
blockchain = props.blockchain,
|
|
1706
|
+
estimatedAmount = props.estimatedAmount,
|
|
1707
|
+
_props$success = props.success,
|
|
1708
|
+
success = _props$success === void 0 ? true : _props$success,
|
|
1709
|
+
_props$direction = props.direction,
|
|
1710
|
+
direction = _props$direction === void 0 ? 'horizontal' : _props$direction;
|
|
1650
1711
|
return React__default.createElement(StepContainer, {
|
|
1651
|
-
direction: direction
|
|
1712
|
+
direction: direction,
|
|
1713
|
+
success: success
|
|
1652
1714
|
}, React__default.createElement(StepLogoContainer, {
|
|
1653
1715
|
direction: direction
|
|
1654
1716
|
}, React__default.createElement(Logo, {
|
|
@@ -1659,13 +1721,20 @@ function StepDetail(_ref) {
|
|
|
1659
1721
|
alt: blockchain
|
|
1660
1722
|
}))), React__default.createElement(Detail, {
|
|
1661
1723
|
pl: direction === 'horizontal'
|
|
1662
|
-
}, React__default.createElement(Typography, {
|
|
1724
|
+
}, amount && React__default.createElement(Typography, {
|
|
1663
1725
|
noWrap: true,
|
|
1664
|
-
variant: direction === 'vertical' ? 'body2' : '
|
|
1665
|
-
}, amount
|
|
1726
|
+
variant: direction === 'vertical' ? 'body2' : 'title'
|
|
1727
|
+
}, amount), !amount && estimatedAmount && React__default.createElement(Typography, {
|
|
1728
|
+
noWrap: true,
|
|
1729
|
+
variant: direction === 'vertical' ? 'body2' : 'title',
|
|
1730
|
+
color: '$neutrals600'
|
|
1731
|
+
}, estimatedAmount), "\xA0", React__default.createElement(Typography, {
|
|
1732
|
+
variant: direction === 'vertical' ? 'body2' : 'title',
|
|
1733
|
+
noWrap: true
|
|
1734
|
+
}, symbol), React__default.createElement(SubTitle, {
|
|
1666
1735
|
noWrap: true,
|
|
1667
1736
|
variant: "caption",
|
|
1668
|
-
color: "neutrals800"
|
|
1737
|
+
color: "$neutrals800"
|
|
1669
1738
|
}, "on ", blockchain)));
|
|
1670
1739
|
}
|
|
1671
1740
|
|
|
@@ -1887,6 +1956,37 @@ function Tooltip(_ref) {
|
|
|
1887
1956
|
})))));
|
|
1888
1957
|
}
|
|
1889
1958
|
|
|
1959
|
+
var FilledCircle = /*#__PURE__*/styled('span', {
|
|
1960
|
+
width: '10px',
|
|
1961
|
+
height: '10px',
|
|
1962
|
+
backgroundColor: '$primary',
|
|
1963
|
+
borderRadius: '99999px'
|
|
1964
|
+
});
|
|
1965
|
+
|
|
1966
|
+
var _excluded$E = ["size"];
|
|
1967
|
+
var ImageContainer = /*#__PURE__*/styled('div', {
|
|
1968
|
+
display: 'flex',
|
|
1969
|
+
justifyContent: 'center',
|
|
1970
|
+
alignItems: 'center',
|
|
1971
|
+
'.image': {
|
|
1972
|
+
width: '100%',
|
|
1973
|
+
height: '100%',
|
|
1974
|
+
objectFit: 'contain'
|
|
1975
|
+
}
|
|
1976
|
+
});
|
|
1977
|
+
function Image(props) {
|
|
1978
|
+
var size = props.size,
|
|
1979
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$E);
|
|
1980
|
+
return React__default.createElement(ImageContainer, {
|
|
1981
|
+
css: {
|
|
1982
|
+
width: size + 'px',
|
|
1983
|
+
height: size + 'px'
|
|
1984
|
+
}
|
|
1985
|
+
}, React__default.createElement("img", Object.assign({
|
|
1986
|
+
className: "image"
|
|
1987
|
+
}, otherProps)));
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1890
1990
|
var Container = /*#__PURE__*/styled('div', {
|
|
1891
1991
|
borderRadius: '$5',
|
|
1892
1992
|
border: '1px solid $neutrals300',
|
|
@@ -1924,10 +2024,6 @@ var HR = /*#__PURE__*/styled('hr', {
|
|
|
1924
2024
|
border: '1px solid $neutrals400',
|
|
1925
2025
|
margin: '$8 0'
|
|
1926
2026
|
});
|
|
1927
|
-
var SwapperLogo = /*#__PURE__*/styled('img', {
|
|
1928
|
-
width: '$16',
|
|
1929
|
-
height: '$16'
|
|
1930
|
-
});
|
|
1931
2027
|
var RelativeContainer = /*#__PURE__*/styled('div', {
|
|
1932
2028
|
position: 'relative'
|
|
1933
2029
|
});
|
|
@@ -2059,9 +2155,10 @@ function BestRoute(props) {
|
|
|
2059
2155
|
chainLogo: swap.from.blockchainLogo,
|
|
2060
2156
|
blockchain: swap.from.blockchain,
|
|
2061
2157
|
amount: swap.fromAmount
|
|
2062
|
-
}), React__default.createElement(Dot, null)), React__default.createElement(SwapperContainer, null, React__default.createElement(Line, null), React__default.createElement(
|
|
2158
|
+
}), React__default.createElement(Dot, null)), React__default.createElement(SwapperContainer, null, React__default.createElement(Line, null), React__default.createElement(Image, {
|
|
2063
2159
|
src: swap.swapperLogo,
|
|
2064
|
-
alt: swap.swapperId
|
|
2160
|
+
alt: swap.swapperId,
|
|
2161
|
+
size: 20
|
|
2065
2162
|
}), React__default.createElement(Line, null)), index + 1 === ((_data$result2 = data.result) == null ? void 0 : _data$result2.swaps.length) && React__default.createElement(ArrowRight, null), React__default.createElement(StepDetail, {
|
|
2066
2163
|
direction: "vertical",
|
|
2067
2164
|
logo: swap.to.logo,
|
|
@@ -2075,7 +2172,7 @@ function BestRoute(props) {
|
|
|
2075
2172
|
}, "No routes found")));
|
|
2076
2173
|
}
|
|
2077
2174
|
|
|
2078
|
-
var _excluded$
|
|
2175
|
+
var _excluded$F = ["children", "loading", "disabled", "prefix", "suffix", "align", "flexContent"];
|
|
2079
2176
|
var _ghost, _css, _css2, _css3;
|
|
2080
2177
|
var ButtonContainer = /*#__PURE__*/styled('button', {
|
|
2081
2178
|
borderRadius: '$5',
|
|
@@ -2104,6 +2201,7 @@ var ButtonContainer = /*#__PURE__*/styled('button', {
|
|
|
2104
2201
|
},
|
|
2105
2202
|
size: {
|
|
2106
2203
|
compact: {},
|
|
2204
|
+
free: {},
|
|
2107
2205
|
small: {
|
|
2108
2206
|
height: '$32'
|
|
2109
2207
|
},
|
|
@@ -2419,7 +2517,7 @@ function Button(_ref) {
|
|
|
2419
2517
|
suffix = _ref.suffix,
|
|
2420
2518
|
align = _ref.align,
|
|
2421
2519
|
flexContent = _ref.flexContent,
|
|
2422
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
2520
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$F);
|
|
2423
2521
|
var isDisabled = loading || disabled;
|
|
2424
2522
|
return React__default.createElement(ButtonContainer, Object.assign({
|
|
2425
2523
|
disabled: isDisabled
|
|
@@ -2437,13 +2535,6 @@ function Button(_ref) {
|
|
|
2437
2535
|
}), suffix);
|
|
2438
2536
|
}
|
|
2439
2537
|
|
|
2440
|
-
var FilledCircle = /*#__PURE__*/styled('span', {
|
|
2441
|
-
width: '10px',
|
|
2442
|
-
height: '10px',
|
|
2443
|
-
backgroundColor: '$primary',
|
|
2444
|
-
borderRadius: '99999px'
|
|
2445
|
-
});
|
|
2446
|
-
|
|
2447
2538
|
var ListContainer = /*#__PURE__*/styled('div', {
|
|
2448
2539
|
display: 'grid',
|
|
2449
2540
|
gap: '.5rem',
|
|
@@ -2452,10 +2543,8 @@ var ListContainer = /*#__PURE__*/styled('div', {
|
|
|
2452
2543
|
width: '100%',
|
|
2453
2544
|
height: '100%'
|
|
2454
2545
|
});
|
|
2455
|
-
var
|
|
2456
|
-
|
|
2457
|
-
maxHeight: '1.5rem',
|
|
2458
|
-
marginRight: '$4'
|
|
2546
|
+
var ImageContainer$1 = /*#__PURE__*/styled('div', {
|
|
2547
|
+
paddingRight: '$4'
|
|
2459
2548
|
});
|
|
2460
2549
|
function BlockchainsList(props) {
|
|
2461
2550
|
var list = props.list,
|
|
@@ -2482,9 +2571,10 @@ function BlockchainsList(props) {
|
|
|
2482
2571
|
type: isSelect(blockchain.name) ? 'primary' : undefined,
|
|
2483
2572
|
variant: "outlined",
|
|
2484
2573
|
size: "large",
|
|
2485
|
-
prefix: React__default.createElement(Image, {
|
|
2574
|
+
prefix: React__default.createElement(ImageContainer$1, null, React__default.createElement(Image, {
|
|
2575
|
+
size: 24,
|
|
2486
2576
|
src: blockchain.logo
|
|
2487
|
-
}),
|
|
2577
|
+
})),
|
|
2488
2578
|
suffix: isSelect(blockchain.name) ? React__default.createElement(FilledCircle, null) : undefined,
|
|
2489
2579
|
align: "start",
|
|
2490
2580
|
onClick: changeSelectedBlockchain.bind(null, blockchain),
|
|
@@ -2495,9 +2585,70 @@ function BlockchainsList(props) {
|
|
|
2495
2585
|
}));
|
|
2496
2586
|
}
|
|
2497
2587
|
|
|
2498
|
-
var
|
|
2588
|
+
var DividerContainer = /*#__PURE__*/styled('div', {
|
|
2589
|
+
variants: {
|
|
2590
|
+
size: {
|
|
2591
|
+
4: {
|
|
2592
|
+
height: '$4'
|
|
2593
|
+
},
|
|
2594
|
+
8: {
|
|
2595
|
+
height: '$8'
|
|
2596
|
+
},
|
|
2597
|
+
12: {
|
|
2598
|
+
height: '$12'
|
|
2599
|
+
},
|
|
2600
|
+
16: {
|
|
2601
|
+
height: '$16'
|
|
2602
|
+
},
|
|
2603
|
+
18: {
|
|
2604
|
+
height: '$18'
|
|
2605
|
+
},
|
|
2606
|
+
20: {
|
|
2607
|
+
height: '$20'
|
|
2608
|
+
},
|
|
2609
|
+
24: {
|
|
2610
|
+
height: '$24'
|
|
2611
|
+
},
|
|
2612
|
+
32: {
|
|
2613
|
+
height: '$32'
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
});
|
|
2618
|
+
function Divider(_ref) {
|
|
2619
|
+
var _ref$size = _ref.size,
|
|
2620
|
+
size = _ref$size === void 0 ? 12 : _ref$size;
|
|
2621
|
+
return React__default.createElement(DividerContainer, {
|
|
2622
|
+
size: size
|
|
2623
|
+
});
|
|
2624
|
+
}
|
|
2625
|
+
|
|
2626
|
+
var HeaderContainer = /*#__PURE__*/styled('div', {
|
|
2627
|
+
display: 'flex',
|
|
2628
|
+
justifyContent: 'space-between',
|
|
2629
|
+
alignItems: 'center',
|
|
2630
|
+
padding: '$8 0',
|
|
2631
|
+
position: 'relative'
|
|
2632
|
+
});
|
|
2633
|
+
var BackButton = /*#__PURE__*/styled(Button, {
|
|
2634
|
+
padding: '$8'
|
|
2635
|
+
});
|
|
2636
|
+
function Header(props) {
|
|
2637
|
+
return React__default.createElement(HeaderContainer, null, props.onBack ? React__default.createElement(BackButton, {
|
|
2638
|
+
variant: "ghost",
|
|
2639
|
+
size: "small",
|
|
2640
|
+
onClick: props.onBack
|
|
2641
|
+
}, React__default.createElement(AngleLeftIcon, {
|
|
2642
|
+
size: 24
|
|
2643
|
+
})) : null, props.prefix, React__default.createElement(Typography, {
|
|
2644
|
+
variant: "h4"
|
|
2645
|
+
}, props.title), props.suffix || React__default.createElement("div", null));
|
|
2646
|
+
}
|
|
2647
|
+
|
|
2648
|
+
var _excluded$G = ["label", "prefix", "suffix", "children", "size", "style"];
|
|
2499
2649
|
var InputContainer = /*#__PURE__*/styled('div', {
|
|
2500
2650
|
backgroundColor: '$background',
|
|
2651
|
+
padding: '1px',
|
|
2501
2652
|
boxSizing: 'border-box',
|
|
2502
2653
|
border: '1px solid $neutrals400',
|
|
2503
2654
|
borderRadius: '$5',
|
|
@@ -2507,6 +2658,7 @@ var InputContainer = /*#__PURE__*/styled('div', {
|
|
|
2507
2658
|
position: 'relative',
|
|
2508
2659
|
alignItems: 'center',
|
|
2509
2660
|
color: '$foreground',
|
|
2661
|
+
overflowX: 'hidden',
|
|
2510
2662
|
transition: 'border-color ease .3s',
|
|
2511
2663
|
'&:focus-within': {
|
|
2512
2664
|
borderColor: '$success',
|
|
@@ -2567,6 +2719,13 @@ var Input = /*#__PURE__*/styled('input', {
|
|
|
2567
2719
|
margin: 0,
|
|
2568
2720
|
'&:disabled': {
|
|
2569
2721
|
cursor: 'not-allowed'
|
|
2722
|
+
},
|
|
2723
|
+
'&::-webkit-outer-spin-button, &::-webkit-inner-spin-button': {
|
|
2724
|
+
'-webkit-appearance': 'none',
|
|
2725
|
+
margin: 0
|
|
2726
|
+
},
|
|
2727
|
+
'&[type="number"]': {
|
|
2728
|
+
'-moz-appearance': 'textfield'
|
|
2570
2729
|
}
|
|
2571
2730
|
});
|
|
2572
2731
|
var Label = /*#__PURE__*/styled('label', {
|
|
@@ -2581,7 +2740,7 @@ var TextField = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
2581
2740
|
suffix = props.suffix,
|
|
2582
2741
|
size = props.size,
|
|
2583
2742
|
style = props.style,
|
|
2584
|
-
inputAttributes = _objectWithoutPropertiesLoose(props, _excluded$
|
|
2743
|
+
inputAttributes = _objectWithoutPropertiesLoose(props, _excluded$G);
|
|
2585
2744
|
return React__default.createElement(React__default.Fragment, null, label && React__default.createElement(Label, Object.assign({
|
|
2586
2745
|
className: "_text"
|
|
2587
2746
|
}, inputAttributes.id && {
|
|
@@ -2601,36 +2760,15 @@ var TextField = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
2601
2760
|
})), suffix || null));
|
|
2602
2761
|
});
|
|
2603
2762
|
|
|
2604
|
-
var
|
|
2763
|
+
var ContentContainer = /*#__PURE__*/styled('div', {
|
|
2764
|
+
overflow: 'hidden',
|
|
2605
2765
|
display: 'flex',
|
|
2606
2766
|
flexDirection: 'column',
|
|
2607
|
-
height: '100%',
|
|
2608
|
-
width: '100%',
|
|
2609
|
-
padding: '$12 0',
|
|
2610
|
-
position: 'relative',
|
|
2611
|
-
'@lg': {
|
|
2612
|
-
padding: '$16 0'
|
|
2613
|
-
}
|
|
2614
|
-
});
|
|
2615
|
-
var HeaderContainer = /*#__PURE__*/styled('div', {
|
|
2616
|
-
display: 'flex',
|
|
2617
|
-
justifyContent: 'center',
|
|
2618
|
-
alignItems: 'center',
|
|
2619
|
-
marginBottom: '$16',
|
|
2620
|
-
position: 'relative'
|
|
2621
|
-
});
|
|
2622
|
-
var BackIcon = /*#__PURE__*/styled(AngleLeftIcon, {
|
|
2623
|
-
position: 'absolute',
|
|
2624
|
-
left: '0'
|
|
2625
|
-
});
|
|
2626
|
-
var StyledBackIcon = /*#__PURE__*/styled(BackIcon, {
|
|
2627
|
-
cursor: 'pointer'
|
|
2628
|
-
});
|
|
2629
|
-
var ContentContainer = /*#__PURE__*/styled('div', {
|
|
2630
2767
|
flex: '1',
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2768
|
+
padding: '0 $4'
|
|
2769
|
+
});
|
|
2770
|
+
var TextFieldContainer = /*#__PURE__*/styled('div', {
|
|
2771
|
+
padding: '1px'
|
|
2634
2772
|
});
|
|
2635
2773
|
function SecondaryPage(props) {
|
|
2636
2774
|
var title = props.title,
|
|
@@ -2642,12 +2780,11 @@ function SecondaryPage(props) {
|
|
|
2642
2780
|
var _useState = React.useState(''),
|
|
2643
2781
|
searchedFor = _useState[0],
|
|
2644
2782
|
setSearchedFor = _useState[1];
|
|
2645
|
-
return React__default.createElement(
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
}, title), TopButton), props.textField && React__default.createElement("div", null, React__default.createElement(TextField, {
|
|
2783
|
+
return React__default.createElement(React__default.Fragment, null, hasHeader && React__default.createElement(Header, {
|
|
2784
|
+
onBack: onBack,
|
|
2785
|
+
title: title || '',
|
|
2786
|
+
suffix: TopButton
|
|
2787
|
+
}), React__default.createElement(ContentContainer, null, props.textField && React__default.createElement(TextFieldContainer, null, React__default.createElement(TextField, {
|
|
2651
2788
|
size: "large",
|
|
2652
2789
|
prefix: React__default.createElement(SearchIcon, {
|
|
2653
2790
|
size: 24
|
|
@@ -2658,7 +2795,38 @@ function SecondaryPage(props) {
|
|
|
2658
2795
|
},
|
|
2659
2796
|
value: searchedFor,
|
|
2660
2797
|
autoFocus: true
|
|
2661
|
-
})
|
|
2798
|
+
}), React__default.createElement(Divider, {
|
|
2799
|
+
size: 16
|
|
2800
|
+
})), props.textField && (props.children == null ? void 0 : props.children(searchedFor)), !props.textField && props.children), Footer);
|
|
2801
|
+
}
|
|
2802
|
+
|
|
2803
|
+
function containsText(text, searchText) {
|
|
2804
|
+
return text.toLowerCase().indexOf(searchText.toLowerCase()) > -1;
|
|
2805
|
+
}
|
|
2806
|
+
function getConciseAddress(address, maxChars, ellipsisLength) {
|
|
2807
|
+
if (maxChars === void 0) {
|
|
2808
|
+
maxChars = 8;
|
|
2809
|
+
}
|
|
2810
|
+
if (ellipsisLength === void 0) {
|
|
2811
|
+
ellipsisLength = 3;
|
|
2812
|
+
}
|
|
2813
|
+
if (!address) return null;
|
|
2814
|
+
if (address.length < 2 * maxChars + ellipsisLength) return address;
|
|
2815
|
+
var start = Math.ceil((address.length - maxChars) / 2);
|
|
2816
|
+
var end = address.length - maxChars;
|
|
2817
|
+
return "" + address.substr(start, maxChars) + '.'.repeat(ellipsisLength) + address.substr(end);
|
|
2818
|
+
}
|
|
2819
|
+
function limitDecimalPlaces(numberString, maxDecimalPlaces) {
|
|
2820
|
+
if (maxDecimalPlaces === void 0) {
|
|
2821
|
+
maxDecimalPlaces = 4;
|
|
2822
|
+
}
|
|
2823
|
+
var number = parseFloat(numberString);
|
|
2824
|
+
if (isNaN(number)) return numberString; // Return the original string if it's not a valid number
|
|
2825
|
+
else {
|
|
2826
|
+
var multiplier = Math.pow(10, maxDecimalPlaces);
|
|
2827
|
+
var roundedNumber = Math.round(number * multiplier) / multiplier;
|
|
2828
|
+
return roundedNumber.toString();
|
|
2829
|
+
}
|
|
2662
2830
|
}
|
|
2663
2831
|
|
|
2664
2832
|
var SpacerContainer = /*#__PURE__*/styled('div', {
|
|
@@ -2796,7 +2964,7 @@ var MainContainer = /*#__PURE__*/styled('div', {
|
|
|
2796
2964
|
color: '$primary200'
|
|
2797
2965
|
},
|
|
2798
2966
|
secondary: {
|
|
2799
|
-
color: '$
|
|
2967
|
+
color: '$foreground'
|
|
2800
2968
|
},
|
|
2801
2969
|
success: {
|
|
2802
2970
|
color: '$success300'
|
|
@@ -2820,7 +2988,14 @@ function Alert(props) {
|
|
|
2820
2988
|
className: showIcon ? 'hasIcon' : ''
|
|
2821
2989
|
}, React__default.createElement("div", {
|
|
2822
2990
|
className: "main"
|
|
2823
|
-
}, showIcon && React__default.createElement(React__default.Fragment, null,
|
|
2991
|
+
}, showIcon && React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
2992
|
+
style: {
|
|
2993
|
+
width: '32px',
|
|
2994
|
+
display: 'flex',
|
|
2995
|
+
justifyContent: 'center',
|
|
2996
|
+
alignItems: 'center'
|
|
2997
|
+
}
|
|
2998
|
+
}, type === 'success' && React__default.createElement(CheckCircleIcon, {
|
|
2824
2999
|
color: type,
|
|
2825
3000
|
size: 24
|
|
2826
3001
|
}), type === 'warning' && React__default.createElement(WarningIcon, {
|
|
@@ -2831,68 +3006,293 @@ function Alert(props) {
|
|
|
2831
3006
|
size: 24
|
|
2832
3007
|
}), React__default.createElement(Spacer, {
|
|
2833
3008
|
size: 8
|
|
2834
|
-
})),
|
|
2835
|
-
|
|
3009
|
+
}))), React__default.createElement("div", {
|
|
3010
|
+
style: {
|
|
3011
|
+
display: 'flex',
|
|
3012
|
+
justifyContent: 'center',
|
|
3013
|
+
alignItems: 'start',
|
|
3014
|
+
flexDirection: 'column',
|
|
3015
|
+
width: '100%'
|
|
3016
|
+
}
|
|
3017
|
+
}, title && React__default.createElement(React__default.Fragment, null, React__default.createElement(Typography, {
|
|
3018
|
+
className: "title",
|
|
3019
|
+
variant: "title",
|
|
2836
3020
|
color: type
|
|
2837
|
-
}, title), children
|
|
3021
|
+
}, title), !!children && React__default.createElement(Spacer, {
|
|
3022
|
+
size: 8,
|
|
3023
|
+
direction: "vertical"
|
|
3024
|
+
})), children)), props.footer ? React__default.createElement("div", {
|
|
2838
3025
|
className: "footer"
|
|
2839
3026
|
}, props.footer) : null);
|
|
2840
3027
|
}
|
|
2841
3028
|
|
|
2842
|
-
|
|
2843
|
-
return
|
|
2844
|
-
|
|
3029
|
+
function LoadingFailedAlert() {
|
|
3030
|
+
return React__default.createElement(Alert, {
|
|
3031
|
+
type: "error",
|
|
3032
|
+
title: " Error connecting server, please reload the app and try again."
|
|
3033
|
+
});
|
|
3034
|
+
}
|
|
2845
3035
|
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
var filterBlockchains = function filterBlockchains(list, searchedFor) {
|
|
2853
|
-
return list.filter(function (blockchain) {
|
|
2854
|
-
return containsText(blockchain.name, searchedFor) || containsText(blockchain.displayName, searchedFor);
|
|
3036
|
+
function NotFoundAlert(props) {
|
|
3037
|
+
var catergory = props.catergory,
|
|
3038
|
+
searchedFor = props.searchedFor;
|
|
3039
|
+
return React__default.createElement(Alert, {
|
|
3040
|
+
type: "secondary",
|
|
3041
|
+
title: catergory + " " + (searchedFor ? "'" + searchedFor + "'" : '') + " not found."
|
|
2855
3042
|
});
|
|
2856
|
-
}
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
return React__default.createElement(
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
3043
|
+
}
|
|
3044
|
+
|
|
3045
|
+
function VirtualizedList(props) {
|
|
3046
|
+
var itemCount = props.itemCount,
|
|
3047
|
+
hasNextPage = props.hasNextPage,
|
|
3048
|
+
loadNextPage = props.loadNextPage,
|
|
3049
|
+
Item = props.Item,
|
|
3050
|
+
innerElementType = props.innerElementType,
|
|
3051
|
+
size = props.size;
|
|
3052
|
+
var isItemLoaded = function isItemLoaded(index) {
|
|
3053
|
+
return !hasNextPage || index < itemCount;
|
|
3054
|
+
};
|
|
3055
|
+
return React__default.createElement(AutoSizer, null, function (_ref) {
|
|
3056
|
+
var width = _ref.width,
|
|
3057
|
+
height = _ref.height;
|
|
3058
|
+
return React__default.createElement(InfiniteLoader, {
|
|
3059
|
+
isItemLoaded: isItemLoaded,
|
|
3060
|
+
itemCount: hasNextPage ? itemCount + 1 : itemCount,
|
|
3061
|
+
loadMoreItems: loadNextPage,
|
|
3062
|
+
threshold: 1
|
|
3063
|
+
}, function (_ref2) {
|
|
3064
|
+
var onItemsRendered = _ref2.onItemsRendered,
|
|
3065
|
+
ref = _ref2.ref;
|
|
3066
|
+
return React__default.createElement(reactWindow.VariableSizeList, {
|
|
3067
|
+
innerElementType: innerElementType,
|
|
3068
|
+
ref: ref,
|
|
3069
|
+
itemSize: function itemSize() {
|
|
3070
|
+
return size;
|
|
3071
|
+
},
|
|
3072
|
+
itemCount: itemCount,
|
|
3073
|
+
height: height || 0,
|
|
3074
|
+
width: width || 0,
|
|
3075
|
+
onItemsRendered: onItemsRendered
|
|
3076
|
+
}, function (_ref3) {
|
|
3077
|
+
var index = _ref3.index,
|
|
3078
|
+
style = _ref3.style;
|
|
3079
|
+
return isItemLoaded(index) ? React__default.createElement(Item, {
|
|
3080
|
+
index: index,
|
|
3081
|
+
style: style
|
|
3082
|
+
}) : null;
|
|
3083
|
+
});
|
|
3084
|
+
});
|
|
3085
|
+
});
|
|
3086
|
+
}
|
|
3087
|
+
|
|
3088
|
+
var TokenImageContainer = /*#__PURE__*/styled('div', {
|
|
3089
|
+
paddingRight: '$16'
|
|
3090
|
+
});
|
|
3091
|
+
var TokenNameContainer = /*#__PURE__*/styled('div', {
|
|
3092
|
+
display: 'flex',
|
|
3093
|
+
flexDirection: 'column'
|
|
3094
|
+
});
|
|
3095
|
+
var TokenAmountContainer = /*#__PURE__*/styled('div', {
|
|
3096
|
+
display: 'flex',
|
|
3097
|
+
flexDirection: 'column',
|
|
3098
|
+
alignItems: 'flex-end'
|
|
3099
|
+
});
|
|
3100
|
+
function TokenItem(props) {
|
|
3101
|
+
var _token$balance;
|
|
3102
|
+
var token = props.token,
|
|
3103
|
+
style = props.style,
|
|
3104
|
+
onClick = props.onClick,
|
|
3105
|
+
selected = props.selected;
|
|
3106
|
+
return React__default.createElement("div", {
|
|
3107
|
+
style: _extends({
|
|
3108
|
+
display: 'flex',
|
|
3109
|
+
alignItems: 'center',
|
|
3110
|
+
width: '100%'
|
|
3111
|
+
}, style, {
|
|
3112
|
+
height: '48px',
|
|
3113
|
+
top: parseFloat(style == null ? void 0 : style.top) + 0 + "px",
|
|
3114
|
+
padding: '0 4px'
|
|
3115
|
+
})
|
|
3116
|
+
}, React__default.createElement(Button, {
|
|
3117
|
+
variant: "outlined",
|
|
3118
|
+
size: "large",
|
|
3119
|
+
align: "start",
|
|
3120
|
+
onClick: onClick.bind(null, token),
|
|
3121
|
+
type: selected ? 'primary' : undefined,
|
|
3122
|
+
prefix: React__default.createElement(TokenImageContainer, null, React__default.createElement(Image, {
|
|
3123
|
+
src: token.image,
|
|
3124
|
+
size: 32
|
|
3125
|
+
})),
|
|
3126
|
+
suffix: ((_token$balance = token.balance) == null ? void 0 : _token$balance.amount) && React__default.createElement(TokenAmountContainer, null, React__default.createElement(Typography, {
|
|
3127
|
+
variant: "body2"
|
|
3128
|
+
}, token.balance.amount), React__default.createElement(Typography, {
|
|
3129
|
+
variant: "caption"
|
|
3130
|
+
}, token.balance.usdValue + "$"))
|
|
3131
|
+
}, React__default.createElement(TokenNameContainer, null, React__default.createElement(Typography, {
|
|
3132
|
+
variant: "body1"
|
|
3133
|
+
}, token.symbol), React__default.createElement(Typography, {
|
|
3134
|
+
variant: "caption",
|
|
3135
|
+
color: "neutrals600"
|
|
3136
|
+
}, token.name))));
|
|
3137
|
+
}
|
|
3138
|
+
|
|
3139
|
+
var _excluded$H = ["style"];
|
|
3140
|
+
var PAGE_SIZE = 20;
|
|
3141
|
+
function TokenList(props) {
|
|
3142
|
+
var list = props.list,
|
|
3143
|
+
searchedText = props.searchedText,
|
|
3144
|
+
onChange = props.onChange,
|
|
3145
|
+
multiSelect = props.multiSelect,
|
|
3146
|
+
selectedList = props.selectedList;
|
|
3147
|
+
var _useState = React.useState(props.selected),
|
|
3148
|
+
selected = _useState[0],
|
|
3149
|
+
setSelected = _useState[1];
|
|
3150
|
+
var changeSelected = function changeSelected(token) {
|
|
3151
|
+
setSelected(token);
|
|
3152
|
+
onChange(token);
|
|
3153
|
+
};
|
|
3154
|
+
var isSelected = function isSelected(token) {
|
|
3155
|
+
if (multiSelect && selectedList) {
|
|
3156
|
+
return selectedList.map(function (item) {
|
|
3157
|
+
return item.symbol + item.address;
|
|
3158
|
+
}).indexOf(token.symbol + token.address) > -1;
|
|
3159
|
+
}
|
|
3160
|
+
return (selected == null ? void 0 : selected.symbol) === token.symbol && (selected == null ? void 0 : selected.address) === token.address;
|
|
3161
|
+
};
|
|
3162
|
+
var _useState2 = React.useState(true),
|
|
3163
|
+
hasNextPage = _useState2[0],
|
|
3164
|
+
setHasNextPage = _useState2[1];
|
|
3165
|
+
var _useState3 = React.useState(list),
|
|
3166
|
+
tokens = _useState3[0],
|
|
3167
|
+
setTokens = _useState3[1];
|
|
3168
|
+
var loadNextPage = function loadNextPage() {
|
|
3169
|
+
setTokens(list.slice(0, tokens.length + PAGE_SIZE));
|
|
3170
|
+
};
|
|
3171
|
+
React.useEffect(function () {
|
|
3172
|
+
setTokens(list.slice(0, PAGE_SIZE));
|
|
3173
|
+
}, [searchedText, list]);
|
|
3174
|
+
React.useEffect(function () {
|
|
3175
|
+
setHasNextPage(list.length > tokens.length);
|
|
3176
|
+
}, [tokens.length]);
|
|
3177
|
+
var innerElementType = React.forwardRef(function (_ref, ref) {
|
|
3178
|
+
var style = _ref.style,
|
|
3179
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$H);
|
|
3180
|
+
return React__default.createElement("div", Object.assign({
|
|
3181
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3182
|
+
ref: ref,
|
|
3183
|
+
style: _extends({}, style, {
|
|
3184
|
+
height: parseFloat(style == null ? void 0 : style.height) + 8 * 2 + "px"
|
|
3185
|
+
})
|
|
3186
|
+
}, rest));
|
|
3187
|
+
});
|
|
3188
|
+
return React__default.createElement(VirtualizedList, {
|
|
3189
|
+
Item: function Item(_ref2) {
|
|
3190
|
+
var index = _ref2.index,
|
|
3191
|
+
style = _ref2.style;
|
|
3192
|
+
return React__default.createElement(TokenItem, {
|
|
3193
|
+
token: tokens[index],
|
|
3194
|
+
style: style,
|
|
3195
|
+
onClick: changeSelected,
|
|
3196
|
+
selected: isSelected(tokens[index])
|
|
3197
|
+
});
|
|
3198
|
+
},
|
|
3199
|
+
hasNextPage: hasNextPage,
|
|
3200
|
+
itemCount: tokens.length,
|
|
3201
|
+
loadNextPage: loadNextPage,
|
|
3202
|
+
innerElementType: innerElementType,
|
|
3203
|
+
size: 56
|
|
3204
|
+
});
|
|
3205
|
+
}
|
|
3206
|
+
|
|
3207
|
+
var LoaderContainer = /*#__PURE__*/styled('div', {
|
|
3208
|
+
display: 'flex',
|
|
3209
|
+
justifyContent: 'center',
|
|
3210
|
+
width: '100%',
|
|
3211
|
+
paddingTop: '33%',
|
|
3212
|
+
flex: 1
|
|
3213
|
+
});
|
|
3214
|
+
var filterTokens = function filterTokens(list, searchedFor) {
|
|
3215
|
+
return list.filter(function (token) {
|
|
3216
|
+
return containsText(token.symbol, searchedFor) || containsText(token.address || '', searchedFor) || containsText(token.name || '', searchedFor);
|
|
3217
|
+
});
|
|
3218
|
+
};
|
|
3219
|
+
function TokenSelector(props) {
|
|
3220
|
+
var list = props.list,
|
|
3221
|
+
type = props.type,
|
|
3222
|
+
selected = props.selected,
|
|
3223
|
+
hasHeader = props.hasHeader,
|
|
3224
|
+
onChange = props.onChange,
|
|
3225
|
+
onBack = props.onBack,
|
|
3226
|
+
loadingStatus = props.loadingStatus;
|
|
3227
|
+
return React__default.createElement(SecondaryPage, {
|
|
3228
|
+
textField: true,
|
|
3229
|
+
hasHeader: hasHeader,
|
|
3230
|
+
title: "Select " + type + " Token",
|
|
3231
|
+
onBack: onBack,
|
|
3232
|
+
textFieldPlaceholder: "Search Token By Name"
|
|
3233
|
+
}, function (searchedFor) {
|
|
3234
|
+
var filteredTokens = filterTokens(list, searchedFor);
|
|
3235
|
+
return loadingStatus === 'loading' ? React__default.createElement(LoaderContainer, null, React__default.createElement(Spinner, {
|
|
3236
|
+
size: 24
|
|
3237
|
+
})) : loadingStatus === 'failed' ? React__default.createElement(LoadingFailedAlert, null) : filteredTokens.length ? React__default.createElement(TokenList, {
|
|
3238
|
+
searchedText: searchedFor,
|
|
3239
|
+
list: filteredTokens,
|
|
3240
|
+
selected: selected,
|
|
3241
|
+
onChange: onChange
|
|
3242
|
+
}) : React__default.createElement(NotFoundAlert, {
|
|
3243
|
+
catergory: "Token",
|
|
3244
|
+
searchedFor: searchedFor
|
|
3245
|
+
});
|
|
3246
|
+
});
|
|
3247
|
+
}
|
|
3248
|
+
|
|
3249
|
+
var ListContainer$1 = /*#__PURE__*/styled('div', {
|
|
3250
|
+
overflowY: 'auto',
|
|
3251
|
+
padding: '0 $4'
|
|
3252
|
+
});
|
|
3253
|
+
var filterBlockchains = function filterBlockchains(list, searchedFor) {
|
|
3254
|
+
return list.filter(function (blockchain) {
|
|
3255
|
+
return containsText(blockchain.name, searchedFor) || containsText(blockchain.displayName, searchedFor);
|
|
3256
|
+
});
|
|
3257
|
+
};
|
|
3258
|
+
function BlockchainSelector(props) {
|
|
3259
|
+
var type = props.type,
|
|
3260
|
+
list = props.list,
|
|
3261
|
+
onChange = props.onChange,
|
|
3262
|
+
selected = props.selected,
|
|
3263
|
+
onBack = props.onBack,
|
|
3264
|
+
loadingStatus = props.loadingStatus,
|
|
3265
|
+
hasHeader = props.hasHeader,
|
|
3266
|
+
listContainerStyle = props.listContainerStyle,
|
|
3267
|
+
multiSelect = props.multiSelect,
|
|
3268
|
+
selectedList = props.selectedList;
|
|
3269
|
+
return React__default.createElement(SecondaryPage, {
|
|
3270
|
+
textField: true,
|
|
3271
|
+
hasHeader: hasHeader,
|
|
3272
|
+
textFieldPlaceholder: "Search Blockchain By Name",
|
|
2872
3273
|
title: "Select " + type + " Network",
|
|
2873
3274
|
onBack: onBack
|
|
2874
3275
|
}, function (searchedFor) {
|
|
2875
3276
|
var filteredBlockchains = filterBlockchains(list, searchedFor);
|
|
2876
|
-
return React__default.createElement(
|
|
3277
|
+
return React__default.createElement(React__default.Fragment, null, loadingStatus === 'loading' && React__default.createElement(LoaderContainer, null, React__default.createElement(Spinner, {
|
|
3278
|
+
size: 24
|
|
3279
|
+
})), React__default.createElement(ListContainer$1, {
|
|
2877
3280
|
style: listContainerStyle,
|
|
2878
3281
|
key: "1"
|
|
2879
|
-
}, loadingStatus === '
|
|
2880
|
-
size: 24
|
|
2881
|
-
})), loadingStatus === 'failed' && React__default.createElement(Alert, {
|
|
2882
|
-
type: "error"
|
|
2883
|
-
}, React__default.createElement(Typography, {
|
|
2884
|
-
variant: "body2"
|
|
2885
|
-
}, "Error connecting server, please reload the app and try again")), loadingStatus === 'success' && React__default.createElement(React__default.Fragment, null, filteredBlockchains.length > 0 ? React__default.createElement(BlockchainsList, {
|
|
3282
|
+
}, loadingStatus === 'failed' && React__default.createElement(LoadingFailedAlert, null), loadingStatus === 'success' && React__default.createElement(React__default.Fragment, null, filteredBlockchains.length ? React__default.createElement(BlockchainsList, {
|
|
2886
3283
|
list: filteredBlockchains,
|
|
2887
3284
|
selected: selected,
|
|
2888
3285
|
multiSelect: multiSelect,
|
|
2889
3286
|
selectedList: selectedList,
|
|
2890
3287
|
onChange: onChange
|
|
2891
|
-
}) : React__default.createElement(
|
|
3288
|
+
}) : React__default.createElement(NotFoundAlert, {
|
|
3289
|
+
catergory: "Blockchain",
|
|
3290
|
+
searchedFor: searchedFor
|
|
3291
|
+
}))));
|
|
2892
3292
|
});
|
|
2893
3293
|
}
|
|
2894
3294
|
|
|
2895
|
-
var _excluded$
|
|
3295
|
+
var _excluded$I = ["label", "id"];
|
|
2896
3296
|
var CheckboxContainer = /*#__PURE__*/styled('div', {
|
|
2897
3297
|
display: 'flex',
|
|
2898
3298
|
alignItems: 'center'
|
|
@@ -2917,7 +3317,7 @@ var Label$1 = /*#__PURE__*/styled('label', {
|
|
|
2917
3317
|
function Checkbox(_ref) {
|
|
2918
3318
|
var label = _ref.label,
|
|
2919
3319
|
id = _ref.id,
|
|
2920
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3320
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$I);
|
|
2921
3321
|
return React__default.createElement(CheckboxContainer, null, React__default.createElement(CheckboxRoot, Object.assign({
|
|
2922
3322
|
id: id
|
|
2923
3323
|
}, props), React__default.createElement(RadixCheckbox.Indicator, null, React__default.createElement(CheckIcon, {
|
|
@@ -3000,15 +3400,13 @@ var ModalHeader = /*#__PURE__*/styled('div', {
|
|
|
3000
3400
|
position: 'relative',
|
|
3001
3401
|
marginBottom: '$16'
|
|
3002
3402
|
});
|
|
3003
|
-
var ContentContainer$1 = /*#__PURE__*/styled('div', {});
|
|
3004
3403
|
function Modal(props) {
|
|
3005
3404
|
var title = props.title,
|
|
3006
3405
|
content = props.content,
|
|
3007
3406
|
open = props.open,
|
|
3008
3407
|
onClose = props.onClose,
|
|
3009
3408
|
containerStyle = props.containerStyle,
|
|
3010
|
-
action = props.action
|
|
3011
|
-
contentStyle = props.contentStyle;
|
|
3409
|
+
action = props.action;
|
|
3012
3410
|
var handleBackDropClick = function handleBackDropClick(event) {
|
|
3013
3411
|
if (event.target === event.currentTarget) onClose();
|
|
3014
3412
|
};
|
|
@@ -3024,9 +3422,7 @@ function Modal(props) {
|
|
|
3024
3422
|
}, title), React__default.createElement(Row, null, action, React__default.createElement(CloseIcon, {
|
|
3025
3423
|
size: 24,
|
|
3026
3424
|
onClick: onClose
|
|
3027
|
-
}))),
|
|
3028
|
-
style: contentStyle
|
|
3029
|
-
}, content))), document.body));
|
|
3425
|
+
}))), content)), document.body));
|
|
3030
3426
|
}
|
|
3031
3427
|
|
|
3032
3428
|
(function (WalletState) {
|
|
@@ -3053,10 +3449,8 @@ var State = function State(_ref) {
|
|
|
3053
3449
|
})), walletState === exports.WalletState.CONNECTING && React__default.createElement(Spinner, null), walletState === exports.WalletState.CONNECTED && React__default.createElement(DisconnectIcon, null)));
|
|
3054
3450
|
};
|
|
3055
3451
|
|
|
3056
|
-
var
|
|
3057
|
-
|
|
3058
|
-
height: '$24',
|
|
3059
|
-
marginRight: '$12'
|
|
3452
|
+
var WalletImageContainer = /*#__PURE__*/styled('div', {
|
|
3453
|
+
paddingRight: '$12'
|
|
3060
3454
|
});
|
|
3061
3455
|
var Text = /*#__PURE__*/styled('div', {
|
|
3062
3456
|
display: 'flex',
|
|
@@ -3084,7 +3478,7 @@ function Wallet(props) {
|
|
|
3084
3478
|
installLink = props.installLink;
|
|
3085
3479
|
return React__default.createElement(ExtendedButton, {
|
|
3086
3480
|
type: state === exports.WalletState.CONNECTED ? 'primary' : undefined,
|
|
3087
|
-
disabled:
|
|
3481
|
+
disabled: state == exports.WalletState.CONNECTING,
|
|
3088
3482
|
onClick: function onClick() {
|
|
3089
3483
|
if (state === exports.WalletState.NOT_INSTALLED) {
|
|
3090
3484
|
window.open(walletsShared.detectInstallLink(installLink), '_blank');
|
|
@@ -3093,9 +3487,10 @@ function Wallet(props) {
|
|
|
3093
3487
|
align: "start",
|
|
3094
3488
|
variant: "outlined",
|
|
3095
3489
|
size: "large",
|
|
3096
|
-
prefix: React__default.createElement(
|
|
3097
|
-
src: image
|
|
3098
|
-
|
|
3490
|
+
prefix: React__default.createElement(WalletImageContainer, null, React__default.createElement(Image, {
|
|
3491
|
+
src: image,
|
|
3492
|
+
size: 24
|
|
3493
|
+
})),
|
|
3099
3494
|
suffix: React__default.createElement(State, {
|
|
3100
3495
|
walletState: state,
|
|
3101
3496
|
installLink: installLink
|
|
@@ -3191,28 +3586,40 @@ var groupLiquiditySources = function groupLiquiditySources(liquiditySources) {
|
|
|
3191
3586
|
})
|
|
3192
3587
|
};
|
|
3193
3588
|
};
|
|
3589
|
+
var MainContainer$1 = /*#__PURE__*/styled('div', {
|
|
3590
|
+
variants: {
|
|
3591
|
+
loaded: {
|
|
3592
|
+
"true": {
|
|
3593
|
+
overflowY: 'auto',
|
|
3594
|
+
padding: '0 $4'
|
|
3595
|
+
}
|
|
3596
|
+
}
|
|
3597
|
+
}
|
|
3598
|
+
});
|
|
3194
3599
|
var LiquiditySourceType = /*#__PURE__*/styled('div', {
|
|
3195
3600
|
position: 'sticky',
|
|
3196
3601
|
display: 'flex',
|
|
3197
3602
|
justifyContent: 'space-between',
|
|
3198
3603
|
alignItems: 'center',
|
|
3199
3604
|
top: '0',
|
|
3200
|
-
marginTop: '$8',
|
|
3201
|
-
marginBottom: '$8',
|
|
3202
3605
|
backgroundColor: '$background',
|
|
3203
3606
|
zIndex: '9999',
|
|
3204
3607
|
paddingTop: '$8',
|
|
3205
3608
|
paddingBottom: '$8'
|
|
3206
3609
|
});
|
|
3207
|
-
var
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3610
|
+
var LiquidityImageContainer = /*#__PURE__*/styled('div', {
|
|
3611
|
+
paddingRight: '$16'
|
|
3612
|
+
});
|
|
3613
|
+
var LoaderContainer$1 = /*#__PURE__*/styled('div', {
|
|
3614
|
+
display: 'flex',
|
|
3615
|
+
justifyContent: 'center'
|
|
3211
3616
|
});
|
|
3212
3617
|
function LiquiditySourceList(props) {
|
|
3213
3618
|
var list = props.list,
|
|
3214
3619
|
onChange = props.onChange,
|
|
3215
|
-
listContainerStyle = props.listContainerStyle
|
|
3620
|
+
listContainerStyle = props.listContainerStyle,
|
|
3621
|
+
loadingStatus = props.loadingStatus,
|
|
3622
|
+
searchedFor = props.searchedFor;
|
|
3216
3623
|
var _useState = React.useState(list.filter(function (item) {
|
|
3217
3624
|
return item.selected;
|
|
3218
3625
|
})),
|
|
@@ -3246,10 +3653,9 @@ function LiquiditySourceList(props) {
|
|
|
3246
3653
|
// TODO: This is not performant
|
|
3247
3654
|
var totalSelectedBridges = bridges.filter(isSelected).length;
|
|
3248
3655
|
var totalSelectedExchanges = exchanges.filter(isSelected).length;
|
|
3249
|
-
return React__default.createElement(
|
|
3250
|
-
style:
|
|
3251
|
-
|
|
3252
|
-
}, listContainerStyle)
|
|
3656
|
+
return React__default.createElement(MainContainer$1, {
|
|
3657
|
+
style: listContainerStyle,
|
|
3658
|
+
loaded: loadingStatus === 'success'
|
|
3253
3659
|
}, React__default.createElement("div", null, React__default.createElement(LiquiditySourceType, null, React__default.createElement(Typography, {
|
|
3254
3660
|
variant: "h5"
|
|
3255
3661
|
}, "Bridges"), React__default.createElement(Typography, {
|
|
@@ -3258,14 +3664,19 @@ function LiquiditySourceList(props) {
|
|
|
3258
3664
|
}, totalSelectedBridges === totalBridges ? totalBridges : totalSelectedBridges + " / " + totalBridges)), React__default.createElement(Spacer, {
|
|
3259
3665
|
size: 12,
|
|
3260
3666
|
direction: "vertical"
|
|
3261
|
-
}),
|
|
3667
|
+
}), loadingStatus === 'loading' && React__default.createElement(LoaderContainer$1, null, React__default.createElement(Spinner, {
|
|
3668
|
+
size: 24
|
|
3669
|
+
})), loadingStatus === 'failed' && React__default.createElement(LoadingFailedAlert, null), loadingStatus === 'success' && React__default.createElement(React__default.Fragment, null, totalBridges ? bridges.map(function (liquiditySource, index) {
|
|
3262
3670
|
return React__default.createElement(LiquiditySourceItem, {
|
|
3263
3671
|
liquiditySource: liquiditySource,
|
|
3264
3672
|
key: index,
|
|
3265
3673
|
selected: isSelected(liquiditySource),
|
|
3266
3674
|
onChange: changeLiquiditySources
|
|
3267
3675
|
});
|
|
3268
|
-
})
|
|
3676
|
+
}) : React__default.createElement(NotFoundAlert, {
|
|
3677
|
+
catergory: "Bridge",
|
|
3678
|
+
searchedFor: searchedFor
|
|
3679
|
+
}))), React__default.createElement("div", null, React__default.createElement(LiquiditySourceType, null, React__default.createElement(Typography, {
|
|
3269
3680
|
variant: "h5"
|
|
3270
3681
|
}, "Exchanges"), React__default.createElement(Typography, {
|
|
3271
3682
|
variant: "body1",
|
|
@@ -3273,14 +3684,19 @@ function LiquiditySourceList(props) {
|
|
|
3273
3684
|
}, totalSelectedExchanges === totalExchanges ? totalExchanges : totalSelectedExchanges + " / " + totalExchanges)), React__default.createElement(Spacer, {
|
|
3274
3685
|
size: 12,
|
|
3275
3686
|
direction: "vertical"
|
|
3276
|
-
}),
|
|
3687
|
+
}), loadingStatus === 'loading' && React__default.createElement(LoaderContainer$1, null, React__default.createElement(Spinner, {
|
|
3688
|
+
size: 24
|
|
3689
|
+
})), loadingStatus === 'failed' && React__default.createElement(LoadingFailedAlert, null), loadingStatus == 'success' && React__default.createElement(React__default.Fragment, null, totalExchanges ? exchanges.map(function (liquiditySource, index) {
|
|
3277
3690
|
return React__default.createElement(LiquiditySourceItem, {
|
|
3278
3691
|
liquiditySource: liquiditySource,
|
|
3279
3692
|
key: index,
|
|
3280
3693
|
selected: isSelected(liquiditySource),
|
|
3281
3694
|
onChange: changeLiquiditySources
|
|
3282
3695
|
});
|
|
3283
|
-
})
|
|
3696
|
+
}) : React__default.createElement(NotFoundAlert, {
|
|
3697
|
+
catergory: "Exchange",
|
|
3698
|
+
searchedFor: searchedFor
|
|
3699
|
+
}))));
|
|
3284
3700
|
}
|
|
3285
3701
|
var LiquiditySourceItem = function LiquiditySourceItem(_ref) {
|
|
3286
3702
|
var liquiditySource = _ref.liquiditySource,
|
|
@@ -3290,9 +3706,10 @@ var LiquiditySourceItem = function LiquiditySourceItem(_ref) {
|
|
|
3290
3706
|
size: "large",
|
|
3291
3707
|
align: "start",
|
|
3292
3708
|
variant: "outlined",
|
|
3293
|
-
prefix: React__default.createElement(
|
|
3294
|
-
src: liquiditySource.logo
|
|
3295
|
-
|
|
3709
|
+
prefix: React__default.createElement(LiquidityImageContainer, null, React__default.createElement(Image, {
|
|
3710
|
+
src: liquiditySource.logo,
|
|
3711
|
+
size: 20
|
|
3712
|
+
})),
|
|
3296
3713
|
suffix: React__default.createElement(Switch, {
|
|
3297
3714
|
checked: selected
|
|
3298
3715
|
}),
|
|
@@ -3310,22 +3727,19 @@ var filterLiquiditySources = function filterLiquiditySources(liquiditySources, s
|
|
|
3310
3727
|
return containsText(liquiditySource.title, searchedFor || '');
|
|
3311
3728
|
});
|
|
3312
3729
|
};
|
|
3313
|
-
var ActionButton = /*#__PURE__*/styled(Button, {
|
|
3314
|
-
position: 'absolute',
|
|
3315
|
-
right: 0
|
|
3316
|
-
});
|
|
3317
3730
|
function LiquiditySourcesSelector(props) {
|
|
3318
3731
|
var list = props.list,
|
|
3319
3732
|
onChange = props.onChange,
|
|
3320
3733
|
onBack = props.onBack,
|
|
3321
3734
|
hasHeader = props.hasHeader,
|
|
3322
3735
|
listContainerStyle = props.listContainerStyle,
|
|
3323
|
-
toggleAll = props.toggleAll
|
|
3736
|
+
toggleAll = props.toggleAll,
|
|
3737
|
+
loadingStatus = props.loadingStatus;
|
|
3324
3738
|
return React__default.createElement(SecondaryPage, {
|
|
3325
3739
|
textField: true,
|
|
3326
3740
|
textFieldPlaceholder: "Search By Name",
|
|
3327
3741
|
title: "Liquidity Sources",
|
|
3328
|
-
TopButton: React__default.createElement(
|
|
3742
|
+
TopButton: React__default.createElement(Button, {
|
|
3329
3743
|
variant: "ghost",
|
|
3330
3744
|
type: "primary",
|
|
3331
3745
|
onClick: toggleAll
|
|
@@ -3338,7 +3752,9 @@ function LiquiditySourcesSelector(props) {
|
|
|
3338
3752
|
return React__default.createElement(LiquiditySourceList, {
|
|
3339
3753
|
listContainerStyle: listContainerStyle,
|
|
3340
3754
|
list: filterLiquiditySources(list, searchedFor),
|
|
3341
|
-
onChange: onChange
|
|
3755
|
+
onChange: onChange,
|
|
3756
|
+
loadingStatus: loadingStatus,
|
|
3757
|
+
searchedFor: searchedFor
|
|
3342
3758
|
});
|
|
3343
3759
|
});
|
|
3344
3760
|
}
|
|
@@ -3382,7 +3798,7 @@ var SolidCircle = /*#__PURE__*/styled('div', {
|
|
|
3382
3798
|
}
|
|
3383
3799
|
}
|
|
3384
3800
|
});
|
|
3385
|
-
var Container$
|
|
3801
|
+
var Container$1 = /*#__PURE__*/styled('div', {
|
|
3386
3802
|
border: '1.5px solid',
|
|
3387
3803
|
borderRadius: '$5',
|
|
3388
3804
|
padding: '$12',
|
|
@@ -3429,18 +3845,19 @@ function SelectableWalletList(_ref) {
|
|
|
3429
3845
|
}, [list]);
|
|
3430
3846
|
return React__default.createElement(Row$1, null, list.map(function (w, index) {
|
|
3431
3847
|
var checked = active === w.walletType;
|
|
3432
|
-
return React__default.createElement(Container$
|
|
3848
|
+
return React__default.createElement(Container$1, {
|
|
3433
3849
|
checked: checked,
|
|
3434
3850
|
onClick: onClick.bind(null, w),
|
|
3435
3851
|
key: index
|
|
3436
|
-
}, React__default.createElement(
|
|
3852
|
+
}, React__default.createElement(Image, {
|
|
3437
3853
|
src: w.image,
|
|
3438
3854
|
alt: w.walletType,
|
|
3439
|
-
|
|
3440
|
-
height: 24
|
|
3855
|
+
size: 24
|
|
3441
3856
|
}), React__default.createElement(Typography, {
|
|
3442
3857
|
variant: "body2"
|
|
3443
|
-
}, w.name), React__default.createElement(
|
|
3858
|
+
}, w.name), React__default.createElement(Typography, {
|
|
3859
|
+
variant: "caption"
|
|
3860
|
+
}, getConciseAddress(w.address)), React__default.createElement(Circle, {
|
|
3444
3861
|
checked: checked
|
|
3445
3862
|
}, React__default.createElement(SolidCircle, {
|
|
3446
3863
|
checked: checked
|
|
@@ -3480,7 +3897,7 @@ var StyledItem = /*#__PURE__*/styled(RadioGroup.Item, {
|
|
|
3480
3897
|
borderColor: '$neutrals600'
|
|
3481
3898
|
}
|
|
3482
3899
|
});
|
|
3483
|
-
var Container$
|
|
3900
|
+
var Container$2 = /*#__PURE__*/styled('div', {
|
|
3484
3901
|
display: 'flex'
|
|
3485
3902
|
});
|
|
3486
3903
|
var StyledIndicator = /*#__PURE__*/styled(RadioGroup.Indicator, {
|
|
@@ -3510,7 +3927,7 @@ function Radio(props) {
|
|
|
3510
3927
|
_props$direction = props.direction,
|
|
3511
3928
|
direction = _props$direction === void 0 ? 'vertical' : _props$direction,
|
|
3512
3929
|
style = props.style;
|
|
3513
|
-
return React__default.createElement(Container$
|
|
3930
|
+
return React__default.createElement(Container$2, null, React__default.createElement(StyledRoot, {
|
|
3514
3931
|
onValueChange: onChange,
|
|
3515
3932
|
value: value,
|
|
3516
3933
|
direction: direction,
|
|
@@ -3546,13 +3963,13 @@ var SlippageChipsContainer = /*#__PURE__*/styled('div', {
|
|
|
3546
3963
|
var LiquiditySourceContainer = /*#__PURE__*/styled(BaseContainer, {
|
|
3547
3964
|
display: 'flex',
|
|
3548
3965
|
justifyContent: 'space-between',
|
|
3549
|
-
marginTop: '$
|
|
3966
|
+
marginTop: '$16',
|
|
3550
3967
|
cursor: 'pointer'
|
|
3551
3968
|
});
|
|
3552
3969
|
var InfiniteContainer = /*#__PURE__*/styled(BaseContainer, {
|
|
3553
3970
|
display: 'flex',
|
|
3554
3971
|
justifyContent: 'space-between',
|
|
3555
|
-
marginTop: '$
|
|
3972
|
+
marginTop: '$16'
|
|
3556
3973
|
});
|
|
3557
3974
|
var StyledAngleRight = /*#__PURE__*/styled(AngleRightIcon, {
|
|
3558
3975
|
marginLeft: '$8'
|
|
@@ -3563,7 +3980,7 @@ var LiquiditySourceNumber = /*#__PURE__*/styled('div', {
|
|
|
3563
3980
|
justifyContent: 'center'
|
|
3564
3981
|
});
|
|
3565
3982
|
var ThemesContainer = /*#__PURE__*/styled(BaseContainer, {
|
|
3566
|
-
marginTop: '$
|
|
3983
|
+
marginTop: '$16'
|
|
3567
3984
|
});
|
|
3568
3985
|
var Head = /*#__PURE__*/styled('div', {
|
|
3569
3986
|
display: 'flex',
|
|
@@ -3585,7 +4002,8 @@ function Settings(props) {
|
|
|
3585
4002
|
selectedTheme = props.selectedTheme,
|
|
3586
4003
|
onThemeChange = props.onThemeChange,
|
|
3587
4004
|
toggleInfiniteApprove = props.toggleInfiniteApprove,
|
|
3588
|
-
infiniteApprove = props.infiniteApprove
|
|
4005
|
+
infiniteApprove = props.infiniteApprove,
|
|
4006
|
+
loadingStatus = props.loadingStatus;
|
|
3589
4007
|
var _useState = React.useState(props.selectedSlippage),
|
|
3590
4008
|
selectedSlippage = _useState[0],
|
|
3591
4009
|
setSelectedSlippage = _useState[1];
|
|
@@ -3653,14 +4071,21 @@ function Settings(props) {
|
|
|
3653
4071
|
}, "Infinite Approval"), React__default.createElement(Switch, {
|
|
3654
4072
|
checked: infiniteApprove,
|
|
3655
4073
|
onChange: toggleInfiniteApprove
|
|
3656
|
-
})), React__default.createElement(LiquiditySourceContainer, {
|
|
3657
|
-
onClick: onLiquiditySourcesClick
|
|
4074
|
+
})), React__default.createElement(LiquiditySourceContainer, null, React__default.createElement(Button, {
|
|
4075
|
+
onClick: onLiquiditySourcesClick,
|
|
4076
|
+
align: "start",
|
|
4077
|
+
variant: "ghost",
|
|
4078
|
+
loading: loadingStatus === 'loading',
|
|
4079
|
+
suffix: React__default.createElement(LiquiditySourceNumber, null, loadingStatus === 'success' && React__default.createElement(Typography, {
|
|
4080
|
+
variant: "body2",
|
|
4081
|
+
color: "neutrals800"
|
|
4082
|
+
}, liquiditySources.length !== selectedLiquiditySources.length ? selectedLiquiditySources.length + " / " + liquiditySources.length : liquiditySources.length), loadingStatus === 'failed' && React__default.createElement(Typography, {
|
|
4083
|
+
variant: "body2",
|
|
4084
|
+
color: "$error500"
|
|
4085
|
+
}, "Loading failed"), React__default.createElement(StyledAngleRight, null))
|
|
3658
4086
|
}, React__default.createElement(Typography, {
|
|
3659
4087
|
variant: "body1"
|
|
3660
|
-
}, "Liquidity Sources")
|
|
3661
|
-
variant: "body2",
|
|
3662
|
-
color: "neutrals800"
|
|
3663
|
-
}, liquiditySources.length !== selectedLiquiditySources.length ? selectedLiquiditySources.length + " / " + liquiditySources.length : liquiditySources.length), React__default.createElement(StyledAngleRight, null))));
|
|
4088
|
+
}, "Liquidity Sources"))));
|
|
3664
4089
|
return React__default.createElement(SecondaryPage, {
|
|
3665
4090
|
title: "Settings",
|
|
3666
4091
|
textField: false,
|
|
@@ -3668,107 +4093,118 @@ function Settings(props) {
|
|
|
3668
4093
|
}, PageContent);
|
|
3669
4094
|
}
|
|
3670
4095
|
|
|
3671
|
-
var MainContainer$
|
|
4096
|
+
var MainContainer$2 = /*#__PURE__*/styled('div', {
|
|
4097
|
+
position: 'relative',
|
|
4098
|
+
display: 'flex',
|
|
4099
|
+
flexDirection: 'column',
|
|
3672
4100
|
borderRadius: '$10',
|
|
3673
|
-
maxWidth: '512px',
|
|
3674
4101
|
boxShadow: '$s',
|
|
3675
|
-
minWidth: '375px',
|
|
3676
4102
|
width: '100%',
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
display: 'flex',
|
|
3680
|
-
flexDirection: 'column',
|
|
3681
|
-
alignItems: 'end',
|
|
4103
|
+
minWidth: '375px',
|
|
4104
|
+
maxWidth: '512px',
|
|
3682
4105
|
padding: '$16',
|
|
3683
4106
|
boxSizing: 'border-box',
|
|
3684
|
-
|
|
3685
|
-
});
|
|
3686
|
-
var ContentContainer$2 = /*#__PURE__*/styled('div', {
|
|
3687
|
-
width: '100%'
|
|
3688
|
-
});
|
|
3689
|
-
function SwapContainer(props) {
|
|
3690
|
-
var children = props.children,
|
|
3691
|
-
style = props.style;
|
|
3692
|
-
return React__default.createElement(MainContainer$1, {
|
|
3693
|
-
style: style,
|
|
3694
|
-
id: "swap-box"
|
|
3695
|
-
}, React__default.createElement(ContentContainer$2, null, children));
|
|
3696
|
-
}
|
|
3697
|
-
|
|
3698
|
-
var Container$4 = /*#__PURE__*/styled('div', {
|
|
3699
|
-
position: 'relative'
|
|
3700
|
-
});
|
|
3701
|
-
var ButtonContainer$1 = /*#__PURE__*/styled('div', {
|
|
3702
|
-
paddingTop: '$8'
|
|
3703
|
-
});
|
|
3704
|
-
var SwapContainer$1 = /*#__PURE__*/styled('div', {
|
|
3705
|
-
display: 'flex',
|
|
3706
|
-
justifyContent: 'space-between',
|
|
3707
|
-
'@md': {
|
|
3708
|
-
padding: '$12'
|
|
3709
|
-
},
|
|
3710
|
-
'&:hover': {
|
|
3711
|
-
borderColor: '$primary'
|
|
3712
|
-
},
|
|
4107
|
+
backgroundColor: '$background',
|
|
3713
4108
|
variants: {
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
running: {
|
|
3719
|
-
borderColor: '$neutrals400'
|
|
4109
|
+
fixedHeight: {
|
|
4110
|
+
"true": {
|
|
4111
|
+
height: '595px',
|
|
4112
|
+
maxHeight: '595px'
|
|
3720
4113
|
},
|
|
3721
|
-
|
|
3722
|
-
|
|
4114
|
+
"false": {
|
|
4115
|
+
height: 'auto'
|
|
3723
4116
|
}
|
|
3724
4117
|
}
|
|
3725
4118
|
}
|
|
3726
4119
|
});
|
|
3727
|
-
|
|
4120
|
+
function SwapContainer(props) {
|
|
4121
|
+
var children = props.children,
|
|
4122
|
+
style = props.style,
|
|
4123
|
+
_props$fixedHeight = props.fixedHeight,
|
|
4124
|
+
fixedHeight = _props$fixedHeight === void 0 ? true : _props$fixedHeight;
|
|
4125
|
+
return React__default.createElement(MainContainer$2, {
|
|
4126
|
+
style: style,
|
|
4127
|
+
id: "swap-box",
|
|
4128
|
+
fixedHeight: fixedHeight
|
|
4129
|
+
}, children);
|
|
4130
|
+
}
|
|
4131
|
+
|
|
4132
|
+
var TokenContainer = /*#__PURE__*/styled('div', {
|
|
3728
4133
|
display: 'flex',
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
height: '0',
|
|
3734
|
-
width: '$20',
|
|
3735
|
-
border: '1px dashed $foreground',
|
|
3736
|
-
borderRadius: 'inherit',
|
|
3737
|
-
'@md': {
|
|
3738
|
-
width: '$36'
|
|
4134
|
+
alignItems: 'center',
|
|
4135
|
+
width: '160px',
|
|
4136
|
+
'& .amount': {
|
|
4137
|
+
fontWeight: 'bold'
|
|
3739
4138
|
},
|
|
3740
|
-
'
|
|
3741
|
-
|
|
4139
|
+
'& .estimated': {
|
|
4140
|
+
color: '$neutrals600'
|
|
3742
4141
|
}
|
|
3743
4142
|
});
|
|
3744
|
-
var
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
width: '$
|
|
3751
|
-
height: '$
|
|
4143
|
+
var TokenImage = /*#__PURE__*/styled('div', {
|
|
4144
|
+
position: 'relative',
|
|
4145
|
+
'.overlay': {
|
|
4146
|
+
position: 'absolute',
|
|
4147
|
+
right: -4,
|
|
4148
|
+
bottom: -4,
|
|
4149
|
+
width: '$16',
|
|
4150
|
+
height: '$16',
|
|
4151
|
+
padding: '$2',
|
|
4152
|
+
borderRadius: '50%',
|
|
4153
|
+
display: 'flex',
|
|
4154
|
+
justifyContent: 'center',
|
|
4155
|
+
alignItems: 'center',
|
|
4156
|
+
backgroundColor: '$background',
|
|
4157
|
+
border: '1px solid $neutrals400'
|
|
3752
4158
|
}
|
|
3753
4159
|
});
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
4160
|
+
function Token(props) {
|
|
4161
|
+
var _props$data = props.data,
|
|
4162
|
+
token = _props$data.token,
|
|
4163
|
+
blockchain = _props$data.blockchain,
|
|
4164
|
+
amount = _props$data.amount,
|
|
4165
|
+
estimatedAmount = _props$data.estimatedAmount;
|
|
4166
|
+
return React__default.createElement(TokenContainer, null, React__default.createElement(TokenImage, null, React__default.createElement(Image, {
|
|
4167
|
+
src: token.logo,
|
|
4168
|
+
alt: "",
|
|
4169
|
+
size: 24
|
|
4170
|
+
}), React__default.createElement("div", {
|
|
4171
|
+
className: "overlay"
|
|
4172
|
+
}, React__default.createElement(Image, {
|
|
4173
|
+
src: blockchain.logo,
|
|
4174
|
+
alt: blockchain.name,
|
|
4175
|
+
size: 12
|
|
4176
|
+
}))), React__default.createElement(Spacer, {
|
|
4177
|
+
size: 8
|
|
4178
|
+
}), !!amount && React__default.createElement("span", {
|
|
4179
|
+
className: "amount"
|
|
4180
|
+
}, props.data.amount), !amount && estimatedAmount && React__default.createElement("span", {
|
|
4181
|
+
className: "amount estimated"
|
|
4182
|
+
}, props.data.estimatedAmount), React__default.createElement(Spacer, {
|
|
4183
|
+
size: 4
|
|
4184
|
+
}), token.symbol);
|
|
4185
|
+
}
|
|
4186
|
+
|
|
4187
|
+
var Container$3 = /*#__PURE__*/styled('div', {
|
|
4188
|
+
position: 'relative',
|
|
3767
4189
|
display: 'flex',
|
|
3768
|
-
justifyContent: '
|
|
3769
|
-
'
|
|
3770
|
-
|
|
3771
|
-
|
|
4190
|
+
justifyContent: 'space-between',
|
|
4191
|
+
alignItems: 'center',
|
|
4192
|
+
padding: '$16 0',
|
|
4193
|
+
borderBottom: '1px solid $neutrals300',
|
|
4194
|
+
'& > .info': {
|
|
4195
|
+
display: 'flex',
|
|
4196
|
+
alignItems: 'center'
|
|
4197
|
+
},
|
|
4198
|
+
'.status': {
|
|
4199
|
+
textTransform: 'uppercase',
|
|
4200
|
+
fontWeight: 'bold',
|
|
4201
|
+
fontSize: '$12'
|
|
4202
|
+
},
|
|
4203
|
+
'&.failed .status': {
|
|
4204
|
+
color: '$error'
|
|
4205
|
+
},
|
|
4206
|
+
'&.success .status': {
|
|
4207
|
+
color: '$success'
|
|
3772
4208
|
}
|
|
3773
4209
|
});
|
|
3774
4210
|
function SwapDetail(_ref) {
|
|
@@ -3777,234 +4213,55 @@ function SwapDetail(_ref) {
|
|
|
3777
4213
|
onClick = _ref.onClick;
|
|
3778
4214
|
var firstStep = swap.steps[0];
|
|
3779
4215
|
var lastStep = swap.steps[swap.steps.length - 1];
|
|
3780
|
-
return React__default.createElement(
|
|
4216
|
+
return React__default.createElement(Button, {
|
|
4217
|
+
variant: "ghost",
|
|
4218
|
+
size: "free",
|
|
4219
|
+
fullWidth: true,
|
|
3781
4220
|
onClick: onClick.bind(null, swap.requestId)
|
|
3782
|
-
}, React__default.createElement(
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
blockchain: lastStep.toBlockchain,
|
|
3798
|
-
amount: lastStep.outputAmount
|
|
3799
|
-
})))), React__default.createElement(StatusContainer, null, status === 'running' ? React__default.createElement(TryAgainIcon, {
|
|
3800
|
-
size: 16
|
|
3801
|
-
}) : status === 'failed' ? React__default.createElement(InfoCircleIcon, {
|
|
3802
|
-
size: 18,
|
|
3803
|
-
color: "error"
|
|
3804
|
-
}) : React__default.createElement(CheckCircleIcon, {
|
|
3805
|
-
size: 18,
|
|
3806
|
-
color: "success"
|
|
3807
|
-
})));
|
|
3808
|
-
}
|
|
3809
|
-
|
|
3810
|
-
function VirtualizedList(props) {
|
|
3811
|
-
var itemCount = props.itemCount,
|
|
3812
|
-
hasNextPage = props.hasNextPage,
|
|
3813
|
-
loadNextPage = props.loadNextPage,
|
|
3814
|
-
Item = props.Item,
|
|
3815
|
-
innerElementType = props.innerElementType,
|
|
3816
|
-
size = props.size;
|
|
3817
|
-
var isItemLoaded = function isItemLoaded(index) {
|
|
3818
|
-
return !hasNextPage || index < itemCount;
|
|
3819
|
-
};
|
|
3820
|
-
return React__default.createElement(AutoSizer, null, function (_ref) {
|
|
3821
|
-
var width = _ref.width,
|
|
3822
|
-
height = _ref.height;
|
|
3823
|
-
return React__default.createElement(InfiniteLoader, {
|
|
3824
|
-
isItemLoaded: isItemLoaded,
|
|
3825
|
-
itemCount: hasNextPage ? itemCount + 1 : itemCount,
|
|
3826
|
-
loadMoreItems: loadNextPage,
|
|
3827
|
-
threshold: 1
|
|
3828
|
-
}, function (_ref2) {
|
|
3829
|
-
var onItemsRendered = _ref2.onItemsRendered,
|
|
3830
|
-
ref = _ref2.ref;
|
|
3831
|
-
return React__default.createElement(reactWindow.VariableSizeList, {
|
|
3832
|
-
innerElementType: innerElementType,
|
|
3833
|
-
ref: ref,
|
|
3834
|
-
itemSize: function itemSize() {
|
|
3835
|
-
return size;
|
|
3836
|
-
},
|
|
3837
|
-
itemCount: itemCount,
|
|
3838
|
-
height: height || 0,
|
|
3839
|
-
width: width || 0,
|
|
3840
|
-
onItemsRendered: onItemsRendered
|
|
3841
|
-
}, function (_ref3) {
|
|
3842
|
-
var index = _ref3.index,
|
|
3843
|
-
style = _ref3.style;
|
|
3844
|
-
return isItemLoaded(index) ? React__default.createElement(Item, {
|
|
3845
|
-
index: index,
|
|
3846
|
-
style: style
|
|
3847
|
-
}) : null;
|
|
3848
|
-
});
|
|
3849
|
-
});
|
|
3850
|
-
});
|
|
3851
|
-
}
|
|
3852
|
-
|
|
3853
|
-
var TokenImage = /*#__PURE__*/styled('img', {
|
|
3854
|
-
width: '$32',
|
|
3855
|
-
maxHeight: '$32',
|
|
3856
|
-
marginRight: '$16'
|
|
3857
|
-
});
|
|
3858
|
-
var TokenNameContainer = /*#__PURE__*/styled('div', {
|
|
3859
|
-
display: 'flex',
|
|
3860
|
-
flexDirection: 'column'
|
|
3861
|
-
});
|
|
3862
|
-
var TokenAmountContainer = /*#__PURE__*/styled('div', {
|
|
3863
|
-
display: 'flex',
|
|
3864
|
-
flexDirection: 'column',
|
|
3865
|
-
alignItems: 'flex-end'
|
|
3866
|
-
});
|
|
3867
|
-
function TokenItem(props) {
|
|
3868
|
-
var _token$balance;
|
|
3869
|
-
var token = props.token,
|
|
3870
|
-
style = props.style,
|
|
3871
|
-
onClick = props.onClick,
|
|
3872
|
-
selected = props.selected;
|
|
3873
|
-
return React__default.createElement("div", {
|
|
3874
|
-
style: _extends({
|
|
3875
|
-
display: 'flex',
|
|
3876
|
-
alignItems: 'center',
|
|
3877
|
-
width: '100%'
|
|
3878
|
-
}, style, {
|
|
3879
|
-
height: '48px',
|
|
3880
|
-
top: parseFloat(style == null ? void 0 : style.top) + 0 + "px"
|
|
3881
|
-
})
|
|
3882
|
-
}, React__default.createElement(Button, {
|
|
3883
|
-
variant: "outlined",
|
|
3884
|
-
size: "large",
|
|
3885
|
-
align: "start",
|
|
3886
|
-
onClick: onClick.bind(null, token),
|
|
3887
|
-
type: selected ? 'primary' : undefined,
|
|
3888
|
-
prefix: React__default.createElement(TokenImage, {
|
|
3889
|
-
src: token.image
|
|
3890
|
-
}),
|
|
3891
|
-
suffix: ((_token$balance = token.balance) == null ? void 0 : _token$balance.amount) && React__default.createElement(TokenAmountContainer, null, React__default.createElement(Typography, {
|
|
3892
|
-
variant: "body2"
|
|
3893
|
-
}, token.balance.amount), React__default.createElement(Typography, {
|
|
3894
|
-
variant: "caption"
|
|
3895
|
-
}, token.balance.usdValue + "$"))
|
|
3896
|
-
}, React__default.createElement(TokenNameContainer, null, React__default.createElement(Typography, {
|
|
3897
|
-
variant: "body1"
|
|
3898
|
-
}, token.symbol), React__default.createElement(Typography, {
|
|
3899
|
-
variant: "body2"
|
|
3900
|
-
}, token.name))));
|
|
3901
|
-
}
|
|
3902
|
-
|
|
3903
|
-
var _excluded$G = ["style"];
|
|
3904
|
-
var PAGE_SIZE = 20;
|
|
3905
|
-
function TokenList(props) {
|
|
3906
|
-
var list = props.list,
|
|
3907
|
-
searchedText = props.searchedText,
|
|
3908
|
-
onChange = props.onChange,
|
|
3909
|
-
multiSelect = props.multiSelect,
|
|
3910
|
-
selectedList = props.selectedList;
|
|
3911
|
-
var _useState = React.useState(props.selected),
|
|
3912
|
-
selected = _useState[0],
|
|
3913
|
-
setSelected = _useState[1];
|
|
3914
|
-
var changeSelected = function changeSelected(token) {
|
|
3915
|
-
setSelected(token);
|
|
3916
|
-
onChange(token);
|
|
3917
|
-
};
|
|
3918
|
-
var isSelected = function isSelected(token) {
|
|
3919
|
-
if (multiSelect && selectedList) {
|
|
3920
|
-
return selectedList === 'all' || selectedList.map(function (item) {
|
|
3921
|
-
return item.symbol + item.address;
|
|
3922
|
-
}).indexOf(token.symbol + token.address) > -1;
|
|
4221
|
+
}, React__default.createElement(Container$3, {
|
|
4222
|
+
className: "" + status
|
|
4223
|
+
}, React__default.createElement("div", {
|
|
4224
|
+
className: "info"
|
|
4225
|
+
}, React__default.createElement(Token, {
|
|
4226
|
+
data: {
|
|
4227
|
+
token: {
|
|
4228
|
+
logo: firstStep.fromLogo,
|
|
4229
|
+
symbol: firstStep.fromSymbol
|
|
4230
|
+
},
|
|
4231
|
+
blockchain: {
|
|
4232
|
+
logo: firstStep.fromBlockchainLogo || '',
|
|
4233
|
+
name: firstStep.fromBlockchain
|
|
4234
|
+
},
|
|
4235
|
+
amount: limitDecimalPlaces(swap.inputAmount)
|
|
3923
4236
|
}
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
var style = _ref.style,
|
|
3943
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$G);
|
|
3944
|
-
return React__default.createElement("div", Object.assign({
|
|
3945
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3946
|
-
ref: ref,
|
|
3947
|
-
style: _extends({}, style, {
|
|
3948
|
-
height: parseFloat(style == null ? void 0 : style.height) + 8 * 2 + "px"
|
|
3949
|
-
})
|
|
3950
|
-
}, rest));
|
|
3951
|
-
});
|
|
3952
|
-
return React__default.createElement("div", {
|
|
3953
|
-
style: {
|
|
3954
|
-
height: '450px'
|
|
4237
|
+
}), React__default.createElement(Spacer, {
|
|
4238
|
+
size: 12
|
|
4239
|
+
}), React__default.createElement(ArrowRightIcon, {
|
|
4240
|
+
size: 12
|
|
4241
|
+
}), React__default.createElement(Spacer, {
|
|
4242
|
+
size: 12
|
|
4243
|
+
}), React__default.createElement(Token, {
|
|
4244
|
+
data: {
|
|
4245
|
+
token: {
|
|
4246
|
+
logo: lastStep.toLogo,
|
|
4247
|
+
symbol: lastStep.toSymbol
|
|
4248
|
+
},
|
|
4249
|
+
blockchain: {
|
|
4250
|
+
logo: lastStep.toBlockchainLogo || '',
|
|
4251
|
+
name: lastStep.toBlockchain
|
|
4252
|
+
},
|
|
4253
|
+
amount: limitDecimalPlaces(lastStep.outputAmount || ''),
|
|
4254
|
+
estimatedAmount: limitDecimalPlaces(lastStep.expectedOutputAmountHumanReadable || '')
|
|
3955
4255
|
}
|
|
3956
|
-
}, React__default.createElement(
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
style: style,
|
|
3963
|
-
onClick: changeSelected,
|
|
3964
|
-
selected: isSelected(tokens[index])
|
|
3965
|
-
});
|
|
3966
|
-
},
|
|
3967
|
-
hasNextPage: hasNextPage,
|
|
3968
|
-
itemCount: tokens.length,
|
|
3969
|
-
loadNextPage: loadNextPage,
|
|
3970
|
-
innerElementType: innerElementType,
|
|
3971
|
-
size: 56
|
|
3972
|
-
}));
|
|
3973
|
-
}
|
|
3974
|
-
|
|
3975
|
-
var filterTokens = function filterTokens(list, searchedFor) {
|
|
3976
|
-
return list.filter(function (token) {
|
|
3977
|
-
return containsText(token.symbol, searchedFor) || containsText(token.address || '', searchedFor) || containsText(token.name || '', searchedFor);
|
|
3978
|
-
});
|
|
3979
|
-
};
|
|
3980
|
-
function TokenSelector(props) {
|
|
3981
|
-
var list = props.list,
|
|
3982
|
-
type = props.type,
|
|
3983
|
-
selected = props.selected,
|
|
3984
|
-
onChange = props.onChange,
|
|
3985
|
-
hasHeader = props.hasHeader,
|
|
3986
|
-
multiSelect = props.multiSelect,
|
|
3987
|
-
selectedList = props.selectedList,
|
|
3988
|
-
onBack = props.onBack;
|
|
3989
|
-
return React__default.createElement(SecondaryPage, {
|
|
3990
|
-
textField: true,
|
|
3991
|
-
textFieldPlaceholder: "Search Blockchain By Name",
|
|
3992
|
-
title: "Select " + type + " Token",
|
|
3993
|
-
hasHeader: hasHeader,
|
|
3994
|
-
onBack: onBack
|
|
3995
|
-
}, function (searchedFor) {
|
|
3996
|
-
return React__default.createElement(TokenList, {
|
|
3997
|
-
searchedText: searchedFor,
|
|
3998
|
-
list: filterTokens(list, searchedFor),
|
|
3999
|
-
selected: selected,
|
|
4000
|
-
selectedList: selectedList,
|
|
4001
|
-
multiSelect: multiSelect,
|
|
4002
|
-
onChange: onChange
|
|
4003
|
-
});
|
|
4004
|
-
});
|
|
4256
|
+
})), React__default.createElement("div", {
|
|
4257
|
+
className: "status"
|
|
4258
|
+
}, status === 'running' ? React__default.createElement(Spinner, {
|
|
4259
|
+
size: 24,
|
|
4260
|
+
color: "primary"
|
|
4261
|
+
}) : status)));
|
|
4005
4262
|
}
|
|
4006
4263
|
|
|
4007
|
-
var Container$
|
|
4264
|
+
var Container$4 = /*#__PURE__*/styled('div', {
|
|
4008
4265
|
position: 'relative'
|
|
4009
4266
|
});
|
|
4010
4267
|
var Color = /*#__PURE__*/styled('div', {
|
|
@@ -4054,7 +4311,7 @@ function ColorPicker(_ref) {
|
|
|
4054
4311
|
var _useState = React.useState(false),
|
|
4055
4312
|
displayColorPicker = _useState[0],
|
|
4056
4313
|
setDisplayColorPicker = _useState[1];
|
|
4057
|
-
return React__default.createElement(Container$
|
|
4314
|
+
return React__default.createElement(Container$4, null, React__default.createElement(Label$3, {
|
|
4058
4315
|
className: "_text"
|
|
4059
4316
|
}, label), React__default.createElement(Button, {
|
|
4060
4317
|
variant: "outlined",
|
|
@@ -4132,172 +4389,58 @@ var DrawerContainer = /*#__PURE__*/styled('div', {
|
|
|
4132
4389
|
}
|
|
4133
4390
|
}
|
|
4134
4391
|
});
|
|
4135
|
-
var DrawerHeader = /*#__PURE__*/styled('div', {
|
|
4136
|
-
display: 'flex',
|
|
4137
|
-
justifyContent: 'space-between',
|
|
4138
|
-
alignItems: 'center',
|
|
4139
|
-
position: 'relative',
|
|
4140
|
-
marginBottom: '$16'
|
|
4141
|
-
});
|
|
4142
|
-
var Body = /*#__PURE__*/styled('div', {
|
|
4143
|
-
overflowY: 'auto',
|
|
4144
|
-
height: '100%'
|
|
4145
|
-
});
|
|
4146
|
-
var Footer = /*#__PURE__*/styled('footer', {
|
|
4147
|
-
width: '100%',
|
|
4148
|
-
marginTop: '$28'
|
|
4149
|
-
});
|
|
4150
|
-
function Drawer(props) {
|
|
4151
|
-
var title = props.title,
|
|
4152
|
-
content = props.content,
|
|
4153
|
-
open = props.open,
|
|
4154
|
-
onClose = props.onClose,
|
|
4155
|
-
containerStyle = props.containerStyle,
|
|
4156
|
-
_props$anchor = props.anchor,
|
|
4157
|
-
anchor = _props$anchor === void 0 ? 'bottom' : _props$anchor,
|
|
4158
|
-
_props$showClose = props.showClose,
|
|
4159
|
-
showClose = _props$showClose === void 0 ? false : _props$showClose,
|
|
4160
|
-
footer = props.footer,
|
|
4161
|
-
container = props.container;
|
|
4162
|
-
var handleBackDropClick = function handleBackDropClick(event) {
|
|
4163
|
-
if (event.target === event.currentTarget) onClose();
|
|
4164
|
-
};
|
|
4165
|
-
return React__default.createElement(React__default.Fragment, null, open && container && reactDom.createPortal(React__default.createElement(BackDrop$1, {
|
|
4166
|
-
onClick: handleBackDropClick
|
|
4167
|
-
}, React__default.createElement(DrawerContainer, {
|
|
4168
|
-
anchor: anchor,
|
|
4169
|
-
style: containerStyle
|
|
4170
|
-
}, React__default.createElement(DrawerHeader, null, React__default.createElement(Typography, {
|
|
4171
|
-
variant: "h4"
|
|
4172
|
-
}, title), showClose && React__default.createElement(CloseIcon, {
|
|
4173
|
-
size: 24,
|
|
4174
|
-
onClick: onClose
|
|
4175
|
-
})), React__default.createElement(Body, null, content), React__default.createElement(Footer, null, footer))), container));
|
|
4176
|
-
}
|
|
4177
|
-
|
|
4178
|
-
var MainContainer$2 = /*#__PURE__*/styled('div', {
|
|
4179
|
-
overflow: 'hidden'
|
|
4180
|
-
});
|
|
4181
|
-
var Line$2 = /*#__PURE__*/styled('div', {
|
|
4182
|
-
width: '0',
|
|
4183
|
-
marginLeft: '$12',
|
|
4184
|
-
height: '36px',
|
|
4185
|
-
border: '1px dashed $foreground',
|
|
4186
|
-
borderRadius: 'inherit'
|
|
4187
|
-
});
|
|
4188
|
-
var SwapperContainer$1 = /*#__PURE__*/styled('div', {
|
|
4189
|
-
display: 'flex',
|
|
4190
|
-
alignItems: 'center',
|
|
4191
|
-
marginLeft: '6px'
|
|
4192
|
-
});
|
|
4193
|
-
var Fee = /*#__PURE__*/styled('div', {
|
|
4194
|
-
display: 'flex',
|
|
4195
|
-
alignItems: 'center'
|
|
4196
|
-
});
|
|
4197
|
-
var SwapperLogo$1 = /*#__PURE__*/styled('img', {
|
|
4198
|
-
width: '$16',
|
|
4199
|
-
height: '$16'
|
|
4200
|
-
});
|
|
4201
|
-
var RelativeContainer$1 = /*#__PURE__*/styled('div', {
|
|
4202
|
-
position: 'relative'
|
|
4203
|
-
});
|
|
4204
|
-
var Footer$1 = /*#__PURE__*/styled('div', {
|
|
4205
|
-
display: 'flex',
|
|
4206
|
-
alignItems: 'center'
|
|
4207
|
-
});
|
|
4208
|
-
var Dot$2 = /*#__PURE__*/styled('div', {
|
|
4209
|
-
width: '$8',
|
|
4210
|
-
height: '$8',
|
|
4211
|
-
backgroundColor: '$foreground',
|
|
4212
|
-
borderRadius: '4px',
|
|
4213
|
-
marginLeft: '$8'
|
|
4214
|
-
});
|
|
4215
|
-
var ArrowDown = /*#__PURE__*/styled('div', {
|
|
4216
|
-
width: '0px',
|
|
4217
|
-
height: '0px',
|
|
4218
|
-
borderLeft: '5px solid transparent',
|
|
4219
|
-
borderRight: '5px solid transparent',
|
|
4220
|
-
borderTop: '5px solid $foreground',
|
|
4221
|
-
marginLeft: '$8'
|
|
4222
|
-
});
|
|
4223
|
-
var BestRouteContainer$1 = /*#__PURE__*/styled('div', {
|
|
4224
|
-
overflow: 'auto'
|
|
4392
|
+
var DrawerHeader = /*#__PURE__*/styled('div', {
|
|
4393
|
+
display: 'flex',
|
|
4394
|
+
justifyContent: 'space-between',
|
|
4395
|
+
alignItems: 'center',
|
|
4396
|
+
position: 'relative',
|
|
4397
|
+
marginBottom: '$16'
|
|
4225
4398
|
});
|
|
4226
|
-
var
|
|
4227
|
-
|
|
4399
|
+
var Body = /*#__PURE__*/styled('div', {
|
|
4400
|
+
overflowY: 'auto',
|
|
4401
|
+
height: '100%'
|
|
4228
4402
|
});
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
}), warnings == null ? void 0 : warnings.map(function (warning, index) {
|
|
4260
|
-
return React__default.createElement(React__default.Fragment, null, React__default.createElement(Spacer, {
|
|
4261
|
-
direction: "vertical"
|
|
4262
|
-
}), React__default.createElement(Alert, {
|
|
4263
|
-
type: "warning",
|
|
4264
|
-
key: index
|
|
4265
|
-
}, warning));
|
|
4266
|
-
}))), React__default.createElement(BestRouteContainer$1, null, bestRoute == null ? void 0 : (_bestRoute$result = bestRoute.result) == null ? void 0 : _bestRoute$result.swaps.map(function (swap, index) {
|
|
4267
|
-
var _bestRoute$result2;
|
|
4268
|
-
return React__default.createElement(React.Fragment, {
|
|
4269
|
-
key: index
|
|
4270
|
-
}, index === 0 && React__default.createElement(RelativeContainer$1, null, React__default.createElement(StepDetail, {
|
|
4271
|
-
logo: swap.from.logo,
|
|
4272
|
-
symbol: swap.from.symbol,
|
|
4273
|
-
chainLogo: swap.from.blockchainLogo,
|
|
4274
|
-
blockchain: swap.from.blockchain,
|
|
4275
|
-
amount: swap.fromAmount
|
|
4276
|
-
}), React__default.createElement(Dot$2, null)), React__default.createElement(Line$2, null), React__default.createElement(SwapperContainer$1, null, React__default.createElement(SwapperLogo$1, {
|
|
4277
|
-
src: swap.swapperLogo,
|
|
4278
|
-
alt: swap.swapperId
|
|
4279
|
-
}), React__default.createElement("div", null, React__default.createElement(Typography, {
|
|
4280
|
-
ml: 4,
|
|
4281
|
-
variant: "caption"
|
|
4282
|
-
}, swap.swapperType, " from ", swap.from.symbol, " to", ' ', swap.to.symbol, " via ", swap.swapperId, ' '), React__default.createElement(Fee, null, React__default.createElement(GasIcon, null), React__default.createElement(Typography, {
|
|
4283
|
-
ml: 4,
|
|
4284
|
-
variant: "caption"
|
|
4285
|
-
}, "$", swap.feeInUsd, " estimated gas fee")))), React__default.createElement(Line$2, null), index + 1 === ((_bestRoute$result2 = bestRoute.result) == null ? void 0 : _bestRoute$result2.swaps.length) && React__default.createElement(ArrowDown, null), React__default.createElement(StepDetail, {
|
|
4286
|
-
logo: swap.to.logo,
|
|
4287
|
-
symbol: swap.to.symbol,
|
|
4288
|
-
chainLogo: swap.to.blockchainLogo,
|
|
4289
|
-
blockchain: swap.to.blockchain,
|
|
4290
|
-
amount: swap.toAmount
|
|
4291
|
-
}));
|
|
4292
|
-
}))));
|
|
4403
|
+
var Footer = /*#__PURE__*/styled('footer', {
|
|
4404
|
+
width: '100%',
|
|
4405
|
+
marginTop: '$28'
|
|
4406
|
+
});
|
|
4407
|
+
function Drawer(props) {
|
|
4408
|
+
var title = props.title,
|
|
4409
|
+
content = props.content,
|
|
4410
|
+
open = props.open,
|
|
4411
|
+
onClose = props.onClose,
|
|
4412
|
+
containerStyle = props.containerStyle,
|
|
4413
|
+
_props$anchor = props.anchor,
|
|
4414
|
+
anchor = _props$anchor === void 0 ? 'bottom' : _props$anchor,
|
|
4415
|
+
_props$showClose = props.showClose,
|
|
4416
|
+
showClose = _props$showClose === void 0 ? false : _props$showClose,
|
|
4417
|
+
footer = props.footer,
|
|
4418
|
+
container = props.container;
|
|
4419
|
+
var handleBackDropClick = function handleBackDropClick(event) {
|
|
4420
|
+
if (event.target === event.currentTarget) onClose();
|
|
4421
|
+
};
|
|
4422
|
+
return React__default.createElement(React__default.Fragment, null, open && container && reactDom.createPortal(React__default.createElement(BackDrop$1, {
|
|
4423
|
+
onClick: handleBackDropClick
|
|
4424
|
+
}, React__default.createElement(DrawerContainer, {
|
|
4425
|
+
anchor: anchor,
|
|
4426
|
+
style: containerStyle
|
|
4427
|
+
}, React__default.createElement(DrawerHeader, null, React__default.createElement(Typography, {
|
|
4428
|
+
variant: "h6"
|
|
4429
|
+
}, title), showClose && React__default.createElement(CloseIcon, {
|
|
4430
|
+
size: 24,
|
|
4431
|
+
onClick: onClose
|
|
4432
|
+
})), React__default.createElement(Body, null, content), React__default.createElement(Footer, null, footer))), container));
|
|
4293
4433
|
}
|
|
4294
4434
|
|
|
4435
|
+
var MainContainer$3 = /*#__PURE__*/styled('div', {
|
|
4436
|
+
overflowY: 'auto'
|
|
4437
|
+
});
|
|
4295
4438
|
var Section = /*#__PURE__*/styled('div', {
|
|
4296
4439
|
paddingBottom: '$32',
|
|
4297
4440
|
marginBottom: '$32',
|
|
4298
4441
|
borderBottom: '1px solid $neutrals400'
|
|
4299
4442
|
});
|
|
4300
|
-
var Footer$
|
|
4443
|
+
var Footer$1 = /*#__PURE__*/styled('div', {
|
|
4301
4444
|
display: 'flex',
|
|
4302
4445
|
alignItems: 'center'
|
|
4303
4446
|
});
|
|
@@ -4307,7 +4450,7 @@ var AlertContainer = /*#__PURE__*/styled('div', {
|
|
|
4307
4450
|
var ConfirmButton = /*#__PURE__*/styled(Button, {
|
|
4308
4451
|
marginTop: '$16'
|
|
4309
4452
|
});
|
|
4310
|
-
var Container$
|
|
4453
|
+
var Container$5 = /*#__PURE__*/styled('div', {
|
|
4311
4454
|
paddingBottom: '$24',
|
|
4312
4455
|
'.title': {
|
|
4313
4456
|
paddingBottom: '$8',
|
|
@@ -4327,7 +4470,10 @@ var Container$6 = /*#__PURE__*/styled('div', {
|
|
|
4327
4470
|
alignItems: 'center'
|
|
4328
4471
|
}
|
|
4329
4472
|
});
|
|
4330
|
-
|
|
4473
|
+
var Alerts = /*#__PURE__*/styled('div', {
|
|
4474
|
+
paddingBottom: '$16'
|
|
4475
|
+
});
|
|
4476
|
+
function ConfirmSwap(props) {
|
|
4331
4477
|
var onBack = props.onBack,
|
|
4332
4478
|
loading = props.loading,
|
|
4333
4479
|
onConfirm = props.onConfirm,
|
|
@@ -4336,27 +4482,53 @@ function ConfirmWallets(props) {
|
|
|
4336
4482
|
onChange = props.onChange,
|
|
4337
4483
|
confirmDisabled = props.confirmDisabled,
|
|
4338
4484
|
isExperimentalChain = props.isExperimentalChain,
|
|
4339
|
-
handleConnectChain = props.handleConnectChain
|
|
4485
|
+
handleConnectChain = props.handleConnectChain,
|
|
4486
|
+
confirmButtonTitle = props.confirmButtonTitle,
|
|
4487
|
+
errors = props.errors,
|
|
4488
|
+
warnings = props.warnings,
|
|
4489
|
+
extraMessages = props.extraMessages;
|
|
4340
4490
|
return React__default.createElement(SecondaryPage, {
|
|
4341
4491
|
textField: false,
|
|
4342
4492
|
title: "Confirm Swap",
|
|
4343
4493
|
onBack: onBack,
|
|
4344
|
-
Footer: React__default.createElement(Footer$
|
|
4494
|
+
Footer: React__default.createElement(Footer$1, null, React__default.createElement(ConfirmButton, {
|
|
4345
4495
|
fullWidth: true,
|
|
4346
4496
|
loading: loading,
|
|
4347
4497
|
type: "primary",
|
|
4348
4498
|
variant: "contained",
|
|
4349
4499
|
onClick: onConfirm,
|
|
4350
4500
|
disabled: confirmDisabled
|
|
4351
|
-
},
|
|
4352
|
-
},
|
|
4501
|
+
}, confirmButtonTitle))
|
|
4502
|
+
}, React__default.createElement(MainContainer$3, null, React__default.createElement("div", null, extraMessages || null, React__default.createElement(Alerts, null, errors == null ? void 0 : errors.map(function (error, index) {
|
|
4503
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(Spacer, {
|
|
4504
|
+
direction: "vertical"
|
|
4505
|
+
}), React__default.createElement(Alert, Object.assign({
|
|
4506
|
+
type: "error",
|
|
4507
|
+
key: index
|
|
4508
|
+
}, typeof error === 'string' ? {
|
|
4509
|
+
title: error
|
|
4510
|
+
} : {
|
|
4511
|
+
children: error
|
|
4512
|
+
})));
|
|
4513
|
+
}), warnings == null ? void 0 : warnings.map(function (warning, index) {
|
|
4514
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(Spacer, {
|
|
4515
|
+
direction: "vertical"
|
|
4516
|
+
}), React__default.createElement(Alert, Object.assign({
|
|
4517
|
+
type: "warning",
|
|
4518
|
+
key: index
|
|
4519
|
+
}, typeof warning === 'string' ? {
|
|
4520
|
+
title: warning
|
|
4521
|
+
} : {
|
|
4522
|
+
children: warning
|
|
4523
|
+
})));
|
|
4524
|
+
}))), props.previewInputs || props.previewRoutes ? React__default.createElement(Section, null, props.previewInputs, !!props.previewRoutes ? React__default.createElement(Spacer, {
|
|
4353
4525
|
size: 16,
|
|
4354
4526
|
direction: "vertical"
|
|
4355
4527
|
}) : null, props.previewRoutes) : null, requiredWallets.map(function (wallet, index) {
|
|
4356
4528
|
var list = selectableWallets.filter(function (w) {
|
|
4357
4529
|
return wallet === w.chain;
|
|
4358
4530
|
});
|
|
4359
|
-
return React__default.createElement(Container$
|
|
4531
|
+
return React__default.createElement(Container$5, {
|
|
4360
4532
|
key: index
|
|
4361
4533
|
}, React__default.createElement("div", {
|
|
4362
4534
|
className: "title"
|
|
@@ -4368,7 +4540,7 @@ function ConfirmWallets(props) {
|
|
|
4368
4540
|
variant: "body2"
|
|
4369
4541
|
}, "Your ", wallet, " Wallet")), list.length === 0 && React__default.createElement(React__default.Fragment, null, React__default.createElement(AlertContainer, null, React__default.createElement(Alert, {
|
|
4370
4542
|
type: "error"
|
|
4371
|
-
}, "You need to connect a compatible wallet with ", wallet)), (isExperimentalChain == null ? void 0 : isExperimentalChain(wallet)) && React__default.createElement(Button, {
|
|
4543
|
+
}, "You need to connect a compatible wallet with ", wallet, ".")), (isExperimentalChain == null ? void 0 : isExperimentalChain(wallet)) && React__default.createElement(Button, {
|
|
4372
4544
|
variant: "contained",
|
|
4373
4545
|
type: "primary",
|
|
4374
4546
|
align: "grow",
|
|
@@ -4379,101 +4551,202 @@ function ConfirmWallets(props) {
|
|
|
4379
4551
|
list: list,
|
|
4380
4552
|
onChange: onChange
|
|
4381
4553
|
}));
|
|
4382
|
-
}));
|
|
4383
|
-
}
|
|
4384
|
-
|
|
4385
|
-
function groupingOfSwaps(list) {
|
|
4386
|
-
return list.reduce(function (acc, swap) {
|
|
4387
|
-
var categoryIndex = acc.findIndex(function (item) {
|
|
4388
|
-
return swap.status === 'running' && item.title == 'Active Swaps' || swap.status !== 'running' && item.title == 'Recent Swaps';
|
|
4389
|
-
});
|
|
4390
|
-
if (categoryIndex > -1) {
|
|
4391
|
-
acc[categoryIndex].swaps.push(swap);
|
|
4392
|
-
} else {
|
|
4393
|
-
acc.push({
|
|
4394
|
-
title: swap.status === 'running' ? 'Active Swaps' : 'Recent Swaps',
|
|
4395
|
-
swaps: [swap]
|
|
4396
|
-
});
|
|
4397
|
-
}
|
|
4398
|
-
return acc;
|
|
4399
|
-
}, []);
|
|
4554
|
+
})));
|
|
4400
4555
|
}
|
|
4401
4556
|
|
|
4402
|
-
var BodyError = /*#__PURE__*/styled('div', {
|
|
4403
|
-
height: '100%',
|
|
4404
|
-
display: 'flex',
|
|
4405
|
-
justifyContent: 'center',
|
|
4406
|
-
alignItems: 'center'
|
|
4407
|
-
});
|
|
4408
|
-
var ErrorMsg$1 = /*#__PURE__*/styled(Typography, {
|
|
4409
|
-
color: '$error'
|
|
4410
|
-
});
|
|
4411
|
-
var filteredHistory = function filteredHistory(list, searchedFor) {
|
|
4412
|
-
return list.filter(function (swap) {
|
|
4413
|
-
var firstStep = swap.steps[0];
|
|
4414
|
-
var lastStep = swap.steps[swap.steps.length - 1];
|
|
4415
|
-
return containsText(firstStep.fromBlockchain, searchedFor) || containsText(firstStep.fromSymbol, searchedFor) || containsText(lastStep.toBlockchain, searchedFor) || containsText(lastStep.toSymbol, searchedFor) || containsText(swap.requestId, searchedFor);
|
|
4416
|
-
});
|
|
4417
|
-
};
|
|
4418
4557
|
var Group = /*#__PURE__*/styled('div', {
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
});
|
|
4423
|
-
var GroupTitle = /*#__PURE__*/styled(Typography, {
|
|
4424
|
-
color: '$neutrals500'
|
|
4558
|
+
'.group-title': {
|
|
4559
|
+
textTransform: 'uppercase'
|
|
4560
|
+
}
|
|
4425
4561
|
});
|
|
4426
|
-
|
|
4562
|
+
function SwapsGroup(props) {
|
|
4427
4563
|
var list = props.list,
|
|
4428
|
-
onSwapClick = props.onSwapClick
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4564
|
+
onSwapClick = props.onSwapClick,
|
|
4565
|
+
groupBy = props.groupBy;
|
|
4566
|
+
var groups = groupBy ? groupBy(list) : [{
|
|
4567
|
+
title: 'History',
|
|
4568
|
+
swaps: list
|
|
4569
|
+
}];
|
|
4570
|
+
return React__default.createElement(React__default.Fragment, null, groups.filter(function (group) {
|
|
4571
|
+
return group.swaps.length > 0;
|
|
4572
|
+
}).map(function (group, index) {
|
|
4573
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(Group, {
|
|
4432
4574
|
key: index
|
|
4433
|
-
}, React__default.createElement(
|
|
4434
|
-
variant: "body2"
|
|
4575
|
+
}, React__default.createElement(Typography, {
|
|
4576
|
+
variant: "body2",
|
|
4577
|
+
color: "neutrals600",
|
|
4578
|
+
className: "group-title"
|
|
4435
4579
|
}, group.title), group.swaps.map(function (swap, index) {
|
|
4436
|
-
return React__default.createElement(SwapDetail, {
|
|
4580
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(SwapDetail, {
|
|
4437
4581
|
key: index,
|
|
4438
4582
|
swap: swap,
|
|
4439
4583
|
status: swap.status,
|
|
4440
4584
|
onClick: onSwapClick
|
|
4441
|
-
})
|
|
4585
|
+
}), React__default.createElement(Divider, {
|
|
4586
|
+
size: 12
|
|
4587
|
+
}));
|
|
4588
|
+
})), React__default.createElement(Divider, {
|
|
4589
|
+
size: 24
|
|
4442
4590
|
}));
|
|
4443
4591
|
}));
|
|
4592
|
+
}
|
|
4593
|
+
|
|
4594
|
+
var Container$6 = /*#__PURE__*/styled('div', {
|
|
4595
|
+
overflowY: 'auto'
|
|
4596
|
+
});
|
|
4597
|
+
var filteredHistory = function filteredHistory(list, searchedFor) {
|
|
4598
|
+
return list.filter(function (swap) {
|
|
4599
|
+
var firstStep = swap.steps[0];
|
|
4600
|
+
var lastStep = swap.steps[swap.steps.length - 1];
|
|
4601
|
+
return containsText(firstStep.fromBlockchain, searchedFor) || containsText(firstStep.fromSymbol, searchedFor) || containsText(lastStep.toBlockchain, searchedFor) || containsText(lastStep.toSymbol, searchedFor) || containsText(swap.requestId, searchedFor);
|
|
4602
|
+
});
|
|
4444
4603
|
};
|
|
4445
|
-
function History(
|
|
4446
|
-
var
|
|
4447
|
-
list =
|
|
4448
|
-
onBack =
|
|
4449
|
-
onSwapClick =
|
|
4604
|
+
function History(props) {
|
|
4605
|
+
var _props$list = props.list,
|
|
4606
|
+
list = _props$list === void 0 ? [] : _props$list,
|
|
4607
|
+
onBack = props.onBack,
|
|
4608
|
+
onSwapClick = props.onSwapClick,
|
|
4609
|
+
groupBy = props.groupBy,
|
|
4610
|
+
loading = props.loading;
|
|
4450
4611
|
return React__default.createElement(SecondaryPage, {
|
|
4451
4612
|
onBack: onBack,
|
|
4452
4613
|
textField: true,
|
|
4453
|
-
textFieldPlaceholder: "Search
|
|
4614
|
+
textFieldPlaceholder: "Search by Network, Token or Request ID",
|
|
4454
4615
|
title: "Swaps"
|
|
4455
4616
|
}, function (searchedFor) {
|
|
4456
4617
|
var filterSwaps = filteredHistory(list, searchedFor);
|
|
4457
|
-
return
|
|
4618
|
+
return React__default.createElement(React__default.Fragment, null, loading && React__default.createElement(LoaderContainer, null, React__default.createElement(Spinner, {
|
|
4619
|
+
size: 24
|
|
4620
|
+
})), React__default.createElement(Container$6, null, !loading && React__default.createElement(React__default.Fragment, null, filterSwaps.length ? React__default.createElement(SwapsGroup, {
|
|
4458
4621
|
list: filterSwaps,
|
|
4459
|
-
onSwapClick: onSwapClick
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4622
|
+
onSwapClick: onSwapClick,
|
|
4623
|
+
groupBy: groupBy
|
|
4624
|
+
}) : React__default.createElement(NotFoundAlert, {
|
|
4625
|
+
catergory: "Swap"
|
|
4626
|
+
}))));
|
|
4463
4627
|
});
|
|
4464
4628
|
}
|
|
4465
4629
|
|
|
4630
|
+
var getAlertType = function getAlertType(messageType) {
|
|
4631
|
+
if (!messageType || messageType === 'info') return 'secondary';else return messageType;
|
|
4632
|
+
};
|
|
4633
|
+
var DetailedMessage = /*#__PURE__*/styled('div', {
|
|
4634
|
+
width: '90%',
|
|
4635
|
+
overflowWrap: 'break-word',
|
|
4636
|
+
color: '$error500 !important'
|
|
4637
|
+
});
|
|
4638
|
+
var SuccessText = /*#__PURE__*/styled(Typography, {
|
|
4639
|
+
color: '$success500 !important'
|
|
4640
|
+
});
|
|
4641
|
+
var SwapMessages = function SwapMessages(props) {
|
|
4642
|
+
var shortMessage = props.shortMessage,
|
|
4643
|
+
detailedMessage = props.detailedMessage,
|
|
4644
|
+
currentStepBlockchain = props.currentStepBlockchain,
|
|
4645
|
+
type = props.type,
|
|
4646
|
+
lastConvertedTokenInFailedSwap = props.lastConvertedTokenInFailedSwap;
|
|
4647
|
+
var _useState = React.useState(false),
|
|
4648
|
+
expandedMessage = _useState[0],
|
|
4649
|
+
setExpandedMessage = _useState[1];
|
|
4650
|
+
var allowedNumberOfChars = detailedMessage["long"] ? 0 : 150;
|
|
4651
|
+
var shouldShowMoreDetailsButton = !expandedMessage && detailedMessage.content.length > allowedNumberOfChars;
|
|
4652
|
+
return React__default.createElement(Alert, Object.assign({
|
|
4653
|
+
type: getAlertType(type),
|
|
4654
|
+
title: shortMessage
|
|
4655
|
+
}, shouldShowMoreDetailsButton && {
|
|
4656
|
+
footer: React__default.createElement(Button, {
|
|
4657
|
+
variant: "outlined",
|
|
4658
|
+
type: "primary",
|
|
4659
|
+
onClick: setExpandedMessage.bind(null, function (prevState) {
|
|
4660
|
+
return !prevState;
|
|
4661
|
+
})
|
|
4662
|
+
}, "Show more details")
|
|
4663
|
+
}, !!props.switchNetwork && {
|
|
4664
|
+
footer: React__default.createElement(Button, {
|
|
4665
|
+
variant: 'outlined',
|
|
4666
|
+
type: "primary",
|
|
4667
|
+
onClick: props.switchNetwork
|
|
4668
|
+
}, "Change network to ", currentStepBlockchain)
|
|
4669
|
+
}), !!detailedMessage.content ? React__default.createElement(DetailedMessage, null, React__default.createElement(Typography, {
|
|
4670
|
+
variant: "body3"
|
|
4671
|
+
}, shouldShowMoreDetailsButton && !expandedMessage ? detailedMessage.content.substring(0, allowedNumberOfChars) + (allowedNumberOfChars > 0 ? '...' : '') : detailedMessage.content)) : null, !!lastConvertedTokenInFailedSwap && React__default.createElement(React__default.Fragment, null, React__default.createElement("p", null, React__default.createElement(Typography, {
|
|
4672
|
+
variant: "body3"
|
|
4673
|
+
}, "Don't worry, your fund is\xA0"), React__default.createElement(SuccessText, {
|
|
4674
|
+
variant: "body3"
|
|
4675
|
+
}, React__default.createElement("b", null, "Safe"))), React__default.createElement("p", null, React__default.createElement(Typography, {
|
|
4676
|
+
variant: "body3"
|
|
4677
|
+
}, "It is converted to \xA0", React__default.createElement("u", null, lastConvertedTokenInFailedSwap.outputAmount), "\xA0"), React__default.createElement(SuccessText, {
|
|
4678
|
+
variant: "body3"
|
|
4679
|
+
}, React__default.createElement("b", null, lastConvertedTokenInFailedSwap.symbol, "\xA0")), React__default.createElement(Typography, {
|
|
4680
|
+
variant: "body3"
|
|
4681
|
+
}, "on your\xA0"), React__default.createElement(SuccessText, {
|
|
4682
|
+
variant: "body3"
|
|
4683
|
+
}, React__default.createElement("b", null, lastConvertedTokenInFailedSwap.blockchain, "\xA0")), React__default.createElement(Typography, {
|
|
4684
|
+
variant: "body3"
|
|
4685
|
+
}, "wallet"))));
|
|
4686
|
+
};
|
|
4687
|
+
|
|
4688
|
+
var _excluded$J = ["pendingSwap", "onBack", "onCopy", "isCopied", "onCancel", "date", "onRetry", "previewInputs"];
|
|
4689
|
+
var SwapperContainer$1 = /*#__PURE__*/styled('div', {
|
|
4690
|
+
display: 'flex',
|
|
4691
|
+
alignItems: 'center',
|
|
4692
|
+
paddingLeft: '$4',
|
|
4693
|
+
variants: {
|
|
4694
|
+
created: {
|
|
4695
|
+
"true": {
|
|
4696
|
+
filter: 'grayscale(100%)'
|
|
4697
|
+
}
|
|
4698
|
+
},
|
|
4699
|
+
running: {
|
|
4700
|
+
"true": {
|
|
4701
|
+
animation: pulse + " 2s ease-in-out infinite"
|
|
4702
|
+
}
|
|
4703
|
+
}
|
|
4704
|
+
}
|
|
4705
|
+
});
|
|
4706
|
+
var FeeContainer = /*#__PURE__*/styled('div', {
|
|
4707
|
+
paddingLeft: '$16'
|
|
4708
|
+
});
|
|
4709
|
+
var Fee = /*#__PURE__*/styled('div', {
|
|
4710
|
+
display: 'flex',
|
|
4711
|
+
alignItems: 'center'
|
|
4712
|
+
});
|
|
4713
|
+
var RelativeContainer$1 = /*#__PURE__*/styled('div', {
|
|
4714
|
+
position: 'relative'
|
|
4715
|
+
});
|
|
4716
|
+
var Dot$1 = /*#__PURE__*/styled('div', {
|
|
4717
|
+
width: '$8',
|
|
4718
|
+
height: '$8',
|
|
4719
|
+
backgroundColor: '$foreground',
|
|
4720
|
+
borderRadius: '4px',
|
|
4721
|
+
marginLeft: '11px'
|
|
4722
|
+
});
|
|
4723
|
+
var ArrowDown = /*#__PURE__*/styled('div', {
|
|
4724
|
+
width: '0px',
|
|
4725
|
+
height: '0px',
|
|
4726
|
+
borderLeft: '5px solid transparent',
|
|
4727
|
+
borderRight: '5px solid transparent',
|
|
4728
|
+
borderTop: '5px solid $foreground',
|
|
4729
|
+
marginLeft: '$10'
|
|
4730
|
+
});
|
|
4466
4731
|
var StyledAnchor = /*#__PURE__*/styled('a', {
|
|
4467
4732
|
color: '$primary',
|
|
4468
|
-
fontWeight: '$600'
|
|
4469
|
-
|
|
4733
|
+
fontWeight: '$600'
|
|
4734
|
+
});
|
|
4735
|
+
var SwapInfoContainer = /*#__PURE__*/styled('div', {
|
|
4736
|
+
display: 'flex',
|
|
4737
|
+
flexDirection: 'column',
|
|
4738
|
+
paddingBottom: '$16',
|
|
4739
|
+
borderBottom: '1px solid $neutrals300'
|
|
4470
4740
|
});
|
|
4471
4741
|
var InternalDetailsContainer = /*#__PURE__*/styled('div', {
|
|
4472
|
-
display: 'flex'
|
|
4742
|
+
display: 'flex',
|
|
4743
|
+
'.details': {
|
|
4744
|
+
padding: '$8 0'
|
|
4745
|
+
}
|
|
4473
4746
|
});
|
|
4474
4747
|
var InternalDetail = /*#__PURE__*/styled('div', {
|
|
4475
4748
|
display: 'flex',
|
|
4476
|
-
|
|
4749
|
+
margin: '$12 0 $12 $20'
|
|
4477
4750
|
});
|
|
4478
4751
|
var DescriptionContainer = /*#__PURE__*/styled('div', {
|
|
4479
4752
|
display: 'flex',
|
|
@@ -4481,152 +4754,174 @@ var DescriptionContainer = /*#__PURE__*/styled('div', {
|
|
|
4481
4754
|
});
|
|
4482
4755
|
var Description = /*#__PURE__*/styled(Typography, {
|
|
4483
4756
|
color: '$success',
|
|
4484
|
-
|
|
4485
|
-
});
|
|
4486
|
-
var Error = /*#__PURE__*/styled(Description, {
|
|
4487
|
-
color: '$error'
|
|
4757
|
+
paddingLeft: '$4'
|
|
4488
4758
|
});
|
|
4489
|
-
var Line$
|
|
4759
|
+
var Line$1 = /*#__PURE__*/styled('div', {
|
|
4490
4760
|
width: '0',
|
|
4491
4761
|
minHeight: '$16',
|
|
4492
|
-
marginLeft: '
|
|
4762
|
+
marginLeft: '14px',
|
|
4493
4763
|
border: '1px dashed $foreground',
|
|
4494
4764
|
borderRadius: 'inherit'
|
|
4495
4765
|
});
|
|
4496
|
-
var
|
|
4497
|
-
cursor: 'pointer',
|
|
4498
|
-
backgroundColor: '$neutrals200',
|
|
4499
|
-
padding: '$4',
|
|
4766
|
+
var Row$2 = /*#__PURE__*/styled('div', {
|
|
4500
4767
|
display: 'flex',
|
|
4501
|
-
justifyContent: '
|
|
4768
|
+
justifyContent: 'space-between',
|
|
4502
4769
|
alignItems: 'center',
|
|
4503
|
-
|
|
4504
|
-
|
|
4770
|
+
fontSize: '$14',
|
|
4771
|
+
padding: '$8 0',
|
|
4772
|
+
'.name': {
|
|
4773
|
+
color: '$neutrals600'
|
|
4774
|
+
},
|
|
4775
|
+
'.value': {
|
|
4776
|
+
display: 'flex',
|
|
4777
|
+
alignItems: 'center',
|
|
4778
|
+
color: '$neutrals800',
|
|
4779
|
+
justifyContent: 'flex-end'
|
|
4780
|
+
},
|
|
4781
|
+
'.status': {
|
|
4782
|
+
fontWeight: 'bold',
|
|
4783
|
+
textTransform: 'uppercase'
|
|
4784
|
+
},
|
|
4785
|
+
'.status.failed': {
|
|
4786
|
+
color: '$error'
|
|
4787
|
+
},
|
|
4788
|
+
'.status.success': {
|
|
4789
|
+
color: '$success'
|
|
4790
|
+
}
|
|
4505
4791
|
});
|
|
4506
|
-
var RequestId = /*#__PURE__*/styled(
|
|
4507
|
-
|
|
4792
|
+
var RequestId = /*#__PURE__*/styled('div', {
|
|
4793
|
+
width: '150px',
|
|
4794
|
+
whiteSpace: 'nowrap',
|
|
4795
|
+
overflow: 'hidden',
|
|
4796
|
+
textOverflow: 'ellipsis',
|
|
4797
|
+
'@md': {
|
|
4798
|
+
width: 'auto'
|
|
4799
|
+
}
|
|
4508
4800
|
});
|
|
4509
|
-
var
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4801
|
+
var ExtraDetails = /*#__PURE__*/styled('div', {
|
|
4802
|
+
padding: '0',
|
|
4803
|
+
color: '$neutrals600',
|
|
4804
|
+
fontSize: '$10'
|
|
4513
4805
|
});
|
|
4514
|
-
var
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
"true": {
|
|
4518
|
-
filter: 'grayscale(100%)'
|
|
4519
|
-
}
|
|
4520
|
-
},
|
|
4521
|
-
isRunning: {
|
|
4522
|
-
"true": {
|
|
4523
|
-
animation: pulse + " 2s ease-in-out infinite"
|
|
4524
|
-
}
|
|
4525
|
-
}
|
|
4526
|
-
}
|
|
4806
|
+
var SwapFlowContainer = /*#__PURE__*/styled('div', {
|
|
4807
|
+
overflowY: 'auto',
|
|
4808
|
+
padding: '$8 $4 $2 $4'
|
|
4527
4809
|
});
|
|
4528
4810
|
function SwapHistory(props) {
|
|
4529
4811
|
var pendingSwap = props.pendingSwap,
|
|
4530
4812
|
onBack = props.onBack,
|
|
4531
4813
|
onCopy = props.onCopy,
|
|
4532
4814
|
isCopied = props.isCopied,
|
|
4533
|
-
onCancel = props.onCancel
|
|
4815
|
+
onCancel = props.onCancel,
|
|
4816
|
+
date = props.date,
|
|
4817
|
+
onRetry = props.onRetry,
|
|
4818
|
+
extraMessageProps = _objectWithoutPropertiesLoose(props, _excluded$J);
|
|
4534
4819
|
var _useState = React.useState(false),
|
|
4535
4820
|
showDrawer = _useState[0],
|
|
4536
4821
|
setShowDrawer = _useState[1];
|
|
4537
4822
|
return React__default.createElement(SecondaryPage, {
|
|
4538
4823
|
title: "Swap Details",
|
|
4539
4824
|
textField: false,
|
|
4540
|
-
onBack: onBack
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4825
|
+
onBack: onBack,
|
|
4826
|
+
Footer: React__default.createElement(React__default.Fragment, null, (pendingSwap == null ? void 0 : pendingSwap.status) === 'running' && React__default.createElement(Button, {
|
|
4827
|
+
variant: "outlined",
|
|
4828
|
+
fullWidth: true,
|
|
4829
|
+
type: "error",
|
|
4830
|
+
onClick: setShowDrawer.bind(null, true)
|
|
4831
|
+
}, "Cancel"), !!onRetry && React__default.createElement(Button, {
|
|
4832
|
+
variant: "contained",
|
|
4833
|
+
fullWidth: true,
|
|
4834
|
+
type: "primary",
|
|
4835
|
+
onClick: onRetry
|
|
4836
|
+
}, "Try again"))
|
|
4837
|
+
}, React__default.createElement("div", null, React__default.createElement(SwapInfoContainer, null, React__default.createElement(Row$2, null, React__default.createElement("div", {
|
|
4838
|
+
className: "name"
|
|
4839
|
+
}, "Request Id:", React__default.createElement("span", {
|
|
4840
|
+
className: "value requestId",
|
|
4548
4841
|
onClick: onCopy.bind(null, pendingSwap == null ? void 0 : pendingSwap.requestId)
|
|
4549
|
-
}, React__default.createElement(RequestId, {
|
|
4550
|
-
|
|
4551
|
-
}
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
}
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
}, pendingSwap == null ? void 0 : pendingSwap.steps.map(function (step, index) {
|
|
4565
|
-
return React__default.createElement(
|
|
4566
|
-
key: index
|
|
4567
|
-
hasNotStarted: step.status === 'created',
|
|
4568
|
-
isRunning: step.status != 'failed' && step.status != 'success' && step.status != 'created'
|
|
4842
|
+
}, React__default.createElement(RequestId, null, pendingSwap == null ? void 0 : pendingSwap.requestId), React__default.createElement(Spacer, {
|
|
4843
|
+
size: 4
|
|
4844
|
+
}), React__default.createElement(Button, {
|
|
4845
|
+
type: "primary",
|
|
4846
|
+
variant: "ghost",
|
|
4847
|
+
size: "compact"
|
|
4848
|
+
}, isCopied ? 'Copied!' : 'Copy'))), React__default.createElement("div", {
|
|
4849
|
+
className: "name"
|
|
4850
|
+
}, React__default.createElement("span", {
|
|
4851
|
+
className: "value status " + ((pendingSwap == null ? void 0 : pendingSwap.status) || '')
|
|
4852
|
+
}, pendingSwap == null ? void 0 : pendingSwap.status, (pendingSwap == null ? void 0 : pendingSwap.status) === 'running' && React__default.createElement(Spinner, {
|
|
4853
|
+
size: 16,
|
|
4854
|
+
color: "primary"
|
|
4855
|
+
})), React__default.createElement(ExtraDetails, null, date))))), React__default.createElement(SwapFlowContainer, null, extraMessageProps.shortMessage && React__default.createElement(SwapMessages, Object.assign({}, extraMessageProps)), React__default.createElement(Divider, {
|
|
4856
|
+
size: 16
|
|
4857
|
+
}), pendingSwap == null ? void 0 : pendingSwap.steps.map(function (step, index) {
|
|
4858
|
+
return React__default.createElement("div", {
|
|
4859
|
+
key: index
|
|
4569
4860
|
}, index === 0 && React__default.createElement(RelativeContainer$1, null, React__default.createElement(StepDetail, {
|
|
4570
4861
|
logo: step.fromLogo,
|
|
4571
4862
|
symbol: step.fromSymbol,
|
|
4572
|
-
chainLogo: step.fromBlockchainLogo,
|
|
4863
|
+
chainLogo: step.fromBlockchainLogo || '',
|
|
4573
4864
|
blockchain: step.fromBlockchain,
|
|
4574
4865
|
amount: pendingSwap.inputAmount
|
|
4575
|
-
}), React__default.createElement(Dot$
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
}
|
|
4579
|
-
|
|
4866
|
+
}), React__default.createElement(Dot$1, null)), React__default.createElement(Line$1, null), React__default.createElement(SwapperContainer$1, {
|
|
4867
|
+
created: step.status === 'created',
|
|
4868
|
+
running: !['created', 'success', 'failed'].includes(step.status)
|
|
4869
|
+
}, React__default.createElement(Image, {
|
|
4870
|
+
src: step.swapperLogo || '',
|
|
4871
|
+
alt: step.swapperId,
|
|
4872
|
+
size: 20
|
|
4873
|
+
}), React__default.createElement(FeeContainer, null, React__default.createElement(Typography, {
|
|
4580
4874
|
variant: "caption"
|
|
4581
|
-
}, step.swapperType
|
|
4582
|
-
ml: 4,
|
|
4875
|
+
}, step.swapperType === 'DEX' ? 'Swap' : 'Bridge', " via", ' ', step.swapperId), React__default.createElement(Fee, null, React__default.createElement(GasIcon, null), React__default.createElement(Typography, {
|
|
4583
4876
|
variant: "caption"
|
|
4584
|
-
}, "$", step.feeInUsd, " estimated gas fee")))), React__default.createElement("div", {
|
|
4877
|
+
}, "\xA0 $", step.feeInUsd, " estimated gas fee")))), React__default.createElement("div", {
|
|
4585
4878
|
style: {
|
|
4586
4879
|
display: 'flex'
|
|
4587
4880
|
}
|
|
4588
|
-
}, React__default.createElement(InternalDetailsContainer, null, React__default.createElement(Line$
|
|
4881
|
+
}, React__default.createElement(InternalDetailsContainer, null, React__default.createElement(Line$1, null), React__default.createElement("div", {
|
|
4882
|
+
className: "details"
|
|
4883
|
+
}, !!step.explorerUrl && React__default.createElement("div", null, step.explorerUrl.map(function (item, index) {
|
|
4589
4884
|
return React__default.createElement(InternalDetail, {
|
|
4590
4885
|
key: index
|
|
4591
|
-
}, React__default.createElement(DescriptionContainer, null, React__default.createElement(
|
|
4592
|
-
|
|
4886
|
+
}, React__default.createElement(DescriptionContainer, null, React__default.createElement(Divider, {
|
|
4887
|
+
size: 4
|
|
4888
|
+
}), React__default.createElement(CheckCircleIcon, {
|
|
4889
|
+
color: "primary"
|
|
4593
4890
|
}), React__default.createElement(Description, {
|
|
4594
|
-
variant: "
|
|
4595
|
-
},
|
|
4891
|
+
variant: "body3"
|
|
4892
|
+
}, React__default.createElement(StyledAnchor, {
|
|
4596
4893
|
href: item.url,
|
|
4597
4894
|
target: "_blank",
|
|
4598
4895
|
rel: "noreferrer",
|
|
4599
4896
|
key: index
|
|
4600
|
-
}, "
|
|
4601
|
-
}), step.status === 'failed' && React__default.createElement(InternalDetail, null, React__default.createElement(DescriptionContainer, null, React__default.createElement(InfoCircleIcon, {
|
|
4897
|
+
}, !item.description ? React__default.createElement("b", null, "View transaction") : React__default.createElement("b", null, item.description.substring(0, 1).toUpperCase(), item.description.substring(1), " Tx")))));
|
|
4898
|
+
})), step.status === 'failed' && React__default.createElement(InternalDetail, null, React__default.createElement(DescriptionContainer, null, React__default.createElement(InfoCircleIcon, {
|
|
4602
4899
|
color: "error"
|
|
4603
|
-
}), React__default.createElement(
|
|
4604
|
-
variant: "
|
|
4900
|
+
}), React__default.createElement(Description, {
|
|
4901
|
+
variant: "body3",
|
|
4902
|
+
color: "$error500"
|
|
4605
4903
|
}, "Step failed")))))), index + 1 === pendingSwap.steps.length && React__default.createElement(ArrowDown, null), React__default.createElement(StepDetail, {
|
|
4606
4904
|
logo: step.toLogo,
|
|
4607
4905
|
symbol: step.toSymbol,
|
|
4608
|
-
chainLogo: step.toBlockchainLogo,
|
|
4906
|
+
chainLogo: step.toBlockchainLogo || '',
|
|
4609
4907
|
blockchain: step.toBlockchain,
|
|
4610
|
-
amount: step.outputAmount
|
|
4908
|
+
amount: step.outputAmount || '',
|
|
4909
|
+
estimatedAmount: step.expectedOutputAmountHumanReadable || '',
|
|
4910
|
+
success: step.status === 'success'
|
|
4611
4911
|
}));
|
|
4612
|
-
}),
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
onClick: setShowDrawer.bind(null, true)
|
|
4616
|
-
}, "Cancel")))), React__default.createElement(Drawer, {
|
|
4912
|
+
}), React__default.createElement(Divider, {
|
|
4913
|
+
size: 32
|
|
4914
|
+
})), React__default.createElement(Drawer, {
|
|
4617
4915
|
onClose: setShowDrawer.bind(null, false),
|
|
4618
4916
|
open: showDrawer,
|
|
4619
4917
|
showClose: true,
|
|
4620
4918
|
anchor: "bottom",
|
|
4621
4919
|
title: "Cancel Progress",
|
|
4622
|
-
content: React__default.createElement(
|
|
4920
|
+
content: React__default.createElement(Alert, {
|
|
4623
4921
|
type: "warning"
|
|
4624
4922
|
}, React__default.createElement(Typography, {
|
|
4625
4923
|
variant: "body2"
|
|
4626
|
-
},
|
|
4627
|
-
size: 12,
|
|
4628
|
-
direction: "vertical"
|
|
4629
|
-
}), React__default.createElement("p", null, "If you have already signed your transaction to blockchain, you should wait for that to complete or rollback")))),
|
|
4924
|
+
}, "Warning: Cancel ", React__default.createElement("u", null, "doesn't revert"), " your transaction if you've already signed and sent a transaction to the blockchain. It only stops next steps from being executed.")),
|
|
4630
4925
|
footer: React__default.createElement("div", {
|
|
4631
4926
|
style: {
|
|
4632
4927
|
display: 'flex',
|
|
@@ -4659,6 +4954,7 @@ exports.AngleDownIcon = AngleDownIcon;
|
|
|
4659
4954
|
exports.AngleLeftIcon = AngleLeftIcon;
|
|
4660
4955
|
exports.AngleRightIcon = AngleRightIcon;
|
|
4661
4956
|
exports.AngleUpIcon = AngleUpIcon;
|
|
4957
|
+
exports.ArrowRightIcon = ArrowRightIcon;
|
|
4662
4958
|
exports.BagIcon = BagIcon;
|
|
4663
4959
|
exports.BanIcon = BanIcon;
|
|
4664
4960
|
exports.BestRoute = BestRoute;
|
|
@@ -4674,21 +4970,24 @@ exports.Chip = Chip;
|
|
|
4674
4970
|
exports.CloseIcon = CloseIcon;
|
|
4675
4971
|
exports.ColorPicker = ColorPicker;
|
|
4676
4972
|
exports.ConfirmSwap = ConfirmSwap;
|
|
4677
|
-
exports.ConfirmWallets = ConfirmWallets;
|
|
4678
4973
|
exports.ConnectWalletsModal = ConnectWalletsModal;
|
|
4679
4974
|
exports.CopyIcon = CopyIcon;
|
|
4680
4975
|
exports.DeleteCircleIcon = DeleteCircleIcon;
|
|
4681
4976
|
exports.DeleteWalletIcon = DeleteWalletIcon;
|
|
4682
4977
|
exports.DisconnectIcon = DisconnectIcon;
|
|
4978
|
+
exports.Divider = Divider;
|
|
4683
4979
|
exports.DownloadIcon = DownloadIcon;
|
|
4684
4980
|
exports.Drawer = Drawer;
|
|
4685
4981
|
exports.FilledCircle = FilledCircle;
|
|
4686
4982
|
exports.GasIcon = GasIcon;
|
|
4983
|
+
exports.Header = Header;
|
|
4687
4984
|
exports.History = History;
|
|
4688
4985
|
exports.HistoryIcon = HistoryIcon;
|
|
4689
4986
|
exports.HorizontalSwapIcon = HorizontalSwapIcon;
|
|
4987
|
+
exports.Image = Image;
|
|
4690
4988
|
exports.InfoCircleIcon = InfoCircleIcon;
|
|
4691
4989
|
exports.LiquiditySourcesSelector = LiquiditySourcesSelector;
|
|
4990
|
+
exports.LoadingFailedAlert = LoadingFailedAlert;
|
|
4692
4991
|
exports.MinusCircleIcon = MinusCircleIcon;
|
|
4693
4992
|
exports.Modal = Modal;
|
|
4694
4993
|
exports.Radio = Radio;
|
|
@@ -4709,6 +5008,7 @@ exports.SwapContainer = SwapContainer;
|
|
|
4709
5008
|
exports.SwapDetail = SwapDetail;
|
|
4710
5009
|
exports.SwapHistory = SwapHistory;
|
|
4711
5010
|
exports.SwapWalletIcon = SwapWalletIcon;
|
|
5011
|
+
exports.SwapsGroup = SwapsGroup;
|
|
4712
5012
|
exports.Switch = Switch;
|
|
4713
5013
|
exports.TextField = TextField;
|
|
4714
5014
|
exports.TimeIcon = TimeIcon;
|