@rango-dev/ui 0.1.10-next.92 → 0.1.11-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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/SwapContainer/SwapContainer.d.ts +1 -0
- package/dist/components/SwapDetail/Token.d.ts +16 -0
- package/dist/components/TokenList/TokenList.d.ts +2 -2
- package/dist/components/TokenSelector/TokenSelector.d.ts +4 -3
- package/dist/components/index.d.ts +2 -0
- package/dist/containers/ConfirmSwap/ConfirmSwap.d.ts +10 -17
- 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 +6 -1
- package/dist/containers/History/index.d.ts +1 -1
- 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 +1 -0
- package/dist/types/meta.d.ts +1 -0
- package/dist/ui.cjs.development.js +1069 -857
- 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 +1068 -859
- 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/mock.ts +10 -0
- package/src/components/BlockchainSelector/BlockchainSelector.tsx +13 -19
- 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/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/index.ts +1 -0
- package/src/components/LiquiditySourceList/LiquiditySourceList.tsx +72 -22
- 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 +5 -0
- package/src/components/SelectableWalletList/mock.ts +4 -3
- package/src/components/Settings/Settings.tsx +30 -11
- package/src/components/StatusDrawer/StatusDrawer.tsx +1 -0
- package/src/components/StepDetail/StepDetail.tsx +1 -0
- package/src/components/SwapContainer/SwapContainer.tsx +21 -16
- package/src/components/SwapDetail/SwapDetail.tsx +77 -115
- package/src/components/SwapDetail/Token.tsx +68 -0
- package/src/components/SwapDetail/mock.ts +1 -0
- package/src/components/TextField/TextField.tsx +1 -0
- package/src/components/TokenList/TokenItem.tsx +4 -1
- package/src/components/TokenList/TokenList.tsx +18 -21
- package/src/components/TokenSelector/TokenSelector.tsx +38 -25
- package/src/components/Wallet/Wallet.tsx +1 -1
- package/src/components/index.ts +2 -0
- package/src/containers/ConfirmSwap/ConfirmSwap.stories.tsx +11 -2
- package/src/containers/ConfirmSwap/ConfirmSwap.tsx +103 -117
- package/src/containers/ConfirmSwap/mock.ts +79 -2
- package/src/containers/History/History.tsx +57 -38
- package/src/containers/History/index.ts +1 -1
- package/src/containers/History/mock.ts +1 -0
- package/src/containers/History/types.tsx +2 -30
- package/src/containers/SwapHistory/SwapHistory.tsx +313 -165
- 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 +14 -0
- 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() {
|
|
@@ -871,11 +871,42 @@ ChevronRightIcon.toString = function () {
|
|
|
871
871
|
};
|
|
872
872
|
|
|
873
873
|
var _excluded$m = ["size", "color"];
|
|
874
|
-
var
|
|
874
|
+
var ArrowRightIcon = function ArrowRightIcon(_ref) {
|
|
875
875
|
var _ref$size = _ref.size,
|
|
876
876
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
877
877
|
color = _ref.color,
|
|
878
878
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$m);
|
|
879
|
+
return React.createElement(SvgWithStrokeColor, Object.assign({
|
|
880
|
+
width: size,
|
|
881
|
+
height: size,
|
|
882
|
+
viewBox: "0 0 24 24",
|
|
883
|
+
color: color,
|
|
884
|
+
fill: "none",
|
|
885
|
+
stroke: "currentColor",
|
|
886
|
+
"stroke-width": "2",
|
|
887
|
+
"stroke-linecap": "round",
|
|
888
|
+
"stroke-linejoin": "round",
|
|
889
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
890
|
+
className: "_icon"
|
|
891
|
+
}, props), React.createElement("line", {
|
|
892
|
+
x1: "5",
|
|
893
|
+
y1: "12",
|
|
894
|
+
x2: "19",
|
|
895
|
+
y2: "12"
|
|
896
|
+
}), React.createElement("polyline", {
|
|
897
|
+
points: "12 5 19 12 12 19"
|
|
898
|
+
}));
|
|
899
|
+
};
|
|
900
|
+
ArrowRightIcon.toString = function () {
|
|
901
|
+
return '._icon';
|
|
902
|
+
};
|
|
903
|
+
|
|
904
|
+
var _excluded$n = ["size", "color"];
|
|
905
|
+
var RetryRightIcon = function RetryRightIcon(_ref) {
|
|
906
|
+
var _ref$size = _ref.size,
|
|
907
|
+
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
908
|
+
color = _ref.color,
|
|
909
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$n);
|
|
879
910
|
return React.createElement(SvgWithStrokeColor, Object.assign({
|
|
880
911
|
width: size,
|
|
881
912
|
height: size,
|
|
@@ -895,12 +926,12 @@ RetryRightIcon.toString = function () {
|
|
|
895
926
|
return '._icon';
|
|
896
927
|
};
|
|
897
928
|
|
|
898
|
-
var _excluded$
|
|
929
|
+
var _excluded$o = ["size", "color"];
|
|
899
930
|
var RetryLeftIcon = function RetryLeftIcon(_ref) {
|
|
900
931
|
var _ref$size = _ref.size,
|
|
901
932
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
902
933
|
color = _ref.color,
|
|
903
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
934
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$o);
|
|
904
935
|
return React.createElement(SvgWithStrokeColor, Object.assign({
|
|
905
936
|
width: size,
|
|
906
937
|
height: size,
|
|
@@ -920,12 +951,12 @@ RetryLeftIcon.toString = function () {
|
|
|
920
951
|
return '._icon';
|
|
921
952
|
};
|
|
922
953
|
|
|
923
|
-
var _excluded$
|
|
954
|
+
var _excluded$p = ["size", "color"];
|
|
924
955
|
var TryAgainIcon = function TryAgainIcon(_ref) {
|
|
925
956
|
var _ref$size = _ref.size,
|
|
926
957
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
927
958
|
color = _ref.color,
|
|
928
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
959
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$p);
|
|
929
960
|
return React.createElement(SvgWithStrokeColor, Object.assign({
|
|
930
961
|
width: size,
|
|
931
962
|
height: size,
|
|
@@ -945,12 +976,12 @@ TryAgainIcon.toString = function () {
|
|
|
945
976
|
return '._icon';
|
|
946
977
|
};
|
|
947
978
|
|
|
948
|
-
var _excluded$
|
|
979
|
+
var _excluded$q = ["size", "color"];
|
|
949
980
|
var VerticalSwapIcon = function VerticalSwapIcon(_ref) {
|
|
950
981
|
var _ref$size = _ref.size,
|
|
951
982
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
952
983
|
color = _ref.color,
|
|
953
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
984
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
|
|
954
985
|
return React.createElement(SvgWithStrokeColor, Object.assign({
|
|
955
986
|
width: size,
|
|
956
987
|
height: size,
|
|
@@ -976,12 +1007,12 @@ VerticalSwapIcon.toString = function () {
|
|
|
976
1007
|
return '._icon';
|
|
977
1008
|
};
|
|
978
1009
|
|
|
979
|
-
var _excluded$
|
|
1010
|
+
var _excluded$r = ["size", "color"];
|
|
980
1011
|
var HorizontalSwapIcon = function HorizontalSwapIcon(_ref) {
|
|
981
1012
|
var _ref$size = _ref.size,
|
|
982
1013
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
983
1014
|
color = _ref.color,
|
|
984
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1015
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$r);
|
|
985
1016
|
return React.createElement(SvgWithStrokeColor, Object.assign({
|
|
986
1017
|
width: size,
|
|
987
1018
|
height: size,
|
|
@@ -1007,13 +1038,13 @@ HorizontalSwapIcon.toString = function () {
|
|
|
1007
1038
|
return '._icon';
|
|
1008
1039
|
};
|
|
1009
1040
|
|
|
1010
|
-
var _excluded$
|
|
1041
|
+
var _excluded$s = ["color", "size"];
|
|
1011
1042
|
var RetryIcon = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
|
|
1012
1043
|
var _ref$color = _ref.color,
|
|
1013
1044
|
color = _ref$color === void 0 ? 'black' : _ref$color,
|
|
1014
1045
|
_ref$size = _ref.size,
|
|
1015
1046
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1016
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1047
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
|
1017
1048
|
return React.createElement(SvgWithStrokeColor, Object.assign({
|
|
1018
1049
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1019
1050
|
width: size,
|
|
@@ -1038,12 +1069,12 @@ RetryIcon.toString = function () {
|
|
|
1038
1069
|
return '._icon';
|
|
1039
1070
|
};
|
|
1040
1071
|
|
|
1041
|
-
var _excluded$
|
|
1072
|
+
var _excluded$t = ["size", "color"];
|
|
1042
1073
|
var WalletIcon = function WalletIcon(_ref) {
|
|
1043
1074
|
var _ref$size = _ref.size,
|
|
1044
1075
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1045
1076
|
color = _ref.color,
|
|
1046
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1077
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$t);
|
|
1047
1078
|
return React.createElement(SvgWithFillColor, Object.assign({
|
|
1048
1079
|
width: size,
|
|
1049
1080
|
height: size,
|
|
@@ -1070,12 +1101,12 @@ WalletIcon.toString = function () {
|
|
|
1070
1101
|
return '._icon';
|
|
1071
1102
|
};
|
|
1072
1103
|
|
|
1073
|
-
var _excluded$
|
|
1104
|
+
var _excluded$u = ["size", "color"];
|
|
1074
1105
|
var AddWalletIcon = function AddWalletIcon(_ref) {
|
|
1075
1106
|
var _ref$size = _ref.size,
|
|
1076
1107
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1077
1108
|
color = _ref.color,
|
|
1078
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1109
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$u);
|
|
1079
1110
|
return React.createElement(SvgWithFillColor, Object.assign({
|
|
1080
1111
|
width: size,
|
|
1081
1112
|
height: size,
|
|
@@ -1110,12 +1141,12 @@ AddWalletIcon.toString = function () {
|
|
|
1110
1141
|
return '._icon';
|
|
1111
1142
|
};
|
|
1112
1143
|
|
|
1113
|
-
var _excluded$
|
|
1144
|
+
var _excluded$v = ["size", "color"];
|
|
1114
1145
|
var DeleteWalletIcon = function DeleteWalletIcon(_ref) {
|
|
1115
1146
|
var _ref$size = _ref.size,
|
|
1116
1147
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1117
1148
|
color = _ref.color,
|
|
1118
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1149
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$v);
|
|
1119
1150
|
return React.createElement(SvgWithFillColor, Object.assign({
|
|
1120
1151
|
width: size,
|
|
1121
1152
|
height: size,
|
|
@@ -1150,12 +1181,12 @@ DeleteWalletIcon.toString = function () {
|
|
|
1150
1181
|
return '._icon';
|
|
1151
1182
|
};
|
|
1152
1183
|
|
|
1153
|
-
var _excluded$
|
|
1184
|
+
var _excluded$w = ["size", "color"];
|
|
1154
1185
|
var CheckWalletIcon = function CheckWalletIcon(_ref) {
|
|
1155
1186
|
var _ref$size = _ref.size,
|
|
1156
1187
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1157
1188
|
color = _ref.color,
|
|
1158
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1189
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$w);
|
|
1159
1190
|
return React.createElement(SvgWithFillColor, Object.assign({
|
|
1160
1191
|
width: size,
|
|
1161
1192
|
height: size,
|
|
@@ -1186,12 +1217,12 @@ CheckWalletIcon.toString = function () {
|
|
|
1186
1217
|
return '._icon';
|
|
1187
1218
|
};
|
|
1188
1219
|
|
|
1189
|
-
var _excluded$
|
|
1220
|
+
var _excluded$x = ["size", "color"];
|
|
1190
1221
|
var SwapWalletIcon = function SwapWalletIcon(_ref) {
|
|
1191
1222
|
var _ref$size = _ref.size,
|
|
1192
1223
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1193
1224
|
color = _ref.color,
|
|
1194
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1225
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$x);
|
|
1195
1226
|
return React.createElement(SvgWithFillColor, Object.assign({
|
|
1196
1227
|
width: size,
|
|
1197
1228
|
height: size,
|
|
@@ -1226,13 +1257,13 @@ SwapWalletIcon.toString = function () {
|
|
|
1226
1257
|
return '._icon';
|
|
1227
1258
|
};
|
|
1228
1259
|
|
|
1229
|
-
var _excluded$
|
|
1260
|
+
var _excluded$y = ["color", "size"];
|
|
1230
1261
|
var DisconnectIcon = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
|
|
1231
1262
|
var _ref$color = _ref.color,
|
|
1232
1263
|
color = _ref$color === void 0 ? 'black' : _ref$color,
|
|
1233
1264
|
_ref$size = _ref.size,
|
|
1234
1265
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1235
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1266
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$y);
|
|
1236
1267
|
return React.createElement(SvgWithStrokeColor, Object.assign({
|
|
1237
1268
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1238
1269
|
width: size,
|
|
@@ -1262,12 +1293,12 @@ DisconnectIcon.toString = function () {
|
|
|
1262
1293
|
return '._icon';
|
|
1263
1294
|
};
|
|
1264
1295
|
|
|
1265
|
-
var _excluded$
|
|
1296
|
+
var _excluded$z = ["size", "color"];
|
|
1266
1297
|
var BagIcon = function BagIcon(_ref) {
|
|
1267
1298
|
var _ref$size = _ref.size,
|
|
1268
1299
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1269
1300
|
color = _ref.color,
|
|
1270
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1301
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$z);
|
|
1271
1302
|
return React.createElement(SvgWithStrokeColor, Object.assign({
|
|
1272
1303
|
width: size,
|
|
1273
1304
|
height: size,
|
|
@@ -1297,11 +1328,11 @@ BagIcon.toString = function () {
|
|
|
1297
1328
|
return '._icon';
|
|
1298
1329
|
};
|
|
1299
1330
|
|
|
1300
|
-
var _excluded$
|
|
1331
|
+
var _excluded$A = ["size"];
|
|
1301
1332
|
var TimeIcon = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
|
|
1302
1333
|
var _ref$size = _ref.size,
|
|
1303
1334
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1304
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1335
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$A);
|
|
1305
1336
|
return React.createElement(SvgWithStrokeColor, Object.assign({
|
|
1306
1337
|
width: size,
|
|
1307
1338
|
height: size,
|
|
@@ -1334,12 +1365,12 @@ CloseIcon.toString = function () {
|
|
|
1334
1365
|
return '._icon';
|
|
1335
1366
|
};
|
|
1336
1367
|
|
|
1337
|
-
var _excluded$
|
|
1368
|
+
var _excluded$B = ["size", "color"];
|
|
1338
1369
|
var SignatureIcon = function SignatureIcon(_ref) {
|
|
1339
1370
|
var _ref$size = _ref.size,
|
|
1340
1371
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1341
1372
|
color = _ref.color,
|
|
1342
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1373
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$B);
|
|
1343
1374
|
return React.createElement(SvgWithFillColor, Object.assign({
|
|
1344
1375
|
width: size,
|
|
1345
1376
|
height: size,
|
|
@@ -1360,12 +1391,12 @@ SignatureIcon.toString = function () {
|
|
|
1360
1391
|
return '._icon';
|
|
1361
1392
|
};
|
|
1362
1393
|
|
|
1363
|
-
var _excluded$
|
|
1394
|
+
var _excluded$C = ["size", "color"];
|
|
1364
1395
|
var CopyIcon = function CopyIcon(_ref) {
|
|
1365
1396
|
var _ref$size = _ref.size,
|
|
1366
1397
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1367
1398
|
color = _ref.color,
|
|
1368
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1399
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$C);
|
|
1369
1400
|
return React.createElement(SvgWithFillColor, Object.assign({
|
|
1370
1401
|
width: size,
|
|
1371
1402
|
height: size,
|
|
@@ -1391,7 +1422,7 @@ CopyIcon.toString = function () {
|
|
|
1391
1422
|
return '._icon';
|
|
1392
1423
|
};
|
|
1393
1424
|
|
|
1394
|
-
var _excluded$
|
|
1425
|
+
var _excluded$D = ["children", "className", "color"];
|
|
1395
1426
|
var TypographyContainer = /*#__PURE__*/styled('span', {
|
|
1396
1427
|
margin: 0,
|
|
1397
1428
|
display: 'inline-block',
|
|
@@ -1558,7 +1589,7 @@ function Typography(_ref) {
|
|
|
1558
1589
|
var children = _ref.children,
|
|
1559
1590
|
className = _ref.className,
|
|
1560
1591
|
color = _ref.color,
|
|
1561
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1592
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$D);
|
|
1562
1593
|
var customCss = color ? {
|
|
1563
1594
|
color: color.startsWith('$') ? color : "$" + color
|
|
1564
1595
|
} : {
|
|
@@ -1637,7 +1668,8 @@ var Detail = /*#__PURE__*/styled('div', {
|
|
|
1637
1668
|
}
|
|
1638
1669
|
});
|
|
1639
1670
|
var SubTitle = /*#__PURE__*/styled(Typography, {
|
|
1640
|
-
color: '$neutrals600'
|
|
1671
|
+
color: '$neutrals600',
|
|
1672
|
+
display: 'block'
|
|
1641
1673
|
});
|
|
1642
1674
|
function StepDetail(_ref) {
|
|
1643
1675
|
var logo = _ref.logo,
|
|
@@ -2075,7 +2107,7 @@ function BestRoute(props) {
|
|
|
2075
2107
|
}, "No routes found")));
|
|
2076
2108
|
}
|
|
2077
2109
|
|
|
2078
|
-
var _excluded$
|
|
2110
|
+
var _excluded$E = ["children", "loading", "disabled", "prefix", "suffix", "align", "flexContent"];
|
|
2079
2111
|
var _ghost, _css, _css2, _css3;
|
|
2080
2112
|
var ButtonContainer = /*#__PURE__*/styled('button', {
|
|
2081
2113
|
borderRadius: '$5',
|
|
@@ -2104,6 +2136,7 @@ var ButtonContainer = /*#__PURE__*/styled('button', {
|
|
|
2104
2136
|
},
|
|
2105
2137
|
size: {
|
|
2106
2138
|
compact: {},
|
|
2139
|
+
free: {},
|
|
2107
2140
|
small: {
|
|
2108
2141
|
height: '$32'
|
|
2109
2142
|
},
|
|
@@ -2419,7 +2452,7 @@ function Button(_ref) {
|
|
|
2419
2452
|
suffix = _ref.suffix,
|
|
2420
2453
|
align = _ref.align,
|
|
2421
2454
|
flexContent = _ref.flexContent,
|
|
2422
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
2455
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$E);
|
|
2423
2456
|
var isDisabled = loading || disabled;
|
|
2424
2457
|
return React__default.createElement(ButtonContainer, Object.assign({
|
|
2425
2458
|
disabled: isDisabled
|
|
@@ -2495,9 +2528,70 @@ function BlockchainsList(props) {
|
|
|
2495
2528
|
}));
|
|
2496
2529
|
}
|
|
2497
2530
|
|
|
2498
|
-
var
|
|
2531
|
+
var DividerContainer = /*#__PURE__*/styled('div', {
|
|
2532
|
+
variants: {
|
|
2533
|
+
size: {
|
|
2534
|
+
4: {
|
|
2535
|
+
height: '$4'
|
|
2536
|
+
},
|
|
2537
|
+
8: {
|
|
2538
|
+
height: '$8'
|
|
2539
|
+
},
|
|
2540
|
+
12: {
|
|
2541
|
+
height: '$12'
|
|
2542
|
+
},
|
|
2543
|
+
16: {
|
|
2544
|
+
height: '$16'
|
|
2545
|
+
},
|
|
2546
|
+
18: {
|
|
2547
|
+
height: '$18'
|
|
2548
|
+
},
|
|
2549
|
+
20: {
|
|
2550
|
+
height: '$20'
|
|
2551
|
+
},
|
|
2552
|
+
24: {
|
|
2553
|
+
height: '$24'
|
|
2554
|
+
},
|
|
2555
|
+
32: {
|
|
2556
|
+
height: '$32'
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
});
|
|
2561
|
+
function Divider(_ref) {
|
|
2562
|
+
var _ref$size = _ref.size,
|
|
2563
|
+
size = _ref$size === void 0 ? 12 : _ref$size;
|
|
2564
|
+
return React__default.createElement(DividerContainer, {
|
|
2565
|
+
size: size
|
|
2566
|
+
});
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
var HeaderContainer = /*#__PURE__*/styled('div', {
|
|
2570
|
+
display: 'flex',
|
|
2571
|
+
justifyContent: 'space-between',
|
|
2572
|
+
alignItems: 'center',
|
|
2573
|
+
padding: '$8 0',
|
|
2574
|
+
position: 'relative'
|
|
2575
|
+
});
|
|
2576
|
+
var BackButton = /*#__PURE__*/styled(Button, {
|
|
2577
|
+
padding: '$8'
|
|
2578
|
+
});
|
|
2579
|
+
function Header(props) {
|
|
2580
|
+
return React__default.createElement(HeaderContainer, null, props.onBack ? React__default.createElement(BackButton, {
|
|
2581
|
+
variant: "ghost",
|
|
2582
|
+
size: "small",
|
|
2583
|
+
onClick: props.onBack
|
|
2584
|
+
}, React__default.createElement(AngleLeftIcon, {
|
|
2585
|
+
size: 24
|
|
2586
|
+
})) : null, props.prefix, React__default.createElement(Typography, {
|
|
2587
|
+
variant: "h4"
|
|
2588
|
+
}, props.title), props.suffix || React__default.createElement("div", null));
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2591
|
+
var _excluded$F = ["label", "prefix", "suffix", "children", "size", "style"];
|
|
2499
2592
|
var InputContainer = /*#__PURE__*/styled('div', {
|
|
2500
2593
|
backgroundColor: '$background',
|
|
2594
|
+
padding: '1px',
|
|
2501
2595
|
boxSizing: 'border-box',
|
|
2502
2596
|
border: '1px solid $neutrals400',
|
|
2503
2597
|
borderRadius: '$5',
|
|
@@ -2581,7 +2675,7 @@ var TextField = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
2581
2675
|
suffix = props.suffix,
|
|
2582
2676
|
size = props.size,
|
|
2583
2677
|
style = props.style,
|
|
2584
|
-
inputAttributes = _objectWithoutPropertiesLoose(props, _excluded$
|
|
2678
|
+
inputAttributes = _objectWithoutPropertiesLoose(props, _excluded$F);
|
|
2585
2679
|
return React__default.createElement(React__default.Fragment, null, label && React__default.createElement(Label, Object.assign({
|
|
2586
2680
|
className: "_text"
|
|
2587
2681
|
}, inputAttributes.id && {
|
|
@@ -2601,36 +2695,15 @@ var TextField = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
2601
2695
|
})), suffix || null));
|
|
2602
2696
|
});
|
|
2603
2697
|
|
|
2604
|
-
var
|
|
2698
|
+
var ContentContainer = /*#__PURE__*/styled('div', {
|
|
2699
|
+
overflow: 'hidden',
|
|
2605
2700
|
display: 'flex',
|
|
2606
2701
|
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
2702
|
flex: '1',
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2703
|
+
padding: '0 $4'
|
|
2704
|
+
});
|
|
2705
|
+
var TextFieldContainer = /*#__PURE__*/styled('div', {
|
|
2706
|
+
padding: '1px'
|
|
2634
2707
|
});
|
|
2635
2708
|
function SecondaryPage(props) {
|
|
2636
2709
|
var title = props.title,
|
|
@@ -2642,12 +2715,11 @@ function SecondaryPage(props) {
|
|
|
2642
2715
|
var _useState = React.useState(''),
|
|
2643
2716
|
searchedFor = _useState[0],
|
|
2644
2717
|
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, {
|
|
2718
|
+
return React__default.createElement(React__default.Fragment, null, hasHeader && React__default.createElement(Header, {
|
|
2719
|
+
onBack: onBack,
|
|
2720
|
+
title: title || '',
|
|
2721
|
+
suffix: TopButton
|
|
2722
|
+
}), React__default.createElement(ContentContainer, null, props.textField && React__default.createElement(TextFieldContainer, null, React__default.createElement(TextField, {
|
|
2651
2723
|
size: "large",
|
|
2652
2724
|
prefix: React__default.createElement(SearchIcon, {
|
|
2653
2725
|
size: 24
|
|
@@ -2658,9 +2730,28 @@ function SecondaryPage(props) {
|
|
|
2658
2730
|
},
|
|
2659
2731
|
value: searchedFor,
|
|
2660
2732
|
autoFocus: true
|
|
2661
|
-
})
|
|
2733
|
+
}), React__default.createElement(Divider, {
|
|
2734
|
+
size: 16
|
|
2735
|
+
})), props.textField && (props.children == null ? void 0 : props.children(searchedFor)), !props.textField && props.children), Footer);
|
|
2662
2736
|
}
|
|
2663
2737
|
|
|
2738
|
+
var containsText = function containsText(text, searchText) {
|
|
2739
|
+
return text.toLowerCase().indexOf(searchText.toLowerCase()) > -1;
|
|
2740
|
+
};
|
|
2741
|
+
var getConciseAddress = function getConciseAddress(address, maxChars, ellipsisLength) {
|
|
2742
|
+
if (maxChars === void 0) {
|
|
2743
|
+
maxChars = 8;
|
|
2744
|
+
}
|
|
2745
|
+
if (ellipsisLength === void 0) {
|
|
2746
|
+
ellipsisLength = 3;
|
|
2747
|
+
}
|
|
2748
|
+
if (!address) return null;
|
|
2749
|
+
if (address.length < 2 * maxChars + ellipsisLength) return address;
|
|
2750
|
+
var start = Math.ceil((address.length - maxChars) / 2);
|
|
2751
|
+
var end = address.length - maxChars;
|
|
2752
|
+
return "" + address.substr(start, maxChars) + '.'.repeat(ellipsisLength) + address.substr(end);
|
|
2753
|
+
};
|
|
2754
|
+
|
|
2664
2755
|
var SpacerContainer = /*#__PURE__*/styled('div', {
|
|
2665
2756
|
variants: {
|
|
2666
2757
|
size: {
|
|
@@ -2796,7 +2887,7 @@ var MainContainer = /*#__PURE__*/styled('div', {
|
|
|
2796
2887
|
color: '$primary200'
|
|
2797
2888
|
},
|
|
2798
2889
|
secondary: {
|
|
2799
|
-
color: '$
|
|
2890
|
+
color: '$foreground'
|
|
2800
2891
|
},
|
|
2801
2892
|
success: {
|
|
2802
2893
|
color: '$success300'
|
|
@@ -2820,7 +2911,14 @@ function Alert(props) {
|
|
|
2820
2911
|
className: showIcon ? 'hasIcon' : ''
|
|
2821
2912
|
}, React__default.createElement("div", {
|
|
2822
2913
|
className: "main"
|
|
2823
|
-
}, showIcon && React__default.createElement(React__default.Fragment, null,
|
|
2914
|
+
}, showIcon && React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
2915
|
+
style: {
|
|
2916
|
+
width: '32px',
|
|
2917
|
+
display: 'flex',
|
|
2918
|
+
justifyContent: 'center',
|
|
2919
|
+
alignItems: 'center'
|
|
2920
|
+
}
|
|
2921
|
+
}, type === 'success' && React__default.createElement(CheckCircleIcon, {
|
|
2824
2922
|
color: type,
|
|
2825
2923
|
size: 24
|
|
2826
2924
|
}), type === 'warning' && React__default.createElement(WarningIcon, {
|
|
@@ -2831,240 +2929,461 @@ function Alert(props) {
|
|
|
2831
2929
|
size: 24
|
|
2832
2930
|
}), React__default.createElement(Spacer, {
|
|
2833
2931
|
size: 8
|
|
2834
|
-
})),
|
|
2932
|
+
}))), React__default.createElement("div", {
|
|
2933
|
+
style: {
|
|
2934
|
+
display: 'flex',
|
|
2935
|
+
justifyContent: 'center',
|
|
2936
|
+
alignItems: 'start',
|
|
2937
|
+
flexDirection: 'column',
|
|
2938
|
+
width: '100%'
|
|
2939
|
+
}
|
|
2940
|
+
}, title && React__default.createElement(React__default.Fragment, null, React__default.createElement(Typography, {
|
|
2941
|
+
className: "title",
|
|
2835
2942
|
variant: "h6",
|
|
2836
2943
|
color: type
|
|
2837
|
-
}, title), children
|
|
2944
|
+
}, title), !!children && React__default.createElement(Spacer, {
|
|
2945
|
+
size: 8,
|
|
2946
|
+
direction: "vertical"
|
|
2947
|
+
})), children)), props.footer ? React__default.createElement("div", {
|
|
2838
2948
|
className: "footer"
|
|
2839
2949
|
}, props.footer) : null);
|
|
2840
2950
|
}
|
|
2841
2951
|
|
|
2842
|
-
|
|
2843
|
-
return
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
var ListContainer$1 = /*#__PURE__*/styled('div', {
|
|
2847
|
-
height: '450px',
|
|
2848
|
-
display: 'flex',
|
|
2849
|
-
justifyContent: 'center',
|
|
2850
|
-
alignItems: 'center'
|
|
2851
|
-
});
|
|
2852
|
-
var filterBlockchains = function filterBlockchains(list, searchedFor) {
|
|
2853
|
-
return list.filter(function (blockchain) {
|
|
2854
|
-
return containsText(blockchain.name, searchedFor) || containsText(blockchain.displayName, searchedFor);
|
|
2855
|
-
});
|
|
2856
|
-
};
|
|
2857
|
-
function BlockchainSelector(props) {
|
|
2858
|
-
var type = props.type,
|
|
2859
|
-
list = props.list,
|
|
2860
|
-
onChange = props.onChange,
|
|
2861
|
-
selected = props.selected,
|
|
2862
|
-
onBack = props.onBack,
|
|
2863
|
-
loadingStatus = props.loadingStatus,
|
|
2864
|
-
hasHeader = props.hasHeader,
|
|
2865
|
-
listContainerStyle = props.listContainerStyle,
|
|
2866
|
-
multiSelect = props.multiSelect,
|
|
2867
|
-
selectedList = props.selectedList;
|
|
2868
|
-
return React__default.createElement(SecondaryPage, {
|
|
2869
|
-
textField: true,
|
|
2870
|
-
hasHeader: hasHeader,
|
|
2871
|
-
textFieldPlaceholder: "Search Blockchain By Name",
|
|
2872
|
-
title: "Select " + type + " Network",
|
|
2873
|
-
onBack: onBack
|
|
2874
|
-
}, function (searchedFor) {
|
|
2875
|
-
var filteredBlockchains = filterBlockchains(list, searchedFor);
|
|
2876
|
-
return React__default.createElement(ListContainer$1, {
|
|
2877
|
-
style: listContainerStyle,
|
|
2878
|
-
key: "1"
|
|
2879
|
-
}, loadingStatus === 'loading' && React__default.createElement("div", null, React__default.createElement(Spinner, {
|
|
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, {
|
|
2886
|
-
list: filteredBlockchains,
|
|
2887
|
-
selected: selected,
|
|
2888
|
-
multiSelect: multiSelect,
|
|
2889
|
-
selectedList: selectedList,
|
|
2890
|
-
onChange: onChange
|
|
2891
|
-
}) : React__default.createElement(Alert, null, searchedFor + " not found")));
|
|
2952
|
+
function LoadingFailedAlert() {
|
|
2953
|
+
return React__default.createElement(Alert, {
|
|
2954
|
+
type: "error",
|
|
2955
|
+
title: " Error connecting server, please reload the app and try again."
|
|
2892
2956
|
});
|
|
2893
2957
|
}
|
|
2894
2958
|
|
|
2895
|
-
|
|
2896
|
-
var
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
width: 20,
|
|
2903
|
-
padding: 0,
|
|
2904
|
-
height: 20,
|
|
2905
|
-
border: '1px solid $foreground',
|
|
2906
|
-
display: 'flex',
|
|
2907
|
-
alignItems: 'center',
|
|
2908
|
-
justifyContent: 'center',
|
|
2909
|
-
marginRight: '$2',
|
|
2910
|
-
backgroundColor: '$neutral-100'
|
|
2911
|
-
});
|
|
2912
|
-
var Label$1 = /*#__PURE__*/styled('label', {
|
|
2913
|
-
color: '$foreground',
|
|
2914
|
-
fontSize: '$m',
|
|
2915
|
-
marginLeft: '$8'
|
|
2916
|
-
});
|
|
2917
|
-
function Checkbox(_ref) {
|
|
2918
|
-
var label = _ref.label,
|
|
2919
|
-
id = _ref.id,
|
|
2920
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$F);
|
|
2921
|
-
return React__default.createElement(CheckboxContainer, null, React__default.createElement(CheckboxRoot, Object.assign({
|
|
2922
|
-
id: id
|
|
2923
|
-
}, props), React__default.createElement(RadixCheckbox.Indicator, null, React__default.createElement(CheckIcon, {
|
|
2924
|
-
size: 20
|
|
2925
|
-
}))), React__default.createElement(Label$1, {
|
|
2926
|
-
className: "_text",
|
|
2927
|
-
htmlFor: id
|
|
2928
|
-
}, label));
|
|
2959
|
+
function NotFoundAlert(props) {
|
|
2960
|
+
var catergory = props.catergory,
|
|
2961
|
+
searchedFor = props.searchedFor;
|
|
2962
|
+
return React__default.createElement(Alert, {
|
|
2963
|
+
type: "secondary",
|
|
2964
|
+
title: catergory + " " + (searchedFor ? "'" + searchedFor + "'" : '') + " not found."
|
|
2965
|
+
});
|
|
2929
2966
|
}
|
|
2930
2967
|
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
}
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2968
|
+
function VirtualizedList(props) {
|
|
2969
|
+
var itemCount = props.itemCount,
|
|
2970
|
+
hasNextPage = props.hasNextPage,
|
|
2971
|
+
loadNextPage = props.loadNextPage,
|
|
2972
|
+
Item = props.Item,
|
|
2973
|
+
innerElementType = props.innerElementType,
|
|
2974
|
+
size = props.size;
|
|
2975
|
+
var isItemLoaded = function isItemLoaded(index) {
|
|
2976
|
+
return !hasNextPage || index < itemCount;
|
|
2977
|
+
};
|
|
2978
|
+
return React__default.createElement(AutoSizer, null, function (_ref) {
|
|
2979
|
+
var width = _ref.width,
|
|
2980
|
+
height = _ref.height;
|
|
2981
|
+
return React__default.createElement(InfiniteLoader, {
|
|
2982
|
+
isItemLoaded: isItemLoaded,
|
|
2983
|
+
itemCount: hasNextPage ? itemCount + 1 : itemCount,
|
|
2984
|
+
loadMoreItems: loadNextPage,
|
|
2985
|
+
threshold: 1
|
|
2986
|
+
}, function (_ref2) {
|
|
2987
|
+
var onItemsRendered = _ref2.onItemsRendered,
|
|
2988
|
+
ref = _ref2.ref;
|
|
2989
|
+
return React__default.createElement(reactWindow.VariableSizeList, {
|
|
2990
|
+
innerElementType: innerElementType,
|
|
2991
|
+
ref: ref,
|
|
2992
|
+
itemSize: function itemSize() {
|
|
2993
|
+
return size;
|
|
2994
|
+
},
|
|
2995
|
+
itemCount: itemCount,
|
|
2996
|
+
height: height || 0,
|
|
2997
|
+
width: width || 0,
|
|
2998
|
+
onItemsRendered: onItemsRendered
|
|
2999
|
+
}, function (_ref3) {
|
|
3000
|
+
var index = _ref3.index,
|
|
3001
|
+
style = _ref3.style;
|
|
3002
|
+
return isItemLoaded(index) ? React__default.createElement(Item, {
|
|
3003
|
+
index: index,
|
|
3004
|
+
style: style
|
|
3005
|
+
}) : null;
|
|
3006
|
+
});
|
|
3007
|
+
});
|
|
3008
|
+
});
|
|
2970
3009
|
}
|
|
2971
3010
|
|
|
2972
|
-
var
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
alignItems: 'center',
|
|
2977
|
-
top: '0',
|
|
2978
|
-
left: '0',
|
|
2979
|
-
width: '100vw',
|
|
2980
|
-
height: '100vh',
|
|
2981
|
-
backgroundColor: 'rgba(0,0,0,.1)'
|
|
2982
|
-
});
|
|
2983
|
-
var ModalContainer = /*#__PURE__*/styled('div', {
|
|
2984
|
-
backgroundColor: '$background',
|
|
2985
|
-
borderRadius: '$10',
|
|
2986
|
-
padding: '$16 $16',
|
|
2987
|
-
display: 'flex',
|
|
2988
|
-
flexDirection: 'column',
|
|
2989
|
-
boxShadow: '$s',
|
|
2990
|
-
zIndex: 10
|
|
3011
|
+
var TokenImage = /*#__PURE__*/styled('img', {
|
|
3012
|
+
width: '$32',
|
|
3013
|
+
maxHeight: '$32',
|
|
3014
|
+
marginRight: '$16'
|
|
2991
3015
|
});
|
|
2992
|
-
var
|
|
3016
|
+
var TokenNameContainer = /*#__PURE__*/styled('div', {
|
|
2993
3017
|
display: 'flex',
|
|
2994
|
-
|
|
3018
|
+
flexDirection: 'column'
|
|
2995
3019
|
});
|
|
2996
|
-
var
|
|
3020
|
+
var TokenAmountContainer = /*#__PURE__*/styled('div', {
|
|
2997
3021
|
display: 'flex',
|
|
2998
|
-
|
|
2999
|
-
alignItems: '
|
|
3000
|
-
position: 'relative',
|
|
3001
|
-
marginBottom: '$16'
|
|
3022
|
+
flexDirection: 'column',
|
|
3023
|
+
alignItems: 'flex-end'
|
|
3002
3024
|
});
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
var
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3025
|
+
function TokenItem(props) {
|
|
3026
|
+
var _token$balance;
|
|
3027
|
+
var token = props.token,
|
|
3028
|
+
style = props.style,
|
|
3029
|
+
onClick = props.onClick,
|
|
3030
|
+
selected = props.selected;
|
|
3031
|
+
return React__default.createElement("div", {
|
|
3032
|
+
style: _extends({
|
|
3033
|
+
display: 'flex',
|
|
3034
|
+
alignItems: 'center',
|
|
3035
|
+
width: '100%'
|
|
3036
|
+
}, style, {
|
|
3037
|
+
height: '48px',
|
|
3038
|
+
top: parseFloat(style == null ? void 0 : style.top) + 0 + "px",
|
|
3039
|
+
padding: '0 4px'
|
|
3040
|
+
})
|
|
3041
|
+
}, React__default.createElement(Button, {
|
|
3042
|
+
variant: "outlined",
|
|
3043
|
+
size: "large",
|
|
3044
|
+
align: "start",
|
|
3045
|
+
onClick: onClick.bind(null, token),
|
|
3046
|
+
type: selected ? 'primary' : undefined,
|
|
3047
|
+
prefix: React__default.createElement(TokenImage, {
|
|
3048
|
+
src: token.image
|
|
3049
|
+
}),
|
|
3050
|
+
suffix: ((_token$balance = token.balance) == null ? void 0 : _token$balance.amount) && React__default.createElement(TokenAmountContainer, null, React__default.createElement(Typography, {
|
|
3051
|
+
variant: "body2"
|
|
3052
|
+
}, token.balance.amount), React__default.createElement(Typography, {
|
|
3053
|
+
variant: "caption"
|
|
3054
|
+
}, token.balance.usdValue + "$"))
|
|
3055
|
+
}, React__default.createElement(TokenNameContainer, null, React__default.createElement(Typography, {
|
|
3056
|
+
variant: "body1"
|
|
3057
|
+
}, token.symbol), React__default.createElement(Typography, {
|
|
3058
|
+
variant: "caption",
|
|
3059
|
+
color: "neutrals600"
|
|
3060
|
+
}, token.name))));
|
|
3061
|
+
}
|
|
3062
|
+
|
|
3063
|
+
var _excluded$G = ["style"];
|
|
3064
|
+
var PAGE_SIZE = 20;
|
|
3065
|
+
function TokenList(props) {
|
|
3066
|
+
var list = props.list,
|
|
3067
|
+
searchedText = props.searchedText,
|
|
3068
|
+
onChange = props.onChange,
|
|
3069
|
+
multiSelect = props.multiSelect,
|
|
3070
|
+
selectedList = props.selectedList;
|
|
3071
|
+
var _useState = React.useState(props.selected),
|
|
3072
|
+
selected = _useState[0],
|
|
3073
|
+
setSelected = _useState[1];
|
|
3074
|
+
var changeSelected = function changeSelected(token) {
|
|
3075
|
+
setSelected(token);
|
|
3076
|
+
onChange(token);
|
|
3077
|
+
};
|
|
3078
|
+
var isSelected = function isSelected(token) {
|
|
3079
|
+
if (multiSelect && selectedList) {
|
|
3080
|
+
return selectedList.map(function (item) {
|
|
3081
|
+
return item.symbol + item.address;
|
|
3082
|
+
}).indexOf(token.symbol + token.address) > -1;
|
|
3083
|
+
}
|
|
3084
|
+
return (selected == null ? void 0 : selected.symbol) === token.symbol && (selected == null ? void 0 : selected.address) === token.address;
|
|
3085
|
+
};
|
|
3086
|
+
var _useState2 = React.useState(true),
|
|
3087
|
+
hasNextPage = _useState2[0],
|
|
3088
|
+
setHasNextPage = _useState2[1];
|
|
3089
|
+
var _useState3 = React.useState(list),
|
|
3090
|
+
tokens = _useState3[0],
|
|
3091
|
+
setTokens = _useState3[1];
|
|
3092
|
+
var loadNextPage = function loadNextPage() {
|
|
3093
|
+
setTokens(list.slice(0, tokens.length + PAGE_SIZE));
|
|
3014
3094
|
};
|
|
3015
3095
|
React.useEffect(function () {
|
|
3016
|
-
|
|
3017
|
-
}, [
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
},
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3096
|
+
setTokens(list.slice(0, PAGE_SIZE));
|
|
3097
|
+
}, [searchedText, list]);
|
|
3098
|
+
React.useEffect(function () {
|
|
3099
|
+
setHasNextPage(list.length > tokens.length);
|
|
3100
|
+
}, [tokens.length]);
|
|
3101
|
+
var innerElementType = React.forwardRef(function (_ref, ref) {
|
|
3102
|
+
var style = _ref.style,
|
|
3103
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$G);
|
|
3104
|
+
return React__default.createElement("div", Object.assign({
|
|
3105
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3106
|
+
ref: ref,
|
|
3107
|
+
style: _extends({}, style, {
|
|
3108
|
+
height: parseFloat(style == null ? void 0 : style.height) + 8 * 2 + "px"
|
|
3109
|
+
})
|
|
3110
|
+
}, rest));
|
|
3111
|
+
});
|
|
3112
|
+
return React__default.createElement(VirtualizedList, {
|
|
3113
|
+
Item: function Item(_ref2) {
|
|
3114
|
+
var index = _ref2.index,
|
|
3115
|
+
style = _ref2.style;
|
|
3116
|
+
return React__default.createElement(TokenItem, {
|
|
3117
|
+
token: tokens[index],
|
|
3118
|
+
style: style,
|
|
3119
|
+
onClick: changeSelected,
|
|
3120
|
+
selected: isSelected(tokens[index])
|
|
3121
|
+
});
|
|
3122
|
+
},
|
|
3123
|
+
hasNextPage: hasNextPage,
|
|
3124
|
+
itemCount: tokens.length,
|
|
3125
|
+
loadNextPage: loadNextPage,
|
|
3126
|
+
innerElementType: innerElementType,
|
|
3127
|
+
size: 56
|
|
3128
|
+
});
|
|
3030
3129
|
}
|
|
3031
3130
|
|
|
3032
|
-
|
|
3033
|
-
WalletState["NOT_INSTALLED"] = "not installed";
|
|
3034
|
-
WalletState["DISCONNECTED"] = "disconnected";
|
|
3035
|
-
WalletState["CONNECTING"] = "connecting";
|
|
3036
|
-
WalletState["CONNECTED"] = "connected";
|
|
3037
|
-
})(exports.WalletState || (exports.WalletState = {}));
|
|
3038
|
-
|
|
3039
|
-
var StateIconContainer = /*#__PURE__*/styled('span', {
|
|
3131
|
+
var LoaderContainer = /*#__PURE__*/styled('div', {
|
|
3040
3132
|
display: 'flex',
|
|
3041
3133
|
justifyContent: 'center',
|
|
3042
|
-
|
|
3134
|
+
width: '100%',
|
|
3135
|
+
paddingTop: '5%',
|
|
3136
|
+
flex: 1
|
|
3043
3137
|
});
|
|
3044
|
-
var
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
href: walletsShared.detectInstallLink(installLink),
|
|
3049
|
-
target: "_blank"
|
|
3050
|
-
}, React__default.createElement(DownloadIcon, {
|
|
3051
|
-
size: 24,
|
|
3052
|
-
color: "success"
|
|
3053
|
-
})), walletState === exports.WalletState.CONNECTING && React__default.createElement(Spinner, null), walletState === exports.WalletState.CONNECTED && React__default.createElement(DisconnectIcon, null)));
|
|
3138
|
+
var filterTokens = function filterTokens(list, searchedFor) {
|
|
3139
|
+
return list.filter(function (token) {
|
|
3140
|
+
return containsText(token.symbol, searchedFor) || containsText(token.address || '', searchedFor) || containsText(token.name || '', searchedFor);
|
|
3141
|
+
});
|
|
3054
3142
|
};
|
|
3055
|
-
|
|
3056
|
-
var
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3143
|
+
function TokenSelector(props) {
|
|
3144
|
+
var list = props.list,
|
|
3145
|
+
type = props.type,
|
|
3146
|
+
selected = props.selected,
|
|
3147
|
+
hasHeader = props.hasHeader,
|
|
3148
|
+
onChange = props.onChange,
|
|
3149
|
+
onBack = props.onBack,
|
|
3150
|
+
loadingStatus = props.loadingStatus;
|
|
3151
|
+
return React__default.createElement(SecondaryPage, {
|
|
3152
|
+
textField: true,
|
|
3153
|
+
hasHeader: hasHeader,
|
|
3154
|
+
title: "Select " + type + " Token",
|
|
3155
|
+
onBack: onBack,
|
|
3156
|
+
textFieldPlaceholder: "Search Token By Name"
|
|
3157
|
+
}, function (searchedFor) {
|
|
3158
|
+
var filteredTokens = filterTokens(list, searchedFor);
|
|
3159
|
+
return loadingStatus === 'loading' ? React__default.createElement(LoaderContainer, null, React__default.createElement(Spinner, {
|
|
3160
|
+
size: 24
|
|
3161
|
+
})) : loadingStatus === 'failed' ? React__default.createElement(LoadingFailedAlert, null) : filteredTokens.length ? React__default.createElement(TokenList, {
|
|
3162
|
+
searchedText: searchedFor,
|
|
3163
|
+
list: filteredTokens,
|
|
3164
|
+
selected: selected,
|
|
3165
|
+
onChange: onChange
|
|
3166
|
+
}) : React__default.createElement(NotFoundAlert, {
|
|
3167
|
+
catergory: "Token",
|
|
3168
|
+
searchedFor: searchedFor
|
|
3169
|
+
});
|
|
3170
|
+
});
|
|
3171
|
+
}
|
|
3172
|
+
|
|
3173
|
+
var ListContainer$1 = /*#__PURE__*/styled('div', {
|
|
3174
|
+
overflowY: 'auto'
|
|
3175
|
+
});
|
|
3176
|
+
var filterBlockchains = function filterBlockchains(list, searchedFor) {
|
|
3177
|
+
return list.filter(function (blockchain) {
|
|
3178
|
+
return containsText(blockchain.name, searchedFor) || containsText(blockchain.displayName, searchedFor);
|
|
3179
|
+
});
|
|
3180
|
+
};
|
|
3181
|
+
function BlockchainSelector(props) {
|
|
3182
|
+
var type = props.type,
|
|
3183
|
+
list = props.list,
|
|
3184
|
+
onChange = props.onChange,
|
|
3185
|
+
selected = props.selected,
|
|
3186
|
+
onBack = props.onBack,
|
|
3187
|
+
loadingStatus = props.loadingStatus,
|
|
3188
|
+
hasHeader = props.hasHeader,
|
|
3189
|
+
listContainerStyle = props.listContainerStyle,
|
|
3190
|
+
multiSelect = props.multiSelect,
|
|
3191
|
+
selectedList = props.selectedList;
|
|
3192
|
+
return React__default.createElement(SecondaryPage, {
|
|
3193
|
+
textField: true,
|
|
3194
|
+
hasHeader: hasHeader,
|
|
3195
|
+
textFieldPlaceholder: "Search Blockchain By Name",
|
|
3196
|
+
title: "Select " + type + " Network",
|
|
3197
|
+
onBack: onBack
|
|
3198
|
+
}, function (searchedFor) {
|
|
3199
|
+
var filteredBlockchains = filterBlockchains(list, searchedFor);
|
|
3200
|
+
return React__default.createElement(ListContainer$1, {
|
|
3201
|
+
style: listContainerStyle,
|
|
3202
|
+
key: "1"
|
|
3203
|
+
}, loadingStatus === 'loading' && React__default.createElement(LoaderContainer, null, React__default.createElement(Spinner, {
|
|
3204
|
+
size: 24
|
|
3205
|
+
})), loadingStatus === 'failed' && React__default.createElement(LoadingFailedAlert, null), loadingStatus === 'success' && React__default.createElement(React__default.Fragment, null, filteredBlockchains.length ? React__default.createElement(BlockchainsList, {
|
|
3206
|
+
list: filteredBlockchains,
|
|
3207
|
+
selected: selected,
|
|
3208
|
+
multiSelect: multiSelect,
|
|
3209
|
+
selectedList: selectedList,
|
|
3210
|
+
onChange: onChange
|
|
3211
|
+
}) : React__default.createElement(NotFoundAlert, {
|
|
3212
|
+
catergory: "Blockchain",
|
|
3213
|
+
searchedFor: searchedFor
|
|
3214
|
+
})));
|
|
3215
|
+
});
|
|
3216
|
+
}
|
|
3217
|
+
|
|
3218
|
+
var _excluded$H = ["label", "id"];
|
|
3219
|
+
var CheckboxContainer = /*#__PURE__*/styled('div', {
|
|
3220
|
+
display: 'flex',
|
|
3221
|
+
alignItems: 'center'
|
|
3222
|
+
});
|
|
3223
|
+
var CheckboxRoot = /*#__PURE__*/styled(RadixCheckbox.Root, {
|
|
3224
|
+
borderRadius: '5px',
|
|
3225
|
+
width: 20,
|
|
3226
|
+
padding: 0,
|
|
3227
|
+
height: 20,
|
|
3228
|
+
border: '1px solid $foreground',
|
|
3229
|
+
display: 'flex',
|
|
3230
|
+
alignItems: 'center',
|
|
3231
|
+
justifyContent: 'center',
|
|
3232
|
+
marginRight: '$2',
|
|
3233
|
+
backgroundColor: '$neutral-100'
|
|
3234
|
+
});
|
|
3235
|
+
var Label$1 = /*#__PURE__*/styled('label', {
|
|
3236
|
+
color: '$foreground',
|
|
3237
|
+
fontSize: '$m',
|
|
3238
|
+
marginLeft: '$8'
|
|
3239
|
+
});
|
|
3240
|
+
function Checkbox(_ref) {
|
|
3241
|
+
var label = _ref.label,
|
|
3242
|
+
id = _ref.id,
|
|
3243
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$H);
|
|
3244
|
+
return React__default.createElement(CheckboxContainer, null, React__default.createElement(CheckboxRoot, Object.assign({
|
|
3245
|
+
id: id
|
|
3246
|
+
}, props), React__default.createElement(RadixCheckbox.Indicator, null, React__default.createElement(CheckIcon, {
|
|
3247
|
+
size: 20
|
|
3248
|
+
}))), React__default.createElement(Label$1, {
|
|
3249
|
+
className: "_text",
|
|
3250
|
+
htmlFor: id
|
|
3251
|
+
}, label));
|
|
3252
|
+
}
|
|
3253
|
+
|
|
3254
|
+
var ChipCointainer = /*#__PURE__*/styled('div', {
|
|
3255
|
+
display: 'inline-flex',
|
|
3256
|
+
justifyContent: 'center',
|
|
3257
|
+
alignItems: 'center',
|
|
3258
|
+
borderRadius: '$5',
|
|
3259
|
+
padding: '$4 $8',
|
|
3260
|
+
height: '32',
|
|
3261
|
+
fontSize: '$14',
|
|
3262
|
+
cursor: 'pointer',
|
|
3263
|
+
transition: 'all 0.35s',
|
|
3264
|
+
color: '$foreground',
|
|
3265
|
+
'&:hover': {
|
|
3266
|
+
backgroundColor: '$success700',
|
|
3267
|
+
color: '$background'
|
|
3268
|
+
},
|
|
3269
|
+
variants: {
|
|
3270
|
+
selected: {
|
|
3271
|
+
"true": {
|
|
3272
|
+
backgroundColor: '$success',
|
|
3273
|
+
color: '$background'
|
|
3274
|
+
},
|
|
3275
|
+
"false": {
|
|
3276
|
+
backgroundColor: '$background'
|
|
3277
|
+
}
|
|
3278
|
+
}
|
|
3279
|
+
}
|
|
3280
|
+
});
|
|
3281
|
+
function Chip(props) {
|
|
3282
|
+
var label = props.label,
|
|
3283
|
+
selected = props.selected,
|
|
3284
|
+
prefix = props.prefix,
|
|
3285
|
+
suffix = props.suffix,
|
|
3286
|
+
onClick = props.onClick,
|
|
3287
|
+
style = props.style;
|
|
3288
|
+
return React__default.createElement(ChipCointainer, {
|
|
3289
|
+
selected: selected,
|
|
3290
|
+
onClick: onClick,
|
|
3291
|
+
style: style
|
|
3292
|
+
}, prefix || null, label, suffix || null);
|
|
3293
|
+
}
|
|
3294
|
+
|
|
3295
|
+
var BackDrop = /*#__PURE__*/styled('div', {
|
|
3296
|
+
position: 'fixed',
|
|
3297
|
+
display: 'flex',
|
|
3298
|
+
justifyContent: 'center',
|
|
3299
|
+
alignItems: 'center',
|
|
3300
|
+
top: '0',
|
|
3301
|
+
left: '0',
|
|
3302
|
+
width: '100vw',
|
|
3303
|
+
height: '100vh',
|
|
3304
|
+
backgroundColor: 'rgba(0,0,0,.1)'
|
|
3305
|
+
});
|
|
3306
|
+
var ModalContainer = /*#__PURE__*/styled('div', {
|
|
3307
|
+
backgroundColor: '$background',
|
|
3308
|
+
borderRadius: '$10',
|
|
3309
|
+
padding: '$16 $16',
|
|
3310
|
+
display: 'flex',
|
|
3311
|
+
flexDirection: 'column',
|
|
3312
|
+
boxShadow: '$s',
|
|
3313
|
+
zIndex: 10
|
|
3314
|
+
});
|
|
3315
|
+
var Row = /*#__PURE__*/styled('div', {
|
|
3316
|
+
display: 'flex',
|
|
3317
|
+
alignItems: 'center'
|
|
3318
|
+
});
|
|
3319
|
+
var ModalHeader = /*#__PURE__*/styled('div', {
|
|
3320
|
+
display: 'flex',
|
|
3321
|
+
justifyContent: 'space-between',
|
|
3322
|
+
alignItems: 'center',
|
|
3323
|
+
position: 'relative',
|
|
3324
|
+
marginBottom: '$16'
|
|
3325
|
+
});
|
|
3326
|
+
function Modal(props) {
|
|
3327
|
+
var title = props.title,
|
|
3328
|
+
content = props.content,
|
|
3329
|
+
open = props.open,
|
|
3330
|
+
onClose = props.onClose,
|
|
3331
|
+
containerStyle = props.containerStyle,
|
|
3332
|
+
action = props.action;
|
|
3333
|
+
var handleBackDropClick = function handleBackDropClick(event) {
|
|
3334
|
+
if (event.target === event.currentTarget) onClose();
|
|
3335
|
+
};
|
|
3336
|
+
React.useEffect(function () {
|
|
3337
|
+
if (open) document.body.style.overflow = 'hidden';else document.body.style.overflow = 'unset';
|
|
3338
|
+
}, [open]);
|
|
3339
|
+
return React__default.createElement(React__default.Fragment, null, open && reactDom.createPortal(React__default.createElement(BackDrop, {
|
|
3340
|
+
onClick: handleBackDropClick
|
|
3341
|
+
}, React__default.createElement(ModalContainer, {
|
|
3342
|
+
style: containerStyle
|
|
3343
|
+
}, React__default.createElement(ModalHeader, null, React__default.createElement(Typography, {
|
|
3344
|
+
variant: "h4"
|
|
3345
|
+
}, title), React__default.createElement(Row, null, action, React__default.createElement(CloseIcon, {
|
|
3346
|
+
size: 24,
|
|
3347
|
+
onClick: onClose
|
|
3348
|
+
}))), content)), document.body));
|
|
3349
|
+
}
|
|
3350
|
+
|
|
3351
|
+
(function (WalletState) {
|
|
3352
|
+
WalletState["NOT_INSTALLED"] = "not installed";
|
|
3353
|
+
WalletState["DISCONNECTED"] = "disconnected";
|
|
3354
|
+
WalletState["CONNECTING"] = "connecting";
|
|
3355
|
+
WalletState["CONNECTED"] = "connected";
|
|
3356
|
+
})(exports.WalletState || (exports.WalletState = {}));
|
|
3357
|
+
|
|
3358
|
+
var StateIconContainer = /*#__PURE__*/styled('span', {
|
|
3359
|
+
display: 'flex',
|
|
3360
|
+
justifyContent: 'center',
|
|
3361
|
+
alignItems: 'center'
|
|
3362
|
+
});
|
|
3363
|
+
var State = function State(_ref) {
|
|
3364
|
+
var walletState = _ref.walletState,
|
|
3365
|
+
installLink = _ref.installLink;
|
|
3366
|
+
return React__default.createElement(React.Fragment, null, walletState !== exports.WalletState.DISCONNECTED && React__default.createElement(StateIconContainer, null, walletState === exports.WalletState.NOT_INSTALLED && React__default.createElement("a", {
|
|
3367
|
+
href: walletsShared.detectInstallLink(installLink),
|
|
3368
|
+
target: "_blank"
|
|
3369
|
+
}, React__default.createElement(DownloadIcon, {
|
|
3370
|
+
size: 24,
|
|
3371
|
+
color: "success"
|
|
3372
|
+
})), walletState === exports.WalletState.CONNECTING && React__default.createElement(Spinner, null), walletState === exports.WalletState.CONNECTED && React__default.createElement(DisconnectIcon, null)));
|
|
3373
|
+
};
|
|
3374
|
+
|
|
3375
|
+
var WalletImage = /*#__PURE__*/styled('img', {
|
|
3376
|
+
width: '$24',
|
|
3377
|
+
height: '$24',
|
|
3378
|
+
marginRight: '$12'
|
|
3379
|
+
});
|
|
3380
|
+
var Text = /*#__PURE__*/styled('div', {
|
|
3381
|
+
display: 'flex',
|
|
3382
|
+
flexDirection: 'column'
|
|
3383
|
+
});
|
|
3384
|
+
var ExtendedButton = /*#__PURE__*/styled(Button, {
|
|
3385
|
+
variants: {
|
|
3386
|
+
type: {
|
|
3068
3387
|
primary: {
|
|
3069
3388
|
outline: '1px solid $primary',
|
|
3070
3389
|
borderColor: '$primary',
|
|
@@ -3084,7 +3403,7 @@ function Wallet(props) {
|
|
|
3084
3403
|
installLink = props.installLink;
|
|
3085
3404
|
return React__default.createElement(ExtendedButton, {
|
|
3086
3405
|
type: state === exports.WalletState.CONNECTED ? 'primary' : undefined,
|
|
3087
|
-
disabled:
|
|
3406
|
+
disabled: state == exports.WalletState.CONNECTING,
|
|
3088
3407
|
onClick: function onClick() {
|
|
3089
3408
|
if (state === exports.WalletState.NOT_INSTALLED) {
|
|
3090
3409
|
window.open(walletsShared.detectInstallLink(installLink), '_blank');
|
|
@@ -3191,14 +3510,21 @@ var groupLiquiditySources = function groupLiquiditySources(liquiditySources) {
|
|
|
3191
3510
|
})
|
|
3192
3511
|
};
|
|
3193
3512
|
};
|
|
3513
|
+
var MainContainer$1 = /*#__PURE__*/styled('div', {
|
|
3514
|
+
variants: {
|
|
3515
|
+
loaded: {
|
|
3516
|
+
"true": {
|
|
3517
|
+
overflowY: 'auto'
|
|
3518
|
+
}
|
|
3519
|
+
}
|
|
3520
|
+
}
|
|
3521
|
+
});
|
|
3194
3522
|
var LiquiditySourceType = /*#__PURE__*/styled('div', {
|
|
3195
3523
|
position: 'sticky',
|
|
3196
3524
|
display: 'flex',
|
|
3197
3525
|
justifyContent: 'space-between',
|
|
3198
3526
|
alignItems: 'center',
|
|
3199
3527
|
top: '0',
|
|
3200
|
-
marginTop: '$8',
|
|
3201
|
-
marginBottom: '$8',
|
|
3202
3528
|
backgroundColor: '$background',
|
|
3203
3529
|
zIndex: '9999',
|
|
3204
3530
|
paddingTop: '$8',
|
|
@@ -3209,10 +3535,16 @@ var LiquidityImage = /*#__PURE__*/styled('img', {
|
|
|
3209
3535
|
maxHeight: '$20',
|
|
3210
3536
|
marginRight: '$16'
|
|
3211
3537
|
});
|
|
3538
|
+
var LoaderContainer$1 = /*#__PURE__*/styled('div', {
|
|
3539
|
+
display: 'flex',
|
|
3540
|
+
justifyContent: 'center'
|
|
3541
|
+
});
|
|
3212
3542
|
function LiquiditySourceList(props) {
|
|
3213
3543
|
var list = props.list,
|
|
3214
3544
|
onChange = props.onChange,
|
|
3215
|
-
listContainerStyle = props.listContainerStyle
|
|
3545
|
+
listContainerStyle = props.listContainerStyle,
|
|
3546
|
+
loadingStatus = props.loadingStatus,
|
|
3547
|
+
searchedFor = props.searchedFor;
|
|
3216
3548
|
var _useState = React.useState(list.filter(function (item) {
|
|
3217
3549
|
return item.selected;
|
|
3218
3550
|
})),
|
|
@@ -3246,10 +3578,9 @@ function LiquiditySourceList(props) {
|
|
|
3246
3578
|
// TODO: This is not performant
|
|
3247
3579
|
var totalSelectedBridges = bridges.filter(isSelected).length;
|
|
3248
3580
|
var totalSelectedExchanges = exchanges.filter(isSelected).length;
|
|
3249
|
-
return React__default.createElement(
|
|
3250
|
-
style:
|
|
3251
|
-
|
|
3252
|
-
}, listContainerStyle)
|
|
3581
|
+
return React__default.createElement(MainContainer$1, {
|
|
3582
|
+
style: listContainerStyle,
|
|
3583
|
+
loaded: loadingStatus === 'success'
|
|
3253
3584
|
}, React__default.createElement("div", null, React__default.createElement(LiquiditySourceType, null, React__default.createElement(Typography, {
|
|
3254
3585
|
variant: "h5"
|
|
3255
3586
|
}, "Bridges"), React__default.createElement(Typography, {
|
|
@@ -3258,14 +3589,19 @@ function LiquiditySourceList(props) {
|
|
|
3258
3589
|
}, totalSelectedBridges === totalBridges ? totalBridges : totalSelectedBridges + " / " + totalBridges)), React__default.createElement(Spacer, {
|
|
3259
3590
|
size: 12,
|
|
3260
3591
|
direction: "vertical"
|
|
3261
|
-
}),
|
|
3592
|
+
}), loadingStatus === 'loading' && React__default.createElement(LoaderContainer$1, null, React__default.createElement(Spinner, {
|
|
3593
|
+
size: 24
|
|
3594
|
+
})), loadingStatus === 'failed' && React__default.createElement(LoadingFailedAlert, null), loadingStatus === 'success' && React__default.createElement(React__default.Fragment, null, totalBridges ? bridges.map(function (liquiditySource, index) {
|
|
3262
3595
|
return React__default.createElement(LiquiditySourceItem, {
|
|
3263
3596
|
liquiditySource: liquiditySource,
|
|
3264
3597
|
key: index,
|
|
3265
3598
|
selected: isSelected(liquiditySource),
|
|
3266
3599
|
onChange: changeLiquiditySources
|
|
3267
3600
|
});
|
|
3268
|
-
})
|
|
3601
|
+
}) : React__default.createElement(NotFoundAlert, {
|
|
3602
|
+
catergory: "Bridge",
|
|
3603
|
+
searchedFor: searchedFor
|
|
3604
|
+
}))), React__default.createElement("div", null, React__default.createElement(LiquiditySourceType, null, React__default.createElement(Typography, {
|
|
3269
3605
|
variant: "h5"
|
|
3270
3606
|
}, "Exchanges"), React__default.createElement(Typography, {
|
|
3271
3607
|
variant: "body1",
|
|
@@ -3273,14 +3609,19 @@ function LiquiditySourceList(props) {
|
|
|
3273
3609
|
}, totalSelectedExchanges === totalExchanges ? totalExchanges : totalSelectedExchanges + " / " + totalExchanges)), React__default.createElement(Spacer, {
|
|
3274
3610
|
size: 12,
|
|
3275
3611
|
direction: "vertical"
|
|
3276
|
-
}),
|
|
3612
|
+
}), loadingStatus === 'loading' && React__default.createElement(LoaderContainer$1, null, React__default.createElement(Spinner, {
|
|
3613
|
+
size: 24
|
|
3614
|
+
})), loadingStatus === 'failed' && React__default.createElement(LoadingFailedAlert, null), loadingStatus == 'success' && React__default.createElement(React__default.Fragment, null, totalExchanges ? exchanges.map(function (liquiditySource, index) {
|
|
3277
3615
|
return React__default.createElement(LiquiditySourceItem, {
|
|
3278
3616
|
liquiditySource: liquiditySource,
|
|
3279
3617
|
key: index,
|
|
3280
3618
|
selected: isSelected(liquiditySource),
|
|
3281
3619
|
onChange: changeLiquiditySources
|
|
3282
3620
|
});
|
|
3283
|
-
})
|
|
3621
|
+
}) : React__default.createElement(NotFoundAlert, {
|
|
3622
|
+
catergory: "Exchange",
|
|
3623
|
+
searchedFor: searchedFor
|
|
3624
|
+
}))));
|
|
3284
3625
|
}
|
|
3285
3626
|
var LiquiditySourceItem = function LiquiditySourceItem(_ref) {
|
|
3286
3627
|
var liquiditySource = _ref.liquiditySource,
|
|
@@ -3310,22 +3651,19 @@ var filterLiquiditySources = function filterLiquiditySources(liquiditySources, s
|
|
|
3310
3651
|
return containsText(liquiditySource.title, searchedFor || '');
|
|
3311
3652
|
});
|
|
3312
3653
|
};
|
|
3313
|
-
var ActionButton = /*#__PURE__*/styled(Button, {
|
|
3314
|
-
position: 'absolute',
|
|
3315
|
-
right: 0
|
|
3316
|
-
});
|
|
3317
3654
|
function LiquiditySourcesSelector(props) {
|
|
3318
3655
|
var list = props.list,
|
|
3319
3656
|
onChange = props.onChange,
|
|
3320
3657
|
onBack = props.onBack,
|
|
3321
3658
|
hasHeader = props.hasHeader,
|
|
3322
3659
|
listContainerStyle = props.listContainerStyle,
|
|
3323
|
-
toggleAll = props.toggleAll
|
|
3660
|
+
toggleAll = props.toggleAll,
|
|
3661
|
+
loadingStatus = props.loadingStatus;
|
|
3324
3662
|
return React__default.createElement(SecondaryPage, {
|
|
3325
3663
|
textField: true,
|
|
3326
3664
|
textFieldPlaceholder: "Search By Name",
|
|
3327
3665
|
title: "Liquidity Sources",
|
|
3328
|
-
TopButton: React__default.createElement(
|
|
3666
|
+
TopButton: React__default.createElement(Button, {
|
|
3329
3667
|
variant: "ghost",
|
|
3330
3668
|
type: "primary",
|
|
3331
3669
|
onClick: toggleAll
|
|
@@ -3338,7 +3676,9 @@ function LiquiditySourcesSelector(props) {
|
|
|
3338
3676
|
return React__default.createElement(LiquiditySourceList, {
|
|
3339
3677
|
listContainerStyle: listContainerStyle,
|
|
3340
3678
|
list: filterLiquiditySources(list, searchedFor),
|
|
3341
|
-
onChange: onChange
|
|
3679
|
+
onChange: onChange,
|
|
3680
|
+
loadingStatus: loadingStatus,
|
|
3681
|
+
searchedFor: searchedFor
|
|
3342
3682
|
});
|
|
3343
3683
|
});
|
|
3344
3684
|
}
|
|
@@ -3382,7 +3722,7 @@ var SolidCircle = /*#__PURE__*/styled('div', {
|
|
|
3382
3722
|
}
|
|
3383
3723
|
}
|
|
3384
3724
|
});
|
|
3385
|
-
var Container$
|
|
3725
|
+
var Container$1 = /*#__PURE__*/styled('div', {
|
|
3386
3726
|
border: '1.5px solid',
|
|
3387
3727
|
borderRadius: '$5',
|
|
3388
3728
|
padding: '$12',
|
|
@@ -3429,7 +3769,7 @@ function SelectableWalletList(_ref) {
|
|
|
3429
3769
|
}, [list]);
|
|
3430
3770
|
return React__default.createElement(Row$1, null, list.map(function (w, index) {
|
|
3431
3771
|
var checked = active === w.walletType;
|
|
3432
|
-
return React__default.createElement(Container$
|
|
3772
|
+
return React__default.createElement(Container$1, {
|
|
3433
3773
|
checked: checked,
|
|
3434
3774
|
onClick: onClick.bind(null, w),
|
|
3435
3775
|
key: index
|
|
@@ -3440,7 +3780,9 @@ function SelectableWalletList(_ref) {
|
|
|
3440
3780
|
height: 24
|
|
3441
3781
|
}), React__default.createElement(Typography, {
|
|
3442
3782
|
variant: "body2"
|
|
3443
|
-
}, w.name), React__default.createElement(
|
|
3783
|
+
}, w.name), React__default.createElement(Typography, {
|
|
3784
|
+
variant: "caption"
|
|
3785
|
+
}, getConciseAddress(w.address)), React__default.createElement(Circle, {
|
|
3444
3786
|
checked: checked
|
|
3445
3787
|
}, React__default.createElement(SolidCircle, {
|
|
3446
3788
|
checked: checked
|
|
@@ -3480,7 +3822,7 @@ var StyledItem = /*#__PURE__*/styled(RadioGroup.Item, {
|
|
|
3480
3822
|
borderColor: '$neutrals600'
|
|
3481
3823
|
}
|
|
3482
3824
|
});
|
|
3483
|
-
var Container$
|
|
3825
|
+
var Container$2 = /*#__PURE__*/styled('div', {
|
|
3484
3826
|
display: 'flex'
|
|
3485
3827
|
});
|
|
3486
3828
|
var StyledIndicator = /*#__PURE__*/styled(RadioGroup.Indicator, {
|
|
@@ -3510,7 +3852,7 @@ function Radio(props) {
|
|
|
3510
3852
|
_props$direction = props.direction,
|
|
3511
3853
|
direction = _props$direction === void 0 ? 'vertical' : _props$direction,
|
|
3512
3854
|
style = props.style;
|
|
3513
|
-
return React__default.createElement(Container$
|
|
3855
|
+
return React__default.createElement(Container$2, null, React__default.createElement(StyledRoot, {
|
|
3514
3856
|
onValueChange: onChange,
|
|
3515
3857
|
value: value,
|
|
3516
3858
|
direction: direction,
|
|
@@ -3585,7 +3927,8 @@ function Settings(props) {
|
|
|
3585
3927
|
selectedTheme = props.selectedTheme,
|
|
3586
3928
|
onThemeChange = props.onThemeChange,
|
|
3587
3929
|
toggleInfiniteApprove = props.toggleInfiniteApprove,
|
|
3588
|
-
infiniteApprove = props.infiniteApprove
|
|
3930
|
+
infiniteApprove = props.infiniteApprove,
|
|
3931
|
+
loadingStatus = props.loadingStatus;
|
|
3589
3932
|
var _useState = React.useState(props.selectedSlippage),
|
|
3590
3933
|
selectedSlippage = _useState[0],
|
|
3591
3934
|
setSelectedSlippage = _useState[1];
|
|
@@ -3653,14 +3996,21 @@ function Settings(props) {
|
|
|
3653
3996
|
}, "Infinite Approval"), React__default.createElement(Switch, {
|
|
3654
3997
|
checked: infiniteApprove,
|
|
3655
3998
|
onChange: toggleInfiniteApprove
|
|
3656
|
-
})), React__default.createElement(LiquiditySourceContainer, {
|
|
3657
|
-
onClick: onLiquiditySourcesClick
|
|
3999
|
+
})), React__default.createElement(LiquiditySourceContainer, null, React__default.createElement(Button, {
|
|
4000
|
+
onClick: onLiquiditySourcesClick,
|
|
4001
|
+
align: "start",
|
|
4002
|
+
variant: "ghost",
|
|
4003
|
+
loading: loadingStatus === 'loading',
|
|
4004
|
+
suffix: React__default.createElement(LiquiditySourceNumber, null, loadingStatus === 'success' && React__default.createElement(Typography, {
|
|
4005
|
+
variant: "body2",
|
|
4006
|
+
color: "neutrals800"
|
|
4007
|
+
}, liquiditySources.length !== selectedLiquiditySources.length ? selectedLiquiditySources.length + " / " + liquiditySources.length : liquiditySources.length), loadingStatus === 'failed' && React__default.createElement(Typography, {
|
|
4008
|
+
variant: "body2",
|
|
4009
|
+
color: "$error500"
|
|
4010
|
+
}, "Loading failed"), React__default.createElement(StyledAngleRight, null))
|
|
3658
4011
|
}, React__default.createElement(Typography, {
|
|
3659
4012
|
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))));
|
|
4013
|
+
}, "Liquidity Sources"))));
|
|
3664
4014
|
return React__default.createElement(SecondaryPage, {
|
|
3665
4015
|
title: "Settings",
|
|
3666
4016
|
textField: false,
|
|
@@ -3668,107 +4018,114 @@ function Settings(props) {
|
|
|
3668
4018
|
}, PageContent);
|
|
3669
4019
|
}
|
|
3670
4020
|
|
|
3671
|
-
var MainContainer$
|
|
3672
|
-
|
|
3673
|
-
maxWidth: '512px',
|
|
3674
|
-
boxShadow: '$s',
|
|
3675
|
-
minWidth: '375px',
|
|
3676
|
-
width: '100%',
|
|
3677
|
-
backgroundColor: '$background',
|
|
3678
|
-
height: 'fit-content',
|
|
4021
|
+
var MainContainer$2 = /*#__PURE__*/styled('div', {
|
|
4022
|
+
position: 'relative',
|
|
3679
4023
|
display: 'flex',
|
|
3680
4024
|
flexDirection: 'column',
|
|
3681
|
-
|
|
4025
|
+
borderRadius: '$10',
|
|
4026
|
+
boxShadow: '$s',
|
|
4027
|
+
width: '100%',
|
|
4028
|
+
minWidth: '375px',
|
|
4029
|
+
maxWidth: '512px',
|
|
4030
|
+
maxHeight: '595px',
|
|
3682
4031
|
padding: '$16',
|
|
3683
4032
|
boxSizing: 'border-box',
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
4033
|
+
backgroundColor: '$background',
|
|
4034
|
+
variants: {
|
|
4035
|
+
fixedHeight: {
|
|
4036
|
+
"true": {
|
|
4037
|
+
height: '595px'
|
|
4038
|
+
},
|
|
4039
|
+
"false": {
|
|
4040
|
+
height: 'auto'
|
|
4041
|
+
}
|
|
4042
|
+
}
|
|
4043
|
+
}
|
|
3688
4044
|
});
|
|
3689
4045
|
function SwapContainer(props) {
|
|
3690
4046
|
var children = props.children,
|
|
3691
|
-
style = props.style
|
|
3692
|
-
|
|
4047
|
+
style = props.style,
|
|
4048
|
+
_props$fixedHeight = props.fixedHeight,
|
|
4049
|
+
fixedHeight = _props$fixedHeight === void 0 ? true : _props$fixedHeight;
|
|
4050
|
+
return React__default.createElement(MainContainer$2, {
|
|
3693
4051
|
style: style,
|
|
3694
|
-
id: "swap-box"
|
|
3695
|
-
|
|
4052
|
+
id: "swap-box",
|
|
4053
|
+
fixedHeight: fixedHeight
|
|
4054
|
+
}, children);
|
|
3696
4055
|
}
|
|
3697
4056
|
|
|
3698
|
-
var
|
|
3699
|
-
position: 'relative'
|
|
3700
|
-
});
|
|
3701
|
-
var ButtonContainer$1 = /*#__PURE__*/styled('div', {
|
|
3702
|
-
paddingTop: '$8'
|
|
3703
|
-
});
|
|
3704
|
-
var SwapContainer$1 = /*#__PURE__*/styled('div', {
|
|
4057
|
+
var TokenContainer = /*#__PURE__*/styled('div', {
|
|
3705
4058
|
display: 'flex',
|
|
3706
|
-
|
|
3707
|
-
'
|
|
3708
|
-
|
|
3709
|
-
},
|
|
3710
|
-
'&:hover': {
|
|
3711
|
-
borderColor: '$primary'
|
|
3712
|
-
},
|
|
3713
|
-
variants: {
|
|
3714
|
-
status: {
|
|
3715
|
-
failed: {
|
|
3716
|
-
borderColor: '$error'
|
|
3717
|
-
},
|
|
3718
|
-
running: {
|
|
3719
|
-
borderColor: '$neutrals400'
|
|
3720
|
-
},
|
|
3721
|
-
success: {
|
|
3722
|
-
borderColor: '$success'
|
|
3723
|
-
}
|
|
3724
|
-
}
|
|
4059
|
+
alignItems: 'center',
|
|
4060
|
+
'& .amount': {
|
|
4061
|
+
fontWeight: 'bold'
|
|
3725
4062
|
}
|
|
3726
4063
|
});
|
|
3727
|
-
var
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
width: '$20',
|
|
3735
|
-
border: '1px dashed $foreground',
|
|
3736
|
-
borderRadius: 'inherit',
|
|
3737
|
-
'@md': {
|
|
3738
|
-
width: '$36'
|
|
4064
|
+
var TokenImage$1 = /*#__PURE__*/styled('div', {
|
|
4065
|
+
position: 'relative',
|
|
4066
|
+
width: '$24',
|
|
4067
|
+
height: '$24',
|
|
4068
|
+
img: {
|
|
4069
|
+
width: '100%',
|
|
4070
|
+
display: 'block'
|
|
3739
4071
|
},
|
|
3740
|
-
'
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
width: '$8',
|
|
3751
|
-
height: '$8'
|
|
4072
|
+
'.overlay': {
|
|
4073
|
+
position: 'absolute',
|
|
4074
|
+
right: -4,
|
|
4075
|
+
bottom: -4,
|
|
4076
|
+
width: '$16',
|
|
4077
|
+
height: '$16',
|
|
4078
|
+
padding: '$2',
|
|
4079
|
+
borderRadius: '50%',
|
|
4080
|
+
backgroundColor: '$background',
|
|
4081
|
+
border: '1px solid $neutrals400'
|
|
3752
4082
|
}
|
|
3753
4083
|
});
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
}
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
4084
|
+
function Token(props) {
|
|
4085
|
+
return React__default.createElement(TokenContainer, null, React__default.createElement(TokenImage$1, null, React__default.createElement("img", {
|
|
4086
|
+
src: props.data.token.logo,
|
|
4087
|
+
alt: ""
|
|
4088
|
+
}), React__default.createElement("div", {
|
|
4089
|
+
className: "overlay"
|
|
4090
|
+
}, React__default.createElement("img", {
|
|
4091
|
+
src: props.data.blockchain.logo,
|
|
4092
|
+
alt: props.data.blockchain.name
|
|
4093
|
+
}))), React__default.createElement(Spacer, {
|
|
4094
|
+
size: 8
|
|
4095
|
+
}), React__default.createElement("span", {
|
|
4096
|
+
className: "amount"
|
|
4097
|
+
}, props.data.amount), React__default.createElement(Spacer, {
|
|
4098
|
+
size: 4
|
|
4099
|
+
}), props.data.token.symbol);
|
|
4100
|
+
}
|
|
4101
|
+
|
|
4102
|
+
var Container$3 = /*#__PURE__*/styled('div', {
|
|
4103
|
+
position: 'relative',
|
|
3767
4104
|
display: 'flex',
|
|
3768
|
-
justifyContent: '
|
|
3769
|
-
'
|
|
3770
|
-
|
|
3771
|
-
|
|
4105
|
+
justifyContent: 'space-between',
|
|
4106
|
+
alignItems: 'center',
|
|
4107
|
+
padding: '$16 0',
|
|
4108
|
+
borderBottom: '1px solid $neutrals300',
|
|
4109
|
+
'& > .info': {
|
|
4110
|
+
display: 'flex',
|
|
4111
|
+
alignItems: 'center'
|
|
4112
|
+
},
|
|
4113
|
+
'.status': {
|
|
4114
|
+
textTransform: 'uppercase',
|
|
4115
|
+
fontWeight: 'bold',
|
|
4116
|
+
fontSize: '$12'
|
|
4117
|
+
},
|
|
4118
|
+
'&.running': {
|
|
4119
|
+
color: '$foreground'
|
|
4120
|
+
},
|
|
4121
|
+
'&.failed,&.success': {
|
|
4122
|
+
color: '$neutrals600'
|
|
4123
|
+
},
|
|
4124
|
+
'&.failed .status': {
|
|
4125
|
+
color: '$error'
|
|
4126
|
+
},
|
|
4127
|
+
'&.success .status': {
|
|
4128
|
+
color: '$success'
|
|
3772
4129
|
}
|
|
3773
4130
|
});
|
|
3774
4131
|
function SwapDetail(_ref) {
|
|
@@ -3777,234 +4134,56 @@ function SwapDetail(_ref) {
|
|
|
3777
4134
|
onClick = _ref.onClick;
|
|
3778
4135
|
var firstStep = swap.steps[0];
|
|
3779
4136
|
var lastStep = swap.steps[swap.steps.length - 1];
|
|
3780
|
-
return React__default.createElement(
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
}, React__default.createElement(
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
})
|
|
3805
|
-
size:
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
}
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
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;
|
|
3923
|
-
}
|
|
3924
|
-
return (selected == null ? void 0 : selected.symbol) === token.symbol && (selected == null ? void 0 : selected.address) === token.address;
|
|
3925
|
-
};
|
|
3926
|
-
var _useState2 = React.useState(true),
|
|
3927
|
-
hasNextPage = _useState2[0],
|
|
3928
|
-
setHasNextPage = _useState2[1];
|
|
3929
|
-
var _useState3 = React.useState(list),
|
|
3930
|
-
tokens = _useState3[0],
|
|
3931
|
-
setTokens = _useState3[1];
|
|
3932
|
-
var loadNextPage = function loadNextPage() {
|
|
3933
|
-
setTokens(list.slice(0, tokens.length + PAGE_SIZE));
|
|
3934
|
-
};
|
|
3935
|
-
React.useEffect(function () {
|
|
3936
|
-
setTokens(list.slice(0, PAGE_SIZE));
|
|
3937
|
-
}, [searchedText]);
|
|
3938
|
-
React.useEffect(function () {
|
|
3939
|
-
setHasNextPage(list.length > tokens.length);
|
|
3940
|
-
}, [tokens.length]);
|
|
3941
|
-
var innerElementType = React.forwardRef(function (_ref, ref) {
|
|
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'
|
|
3955
|
-
}
|
|
3956
|
-
}, React__default.createElement(VirtualizedList, {
|
|
3957
|
-
Item: function Item(_ref2) {
|
|
3958
|
-
var index = _ref2.index,
|
|
3959
|
-
style = _ref2.style;
|
|
3960
|
-
return React__default.createElement(TokenItem, {
|
|
3961
|
-
token: tokens[index],
|
|
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
|
-
});
|
|
4137
|
+
return React__default.createElement(Button, {
|
|
4138
|
+
variant: "ghost",
|
|
4139
|
+
size: "free",
|
|
4140
|
+
fullWidth: true,
|
|
4141
|
+
onClick: onClick.bind(null, swap.requestId)
|
|
4142
|
+
}, React__default.createElement(Container$3, {
|
|
4143
|
+
className: "" + status
|
|
4144
|
+
}, React__default.createElement("div", {
|
|
4145
|
+
className: "info"
|
|
4146
|
+
}, React__default.createElement(Token, {
|
|
4147
|
+
data: {
|
|
4148
|
+
token: {
|
|
4149
|
+
logo: firstStep.fromLogo,
|
|
4150
|
+
symbol: firstStep.fromSymbol
|
|
4151
|
+
},
|
|
4152
|
+
blockchain: {
|
|
4153
|
+
// @ts-ignore
|
|
4154
|
+
logo: firstStep.fromBlockchainLogo || '',
|
|
4155
|
+
name: firstStep.fromBlockchain
|
|
4156
|
+
},
|
|
4157
|
+
amount: swap.inputAmount
|
|
4158
|
+
}
|
|
4159
|
+
}), React__default.createElement(Spacer, {
|
|
4160
|
+
size: 12
|
|
4161
|
+
}), React__default.createElement(ArrowRightIcon, {
|
|
4162
|
+
size: 12
|
|
4163
|
+
}), React__default.createElement(Spacer, {
|
|
4164
|
+
size: 12
|
|
4165
|
+
}), React__default.createElement(Token, {
|
|
4166
|
+
data: {
|
|
4167
|
+
token: {
|
|
4168
|
+
logo: lastStep.toLogo,
|
|
4169
|
+
symbol: lastStep.toSymbol
|
|
4170
|
+
},
|
|
4171
|
+
blockchain: {
|
|
4172
|
+
// @ts-ignore
|
|
4173
|
+
logo: lastStep.toBlockchainLogo,
|
|
4174
|
+
name: lastStep.toBlockchain
|
|
4175
|
+
},
|
|
4176
|
+
amount: lastStep.outputAmount || lastStep.expectedOutputAmountHumanReadable || ''
|
|
4177
|
+
}
|
|
4178
|
+
})), React__default.createElement("div", {
|
|
4179
|
+
className: "status"
|
|
4180
|
+
}, status === 'running' ? React__default.createElement(Spinner, {
|
|
4181
|
+
size: 24,
|
|
4182
|
+
color: "primary"
|
|
4183
|
+
}) : status)));
|
|
4005
4184
|
}
|
|
4006
4185
|
|
|
4007
|
-
var Container$
|
|
4186
|
+
var Container$4 = /*#__PURE__*/styled('div', {
|
|
4008
4187
|
position: 'relative'
|
|
4009
4188
|
});
|
|
4010
4189
|
var Color = /*#__PURE__*/styled('div', {
|
|
@@ -4054,7 +4233,7 @@ function ColorPicker(_ref) {
|
|
|
4054
4233
|
var _useState = React.useState(false),
|
|
4055
4234
|
displayColorPicker = _useState[0],
|
|
4056
4235
|
setDisplayColorPicker = _useState[1];
|
|
4057
|
-
return React__default.createElement(Container$
|
|
4236
|
+
return React__default.createElement(Container$4, null, React__default.createElement(Label$3, {
|
|
4058
4237
|
className: "_text"
|
|
4059
4238
|
}, label), React__default.createElement(Button, {
|
|
4060
4239
|
variant: "outlined",
|
|
@@ -4175,129 +4354,15 @@ function Drawer(props) {
|
|
|
4175
4354
|
})), React__default.createElement(Body, null, content), React__default.createElement(Footer, null, footer))), container));
|
|
4176
4355
|
}
|
|
4177
4356
|
|
|
4178
|
-
var MainContainer$
|
|
4179
|
-
|
|
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'
|
|
4357
|
+
var MainContainer$3 = /*#__PURE__*/styled('div', {
|
|
4358
|
+
overflowY: 'auto'
|
|
4196
4359
|
});
|
|
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'
|
|
4225
|
-
});
|
|
4226
|
-
var Alerts = /*#__PURE__*/styled('div', {
|
|
4227
|
-
paddingBottom: '$16'
|
|
4228
|
-
});
|
|
4229
|
-
function ConfirmSwap(props) {
|
|
4230
|
-
var _bestRoute$result;
|
|
4231
|
-
var bestRoute = props.bestRoute,
|
|
4232
|
-
onBack = props.onBack,
|
|
4233
|
-
onConfirm = props.onConfirm,
|
|
4234
|
-
loading = props.loading,
|
|
4235
|
-
errors = props.errors,
|
|
4236
|
-
warnings = props.warnings,
|
|
4237
|
-
extraMessages = props.extraMessages,
|
|
4238
|
-
confirmButtonTitle = props.confirmButtonTitle,
|
|
4239
|
-
confirmButtonDisabled = props.confirmButtonDisabled;
|
|
4240
|
-
return React__default.createElement(SecondaryPage, {
|
|
4241
|
-
textField: false,
|
|
4242
|
-
title: "Swap",
|
|
4243
|
-
onBack: onBack,
|
|
4244
|
-
Footer: React__default.createElement(Footer$1, null, React__default.createElement(Button, {
|
|
4245
|
-
type: "primary",
|
|
4246
|
-
fullWidth: true,
|
|
4247
|
-
loading: loading,
|
|
4248
|
-
variant: "contained",
|
|
4249
|
-
onClick: onConfirm,
|
|
4250
|
-
disabled: confirmButtonDisabled
|
|
4251
|
-
}, confirmButtonTitle))
|
|
4252
|
-
}, React__default.createElement(MainContainer$2, null, React__default.createElement("div", null, extraMessages || null, React__default.createElement(Alerts, null, errors == null ? void 0 : errors.map(function (error, index) {
|
|
4253
|
-
return React__default.createElement(React__default.Fragment, null, React__default.createElement(Spacer, {
|
|
4254
|
-
direction: "vertical"
|
|
4255
|
-
}), React__default.createElement(Alert, {
|
|
4256
|
-
type: "error",
|
|
4257
|
-
key: index
|
|
4258
|
-
}, error));
|
|
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
|
-
}))));
|
|
4293
|
-
}
|
|
4294
|
-
|
|
4295
4360
|
var Section = /*#__PURE__*/styled('div', {
|
|
4296
4361
|
paddingBottom: '$32',
|
|
4297
4362
|
marginBottom: '$32',
|
|
4298
4363
|
borderBottom: '1px solid $neutrals400'
|
|
4299
4364
|
});
|
|
4300
|
-
var Footer$
|
|
4365
|
+
var Footer$1 = /*#__PURE__*/styled('div', {
|
|
4301
4366
|
display: 'flex',
|
|
4302
4367
|
alignItems: 'center'
|
|
4303
4368
|
});
|
|
@@ -4307,7 +4372,7 @@ var AlertContainer = /*#__PURE__*/styled('div', {
|
|
|
4307
4372
|
var ConfirmButton = /*#__PURE__*/styled(Button, {
|
|
4308
4373
|
marginTop: '$16'
|
|
4309
4374
|
});
|
|
4310
|
-
var Container$
|
|
4375
|
+
var Container$5 = /*#__PURE__*/styled('div', {
|
|
4311
4376
|
paddingBottom: '$24',
|
|
4312
4377
|
'.title': {
|
|
4313
4378
|
paddingBottom: '$8',
|
|
@@ -4327,7 +4392,10 @@ var Container$6 = /*#__PURE__*/styled('div', {
|
|
|
4327
4392
|
alignItems: 'center'
|
|
4328
4393
|
}
|
|
4329
4394
|
});
|
|
4330
|
-
|
|
4395
|
+
var Alerts = /*#__PURE__*/styled('div', {
|
|
4396
|
+
paddingBottom: '$16'
|
|
4397
|
+
});
|
|
4398
|
+
function ConfirmSwap(props) {
|
|
4331
4399
|
var onBack = props.onBack,
|
|
4332
4400
|
loading = props.loading,
|
|
4333
4401
|
onConfirm = props.onConfirm,
|
|
@@ -4336,27 +4404,45 @@ function ConfirmWallets(props) {
|
|
|
4336
4404
|
onChange = props.onChange,
|
|
4337
4405
|
confirmDisabled = props.confirmDisabled,
|
|
4338
4406
|
isExperimentalChain = props.isExperimentalChain,
|
|
4339
|
-
handleConnectChain = props.handleConnectChain
|
|
4407
|
+
handleConnectChain = props.handleConnectChain,
|
|
4408
|
+
confirmButtonTitle = props.confirmButtonTitle,
|
|
4409
|
+
errors = props.errors,
|
|
4410
|
+
warnings = props.warnings,
|
|
4411
|
+
extraMessages = props.extraMessages;
|
|
4340
4412
|
return React__default.createElement(SecondaryPage, {
|
|
4341
4413
|
textField: false,
|
|
4342
4414
|
title: "Confirm Swap",
|
|
4343
4415
|
onBack: onBack,
|
|
4344
|
-
Footer: React__default.createElement(Footer$
|
|
4416
|
+
Footer: React__default.createElement(Footer$1, null, React__default.createElement(ConfirmButton, {
|
|
4345
4417
|
fullWidth: true,
|
|
4346
4418
|
loading: loading,
|
|
4347
4419
|
type: "primary",
|
|
4348
4420
|
variant: "contained",
|
|
4349
4421
|
onClick: onConfirm,
|
|
4350
4422
|
disabled: confirmDisabled
|
|
4351
|
-
},
|
|
4352
|
-
},
|
|
4423
|
+
}, confirmButtonTitle))
|
|
4424
|
+
}, 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) {
|
|
4425
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(Spacer, {
|
|
4426
|
+
direction: "vertical"
|
|
4427
|
+
}), React__default.createElement(Alert, {
|
|
4428
|
+
type: "error",
|
|
4429
|
+
key: index
|
|
4430
|
+
}, error));
|
|
4431
|
+
}), warnings == null ? void 0 : warnings.map(function (warning, index) {
|
|
4432
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(Spacer, {
|
|
4433
|
+
direction: "vertical"
|
|
4434
|
+
}), React__default.createElement(Alert, {
|
|
4435
|
+
type: "warning",
|
|
4436
|
+
key: index
|
|
4437
|
+
}, warning));
|
|
4438
|
+
}))), props.previewInputs || props.previewRoutes ? React__default.createElement(Section, null, props.previewInputs, !!props.previewRoutes ? React__default.createElement(Spacer, {
|
|
4353
4439
|
size: 16,
|
|
4354
4440
|
direction: "vertical"
|
|
4355
4441
|
}) : null, props.previewRoutes) : null, requiredWallets.map(function (wallet, index) {
|
|
4356
4442
|
var list = selectableWallets.filter(function (w) {
|
|
4357
4443
|
return wallet === w.chain;
|
|
4358
4444
|
});
|
|
4359
|
-
return React__default.createElement(Container$
|
|
4445
|
+
return React__default.createElement(Container$5, {
|
|
4360
4446
|
key: index
|
|
4361
4447
|
}, React__default.createElement("div", {
|
|
4362
4448
|
className: "title"
|
|
@@ -4379,34 +4465,16 @@ function ConfirmWallets(props) {
|
|
|
4379
4465
|
list: list,
|
|
4380
4466
|
onChange: onChange
|
|
4381
4467
|
}));
|
|
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
|
-
}, []);
|
|
4468
|
+
})));
|
|
4400
4469
|
}
|
|
4401
4470
|
|
|
4402
|
-
var
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
alignItems: 'center'
|
|
4471
|
+
var Group = /*#__PURE__*/styled('div', {
|
|
4472
|
+
'.group-title': {
|
|
4473
|
+
textTransform: 'uppercase'
|
|
4474
|
+
}
|
|
4407
4475
|
});
|
|
4408
|
-
var
|
|
4409
|
-
|
|
4476
|
+
var Container$6 = /*#__PURE__*/styled('div', {
|
|
4477
|
+
overflowY: 'auto'
|
|
4410
4478
|
});
|
|
4411
4479
|
var filteredHistory = function filteredHistory(list, searchedFor) {
|
|
4412
4480
|
return list.filter(function (swap) {
|
|
@@ -4415,30 +4483,34 @@ var filteredHistory = function filteredHistory(list, searchedFor) {
|
|
|
4415
4483
|
return containsText(firstStep.fromBlockchain, searchedFor) || containsText(firstStep.fromSymbol, searchedFor) || containsText(lastStep.toBlockchain, searchedFor) || containsText(lastStep.toSymbol, searchedFor) || containsText(swap.requestId, searchedFor);
|
|
4416
4484
|
});
|
|
4417
4485
|
};
|
|
4418
|
-
var Group = /*#__PURE__*/styled('div', {
|
|
4419
|
-
marginBottom: '$24',
|
|
4420
|
-
paddingRight: '$8',
|
|
4421
|
-
maxHeight: '600px'
|
|
4422
|
-
});
|
|
4423
|
-
var GroupTitle = /*#__PURE__*/styled(Typography, {
|
|
4424
|
-
color: '$neutrals500'
|
|
4425
|
-
});
|
|
4426
4486
|
var SwapsGroup = function SwapsGroup(props) {
|
|
4427
4487
|
var list = props.list,
|
|
4428
|
-
onSwapClick = props.onSwapClick
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4488
|
+
onSwapClick = props.onSwapClick,
|
|
4489
|
+
groupBy = props.groupBy;
|
|
4490
|
+
var groups = groupBy ? groupBy(list) : [{
|
|
4491
|
+
title: 'History',
|
|
4492
|
+
swaps: list
|
|
4493
|
+
}];
|
|
4494
|
+
return React__default.createElement(React__default.Fragment, null, groups.filter(function (group) {
|
|
4495
|
+
return group.swaps.length > 0;
|
|
4496
|
+
}).map(function (group, index) {
|
|
4497
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(Group, {
|
|
4432
4498
|
key: index
|
|
4433
|
-
}, React__default.createElement(
|
|
4434
|
-
variant: "body2"
|
|
4499
|
+
}, React__default.createElement(Typography, {
|
|
4500
|
+
variant: "body2",
|
|
4501
|
+
color: "neutrals600",
|
|
4502
|
+
className: "group-title"
|
|
4435
4503
|
}, group.title), group.swaps.map(function (swap, index) {
|
|
4436
|
-
return React__default.createElement(SwapDetail, {
|
|
4504
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(SwapDetail, {
|
|
4437
4505
|
key: index,
|
|
4438
4506
|
swap: swap,
|
|
4439
4507
|
status: swap.status,
|
|
4440
4508
|
onClick: onSwapClick
|
|
4441
|
-
})
|
|
4509
|
+
}), React__default.createElement(Divider, {
|
|
4510
|
+
size: 12
|
|
4511
|
+
}));
|
|
4512
|
+
})), React__default.createElement(Divider, {
|
|
4513
|
+
size: 24
|
|
4442
4514
|
}));
|
|
4443
4515
|
}));
|
|
4444
4516
|
};
|
|
@@ -4446,28 +4518,126 @@ function History(_ref) {
|
|
|
4446
4518
|
var _ref$list = _ref.list,
|
|
4447
4519
|
list = _ref$list === void 0 ? [] : _ref$list,
|
|
4448
4520
|
onBack = _ref.onBack,
|
|
4449
|
-
onSwapClick = _ref.onSwapClick
|
|
4521
|
+
onSwapClick = _ref.onSwapClick,
|
|
4522
|
+
groupBy = _ref.groupBy;
|
|
4450
4523
|
return React__default.createElement(SecondaryPage, {
|
|
4451
4524
|
onBack: onBack,
|
|
4452
4525
|
textField: true,
|
|
4453
|
-
textFieldPlaceholder: "Search By Blockchain Or Token",
|
|
4526
|
+
textFieldPlaceholder: "Search By Blockchain Or Token Or Request ID",
|
|
4454
4527
|
title: "Swaps"
|
|
4455
4528
|
}, function (searchedFor) {
|
|
4456
4529
|
var filterSwaps = filteredHistory(list, searchedFor);
|
|
4457
|
-
return filterSwaps.length ? React__default.createElement(SwapsGroup, {
|
|
4530
|
+
return React__default.createElement(Container$6, null, filterSwaps.length ? React__default.createElement(SwapsGroup, {
|
|
4458
4531
|
list: filterSwaps,
|
|
4459
|
-
onSwapClick: onSwapClick
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4532
|
+
onSwapClick: onSwapClick,
|
|
4533
|
+
groupBy: groupBy
|
|
4534
|
+
}) : React__default.createElement(NotFoundAlert, {
|
|
4535
|
+
catergory: "Swap"
|
|
4536
|
+
}));
|
|
4463
4537
|
});
|
|
4464
4538
|
}
|
|
4465
4539
|
|
|
4540
|
+
var getAlertType = function getAlertType(messageType) {
|
|
4541
|
+
if (!messageType || messageType === 'info') return 'secondary';else return messageType;
|
|
4542
|
+
};
|
|
4543
|
+
var DetailedMessage = /*#__PURE__*/styled('div', {
|
|
4544
|
+
width: '90%',
|
|
4545
|
+
overflowWrap: 'break-word',
|
|
4546
|
+
color: '$error500 !important'
|
|
4547
|
+
});
|
|
4548
|
+
var SuccessText = /*#__PURE__*/styled(Typography, {
|
|
4549
|
+
color: '$success500 !important'
|
|
4550
|
+
});
|
|
4551
|
+
var SwapMessages = function SwapMessages(props) {
|
|
4552
|
+
var shortMessage = props.shortMessage,
|
|
4553
|
+
detailedMessage = props.detailedMessage,
|
|
4554
|
+
currentStepBlockchain = props.currentStepBlockchain,
|
|
4555
|
+
type = props.type,
|
|
4556
|
+
lastConvertedTokenInFailedSwap = props.lastConvertedTokenInFailedSwap;
|
|
4557
|
+
var _useState = React.useState(false),
|
|
4558
|
+
expandedMessage = _useState[0],
|
|
4559
|
+
setExpandedMessage = _useState[1];
|
|
4560
|
+
var allowedNumberOfChars = detailedMessage["long"] ? 0 : 150;
|
|
4561
|
+
var shouldShowMoreDetailsButton = !expandedMessage && detailedMessage.content.length > allowedNumberOfChars;
|
|
4562
|
+
return React__default.createElement(Alert, Object.assign({
|
|
4563
|
+
type: getAlertType(type),
|
|
4564
|
+
title: shortMessage
|
|
4565
|
+
}, shouldShowMoreDetailsButton && {
|
|
4566
|
+
footer: React__default.createElement(Button, {
|
|
4567
|
+
variant: "outlined",
|
|
4568
|
+
type: "primary",
|
|
4569
|
+
onClick: setExpandedMessage.bind(null, function (prevState) {
|
|
4570
|
+
return !prevState;
|
|
4571
|
+
})
|
|
4572
|
+
}, "Show more details")
|
|
4573
|
+
}, !!props.switchNetwork && {
|
|
4574
|
+
footer: React__default.createElement(Button, {
|
|
4575
|
+
variant: 'outlined',
|
|
4576
|
+
type: "primary",
|
|
4577
|
+
onClick: props.switchNetwork
|
|
4578
|
+
}, "Change network to ", currentStepBlockchain)
|
|
4579
|
+
}), !!detailedMessage.content ? React__default.createElement(DetailedMessage, null, React__default.createElement(Typography, {
|
|
4580
|
+
variant: "body2"
|
|
4581
|
+
}, 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, {
|
|
4582
|
+
variant: "body2"
|
|
4583
|
+
}, "Don't worry, your fund is\xA0"), React__default.createElement(SuccessText, {
|
|
4584
|
+
variant: "body2"
|
|
4585
|
+
}, React__default.createElement("b", null, "Safe"))), React__default.createElement("p", null, React__default.createElement(Typography, {
|
|
4586
|
+
variant: "body2"
|
|
4587
|
+
}, "It is converted to \xA0", React__default.createElement("u", null, lastConvertedTokenInFailedSwap.outputAmount), "\xA0"), React__default.createElement(SuccessText, {
|
|
4588
|
+
variant: "body2"
|
|
4589
|
+
}, React__default.createElement("b", null, lastConvertedTokenInFailedSwap.symbol, "\xA0")), React__default.createElement(Typography, {
|
|
4590
|
+
variant: "body2"
|
|
4591
|
+
}, "on your\xA0"), React__default.createElement(SuccessText, {
|
|
4592
|
+
variant: "body2"
|
|
4593
|
+
}, React__default.createElement("b", null, lastConvertedTokenInFailedSwap.blockchain, "\xA0")), React__default.createElement(Typography, {
|
|
4594
|
+
variant: "body2"
|
|
4595
|
+
}, "wallet"))));
|
|
4596
|
+
};
|
|
4597
|
+
|
|
4598
|
+
var _excluded$I = ["pendingSwap", "onBack", "onCopy", "isCopied", "onCancel", "date", "onRetry", "previewInputs"];
|
|
4599
|
+
var SwapperContainer$1 = /*#__PURE__*/styled('div', {
|
|
4600
|
+
display: 'flex',
|
|
4601
|
+
alignItems: 'center',
|
|
4602
|
+
marginLeft: '6px'
|
|
4603
|
+
});
|
|
4604
|
+
var Fee = /*#__PURE__*/styled('div', {
|
|
4605
|
+
display: 'flex',
|
|
4606
|
+
alignItems: 'center'
|
|
4607
|
+
});
|
|
4608
|
+
var SwapperLogo$1 = /*#__PURE__*/styled('img', {
|
|
4609
|
+
width: '$16',
|
|
4610
|
+
height: '$16'
|
|
4611
|
+
});
|
|
4612
|
+
var RelativeContainer$1 = /*#__PURE__*/styled('div', {
|
|
4613
|
+
position: 'relative'
|
|
4614
|
+
});
|
|
4615
|
+
var Dot$1 = /*#__PURE__*/styled('div', {
|
|
4616
|
+
width: '$8',
|
|
4617
|
+
height: '$8',
|
|
4618
|
+
backgroundColor: '$foreground',
|
|
4619
|
+
borderRadius: '4px',
|
|
4620
|
+
marginLeft: '$8'
|
|
4621
|
+
});
|
|
4622
|
+
var ArrowDown = /*#__PURE__*/styled('div', {
|
|
4623
|
+
width: '0px',
|
|
4624
|
+
height: '0px',
|
|
4625
|
+
borderLeft: '5px solid transparent',
|
|
4626
|
+
borderRight: '5px solid transparent',
|
|
4627
|
+
borderTop: '5px solid $foreground',
|
|
4628
|
+
marginLeft: '$8'
|
|
4629
|
+
});
|
|
4466
4630
|
var StyledAnchor = /*#__PURE__*/styled('a', {
|
|
4467
4631
|
color: '$primary',
|
|
4468
4632
|
fontWeight: '$600',
|
|
4469
4633
|
marginLeft: '$12'
|
|
4470
4634
|
});
|
|
4635
|
+
var SwapInfoContainer = /*#__PURE__*/styled('div', {
|
|
4636
|
+
display: 'flex',
|
|
4637
|
+
flexDirection: 'column',
|
|
4638
|
+
paddingBottom: '$16',
|
|
4639
|
+
borderBottom: '1px solid $neutrals300'
|
|
4640
|
+
});
|
|
4471
4641
|
var InternalDetailsContainer = /*#__PURE__*/styled('div', {
|
|
4472
4642
|
display: 'flex'
|
|
4473
4643
|
});
|
|
@@ -4486,30 +4656,51 @@ var Description = /*#__PURE__*/styled(Typography, {
|
|
|
4486
4656
|
var Error = /*#__PURE__*/styled(Description, {
|
|
4487
4657
|
color: '$error'
|
|
4488
4658
|
});
|
|
4489
|
-
var Line$
|
|
4659
|
+
var Line$1 = /*#__PURE__*/styled('div', {
|
|
4490
4660
|
width: '0',
|
|
4491
4661
|
minHeight: '$16',
|
|
4492
4662
|
marginLeft: '$12',
|
|
4493
4663
|
border: '1px dashed $foreground',
|
|
4494
4664
|
borderRadius: 'inherit'
|
|
4495
4665
|
});
|
|
4496
|
-
var
|
|
4497
|
-
cursor: 'pointer',
|
|
4498
|
-
backgroundColor: '$neutrals200',
|
|
4499
|
-
padding: '$4',
|
|
4666
|
+
var Row$2 = /*#__PURE__*/styled('div', {
|
|
4500
4667
|
display: 'flex',
|
|
4501
|
-
justifyContent: '
|
|
4668
|
+
justifyContent: 'space-between',
|
|
4502
4669
|
alignItems: 'center',
|
|
4503
|
-
|
|
4504
|
-
|
|
4670
|
+
fontSize: '$14',
|
|
4671
|
+
padding: '$8 0',
|
|
4672
|
+
'.name': {
|
|
4673
|
+
color: '$neutrals600'
|
|
4674
|
+
},
|
|
4675
|
+
'.value': {
|
|
4676
|
+
display: 'flex',
|
|
4677
|
+
alignItems: 'center',
|
|
4678
|
+
color: '$neutrals800'
|
|
4679
|
+
},
|
|
4680
|
+
'.status': {
|
|
4681
|
+
fontWeight: 'bold',
|
|
4682
|
+
textTransform: 'uppercase'
|
|
4683
|
+
},
|
|
4684
|
+
'.status.failed': {
|
|
4685
|
+
color: '$error'
|
|
4686
|
+
},
|
|
4687
|
+
'.status.success': {
|
|
4688
|
+
color: '$success'
|
|
4689
|
+
}
|
|
4505
4690
|
});
|
|
4506
|
-
var RequestId = /*#__PURE__*/styled(
|
|
4507
|
-
|
|
4691
|
+
var RequestId = /*#__PURE__*/styled('div', {
|
|
4692
|
+
width: '150px',
|
|
4693
|
+
whiteSpace: 'nowrap',
|
|
4694
|
+
overflow: 'hidden',
|
|
4695
|
+
textOverflow: 'ellipsis',
|
|
4696
|
+
'@md': {
|
|
4697
|
+
width: 'auto'
|
|
4698
|
+
}
|
|
4508
4699
|
});
|
|
4509
|
-
var
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4700
|
+
var ExtraDetails = /*#__PURE__*/styled('div', {
|
|
4701
|
+
padding: '$8 0',
|
|
4702
|
+
color: '$neutrals600',
|
|
4703
|
+
fontSize: '$12'
|
|
4513
4704
|
});
|
|
4514
4705
|
var StepContainer$1 = /*#__PURE__*/styled('div', {
|
|
4515
4706
|
variants: {
|
|
@@ -4525,43 +4716,57 @@ var StepContainer$1 = /*#__PURE__*/styled('div', {
|
|
|
4525
4716
|
}
|
|
4526
4717
|
}
|
|
4527
4718
|
});
|
|
4719
|
+
var SwapFlowContainer = /*#__PURE__*/styled('div', {
|
|
4720
|
+
overflowY: 'auto'
|
|
4721
|
+
});
|
|
4528
4722
|
function SwapHistory(props) {
|
|
4529
4723
|
var pendingSwap = props.pendingSwap,
|
|
4530
4724
|
onBack = props.onBack,
|
|
4531
4725
|
onCopy = props.onCopy,
|
|
4532
4726
|
isCopied = props.isCopied,
|
|
4533
|
-
onCancel = props.onCancel
|
|
4727
|
+
onCancel = props.onCancel,
|
|
4728
|
+
date = props.date,
|
|
4729
|
+
onRetry = props.onRetry,
|
|
4730
|
+
extraMessageProps = _objectWithoutPropertiesLoose(props, _excluded$I);
|
|
4534
4731
|
var _useState = React.useState(false),
|
|
4535
4732
|
showDrawer = _useState[0],
|
|
4536
4733
|
setShowDrawer = _useState[1];
|
|
4537
4734
|
return React__default.createElement(SecondaryPage, {
|
|
4538
4735
|
title: "Swap Details",
|
|
4539
4736
|
textField: false,
|
|
4540
|
-
onBack: onBack
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4737
|
+
onBack: onBack,
|
|
4738
|
+
Footer: React__default.createElement(React__default.Fragment, null, (pendingSwap == null ? void 0 : pendingSwap.status) === 'running' && React__default.createElement(Button, {
|
|
4739
|
+
variant: "outlined",
|
|
4740
|
+
fullWidth: true,
|
|
4741
|
+
type: "error",
|
|
4742
|
+
onClick: setShowDrawer.bind(null, true)
|
|
4743
|
+
}, "Cancel"), !!onRetry && React__default.createElement(Button, {
|
|
4744
|
+
variant: "contained",
|
|
4745
|
+
fullWidth: true,
|
|
4746
|
+
type: "primary",
|
|
4747
|
+
onClick: onRetry
|
|
4748
|
+
}, "Try again"))
|
|
4749
|
+
}, React__default.createElement("div", null, React__default.createElement(SwapInfoContainer, null, React__default.createElement(Row$2, null, React__default.createElement("div", {
|
|
4750
|
+
className: "name"
|
|
4751
|
+
}, "Request ID:"), React__default.createElement("div", {
|
|
4752
|
+
className: "value requestId",
|
|
4548
4753
|
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) {
|
|
4754
|
+
}, React__default.createElement(RequestId, null, pendingSwap == null ? void 0 : pendingSwap.requestId), React__default.createElement(Spacer, {
|
|
4755
|
+
size: 4
|
|
4756
|
+
}), React__default.createElement(Button, {
|
|
4757
|
+
type: "primary",
|
|
4758
|
+
variant: "ghost",
|
|
4759
|
+
size: "compact"
|
|
4760
|
+
}, isCopied ? 'Copied!' : 'Copy'))), React__default.createElement(Row$2, null, React__default.createElement("div", {
|
|
4761
|
+
className: "name"
|
|
4762
|
+
}, "Status:"), React__default.createElement("div", {
|
|
4763
|
+
className: "value status " + ((pendingSwap == null ? void 0 : pendingSwap.status) || '')
|
|
4764
|
+
}, pendingSwap == null ? void 0 : pendingSwap.status, (pendingSwap == null ? void 0 : pendingSwap.status) === 'running' && React__default.createElement(Spinner, {
|
|
4765
|
+
size: 16,
|
|
4766
|
+
color: "primary"
|
|
4767
|
+
}))), React__default.createElement(ExtraDetails, null, date))), React__default.createElement(SwapFlowContainer, null, extraMessageProps.shortMessage && React__default.createElement(SwapMessages, Object.assign({}, extraMessageProps)), React__default.createElement(Divider, {
|
|
4768
|
+
size: 32
|
|
4769
|
+
}), pendingSwap == null ? void 0 : pendingSwap.steps.map(function (step, index) {
|
|
4565
4770
|
return React__default.createElement(StepContainer$1, {
|
|
4566
4771
|
key: index,
|
|
4567
4772
|
hasNotStarted: step.status === 'created',
|
|
@@ -4569,23 +4774,30 @@ function SwapHistory(props) {
|
|
|
4569
4774
|
}, index === 0 && React__default.createElement(RelativeContainer$1, null, React__default.createElement(StepDetail, {
|
|
4570
4775
|
logo: step.fromLogo,
|
|
4571
4776
|
symbol: step.fromSymbol,
|
|
4572
|
-
|
|
4777
|
+
// @ts-ignore
|
|
4778
|
+
chainLogo: step.fromBlockchainLogo || '',
|
|
4573
4779
|
blockchain: step.fromBlockchain,
|
|
4574
4780
|
amount: pendingSwap.inputAmount
|
|
4575
|
-
}), React__default.createElement(Dot$
|
|
4576
|
-
src:
|
|
4781
|
+
}), React__default.createElement(Dot$1, null)), React__default.createElement(Line$1, null), React__default.createElement(SwapperContainer$1, null, React__default.createElement(SwapperLogo$1, {
|
|
4782
|
+
src:
|
|
4783
|
+
// @ts-ignore
|
|
4784
|
+
step.swapperLogo || '',
|
|
4577
4785
|
alt: step.swapperId
|
|
4578
4786
|
}), React__default.createElement("div", null, React__default.createElement(Typography, {
|
|
4579
4787
|
ml: 4,
|
|
4580
4788
|
variant: "caption"
|
|
4581
|
-
},
|
|
4789
|
+
},
|
|
4790
|
+
// @ts-ignore
|
|
4791
|
+
step.swapperType, ' ', "from ", step.fromSymbol, " to ", step.toSymbol, "via ", step.swapperId), React__default.createElement(Fee, null, React__default.createElement(GasIcon, null), React__default.createElement(Typography, {
|
|
4582
4792
|
ml: 4,
|
|
4583
4793
|
variant: "caption"
|
|
4584
|
-
}, "$",
|
|
4794
|
+
}, "$",
|
|
4795
|
+
// @ts-ignore
|
|
4796
|
+
step.feeInUsd, ' ', "estimated gas fee")))), React__default.createElement("div", {
|
|
4585
4797
|
style: {
|
|
4586
4798
|
display: 'flex'
|
|
4587
4799
|
}
|
|
4588
|
-
}, React__default.createElement(InternalDetailsContainer, null, React__default.createElement(Line$
|
|
4800
|
+
}, React__default.createElement(InternalDetailsContainer, null, React__default.createElement(Line$1, null), !!step.explorerUrl && React__default.createElement("div", null, step.explorerUrl.map(function (item, index) {
|
|
4589
4801
|
return React__default.createElement(InternalDetail, {
|
|
4590
4802
|
key: index
|
|
4591
4803
|
}, React__default.createElement(DescriptionContainer, null, React__default.createElement(CheckCircleIcon, {
|
|
@@ -4605,28 +4817,25 @@ function SwapHistory(props) {
|
|
|
4605
4817
|
}, "Step failed")))))), index + 1 === pendingSwap.steps.length && React__default.createElement(ArrowDown, null), React__default.createElement(StepDetail, {
|
|
4606
4818
|
logo: step.toLogo,
|
|
4607
4819
|
symbol: step.toSymbol,
|
|
4608
|
-
|
|
4820
|
+
// @ts-ignore
|
|
4821
|
+
chainLogo: step.toBlockchainLogo || '',
|
|
4609
4822
|
blockchain: step.toBlockchain,
|
|
4610
|
-
amount: step.outputAmount
|
|
4823
|
+
amount: step.outputAmount || ''
|
|
4611
4824
|
}));
|
|
4612
|
-
}),
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
onClick: setShowDrawer.bind(null, true)
|
|
4616
|
-
}, "Cancel")))), React__default.createElement(Drawer, {
|
|
4825
|
+
}), React__default.createElement(Divider, {
|
|
4826
|
+
size: 32
|
|
4827
|
+
})), React__default.createElement(Drawer, {
|
|
4617
4828
|
onClose: setShowDrawer.bind(null, false),
|
|
4618
4829
|
open: showDrawer,
|
|
4619
4830
|
showClose: true,
|
|
4620
4831
|
anchor: "bottom",
|
|
4621
4832
|
title: "Cancel Progress",
|
|
4622
|
-
content: React__default.createElement(
|
|
4833
|
+
content: React__default.createElement(Alert, {
|
|
4623
4834
|
type: "warning"
|
|
4624
|
-
}, React__default.createElement(
|
|
4625
|
-
variant: "body2"
|
|
4626
|
-
}, React__default.createElement("p", null, "Warning: Rango ", React__default.createElement("u", null, "neither reverts"), " your transaction", React__default.createElement("u", null, "nor refunds"), " you if you've already signed and sent a transaction to the blockchain since it's out of Rango's control. Beware that \"Cancel\" only stops next steps from being executed."), React__default.createElement(Spacer, {
|
|
4835
|
+
}, React__default.createElement("p", null, "Warning: Rango ", React__default.createElement("u", null, "neither reverts"), " your transaction\xA0", React__default.createElement("u", null, "nor refunds"), " you if you've already signed and sent a transaction to the blockchain since it's out of Rango's control. Beware that \"Cancel\" only stops next steps from being executed."), React__default.createElement(Spacer, {
|
|
4627
4836
|
size: 12,
|
|
4628
4837
|
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"))
|
|
4838
|
+
}), React__default.createElement("p", null, "If you have already signed your transaction to blockchain, you should wait for that to complete or rollback")),
|
|
4630
4839
|
footer: React__default.createElement("div", {
|
|
4631
4840
|
style: {
|
|
4632
4841
|
display: 'flex',
|
|
@@ -4659,6 +4868,7 @@ exports.AngleDownIcon = AngleDownIcon;
|
|
|
4659
4868
|
exports.AngleLeftIcon = AngleLeftIcon;
|
|
4660
4869
|
exports.AngleRightIcon = AngleRightIcon;
|
|
4661
4870
|
exports.AngleUpIcon = AngleUpIcon;
|
|
4871
|
+
exports.ArrowRightIcon = ArrowRightIcon;
|
|
4662
4872
|
exports.BagIcon = BagIcon;
|
|
4663
4873
|
exports.BanIcon = BanIcon;
|
|
4664
4874
|
exports.BestRoute = BestRoute;
|
|
@@ -4674,21 +4884,23 @@ exports.Chip = Chip;
|
|
|
4674
4884
|
exports.CloseIcon = CloseIcon;
|
|
4675
4885
|
exports.ColorPicker = ColorPicker;
|
|
4676
4886
|
exports.ConfirmSwap = ConfirmSwap;
|
|
4677
|
-
exports.ConfirmWallets = ConfirmWallets;
|
|
4678
4887
|
exports.ConnectWalletsModal = ConnectWalletsModal;
|
|
4679
4888
|
exports.CopyIcon = CopyIcon;
|
|
4680
4889
|
exports.DeleteCircleIcon = DeleteCircleIcon;
|
|
4681
4890
|
exports.DeleteWalletIcon = DeleteWalletIcon;
|
|
4682
4891
|
exports.DisconnectIcon = DisconnectIcon;
|
|
4892
|
+
exports.Divider = Divider;
|
|
4683
4893
|
exports.DownloadIcon = DownloadIcon;
|
|
4684
4894
|
exports.Drawer = Drawer;
|
|
4685
4895
|
exports.FilledCircle = FilledCircle;
|
|
4686
4896
|
exports.GasIcon = GasIcon;
|
|
4897
|
+
exports.Header = Header;
|
|
4687
4898
|
exports.History = History;
|
|
4688
4899
|
exports.HistoryIcon = HistoryIcon;
|
|
4689
4900
|
exports.HorizontalSwapIcon = HorizontalSwapIcon;
|
|
4690
4901
|
exports.InfoCircleIcon = InfoCircleIcon;
|
|
4691
4902
|
exports.LiquiditySourcesSelector = LiquiditySourcesSelector;
|
|
4903
|
+
exports.LoadingFailedAlert = LoadingFailedAlert;
|
|
4692
4904
|
exports.MinusCircleIcon = MinusCircleIcon;
|
|
4693
4905
|
exports.Modal = Modal;
|
|
4694
4906
|
exports.Radio = Radio;
|