@kimafinance/kima-transaction-widget 1.4.6 → 1.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +617 -568
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +450 -414
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/KimaProvider.tsx
|
|
4
|
-
import * as
|
|
4
|
+
import * as React49 from "react";
|
|
5
5
|
import { createContext, useContext, useMemo as useMemo7 } from "react";
|
|
6
6
|
import { Provider, useSelector as useSelector16 } from "react-redux";
|
|
7
7
|
|
|
@@ -1358,6 +1358,84 @@ var KimaNetwork = ({ width = 120, height = 15, ...rest }) => {
|
|
|
1358
1358
|
};
|
|
1359
1359
|
var KimaNetwork_default = KimaNetwork;
|
|
1360
1360
|
|
|
1361
|
+
// src/assets/icons/CFX.tsx
|
|
1362
|
+
import React40 from "react";
|
|
1363
|
+
var CFX = ({ width = 30, height = 30, ...rest }) => {
|
|
1364
|
+
return /* @__PURE__ */ React40.createElement(
|
|
1365
|
+
"svg",
|
|
1366
|
+
{
|
|
1367
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1368
|
+
width,
|
|
1369
|
+
height,
|
|
1370
|
+
viewBox: "0 0 1766.6 2212",
|
|
1371
|
+
fill: "none",
|
|
1372
|
+
...rest
|
|
1373
|
+
},
|
|
1374
|
+
/* @__PURE__ */ React40.createElement("g", null, /* @__PURE__ */ React40.createElement("g", null, /* @__PURE__ */ React40.createElement(
|
|
1375
|
+
"polygon",
|
|
1376
|
+
{
|
|
1377
|
+
fill: "#181818",
|
|
1378
|
+
fillRule: "evenodd",
|
|
1379
|
+
clipRule: "evenodd",
|
|
1380
|
+
points: "0,1309.5 879.5,426.3 1766.6,1317.2 1766.6,892.7 887.1,0 1,895.7"
|
|
1381
|
+
}
|
|
1382
|
+
), /* @__PURE__ */ React40.createElement(
|
|
1383
|
+
"polygon",
|
|
1384
|
+
{
|
|
1385
|
+
fill: "#181818",
|
|
1386
|
+
fillRule: "evenodd",
|
|
1387
|
+
clipRule: "evenodd",
|
|
1388
|
+
points: "203.6,1528.4 875.6,2212 1555.4,1528.4 1348,1317.2 879.5,1789.6 626,1528.4 1090.7,1052.2 882.4,845.8"
|
|
1389
|
+
}
|
|
1390
|
+
)))
|
|
1391
|
+
);
|
|
1392
|
+
};
|
|
1393
|
+
var CFX_default = CFX;
|
|
1394
|
+
|
|
1395
|
+
// src/assets/icons/EURC.tsx
|
|
1396
|
+
import React41 from "react";
|
|
1397
|
+
var EURC = ({ width = 100, height = 100, ...rest }) => {
|
|
1398
|
+
return /* @__PURE__ */ React41.createElement(
|
|
1399
|
+
"svg",
|
|
1400
|
+
{
|
|
1401
|
+
width,
|
|
1402
|
+
height,
|
|
1403
|
+
viewBox: "0 0 100 100",
|
|
1404
|
+
fill: "none",
|
|
1405
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1406
|
+
xlinkHref: "http://www.w3.org/1999/xlink"
|
|
1407
|
+
},
|
|
1408
|
+
/* @__PURE__ */ React41.createElement(
|
|
1409
|
+
"path",
|
|
1410
|
+
{
|
|
1411
|
+
d: "M50 100C77.7085 100 100 77.7085 100 50C100 22.2915 77.7085 0 50 0C22.2915 0 0 22.2915 0 50C0 77.7085 22.2915 100 50 100Z",
|
|
1412
|
+
fill: "#2775CA"
|
|
1413
|
+
}
|
|
1414
|
+
),
|
|
1415
|
+
/* @__PURE__ */ React41.createElement("rect", { width: "100", height: "100", fill: "url(#pattern0_1506_393)" }),
|
|
1416
|
+
/* @__PURE__ */ React41.createElement("defs", null, /* @__PURE__ */ React41.createElement(
|
|
1417
|
+
"pattern",
|
|
1418
|
+
{
|
|
1419
|
+
id: "pattern0_1506_393",
|
|
1420
|
+
patternContentUnits: "objectBoundingBox",
|
|
1421
|
+
width: "1",
|
|
1422
|
+
height: "1"
|
|
1423
|
+
},
|
|
1424
|
+
/* @__PURE__ */ React41.createElement("use", { xlinkHref: "#image0_1506_393", transform: "scale(0.005)" })
|
|
1425
|
+
), /* @__PURE__ */ React41.createElement(
|
|
1426
|
+
"image",
|
|
1427
|
+
{
|
|
1428
|
+
id: "image0_1506_393",
|
|
1429
|
+
width: "200",
|
|
1430
|
+
height: "200",
|
|
1431
|
+
preserveAspectRatio: "none",
|
|
1432
|
+
xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAPH0lEQVR4Xu2dP44sSRGH9wJcAgnN4wDcgBOszSnQe2OiZ2LhcoFBHAHhg9DMrjAWY611AAeDdXad1UoMEz2T83p+WdWdGRn/Mis+6ZNW+6ajqrszKjMjs6o/+yxR5eb2Lz95d/vw+c2Hh7ub9/ffvfrh4bHbl9e+u73/+LPbv/2cYuPxkiQkz4lw/5Hd+CU8Jc9TMmbiJJ5QA7y5/eLLqoFGlc41kybR4nRV9uwZpH16LzREw/eZJM2cxvjYsFY0kyVp5YYm0tiADibNo/BzSQ7MaWK90VBSSpaHz/HzSg7CUnMKbZ8m+fj5JQtymldkYoyZ1bD1yGGUvDn8WoDDVKIczQrYhGSPYW/2KBOQPYa/2aMEBb+o1NH399/h95M4UX05aSjx+0qMeNlCXn0haTxzfmIMfgHpHOL3mAiTvcb85iReCfyg07nF7zcZAD/cdA3xe046yX1TBzA3QvKoPsh0afH7Ty6AH156DLEdJEBuFUlzO/0OucEwLebCIjDVI3RSK++wnRySjQ8mTZ89+qbH6gNJ0w2x3RwC/BDS9JLYfpYG3/xs/u5P/3786p/fP/7yt19V/xZNOkc6Vzpn/LepPMpwq3rjk/iv//7wuAU1PvzbKH77/Y94uicin/M1sT0tBb7Z6P7iN39//OHH/2H7qvjpr++r13pL53QNSnp6j/ja6GK7WgJ8k5F9/8dvsC1dJGKC/Or3X+NpXoT+HmOEdbX9W7Osc7T0FluskCCFWYZfyzxDeIYV8j//41tsJ12slCAF6kUxZjSnX3GPvreqdyi1x4oJUgg/9Jp571b1ZoIo1XgKKydIIXJJG9vdFOCbiOJeuXaEIyQIQUNRPE4Usf2FBk8+ghoNpnCUBClE7U2wHYYkYsVKGzxeBFvWQUbBYwYw/g7gjZN2kxbBtIlcFuWWrXvAY3qL7TEUeLKe/uGv/8HvUgU8bjQtiFYSxnYZAjxJT7WhPU4zbdGgOcPevixJ8LieYvt0JdITDzWhRobHm03tYRcez81I6yPVyTlIV0ktpt8qvqHmEDRK74rt1AU8KQ+lVsSRKF+0plrl4Cgr8NheTYkwtKKruzS0mIjHWVkqCWvMUSJM3l0flo0nY+3oJkNkhTnGqNJzlAhJgu3WBDwJa6WTA+MfWen5nHuSeNyuW52EoZITTLpiRtwqEkFJvJME268qeHBLJSfk3l/aDEpejLwn7tiOVfC+x0OK7DX6lALjmmqxNlId1FApMG7aphQY11Jsz6J43j4rwYoLftZKFUcwrpWqZV88mJUSRL7ZZzZpB/MoniV1bNcieM09JBYCs+eQV6IncZu0a8xFqoMYKFGxysm4nhL323jdnYjtewivuccoWcbVV6IMjDEtFJ2LYHALR8lhlZ2jwy1arMWYFmI7Z+Ex9xjdYerVbR/Z0eGwy85piblIFVTZ0YcNzLwTl947JTddIEhqdOW/qQFFn0+NbnTEeBZie+8GA2o7CsaL7MjQhBpjxJ5yFIynLbb3Lqwf4TM6tMJ40dS674LAY3k6gvVQa+gh2BhM2xGiDz8kqj3XiLIYOjpMxnjaYrtvwrq0O9J7RC7nSix09hLh8xgZPloPHVklXwyiLZcoV01UYhFtFO9edeQ5yBhLVc4NVVUQRaf5IBuNkBwFPDdruVivY2H7v4j18IqL9YSuxZGhohaePcnI54GxNO0aZuGLNeX2Hl6rr5eU2OWqBZ6rpVyosIGxNMU82AVfqCkXz6viltIPOtAAz9lSLhhHU8yDTSy3lnC7X+vxaYuzgOdtJbeqZTqMbtl6Ur1IUS4Yx1sNaEGRhp/SC4ueJWAuGEdTzIcKfIGW3CGJ9bj0mlJc+52Rsk9LAq/hKXeOZtmLYD68wXJ4xQXjeCqxCMhNeG5xo4DxrOSCcdS8NMyiBZPqBUpy4DYmDUe3UxAYkyMXr9tdub0IxlHz0qJh9cdKcq+8GMdT7hddwHhcRxYlMZaVHCy3n2BevIJ/qCWHSL3HSKPUeJoHtzfDOFZyLy4YR0vMixM09sI/1JIDxvB0BIwlaQ+WV2Q0fEJvzUOs7v3grH1EWzXnol09ar2jL8I6Egerahb97g3mR+jhldUH02JrI0Ssdh3vEe0p9qHnoVsT9eqPlOSAMTzlgnG0xOFLpLkbygFjaIn5YZIgsw+vuAt1Hj0gJUqkHmNLDlZzp7fJYTRB5+BVr9+SC8ZJn+XehoxxNHyTIFY/xskBY3iJQ5dWrK54M8r9TDGOiueVLKsV9F401gy4hp5UTiwHjKHk3acEqf9RXM743XPnKcoh0vwpqpxt8CZzuvNKVvWPCnJWTzGGljQWviYH+vIxDlfqwUwahoO9WF04TROEA8aQljsG9mTFJOGAMTR8To7AFSyMIe2s4PuYXQ4YQ8NTgljdA9KL9kOoZwbfy+xy7prEGCpSJcviET+coYzmOJOzYBkFqy0rlnIm6hhDw9OjgCxKvJzt4RhD0pnB97KC0dpH8fRga4sE4ZR4MYaUM4PvZSV7MSlWUKm3+p8KUpmyF4whIXexLwImDcLRXkx2KFglSJRJGGesG4EV5x1oL3TRxRjiWiUIB4whIadYEAF8Hyvai3aV8+TREoSkJOHe9GTNEXqOIgeMoWHIBIm0h4lTYTHp/heTA8bQMGSCRNrFy6nARbjnezZ7sbqIZoJcMRPERs6wF2NoGDJBTCZgjWaC2JgJ0sHsCZJzkH4zQTrIBDmemSAdWM5BZlo8jHThkJYDxtAwZIJYVShm3NW7au/EAWNoGDJBCIwhLWd9Iwr4XlaQA8YQ94gr6cWZwfeygr1c+0UuEU8JYrDdPcpmxSLnfKKw6q7eXkyGmlYJEmW7OznjvKOw8t6sXiy2u59umLK45ZZTKsUYEs4871i5gkX2YtKT0j3pFg9t4DRMjCEh59lcUcD3spJR2kclJUjUx/5oPLSBYs6IydXSUc5aFMbQMPSD47SGFLNN0FeedxTDrqJHThACY0hJcyLqTXrkQMUJjNNj9N/3kJIDxtDwsAnCkQvGSWs5YAxx3zy82qDUG3Wc2Sq3F8E46Vs5zwmw+FGlU4m3YPEDOpxSr8UH0SrniyQosTBW+knOGplJ0QJ/Crr6AwV7sdzV2yIXjGPhDL9RSHLAGBq+SY6oCUJgDE859XrCsifc6uksj98rB4yhIeZH2ASJ9uVywThaXipjW2zP6JEzvCIwjoaYHyYJssJEl7sabzFcbN1nZrITtkEOVkmO+UEJcod/pCEHjOHp1hCmFe0vtxd8vbUcMIaGVLTC/Ai75YQwqVp0OALGkpJ2HvSCMSyNPJrA3HgF/1DD1mEAgnG8HQFjjRq5se3JwepCiXnxCv6hlhwwhrejP6UgVYLl9ByE9/oMB4yhJebFKxYr6iSHiA9jG2U0SbgFAwJjWco9b4yj4u0XX2JevGI1D+FefTGOt9zh4jm0k7U3UbhDqsKMvYdZuR9X0JHqBUpyiFKePPfSukMvtF9tK1no/1ED4Q6nztG6jaBV7ueFcbTEfKiIPMwiME4EZwLP3VouGEfF8x28e1gNs7jDk4hzEXIGtNdhrsmde1hVr64OrwrVC5XkgnGiGJkIdyZywThaYh7sgi/UkjvZ9J5k7sntFbWhcf/W3MZSzv1AhGWvh3mwi8X9IUUuGCeKI1tRNLB6zvE1uWAcNVuHV4UqgJLcHZ0ExopkBLwrVkUuZqXdDx29RwEDaMrFbPLGkHoSbklTgijFjJFhJ8bSFNv/VSyHWSP1fYwVTe5NViPgOXjKxeTZu8Xe4VWhCqQoF4v7LCTk3JPfi+WEtkXO864KGEtTbPfN3BjdI0JyK1pE1KrWltxtNpcwvdo2OjK3tEz0zXs/esCAmo6AsWZw5KJAieZdur3kCBhLU2zv3WBATUfH6xhvRqnR0+dAV1EyciFiy9EyN8ZTtWVryTWstp4UR8F4qa2jYDxNsa2zwcCajl6BIu74PYojk3IC46kq0XsULEu+5OhQK+KkdXW5GxELGE9dbml3j+oAyo4yU2VrdkcqVoTHdhhs38NYz0XIUSy3KhxVibI1xlRXuvcoVAdSdnSoRWRPoueUyfFBofcoWPyeITrafROZJPJO+71o9R6F6oAGSpATdzlHJ+SEx7yDxPYsjsdchJQgyvbvmR0t5RYwroXYltXAA1soMR8hvK5cKygFxjVRct2jheoEDJRKEiLyPqZoji7enoOxrcT2q47V44FQicpJIcvA113k877D9mvCxomYyH0AwBY55NpXar5BuFSsXsR2a4ZH2bc4civnFlnl+qTkBYhw3ZGsXda9RnVChkqUG8/J3kS21yBc742/9CBqS6oTM1T6akccsRys8YAJz2EVie3UDc+hFilZ3TonwtMItZXuhQt4HGuxjbqDJ2it9JzkHO8roYYSW0X2cJ1zvIjtMwR4kh5qMssTVPa0eFYXHtNDbJehwJP10IKZhl9aw6hzolw8sD2G48bwUUGX1Ji8b4HHjaYFrpWqM4cf4WMFnriXWpP3cyLfA28BHtNTbIehwZP3VHuIEXFfl+T+qS2iLaxi+5sCfBOejjyk7RoRE0Szque4p2pTbHfT4HXvyCVHHpS9x1ESJGJhAtvcdFg/MqhVSY6QIBg/grRAje1tSt7d3n/ENxdBqWHXygkSbThVnKZi1QptHMM3GcXRkvCKCRKldLslXXCxfS2B101WrXJ7lJUSJGqP8WqUHbpaVG84oL2JskKChE8McvXkKFRvPKitC40RE6RlHYS2h0TYWNjkUZKjUH0Awd37CbXIY/W9uZXlLziJeLTkKESfk+xJDY/uvJuhoZWhVrSV7w59HrgQhcjVrdTXZatVvURdJ0n9XG6dY5SoK+6pvcuskEsTce9Waiu2iWQD/NDSY4jtILkAfnjpwlo/WHoVcvK+vjkZFwA/1HQN8XtOBsAPN51b/H4TAbLKNb/4nSYKzLpF5dAedT+VF9mbTKT3TxAcmdzLFdpjbzSMxMaXk3qZ6xoxyWGXv/idJAHx/r2SQ5rzjPnIHkVf/MyTCckeRcHsMdYje5RBc/J9HPIGrXZzQ+GByeHXBXMYlZyTyfKQSZG0cZqvHGHPV+6RSkZZLlloe072FIkmp0n+DEnzdI75lJAkBC9l5DuXxHk65ukW5ewZktk4Jc6Tzw34aXhDCdSTROXvn16bSWDL/wHsQpzQgNCUNwAAAABJRU5ErkJggg=="
|
|
1433
|
+
}
|
|
1434
|
+
))
|
|
1435
|
+
);
|
|
1436
|
+
};
|
|
1437
|
+
var EURC_default = EURC;
|
|
1438
|
+
|
|
1361
1439
|
// src/utils/constants.tsx
|
|
1362
1440
|
import {
|
|
1363
1441
|
arbitrum,
|
|
@@ -1366,9 +1444,12 @@ import {
|
|
|
1366
1444
|
avalancheFuji,
|
|
1367
1445
|
base,
|
|
1368
1446
|
baseSepolia,
|
|
1447
|
+
berachain,
|
|
1369
1448
|
berachainBepolia,
|
|
1370
1449
|
bsc,
|
|
1371
1450
|
bscTestnet,
|
|
1451
|
+
confluxESpace,
|
|
1452
|
+
confluxESpaceTestnet,
|
|
1372
1453
|
mainnet,
|
|
1373
1454
|
optimism,
|
|
1374
1455
|
optimismSepolia,
|
|
@@ -1392,6 +1473,7 @@ var ChainName = /* @__PURE__ */ ((ChainName2) => {
|
|
|
1392
1473
|
ChainName2["FIAT"] = "FIAT";
|
|
1393
1474
|
ChainName2["BTC"] = "BTC";
|
|
1394
1475
|
ChainName2["BERA"] = "BERA";
|
|
1476
|
+
ChainName2["CFX"] = "CFX";
|
|
1395
1477
|
return ChainName2;
|
|
1396
1478
|
})(ChainName || {});
|
|
1397
1479
|
var CHAIN_NAMES_TO_APPKIT_NETWORK_MAINNET = {
|
|
@@ -1402,7 +1484,9 @@ var CHAIN_NAMES_TO_APPKIT_NETWORK_MAINNET = {
|
|
|
1402
1484
|
["BSC" /* BSC */]: bsc,
|
|
1403
1485
|
["OPT" /* OPTIMISM */]: optimism,
|
|
1404
1486
|
["ARB" /* ARBITRUM */]: arbitrum,
|
|
1405
|
-
["ZKE" /* POLYGON_ZKEVM */]: polygonZkEvm
|
|
1487
|
+
["ZKE" /* POLYGON_ZKEVM */]: polygonZkEvm,
|
|
1488
|
+
["BERA" /* BERA */]: berachain,
|
|
1489
|
+
["CFX" /* CFX */]: confluxESpace
|
|
1406
1490
|
};
|
|
1407
1491
|
var CHAIN_NAMES_TO_APPKIT_NETWORK_TESTNET = {
|
|
1408
1492
|
["ETH" /* ETHEREUM */]: sepolia,
|
|
@@ -1413,7 +1497,8 @@ var CHAIN_NAMES_TO_APPKIT_NETWORK_TESTNET = {
|
|
|
1413
1497
|
["OPT" /* OPTIMISM */]: optimismSepolia,
|
|
1414
1498
|
["ARB" /* ARBITRUM */]: arbitrumSepolia,
|
|
1415
1499
|
["ZKE" /* POLYGON_ZKEVM */]: polygonZkEvmCardona,
|
|
1416
|
-
["BERA" /* BERA */]: berachainBepolia
|
|
1500
|
+
["BERA" /* BERA */]: berachainBepolia,
|
|
1501
|
+
["CFX" /* CFX */]: confluxESpaceTestnet
|
|
1417
1502
|
};
|
|
1418
1503
|
var CHAIN_NAMES_TO_STRING = {
|
|
1419
1504
|
["ETH" /* ETHEREUM */]: "Ethereum",
|
|
@@ -1428,7 +1513,8 @@ var CHAIN_NAMES_TO_STRING = {
|
|
|
1428
1513
|
["FIAT" /* FIAT */]: "Pay with FIAT",
|
|
1429
1514
|
["BTC" /* BTC */]: "Bitcoin",
|
|
1430
1515
|
["BASE" /* BASE */]: "Base",
|
|
1431
|
-
["BERA" /* BERA */]: "Bera"
|
|
1516
|
+
["BERA" /* BERA */]: "Bera",
|
|
1517
|
+
["CFX" /* CFX */]: "Conflux"
|
|
1432
1518
|
};
|
|
1433
1519
|
var CHAIN_STRING_TO_NAME = {
|
|
1434
1520
|
["Ethereum"]: "ETH" /* ETHEREUM */,
|
|
@@ -1443,7 +1529,8 @@ var CHAIN_STRING_TO_NAME = {
|
|
|
1443
1529
|
["Pay with FIAT"]: "FIAT" /* FIAT */,
|
|
1444
1530
|
["Bitcoin"]: "BTC" /* BTC */,
|
|
1445
1531
|
["Base"]: "BASE" /* BASE */,
|
|
1446
|
-
["Bera"]: "BERA" /* BERA
|
|
1532
|
+
["Bera"]: "BERA" /* BERA */,
|
|
1533
|
+
["Conflux"]: "CFX" /* CFX */
|
|
1447
1534
|
};
|
|
1448
1535
|
var networkOptions = [
|
|
1449
1536
|
{
|
|
@@ -1467,6 +1554,11 @@ var networkOptions = [
|
|
|
1467
1554
|
label: "Bitcoin",
|
|
1468
1555
|
icon: BTC_default
|
|
1469
1556
|
},
|
|
1557
|
+
{
|
|
1558
|
+
id: "CFX" /* CFX */,
|
|
1559
|
+
label: "Conflux",
|
|
1560
|
+
icon: CFX_default
|
|
1561
|
+
},
|
|
1470
1562
|
{
|
|
1471
1563
|
id: "ETH" /* ETHEREUM */,
|
|
1472
1564
|
label: "Ethereum",
|
|
@@ -1510,7 +1602,7 @@ var networkOptions = [
|
|
|
1510
1602
|
];
|
|
1511
1603
|
var CLUSTER = "devnet";
|
|
1512
1604
|
var SOLANA_HOST = clusterApiUrl(CLUSTER);
|
|
1513
|
-
var isEVMChain = (chainId) => chainId === "ETH" /* ETHEREUM */ || chainId === "POL" /* POLYGON */ || chainId === "AVX" /* AVALANCHE */ || chainId === "BSC" /* BSC */ || chainId === "OPT" /* OPTIMISM */ || chainId === "ARB" /* ARBITRUM */ || chainId === "ZKE" /* POLYGON_ZKEVM */ || chainId === "BASE" /* BASE */ || chainId === "BERA" /* BERA */;
|
|
1605
|
+
var isEVMChain = (chainId) => chainId === "ETH" /* ETHEREUM */ || chainId === "POL" /* POLYGON */ || chainId === "AVX" /* AVALANCHE */ || chainId === "BSC" /* BSC */ || chainId === "OPT" /* OPTIMISM */ || chainId === "ARB" /* ARBITRUM */ || chainId === "ZKE" /* POLYGON_ZKEVM */ || chainId === "BASE" /* BASE */ || chainId === "BERA" /* BERA */ || chainId === "CFX" /* CFX */;
|
|
1514
1606
|
var lightDemoAccounts = {
|
|
1515
1607
|
EVM: "0x1150bd27bA25fa13806C98324F201dfe815A4502",
|
|
1516
1608
|
// EVM: '0x10962c43ea1bfE1186Dbf59985Df4E1ce94Ca4a9', // personal for testing
|
|
@@ -1519,7 +1611,15 @@ var lightDemoAccounts = {
|
|
|
1519
1611
|
TRX: "TBVn4bsBN4DhtZ7D3vEVpAyqkvdFn7zmpU"
|
|
1520
1612
|
// TRX: 'TL6yGtzbHfQdBRFYh4TLFoU5iiPMmpQtur' // personal for testing
|
|
1521
1613
|
};
|
|
1522
|
-
var lightDemoNetworks = [
|
|
1614
|
+
var lightDemoNetworks = [
|
|
1615
|
+
"ARB",
|
|
1616
|
+
"AVX",
|
|
1617
|
+
"BASE",
|
|
1618
|
+
"OPT",
|
|
1619
|
+
"BSC",
|
|
1620
|
+
"SOL",
|
|
1621
|
+
"TRX"
|
|
1622
|
+
];
|
|
1523
1623
|
|
|
1524
1624
|
// src/interface.tsx
|
|
1525
1625
|
var NetworkOptions = /* @__PURE__ */ ((NetworkOptions4) => {
|
|
@@ -2072,7 +2172,7 @@ var useGetEnvOptions = ({
|
|
|
2072
2172
|
};
|
|
2073
2173
|
|
|
2074
2174
|
// plugins/evm/index.tsx
|
|
2075
|
-
import
|
|
2175
|
+
import React43 from "react";
|
|
2076
2176
|
|
|
2077
2177
|
// plugins/PluginBase.ts
|
|
2078
2178
|
var PluginBase = class {
|
|
@@ -2109,7 +2209,7 @@ var PluginBase = class {
|
|
|
2109
2209
|
};
|
|
2110
2210
|
|
|
2111
2211
|
// plugins/evm/features/walletConnect/WalletProvider.tsx
|
|
2112
|
-
import
|
|
2212
|
+
import React42, { useEffect, useState } from "react";
|
|
2113
2213
|
|
|
2114
2214
|
// plugins/evm/config/modalConfig.ts
|
|
2115
2215
|
import { createAppKit } from "@reown/appkit/react";
|
|
@@ -2128,7 +2228,9 @@ import {
|
|
|
2128
2228
|
optimismSepolia as optimismSepolia2,
|
|
2129
2229
|
polygon as polygon2,
|
|
2130
2230
|
polygonAmoy as polygonAmoy2,
|
|
2131
|
-
sepolia as sepolia3
|
|
2231
|
+
sepolia as sepolia3,
|
|
2232
|
+
confluxESpace as confluxESpace2,
|
|
2233
|
+
confluxESpaceTestnet as confluxESpaceTestnet2
|
|
2132
2234
|
} from "@reown/appkit/networks";
|
|
2133
2235
|
import { EthersAdapter } from "@reown/appkit-adapter-ethers";
|
|
2134
2236
|
var appkitMainnetChains = [
|
|
@@ -2138,7 +2240,8 @@ var appkitMainnetChains = [
|
|
|
2138
2240
|
base2,
|
|
2139
2241
|
arbitrum2,
|
|
2140
2242
|
optimism2,
|
|
2141
|
-
avalanche2
|
|
2243
|
+
avalanche2,
|
|
2244
|
+
confluxESpace2
|
|
2142
2245
|
];
|
|
2143
2246
|
var appkitTestnetChains = [
|
|
2144
2247
|
sepolia3,
|
|
@@ -2148,7 +2251,8 @@ var appkitTestnetChains = [
|
|
|
2148
2251
|
arbitrumSepolia3,
|
|
2149
2252
|
optimismSepolia2,
|
|
2150
2253
|
avalancheFuji2,
|
|
2151
|
-
berachainBepolia2
|
|
2254
|
+
berachainBepolia2,
|
|
2255
|
+
confluxESpaceTestnet2
|
|
2152
2256
|
];
|
|
2153
2257
|
var metadata = {
|
|
2154
2258
|
name: "Kima Transaction Widget",
|
|
@@ -2197,9 +2301,9 @@ var WalletProvider = ({
|
|
|
2197
2301
|
}
|
|
2198
2302
|
}, [networkOption, isLoading, walletConnectProjectId]);
|
|
2199
2303
|
if (!isReady) {
|
|
2200
|
-
return /* @__PURE__ */
|
|
2304
|
+
return /* @__PURE__ */ React42.createElement(React42.Fragment, null);
|
|
2201
2305
|
}
|
|
2202
|
-
return /* @__PURE__ */
|
|
2306
|
+
return /* @__PURE__ */ React42.createElement(React42.Fragment, null, children);
|
|
2203
2307
|
};
|
|
2204
2308
|
var WalletProvider_default = WalletProvider;
|
|
2205
2309
|
|
|
@@ -2242,135 +2346,6 @@ var selectCCTransactionIdSeed = (state) => state.option.ccTransactionIdSeed;
|
|
|
2242
2346
|
var selectCCTransactionStatus = (state) => state.option.ccTransactionStatus;
|
|
2243
2347
|
var selectCCTransactionRetrying = (state) => state.option.ccTransactionRetrying;
|
|
2244
2348
|
|
|
2245
|
-
// plugins/evm/utils/constants.tsx
|
|
2246
|
-
import { clusterApiUrl as clusterApiUrl2 } from "@solana/web3.js";
|
|
2247
|
-
|
|
2248
|
-
// plugins/evm/assets/icons/Cross.tsx
|
|
2249
|
-
import React41 from "react";
|
|
2250
|
-
|
|
2251
|
-
// plugins/evm/assets/icons/Minimize.tsx
|
|
2252
|
-
import React42 from "react";
|
|
2253
|
-
|
|
2254
|
-
// plugins/evm/assets/icons/FooterLogo.tsx
|
|
2255
|
-
import React43 from "react";
|
|
2256
|
-
|
|
2257
|
-
// plugins/evm/assets/icons/Check.tsx
|
|
2258
|
-
import React44 from "react";
|
|
2259
|
-
|
|
2260
|
-
// plugins/evm/assets/icons/Warning.tsx
|
|
2261
|
-
import React45 from "react";
|
|
2262
|
-
|
|
2263
|
-
// plugins/evm/assets/icons/ArrowRight.tsx
|
|
2264
|
-
import React46 from "react";
|
|
2265
|
-
|
|
2266
|
-
// plugins/evm/assets/icons/Arrow.tsx
|
|
2267
|
-
import React47 from "react";
|
|
2268
|
-
|
|
2269
|
-
// plugins/evm/assets/icons/Lock.tsx
|
|
2270
|
-
import React48 from "react";
|
|
2271
|
-
|
|
2272
|
-
// plugins/evm/assets/icons/Ethereum.tsx
|
|
2273
|
-
import React49 from "react";
|
|
2274
|
-
|
|
2275
|
-
// plugins/evm/assets/icons/Solana.tsx
|
|
2276
|
-
import React50 from "react";
|
|
2277
|
-
|
|
2278
|
-
// plugins/evm/assets/icons/Polygon.tsx
|
|
2279
|
-
import React51 from "react";
|
|
2280
|
-
|
|
2281
|
-
// plugins/evm/assets/icons/Polygon_zkEVM.tsx
|
|
2282
|
-
import React52 from "react";
|
|
2283
|
-
|
|
2284
|
-
// plugins/evm/assets/icons/Loader.tsx
|
|
2285
|
-
import React53 from "react";
|
|
2286
|
-
|
|
2287
|
-
// plugins/evm/assets/icons/Error.tsx
|
|
2288
|
-
import React54 from "react";
|
|
2289
|
-
|
|
2290
|
-
// plugins/evm/assets/icons/Avalanche.tsx
|
|
2291
|
-
import React55 from "react";
|
|
2292
|
-
|
|
2293
|
-
// plugins/evm/assets/icons/Arbitrum.tsx
|
|
2294
|
-
import React56 from "react";
|
|
2295
|
-
|
|
2296
|
-
// plugins/evm/assets/icons/Optimism.tsx
|
|
2297
|
-
import React57 from "react";
|
|
2298
|
-
|
|
2299
|
-
// plugins/evm/assets/icons/USDC.tsx
|
|
2300
|
-
import React58 from "react";
|
|
2301
|
-
|
|
2302
|
-
// plugins/evm/assets/icons/USDT.tsx
|
|
2303
|
-
import React59 from "react";
|
|
2304
|
-
|
|
2305
|
-
// plugins/evm/assets/icons/USDK.tsx
|
|
2306
|
-
import React60 from "react";
|
|
2307
|
-
|
|
2308
|
-
// plugins/evm/assets/icons/Fuse.tsx
|
|
2309
|
-
import React61 from "react";
|
|
2310
|
-
|
|
2311
|
-
// plugins/evm/assets/icons/Celo.tsx
|
|
2312
|
-
import React62 from "react";
|
|
2313
|
-
|
|
2314
|
-
// plugins/evm/assets/icons/GoodDollar.tsx
|
|
2315
|
-
import React63 from "react";
|
|
2316
|
-
|
|
2317
|
-
// plugins/evm/assets/icons/Copy.tsx
|
|
2318
|
-
import React64 from "react";
|
|
2319
|
-
|
|
2320
|
-
// plugins/evm/assets/icons/Bank.tsx
|
|
2321
|
-
import React65 from "react";
|
|
2322
|
-
|
|
2323
|
-
// plugins/evm/assets/icons/BSC.tsx
|
|
2324
|
-
import React66 from "react";
|
|
2325
|
-
|
|
2326
|
-
// plugins/evm/assets/icons/KEUR.tsx
|
|
2327
|
-
import React67 from "react";
|
|
2328
|
-
|
|
2329
|
-
// plugins/evm/assets/icons/Tron.tsx
|
|
2330
|
-
import React68 from "react";
|
|
2331
|
-
|
|
2332
|
-
// plugins/evm/assets/icons/BTC.tsx
|
|
2333
|
-
import React69 from "react";
|
|
2334
|
-
|
|
2335
|
-
// plugins/evm/assets/icons/Wallet.tsx
|
|
2336
|
-
import React70 from "react";
|
|
2337
|
-
|
|
2338
|
-
// plugins/evm/assets/icons/Explorer.tsx
|
|
2339
|
-
import React71 from "react";
|
|
2340
|
-
|
|
2341
|
-
// plugins/evm/assets/icons/ExternalUrl.tsx
|
|
2342
|
-
import React72 from "react";
|
|
2343
|
-
|
|
2344
|
-
// plugins/evm/assets/icons/Base.tsx
|
|
2345
|
-
import React73 from "react";
|
|
2346
|
-
|
|
2347
|
-
// plugins/evm/assets/icons/Bera.tsx
|
|
2348
|
-
import React74 from "react";
|
|
2349
|
-
|
|
2350
|
-
// plugins/evm/utils/constants.tsx
|
|
2351
|
-
import {
|
|
2352
|
-
arbitrum as arbitrum3,
|
|
2353
|
-
arbitrumSepolia as arbitrumSepolia4,
|
|
2354
|
-
avalanche as avalanche3,
|
|
2355
|
-
avalancheFuji as avalancheFuji3,
|
|
2356
|
-
base as base3,
|
|
2357
|
-
baseSepolia as baseSepolia3,
|
|
2358
|
-
bsc as bsc3,
|
|
2359
|
-
bscTestnet as bscTestnet3,
|
|
2360
|
-
mainnet as mainnet3,
|
|
2361
|
-
optimism as optimism3,
|
|
2362
|
-
optimismSepolia as optimismSepolia3,
|
|
2363
|
-
polygon as polygon3,
|
|
2364
|
-
polygonAmoy as polygonAmoy3,
|
|
2365
|
-
polygonZkEvm as polygonZkEvm2,
|
|
2366
|
-
polygonZkEvmCardona as polygonZkEvmCardona2,
|
|
2367
|
-
sepolia as sepolia4,
|
|
2368
|
-
berachainTestnetbArtio
|
|
2369
|
-
} from "@reown/appkit/networks";
|
|
2370
|
-
var CLUSTER2 = "devnet";
|
|
2371
|
-
var SOLANA_HOST2 = clusterApiUrl2(CLUSTER2);
|
|
2372
|
-
var isEVMChain2 = (chainId) => chainId === "ETH" /* ETHEREUM */ || chainId === "POL" /* POLYGON */ || chainId === "AVX" /* AVALANCHE */ || chainId === "BSC" /* BSC */ || chainId === "OPT" /* OPTIMISM */ || chainId === "ARB" /* ARBITRUM */ || chainId === "ZKE" /* POLYGON_ZKEVM */ || chainId === "BASE" /* BASE */ || chainId === "BERA" /* BERA */;
|
|
2373
|
-
|
|
2374
2349
|
// plugins/evm/core/hooks/useEvmProvider.ts
|
|
2375
2350
|
import { useAppKitAccount, useAppKitProvider } from "@reown/appkit/react";
|
|
2376
2351
|
import { BrowserProvider, JsonRpcSigner } from "ethers";
|
|
@@ -2586,7 +2561,7 @@ function useBalance() {
|
|
|
2586
2561
|
const { pools } = useGetPools_default(backendUrl, networkOption);
|
|
2587
2562
|
const { walletAddress, walletProvider } = useEvmProvider();
|
|
2588
2563
|
const userAddress = mode === "light" /* light */ ? lightDemoAccounts.EVM : walletAddress;
|
|
2589
|
-
const enabled = !!userAddress && !!tokenOptions && !!selectedCoin && pools.length > 0 &&
|
|
2564
|
+
const enabled = !!userAddress && !!tokenOptions && !!selectedCoin && pools.length > 0 && isEVMChain(sourceChain.shortName) && (!!walletProvider || mode === "light" /* light */);
|
|
2590
2565
|
const { data: allowanceData } = useQuery3({
|
|
2591
2566
|
queryKey: [
|
|
2592
2567
|
"evmAllowance",
|
|
@@ -2805,23 +2780,22 @@ function useIsWalletReady() {
|
|
|
2805
2780
|
const [statusMessage, setStatusMessage] = useState2("Wallet not connected");
|
|
2806
2781
|
const [connectedAddress, setConnectedAddress] = useState2("");
|
|
2807
2782
|
const switchNetwork = useCallback(async () => {
|
|
2783
|
+
if (!sourceChain || !appKitModel) return;
|
|
2784
|
+
if (sourceChain.compatibility !== "EVM" /* EVM */) return;
|
|
2808
2785
|
logger_default.debug("useIsWalletReady:EVM:Attempting to switch network...", {
|
|
2809
2786
|
hasProvider: !!appkitProvider,
|
|
2810
2787
|
sourceChain,
|
|
2811
2788
|
modalExists: appKitModel !== null,
|
|
2812
2789
|
modal: appKitModel
|
|
2813
2790
|
});
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
} catch (e) {
|
|
2823
|
-
logger_default.error("useIsWalletReady:EVM:Network switch failed:", e);
|
|
2824
|
-
}
|
|
2791
|
+
try {
|
|
2792
|
+
appKitModel.switchNetwork(sourceChain);
|
|
2793
|
+
logger_default.debug(
|
|
2794
|
+
"useIsWalletReady:EVM:Network switch successful to:",
|
|
2795
|
+
sourceChain.name
|
|
2796
|
+
);
|
|
2797
|
+
} catch (e) {
|
|
2798
|
+
logger_default.warn("useIsWalletReady:EVM:Network switch failed:", e);
|
|
2825
2799
|
}
|
|
2826
2800
|
}, [appkitProvider, sourceChain]);
|
|
2827
2801
|
useEffect2(() => {
|
|
@@ -3053,7 +3027,7 @@ var EvmPlugin = class extends PluginBase {
|
|
|
3053
3027
|
walletConnectProjectId,
|
|
3054
3028
|
isLoading
|
|
3055
3029
|
}) => {
|
|
3056
|
-
return /* @__PURE__ */
|
|
3030
|
+
return /* @__PURE__ */ React43.createElement(
|
|
3057
3031
|
WalletProvider_default,
|
|
3058
3032
|
{
|
|
3059
3033
|
children,
|
|
@@ -3069,10 +3043,10 @@ var evmPlugin = new EvmPlugin(store);
|
|
|
3069
3043
|
var evm_default = evmPlugin;
|
|
3070
3044
|
|
|
3071
3045
|
// plugins/solana/index.tsx
|
|
3072
|
-
import
|
|
3046
|
+
import React45 from "react";
|
|
3073
3047
|
|
|
3074
3048
|
// plugins/solana/features/walletConnect/WalletProvider.tsx
|
|
3075
|
-
import
|
|
3049
|
+
import React44 from "react";
|
|
3076
3050
|
import {
|
|
3077
3051
|
ConnectionProvider,
|
|
3078
3052
|
WalletProvider as SolanaWalletProvider
|
|
@@ -3087,9 +3061,9 @@ import {
|
|
|
3087
3061
|
} from "@solana/wallet-adapter-wallets";
|
|
3088
3062
|
|
|
3089
3063
|
// plugins/solana/utils/constants.tsx
|
|
3090
|
-
import { clusterApiUrl as
|
|
3064
|
+
import { clusterApiUrl as clusterApiUrl2 } from "@solana/web3.js";
|
|
3091
3065
|
function getHostEndpoint(networkOption) {
|
|
3092
|
-
return networkOption === "mainnet" ? "https://solana-rpc.publicnode.com" :
|
|
3066
|
+
return networkOption === "mainnet" ? "https://solana-rpc.publicnode.com" : clusterApiUrl2("devnet");
|
|
3093
3067
|
}
|
|
3094
3068
|
var networkOptions2 = [
|
|
3095
3069
|
{
|
|
@@ -3110,7 +3084,7 @@ var WalletProvider2 = ({
|
|
|
3110
3084
|
logger_default.debug(
|
|
3111
3085
|
`WalletProvider initialized with projectId: ${walletConnectProjectId}`
|
|
3112
3086
|
);
|
|
3113
|
-
return /* @__PURE__ */
|
|
3087
|
+
return /* @__PURE__ */ React44.createElement(ConnectionProvider, { endpoint }, /* @__PURE__ */ React44.createElement(
|
|
3114
3088
|
SolanaWalletProvider,
|
|
3115
3089
|
{
|
|
3116
3090
|
autoConnect: false,
|
|
@@ -3198,6 +3172,16 @@ var getTokenAllowance2 = async ({
|
|
|
3198
3172
|
);
|
|
3199
3173
|
const accountInfo = await connection.getParsedAccountInfo(tokenAccountAddress);
|
|
3200
3174
|
const parsedAccountInfo = accountInfo?.value?.data;
|
|
3175
|
+
if (!parsedAccountInfo) {
|
|
3176
|
+
logger_default.warn(
|
|
3177
|
+
`Sol:getTokenAllowance: No token ${selectedCoin} account info found for ${userPublicKey.toBase58()}`
|
|
3178
|
+
);
|
|
3179
|
+
return {
|
|
3180
|
+
allowance: BigInt(0),
|
|
3181
|
+
balance: BigInt(0),
|
|
3182
|
+
decimals: 0
|
|
3183
|
+
};
|
|
3184
|
+
}
|
|
3201
3185
|
return {
|
|
3202
3186
|
allowance: parsedAccountInfo.parsed?.info?.delegate === poolAddress ? BigInt(parsedAccountInfo.parsed?.info?.delegatedAmount?.amount ?? 0) : BigInt(0),
|
|
3203
3187
|
balance: BigInt(parsedAccountInfo.parsed?.info?.tokenAmount?.amount ?? 0),
|
|
@@ -3457,7 +3441,7 @@ var SolanaPlugin = class extends PluginBase {
|
|
|
3457
3441
|
networkOption,
|
|
3458
3442
|
walletConnectProjectId
|
|
3459
3443
|
}) => {
|
|
3460
|
-
return /* @__PURE__ */
|
|
3444
|
+
return /* @__PURE__ */ React45.createElement(
|
|
3461
3445
|
WalletProvider_default2,
|
|
3462
3446
|
{
|
|
3463
3447
|
networkOption,
|
|
@@ -3471,10 +3455,10 @@ var solanaPlugin = new SolanaPlugin(store);
|
|
|
3471
3455
|
var solana_default = solanaPlugin;
|
|
3472
3456
|
|
|
3473
3457
|
// plugins/tron/index.tsx
|
|
3474
|
-
import
|
|
3458
|
+
import React47 from "react";
|
|
3475
3459
|
|
|
3476
3460
|
// plugins/tron/features/walletConnect/WalletProvider.tsx
|
|
3477
|
-
import
|
|
3461
|
+
import React46, { useMemo as useMemo3 } from "react";
|
|
3478
3462
|
import { WalletProvider as TronWalletProviderBase } from "@tronweb3/tronwallet-adapter-react-hooks";
|
|
3479
3463
|
import { LedgerAdapter } from "@tronweb3/tronwallet-adapter-ledger";
|
|
3480
3464
|
import { TronLinkAdapter } from "@tronweb3/tronwallet-adapter-tronlink";
|
|
@@ -3516,7 +3500,7 @@ var WalletProvider3 = ({ children, networkOption }) => {
|
|
|
3516
3500
|
adapters[0].switchChain("0x2b6653dc");
|
|
3517
3501
|
}
|
|
3518
3502
|
};
|
|
3519
|
-
return /* @__PURE__ */
|
|
3503
|
+
return /* @__PURE__ */ React46.createElement(
|
|
3520
3504
|
TronWalletProviderBase,
|
|
3521
3505
|
{
|
|
3522
3506
|
adapters,
|
|
@@ -4074,7 +4058,7 @@ var TronPlugin = class extends PluginBase {
|
|
|
4074
4058
|
networkOption,
|
|
4075
4059
|
walletConnectProjectId
|
|
4076
4060
|
}) => {
|
|
4077
|
-
return /* @__PURE__ */
|
|
4061
|
+
return /* @__PURE__ */ React47.createElement(
|
|
4078
4062
|
WalletProvider_default3,
|
|
4079
4063
|
{
|
|
4080
4064
|
networkOption,
|
|
@@ -4088,7 +4072,7 @@ var tronPlugin = new TronPlugin(store);
|
|
|
4088
4072
|
var tron_default = tronPlugin;
|
|
4089
4073
|
|
|
4090
4074
|
// plugins/credit-card/index.tsx
|
|
4091
|
-
import
|
|
4075
|
+
import React48 from "react";
|
|
4092
4076
|
|
|
4093
4077
|
// plugins/credit-card/core/hooks/useIsProviderReady.tsx
|
|
4094
4078
|
import { useDispatch as useDispatch5, useSelector as useSelector15 } from "react-redux";
|
|
@@ -4098,12 +4082,10 @@ var useIsProviderReady = () => {
|
|
|
4098
4082
|
const dispatch = useDispatch5();
|
|
4099
4083
|
const sourceChain = useSelector15(selectSourceChain);
|
|
4100
4084
|
useEffect5(() => {
|
|
4101
|
-
if (sourceChain.
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
setIsReady(true);
|
|
4106
|
-
}
|
|
4085
|
+
if (!sourceChain || sourceChain.shortName !== "CC") return;
|
|
4086
|
+
logger_default.debug("CC:useIsProviderReady: dispatching changes from fiat...");
|
|
4087
|
+
dispatch(setSourceAddress(""));
|
|
4088
|
+
setIsReady(true);
|
|
4107
4089
|
}, [sourceChain]);
|
|
4108
4090
|
return { isReady, statusMessage: "", walletAddres: "" };
|
|
4109
4091
|
};
|
|
@@ -4146,7 +4128,7 @@ var CreditCardPlugin = class extends PluginBase {
|
|
|
4146
4128
|
return chain.compatibility === "CC";
|
|
4147
4129
|
};
|
|
4148
4130
|
Provider = ({ children }) => {
|
|
4149
|
-
return /* @__PURE__ */
|
|
4131
|
+
return /* @__PURE__ */ React48.createElement(React48.Fragment, null, children);
|
|
4150
4132
|
};
|
|
4151
4133
|
};
|
|
4152
4134
|
var creditCardPlugin = new CreditCardPlugin(store);
|
|
@@ -4167,7 +4149,7 @@ var useKimaContext = () => {
|
|
|
4167
4149
|
}
|
|
4168
4150
|
return context;
|
|
4169
4151
|
};
|
|
4170
|
-
var InternalKimaProvider =
|
|
4152
|
+
var InternalKimaProvider = React49.memo(
|
|
4171
4153
|
({ kimaBackendUrl, walletConnectProjectId, children, logLevel }) => {
|
|
4172
4154
|
const { data: envOptions, isLoading } = useGetEnvOptions({
|
|
4173
4155
|
kimaBackendUrl
|
|
@@ -4181,7 +4163,7 @@ var InternalKimaProvider = React81.memo(
|
|
|
4181
4163
|
const plugin = getPluginProvider(pluginData.id);
|
|
4182
4164
|
if (plugin) {
|
|
4183
4165
|
const { Provider: Provider3 } = plugin;
|
|
4184
|
-
return /* @__PURE__ */
|
|
4166
|
+
return /* @__PURE__ */ React49.createElement(
|
|
4185
4167
|
Provider3,
|
|
4186
4168
|
{
|
|
4187
4169
|
key: plugin.data.id,
|
|
@@ -4195,12 +4177,12 @@ var InternalKimaProvider = React81.memo(
|
|
|
4195
4177
|
return acc;
|
|
4196
4178
|
}, children);
|
|
4197
4179
|
}, [plugins, walletConnectProjectId, envOptions, isLoading]);
|
|
4198
|
-
return /* @__PURE__ */
|
|
4180
|
+
return /* @__PURE__ */ React49.createElement(React49.Fragment, null, WrappedProviders);
|
|
4199
4181
|
}
|
|
4200
4182
|
);
|
|
4201
4183
|
var KimaProvider = ({
|
|
4202
4184
|
walletConnectProjectId,
|
|
4203
|
-
children = /* @__PURE__ */
|
|
4185
|
+
children = /* @__PURE__ */ React49.createElement(React49.Fragment, null),
|
|
4204
4186
|
externalProvider,
|
|
4205
4187
|
kimaBackendUrl = "http://localhost:3001",
|
|
4206
4188
|
logLevel,
|
|
@@ -4235,7 +4217,7 @@ var KimaProvider = ({
|
|
|
4235
4217
|
errorHandler,
|
|
4236
4218
|
switchChainHandler
|
|
4237
4219
|
};
|
|
4238
|
-
return /* @__PURE__ */
|
|
4220
|
+
return /* @__PURE__ */ React49.createElement(QueryClientProvider, { client: queryClient }, /* @__PURE__ */ React49.createElement(Provider, { store }, /* @__PURE__ */ React49.createElement(KimaContext.Provider, { value: kimaContext }, /* @__PURE__ */ React49.createElement(
|
|
4239
4221
|
InternalKimaProvider,
|
|
4240
4222
|
{
|
|
4241
4223
|
kimaBackendUrl,
|
|
@@ -4247,17 +4229,17 @@ var KimaProvider = ({
|
|
|
4247
4229
|
var KimaProvider_default = KimaProvider;
|
|
4248
4230
|
|
|
4249
4231
|
// src/components/KimaTransactionWidget.tsx
|
|
4250
|
-
import
|
|
4232
|
+
import React88, { useEffect as useEffect24, useState as useState18 } from "react";
|
|
4251
4233
|
|
|
4252
4234
|
// src/components/KimaWidgetWrapper.tsx
|
|
4253
|
-
import
|
|
4235
|
+
import React86, { useEffect as useEffect23 } from "react";
|
|
4254
4236
|
import { useDispatch as useDispatch27, useSelector as useSelector47 } from "react-redux";
|
|
4255
4237
|
|
|
4256
4238
|
// src/components/TransactionWidget.tsx
|
|
4257
|
-
import
|
|
4239
|
+
import React73, { useEffect as useEffect15, useMemo as useMemo12, useState as useState11 } from "react";
|
|
4258
4240
|
|
|
4259
4241
|
// src/components/reusable/Progressbar.tsx
|
|
4260
|
-
import
|
|
4242
|
+
import React50 from "react";
|
|
4261
4243
|
import { useSelector as useSelector17 } from "react-redux";
|
|
4262
4244
|
var stepInfo = [
|
|
4263
4245
|
{
|
|
@@ -4278,12 +4260,12 @@ var stepInfo = [
|
|
|
4278
4260
|
];
|
|
4279
4261
|
var Progressbar = ({ step, errorStep, setFocus, loadingStep }) => {
|
|
4280
4262
|
const theme = useSelector17(selectTheme);
|
|
4281
|
-
return /* @__PURE__ */
|
|
4263
|
+
return /* @__PURE__ */ React50.createElement("div", { className: "kima-progressbar" }, /* @__PURE__ */ React50.createElement(
|
|
4282
4264
|
"div",
|
|
4283
4265
|
{
|
|
4284
4266
|
className: `value step-${step * 100 / 4}`
|
|
4285
4267
|
}
|
|
4286
|
-
), /* @__PURE__ */
|
|
4268
|
+
), /* @__PURE__ */ React50.createElement("div", { className: "step-indicators" }, stepInfo.map((item, index) => /* @__PURE__ */ React50.createElement(
|
|
4287
4269
|
"div",
|
|
4288
4270
|
{
|
|
4289
4271
|
key: item.title,
|
|
@@ -4294,14 +4276,14 @@ var Progressbar = ({ step, errorStep, setFocus, loadingStep }) => {
|
|
|
4294
4276
|
if (index < 4) setFocus(index);
|
|
4295
4277
|
}
|
|
4296
4278
|
},
|
|
4297
|
-
/* @__PURE__ */
|
|
4279
|
+
/* @__PURE__ */ React50.createElement("div", { className: "step-info" }, step < index && /* @__PURE__ */ React50.createElement(Lock_default, null), step >= index ? index === loadingStep ? /* @__PURE__ */ React50.createElement(Loader_default, { className: "loader" }) : index === errorStep ? /* @__PURE__ */ React50.createElement(Warning_default, null) : /* @__PURE__ */ React50.createElement(Check_default, null) : null, /* @__PURE__ */ React50.createElement("span", null, item.title))
|
|
4298
4280
|
))));
|
|
4299
4281
|
};
|
|
4300
4282
|
var Progressbar_default = Progressbar;
|
|
4301
4283
|
|
|
4302
4284
|
// src/components/reusable/ExternalLink.tsx
|
|
4303
|
-
import
|
|
4304
|
-
var ExternalLink = ({ to, children, className, rest }) => /* @__PURE__ */
|
|
4285
|
+
import React51 from "react";
|
|
4286
|
+
var ExternalLink = ({ to, children, className, rest }) => /* @__PURE__ */ React51.createElement(
|
|
4305
4287
|
"a",
|
|
4306
4288
|
{
|
|
4307
4289
|
className,
|
|
@@ -4315,20 +4297,20 @@ var ExternalLink = ({ to, children, className, rest }) => /* @__PURE__ */ React8
|
|
|
4315
4297
|
var ExternalLink_default = ExternalLink;
|
|
4316
4298
|
|
|
4317
4299
|
// src/components/reusable/NetworkLabel.tsx
|
|
4318
|
-
import
|
|
4300
|
+
import React52 from "react";
|
|
4319
4301
|
import { useSelector as useSelector18 } from "react-redux";
|
|
4320
4302
|
|
|
4321
4303
|
// src/components/reusable/PrimaryButton.tsx
|
|
4322
|
-
import
|
|
4304
|
+
import React55 from "react";
|
|
4323
4305
|
|
|
4324
4306
|
// src/assets/loading/180-ring.tsx
|
|
4325
|
-
import
|
|
4307
|
+
import React53 from "react";
|
|
4326
4308
|
var Loading180Ring = ({
|
|
4327
4309
|
width = 24,
|
|
4328
4310
|
height = 24,
|
|
4329
4311
|
fill = "white"
|
|
4330
4312
|
}) => {
|
|
4331
|
-
return /* @__PURE__ */
|
|
4313
|
+
return /* @__PURE__ */ React53.createElement(
|
|
4332
4314
|
"svg",
|
|
4333
4315
|
{
|
|
4334
4316
|
width,
|
|
@@ -4337,7 +4319,7 @@ var Loading180Ring = ({
|
|
|
4337
4319
|
viewBox: "0 0 24 24",
|
|
4338
4320
|
xmlns: "http://www.w3.org/2000/svg"
|
|
4339
4321
|
},
|
|
4340
|
-
/* @__PURE__ */
|
|
4322
|
+
/* @__PURE__ */ React53.createElement("path", { d: "M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z" }, /* @__PURE__ */ React53.createElement(
|
|
4341
4323
|
"animateTransform",
|
|
4342
4324
|
{
|
|
4343
4325
|
attributeName: "transform",
|
|
@@ -4352,7 +4334,7 @@ var Loading180Ring = ({
|
|
|
4352
4334
|
var ring_default = Loading180Ring;
|
|
4353
4335
|
|
|
4354
4336
|
// src/assets/loading/6-dots-scale.tsx
|
|
4355
|
-
import
|
|
4337
|
+
import React54 from "react";
|
|
4356
4338
|
|
|
4357
4339
|
// src/components/reusable/PrimaryButton.tsx
|
|
4358
4340
|
var PrimaryButton = ({
|
|
@@ -4363,7 +4345,7 @@ var PrimaryButton = ({
|
|
|
4363
4345
|
disabled = false,
|
|
4364
4346
|
ref
|
|
4365
4347
|
}) => {
|
|
4366
|
-
return /* @__PURE__ */
|
|
4348
|
+
return /* @__PURE__ */ React55.createElement("div", { className: "primary-button-wrapper" }, /* @__PURE__ */ React55.createElement(
|
|
4367
4349
|
"button",
|
|
4368
4350
|
{
|
|
4369
4351
|
className: `primary-button ${className}`,
|
|
@@ -4371,14 +4353,14 @@ var PrimaryButton = ({
|
|
|
4371
4353
|
ref,
|
|
4372
4354
|
disabled
|
|
4373
4355
|
},
|
|
4374
|
-
isLoading && /* @__PURE__ */
|
|
4356
|
+
isLoading && /* @__PURE__ */ React55.createElement("div", { className: "loading-indicator" }, /* @__PURE__ */ React55.createElement(ring_default, { width: 24, height: 24, fill: "white" })),
|
|
4375
4357
|
children
|
|
4376
4358
|
));
|
|
4377
4359
|
};
|
|
4378
4360
|
var PrimaryButton_default = PrimaryButton;
|
|
4379
4361
|
|
|
4380
4362
|
// src/components/reusable/SecondaryButton.tsx
|
|
4381
|
-
import
|
|
4363
|
+
import React56 from "react";
|
|
4382
4364
|
var SecondaryButton = ({
|
|
4383
4365
|
className,
|
|
4384
4366
|
clickHandler,
|
|
@@ -4387,7 +4369,7 @@ var SecondaryButton = ({
|
|
|
4387
4369
|
style,
|
|
4388
4370
|
disabled = false,
|
|
4389
4371
|
isLoading
|
|
4390
|
-
}) => /* @__PURE__ */
|
|
4372
|
+
}) => /* @__PURE__ */ React56.createElement(
|
|
4391
4373
|
"button",
|
|
4392
4374
|
{
|
|
4393
4375
|
className: `secondary-button ${className} ${theme}`,
|
|
@@ -4395,18 +4377,18 @@ var SecondaryButton = ({
|
|
|
4395
4377
|
...style,
|
|
4396
4378
|
disabled
|
|
4397
4379
|
},
|
|
4398
|
-
isLoading && /* @__PURE__ */
|
|
4380
|
+
isLoading && /* @__PURE__ */ React56.createElement("div", { className: "loading-indicator" }, /* @__PURE__ */ React56.createElement(ring_default, { width: 24, height: 24, fill: "black" })),
|
|
4399
4381
|
children
|
|
4400
4382
|
);
|
|
4401
4383
|
var SecondaryButton_default = SecondaryButton;
|
|
4402
4384
|
|
|
4403
4385
|
// src/components/reusable/Dropdown.tsx
|
|
4404
|
-
import
|
|
4386
|
+
import React57 from "react";
|
|
4405
4387
|
import { useDispatch as useDispatch6 } from "react-redux";
|
|
4406
4388
|
import { useSelector as useSelector19 } from "react-redux";
|
|
4407
4389
|
|
|
4408
4390
|
// src/components/reusable/WalletButton.tsx
|
|
4409
|
-
import
|
|
4391
|
+
import React60, { useEffect as useEffect10, useMemo as useMemo8 } from "react";
|
|
4410
4392
|
import { useDispatch as useDispatch7, useSelector as useSelector21 } from "react-redux";
|
|
4411
4393
|
|
|
4412
4394
|
// src/hooks/useGetCurrentPlugin.tsx
|
|
@@ -4414,7 +4396,7 @@ import { useEffect as useEffect6, useState as useState5 } from "react";
|
|
|
4414
4396
|
import { useSelector as useSelector20 } from "react-redux";
|
|
4415
4397
|
|
|
4416
4398
|
// plugins/default/index.tsx
|
|
4417
|
-
import
|
|
4399
|
+
import React58 from "react";
|
|
4418
4400
|
var DefaultPlugin = class extends PluginBase {
|
|
4419
4401
|
constructor(store2) {
|
|
4420
4402
|
super({
|
|
@@ -4449,7 +4431,7 @@ var DefaultPlugin = class extends PluginBase {
|
|
|
4449
4431
|
networkOption,
|
|
4450
4432
|
walletConnectProjectId
|
|
4451
4433
|
}) => {
|
|
4452
|
-
return /* @__PURE__ */
|
|
4434
|
+
return /* @__PURE__ */ React58.createElement("div", null, children);
|
|
4453
4435
|
};
|
|
4454
4436
|
};
|
|
4455
4437
|
var defaultPlugin = new DefaultPlugin(store);
|
|
@@ -4542,7 +4524,7 @@ import { useWallet as useTronWallet2 } from "@tronweb3/tronwallet-adapter-react-
|
|
|
4542
4524
|
import { useAppKit, useAppKitState } from "@reown/appkit/react";
|
|
4543
4525
|
|
|
4544
4526
|
// src/components/reusable/CopyButton.tsx
|
|
4545
|
-
import
|
|
4527
|
+
import React59, { useEffect as useEffect8, useState as useState7 } from "react";
|
|
4546
4528
|
var CopyButton = ({ text }) => {
|
|
4547
4529
|
const [copyClicked, setCopyClicked] = useState7(false);
|
|
4548
4530
|
useEffect8(() => {
|
|
@@ -4551,7 +4533,7 @@ var CopyButton = ({ text }) => {
|
|
|
4551
4533
|
setCopyClicked(false);
|
|
4552
4534
|
}, 2e3);
|
|
4553
4535
|
}, [copyClicked]);
|
|
4554
|
-
return /* @__PURE__ */
|
|
4536
|
+
return /* @__PURE__ */ React59.createElement(
|
|
4555
4537
|
"span",
|
|
4556
4538
|
{
|
|
4557
4539
|
className: "copy-btn",
|
|
@@ -4560,7 +4542,7 @@ var CopyButton = ({ text }) => {
|
|
|
4560
4542
|
navigator.clipboard.writeText(text);
|
|
4561
4543
|
}
|
|
4562
4544
|
},
|
|
4563
|
-
copyClicked ? /* @__PURE__ */
|
|
4545
|
+
copyClicked ? /* @__PURE__ */ React59.createElement(Check_default, null) : /* @__PURE__ */ React59.createElement(Copy_default, null)
|
|
4564
4546
|
);
|
|
4565
4547
|
};
|
|
4566
4548
|
var CopyButton_default = CopyButton;
|
|
@@ -4786,13 +4768,13 @@ var WalletButton = ({
|
|
|
4786
4768
|
}
|
|
4787
4769
|
dispatch(setSourceAddress(connectedAddress));
|
|
4788
4770
|
}, [isReady]);
|
|
4789
|
-
return /* @__PURE__ */
|
|
4771
|
+
return /* @__PURE__ */ React60.createElement(
|
|
4790
4772
|
"div",
|
|
4791
4773
|
{
|
|
4792
4774
|
className: `wallet-button ${isConnected ? "connected" : "disconnected"} ${theme.colorMode} ${errorBelow ? "error-below" : ""}`,
|
|
4793
4775
|
"data-testid": "connect-wallet-btn"
|
|
4794
4776
|
},
|
|
4795
|
-
/* @__PURE__ */
|
|
4777
|
+
/* @__PURE__ */ React60.createElement("div", { className: "info-wrapper" }, /* @__PURE__ */ React60.createElement(
|
|
4796
4778
|
"button",
|
|
4797
4779
|
{
|
|
4798
4780
|
className: `${isConnected ? "connected" : "disconnected"} ${width < 640 && "shortened"} ${theme.colorMode}`,
|
|
@@ -4802,16 +4784,16 @@ var WalletButton = ({
|
|
|
4802
4784
|
isConnected && !placeholder ? width >= 640 ? `${connectedAddress || ""}` : getShortenedAddress(connectedAddress || "") : "",
|
|
4803
4785
|
!isConnected && mode === "light" /* light */ && "Select Network to Load Account",
|
|
4804
4786
|
!isConnected && mode !== "light" /* light */ && initialSelection && "Select Network to Connect",
|
|
4805
|
-
!isConnected && mode !== "light" /* light */ && !initialSelection && /* @__PURE__ */
|
|
4787
|
+
!isConnected && mode !== "light" /* light */ && !initialSelection && /* @__PURE__ */ React60.createElement(Wallet_default, null),
|
|
4806
4788
|
!isConnected && mode !== "light" /* light */ && !initialSelection && "Connect Wallet"
|
|
4807
|
-
), isConnected && !placeholder && /* @__PURE__ */
|
|
4808
|
-
isConnected && !placeholder && balance !== void 0 && decimals !== void 0 ? /* @__PURE__ */
|
|
4789
|
+
), isConnected && !placeholder && /* @__PURE__ */ React60.createElement(CopyButton_default, { text: connectedAddress })),
|
|
4790
|
+
isConnected && !placeholder && balance !== void 0 && decimals !== void 0 ? /* @__PURE__ */ React60.createElement("p", { className: "balance-info" }, formatUSD(bigIntToNumber({ value: balance, decimals })), " ", selectedCoin, " available") : null
|
|
4809
4791
|
);
|
|
4810
4792
|
};
|
|
4811
4793
|
var WalletButton_default = WalletButton;
|
|
4812
4794
|
|
|
4813
4795
|
// src/components/reusable/CoinDropdown.tsx
|
|
4814
|
-
import
|
|
4796
|
+
import React62, { useEffect as useEffect12, useRef, useState as useState8 } from "react";
|
|
4815
4797
|
import { useSelector as useSelector23 } from "react-redux";
|
|
4816
4798
|
import { useDispatch as useDispatch9 } from "react-redux";
|
|
4817
4799
|
|
|
@@ -4819,25 +4801,61 @@ import { useDispatch as useDispatch9 } from "react-redux";
|
|
|
4819
4801
|
import { useEffect as useEffect11, useMemo as useMemo9 } from "react";
|
|
4820
4802
|
import { useSelector as useSelector22 } from "react-redux";
|
|
4821
4803
|
import { useDispatch as useDispatch8 } from "react-redux";
|
|
4804
|
+
var emptyTokenList = { tokenList: [] };
|
|
4822
4805
|
function useCurrencyOptions(isSourceChain) {
|
|
4823
4806
|
const dispatch = useDispatch8();
|
|
4824
4807
|
const mode = useSelector22(selectMode);
|
|
4825
4808
|
const sourceChain = useSelector22(selectSourceChain);
|
|
4809
|
+
const sourceSymbol = useSelector22(selectSourceCurrency);
|
|
4826
4810
|
const targetChain = useSelector22(selectTargetChain);
|
|
4827
|
-
const chain = isSourceChain ? sourceChain : targetChain;
|
|
4828
4811
|
const transactionOption = useSelector22(selectTransactionOption);
|
|
4829
|
-
const networks = useSelector22(selectNetworks);
|
|
4830
4812
|
const output = useMemo9(() => {
|
|
4831
|
-
|
|
4832
|
-
const
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4813
|
+
const chain = isSourceChain ? sourceChain : targetChain;
|
|
4814
|
+
const location = isSourceChain ? "origin" : "target";
|
|
4815
|
+
if (!chain) {
|
|
4816
|
+
logger_default.debug(`useCurrencyOptions(${location}): no chain selected`, {
|
|
4817
|
+
chain,
|
|
4818
|
+
sourceSymbol
|
|
4819
|
+
});
|
|
4820
|
+
return emptyTokenList;
|
|
4821
|
+
}
|
|
4822
|
+
if (isSourceChain) return { tokenList: chain.supportedTokens };
|
|
4823
|
+
if (!sourceSymbol) {
|
|
4824
|
+
logger_default.debug(`useCurrencyOptions(${location}): no sourceSymbol selected`, {
|
|
4825
|
+
chain,
|
|
4826
|
+
sourceSymbol
|
|
4827
|
+
});
|
|
4828
|
+
return { tokenList: chain.supportedTokens };
|
|
4829
|
+
}
|
|
4830
|
+
const sourceToken = sourceChain.supportedTokens.find(
|
|
4831
|
+
(t) => t.symbol === sourceSymbol
|
|
4832
|
+
);
|
|
4833
|
+
if (!sourceToken) {
|
|
4834
|
+
logger_default.debug(
|
|
4835
|
+
`useCurrencyOptions(${location}): source token ${sourceSymbol ?? "undefined"} not found`,
|
|
4836
|
+
{ sourceChain, sourceSymbol }
|
|
4837
|
+
);
|
|
4838
|
+
return { tokenList: chain.supportedTokens };
|
|
4839
|
+
}
|
|
4840
|
+
const tokenList2 = chain.supportedTokens.filter(
|
|
4841
|
+
(token) => token.peggedTo === sourceToken.peggedTo
|
|
4842
|
+
);
|
|
4843
|
+
logger_default.debug(`useCurrencyOptions(${location}): updated token list `, {
|
|
4844
|
+
tokenList: tokenList2,
|
|
4845
|
+
sourceSymbol,
|
|
4846
|
+
sourceToken,
|
|
4847
|
+
chain
|
|
4848
|
+
});
|
|
4849
|
+
return { tokenList: tokenList2 };
|
|
4850
|
+
}, [sourceChain, sourceSymbol, targetChain, isSourceChain]);
|
|
4836
4851
|
const { tokenList } = output;
|
|
4837
4852
|
useEffect11(() => {
|
|
4838
4853
|
if (!tokenList.length) return;
|
|
4839
4854
|
if (mode === "payment" /* payment */ && !isSourceChain) return;
|
|
4840
4855
|
const [firstToken] = tokenList;
|
|
4856
|
+
logger_default.debug(
|
|
4857
|
+
`useCurrencyOptions: seting default currency to ${firstToken.symbol}`
|
|
4858
|
+
);
|
|
4841
4859
|
if (isSourceChain) {
|
|
4842
4860
|
dispatch(setSourceCurrency(firstToken.symbol));
|
|
4843
4861
|
} else {
|
|
@@ -4848,16 +4866,19 @@ function useCurrencyOptions(isSourceChain) {
|
|
|
4848
4866
|
}
|
|
4849
4867
|
|
|
4850
4868
|
// src/components/reusable/TokenIcon.tsx
|
|
4851
|
-
import
|
|
4869
|
+
import React61 from "react";
|
|
4852
4870
|
var COIN_LIST = {
|
|
4871
|
+
EUR: KEUR_default,
|
|
4872
|
+
EURC: EURC_default,
|
|
4873
|
+
EURK: KEUR_default,
|
|
4874
|
+
HONEY: Honey_default,
|
|
4853
4875
|
KEUR: KEUR_default,
|
|
4854
4876
|
KIMAUSD: USDK_default,
|
|
4855
4877
|
USDC: USDC_default,
|
|
4856
4878
|
USDK: USDK_default,
|
|
4857
|
-
USDT: USDT_default,
|
|
4858
|
-
WBTC: BTC_default,
|
|
4859
4879
|
USD: USD_default,
|
|
4860
|
-
|
|
4880
|
+
USDT: USDT_default,
|
|
4881
|
+
WBTC: BTC_default
|
|
4861
4882
|
};
|
|
4862
4883
|
function TokenIcon({
|
|
4863
4884
|
symbol,
|
|
@@ -4870,7 +4891,7 @@ function TokenIcon({
|
|
|
4870
4891
|
logger_default.warn(`Token icon not found for symbol: ${symbol}`);
|
|
4871
4892
|
return null;
|
|
4872
4893
|
}
|
|
4873
|
-
return /* @__PURE__ */
|
|
4894
|
+
return /* @__PURE__ */ React61.createElement("div", { className: "icon-wrapper" }, /* @__PURE__ */ React61.createElement(Icon, { width, height }));
|
|
4874
4895
|
}
|
|
4875
4896
|
|
|
4876
4897
|
// src/components/reusable/CoinDropdown.tsx
|
|
@@ -4903,67 +4924,69 @@ var CoinDropdown = ({
|
|
|
4903
4924
|
dispatch(setTargetCurrency(symbol));
|
|
4904
4925
|
}
|
|
4905
4926
|
};
|
|
4906
|
-
return /* @__PURE__ */
|
|
4927
|
+
return /* @__PURE__ */ React62.createElement(
|
|
4907
4928
|
"div",
|
|
4908
4929
|
{
|
|
4909
4930
|
className: `coin-dropdown ${theme.colorMode} ${collapsed ? "collapsed" : "toggled"}`,
|
|
4910
4931
|
onClick: () => setCollapsed((prev) => !prev),
|
|
4911
4932
|
ref
|
|
4912
4933
|
},
|
|
4913
|
-
/* @__PURE__ */
|
|
4914
|
-
/* @__PURE__ */
|
|
4934
|
+
/* @__PURE__ */ React62.createElement("div", { className: "coin-wrapper" }, /* @__PURE__ */ React62.createElement(TokenIcon, { symbol: tokenSymbol, width: 24, height: 24 }), /* @__PURE__ */ React62.createElement("span", { className: "coin" }, tokenSymbol)),
|
|
4935
|
+
/* @__PURE__ */ React62.createElement(
|
|
4915
4936
|
"div",
|
|
4916
4937
|
{
|
|
4917
4938
|
className: `coin-menu ${theme.colorMode} ${collapsed ? "collapsed" : "toggled"}`
|
|
4918
4939
|
},
|
|
4919
|
-
tokenList.map((token) => /* @__PURE__ */
|
|
4940
|
+
tokenList.map((token) => /* @__PURE__ */ React62.createElement(
|
|
4920
4941
|
"div",
|
|
4921
4942
|
{
|
|
4922
4943
|
className: `coin-item ${theme.colorMode}`,
|
|
4923
4944
|
key: token.symbol,
|
|
4924
4945
|
onClick: () => handleDropdownItemClick(token.symbol)
|
|
4925
4946
|
},
|
|
4926
|
-
/* @__PURE__ */
|
|
4927
|
-
/* @__PURE__ */
|
|
4947
|
+
/* @__PURE__ */ React62.createElement(TokenIcon, { symbol: token.symbol, width: 24, height: 24 }),
|
|
4948
|
+
/* @__PURE__ */ React62.createElement("p", null, token.symbol)
|
|
4928
4949
|
))
|
|
4929
4950
|
),
|
|
4930
|
-
/* @__PURE__ */
|
|
4951
|
+
/* @__PURE__ */ React62.createElement("div", { className: `dropdown-icon ${collapsed ? "toggled" : "collapsed"}` }, /* @__PURE__ */ React62.createElement(Arrow_default, { fill: "none" }))
|
|
4931
4952
|
);
|
|
4932
4953
|
};
|
|
4933
4954
|
var CoinDropdown_default = CoinDropdown;
|
|
4934
4955
|
|
|
4935
4956
|
// src/components/reusable/ConfirmDetails.tsx
|
|
4936
|
-
import
|
|
4957
|
+
import React65, { useEffect as useEffect13, useMemo as useMemo10, useState as useState9 } from "react";
|
|
4937
4958
|
import { useSelector as useSelector25 } from "react-redux";
|
|
4938
4959
|
|
|
4939
4960
|
// src/components/reusable/ChainIcon.tsx
|
|
4940
|
-
import
|
|
4961
|
+
import React63 from "react";
|
|
4941
4962
|
var chainIcons = {
|
|
4942
|
-
|
|
4943
|
-
POL: Polygon_default,
|
|
4963
|
+
ARB: Arbitrum_default,
|
|
4944
4964
|
AVX: Avalanche_default,
|
|
4965
|
+
BANK: Bank_default,
|
|
4945
4966
|
BASE: Base_default,
|
|
4967
|
+
BERA: Bera_default,
|
|
4946
4968
|
BSC: BSC_default,
|
|
4947
4969
|
BTC: BTC_default,
|
|
4948
|
-
|
|
4970
|
+
CC: CreditCard_default,
|
|
4971
|
+
CFX: CFX_default,
|
|
4972
|
+
ETH: Ethereum_default,
|
|
4973
|
+
FIAT: Bank_default,
|
|
4974
|
+
POL: Polygon_default,
|
|
4949
4975
|
OPT: Optimism_default,
|
|
4950
|
-
TRX: Tron_default,
|
|
4951
4976
|
SOL: Solana_default,
|
|
4952
|
-
|
|
4953
|
-
BERA: Bera_default,
|
|
4954
|
-
CC: CreditCard_default
|
|
4977
|
+
TRX: Tron_default
|
|
4955
4978
|
};
|
|
4956
4979
|
function ChainIcon({ symbol }) {
|
|
4957
4980
|
const Icon = symbol === "FIAT" ? chainIcons["CC"] : chainIcons[symbol];
|
|
4958
4981
|
if (!Icon) {
|
|
4959
|
-
logger_default.warn(`Chain icon not found for symbol: ${symbol}`);
|
|
4960
|
-
return /* @__PURE__ */
|
|
4982
|
+
if (symbol) logger_default.warn(`Chain icon not found for symbol: ${symbol}`);
|
|
4983
|
+
return /* @__PURE__ */ React63.createElement("div", null);
|
|
4961
4984
|
}
|
|
4962
|
-
return /* @__PURE__ */
|
|
4985
|
+
return /* @__PURE__ */ React63.createElement("div", { className: "icon" }, /* @__PURE__ */ React63.createElement(Icon, null));
|
|
4963
4986
|
}
|
|
4964
4987
|
|
|
4965
4988
|
// src/components/reusable/FeeDeductionRadioButtons.tsx
|
|
4966
|
-
import
|
|
4989
|
+
import React64 from "react";
|
|
4967
4990
|
import { useDispatch as useDispatch10, useSelector as useSelector24 } from "react-redux";
|
|
4968
4991
|
var FeeDeductionRadioButtons = ({ disabled }) => {
|
|
4969
4992
|
const dispatch = useDispatch10();
|
|
@@ -4980,7 +5003,7 @@ var FeeDeductionRadioButtons = ({ disabled }) => {
|
|
|
4980
5003
|
const handleChange = (value) => {
|
|
4981
5004
|
dispatch(setFeeDeduct(value));
|
|
4982
5005
|
};
|
|
4983
|
-
return /* @__PURE__ */
|
|
5006
|
+
return /* @__PURE__ */ React64.createElement("div", { className: `fee-deduction-radio-container ${theme.colorMode}` }, /* @__PURE__ */ React64.createElement("div", { className: "fee-options" }, Number(amount) - totalFee > 0 && /* @__PURE__ */ React64.createElement("label", { className: `fee-option ${disabled ? "disabled" : ""}` }, /* @__PURE__ */ React64.createElement(
|
|
4984
5007
|
"input",
|
|
4985
5008
|
{
|
|
4986
5009
|
type: "radio",
|
|
@@ -4989,11 +5012,11 @@ var FeeDeductionRadioButtons = ({ disabled }) => {
|
|
|
4989
5012
|
disabled,
|
|
4990
5013
|
onChange: () => handleChange(true)
|
|
4991
5014
|
}
|
|
4992
|
-
), /* @__PURE__ */
|
|
5015
|
+
), /* @__PURE__ */ React64.createElement("span", { className: `radio-label ${theme.colorMode}` }, `Pay $${formatterFloat.format(
|
|
4993
5016
|
Number(amount)
|
|
4994
5017
|
)} ${sourceCurrency} in ${sourceNetwork.name} to receive $${formatterFloat.format(
|
|
4995
5018
|
Number(amount) - totalFee
|
|
4996
|
-
)} ${targetCurrency} in ${targetNetwork.name}`)), /* @__PURE__ */
|
|
5019
|
+
)} ${targetCurrency} in ${targetNetwork.name}`)), /* @__PURE__ */ React64.createElement("label", { className: `fee-option ${disabled ? "disabled" : ""}` }, /* @__PURE__ */ React64.createElement(
|
|
4997
5020
|
"input",
|
|
4998
5021
|
{
|
|
4999
5022
|
type: "radio",
|
|
@@ -5002,7 +5025,7 @@ var FeeDeductionRadioButtons = ({ disabled }) => {
|
|
|
5002
5025
|
disabled,
|
|
5003
5026
|
onChange: () => handleChange(false)
|
|
5004
5027
|
}
|
|
5005
|
-
), /* @__PURE__ */
|
|
5028
|
+
), /* @__PURE__ */ React64.createElement("span", { className: `radio-label ${theme.colorMode}` }, `Pay $${formatterFloat.format(
|
|
5006
5029
|
Number(amount) + totalFee
|
|
5007
5030
|
)} ${sourceCurrency} in ${sourceNetwork.name} to receive $${formatterFloat.format(
|
|
5008
5031
|
Number(amount)
|
|
@@ -5031,10 +5054,6 @@ var ConfirmDetails = ({
|
|
|
5031
5054
|
const [feeCollapsed, setFeeCollapsed] = useState9(true);
|
|
5032
5055
|
const transactionOption = useSelector25(selectTransactionOption);
|
|
5033
5056
|
const { connectedAddress } = useIsWalletReady4();
|
|
5034
|
-
const originNetworkOption = useMemo10(
|
|
5035
|
-
() => networkOptions3.filter((network) => network.id === originNetwork.id)[0],
|
|
5036
|
-
[networkOptions3, originNetwork]
|
|
5037
|
-
);
|
|
5038
5057
|
const targetNetworkOption = useMemo10(
|
|
5039
5058
|
() => networkOptions3.filter(
|
|
5040
5059
|
(network) => network.shortName === (mode === "payment" /* payment */ ? transactionOption?.targetChain : targetNetwork.shortName)
|
|
@@ -5047,13 +5066,13 @@ var ConfirmDetails = ({
|
|
|
5047
5066
|
useEffect13(() => {
|
|
5048
5067
|
width === 0 && updateWidth(window.innerWidth);
|
|
5049
5068
|
}, []);
|
|
5050
|
-
return /* @__PURE__ */
|
|
5069
|
+
return /* @__PURE__ */ React65.createElement("div", { className: `confirm-details ${theme.colorMode}` }, /* @__PURE__ */ React65.createElement("p", null, "Step ", isApproved ? "2" : "1", "\xA0of 2\xA0\xA0\xA0", isApproved ? "Submit transaction" : originNetwork.shortName === "FIAT" /* FIAT */ ? "Bank Details" : "Approval"), originNetwork.shortName === "FIAT" /* FIAT */ ? /* @__PURE__ */ React65.createElement("div", null, /* @__PURE__ */ React65.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React65.createElement("span", { className: "label" }, "IBAN:"), /* @__PURE__ */ React65.createElement("span", { className: `kima-card-network-label ${theme.colorMode}` }, /* @__PURE__ */ React65.createElement(ChainIcon, { symbol: originNetwork?.shortName }), "FIAT"), /* @__PURE__ */ React65.createElement("p", null, "ES6621000418401234567891")), /* @__PURE__ */ React65.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React65.createElement("span", { className: "label" }, "Recipient:"), /* @__PURE__ */ React65.createElement("p", null, "Kima Sandbox")), /* @__PURE__ */ React65.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React65.createElement("span", { className: "label" }, "BIC:"), /* @__PURE__ */ React65.createElement("p", null, "CAIXESBBXXX")), /* @__PURE__ */ React65.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React65.createElement("span", { className: "label" }, "Description:"), /* @__PURE__ */ React65.createElement("p", { className: "signature" }, signature))) : /* @__PURE__ */ React65.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React65.createElement("span", { className: "label" }, "Source ", originNetwork.shortName !== "CC" && "wallet", ":"), /* @__PURE__ */ React65.createElement("div", { className: "network-details" }, /* @__PURE__ */ React65.createElement("div", { className: "kima-card-network-container" }, /* @__PURE__ */ React65.createElement("span", { className: `kima-card-network-label ${theme.colorMode}` }, /* @__PURE__ */ React65.createElement(ChainIcon, { symbol: originNetwork?.shortName }), originNetwork.name)), originNetwork.shortName !== "CC" && /* @__PURE__ */ React65.createElement("p", { className: theme.colorMode }, dAppOption === "LPDrain" /* LPDrain */ ? targetAddress : connectedAddress))), /* @__PURE__ */ React65.createElement("div", { className: "detail-item amount" }, /* @__PURE__ */ React65.createElement("span", { className: "amount-container" }, /* @__PURE__ */ React65.createElement("div", { className: "amount-details" }, /* @__PURE__ */ React65.createElement("span", null, "Amount to Transfer "), /* @__PURE__ */ React65.createElement("div", { className: "coin-details" }, /* @__PURE__ */ React65.createElement("p", null, formatBigInt(txValues.allowanceAmount), " ", sourceCurrency))), /* @__PURE__ */ React65.createElement("div", { className: "amount-details" }, /* @__PURE__ */ React65.createElement("span", null, "Total Fees"), /* @__PURE__ */ React65.createElement(
|
|
5051
5070
|
"div",
|
|
5052
5071
|
{
|
|
5053
5072
|
className: "fee-collapse",
|
|
5054
5073
|
onClick: () => setFeeCollapsed(!feeCollapsed)
|
|
5055
5074
|
},
|
|
5056
|
-
/* @__PURE__ */
|
|
5075
|
+
/* @__PURE__ */ React65.createElement(
|
|
5057
5076
|
MiniArrow_default,
|
|
5058
5077
|
{
|
|
5059
5078
|
width: 15,
|
|
@@ -5064,16 +5083,16 @@ var ConfirmDetails = ({
|
|
|
5064
5083
|
}
|
|
5065
5084
|
}
|
|
5066
5085
|
),
|
|
5067
|
-
/* @__PURE__ */
|
|
5068
|
-
)), /* @__PURE__ */
|
|
5086
|
+
/* @__PURE__ */ React65.createElement("span", { className: "service-fee" }, formatBigInt(totalFee), " ", sourceCurrency)
|
|
5087
|
+
)), /* @__PURE__ */ React65.createElement("div", { className: `fee-breakdown ${feeCollapsed ? "collapsed" : ""}` }, /* @__PURE__ */ React65.createElement("div", { className: "amount-details" }, /* @__PURE__ */ React65.createElement("span", null, originNetwork.shortName === "CC" ? "Credit Card Processing Fee" : `Source Network Fee (${originNetwork.shortName})`), /* @__PURE__ */ React65.createElement("span", { className: "service-fee" }, formatBigInt(sourceFee), " ", sourceCurrency)), /* @__PURE__ */ React65.createElement("div", { className: "amount-details" }, /* @__PURE__ */ React65.createElement("span", null, "Target Network Fee (", targetNetwork.shortName, ")"), /* @__PURE__ */ React65.createElement("span", { className: "service-fee" }, formatBigInt(targetFee), " ", targetCurrency)), /* @__PURE__ */ React65.createElement("div", { className: "amount-details" }, /* @__PURE__ */ React65.createElement("span", null, "KIMA Service Fee"), /* @__PURE__ */ React65.createElement("span", { className: "service-fee" }, formatBigInt(kimaFee), " ", sourceCurrency))), /* @__PURE__ */ React65.createElement("div", { className: "amount-details" }, /* @__PURE__ */ React65.createElement("span", null, "Target Transfer Amount"), /* @__PURE__ */ React65.createElement("span", { className: "service-fee" }, formatBigInt(txValues.submitAmount), " ", targetCurrency)))), targetNetwork.shortName === "FIAT" /* FIAT */ ? /* @__PURE__ */ React65.createElement("div", null, /* @__PURE__ */ React65.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React65.createElement("span", { className: "label" }, "IBAN:"), /* @__PURE__ */ React65.createElement("p", null, bankDetails.iban), /* @__PURE__ */ React65.createElement("span", { className: `kima-card-network-label ${theme.colorMode}` }, /* @__PURE__ */ React65.createElement(ChainIcon, { symbol: targetNetworkOption?.shortName }), "FIAT")), /* @__PURE__ */ React65.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React65.createElement("span", { className: "label" }, "Recipient:"), /* @__PURE__ */ React65.createElement("p", null, bankDetails.recipient))) : /* @__PURE__ */ React65.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React65.createElement("span", { className: "label" }, "Target wallet:"), /* @__PURE__ */ React65.createElement("div", { className: "network-details" }, /* @__PURE__ */ React65.createElement("div", { className: "kima-card-network-container" }, /* @__PURE__ */ React65.createElement("span", { className: `kima-card-network-label ${theme.colorMode}` }, /* @__PURE__ */ React65.createElement(ChainIcon, { symbol: targetNetworkOption?.shortName }), targetNetworkOption?.name)), /* @__PURE__ */ React65.createElement("p", { className: theme.colorMode }, mode === "light" /* light */ ? targetNetwork.shortName === "SOL" ? lightDemoAccounts.SOL : targetNetwork.shortName === "TRX" ? lightDemoAccounts.TRX : lightDemoAccounts.EVM : dAppOption === "LPDrain" /* LPDrain */ ? connectedAddress : targetAddress))), mode === "bridge" /* bridge */ && BigInt(totalFee.value) > BigInt(0) ? (
|
|
5069
5088
|
// <FeeDeductionSlider />
|
|
5070
|
-
/* @__PURE__ */
|
|
5089
|
+
/* @__PURE__ */ React65.createElement(FeeDeductionRadioButtons_default, { disabled: feeOptionDisabled })
|
|
5071
5090
|
) : null);
|
|
5072
5091
|
};
|
|
5073
5092
|
var ConfirmDetails_default = ConfirmDetails;
|
|
5074
5093
|
|
|
5075
5094
|
// src/components/reusable/AddressInput.tsx
|
|
5076
|
-
import
|
|
5095
|
+
import React66, { useEffect as useEffect14 } from "react";
|
|
5077
5096
|
import { useDispatch as useDispatch11, useSelector as useSelector26 } from "react-redux";
|
|
5078
5097
|
var AddressInput = ({
|
|
5079
5098
|
theme,
|
|
@@ -5112,7 +5131,7 @@ var AddressInput = ({
|
|
|
5112
5131
|
mode,
|
|
5113
5132
|
dispatch
|
|
5114
5133
|
]);
|
|
5115
|
-
return /* @__PURE__ */
|
|
5134
|
+
return /* @__PURE__ */ React66.createElement(
|
|
5116
5135
|
"input",
|
|
5117
5136
|
{
|
|
5118
5137
|
className: `kima-address-input ${theme}`,
|
|
@@ -5127,11 +5146,11 @@ var AddressInput = ({
|
|
|
5127
5146
|
var AddressInput_default = AddressInput;
|
|
5128
5147
|
|
|
5129
5148
|
// src/components/reusable/CustomCheckbox.tsx
|
|
5130
|
-
import
|
|
5149
|
+
import React67 from "react";
|
|
5131
5150
|
import { useSelector as useSelector27 } from "react-redux";
|
|
5132
5151
|
|
|
5133
5152
|
// src/components/reusable/StepBox.tsx
|
|
5134
|
-
import
|
|
5153
|
+
import React68, { useMemo as useMemo11 } from "react";
|
|
5135
5154
|
import { useSelector as useSelector28 } from "react-redux";
|
|
5136
5155
|
var stepInfo2 = [
|
|
5137
5156
|
{
|
|
@@ -5163,61 +5182,61 @@ var StepBox = ({ step, errorStep, loadingStep, data }) => {
|
|
|
5163
5182
|
() => networks.find((network) => network.shortName === data?.targetChain),
|
|
5164
5183
|
[data, networks]
|
|
5165
5184
|
);
|
|
5166
|
-
return /* @__PURE__ */
|
|
5185
|
+
return /* @__PURE__ */ React68.createElement("div", { className: "kima-stepbox" }, /* @__PURE__ */ React68.createElement("div", { className: `content-wrapper ${theme.colorMode}` }, stepInfo2.map((item, index) => /* @__PURE__ */ React68.createElement("div", { key: item.title, className: "step-item" }, /* @__PURE__ */ React68.createElement(
|
|
5167
5186
|
"div",
|
|
5168
5187
|
{
|
|
5169
5188
|
className: `info-item
|
|
5170
5189
|
${step >= index ? index === loadingStep ? "active" : index === errorStep ? "error" : "completed" : ""}
|
|
5171
5190
|
${step < index && "locked"} ${theme.colorMode}`
|
|
5172
5191
|
},
|
|
5173
|
-
step < index && /* @__PURE__ */
|
|
5174
|
-
step >= index ? index === loadingStep ? /* @__PURE__ */
|
|
5175
|
-
/* @__PURE__ */
|
|
5176
|
-
), index === 0 && data?.kimaTxHash ? /* @__PURE__ */
|
|
5192
|
+
step < index && /* @__PURE__ */ React68.createElement(Lock_default, null),
|
|
5193
|
+
step >= index ? index === loadingStep ? /* @__PURE__ */ React68.createElement(Loader_default, { className: "loader" }) : index === errorStep ? /* @__PURE__ */ React68.createElement(Warning_default, null) : /* @__PURE__ */ React68.createElement(Check_default, null) : null,
|
|
5194
|
+
/* @__PURE__ */ React68.createElement("p", null, item.title)
|
|
5195
|
+
), index === 0 && data?.kimaTxHash ? /* @__PURE__ */ React68.createElement("div", { className: `info-item ${theme.colorMode}` }, /* @__PURE__ */ React68.createElement("div", { className: "icon" }, /* @__PURE__ */ React68.createElement(USDK_default, { width: 30, height: 30 })), /* @__PURE__ */ React68.createElement("p", { className: "chain-name" }, "Kima TX Hash:"), /* @__PURE__ */ React68.createElement("p", null, /* @__PURE__ */ React68.createElement(
|
|
5177
5196
|
ExternalLink_default,
|
|
5178
5197
|
{
|
|
5179
5198
|
to: `${explorerUrl}/transactions/?tx=${data?.kimaTxHash}`
|
|
5180
5199
|
},
|
|
5181
5200
|
getShortenedAddress(data?.kimaTxHash || "")
|
|
5182
|
-
), /* @__PURE__ */
|
|
5201
|
+
), /* @__PURE__ */ React68.createElement(CopyButton_default, { text: data?.kimaTxHash }))) : null, index === 1 && data?.tssPullHash && sourceChain?.shortName !== "CC" ? /* @__PURE__ */ React68.createElement(
|
|
5183
5202
|
"div",
|
|
5184
5203
|
{
|
|
5185
5204
|
className: `info-item ${theme.colorMode} source-chain ${step >= 3 ? "paid" : ""}`
|
|
5186
5205
|
},
|
|
5187
|
-
/* @__PURE__ */
|
|
5188
|
-
/* @__PURE__ */
|
|
5189
|
-
/* @__PURE__ */
|
|
5206
|
+
/* @__PURE__ */ React68.createElement(ChainIcon, { symbol: data.sourceChain }),
|
|
5207
|
+
/* @__PURE__ */ React68.createElement("p", { className: "chain-name" }, sourceChain?.name, " TX Hash:"),
|
|
5208
|
+
/* @__PURE__ */ React68.createElement("p", null, /* @__PURE__ */ React68.createElement(
|
|
5190
5209
|
ExternalLink_default,
|
|
5191
5210
|
{
|
|
5192
5211
|
to: `${sourceChain?.blockExplorers?.default.url}/${data?.sourceChain === "TRX" /* TRON */ ? "#/transaction" : "tx"}/${data?.tssPullHash}${data?.sourceChain === "SOL" /* SOLANA */ && networkOption === "testnet" /* testnet */ ? "?cluster=devnet" : ""}`
|
|
5193
5212
|
},
|
|
5194
5213
|
getShortenedAddress(data?.tssPullHash || "")
|
|
5195
|
-
), /* @__PURE__ */
|
|
5196
|
-
) : null, index === 3 && data?.tssRefundHash ? /* @__PURE__ */
|
|
5214
|
+
), /* @__PURE__ */ React68.createElement(CopyButton_default, { text: data?.tssPullHash || "" }))
|
|
5215
|
+
) : null, index === 3 && data?.tssRefundHash ? /* @__PURE__ */ React68.createElement("div", { className: `info-item ${theme.colorMode} target-chain` }, /* @__PURE__ */ React68.createElement(ChainIcon, { symbol: data.sourceChain }), /* @__PURE__ */ React68.createElement("p", { className: "chain-name" }, sourceChain?.name, " TX Hash:"), /* @__PURE__ */ React68.createElement("p", null, /* @__PURE__ */ React68.createElement(
|
|
5197
5216
|
ExternalLink_default,
|
|
5198
5217
|
{
|
|
5199
5218
|
to: `${sourceChain?.blockExplorers?.default.url}/${data?.sourceChain === "TRX" /* TRON */ ? "#/transaction" : "tx"}/${data?.tssRefundHash}${data?.sourceChain === "SOL" /* SOLANA */ && networkOption === "testnet" /* testnet */ ? "?cluster=devnet" : ""}`
|
|
5200
5219
|
},
|
|
5201
5220
|
getShortenedAddress(data?.tssRefundHash || "")
|
|
5202
|
-
), /* @__PURE__ */
|
|
5221
|
+
), /* @__PURE__ */ React68.createElement(CopyButton_default, { text: data?.tssRefundHash || "" }))) : null, index === 3 && data?.tssReleaseHash ? /* @__PURE__ */ React68.createElement("div", { className: `info-item ${theme.colorMode} target-chain` }, /* @__PURE__ */ React68.createElement(ChainIcon, { symbol: data.targetChain }), /* @__PURE__ */ React68.createElement("p", { className: "chain-name" }, targetChain?.name, " TX Hash:"), /* @__PURE__ */ React68.createElement("p", null, /* @__PURE__ */ React68.createElement(
|
|
5203
5222
|
ExternalLink_default,
|
|
5204
5223
|
{
|
|
5205
5224
|
to: `${targetChain?.blockExplorers?.default.url}/${data?.targetChain === "TRX" /* TRON */ ? "#/transaction" : "tx"}/${data?.tssReleaseHash}${data?.targetChain === "SOL" /* SOLANA */ && networkOption === "testnet" /* testnet */ ? "?cluster=devnet" : ""}`
|
|
5206
5225
|
},
|
|
5207
5226
|
getShortenedAddress(data?.tssReleaseHash || "")
|
|
5208
|
-
), /* @__PURE__ */
|
|
5227
|
+
), /* @__PURE__ */ React68.createElement(CopyButton_default, { text: data?.tssReleaseHash || "" }))) : null))));
|
|
5209
5228
|
};
|
|
5210
5229
|
var StepBox_default = StepBox;
|
|
5211
5230
|
|
|
5212
5231
|
// src/components/reusable/BankInput.tsx
|
|
5213
|
-
import
|
|
5232
|
+
import React69 from "react";
|
|
5214
5233
|
import { useDispatch as useDispatch12 } from "react-redux";
|
|
5215
5234
|
import { useSelector as useSelector29 } from "react-redux";
|
|
5216
5235
|
var BankInput = () => {
|
|
5217
5236
|
const dispatch = useDispatch12();
|
|
5218
5237
|
const theme = useSelector29(selectTheme);
|
|
5219
5238
|
const bankDetails = useSelector29(selectBankDetails);
|
|
5220
|
-
return /* @__PURE__ */
|
|
5239
|
+
return /* @__PURE__ */ React69.createElement("div", { className: "bank-input" }, /* @__PURE__ */ React69.createElement("div", { className: `form-item ${theme.colorMode}` }, /* @__PURE__ */ React69.createElement("span", { className: "label" }, "IBAN:"), /* @__PURE__ */ React69.createElement(
|
|
5221
5240
|
"input",
|
|
5222
5241
|
{
|
|
5223
5242
|
className: "kima-address-input",
|
|
@@ -5225,7 +5244,7 @@ var BankInput = () => {
|
|
|
5225
5244
|
value: bankDetails.iban,
|
|
5226
5245
|
onChange: (e) => dispatch(setBankDetails({ ...bankDetails, iban: e.target.value }))
|
|
5227
5246
|
}
|
|
5228
|
-
)), /* @__PURE__ */
|
|
5247
|
+
)), /* @__PURE__ */ React69.createElement("div", { className: `form-item ${theme.colorMode}` }, /* @__PURE__ */ React69.createElement("span", { className: "label" }, "Recipient:"), /* @__PURE__ */ React69.createElement(
|
|
5229
5248
|
"input",
|
|
5230
5249
|
{
|
|
5231
5250
|
className: "kima-address-input",
|
|
@@ -5240,7 +5259,7 @@ var BankInput = () => {
|
|
|
5240
5259
|
var BankInput_default = BankInput;
|
|
5241
5260
|
|
|
5242
5261
|
// src/components/reusable/TxButton.tsx
|
|
5243
|
-
import
|
|
5262
|
+
import React70 from "react";
|
|
5244
5263
|
import { useDispatch as useDispatch13 } from "react-redux";
|
|
5245
5264
|
import { useSelector as useSelector30 } from "react-redux";
|
|
5246
5265
|
var TxButton = ({ theme }) => {
|
|
@@ -5249,14 +5268,14 @@ var TxButton = ({ theme }) => {
|
|
|
5249
5268
|
dispatch(setPendingTxPopup(true));
|
|
5250
5269
|
};
|
|
5251
5270
|
const txCount = useSelector30(selectPendingTxs);
|
|
5252
|
-
return /* @__PURE__ */
|
|
5271
|
+
return /* @__PURE__ */ React70.createElement(
|
|
5253
5272
|
"button",
|
|
5254
5273
|
{
|
|
5255
5274
|
className: `secondary-button tx-button ${theme.colorMode}`,
|
|
5256
5275
|
onClick: handleClick
|
|
5257
5276
|
},
|
|
5258
5277
|
txCount,
|
|
5259
|
-
/* @__PURE__ */
|
|
5278
|
+
/* @__PURE__ */ React70.createElement(
|
|
5260
5279
|
ring_default,
|
|
5261
5280
|
{
|
|
5262
5281
|
height: 16,
|
|
@@ -5383,17 +5402,17 @@ var useGetTxData = (txId, dAppOption, backendUrl) => {
|
|
|
5383
5402
|
var useGetTxData_default = useGetTxData;
|
|
5384
5403
|
|
|
5385
5404
|
// src/components/reusable/TransactionStatusMessage.tsx
|
|
5386
|
-
import
|
|
5405
|
+
import React71 from "react";
|
|
5387
5406
|
var TransactionStatusMessage = ({
|
|
5388
5407
|
isCompleted,
|
|
5389
5408
|
transactionId
|
|
5390
5409
|
}) => {
|
|
5391
|
-
return /* @__PURE__ */
|
|
5410
|
+
return /* @__PURE__ */ React71.createElement("div", { className: "transaction-status-message" }, /* @__PURE__ */ React71.createElement("h2", null, isCompleted !== "Completed" /* COMPLETED */ && "Your transaction is currently being processed.", " ", "Please copy the Transaction ID below for future reference. You can use this ID to track the transaction status or resolve any issues if needed."), /* @__PURE__ */ React71.createElement("span", { className: "transaction-copy" }, /* @__PURE__ */ React71.createElement("h3", null, transactionId), /* @__PURE__ */ React71.createElement(CopyButton_default, { text: transactionId })));
|
|
5392
5411
|
};
|
|
5393
5412
|
var TransactionStatusMessage_default = TransactionStatusMessage;
|
|
5394
5413
|
|
|
5395
5414
|
// src/components/reusable/TransactionSearch.tsx
|
|
5396
|
-
import
|
|
5415
|
+
import React72, { useRef as useRef3, useState as useState10 } from "react";
|
|
5397
5416
|
import { useSelector as useSelector31 } from "react-redux";
|
|
5398
5417
|
import { useDispatch as useDispatch14 } from "react-redux";
|
|
5399
5418
|
import toast2 from "react-hot-toast";
|
|
@@ -5406,7 +5425,7 @@ var TransactionSearch = () => {
|
|
|
5406
5425
|
const handleSearch = async () => {
|
|
5407
5426
|
if (transactionId.length <= 0)
|
|
5408
5427
|
return toast2.error("You must provide a valid transaction id", {
|
|
5409
|
-
icon: /* @__PURE__ */
|
|
5428
|
+
icon: /* @__PURE__ */ React72.createElement(Error_default, null)
|
|
5410
5429
|
});
|
|
5411
5430
|
try {
|
|
5412
5431
|
const data = await getTxData({
|
|
@@ -5423,11 +5442,11 @@ var TransactionSearch = () => {
|
|
|
5423
5442
|
logger_default.error("Error searching transaction: ", error);
|
|
5424
5443
|
return toast2.error(
|
|
5425
5444
|
"Transaction not found. Please check for the proper transaction id.",
|
|
5426
|
-
{ icon: /* @__PURE__ */
|
|
5445
|
+
{ icon: /* @__PURE__ */ React72.createElement(Error_default, null) }
|
|
5427
5446
|
);
|
|
5428
5447
|
}
|
|
5429
5448
|
};
|
|
5430
|
-
return /* @__PURE__ */
|
|
5449
|
+
return /* @__PURE__ */ React72.createElement("div", { className: "form-item transaction-search" }, /* @__PURE__ */ React72.createElement("div", { className: "transaction-input" }, /* @__PURE__ */ React72.createElement("span", { className: "label" }, "Search Transaction:"), /* @__PURE__ */ React72.createElement(
|
|
5431
5450
|
"input",
|
|
5432
5451
|
{
|
|
5433
5452
|
className: `${theme.colorMode}`,
|
|
@@ -5437,7 +5456,7 @@ var TransactionSearch = () => {
|
|
|
5437
5456
|
onChange: (e) => setTransactionId(e.target.value),
|
|
5438
5457
|
spellCheck: false
|
|
5439
5458
|
}
|
|
5440
|
-
)), /* @__PURE__ */
|
|
5459
|
+
)), /* @__PURE__ */ React72.createElement(SecondaryButton_default, { clickHandler: handleSearch }, "Search"));
|
|
5441
5460
|
};
|
|
5442
5461
|
var TransactionSearch_default = TransactionSearch;
|
|
5443
5462
|
|
|
@@ -5497,7 +5516,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5497
5516
|
toast3.error(
|
|
5498
5517
|
"The provided transaction id is not valid, please use a different one or contact support for further assistance",
|
|
5499
5518
|
{
|
|
5500
|
-
icon: /* @__PURE__ */
|
|
5519
|
+
icon: /* @__PURE__ */ React73.createElement(Error_default, null)
|
|
5501
5520
|
}
|
|
5502
5521
|
);
|
|
5503
5522
|
}, [error]);
|
|
@@ -5521,7 +5540,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5521
5540
|
setErrorStep(1);
|
|
5522
5541
|
setLoadingStep(-1);
|
|
5523
5542
|
logger_default.error("transaction failed:", data.failReason);
|
|
5524
|
-
toast3.error("Unavailable", { icon: /* @__PURE__ */
|
|
5543
|
+
toast3.error("Unavailable", { icon: /* @__PURE__ */ React73.createElement(Error_default, null) });
|
|
5525
5544
|
setErrorMessage("Unavailable");
|
|
5526
5545
|
} else if (status === "Paid" /* PAID */) {
|
|
5527
5546
|
setStep(3);
|
|
@@ -5532,7 +5551,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5532
5551
|
toast3.error(
|
|
5533
5552
|
"Failed to release tokens to target! Starting refund process.",
|
|
5534
5553
|
{
|
|
5535
|
-
icon: /* @__PURE__ */
|
|
5554
|
+
icon: /* @__PURE__ */ React73.createElement(Error_default, null)
|
|
5536
5555
|
}
|
|
5537
5556
|
);
|
|
5538
5557
|
setErrorMessage(
|
|
@@ -5543,7 +5562,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5543
5562
|
setErrorStep(3);
|
|
5544
5563
|
setLoadingStep(-1);
|
|
5545
5564
|
toast3.error("Failed to refund tokens to source!", {
|
|
5546
|
-
icon: /* @__PURE__ */
|
|
5565
|
+
icon: /* @__PURE__ */ React73.createElement(Error_default, null)
|
|
5547
5566
|
});
|
|
5548
5567
|
setErrorMessage("Failed to refund tokens to source!");
|
|
5549
5568
|
} else if (status === "RefundCompleted" /* REFUNDCOMPLETED */) {
|
|
@@ -5551,7 +5570,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5551
5570
|
setErrorStep(3);
|
|
5552
5571
|
setLoadingStep(-1);
|
|
5553
5572
|
toast3.success("Refund completed!", {
|
|
5554
|
-
icon: /* @__PURE__ */
|
|
5573
|
+
icon: /* @__PURE__ */ React73.createElement(Error_default, null)
|
|
5555
5574
|
});
|
|
5556
5575
|
setErrorMessage("Refund completed!");
|
|
5557
5576
|
} else if (status === "FailedToPay" /* FAILEDTOPAY */) {
|
|
@@ -5560,7 +5579,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5560
5579
|
setLoadingStep(-1);
|
|
5561
5580
|
logger_default.error("transaction failed:", data.failReason);
|
|
5562
5581
|
toast3.error("Failed to release tokens to target!", {
|
|
5563
|
-
icon: /* @__PURE__ */
|
|
5582
|
+
icon: /* @__PURE__ */ React73.createElement(Error_default, null)
|
|
5564
5583
|
});
|
|
5565
5584
|
setErrorMessage("Failed to release tokens to target!");
|
|
5566
5585
|
} else if (status === "FailedToPull" /* FAILEDTOPULL */) {
|
|
@@ -5568,7 +5587,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5568
5587
|
setErrorStep(1);
|
|
5569
5588
|
setLoadingStep(-1);
|
|
5570
5589
|
logger_default.error("transaction failed:", data.failReason);
|
|
5571
|
-
toast3.error("Failed to pull tokens from source!", { icon: /* @__PURE__ */
|
|
5590
|
+
toast3.error("Failed to pull tokens from source!", { icon: /* @__PURE__ */ React73.createElement(Error_default, null) });
|
|
5572
5591
|
setErrorMessage("Failed to pull tokens from source!");
|
|
5573
5592
|
} else if (status === "Completed" /* COMPLETED */) {
|
|
5574
5593
|
setStep(4);
|
|
@@ -5629,7 +5648,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5629
5648
|
dispatch(setTxId(-1));
|
|
5630
5649
|
dispatch(setSubmitted(false));
|
|
5631
5650
|
};
|
|
5632
|
-
return /* @__PURE__ */
|
|
5651
|
+
return /* @__PURE__ */ React73.createElement(Provider2, { store }, /* @__PURE__ */ React73.createElement(
|
|
5633
5652
|
"div",
|
|
5634
5653
|
{
|
|
5635
5654
|
className: `kima-card transaction-card ${theme.colorMode} ${minimized ? "minimized" : ""}`,
|
|
@@ -5637,17 +5656,17 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5637
5656
|
background: theme.colorMode === "light" /* light */ ? theme.backgroundColorLight : theme.backgroundColorDark
|
|
5638
5657
|
}
|
|
5639
5658
|
},
|
|
5640
|
-
/* @__PURE__ */
|
|
5659
|
+
/* @__PURE__ */ React73.createElement("div", { className: "kima-card-header" }, /* @__PURE__ */ React73.createElement("div", { className: "topbar" }, /* @__PURE__ */ React73.createElement("div", { className: "title" }, isValidTxId && !error ? /* @__PURE__ */ React73.createElement("div", { className: "transaction-title" }, mode !== "status" /* status */ ? data?.status === "Completed" /* COMPLETED */ ? "Transferred " : "Transfering " : isEmptyStatus ? "Fetching transaction status " : data?.status === "Completed" /* COMPLETED */ ? "Transfered " : "Transfering ", mode !== "status" /* status */ ? Number(amount) !== 0 ? transactionSourceChain?.shortName === "CC" ? bigIntToNumber(txValues.allowanceAmount).toFixed(2) : formatBigInt(txValues.allowanceAmount) : "" : data?.amount || "", " ", mode !== "status" /* status */ ? `${sourceSymbol} ` : isEmptyStatus ? "" : `(${data?.sourceSymbol})`, /* @__PURE__ */ React73.createElement("div", { className: "title-icon" }, /* @__PURE__ */ React73.createElement(
|
|
5641
5660
|
ChainIcon,
|
|
5642
5661
|
{
|
|
5643
5662
|
symbol: transactionSourceChain?.shortName
|
|
5644
5663
|
}
|
|
5645
|
-
)), " ", mode !== "status" /* status */ ? `${transactionSourceChain?.name}` : isEmptyStatus ? "" : `${data?.sourceChain === "FIAT" ? "CC" : data?.sourceChain}`, " ", mode !== "status" /* status */ ? `\u2192 ` : isEmptyStatus ? "" : `\u2192 `, mode !== "status" /* status */ ? Number(amount) !== 0 ? transactionSourceChain?.shortName === "CC" ? bigIntToNumber(txValues.submitAmount).toFixed(2) : formatBigInt(txValues.submitAmount) : "" : data?.amount || "", " ", mode !== "status" /* status */ ? `${targetSymbol}${" "}` : isEmptyStatus ? "" : `${data?.targetSymbol}${" "}`, /* @__PURE__ */
|
|
5664
|
+
)), " ", mode !== "status" /* status */ ? `${transactionSourceChain?.name}` : isEmptyStatus ? "" : `${data?.sourceChain === "FIAT" ? "CC" : data?.sourceChain}`, " ", mode !== "status" /* status */ ? `\u2192 ` : isEmptyStatus ? "" : `\u2192 `, mode !== "status" /* status */ ? Number(amount) !== 0 ? transactionSourceChain?.shortName === "CC" ? bigIntToNumber(txValues.submitAmount).toFixed(2) : formatBigInt(txValues.submitAmount) : "" : data?.amount || "", " ", mode !== "status" /* status */ ? `${targetSymbol}${" "}` : isEmptyStatus ? "" : `${data?.targetSymbol}${" "}`, /* @__PURE__ */ React73.createElement("div", { className: "title-icon" }, /* @__PURE__ */ React73.createElement(
|
|
5646
5665
|
ChainIcon,
|
|
5647
5666
|
{
|
|
5648
5667
|
symbol: transactionTargetChain?.shortName
|
|
5649
5668
|
}
|
|
5650
|
-
)), " ", mode !== "status" /* status */ ? `${transactionTargetChain?.name}${" "}` : isEmptyStatus ? "" : `${data?.targetChain} ${" "}`) : /* @__PURE__ */
|
|
5669
|
+
)), " ", mode !== "status" /* status */ ? `${transactionTargetChain?.name}${" "}` : isEmptyStatus ? "" : `${data?.targetChain} ${" "}`) : /* @__PURE__ */ React73.createElement("div", null, /* @__PURE__ */ React73.createElement("h3", { className: "transaction" }, "Transaction Status"))), !minimized ? /* @__PURE__ */ React73.createElement("div", { className: "control-buttons" }, /* @__PURE__ */ React73.createElement(
|
|
5651
5670
|
"button",
|
|
5652
5671
|
{
|
|
5653
5672
|
className: "icon-button minimize",
|
|
@@ -5655,9 +5674,9 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5655
5674
|
setMinimized(true);
|
|
5656
5675
|
}
|
|
5657
5676
|
},
|
|
5658
|
-
/* @__PURE__ */
|
|
5659
|
-
), !isValidTxId || loadingStep < 0 || error ? /* @__PURE__ */
|
|
5660
|
-
isValidTxId && !error ? /* @__PURE__ */
|
|
5677
|
+
/* @__PURE__ */ React73.createElement(Minimize_default, null)
|
|
5678
|
+
), !isValidTxId || loadingStep < 0 || error ? /* @__PURE__ */ React73.createElement("button", { className: "reset-button", onClick: resetForm }, "Reset") : null) : /* @__PURE__ */ React73.createElement("div", { className: "control-buttons" }, /* @__PURE__ */ React73.createElement("div", { className: "maximize", onClick: () => setMinimized(false) }, "View")))),
|
|
5679
|
+
isValidTxId && !error ? /* @__PURE__ */ React73.createElement("div", { className: "kima-card-content" }, /* @__PURE__ */ React73.createElement("div", { className: "transaction-content" }, /* @__PURE__ */ React73.createElement(
|
|
5661
5680
|
Progressbar_default,
|
|
5662
5681
|
{
|
|
5663
5682
|
step,
|
|
@@ -5666,7 +5685,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5666
5685
|
setFocus,
|
|
5667
5686
|
loadingStep
|
|
5668
5687
|
}
|
|
5669
|
-
), /* @__PURE__ */
|
|
5688
|
+
), /* @__PURE__ */ React73.createElement(
|
|
5670
5689
|
StepBox_default,
|
|
5671
5690
|
{
|
|
5672
5691
|
step,
|
|
@@ -5674,14 +5693,14 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5674
5693
|
loadingStep,
|
|
5675
5694
|
data
|
|
5676
5695
|
}
|
|
5677
|
-
)), !error && !isEmptyStatus && /* @__PURE__ */
|
|
5696
|
+
)), !error && !isEmptyStatus && /* @__PURE__ */ React73.createElement(
|
|
5678
5697
|
TransactionStatusMessage_default,
|
|
5679
5698
|
{
|
|
5680
5699
|
isCompleted: data?.status,
|
|
5681
5700
|
transactionId: txId.toString()
|
|
5682
5701
|
}
|
|
5683
|
-
)) : /* @__PURE__ */
|
|
5684
|
-
/* @__PURE__ */
|
|
5702
|
+
)) : /* @__PURE__ */ React73.createElement("div", { className: "kima-card-content" }, /* @__PURE__ */ React73.createElement("h4", { className: "subtitle" }, "You can follow the status of a previous submitted transaction by entering the provided transaction id"), /* @__PURE__ */ React73.createElement("div", { className: "single-form" }, /* @__PURE__ */ React73.createElement(TransactionSearch_default, null))),
|
|
5703
|
+
/* @__PURE__ */ React73.createElement(
|
|
5685
5704
|
Toaster,
|
|
5686
5705
|
{
|
|
5687
5706
|
position: "top-right",
|
|
@@ -5708,21 +5727,21 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5708
5727
|
}
|
|
5709
5728
|
}
|
|
5710
5729
|
),
|
|
5711
|
-
/* @__PURE__ */
|
|
5730
|
+
/* @__PURE__ */ React73.createElement("div", { className: "floating-footer status" }, /* @__PURE__ */ React73.createElement("div", { className: `items ${theme.colorMode}` }, /* @__PURE__ */ React73.createElement("span", null, "Powered by"), /* @__PURE__ */ React73.createElement(KimaNetwork_default, null)))
|
|
5712
5731
|
));
|
|
5713
5732
|
};
|
|
5714
5733
|
|
|
5715
5734
|
// src/components/TransferWidget.tsx
|
|
5716
|
-
import
|
|
5735
|
+
import React84, { useEffect as useEffect21, useState as useState16, useRef as useRef8, useMemo as useMemo21, useCallback as useCallback3 } from "react";
|
|
5717
5736
|
import { useDispatch as useDispatch26, useSelector as useSelector45 } from "react-redux";
|
|
5718
5737
|
|
|
5719
5738
|
// src/components/reusable/SingleForm.tsx
|
|
5720
|
-
import
|
|
5739
|
+
import React75, { useEffect as useEffect17, useMemo as useMemo14, useState as useState13 } from "react";
|
|
5721
5740
|
import { toast as toast4 } from "react-hot-toast";
|
|
5722
5741
|
import { useDispatch as useDispatch17, useSelector as useSelector35 } from "react-redux";
|
|
5723
5742
|
|
|
5724
5743
|
// src/components/primary/NetworkSelector.tsx
|
|
5725
|
-
import
|
|
5744
|
+
import React74, { useState as useState12, useMemo as useMemo13, useRef as useRef4, useEffect as useEffect16 } from "react";
|
|
5726
5745
|
import { useSelector as useSelector33, useDispatch as useDispatch16 } from "react-redux";
|
|
5727
5746
|
var NetworkSelector = ({
|
|
5728
5747
|
type,
|
|
@@ -5736,6 +5755,7 @@ var NetworkSelector = ({
|
|
|
5736
5755
|
const networkOptions3 = useSelector33(selectNetworks);
|
|
5737
5756
|
const mode = useSelector33(selectMode);
|
|
5738
5757
|
const sourceNetwork = useSelector33(selectSourceChain);
|
|
5758
|
+
const sourceSymbol = useSelector33(selectSourceCurrency);
|
|
5739
5759
|
const targetNetwork = useSelector33(selectTargetChain);
|
|
5740
5760
|
const { switchChainHandler } = useKimaContext();
|
|
5741
5761
|
const isOriginSelector = type === "origin";
|
|
@@ -5743,9 +5763,18 @@ var NetworkSelector = ({
|
|
|
5743
5763
|
return networkOptions3.filter((network) => {
|
|
5744
5764
|
const isSameAsSource = isOriginSelector ? false : network.shortName === sourceNetwork.shortName;
|
|
5745
5765
|
const isAllowedInLightMode = mode !== "light" /* light */ || lightDemoNetworks.includes(network.shortName);
|
|
5746
|
-
|
|
5766
|
+
const sourceToken = sourceNetwork.supportedTokens.find(
|
|
5767
|
+
(t) => t.symbol === sourceSymbol
|
|
5768
|
+
);
|
|
5769
|
+
let supportsSourceCurrency = true;
|
|
5770
|
+
if (!isOriginSelector && !!sourceToken) {
|
|
5771
|
+
supportsSourceCurrency = network.supportedTokens.some(
|
|
5772
|
+
(token) => token.peggedTo === sourceToken?.peggedTo
|
|
5773
|
+
);
|
|
5774
|
+
}
|
|
5775
|
+
return network.supportedLocations.includes(type) && !isSameAsSource && supportsSourceCurrency && isAllowedInLightMode;
|
|
5747
5776
|
});
|
|
5748
|
-
}, [networkOptions3, sourceNetwork, type, mode]);
|
|
5777
|
+
}, [networkOptions3, sourceNetwork, sourceSymbol, type, mode]);
|
|
5749
5778
|
const selectedNetwork = useMemo13(() => {
|
|
5750
5779
|
if (initialSelection) {
|
|
5751
5780
|
return {
|
|
@@ -5818,20 +5847,20 @@ var NetworkSelector = ({
|
|
|
5818
5847
|
dispatch(setTargetAddress(lightDemoAccounts.TRX));
|
|
5819
5848
|
}
|
|
5820
5849
|
}, [sourceNetwork, targetNetwork, mode]);
|
|
5821
|
-
return /* @__PURE__ */
|
|
5850
|
+
return /* @__PURE__ */ React74.createElement(
|
|
5822
5851
|
"div",
|
|
5823
5852
|
{
|
|
5824
5853
|
className: `network-dropdown ${theme?.colorMode ?? ""} ${collapsed ? "collapsed" : "toggled"}`,
|
|
5825
5854
|
onClick: () => setCollapsed((prev) => !prev),
|
|
5826
5855
|
ref
|
|
5827
5856
|
},
|
|
5828
|
-
/* @__PURE__ */
|
|
5829
|
-
/* @__PURE__ */
|
|
5857
|
+
/* @__PURE__ */ React74.createElement("div", { className: "network-wrapper" }, /* @__PURE__ */ React74.createElement(ChainIcon, { symbol: selectedNetwork.shortName }), /* @__PURE__ */ React74.createElement("span", null, selectedNetwork.name)),
|
|
5858
|
+
/* @__PURE__ */ React74.createElement(
|
|
5830
5859
|
"div",
|
|
5831
5860
|
{
|
|
5832
5861
|
className: `network-menu custom-scrollbar ${theme?.colorMode ?? ""} ${collapsed ? "collapsed" : "toggled"}`
|
|
5833
5862
|
},
|
|
5834
|
-
networks.filter((network) => network.shortName !== selectedNetwork.shortName).map((network) => /* @__PURE__ */
|
|
5863
|
+
networks.filter((network) => network.shortName !== selectedNetwork.shortName).map((network) => /* @__PURE__ */ React74.createElement(
|
|
5835
5864
|
"div",
|
|
5836
5865
|
{
|
|
5837
5866
|
key: network.id,
|
|
@@ -5843,15 +5872,15 @@ var NetworkSelector = ({
|
|
|
5843
5872
|
}
|
|
5844
5873
|
}
|
|
5845
5874
|
},
|
|
5846
|
-
network.disabled ? /* @__PURE__ */
|
|
5847
|
-
/* @__PURE__ */
|
|
5848
|
-
network.disabled && /* @__PURE__ */
|
|
5875
|
+
network.disabled ? /* @__PURE__ */ React74.createElement(Warning_default, { width: 25, height: 25 }) : /* @__PURE__ */ React74.createElement(ChainIcon, { symbol: network.shortName }),
|
|
5876
|
+
/* @__PURE__ */ React74.createElement("p", null, network.name),
|
|
5877
|
+
network.disabled && /* @__PURE__ */ React74.createElement("span", { className: "tooltip" }, "Temporarily unavailable")
|
|
5849
5878
|
))
|
|
5850
5879
|
),
|
|
5851
|
-
/* @__PURE__ */
|
|
5880
|
+
/* @__PURE__ */ React74.createElement("div", { className: `dropdown-icon ${collapsed ? "toggled" : "collapsed"}` }, /* @__PURE__ */ React74.createElement(Arrow_default, { fill: "none" }))
|
|
5852
5881
|
);
|
|
5853
5882
|
};
|
|
5854
|
-
var NetworkSelector_default =
|
|
5883
|
+
var NetworkSelector_default = React74.memo(NetworkSelector);
|
|
5855
5884
|
|
|
5856
5885
|
// src/components/reusable/SingleForm.tsx
|
|
5857
5886
|
import { parseUnits as parseUnits2 } from "viem";
|
|
@@ -6019,6 +6048,12 @@ var SingleForm = ({
|
|
|
6019
6048
|
const intAmount = parseUnits2(amount, totalFee.decimals);
|
|
6020
6049
|
return balance - intAmount;
|
|
6021
6050
|
}, [balance, totalFee, feeDeduct]);
|
|
6051
|
+
const feeCurrency = useMemo14(() => {
|
|
6052
|
+
const sourceToken = sourceNetwork.supportedTokens.find(
|
|
6053
|
+
(t) => t.symbol === sourceCurrency
|
|
6054
|
+
);
|
|
6055
|
+
return sourceToken?.peggedTo ?? "USD";
|
|
6056
|
+
}, [sourceNetwork, sourceCurrency]);
|
|
6022
6057
|
useEffect17(() => {
|
|
6023
6058
|
if (!errorMessage) return;
|
|
6024
6059
|
toast4.error(errorMessage);
|
|
@@ -6054,7 +6089,7 @@ var SingleForm = ({
|
|
|
6054
6089
|
const isConnected = useMemo14(() => {
|
|
6055
6090
|
return isReady && !initialSelection.sourceSelection;
|
|
6056
6091
|
}, [isReady, initialSelection]);
|
|
6057
|
-
return /* @__PURE__ */
|
|
6092
|
+
return /* @__PURE__ */ React75.createElement("div", { className: "single-form" }, /* @__PURE__ */ React75.createElement("div", { className: "form-item" }, /* @__PURE__ */ React75.createElement("span", { className: "label" }, "Source Network:"), /* @__PURE__ */ React75.createElement("div", { className: "items" }, /* @__PURE__ */ React75.createElement(
|
|
6058
6093
|
NetworkSelector_default,
|
|
6059
6094
|
{
|
|
6060
6095
|
type: "origin",
|
|
@@ -6063,20 +6098,20 @@ var SingleForm = ({
|
|
|
6063
6098
|
setInitialSelection
|
|
6064
6099
|
}
|
|
6065
6100
|
}
|
|
6066
|
-
), /* @__PURE__ */
|
|
6101
|
+
), /* @__PURE__ */ React75.createElement(CoinDropdown_default, null))), /* @__PURE__ */ React75.createElement(
|
|
6067
6102
|
"div",
|
|
6068
6103
|
{
|
|
6069
6104
|
className: `dynamic-area ${sourceNetwork.shortName === "FIAT" /* FIAT */ ? "reverse" : "1"}`
|
|
6070
6105
|
},
|
|
6071
|
-
sourceNetwork.compatibility !== "CC" /* CC */ && /* @__PURE__ */
|
|
6106
|
+
sourceNetwork.compatibility !== "CC" /* CC */ && /* @__PURE__ */ React75.createElement(
|
|
6072
6107
|
"div",
|
|
6073
6108
|
{
|
|
6074
6109
|
className: `form-item wallet-button-item ${isConnected && "connected"}`
|
|
6075
6110
|
},
|
|
6076
|
-
/* @__PURE__ */
|
|
6077
|
-
/* @__PURE__ */
|
|
6111
|
+
/* @__PURE__ */ React75.createElement("span", { className: "label" }, "Wallet:"),
|
|
6112
|
+
/* @__PURE__ */ React75.createElement(WalletButton_default, { initialSelection: initialSelection.sourceSelection })
|
|
6078
6113
|
),
|
|
6079
|
-
mode !== "payment" /* payment */ && /* @__PURE__ */
|
|
6114
|
+
mode !== "payment" /* payment */ && /* @__PURE__ */ React75.createElement("div", { className: "form-item" }, /* @__PURE__ */ React75.createElement("span", { className: "label" }, "Target Network:"), /* @__PURE__ */ React75.createElement("div", { className: "items" }, /* @__PURE__ */ React75.createElement(
|
|
6080
6115
|
NetworkSelector_default,
|
|
6081
6116
|
{
|
|
6082
6117
|
type: "target",
|
|
@@ -6085,29 +6120,29 @@ var SingleForm = ({
|
|
|
6085
6120
|
setInitialSelection
|
|
6086
6121
|
}
|
|
6087
6122
|
}
|
|
6088
|
-
), /* @__PURE__ */
|
|
6089
|
-
), mode === "bridge" /* bridge */ && sourceNetwork.shortName !== "FIAT" /* FIAT */ ? targetNetwork.shortName === "FIAT" /* FIAT */ ? /* @__PURE__ */
|
|
6123
|
+
), /* @__PURE__ */ React75.createElement(CoinDropdown_default, { isSourceChain: false })))
|
|
6124
|
+
), mode === "bridge" /* bridge */ && sourceNetwork.shortName !== "FIAT" /* FIAT */ ? targetNetwork.shortName === "FIAT" /* FIAT */ ? /* @__PURE__ */ React75.createElement(BankInput_default, null) : /* @__PURE__ */ React75.createElement("div", { className: `form-item ${theme.colorMode}` }, /* @__PURE__ */ React75.createElement("span", { className: "label" }, "Target Address:"), /* @__PURE__ */ React75.createElement(
|
|
6090
6125
|
AddressInput_default,
|
|
6091
6126
|
{
|
|
6092
6127
|
theme: theme.colorMode,
|
|
6093
6128
|
placeholder: "Target address",
|
|
6094
6129
|
initialSelection
|
|
6095
6130
|
}
|
|
6096
|
-
)) : null, mode === "light" /* light */ && /* @__PURE__ */
|
|
6131
|
+
)) : null, mode === "light" /* light */ && /* @__PURE__ */ React75.createElement(
|
|
6097
6132
|
"div",
|
|
6098
6133
|
{
|
|
6099
6134
|
className: `form-item wallet-button-item ${!initialSelection.targetSelection && "connected"}`,
|
|
6100
6135
|
style: { display: "flex", alignItems: "center" }
|
|
6101
6136
|
},
|
|
6102
|
-
/* @__PURE__ */
|
|
6103
|
-
/* @__PURE__ */
|
|
6137
|
+
/* @__PURE__ */ React75.createElement("span", { className: "label" }, "Target Wallet:"),
|
|
6138
|
+
/* @__PURE__ */ React75.createElement(
|
|
6104
6139
|
WalletButton_default,
|
|
6105
6140
|
{
|
|
6106
6141
|
initialSelection: initialSelection.targetSelection,
|
|
6107
6142
|
placeholder: true
|
|
6108
6143
|
}
|
|
6109
6144
|
)
|
|
6110
|
-
), mode === "bridge" /* bridge */ && /* @__PURE__ */
|
|
6145
|
+
), mode === "bridge" /* bridge */ && /* @__PURE__ */ React75.createElement("div", { className: `form-item ${theme.colorMode}` }, /* @__PURE__ */ React75.createElement("span", { className: "label" }, "Amount:"), /* @__PURE__ */ React75.createElement("div", { className: `amount-label-container items ${theme.colorMode}` }, /* @__PURE__ */ React75.createElement(
|
|
6111
6146
|
"input",
|
|
6112
6147
|
{
|
|
6113
6148
|
className: `${theme.colorMode}`,
|
|
@@ -6116,7 +6151,7 @@ var SingleForm = ({
|
|
|
6116
6151
|
value: amountValue || "",
|
|
6117
6152
|
onChange: (e) => onAmountChange(e.target.value)
|
|
6118
6153
|
}
|
|
6119
|
-
), /* @__PURE__ */
|
|
6154
|
+
), /* @__PURE__ */ React75.createElement("div", { className: "max-disclaimer" }, sourceNetwork.shortName !== "CC" && /* @__PURE__ */ React75.createElement("span", { className: "max-button", onClick: onMaxClick }, "Max"), +totalFee !== -1 && /* @__PURE__ */ React75.createElement("p", { className: "fee-amount" }, "Est fees:", " ", /* @__PURE__ */ React75.createElement("span", { className: `${isLoadingFees ? "loading" : ""}` }, " ", isLoadingFees ? "" : `$ ${formatBigInt(totalFee)} ${feeCurrency}`))))));
|
|
6120
6155
|
};
|
|
6121
6156
|
var SingleForm_default = SingleForm;
|
|
6122
6157
|
|
|
@@ -6165,11 +6200,11 @@ function useAllowance2({
|
|
|
6165
6200
|
import { toast as toast5, Toaster as Toaster2 } from "react-hot-toast";
|
|
6166
6201
|
|
|
6167
6202
|
// plugins/solana/components/SolanaWalletConnectModal.tsx
|
|
6168
|
-
import
|
|
6203
|
+
import React78 from "react";
|
|
6169
6204
|
import { useDispatch as useDispatch20, useSelector as useSelector38 } from "react-redux";
|
|
6170
6205
|
|
|
6171
6206
|
// plugins/solana/components/SolanaWalletSelect.tsx
|
|
6172
|
-
import
|
|
6207
|
+
import React76, { useCallback as useCallback2, useEffect as useEffect18, useMemo as useMemo15, useRef as useRef5 } from "react";
|
|
6173
6208
|
import { useDispatch as useDispatch18, useSelector as useSelector36 } from "react-redux";
|
|
6174
6209
|
import { useWallet as useWallet7 } from "@solana/wallet-adapter-react";
|
|
6175
6210
|
import { WalletReadyState } from "@solana/wallet-adapter-base";
|
|
@@ -6243,28 +6278,28 @@ var SolanaWalletSelect = () => {
|
|
|
6243
6278
|
}
|
|
6244
6279
|
dispatch(setSolanaConnectModal(false));
|
|
6245
6280
|
}, [wallet, sourceChain]);
|
|
6246
|
-
return /* @__PURE__ */
|
|
6281
|
+
return /* @__PURE__ */ React76.createElement("div", { className: `wallet-select` }, /* @__PURE__ */ React76.createElement("div", { className: "slide-area hide-scrollbar", ref: sliderRef }, /* @__PURE__ */ React76.createElement("div", { className: "wallet-container" }, detected.map((wallet2, index) => /* @__PURE__ */ React76.createElement(
|
|
6247
6282
|
"div",
|
|
6248
6283
|
{
|
|
6249
6284
|
className: `card-item ${theme.colorMode}`,
|
|
6250
6285
|
onClick: () => handleWalletClick(wallet2.adapter.name),
|
|
6251
6286
|
key: `${wallet2.adapter.name}-${index}`
|
|
6252
6287
|
},
|
|
6253
|
-
/* @__PURE__ */
|
|
6254
|
-
)), undetected.map((wallet2, index) => /* @__PURE__ */
|
|
6288
|
+
/* @__PURE__ */ React76.createElement("div", { className: "wallet-item" }, /* @__PURE__ */ React76.createElement("img", { src: wallet2.adapter.icon, alt: wallet2.adapter.name }), /* @__PURE__ */ React76.createElement("span", null, wallet2.adapter.name))
|
|
6289
|
+
)), undetected.map((wallet2, index) => /* @__PURE__ */ React76.createElement(
|
|
6255
6290
|
ExternalLink_default,
|
|
6256
6291
|
{
|
|
6257
6292
|
to: wallet2.adapter.url,
|
|
6258
6293
|
className: `card-item ${theme.colorMode}`,
|
|
6259
6294
|
key: `${wallet2.adapter.name}-${index}`
|
|
6260
6295
|
},
|
|
6261
|
-
/* @__PURE__ */
|
|
6296
|
+
/* @__PURE__ */ React76.createElement("div", { className: "wallet-item" }, /* @__PURE__ */ React76.createElement("img", { src: wallet2.adapter.icon, alt: wallet2.adapter.name }), /* @__PURE__ */ React76.createElement("span", null, "Install ", wallet2.adapter.name))
|
|
6262
6297
|
)))));
|
|
6263
6298
|
};
|
|
6264
6299
|
var SolanaWalletSelect_default = SolanaWalletSelect;
|
|
6265
6300
|
|
|
6266
6301
|
// plugins/solana/components/AccountDetailsModal.tsx
|
|
6267
|
-
import
|
|
6302
|
+
import React77, { useMemo as useMemo16 } from "react";
|
|
6268
6303
|
import { useDispatch as useDispatch19, useSelector as useSelector37 } from "react-redux";
|
|
6269
6304
|
import { useWallet as useSolanaWallet3 } from "@solana/wallet-adapter-react";
|
|
6270
6305
|
var AccountDetailsModal = () => {
|
|
@@ -6285,25 +6320,25 @@ var AccountDetailsModal = () => {
|
|
|
6285
6320
|
dispatch(setAccountDetailsModal(false));
|
|
6286
6321
|
};
|
|
6287
6322
|
if (sourceChain.shortName !== "SOL") return;
|
|
6288
|
-
return /* @__PURE__ */
|
|
6323
|
+
return /* @__PURE__ */ React77.createElement(
|
|
6289
6324
|
"div",
|
|
6290
6325
|
{
|
|
6291
6326
|
className: `kima-modal ${theme.colorMode} ${accountDetailsModal && "open"}`
|
|
6292
6327
|
},
|
|
6293
|
-
/* @__PURE__ */
|
|
6294
|
-
/* @__PURE__ */
|
|
6328
|
+
/* @__PURE__ */ React77.createElement("div", { className: "modal-overlay" }),
|
|
6329
|
+
/* @__PURE__ */ React77.createElement("div", { className: `modal-content-container ${theme.colorMode}` }, /* @__PURE__ */ React77.createElement("div", { className: "kima-card-header" }, /* @__PURE__ */ React77.createElement("div", { className: "topbar" }, /* @__PURE__ */ React77.createElement("div", { className: "title" }, /* @__PURE__ */ React77.createElement("h3", null, "Account Details")), /* @__PURE__ */ React77.createElement("div", { className: "control-buttons" }, /* @__PURE__ */ React77.createElement(
|
|
6295
6330
|
"button",
|
|
6296
6331
|
{
|
|
6297
6332
|
className: "cross-icon-button",
|
|
6298
6333
|
onClick: () => dispatch(setAccountDetailsModal(false))
|
|
6299
6334
|
},
|
|
6300
|
-
/* @__PURE__ */
|
|
6335
|
+
/* @__PURE__ */ React77.createElement(
|
|
6301
6336
|
Cross_default,
|
|
6302
6337
|
{
|
|
6303
6338
|
fill: theme.colorMode === "light" ? "black" : "white"
|
|
6304
6339
|
}
|
|
6305
6340
|
)
|
|
6306
|
-
)))), /* @__PURE__ */
|
|
6341
|
+
)))), /* @__PURE__ */ React77.createElement("div", { className: "modal-content" }, /* @__PURE__ */ React77.createElement("div", { className: "summary" }, networkDetails && /* @__PURE__ */ React77.createElement(networkDetails.icon, { width: 60, height: 60 }), /* @__PURE__ */ React77.createElement("div", { className: "address" }, /* @__PURE__ */ React77.createElement("h2", null, getShortenedAddress(walletAddress || "")), /* @__PURE__ */ React77.createElement(CopyButton_default, { text: walletAddress })), /* @__PURE__ */ React77.createElement("h3", null, formatterFloat.format(Number(solBalance)), " $SOL")), /* @__PURE__ */ React77.createElement(SecondaryButton_default, { className: "block-explorer" }, /* @__PURE__ */ React77.createElement(ExternalLink_default, { className: "link", to: explorerUrl }, /* @__PURE__ */ React77.createElement(Explorer_default, { fill: "#778DA3" }), /* @__PURE__ */ React77.createElement("p", null, "Block explorer"), /* @__PURE__ */ React77.createElement(ExternalUrl_default, { fill: "#778DA3" }))), /* @__PURE__ */ React77.createElement(PrimaryButton_default, { clickHandler: handleDisconnect }, "Discconect")))
|
|
6307
6342
|
);
|
|
6308
6343
|
};
|
|
6309
6344
|
var AccountDetailsModal_default = AccountDetailsModal;
|
|
@@ -6313,18 +6348,18 @@ var SolanaWalletConnectModal = () => {
|
|
|
6313
6348
|
const dispatch = useDispatch20();
|
|
6314
6349
|
const theme = useSelector38(selectTheme);
|
|
6315
6350
|
const connectModal = useSelector38(selectSolanaConnectModal);
|
|
6316
|
-
return /* @__PURE__ */
|
|
6351
|
+
return /* @__PURE__ */ React78.createElement("div", null, /* @__PURE__ */ React78.createElement(AccountDetailsModal_default, null), /* @__PURE__ */ React78.createElement(
|
|
6317
6352
|
"div",
|
|
6318
6353
|
{
|
|
6319
6354
|
className: `kima-modal wallet-connect ${connectModal ? "open" : ""}`
|
|
6320
6355
|
},
|
|
6321
|
-
/* @__PURE__ */
|
|
6356
|
+
/* @__PURE__ */ React78.createElement("div", { className: `modal-content-container ${theme.colorMode}` }, /* @__PURE__ */ React78.createElement("div", { className: "kima-card-header" }, /* @__PURE__ */ React78.createElement("div", { className: "topbar" }, /* @__PURE__ */ React78.createElement("div", { className: "title" }, /* @__PURE__ */ React78.createElement("h3", null, "Connect Wallet")), /* @__PURE__ */ React78.createElement("div", { className: "control-buttons" }, /* @__PURE__ */ React78.createElement(
|
|
6322
6357
|
"button",
|
|
6323
6358
|
{
|
|
6324
6359
|
className: "cross-icon-button",
|
|
6325
6360
|
onClick: () => dispatch(setSolanaConnectModal(false))
|
|
6326
6361
|
},
|
|
6327
|
-
/* @__PURE__ */
|
|
6362
|
+
/* @__PURE__ */ React78.createElement(
|
|
6328
6363
|
Cross_default,
|
|
6329
6364
|
{
|
|
6330
6365
|
width: 30,
|
|
@@ -6332,17 +6367,17 @@ var SolanaWalletConnectModal = () => {
|
|
|
6332
6367
|
fill: theme.colorMode === "light" ? "black" : "white"
|
|
6333
6368
|
}
|
|
6334
6369
|
)
|
|
6335
|
-
)))), /* @__PURE__ */
|
|
6370
|
+
)))), /* @__PURE__ */ React78.createElement("div", { className: "modal-content" }, /* @__PURE__ */ React78.createElement(SolanaWalletSelect_default, null)))
|
|
6336
6371
|
));
|
|
6337
6372
|
};
|
|
6338
6373
|
var SolanaWalletConnectModal_default = SolanaWalletConnectModal;
|
|
6339
6374
|
|
|
6340
6375
|
// plugins/tron/components/TronWalletConnectModal.tsx
|
|
6341
|
-
import
|
|
6376
|
+
import React81 from "react";
|
|
6342
6377
|
import { useDispatch as useDispatch23, useSelector as useSelector41 } from "react-redux";
|
|
6343
6378
|
|
|
6344
6379
|
// plugins/tron/components/AccountDetailsModal.tsx
|
|
6345
|
-
import
|
|
6380
|
+
import React79, { useMemo as useMemo17 } from "react";
|
|
6346
6381
|
import { useDispatch as useDispatch21, useSelector as useSelector39 } from "react-redux";
|
|
6347
6382
|
import { useWallet as useTronWallet3 } from "@tronweb3/tronwallet-adapter-react-hooks";
|
|
6348
6383
|
var AccountDetailsModal2 = () => {
|
|
@@ -6367,31 +6402,31 @@ var AccountDetailsModal2 = () => {
|
|
|
6367
6402
|
dispatch(setAccountDetailsModal(false));
|
|
6368
6403
|
};
|
|
6369
6404
|
if (sourcheChain.shortName !== "TRX") return;
|
|
6370
|
-
return /* @__PURE__ */
|
|
6405
|
+
return /* @__PURE__ */ React79.createElement(
|
|
6371
6406
|
"div",
|
|
6372
6407
|
{
|
|
6373
6408
|
className: `kima-modal ${theme.colorMode} ${accountDetailsModal && "open"}`
|
|
6374
6409
|
},
|
|
6375
|
-
/* @__PURE__ */
|
|
6376
|
-
/* @__PURE__ */
|
|
6410
|
+
/* @__PURE__ */ React79.createElement("div", { className: "modal-overlay" }),
|
|
6411
|
+
/* @__PURE__ */ React79.createElement("div", { className: `modal-content-container ${theme.colorMode}` }, /* @__PURE__ */ React79.createElement("div", { className: "kima-card-header" }, /* @__PURE__ */ React79.createElement("div", { className: "topbar" }, /* @__PURE__ */ React79.createElement("div", { className: "title" }, /* @__PURE__ */ React79.createElement("h3", null, "Account Details")), /* @__PURE__ */ React79.createElement("div", { className: "control-buttons" }, /* @__PURE__ */ React79.createElement(
|
|
6377
6412
|
"button",
|
|
6378
6413
|
{
|
|
6379
6414
|
className: "cross-icon-button",
|
|
6380
6415
|
onClick: () => dispatch(setAccountDetailsModal(false))
|
|
6381
6416
|
},
|
|
6382
|
-
/* @__PURE__ */
|
|
6417
|
+
/* @__PURE__ */ React79.createElement(
|
|
6383
6418
|
Cross_default,
|
|
6384
6419
|
{
|
|
6385
6420
|
fill: theme.colorMode === "light" ? "black" : "white"
|
|
6386
6421
|
}
|
|
6387
6422
|
)
|
|
6388
|
-
)))), /* @__PURE__ */
|
|
6423
|
+
)))), /* @__PURE__ */ React79.createElement("div", { className: "modal-content" }, /* @__PURE__ */ React79.createElement("div", { className: "summary" }, networkDetails && /* @__PURE__ */ React79.createElement(networkDetails.icon, { width: 60, height: 60 }), /* @__PURE__ */ React79.createElement("div", { className: "address" }, /* @__PURE__ */ React79.createElement("h2", null, getShortenedAddress(connectedAddress || "")), /* @__PURE__ */ React79.createElement(CopyButton_default, { text: connectedAddress })), /* @__PURE__ */ React79.createElement("h3", null, formatterFloat.format(Number(tronBalance)), " ", selectedNetwork.shortName)), /* @__PURE__ */ React79.createElement(SecondaryButton_default, { className: "block-explorer" }, /* @__PURE__ */ React79.createElement(ExternalLink_default, { className: "link", to: explorerUrl }, /* @__PURE__ */ React79.createElement(Explorer_default, { fill: "#778DA3" }), /* @__PURE__ */ React79.createElement("p", null, "Block explorer"), /* @__PURE__ */ React79.createElement(ExternalUrl_default, { fill: "#778DA3" }))), /* @__PURE__ */ React79.createElement(PrimaryButton_default, { clickHandler: handleDisconnect }, "Disconnect")))
|
|
6389
6424
|
);
|
|
6390
6425
|
};
|
|
6391
6426
|
var AccountDetailsModal_default2 = AccountDetailsModal2;
|
|
6392
6427
|
|
|
6393
6428
|
// plugins/tron/components/TronWalletSelect.tsx
|
|
6394
|
-
import
|
|
6429
|
+
import React80, { useEffect as useEffect19, useMemo as useMemo18, useRef as useRef6 } from "react";
|
|
6395
6430
|
import { useDispatch as useDispatch22, useSelector as useSelector40 } from "react-redux";
|
|
6396
6431
|
import { useWallet as useWallet8 } from "@tronweb3/tronwallet-adapter-react-hooks";
|
|
6397
6432
|
import { AdapterState } from "@tronweb3/tronwallet-abstract-adapter";
|
|
@@ -6450,22 +6485,22 @@ var TronWalletSelect = () => {
|
|
|
6450
6485
|
const connectWallet = async (walletName) => {
|
|
6451
6486
|
currentWallet?.adapter.name === walletName ? await connect() : select(walletName);
|
|
6452
6487
|
};
|
|
6453
|
-
return /* @__PURE__ */
|
|
6488
|
+
return /* @__PURE__ */ React80.createElement("div", { className: `wallet-select` }, /* @__PURE__ */ React80.createElement("div", { className: "slide-area hide-scrollbar", ref: sliderRef }, /* @__PURE__ */ React80.createElement("div", { className: "wallet-container" }, detected.map((wallet, index) => /* @__PURE__ */ React80.createElement(
|
|
6454
6489
|
"div",
|
|
6455
6490
|
{
|
|
6456
6491
|
className: `card-item ${theme.colorMode}`,
|
|
6457
6492
|
onClick: () => connectWallet(wallet.adapter.name),
|
|
6458
6493
|
key: `${wallet.adapter.name}-${index}`
|
|
6459
6494
|
},
|
|
6460
|
-
/* @__PURE__ */
|
|
6461
|
-
)), undetected.map((wallet, index) => /* @__PURE__ */
|
|
6495
|
+
/* @__PURE__ */ React80.createElement("div", { className: "wallet-item" }, /* @__PURE__ */ React80.createElement("img", { src: wallet.adapter.icon, alt: wallet.adapter.name }), /* @__PURE__ */ React80.createElement("span", null, wallet.adapter.name))
|
|
6496
|
+
)), undetected.map((wallet, index) => /* @__PURE__ */ React80.createElement(
|
|
6462
6497
|
ExternalLink_default,
|
|
6463
6498
|
{
|
|
6464
6499
|
to: wallet.adapter.url,
|
|
6465
6500
|
className: `card-item ${theme.colorMode}`,
|
|
6466
6501
|
key: `${wallet.adapter.name}-${index}`
|
|
6467
6502
|
},
|
|
6468
|
-
/* @__PURE__ */
|
|
6503
|
+
/* @__PURE__ */ React80.createElement("div", { className: "wallet-item" }, /* @__PURE__ */ React80.createElement("img", { src: wallet.adapter.icon, alt: wallet.adapter.name }), /* @__PURE__ */ React80.createElement("span", null, "Install ", wallet.adapter.name))
|
|
6469
6504
|
)))));
|
|
6470
6505
|
};
|
|
6471
6506
|
var TronWalletSelect_default = TronWalletSelect;
|
|
@@ -6475,25 +6510,25 @@ var TronWalletConnectModal = () => {
|
|
|
6475
6510
|
const dispatch = useDispatch23();
|
|
6476
6511
|
const theme = useSelector41(selectTheme);
|
|
6477
6512
|
const connectModal = useSelector41(selectTronConnectModal);
|
|
6478
|
-
return /* @__PURE__ */
|
|
6513
|
+
return /* @__PURE__ */ React81.createElement("div", null, /* @__PURE__ */ React81.createElement(AccountDetailsModal_default2, null), /* @__PURE__ */ React81.createElement(
|
|
6479
6514
|
"div",
|
|
6480
6515
|
{
|
|
6481
6516
|
className: `kima-modal wallet-connect ${theme.colorMode} ${connectModal ? "open" : ""}`
|
|
6482
6517
|
},
|
|
6483
|
-
/* @__PURE__ */
|
|
6484
|
-
/* @__PURE__ */
|
|
6518
|
+
/* @__PURE__ */ React81.createElement("div", { className: "modal-overlay" }),
|
|
6519
|
+
/* @__PURE__ */ React81.createElement("div", { className: `modal-content-container ${theme.colorMode}` }, /* @__PURE__ */ React81.createElement("div", { className: "kima-card-header" }, /* @__PURE__ */ React81.createElement("div", { className: "topbar" }, /* @__PURE__ */ React81.createElement("div", { className: "title" }, /* @__PURE__ */ React81.createElement("h3", null, "Connect Wallet")), /* @__PURE__ */ React81.createElement("div", { className: "control-buttons" }, /* @__PURE__ */ React81.createElement(
|
|
6485
6520
|
"button",
|
|
6486
6521
|
{
|
|
6487
6522
|
className: "icon-button",
|
|
6488
6523
|
onClick: () => dispatch(setTronConnectModal(false))
|
|
6489
6524
|
},
|
|
6490
|
-
/* @__PURE__ */
|
|
6525
|
+
/* @__PURE__ */ React81.createElement(
|
|
6491
6526
|
Cross_default,
|
|
6492
6527
|
{
|
|
6493
6528
|
fill: theme.colorMode === "light" ? "black" : "white"
|
|
6494
6529
|
}
|
|
6495
6530
|
)
|
|
6496
|
-
)))), /* @__PURE__ */
|
|
6531
|
+
)))), /* @__PURE__ */ React81.createElement("div", { className: "modal-content" }, /* @__PURE__ */ React81.createElement(TronWalletSelect_default, null)))
|
|
6497
6532
|
));
|
|
6498
6533
|
};
|
|
6499
6534
|
var TronWalletConnectModal_default = TronWalletConnectModal;
|
|
@@ -6810,7 +6845,7 @@ function useDisconnectWallet5() {
|
|
|
6810
6845
|
}
|
|
6811
6846
|
|
|
6812
6847
|
// src/components/reusable/WarningModal.tsx
|
|
6813
|
-
import
|
|
6848
|
+
import React82 from "react";
|
|
6814
6849
|
var WarningModal = ({
|
|
6815
6850
|
message,
|
|
6816
6851
|
cancelButtonText = "Cancel",
|
|
@@ -6818,14 +6853,14 @@ var WarningModal = ({
|
|
|
6818
6853
|
onAcknowledge,
|
|
6819
6854
|
onCancel
|
|
6820
6855
|
}) => {
|
|
6821
|
-
return /* @__PURE__ */
|
|
6856
|
+
return /* @__PURE__ */ React82.createElement("div", { className: "warning-modal-overlay" }, /* @__PURE__ */ React82.createElement("div", { className: "warning-modal" }, /* @__PURE__ */ React82.createElement("h3", null, "Warning"), /* @__PURE__ */ React82.createElement("p", null, message), /* @__PURE__ */ React82.createElement("div", { className: "warning-modal-buttons" }, /* @__PURE__ */ React82.createElement(
|
|
6822
6857
|
SecondaryButton_default,
|
|
6823
6858
|
{
|
|
6824
6859
|
className: "warning-modal-cancel",
|
|
6825
6860
|
clickHandler: onCancel
|
|
6826
6861
|
},
|
|
6827
6862
|
cancelButtonText
|
|
6828
|
-
), /* @__PURE__ */
|
|
6863
|
+
), /* @__PURE__ */ React82.createElement(
|
|
6829
6864
|
PrimaryButton_default,
|
|
6830
6865
|
{
|
|
6831
6866
|
className: "warning-modal-acknowledge",
|
|
@@ -6837,7 +6872,7 @@ var WarningModal = ({
|
|
|
6837
6872
|
var WarningModal_default = WarningModal;
|
|
6838
6873
|
|
|
6839
6874
|
// src/components/reusable/CCWidget.tsx
|
|
6840
|
-
import
|
|
6875
|
+
import React83, { useEffect as useEffect20, useMemo as useMemo20, useRef as useRef7, useState as useState15 } from "react";
|
|
6841
6876
|
import { useSelector as useSelector44, useDispatch as useDispatch25 } from "react-redux";
|
|
6842
6877
|
import { v4 as uuidv4 } from "uuid";
|
|
6843
6878
|
|
|
@@ -6871,6 +6906,7 @@ var CCWidget = ({ submitCallback }) => {
|
|
|
6871
6906
|
const backendUrl = useSelector44(selectBackendUrl);
|
|
6872
6907
|
const ccTransactionStatus = useSelector44(selectCCTransactionStatus);
|
|
6873
6908
|
const networkOption = useSelector44(selectNetworkOption);
|
|
6909
|
+
const sourceCurrency = useSelector44(selectSourceCurrency);
|
|
6874
6910
|
const { transactionValues } = useSelector44(selectServiceFee);
|
|
6875
6911
|
const randomUserIdRef = useRef7(uuidv4());
|
|
6876
6912
|
const ccTransactionIdSeedRef = useRef7(uuidv4());
|
|
@@ -6922,12 +6958,12 @@ var CCWidget = ({ submitCallback }) => {
|
|
|
6922
6958
|
useEffect20(() => {
|
|
6923
6959
|
if (error) dispatch(setCCTransactionStatus("error-id"));
|
|
6924
6960
|
}, [dispatch, error]);
|
|
6925
|
-
return /* @__PURE__ */
|
|
6961
|
+
return /* @__PURE__ */ React83.createElement("div", { className: `cc-widget ${isLoading ? "loading" : ""}` }, (isLoading || isTransactionIdLoading || isEnvLoading || ccTransactionStatus === "success") && /* @__PURE__ */ React83.createElement("div", { className: "cc-widget-loader" }, /* @__PURE__ */ React83.createElement(ring_default, { width: 50, height: 50, fill: "#86b8ce" })), /* @__PURE__ */ React83.createElement(
|
|
6926
6962
|
"iframe",
|
|
6927
6963
|
{
|
|
6928
6964
|
width: isLoading || isTransactionIdLoading || ccTransactionStatus === "success" || error ? 0 : "100%",
|
|
6929
6965
|
height: isLoading || isTransactionIdLoading || ccTransactionStatus === "success" || error ? 0 : "100%",
|
|
6930
|
-
src: `${baseUrl}/widgets/kyc?partner=${partnerId}&user_uuid=${randomUserIdRef.current}&amount=${allowanceAmount}¤cy
|
|
6966
|
+
src: `${baseUrl}/widgets/kyc?partner=${partnerId}&user_uuid=${randomUserIdRef.current}&amount=${allowanceAmount}¤cy=${sourceCurrency}&trx_uuid=${data?.transactionId}&postmessage=true`,
|
|
6931
6967
|
loading: "lazy",
|
|
6932
6968
|
title: "Credit Card Widget",
|
|
6933
6969
|
allow: "camera; clipboard-write",
|
|
@@ -7072,14 +7108,14 @@ var TransferWidget = ({
|
|
|
7072
7108
|
try {
|
|
7073
7109
|
await submitTransaction(signature);
|
|
7074
7110
|
} catch (err) {
|
|
7075
|
-
toast5.error("Failed to submit transaction", { icon: /* @__PURE__ */
|
|
7111
|
+
toast5.error("Failed to submit transaction", { icon: /* @__PURE__ */ React84.createElement(Error_default, null) });
|
|
7076
7112
|
dispatch(setCCTransactionStatus("error-generic"));
|
|
7077
7113
|
}
|
|
7078
7114
|
}, [signature, submitTransaction]);
|
|
7079
7115
|
const handleSubmit = async () => {
|
|
7080
7116
|
const { error: error2, message: validationMessage } = validate(true);
|
|
7081
7117
|
if (error2 === "ValidationError" /* Error */) {
|
|
7082
|
-
return toast5.error(validationMessage, { icon: /* @__PURE__ */
|
|
7118
|
+
return toast5.error(validationMessage, { icon: /* @__PURE__ */ React84.createElement(Error_default, null) });
|
|
7083
7119
|
}
|
|
7084
7120
|
if (sourceChain.shortName === "CC") {
|
|
7085
7121
|
dispatch(setCCTransactionStatus("initialized"));
|
|
@@ -7128,7 +7164,7 @@ var TransferWidget = ({
|
|
|
7128
7164
|
if (error2 !== "ValidationError" /* Error */ && formStep > 0) {
|
|
7129
7165
|
return handleSubmit();
|
|
7130
7166
|
}
|
|
7131
|
-
toast5.error(validationMessage, { icon: /* @__PURE__ */
|
|
7167
|
+
toast5.error(validationMessage, { icon: /* @__PURE__ */ React84.createElement(Error_default, null) });
|
|
7132
7168
|
mainRef.current?.click();
|
|
7133
7169
|
};
|
|
7134
7170
|
const onBack = () => {
|
|
@@ -7203,7 +7239,7 @@ var TransferWidget = ({
|
|
|
7203
7239
|
}
|
|
7204
7240
|
await disconnectWallet();
|
|
7205
7241
|
};
|
|
7206
|
-
return /* @__PURE__ */
|
|
7242
|
+
return /* @__PURE__ */ React84.createElement(
|
|
7207
7243
|
"div",
|
|
7208
7244
|
{
|
|
7209
7245
|
className: `kima-card ${theme.colorMode}`,
|
|
@@ -7211,7 +7247,7 @@ var TransferWidget = ({
|
|
|
7211
7247
|
background: theme.colorMode === "light" /* light */ ? theme.backgroundColorLight : theme.backgroundColorDark
|
|
7212
7248
|
}
|
|
7213
7249
|
},
|
|
7214
|
-
resetModalOpen && /* @__PURE__ */
|
|
7250
|
+
resetModalOpen && /* @__PURE__ */ React84.createElement(
|
|
7215
7251
|
WarningModal_default,
|
|
7216
7252
|
{
|
|
7217
7253
|
message: "Are you sure you want to reset the widget?",
|
|
@@ -7223,7 +7259,7 @@ var TransferWidget = ({
|
|
|
7223
7259
|
onCancel: () => setResetModalOpen(false)
|
|
7224
7260
|
}
|
|
7225
7261
|
),
|
|
7226
|
-
warningModalOpen && /* @__PURE__ */
|
|
7262
|
+
warningModalOpen && /* @__PURE__ */ React84.createElement(
|
|
7227
7263
|
WarningModal_default,
|
|
7228
7264
|
{
|
|
7229
7265
|
message: warningModalOpen.message,
|
|
@@ -7237,14 +7273,14 @@ var TransferWidget = ({
|
|
|
7237
7273
|
}
|
|
7238
7274
|
}
|
|
7239
7275
|
),
|
|
7240
|
-
mode === "payment" /* payment */ && !transactionOption && /* @__PURE__ */
|
|
7241
|
-
/* @__PURE__ */
|
|
7276
|
+
mode === "payment" /* payment */ && !transactionOption && /* @__PURE__ */ React84.createElement("h2", { className: "invalid-option-banner" }, "We're unable to process your payment. Please ensure the necessary transaction details are provided. Contact support if the issue persists."),
|
|
7277
|
+
/* @__PURE__ */ React84.createElement("div", { className: "transfer-card" }, /* @__PURE__ */ React84.createElement("div", { className: "kima-card-header" }, /* @__PURE__ */ React84.createElement("div", { className: "topbar" }, /* @__PURE__ */ React84.createElement("div", { className: "title" }, /* @__PURE__ */ React84.createElement("h3", { style: { marginRight: "5px" } }, formStep === 0 ? titleOption?.initialTitle ? titleOption.initialTitle : mode === "payment" /* payment */ ? "New Purchase" : "New Transfer" : titleOption?.confirmTitle ? titleOption.confirmTitle : mode === "payment" /* payment */ ? "Confirm Purchase" : "Transfer Details")), /* @__PURE__ */ React84.createElement("div", { className: "control-buttons" }, pendingTxs > 0 ? /* @__PURE__ */ React84.createElement(TxButton_default, { theme }) : null, /* @__PURE__ */ React84.createElement(
|
|
7242
7278
|
ExternalLink_default,
|
|
7243
7279
|
{
|
|
7244
7280
|
to: helpURL ? helpURL : networkOption === "testnet" /* testnet */ ? "https://docs.kima.network/kima-network/try-kima-with-the-demo-app" : "https://support.kima.network"
|
|
7245
7281
|
},
|
|
7246
|
-
/* @__PURE__ */
|
|
7247
|
-
), sourceChain.shortName === "CC" && formStep > 0 && /* @__PURE__ */
|
|
7282
|
+
/* @__PURE__ */ React84.createElement("div", { className: "menu-button" }, "I need help")
|
|
7283
|
+
), sourceChain.shortName === "CC" && formStep > 0 && /* @__PURE__ */ React84.createElement(ExternalLink_default, { to: "https://docs.kima.network/kima-network/supported-fiat#unsupported-countries-credit-cards" }, /* @__PURE__ */ React84.createElement("div", { className: "menu-button" }, "Unsupported Countries")), formStep === 0 && mode !== "payment" /* payment */ && /* @__PURE__ */ React84.createElement(
|
|
7248
7284
|
"button",
|
|
7249
7285
|
{
|
|
7250
7286
|
className: "reset-button",
|
|
@@ -7252,7 +7288,7 @@ var TransferWidget = ({
|
|
|
7252
7288
|
disabled: isApproving || isSubmitting || isSigning
|
|
7253
7289
|
},
|
|
7254
7290
|
"Reset"
|
|
7255
|
-
))), mode === "payment" /* payment */ && paymentTitleOption?.title && /* @__PURE__ */
|
|
7291
|
+
))), mode === "payment" /* payment */ && paymentTitleOption?.title && /* @__PURE__ */ React84.createElement("h4", { className: "subtitle" }, paymentTitleOption.title)), /* @__PURE__ */ React84.createElement("div", { className: "kima-card-content", ref: mainRef }, formStep === 0 ? /* @__PURE__ */ React84.createElement(
|
|
7256
7292
|
SingleForm_default,
|
|
7257
7293
|
{
|
|
7258
7294
|
...{
|
|
@@ -7265,7 +7301,7 @@ var TransferWidget = ({
|
|
|
7265
7301
|
setInitialSelection
|
|
7266
7302
|
}
|
|
7267
7303
|
}
|
|
7268
|
-
) : ccTransactionStatus !== "idle" ? /* @__PURE__ */
|
|
7304
|
+
) : ccTransactionStatus !== "idle" ? /* @__PURE__ */ React84.createElement(CCWidget_default, { submitCallback: submit }) : /* @__PURE__ */ React84.createElement(
|
|
7269
7305
|
ConfirmDetails_default,
|
|
7270
7306
|
{
|
|
7271
7307
|
...{
|
|
@@ -7273,12 +7309,12 @@ var TransferWidget = ({
|
|
|
7273
7309
|
feeOptionDisabled
|
|
7274
7310
|
}
|
|
7275
7311
|
}
|
|
7276
|
-
)), /* @__PURE__ */
|
|
7312
|
+
)), /* @__PURE__ */ React84.createElement(
|
|
7277
7313
|
"div",
|
|
7278
7314
|
{
|
|
7279
7315
|
className: `kima-card-footer ${mode === "bridge" /* bridge */ && formStep !== 0 && "confirm"}`
|
|
7280
7316
|
},
|
|
7281
|
-
/* @__PURE__ */
|
|
7317
|
+
/* @__PURE__ */ React84.createElement("div", { className: `button-group` }, isBackButtonEnabled && /* @__PURE__ */ React84.createElement(
|
|
7282
7318
|
SecondaryButton_default,
|
|
7283
7319
|
{
|
|
7284
7320
|
clickHandler: onBack,
|
|
@@ -7286,7 +7322,7 @@ var TransferWidget = ({
|
|
|
7286
7322
|
disabled: isApproving || isSubmitting || isSigning
|
|
7287
7323
|
},
|
|
7288
7324
|
formStep > 0 && ccTransactionStatus !== "initialized" ? "Back" : "Cancel"
|
|
7289
|
-
), !!allowance && allowance > 0 && formStep !== 0 && sourceChain.shortName !== "CC" && mode !== "light" /* light */ ? /* @__PURE__ */
|
|
7325
|
+
), !!allowance && allowance > 0 && formStep !== 0 && sourceChain.shortName !== "CC" && mode !== "light" /* light */ ? /* @__PURE__ */ React84.createElement(
|
|
7290
7326
|
SecondaryButton_default,
|
|
7291
7327
|
{
|
|
7292
7328
|
clickHandler: onCancelApprove,
|
|
@@ -7295,7 +7331,7 @@ var TransferWidget = ({
|
|
|
7295
7331
|
disabled: isCancellingApprove || isApproving || isSubmitting || isSigning
|
|
7296
7332
|
},
|
|
7297
7333
|
isCancellingApprove ? "Cancelling Approval" : "Cancel Approve"
|
|
7298
|
-
) : null, isSubmitButtonEnabled && /* @__PURE__ */
|
|
7334
|
+
) : null, isSubmitButtonEnabled && /* @__PURE__ */ React84.createElement(
|
|
7299
7335
|
PrimaryButton_default,
|
|
7300
7336
|
{
|
|
7301
7337
|
clickHandler: onNext,
|
|
@@ -7304,7 +7340,7 @@ var TransferWidget = ({
|
|
|
7304
7340
|
},
|
|
7305
7341
|
getButtonLabel()
|
|
7306
7342
|
))
|
|
7307
|
-
), /* @__PURE__ */
|
|
7343
|
+
), /* @__PURE__ */ React84.createElement(SolanaWalletConnectModal_default, null), /* @__PURE__ */ React84.createElement(TronWalletConnectModal_default, null), /* @__PURE__ */ React84.createElement(
|
|
7308
7344
|
Toaster2,
|
|
7309
7345
|
{
|
|
7310
7346
|
position: "top-right",
|
|
@@ -7329,7 +7365,7 @@ var TransferWidget = ({
|
|
|
7329
7365
|
}
|
|
7330
7366
|
}
|
|
7331
7367
|
}
|
|
7332
|
-
), /* @__PURE__ */
|
|
7368
|
+
), /* @__PURE__ */ React84.createElement("div", { className: "floating-footer" }, /* @__PURE__ */ React84.createElement("div", { className: `items ${theme.colorMode}` }, /* @__PURE__ */ React84.createElement("span", null, "Powered by"), /* @__PURE__ */ React84.createElement(KimaNetwork_default, null))))
|
|
7333
7369
|
);
|
|
7334
7370
|
};
|
|
7335
7371
|
|
|
@@ -7368,7 +7404,7 @@ var useDebugCode = (sequence = ["D", "E", "B", "U", "G"]) => {
|
|
|
7368
7404
|
};
|
|
7369
7405
|
|
|
7370
7406
|
// src/components/ErrorWidget.tsx
|
|
7371
|
-
import
|
|
7407
|
+
import React85 from "react";
|
|
7372
7408
|
import { useSelector as useSelector46 } from "react-redux";
|
|
7373
7409
|
var ErrorWidget = ({
|
|
7374
7410
|
theme,
|
|
@@ -7381,7 +7417,7 @@ var ErrorWidget = ({
|
|
|
7381
7417
|
const ccTransactionId = useSelector46(selectCCTransactionId);
|
|
7382
7418
|
const isCreditCardSource = sourceChain.shortName === "CC";
|
|
7383
7419
|
const isRetrying = useSelector46(selectCCTransactionRetrying);
|
|
7384
|
-
return /* @__PURE__ */
|
|
7420
|
+
return /* @__PURE__ */ React85.createElement(
|
|
7385
7421
|
"div",
|
|
7386
7422
|
{
|
|
7387
7423
|
className: `kima-card ${theme.colorMode}`,
|
|
@@ -7389,7 +7425,7 @@ var ErrorWidget = ({
|
|
|
7389
7425
|
background: theme.colorMode === "light" /* light */ ? theme.backgroundColorLight : theme.backgroundColorDark
|
|
7390
7426
|
}
|
|
7391
7427
|
},
|
|
7392
|
-
/* @__PURE__ */
|
|
7428
|
+
/* @__PURE__ */ React85.createElement("div", { className: "transfer-card" }, /* @__PURE__ */ React85.createElement("div", { className: "kima-card-header" }, /* @__PURE__ */ React85.createElement("div", { className: "topbar" }, /* @__PURE__ */ React85.createElement("div", { className: "title" }, /* @__PURE__ */ React85.createElement("h3", null, title))), /* @__PURE__ */ React85.createElement("h4", { className: "subtitle" })), /* @__PURE__ */ React85.createElement("div", { className: "kima-card-content error" }, isCreditCardSource && !isRetrying && /* @__PURE__ */ React85.createElement(Error_default, { width: 40, height: 40 }), message && message !== "" && /* @__PURE__ */ React85.createElement("h2", null, message), isCreditCardSource && /* @__PURE__ */ React85.createElement(
|
|
7393
7429
|
"div",
|
|
7394
7430
|
{
|
|
7395
7431
|
style: {
|
|
@@ -7398,8 +7434,8 @@ var ErrorWidget = ({
|
|
|
7398
7434
|
flexDirection: "column"
|
|
7399
7435
|
}
|
|
7400
7436
|
},
|
|
7401
|
-
isRetrying ? /* @__PURE__ */
|
|
7402
|
-
ccTransactionId && /* @__PURE__ */
|
|
7437
|
+
isRetrying ? /* @__PURE__ */ React85.createElement("p", null, "The transaction is being retried in the background. This may take a few moments. If the issue persists, please contact support and provide the transaction ID below for reference.") : /* @__PURE__ */ React85.createElement("p", null, "This credit card transaction has failed. Please check the details and try again. If the issue persists, please contact support and provide the transaction ID below for reference."),
|
|
7438
|
+
ccTransactionId && /* @__PURE__ */ React85.createElement(
|
|
7403
7439
|
"div",
|
|
7404
7440
|
{
|
|
7405
7441
|
style: {
|
|
@@ -7409,7 +7445,7 @@ var ErrorWidget = ({
|
|
|
7409
7445
|
justifyContent: "center"
|
|
7410
7446
|
}
|
|
7411
7447
|
},
|
|
7412
|
-
/* @__PURE__ */
|
|
7448
|
+
/* @__PURE__ */ React85.createElement(
|
|
7413
7449
|
"code",
|
|
7414
7450
|
{
|
|
7415
7451
|
style: {
|
|
@@ -7420,10 +7456,10 @@ var ErrorWidget = ({
|
|
|
7420
7456
|
},
|
|
7421
7457
|
ccTransactionId
|
|
7422
7458
|
),
|
|
7423
|
-
/* @__PURE__ */
|
|
7459
|
+
/* @__PURE__ */ React85.createElement(CopyButton_default, { text: ccTransactionId })
|
|
7424
7460
|
),
|
|
7425
|
-
isRetrying && /* @__PURE__ */
|
|
7426
|
-
)), backButtonEnabled && /* @__PURE__ */
|
|
7461
|
+
isRetrying && /* @__PURE__ */ React85.createElement(ring_default, { width: 30, height: 30, fill: "#86b8ce" })
|
|
7462
|
+
)), backButtonEnabled && /* @__PURE__ */ React85.createElement(
|
|
7427
7463
|
"div",
|
|
7428
7464
|
{
|
|
7429
7465
|
style: {
|
|
@@ -7432,8 +7468,8 @@ var ErrorWidget = ({
|
|
|
7432
7468
|
marginTop: 16
|
|
7433
7469
|
}
|
|
7434
7470
|
},
|
|
7435
|
-
/* @__PURE__ */
|
|
7436
|
-
), /* @__PURE__ */
|
|
7471
|
+
/* @__PURE__ */ React85.createElement(PrimaryButton_default, { clickHandler: backButtonFunction }, "Back")
|
|
7472
|
+
), /* @__PURE__ */ React85.createElement("div", { className: "kima-card-footer" }), /* @__PURE__ */ React85.createElement("div", { className: "floating-footer" }, /* @__PURE__ */ React85.createElement("div", { className: `items ${theme.colorMode}` }, /* @__PURE__ */ React85.createElement("span", null, "Powered by"), /* @__PURE__ */ React85.createElement(FooterLogo_default, { width: 50, fill: "black" }), /* @__PURE__ */ React85.createElement("strong", null, "Network"))))
|
|
7437
7473
|
);
|
|
7438
7474
|
};
|
|
7439
7475
|
var ErrorWidget_default = ErrorWidget;
|
|
@@ -7511,9 +7547,9 @@ var KimaWidgetWrapper = ({
|
|
|
7511
7547
|
console.log("widget wrapper", submitted, ccTransactionStatus);
|
|
7512
7548
|
if (submitted) {
|
|
7513
7549
|
logger_default.debug("will return transaction widget on cc success");
|
|
7514
|
-
return /* @__PURE__ */
|
|
7550
|
+
return /* @__PURE__ */ React86.createElement(TransactionWidget, { theme });
|
|
7515
7551
|
} else if (ccTransactionStatus === "error-id") {
|
|
7516
|
-
return /* @__PURE__ */
|
|
7552
|
+
return /* @__PURE__ */ React86.createElement(
|
|
7517
7553
|
ErrorWidget_default,
|
|
7518
7554
|
{
|
|
7519
7555
|
theme,
|
|
@@ -7527,7 +7563,7 @@ var KimaWidgetWrapper = ({
|
|
|
7527
7563
|
}
|
|
7528
7564
|
);
|
|
7529
7565
|
} else if (ccTransactionStatus === "error-generic") {
|
|
7530
|
-
return /* @__PURE__ */
|
|
7566
|
+
return /* @__PURE__ */ React86.createElement(
|
|
7531
7567
|
ErrorWidget_default,
|
|
7532
7568
|
{
|
|
7533
7569
|
theme,
|
|
@@ -7541,7 +7577,7 @@ var KimaWidgetWrapper = ({
|
|
|
7541
7577
|
}
|
|
7542
7578
|
);
|
|
7543
7579
|
}
|
|
7544
|
-
return /* @__PURE__ */
|
|
7580
|
+
return /* @__PURE__ */ React86.createElement(
|
|
7545
7581
|
TransferWidget,
|
|
7546
7582
|
{
|
|
7547
7583
|
theme,
|
|
@@ -7551,7 +7587,7 @@ var KimaWidgetWrapper = ({
|
|
|
7551
7587
|
}
|
|
7552
7588
|
);
|
|
7553
7589
|
}
|
|
7554
|
-
return submitted ? /* @__PURE__ */
|
|
7590
|
+
return submitted ? /* @__PURE__ */ React86.createElement(TransactionWidget, { theme }) : /* @__PURE__ */ React86.createElement(
|
|
7555
7591
|
TransferWidget,
|
|
7556
7592
|
{
|
|
7557
7593
|
theme,
|
|
@@ -7567,9 +7603,9 @@ var KimaWidgetWrapper_default = KimaWidgetWrapper;
|
|
|
7567
7603
|
import { useDispatch as useDispatch28 } from "react-redux";
|
|
7568
7604
|
|
|
7569
7605
|
// src/SkeletonLoader.tsx
|
|
7570
|
-
import
|
|
7606
|
+
import React87 from "react";
|
|
7571
7607
|
var SkeletonLoader = ({ theme }) => {
|
|
7572
|
-
return /* @__PURE__ */
|
|
7608
|
+
return /* @__PURE__ */ React87.createElement(
|
|
7573
7609
|
"div",
|
|
7574
7610
|
{
|
|
7575
7611
|
className: `kima-card ${theme.colorMode}`,
|
|
@@ -7577,7 +7613,7 @@ var SkeletonLoader = ({ theme }) => {
|
|
|
7577
7613
|
background: theme.colorMode === "light" /* light */ ? theme.backgroundColorLight : theme.backgroundColorDark
|
|
7578
7614
|
}
|
|
7579
7615
|
},
|
|
7580
|
-
/* @__PURE__ */
|
|
7616
|
+
/* @__PURE__ */ React87.createElement("div", { className: "transfer-card" }, /* @__PURE__ */ React87.createElement("div", { className: "kima-card-header" }, /* @__PURE__ */ React87.createElement("div", { className: "topbar" }, /* @__PURE__ */ React87.createElement("div", { className: "title skeleton" }, /* @__PURE__ */ React87.createElement("h3", null))), /* @__PURE__ */ React87.createElement("h4", { className: "subtitle" })), /* @__PURE__ */ React87.createElement("div", { className: "kima-card-content skeleton" }, /* @__PURE__ */ React87.createElement("div", { className: "skeleton" }), /* @__PURE__ */ React87.createElement("div", { className: "skeleton" }), /* @__PURE__ */ React87.createElement("div", { className: "skeleton" }), /* @__PURE__ */ React87.createElement("div", { className: "skeleton" }), /* @__PURE__ */ React87.createElement("div", { className: "skeleton" })), /* @__PURE__ */ React87.createElement("div", { className: `kima-card-footer` }, /* @__PURE__ */ React87.createElement("div", { className: `button-group skeleton` }, /* @__PURE__ */ React87.createElement("div", { className: "skeleton" }))), /* @__PURE__ */ React87.createElement("div", { className: "floating-footer" }, /* @__PURE__ */ React87.createElement("div", { className: `items ${theme.colorMode}` }, /* @__PURE__ */ React87.createElement("span", null, "Powered by"), /* @__PURE__ */ React87.createElement(FooterLogo_default, { width: 50, fill: "black" }), /* @__PURE__ */ React87.createElement("strong", null, "Network"))))
|
|
7581
7617
|
);
|
|
7582
7618
|
};
|
|
7583
7619
|
var SkeletonLoader_default = SkeletonLoader;
|
|
@@ -7622,11 +7658,11 @@ var KimaTransactionWidget = ({
|
|
|
7622
7658
|
}
|
|
7623
7659
|
}, [theme?.colorMode]);
|
|
7624
7660
|
if (!hydrated || !theme?.colorMode)
|
|
7625
|
-
return /* @__PURE__ */
|
|
7661
|
+
return /* @__PURE__ */ React88.createElement(ring_default, { width: 20, height: 20, fill: "#86b8ce" });
|
|
7626
7662
|
if (isLoadingEnvs || isLoadingChainData)
|
|
7627
|
-
return /* @__PURE__ */
|
|
7663
|
+
return /* @__PURE__ */ React88.createElement(SkeletonLoader_default, { theme });
|
|
7628
7664
|
if (envOptionsError || !envOptions)
|
|
7629
|
-
return /* @__PURE__ */
|
|
7665
|
+
return /* @__PURE__ */ React88.createElement(
|
|
7630
7666
|
ErrorWidget_default,
|
|
7631
7667
|
{
|
|
7632
7668
|
theme,
|
|
@@ -7635,7 +7671,7 @@ var KimaTransactionWidget = ({
|
|
|
7635
7671
|
}
|
|
7636
7672
|
);
|
|
7637
7673
|
if (chainDataError || !chainData)
|
|
7638
|
-
return /* @__PURE__ */
|
|
7674
|
+
return /* @__PURE__ */ React88.createElement(
|
|
7639
7675
|
ErrorWidget_default,
|
|
7640
7676
|
{
|
|
7641
7677
|
theme,
|
|
@@ -7643,7 +7679,7 @@ var KimaTransactionWidget = ({
|
|
|
7643
7679
|
message: "There was an error loading the chain data from the backend. Please check that the backend is running properly and the widget points to the corresponding url." /* ChainLoadingError */
|
|
7644
7680
|
}
|
|
7645
7681
|
);
|
|
7646
|
-
return /* @__PURE__ */
|
|
7682
|
+
return /* @__PURE__ */ React88.createElement(
|
|
7647
7683
|
KimaWidgetWrapper_default,
|
|
7648
7684
|
{
|
|
7649
7685
|
...{
|