@rango-dev/ui 0.1.10-next.92 → 0.1.11-next.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/README.md +1 -181
  2. package/dist/components/Alert/LoadingFailedAlert.d.ts +2 -0
  3. package/dist/components/Alert/NotFoundAlert.d.ts +7 -0
  4. package/dist/components/Alert/index.d.ts +1 -0
  5. package/dist/components/BlockchainSelector/BlockchainSelector.d.ts +1 -1
  6. package/dist/components/Button/Button.d.ts +1 -1
  7. package/dist/components/Divider/Divider.d.ts +6 -0
  8. package/dist/components/Divider/index.d.ts +1 -0
  9. package/dist/components/Header/Header.d.ts +9 -0
  10. package/dist/components/Header/index.d.ts +1 -0
  11. package/dist/components/Icon/ArrowRightIcon.d.ts +3 -0
  12. package/dist/components/Icon/index.d.ts +1 -0
  13. package/dist/components/Icon/types.d.ts +1 -0
  14. package/dist/components/LiquiditySourceList/LiquiditySourceList.d.ts +3 -1
  15. package/dist/components/LiquiditySourcesSelector/LiquiditySourcesSelector.d.ts +2 -1
  16. package/dist/components/Modal/Modal.d.ts +0 -1
  17. package/dist/components/SelectableWalletList/mock.d.ts +1 -1
  18. package/dist/components/Settings/Settings.d.ts +2 -1
  19. package/dist/components/StepDetail/StepDetail.d.ts +3 -1
  20. package/dist/components/SwapContainer/SwapContainer.d.ts +1 -0
  21. package/dist/components/SwapDetail/Token.d.ts +17 -0
  22. package/dist/components/TextField/TextField.d.ts +1 -1
  23. package/dist/components/TokenList/TokenList.d.ts +2 -2
  24. package/dist/components/TokenSelector/TokenSelector.d.ts +4 -3
  25. package/dist/components/Typography/Typography.d.ts +1 -1
  26. package/dist/components/common/Image.d.ts +6 -0
  27. package/dist/components/common/index.d.ts +1 -0
  28. package/dist/components/index.d.ts +2 -0
  29. package/dist/containers/ConfirmSwap/ConfirmSwap.d.ts +14 -19
  30. package/dist/containers/ConfirmSwap/ConfirmSwap.stories.d.ts +1 -0
  31. package/dist/containers/ConfirmSwap/mock.d.ts +3 -0
  32. package/dist/containers/History/History.d.ts +5 -7
  33. package/dist/containers/History/SwapsGroup.d.ts +13 -0
  34. package/dist/containers/History/index.d.ts +1 -0
  35. package/dist/containers/History/types.d.ts +3 -24
  36. package/dist/containers/SwapHistory/SwapHistory.d.ts +16 -3
  37. package/dist/containers/SwapHistory/SwapMessages.d.ts +17 -0
  38. package/dist/containers/index.d.ts +0 -1
  39. package/dist/helper/index.d.ts +3 -1
  40. package/dist/types/meta.d.ts +1 -0
  41. package/dist/ui.cjs.development.js +1137 -837
  42. package/dist/ui.cjs.development.js.map +1 -1
  43. package/dist/ui.cjs.production.min.js +1 -1
  44. package/dist/ui.cjs.production.min.js.map +1 -1
  45. package/dist/ui.esm.js +1134 -839
  46. package/dist/ui.esm.js.map +1 -1
  47. package/package.json +3 -2
  48. package/src/components/Alert/Alert.tsx +33 -12
  49. package/src/components/Alert/LoadingFailedAlert.tsx +11 -0
  50. package/src/components/Alert/NotFoundAlert.tsx +19 -0
  51. package/src/components/Alert/index.ts +1 -0
  52. package/src/components/BestRoute/BestRoute.tsx +2 -5
  53. package/src/components/BestRoute/mock.ts +10 -0
  54. package/src/components/BlockchainSelector/BlockchainSelector.tsx +31 -34
  55. package/src/components/BlockchainsList/BlockchainsList.tsx +8 -6
  56. package/src/components/Button/Button.tsx +2 -1
  57. package/src/components/ConnectWalletsModal/mockData.ts +16 -0
  58. package/src/components/Divider/Divider.tsx +41 -0
  59. package/src/components/Divider/index.ts +1 -0
  60. package/src/components/Drawer/Drawer.tsx +1 -1
  61. package/src/components/Header/Header.tsx +39 -0
  62. package/src/components/Header/index.ts +1 -0
  63. package/src/components/Icon/ArrowRightIcon.tsx +31 -0
  64. package/src/components/Icon/common.ts +10 -0
  65. package/src/components/Icon/index.ts +1 -0
  66. package/src/components/Icon/types.tsx +1 -0
  67. package/src/components/LiquiditySourceList/LiquiditySourceList.tsx +81 -27
  68. package/src/components/LiquiditySourcesSelector/LiquiditySourcesSelector.tsx +15 -10
  69. package/src/components/Modal/Modal.tsx +1 -6
  70. package/src/components/SecondaryPage/SecondaryPage.tsx +26 -52
  71. package/src/components/SelectableWalletList/SelectableWalletList.tsx +7 -1
  72. package/src/components/SelectableWalletList/mock.ts +4 -3
  73. package/src/components/Settings/Settings.tsx +34 -14
  74. package/src/components/StatusDrawer/StatusDrawer.tsx +1 -0
  75. package/src/components/StepDetail/StepDetail.tsx +46 -12
  76. package/src/components/SwapContainer/SwapContainer.tsx +21 -17
  77. package/src/components/SwapDetail/SwapDetail.tsx +71 -117
  78. package/src/components/SwapDetail/Token.tsx +73 -0
  79. package/src/components/SwapDetail/mock.ts +1 -0
  80. package/src/components/TextField/TextField.tsx +9 -0
  81. package/src/components/TokenList/TokenItem.tsx +12 -6
  82. package/src/components/TokenList/TokenList.tsx +18 -21
  83. package/src/components/TokenSelector/TokenSelector.tsx +38 -25
  84. package/src/components/Typography/Typography.tsx +8 -0
  85. package/src/components/Wallet/Wallet.tsx +9 -6
  86. package/src/components/common/Image.tsx +27 -0
  87. package/src/components/common/index.ts +1 -0
  88. package/src/components/index.ts +2 -0
  89. package/src/containers/ConfirmSwap/ConfirmSwap.stories.tsx +11 -2
  90. package/src/containers/ConfirmSwap/ConfirmSwap.tsx +111 -125
  91. package/src/containers/ConfirmSwap/mock.ts +79 -2
  92. package/src/containers/History/History.tsx +33 -57
  93. package/src/containers/History/SwapsGroup.tsx +59 -0
  94. package/src/containers/History/index.ts +1 -0
  95. package/src/containers/History/mock.ts +1 -0
  96. package/src/containers/History/types.tsx +2 -30
  97. package/src/containers/SwapHistory/SwapHistory.tsx +306 -177
  98. package/src/containers/SwapHistory/SwapMessages.tsx +116 -0
  99. package/src/containers/SwapHistory/mock.ts +1 -0
  100. package/src/containers/index.ts +0 -1
  101. package/src/helper/index.ts +31 -2
  102. package/src/types/meta.ts +2 -0
  103. package/dist/containers/ConfirmWallets/ConfirmWallets.d.ts +0 -16
  104. package/dist/containers/ConfirmWallets/ConfirmWallets.stories.d.ts +0 -6
  105. package/dist/containers/ConfirmWallets/index.d.ts +0 -1
  106. package/dist/containers/ConfirmWallets/mock.d.ts +0 -5
  107. package/dist/helper/swaps.d.ts +0 -5
  108. package/src/containers/ConfirmWallets/ConfirmWallets.stories.tsx +0 -26
  109. package/src/containers/ConfirmWallets/ConfirmWallets.tsx +0 -143
  110. package/src/containers/ConfirmWallets/index.ts +0 -1
  111. package/src/containers/ConfirmWallets/mock.ts +0 -222
  112. 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 as Arrow$1 } from '@radix-ui/react-tooltip';
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() {
@@ -218,6 +218,11 @@ var SvgWithStrokeColor = /*#__PURE__*/styled('svg', {
218
218
  }, _white["." + darkTheme + " &"] = {
219
219
  $$color: '$colors$foreground'
220
220
  }, _white.stroke = '$$color', _white)
221
+ },
222
+ disabled: {
223
+ "true": {
224
+ stroke: '$neutrals400'
225
+ }
221
226
  }
222
227
  }
223
228
  });
@@ -247,6 +252,11 @@ var SvgWithFillColor = /*#__PURE__*/styled('svg', {
247
252
  }, _white2["." + darkTheme + " &"] = {
248
253
  $$color: '$colors$foreground'
249
254
  }, _white2.fill = '$$color', _white2)
255
+ },
256
+ disabled: {
257
+ "true": {
258
+ stroke: '$neutrals400'
259
+ }
250
260
  }
251
261
  }
252
262
  });
@@ -864,11 +874,42 @@ ChevronRightIcon.toString = function () {
864
874
  };
865
875
 
866
876
  var _excluded$m = ["size", "color"];
867
- var RetryRightIcon = function RetryRightIcon(_ref) {
877
+ var ArrowRightIcon = function ArrowRightIcon(_ref) {
868
878
  var _ref$size = _ref.size,
869
879
  size = _ref$size === void 0 ? 16 : _ref$size,
870
880
  color = _ref.color,
871
881
  props = _objectWithoutPropertiesLoose(_ref, _excluded$m);
882
+ return createElement(SvgWithStrokeColor, Object.assign({
883
+ width: size,
884
+ height: size,
885
+ viewBox: "0 0 24 24",
886
+ color: color,
887
+ fill: "none",
888
+ stroke: "currentColor",
889
+ "stroke-width": "2",
890
+ "stroke-linecap": "round",
891
+ "stroke-linejoin": "round",
892
+ xmlns: "http://www.w3.org/2000/svg",
893
+ className: "_icon"
894
+ }, props), createElement("line", {
895
+ x1: "5",
896
+ y1: "12",
897
+ x2: "19",
898
+ y2: "12"
899
+ }), createElement("polyline", {
900
+ points: "12 5 19 12 12 19"
901
+ }));
902
+ };
903
+ ArrowRightIcon.toString = function () {
904
+ return '._icon';
905
+ };
906
+
907
+ var _excluded$n = ["size", "color"];
908
+ var RetryRightIcon = function RetryRightIcon(_ref) {
909
+ var _ref$size = _ref.size,
910
+ size = _ref$size === void 0 ? 16 : _ref$size,
911
+ color = _ref.color,
912
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$n);
872
913
  return createElement(SvgWithStrokeColor, Object.assign({
873
914
  width: size,
874
915
  height: size,
@@ -888,12 +929,12 @@ RetryRightIcon.toString = function () {
888
929
  return '._icon';
889
930
  };
890
931
 
891
- var _excluded$n = ["size", "color"];
932
+ var _excluded$o = ["size", "color"];
892
933
  var RetryLeftIcon = function RetryLeftIcon(_ref) {
893
934
  var _ref$size = _ref.size,
894
935
  size = _ref$size === void 0 ? 16 : _ref$size,
895
936
  color = _ref.color,
896
- props = _objectWithoutPropertiesLoose(_ref, _excluded$n);
937
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$o);
897
938
  return createElement(SvgWithStrokeColor, Object.assign({
898
939
  width: size,
899
940
  height: size,
@@ -913,12 +954,12 @@ RetryLeftIcon.toString = function () {
913
954
  return '._icon';
914
955
  };
915
956
 
916
- var _excluded$o = ["size", "color"];
957
+ var _excluded$p = ["size", "color"];
917
958
  var TryAgainIcon = function TryAgainIcon(_ref) {
918
959
  var _ref$size = _ref.size,
919
960
  size = _ref$size === void 0 ? 16 : _ref$size,
920
961
  color = _ref.color,
921
- props = _objectWithoutPropertiesLoose(_ref, _excluded$o);
962
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$p);
922
963
  return createElement(SvgWithStrokeColor, Object.assign({
923
964
  width: size,
924
965
  height: size,
@@ -938,12 +979,12 @@ TryAgainIcon.toString = function () {
938
979
  return '._icon';
939
980
  };
940
981
 
941
- var _excluded$p = ["size", "color"];
982
+ var _excluded$q = ["size", "color"];
942
983
  var VerticalSwapIcon = function VerticalSwapIcon(_ref) {
943
984
  var _ref$size = _ref.size,
944
985
  size = _ref$size === void 0 ? 16 : _ref$size,
945
986
  color = _ref.color,
946
- props = _objectWithoutPropertiesLoose(_ref, _excluded$p);
987
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
947
988
  return createElement(SvgWithStrokeColor, Object.assign({
948
989
  width: size,
949
990
  height: size,
@@ -969,12 +1010,12 @@ VerticalSwapIcon.toString = function () {
969
1010
  return '._icon';
970
1011
  };
971
1012
 
972
- var _excluded$q = ["size", "color"];
1013
+ var _excluded$r = ["size", "color"];
973
1014
  var HorizontalSwapIcon = function HorizontalSwapIcon(_ref) {
974
1015
  var _ref$size = _ref.size,
975
1016
  size = _ref$size === void 0 ? 16 : _ref$size,
976
1017
  color = _ref.color,
977
- props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
1018
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$r);
978
1019
  return createElement(SvgWithStrokeColor, Object.assign({
979
1020
  width: size,
980
1021
  height: size,
@@ -1000,13 +1041,13 @@ HorizontalSwapIcon.toString = function () {
1000
1041
  return '._icon';
1001
1042
  };
1002
1043
 
1003
- var _excluded$r = ["color", "size"];
1044
+ var _excluded$s = ["color", "size"];
1004
1045
  var RetryIcon = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
1005
1046
  var _ref$color = _ref.color,
1006
1047
  color = _ref$color === void 0 ? 'black' : _ref$color,
1007
1048
  _ref$size = _ref.size,
1008
1049
  size = _ref$size === void 0 ? 16 : _ref$size,
1009
- props = _objectWithoutPropertiesLoose(_ref, _excluded$r);
1050
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
1010
1051
  return createElement(SvgWithStrokeColor, Object.assign({
1011
1052
  xmlns: "http://www.w3.org/2000/svg",
1012
1053
  width: size,
@@ -1031,12 +1072,12 @@ RetryIcon.toString = function () {
1031
1072
  return '._icon';
1032
1073
  };
1033
1074
 
1034
- var _excluded$s = ["size", "color"];
1075
+ var _excluded$t = ["size", "color"];
1035
1076
  var WalletIcon = function WalletIcon(_ref) {
1036
1077
  var _ref$size = _ref.size,
1037
1078
  size = _ref$size === void 0 ? 16 : _ref$size,
1038
1079
  color = _ref.color,
1039
- props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
1080
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$t);
1040
1081
  return createElement(SvgWithFillColor, Object.assign({
1041
1082
  width: size,
1042
1083
  height: size,
@@ -1063,12 +1104,12 @@ WalletIcon.toString = function () {
1063
1104
  return '._icon';
1064
1105
  };
1065
1106
 
1066
- var _excluded$t = ["size", "color"];
1107
+ var _excluded$u = ["size", "color"];
1067
1108
  var AddWalletIcon = function AddWalletIcon(_ref) {
1068
1109
  var _ref$size = _ref.size,
1069
1110
  size = _ref$size === void 0 ? 16 : _ref$size,
1070
1111
  color = _ref.color,
1071
- props = _objectWithoutPropertiesLoose(_ref, _excluded$t);
1112
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$u);
1072
1113
  return createElement(SvgWithFillColor, Object.assign({
1073
1114
  width: size,
1074
1115
  height: size,
@@ -1103,12 +1144,12 @@ AddWalletIcon.toString = function () {
1103
1144
  return '._icon';
1104
1145
  };
1105
1146
 
1106
- var _excluded$u = ["size", "color"];
1147
+ var _excluded$v = ["size", "color"];
1107
1148
  var DeleteWalletIcon = function DeleteWalletIcon(_ref) {
1108
1149
  var _ref$size = _ref.size,
1109
1150
  size = _ref$size === void 0 ? 16 : _ref$size,
1110
1151
  color = _ref.color,
1111
- props = _objectWithoutPropertiesLoose(_ref, _excluded$u);
1152
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$v);
1112
1153
  return createElement(SvgWithFillColor, Object.assign({
1113
1154
  width: size,
1114
1155
  height: size,
@@ -1143,12 +1184,12 @@ DeleteWalletIcon.toString = function () {
1143
1184
  return '._icon';
1144
1185
  };
1145
1186
 
1146
- var _excluded$v = ["size", "color"];
1187
+ var _excluded$w = ["size", "color"];
1147
1188
  var CheckWalletIcon = function CheckWalletIcon(_ref) {
1148
1189
  var _ref$size = _ref.size,
1149
1190
  size = _ref$size === void 0 ? 16 : _ref$size,
1150
1191
  color = _ref.color,
1151
- props = _objectWithoutPropertiesLoose(_ref, _excluded$v);
1192
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$w);
1152
1193
  return createElement(SvgWithFillColor, Object.assign({
1153
1194
  width: size,
1154
1195
  height: size,
@@ -1179,12 +1220,12 @@ CheckWalletIcon.toString = function () {
1179
1220
  return '._icon';
1180
1221
  };
1181
1222
 
1182
- var _excluded$w = ["size", "color"];
1223
+ var _excluded$x = ["size", "color"];
1183
1224
  var SwapWalletIcon = function SwapWalletIcon(_ref) {
1184
1225
  var _ref$size = _ref.size,
1185
1226
  size = _ref$size === void 0 ? 16 : _ref$size,
1186
1227
  color = _ref.color,
1187
- props = _objectWithoutPropertiesLoose(_ref, _excluded$w);
1228
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$x);
1188
1229
  return createElement(SvgWithFillColor, Object.assign({
1189
1230
  width: size,
1190
1231
  height: size,
@@ -1219,13 +1260,13 @@ SwapWalletIcon.toString = function () {
1219
1260
  return '._icon';
1220
1261
  };
1221
1262
 
1222
- var _excluded$x = ["color", "size"];
1263
+ var _excluded$y = ["color", "size"];
1223
1264
  var DisconnectIcon = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
1224
1265
  var _ref$color = _ref.color,
1225
1266
  color = _ref$color === void 0 ? 'black' : _ref$color,
1226
1267
  _ref$size = _ref.size,
1227
1268
  size = _ref$size === void 0 ? 16 : _ref$size,
1228
- props = _objectWithoutPropertiesLoose(_ref, _excluded$x);
1269
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$y);
1229
1270
  return createElement(SvgWithStrokeColor, Object.assign({
1230
1271
  xmlns: "http://www.w3.org/2000/svg",
1231
1272
  width: size,
@@ -1255,12 +1296,12 @@ DisconnectIcon.toString = function () {
1255
1296
  return '._icon';
1256
1297
  };
1257
1298
 
1258
- var _excluded$y = ["size", "color"];
1299
+ var _excluded$z = ["size", "color"];
1259
1300
  var BagIcon = function BagIcon(_ref) {
1260
1301
  var _ref$size = _ref.size,
1261
1302
  size = _ref$size === void 0 ? 16 : _ref$size,
1262
1303
  color = _ref.color,
1263
- props = _objectWithoutPropertiesLoose(_ref, _excluded$y);
1304
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$z);
1264
1305
  return createElement(SvgWithStrokeColor, Object.assign({
1265
1306
  width: size,
1266
1307
  height: size,
@@ -1290,11 +1331,11 @@ BagIcon.toString = function () {
1290
1331
  return '._icon';
1291
1332
  };
1292
1333
 
1293
- var _excluded$z = ["size"];
1334
+ var _excluded$A = ["size"];
1294
1335
  var TimeIcon = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
1295
1336
  var _ref$size = _ref.size,
1296
1337
  size = _ref$size === void 0 ? 16 : _ref$size,
1297
- props = _objectWithoutPropertiesLoose(_ref, _excluded$z);
1338
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$A);
1298
1339
  return createElement(SvgWithStrokeColor, Object.assign({
1299
1340
  width: size,
1300
1341
  height: size,
@@ -1327,12 +1368,12 @@ CloseIcon.toString = function () {
1327
1368
  return '._icon';
1328
1369
  };
1329
1370
 
1330
- var _excluded$A = ["size", "color"];
1371
+ var _excluded$B = ["size", "color"];
1331
1372
  var SignatureIcon = function SignatureIcon(_ref) {
1332
1373
  var _ref$size = _ref.size,
1333
1374
  size = _ref$size === void 0 ? 16 : _ref$size,
1334
1375
  color = _ref.color,
1335
- props = _objectWithoutPropertiesLoose(_ref, _excluded$A);
1376
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$B);
1336
1377
  return createElement(SvgWithFillColor, Object.assign({
1337
1378
  width: size,
1338
1379
  height: size,
@@ -1353,12 +1394,12 @@ SignatureIcon.toString = function () {
1353
1394
  return '._icon';
1354
1395
  };
1355
1396
 
1356
- var _excluded$B = ["size", "color"];
1397
+ var _excluded$C = ["size", "color"];
1357
1398
  var CopyIcon = function CopyIcon(_ref) {
1358
1399
  var _ref$size = _ref.size,
1359
1400
  size = _ref$size === void 0 ? 16 : _ref$size,
1360
1401
  color = _ref.color,
1361
- props = _objectWithoutPropertiesLoose(_ref, _excluded$B);
1402
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$C);
1362
1403
  return createElement(SvgWithFillColor, Object.assign({
1363
1404
  width: size,
1364
1405
  height: size,
@@ -1384,7 +1425,7 @@ CopyIcon.toString = function () {
1384
1425
  return '._icon';
1385
1426
  };
1386
1427
 
1387
- var _excluded$C = ["children", "className", "color"];
1428
+ var _excluded$D = ["children", "className", "color"];
1388
1429
  var TypographyContainer = /*#__PURE__*/styled('span', {
1389
1430
  margin: 0,
1390
1431
  display: 'inline-block',
@@ -1444,6 +1485,13 @@ var TypographyContainer = /*#__PURE__*/styled('span', {
1444
1485
  fontSize: '$18'
1445
1486
  }
1446
1487
  },
1488
+ title: {
1489
+ fontSize: '$14',
1490
+ fontWeight: '$500',
1491
+ '@md': {
1492
+ fontSize: '$15'
1493
+ }
1494
+ },
1447
1495
  body1: {
1448
1496
  fontSize: '$14',
1449
1497
  fontWeight: '$400',
@@ -1551,7 +1599,7 @@ function Typography(_ref) {
1551
1599
  var children = _ref.children,
1552
1600
  className = _ref.className,
1553
1601
  color = _ref.color,
1554
- props = _objectWithoutPropertiesLoose(_ref, _excluded$C);
1602
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$D);
1555
1603
  var customCss = color ? {
1556
1604
  color: color.startsWith('$') ? color : "$" + color
1557
1605
  } : {
@@ -1611,6 +1659,14 @@ var StepContainer = /*#__PURE__*/styled('div', {
1611
1659
  textAlign: 'center',
1612
1660
  justifyContent: 'center'
1613
1661
  }
1662
+ },
1663
+ success: {
1664
+ "true": {
1665
+ filter: 'none'
1666
+ },
1667
+ "false": {
1668
+ filter: 'grayscale(100%)'
1669
+ }
1614
1670
  }
1615
1671
  }
1616
1672
  });
@@ -1630,18 +1686,24 @@ var Detail = /*#__PURE__*/styled('div', {
1630
1686
  }
1631
1687
  });
1632
1688
  var SubTitle = /*#__PURE__*/styled(Typography, {
1633
- color: '$neutrals600'
1634
- });
1635
- function StepDetail(_ref) {
1636
- var logo = _ref.logo,
1637
- chainLogo = _ref.chainLogo,
1638
- amount = _ref.amount,
1639
- symbol = _ref.symbol,
1640
- blockchain = _ref.blockchain,
1641
- _ref$direction = _ref.direction,
1642
- direction = _ref$direction === void 0 ? 'horizontal' : _ref$direction;
1689
+ color: '$neutrals600',
1690
+ display: 'block',
1691
+ paddingLeft: '$8'
1692
+ });
1693
+ function StepDetail(props) {
1694
+ var logo = props.logo,
1695
+ chainLogo = props.chainLogo,
1696
+ amount = props.amount,
1697
+ symbol = props.symbol,
1698
+ blockchain = props.blockchain,
1699
+ estimatedAmount = props.estimatedAmount,
1700
+ _props$success = props.success,
1701
+ success = _props$success === void 0 ? true : _props$success,
1702
+ _props$direction = props.direction,
1703
+ direction = _props$direction === void 0 ? 'horizontal' : _props$direction;
1643
1704
  return React__default.createElement(StepContainer, {
1644
- direction: direction
1705
+ direction: direction,
1706
+ success: success
1645
1707
  }, React__default.createElement(StepLogoContainer, {
1646
1708
  direction: direction
1647
1709
  }, React__default.createElement(Logo, {
@@ -1652,13 +1714,20 @@ function StepDetail(_ref) {
1652
1714
  alt: blockchain
1653
1715
  }))), React__default.createElement(Detail, {
1654
1716
  pl: direction === 'horizontal'
1655
- }, React__default.createElement(Typography, {
1717
+ }, amount && React__default.createElement(Typography, {
1656
1718
  noWrap: true,
1657
- variant: direction === 'vertical' ? 'body2' : 'h6'
1658
- }, amount ? parseFloat(amount).toFixed(2) : '?', " ", symbol), React__default.createElement(SubTitle, {
1719
+ variant: direction === 'vertical' ? 'body2' : 'title'
1720
+ }, amount), !amount && estimatedAmount && React__default.createElement(Typography, {
1721
+ noWrap: true,
1722
+ variant: direction === 'vertical' ? 'body2' : 'title',
1723
+ color: '$neutrals600'
1724
+ }, estimatedAmount), "\xA0", React__default.createElement(Typography, {
1725
+ variant: direction === 'vertical' ? 'body2' : 'title',
1726
+ noWrap: true
1727
+ }, symbol), React__default.createElement(SubTitle, {
1659
1728
  noWrap: true,
1660
1729
  variant: "caption",
1661
- color: "neutrals800"
1730
+ color: "$neutrals800"
1662
1731
  }, "on ", blockchain)));
1663
1732
  }
1664
1733
 
@@ -1832,7 +1901,7 @@ var TooltipContent = /*#__PURE__*/styled(Content$1, {
1832
1901
  }
1833
1902
  }
1834
1903
  });
1835
- var TooltipArrow = /*#__PURE__*/styled(Arrow$1, {
1904
+ var TooltipArrow = /*#__PURE__*/styled(Arrow, {
1836
1905
  variants: {
1837
1906
  color: {
1838
1907
  primary: {
@@ -1880,6 +1949,37 @@ function Tooltip(_ref) {
1880
1949
  })))));
1881
1950
  }
1882
1951
 
1952
+ var FilledCircle = /*#__PURE__*/styled('span', {
1953
+ width: '10px',
1954
+ height: '10px',
1955
+ backgroundColor: '$primary',
1956
+ borderRadius: '99999px'
1957
+ });
1958
+
1959
+ var _excluded$E = ["size"];
1960
+ var ImageContainer = /*#__PURE__*/styled('div', {
1961
+ display: 'flex',
1962
+ justifyContent: 'center',
1963
+ alignItems: 'center',
1964
+ '.image': {
1965
+ width: '100%',
1966
+ height: '100%',
1967
+ objectFit: 'contain'
1968
+ }
1969
+ });
1970
+ function Image(props) {
1971
+ var size = props.size,
1972
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$E);
1973
+ return React__default.createElement(ImageContainer, {
1974
+ css: {
1975
+ width: size + 'px',
1976
+ height: size + 'px'
1977
+ }
1978
+ }, React__default.createElement("img", Object.assign({
1979
+ className: "image"
1980
+ }, otherProps)));
1981
+ }
1982
+
1883
1983
  var Container = /*#__PURE__*/styled('div', {
1884
1984
  borderRadius: '$5',
1885
1985
  border: '1px solid $neutrals300',
@@ -1917,10 +2017,6 @@ var HR = /*#__PURE__*/styled('hr', {
1917
2017
  border: '1px solid $neutrals400',
1918
2018
  margin: '$8 0'
1919
2019
  });
1920
- var SwapperLogo = /*#__PURE__*/styled('img', {
1921
- width: '$16',
1922
- height: '$16'
1923
- });
1924
2020
  var RelativeContainer = /*#__PURE__*/styled('div', {
1925
2021
  position: 'relative'
1926
2022
  });
@@ -2052,9 +2148,10 @@ function BestRoute(props) {
2052
2148
  chainLogo: swap.from.blockchainLogo,
2053
2149
  blockchain: swap.from.blockchain,
2054
2150
  amount: swap.fromAmount
2055
- }), React__default.createElement(Dot, null)), React__default.createElement(SwapperContainer, null, React__default.createElement(Line, null), React__default.createElement(SwapperLogo, {
2151
+ }), React__default.createElement(Dot, null)), React__default.createElement(SwapperContainer, null, React__default.createElement(Line, null), React__default.createElement(Image, {
2056
2152
  src: swap.swapperLogo,
2057
- alt: swap.swapperId
2153
+ alt: swap.swapperId,
2154
+ size: 20
2058
2155
  }), React__default.createElement(Line, null)), index + 1 === ((_data$result2 = data.result) == null ? void 0 : _data$result2.swaps.length) && React__default.createElement(ArrowRight, null), React__default.createElement(StepDetail, {
2059
2156
  direction: "vertical",
2060
2157
  logo: swap.to.logo,
@@ -2068,7 +2165,7 @@ function BestRoute(props) {
2068
2165
  }, "No routes found")));
2069
2166
  }
2070
2167
 
2071
- var _excluded$D = ["children", "loading", "disabled", "prefix", "suffix", "align", "flexContent"];
2168
+ var _excluded$F = ["children", "loading", "disabled", "prefix", "suffix", "align", "flexContent"];
2072
2169
  var _ghost, _css, _css2, _css3;
2073
2170
  var ButtonContainer = /*#__PURE__*/styled('button', {
2074
2171
  borderRadius: '$5',
@@ -2097,6 +2194,7 @@ var ButtonContainer = /*#__PURE__*/styled('button', {
2097
2194
  },
2098
2195
  size: {
2099
2196
  compact: {},
2197
+ free: {},
2100
2198
  small: {
2101
2199
  height: '$32'
2102
2200
  },
@@ -2412,7 +2510,7 @@ function Button(_ref) {
2412
2510
  suffix = _ref.suffix,
2413
2511
  align = _ref.align,
2414
2512
  flexContent = _ref.flexContent,
2415
- props = _objectWithoutPropertiesLoose(_ref, _excluded$D);
2513
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$F);
2416
2514
  var isDisabled = loading || disabled;
2417
2515
  return React__default.createElement(ButtonContainer, Object.assign({
2418
2516
  disabled: isDisabled
@@ -2430,13 +2528,6 @@ function Button(_ref) {
2430
2528
  }), suffix);
2431
2529
  }
2432
2530
 
2433
- var FilledCircle = /*#__PURE__*/styled('span', {
2434
- width: '10px',
2435
- height: '10px',
2436
- backgroundColor: '$primary',
2437
- borderRadius: '99999px'
2438
- });
2439
-
2440
2531
  var ListContainer = /*#__PURE__*/styled('div', {
2441
2532
  display: 'grid',
2442
2533
  gap: '.5rem',
@@ -2445,10 +2536,8 @@ var ListContainer = /*#__PURE__*/styled('div', {
2445
2536
  width: '100%',
2446
2537
  height: '100%'
2447
2538
  });
2448
- var Image = /*#__PURE__*/styled('img', {
2449
- width: '1.5rem',
2450
- maxHeight: '1.5rem',
2451
- marginRight: '$4'
2539
+ var ImageContainer$1 = /*#__PURE__*/styled('div', {
2540
+ paddingRight: '$4'
2452
2541
  });
2453
2542
  function BlockchainsList(props) {
2454
2543
  var list = props.list,
@@ -2475,9 +2564,10 @@ function BlockchainsList(props) {
2475
2564
  type: isSelect(blockchain.name) ? 'primary' : undefined,
2476
2565
  variant: "outlined",
2477
2566
  size: "large",
2478
- prefix: React__default.createElement(Image, {
2567
+ prefix: React__default.createElement(ImageContainer$1, null, React__default.createElement(Image, {
2568
+ size: 24,
2479
2569
  src: blockchain.logo
2480
- }),
2570
+ })),
2481
2571
  suffix: isSelect(blockchain.name) ? React__default.createElement(FilledCircle, null) : undefined,
2482
2572
  align: "start",
2483
2573
  onClick: changeSelectedBlockchain.bind(null, blockchain),
@@ -2488,9 +2578,70 @@ function BlockchainsList(props) {
2488
2578
  }));
2489
2579
  }
2490
2580
 
2491
- var _excluded$E = ["label", "prefix", "suffix", "children", "size", "style"];
2581
+ var DividerContainer = /*#__PURE__*/styled('div', {
2582
+ variants: {
2583
+ size: {
2584
+ 4: {
2585
+ height: '$4'
2586
+ },
2587
+ 8: {
2588
+ height: '$8'
2589
+ },
2590
+ 12: {
2591
+ height: '$12'
2592
+ },
2593
+ 16: {
2594
+ height: '$16'
2595
+ },
2596
+ 18: {
2597
+ height: '$18'
2598
+ },
2599
+ 20: {
2600
+ height: '$20'
2601
+ },
2602
+ 24: {
2603
+ height: '$24'
2604
+ },
2605
+ 32: {
2606
+ height: '$32'
2607
+ }
2608
+ }
2609
+ }
2610
+ });
2611
+ function Divider(_ref) {
2612
+ var _ref$size = _ref.size,
2613
+ size = _ref$size === void 0 ? 12 : _ref$size;
2614
+ return React__default.createElement(DividerContainer, {
2615
+ size: size
2616
+ });
2617
+ }
2618
+
2619
+ var HeaderContainer = /*#__PURE__*/styled('div', {
2620
+ display: 'flex',
2621
+ justifyContent: 'space-between',
2622
+ alignItems: 'center',
2623
+ padding: '$8 0',
2624
+ position: 'relative'
2625
+ });
2626
+ var BackButton = /*#__PURE__*/styled(Button, {
2627
+ padding: '$8'
2628
+ });
2629
+ function Header(props) {
2630
+ return React__default.createElement(HeaderContainer, null, props.onBack ? React__default.createElement(BackButton, {
2631
+ variant: "ghost",
2632
+ size: "small",
2633
+ onClick: props.onBack
2634
+ }, React__default.createElement(AngleLeftIcon, {
2635
+ size: 24
2636
+ })) : null, props.prefix, React__default.createElement(Typography, {
2637
+ variant: "h4"
2638
+ }, props.title), props.suffix || React__default.createElement("div", null));
2639
+ }
2640
+
2641
+ var _excluded$G = ["label", "prefix", "suffix", "children", "size", "style"];
2492
2642
  var InputContainer = /*#__PURE__*/styled('div', {
2493
2643
  backgroundColor: '$background',
2644
+ padding: '1px',
2494
2645
  boxSizing: 'border-box',
2495
2646
  border: '1px solid $neutrals400',
2496
2647
  borderRadius: '$5',
@@ -2500,6 +2651,7 @@ var InputContainer = /*#__PURE__*/styled('div', {
2500
2651
  position: 'relative',
2501
2652
  alignItems: 'center',
2502
2653
  color: '$foreground',
2654
+ overflowX: 'hidden',
2503
2655
  transition: 'border-color ease .3s',
2504
2656
  '&:focus-within': {
2505
2657
  borderColor: '$success',
@@ -2560,6 +2712,13 @@ var Input = /*#__PURE__*/styled('input', {
2560
2712
  margin: 0,
2561
2713
  '&:disabled': {
2562
2714
  cursor: 'not-allowed'
2715
+ },
2716
+ '&::-webkit-outer-spin-button, &::-webkit-inner-spin-button': {
2717
+ '-webkit-appearance': 'none',
2718
+ margin: 0
2719
+ },
2720
+ '&[type="number"]': {
2721
+ '-moz-appearance': 'textfield'
2563
2722
  }
2564
2723
  });
2565
2724
  var Label = /*#__PURE__*/styled('label', {
@@ -2574,7 +2733,7 @@ var TextField = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
2574
2733
  suffix = props.suffix,
2575
2734
  size = props.size,
2576
2735
  style = props.style,
2577
- inputAttributes = _objectWithoutPropertiesLoose(props, _excluded$E);
2736
+ inputAttributes = _objectWithoutPropertiesLoose(props, _excluded$G);
2578
2737
  return React__default.createElement(React__default.Fragment, null, label && React__default.createElement(Label, Object.assign({
2579
2738
  className: "_text"
2580
2739
  }, inputAttributes.id && {
@@ -2594,36 +2753,15 @@ var TextField = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
2594
2753
  })), suffix || null));
2595
2754
  });
2596
2755
 
2597
- var Container$1 = /*#__PURE__*/styled('div', {
2756
+ var ContentContainer = /*#__PURE__*/styled('div', {
2757
+ overflow: 'hidden',
2598
2758
  display: 'flex',
2599
2759
  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
2760
  flex: '1',
2624
- overflowY: 'auto',
2625
- overflowX: 'hidden',
2626
- marginTop: '$16'
2761
+ padding: '0 $4'
2762
+ });
2763
+ var TextFieldContainer = /*#__PURE__*/styled('div', {
2764
+ padding: '1px'
2627
2765
  });
2628
2766
  function SecondaryPage(props) {
2629
2767
  var title = props.title,
@@ -2635,12 +2773,11 @@ function SecondaryPage(props) {
2635
2773
  var _useState = useState(''),
2636
2774
  searchedFor = _useState[0],
2637
2775
  setSearchedFor = _useState[1];
2638
- return React__default.createElement(Container$1, null, hasHeader && React__default.createElement(HeaderContainer, null, React__default.createElement(StyledBackIcon, {
2639
- size: 24,
2640
- onClick: onBack
2641
- }), React__default.createElement(Typography, {
2642
- variant: "h4"
2643
- }, title), TopButton), props.textField && React__default.createElement("div", null, React__default.createElement(TextField, {
2776
+ return React__default.createElement(React__default.Fragment, null, hasHeader && React__default.createElement(Header, {
2777
+ onBack: onBack,
2778
+ title: title || '',
2779
+ suffix: TopButton
2780
+ }), React__default.createElement(ContentContainer, null, props.textField && React__default.createElement(TextFieldContainer, null, React__default.createElement(TextField, {
2644
2781
  size: "large",
2645
2782
  prefix: React__default.createElement(SearchIcon, {
2646
2783
  size: 24
@@ -2651,7 +2788,38 @@ function SecondaryPage(props) {
2651
2788
  },
2652
2789
  value: searchedFor,
2653
2790
  autoFocus: true
2654
- })), React__default.createElement(ContentContainer, null, props.textField && (props.children == null ? void 0 : props.children(searchedFor)), !props.textField && props.children), Footer);
2791
+ }), React__default.createElement(Divider, {
2792
+ size: 16
2793
+ })), props.textField && (props.children == null ? void 0 : props.children(searchedFor)), !props.textField && props.children), Footer);
2794
+ }
2795
+
2796
+ function containsText(text, searchText) {
2797
+ return text.toLowerCase().indexOf(searchText.toLowerCase()) > -1;
2798
+ }
2799
+ function getConciseAddress(address, maxChars, ellipsisLength) {
2800
+ if (maxChars === void 0) {
2801
+ maxChars = 8;
2802
+ }
2803
+ if (ellipsisLength === void 0) {
2804
+ ellipsisLength = 3;
2805
+ }
2806
+ if (!address) return null;
2807
+ if (address.length < 2 * maxChars + ellipsisLength) return address;
2808
+ var start = Math.ceil((address.length - maxChars) / 2);
2809
+ var end = address.length - maxChars;
2810
+ return "" + address.substr(start, maxChars) + '.'.repeat(ellipsisLength) + address.substr(end);
2811
+ }
2812
+ function limitDecimalPlaces(numberString, maxDecimalPlaces) {
2813
+ if (maxDecimalPlaces === void 0) {
2814
+ maxDecimalPlaces = 4;
2815
+ }
2816
+ var number = parseFloat(numberString);
2817
+ if (isNaN(number)) return numberString; // Return the original string if it's not a valid number
2818
+ else {
2819
+ var multiplier = Math.pow(10, maxDecimalPlaces);
2820
+ var roundedNumber = Math.round(number * multiplier) / multiplier;
2821
+ return roundedNumber.toString();
2822
+ }
2655
2823
  }
2656
2824
 
2657
2825
  var SpacerContainer = /*#__PURE__*/styled('div', {
@@ -2789,7 +2957,7 @@ var MainContainer = /*#__PURE__*/styled('div', {
2789
2957
  color: '$primary200'
2790
2958
  },
2791
2959
  secondary: {
2792
- color: '$secondary'
2960
+ color: '$foreground'
2793
2961
  },
2794
2962
  success: {
2795
2963
  color: '$success300'
@@ -2813,7 +2981,14 @@ function Alert(props) {
2813
2981
  className: showIcon ? 'hasIcon' : ''
2814
2982
  }, React__default.createElement("div", {
2815
2983
  className: "main"
2816
- }, showIcon && React__default.createElement(React__default.Fragment, null, type === 'success' && React__default.createElement(CheckCircleIcon, {
2984
+ }, showIcon && React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
2985
+ style: {
2986
+ width: '32px',
2987
+ display: 'flex',
2988
+ justifyContent: 'center',
2989
+ alignItems: 'center'
2990
+ }
2991
+ }, type === 'success' && React__default.createElement(CheckCircleIcon, {
2817
2992
  color: type,
2818
2993
  size: 24
2819
2994
  }), type === 'warning' && React__default.createElement(WarningIcon, {
@@ -2824,68 +2999,293 @@ function Alert(props) {
2824
2999
  size: 24
2825
3000
  }), React__default.createElement(Spacer, {
2826
3001
  size: 8
2827
- })), title && React__default.createElement(Typography, {
2828
- variant: "h6",
3002
+ }))), React__default.createElement("div", {
3003
+ style: {
3004
+ display: 'flex',
3005
+ justifyContent: 'center',
3006
+ alignItems: 'start',
3007
+ flexDirection: 'column',
3008
+ width: '100%'
3009
+ }
3010
+ }, title && React__default.createElement(React__default.Fragment, null, React__default.createElement(Typography, {
3011
+ className: "title",
3012
+ variant: "title",
2829
3013
  color: type
2830
- }, title), children), props.footer ? React__default.createElement("div", {
3014
+ }, title), !!children && React__default.createElement(Spacer, {
3015
+ size: 8,
3016
+ direction: "vertical"
3017
+ })), children)), props.footer ? React__default.createElement("div", {
2831
3018
  className: "footer"
2832
3019
  }, props.footer) : null);
2833
3020
  }
2834
3021
 
2835
- var containsText = function containsText(text, searchText) {
2836
- return text.toLowerCase().indexOf(searchText.toLowerCase()) > -1;
2837
- };
3022
+ function LoadingFailedAlert() {
3023
+ return React__default.createElement(Alert, {
3024
+ type: "error",
3025
+ title: " Error connecting server, please reload the app and try again."
3026
+ });
3027
+ }
2838
3028
 
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);
3029
+ function NotFoundAlert(props) {
3030
+ var catergory = props.catergory,
3031
+ searchedFor = props.searchedFor;
3032
+ return React__default.createElement(Alert, {
3033
+ type: "secondary",
3034
+ title: catergory + " " + (searchedFor ? "'" + searchedFor + "'" : '') + " not found."
2848
3035
  });
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",
3036
+ }
3037
+
3038
+ function VirtualizedList(props) {
3039
+ var itemCount = props.itemCount,
3040
+ hasNextPage = props.hasNextPage,
3041
+ loadNextPage = props.loadNextPage,
3042
+ Item = props.Item,
3043
+ innerElementType = props.innerElementType,
3044
+ size = props.size;
3045
+ var isItemLoaded = function isItemLoaded(index) {
3046
+ return !hasNextPage || index < itemCount;
3047
+ };
3048
+ return React__default.createElement(AutoSizer, null, function (_ref) {
3049
+ var width = _ref.width,
3050
+ height = _ref.height;
3051
+ return React__default.createElement(InfiniteLoader, {
3052
+ isItemLoaded: isItemLoaded,
3053
+ itemCount: hasNextPage ? itemCount + 1 : itemCount,
3054
+ loadMoreItems: loadNextPage,
3055
+ threshold: 1
3056
+ }, function (_ref2) {
3057
+ var onItemsRendered = _ref2.onItemsRendered,
3058
+ ref = _ref2.ref;
3059
+ return React__default.createElement(VariableSizeList, {
3060
+ innerElementType: innerElementType,
3061
+ ref: ref,
3062
+ itemSize: function itemSize() {
3063
+ return size;
3064
+ },
3065
+ itemCount: itemCount,
3066
+ height: height || 0,
3067
+ width: width || 0,
3068
+ onItemsRendered: onItemsRendered
3069
+ }, function (_ref3) {
3070
+ var index = _ref3.index,
3071
+ style = _ref3.style;
3072
+ return isItemLoaded(index) ? React__default.createElement(Item, {
3073
+ index: index,
3074
+ style: style
3075
+ }) : null;
3076
+ });
3077
+ });
3078
+ });
3079
+ }
3080
+
3081
+ var TokenImageContainer = /*#__PURE__*/styled('div', {
3082
+ paddingRight: '$16'
3083
+ });
3084
+ var TokenNameContainer = /*#__PURE__*/styled('div', {
3085
+ display: 'flex',
3086
+ flexDirection: 'column'
3087
+ });
3088
+ var TokenAmountContainer = /*#__PURE__*/styled('div', {
3089
+ display: 'flex',
3090
+ flexDirection: 'column',
3091
+ alignItems: 'flex-end'
3092
+ });
3093
+ function TokenItem(props) {
3094
+ var _token$balance;
3095
+ var token = props.token,
3096
+ style = props.style,
3097
+ onClick = props.onClick,
3098
+ selected = props.selected;
3099
+ return React__default.createElement("div", {
3100
+ style: _extends({
3101
+ display: 'flex',
3102
+ alignItems: 'center',
3103
+ width: '100%'
3104
+ }, style, {
3105
+ height: '48px',
3106
+ top: parseFloat(style == null ? void 0 : style.top) + 0 + "px",
3107
+ padding: '0 4px'
3108
+ })
3109
+ }, React__default.createElement(Button, {
3110
+ variant: "outlined",
3111
+ size: "large",
3112
+ align: "start",
3113
+ onClick: onClick.bind(null, token),
3114
+ type: selected ? 'primary' : undefined,
3115
+ prefix: React__default.createElement(TokenImageContainer, null, React__default.createElement(Image, {
3116
+ src: token.image,
3117
+ size: 32
3118
+ })),
3119
+ suffix: ((_token$balance = token.balance) == null ? void 0 : _token$balance.amount) && React__default.createElement(TokenAmountContainer, null, React__default.createElement(Typography, {
3120
+ variant: "body2"
3121
+ }, token.balance.amount), React__default.createElement(Typography, {
3122
+ variant: "caption"
3123
+ }, token.balance.usdValue + "$"))
3124
+ }, React__default.createElement(TokenNameContainer, null, React__default.createElement(Typography, {
3125
+ variant: "body1"
3126
+ }, token.symbol), React__default.createElement(Typography, {
3127
+ variant: "caption",
3128
+ color: "neutrals600"
3129
+ }, token.name))));
3130
+ }
3131
+
3132
+ var _excluded$H = ["style"];
3133
+ var PAGE_SIZE = 20;
3134
+ function TokenList(props) {
3135
+ var list = props.list,
3136
+ searchedText = props.searchedText,
3137
+ onChange = props.onChange,
3138
+ multiSelect = props.multiSelect,
3139
+ selectedList = props.selectedList;
3140
+ var _useState = useState(props.selected),
3141
+ selected = _useState[0],
3142
+ setSelected = _useState[1];
3143
+ var changeSelected = function changeSelected(token) {
3144
+ setSelected(token);
3145
+ onChange(token);
3146
+ };
3147
+ var isSelected = function isSelected(token) {
3148
+ if (multiSelect && selectedList) {
3149
+ return selectedList.map(function (item) {
3150
+ return item.symbol + item.address;
3151
+ }).indexOf(token.symbol + token.address) > -1;
3152
+ }
3153
+ return (selected == null ? void 0 : selected.symbol) === token.symbol && (selected == null ? void 0 : selected.address) === token.address;
3154
+ };
3155
+ var _useState2 = useState(true),
3156
+ hasNextPage = _useState2[0],
3157
+ setHasNextPage = _useState2[1];
3158
+ var _useState3 = useState(list),
3159
+ tokens = _useState3[0],
3160
+ setTokens = _useState3[1];
3161
+ var loadNextPage = function loadNextPage() {
3162
+ setTokens(list.slice(0, tokens.length + PAGE_SIZE));
3163
+ };
3164
+ useEffect(function () {
3165
+ setTokens(list.slice(0, PAGE_SIZE));
3166
+ }, [searchedText, list]);
3167
+ useEffect(function () {
3168
+ setHasNextPage(list.length > tokens.length);
3169
+ }, [tokens.length]);
3170
+ var innerElementType = forwardRef(function (_ref, ref) {
3171
+ var style = _ref.style,
3172
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$H);
3173
+ return React__default.createElement("div", Object.assign({
3174
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3175
+ ref: ref,
3176
+ style: _extends({}, style, {
3177
+ height: parseFloat(style == null ? void 0 : style.height) + 8 * 2 + "px"
3178
+ })
3179
+ }, rest));
3180
+ });
3181
+ return React__default.createElement(VirtualizedList, {
3182
+ Item: function Item(_ref2) {
3183
+ var index = _ref2.index,
3184
+ style = _ref2.style;
3185
+ return React__default.createElement(TokenItem, {
3186
+ token: tokens[index],
3187
+ style: style,
3188
+ onClick: changeSelected,
3189
+ selected: isSelected(tokens[index])
3190
+ });
3191
+ },
3192
+ hasNextPage: hasNextPage,
3193
+ itemCount: tokens.length,
3194
+ loadNextPage: loadNextPage,
3195
+ innerElementType: innerElementType,
3196
+ size: 56
3197
+ });
3198
+ }
3199
+
3200
+ var LoaderContainer = /*#__PURE__*/styled('div', {
3201
+ display: 'flex',
3202
+ justifyContent: 'center',
3203
+ width: '100%',
3204
+ paddingTop: '33%',
3205
+ flex: 1
3206
+ });
3207
+ var filterTokens = function filterTokens(list, searchedFor) {
3208
+ return list.filter(function (token) {
3209
+ return containsText(token.symbol, searchedFor) || containsText(token.address || '', searchedFor) || containsText(token.name || '', searchedFor);
3210
+ });
3211
+ };
3212
+ function TokenSelector(props) {
3213
+ var list = props.list,
3214
+ type = props.type,
3215
+ selected = props.selected,
3216
+ hasHeader = props.hasHeader,
3217
+ onChange = props.onChange,
3218
+ onBack = props.onBack,
3219
+ loadingStatus = props.loadingStatus;
3220
+ return React__default.createElement(SecondaryPage, {
3221
+ textField: true,
3222
+ hasHeader: hasHeader,
3223
+ title: "Select " + type + " Token",
3224
+ onBack: onBack,
3225
+ textFieldPlaceholder: "Search Token By Name"
3226
+ }, function (searchedFor) {
3227
+ var filteredTokens = filterTokens(list, searchedFor);
3228
+ return loadingStatus === 'loading' ? React__default.createElement(LoaderContainer, null, React__default.createElement(Spinner, {
3229
+ size: 24
3230
+ })) : loadingStatus === 'failed' ? React__default.createElement(LoadingFailedAlert, null) : filteredTokens.length ? React__default.createElement(TokenList, {
3231
+ searchedText: searchedFor,
3232
+ list: filteredTokens,
3233
+ selected: selected,
3234
+ onChange: onChange
3235
+ }) : React__default.createElement(NotFoundAlert, {
3236
+ catergory: "Token",
3237
+ searchedFor: searchedFor
3238
+ });
3239
+ });
3240
+ }
3241
+
3242
+ var ListContainer$1 = /*#__PURE__*/styled('div', {
3243
+ overflowY: 'auto',
3244
+ padding: '0 $4'
3245
+ });
3246
+ var filterBlockchains = function filterBlockchains(list, searchedFor) {
3247
+ return list.filter(function (blockchain) {
3248
+ return containsText(blockchain.name, searchedFor) || containsText(blockchain.displayName, searchedFor);
3249
+ });
3250
+ };
3251
+ function BlockchainSelector(props) {
3252
+ var type = props.type,
3253
+ list = props.list,
3254
+ onChange = props.onChange,
3255
+ selected = props.selected,
3256
+ onBack = props.onBack,
3257
+ loadingStatus = props.loadingStatus,
3258
+ hasHeader = props.hasHeader,
3259
+ listContainerStyle = props.listContainerStyle,
3260
+ multiSelect = props.multiSelect,
3261
+ selectedList = props.selectedList;
3262
+ return React__default.createElement(SecondaryPage, {
3263
+ textField: true,
3264
+ hasHeader: hasHeader,
3265
+ textFieldPlaceholder: "Search Blockchain By Name",
2865
3266
  title: "Select " + type + " Network",
2866
3267
  onBack: onBack
2867
3268
  }, function (searchedFor) {
2868
3269
  var filteredBlockchains = filterBlockchains(list, searchedFor);
2869
- return React__default.createElement(ListContainer$1, {
3270
+ return React__default.createElement(React__default.Fragment, null, loadingStatus === 'loading' && React__default.createElement(LoaderContainer, null, React__default.createElement(Spinner, {
3271
+ size: 24
3272
+ })), React__default.createElement(ListContainer$1, {
2870
3273
  style: listContainerStyle,
2871
3274
  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, {
3275
+ }, loadingStatus === 'failed' && React__default.createElement(LoadingFailedAlert, null), loadingStatus === 'success' && React__default.createElement(React__default.Fragment, null, filteredBlockchains.length ? React__default.createElement(BlockchainsList, {
2879
3276
  list: filteredBlockchains,
2880
3277
  selected: selected,
2881
3278
  multiSelect: multiSelect,
2882
3279
  selectedList: selectedList,
2883
3280
  onChange: onChange
2884
- }) : React__default.createElement(Alert, null, searchedFor + " not found")));
3281
+ }) : React__default.createElement(NotFoundAlert, {
3282
+ catergory: "Blockchain",
3283
+ searchedFor: searchedFor
3284
+ }))));
2885
3285
  });
2886
3286
  }
2887
3287
 
2888
- var _excluded$F = ["label", "id"];
3288
+ var _excluded$I = ["label", "id"];
2889
3289
  var CheckboxContainer = /*#__PURE__*/styled('div', {
2890
3290
  display: 'flex',
2891
3291
  alignItems: 'center'
@@ -2910,7 +3310,7 @@ var Label$1 = /*#__PURE__*/styled('label', {
2910
3310
  function Checkbox(_ref) {
2911
3311
  var label = _ref.label,
2912
3312
  id = _ref.id,
2913
- props = _objectWithoutPropertiesLoose(_ref, _excluded$F);
3313
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$I);
2914
3314
  return React__default.createElement(CheckboxContainer, null, React__default.createElement(CheckboxRoot, Object.assign({
2915
3315
  id: id
2916
3316
  }, props), React__default.createElement(Indicator, null, React__default.createElement(CheckIcon, {
@@ -2993,15 +3393,13 @@ var ModalHeader = /*#__PURE__*/styled('div', {
2993
3393
  position: 'relative',
2994
3394
  marginBottom: '$16'
2995
3395
  });
2996
- var ContentContainer$1 = /*#__PURE__*/styled('div', {});
2997
3396
  function Modal(props) {
2998
3397
  var title = props.title,
2999
3398
  content = props.content,
3000
3399
  open = props.open,
3001
3400
  onClose = props.onClose,
3002
3401
  containerStyle = props.containerStyle,
3003
- action = props.action,
3004
- contentStyle = props.contentStyle;
3402
+ action = props.action;
3005
3403
  var handleBackDropClick = function handleBackDropClick(event) {
3006
3404
  if (event.target === event.currentTarget) onClose();
3007
3405
  };
@@ -3017,9 +3415,7 @@ function Modal(props) {
3017
3415
  }, title), React__default.createElement(Row, null, action, React__default.createElement(CloseIcon, {
3018
3416
  size: 24,
3019
3417
  onClick: onClose
3020
- }))), React__default.createElement(ContentContainer$1, {
3021
- style: contentStyle
3022
- }, content))), document.body));
3418
+ }))), content)), document.body));
3023
3419
  }
3024
3420
 
3025
3421
  var WalletState;
@@ -3047,10 +3443,8 @@ var State = function State(_ref) {
3047
3443
  })), walletState === WalletState.CONNECTING && React__default.createElement(Spinner, null), walletState === WalletState.CONNECTED && React__default.createElement(DisconnectIcon, null)));
3048
3444
  };
3049
3445
 
3050
- var WalletImage = /*#__PURE__*/styled('img', {
3051
- width: '$24',
3052
- height: '$24',
3053
- marginRight: '$12'
3446
+ var WalletImageContainer = /*#__PURE__*/styled('div', {
3447
+ paddingRight: '$12'
3054
3448
  });
3055
3449
  var Text = /*#__PURE__*/styled('div', {
3056
3450
  display: 'flex',
@@ -3078,7 +3472,7 @@ function Wallet(props) {
3078
3472
  installLink = props.installLink;
3079
3473
  return React__default.createElement(ExtendedButton, {
3080
3474
  type: state === WalletState.CONNECTED ? 'primary' : undefined,
3081
- disabled: !state,
3475
+ disabled: state == WalletState.CONNECTING,
3082
3476
  onClick: function onClick() {
3083
3477
  if (state === WalletState.NOT_INSTALLED) {
3084
3478
  window.open(detectInstallLink(installLink), '_blank');
@@ -3087,9 +3481,10 @@ function Wallet(props) {
3087
3481
  align: "start",
3088
3482
  variant: "outlined",
3089
3483
  size: "large",
3090
- prefix: React__default.createElement(WalletImage, {
3091
- src: image
3092
- }),
3484
+ prefix: React__default.createElement(WalletImageContainer, null, React__default.createElement(Image, {
3485
+ src: image,
3486
+ size: 24
3487
+ })),
3093
3488
  suffix: React__default.createElement(State, {
3094
3489
  walletState: state,
3095
3490
  installLink: installLink
@@ -3185,28 +3580,40 @@ var groupLiquiditySources = function groupLiquiditySources(liquiditySources) {
3185
3580
  })
3186
3581
  };
3187
3582
  };
3583
+ var MainContainer$1 = /*#__PURE__*/styled('div', {
3584
+ variants: {
3585
+ loaded: {
3586
+ "true": {
3587
+ overflowY: 'auto',
3588
+ padding: '0 $4'
3589
+ }
3590
+ }
3591
+ }
3592
+ });
3188
3593
  var LiquiditySourceType = /*#__PURE__*/styled('div', {
3189
3594
  position: 'sticky',
3190
3595
  display: 'flex',
3191
3596
  justifyContent: 'space-between',
3192
3597
  alignItems: 'center',
3193
3598
  top: '0',
3194
- marginTop: '$8',
3195
- marginBottom: '$8',
3196
3599
  backgroundColor: '$background',
3197
3600
  zIndex: '9999',
3198
3601
  paddingTop: '$8',
3199
3602
  paddingBottom: '$8'
3200
3603
  });
3201
- var LiquidityImage = /*#__PURE__*/styled('img', {
3202
- width: '$20',
3203
- maxHeight: '$20',
3204
- marginRight: '$16'
3604
+ var LiquidityImageContainer = /*#__PURE__*/styled('div', {
3605
+ paddingRight: '$16'
3606
+ });
3607
+ var LoaderContainer$1 = /*#__PURE__*/styled('div', {
3608
+ display: 'flex',
3609
+ justifyContent: 'center'
3205
3610
  });
3206
3611
  function LiquiditySourceList(props) {
3207
3612
  var list = props.list,
3208
3613
  onChange = props.onChange,
3209
- listContainerStyle = props.listContainerStyle;
3614
+ listContainerStyle = props.listContainerStyle,
3615
+ loadingStatus = props.loadingStatus,
3616
+ searchedFor = props.searchedFor;
3210
3617
  var _useState = useState(list.filter(function (item) {
3211
3618
  return item.selected;
3212
3619
  })),
@@ -3240,10 +3647,9 @@ function LiquiditySourceList(props) {
3240
3647
  // TODO: This is not performant
3241
3648
  var totalSelectedBridges = bridges.filter(isSelected).length;
3242
3649
  var totalSelectedExchanges = exchanges.filter(isSelected).length;
3243
- return React__default.createElement("div", {
3244
- style: _extends({
3245
- height: '450px'
3246
- }, listContainerStyle)
3650
+ return React__default.createElement(MainContainer$1, {
3651
+ style: listContainerStyle,
3652
+ loaded: loadingStatus === 'success'
3247
3653
  }, React__default.createElement("div", null, React__default.createElement(LiquiditySourceType, null, React__default.createElement(Typography, {
3248
3654
  variant: "h5"
3249
3655
  }, "Bridges"), React__default.createElement(Typography, {
@@ -3252,14 +3658,19 @@ function LiquiditySourceList(props) {
3252
3658
  }, totalSelectedBridges === totalBridges ? totalBridges : totalSelectedBridges + " / " + totalBridges)), React__default.createElement(Spacer, {
3253
3659
  size: 12,
3254
3660
  direction: "vertical"
3255
- }), bridges.map(function (liquiditySource, index) {
3661
+ }), loadingStatus === 'loading' && React__default.createElement(LoaderContainer$1, null, React__default.createElement(Spinner, {
3662
+ size: 24
3663
+ })), loadingStatus === 'failed' && React__default.createElement(LoadingFailedAlert, null), loadingStatus === 'success' && React__default.createElement(React__default.Fragment, null, totalBridges ? bridges.map(function (liquiditySource, index) {
3256
3664
  return React__default.createElement(LiquiditySourceItem, {
3257
3665
  liquiditySource: liquiditySource,
3258
3666
  key: index,
3259
3667
  selected: isSelected(liquiditySource),
3260
3668
  onChange: changeLiquiditySources
3261
3669
  });
3262
- })), React__default.createElement("div", null, React__default.createElement(LiquiditySourceType, null, React__default.createElement(Typography, {
3670
+ }) : React__default.createElement(NotFoundAlert, {
3671
+ catergory: "Bridge",
3672
+ searchedFor: searchedFor
3673
+ }))), React__default.createElement("div", null, React__default.createElement(LiquiditySourceType, null, React__default.createElement(Typography, {
3263
3674
  variant: "h5"
3264
3675
  }, "Exchanges"), React__default.createElement(Typography, {
3265
3676
  variant: "body1",
@@ -3267,14 +3678,19 @@ function LiquiditySourceList(props) {
3267
3678
  }, totalSelectedExchanges === totalExchanges ? totalExchanges : totalSelectedExchanges + " / " + totalExchanges)), React__default.createElement(Spacer, {
3268
3679
  size: 12,
3269
3680
  direction: "vertical"
3270
- }), exchanges.map(function (liquiditySource, index) {
3681
+ }), loadingStatus === 'loading' && React__default.createElement(LoaderContainer$1, null, React__default.createElement(Spinner, {
3682
+ size: 24
3683
+ })), loadingStatus === 'failed' && React__default.createElement(LoadingFailedAlert, null), loadingStatus == 'success' && React__default.createElement(React__default.Fragment, null, totalExchanges ? exchanges.map(function (liquiditySource, index) {
3271
3684
  return React__default.createElement(LiquiditySourceItem, {
3272
3685
  liquiditySource: liquiditySource,
3273
3686
  key: index,
3274
3687
  selected: isSelected(liquiditySource),
3275
3688
  onChange: changeLiquiditySources
3276
3689
  });
3277
- })));
3690
+ }) : React__default.createElement(NotFoundAlert, {
3691
+ catergory: "Exchange",
3692
+ searchedFor: searchedFor
3693
+ }))));
3278
3694
  }
3279
3695
  var LiquiditySourceItem = function LiquiditySourceItem(_ref) {
3280
3696
  var liquiditySource = _ref.liquiditySource,
@@ -3284,9 +3700,10 @@ var LiquiditySourceItem = function LiquiditySourceItem(_ref) {
3284
3700
  size: "large",
3285
3701
  align: "start",
3286
3702
  variant: "outlined",
3287
- prefix: React__default.createElement(LiquidityImage, {
3288
- src: liquiditySource.logo
3289
- }),
3703
+ prefix: React__default.createElement(LiquidityImageContainer, null, React__default.createElement(Image, {
3704
+ src: liquiditySource.logo,
3705
+ size: 20
3706
+ })),
3290
3707
  suffix: React__default.createElement(Switch, {
3291
3708
  checked: selected
3292
3709
  }),
@@ -3304,22 +3721,19 @@ var filterLiquiditySources = function filterLiquiditySources(liquiditySources, s
3304
3721
  return containsText(liquiditySource.title, searchedFor || '');
3305
3722
  });
3306
3723
  };
3307
- var ActionButton = /*#__PURE__*/styled(Button, {
3308
- position: 'absolute',
3309
- right: 0
3310
- });
3311
3724
  function LiquiditySourcesSelector(props) {
3312
3725
  var list = props.list,
3313
3726
  onChange = props.onChange,
3314
3727
  onBack = props.onBack,
3315
3728
  hasHeader = props.hasHeader,
3316
3729
  listContainerStyle = props.listContainerStyle,
3317
- toggleAll = props.toggleAll;
3730
+ toggleAll = props.toggleAll,
3731
+ loadingStatus = props.loadingStatus;
3318
3732
  return React__default.createElement(SecondaryPage, {
3319
3733
  textField: true,
3320
3734
  textFieldPlaceholder: "Search By Name",
3321
3735
  title: "Liquidity Sources",
3322
- TopButton: React__default.createElement(ActionButton, {
3736
+ TopButton: React__default.createElement(Button, {
3323
3737
  variant: "ghost",
3324
3738
  type: "primary",
3325
3739
  onClick: toggleAll
@@ -3332,7 +3746,9 @@ function LiquiditySourcesSelector(props) {
3332
3746
  return React__default.createElement(LiquiditySourceList, {
3333
3747
  listContainerStyle: listContainerStyle,
3334
3748
  list: filterLiquiditySources(list, searchedFor),
3335
- onChange: onChange
3749
+ onChange: onChange,
3750
+ loadingStatus: loadingStatus,
3751
+ searchedFor: searchedFor
3336
3752
  });
3337
3753
  });
3338
3754
  }
@@ -3376,7 +3792,7 @@ var SolidCircle = /*#__PURE__*/styled('div', {
3376
3792
  }
3377
3793
  }
3378
3794
  });
3379
- var Container$2 = /*#__PURE__*/styled('div', {
3795
+ var Container$1 = /*#__PURE__*/styled('div', {
3380
3796
  border: '1.5px solid',
3381
3797
  borderRadius: '$5',
3382
3798
  padding: '$12',
@@ -3423,18 +3839,19 @@ function SelectableWalletList(_ref) {
3423
3839
  }, [list]);
3424
3840
  return React__default.createElement(Row$1, null, list.map(function (w, index) {
3425
3841
  var checked = active === w.walletType;
3426
- return React__default.createElement(Container$2, {
3842
+ return React__default.createElement(Container$1, {
3427
3843
  checked: checked,
3428
3844
  onClick: onClick.bind(null, w),
3429
3845
  key: index
3430
- }, React__default.createElement("img", {
3846
+ }, React__default.createElement(Image, {
3431
3847
  src: w.image,
3432
3848
  alt: w.walletType,
3433
- width: 24,
3434
- height: 24
3849
+ size: 24
3435
3850
  }), React__default.createElement(Typography, {
3436
3851
  variant: "body2"
3437
- }, w.name), React__default.createElement(Circle, {
3852
+ }, w.name), React__default.createElement(Typography, {
3853
+ variant: "caption"
3854
+ }, getConciseAddress(w.address)), React__default.createElement(Circle, {
3438
3855
  checked: checked
3439
3856
  }, React__default.createElement(SolidCircle, {
3440
3857
  checked: checked
@@ -3474,7 +3891,7 @@ var StyledItem = /*#__PURE__*/styled(Item, {
3474
3891
  borderColor: '$neutrals600'
3475
3892
  }
3476
3893
  });
3477
- var Container$3 = /*#__PURE__*/styled('div', {
3894
+ var Container$2 = /*#__PURE__*/styled('div', {
3478
3895
  display: 'flex'
3479
3896
  });
3480
3897
  var StyledIndicator = /*#__PURE__*/styled(Indicator$1, {
@@ -3504,7 +3921,7 @@ function Radio(props) {
3504
3921
  _props$direction = props.direction,
3505
3922
  direction = _props$direction === void 0 ? 'vertical' : _props$direction,
3506
3923
  style = props.style;
3507
- return React__default.createElement(Container$3, null, React__default.createElement(StyledRoot, {
3924
+ return React__default.createElement(Container$2, null, React__default.createElement(StyledRoot, {
3508
3925
  onValueChange: onChange,
3509
3926
  value: value,
3510
3927
  direction: direction,
@@ -3540,13 +3957,13 @@ var SlippageChipsContainer = /*#__PURE__*/styled('div', {
3540
3957
  var LiquiditySourceContainer = /*#__PURE__*/styled(BaseContainer, {
3541
3958
  display: 'flex',
3542
3959
  justifyContent: 'space-between',
3543
- marginTop: '$32',
3960
+ marginTop: '$16',
3544
3961
  cursor: 'pointer'
3545
3962
  });
3546
3963
  var InfiniteContainer = /*#__PURE__*/styled(BaseContainer, {
3547
3964
  display: 'flex',
3548
3965
  justifyContent: 'space-between',
3549
- marginTop: '$32'
3966
+ marginTop: '$16'
3550
3967
  });
3551
3968
  var StyledAngleRight = /*#__PURE__*/styled(AngleRightIcon, {
3552
3969
  marginLeft: '$8'
@@ -3557,7 +3974,7 @@ var LiquiditySourceNumber = /*#__PURE__*/styled('div', {
3557
3974
  justifyContent: 'center'
3558
3975
  });
3559
3976
  var ThemesContainer = /*#__PURE__*/styled(BaseContainer, {
3560
- marginTop: '$32'
3977
+ marginTop: '$16'
3561
3978
  });
3562
3979
  var Head = /*#__PURE__*/styled('div', {
3563
3980
  display: 'flex',
@@ -3579,7 +3996,8 @@ function Settings(props) {
3579
3996
  selectedTheme = props.selectedTheme,
3580
3997
  onThemeChange = props.onThemeChange,
3581
3998
  toggleInfiniteApprove = props.toggleInfiniteApprove,
3582
- infiniteApprove = props.infiniteApprove;
3999
+ infiniteApprove = props.infiniteApprove,
4000
+ loadingStatus = props.loadingStatus;
3583
4001
  var _useState = useState(props.selectedSlippage),
3584
4002
  selectedSlippage = _useState[0],
3585
4003
  setSelectedSlippage = _useState[1];
@@ -3647,14 +4065,21 @@ function Settings(props) {
3647
4065
  }, "Infinite Approval"), React__default.createElement(Switch, {
3648
4066
  checked: infiniteApprove,
3649
4067
  onChange: toggleInfiniteApprove
3650
- })), React__default.createElement(LiquiditySourceContainer, {
3651
- onClick: onLiquiditySourcesClick
4068
+ })), React__default.createElement(LiquiditySourceContainer, null, React__default.createElement(Button, {
4069
+ onClick: onLiquiditySourcesClick,
4070
+ align: "start",
4071
+ variant: "ghost",
4072
+ loading: loadingStatus === 'loading',
4073
+ suffix: React__default.createElement(LiquiditySourceNumber, null, loadingStatus === 'success' && React__default.createElement(Typography, {
4074
+ variant: "body2",
4075
+ color: "neutrals800"
4076
+ }, liquiditySources.length !== selectedLiquiditySources.length ? selectedLiquiditySources.length + " / " + liquiditySources.length : liquiditySources.length), loadingStatus === 'failed' && React__default.createElement(Typography, {
4077
+ variant: "body2",
4078
+ color: "$error500"
4079
+ }, "Loading failed"), React__default.createElement(StyledAngleRight, null))
3652
4080
  }, React__default.createElement(Typography, {
3653
4081
  variant: "body1"
3654
- }, "Liquidity Sources"), React__default.createElement(LiquiditySourceNumber, null, React__default.createElement(Typography, {
3655
- variant: "body2",
3656
- color: "neutrals800"
3657
- }, liquiditySources.length !== selectedLiquiditySources.length ? selectedLiquiditySources.length + " / " + liquiditySources.length : liquiditySources.length), React__default.createElement(StyledAngleRight, null))));
4082
+ }, "Liquidity Sources"))));
3658
4083
  return React__default.createElement(SecondaryPage, {
3659
4084
  title: "Settings",
3660
4085
  textField: false,
@@ -3662,107 +4087,118 @@ function Settings(props) {
3662
4087
  }, PageContent);
3663
4088
  }
3664
4089
 
3665
- var MainContainer$1 = /*#__PURE__*/styled('div', {
4090
+ var MainContainer$2 = /*#__PURE__*/styled('div', {
4091
+ position: 'relative',
4092
+ display: 'flex',
4093
+ flexDirection: 'column',
3666
4094
  borderRadius: '$10',
3667
- maxWidth: '512px',
3668
4095
  boxShadow: '$s',
3669
- minWidth: '375px',
3670
4096
  width: '100%',
3671
- backgroundColor: '$background',
3672
- height: 'fit-content',
3673
- display: 'flex',
3674
- flexDirection: 'column',
3675
- alignItems: 'end',
4097
+ minWidth: '375px',
4098
+ maxWidth: '512px',
3676
4099
  padding: '$16',
3677
4100
  boxSizing: 'border-box',
3678
- position: 'relative'
3679
- });
3680
- var ContentContainer$2 = /*#__PURE__*/styled('div', {
3681
- width: '100%'
3682
- });
3683
- function SwapContainer(props) {
3684
- var children = props.children,
3685
- style = props.style;
3686
- return React__default.createElement(MainContainer$1, {
3687
- style: style,
3688
- id: "swap-box"
3689
- }, React__default.createElement(ContentContainer$2, null, children));
3690
- }
3691
-
3692
- var Container$4 = /*#__PURE__*/styled('div', {
3693
- position: 'relative'
3694
- });
3695
- var ButtonContainer$1 = /*#__PURE__*/styled('div', {
3696
- paddingTop: '$8'
3697
- });
3698
- var SwapContainer$1 = /*#__PURE__*/styled('div', {
3699
- display: 'flex',
3700
- justifyContent: 'space-between',
3701
- '@md': {
3702
- padding: '$12'
3703
- },
3704
- '&:hover': {
3705
- borderColor: '$primary'
3706
- },
4101
+ backgroundColor: '$background',
3707
4102
  variants: {
3708
- status: {
3709
- failed: {
3710
- borderColor: '$error'
3711
- },
3712
- running: {
3713
- borderColor: '$neutrals400'
4103
+ fixedHeight: {
4104
+ "true": {
4105
+ height: '595px',
4106
+ maxHeight: '595px'
3714
4107
  },
3715
- success: {
3716
- borderColor: '$success'
4108
+ "false": {
4109
+ height: 'auto'
3717
4110
  }
3718
4111
  }
3719
4112
  }
3720
4113
  });
3721
- var Arrow = /*#__PURE__*/styled('div', {
4114
+ function SwapContainer(props) {
4115
+ var children = props.children,
4116
+ style = props.style,
4117
+ _props$fixedHeight = props.fixedHeight,
4118
+ fixedHeight = _props$fixedHeight === void 0 ? true : _props$fixedHeight;
4119
+ return React__default.createElement(MainContainer$2, {
4120
+ style: style,
4121
+ id: "swap-box",
4122
+ fixedHeight: fixedHeight
4123
+ }, children);
4124
+ }
4125
+
4126
+ var TokenContainer = /*#__PURE__*/styled('div', {
3722
4127
  display: 'flex',
3723
- justifyContent: 'center',
3724
- alignItems: 'center'
3725
- });
3726
- var Line$1 = /*#__PURE__*/styled('div', {
3727
- height: '0',
3728
- width: '$20',
3729
- border: '1px dashed $foreground',
3730
- borderRadius: 'inherit',
3731
- '@md': {
3732
- width: '$36'
4128
+ alignItems: 'center',
4129
+ width: '160px',
4130
+ '& .amount': {
4131
+ fontWeight: 'bold'
3733
4132
  },
3734
- '@lg': {
3735
- width: '$48'
4133
+ '& .estimated': {
4134
+ color: '$neutrals600'
3736
4135
  }
3737
4136
  });
3738
- var Dot$1 = /*#__PURE__*/styled('div', {
3739
- width: '$6',
3740
- height: '$6',
3741
- backgroundColor: '$foreground',
3742
- borderRadius: '50%',
3743
- '@lg': {
3744
- width: '$8',
3745
- height: '$8'
4137
+ var TokenImage = /*#__PURE__*/styled('div', {
4138
+ position: 'relative',
4139
+ '.overlay': {
4140
+ position: 'absolute',
4141
+ right: -4,
4142
+ bottom: -4,
4143
+ width: '$16',
4144
+ height: '$16',
4145
+ padding: '$2',
4146
+ borderRadius: '50%',
4147
+ display: 'flex',
4148
+ justifyContent: 'center',
4149
+ alignItems: 'center',
4150
+ backgroundColor: '$background',
4151
+ border: '1px solid $neutrals400'
3746
4152
  }
3747
4153
  });
3748
- var ArrowRight$1 = /*#__PURE__*/styled('div', {
3749
- width: '0px',
3750
- height: '0px',
3751
- borderTop: '5px solid transparent',
3752
- borderBottom: '5px solid transparent',
3753
- borderLeft: '5px solid $foreground'
3754
- });
3755
- var StatusContainer = /*#__PURE__*/styled('div', {
3756
- position: 'absolute',
3757
- right: '-8px',
3758
- top: '30%',
3759
- background: '$background',
3760
- borderRadius: '50%',
4154
+ function Token(props) {
4155
+ var _props$data = props.data,
4156
+ token = _props$data.token,
4157
+ blockchain = _props$data.blockchain,
4158
+ amount = _props$data.amount,
4159
+ estimatedAmount = _props$data.estimatedAmount;
4160
+ return React__default.createElement(TokenContainer, null, React__default.createElement(TokenImage, null, React__default.createElement(Image, {
4161
+ src: token.logo,
4162
+ alt: "",
4163
+ size: 24
4164
+ }), React__default.createElement("div", {
4165
+ className: "overlay"
4166
+ }, React__default.createElement(Image, {
4167
+ src: blockchain.logo,
4168
+ alt: blockchain.name,
4169
+ size: 12
4170
+ }))), React__default.createElement(Spacer, {
4171
+ size: 8
4172
+ }), !!amount && React__default.createElement("span", {
4173
+ className: "amount"
4174
+ }, props.data.amount), !amount && estimatedAmount && React__default.createElement("span", {
4175
+ className: "amount estimated"
4176
+ }, props.data.estimatedAmount), React__default.createElement(Spacer, {
4177
+ size: 4
4178
+ }), token.symbol);
4179
+ }
4180
+
4181
+ var Container$3 = /*#__PURE__*/styled('div', {
4182
+ position: 'relative',
3761
4183
  display: 'flex',
3762
- justifyContent: 'center',
3763
- '@md': {
3764
- top: '40%',
3765
- right: '-8px'
4184
+ justifyContent: 'space-between',
4185
+ alignItems: 'center',
4186
+ padding: '$16 0',
4187
+ borderBottom: '1px solid $neutrals300',
4188
+ '& > .info': {
4189
+ display: 'flex',
4190
+ alignItems: 'center'
4191
+ },
4192
+ '.status': {
4193
+ textTransform: 'uppercase',
4194
+ fontWeight: 'bold',
4195
+ fontSize: '$12'
4196
+ },
4197
+ '&.failed .status': {
4198
+ color: '$error'
4199
+ },
4200
+ '&.success .status': {
4201
+ color: '$success'
3766
4202
  }
3767
4203
  });
3768
4204
  function SwapDetail(_ref) {
@@ -3771,234 +4207,55 @@ function SwapDetail(_ref) {
3771
4207
  onClick = _ref.onClick;
3772
4208
  var firstStep = swap.steps[0];
3773
4209
  var lastStep = swap.steps[swap.steps.length - 1];
3774
- return React__default.createElement(Container$4, {
4210
+ return React__default.createElement(Button, {
4211
+ variant: "ghost",
4212
+ size: "free",
4213
+ fullWidth: true,
3775
4214
  onClick: onClick.bind(null, swap.requestId)
3776
- }, React__default.createElement(ButtonContainer$1, null, React__default.createElement(Button, {
3777
- variant: "outlined",
3778
- align: "grow",
3779
- size: "large",
3780
- type: status === 'failed' ? 'error' : status === 'success' ? 'success' : undefined
3781
- }, React__default.createElement(SwapContainer$1, null, React__default.createElement(StepDetail, {
3782
- logo: firstStep.fromLogo,
3783
- symbol: firstStep.fromSymbol,
3784
- chainLogo: firstStep.fromBlockchainLogo,
3785
- blockchain: firstStep.fromBlockchain,
3786
- amount: swap.inputAmount
3787
- }), React__default.createElement(Arrow, null, React__default.createElement(Dot$1, null), React__default.createElement(Line$1, null), React__default.createElement(ArrowRight$1, null)), React__default.createElement(StepDetail, {
3788
- logo: lastStep.toLogo,
3789
- symbol: lastStep.toSymbol,
3790
- chainLogo: lastStep.toBlockchainLogo,
3791
- blockchain: lastStep.toBlockchain,
3792
- amount: lastStep.outputAmount
3793
- })))), React__default.createElement(StatusContainer, null, status === 'running' ? React__default.createElement(TryAgainIcon, {
3794
- size: 16
3795
- }) : status === 'failed' ? React__default.createElement(InfoCircleIcon, {
3796
- size: 18,
3797
- color: "error"
3798
- }) : React__default.createElement(CheckCircleIcon, {
3799
- size: 18,
3800
- color: "success"
3801
- })));
3802
- }
3803
-
3804
- function VirtualizedList(props) {
3805
- var itemCount = props.itemCount,
3806
- hasNextPage = props.hasNextPage,
3807
- loadNextPage = props.loadNextPage,
3808
- Item = props.Item,
3809
- innerElementType = props.innerElementType,
3810
- size = props.size;
3811
- var isItemLoaded = function isItemLoaded(index) {
3812
- return !hasNextPage || index < itemCount;
3813
- };
3814
- return React__default.createElement(AutoSizer, null, function (_ref) {
3815
- var width = _ref.width,
3816
- height = _ref.height;
3817
- return React__default.createElement(InfiniteLoader, {
3818
- isItemLoaded: isItemLoaded,
3819
- itemCount: hasNextPage ? itemCount + 1 : itemCount,
3820
- loadMoreItems: loadNextPage,
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;
4215
+ }, React__default.createElement(Container$3, {
4216
+ className: "" + status
4217
+ }, React__default.createElement("div", {
4218
+ className: "info"
4219
+ }, React__default.createElement(Token, {
4220
+ data: {
4221
+ token: {
4222
+ logo: firstStep.fromLogo,
4223
+ symbol: firstStep.fromSymbol
4224
+ },
4225
+ blockchain: {
4226
+ logo: firstStep.fromBlockchainLogo || '',
4227
+ name: firstStep.fromBlockchain
4228
+ },
4229
+ amount: limitDecimalPlaces(swap.inputAmount)
3917
4230
  }
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'
4231
+ }), React__default.createElement(Spacer, {
4232
+ size: 12
4233
+ }), React__default.createElement(ArrowRightIcon, {
4234
+ size: 12
4235
+ }), React__default.createElement(Spacer, {
4236
+ size: 12
4237
+ }), React__default.createElement(Token, {
4238
+ data: {
4239
+ token: {
4240
+ logo: lastStep.toLogo,
4241
+ symbol: lastStep.toSymbol
4242
+ },
4243
+ blockchain: {
4244
+ logo: lastStep.toBlockchainLogo || '',
4245
+ name: lastStep.toBlockchain
4246
+ },
4247
+ amount: limitDecimalPlaces(lastStep.outputAmount || ''),
4248
+ estimatedAmount: limitDecimalPlaces(lastStep.expectedOutputAmountHumanReadable || '')
3949
4249
  }
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
- });
4250
+ })), React__default.createElement("div", {
4251
+ className: "status"
4252
+ }, status === 'running' ? React__default.createElement(Spinner, {
4253
+ size: 24,
4254
+ color: "primary"
4255
+ }) : status)));
3999
4256
  }
4000
4257
 
4001
- var Container$5 = /*#__PURE__*/styled('div', {
4258
+ var Container$4 = /*#__PURE__*/styled('div', {
4002
4259
  position: 'relative'
4003
4260
  });
4004
4261
  var Color = /*#__PURE__*/styled('div', {
@@ -4048,7 +4305,7 @@ function ColorPicker(_ref) {
4048
4305
  var _useState = useState(false),
4049
4306
  displayColorPicker = _useState[0],
4050
4307
  setDisplayColorPicker = _useState[1];
4051
- return React__default.createElement(Container$5, null, React__default.createElement(Label$3, {
4308
+ return React__default.createElement(Container$4, null, React__default.createElement(Label$3, {
4052
4309
  className: "_text"
4053
4310
  }, label), React__default.createElement(Button, {
4054
4311
  variant: "outlined",
@@ -4126,172 +4383,58 @@ var DrawerContainer = /*#__PURE__*/styled('div', {
4126
4383
  }
4127
4384
  }
4128
4385
  });
4129
- var DrawerHeader = /*#__PURE__*/styled('div', {
4130
- display: 'flex',
4131
- justifyContent: 'space-between',
4132
- alignItems: 'center',
4133
- position: 'relative',
4134
- marginBottom: '$16'
4135
- });
4136
- var Body = /*#__PURE__*/styled('div', {
4137
- overflowY: 'auto',
4138
- height: '100%'
4139
- });
4140
- var Footer = /*#__PURE__*/styled('footer', {
4141
- width: '100%',
4142
- marginTop: '$28'
4143
- });
4144
- function Drawer(props) {
4145
- var title = props.title,
4146
- content = props.content,
4147
- open = props.open,
4148
- onClose = props.onClose,
4149
- containerStyle = props.containerStyle,
4150
- _props$anchor = props.anchor,
4151
- anchor = _props$anchor === void 0 ? 'bottom' : _props$anchor,
4152
- _props$showClose = props.showClose,
4153
- showClose = _props$showClose === void 0 ? false : _props$showClose,
4154
- footer = props.footer,
4155
- container = props.container;
4156
- var handleBackDropClick = function handleBackDropClick(event) {
4157
- if (event.target === event.currentTarget) onClose();
4158
- };
4159
- return React__default.createElement(React__default.Fragment, null, open && container && createPortal(React__default.createElement(BackDrop$1, {
4160
- onClick: handleBackDropClick
4161
- }, React__default.createElement(DrawerContainer, {
4162
- anchor: anchor,
4163
- style: containerStyle
4164
- }, React__default.createElement(DrawerHeader, null, React__default.createElement(Typography, {
4165
- variant: "h4"
4166
- }, title), showClose && React__default.createElement(CloseIcon, {
4167
- size: 24,
4168
- onClick: onClose
4169
- })), React__default.createElement(Body, null, content), React__default.createElement(Footer, null, footer))), container));
4170
- }
4171
-
4172
- var MainContainer$2 = /*#__PURE__*/styled('div', {
4173
- overflow: 'hidden'
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'
4386
+ var DrawerHeader = /*#__PURE__*/styled('div', {
4387
+ display: 'flex',
4388
+ justifyContent: 'space-between',
4389
+ alignItems: 'center',
4390
+ position: 'relative',
4391
+ marginBottom: '$16'
4219
4392
  });
4220
- var Alerts = /*#__PURE__*/styled('div', {
4221
- paddingBottom: '$16'
4393
+ var Body = /*#__PURE__*/styled('div', {
4394
+ overflowY: 'auto',
4395
+ height: '100%'
4222
4396
  });
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
- }))));
4397
+ var Footer = /*#__PURE__*/styled('footer', {
4398
+ width: '100%',
4399
+ marginTop: '$28'
4400
+ });
4401
+ function Drawer(props) {
4402
+ var title = props.title,
4403
+ content = props.content,
4404
+ open = props.open,
4405
+ onClose = props.onClose,
4406
+ containerStyle = props.containerStyle,
4407
+ _props$anchor = props.anchor,
4408
+ anchor = _props$anchor === void 0 ? 'bottom' : _props$anchor,
4409
+ _props$showClose = props.showClose,
4410
+ showClose = _props$showClose === void 0 ? false : _props$showClose,
4411
+ footer = props.footer,
4412
+ container = props.container;
4413
+ var handleBackDropClick = function handleBackDropClick(event) {
4414
+ if (event.target === event.currentTarget) onClose();
4415
+ };
4416
+ return React__default.createElement(React__default.Fragment, null, open && container && createPortal(React__default.createElement(BackDrop$1, {
4417
+ onClick: handleBackDropClick
4418
+ }, React__default.createElement(DrawerContainer, {
4419
+ anchor: anchor,
4420
+ style: containerStyle
4421
+ }, React__default.createElement(DrawerHeader, null, React__default.createElement(Typography, {
4422
+ variant: "h6"
4423
+ }, title), showClose && React__default.createElement(CloseIcon, {
4424
+ size: 24,
4425
+ onClick: onClose
4426
+ })), React__default.createElement(Body, null, content), React__default.createElement(Footer, null, footer))), container));
4287
4427
  }
4288
4428
 
4429
+ var MainContainer$3 = /*#__PURE__*/styled('div', {
4430
+ overflowY: 'auto'
4431
+ });
4289
4432
  var Section = /*#__PURE__*/styled('div', {
4290
4433
  paddingBottom: '$32',
4291
4434
  marginBottom: '$32',
4292
4435
  borderBottom: '1px solid $neutrals400'
4293
4436
  });
4294
- var Footer$2 = /*#__PURE__*/styled('div', {
4437
+ var Footer$1 = /*#__PURE__*/styled('div', {
4295
4438
  display: 'flex',
4296
4439
  alignItems: 'center'
4297
4440
  });
@@ -4301,7 +4444,7 @@ var AlertContainer = /*#__PURE__*/styled('div', {
4301
4444
  var ConfirmButton = /*#__PURE__*/styled(Button, {
4302
4445
  marginTop: '$16'
4303
4446
  });
4304
- var Container$6 = /*#__PURE__*/styled('div', {
4447
+ var Container$5 = /*#__PURE__*/styled('div', {
4305
4448
  paddingBottom: '$24',
4306
4449
  '.title': {
4307
4450
  paddingBottom: '$8',
@@ -4321,7 +4464,10 @@ var Container$6 = /*#__PURE__*/styled('div', {
4321
4464
  alignItems: 'center'
4322
4465
  }
4323
4466
  });
4324
- function ConfirmWallets(props) {
4467
+ var Alerts = /*#__PURE__*/styled('div', {
4468
+ paddingBottom: '$16'
4469
+ });
4470
+ function ConfirmSwap(props) {
4325
4471
  var onBack = props.onBack,
4326
4472
  loading = props.loading,
4327
4473
  onConfirm = props.onConfirm,
@@ -4330,27 +4476,53 @@ function ConfirmWallets(props) {
4330
4476
  onChange = props.onChange,
4331
4477
  confirmDisabled = props.confirmDisabled,
4332
4478
  isExperimentalChain = props.isExperimentalChain,
4333
- handleConnectChain = props.handleConnectChain;
4479
+ handleConnectChain = props.handleConnectChain,
4480
+ confirmButtonTitle = props.confirmButtonTitle,
4481
+ errors = props.errors,
4482
+ warnings = props.warnings,
4483
+ extraMessages = props.extraMessages;
4334
4484
  return React__default.createElement(SecondaryPage, {
4335
4485
  textField: false,
4336
4486
  title: "Confirm Swap",
4337
4487
  onBack: onBack,
4338
- Footer: React__default.createElement(Footer$2, null, React__default.createElement(ConfirmButton, {
4488
+ Footer: React__default.createElement(Footer$1, null, React__default.createElement(ConfirmButton, {
4339
4489
  fullWidth: true,
4340
4490
  loading: loading,
4341
4491
  type: "primary",
4342
4492
  variant: "contained",
4343
4493
  onClick: onConfirm,
4344
4494
  disabled: confirmDisabled
4345
- }, "Confirm Swap"))
4346
- }, props.previewInputs || props.previewRoutes ? React__default.createElement(Section, null, props.previewInputs, !!props.previewRoutes ? React__default.createElement(Spacer, {
4495
+ }, confirmButtonTitle))
4496
+ }, 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) {
4497
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement(Spacer, {
4498
+ direction: "vertical"
4499
+ }), React__default.createElement(Alert, Object.assign({
4500
+ type: "error",
4501
+ key: index
4502
+ }, typeof error === 'string' ? {
4503
+ title: error
4504
+ } : {
4505
+ children: error
4506
+ })));
4507
+ }), warnings == null ? void 0 : warnings.map(function (warning, index) {
4508
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement(Spacer, {
4509
+ direction: "vertical"
4510
+ }), React__default.createElement(Alert, Object.assign({
4511
+ type: "warning",
4512
+ key: index
4513
+ }, typeof warning === 'string' ? {
4514
+ title: warning
4515
+ } : {
4516
+ children: warning
4517
+ })));
4518
+ }))), props.previewInputs || props.previewRoutes ? React__default.createElement(Section, null, props.previewInputs, !!props.previewRoutes ? React__default.createElement(Spacer, {
4347
4519
  size: 16,
4348
4520
  direction: "vertical"
4349
4521
  }) : null, props.previewRoutes) : null, requiredWallets.map(function (wallet, index) {
4350
4522
  var list = selectableWallets.filter(function (w) {
4351
4523
  return wallet === w.chain;
4352
4524
  });
4353
- return React__default.createElement(Container$6, {
4525
+ return React__default.createElement(Container$5, {
4354
4526
  key: index
4355
4527
  }, React__default.createElement("div", {
4356
4528
  className: "title"
@@ -4362,7 +4534,7 @@ function ConfirmWallets(props) {
4362
4534
  variant: "body2"
4363
4535
  }, "Your ", wallet, " Wallet")), list.length === 0 && React__default.createElement(React__default.Fragment, null, React__default.createElement(AlertContainer, null, React__default.createElement(Alert, {
4364
4536
  type: "error"
4365
- }, "You need to connect a compatible wallet with ", wallet)), (isExperimentalChain == null ? void 0 : isExperimentalChain(wallet)) && React__default.createElement(Button, {
4537
+ }, "You need to connect a compatible wallet with ", wallet, ".")), (isExperimentalChain == null ? void 0 : isExperimentalChain(wallet)) && React__default.createElement(Button, {
4366
4538
  variant: "contained",
4367
4539
  type: "primary",
4368
4540
  align: "grow",
@@ -4373,101 +4545,202 @@ function ConfirmWallets(props) {
4373
4545
  list: list,
4374
4546
  onChange: onChange
4375
4547
  }));
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
- }, []);
4548
+ })));
4394
4549
  }
4395
4550
 
4396
- var BodyError = /*#__PURE__*/styled('div', {
4397
- height: '100%',
4398
- display: 'flex',
4399
- justifyContent: 'center',
4400
- alignItems: 'center'
4401
- });
4402
- var ErrorMsg$1 = /*#__PURE__*/styled(Typography, {
4403
- color: '$error'
4404
- });
4405
- var filteredHistory = function filteredHistory(list, searchedFor) {
4406
- return list.filter(function (swap) {
4407
- var firstStep = swap.steps[0];
4408
- var lastStep = swap.steps[swap.steps.length - 1];
4409
- return containsText(firstStep.fromBlockchain, searchedFor) || containsText(firstStep.fromSymbol, searchedFor) || containsText(lastStep.toBlockchain, searchedFor) || containsText(lastStep.toSymbol, searchedFor) || containsText(swap.requestId, searchedFor);
4410
- });
4411
- };
4412
4551
  var Group = /*#__PURE__*/styled('div', {
4413
- marginBottom: '$24',
4414
- paddingRight: '$8',
4415
- maxHeight: '600px'
4416
- });
4417
- var GroupTitle = /*#__PURE__*/styled(Typography, {
4418
- color: '$neutrals500'
4552
+ '.group-title': {
4553
+ textTransform: 'uppercase'
4554
+ }
4419
4555
  });
4420
- var SwapsGroup = function SwapsGroup(props) {
4556
+ function SwapsGroup(props) {
4421
4557
  var list = props.list,
4422
- onSwapClick = props.onSwapClick;
4423
- var swapsInGroup = groupingOfSwaps(list);
4424
- return React__default.createElement(React__default.Fragment, null, swapsInGroup.map(function (group, index) {
4425
- return React__default.createElement(Group, {
4558
+ onSwapClick = props.onSwapClick,
4559
+ groupBy = props.groupBy;
4560
+ var groups = groupBy ? groupBy(list) : [{
4561
+ title: 'History',
4562
+ swaps: list
4563
+ }];
4564
+ return React__default.createElement(React__default.Fragment, null, groups.filter(function (group) {
4565
+ return group.swaps.length > 0;
4566
+ }).map(function (group, index) {
4567
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement(Group, {
4426
4568
  key: index
4427
- }, React__default.createElement(GroupTitle, {
4428
- variant: "body2"
4569
+ }, React__default.createElement(Typography, {
4570
+ variant: "body2",
4571
+ color: "neutrals600",
4572
+ className: "group-title"
4429
4573
  }, group.title), group.swaps.map(function (swap, index) {
4430
- return React__default.createElement(SwapDetail, {
4574
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement(SwapDetail, {
4431
4575
  key: index,
4432
4576
  swap: swap,
4433
4577
  status: swap.status,
4434
4578
  onClick: onSwapClick
4435
- });
4579
+ }), React__default.createElement(Divider, {
4580
+ size: 12
4581
+ }));
4582
+ })), React__default.createElement(Divider, {
4583
+ size: 24
4436
4584
  }));
4437
4585
  }));
4586
+ }
4587
+
4588
+ var Container$6 = /*#__PURE__*/styled('div', {
4589
+ overflowY: 'auto'
4590
+ });
4591
+ var filteredHistory = function filteredHistory(list, searchedFor) {
4592
+ return list.filter(function (swap) {
4593
+ var firstStep = swap.steps[0];
4594
+ var lastStep = swap.steps[swap.steps.length - 1];
4595
+ return containsText(firstStep.fromBlockchain, searchedFor) || containsText(firstStep.fromSymbol, searchedFor) || containsText(lastStep.toBlockchain, searchedFor) || containsText(lastStep.toSymbol, searchedFor) || containsText(swap.requestId, searchedFor);
4596
+ });
4438
4597
  };
4439
- function History(_ref) {
4440
- var _ref$list = _ref.list,
4441
- list = _ref$list === void 0 ? [] : _ref$list,
4442
- onBack = _ref.onBack,
4443
- onSwapClick = _ref.onSwapClick;
4598
+ function History(props) {
4599
+ var _props$list = props.list,
4600
+ list = _props$list === void 0 ? [] : _props$list,
4601
+ onBack = props.onBack,
4602
+ onSwapClick = props.onSwapClick,
4603
+ groupBy = props.groupBy,
4604
+ loading = props.loading;
4444
4605
  return React__default.createElement(SecondaryPage, {
4445
4606
  onBack: onBack,
4446
4607
  textField: true,
4447
- textFieldPlaceholder: "Search By Blockchain Or Token",
4608
+ textFieldPlaceholder: "Search by Network, Token or Request ID",
4448
4609
  title: "Swaps"
4449
4610
  }, function (searchedFor) {
4450
4611
  var filterSwaps = filteredHistory(list, searchedFor);
4451
- return filterSwaps.length ? React__default.createElement(SwapsGroup, {
4612
+ return React__default.createElement(React__default.Fragment, null, loading && React__default.createElement(LoaderContainer, null, React__default.createElement(Spinner, {
4613
+ size: 24
4614
+ })), React__default.createElement(Container$6, null, !loading && React__default.createElement(React__default.Fragment, null, filterSwaps.length ? React__default.createElement(SwapsGroup, {
4452
4615
  list: filterSwaps,
4453
- onSwapClick: onSwapClick
4454
- }) : React__default.createElement(BodyError, null, React__default.createElement(ErrorMsg$1, {
4455
- variant: "caption"
4456
- }, "Not Found"));
4616
+ onSwapClick: onSwapClick,
4617
+ groupBy: groupBy
4618
+ }) : React__default.createElement(NotFoundAlert, {
4619
+ catergory: "Swap"
4620
+ }))));
4457
4621
  });
4458
4622
  }
4459
4623
 
4624
+ var getAlertType = function getAlertType(messageType) {
4625
+ if (!messageType || messageType === 'info') return 'secondary';else return messageType;
4626
+ };
4627
+ var DetailedMessage = /*#__PURE__*/styled('div', {
4628
+ width: '90%',
4629
+ overflowWrap: 'break-word',
4630
+ color: '$error500 !important'
4631
+ });
4632
+ var SuccessText = /*#__PURE__*/styled(Typography, {
4633
+ color: '$success500 !important'
4634
+ });
4635
+ var SwapMessages = function SwapMessages(props) {
4636
+ var shortMessage = props.shortMessage,
4637
+ detailedMessage = props.detailedMessage,
4638
+ currentStepBlockchain = props.currentStepBlockchain,
4639
+ type = props.type,
4640
+ lastConvertedTokenInFailedSwap = props.lastConvertedTokenInFailedSwap;
4641
+ var _useState = useState(false),
4642
+ expandedMessage = _useState[0],
4643
+ setExpandedMessage = _useState[1];
4644
+ var allowedNumberOfChars = detailedMessage["long"] ? 0 : 150;
4645
+ var shouldShowMoreDetailsButton = !expandedMessage && detailedMessage.content.length > allowedNumberOfChars;
4646
+ return React__default.createElement(Alert, Object.assign({
4647
+ type: getAlertType(type),
4648
+ title: shortMessage
4649
+ }, shouldShowMoreDetailsButton && {
4650
+ footer: React__default.createElement(Button, {
4651
+ variant: "outlined",
4652
+ type: "primary",
4653
+ onClick: setExpandedMessage.bind(null, function (prevState) {
4654
+ return !prevState;
4655
+ })
4656
+ }, "Show more details")
4657
+ }, !!props.switchNetwork && {
4658
+ footer: React__default.createElement(Button, {
4659
+ variant: 'outlined',
4660
+ type: "primary",
4661
+ onClick: props.switchNetwork
4662
+ }, "Change network to ", currentStepBlockchain)
4663
+ }), !!detailedMessage.content ? React__default.createElement(DetailedMessage, null, React__default.createElement(Typography, {
4664
+ variant: "body3"
4665
+ }, 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, {
4666
+ variant: "body3"
4667
+ }, "Don't worry, your fund is\xA0"), React__default.createElement(SuccessText, {
4668
+ variant: "body3"
4669
+ }, React__default.createElement("b", null, "Safe"))), React__default.createElement("p", null, React__default.createElement(Typography, {
4670
+ variant: "body3"
4671
+ }, "It is converted to \xA0", React__default.createElement("u", null, lastConvertedTokenInFailedSwap.outputAmount), "\xA0"), React__default.createElement(SuccessText, {
4672
+ variant: "body3"
4673
+ }, React__default.createElement("b", null, lastConvertedTokenInFailedSwap.symbol, "\xA0")), React__default.createElement(Typography, {
4674
+ variant: "body3"
4675
+ }, "on your\xA0"), React__default.createElement(SuccessText, {
4676
+ variant: "body3"
4677
+ }, React__default.createElement("b", null, lastConvertedTokenInFailedSwap.blockchain, "\xA0")), React__default.createElement(Typography, {
4678
+ variant: "body3"
4679
+ }, "wallet"))));
4680
+ };
4681
+
4682
+ var _excluded$J = ["pendingSwap", "onBack", "onCopy", "isCopied", "onCancel", "date", "onRetry", "previewInputs"];
4683
+ var SwapperContainer$1 = /*#__PURE__*/styled('div', {
4684
+ display: 'flex',
4685
+ alignItems: 'center',
4686
+ paddingLeft: '$4',
4687
+ variants: {
4688
+ created: {
4689
+ "true": {
4690
+ filter: 'grayscale(100%)'
4691
+ }
4692
+ },
4693
+ running: {
4694
+ "true": {
4695
+ animation: pulse + " 2s ease-in-out infinite"
4696
+ }
4697
+ }
4698
+ }
4699
+ });
4700
+ var FeeContainer = /*#__PURE__*/styled('div', {
4701
+ paddingLeft: '$16'
4702
+ });
4703
+ var Fee = /*#__PURE__*/styled('div', {
4704
+ display: 'flex',
4705
+ alignItems: 'center'
4706
+ });
4707
+ var RelativeContainer$1 = /*#__PURE__*/styled('div', {
4708
+ position: 'relative'
4709
+ });
4710
+ var Dot$1 = /*#__PURE__*/styled('div', {
4711
+ width: '$8',
4712
+ height: '$8',
4713
+ backgroundColor: '$foreground',
4714
+ borderRadius: '4px',
4715
+ marginLeft: '11px'
4716
+ });
4717
+ var ArrowDown = /*#__PURE__*/styled('div', {
4718
+ width: '0px',
4719
+ height: '0px',
4720
+ borderLeft: '5px solid transparent',
4721
+ borderRight: '5px solid transparent',
4722
+ borderTop: '5px solid $foreground',
4723
+ marginLeft: '$10'
4724
+ });
4460
4725
  var StyledAnchor = /*#__PURE__*/styled('a', {
4461
4726
  color: '$primary',
4462
- fontWeight: '$600',
4463
- marginLeft: '$12'
4727
+ fontWeight: '$600'
4728
+ });
4729
+ var SwapInfoContainer = /*#__PURE__*/styled('div', {
4730
+ display: 'flex',
4731
+ flexDirection: 'column',
4732
+ paddingBottom: '$16',
4733
+ borderBottom: '1px solid $neutrals300'
4464
4734
  });
4465
4735
  var InternalDetailsContainer = /*#__PURE__*/styled('div', {
4466
- display: 'flex'
4736
+ display: 'flex',
4737
+ '.details': {
4738
+ padding: '$8 0'
4739
+ }
4467
4740
  });
4468
4741
  var InternalDetail = /*#__PURE__*/styled('div', {
4469
4742
  display: 'flex',
4470
- padding: '$10'
4743
+ margin: '$12 0 $12 $20'
4471
4744
  });
4472
4745
  var DescriptionContainer = /*#__PURE__*/styled('div', {
4473
4746
  display: 'flex',
@@ -4475,152 +4748,174 @@ var DescriptionContainer = /*#__PURE__*/styled('div', {
4475
4748
  });
4476
4749
  var Description = /*#__PURE__*/styled(Typography, {
4477
4750
  color: '$success',
4478
- marginLeft: '$8'
4479
- });
4480
- var Error = /*#__PURE__*/styled(Description, {
4481
- color: '$error'
4751
+ paddingLeft: '$4'
4482
4752
  });
4483
- var Line$3 = /*#__PURE__*/styled('div', {
4753
+ var Line$1 = /*#__PURE__*/styled('div', {
4484
4754
  width: '0',
4485
4755
  minHeight: '$16',
4486
- marginLeft: '$12',
4756
+ marginLeft: '14px',
4487
4757
  border: '1px dashed $foreground',
4488
4758
  borderRadius: 'inherit'
4489
4759
  });
4490
- var RequestIdContainer = /*#__PURE__*/styled('div', {
4491
- cursor: 'pointer',
4492
- backgroundColor: '$neutrals200',
4493
- padding: '$4',
4760
+ var Row$2 = /*#__PURE__*/styled('div', {
4494
4761
  display: 'flex',
4495
- justifyContent: 'center',
4762
+ justifyContent: 'space-between',
4496
4763
  alignItems: 'center',
4497
- borderRadius: '$5',
4498
- marginBottom: '$16'
4764
+ fontSize: '$14',
4765
+ padding: '$8 0',
4766
+ '.name': {
4767
+ color: '$neutrals600'
4768
+ },
4769
+ '.value': {
4770
+ display: 'flex',
4771
+ alignItems: 'center',
4772
+ color: '$neutrals800',
4773
+ justifyContent: 'flex-end'
4774
+ },
4775
+ '.status': {
4776
+ fontWeight: 'bold',
4777
+ textTransform: 'uppercase'
4778
+ },
4779
+ '.status.failed': {
4780
+ color: '$error'
4781
+ },
4782
+ '.status.success': {
4783
+ color: '$success'
4784
+ }
4499
4785
  });
4500
- var RequestId = /*#__PURE__*/styled(Typography, {
4501
- color: '$warning500'
4786
+ var RequestId = /*#__PURE__*/styled('div', {
4787
+ width: '150px',
4788
+ whiteSpace: 'nowrap',
4789
+ overflow: 'hidden',
4790
+ textOverflow: 'ellipsis',
4791
+ '@md': {
4792
+ width: 'auto'
4793
+ }
4502
4794
  });
4503
- var CancelButtonContainer = /*#__PURE__*/styled('div', {
4504
- display: 'flex',
4505
- justifyContent: 'center',
4506
- alignItems: 'center'
4795
+ var ExtraDetails = /*#__PURE__*/styled('div', {
4796
+ padding: '0',
4797
+ color: '$neutrals600',
4798
+ fontSize: '$10'
4507
4799
  });
4508
- var StepContainer$1 = /*#__PURE__*/styled('div', {
4509
- variants: {
4510
- hasNotStarted: {
4511
- "true": {
4512
- filter: 'grayscale(100%)'
4513
- }
4514
- },
4515
- isRunning: {
4516
- "true": {
4517
- animation: pulse + " 2s ease-in-out infinite"
4518
- }
4519
- }
4520
- }
4800
+ var SwapFlowContainer = /*#__PURE__*/styled('div', {
4801
+ overflowY: 'auto',
4802
+ padding: '$8 $4 $2 $4'
4521
4803
  });
4522
4804
  function SwapHistory(props) {
4523
4805
  var pendingSwap = props.pendingSwap,
4524
4806
  onBack = props.onBack,
4525
4807
  onCopy = props.onCopy,
4526
4808
  isCopied = props.isCopied,
4527
- onCancel = props.onCancel;
4809
+ onCancel = props.onCancel,
4810
+ date = props.date,
4811
+ onRetry = props.onRetry,
4812
+ extraMessageProps = _objectWithoutPropertiesLoose(props, _excluded$J);
4528
4813
  var _useState = useState(false),
4529
4814
  showDrawer = _useState[0],
4530
4815
  setShowDrawer = _useState[1];
4531
4816
  return React__default.createElement(SecondaryPage, {
4532
4817
  title: "Swap Details",
4533
4818
  textField: false,
4534
- onBack: onBack
4535
- }, React__default.createElement("div", {
4536
- style: {
4537
- overflow: 'hidden'
4538
- }
4539
- }, React__default.createElement("div", null, React__default.createElement(Typography, {
4540
- variant: "body1"
4541
- }, " request ID :"), React__default.createElement(RequestIdContainer, {
4819
+ onBack: onBack,
4820
+ Footer: React__default.createElement(React__default.Fragment, null, (pendingSwap == null ? void 0 : pendingSwap.status) === 'running' && React__default.createElement(Button, {
4821
+ variant: "outlined",
4822
+ fullWidth: true,
4823
+ type: "error",
4824
+ onClick: setShowDrawer.bind(null, true)
4825
+ }, "Cancel"), !!onRetry && React__default.createElement(Button, {
4826
+ variant: "contained",
4827
+ fullWidth: true,
4828
+ type: "primary",
4829
+ onClick: onRetry
4830
+ }, "Try again"))
4831
+ }, React__default.createElement("div", null, React__default.createElement(SwapInfoContainer, null, React__default.createElement(Row$2, null, React__default.createElement("div", {
4832
+ className: "name"
4833
+ }, "Request Id:", React__default.createElement("span", {
4834
+ className: "value requestId",
4542
4835
  onClick: onCopy.bind(null, pendingSwap == null ? void 0 : pendingSwap.requestId)
4543
- }, React__default.createElement(RequestId, {
4544
- variant: "body1"
4545
- }, pendingSwap == null ? void 0 : pendingSwap.requestId), React__default.createElement(Spacer, {
4546
- size: 12
4547
- }), isCopied ? React__default.createElement(CheckSquareIcon, {
4548
- color: "success",
4549
- size: 18
4550
- }) : React__default.createElement(CopyIcon, {
4551
- color: "warning",
4552
- size: 18
4553
- }))), React__default.createElement("div", {
4554
- style: {
4555
- overflow: 'auto',
4556
- position: 'relative'
4557
- }
4558
- }, pendingSwap == null ? void 0 : pendingSwap.steps.map(function (step, index) {
4559
- return React__default.createElement(StepContainer$1, {
4560
- key: index,
4561
- hasNotStarted: step.status === 'created',
4562
- isRunning: step.status != 'failed' && step.status != 'success' && step.status != 'created'
4836
+ }, React__default.createElement(RequestId, null, pendingSwap == null ? void 0 : pendingSwap.requestId), React__default.createElement(Spacer, {
4837
+ size: 4
4838
+ }), React__default.createElement(Button, {
4839
+ type: "primary",
4840
+ variant: "ghost",
4841
+ size: "compact"
4842
+ }, isCopied ? 'Copied!' : 'Copy'))), React__default.createElement("div", {
4843
+ className: "name"
4844
+ }, React__default.createElement("span", {
4845
+ className: "value status " + ((pendingSwap == null ? void 0 : pendingSwap.status) || '')
4846
+ }, pendingSwap == null ? void 0 : pendingSwap.status, (pendingSwap == null ? void 0 : pendingSwap.status) === 'running' && React__default.createElement(Spinner, {
4847
+ size: 16,
4848
+ color: "primary"
4849
+ })), React__default.createElement(ExtraDetails, null, date))))), React__default.createElement(SwapFlowContainer, null, extraMessageProps.shortMessage && React__default.createElement(SwapMessages, Object.assign({}, extraMessageProps)), React__default.createElement(Divider, {
4850
+ size: 16
4851
+ }), pendingSwap == null ? void 0 : pendingSwap.steps.map(function (step, index) {
4852
+ return React__default.createElement("div", {
4853
+ key: index
4563
4854
  }, index === 0 && React__default.createElement(RelativeContainer$1, null, React__default.createElement(StepDetail, {
4564
4855
  logo: step.fromLogo,
4565
4856
  symbol: step.fromSymbol,
4566
- chainLogo: step.fromBlockchainLogo,
4857
+ chainLogo: step.fromBlockchainLogo || '',
4567
4858
  blockchain: step.fromBlockchain,
4568
4859
  amount: pendingSwap.inputAmount
4569
- }), React__default.createElement(Dot$2, null)), React__default.createElement(Line$3, null), React__default.createElement(SwapperContainer$1, null, React__default.createElement(SwapperLogo$1, {
4570
- src: step.swapperLogo,
4571
- alt: step.swapperId
4572
- }), React__default.createElement("div", null, React__default.createElement(Typography, {
4573
- ml: 4,
4860
+ }), React__default.createElement(Dot$1, null)), React__default.createElement(Line$1, null), React__default.createElement(SwapperContainer$1, {
4861
+ created: step.status === 'created',
4862
+ running: !['created', 'success', 'failed'].includes(step.status)
4863
+ }, React__default.createElement(Image, {
4864
+ src: step.swapperLogo || '',
4865
+ alt: step.swapperId,
4866
+ size: 20
4867
+ }), React__default.createElement(FeeContainer, null, React__default.createElement(Typography, {
4574
4868
  variant: "caption"
4575
- }, 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
- ml: 4,
4869
+ }, step.swapperType === 'DEX' ? 'Swap' : 'Bridge', " via", ' ', step.swapperId), React__default.createElement(Fee, null, React__default.createElement(GasIcon, null), React__default.createElement(Typography, {
4577
4870
  variant: "caption"
4578
- }, "$", step.feeInUsd, " estimated gas fee")))), React__default.createElement("div", {
4871
+ }, "\xA0 $", step.feeInUsd, " estimated gas fee")))), React__default.createElement("div", {
4579
4872
  style: {
4580
4873
  display: 'flex'
4581
4874
  }
4582
- }, React__default.createElement(InternalDetailsContainer, null, React__default.createElement(Line$3, null), !!step.explorerUrl && React__default.createElement("div", null, step.explorerUrl.map(function (item, index) {
4875
+ }, React__default.createElement(InternalDetailsContainer, null, React__default.createElement(Line$1, null), React__default.createElement("div", {
4876
+ className: "details"
4877
+ }, !!step.explorerUrl && React__default.createElement("div", null, step.explorerUrl.map(function (item, index) {
4583
4878
  return React__default.createElement(InternalDetail, {
4584
4879
  key: index
4585
- }, React__default.createElement(DescriptionContainer, null, React__default.createElement(CheckCircleIcon, {
4586
- color: "success"
4880
+ }, React__default.createElement(DescriptionContainer, null, React__default.createElement(Divider, {
4881
+ size: 4
4882
+ }), React__default.createElement(CheckCircleIcon, {
4883
+ color: "primary"
4587
4884
  }), React__default.createElement(Description, {
4588
- variant: "body2"
4589
- }, !item.description ? React__default.createElement("b", null, "View transaction") : React__default.createElement("b", null, item.description.substring(0, 1).toUpperCase(), item.description.substring(1)))), React__default.createElement(StyledAnchor, {
4885
+ variant: "body3"
4886
+ }, React__default.createElement(StyledAnchor, {
4590
4887
  href: item.url,
4591
4888
  target: "_blank",
4592
4889
  rel: "noreferrer",
4593
4890
  key: index
4594
- }, "TX-Link"));
4595
- }), step.status === 'failed' && React__default.createElement(InternalDetail, null, React__default.createElement(DescriptionContainer, null, React__default.createElement(InfoCircleIcon, {
4891
+ }, !item.description ? React__default.createElement("b", null, "View transaction") : React__default.createElement("b", null, item.description.substring(0, 1).toUpperCase(), item.description.substring(1), " Tx")))));
4892
+ })), step.status === 'failed' && React__default.createElement(InternalDetail, null, React__default.createElement(DescriptionContainer, null, React__default.createElement(InfoCircleIcon, {
4596
4893
  color: "error"
4597
- }), React__default.createElement(Error, {
4598
- variant: "body2"
4894
+ }), React__default.createElement(Description, {
4895
+ variant: "body3",
4896
+ color: "$error500"
4599
4897
  }, "Step failed")))))), index + 1 === pendingSwap.steps.length && React__default.createElement(ArrowDown, null), React__default.createElement(StepDetail, {
4600
4898
  logo: step.toLogo,
4601
4899
  symbol: step.toSymbol,
4602
- chainLogo: step.toBlockchainLogo,
4900
+ chainLogo: step.toBlockchainLogo || '',
4603
4901
  blockchain: step.toBlockchain,
4604
- amount: step.outputAmount
4902
+ amount: step.outputAmount || '',
4903
+ estimatedAmount: step.expectedOutputAmountHumanReadable || '',
4904
+ success: step.status === 'success'
4605
4905
  }));
4606
- }), (pendingSwap == null ? void 0 : pendingSwap.status) === 'running' && React__default.createElement(CancelButtonContainer, null, React__default.createElement(Button, {
4607
- variant: "contained",
4608
- type: "error",
4609
- onClick: setShowDrawer.bind(null, true)
4610
- }, "Cancel")))), React__default.createElement(Drawer, {
4906
+ }), React__default.createElement(Divider, {
4907
+ size: 32
4908
+ })), React__default.createElement(Drawer, {
4611
4909
  onClose: setShowDrawer.bind(null, false),
4612
4910
  open: showDrawer,
4613
4911
  showClose: true,
4614
4912
  anchor: "bottom",
4615
4913
  title: "Cancel Progress",
4616
- content: React__default.createElement(React__default.Fragment, null, React__default.createElement(Alert, {
4914
+ content: React__default.createElement(Alert, {
4617
4915
  type: "warning"
4618
4916
  }, React__default.createElement(Typography, {
4619
4917
  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, {
4621
- size: 12,
4622
- 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")))),
4918
+ }, "Warning: Cancel ", React__default.createElement("u", null, "doesn't revert"), " your transaction if you've already signed and sent a transaction to the blockchain. It only stops next steps from being executed.")),
4624
4919
  footer: React__default.createElement("div", {
4625
4920
  style: {
4626
4921
  display: 'flex',
@@ -4645,5 +4940,5 @@ function SwapHistory(props) {
4645
4940
  }));
4646
4941
  }
4647
4942
 
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, ConfirmWallets, ConnectWalletsModal, CopyIcon, DeleteCircleIcon, DeleteWalletIcon, DisconnectIcon, DownloadIcon, Drawer, FilledCircle, GasIcon, History, HistoryIcon, HorizontalSwapIcon, InfoCircleIcon, LiquiditySourcesSelector, 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 };
4943
+ 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, Image, InfoCircleIcon, LiquiditySourcesSelector, LoadingFailedAlert, MinusCircleIcon, Modal, Radio, RetryIcon, RetryLeftIcon, RetryRightIcon, SearchIcon, SearchMinusIcon, SecondaryPage, SelectableWalletList, Settings, SettingsIcon, SignatureIcon, Spacer, Spinner, StepDetail, SwapContainer, SwapDetail, SwapHistory, SwapWalletIcon, SwapsGroup, Switch, TextField, TimeIcon, TokenList, TokenSelector, Tooltip, TrashIcon, TryAgainIcon, Typography, VerticalSwapIcon, Wallet, WalletIcon, WalletState, WarningIcon, createTheme, css, darkTheme, globalCss, keyframes, lightTheme, styled };
4649
4944
  //# sourceMappingURL=ui.esm.js.map