@rango-dev/ui 0.1.10-next.92 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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/TokenSelector/TokenSelector.d.ts +3 -0
- 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 +1062 -838
- 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 +1061 -840
- 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/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 +16 -18
- package/src/components/TokenSelector/TokenSelector.tsx +47 -10
- 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 +309 -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
package/dist/ui.esm.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React__default, { createElement, forwardRef, Fragment, useState, useEffect } from 'react';
|
|
2
|
-
import { Provider, Root, Portal, Trigger, Content as Content$1, Arrow
|
|
2
|
+
import { Provider, Root, Portal, Trigger, Content as Content$1, Arrow } from '@radix-ui/react-tooltip';
|
|
3
|
+
import { VariableSizeList } from 'react-window';
|
|
4
|
+
import InfiniteLoader from 'react-window-infinite-loader';
|
|
5
|
+
import AutoSizer from 'react-virtualized-auto-sizer';
|
|
3
6
|
import { Indicator, Root as Root$1 } from '@radix-ui/react-checkbox';
|
|
4
7
|
import { createPortal } from 'react-dom';
|
|
5
8
|
import { detectInstallLink } from '@rango-dev/wallets-shared';
|
|
6
9
|
import { Root as Root$2, Thumb } from '@radix-ui/react-switch';
|
|
7
10
|
import { Root as Root$3, Item, Indicator as Indicator$1 } from '@radix-ui/react-radio-group';
|
|
8
|
-
import { VariableSizeList } from 'react-window';
|
|
9
|
-
import InfiniteLoader from 'react-window-infinite-loader';
|
|
10
|
-
import AutoSizer from 'react-virtualized-auto-sizer';
|
|
11
11
|
import { ChromePicker } from 'react-color';
|
|
12
12
|
|
|
13
13
|
function _extends() {
|
|
@@ -864,11 +864,42 @@ ChevronRightIcon.toString = function () {
|
|
|
864
864
|
};
|
|
865
865
|
|
|
866
866
|
var _excluded$m = ["size", "color"];
|
|
867
|
-
var
|
|
867
|
+
var ArrowRightIcon = function ArrowRightIcon(_ref) {
|
|
868
868
|
var _ref$size = _ref.size,
|
|
869
869
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
870
870
|
color = _ref.color,
|
|
871
871
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$m);
|
|
872
|
+
return createElement(SvgWithStrokeColor, Object.assign({
|
|
873
|
+
width: size,
|
|
874
|
+
height: size,
|
|
875
|
+
viewBox: "0 0 24 24",
|
|
876
|
+
color: color,
|
|
877
|
+
fill: "none",
|
|
878
|
+
stroke: "currentColor",
|
|
879
|
+
"stroke-width": "2",
|
|
880
|
+
"stroke-linecap": "round",
|
|
881
|
+
"stroke-linejoin": "round",
|
|
882
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
883
|
+
className: "_icon"
|
|
884
|
+
}, props), createElement("line", {
|
|
885
|
+
x1: "5",
|
|
886
|
+
y1: "12",
|
|
887
|
+
x2: "19",
|
|
888
|
+
y2: "12"
|
|
889
|
+
}), createElement("polyline", {
|
|
890
|
+
points: "12 5 19 12 12 19"
|
|
891
|
+
}));
|
|
892
|
+
};
|
|
893
|
+
ArrowRightIcon.toString = function () {
|
|
894
|
+
return '._icon';
|
|
895
|
+
};
|
|
896
|
+
|
|
897
|
+
var _excluded$n = ["size", "color"];
|
|
898
|
+
var RetryRightIcon = function RetryRightIcon(_ref) {
|
|
899
|
+
var _ref$size = _ref.size,
|
|
900
|
+
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
901
|
+
color = _ref.color,
|
|
902
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$n);
|
|
872
903
|
return createElement(SvgWithStrokeColor, Object.assign({
|
|
873
904
|
width: size,
|
|
874
905
|
height: size,
|
|
@@ -888,12 +919,12 @@ RetryRightIcon.toString = function () {
|
|
|
888
919
|
return '._icon';
|
|
889
920
|
};
|
|
890
921
|
|
|
891
|
-
var _excluded$
|
|
922
|
+
var _excluded$o = ["size", "color"];
|
|
892
923
|
var RetryLeftIcon = function RetryLeftIcon(_ref) {
|
|
893
924
|
var _ref$size = _ref.size,
|
|
894
925
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
895
926
|
color = _ref.color,
|
|
896
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
927
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$o);
|
|
897
928
|
return createElement(SvgWithStrokeColor, Object.assign({
|
|
898
929
|
width: size,
|
|
899
930
|
height: size,
|
|
@@ -913,12 +944,12 @@ RetryLeftIcon.toString = function () {
|
|
|
913
944
|
return '._icon';
|
|
914
945
|
};
|
|
915
946
|
|
|
916
|
-
var _excluded$
|
|
947
|
+
var _excluded$p = ["size", "color"];
|
|
917
948
|
var TryAgainIcon = function TryAgainIcon(_ref) {
|
|
918
949
|
var _ref$size = _ref.size,
|
|
919
950
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
920
951
|
color = _ref.color,
|
|
921
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
952
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$p);
|
|
922
953
|
return createElement(SvgWithStrokeColor, Object.assign({
|
|
923
954
|
width: size,
|
|
924
955
|
height: size,
|
|
@@ -938,12 +969,12 @@ TryAgainIcon.toString = function () {
|
|
|
938
969
|
return '._icon';
|
|
939
970
|
};
|
|
940
971
|
|
|
941
|
-
var _excluded$
|
|
972
|
+
var _excluded$q = ["size", "color"];
|
|
942
973
|
var VerticalSwapIcon = function VerticalSwapIcon(_ref) {
|
|
943
974
|
var _ref$size = _ref.size,
|
|
944
975
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
945
976
|
color = _ref.color,
|
|
946
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
977
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
|
|
947
978
|
return createElement(SvgWithStrokeColor, Object.assign({
|
|
948
979
|
width: size,
|
|
949
980
|
height: size,
|
|
@@ -969,12 +1000,12 @@ VerticalSwapIcon.toString = function () {
|
|
|
969
1000
|
return '._icon';
|
|
970
1001
|
};
|
|
971
1002
|
|
|
972
|
-
var _excluded$
|
|
1003
|
+
var _excluded$r = ["size", "color"];
|
|
973
1004
|
var HorizontalSwapIcon = function HorizontalSwapIcon(_ref) {
|
|
974
1005
|
var _ref$size = _ref.size,
|
|
975
1006
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
976
1007
|
color = _ref.color,
|
|
977
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1008
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$r);
|
|
978
1009
|
return createElement(SvgWithStrokeColor, Object.assign({
|
|
979
1010
|
width: size,
|
|
980
1011
|
height: size,
|
|
@@ -1000,13 +1031,13 @@ HorizontalSwapIcon.toString = function () {
|
|
|
1000
1031
|
return '._icon';
|
|
1001
1032
|
};
|
|
1002
1033
|
|
|
1003
|
-
var _excluded$
|
|
1034
|
+
var _excluded$s = ["color", "size"];
|
|
1004
1035
|
var RetryIcon = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
1005
1036
|
var _ref$color = _ref.color,
|
|
1006
1037
|
color = _ref$color === void 0 ? 'black' : _ref$color,
|
|
1007
1038
|
_ref$size = _ref.size,
|
|
1008
1039
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1009
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1040
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
|
1010
1041
|
return createElement(SvgWithStrokeColor, Object.assign({
|
|
1011
1042
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1012
1043
|
width: size,
|
|
@@ -1031,12 +1062,12 @@ RetryIcon.toString = function () {
|
|
|
1031
1062
|
return '._icon';
|
|
1032
1063
|
};
|
|
1033
1064
|
|
|
1034
|
-
var _excluded$
|
|
1065
|
+
var _excluded$t = ["size", "color"];
|
|
1035
1066
|
var WalletIcon = function WalletIcon(_ref) {
|
|
1036
1067
|
var _ref$size = _ref.size,
|
|
1037
1068
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1038
1069
|
color = _ref.color,
|
|
1039
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1070
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$t);
|
|
1040
1071
|
return createElement(SvgWithFillColor, Object.assign({
|
|
1041
1072
|
width: size,
|
|
1042
1073
|
height: size,
|
|
@@ -1063,12 +1094,12 @@ WalletIcon.toString = function () {
|
|
|
1063
1094
|
return '._icon';
|
|
1064
1095
|
};
|
|
1065
1096
|
|
|
1066
|
-
var _excluded$
|
|
1097
|
+
var _excluded$u = ["size", "color"];
|
|
1067
1098
|
var AddWalletIcon = function AddWalletIcon(_ref) {
|
|
1068
1099
|
var _ref$size = _ref.size,
|
|
1069
1100
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1070
1101
|
color = _ref.color,
|
|
1071
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1102
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$u);
|
|
1072
1103
|
return createElement(SvgWithFillColor, Object.assign({
|
|
1073
1104
|
width: size,
|
|
1074
1105
|
height: size,
|
|
@@ -1103,12 +1134,12 @@ AddWalletIcon.toString = function () {
|
|
|
1103
1134
|
return '._icon';
|
|
1104
1135
|
};
|
|
1105
1136
|
|
|
1106
|
-
var _excluded$
|
|
1137
|
+
var _excluded$v = ["size", "color"];
|
|
1107
1138
|
var DeleteWalletIcon = function DeleteWalletIcon(_ref) {
|
|
1108
1139
|
var _ref$size = _ref.size,
|
|
1109
1140
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1110
1141
|
color = _ref.color,
|
|
1111
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1142
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$v);
|
|
1112
1143
|
return createElement(SvgWithFillColor, Object.assign({
|
|
1113
1144
|
width: size,
|
|
1114
1145
|
height: size,
|
|
@@ -1143,12 +1174,12 @@ DeleteWalletIcon.toString = function () {
|
|
|
1143
1174
|
return '._icon';
|
|
1144
1175
|
};
|
|
1145
1176
|
|
|
1146
|
-
var _excluded$
|
|
1177
|
+
var _excluded$w = ["size", "color"];
|
|
1147
1178
|
var CheckWalletIcon = function CheckWalletIcon(_ref) {
|
|
1148
1179
|
var _ref$size = _ref.size,
|
|
1149
1180
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1150
1181
|
color = _ref.color,
|
|
1151
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1182
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$w);
|
|
1152
1183
|
return createElement(SvgWithFillColor, Object.assign({
|
|
1153
1184
|
width: size,
|
|
1154
1185
|
height: size,
|
|
@@ -1179,12 +1210,12 @@ CheckWalletIcon.toString = function () {
|
|
|
1179
1210
|
return '._icon';
|
|
1180
1211
|
};
|
|
1181
1212
|
|
|
1182
|
-
var _excluded$
|
|
1213
|
+
var _excluded$x = ["size", "color"];
|
|
1183
1214
|
var SwapWalletIcon = function SwapWalletIcon(_ref) {
|
|
1184
1215
|
var _ref$size = _ref.size,
|
|
1185
1216
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1186
1217
|
color = _ref.color,
|
|
1187
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1218
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$x);
|
|
1188
1219
|
return createElement(SvgWithFillColor, Object.assign({
|
|
1189
1220
|
width: size,
|
|
1190
1221
|
height: size,
|
|
@@ -1219,13 +1250,13 @@ SwapWalletIcon.toString = function () {
|
|
|
1219
1250
|
return '._icon';
|
|
1220
1251
|
};
|
|
1221
1252
|
|
|
1222
|
-
var _excluded$
|
|
1253
|
+
var _excluded$y = ["color", "size"];
|
|
1223
1254
|
var DisconnectIcon = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
1224
1255
|
var _ref$color = _ref.color,
|
|
1225
1256
|
color = _ref$color === void 0 ? 'black' : _ref$color,
|
|
1226
1257
|
_ref$size = _ref.size,
|
|
1227
1258
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1228
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1259
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$y);
|
|
1229
1260
|
return createElement(SvgWithStrokeColor, Object.assign({
|
|
1230
1261
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1231
1262
|
width: size,
|
|
@@ -1255,12 +1286,12 @@ DisconnectIcon.toString = function () {
|
|
|
1255
1286
|
return '._icon';
|
|
1256
1287
|
};
|
|
1257
1288
|
|
|
1258
|
-
var _excluded$
|
|
1289
|
+
var _excluded$z = ["size", "color"];
|
|
1259
1290
|
var BagIcon = function BagIcon(_ref) {
|
|
1260
1291
|
var _ref$size = _ref.size,
|
|
1261
1292
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1262
1293
|
color = _ref.color,
|
|
1263
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1294
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$z);
|
|
1264
1295
|
return createElement(SvgWithStrokeColor, Object.assign({
|
|
1265
1296
|
width: size,
|
|
1266
1297
|
height: size,
|
|
@@ -1290,11 +1321,11 @@ BagIcon.toString = function () {
|
|
|
1290
1321
|
return '._icon';
|
|
1291
1322
|
};
|
|
1292
1323
|
|
|
1293
|
-
var _excluded$
|
|
1324
|
+
var _excluded$A = ["size"];
|
|
1294
1325
|
var TimeIcon = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
1295
1326
|
var _ref$size = _ref.size,
|
|
1296
1327
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1297
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1328
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$A);
|
|
1298
1329
|
return createElement(SvgWithStrokeColor, Object.assign({
|
|
1299
1330
|
width: size,
|
|
1300
1331
|
height: size,
|
|
@@ -1327,12 +1358,12 @@ CloseIcon.toString = function () {
|
|
|
1327
1358
|
return '._icon';
|
|
1328
1359
|
};
|
|
1329
1360
|
|
|
1330
|
-
var _excluded$
|
|
1361
|
+
var _excluded$B = ["size", "color"];
|
|
1331
1362
|
var SignatureIcon = function SignatureIcon(_ref) {
|
|
1332
1363
|
var _ref$size = _ref.size,
|
|
1333
1364
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1334
1365
|
color = _ref.color,
|
|
1335
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1366
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$B);
|
|
1336
1367
|
return createElement(SvgWithFillColor, Object.assign({
|
|
1337
1368
|
width: size,
|
|
1338
1369
|
height: size,
|
|
@@ -1353,12 +1384,12 @@ SignatureIcon.toString = function () {
|
|
|
1353
1384
|
return '._icon';
|
|
1354
1385
|
};
|
|
1355
1386
|
|
|
1356
|
-
var _excluded$
|
|
1387
|
+
var _excluded$C = ["size", "color"];
|
|
1357
1388
|
var CopyIcon = function CopyIcon(_ref) {
|
|
1358
1389
|
var _ref$size = _ref.size,
|
|
1359
1390
|
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
1360
1391
|
color = _ref.color,
|
|
1361
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1392
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$C);
|
|
1362
1393
|
return createElement(SvgWithFillColor, Object.assign({
|
|
1363
1394
|
width: size,
|
|
1364
1395
|
height: size,
|
|
@@ -1384,7 +1415,7 @@ CopyIcon.toString = function () {
|
|
|
1384
1415
|
return '._icon';
|
|
1385
1416
|
};
|
|
1386
1417
|
|
|
1387
|
-
var _excluded$
|
|
1418
|
+
var _excluded$D = ["children", "className", "color"];
|
|
1388
1419
|
var TypographyContainer = /*#__PURE__*/styled('span', {
|
|
1389
1420
|
margin: 0,
|
|
1390
1421
|
display: 'inline-block',
|
|
@@ -1551,7 +1582,7 @@ function Typography(_ref) {
|
|
|
1551
1582
|
var children = _ref.children,
|
|
1552
1583
|
className = _ref.className,
|
|
1553
1584
|
color = _ref.color,
|
|
1554
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1585
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$D);
|
|
1555
1586
|
var customCss = color ? {
|
|
1556
1587
|
color: color.startsWith('$') ? color : "$" + color
|
|
1557
1588
|
} : {
|
|
@@ -1630,7 +1661,8 @@ var Detail = /*#__PURE__*/styled('div', {
|
|
|
1630
1661
|
}
|
|
1631
1662
|
});
|
|
1632
1663
|
var SubTitle = /*#__PURE__*/styled(Typography, {
|
|
1633
|
-
color: '$neutrals600'
|
|
1664
|
+
color: '$neutrals600',
|
|
1665
|
+
display: 'block'
|
|
1634
1666
|
});
|
|
1635
1667
|
function StepDetail(_ref) {
|
|
1636
1668
|
var logo = _ref.logo,
|
|
@@ -1832,7 +1864,7 @@ var TooltipContent = /*#__PURE__*/styled(Content$1, {
|
|
|
1832
1864
|
}
|
|
1833
1865
|
}
|
|
1834
1866
|
});
|
|
1835
|
-
var TooltipArrow = /*#__PURE__*/styled(Arrow
|
|
1867
|
+
var TooltipArrow = /*#__PURE__*/styled(Arrow, {
|
|
1836
1868
|
variants: {
|
|
1837
1869
|
color: {
|
|
1838
1870
|
primary: {
|
|
@@ -2068,7 +2100,7 @@ function BestRoute(props) {
|
|
|
2068
2100
|
}, "No routes found")));
|
|
2069
2101
|
}
|
|
2070
2102
|
|
|
2071
|
-
var _excluded$
|
|
2103
|
+
var _excluded$E = ["children", "loading", "disabled", "prefix", "suffix", "align", "flexContent"];
|
|
2072
2104
|
var _ghost, _css, _css2, _css3;
|
|
2073
2105
|
var ButtonContainer = /*#__PURE__*/styled('button', {
|
|
2074
2106
|
borderRadius: '$5',
|
|
@@ -2097,6 +2129,7 @@ var ButtonContainer = /*#__PURE__*/styled('button', {
|
|
|
2097
2129
|
},
|
|
2098
2130
|
size: {
|
|
2099
2131
|
compact: {},
|
|
2132
|
+
free: {},
|
|
2100
2133
|
small: {
|
|
2101
2134
|
height: '$32'
|
|
2102
2135
|
},
|
|
@@ -2412,7 +2445,7 @@ function Button(_ref) {
|
|
|
2412
2445
|
suffix = _ref.suffix,
|
|
2413
2446
|
align = _ref.align,
|
|
2414
2447
|
flexContent = _ref.flexContent,
|
|
2415
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
2448
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$E);
|
|
2416
2449
|
var isDisabled = loading || disabled;
|
|
2417
2450
|
return React__default.createElement(ButtonContainer, Object.assign({
|
|
2418
2451
|
disabled: isDisabled
|
|
@@ -2488,9 +2521,70 @@ function BlockchainsList(props) {
|
|
|
2488
2521
|
}));
|
|
2489
2522
|
}
|
|
2490
2523
|
|
|
2491
|
-
var
|
|
2524
|
+
var DividerContainer = /*#__PURE__*/styled('div', {
|
|
2525
|
+
variants: {
|
|
2526
|
+
size: {
|
|
2527
|
+
4: {
|
|
2528
|
+
height: '$4'
|
|
2529
|
+
},
|
|
2530
|
+
8: {
|
|
2531
|
+
height: '$8'
|
|
2532
|
+
},
|
|
2533
|
+
12: {
|
|
2534
|
+
height: '$12'
|
|
2535
|
+
},
|
|
2536
|
+
16: {
|
|
2537
|
+
height: '$16'
|
|
2538
|
+
},
|
|
2539
|
+
18: {
|
|
2540
|
+
height: '$18'
|
|
2541
|
+
},
|
|
2542
|
+
20: {
|
|
2543
|
+
height: '$20'
|
|
2544
|
+
},
|
|
2545
|
+
24: {
|
|
2546
|
+
height: '$24'
|
|
2547
|
+
},
|
|
2548
|
+
32: {
|
|
2549
|
+
height: '$32'
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
}
|
|
2553
|
+
});
|
|
2554
|
+
function Divider(_ref) {
|
|
2555
|
+
var _ref$size = _ref.size,
|
|
2556
|
+
size = _ref$size === void 0 ? 12 : _ref$size;
|
|
2557
|
+
return React__default.createElement(DividerContainer, {
|
|
2558
|
+
size: size
|
|
2559
|
+
});
|
|
2560
|
+
}
|
|
2561
|
+
|
|
2562
|
+
var HeaderContainer = /*#__PURE__*/styled('div', {
|
|
2563
|
+
display: 'flex',
|
|
2564
|
+
justifyContent: 'space-between',
|
|
2565
|
+
alignItems: 'center',
|
|
2566
|
+
padding: '$8 0',
|
|
2567
|
+
position: 'relative'
|
|
2568
|
+
});
|
|
2569
|
+
var BackButton = /*#__PURE__*/styled(Button, {
|
|
2570
|
+
padding: '$8'
|
|
2571
|
+
});
|
|
2572
|
+
function Header(props) {
|
|
2573
|
+
return React__default.createElement(HeaderContainer, null, props.onBack ? React__default.createElement(BackButton, {
|
|
2574
|
+
variant: "ghost",
|
|
2575
|
+
size: "small",
|
|
2576
|
+
onClick: props.onBack
|
|
2577
|
+
}, React__default.createElement(AngleLeftIcon, {
|
|
2578
|
+
size: 24
|
|
2579
|
+
})) : null, props.prefix, React__default.createElement(Typography, {
|
|
2580
|
+
variant: "h4"
|
|
2581
|
+
}, props.title), props.suffix || React__default.createElement("div", null));
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
var _excluded$F = ["label", "prefix", "suffix", "children", "size", "style"];
|
|
2492
2585
|
var InputContainer = /*#__PURE__*/styled('div', {
|
|
2493
2586
|
backgroundColor: '$background',
|
|
2587
|
+
padding: '1px',
|
|
2494
2588
|
boxSizing: 'border-box',
|
|
2495
2589
|
border: '1px solid $neutrals400',
|
|
2496
2590
|
borderRadius: '$5',
|
|
@@ -2574,7 +2668,7 @@ var TextField = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
2574
2668
|
suffix = props.suffix,
|
|
2575
2669
|
size = props.size,
|
|
2576
2670
|
style = props.style,
|
|
2577
|
-
inputAttributes = _objectWithoutPropertiesLoose(props, _excluded$
|
|
2671
|
+
inputAttributes = _objectWithoutPropertiesLoose(props, _excluded$F);
|
|
2578
2672
|
return React__default.createElement(React__default.Fragment, null, label && React__default.createElement(Label, Object.assign({
|
|
2579
2673
|
className: "_text"
|
|
2580
2674
|
}, inputAttributes.id && {
|
|
@@ -2594,36 +2688,15 @@ var TextField = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
2594
2688
|
})), suffix || null));
|
|
2595
2689
|
});
|
|
2596
2690
|
|
|
2597
|
-
var
|
|
2691
|
+
var ContentContainer = /*#__PURE__*/styled('div', {
|
|
2692
|
+
overflow: 'hidden',
|
|
2598
2693
|
display: 'flex',
|
|
2599
2694
|
flexDirection: 'column',
|
|
2600
|
-
height: '100%',
|
|
2601
|
-
width: '100%',
|
|
2602
|
-
padding: '$12 0',
|
|
2603
|
-
position: 'relative',
|
|
2604
|
-
'@lg': {
|
|
2605
|
-
padding: '$16 0'
|
|
2606
|
-
}
|
|
2607
|
-
});
|
|
2608
|
-
var HeaderContainer = /*#__PURE__*/styled('div', {
|
|
2609
|
-
display: 'flex',
|
|
2610
|
-
justifyContent: 'center',
|
|
2611
|
-
alignItems: 'center',
|
|
2612
|
-
marginBottom: '$16',
|
|
2613
|
-
position: 'relative'
|
|
2614
|
-
});
|
|
2615
|
-
var BackIcon = /*#__PURE__*/styled(AngleLeftIcon, {
|
|
2616
|
-
position: 'absolute',
|
|
2617
|
-
left: '0'
|
|
2618
|
-
});
|
|
2619
|
-
var StyledBackIcon = /*#__PURE__*/styled(BackIcon, {
|
|
2620
|
-
cursor: 'pointer'
|
|
2621
|
-
});
|
|
2622
|
-
var ContentContainer = /*#__PURE__*/styled('div', {
|
|
2623
2695
|
flex: '1',
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2696
|
+
padding: '0 $4'
|
|
2697
|
+
});
|
|
2698
|
+
var TextFieldContainer = /*#__PURE__*/styled('div', {
|
|
2699
|
+
padding: '1px'
|
|
2627
2700
|
});
|
|
2628
2701
|
function SecondaryPage(props) {
|
|
2629
2702
|
var title = props.title,
|
|
@@ -2635,12 +2708,11 @@ function SecondaryPage(props) {
|
|
|
2635
2708
|
var _useState = useState(''),
|
|
2636
2709
|
searchedFor = _useState[0],
|
|
2637
2710
|
setSearchedFor = _useState[1];
|
|
2638
|
-
return React__default.createElement(
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
}, title), TopButton), props.textField && React__default.createElement("div", null, React__default.createElement(TextField, {
|
|
2711
|
+
return React__default.createElement(React__default.Fragment, null, hasHeader && React__default.createElement(Header, {
|
|
2712
|
+
onBack: onBack,
|
|
2713
|
+
title: title || '',
|
|
2714
|
+
suffix: TopButton
|
|
2715
|
+
}), React__default.createElement(ContentContainer, null, props.textField && React__default.createElement(TextFieldContainer, null, React__default.createElement(TextField, {
|
|
2644
2716
|
size: "large",
|
|
2645
2717
|
prefix: React__default.createElement(SearchIcon, {
|
|
2646
2718
|
size: 24
|
|
@@ -2651,9 +2723,28 @@ function SecondaryPage(props) {
|
|
|
2651
2723
|
},
|
|
2652
2724
|
value: searchedFor,
|
|
2653
2725
|
autoFocus: true
|
|
2654
|
-
})
|
|
2726
|
+
}), React__default.createElement(Divider, {
|
|
2727
|
+
size: 16
|
|
2728
|
+
})), props.textField && (props.children == null ? void 0 : props.children(searchedFor)), !props.textField && props.children), Footer);
|
|
2655
2729
|
}
|
|
2656
2730
|
|
|
2731
|
+
var containsText = function containsText(text, searchText) {
|
|
2732
|
+
return text.toLowerCase().indexOf(searchText.toLowerCase()) > -1;
|
|
2733
|
+
};
|
|
2734
|
+
var getConciseAddress = function getConciseAddress(address, maxChars, ellipsisLength) {
|
|
2735
|
+
if (maxChars === void 0) {
|
|
2736
|
+
maxChars = 8;
|
|
2737
|
+
}
|
|
2738
|
+
if (ellipsisLength === void 0) {
|
|
2739
|
+
ellipsisLength = 3;
|
|
2740
|
+
}
|
|
2741
|
+
if (!address) return null;
|
|
2742
|
+
if (address.length < 2 * maxChars + ellipsisLength) return address;
|
|
2743
|
+
var start = Math.ceil((address.length - maxChars) / 2);
|
|
2744
|
+
var end = address.length - maxChars;
|
|
2745
|
+
return "" + address.substr(start, maxChars) + '.'.repeat(ellipsisLength) + address.substr(end);
|
|
2746
|
+
};
|
|
2747
|
+
|
|
2657
2748
|
var SpacerContainer = /*#__PURE__*/styled('div', {
|
|
2658
2749
|
variants: {
|
|
2659
2750
|
size: {
|
|
@@ -2789,7 +2880,7 @@ var MainContainer = /*#__PURE__*/styled('div', {
|
|
|
2789
2880
|
color: '$primary200'
|
|
2790
2881
|
},
|
|
2791
2882
|
secondary: {
|
|
2792
|
-
color: '$
|
|
2883
|
+
color: '$foreground'
|
|
2793
2884
|
},
|
|
2794
2885
|
success: {
|
|
2795
2886
|
color: '$success300'
|
|
@@ -2813,7 +2904,14 @@ function Alert(props) {
|
|
|
2813
2904
|
className: showIcon ? 'hasIcon' : ''
|
|
2814
2905
|
}, React__default.createElement("div", {
|
|
2815
2906
|
className: "main"
|
|
2816
|
-
}, showIcon && React__default.createElement(React__default.Fragment, null,
|
|
2907
|
+
}, showIcon && React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
2908
|
+
style: {
|
|
2909
|
+
width: '32px',
|
|
2910
|
+
display: 'flex',
|
|
2911
|
+
justifyContent: 'center',
|
|
2912
|
+
alignItems: 'center'
|
|
2913
|
+
}
|
|
2914
|
+
}, type === 'success' && React__default.createElement(CheckCircleIcon, {
|
|
2817
2915
|
color: type,
|
|
2818
2916
|
size: 24
|
|
2819
2917
|
}), type === 'warning' && React__default.createElement(WarningIcon, {
|
|
@@ -2824,230 +2922,462 @@ function Alert(props) {
|
|
|
2824
2922
|
size: 24
|
|
2825
2923
|
}), React__default.createElement(Spacer, {
|
|
2826
2924
|
size: 8
|
|
2827
|
-
})),
|
|
2925
|
+
}))), React__default.createElement("div", {
|
|
2926
|
+
style: {
|
|
2927
|
+
display: 'flex',
|
|
2928
|
+
justifyContent: 'center',
|
|
2929
|
+
alignItems: 'start',
|
|
2930
|
+
flexDirection: 'column',
|
|
2931
|
+
width: '100%'
|
|
2932
|
+
}
|
|
2933
|
+
}, title && React__default.createElement(React__default.Fragment, null, React__default.createElement(Typography, {
|
|
2934
|
+
className: "title",
|
|
2828
2935
|
variant: "h6",
|
|
2829
2936
|
color: type
|
|
2830
|
-
}, title), children
|
|
2937
|
+
}, title), !!children && React__default.createElement(Spacer, {
|
|
2938
|
+
size: 8,
|
|
2939
|
+
direction: "vertical"
|
|
2940
|
+
})), children)), props.footer ? React__default.createElement("div", {
|
|
2831
2941
|
className: "footer"
|
|
2832
2942
|
}, props.footer) : null);
|
|
2833
2943
|
}
|
|
2834
2944
|
|
|
2835
|
-
|
|
2836
|
-
return
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
var ListContainer$1 = /*#__PURE__*/styled('div', {
|
|
2840
|
-
height: '450px',
|
|
2841
|
-
display: 'flex',
|
|
2842
|
-
justifyContent: 'center',
|
|
2843
|
-
alignItems: 'center'
|
|
2844
|
-
});
|
|
2845
|
-
var filterBlockchains = function filterBlockchains(list, searchedFor) {
|
|
2846
|
-
return list.filter(function (blockchain) {
|
|
2847
|
-
return containsText(blockchain.name, searchedFor) || containsText(blockchain.displayName, searchedFor);
|
|
2848
|
-
});
|
|
2849
|
-
};
|
|
2850
|
-
function BlockchainSelector(props) {
|
|
2851
|
-
var type = props.type,
|
|
2852
|
-
list = props.list,
|
|
2853
|
-
onChange = props.onChange,
|
|
2854
|
-
selected = props.selected,
|
|
2855
|
-
onBack = props.onBack,
|
|
2856
|
-
loadingStatus = props.loadingStatus,
|
|
2857
|
-
hasHeader = props.hasHeader,
|
|
2858
|
-
listContainerStyle = props.listContainerStyle,
|
|
2859
|
-
multiSelect = props.multiSelect,
|
|
2860
|
-
selectedList = props.selectedList;
|
|
2861
|
-
return React__default.createElement(SecondaryPage, {
|
|
2862
|
-
textField: true,
|
|
2863
|
-
hasHeader: hasHeader,
|
|
2864
|
-
textFieldPlaceholder: "Search Blockchain By Name",
|
|
2865
|
-
title: "Select " + type + " Network",
|
|
2866
|
-
onBack: onBack
|
|
2867
|
-
}, function (searchedFor) {
|
|
2868
|
-
var filteredBlockchains = filterBlockchains(list, searchedFor);
|
|
2869
|
-
return React__default.createElement(ListContainer$1, {
|
|
2870
|
-
style: listContainerStyle,
|
|
2871
|
-
key: "1"
|
|
2872
|
-
}, loadingStatus === 'loading' && React__default.createElement("div", null, React__default.createElement(Spinner, {
|
|
2873
|
-
size: 24
|
|
2874
|
-
})), loadingStatus === 'failed' && React__default.createElement(Alert, {
|
|
2875
|
-
type: "error"
|
|
2876
|
-
}, React__default.createElement(Typography, {
|
|
2877
|
-
variant: "body2"
|
|
2878
|
-
}, "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, {
|
|
2879
|
-
list: filteredBlockchains,
|
|
2880
|
-
selected: selected,
|
|
2881
|
-
multiSelect: multiSelect,
|
|
2882
|
-
selectedList: selectedList,
|
|
2883
|
-
onChange: onChange
|
|
2884
|
-
}) : React__default.createElement(Alert, null, searchedFor + " not found")));
|
|
2945
|
+
function LoadingFailedAlert() {
|
|
2946
|
+
return React__default.createElement(Alert, {
|
|
2947
|
+
type: "error",
|
|
2948
|
+
title: " Error connecting server, please reload the app and try again."
|
|
2885
2949
|
});
|
|
2886
2950
|
}
|
|
2887
2951
|
|
|
2888
|
-
|
|
2889
|
-
var
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
width: 20,
|
|
2896
|
-
padding: 0,
|
|
2897
|
-
height: 20,
|
|
2898
|
-
border: '1px solid $foreground',
|
|
2899
|
-
display: 'flex',
|
|
2900
|
-
alignItems: 'center',
|
|
2901
|
-
justifyContent: 'center',
|
|
2902
|
-
marginRight: '$2',
|
|
2903
|
-
backgroundColor: '$neutral-100'
|
|
2904
|
-
});
|
|
2905
|
-
var Label$1 = /*#__PURE__*/styled('label', {
|
|
2906
|
-
color: '$foreground',
|
|
2907
|
-
fontSize: '$m',
|
|
2908
|
-
marginLeft: '$8'
|
|
2909
|
-
});
|
|
2910
|
-
function Checkbox(_ref) {
|
|
2911
|
-
var label = _ref.label,
|
|
2912
|
-
id = _ref.id,
|
|
2913
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$F);
|
|
2914
|
-
return React__default.createElement(CheckboxContainer, null, React__default.createElement(CheckboxRoot, Object.assign({
|
|
2915
|
-
id: id
|
|
2916
|
-
}, props), React__default.createElement(Indicator, null, React__default.createElement(CheckIcon, {
|
|
2917
|
-
size: 20
|
|
2918
|
-
}))), React__default.createElement(Label$1, {
|
|
2919
|
-
className: "_text",
|
|
2920
|
-
htmlFor: id
|
|
2921
|
-
}, label));
|
|
2952
|
+
function NotFoundAlert(props) {
|
|
2953
|
+
var catergory = props.catergory,
|
|
2954
|
+
searchedFor = props.searchedFor;
|
|
2955
|
+
return React__default.createElement(Alert, {
|
|
2956
|
+
type: "secondary",
|
|
2957
|
+
title: catergory + " " + (searchedFor ? "'" + searchedFor + "'" : '') + " not found."
|
|
2958
|
+
});
|
|
2922
2959
|
}
|
|
2923
2960
|
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
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
|
-
|
|
2961
|
+
function VirtualizedList(props) {
|
|
2962
|
+
var itemCount = props.itemCount,
|
|
2963
|
+
hasNextPage = props.hasNextPage,
|
|
2964
|
+
loadNextPage = props.loadNextPage,
|
|
2965
|
+
Item = props.Item,
|
|
2966
|
+
innerElementType = props.innerElementType,
|
|
2967
|
+
size = props.size;
|
|
2968
|
+
var isItemLoaded = function isItemLoaded(index) {
|
|
2969
|
+
return !hasNextPage || index < itemCount;
|
|
2970
|
+
};
|
|
2971
|
+
return React__default.createElement(AutoSizer, null, function (_ref) {
|
|
2972
|
+
var width = _ref.width,
|
|
2973
|
+
height = _ref.height;
|
|
2974
|
+
return React__default.createElement(InfiniteLoader, {
|
|
2975
|
+
isItemLoaded: isItemLoaded,
|
|
2976
|
+
itemCount: hasNextPage ? itemCount + 1 : itemCount,
|
|
2977
|
+
loadMoreItems: loadNextPage,
|
|
2978
|
+
threshold: 1
|
|
2979
|
+
}, function (_ref2) {
|
|
2980
|
+
var onItemsRendered = _ref2.onItemsRendered,
|
|
2981
|
+
ref = _ref2.ref;
|
|
2982
|
+
return React__default.createElement(VariableSizeList, {
|
|
2983
|
+
innerElementType: innerElementType,
|
|
2984
|
+
ref: ref,
|
|
2985
|
+
itemSize: function itemSize() {
|
|
2986
|
+
return size;
|
|
2987
|
+
},
|
|
2988
|
+
itemCount: itemCount,
|
|
2989
|
+
height: height || 0,
|
|
2990
|
+
width: width || 0,
|
|
2991
|
+
onItemsRendered: onItemsRendered
|
|
2992
|
+
}, function (_ref3) {
|
|
2993
|
+
var index = _ref3.index,
|
|
2994
|
+
style = _ref3.style;
|
|
2995
|
+
return isItemLoaded(index) ? React__default.createElement(Item, {
|
|
2996
|
+
index: index,
|
|
2997
|
+
style: style
|
|
2998
|
+
}) : null;
|
|
2999
|
+
});
|
|
3000
|
+
});
|
|
3001
|
+
});
|
|
2963
3002
|
}
|
|
2964
3003
|
|
|
2965
|
-
var
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
alignItems: 'center',
|
|
2970
|
-
top: '0',
|
|
2971
|
-
left: '0',
|
|
2972
|
-
width: '100vw',
|
|
2973
|
-
height: '100vh',
|
|
2974
|
-
backgroundColor: 'rgba(0,0,0,.1)'
|
|
2975
|
-
});
|
|
2976
|
-
var ModalContainer = /*#__PURE__*/styled('div', {
|
|
2977
|
-
backgroundColor: '$background',
|
|
2978
|
-
borderRadius: '$10',
|
|
2979
|
-
padding: '$16 $16',
|
|
2980
|
-
display: 'flex',
|
|
2981
|
-
flexDirection: 'column',
|
|
2982
|
-
boxShadow: '$s',
|
|
2983
|
-
zIndex: 10
|
|
3004
|
+
var TokenImage = /*#__PURE__*/styled('img', {
|
|
3005
|
+
width: '$32',
|
|
3006
|
+
maxHeight: '$32',
|
|
3007
|
+
marginRight: '$16'
|
|
2984
3008
|
});
|
|
2985
|
-
var
|
|
3009
|
+
var TokenNameContainer = /*#__PURE__*/styled('div', {
|
|
2986
3010
|
display: 'flex',
|
|
2987
|
-
|
|
3011
|
+
flexDirection: 'column'
|
|
2988
3012
|
});
|
|
2989
|
-
var
|
|
3013
|
+
var TokenAmountContainer = /*#__PURE__*/styled('div', {
|
|
2990
3014
|
display: 'flex',
|
|
2991
|
-
|
|
2992
|
-
alignItems: '
|
|
2993
|
-
position: 'relative',
|
|
2994
|
-
marginBottom: '$16'
|
|
3015
|
+
flexDirection: 'column',
|
|
3016
|
+
alignItems: 'flex-end'
|
|
2995
3017
|
});
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
var
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3018
|
+
function TokenItem(props) {
|
|
3019
|
+
var _token$balance;
|
|
3020
|
+
var token = props.token,
|
|
3021
|
+
style = props.style,
|
|
3022
|
+
onClick = props.onClick,
|
|
3023
|
+
selected = props.selected;
|
|
3024
|
+
return React__default.createElement("div", {
|
|
3025
|
+
style: _extends({
|
|
3026
|
+
display: 'flex',
|
|
3027
|
+
alignItems: 'center',
|
|
3028
|
+
width: '100%'
|
|
3029
|
+
}, style, {
|
|
3030
|
+
height: '48px',
|
|
3031
|
+
top: parseFloat(style == null ? void 0 : style.top) + 0 + "px",
|
|
3032
|
+
padding: '0 4px'
|
|
3033
|
+
})
|
|
3034
|
+
}, React__default.createElement(Button, {
|
|
3035
|
+
variant: "outlined",
|
|
3036
|
+
size: "large",
|
|
3037
|
+
align: "start",
|
|
3038
|
+
onClick: onClick.bind(null, token),
|
|
3039
|
+
type: selected ? 'primary' : undefined,
|
|
3040
|
+
prefix: React__default.createElement(TokenImage, {
|
|
3041
|
+
src: token.image
|
|
3042
|
+
}),
|
|
3043
|
+
suffix: ((_token$balance = token.balance) == null ? void 0 : _token$balance.amount) && React__default.createElement(TokenAmountContainer, null, React__default.createElement(Typography, {
|
|
3044
|
+
variant: "body2"
|
|
3045
|
+
}, token.balance.amount), React__default.createElement(Typography, {
|
|
3046
|
+
variant: "caption"
|
|
3047
|
+
}, token.balance.usdValue + "$"))
|
|
3048
|
+
}, React__default.createElement(TokenNameContainer, null, React__default.createElement(Typography, {
|
|
3049
|
+
variant: "body1"
|
|
3050
|
+
}, token.symbol), React__default.createElement(Typography, {
|
|
3051
|
+
variant: "caption",
|
|
3052
|
+
color: "neutrals600"
|
|
3053
|
+
}, token.name))));
|
|
3054
|
+
}
|
|
3055
|
+
|
|
3056
|
+
var _excluded$G = ["style"];
|
|
3057
|
+
var PAGE_SIZE = 20;
|
|
3058
|
+
function TokenList(props) {
|
|
3059
|
+
var list = props.list,
|
|
3060
|
+
searchedText = props.searchedText,
|
|
3061
|
+
onChange = props.onChange,
|
|
3062
|
+
multiSelect = props.multiSelect,
|
|
3063
|
+
selectedList = props.selectedList;
|
|
3064
|
+
var _useState = useState(props.selected),
|
|
3065
|
+
selected = _useState[0],
|
|
3066
|
+
setSelected = _useState[1];
|
|
3067
|
+
var changeSelected = function changeSelected(token) {
|
|
3068
|
+
setSelected(token);
|
|
3069
|
+
onChange(token);
|
|
3070
|
+
};
|
|
3071
|
+
var isSelected = function isSelected(token) {
|
|
3072
|
+
if (multiSelect && selectedList) {
|
|
3073
|
+
return selectedList === 'all' || selectedList.map(function (item) {
|
|
3074
|
+
return item.symbol + item.address;
|
|
3075
|
+
}).indexOf(token.symbol + token.address) > -1;
|
|
3076
|
+
}
|
|
3077
|
+
return (selected == null ? void 0 : selected.symbol) === token.symbol && (selected == null ? void 0 : selected.address) === token.address;
|
|
3078
|
+
};
|
|
3079
|
+
var _useState2 = useState(true),
|
|
3080
|
+
hasNextPage = _useState2[0],
|
|
3081
|
+
setHasNextPage = _useState2[1];
|
|
3082
|
+
var _useState3 = useState(list),
|
|
3083
|
+
tokens = _useState3[0],
|
|
3084
|
+
setTokens = _useState3[1];
|
|
3085
|
+
var loadNextPage = function loadNextPage() {
|
|
3086
|
+
setTokens(list.slice(0, tokens.length + PAGE_SIZE));
|
|
3007
3087
|
};
|
|
3008
3088
|
useEffect(function () {
|
|
3009
|
-
|
|
3010
|
-
}, [
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
},
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3089
|
+
setTokens(list.slice(0, PAGE_SIZE));
|
|
3090
|
+
}, [searchedText, list]);
|
|
3091
|
+
useEffect(function () {
|
|
3092
|
+
setHasNextPage(list.length > tokens.length);
|
|
3093
|
+
}, [tokens.length]);
|
|
3094
|
+
var innerElementType = forwardRef(function (_ref, ref) {
|
|
3095
|
+
var style = _ref.style,
|
|
3096
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$G);
|
|
3097
|
+
return React__default.createElement("div", Object.assign({
|
|
3098
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3099
|
+
ref: ref,
|
|
3100
|
+
style: _extends({}, style, {
|
|
3101
|
+
height: parseFloat(style == null ? void 0 : style.height) + 8 * 2 + "px"
|
|
3102
|
+
})
|
|
3103
|
+
}, rest));
|
|
3104
|
+
});
|
|
3105
|
+
return React__default.createElement(VirtualizedList, {
|
|
3106
|
+
Item: function Item(_ref2) {
|
|
3107
|
+
var index = _ref2.index,
|
|
3108
|
+
style = _ref2.style;
|
|
3109
|
+
return React__default.createElement(TokenItem, {
|
|
3110
|
+
token: tokens[index],
|
|
3111
|
+
style: style,
|
|
3112
|
+
onClick: changeSelected,
|
|
3113
|
+
selected: isSelected(tokens[index])
|
|
3114
|
+
});
|
|
3115
|
+
},
|
|
3116
|
+
hasNextPage: hasNextPage,
|
|
3117
|
+
itemCount: tokens.length,
|
|
3118
|
+
loadNextPage: loadNextPage,
|
|
3119
|
+
innerElementType: innerElementType,
|
|
3120
|
+
size: 56
|
|
3121
|
+
});
|
|
3023
3122
|
}
|
|
3024
3123
|
|
|
3025
|
-
var
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
WalletState["CONNECTING"] = "connecting";
|
|
3030
|
-
WalletState["CONNECTED"] = "connected";
|
|
3031
|
-
})(WalletState || (WalletState = {}));
|
|
3032
|
-
|
|
3033
|
-
var StateIconContainer = /*#__PURE__*/styled('span', {
|
|
3124
|
+
var Container$1 = /*#__PURE__*/styled('div', {
|
|
3125
|
+
flex: '1'
|
|
3126
|
+
});
|
|
3127
|
+
var LoaderContainer = /*#__PURE__*/styled('div', {
|
|
3034
3128
|
display: 'flex',
|
|
3035
3129
|
justifyContent: 'center',
|
|
3036
|
-
|
|
3130
|
+
width: '100%',
|
|
3131
|
+
position: 'absolute',
|
|
3132
|
+
top: '50%'
|
|
3037
3133
|
});
|
|
3038
|
-
var
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
href: detectInstallLink(installLink),
|
|
3043
|
-
target: "_blank"
|
|
3044
|
-
}, React__default.createElement(DownloadIcon, {
|
|
3045
|
-
size: 24,
|
|
3046
|
-
color: "success"
|
|
3047
|
-
})), walletState === WalletState.CONNECTING && React__default.createElement(Spinner, null), walletState === WalletState.CONNECTED && React__default.createElement(DisconnectIcon, null)));
|
|
3134
|
+
var filterTokens = function filterTokens(list, searchedFor) {
|
|
3135
|
+
return list.filter(function (token) {
|
|
3136
|
+
return containsText(token.symbol, searchedFor) || containsText(token.address || '', searchedFor) || containsText(token.name || '', searchedFor);
|
|
3137
|
+
});
|
|
3048
3138
|
};
|
|
3049
|
-
|
|
3050
|
-
var
|
|
3139
|
+
function TokenSelector(props) {
|
|
3140
|
+
var list = props.list,
|
|
3141
|
+
type = props.type,
|
|
3142
|
+
selected = props.selected,
|
|
3143
|
+
onChange = props.onChange,
|
|
3144
|
+
hasHeader = props.hasHeader,
|
|
3145
|
+
multiSelect = props.multiSelect,
|
|
3146
|
+
selectedList = props.selectedList,
|
|
3147
|
+
onBack = props.onBack,
|
|
3148
|
+
loadingStatus = props.loadingStatus;
|
|
3149
|
+
return React__default.createElement(SecondaryPage, {
|
|
3150
|
+
textField: true,
|
|
3151
|
+
textFieldPlaceholder: "Search Blockchain By Name",
|
|
3152
|
+
title: "Select " + type + " Token",
|
|
3153
|
+
hasHeader: hasHeader,
|
|
3154
|
+
onBack: onBack
|
|
3155
|
+
}, function (searchedFor) {
|
|
3156
|
+
var filteredTokens = filterTokens(list, searchedFor);
|
|
3157
|
+
return React__default.createElement(Container$1, null, loadingStatus === 'loading' && React__default.createElement(LoaderContainer, null, React__default.createElement(Spinner, {
|
|
3158
|
+
size: 24
|
|
3159
|
+
})), loadingStatus === 'failed' && React__default.createElement(LoadingFailedAlert, null), loadingStatus === 'success' && React__default.createElement(React__default.Fragment, null, filteredTokens.length ? React__default.createElement(TokenList, {
|
|
3160
|
+
searchedText: searchedFor,
|
|
3161
|
+
list: filteredTokens,
|
|
3162
|
+
selected: selected,
|
|
3163
|
+
selectedList: selectedList,
|
|
3164
|
+
multiSelect: multiSelect,
|
|
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(Root$1, {
|
|
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(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
|
+
var ContentContainer$1 = /*#__PURE__*/styled('div', {});
|
|
3327
|
+
function Modal(props) {
|
|
3328
|
+
var title = props.title,
|
|
3329
|
+
content = props.content,
|
|
3330
|
+
open = props.open,
|
|
3331
|
+
onClose = props.onClose,
|
|
3332
|
+
containerStyle = props.containerStyle,
|
|
3333
|
+
action = props.action,
|
|
3334
|
+
contentStyle = props.contentStyle;
|
|
3335
|
+
var handleBackDropClick = function handleBackDropClick(event) {
|
|
3336
|
+
if (event.target === event.currentTarget) onClose();
|
|
3337
|
+
};
|
|
3338
|
+
useEffect(function () {
|
|
3339
|
+
if (open) document.body.style.overflow = 'hidden';else document.body.style.overflow = 'unset';
|
|
3340
|
+
}, [open]);
|
|
3341
|
+
return React__default.createElement(React__default.Fragment, null, open && createPortal(React__default.createElement(BackDrop, {
|
|
3342
|
+
onClick: handleBackDropClick
|
|
3343
|
+
}, React__default.createElement(ModalContainer, {
|
|
3344
|
+
style: containerStyle
|
|
3345
|
+
}, React__default.createElement(ModalHeader, null, React__default.createElement(Typography, {
|
|
3346
|
+
variant: "h4"
|
|
3347
|
+
}, title), React__default.createElement(Row, null, action, React__default.createElement(CloseIcon, {
|
|
3348
|
+
size: 24,
|
|
3349
|
+
onClick: onClose
|
|
3350
|
+
}))), React__default.createElement(ContentContainer$1, {
|
|
3351
|
+
style: contentStyle
|
|
3352
|
+
}, content))), document.body));
|
|
3353
|
+
}
|
|
3354
|
+
|
|
3355
|
+
var WalletState;
|
|
3356
|
+
(function (WalletState) {
|
|
3357
|
+
WalletState["NOT_INSTALLED"] = "not installed";
|
|
3358
|
+
WalletState["DISCONNECTED"] = "disconnected";
|
|
3359
|
+
WalletState["CONNECTING"] = "connecting";
|
|
3360
|
+
WalletState["CONNECTED"] = "connected";
|
|
3361
|
+
})(WalletState || (WalletState = {}));
|
|
3362
|
+
|
|
3363
|
+
var StateIconContainer = /*#__PURE__*/styled('span', {
|
|
3364
|
+
display: 'flex',
|
|
3365
|
+
justifyContent: 'center',
|
|
3366
|
+
alignItems: 'center'
|
|
3367
|
+
});
|
|
3368
|
+
var State = function State(_ref) {
|
|
3369
|
+
var walletState = _ref.walletState,
|
|
3370
|
+
installLink = _ref.installLink;
|
|
3371
|
+
return React__default.createElement(Fragment, null, walletState !== WalletState.DISCONNECTED && React__default.createElement(StateIconContainer, null, walletState === WalletState.NOT_INSTALLED && React__default.createElement("a", {
|
|
3372
|
+
href: detectInstallLink(installLink),
|
|
3373
|
+
target: "_blank"
|
|
3374
|
+
}, React__default.createElement(DownloadIcon, {
|
|
3375
|
+
size: 24,
|
|
3376
|
+
color: "success"
|
|
3377
|
+
})), walletState === WalletState.CONNECTING && React__default.createElement(Spinner, null), walletState === WalletState.CONNECTED && React__default.createElement(DisconnectIcon, null)));
|
|
3378
|
+
};
|
|
3379
|
+
|
|
3380
|
+
var WalletImage = /*#__PURE__*/styled('img', {
|
|
3051
3381
|
width: '$24',
|
|
3052
3382
|
height: '$24',
|
|
3053
3383
|
marginRight: '$12'
|
|
@@ -3078,7 +3408,7 @@ function Wallet(props) {
|
|
|
3078
3408
|
installLink = props.installLink;
|
|
3079
3409
|
return React__default.createElement(ExtendedButton, {
|
|
3080
3410
|
type: state === WalletState.CONNECTED ? 'primary' : undefined,
|
|
3081
|
-
disabled:
|
|
3411
|
+
disabled: state == WalletState.CONNECTING,
|
|
3082
3412
|
onClick: function onClick() {
|
|
3083
3413
|
if (state === WalletState.NOT_INSTALLED) {
|
|
3084
3414
|
window.open(detectInstallLink(installLink), '_blank');
|
|
@@ -3185,14 +3515,21 @@ var groupLiquiditySources = function groupLiquiditySources(liquiditySources) {
|
|
|
3185
3515
|
})
|
|
3186
3516
|
};
|
|
3187
3517
|
};
|
|
3518
|
+
var MainContainer$1 = /*#__PURE__*/styled('div', {
|
|
3519
|
+
variants: {
|
|
3520
|
+
loaded: {
|
|
3521
|
+
"true": {
|
|
3522
|
+
overflowY: 'auto'
|
|
3523
|
+
}
|
|
3524
|
+
}
|
|
3525
|
+
}
|
|
3526
|
+
});
|
|
3188
3527
|
var LiquiditySourceType = /*#__PURE__*/styled('div', {
|
|
3189
3528
|
position: 'sticky',
|
|
3190
3529
|
display: 'flex',
|
|
3191
3530
|
justifyContent: 'space-between',
|
|
3192
3531
|
alignItems: 'center',
|
|
3193
3532
|
top: '0',
|
|
3194
|
-
marginTop: '$8',
|
|
3195
|
-
marginBottom: '$8',
|
|
3196
3533
|
backgroundColor: '$background',
|
|
3197
3534
|
zIndex: '9999',
|
|
3198
3535
|
paddingTop: '$8',
|
|
@@ -3203,10 +3540,16 @@ var LiquidityImage = /*#__PURE__*/styled('img', {
|
|
|
3203
3540
|
maxHeight: '$20',
|
|
3204
3541
|
marginRight: '$16'
|
|
3205
3542
|
});
|
|
3543
|
+
var LoaderContainer$1 = /*#__PURE__*/styled('div', {
|
|
3544
|
+
display: 'flex',
|
|
3545
|
+
justifyContent: 'center'
|
|
3546
|
+
});
|
|
3206
3547
|
function LiquiditySourceList(props) {
|
|
3207
3548
|
var list = props.list,
|
|
3208
3549
|
onChange = props.onChange,
|
|
3209
|
-
listContainerStyle = props.listContainerStyle
|
|
3550
|
+
listContainerStyle = props.listContainerStyle,
|
|
3551
|
+
loadingStatus = props.loadingStatus,
|
|
3552
|
+
searchedFor = props.searchedFor;
|
|
3210
3553
|
var _useState = useState(list.filter(function (item) {
|
|
3211
3554
|
return item.selected;
|
|
3212
3555
|
})),
|
|
@@ -3240,10 +3583,9 @@ function LiquiditySourceList(props) {
|
|
|
3240
3583
|
// TODO: This is not performant
|
|
3241
3584
|
var totalSelectedBridges = bridges.filter(isSelected).length;
|
|
3242
3585
|
var totalSelectedExchanges = exchanges.filter(isSelected).length;
|
|
3243
|
-
return React__default.createElement(
|
|
3244
|
-
style:
|
|
3245
|
-
|
|
3246
|
-
}, listContainerStyle)
|
|
3586
|
+
return React__default.createElement(MainContainer$1, {
|
|
3587
|
+
style: listContainerStyle,
|
|
3588
|
+
loaded: loadingStatus === 'success'
|
|
3247
3589
|
}, React__default.createElement("div", null, React__default.createElement(LiquiditySourceType, null, React__default.createElement(Typography, {
|
|
3248
3590
|
variant: "h5"
|
|
3249
3591
|
}, "Bridges"), React__default.createElement(Typography, {
|
|
@@ -3252,14 +3594,19 @@ function LiquiditySourceList(props) {
|
|
|
3252
3594
|
}, totalSelectedBridges === totalBridges ? totalBridges : totalSelectedBridges + " / " + totalBridges)), React__default.createElement(Spacer, {
|
|
3253
3595
|
size: 12,
|
|
3254
3596
|
direction: "vertical"
|
|
3255
|
-
}),
|
|
3597
|
+
}), loadingStatus === 'loading' && React__default.createElement(LoaderContainer$1, null, React__default.createElement(Spinner, {
|
|
3598
|
+
size: 24
|
|
3599
|
+
})), loadingStatus === 'failed' && React__default.createElement(LoadingFailedAlert, null), loadingStatus === 'success' && React__default.createElement(React__default.Fragment, null, totalBridges ? bridges.map(function (liquiditySource, index) {
|
|
3256
3600
|
return React__default.createElement(LiquiditySourceItem, {
|
|
3257
3601
|
liquiditySource: liquiditySource,
|
|
3258
3602
|
key: index,
|
|
3259
3603
|
selected: isSelected(liquiditySource),
|
|
3260
3604
|
onChange: changeLiquiditySources
|
|
3261
3605
|
});
|
|
3262
|
-
})
|
|
3606
|
+
}) : React__default.createElement(NotFoundAlert, {
|
|
3607
|
+
catergory: "Bridge",
|
|
3608
|
+
searchedFor: searchedFor
|
|
3609
|
+
}))), React__default.createElement("div", null, React__default.createElement(LiquiditySourceType, null, React__default.createElement(Typography, {
|
|
3263
3610
|
variant: "h5"
|
|
3264
3611
|
}, "Exchanges"), React__default.createElement(Typography, {
|
|
3265
3612
|
variant: "body1",
|
|
@@ -3267,14 +3614,19 @@ function LiquiditySourceList(props) {
|
|
|
3267
3614
|
}, totalSelectedExchanges === totalExchanges ? totalExchanges : totalSelectedExchanges + " / " + totalExchanges)), React__default.createElement(Spacer, {
|
|
3268
3615
|
size: 12,
|
|
3269
3616
|
direction: "vertical"
|
|
3270
|
-
}),
|
|
3617
|
+
}), loadingStatus === 'loading' && React__default.createElement(LoaderContainer$1, null, React__default.createElement(Spinner, {
|
|
3618
|
+
size: 24
|
|
3619
|
+
})), loadingStatus === 'failed' && React__default.createElement(LoadingFailedAlert, null), loadingStatus == 'success' && React__default.createElement(React__default.Fragment, null, totalExchanges ? exchanges.map(function (liquiditySource, index) {
|
|
3271
3620
|
return React__default.createElement(LiquiditySourceItem, {
|
|
3272
3621
|
liquiditySource: liquiditySource,
|
|
3273
3622
|
key: index,
|
|
3274
3623
|
selected: isSelected(liquiditySource),
|
|
3275
3624
|
onChange: changeLiquiditySources
|
|
3276
3625
|
});
|
|
3277
|
-
})
|
|
3626
|
+
}) : React__default.createElement(NotFoundAlert, {
|
|
3627
|
+
catergory: "Exchange",
|
|
3628
|
+
searchedFor: searchedFor
|
|
3629
|
+
}))));
|
|
3278
3630
|
}
|
|
3279
3631
|
var LiquiditySourceItem = function LiquiditySourceItem(_ref) {
|
|
3280
3632
|
var liquiditySource = _ref.liquiditySource,
|
|
@@ -3304,22 +3656,19 @@ var filterLiquiditySources = function filterLiquiditySources(liquiditySources, s
|
|
|
3304
3656
|
return containsText(liquiditySource.title, searchedFor || '');
|
|
3305
3657
|
});
|
|
3306
3658
|
};
|
|
3307
|
-
var ActionButton = /*#__PURE__*/styled(Button, {
|
|
3308
|
-
position: 'absolute',
|
|
3309
|
-
right: 0
|
|
3310
|
-
});
|
|
3311
3659
|
function LiquiditySourcesSelector(props) {
|
|
3312
3660
|
var list = props.list,
|
|
3313
3661
|
onChange = props.onChange,
|
|
3314
3662
|
onBack = props.onBack,
|
|
3315
3663
|
hasHeader = props.hasHeader,
|
|
3316
3664
|
listContainerStyle = props.listContainerStyle,
|
|
3317
|
-
toggleAll = props.toggleAll
|
|
3665
|
+
toggleAll = props.toggleAll,
|
|
3666
|
+
loadingStatus = props.loadingStatus;
|
|
3318
3667
|
return React__default.createElement(SecondaryPage, {
|
|
3319
3668
|
textField: true,
|
|
3320
3669
|
textFieldPlaceholder: "Search By Name",
|
|
3321
3670
|
title: "Liquidity Sources",
|
|
3322
|
-
TopButton: React__default.createElement(
|
|
3671
|
+
TopButton: React__default.createElement(Button, {
|
|
3323
3672
|
variant: "ghost",
|
|
3324
3673
|
type: "primary",
|
|
3325
3674
|
onClick: toggleAll
|
|
@@ -3332,7 +3681,9 @@ function LiquiditySourcesSelector(props) {
|
|
|
3332
3681
|
return React__default.createElement(LiquiditySourceList, {
|
|
3333
3682
|
listContainerStyle: listContainerStyle,
|
|
3334
3683
|
list: filterLiquiditySources(list, searchedFor),
|
|
3335
|
-
onChange: onChange
|
|
3684
|
+
onChange: onChange,
|
|
3685
|
+
loadingStatus: loadingStatus,
|
|
3686
|
+
searchedFor: searchedFor
|
|
3336
3687
|
});
|
|
3337
3688
|
});
|
|
3338
3689
|
}
|
|
@@ -3434,7 +3785,9 @@ function SelectableWalletList(_ref) {
|
|
|
3434
3785
|
height: 24
|
|
3435
3786
|
}), React__default.createElement(Typography, {
|
|
3436
3787
|
variant: "body2"
|
|
3437
|
-
}, w.name), React__default.createElement(
|
|
3788
|
+
}, w.name), React__default.createElement(Typography, {
|
|
3789
|
+
variant: "caption"
|
|
3790
|
+
}, getConciseAddress(w.address)), React__default.createElement(Circle, {
|
|
3438
3791
|
checked: checked
|
|
3439
3792
|
}, React__default.createElement(SolidCircle, {
|
|
3440
3793
|
checked: checked
|
|
@@ -3579,7 +3932,8 @@ function Settings(props) {
|
|
|
3579
3932
|
selectedTheme = props.selectedTheme,
|
|
3580
3933
|
onThemeChange = props.onThemeChange,
|
|
3581
3934
|
toggleInfiniteApprove = props.toggleInfiniteApprove,
|
|
3582
|
-
infiniteApprove = props.infiniteApprove
|
|
3935
|
+
infiniteApprove = props.infiniteApprove,
|
|
3936
|
+
loadingStatus = props.loadingStatus;
|
|
3583
3937
|
var _useState = useState(props.selectedSlippage),
|
|
3584
3938
|
selectedSlippage = _useState[0],
|
|
3585
3939
|
setSelectedSlippage = _useState[1];
|
|
@@ -3647,14 +4001,21 @@ function Settings(props) {
|
|
|
3647
4001
|
}, "Infinite Approval"), React__default.createElement(Switch, {
|
|
3648
4002
|
checked: infiniteApprove,
|
|
3649
4003
|
onChange: toggleInfiniteApprove
|
|
3650
|
-
})), React__default.createElement(LiquiditySourceContainer, {
|
|
3651
|
-
onClick: onLiquiditySourcesClick
|
|
4004
|
+
})), React__default.createElement(LiquiditySourceContainer, null, React__default.createElement(Button, {
|
|
4005
|
+
onClick: onLiquiditySourcesClick,
|
|
4006
|
+
align: "start",
|
|
4007
|
+
variant: "ghost",
|
|
4008
|
+
loading: loadingStatus === 'loading',
|
|
4009
|
+
suffix: React__default.createElement(LiquiditySourceNumber, null, loadingStatus === 'success' && React__default.createElement(Typography, {
|
|
4010
|
+
variant: "body2",
|
|
4011
|
+
color: "neutrals800"
|
|
4012
|
+
}, liquiditySources.length !== selectedLiquiditySources.length ? selectedLiquiditySources.length + " / " + liquiditySources.length : liquiditySources.length), loadingStatus === 'failed' && React__default.createElement(Typography, {
|
|
4013
|
+
variant: "body2",
|
|
4014
|
+
color: "$error500"
|
|
4015
|
+
}, "Loading failed"), React__default.createElement(StyledAngleRight, null))
|
|
3652
4016
|
}, React__default.createElement(Typography, {
|
|
3653
4017
|
variant: "body1"
|
|
3654
|
-
}, "Liquidity Sources")
|
|
3655
|
-
variant: "body2",
|
|
3656
|
-
color: "neutrals800"
|
|
3657
|
-
}, liquiditySources.length !== selectedLiquiditySources.length ? selectedLiquiditySources.length + " / " + liquiditySources.length : liquiditySources.length), React__default.createElement(StyledAngleRight, null))));
|
|
4018
|
+
}, "Liquidity Sources"))));
|
|
3658
4019
|
return React__default.createElement(SecondaryPage, {
|
|
3659
4020
|
title: "Settings",
|
|
3660
4021
|
textField: false,
|
|
@@ -3662,340 +4023,169 @@ function Settings(props) {
|
|
|
3662
4023
|
}, PageContent);
|
|
3663
4024
|
}
|
|
3664
4025
|
|
|
3665
|
-
var MainContainer$
|
|
4026
|
+
var MainContainer$2 = /*#__PURE__*/styled('div', {
|
|
4027
|
+
position: 'relative',
|
|
4028
|
+
display: 'flex',
|
|
4029
|
+
flexDirection: 'column',
|
|
3666
4030
|
borderRadius: '$10',
|
|
3667
|
-
maxWidth: '512px',
|
|
3668
4031
|
boxShadow: '$s',
|
|
3669
|
-
minWidth: '375px',
|
|
3670
4032
|
width: '100%',
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
flexDirection: 'column',
|
|
3675
|
-
alignItems: 'end',
|
|
4033
|
+
minWidth: '375px',
|
|
4034
|
+
maxWidth: '512px',
|
|
4035
|
+
maxHeight: '595px',
|
|
3676
4036
|
padding: '$16',
|
|
3677
4037
|
boxSizing: 'border-box',
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
4038
|
+
backgroundColor: '$background',
|
|
4039
|
+
variants: {
|
|
4040
|
+
fixedHeight: {
|
|
4041
|
+
"true": {
|
|
4042
|
+
height: '595px'
|
|
4043
|
+
},
|
|
4044
|
+
"false": {
|
|
4045
|
+
height: 'auto'
|
|
4046
|
+
}
|
|
4047
|
+
}
|
|
4048
|
+
}
|
|
3682
4049
|
});
|
|
3683
4050
|
function SwapContainer(props) {
|
|
3684
4051
|
var children = props.children,
|
|
3685
|
-
style = props.style
|
|
3686
|
-
|
|
4052
|
+
style = props.style,
|
|
4053
|
+
_props$fixedHeight = props.fixedHeight,
|
|
4054
|
+
fixedHeight = _props$fixedHeight === void 0 ? true : _props$fixedHeight;
|
|
4055
|
+
return React__default.createElement(MainContainer$2, {
|
|
3687
4056
|
style: style,
|
|
3688
|
-
id: "swap-box"
|
|
3689
|
-
|
|
4057
|
+
id: "swap-box",
|
|
4058
|
+
fixedHeight: fixedHeight
|
|
4059
|
+
}, children);
|
|
3690
4060
|
}
|
|
3691
4061
|
|
|
3692
|
-
var
|
|
3693
|
-
position: 'relative'
|
|
3694
|
-
});
|
|
3695
|
-
var ButtonContainer$1 = /*#__PURE__*/styled('div', {
|
|
3696
|
-
paddingTop: '$8'
|
|
3697
|
-
});
|
|
3698
|
-
var SwapContainer$1 = /*#__PURE__*/styled('div', {
|
|
4062
|
+
var TokenContainer = /*#__PURE__*/styled('div', {
|
|
3699
4063
|
display: 'flex',
|
|
3700
|
-
|
|
3701
|
-
'
|
|
3702
|
-
|
|
3703
|
-
},
|
|
3704
|
-
'&:hover': {
|
|
3705
|
-
borderColor: '$primary'
|
|
3706
|
-
},
|
|
3707
|
-
variants: {
|
|
3708
|
-
status: {
|
|
3709
|
-
failed: {
|
|
3710
|
-
borderColor: '$error'
|
|
3711
|
-
},
|
|
3712
|
-
running: {
|
|
3713
|
-
borderColor: '$neutrals400'
|
|
3714
|
-
},
|
|
3715
|
-
success: {
|
|
3716
|
-
borderColor: '$success'
|
|
3717
|
-
}
|
|
3718
|
-
}
|
|
4064
|
+
alignItems: 'center',
|
|
4065
|
+
'& .amount': {
|
|
4066
|
+
fontWeight: 'bold'
|
|
3719
4067
|
}
|
|
3720
4068
|
});
|
|
3721
|
-
var
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
width: '$20',
|
|
3729
|
-
border: '1px dashed $foreground',
|
|
3730
|
-
borderRadius: 'inherit',
|
|
3731
|
-
'@md': {
|
|
3732
|
-
width: '$36'
|
|
4069
|
+
var TokenImage$1 = /*#__PURE__*/styled('div', {
|
|
4070
|
+
position: 'relative',
|
|
4071
|
+
width: '$24',
|
|
4072
|
+
height: '$24',
|
|
4073
|
+
img: {
|
|
4074
|
+
width: '100%',
|
|
4075
|
+
display: 'block'
|
|
3733
4076
|
},
|
|
3734
|
-
'
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
width: '$8',
|
|
3745
|
-
height: '$8'
|
|
4077
|
+
'.overlay': {
|
|
4078
|
+
position: 'absolute',
|
|
4079
|
+
right: -4,
|
|
4080
|
+
bottom: -4,
|
|
4081
|
+
width: '$16',
|
|
4082
|
+
height: '$16',
|
|
4083
|
+
padding: '$2',
|
|
4084
|
+
borderRadius: '50%',
|
|
4085
|
+
backgroundColor: '$background',
|
|
4086
|
+
border: '1px solid $neutrals400'
|
|
3746
4087
|
}
|
|
3747
4088
|
});
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
}
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
4089
|
+
function Token(props) {
|
|
4090
|
+
return React__default.createElement(TokenContainer, null, React__default.createElement(TokenImage$1, null, React__default.createElement("img", {
|
|
4091
|
+
src: props.data.token.logo,
|
|
4092
|
+
alt: ""
|
|
4093
|
+
}), React__default.createElement("div", {
|
|
4094
|
+
className: "overlay"
|
|
4095
|
+
}, React__default.createElement("img", {
|
|
4096
|
+
src: props.data.blockchain.logo,
|
|
4097
|
+
alt: props.data.blockchain.name
|
|
4098
|
+
}))), React__default.createElement(Spacer, {
|
|
4099
|
+
size: 8
|
|
4100
|
+
}), React__default.createElement("span", {
|
|
4101
|
+
className: "amount"
|
|
4102
|
+
}, props.data.amount), React__default.createElement(Spacer, {
|
|
4103
|
+
size: 4
|
|
4104
|
+
}), props.data.token.symbol);
|
|
4105
|
+
}
|
|
4106
|
+
|
|
4107
|
+
var Container$4 = /*#__PURE__*/styled('div', {
|
|
4108
|
+
position: 'relative',
|
|
3761
4109
|
display: 'flex',
|
|
3762
|
-
justifyContent: '
|
|
3763
|
-
'
|
|
3764
|
-
|
|
3765
|
-
|
|
4110
|
+
justifyContent: 'space-between',
|
|
4111
|
+
alignItems: 'center',
|
|
4112
|
+
padding: '$16 0',
|
|
4113
|
+
borderBottom: '1px solid $neutrals300',
|
|
4114
|
+
'& > .info': {
|
|
4115
|
+
display: 'flex',
|
|
4116
|
+
alignItems: 'center'
|
|
4117
|
+
},
|
|
4118
|
+
'.status': {
|
|
4119
|
+
textTransform: 'uppercase',
|
|
4120
|
+
fontWeight: 'bold',
|
|
4121
|
+
fontSize: '$12'
|
|
4122
|
+
},
|
|
4123
|
+
'&.running': {
|
|
4124
|
+
color: '$foreground'
|
|
4125
|
+
},
|
|
4126
|
+
'&.failed,&.success': {
|
|
4127
|
+
color: '$neutrals600'
|
|
4128
|
+
},
|
|
4129
|
+
'&.failed .status': {
|
|
4130
|
+
color: '$error'
|
|
4131
|
+
},
|
|
4132
|
+
'&.success .status': {
|
|
4133
|
+
color: '$success'
|
|
3766
4134
|
}
|
|
3767
4135
|
});
|
|
3768
4136
|
function SwapDetail(_ref) {
|
|
3769
4137
|
var swap = _ref.swap,
|
|
3770
4138
|
status = _ref.status,
|
|
3771
|
-
onClick = _ref.onClick;
|
|
3772
|
-
var firstStep = swap.steps[0];
|
|
3773
|
-
var lastStep = swap.steps[swap.steps.length - 1];
|
|
3774
|
-
return React__default.createElement(
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
}, React__default.createElement(
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
})
|
|
3799
|
-
size:
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
}
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
threshold: 1
|
|
3822
|
-
}, function (_ref2) {
|
|
3823
|
-
var onItemsRendered = _ref2.onItemsRendered,
|
|
3824
|
-
ref = _ref2.ref;
|
|
3825
|
-
return React__default.createElement(VariableSizeList, {
|
|
3826
|
-
innerElementType: innerElementType,
|
|
3827
|
-
ref: ref,
|
|
3828
|
-
itemSize: function itemSize() {
|
|
3829
|
-
return size;
|
|
3830
|
-
},
|
|
3831
|
-
itemCount: itemCount,
|
|
3832
|
-
height: height || 0,
|
|
3833
|
-
width: width || 0,
|
|
3834
|
-
onItemsRendered: onItemsRendered
|
|
3835
|
-
}, function (_ref3) {
|
|
3836
|
-
var index = _ref3.index,
|
|
3837
|
-
style = _ref3.style;
|
|
3838
|
-
return isItemLoaded(index) ? React__default.createElement(Item, {
|
|
3839
|
-
index: index,
|
|
3840
|
-
style: style
|
|
3841
|
-
}) : null;
|
|
3842
|
-
});
|
|
3843
|
-
});
|
|
3844
|
-
});
|
|
3845
|
-
}
|
|
3846
|
-
|
|
3847
|
-
var TokenImage = /*#__PURE__*/styled('img', {
|
|
3848
|
-
width: '$32',
|
|
3849
|
-
maxHeight: '$32',
|
|
3850
|
-
marginRight: '$16'
|
|
3851
|
-
});
|
|
3852
|
-
var TokenNameContainer = /*#__PURE__*/styled('div', {
|
|
3853
|
-
display: 'flex',
|
|
3854
|
-
flexDirection: 'column'
|
|
3855
|
-
});
|
|
3856
|
-
var TokenAmountContainer = /*#__PURE__*/styled('div', {
|
|
3857
|
-
display: 'flex',
|
|
3858
|
-
flexDirection: 'column',
|
|
3859
|
-
alignItems: 'flex-end'
|
|
3860
|
-
});
|
|
3861
|
-
function TokenItem(props) {
|
|
3862
|
-
var _token$balance;
|
|
3863
|
-
var token = props.token,
|
|
3864
|
-
style = props.style,
|
|
3865
|
-
onClick = props.onClick,
|
|
3866
|
-
selected = props.selected;
|
|
3867
|
-
return React__default.createElement("div", {
|
|
3868
|
-
style: _extends({
|
|
3869
|
-
display: 'flex',
|
|
3870
|
-
alignItems: 'center',
|
|
3871
|
-
width: '100%'
|
|
3872
|
-
}, style, {
|
|
3873
|
-
height: '48px',
|
|
3874
|
-
top: parseFloat(style == null ? void 0 : style.top) + 0 + "px"
|
|
3875
|
-
})
|
|
3876
|
-
}, React__default.createElement(Button, {
|
|
3877
|
-
variant: "outlined",
|
|
3878
|
-
size: "large",
|
|
3879
|
-
align: "start",
|
|
3880
|
-
onClick: onClick.bind(null, token),
|
|
3881
|
-
type: selected ? 'primary' : undefined,
|
|
3882
|
-
prefix: React__default.createElement(TokenImage, {
|
|
3883
|
-
src: token.image
|
|
3884
|
-
}),
|
|
3885
|
-
suffix: ((_token$balance = token.balance) == null ? void 0 : _token$balance.amount) && React__default.createElement(TokenAmountContainer, null, React__default.createElement(Typography, {
|
|
3886
|
-
variant: "body2"
|
|
3887
|
-
}, token.balance.amount), React__default.createElement(Typography, {
|
|
3888
|
-
variant: "caption"
|
|
3889
|
-
}, token.balance.usdValue + "$"))
|
|
3890
|
-
}, React__default.createElement(TokenNameContainer, null, React__default.createElement(Typography, {
|
|
3891
|
-
variant: "body1"
|
|
3892
|
-
}, token.symbol), React__default.createElement(Typography, {
|
|
3893
|
-
variant: "body2"
|
|
3894
|
-
}, token.name))));
|
|
3895
|
-
}
|
|
3896
|
-
|
|
3897
|
-
var _excluded$G = ["style"];
|
|
3898
|
-
var PAGE_SIZE = 20;
|
|
3899
|
-
function TokenList(props) {
|
|
3900
|
-
var list = props.list,
|
|
3901
|
-
searchedText = props.searchedText,
|
|
3902
|
-
onChange = props.onChange,
|
|
3903
|
-
multiSelect = props.multiSelect,
|
|
3904
|
-
selectedList = props.selectedList;
|
|
3905
|
-
var _useState = useState(props.selected),
|
|
3906
|
-
selected = _useState[0],
|
|
3907
|
-
setSelected = _useState[1];
|
|
3908
|
-
var changeSelected = function changeSelected(token) {
|
|
3909
|
-
setSelected(token);
|
|
3910
|
-
onChange(token);
|
|
3911
|
-
};
|
|
3912
|
-
var isSelected = function isSelected(token) {
|
|
3913
|
-
if (multiSelect && selectedList) {
|
|
3914
|
-
return selectedList === 'all' || selectedList.map(function (item) {
|
|
3915
|
-
return item.symbol + item.address;
|
|
3916
|
-
}).indexOf(token.symbol + token.address) > -1;
|
|
3917
|
-
}
|
|
3918
|
-
return (selected == null ? void 0 : selected.symbol) === token.symbol && (selected == null ? void 0 : selected.address) === token.address;
|
|
3919
|
-
};
|
|
3920
|
-
var _useState2 = useState(true),
|
|
3921
|
-
hasNextPage = _useState2[0],
|
|
3922
|
-
setHasNextPage = _useState2[1];
|
|
3923
|
-
var _useState3 = useState(list),
|
|
3924
|
-
tokens = _useState3[0],
|
|
3925
|
-
setTokens = _useState3[1];
|
|
3926
|
-
var loadNextPage = function loadNextPage() {
|
|
3927
|
-
setTokens(list.slice(0, tokens.length + PAGE_SIZE));
|
|
3928
|
-
};
|
|
3929
|
-
useEffect(function () {
|
|
3930
|
-
setTokens(list.slice(0, PAGE_SIZE));
|
|
3931
|
-
}, [searchedText]);
|
|
3932
|
-
useEffect(function () {
|
|
3933
|
-
setHasNextPage(list.length > tokens.length);
|
|
3934
|
-
}, [tokens.length]);
|
|
3935
|
-
var innerElementType = forwardRef(function (_ref, ref) {
|
|
3936
|
-
var style = _ref.style,
|
|
3937
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$G);
|
|
3938
|
-
return React__default.createElement("div", Object.assign({
|
|
3939
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3940
|
-
ref: ref,
|
|
3941
|
-
style: _extends({}, style, {
|
|
3942
|
-
height: parseFloat(style == null ? void 0 : style.height) + 8 * 2 + "px"
|
|
3943
|
-
})
|
|
3944
|
-
}, rest));
|
|
3945
|
-
});
|
|
3946
|
-
return React__default.createElement("div", {
|
|
3947
|
-
style: {
|
|
3948
|
-
height: '450px'
|
|
3949
|
-
}
|
|
3950
|
-
}, React__default.createElement(VirtualizedList, {
|
|
3951
|
-
Item: function Item(_ref2) {
|
|
3952
|
-
var index = _ref2.index,
|
|
3953
|
-
style = _ref2.style;
|
|
3954
|
-
return React__default.createElement(TokenItem, {
|
|
3955
|
-
token: tokens[index],
|
|
3956
|
-
style: style,
|
|
3957
|
-
onClick: changeSelected,
|
|
3958
|
-
selected: isSelected(tokens[index])
|
|
3959
|
-
});
|
|
3960
|
-
},
|
|
3961
|
-
hasNextPage: hasNextPage,
|
|
3962
|
-
itemCount: tokens.length,
|
|
3963
|
-
loadNextPage: loadNextPage,
|
|
3964
|
-
innerElementType: innerElementType,
|
|
3965
|
-
size: 56
|
|
3966
|
-
}));
|
|
3967
|
-
}
|
|
3968
|
-
|
|
3969
|
-
var filterTokens = function filterTokens(list, searchedFor) {
|
|
3970
|
-
return list.filter(function (token) {
|
|
3971
|
-
return containsText(token.symbol, searchedFor) || containsText(token.address || '', searchedFor) || containsText(token.name || '', searchedFor);
|
|
3972
|
-
});
|
|
3973
|
-
};
|
|
3974
|
-
function TokenSelector(props) {
|
|
3975
|
-
var list = props.list,
|
|
3976
|
-
type = props.type,
|
|
3977
|
-
selected = props.selected,
|
|
3978
|
-
onChange = props.onChange,
|
|
3979
|
-
hasHeader = props.hasHeader,
|
|
3980
|
-
multiSelect = props.multiSelect,
|
|
3981
|
-
selectedList = props.selectedList,
|
|
3982
|
-
onBack = props.onBack;
|
|
3983
|
-
return React__default.createElement(SecondaryPage, {
|
|
3984
|
-
textField: true,
|
|
3985
|
-
textFieldPlaceholder: "Search Blockchain By Name",
|
|
3986
|
-
title: "Select " + type + " Token",
|
|
3987
|
-
hasHeader: hasHeader,
|
|
3988
|
-
onBack: onBack
|
|
3989
|
-
}, function (searchedFor) {
|
|
3990
|
-
return React__default.createElement(TokenList, {
|
|
3991
|
-
searchedText: searchedFor,
|
|
3992
|
-
list: filterTokens(list, searchedFor),
|
|
3993
|
-
selected: selected,
|
|
3994
|
-
selectedList: selectedList,
|
|
3995
|
-
multiSelect: multiSelect,
|
|
3996
|
-
onChange: onChange
|
|
3997
|
-
});
|
|
3998
|
-
});
|
|
4139
|
+
onClick = _ref.onClick;
|
|
4140
|
+
var firstStep = swap.steps[0];
|
|
4141
|
+
var lastStep = swap.steps[swap.steps.length - 1];
|
|
4142
|
+
return React__default.createElement(Button, {
|
|
4143
|
+
variant: "ghost",
|
|
4144
|
+
size: "free",
|
|
4145
|
+
fullWidth: true,
|
|
4146
|
+
onClick: onClick.bind(null, swap.requestId)
|
|
4147
|
+
}, React__default.createElement(Container$4, {
|
|
4148
|
+
className: "" + status
|
|
4149
|
+
}, React__default.createElement("div", {
|
|
4150
|
+
className: "info"
|
|
4151
|
+
}, React__default.createElement(Token, {
|
|
4152
|
+
data: {
|
|
4153
|
+
token: {
|
|
4154
|
+
logo: firstStep.fromLogo,
|
|
4155
|
+
symbol: firstStep.fromSymbol
|
|
4156
|
+
},
|
|
4157
|
+
blockchain: {
|
|
4158
|
+
// @ts-ignore
|
|
4159
|
+
logo: firstStep.fromBlockchainLogo,
|
|
4160
|
+
name: firstStep.fromBlockchain
|
|
4161
|
+
},
|
|
4162
|
+
amount: swap.inputAmount
|
|
4163
|
+
}
|
|
4164
|
+
}), React__default.createElement(Spacer, {
|
|
4165
|
+
size: 12
|
|
4166
|
+
}), React__default.createElement(ArrowRightIcon, {
|
|
4167
|
+
size: 12
|
|
4168
|
+
}), React__default.createElement(Spacer, {
|
|
4169
|
+
size: 12
|
|
4170
|
+
}), React__default.createElement(Token, {
|
|
4171
|
+
data: {
|
|
4172
|
+
token: {
|
|
4173
|
+
logo: lastStep.toLogo,
|
|
4174
|
+
symbol: lastStep.toSymbol
|
|
4175
|
+
},
|
|
4176
|
+
blockchain: {
|
|
4177
|
+
// @ts-ignore
|
|
4178
|
+
logo: lastStep.toBlockchainLogo,
|
|
4179
|
+
name: lastStep.toBlockchain
|
|
4180
|
+
},
|
|
4181
|
+
amount: lastStep.outputAmount || lastStep.expectedOutputAmountHumanReadable || ''
|
|
4182
|
+
}
|
|
4183
|
+
})), React__default.createElement("div", {
|
|
4184
|
+
className: "status"
|
|
4185
|
+
}, status === 'running' ? React__default.createElement(Spinner, {
|
|
4186
|
+
size: 24,
|
|
4187
|
+
color: "primary"
|
|
4188
|
+
}) : status)));
|
|
3999
4189
|
}
|
|
4000
4190
|
|
|
4001
4191
|
var Container$5 = /*#__PURE__*/styled('div', {
|
|
@@ -4169,129 +4359,15 @@ function Drawer(props) {
|
|
|
4169
4359
|
})), React__default.createElement(Body, null, content), React__default.createElement(Footer, null, footer))), container));
|
|
4170
4360
|
}
|
|
4171
4361
|
|
|
4172
|
-
var MainContainer$
|
|
4173
|
-
|
|
4174
|
-
});
|
|
4175
|
-
var Line$2 = /*#__PURE__*/styled('div', {
|
|
4176
|
-
width: '0',
|
|
4177
|
-
marginLeft: '$12',
|
|
4178
|
-
height: '36px',
|
|
4179
|
-
border: '1px dashed $foreground',
|
|
4180
|
-
borderRadius: 'inherit'
|
|
4181
|
-
});
|
|
4182
|
-
var SwapperContainer$1 = /*#__PURE__*/styled('div', {
|
|
4183
|
-
display: 'flex',
|
|
4184
|
-
alignItems: 'center',
|
|
4185
|
-
marginLeft: '6px'
|
|
4186
|
-
});
|
|
4187
|
-
var Fee = /*#__PURE__*/styled('div', {
|
|
4188
|
-
display: 'flex',
|
|
4189
|
-
alignItems: 'center'
|
|
4190
|
-
});
|
|
4191
|
-
var SwapperLogo$1 = /*#__PURE__*/styled('img', {
|
|
4192
|
-
width: '$16',
|
|
4193
|
-
height: '$16'
|
|
4194
|
-
});
|
|
4195
|
-
var RelativeContainer$1 = /*#__PURE__*/styled('div', {
|
|
4196
|
-
position: 'relative'
|
|
4197
|
-
});
|
|
4198
|
-
var Footer$1 = /*#__PURE__*/styled('div', {
|
|
4199
|
-
display: 'flex',
|
|
4200
|
-
alignItems: 'center'
|
|
4201
|
-
});
|
|
4202
|
-
var Dot$2 = /*#__PURE__*/styled('div', {
|
|
4203
|
-
width: '$8',
|
|
4204
|
-
height: '$8',
|
|
4205
|
-
backgroundColor: '$foreground',
|
|
4206
|
-
borderRadius: '4px',
|
|
4207
|
-
marginLeft: '$8'
|
|
4208
|
-
});
|
|
4209
|
-
var ArrowDown = /*#__PURE__*/styled('div', {
|
|
4210
|
-
width: '0px',
|
|
4211
|
-
height: '0px',
|
|
4212
|
-
borderLeft: '5px solid transparent',
|
|
4213
|
-
borderRight: '5px solid transparent',
|
|
4214
|
-
borderTop: '5px solid $foreground',
|
|
4215
|
-
marginLeft: '$8'
|
|
4216
|
-
});
|
|
4217
|
-
var BestRouteContainer$1 = /*#__PURE__*/styled('div', {
|
|
4218
|
-
overflow: 'auto'
|
|
4219
|
-
});
|
|
4220
|
-
var Alerts = /*#__PURE__*/styled('div', {
|
|
4221
|
-
paddingBottom: '$16'
|
|
4362
|
+
var MainContainer$3 = /*#__PURE__*/styled('div', {
|
|
4363
|
+
overflowY: 'auto'
|
|
4222
4364
|
});
|
|
4223
|
-
function ConfirmSwap(props) {
|
|
4224
|
-
var _bestRoute$result;
|
|
4225
|
-
var bestRoute = props.bestRoute,
|
|
4226
|
-
onBack = props.onBack,
|
|
4227
|
-
onConfirm = props.onConfirm,
|
|
4228
|
-
loading = props.loading,
|
|
4229
|
-
errors = props.errors,
|
|
4230
|
-
warnings = props.warnings,
|
|
4231
|
-
extraMessages = props.extraMessages,
|
|
4232
|
-
confirmButtonTitle = props.confirmButtonTitle,
|
|
4233
|
-
confirmButtonDisabled = props.confirmButtonDisabled;
|
|
4234
|
-
return React__default.createElement(SecondaryPage, {
|
|
4235
|
-
textField: false,
|
|
4236
|
-
title: "Swap",
|
|
4237
|
-
onBack: onBack,
|
|
4238
|
-
Footer: React__default.createElement(Footer$1, null, React__default.createElement(Button, {
|
|
4239
|
-
type: "primary",
|
|
4240
|
-
fullWidth: true,
|
|
4241
|
-
loading: loading,
|
|
4242
|
-
variant: "contained",
|
|
4243
|
-
onClick: onConfirm,
|
|
4244
|
-
disabled: confirmButtonDisabled
|
|
4245
|
-
}, confirmButtonTitle))
|
|
4246
|
-
}, 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) {
|
|
4247
|
-
return React__default.createElement(React__default.Fragment, null, React__default.createElement(Spacer, {
|
|
4248
|
-
direction: "vertical"
|
|
4249
|
-
}), React__default.createElement(Alert, {
|
|
4250
|
-
type: "error",
|
|
4251
|
-
key: index
|
|
4252
|
-
}, error));
|
|
4253
|
-
}), warnings == null ? void 0 : warnings.map(function (warning, index) {
|
|
4254
|
-
return React__default.createElement(React__default.Fragment, null, React__default.createElement(Spacer, {
|
|
4255
|
-
direction: "vertical"
|
|
4256
|
-
}), React__default.createElement(Alert, {
|
|
4257
|
-
type: "warning",
|
|
4258
|
-
key: index
|
|
4259
|
-
}, warning));
|
|
4260
|
-
}))), React__default.createElement(BestRouteContainer$1, null, bestRoute == null ? void 0 : (_bestRoute$result = bestRoute.result) == null ? void 0 : _bestRoute$result.swaps.map(function (swap, index) {
|
|
4261
|
-
var _bestRoute$result2;
|
|
4262
|
-
return React__default.createElement(Fragment, {
|
|
4263
|
-
key: index
|
|
4264
|
-
}, index === 0 && React__default.createElement(RelativeContainer$1, null, React__default.createElement(StepDetail, {
|
|
4265
|
-
logo: swap.from.logo,
|
|
4266
|
-
symbol: swap.from.symbol,
|
|
4267
|
-
chainLogo: swap.from.blockchainLogo,
|
|
4268
|
-
blockchain: swap.from.blockchain,
|
|
4269
|
-
amount: swap.fromAmount
|
|
4270
|
-
}), React__default.createElement(Dot$2, null)), React__default.createElement(Line$2, null), React__default.createElement(SwapperContainer$1, null, React__default.createElement(SwapperLogo$1, {
|
|
4271
|
-
src: swap.swapperLogo,
|
|
4272
|
-
alt: swap.swapperId
|
|
4273
|
-
}), React__default.createElement("div", null, React__default.createElement(Typography, {
|
|
4274
|
-
ml: 4,
|
|
4275
|
-
variant: "caption"
|
|
4276
|
-
}, 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, {
|
|
4277
|
-
ml: 4,
|
|
4278
|
-
variant: "caption"
|
|
4279
|
-
}, "$", 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, {
|
|
4280
|
-
logo: swap.to.logo,
|
|
4281
|
-
symbol: swap.to.symbol,
|
|
4282
|
-
chainLogo: swap.to.blockchainLogo,
|
|
4283
|
-
blockchain: swap.to.blockchain,
|
|
4284
|
-
amount: swap.toAmount
|
|
4285
|
-
}));
|
|
4286
|
-
}))));
|
|
4287
|
-
}
|
|
4288
|
-
|
|
4289
4365
|
var Section = /*#__PURE__*/styled('div', {
|
|
4290
4366
|
paddingBottom: '$32',
|
|
4291
4367
|
marginBottom: '$32',
|
|
4292
4368
|
borderBottom: '1px solid $neutrals400'
|
|
4293
4369
|
});
|
|
4294
|
-
var Footer$
|
|
4370
|
+
var Footer$1 = /*#__PURE__*/styled('div', {
|
|
4295
4371
|
display: 'flex',
|
|
4296
4372
|
alignItems: 'center'
|
|
4297
4373
|
});
|
|
@@ -4321,7 +4397,10 @@ var Container$6 = /*#__PURE__*/styled('div', {
|
|
|
4321
4397
|
alignItems: 'center'
|
|
4322
4398
|
}
|
|
4323
4399
|
});
|
|
4324
|
-
|
|
4400
|
+
var Alerts = /*#__PURE__*/styled('div', {
|
|
4401
|
+
paddingBottom: '$16'
|
|
4402
|
+
});
|
|
4403
|
+
function ConfirmSwap(props) {
|
|
4325
4404
|
var onBack = props.onBack,
|
|
4326
4405
|
loading = props.loading,
|
|
4327
4406
|
onConfirm = props.onConfirm,
|
|
@@ -4330,20 +4409,38 @@ function ConfirmWallets(props) {
|
|
|
4330
4409
|
onChange = props.onChange,
|
|
4331
4410
|
confirmDisabled = props.confirmDisabled,
|
|
4332
4411
|
isExperimentalChain = props.isExperimentalChain,
|
|
4333
|
-
handleConnectChain = props.handleConnectChain
|
|
4412
|
+
handleConnectChain = props.handleConnectChain,
|
|
4413
|
+
confirmButtonTitle = props.confirmButtonTitle,
|
|
4414
|
+
errors = props.errors,
|
|
4415
|
+
warnings = props.warnings,
|
|
4416
|
+
extraMessages = props.extraMessages;
|
|
4334
4417
|
return React__default.createElement(SecondaryPage, {
|
|
4335
4418
|
textField: false,
|
|
4336
4419
|
title: "Confirm Swap",
|
|
4337
4420
|
onBack: onBack,
|
|
4338
|
-
Footer: React__default.createElement(Footer$
|
|
4421
|
+
Footer: React__default.createElement(Footer$1, null, React__default.createElement(ConfirmButton, {
|
|
4339
4422
|
fullWidth: true,
|
|
4340
4423
|
loading: loading,
|
|
4341
4424
|
type: "primary",
|
|
4342
4425
|
variant: "contained",
|
|
4343
4426
|
onClick: onConfirm,
|
|
4344
4427
|
disabled: confirmDisabled
|
|
4345
|
-
},
|
|
4346
|
-
},
|
|
4428
|
+
}, confirmButtonTitle))
|
|
4429
|
+
}, 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) {
|
|
4430
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(Spacer, {
|
|
4431
|
+
direction: "vertical"
|
|
4432
|
+
}), React__default.createElement(Alert, {
|
|
4433
|
+
type: "error",
|
|
4434
|
+
key: index
|
|
4435
|
+
}, error));
|
|
4436
|
+
}), warnings == null ? void 0 : warnings.map(function (warning, index) {
|
|
4437
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(Spacer, {
|
|
4438
|
+
direction: "vertical"
|
|
4439
|
+
}), React__default.createElement(Alert, {
|
|
4440
|
+
type: "warning",
|
|
4441
|
+
key: index
|
|
4442
|
+
}, warning));
|
|
4443
|
+
}))), props.previewInputs || props.previewRoutes ? React__default.createElement(Section, null, props.previewInputs, !!props.previewRoutes ? React__default.createElement(Spacer, {
|
|
4347
4444
|
size: 16,
|
|
4348
4445
|
direction: "vertical"
|
|
4349
4446
|
}) : null, props.previewRoutes) : null, requiredWallets.map(function (wallet, index) {
|
|
@@ -4373,34 +4470,16 @@ function ConfirmWallets(props) {
|
|
|
4373
4470
|
list: list,
|
|
4374
4471
|
onChange: onChange
|
|
4375
4472
|
}));
|
|
4376
|
-
}));
|
|
4377
|
-
}
|
|
4378
|
-
|
|
4379
|
-
function groupingOfSwaps(list) {
|
|
4380
|
-
return list.reduce(function (acc, swap) {
|
|
4381
|
-
var categoryIndex = acc.findIndex(function (item) {
|
|
4382
|
-
return swap.status === 'running' && item.title == 'Active Swaps' || swap.status !== 'running' && item.title == 'Recent Swaps';
|
|
4383
|
-
});
|
|
4384
|
-
if (categoryIndex > -1) {
|
|
4385
|
-
acc[categoryIndex].swaps.push(swap);
|
|
4386
|
-
} else {
|
|
4387
|
-
acc.push({
|
|
4388
|
-
title: swap.status === 'running' ? 'Active Swaps' : 'Recent Swaps',
|
|
4389
|
-
swaps: [swap]
|
|
4390
|
-
});
|
|
4391
|
-
}
|
|
4392
|
-
return acc;
|
|
4393
|
-
}, []);
|
|
4473
|
+
})));
|
|
4394
4474
|
}
|
|
4395
4475
|
|
|
4396
|
-
var
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
alignItems: 'center'
|
|
4476
|
+
var Group = /*#__PURE__*/styled('div', {
|
|
4477
|
+
'.group-title': {
|
|
4478
|
+
textTransform: 'uppercase'
|
|
4479
|
+
}
|
|
4401
4480
|
});
|
|
4402
|
-
var
|
|
4403
|
-
|
|
4481
|
+
var Container$7 = /*#__PURE__*/styled('div', {
|
|
4482
|
+
overflowY: 'auto'
|
|
4404
4483
|
});
|
|
4405
4484
|
var filteredHistory = function filteredHistory(list, searchedFor) {
|
|
4406
4485
|
return list.filter(function (swap) {
|
|
@@ -4409,30 +4488,34 @@ var filteredHistory = function filteredHistory(list, searchedFor) {
|
|
|
4409
4488
|
return containsText(firstStep.fromBlockchain, searchedFor) || containsText(firstStep.fromSymbol, searchedFor) || containsText(lastStep.toBlockchain, searchedFor) || containsText(lastStep.toSymbol, searchedFor) || containsText(swap.requestId, searchedFor);
|
|
4410
4489
|
});
|
|
4411
4490
|
};
|
|
4412
|
-
var Group = /*#__PURE__*/styled('div', {
|
|
4413
|
-
marginBottom: '$24',
|
|
4414
|
-
paddingRight: '$8',
|
|
4415
|
-
maxHeight: '600px'
|
|
4416
|
-
});
|
|
4417
|
-
var GroupTitle = /*#__PURE__*/styled(Typography, {
|
|
4418
|
-
color: '$neutrals500'
|
|
4419
|
-
});
|
|
4420
4491
|
var SwapsGroup = function SwapsGroup(props) {
|
|
4421
4492
|
var list = props.list,
|
|
4422
|
-
onSwapClick = props.onSwapClick
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4493
|
+
onSwapClick = props.onSwapClick,
|
|
4494
|
+
groupBy = props.groupBy;
|
|
4495
|
+
var groups = groupBy ? groupBy(list) : [{
|
|
4496
|
+
title: 'History',
|
|
4497
|
+
swaps: list
|
|
4498
|
+
}];
|
|
4499
|
+
return React__default.createElement(React__default.Fragment, null, groups.filter(function (group) {
|
|
4500
|
+
return group.swaps.length > 0;
|
|
4501
|
+
}).map(function (group, index) {
|
|
4502
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(Group, {
|
|
4426
4503
|
key: index
|
|
4427
|
-
}, React__default.createElement(
|
|
4428
|
-
variant: "body2"
|
|
4504
|
+
}, React__default.createElement(Typography, {
|
|
4505
|
+
variant: "body2",
|
|
4506
|
+
color: "neutrals600",
|
|
4507
|
+
className: "group-title"
|
|
4429
4508
|
}, group.title), group.swaps.map(function (swap, index) {
|
|
4430
|
-
return React__default.createElement(SwapDetail, {
|
|
4509
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(SwapDetail, {
|
|
4431
4510
|
key: index,
|
|
4432
4511
|
swap: swap,
|
|
4433
4512
|
status: swap.status,
|
|
4434
4513
|
onClick: onSwapClick
|
|
4435
|
-
})
|
|
4514
|
+
}), React__default.createElement(Divider, {
|
|
4515
|
+
size: 12
|
|
4516
|
+
}));
|
|
4517
|
+
})), React__default.createElement(Divider, {
|
|
4518
|
+
size: 24
|
|
4436
4519
|
}));
|
|
4437
4520
|
}));
|
|
4438
4521
|
};
|
|
@@ -4440,28 +4523,126 @@ function History(_ref) {
|
|
|
4440
4523
|
var _ref$list = _ref.list,
|
|
4441
4524
|
list = _ref$list === void 0 ? [] : _ref$list,
|
|
4442
4525
|
onBack = _ref.onBack,
|
|
4443
|
-
onSwapClick = _ref.onSwapClick
|
|
4526
|
+
onSwapClick = _ref.onSwapClick,
|
|
4527
|
+
groupBy = _ref.groupBy;
|
|
4444
4528
|
return React__default.createElement(SecondaryPage, {
|
|
4445
4529
|
onBack: onBack,
|
|
4446
4530
|
textField: true,
|
|
4447
|
-
textFieldPlaceholder: "Search By Blockchain Or Token",
|
|
4531
|
+
textFieldPlaceholder: "Search By Blockchain Or Token Or Request ID",
|
|
4448
4532
|
title: "Swaps"
|
|
4449
4533
|
}, function (searchedFor) {
|
|
4450
4534
|
var filterSwaps = filteredHistory(list, searchedFor);
|
|
4451
|
-
return filterSwaps.length ? React__default.createElement(SwapsGroup, {
|
|
4535
|
+
return React__default.createElement(Container$7, null, filterSwaps.length ? React__default.createElement(SwapsGroup, {
|
|
4452
4536
|
list: filterSwaps,
|
|
4453
|
-
onSwapClick: onSwapClick
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4537
|
+
onSwapClick: onSwapClick,
|
|
4538
|
+
groupBy: groupBy
|
|
4539
|
+
}) : React__default.createElement(NotFoundAlert, {
|
|
4540
|
+
catergory: "Swap"
|
|
4541
|
+
}));
|
|
4457
4542
|
});
|
|
4458
4543
|
}
|
|
4459
4544
|
|
|
4545
|
+
var getAlertType = function getAlertType(messageType) {
|
|
4546
|
+
if (!messageType || messageType === 'info') return 'secondary';else return messageType;
|
|
4547
|
+
};
|
|
4548
|
+
var DetailedMessage = /*#__PURE__*/styled('div', {
|
|
4549
|
+
width: '90%',
|
|
4550
|
+
overflowWrap: 'break-word',
|
|
4551
|
+
color: '$error500 !important'
|
|
4552
|
+
});
|
|
4553
|
+
var SuccessText = /*#__PURE__*/styled(Typography, {
|
|
4554
|
+
color: '$success500 !important'
|
|
4555
|
+
});
|
|
4556
|
+
var SwapMessages = function SwapMessages(props) {
|
|
4557
|
+
var shortMessage = props.shortMessage,
|
|
4558
|
+
detailedMessage = props.detailedMessage,
|
|
4559
|
+
currentStepBlockchain = props.currentStepBlockchain,
|
|
4560
|
+
type = props.type,
|
|
4561
|
+
lastConvertedTokenInFailedSwap = props.lastConvertedTokenInFailedSwap;
|
|
4562
|
+
var _useState = useState(false),
|
|
4563
|
+
expandedMessage = _useState[0],
|
|
4564
|
+
setExpandedMessage = _useState[1];
|
|
4565
|
+
var allowedNumberOfChars = detailedMessage["long"] ? 0 : 150;
|
|
4566
|
+
var shouldShowMoreDetailsButton = !expandedMessage && detailedMessage.content.length > allowedNumberOfChars;
|
|
4567
|
+
return React__default.createElement(Alert, Object.assign({
|
|
4568
|
+
type: getAlertType(type),
|
|
4569
|
+
title: shortMessage
|
|
4570
|
+
}, shouldShowMoreDetailsButton && {
|
|
4571
|
+
footer: React__default.createElement(Button, {
|
|
4572
|
+
variant: "outlined",
|
|
4573
|
+
type: "primary",
|
|
4574
|
+
onClick: setExpandedMessage.bind(null, function (prevState) {
|
|
4575
|
+
return !prevState;
|
|
4576
|
+
})
|
|
4577
|
+
}, "Show more details")
|
|
4578
|
+
}, !!props.switchNetwork && {
|
|
4579
|
+
footer: React__default.createElement(Button, {
|
|
4580
|
+
variant: 'outlined',
|
|
4581
|
+
type: "primary",
|
|
4582
|
+
onClick: props.switchNetwork
|
|
4583
|
+
}, "Change network to ", currentStepBlockchain)
|
|
4584
|
+
}), !!detailedMessage.content ? React__default.createElement(DetailedMessage, null, React__default.createElement(Typography, {
|
|
4585
|
+
variant: "body2"
|
|
4586
|
+
}, 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, {
|
|
4587
|
+
variant: "body2"
|
|
4588
|
+
}, "Don't worry, your fund is\xA0"), React__default.createElement(SuccessText, {
|
|
4589
|
+
variant: "body2"
|
|
4590
|
+
}, React__default.createElement("b", null, "Safe"))), React__default.createElement("p", null, React__default.createElement(Typography, {
|
|
4591
|
+
variant: "body2"
|
|
4592
|
+
}, "It is converted to \xA0", React__default.createElement("u", null, lastConvertedTokenInFailedSwap.outputAmount), "\xA0"), React__default.createElement(SuccessText, {
|
|
4593
|
+
variant: "body2"
|
|
4594
|
+
}, React__default.createElement("b", null, lastConvertedTokenInFailedSwap.symbol, "\xA0")), React__default.createElement(Typography, {
|
|
4595
|
+
variant: "body2"
|
|
4596
|
+
}, "on your\xA0"), React__default.createElement(SuccessText, {
|
|
4597
|
+
variant: "body2"
|
|
4598
|
+
}, React__default.createElement("b", null, lastConvertedTokenInFailedSwap.blockchain, "\xA0")), React__default.createElement(Typography, {
|
|
4599
|
+
variant: "body2"
|
|
4600
|
+
}, "wallet"))));
|
|
4601
|
+
};
|
|
4602
|
+
|
|
4603
|
+
var _excluded$I = ["pendingSwap", "onBack", "onCopy", "isCopied", "onCancel", "date", "onRetry", "previewInputs"];
|
|
4604
|
+
var SwapperContainer$1 = /*#__PURE__*/styled('div', {
|
|
4605
|
+
display: 'flex',
|
|
4606
|
+
alignItems: 'center',
|
|
4607
|
+
marginLeft: '6px'
|
|
4608
|
+
});
|
|
4609
|
+
var Fee = /*#__PURE__*/styled('div', {
|
|
4610
|
+
display: 'flex',
|
|
4611
|
+
alignItems: 'center'
|
|
4612
|
+
});
|
|
4613
|
+
var SwapperLogo$1 = /*#__PURE__*/styled('img', {
|
|
4614
|
+
width: '$16',
|
|
4615
|
+
height: '$16'
|
|
4616
|
+
});
|
|
4617
|
+
var RelativeContainer$1 = /*#__PURE__*/styled('div', {
|
|
4618
|
+
position: 'relative'
|
|
4619
|
+
});
|
|
4620
|
+
var Dot$1 = /*#__PURE__*/styled('div', {
|
|
4621
|
+
width: '$8',
|
|
4622
|
+
height: '$8',
|
|
4623
|
+
backgroundColor: '$foreground',
|
|
4624
|
+
borderRadius: '4px',
|
|
4625
|
+
marginLeft: '$8'
|
|
4626
|
+
});
|
|
4627
|
+
var ArrowDown = /*#__PURE__*/styled('div', {
|
|
4628
|
+
width: '0px',
|
|
4629
|
+
height: '0px',
|
|
4630
|
+
borderLeft: '5px solid transparent',
|
|
4631
|
+
borderRight: '5px solid transparent',
|
|
4632
|
+
borderTop: '5px solid $foreground',
|
|
4633
|
+
marginLeft: '$8'
|
|
4634
|
+
});
|
|
4460
4635
|
var StyledAnchor = /*#__PURE__*/styled('a', {
|
|
4461
4636
|
color: '$primary',
|
|
4462
4637
|
fontWeight: '$600',
|
|
4463
4638
|
marginLeft: '$12'
|
|
4464
4639
|
});
|
|
4640
|
+
var SwapInfoContainer = /*#__PURE__*/styled('div', {
|
|
4641
|
+
display: 'flex',
|
|
4642
|
+
flexDirection: 'column',
|
|
4643
|
+
paddingBottom: '$16',
|
|
4644
|
+
borderBottom: '1px solid $neutrals300'
|
|
4645
|
+
});
|
|
4465
4646
|
var InternalDetailsContainer = /*#__PURE__*/styled('div', {
|
|
4466
4647
|
display: 'flex'
|
|
4467
4648
|
});
|
|
@@ -4480,30 +4661,51 @@ var Description = /*#__PURE__*/styled(Typography, {
|
|
|
4480
4661
|
var Error = /*#__PURE__*/styled(Description, {
|
|
4481
4662
|
color: '$error'
|
|
4482
4663
|
});
|
|
4483
|
-
var Line$
|
|
4664
|
+
var Line$1 = /*#__PURE__*/styled('div', {
|
|
4484
4665
|
width: '0',
|
|
4485
4666
|
minHeight: '$16',
|
|
4486
4667
|
marginLeft: '$12',
|
|
4487
4668
|
border: '1px dashed $foreground',
|
|
4488
4669
|
borderRadius: 'inherit'
|
|
4489
4670
|
});
|
|
4490
|
-
var
|
|
4491
|
-
cursor: 'pointer',
|
|
4492
|
-
backgroundColor: '$neutrals200',
|
|
4493
|
-
padding: '$4',
|
|
4671
|
+
var Row$2 = /*#__PURE__*/styled('div', {
|
|
4494
4672
|
display: 'flex',
|
|
4495
|
-
justifyContent: '
|
|
4673
|
+
justifyContent: 'space-between',
|
|
4496
4674
|
alignItems: 'center',
|
|
4497
|
-
|
|
4498
|
-
|
|
4675
|
+
fontSize: '$14',
|
|
4676
|
+
padding: '$8 0',
|
|
4677
|
+
'.name': {
|
|
4678
|
+
color: '$neutrals600'
|
|
4679
|
+
},
|
|
4680
|
+
'.value': {
|
|
4681
|
+
display: 'flex',
|
|
4682
|
+
alignItems: 'center',
|
|
4683
|
+
color: '$neutrals800'
|
|
4684
|
+
},
|
|
4685
|
+
'.status': {
|
|
4686
|
+
fontWeight: 'bold',
|
|
4687
|
+
textTransform: 'uppercase'
|
|
4688
|
+
},
|
|
4689
|
+
'.status.failed': {
|
|
4690
|
+
color: '$error'
|
|
4691
|
+
},
|
|
4692
|
+
'.status.success': {
|
|
4693
|
+
color: '$success'
|
|
4694
|
+
}
|
|
4499
4695
|
});
|
|
4500
|
-
var RequestId = /*#__PURE__*/styled(
|
|
4501
|
-
|
|
4696
|
+
var RequestId = /*#__PURE__*/styled('div', {
|
|
4697
|
+
width: '150px',
|
|
4698
|
+
whiteSpace: 'nowrap',
|
|
4699
|
+
overflow: 'hidden',
|
|
4700
|
+
textOverflow: 'ellipsis',
|
|
4701
|
+
'@md': {
|
|
4702
|
+
width: 'auto'
|
|
4703
|
+
}
|
|
4502
4704
|
});
|
|
4503
|
-
var
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4705
|
+
var ExtraDetails = /*#__PURE__*/styled('div', {
|
|
4706
|
+
padding: '$8 0',
|
|
4707
|
+
color: '$neutrals600',
|
|
4708
|
+
fontSize: '$12'
|
|
4507
4709
|
});
|
|
4508
4710
|
var StepContainer$1 = /*#__PURE__*/styled('div', {
|
|
4509
4711
|
variants: {
|
|
@@ -4519,43 +4721,57 @@ var StepContainer$1 = /*#__PURE__*/styled('div', {
|
|
|
4519
4721
|
}
|
|
4520
4722
|
}
|
|
4521
4723
|
});
|
|
4724
|
+
var SwapFlowContainer = /*#__PURE__*/styled('div', {
|
|
4725
|
+
overflowY: 'auto'
|
|
4726
|
+
});
|
|
4522
4727
|
function SwapHistory(props) {
|
|
4523
4728
|
var pendingSwap = props.pendingSwap,
|
|
4524
4729
|
onBack = props.onBack,
|
|
4525
4730
|
onCopy = props.onCopy,
|
|
4526
4731
|
isCopied = props.isCopied,
|
|
4527
|
-
onCancel = props.onCancel
|
|
4732
|
+
onCancel = props.onCancel,
|
|
4733
|
+
date = props.date,
|
|
4734
|
+
onRetry = props.onRetry,
|
|
4735
|
+
extraMessageProps = _objectWithoutPropertiesLoose(props, _excluded$I);
|
|
4528
4736
|
var _useState = useState(false),
|
|
4529
4737
|
showDrawer = _useState[0],
|
|
4530
4738
|
setShowDrawer = _useState[1];
|
|
4531
4739
|
return React__default.createElement(SecondaryPage, {
|
|
4532
4740
|
title: "Swap Details",
|
|
4533
4741
|
textField: false,
|
|
4534
|
-
onBack: onBack
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4742
|
+
onBack: onBack,
|
|
4743
|
+
Footer: React__default.createElement(React__default.Fragment, null, (pendingSwap == null ? void 0 : pendingSwap.status) === 'running' && React__default.createElement(Button, {
|
|
4744
|
+
variant: "outlined",
|
|
4745
|
+
fullWidth: true,
|
|
4746
|
+
type: "error",
|
|
4747
|
+
onClick: setShowDrawer.bind(null, true)
|
|
4748
|
+
}, "Cancel"), !!onRetry && React__default.createElement(Button, {
|
|
4749
|
+
variant: "contained",
|
|
4750
|
+
fullWidth: true,
|
|
4751
|
+
type: "primary",
|
|
4752
|
+
onClick: onRetry
|
|
4753
|
+
}, "Try again"))
|
|
4754
|
+
}, React__default.createElement("div", null, React__default.createElement(SwapInfoContainer, null, React__default.createElement(Row$2, null, React__default.createElement("div", {
|
|
4755
|
+
className: "name"
|
|
4756
|
+
}, "Request ID:"), React__default.createElement("div", {
|
|
4757
|
+
className: "value requestId",
|
|
4542
4758
|
onClick: onCopy.bind(null, pendingSwap == null ? void 0 : pendingSwap.requestId)
|
|
4543
|
-
}, React__default.createElement(RequestId, {
|
|
4544
|
-
|
|
4545
|
-
}
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
}
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
}, pendingSwap == null ? void 0 : pendingSwap.steps.map(function (step, index) {
|
|
4759
|
+
}, React__default.createElement(RequestId, null, pendingSwap == null ? void 0 : pendingSwap.requestId), React__default.createElement(Spacer, {
|
|
4760
|
+
size: 4
|
|
4761
|
+
}), React__default.createElement(Button, {
|
|
4762
|
+
type: "primary",
|
|
4763
|
+
variant: "ghost",
|
|
4764
|
+
size: "compact"
|
|
4765
|
+
}, isCopied ? 'Copied!' : 'Copy'))), React__default.createElement(Row$2, null, React__default.createElement("div", {
|
|
4766
|
+
className: "name"
|
|
4767
|
+
}, "Status:"), React__default.createElement("div", {
|
|
4768
|
+
className: "value status " + ((pendingSwap == null ? void 0 : pendingSwap.status) || '')
|
|
4769
|
+
}, pendingSwap == null ? void 0 : pendingSwap.status, (pendingSwap == null ? void 0 : pendingSwap.status) === 'running' && React__default.createElement(Spinner, {
|
|
4770
|
+
size: 16,
|
|
4771
|
+
color: "primary"
|
|
4772
|
+
}))), React__default.createElement(ExtraDetails, null, date))), React__default.createElement(SwapFlowContainer, null, extraMessageProps.shortMessage && React__default.createElement(SwapMessages, Object.assign({}, extraMessageProps)), React__default.createElement(Divider, {
|
|
4773
|
+
size: 32
|
|
4774
|
+
}), pendingSwap == null ? void 0 : pendingSwap.steps.map(function (step, index) {
|
|
4559
4775
|
return React__default.createElement(StepContainer$1, {
|
|
4560
4776
|
key: index,
|
|
4561
4777
|
hasNotStarted: step.status === 'created',
|
|
@@ -4563,23 +4779,31 @@ function SwapHistory(props) {
|
|
|
4563
4779
|
}, index === 0 && React__default.createElement(RelativeContainer$1, null, React__default.createElement(StepDetail, {
|
|
4564
4780
|
logo: step.fromLogo,
|
|
4565
4781
|
symbol: step.fromSymbol,
|
|
4782
|
+
// @ts-ignore
|
|
4566
4783
|
chainLogo: step.fromBlockchainLogo,
|
|
4567
4784
|
blockchain: step.fromBlockchain,
|
|
4568
4785
|
amount: pendingSwap.inputAmount
|
|
4569
|
-
}), React__default.createElement(Dot$
|
|
4786
|
+
}), React__default.createElement(Dot$1, null)), React__default.createElement(Line$1, null), React__default.createElement(SwapperContainer$1, null, React__default.createElement(SwapperLogo$1
|
|
4787
|
+
// @ts-ignore
|
|
4788
|
+
, {
|
|
4789
|
+
// @ts-ignore
|
|
4570
4790
|
src: step.swapperLogo,
|
|
4571
4791
|
alt: step.swapperId
|
|
4572
4792
|
}), React__default.createElement("div", null, React__default.createElement(Typography, {
|
|
4573
4793
|
ml: 4,
|
|
4574
4794
|
variant: "caption"
|
|
4575
|
-
},
|
|
4795
|
+
},
|
|
4796
|
+
// @ts-ignore
|
|
4797
|
+
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, {
|
|
4576
4798
|
ml: 4,
|
|
4577
4799
|
variant: "caption"
|
|
4578
|
-
}, "$",
|
|
4800
|
+
}, "$",
|
|
4801
|
+
// @ts-ignore
|
|
4802
|
+
step.feeInUsd, ' ', "estimated gas fee")))), React__default.createElement("div", {
|
|
4579
4803
|
style: {
|
|
4580
4804
|
display: 'flex'
|
|
4581
4805
|
}
|
|
4582
|
-
}, React__default.createElement(InternalDetailsContainer, null, React__default.createElement(Line$
|
|
4806
|
+
}, React__default.createElement(InternalDetailsContainer, null, React__default.createElement(Line$1, null), !!step.explorerUrl && React__default.createElement("div", null, step.explorerUrl.map(function (item, index) {
|
|
4583
4807
|
return React__default.createElement(InternalDetail, {
|
|
4584
4808
|
key: index
|
|
4585
4809
|
}, React__default.createElement(DescriptionContainer, null, React__default.createElement(CheckCircleIcon, {
|
|
@@ -4599,28 +4823,25 @@ function SwapHistory(props) {
|
|
|
4599
4823
|
}, "Step failed")))))), index + 1 === pendingSwap.steps.length && React__default.createElement(ArrowDown, null), React__default.createElement(StepDetail, {
|
|
4600
4824
|
logo: step.toLogo,
|
|
4601
4825
|
symbol: step.toSymbol,
|
|
4826
|
+
// @ts-ignore
|
|
4602
4827
|
chainLogo: step.toBlockchainLogo,
|
|
4603
4828
|
blockchain: step.toBlockchain,
|
|
4604
|
-
amount: step.outputAmount
|
|
4829
|
+
amount: step.outputAmount || ''
|
|
4605
4830
|
}));
|
|
4606
|
-
}),
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
onClick: setShowDrawer.bind(null, true)
|
|
4610
|
-
}, "Cancel")))), React__default.createElement(Drawer, {
|
|
4831
|
+
}), React__default.createElement(Divider, {
|
|
4832
|
+
size: 32
|
|
4833
|
+
})), React__default.createElement(Drawer, {
|
|
4611
4834
|
onClose: setShowDrawer.bind(null, false),
|
|
4612
4835
|
open: showDrawer,
|
|
4613
4836
|
showClose: true,
|
|
4614
4837
|
anchor: "bottom",
|
|
4615
4838
|
title: "Cancel Progress",
|
|
4616
|
-
content: React__default.createElement(
|
|
4839
|
+
content: React__default.createElement(Alert, {
|
|
4617
4840
|
type: "warning"
|
|
4618
|
-
}, React__default.createElement(
|
|
4619
|
-
variant: "body2"
|
|
4620
|
-
}, 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, {
|
|
4841
|
+
}, 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, {
|
|
4621
4842
|
size: 12,
|
|
4622
4843
|
direction: "vertical"
|
|
4623
|
-
}), React__default.createElement("p", null, "If you have already signed your transaction to blockchain, you should wait for that to complete or rollback"))
|
|
4844
|
+
}), React__default.createElement("p", null, "If you have already signed your transaction to blockchain, you should wait for that to complete or rollback")),
|
|
4624
4845
|
footer: React__default.createElement("div", {
|
|
4625
4846
|
style: {
|
|
4626
4847
|
display: 'flex',
|
|
@@ -4645,5 +4866,5 @@ function SwapHistory(props) {
|
|
|
4645
4866
|
}));
|
|
4646
4867
|
}
|
|
4647
4868
|
|
|
4648
|
-
export { AddCircleIcon, AddIcon, AddWalletIcon, Alert, AngleDownIcon, AngleLeftIcon, AngleRightIcon, AngleUpIcon, BagIcon, BanIcon, BestRoute, BlockchainSelector, Button, CheckCircleIcon, CheckIcon, CheckSquareIcon, CheckWalletIcon, Checkbox, ChevronRightIcon, Chip, CloseIcon, ColorPicker, ConfirmSwap,
|
|
4869
|
+
export { AddCircleIcon, AddIcon, AddWalletIcon, Alert, AngleDownIcon, AngleLeftIcon, AngleRightIcon, AngleUpIcon, ArrowRightIcon, BagIcon, BanIcon, BestRoute, BlockchainSelector, Button, CheckCircleIcon, CheckIcon, CheckSquareIcon, CheckWalletIcon, Checkbox, ChevronRightIcon, Chip, CloseIcon, ColorPicker, ConfirmSwap, ConnectWalletsModal, CopyIcon, DeleteCircleIcon, DeleteWalletIcon, DisconnectIcon, Divider, DownloadIcon, Drawer, FilledCircle, GasIcon, Header, History, HistoryIcon, HorizontalSwapIcon, InfoCircleIcon, LiquiditySourcesSelector, LoadingFailedAlert, MinusCircleIcon, Modal, Radio, RetryIcon, RetryLeftIcon, RetryRightIcon, SearchIcon, SearchMinusIcon, SecondaryPage, SelectableWalletList, Settings, SettingsIcon, SignatureIcon, Spacer, Spinner, StepDetail, SwapContainer, SwapDetail, SwapHistory, SwapWalletIcon, Switch, TextField, TimeIcon, TokenList, TokenSelector, Tooltip, TrashIcon, TryAgainIcon, Typography, VerticalSwapIcon, Wallet, WalletIcon, WalletState, WarningIcon, createTheme, css, darkTheme, globalCss, keyframes, lightTheme, styled };
|
|
4649
4870
|
//# sourceMappingURL=ui.esm.js.map
|