@kimafinance/kima-transaction-widget 1.4.7 → 1.4.9
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 +1042 -511
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +906 -375
- 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/assets/Manrope-ExtraLight-47OLGDTA.woff +0 -0
- package/dist/assets/Manrope-ExtraLight-6BGXUBPE.woff2 +0 -0
- package/dist/assets/Manrope-ExtraLight-6KZAMPI7.eot +0 -0
- package/dist/assets/SohneBreit-Buch-FPHQDKKW.woff +0 -0
- package/dist/assets/SohneBreit-Buch-UDQP3HAK.woff2 +0 -0
- package/dist/assets/SohneBreit-Buch-VTQ4XGFE.eot +0 -0
- package/dist/index.css +0 -3519
- package/dist/index.css.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/KimaProvider.tsx
|
|
4
|
-
import * as
|
|
4
|
+
import * as React50 from "react";
|
|
5
5
|
import { createContext, useContext, useMemo as useMemo7 } from "react";
|
|
6
6
|
import { Provider, useSelector as useSelector16 } from "react-redux";
|
|
7
|
+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
7
8
|
|
|
8
9
|
// src/store/index.tsx
|
|
9
10
|
import { configureStore } from "@reduxjs/toolkit";
|
|
@@ -188,7 +189,7 @@ var Arrow_default = Arrow;
|
|
|
188
189
|
|
|
189
190
|
// src/assets/icons/Lock.tsx
|
|
190
191
|
import React8 from "react";
|
|
191
|
-
var Lock = ({ width = 24, height =
|
|
192
|
+
var Lock = ({ width = 24, height = 24, fill = "none", ...rest }) => {
|
|
192
193
|
return /* @__PURE__ */ React8.createElement(
|
|
193
194
|
"svg",
|
|
194
195
|
{
|
|
@@ -1392,6 +1393,308 @@ var CFX = ({ width = 30, height = 30, ...rest }) => {
|
|
|
1392
1393
|
};
|
|
1393
1394
|
var CFX_default = CFX;
|
|
1394
1395
|
|
|
1396
|
+
// src/assets/icons/EURC.tsx
|
|
1397
|
+
import React41 from "react";
|
|
1398
|
+
var EURC = ({ width = 100, height = 100, ...rest }) => {
|
|
1399
|
+
return /* @__PURE__ */ React41.createElement(
|
|
1400
|
+
"svg",
|
|
1401
|
+
{
|
|
1402
|
+
width,
|
|
1403
|
+
height,
|
|
1404
|
+
viewBox: "0 0 100 100",
|
|
1405
|
+
fill: "none",
|
|
1406
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1407
|
+
xlinkHref: "http://www.w3.org/1999/xlink"
|
|
1408
|
+
},
|
|
1409
|
+
/* @__PURE__ */ React41.createElement(
|
|
1410
|
+
"path",
|
|
1411
|
+
{
|
|
1412
|
+
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",
|
|
1413
|
+
fill: "#2775CA"
|
|
1414
|
+
}
|
|
1415
|
+
),
|
|
1416
|
+
/* @__PURE__ */ React41.createElement("rect", { width: "100", height: "100", fill: "url(#pattern0_1506_393)" }),
|
|
1417
|
+
/* @__PURE__ */ React41.createElement("defs", null, /* @__PURE__ */ React41.createElement(
|
|
1418
|
+
"pattern",
|
|
1419
|
+
{
|
|
1420
|
+
id: "pattern0_1506_393",
|
|
1421
|
+
patternContentUnits: "objectBoundingBox",
|
|
1422
|
+
width: "1",
|
|
1423
|
+
height: "1"
|
|
1424
|
+
},
|
|
1425
|
+
/* @__PURE__ */ React41.createElement("use", { xlinkHref: "#image0_1506_393", transform: "scale(0.005)" })
|
|
1426
|
+
), /* @__PURE__ */ React41.createElement(
|
|
1427
|
+
"image",
|
|
1428
|
+
{
|
|
1429
|
+
id: "image0_1506_393",
|
|
1430
|
+
width: "200",
|
|
1431
|
+
height: "200",
|
|
1432
|
+
preserveAspectRatio: "none",
|
|
1433
|
+
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=="
|
|
1434
|
+
}
|
|
1435
|
+
))
|
|
1436
|
+
);
|
|
1437
|
+
};
|
|
1438
|
+
var EURC_default = EURC;
|
|
1439
|
+
|
|
1440
|
+
// src/assets/icons/TransactionComplete.tsx
|
|
1441
|
+
import React42 from "react";
|
|
1442
|
+
var TransactionComplete = ({ width = 140, height = 120, ...rest }) => {
|
|
1443
|
+
return /* @__PURE__ */ React42.createElement(
|
|
1444
|
+
"svg",
|
|
1445
|
+
{
|
|
1446
|
+
width,
|
|
1447
|
+
height,
|
|
1448
|
+
viewBox: "0 0 141 116",
|
|
1449
|
+
fill: "none",
|
|
1450
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1451
|
+
...rest
|
|
1452
|
+
},
|
|
1453
|
+
/* @__PURE__ */ React42.createElement(
|
|
1454
|
+
"rect",
|
|
1455
|
+
{
|
|
1456
|
+
x: "140.724",
|
|
1457
|
+
y: "53.4307",
|
|
1458
|
+
width: "9.00052",
|
|
1459
|
+
height: "21.8584",
|
|
1460
|
+
rx: "4.50026",
|
|
1461
|
+
transform: "rotate(90 140.724 53.4307)",
|
|
1462
|
+
fill: "url(#paint0_linear_1838_5769)"
|
|
1463
|
+
}
|
|
1464
|
+
),
|
|
1465
|
+
/* @__PURE__ */ React42.createElement(
|
|
1466
|
+
"rect",
|
|
1467
|
+
{
|
|
1468
|
+
x: "133.009",
|
|
1469
|
+
y: "29.001",
|
|
1470
|
+
width: "9.00052",
|
|
1471
|
+
height: "21.8584",
|
|
1472
|
+
rx: "4.50026",
|
|
1473
|
+
transform: "rotate(60 133.009 29.001)",
|
|
1474
|
+
fill: "url(#paint1_linear_1838_5769)"
|
|
1475
|
+
}
|
|
1476
|
+
),
|
|
1477
|
+
/* @__PURE__ */ React42.createElement(
|
|
1478
|
+
"rect",
|
|
1479
|
+
{
|
|
1480
|
+
x: "136.866",
|
|
1481
|
+
y: "78.5039",
|
|
1482
|
+
width: "9.00052",
|
|
1483
|
+
height: "21.8584",
|
|
1484
|
+
rx: "4.50026",
|
|
1485
|
+
transform: "rotate(120 136.866 78.5039)",
|
|
1486
|
+
fill: "url(#paint2_linear_1838_5769)"
|
|
1487
|
+
}
|
|
1488
|
+
),
|
|
1489
|
+
/* @__PURE__ */ React42.createElement(
|
|
1490
|
+
"rect",
|
|
1491
|
+
{
|
|
1492
|
+
y: "61.8682",
|
|
1493
|
+
width: "9.00052",
|
|
1494
|
+
height: "21.8584",
|
|
1495
|
+
rx: "4.50026",
|
|
1496
|
+
transform: "rotate(-90 0 61.8682)",
|
|
1497
|
+
fill: "url(#paint3_linear_1838_5769)"
|
|
1498
|
+
}
|
|
1499
|
+
),
|
|
1500
|
+
/* @__PURE__ */ React42.createElement(
|
|
1501
|
+
"rect",
|
|
1502
|
+
{
|
|
1503
|
+
x: "7.71472",
|
|
1504
|
+
y: "86.2979",
|
|
1505
|
+
width: "9.00052",
|
|
1506
|
+
height: "21.8584",
|
|
1507
|
+
rx: "4.50026",
|
|
1508
|
+
transform: "rotate(-120 7.71472 86.2979)",
|
|
1509
|
+
fill: "url(#paint4_linear_1838_5769)"
|
|
1510
|
+
}
|
|
1511
|
+
),
|
|
1512
|
+
/* @__PURE__ */ React42.createElement(
|
|
1513
|
+
"rect",
|
|
1514
|
+
{
|
|
1515
|
+
x: "3.85742",
|
|
1516
|
+
y: "36.7959",
|
|
1517
|
+
width: "9.00052",
|
|
1518
|
+
height: "21.8584",
|
|
1519
|
+
rx: "4.50026",
|
|
1520
|
+
transform: "rotate(-60 3.85742 36.7959)",
|
|
1521
|
+
fill: "url(#paint5_linear_1838_5769)"
|
|
1522
|
+
}
|
|
1523
|
+
),
|
|
1524
|
+
/* @__PURE__ */ React42.createElement("g", { filter: "url(#filter0_d_1838_5769)" }, /* @__PURE__ */ React42.createElement("circle", { cx: "70.3622", cy: "57.9308", r: "37.9308", fill: "white" }), /* @__PURE__ */ React42.createElement(
|
|
1525
|
+
"circle",
|
|
1526
|
+
{
|
|
1527
|
+
cx: "70.3622",
|
|
1528
|
+
cy: "57.9308",
|
|
1529
|
+
r: "36.0021",
|
|
1530
|
+
stroke: "url(#paint6_linear_1838_5769)",
|
|
1531
|
+
strokeWidth: "3.85736"
|
|
1532
|
+
}
|
|
1533
|
+
)),
|
|
1534
|
+
/* @__PURE__ */ React42.createElement(
|
|
1535
|
+
"path",
|
|
1536
|
+
{
|
|
1537
|
+
d: "M62.571 74.3906C61.9266 74.3944 61.2878 74.268 60.6912 74.0186C60.0946 73.7691 59.552 73.4017 59.0944 72.9371L49.3011 62.9134C48.3791 61.9697 47.8611 60.6897 47.8611 59.355C47.8611 58.0204 48.3791 56.7404 49.3011 55.7966C50.2232 54.8529 51.4738 54.3227 52.7778 54.3227C54.0817 54.3227 55.3323 54.8529 56.2544 55.7966L62.571 62.312L83.5776 40.7611C84.4997 39.8173 85.7502 39.2871 87.0542 39.2871C88.3582 39.2871 89.6088 39.8173 90.5308 40.7611C91.4529 41.7048 91.9709 42.9848 91.9709 44.3195C91.9709 45.6541 91.4529 46.9341 90.5308 47.8779L66.0476 72.9371C65.5901 73.4017 65.0475 73.7691 64.4509 74.0186C63.8543 74.268 63.2155 74.3944 62.571 74.3906Z",
|
|
1538
|
+
fill: "url(#paint7_linear_1838_5769)"
|
|
1539
|
+
}
|
|
1540
|
+
),
|
|
1541
|
+
/* @__PURE__ */ React42.createElement("defs", null, /* @__PURE__ */ React42.createElement(
|
|
1542
|
+
"filter",
|
|
1543
|
+
{
|
|
1544
|
+
id: "filter0_d_1838_5769",
|
|
1545
|
+
x: "13.1446",
|
|
1546
|
+
y: "0.713175",
|
|
1547
|
+
width: "114.435",
|
|
1548
|
+
height: "114.435",
|
|
1549
|
+
filterUnits: "userSpaceOnUse",
|
|
1550
|
+
colorInterpolationFilters: "sRGB"
|
|
1551
|
+
},
|
|
1552
|
+
/* @__PURE__ */ React42.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
1553
|
+
/* @__PURE__ */ React42.createElement(
|
|
1554
|
+
"feColorMatrix",
|
|
1555
|
+
{
|
|
1556
|
+
in: "SourceAlpha",
|
|
1557
|
+
type: "matrix",
|
|
1558
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
|
|
1559
|
+
result: "hardAlpha"
|
|
1560
|
+
}
|
|
1561
|
+
),
|
|
1562
|
+
/* @__PURE__ */ React42.createElement("feOffset", null),
|
|
1563
|
+
/* @__PURE__ */ React42.createElement("feGaussianBlur", { stdDeviation: "9.64341" }),
|
|
1564
|
+
/* @__PURE__ */ React42.createElement("feComposite", { in2: "hardAlpha", operator: "out" }),
|
|
1565
|
+
/* @__PURE__ */ React42.createElement(
|
|
1566
|
+
"feColorMatrix",
|
|
1567
|
+
{
|
|
1568
|
+
type: "matrix",
|
|
1569
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"
|
|
1570
|
+
}
|
|
1571
|
+
),
|
|
1572
|
+
/* @__PURE__ */ React42.createElement(
|
|
1573
|
+
"feBlend",
|
|
1574
|
+
{
|
|
1575
|
+
mode: "normal",
|
|
1576
|
+
in2: "BackgroundImageFix",
|
|
1577
|
+
result: "effect1_dropShadow_1838_5769"
|
|
1578
|
+
}
|
|
1579
|
+
),
|
|
1580
|
+
/* @__PURE__ */ React42.createElement(
|
|
1581
|
+
"feBlend",
|
|
1582
|
+
{
|
|
1583
|
+
mode: "normal",
|
|
1584
|
+
in: "SourceGraphic",
|
|
1585
|
+
in2: "effect1_dropShadow_1838_5769",
|
|
1586
|
+
result: "shape"
|
|
1587
|
+
}
|
|
1588
|
+
)
|
|
1589
|
+
), /* @__PURE__ */ React42.createElement(
|
|
1590
|
+
"linearGradient",
|
|
1591
|
+
{
|
|
1592
|
+
id: "paint0_linear_1838_5769",
|
|
1593
|
+
x1: "140.724",
|
|
1594
|
+
y1: "64.3599",
|
|
1595
|
+
x2: "149.724",
|
|
1596
|
+
y2: "64.3599",
|
|
1597
|
+
gradientUnits: "userSpaceOnUse"
|
|
1598
|
+
},
|
|
1599
|
+
/* @__PURE__ */ React42.createElement("stop", { stopColor: "#ADF4A6" }),
|
|
1600
|
+
/* @__PURE__ */ React42.createElement("stop", { offset: "0.315", stopColor: "#80D7F5" }),
|
|
1601
|
+
/* @__PURE__ */ React42.createElement("stop", { offset: "0.775", stopColor: "#9990D5" })
|
|
1602
|
+
), /* @__PURE__ */ React42.createElement(
|
|
1603
|
+
"linearGradient",
|
|
1604
|
+
{
|
|
1605
|
+
id: "paint1_linear_1838_5769",
|
|
1606
|
+
x1: "133.009",
|
|
1607
|
+
y1: "39.9302",
|
|
1608
|
+
x2: "142.009",
|
|
1609
|
+
y2: "39.9302",
|
|
1610
|
+
gradientUnits: "userSpaceOnUse"
|
|
1611
|
+
},
|
|
1612
|
+
/* @__PURE__ */ React42.createElement("stop", { stopColor: "#ADF4A6" }),
|
|
1613
|
+
/* @__PURE__ */ React42.createElement("stop", { offset: "0.315", stopColor: "#80D7F5" }),
|
|
1614
|
+
/* @__PURE__ */ React42.createElement("stop", { offset: "0.775", stopColor: "#9990D5" })
|
|
1615
|
+
), /* @__PURE__ */ React42.createElement(
|
|
1616
|
+
"linearGradient",
|
|
1617
|
+
{
|
|
1618
|
+
id: "paint2_linear_1838_5769",
|
|
1619
|
+
x1: "136.866",
|
|
1620
|
+
y1: "89.4331",
|
|
1621
|
+
x2: "145.867",
|
|
1622
|
+
y2: "89.4331",
|
|
1623
|
+
gradientUnits: "userSpaceOnUse"
|
|
1624
|
+
},
|
|
1625
|
+
/* @__PURE__ */ React42.createElement("stop", { stopColor: "#ADF4A6" }),
|
|
1626
|
+
/* @__PURE__ */ React42.createElement("stop", { offset: "0.315", stopColor: "#80D7F5" }),
|
|
1627
|
+
/* @__PURE__ */ React42.createElement("stop", { offset: "0.775", stopColor: "#9990D5" })
|
|
1628
|
+
), /* @__PURE__ */ React42.createElement(
|
|
1629
|
+
"linearGradient",
|
|
1630
|
+
{
|
|
1631
|
+
id: "paint3_linear_1838_5769",
|
|
1632
|
+
x1: "0",
|
|
1633
|
+
y1: "72.7974",
|
|
1634
|
+
x2: "9.00052",
|
|
1635
|
+
y2: "72.7974",
|
|
1636
|
+
gradientUnits: "userSpaceOnUse"
|
|
1637
|
+
},
|
|
1638
|
+
/* @__PURE__ */ React42.createElement("stop", { stopColor: "#ADF4A6" }),
|
|
1639
|
+
/* @__PURE__ */ React42.createElement("stop", { offset: "0.315", stopColor: "#80D7F5" }),
|
|
1640
|
+
/* @__PURE__ */ React42.createElement("stop", { offset: "0.775", stopColor: "#9990D5" })
|
|
1641
|
+
), /* @__PURE__ */ React42.createElement(
|
|
1642
|
+
"linearGradient",
|
|
1643
|
+
{
|
|
1644
|
+
id: "paint4_linear_1838_5769",
|
|
1645
|
+
x1: "7.71472",
|
|
1646
|
+
y1: "97.2271",
|
|
1647
|
+
x2: "16.7152",
|
|
1648
|
+
y2: "97.2271",
|
|
1649
|
+
gradientUnits: "userSpaceOnUse"
|
|
1650
|
+
},
|
|
1651
|
+
/* @__PURE__ */ React42.createElement("stop", { stopColor: "#ADF4A6" }),
|
|
1652
|
+
/* @__PURE__ */ React42.createElement("stop", { offset: "0.315", stopColor: "#80D7F5" }),
|
|
1653
|
+
/* @__PURE__ */ React42.createElement("stop", { offset: "0.775", stopColor: "#9990D5" })
|
|
1654
|
+
), /* @__PURE__ */ React42.createElement(
|
|
1655
|
+
"linearGradient",
|
|
1656
|
+
{
|
|
1657
|
+
id: "paint5_linear_1838_5769",
|
|
1658
|
+
x1: "3.85742",
|
|
1659
|
+
y1: "47.7251",
|
|
1660
|
+
x2: "12.8579",
|
|
1661
|
+
y2: "47.7251",
|
|
1662
|
+
gradientUnits: "userSpaceOnUse"
|
|
1663
|
+
},
|
|
1664
|
+
/* @__PURE__ */ React42.createElement("stop", { stopColor: "#ADF4A6" }),
|
|
1665
|
+
/* @__PURE__ */ React42.createElement("stop", { offset: "0.315", stopColor: "#80D7F5" }),
|
|
1666
|
+
/* @__PURE__ */ React42.createElement("stop", { offset: "0.775", stopColor: "#9990D5" })
|
|
1667
|
+
), /* @__PURE__ */ React42.createElement(
|
|
1668
|
+
"linearGradient",
|
|
1669
|
+
{
|
|
1670
|
+
id: "paint6_linear_1838_5769",
|
|
1671
|
+
x1: "32.4314",
|
|
1672
|
+
y1: "57.9308",
|
|
1673
|
+
x2: "108.293",
|
|
1674
|
+
y2: "57.9308",
|
|
1675
|
+
gradientUnits: "userSpaceOnUse"
|
|
1676
|
+
},
|
|
1677
|
+
/* @__PURE__ */ React42.createElement("stop", { stopColor: "#ADF4A6" }),
|
|
1678
|
+
/* @__PURE__ */ React42.createElement("stop", { offset: "0.315", stopColor: "#80D7F5" }),
|
|
1679
|
+
/* @__PURE__ */ React42.createElement("stop", { offset: "0.775", stopColor: "#9990D5" })
|
|
1680
|
+
), /* @__PURE__ */ React42.createElement(
|
|
1681
|
+
"linearGradient",
|
|
1682
|
+
{
|
|
1683
|
+
id: "paint7_linear_1838_5769",
|
|
1684
|
+
x1: "47.8611",
|
|
1685
|
+
y1: "56.8389",
|
|
1686
|
+
x2: "91.9709",
|
|
1687
|
+
y2: "56.8389",
|
|
1688
|
+
gradientUnits: "userSpaceOnUse"
|
|
1689
|
+
},
|
|
1690
|
+
/* @__PURE__ */ React42.createElement("stop", { stopColor: "#ADF4A6" }),
|
|
1691
|
+
/* @__PURE__ */ React42.createElement("stop", { offset: "0.315", stopColor: "#80D7F5" }),
|
|
1692
|
+
/* @__PURE__ */ React42.createElement("stop", { offset: "0.775", stopColor: "#9990D5" })
|
|
1693
|
+
))
|
|
1694
|
+
);
|
|
1695
|
+
};
|
|
1696
|
+
var TransactionComplete_default = TransactionComplete;
|
|
1697
|
+
|
|
1395
1698
|
// src/utils/constants.tsx
|
|
1396
1699
|
import {
|
|
1397
1700
|
arbitrum,
|
|
@@ -1603,11 +1906,11 @@ var ColorModeOptions = /* @__PURE__ */ ((ColorModeOptions2) => {
|
|
|
1603
1906
|
ColorModeOptions2["dark"] = "dark";
|
|
1604
1907
|
return ColorModeOptions2;
|
|
1605
1908
|
})(ColorModeOptions || {});
|
|
1606
|
-
var DAppOptions = /* @__PURE__ */ ((
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
return
|
|
1909
|
+
var DAppOptions = /* @__PURE__ */ ((DAppOptions3) => {
|
|
1910
|
+
DAppOptions3["None"] = "none";
|
|
1911
|
+
DAppOptions3["LPAdd"] = "LPAdd";
|
|
1912
|
+
DAppOptions3["LPDrain"] = "LPDrain";
|
|
1913
|
+
return DAppOptions3;
|
|
1611
1914
|
})(DAppOptions || {});
|
|
1612
1915
|
|
|
1613
1916
|
// src/store/optionSlice.tsx
|
|
@@ -2054,9 +2357,6 @@ var getAllPlugins = () => {
|
|
|
2054
2357
|
return pluginRegistry;
|
|
2055
2358
|
};
|
|
2056
2359
|
|
|
2057
|
-
// src/KimaProvider.tsx
|
|
2058
|
-
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
2059
|
-
|
|
2060
2360
|
// src/hooks/useGetEnvOptions.tsx
|
|
2061
2361
|
import { useQuery } from "@tanstack/react-query";
|
|
2062
2362
|
|
|
@@ -2128,7 +2428,7 @@ var useGetEnvOptions = ({
|
|
|
2128
2428
|
};
|
|
2129
2429
|
|
|
2130
2430
|
// plugins/evm/index.tsx
|
|
2131
|
-
import
|
|
2431
|
+
import React44 from "react";
|
|
2132
2432
|
|
|
2133
2433
|
// plugins/PluginBase.ts
|
|
2134
2434
|
var PluginBase = class {
|
|
@@ -2165,7 +2465,7 @@ var PluginBase = class {
|
|
|
2165
2465
|
};
|
|
2166
2466
|
|
|
2167
2467
|
// plugins/evm/features/walletConnect/WalletProvider.tsx
|
|
2168
|
-
import
|
|
2468
|
+
import React43, { useEffect, useState } from "react";
|
|
2169
2469
|
|
|
2170
2470
|
// plugins/evm/config/modalConfig.ts
|
|
2171
2471
|
import { createAppKit } from "@reown/appkit/react";
|
|
@@ -2257,9 +2557,9 @@ var WalletProvider = ({
|
|
|
2257
2557
|
}
|
|
2258
2558
|
}, [networkOption, isLoading, walletConnectProjectId]);
|
|
2259
2559
|
if (!isReady) {
|
|
2260
|
-
return /* @__PURE__ */
|
|
2560
|
+
return /* @__PURE__ */ React43.createElement(React43.Fragment, null);
|
|
2261
2561
|
}
|
|
2262
|
-
return /* @__PURE__ */
|
|
2562
|
+
return /* @__PURE__ */ React43.createElement(React43.Fragment, null, children);
|
|
2263
2563
|
};
|
|
2264
2564
|
var WalletProvider_default = WalletProvider;
|
|
2265
2565
|
|
|
@@ -2736,23 +3036,22 @@ function useIsWalletReady() {
|
|
|
2736
3036
|
const [statusMessage, setStatusMessage] = useState2("Wallet not connected");
|
|
2737
3037
|
const [connectedAddress, setConnectedAddress] = useState2("");
|
|
2738
3038
|
const switchNetwork = useCallback(async () => {
|
|
3039
|
+
if (!sourceChain || !appKitModel) return;
|
|
3040
|
+
if (sourceChain.compatibility !== "EVM" /* EVM */) return;
|
|
2739
3041
|
logger_default.debug("useIsWalletReady:EVM:Attempting to switch network...", {
|
|
2740
3042
|
hasProvider: !!appkitProvider,
|
|
2741
3043
|
sourceChain,
|
|
2742
3044
|
modalExists: appKitModel !== null,
|
|
2743
3045
|
modal: appKitModel
|
|
2744
3046
|
});
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
} catch (e) {
|
|
2754
|
-
logger_default.error("useIsWalletReady:EVM:Network switch failed:", e);
|
|
2755
|
-
}
|
|
3047
|
+
try {
|
|
3048
|
+
appKitModel.switchNetwork(sourceChain);
|
|
3049
|
+
logger_default.debug(
|
|
3050
|
+
"useIsWalletReady:EVM:Network switch successful to:",
|
|
3051
|
+
sourceChain.name
|
|
3052
|
+
);
|
|
3053
|
+
} catch (e) {
|
|
3054
|
+
logger_default.warn("useIsWalletReady:EVM:Network switch failed:", e);
|
|
2756
3055
|
}
|
|
2757
3056
|
}, [appkitProvider, sourceChain]);
|
|
2758
3057
|
useEffect2(() => {
|
|
@@ -2850,12 +3149,13 @@ function useEvmAllowance() {
|
|
|
2850
3149
|
const sourceChain = useSelector4(selectSourceChain);
|
|
2851
3150
|
const sourceAddress = useSelector4(selectSourceAddress);
|
|
2852
3151
|
const networkOption = useSelector4(selectNetworkOption);
|
|
3152
|
+
const dAppOption = useSelector4(selectDappOption);
|
|
2853
3153
|
const { transactionValues } = useSelector4(selectServiceFee);
|
|
2854
3154
|
const selectedCoin = useSelector4(selectSourceCurrency);
|
|
2855
3155
|
const tokenOptions = useSelector4(selectTokenOptions);
|
|
2856
3156
|
const backendUrl = useSelector4(selectBackendUrl);
|
|
2857
3157
|
const feeDeduct = useSelector4(selectFeeDeduct);
|
|
2858
|
-
const txValues = feeDeduct ? transactionValues.feeFromTarget : transactionValues.feeFromOrigin;
|
|
3158
|
+
const txValues = feeDeduct || dAppOption !== "none" /* None */ ? transactionValues.feeFromTarget : transactionValues.feeFromOrigin;
|
|
2859
3159
|
const allowanceNumber = BigInt(txValues.allowanceAmount.value);
|
|
2860
3160
|
const { pools } = useGetPools_default(backendUrl, networkOption);
|
|
2861
3161
|
const { walletProvider, walletAddress } = useEvmProvider();
|
|
@@ -2957,7 +3257,9 @@ function useEvmAllowance() {
|
|
|
2957
3257
|
import { useDisconnect } from "@reown/appkit/react";
|
|
2958
3258
|
function useDisconnectWallet() {
|
|
2959
3259
|
const { disconnect } = useDisconnect();
|
|
2960
|
-
return {
|
|
3260
|
+
return {
|
|
3261
|
+
disconnectWallet: disconnect
|
|
3262
|
+
};
|
|
2961
3263
|
}
|
|
2962
3264
|
var useDisconnectWallet_default = useDisconnectWallet;
|
|
2963
3265
|
|
|
@@ -2984,7 +3286,7 @@ var EvmPlugin = class extends PluginBase {
|
|
|
2984
3286
|
walletConnectProjectId,
|
|
2985
3287
|
isLoading
|
|
2986
3288
|
}) => {
|
|
2987
|
-
return /* @__PURE__ */
|
|
3289
|
+
return /* @__PURE__ */ React44.createElement(
|
|
2988
3290
|
WalletProvider_default,
|
|
2989
3291
|
{
|
|
2990
3292
|
children,
|
|
@@ -3000,10 +3302,10 @@ var evmPlugin = new EvmPlugin(store);
|
|
|
3000
3302
|
var evm_default = evmPlugin;
|
|
3001
3303
|
|
|
3002
3304
|
// plugins/solana/index.tsx
|
|
3003
|
-
import
|
|
3305
|
+
import React46 from "react";
|
|
3004
3306
|
|
|
3005
3307
|
// plugins/solana/features/walletConnect/WalletProvider.tsx
|
|
3006
|
-
import
|
|
3308
|
+
import React45 from "react";
|
|
3007
3309
|
import {
|
|
3008
3310
|
ConnectionProvider,
|
|
3009
3311
|
WalletProvider as SolanaWalletProvider
|
|
@@ -3041,7 +3343,7 @@ var WalletProvider2 = ({
|
|
|
3041
3343
|
logger_default.debug(
|
|
3042
3344
|
`WalletProvider initialized with projectId: ${walletConnectProjectId}`
|
|
3043
3345
|
);
|
|
3044
|
-
return /* @__PURE__ */
|
|
3346
|
+
return /* @__PURE__ */ React45.createElement(ConnectionProvider, { endpoint }, /* @__PURE__ */ React45.createElement(
|
|
3045
3347
|
SolanaWalletProvider,
|
|
3046
3348
|
{
|
|
3047
3349
|
autoConnect: false,
|
|
@@ -3108,10 +3410,12 @@ import { useSelector as useSelector8 } from "react-redux";
|
|
|
3108
3410
|
|
|
3109
3411
|
// plugins/solana/core/hooks/useBalance.tsx
|
|
3110
3412
|
import { useSelector as useSelector7 } from "react-redux";
|
|
3413
|
+
import { useQuery as useQuery7 } from "@tanstack/react-query";
|
|
3414
|
+
import { PublicKey as PublicKey6 } from "@solana/web3.js";
|
|
3111
3415
|
|
|
3112
3416
|
// plugins/solana/utils/getTokenAllowance.tsx
|
|
3113
|
-
import { getAssociatedTokenAddress } from "@solana/spl-token";
|
|
3114
3417
|
import { PublicKey as PublicKey4 } from "@solana/web3.js";
|
|
3418
|
+
import { getAssociatedTokenAddress } from "@solana/spl-token";
|
|
3115
3419
|
var getTokenAllowance2 = async ({
|
|
3116
3420
|
tokenOptions,
|
|
3117
3421
|
selectedCoin,
|
|
@@ -3129,6 +3433,16 @@ var getTokenAllowance2 = async ({
|
|
|
3129
3433
|
);
|
|
3130
3434
|
const accountInfo = await connection.getParsedAccountInfo(tokenAccountAddress);
|
|
3131
3435
|
const parsedAccountInfo = accountInfo?.value?.data;
|
|
3436
|
+
if (!parsedAccountInfo) {
|
|
3437
|
+
logger_default.warn(
|
|
3438
|
+
`Sol:getTokenAllowance: No token ${selectedCoin} account info found for ${userPublicKey.toBase58()}`
|
|
3439
|
+
);
|
|
3440
|
+
return {
|
|
3441
|
+
allowance: BigInt(0),
|
|
3442
|
+
balance: BigInt(0),
|
|
3443
|
+
decimals: 0
|
|
3444
|
+
};
|
|
3445
|
+
}
|
|
3132
3446
|
return {
|
|
3133
3447
|
allowance: parsedAccountInfo.parsed?.info?.delegate === poolAddress ? BigInt(parsedAccountInfo.parsed?.info?.delegatedAmount?.amount ?? 0) : BigInt(0),
|
|
3134
3448
|
balance: BigInt(parsedAccountInfo.parsed?.info?.tokenAmount?.amount ?? 0),
|
|
@@ -3142,9 +3456,6 @@ var getTokenAllowance2 = async ({
|
|
|
3142
3456
|
}
|
|
3143
3457
|
};
|
|
3144
3458
|
|
|
3145
|
-
// plugins/solana/core/hooks/useBalance.tsx
|
|
3146
|
-
import { useQuery as useQuery7 } from "@tanstack/react-query";
|
|
3147
|
-
|
|
3148
3459
|
// plugins/solana/core/hooks/useSolanaProvider.ts
|
|
3149
3460
|
import { useSelector as useSelector6 } from "react-redux";
|
|
3150
3461
|
import { useConnection as useConnection2, useWallet as useWallet2 } from "@solana/wallet-adapter-react";
|
|
@@ -3172,7 +3483,6 @@ var useSolanaProvider = () => {
|
|
|
3172
3483
|
};
|
|
3173
3484
|
|
|
3174
3485
|
// plugins/solana/core/hooks/useBalance.tsx
|
|
3175
|
-
import { PublicKey as PublicKey6 } from "@solana/web3.js";
|
|
3176
3486
|
var emptyResult2 = {};
|
|
3177
3487
|
function useBalance2() {
|
|
3178
3488
|
const sourceChain = useSelector7(selectSourceChain);
|
|
@@ -3388,7 +3698,7 @@ var SolanaPlugin = class extends PluginBase {
|
|
|
3388
3698
|
networkOption,
|
|
3389
3699
|
walletConnectProjectId
|
|
3390
3700
|
}) => {
|
|
3391
|
-
return /* @__PURE__ */
|
|
3701
|
+
return /* @__PURE__ */ React46.createElement(
|
|
3392
3702
|
WalletProvider_default2,
|
|
3393
3703
|
{
|
|
3394
3704
|
networkOption,
|
|
@@ -3402,10 +3712,10 @@ var solanaPlugin = new SolanaPlugin(store);
|
|
|
3402
3712
|
var solana_default = solanaPlugin;
|
|
3403
3713
|
|
|
3404
3714
|
// plugins/tron/index.tsx
|
|
3405
|
-
import
|
|
3715
|
+
import React48 from "react";
|
|
3406
3716
|
|
|
3407
3717
|
// plugins/tron/features/walletConnect/WalletProvider.tsx
|
|
3408
|
-
import
|
|
3718
|
+
import React47, { useMemo as useMemo3 } from "react";
|
|
3409
3719
|
import { WalletProvider as TronWalletProviderBase } from "@tronweb3/tronwallet-adapter-react-hooks";
|
|
3410
3720
|
import { LedgerAdapter } from "@tronweb3/tronwallet-adapter-ledger";
|
|
3411
3721
|
import { TronLinkAdapter } from "@tronweb3/tronwallet-adapter-tronlink";
|
|
@@ -3447,7 +3757,7 @@ var WalletProvider3 = ({ children, networkOption }) => {
|
|
|
3447
3757
|
adapters[0].switchChain("0x2b6653dc");
|
|
3448
3758
|
}
|
|
3449
3759
|
};
|
|
3450
|
-
return /* @__PURE__ */
|
|
3760
|
+
return /* @__PURE__ */ React47.createElement(
|
|
3451
3761
|
TronWalletProviderBase,
|
|
3452
3762
|
{
|
|
3453
3763
|
adapters,
|
|
@@ -3559,6 +3869,7 @@ var useTronProvider = () => {
|
|
|
3559
3869
|
|
|
3560
3870
|
// plugins/tron/core/hooks/useBalance.tsx
|
|
3561
3871
|
import { useSelector as useSelector12 } from "react-redux";
|
|
3872
|
+
import { useQuery as useQuery9 } from "@tanstack/react-query";
|
|
3562
3873
|
|
|
3563
3874
|
// plugins/tron/utils/ethereum/erc20ABI.json
|
|
3564
3875
|
var erc20ABI_default = {
|
|
@@ -3815,7 +4126,6 @@ var getTokenAllowance3 = async ({
|
|
|
3815
4126
|
};
|
|
3816
4127
|
|
|
3817
4128
|
// plugins/tron/core/hooks/useBalance.tsx
|
|
3818
|
-
import { useQuery as useQuery9 } from "@tanstack/react-query";
|
|
3819
4129
|
var emptyResult3 = {};
|
|
3820
4130
|
function useBalance3() {
|
|
3821
4131
|
const mode = useSelector12(selectMode);
|
|
@@ -4005,7 +4315,7 @@ var TronPlugin = class extends PluginBase {
|
|
|
4005
4315
|
networkOption,
|
|
4006
4316
|
walletConnectProjectId
|
|
4007
4317
|
}) => {
|
|
4008
|
-
return /* @__PURE__ */
|
|
4318
|
+
return /* @__PURE__ */ React48.createElement(
|
|
4009
4319
|
WalletProvider_default3,
|
|
4010
4320
|
{
|
|
4011
4321
|
networkOption,
|
|
@@ -4019,7 +4329,7 @@ var tronPlugin = new TronPlugin(store);
|
|
|
4019
4329
|
var tron_default = tronPlugin;
|
|
4020
4330
|
|
|
4021
4331
|
// plugins/credit-card/index.tsx
|
|
4022
|
-
import
|
|
4332
|
+
import React49 from "react";
|
|
4023
4333
|
|
|
4024
4334
|
// plugins/credit-card/core/hooks/useIsProviderReady.tsx
|
|
4025
4335
|
import { useDispatch as useDispatch5, useSelector as useSelector15 } from "react-redux";
|
|
@@ -4029,12 +4339,10 @@ var useIsProviderReady = () => {
|
|
|
4029
4339
|
const dispatch = useDispatch5();
|
|
4030
4340
|
const sourceChain = useSelector15(selectSourceChain);
|
|
4031
4341
|
useEffect5(() => {
|
|
4032
|
-
if (sourceChain.
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
setIsReady(true);
|
|
4037
|
-
}
|
|
4342
|
+
if (!sourceChain || sourceChain.shortName !== "CC") return;
|
|
4343
|
+
logger_default.debug("CC:useIsProviderReady: dispatching changes from fiat...");
|
|
4344
|
+
dispatch(setSourceAddress(""));
|
|
4345
|
+
setIsReady(true);
|
|
4038
4346
|
}, [sourceChain]);
|
|
4039
4347
|
return { isReady, statusMessage: "", walletAddres: "" };
|
|
4040
4348
|
};
|
|
@@ -4077,7 +4385,7 @@ var CreditCardPlugin = class extends PluginBase {
|
|
|
4077
4385
|
return chain.compatibility === "CC";
|
|
4078
4386
|
};
|
|
4079
4387
|
Provider = ({ children }) => {
|
|
4080
|
-
return /* @__PURE__ */
|
|
4388
|
+
return /* @__PURE__ */ React49.createElement(React49.Fragment, null, children);
|
|
4081
4389
|
};
|
|
4082
4390
|
};
|
|
4083
4391
|
var creditCardPlugin = new CreditCardPlugin(store);
|
|
@@ -4098,7 +4406,7 @@ var useKimaContext = () => {
|
|
|
4098
4406
|
}
|
|
4099
4407
|
return context;
|
|
4100
4408
|
};
|
|
4101
|
-
var InternalKimaProvider =
|
|
4409
|
+
var InternalKimaProvider = React50.memo(
|
|
4102
4410
|
({ kimaBackendUrl, walletConnectProjectId, children, logLevel }) => {
|
|
4103
4411
|
const { data: envOptions, isLoading } = useGetEnvOptions({
|
|
4104
4412
|
kimaBackendUrl
|
|
@@ -4112,7 +4420,7 @@ var InternalKimaProvider = React48.memo(
|
|
|
4112
4420
|
const plugin = getPluginProvider(pluginData.id);
|
|
4113
4421
|
if (plugin) {
|
|
4114
4422
|
const { Provider: Provider3 } = plugin;
|
|
4115
|
-
return /* @__PURE__ */
|
|
4423
|
+
return /* @__PURE__ */ React50.createElement(
|
|
4116
4424
|
Provider3,
|
|
4117
4425
|
{
|
|
4118
4426
|
key: plugin.data.id,
|
|
@@ -4126,12 +4434,12 @@ var InternalKimaProvider = React48.memo(
|
|
|
4126
4434
|
return acc;
|
|
4127
4435
|
}, children);
|
|
4128
4436
|
}, [plugins, walletConnectProjectId, envOptions, isLoading]);
|
|
4129
|
-
return /* @__PURE__ */
|
|
4437
|
+
return /* @__PURE__ */ React50.createElement(React50.Fragment, null, WrappedProviders);
|
|
4130
4438
|
}
|
|
4131
4439
|
);
|
|
4132
4440
|
var KimaProvider = ({
|
|
4133
4441
|
walletConnectProjectId,
|
|
4134
|
-
children = /* @__PURE__ */
|
|
4442
|
+
children = /* @__PURE__ */ React50.createElement(React50.Fragment, null),
|
|
4135
4443
|
externalProvider,
|
|
4136
4444
|
kimaBackendUrl = "http://localhost:3001",
|
|
4137
4445
|
logLevel,
|
|
@@ -4166,7 +4474,7 @@ var KimaProvider = ({
|
|
|
4166
4474
|
errorHandler,
|
|
4167
4475
|
switchChainHandler
|
|
4168
4476
|
};
|
|
4169
|
-
return /* @__PURE__ */
|
|
4477
|
+
return /* @__PURE__ */ React50.createElement(QueryClientProvider, { client: queryClient }, /* @__PURE__ */ React50.createElement(Provider, { store }, /* @__PURE__ */ React50.createElement(KimaContext.Provider, { value: kimaContext }, /* @__PURE__ */ React50.createElement(
|
|
4170
4478
|
InternalKimaProvider,
|
|
4171
4479
|
{
|
|
4172
4480
|
kimaBackendUrl,
|
|
@@ -4178,17 +4486,17 @@ var KimaProvider = ({
|
|
|
4178
4486
|
var KimaProvider_default = KimaProvider;
|
|
4179
4487
|
|
|
4180
4488
|
// src/components/KimaTransactionWidget.tsx
|
|
4181
|
-
import
|
|
4489
|
+
import React89, { useEffect as useEffect24, useState as useState17 } from "react";
|
|
4182
4490
|
|
|
4183
4491
|
// src/components/KimaWidgetWrapper.tsx
|
|
4184
|
-
import
|
|
4492
|
+
import React87, { useEffect as useEffect23 } from "react";
|
|
4185
4493
|
import { useDispatch as useDispatch27, useSelector as useSelector47 } from "react-redux";
|
|
4186
4494
|
|
|
4187
4495
|
// src/components/TransactionWidget.tsx
|
|
4188
|
-
import
|
|
4496
|
+
import React74, { useEffect as useEffect15, useMemo as useMemo12, useState as useState11 } from "react";
|
|
4189
4497
|
|
|
4190
4498
|
// src/components/reusable/Progressbar.tsx
|
|
4191
|
-
import
|
|
4499
|
+
import React51 from "react";
|
|
4192
4500
|
import { useSelector as useSelector17 } from "react-redux";
|
|
4193
4501
|
var stepInfo = [
|
|
4194
4502
|
{
|
|
@@ -4209,12 +4517,12 @@ var stepInfo = [
|
|
|
4209
4517
|
];
|
|
4210
4518
|
var Progressbar = ({ step, errorStep, setFocus, loadingStep }) => {
|
|
4211
4519
|
const theme = useSelector17(selectTheme);
|
|
4212
|
-
return /* @__PURE__ */
|
|
4520
|
+
return /* @__PURE__ */ React51.createElement("div", { className: "kima-progressbar" }, /* @__PURE__ */ React51.createElement(
|
|
4213
4521
|
"div",
|
|
4214
4522
|
{
|
|
4215
4523
|
className: `value step-${step * 100 / 4}`
|
|
4216
4524
|
}
|
|
4217
|
-
), /* @__PURE__ */
|
|
4525
|
+
), /* @__PURE__ */ React51.createElement("div", { className: "step-indicators" }, stepInfo.map((item, index) => /* @__PURE__ */ React51.createElement(
|
|
4218
4526
|
"div",
|
|
4219
4527
|
{
|
|
4220
4528
|
key: item.title,
|
|
@@ -4225,14 +4533,14 @@ var Progressbar = ({ step, errorStep, setFocus, loadingStep }) => {
|
|
|
4225
4533
|
if (index < 4) setFocus(index);
|
|
4226
4534
|
}
|
|
4227
4535
|
},
|
|
4228
|
-
/* @__PURE__ */
|
|
4536
|
+
/* @__PURE__ */ React51.createElement("div", { className: "step-info" }, step < index && /* @__PURE__ */ React51.createElement(Lock_default, null), step >= index ? index === loadingStep ? /* @__PURE__ */ React51.createElement(Loader_default, { className: "loader" }) : index === errorStep ? /* @__PURE__ */ React51.createElement(Warning_default, null) : /* @__PURE__ */ React51.createElement(Check_default, null) : null, /* @__PURE__ */ React51.createElement("span", null, item.title))
|
|
4229
4537
|
))));
|
|
4230
4538
|
};
|
|
4231
4539
|
var Progressbar_default = Progressbar;
|
|
4232
4540
|
|
|
4233
4541
|
// src/components/reusable/ExternalLink.tsx
|
|
4234
|
-
import
|
|
4235
|
-
var ExternalLink = ({ to, children, className, rest }) => /* @__PURE__ */
|
|
4542
|
+
import React52 from "react";
|
|
4543
|
+
var ExternalLink = ({ to, children, className, rest }) => /* @__PURE__ */ React52.createElement(
|
|
4236
4544
|
"a",
|
|
4237
4545
|
{
|
|
4238
4546
|
className,
|
|
@@ -4246,20 +4554,20 @@ var ExternalLink = ({ to, children, className, rest }) => /* @__PURE__ */ React5
|
|
|
4246
4554
|
var ExternalLink_default = ExternalLink;
|
|
4247
4555
|
|
|
4248
4556
|
// src/components/reusable/NetworkLabel.tsx
|
|
4249
|
-
import
|
|
4557
|
+
import React53 from "react";
|
|
4250
4558
|
import { useSelector as useSelector18 } from "react-redux";
|
|
4251
4559
|
|
|
4252
4560
|
// src/components/reusable/PrimaryButton.tsx
|
|
4253
|
-
import
|
|
4561
|
+
import React56 from "react";
|
|
4254
4562
|
|
|
4255
4563
|
// src/assets/loading/180-ring.tsx
|
|
4256
|
-
import
|
|
4564
|
+
import React54 from "react";
|
|
4257
4565
|
var Loading180Ring = ({
|
|
4258
4566
|
width = 24,
|
|
4259
4567
|
height = 24,
|
|
4260
4568
|
fill = "white"
|
|
4261
4569
|
}) => {
|
|
4262
|
-
return /* @__PURE__ */
|
|
4570
|
+
return /* @__PURE__ */ React54.createElement(
|
|
4263
4571
|
"svg",
|
|
4264
4572
|
{
|
|
4265
4573
|
width,
|
|
@@ -4268,7 +4576,7 @@ var Loading180Ring = ({
|
|
|
4268
4576
|
viewBox: "0 0 24 24",
|
|
4269
4577
|
xmlns: "http://www.w3.org/2000/svg"
|
|
4270
4578
|
},
|
|
4271
|
-
/* @__PURE__ */
|
|
4579
|
+
/* @__PURE__ */ React54.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__ */ React54.createElement(
|
|
4272
4580
|
"animateTransform",
|
|
4273
4581
|
{
|
|
4274
4582
|
attributeName: "transform",
|
|
@@ -4283,7 +4591,7 @@ var Loading180Ring = ({
|
|
|
4283
4591
|
var ring_default = Loading180Ring;
|
|
4284
4592
|
|
|
4285
4593
|
// src/assets/loading/6-dots-scale.tsx
|
|
4286
|
-
import
|
|
4594
|
+
import React55 from "react";
|
|
4287
4595
|
|
|
4288
4596
|
// src/components/reusable/PrimaryButton.tsx
|
|
4289
4597
|
var PrimaryButton = ({
|
|
@@ -4294,7 +4602,7 @@ var PrimaryButton = ({
|
|
|
4294
4602
|
disabled = false,
|
|
4295
4603
|
ref
|
|
4296
4604
|
}) => {
|
|
4297
|
-
return /* @__PURE__ */
|
|
4605
|
+
return /* @__PURE__ */ React56.createElement("div", { className: "primary-button-wrapper" }, /* @__PURE__ */ React56.createElement(
|
|
4298
4606
|
"button",
|
|
4299
4607
|
{
|
|
4300
4608
|
className: `primary-button ${className}`,
|
|
@@ -4302,14 +4610,14 @@ var PrimaryButton = ({
|
|
|
4302
4610
|
ref,
|
|
4303
4611
|
disabled
|
|
4304
4612
|
},
|
|
4305
|
-
isLoading && /* @__PURE__ */
|
|
4613
|
+
isLoading && /* @__PURE__ */ React56.createElement("div", { className: "loading-indicator" }, /* @__PURE__ */ React56.createElement(ring_default, { width: 24, height: 24, fill: "white" })),
|
|
4306
4614
|
children
|
|
4307
4615
|
));
|
|
4308
4616
|
};
|
|
4309
4617
|
var PrimaryButton_default = PrimaryButton;
|
|
4310
4618
|
|
|
4311
4619
|
// src/components/reusable/SecondaryButton.tsx
|
|
4312
|
-
import
|
|
4620
|
+
import React57 from "react";
|
|
4313
4621
|
var SecondaryButton = ({
|
|
4314
4622
|
className,
|
|
4315
4623
|
clickHandler,
|
|
@@ -4318,7 +4626,7 @@ var SecondaryButton = ({
|
|
|
4318
4626
|
style,
|
|
4319
4627
|
disabled = false,
|
|
4320
4628
|
isLoading
|
|
4321
|
-
}) => /* @__PURE__ */
|
|
4629
|
+
}) => /* @__PURE__ */ React57.createElement(
|
|
4322
4630
|
"button",
|
|
4323
4631
|
{
|
|
4324
4632
|
className: `secondary-button ${className} ${theme}`,
|
|
@@ -4326,18 +4634,18 @@ var SecondaryButton = ({
|
|
|
4326
4634
|
...style,
|
|
4327
4635
|
disabled
|
|
4328
4636
|
},
|
|
4329
|
-
isLoading && /* @__PURE__ */
|
|
4637
|
+
isLoading && /* @__PURE__ */ React57.createElement("div", { className: "loading-indicator" }, /* @__PURE__ */ React57.createElement(ring_default, { width: 24, height: 24, fill: "black" })),
|
|
4330
4638
|
children
|
|
4331
4639
|
);
|
|
4332
4640
|
var SecondaryButton_default = SecondaryButton;
|
|
4333
4641
|
|
|
4334
4642
|
// src/components/reusable/Dropdown.tsx
|
|
4335
|
-
import
|
|
4643
|
+
import React58 from "react";
|
|
4336
4644
|
import { useDispatch as useDispatch6 } from "react-redux";
|
|
4337
4645
|
import { useSelector as useSelector19 } from "react-redux";
|
|
4338
4646
|
|
|
4339
4647
|
// src/components/reusable/WalletButton.tsx
|
|
4340
|
-
import
|
|
4648
|
+
import React61, { useEffect as useEffect10, useMemo as useMemo8 } from "react";
|
|
4341
4649
|
import { useDispatch as useDispatch7, useSelector as useSelector21 } from "react-redux";
|
|
4342
4650
|
|
|
4343
4651
|
// src/hooks/useGetCurrentPlugin.tsx
|
|
@@ -4345,7 +4653,7 @@ import { useEffect as useEffect6, useState as useState5 } from "react";
|
|
|
4345
4653
|
import { useSelector as useSelector20 } from "react-redux";
|
|
4346
4654
|
|
|
4347
4655
|
// plugins/default/index.tsx
|
|
4348
|
-
import
|
|
4656
|
+
import React59 from "react";
|
|
4349
4657
|
var DefaultPlugin = class extends PluginBase {
|
|
4350
4658
|
constructor(store2) {
|
|
4351
4659
|
super({
|
|
@@ -4380,7 +4688,7 @@ var DefaultPlugin = class extends PluginBase {
|
|
|
4380
4688
|
networkOption,
|
|
4381
4689
|
walletConnectProjectId
|
|
4382
4690
|
}) => {
|
|
4383
|
-
return /* @__PURE__ */
|
|
4691
|
+
return /* @__PURE__ */ React59.createElement("div", null, children);
|
|
4384
4692
|
};
|
|
4385
4693
|
};
|
|
4386
4694
|
var defaultPlugin = new DefaultPlugin(store);
|
|
@@ -4473,7 +4781,7 @@ import { useWallet as useTronWallet2 } from "@tronweb3/tronwallet-adapter-react-
|
|
|
4473
4781
|
import { useAppKit, useAppKitState } from "@reown/appkit/react";
|
|
4474
4782
|
|
|
4475
4783
|
// src/components/reusable/CopyButton.tsx
|
|
4476
|
-
import
|
|
4784
|
+
import React60, { useEffect as useEffect8, useState as useState7 } from "react";
|
|
4477
4785
|
var CopyButton = ({ text }) => {
|
|
4478
4786
|
const [copyClicked, setCopyClicked] = useState7(false);
|
|
4479
4787
|
useEffect8(() => {
|
|
@@ -4482,7 +4790,7 @@ var CopyButton = ({ text }) => {
|
|
|
4482
4790
|
setCopyClicked(false);
|
|
4483
4791
|
}, 2e3);
|
|
4484
4792
|
}, [copyClicked]);
|
|
4485
|
-
return /* @__PURE__ */
|
|
4793
|
+
return /* @__PURE__ */ React60.createElement(
|
|
4486
4794
|
"span",
|
|
4487
4795
|
{
|
|
4488
4796
|
className: "copy-btn",
|
|
@@ -4491,7 +4799,7 @@ var CopyButton = ({ text }) => {
|
|
|
4491
4799
|
navigator.clipboard.writeText(text);
|
|
4492
4800
|
}
|
|
4493
4801
|
},
|
|
4494
|
-
copyClicked ? /* @__PURE__ */
|
|
4802
|
+
copyClicked ? /* @__PURE__ */ React60.createElement(Check_default, null) : /* @__PURE__ */ React60.createElement(Copy_default, null)
|
|
4495
4803
|
);
|
|
4496
4804
|
};
|
|
4497
4805
|
var CopyButton_default = CopyButton;
|
|
@@ -4647,6 +4955,7 @@ var WalletButton = ({
|
|
|
4647
4955
|
const compliantOption = useSelector21(selectCompliantOption);
|
|
4648
4956
|
const selectedNetwork = useSelector21(selectSourceChain);
|
|
4649
4957
|
const targetAddress = useSelector21(selectTargetAddress);
|
|
4958
|
+
const dAppOption = useSelector21(selectDappOption);
|
|
4650
4959
|
const { externalProvider } = useKimaContext();
|
|
4651
4960
|
const { connected: isSolanaConnected } = useSolanaWallet2();
|
|
4652
4961
|
const { connected: isTronConnected } = useTronWallet2();
|
|
@@ -4708,8 +5017,11 @@ var WalletButton = ({
|
|
|
4708
5017
|
return "";
|
|
4709
5018
|
}, [isReady, statusMessage, sourceCompliant, compliantOption]);
|
|
4710
5019
|
const isConnected = useMemo8(() => {
|
|
5020
|
+
if (mode === "payment" /* payment */ && dAppOption !== "none" /* None */) {
|
|
5021
|
+
return isReady;
|
|
5022
|
+
}
|
|
4711
5023
|
return isReady && !initialSelection;
|
|
4712
|
-
}, [isReady, initialSelection]);
|
|
5024
|
+
}, [isReady, initialSelection, mode, dAppOption]);
|
|
4713
5025
|
useEffect10(() => {
|
|
4714
5026
|
if (!isReady) {
|
|
4715
5027
|
dispatch(setSourceAddress(""));
|
|
@@ -4717,13 +5029,13 @@ var WalletButton = ({
|
|
|
4717
5029
|
}
|
|
4718
5030
|
dispatch(setSourceAddress(connectedAddress));
|
|
4719
5031
|
}, [isReady]);
|
|
4720
|
-
return /* @__PURE__ */
|
|
5032
|
+
return /* @__PURE__ */ React61.createElement(
|
|
4721
5033
|
"div",
|
|
4722
5034
|
{
|
|
4723
5035
|
className: `wallet-button ${isConnected ? "connected" : "disconnected"} ${theme.colorMode} ${errorBelow ? "error-below" : ""}`,
|
|
4724
5036
|
"data-testid": "connect-wallet-btn"
|
|
4725
5037
|
},
|
|
4726
|
-
/* @__PURE__ */
|
|
5038
|
+
/* @__PURE__ */ React61.createElement("div", { className: "info-wrapper" }, /* @__PURE__ */ React61.createElement(
|
|
4727
5039
|
"button",
|
|
4728
5040
|
{
|
|
4729
5041
|
className: `${isConnected ? "connected" : "disconnected"} ${width < 640 && "shortened"} ${theme.colorMode}`,
|
|
@@ -4733,16 +5045,16 @@ var WalletButton = ({
|
|
|
4733
5045
|
isConnected && !placeholder ? width >= 640 ? `${connectedAddress || ""}` : getShortenedAddress(connectedAddress || "") : "",
|
|
4734
5046
|
!isConnected && mode === "light" /* light */ && "Select Network to Load Account",
|
|
4735
5047
|
!isConnected && mode !== "light" /* light */ && initialSelection && "Select Network to Connect",
|
|
4736
|
-
!isConnected && mode !== "light" /* light */ && !initialSelection && /* @__PURE__ */
|
|
5048
|
+
!isConnected && mode !== "light" /* light */ && !initialSelection && /* @__PURE__ */ React61.createElement(Wallet_default, null),
|
|
4737
5049
|
!isConnected && mode !== "light" /* light */ && !initialSelection && "Connect Wallet"
|
|
4738
|
-
), isConnected && !placeholder && /* @__PURE__ */
|
|
4739
|
-
isConnected && !placeholder && balance !== void 0 && decimals !== void 0 ? /* @__PURE__ */
|
|
5050
|
+
), isConnected && !placeholder && /* @__PURE__ */ React61.createElement(CopyButton_default, { text: connectedAddress })),
|
|
5051
|
+
isConnected && !placeholder && balance !== void 0 && decimals !== void 0 ? /* @__PURE__ */ React61.createElement("p", { className: "balance-info" }, formatUSD(bigIntToNumber({ value: balance, decimals })), " ", selectedCoin, " available") : null
|
|
4740
5052
|
);
|
|
4741
5053
|
};
|
|
4742
5054
|
var WalletButton_default = WalletButton;
|
|
4743
5055
|
|
|
4744
5056
|
// src/components/reusable/CoinDropdown.tsx
|
|
4745
|
-
import
|
|
5057
|
+
import React63, { useEffect as useEffect12, useRef, useState as useState8 } from "react";
|
|
4746
5058
|
import { useSelector as useSelector23 } from "react-redux";
|
|
4747
5059
|
import { useDispatch as useDispatch9 } from "react-redux";
|
|
4748
5060
|
|
|
@@ -4750,25 +5062,61 @@ import { useDispatch as useDispatch9 } from "react-redux";
|
|
|
4750
5062
|
import { useEffect as useEffect11, useMemo as useMemo9 } from "react";
|
|
4751
5063
|
import { useSelector as useSelector22 } from "react-redux";
|
|
4752
5064
|
import { useDispatch as useDispatch8 } from "react-redux";
|
|
5065
|
+
var emptyTokenList = { tokenList: [] };
|
|
4753
5066
|
function useCurrencyOptions(isSourceChain) {
|
|
4754
5067
|
const dispatch = useDispatch8();
|
|
4755
5068
|
const mode = useSelector22(selectMode);
|
|
4756
5069
|
const sourceChain = useSelector22(selectSourceChain);
|
|
5070
|
+
const sourceSymbol = useSelector22(selectSourceCurrency);
|
|
4757
5071
|
const targetChain = useSelector22(selectTargetChain);
|
|
4758
|
-
const chain = isSourceChain ? sourceChain : targetChain;
|
|
4759
5072
|
const transactionOption = useSelector22(selectTransactionOption);
|
|
4760
|
-
const networks = useSelector22(selectNetworks);
|
|
4761
5073
|
const output = useMemo9(() => {
|
|
4762
|
-
|
|
4763
|
-
const
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
5074
|
+
const chain = isSourceChain ? sourceChain : targetChain;
|
|
5075
|
+
const location = isSourceChain ? "origin" : "target";
|
|
5076
|
+
if (!chain) {
|
|
5077
|
+
logger_default.debug(`useCurrencyOptions(${location}): no chain selected`, {
|
|
5078
|
+
chain,
|
|
5079
|
+
sourceSymbol
|
|
5080
|
+
});
|
|
5081
|
+
return emptyTokenList;
|
|
5082
|
+
}
|
|
5083
|
+
if (isSourceChain) return { tokenList: chain.supportedTokens };
|
|
5084
|
+
if (!sourceSymbol) {
|
|
5085
|
+
logger_default.debug(`useCurrencyOptions(${location}): no sourceSymbol selected`, {
|
|
5086
|
+
chain,
|
|
5087
|
+
sourceSymbol
|
|
5088
|
+
});
|
|
5089
|
+
return { tokenList: chain.supportedTokens };
|
|
5090
|
+
}
|
|
5091
|
+
const sourceToken = sourceChain.supportedTokens.find(
|
|
5092
|
+
(t) => t.symbol === sourceSymbol
|
|
5093
|
+
);
|
|
5094
|
+
if (!sourceToken) {
|
|
5095
|
+
logger_default.debug(
|
|
5096
|
+
`useCurrencyOptions(${location}): source token ${sourceSymbol ?? "undefined"} not found`,
|
|
5097
|
+
{ sourceChain, sourceSymbol }
|
|
5098
|
+
);
|
|
5099
|
+
return { tokenList: chain.supportedTokens };
|
|
5100
|
+
}
|
|
5101
|
+
const tokenList2 = chain.supportedTokens.filter(
|
|
5102
|
+
(token) => token.peggedTo === sourceToken.peggedTo
|
|
5103
|
+
);
|
|
5104
|
+
logger_default.debug(`useCurrencyOptions(${location}): updated token list `, {
|
|
5105
|
+
tokenList: tokenList2,
|
|
5106
|
+
sourceSymbol,
|
|
5107
|
+
sourceToken,
|
|
5108
|
+
chain
|
|
5109
|
+
});
|
|
5110
|
+
return { tokenList: tokenList2 };
|
|
5111
|
+
}, [sourceChain, sourceSymbol, targetChain, isSourceChain]);
|
|
4767
5112
|
const { tokenList } = output;
|
|
4768
5113
|
useEffect11(() => {
|
|
4769
5114
|
if (!tokenList.length) return;
|
|
4770
5115
|
if (mode === "payment" /* payment */ && !isSourceChain) return;
|
|
4771
5116
|
const [firstToken] = tokenList;
|
|
5117
|
+
logger_default.debug(
|
|
5118
|
+
`useCurrencyOptions: seting default currency to ${firstToken.symbol}`
|
|
5119
|
+
);
|
|
4772
5120
|
if (isSourceChain) {
|
|
4773
5121
|
dispatch(setSourceCurrency(firstToken.symbol));
|
|
4774
5122
|
} else {
|
|
@@ -4779,16 +5127,19 @@ function useCurrencyOptions(isSourceChain) {
|
|
|
4779
5127
|
}
|
|
4780
5128
|
|
|
4781
5129
|
// src/components/reusable/TokenIcon.tsx
|
|
4782
|
-
import
|
|
5130
|
+
import React62 from "react";
|
|
4783
5131
|
var COIN_LIST = {
|
|
5132
|
+
EUR: KEUR_default,
|
|
5133
|
+
EURC: EURC_default,
|
|
5134
|
+
EURK: KEUR_default,
|
|
5135
|
+
HONEY: Honey_default,
|
|
4784
5136
|
KEUR: KEUR_default,
|
|
4785
5137
|
KIMAUSD: USDK_default,
|
|
4786
5138
|
USDC: USDC_default,
|
|
4787
5139
|
USDK: USDK_default,
|
|
4788
|
-
USDT: USDT_default,
|
|
4789
|
-
WBTC: BTC_default,
|
|
4790
5140
|
USD: USD_default,
|
|
4791
|
-
|
|
5141
|
+
USDT: USDT_default,
|
|
5142
|
+
WBTC: BTC_default
|
|
4792
5143
|
};
|
|
4793
5144
|
function TokenIcon({
|
|
4794
5145
|
symbol,
|
|
@@ -4801,7 +5152,7 @@ function TokenIcon({
|
|
|
4801
5152
|
logger_default.warn(`Token icon not found for symbol: ${symbol}`);
|
|
4802
5153
|
return null;
|
|
4803
5154
|
}
|
|
4804
|
-
return /* @__PURE__ */
|
|
5155
|
+
return /* @__PURE__ */ React62.createElement("div", { className: "icon-wrapper" }, /* @__PURE__ */ React62.createElement(Icon, { width, height }));
|
|
4805
5156
|
}
|
|
4806
5157
|
|
|
4807
5158
|
// src/components/reusable/CoinDropdown.tsx
|
|
@@ -4812,10 +5163,24 @@ var CoinDropdown = ({
|
|
|
4812
5163
|
const dispatch = useDispatch9();
|
|
4813
5164
|
const [collapsed, setCollapsed] = useState8(true);
|
|
4814
5165
|
const sourceCurrency = useSelector23(selectSourceCurrency);
|
|
5166
|
+
const mode = useSelector23(selectMode);
|
|
5167
|
+
const dAppOption = useSelector23(selectDappOption);
|
|
5168
|
+
const transactionOption = useSelector23(selectTransactionOption);
|
|
4815
5169
|
const targetCurrency = useSelector23(selectTargetCurrency);
|
|
4816
5170
|
const { tokenList } = useCurrencyOptions(isSourceChain);
|
|
4817
5171
|
const theme = useSelector23(selectTheme);
|
|
4818
5172
|
const tokenSymbol = isSourceChain ? sourceCurrency : targetCurrency;
|
|
5173
|
+
const shouldLockToken = isSourceChain && mode === "payment" /* payment */ && dAppOption !== "none" /* None */ && !!transactionOption?.currency;
|
|
5174
|
+
useEffect12(() => {
|
|
5175
|
+
if (!shouldLockToken) return;
|
|
5176
|
+
const matched = tokenList.find(
|
|
5177
|
+
(token) => token.symbol === transactionOption.currency
|
|
5178
|
+
);
|
|
5179
|
+
if (matched) {
|
|
5180
|
+
dispatch(setSourceCurrency(transactionOption.currency));
|
|
5181
|
+
dispatch(setTargetCurrency(transactionOption.currency));
|
|
5182
|
+
}
|
|
5183
|
+
}, [shouldLockToken, transactionOption?.currency, tokenList]);
|
|
4819
5184
|
useEffect12(() => {
|
|
4820
5185
|
const bodyMouseDowntHandler = (e) => {
|
|
4821
5186
|
if (ref?.current && !ref.current.contains(e.target)) {
|
|
@@ -4834,68 +5199,71 @@ var CoinDropdown = ({
|
|
|
4834
5199
|
dispatch(setTargetCurrency(symbol));
|
|
4835
5200
|
}
|
|
4836
5201
|
};
|
|
4837
|
-
return /* @__PURE__ */
|
|
5202
|
+
return /* @__PURE__ */ React63.createElement(
|
|
4838
5203
|
"div",
|
|
4839
5204
|
{
|
|
4840
|
-
className: `coin-dropdown ${theme.colorMode} ${collapsed ? "collapsed" : "toggled"}`,
|
|
4841
|
-
onClick: () =>
|
|
5205
|
+
className: `coin-dropdown ${theme.colorMode} ${collapsed ? "collapsed" : "toggled"} ${shouldLockToken ? "disabled" : ""}`,
|
|
5206
|
+
onClick: () => {
|
|
5207
|
+
if (!shouldLockToken) setCollapsed((prev) => !prev);
|
|
5208
|
+
},
|
|
4842
5209
|
ref
|
|
4843
5210
|
},
|
|
4844
|
-
/* @__PURE__ */
|
|
4845
|
-
/* @__PURE__ */
|
|
5211
|
+
/* @__PURE__ */ React63.createElement("div", { className: "coin-wrapper" }, /* @__PURE__ */ React63.createElement(TokenIcon, { symbol: tokenSymbol, width: 24, height: 24 }), /* @__PURE__ */ React63.createElement("span", { className: "coin" }, tokenSymbol)),
|
|
5212
|
+
/* @__PURE__ */ React63.createElement(
|
|
4846
5213
|
"div",
|
|
4847
5214
|
{
|
|
4848
5215
|
className: `coin-menu ${theme.colorMode} ${collapsed ? "collapsed" : "toggled"}`
|
|
4849
5216
|
},
|
|
4850
|
-
tokenList.map((token) => /* @__PURE__ */
|
|
5217
|
+
tokenList.map((token) => /* @__PURE__ */ React63.createElement(
|
|
4851
5218
|
"div",
|
|
4852
5219
|
{
|
|
4853
5220
|
className: `coin-item ${theme.colorMode}`,
|
|
4854
5221
|
key: token.symbol,
|
|
4855
5222
|
onClick: () => handleDropdownItemClick(token.symbol)
|
|
4856
5223
|
},
|
|
4857
|
-
/* @__PURE__ */
|
|
4858
|
-
/* @__PURE__ */
|
|
5224
|
+
/* @__PURE__ */ React63.createElement(TokenIcon, { symbol: token.symbol, width: 24, height: 24 }),
|
|
5225
|
+
/* @__PURE__ */ React63.createElement("p", null, token.symbol)
|
|
4859
5226
|
))
|
|
4860
5227
|
),
|
|
4861
|
-
/* @__PURE__ */
|
|
5228
|
+
!shouldLockToken && /* @__PURE__ */ React63.createElement("div", { className: `dropdown-icon ${collapsed ? "toggled" : "collapsed"}` }, /* @__PURE__ */ React63.createElement(Arrow_default, { fill: "none" }))
|
|
4862
5229
|
);
|
|
4863
5230
|
};
|
|
4864
5231
|
var CoinDropdown_default = CoinDropdown;
|
|
4865
5232
|
|
|
4866
5233
|
// src/components/reusable/ConfirmDetails.tsx
|
|
4867
|
-
import
|
|
5234
|
+
import React66, { useEffect as useEffect13, useMemo as useMemo10, useState as useState9 } from "react";
|
|
4868
5235
|
import { useSelector as useSelector25 } from "react-redux";
|
|
4869
5236
|
|
|
4870
5237
|
// src/components/reusable/ChainIcon.tsx
|
|
4871
|
-
import
|
|
5238
|
+
import React64 from "react";
|
|
4872
5239
|
var chainIcons = {
|
|
4873
|
-
|
|
4874
|
-
POL: Polygon_default,
|
|
5240
|
+
ARB: Arbitrum_default,
|
|
4875
5241
|
AVX: Avalanche_default,
|
|
5242
|
+
BANK: Bank_default,
|
|
4876
5243
|
BASE: Base_default,
|
|
5244
|
+
BERA: Bera_default,
|
|
4877
5245
|
BSC: BSC_default,
|
|
4878
5246
|
BTC: BTC_default,
|
|
4879
|
-
|
|
5247
|
+
CC: CreditCard_default,
|
|
5248
|
+
CFX: CFX_default,
|
|
5249
|
+
ETH: Ethereum_default,
|
|
5250
|
+
FIAT: Bank_default,
|
|
5251
|
+
POL: Polygon_default,
|
|
4880
5252
|
OPT: Optimism_default,
|
|
4881
|
-
TRX: Tron_default,
|
|
4882
5253
|
SOL: Solana_default,
|
|
4883
|
-
|
|
4884
|
-
BERA: Bera_default,
|
|
4885
|
-
CFX: CFX_default,
|
|
4886
|
-
CC: CreditCard_default
|
|
5254
|
+
TRX: Tron_default
|
|
4887
5255
|
};
|
|
4888
5256
|
function ChainIcon({ symbol }) {
|
|
4889
5257
|
const Icon = symbol === "FIAT" ? chainIcons["CC"] : chainIcons[symbol];
|
|
4890
5258
|
if (!Icon) {
|
|
4891
|
-
logger_default.warn(`Chain icon not found for symbol: ${symbol}`);
|
|
4892
|
-
return /* @__PURE__ */
|
|
5259
|
+
if (symbol) logger_default.warn(`Chain icon not found for symbol: ${symbol}`);
|
|
5260
|
+
return /* @__PURE__ */ React64.createElement("div", null);
|
|
4893
5261
|
}
|
|
4894
|
-
return /* @__PURE__ */
|
|
5262
|
+
return /* @__PURE__ */ React64.createElement("div", { className: "icon" }, /* @__PURE__ */ React64.createElement(Icon, null));
|
|
4895
5263
|
}
|
|
4896
5264
|
|
|
4897
5265
|
// src/components/reusable/FeeDeductionRadioButtons.tsx
|
|
4898
|
-
import
|
|
5266
|
+
import React65 from "react";
|
|
4899
5267
|
import { useDispatch as useDispatch10, useSelector as useSelector24 } from "react-redux";
|
|
4900
5268
|
var FeeDeductionRadioButtons = ({ disabled }) => {
|
|
4901
5269
|
const dispatch = useDispatch10();
|
|
@@ -4912,7 +5280,7 @@ var FeeDeductionRadioButtons = ({ disabled }) => {
|
|
|
4912
5280
|
const handleChange = (value) => {
|
|
4913
5281
|
dispatch(setFeeDeduct(value));
|
|
4914
5282
|
};
|
|
4915
|
-
return /* @__PURE__ */
|
|
5283
|
+
return /* @__PURE__ */ React65.createElement("div", { className: `fee-deduction-radio-container ${theme.colorMode}` }, /* @__PURE__ */ React65.createElement("div", { className: "fee-options" }, Number(amount) - totalFee > 0 && /* @__PURE__ */ React65.createElement("label", { className: `fee-option ${disabled ? "disabled" : ""}` }, /* @__PURE__ */ React65.createElement(
|
|
4916
5284
|
"input",
|
|
4917
5285
|
{
|
|
4918
5286
|
type: "radio",
|
|
@@ -4921,11 +5289,11 @@ var FeeDeductionRadioButtons = ({ disabled }) => {
|
|
|
4921
5289
|
disabled,
|
|
4922
5290
|
onChange: () => handleChange(true)
|
|
4923
5291
|
}
|
|
4924
|
-
), /* @__PURE__ */
|
|
5292
|
+
), /* @__PURE__ */ React65.createElement("span", { className: `radio-label ${theme.colorMode}` }, `Pay $${formatterFloat.format(
|
|
4925
5293
|
Number(amount)
|
|
4926
5294
|
)} ${sourceCurrency} in ${sourceNetwork.name} to receive $${formatterFloat.format(
|
|
4927
5295
|
Number(amount) - totalFee
|
|
4928
|
-
)} ${targetCurrency} in ${targetNetwork.name}`)), /* @__PURE__ */
|
|
5296
|
+
)} ${targetCurrency} in ${targetNetwork.name}`)), /* @__PURE__ */ React65.createElement("label", { className: `fee-option ${disabled ? "disabled" : ""}` }, /* @__PURE__ */ React65.createElement(
|
|
4929
5297
|
"input",
|
|
4930
5298
|
{
|
|
4931
5299
|
type: "radio",
|
|
@@ -4934,7 +5302,7 @@ var FeeDeductionRadioButtons = ({ disabled }) => {
|
|
|
4934
5302
|
disabled,
|
|
4935
5303
|
onChange: () => handleChange(false)
|
|
4936
5304
|
}
|
|
4937
|
-
), /* @__PURE__ */
|
|
5305
|
+
), /* @__PURE__ */ React65.createElement("span", { className: `radio-label ${theme.colorMode}` }, `Pay $${formatterFloat.format(
|
|
4938
5306
|
Number(amount) + totalFee
|
|
4939
5307
|
)} ${sourceCurrency} in ${sourceNetwork.name} to receive $${formatterFloat.format(
|
|
4940
5308
|
Number(amount)
|
|
@@ -4963,10 +5331,6 @@ var ConfirmDetails = ({
|
|
|
4963
5331
|
const [feeCollapsed, setFeeCollapsed] = useState9(true);
|
|
4964
5332
|
const transactionOption = useSelector25(selectTransactionOption);
|
|
4965
5333
|
const { connectedAddress } = useIsWalletReady4();
|
|
4966
|
-
const originNetworkOption = useMemo10(
|
|
4967
|
-
() => networkOptions3.filter((network) => network.id === originNetwork.id)[0],
|
|
4968
|
-
[networkOptions3, originNetwork]
|
|
4969
|
-
);
|
|
4970
5334
|
const targetNetworkOption = useMemo10(
|
|
4971
5335
|
() => networkOptions3.filter(
|
|
4972
5336
|
(network) => network.shortName === (mode === "payment" /* payment */ ? transactionOption?.targetChain : targetNetwork.shortName)
|
|
@@ -4979,13 +5343,13 @@ var ConfirmDetails = ({
|
|
|
4979
5343
|
useEffect13(() => {
|
|
4980
5344
|
width === 0 && updateWidth(window.innerWidth);
|
|
4981
5345
|
}, []);
|
|
4982
|
-
return /* @__PURE__ */
|
|
5346
|
+
return /* @__PURE__ */ React66.createElement("div", { className: `confirm-details ${theme.colorMode}` }, /* @__PURE__ */ React66.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__ */ React66.createElement("div", null, /* @__PURE__ */ React66.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React66.createElement("span", { className: "label" }, "IBAN:"), /* @__PURE__ */ React66.createElement("span", { className: `kima-card-network-label ${theme.colorMode}` }, /* @__PURE__ */ React66.createElement(ChainIcon, { symbol: originNetwork?.shortName }), "FIAT"), /* @__PURE__ */ React66.createElement("p", null, "ES6621000418401234567891")), /* @__PURE__ */ React66.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React66.createElement("span", { className: "label" }, "Recipient:"), /* @__PURE__ */ React66.createElement("p", null, "Kima Sandbox")), /* @__PURE__ */ React66.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React66.createElement("span", { className: "label" }, "BIC:"), /* @__PURE__ */ React66.createElement("p", null, "CAIXESBBXXX")), /* @__PURE__ */ React66.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React66.createElement("span", { className: "label" }, "Description:"), /* @__PURE__ */ React66.createElement("p", { className: "signature" }, signature))) : /* @__PURE__ */ React66.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React66.createElement("span", { className: "label" }, "Source ", originNetwork.shortName !== "CC" && "wallet", ":"), /* @__PURE__ */ React66.createElement("div", { className: "network-details" }, /* @__PURE__ */ React66.createElement("div", { className: "kima-card-network-container" }, /* @__PURE__ */ React66.createElement("span", { className: `kima-card-network-label ${theme.colorMode}` }, /* @__PURE__ */ React66.createElement(ChainIcon, { symbol: originNetwork?.shortName }), originNetwork.name)), originNetwork.shortName !== "CC" && /* @__PURE__ */ React66.createElement("p", { className: theme.colorMode }, dAppOption === "LPDrain" /* LPDrain */ ? targetAddress : connectedAddress))), /* @__PURE__ */ React66.createElement("div", { className: "detail-item amount" }, /* @__PURE__ */ React66.createElement("span", { className: "amount-container" }, dAppOption === "none" /* None */ && /* @__PURE__ */ React66.createElement("div", { className: "amount-details" }, /* @__PURE__ */ React66.createElement("span", null, "Amount to Transfer "), /* @__PURE__ */ React66.createElement("div", { className: "coin-details" }, /* @__PURE__ */ React66.createElement("p", null, formatBigInt(txValues.allowanceAmount), " ", sourceCurrency))), dAppOption === "none" /* None */ && /* @__PURE__ */ React66.createElement("div", { className: "amount-details" }, /* @__PURE__ */ React66.createElement("span", null, "Total Fees"), /* @__PURE__ */ React66.createElement(
|
|
4983
5347
|
"div",
|
|
4984
5348
|
{
|
|
4985
5349
|
className: "fee-collapse",
|
|
4986
5350
|
onClick: () => setFeeCollapsed(!feeCollapsed)
|
|
4987
5351
|
},
|
|
4988
|
-
/* @__PURE__ */
|
|
5352
|
+
/* @__PURE__ */ React66.createElement(
|
|
4989
5353
|
MiniArrow_default,
|
|
4990
5354
|
{
|
|
4991
5355
|
width: 15,
|
|
@@ -4996,16 +5360,16 @@ var ConfirmDetails = ({
|
|
|
4996
5360
|
}
|
|
4997
5361
|
}
|
|
4998
5362
|
),
|
|
4999
|
-
/* @__PURE__ */
|
|
5000
|
-
)), /* @__PURE__ */
|
|
5363
|
+
/* @__PURE__ */ React66.createElement("span", { className: "service-fee" }, formatBigInt(totalFee), " ", sourceCurrency)
|
|
5364
|
+
)), /* @__PURE__ */ React66.createElement("div", { className: `fee-breakdown ${feeCollapsed ? "collapsed" : ""}` }, /* @__PURE__ */ React66.createElement("div", { className: "amount-details" }, /* @__PURE__ */ React66.createElement("span", null, originNetwork.shortName === "CC" ? "Credit Card Processing Fee" : `Source Network Fee (${originNetwork.shortName})`), /* @__PURE__ */ React66.createElement("span", { className: "service-fee" }, formatBigInt(sourceFee), " ", sourceCurrency)), /* @__PURE__ */ React66.createElement("div", { className: "amount-details" }, /* @__PURE__ */ React66.createElement("span", null, "Target Network Fee (", targetNetwork.shortName, ")"), /* @__PURE__ */ React66.createElement("span", { className: "service-fee" }, formatBigInt(targetFee), " ", targetCurrency)), /* @__PURE__ */ React66.createElement("div", { className: "amount-details" }, /* @__PURE__ */ React66.createElement("span", null, "KIMA Service Fee"), /* @__PURE__ */ React66.createElement("span", { className: "service-fee" }, formatBigInt(kimaFee), " ", sourceCurrency))), /* @__PURE__ */ React66.createElement("div", { className: "amount-details" }, /* @__PURE__ */ React66.createElement("span", null, "Target Transfer Amount"), /* @__PURE__ */ React66.createElement("span", { className: "service-fee" }, formatBigInt(txValues.submitAmount), " ", targetCurrency)))), targetNetwork.shortName === "FIAT" /* FIAT */ ? /* @__PURE__ */ React66.createElement("div", null, /* @__PURE__ */ React66.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React66.createElement("span", { className: "label" }, "IBAN:"), /* @__PURE__ */ React66.createElement("p", null, bankDetails.iban), /* @__PURE__ */ React66.createElement("span", { className: `kima-card-network-label ${theme.colorMode}` }, /* @__PURE__ */ React66.createElement(ChainIcon, { symbol: targetNetworkOption?.shortName }), "FIAT")), /* @__PURE__ */ React66.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React66.createElement("span", { className: "label" }, "Recipient:"), /* @__PURE__ */ React66.createElement("p", null, bankDetails.recipient))) : /* @__PURE__ */ React66.createElement("div", { className: "detail-item" }, /* @__PURE__ */ React66.createElement("span", { className: "label" }, "Target wallet:"), /* @__PURE__ */ React66.createElement("div", { className: "network-details" }, /* @__PURE__ */ React66.createElement("div", { className: "kima-card-network-container" }, /* @__PURE__ */ React66.createElement("span", { className: `kima-card-network-label ${theme.colorMode}` }, /* @__PURE__ */ React66.createElement(ChainIcon, { symbol: targetNetworkOption?.shortName }), targetNetworkOption?.name)), /* @__PURE__ */ React66.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) ? (
|
|
5001
5365
|
// <FeeDeductionSlider />
|
|
5002
|
-
/* @__PURE__ */
|
|
5366
|
+
/* @__PURE__ */ React66.createElement(FeeDeductionRadioButtons_default, { disabled: feeOptionDisabled })
|
|
5003
5367
|
) : null);
|
|
5004
5368
|
};
|
|
5005
5369
|
var ConfirmDetails_default = ConfirmDetails;
|
|
5006
5370
|
|
|
5007
5371
|
// src/components/reusable/AddressInput.tsx
|
|
5008
|
-
import
|
|
5372
|
+
import React67, { useEffect as useEffect14 } from "react";
|
|
5009
5373
|
import { useDispatch as useDispatch11, useSelector as useSelector26 } from "react-redux";
|
|
5010
5374
|
var AddressInput = ({
|
|
5011
5375
|
theme,
|
|
@@ -5044,7 +5408,7 @@ var AddressInput = ({
|
|
|
5044
5408
|
mode,
|
|
5045
5409
|
dispatch
|
|
5046
5410
|
]);
|
|
5047
|
-
return /* @__PURE__ */
|
|
5411
|
+
return /* @__PURE__ */ React67.createElement(
|
|
5048
5412
|
"input",
|
|
5049
5413
|
{
|
|
5050
5414
|
className: `kima-address-input ${theme}`,
|
|
@@ -5059,11 +5423,11 @@ var AddressInput = ({
|
|
|
5059
5423
|
var AddressInput_default = AddressInput;
|
|
5060
5424
|
|
|
5061
5425
|
// src/components/reusable/CustomCheckbox.tsx
|
|
5062
|
-
import
|
|
5426
|
+
import React68 from "react";
|
|
5063
5427
|
import { useSelector as useSelector27 } from "react-redux";
|
|
5064
5428
|
|
|
5065
5429
|
// src/components/reusable/StepBox.tsx
|
|
5066
|
-
import
|
|
5430
|
+
import React69, { useMemo as useMemo11 } from "react";
|
|
5067
5431
|
import { useSelector as useSelector28 } from "react-redux";
|
|
5068
5432
|
var stepInfo2 = [
|
|
5069
5433
|
{
|
|
@@ -5087,6 +5451,7 @@ var StepBox = ({ step, errorStep, loadingStep, data }) => {
|
|
|
5087
5451
|
const explorerUrl = useSelector28(selectKimaExplorer);
|
|
5088
5452
|
const networkOption = useSelector28(selectNetworkOption);
|
|
5089
5453
|
const networks = useSelector28(selectNetworks);
|
|
5454
|
+
const { width: windowWidth } = useWidth_default();
|
|
5090
5455
|
const sourceChain = useMemo11(() => {
|
|
5091
5456
|
const sourceKey = data?.sourceChain === "FIAT" ? "CC" : data?.sourceChain;
|
|
5092
5457
|
return networks.find((network) => network.shortName === sourceKey);
|
|
@@ -5095,61 +5460,60 @@ var StepBox = ({ step, errorStep, loadingStep, data }) => {
|
|
|
5095
5460
|
() => networks.find((network) => network.shortName === data?.targetChain),
|
|
5096
5461
|
[data, networks]
|
|
5097
5462
|
);
|
|
5098
|
-
return /* @__PURE__ */
|
|
5463
|
+
return /* @__PURE__ */ React69.createElement("div", { className: "kima-stepbox" }, /* @__PURE__ */ React69.createElement("div", { className: `content-wrapper ${theme.colorMode}` }, stepInfo2.map((item, index) => /* @__PURE__ */ React69.createElement("div", { key: item.title, className: "step-item" }, /* @__PURE__ */ React69.createElement(
|
|
5099
5464
|
"div",
|
|
5100
5465
|
{
|
|
5101
5466
|
className: `info-item
|
|
5102
5467
|
${step >= index ? index === loadingStep ? "active" : index === errorStep ? "error" : "completed" : ""}
|
|
5103
5468
|
${step < index && "locked"} ${theme.colorMode}`
|
|
5104
5469
|
},
|
|
5105
|
-
step < index && /* @__PURE__ */
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
), index === 0 && data?.kimaTxHash ? /* @__PURE__ */ React67.createElement("div", { className: `info-item ${theme.colorMode}` }, /* @__PURE__ */ React67.createElement("div", { className: "icon" }, /* @__PURE__ */ React67.createElement(USDK_default, { width: 30, height: 30 })), /* @__PURE__ */ React67.createElement("p", { className: "chain-name" }, "Kima TX Hash:"), /* @__PURE__ */ React67.createElement("p", null, /* @__PURE__ */ React67.createElement(
|
|
5470
|
+
/* @__PURE__ */ React69.createElement("div", { className: "info-icon" }, step < index && /* @__PURE__ */ React69.createElement(Lock_default, { width: 24, height: 24 }), step >= index ? index === loadingStep ? /* @__PURE__ */ React69.createElement(Loader_default, { width: 24, height: 24, className: "loader" }) : index === errorStep ? /* @__PURE__ */ React69.createElement(Warning_default, { width: 24, height: 24 }) : /* @__PURE__ */ React69.createElement(Check_default, { width: 24, height: 24 }) : null),
|
|
5471
|
+
/* @__PURE__ */ React69.createElement("p", null, item.title)
|
|
5472
|
+
), index === 0 && data?.kimaTxHash ? /* @__PURE__ */ React69.createElement("div", { className: `info-item ${theme.colorMode}` }, /* @__PURE__ */ React69.createElement("div", { className: "icon" }, /* @__PURE__ */ React69.createElement(USDK_default, { width: 30, height: 30 })), /* @__PURE__ */ React69.createElement("p", { className: "chain-name" }, "Kima TX Hash:"), /* @__PURE__ */ React69.createElement("p", null, /* @__PURE__ */ React69.createElement(
|
|
5109
5473
|
ExternalLink_default,
|
|
5110
5474
|
{
|
|
5111
5475
|
to: `${explorerUrl}/transactions/?tx=${data?.kimaTxHash}`
|
|
5112
5476
|
},
|
|
5113
5477
|
getShortenedAddress(data?.kimaTxHash || "")
|
|
5114
|
-
), /* @__PURE__ */
|
|
5478
|
+
), /* @__PURE__ */ React69.createElement(CopyButton_default, { text: data?.kimaTxHash }))) : null, index === 1 && data?.tssPullHash && sourceChain?.shortName !== "CC" ? /* @__PURE__ */ React69.createElement(
|
|
5115
5479
|
"div",
|
|
5116
5480
|
{
|
|
5117
5481
|
className: `info-item ${theme.colorMode} source-chain ${step >= 3 ? "paid" : ""}`
|
|
5118
5482
|
},
|
|
5119
|
-
/* @__PURE__ */
|
|
5120
|
-
/* @__PURE__ */
|
|
5121
|
-
/* @__PURE__ */
|
|
5483
|
+
/* @__PURE__ */ React69.createElement(ChainIcon, { symbol: data.sourceChain }),
|
|
5484
|
+
/* @__PURE__ */ React69.createElement("p", { className: "chain-name" }, windowWidth >= 770 ? sourceChain?.name : sourceChain?.shortName, " ", "TX Hash:"),
|
|
5485
|
+
/* @__PURE__ */ React69.createElement("p", null, /* @__PURE__ */ React69.createElement(
|
|
5122
5486
|
ExternalLink_default,
|
|
5123
5487
|
{
|
|
5124
5488
|
to: `${sourceChain?.blockExplorers?.default.url}/${data?.sourceChain === "TRX" /* TRON */ ? "#/transaction" : "tx"}/${data?.tssPullHash}${data?.sourceChain === "SOL" /* SOLANA */ && networkOption === "testnet" /* testnet */ ? "?cluster=devnet" : ""}`
|
|
5125
5489
|
},
|
|
5126
5490
|
getShortenedAddress(data?.tssPullHash || "")
|
|
5127
|
-
), /* @__PURE__ */
|
|
5128
|
-
) : null, index === 3 && data?.tssRefundHash ? /* @__PURE__ */
|
|
5491
|
+
), /* @__PURE__ */ React69.createElement(CopyButton_default, { text: data?.tssPullHash || "" }))
|
|
5492
|
+
) : null, index === 3 && data?.tssRefundHash ? /* @__PURE__ */ React69.createElement("div", { className: `info-item ${theme.colorMode} target-chain` }, /* @__PURE__ */ React69.createElement(ChainIcon, { symbol: data.sourceChain }), /* @__PURE__ */ React69.createElement("p", { className: "chain-name" }, windowWidth >= 770 ? sourceChain?.name : sourceChain?.shortName, " ", "TX Hash:"), /* @__PURE__ */ React69.createElement("p", null, /* @__PURE__ */ React69.createElement(
|
|
5129
5493
|
ExternalLink_default,
|
|
5130
5494
|
{
|
|
5131
5495
|
to: `${sourceChain?.blockExplorers?.default.url}/${data?.sourceChain === "TRX" /* TRON */ ? "#/transaction" : "tx"}/${data?.tssRefundHash}${data?.sourceChain === "SOL" /* SOLANA */ && networkOption === "testnet" /* testnet */ ? "?cluster=devnet" : ""}`
|
|
5132
5496
|
},
|
|
5133
5497
|
getShortenedAddress(data?.tssRefundHash || "")
|
|
5134
|
-
), /* @__PURE__ */
|
|
5498
|
+
), /* @__PURE__ */ React69.createElement(CopyButton_default, { text: data?.tssRefundHash || "" }))) : null, index === 3 && data?.tssReleaseHash ? /* @__PURE__ */ React69.createElement("div", { className: `info-item ${theme.colorMode} target-chain` }, /* @__PURE__ */ React69.createElement(ChainIcon, { symbol: data.targetChain }), /* @__PURE__ */ React69.createElement("p", { className: "chain-name" }, windowWidth >= 770 ? targetChain?.name : targetChain?.shortName, " ", "TX Hash:"), /* @__PURE__ */ React69.createElement("p", null, /* @__PURE__ */ React69.createElement(
|
|
5135
5499
|
ExternalLink_default,
|
|
5136
5500
|
{
|
|
5137
5501
|
to: `${targetChain?.blockExplorers?.default.url}/${data?.targetChain === "TRX" /* TRON */ ? "#/transaction" : "tx"}/${data?.tssReleaseHash}${data?.targetChain === "SOL" /* SOLANA */ && networkOption === "testnet" /* testnet */ ? "?cluster=devnet" : ""}`
|
|
5138
5502
|
},
|
|
5139
5503
|
getShortenedAddress(data?.tssReleaseHash || "")
|
|
5140
|
-
), /* @__PURE__ */
|
|
5504
|
+
), /* @__PURE__ */ React69.createElement(CopyButton_default, { text: data?.tssReleaseHash || "" }))) : null))));
|
|
5141
5505
|
};
|
|
5142
5506
|
var StepBox_default = StepBox;
|
|
5143
5507
|
|
|
5144
5508
|
// src/components/reusable/BankInput.tsx
|
|
5145
|
-
import
|
|
5509
|
+
import React70 from "react";
|
|
5146
5510
|
import { useDispatch as useDispatch12 } from "react-redux";
|
|
5147
5511
|
import { useSelector as useSelector29 } from "react-redux";
|
|
5148
5512
|
var BankInput = () => {
|
|
5149
5513
|
const dispatch = useDispatch12();
|
|
5150
5514
|
const theme = useSelector29(selectTheme);
|
|
5151
5515
|
const bankDetails = useSelector29(selectBankDetails);
|
|
5152
|
-
return /* @__PURE__ */
|
|
5516
|
+
return /* @__PURE__ */ React70.createElement("div", { className: "bank-input" }, /* @__PURE__ */ React70.createElement("div", { className: `form-item ${theme.colorMode}` }, /* @__PURE__ */ React70.createElement("span", { className: "label" }, "IBAN:"), /* @__PURE__ */ React70.createElement(
|
|
5153
5517
|
"input",
|
|
5154
5518
|
{
|
|
5155
5519
|
className: "kima-address-input",
|
|
@@ -5157,7 +5521,7 @@ var BankInput = () => {
|
|
|
5157
5521
|
value: bankDetails.iban,
|
|
5158
5522
|
onChange: (e) => dispatch(setBankDetails({ ...bankDetails, iban: e.target.value }))
|
|
5159
5523
|
}
|
|
5160
|
-
)), /* @__PURE__ */
|
|
5524
|
+
)), /* @__PURE__ */ React70.createElement("div", { className: `form-item ${theme.colorMode}` }, /* @__PURE__ */ React70.createElement("span", { className: "label" }, "Recipient:"), /* @__PURE__ */ React70.createElement(
|
|
5161
5525
|
"input",
|
|
5162
5526
|
{
|
|
5163
5527
|
className: "kima-address-input",
|
|
@@ -5172,7 +5536,7 @@ var BankInput = () => {
|
|
|
5172
5536
|
var BankInput_default = BankInput;
|
|
5173
5537
|
|
|
5174
5538
|
// src/components/reusable/TxButton.tsx
|
|
5175
|
-
import
|
|
5539
|
+
import React71 from "react";
|
|
5176
5540
|
import { useDispatch as useDispatch13 } from "react-redux";
|
|
5177
5541
|
import { useSelector as useSelector30 } from "react-redux";
|
|
5178
5542
|
var TxButton = ({ theme }) => {
|
|
@@ -5181,14 +5545,14 @@ var TxButton = ({ theme }) => {
|
|
|
5181
5545
|
dispatch(setPendingTxPopup(true));
|
|
5182
5546
|
};
|
|
5183
5547
|
const txCount = useSelector30(selectPendingTxs);
|
|
5184
|
-
return /* @__PURE__ */
|
|
5548
|
+
return /* @__PURE__ */ React71.createElement(
|
|
5185
5549
|
"button",
|
|
5186
5550
|
{
|
|
5187
5551
|
className: `secondary-button tx-button ${theme.colorMode}`,
|
|
5188
5552
|
onClick: handleClick
|
|
5189
5553
|
},
|
|
5190
5554
|
txCount,
|
|
5191
|
-
/* @__PURE__ */
|
|
5555
|
+
/* @__PURE__ */ React71.createElement(
|
|
5192
5556
|
ring_default,
|
|
5193
5557
|
{
|
|
5194
5558
|
height: 16,
|
|
@@ -5224,43 +5588,25 @@ var emptyStatus = {
|
|
|
5224
5588
|
kimaTxHash: "",
|
|
5225
5589
|
failReason: ""
|
|
5226
5590
|
};
|
|
5227
|
-
var
|
|
5228
|
-
if (
|
|
5229
|
-
const data2 = response.data.liquidity_transaction_data;
|
|
5230
|
-
if (!data2) return emptyStatus;
|
|
5231
|
-
return {
|
|
5232
|
-
status: data2.txstatus,
|
|
5233
|
-
sourceChain: data2.chain,
|
|
5234
|
-
targetChain: data2.chain,
|
|
5235
|
-
tssPullHash: data2.releasehash,
|
|
5236
|
-
tssReleaseHash: data2.releasehash,
|
|
5237
|
-
tssRefundHash: data2.refundhash,
|
|
5238
|
-
failReason: data2.failreason,
|
|
5239
|
-
amount: data2.amount,
|
|
5240
|
-
sourceSymbol: data2.symbol,
|
|
5241
|
-
targetSymbol: data2.symbol,
|
|
5242
|
-
kimaTxHash: data2.kimahash
|
|
5243
|
-
};
|
|
5244
|
-
}
|
|
5245
|
-
const data = response.data.transaction_data;
|
|
5246
|
-
if (!data) return emptyStatus;
|
|
5591
|
+
var parseTxData = (raw) => {
|
|
5592
|
+
if (!raw) return emptyStatus;
|
|
5247
5593
|
return {
|
|
5248
|
-
status:
|
|
5249
|
-
sourceChain:
|
|
5250
|
-
targetChain:
|
|
5251
|
-
tssPullHash:
|
|
5252
|
-
tssReleaseHash:
|
|
5253
|
-
tssRefundHash:
|
|
5254
|
-
failReason:
|
|
5255
|
-
amount:
|
|
5256
|
-
sourceSymbol:
|
|
5257
|
-
targetSymbol:
|
|
5258
|
-
kimaTxHash:
|
|
5594
|
+
status: raw.txstatus,
|
|
5595
|
+
sourceChain: raw.originchain,
|
|
5596
|
+
targetChain: raw.targetchain,
|
|
5597
|
+
tssPullHash: raw.pullhash,
|
|
5598
|
+
tssReleaseHash: raw.releasehash,
|
|
5599
|
+
tssRefundHash: raw.refundhash,
|
|
5600
|
+
failReason: raw.failreason,
|
|
5601
|
+
amount: raw.amount,
|
|
5602
|
+
sourceSymbol: raw.originsymbol,
|
|
5603
|
+
targetSymbol: raw.targetsymbol,
|
|
5604
|
+
kimaTxHash: raw.kimahash
|
|
5259
5605
|
};
|
|
5260
5606
|
};
|
|
5261
5607
|
var isFinished = (data) => {
|
|
5262
5608
|
if (!data) return false;
|
|
5263
|
-
return
|
|
5609
|
+
return [
|
|
5264
5610
|
"Completed" /* COMPLETED */,
|
|
5265
5611
|
"FailedToPull" /* FAILEDTOPULL */,
|
|
5266
5612
|
"FailedToPay" /* FAILEDTOPAY */,
|
|
@@ -5282,11 +5628,11 @@ var getTxData = async ({
|
|
|
5282
5628
|
`${backendUrl}/${path}/${txId}/status`
|
|
5283
5629
|
);
|
|
5284
5630
|
if (typeof response === "string") throw new Error(response);
|
|
5285
|
-
const
|
|
5286
|
-
|
|
5287
|
-
);
|
|
5288
|
-
refPollForUpdates.current = !isFinished(
|
|
5289
|
-
return
|
|
5631
|
+
const res = response;
|
|
5632
|
+
const raw = isLP ? res.data.liquidity_transaction_data : res.data.transaction_data;
|
|
5633
|
+
const parsed = parseTxData(raw);
|
|
5634
|
+
refPollForUpdates.current = !isFinished(parsed);
|
|
5635
|
+
return parsed;
|
|
5290
5636
|
} catch (error) {
|
|
5291
5637
|
logger_default.error(`Error fetching transaction ${txId} data:`, error);
|
|
5292
5638
|
throw new Error(
|
|
@@ -5315,17 +5661,17 @@ var useGetTxData = (txId, dAppOption, backendUrl) => {
|
|
|
5315
5661
|
var useGetTxData_default = useGetTxData;
|
|
5316
5662
|
|
|
5317
5663
|
// src/components/reusable/TransactionStatusMessage.tsx
|
|
5318
|
-
import
|
|
5664
|
+
import React72 from "react";
|
|
5319
5665
|
var TransactionStatusMessage = ({
|
|
5320
5666
|
isCompleted,
|
|
5321
5667
|
transactionId
|
|
5322
5668
|
}) => {
|
|
5323
|
-
return /* @__PURE__ */
|
|
5669
|
+
return /* @__PURE__ */ React72.createElement("div", { className: "transaction-status-message" }, /* @__PURE__ */ React72.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__ */ React72.createElement("span", { className: "transaction-copy" }, /* @__PURE__ */ React72.createElement("h3", null, transactionId), /* @__PURE__ */ React72.createElement(CopyButton_default, { text: transactionId })));
|
|
5324
5670
|
};
|
|
5325
5671
|
var TransactionStatusMessage_default = TransactionStatusMessage;
|
|
5326
5672
|
|
|
5327
5673
|
// src/components/reusable/TransactionSearch.tsx
|
|
5328
|
-
import
|
|
5674
|
+
import React73, { useRef as useRef3, useState as useState10 } from "react";
|
|
5329
5675
|
import { useSelector as useSelector31 } from "react-redux";
|
|
5330
5676
|
import { useDispatch as useDispatch14 } from "react-redux";
|
|
5331
5677
|
import toast2 from "react-hot-toast";
|
|
@@ -5338,7 +5684,7 @@ var TransactionSearch = () => {
|
|
|
5338
5684
|
const handleSearch = async () => {
|
|
5339
5685
|
if (transactionId.length <= 0)
|
|
5340
5686
|
return toast2.error("You must provide a valid transaction id", {
|
|
5341
|
-
icon: /* @__PURE__ */
|
|
5687
|
+
icon: /* @__PURE__ */ React73.createElement(Error_default, null)
|
|
5342
5688
|
});
|
|
5343
5689
|
try {
|
|
5344
5690
|
const data = await getTxData({
|
|
@@ -5355,11 +5701,11 @@ var TransactionSearch = () => {
|
|
|
5355
5701
|
logger_default.error("Error searching transaction: ", error);
|
|
5356
5702
|
return toast2.error(
|
|
5357
5703
|
"Transaction not found. Please check for the proper transaction id.",
|
|
5358
|
-
{ icon: /* @__PURE__ */
|
|
5704
|
+
{ icon: /* @__PURE__ */ React73.createElement(Error_default, null) }
|
|
5359
5705
|
);
|
|
5360
5706
|
}
|
|
5361
5707
|
};
|
|
5362
|
-
return /* @__PURE__ */
|
|
5708
|
+
return /* @__PURE__ */ React73.createElement("div", { className: "form-item transaction-search" }, /* @__PURE__ */ React73.createElement("div", { className: "transaction-input" }, /* @__PURE__ */ React73.createElement("span", { className: "label" }, "Search Transaction:"), /* @__PURE__ */ React73.createElement(
|
|
5363
5709
|
"input",
|
|
5364
5710
|
{
|
|
5365
5711
|
className: `${theme.colorMode}`,
|
|
@@ -5369,7 +5715,7 @@ var TransactionSearch = () => {
|
|
|
5369
5715
|
onChange: (e) => setTransactionId(e.target.value),
|
|
5370
5716
|
spellCheck: false
|
|
5371
5717
|
}
|
|
5372
|
-
)), /* @__PURE__ */
|
|
5718
|
+
)), /* @__PURE__ */ React73.createElement(SecondaryButton_default, { clickHandler: handleSearch }, "Search"));
|
|
5373
5719
|
};
|
|
5374
5720
|
var TransactionSearch_default = TransactionSearch;
|
|
5375
5721
|
|
|
@@ -5381,7 +5727,9 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5381
5727
|
const [errorMessage, setErrorMessage] = useState11("");
|
|
5382
5728
|
const [loadingStep, setLoadingStep] = useState11(-1);
|
|
5383
5729
|
const [minimized, setMinimized] = useState11(false);
|
|
5730
|
+
const [isComplete, setIsComplete] = useState11(false);
|
|
5384
5731
|
const dispatch = useDispatch15();
|
|
5732
|
+
const explorerUrl = useSelector32(selectKimaExplorer);
|
|
5385
5733
|
const mode = useSelector32(selectMode);
|
|
5386
5734
|
const feeDeduct = useSelector32(selectFeeDeduct);
|
|
5387
5735
|
const amount = useSelector32(selectAmount);
|
|
@@ -5398,6 +5746,10 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5398
5746
|
const { successHandler, closeHandler } = useKimaContext();
|
|
5399
5747
|
const backendUrl = useSelector32(selectBackendUrl);
|
|
5400
5748
|
const { data, error } = useGetTxData_default(txId, dAppOption, backendUrl);
|
|
5749
|
+
const { width: windowWidth, updateWidth } = useWidth_default();
|
|
5750
|
+
useEffect15(() => {
|
|
5751
|
+
windowWidth === 0 && updateWidth(window.innerWidth);
|
|
5752
|
+
}, []);
|
|
5401
5753
|
const transactionSourceChain = useMemo12(
|
|
5402
5754
|
() => networks.find(
|
|
5403
5755
|
(network) => network.shortName === (mode === "status" /* status */ ? data?.sourceChain === "FIAT" ? "CC" : data?.sourceChain : sourceChain.shortName)
|
|
@@ -5424,12 +5776,18 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5424
5776
|
txId
|
|
5425
5777
|
});
|
|
5426
5778
|
}, [data]);
|
|
5779
|
+
useEffect15(() => {
|
|
5780
|
+
if (!data) return;
|
|
5781
|
+
if (data.status === "Completed" /* COMPLETED */) {
|
|
5782
|
+
setIsComplete(true);
|
|
5783
|
+
}
|
|
5784
|
+
}, [data, setIsComplete]);
|
|
5427
5785
|
useEffect15(() => {
|
|
5428
5786
|
if (error)
|
|
5429
5787
|
toast3.error(
|
|
5430
5788
|
"The provided transaction id is not valid, please use a different one or contact support for further assistance",
|
|
5431
5789
|
{
|
|
5432
|
-
icon: /* @__PURE__ */
|
|
5790
|
+
icon: /* @__PURE__ */ React74.createElement(Error_default, null)
|
|
5433
5791
|
}
|
|
5434
5792
|
);
|
|
5435
5793
|
}, [error]);
|
|
@@ -5453,7 +5811,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5453
5811
|
setErrorStep(1);
|
|
5454
5812
|
setLoadingStep(-1);
|
|
5455
5813
|
logger_default.error("transaction failed:", data.failReason);
|
|
5456
|
-
toast3.error("Unavailable", { icon: /* @__PURE__ */
|
|
5814
|
+
toast3.error("Unavailable", { icon: /* @__PURE__ */ React74.createElement(Error_default, null) });
|
|
5457
5815
|
setErrorMessage("Unavailable");
|
|
5458
5816
|
} else if (status === "Paid" /* PAID */) {
|
|
5459
5817
|
setStep(3);
|
|
@@ -5464,7 +5822,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5464
5822
|
toast3.error(
|
|
5465
5823
|
"Failed to release tokens to target! Starting refund process.",
|
|
5466
5824
|
{
|
|
5467
|
-
icon: /* @__PURE__ */
|
|
5825
|
+
icon: /* @__PURE__ */ React74.createElement(Error_default, null)
|
|
5468
5826
|
}
|
|
5469
5827
|
);
|
|
5470
5828
|
setErrorMessage(
|
|
@@ -5475,7 +5833,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5475
5833
|
setErrorStep(3);
|
|
5476
5834
|
setLoadingStep(-1);
|
|
5477
5835
|
toast3.error("Failed to refund tokens to source!", {
|
|
5478
|
-
icon: /* @__PURE__ */
|
|
5836
|
+
icon: /* @__PURE__ */ React74.createElement(Error_default, null)
|
|
5479
5837
|
});
|
|
5480
5838
|
setErrorMessage("Failed to refund tokens to source!");
|
|
5481
5839
|
} else if (status === "RefundCompleted" /* REFUNDCOMPLETED */) {
|
|
@@ -5483,7 +5841,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5483
5841
|
setErrorStep(3);
|
|
5484
5842
|
setLoadingStep(-1);
|
|
5485
5843
|
toast3.success("Refund completed!", {
|
|
5486
|
-
icon: /* @__PURE__ */
|
|
5844
|
+
icon: /* @__PURE__ */ React74.createElement(Error_default, null)
|
|
5487
5845
|
});
|
|
5488
5846
|
setErrorMessage("Refund completed!");
|
|
5489
5847
|
} else if (status === "FailedToPay" /* FAILEDTOPAY */) {
|
|
@@ -5492,7 +5850,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5492
5850
|
setLoadingStep(-1);
|
|
5493
5851
|
logger_default.error("transaction failed:", data.failReason);
|
|
5494
5852
|
toast3.error("Failed to release tokens to target!", {
|
|
5495
|
-
icon: /* @__PURE__ */
|
|
5853
|
+
icon: /* @__PURE__ */ React74.createElement(Error_default, null)
|
|
5496
5854
|
});
|
|
5497
5855
|
setErrorMessage("Failed to release tokens to target!");
|
|
5498
5856
|
} else if (status === "FailedToPull" /* FAILEDTOPULL */) {
|
|
@@ -5500,7 +5858,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5500
5858
|
setErrorStep(1);
|
|
5501
5859
|
setLoadingStep(-1);
|
|
5502
5860
|
logger_default.error("transaction failed:", data.failReason);
|
|
5503
|
-
toast3.error("Failed to pull tokens from source!", { icon: /* @__PURE__ */
|
|
5861
|
+
toast3.error("Failed to pull tokens from source!", { icon: /* @__PURE__ */ React74.createElement(Error_default, null) });
|
|
5504
5862
|
setErrorMessage("Failed to pull tokens from source!");
|
|
5505
5863
|
} else if (status === "Completed" /* COMPLETED */) {
|
|
5506
5864
|
setStep(4);
|
|
@@ -5513,7 +5871,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5513
5871
|
}
|
|
5514
5872
|
}, [data?.status]);
|
|
5515
5873
|
const resetForm = () => {
|
|
5516
|
-
|
|
5874
|
+
setIsComplete(false);
|
|
5517
5875
|
dispatch(resetServiceFee());
|
|
5518
5876
|
if (mode === "light" /* light */) {
|
|
5519
5877
|
dispatch(setMode("light" /* light */));
|
|
@@ -5555,41 +5913,76 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5555
5913
|
dispatch(
|
|
5556
5914
|
setMode(transactionOption ? "payment" /* payment */ : "bridge" /* bridge */)
|
|
5557
5915
|
);
|
|
5558
|
-
dispatch(setAmount(""));
|
|
5916
|
+
dispatch(setAmount(transactionOption?.amount.toString() || ""));
|
|
5559
5917
|
dispatch(setCCTransactionId(""));
|
|
5560
5918
|
dispatch(setCCTransactionStatus("idle"));
|
|
5561
5919
|
dispatch(setTxId(-1));
|
|
5562
5920
|
dispatch(setSubmitted(false));
|
|
5563
5921
|
};
|
|
5564
|
-
return /* @__PURE__ */
|
|
5922
|
+
return /* @__PURE__ */ React74.createElement(Provider2, { store }, /* @__PURE__ */ React74.createElement(
|
|
5565
5923
|
"div",
|
|
5566
5924
|
{
|
|
5567
|
-
className: `kima-card transaction-card ${theme.colorMode} ${minimized ? "minimized" : ""}`,
|
|
5925
|
+
className: `kima-card transaction-card ${isComplete ? "transaction-complete" : ""} ${theme.colorMode} ${minimized ? "minimized" : ""}`,
|
|
5568
5926
|
style: {
|
|
5569
5927
|
background: theme.colorMode === "light" /* light */ ? theme.backgroundColorLight : theme.backgroundColorDark
|
|
5570
5928
|
}
|
|
5571
5929
|
},
|
|
5572
|
-
/* @__PURE__ */
|
|
5930
|
+
/* @__PURE__ */ React74.createElement("div", { className: "kima-card-header" }, /* @__PURE__ */ React74.createElement("div", { className: "topbar" }, !isComplete && /* @__PURE__ */ React74.createElement("div", { className: "title" }, isValidTxId && !error ? /* @__PURE__ */ React74.createElement("div", { className: "transaction-title" }, mode !== "status" /* status */ ? data?.status === "Completed" /* COMPLETED */ ? "Transferred " : "Transfering " : isEmptyStatus ? "Fetching transaction status " : data?.status === "Completed" /* COMPLETED */ ? "Transferred " : "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}`, 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__ */ React74.createElement("div", null, /* @__PURE__ */ React74.createElement("h3", { className: "transaction" }, "Transaction Status"))), !minimized ? /* @__PURE__ */ React74.createElement(
|
|
5931
|
+
"div",
|
|
5932
|
+
{
|
|
5933
|
+
className: `control-buttons ${isComplete ? "complete" : ""}`
|
|
5934
|
+
},
|
|
5935
|
+
isComplete && /* @__PURE__ */ React74.createElement(
|
|
5936
|
+
"button",
|
|
5937
|
+
{
|
|
5938
|
+
className: "menu-button",
|
|
5939
|
+
style: { marginRight: "auto" },
|
|
5940
|
+
onClick: () => {
|
|
5941
|
+
setIsComplete(false);
|
|
5942
|
+
}
|
|
5943
|
+
},
|
|
5944
|
+
"< Back"
|
|
5945
|
+
),
|
|
5946
|
+
/* @__PURE__ */ React74.createElement(
|
|
5947
|
+
"button",
|
|
5948
|
+
{
|
|
5949
|
+
className: "icon-button minimize",
|
|
5950
|
+
onClick: () => {
|
|
5951
|
+
setMinimized(true);
|
|
5952
|
+
}
|
|
5953
|
+
},
|
|
5954
|
+
/* @__PURE__ */ React74.createElement(Minimize_default, null)
|
|
5955
|
+
),
|
|
5956
|
+
!isValidTxId || loadingStep < 0 || error && dAppOption !== "none" /* None */ ? /* @__PURE__ */ React74.createElement("button", { className: "reset-button", onClick: resetForm }, "Reset") : null,
|
|
5957
|
+
closeHandler && /* @__PURE__ */ React74.createElement(
|
|
5958
|
+
"button",
|
|
5959
|
+
{
|
|
5960
|
+
className: "cross-icon-button",
|
|
5961
|
+
onClick: () => {
|
|
5962
|
+
resetForm();
|
|
5963
|
+
closeHandler(0);
|
|
5964
|
+
}
|
|
5965
|
+
},
|
|
5966
|
+
/* @__PURE__ */ React74.createElement(Cross_default, null)
|
|
5967
|
+
)
|
|
5968
|
+
) : /* @__PURE__ */ React74.createElement("div", { className: "control-buttons" }, /* @__PURE__ */ React74.createElement("div", { className: "maximize", onClick: () => setMinimized(false) }, "View"))), data && !isComplete && /* @__PURE__ */ React74.createElement("div", { className: "header-network-labels" }, /* @__PURE__ */ React74.createElement("div", { className: `kima-card-network-label ${theme.colorMode}` }, /* @__PURE__ */ React74.createElement(
|
|
5573
5969
|
ChainIcon,
|
|
5574
5970
|
{
|
|
5575
5971
|
symbol: transactionSourceChain?.shortName
|
|
5576
5972
|
}
|
|
5577
|
-
)
|
|
5973
|
+
), windowWidth > 450 && /* @__PURE__ */ React74.createElement("h3", null, transactionSourceChain?.name)), /* @__PURE__ */ React74.createElement(
|
|
5974
|
+
"div",
|
|
5975
|
+
{
|
|
5976
|
+
style: { display: "inline-block", transform: "rotate(-90deg)" }
|
|
5977
|
+
},
|
|
5978
|
+
/* @__PURE__ */ React74.createElement(Arrow_default, { width: 25, height: 25 })
|
|
5979
|
+
), /* @__PURE__ */ React74.createElement("div", { className: `kima-card-network-label ${theme.colorMode}` }, /* @__PURE__ */ React74.createElement(
|
|
5578
5980
|
ChainIcon,
|
|
5579
5981
|
{
|
|
5580
5982
|
symbol: transactionTargetChain?.shortName
|
|
5581
5983
|
}
|
|
5582
|
-
)
|
|
5583
|
-
|
|
5584
|
-
{
|
|
5585
|
-
className: "icon-button minimize",
|
|
5586
|
-
onClick: () => {
|
|
5587
|
-
setMinimized(true);
|
|
5588
|
-
}
|
|
5589
|
-
},
|
|
5590
|
-
/* @__PURE__ */ React72.createElement(Minimize_default, null)
|
|
5591
|
-
), !isValidTxId || loadingStep < 0 || error ? /* @__PURE__ */ React72.createElement("button", { className: "reset-button", onClick: resetForm }, "Reset") : null) : /* @__PURE__ */ React72.createElement("div", { className: "control-buttons" }, /* @__PURE__ */ React72.createElement("div", { className: "maximize", onClick: () => setMinimized(false) }, "View")))),
|
|
5592
|
-
isValidTxId && !error ? /* @__PURE__ */ React72.createElement("div", { className: "kima-card-content" }, /* @__PURE__ */ React72.createElement("div", { className: "transaction-content" }, /* @__PURE__ */ React72.createElement(
|
|
5984
|
+
), windowWidth > 450 && /* @__PURE__ */ React74.createElement("h3", null, transactionTargetChain?.name)))),
|
|
5985
|
+
isValidTxId && !error ? /* @__PURE__ */ React74.createElement("div", { className: "kima-card-content" }, !isComplete ? /* @__PURE__ */ React74.createElement("div", { className: "transaction-content" }, /* @__PURE__ */ React74.createElement(
|
|
5593
5986
|
Progressbar_default,
|
|
5594
5987
|
{
|
|
5595
5988
|
step,
|
|
@@ -5598,7 +5991,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5598
5991
|
setFocus,
|
|
5599
5992
|
loadingStep
|
|
5600
5993
|
}
|
|
5601
|
-
), /* @__PURE__ */
|
|
5994
|
+
), /* @__PURE__ */ React74.createElement(
|
|
5602
5995
|
StepBox_default,
|
|
5603
5996
|
{
|
|
5604
5997
|
step,
|
|
@@ -5606,14 +5999,67 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5606
5999
|
loadingStep,
|
|
5607
6000
|
data
|
|
5608
6001
|
}
|
|
5609
|
-
)),
|
|
6002
|
+
)) : /* @__PURE__ */ React74.createElement("div", { className: "transaction-content transaction-complete" }, /* @__PURE__ */ React74.createElement(TransactionComplete_default, null), /* @__PURE__ */ React74.createElement("h2", null, "Transaction Complete"), /* @__PURE__ */ React74.createElement("div", { className: "kima-stepbox" }, /* @__PURE__ */ React74.createElement(
|
|
6003
|
+
"div",
|
|
6004
|
+
{
|
|
6005
|
+
className: `content-wrapper transaction-complete ${theme.colorMode}`
|
|
6006
|
+
},
|
|
6007
|
+
/* @__PURE__ */ React74.createElement("p", null, "You just transferred ", data?.amount, " ", data?.sourceSymbol),
|
|
6008
|
+
/* @__PURE__ */ React74.createElement("div", { className: "header-network-labels" }, /* @__PURE__ */ React74.createElement(
|
|
6009
|
+
"div",
|
|
6010
|
+
{
|
|
6011
|
+
className: `kima-card-network-label ${theme.colorMode}`
|
|
6012
|
+
},
|
|
6013
|
+
/* @__PURE__ */ React74.createElement(
|
|
6014
|
+
ChainIcon,
|
|
6015
|
+
{
|
|
6016
|
+
symbol: transactionSourceChain?.shortName
|
|
6017
|
+
}
|
|
6018
|
+
),
|
|
6019
|
+
windowWidth > 450 && /* @__PURE__ */ React74.createElement("h3", null, transactionSourceChain?.name)
|
|
6020
|
+
), /* @__PURE__ */ React74.createElement(
|
|
6021
|
+
"div",
|
|
6022
|
+
{
|
|
6023
|
+
style: {
|
|
6024
|
+
display: "inline-block",
|
|
6025
|
+
transform: "rotate(-90deg)"
|
|
6026
|
+
}
|
|
6027
|
+
},
|
|
6028
|
+
/* @__PURE__ */ React74.createElement(Arrow_default, { width: 25, height: 25 })
|
|
6029
|
+
), /* @__PURE__ */ React74.createElement(
|
|
6030
|
+
"div",
|
|
6031
|
+
{
|
|
6032
|
+
className: `kima-card-network-label ${theme.colorMode}`
|
|
6033
|
+
},
|
|
6034
|
+
/* @__PURE__ */ React74.createElement(
|
|
6035
|
+
ChainIcon,
|
|
6036
|
+
{
|
|
6037
|
+
symbol: transactionTargetChain?.shortName
|
|
6038
|
+
}
|
|
6039
|
+
),
|
|
6040
|
+
windowWidth > 450 && /* @__PURE__ */ React74.createElement("h3", null, transactionTargetChain?.name)
|
|
6041
|
+
))
|
|
6042
|
+
)), /* @__PURE__ */ React74.createElement("div", { className: "transaction-buttons" }, /* @__PURE__ */ React74.createElement(
|
|
6043
|
+
SecondaryButton_default,
|
|
6044
|
+
{
|
|
6045
|
+
clickHandler: resetForm,
|
|
6046
|
+
theme: theme.colorMode
|
|
6047
|
+
},
|
|
6048
|
+
"New Transaction"
|
|
6049
|
+
), /* @__PURE__ */ React74.createElement(
|
|
6050
|
+
ExternalLink_default,
|
|
6051
|
+
{
|
|
6052
|
+
to: `${explorerUrl}/transactions/?tx=${data?.kimaTxHash}`
|
|
6053
|
+
},
|
|
6054
|
+
/* @__PURE__ */ React74.createElement(PrimaryButton_default, null, "View Details")
|
|
6055
|
+
))), !error && !isEmptyStatus && !isComplete && /* @__PURE__ */ React74.createElement(
|
|
5610
6056
|
TransactionStatusMessage_default,
|
|
5611
6057
|
{
|
|
5612
6058
|
isCompleted: data?.status,
|
|
5613
6059
|
transactionId: txId.toString()
|
|
5614
6060
|
}
|
|
5615
|
-
)) : /* @__PURE__ */
|
|
5616
|
-
/* @__PURE__ */
|
|
6061
|
+
)) : /* @__PURE__ */ React74.createElement("div", { className: "kima-card-content" }, /* @__PURE__ */ React74.createElement("h4", { className: "subtitle" }, "You can follow the status of a previous submitted transaction by entering the provided transaction id"), /* @__PURE__ */ React74.createElement("div", { className: "single-form" }, /* @__PURE__ */ React74.createElement(TransactionSearch_default, null))),
|
|
6062
|
+
/* @__PURE__ */ React74.createElement(
|
|
5617
6063
|
Toaster,
|
|
5618
6064
|
{
|
|
5619
6065
|
position: "top-right",
|
|
@@ -5640,21 +6086,27 @@ var TransactionWidget = ({ theme }) => {
|
|
|
5640
6086
|
}
|
|
5641
6087
|
}
|
|
5642
6088
|
),
|
|
5643
|
-
/* @__PURE__ */
|
|
6089
|
+
/* @__PURE__ */ React74.createElement(
|
|
6090
|
+
"div",
|
|
6091
|
+
{
|
|
6092
|
+
className: `floating-footer ${isComplete ? "complete" : "status"}`
|
|
6093
|
+
},
|
|
6094
|
+
/* @__PURE__ */ React74.createElement("div", { className: `items ${theme.colorMode}` }, /* @__PURE__ */ React74.createElement("span", null, "Powered by"), /* @__PURE__ */ React74.createElement(KimaNetwork_default, null))
|
|
6095
|
+
)
|
|
5644
6096
|
));
|
|
5645
6097
|
};
|
|
5646
6098
|
|
|
5647
6099
|
// src/components/TransferWidget.tsx
|
|
5648
|
-
import
|
|
6100
|
+
import React85, { useEffect as useEffect21, useState as useState15, useRef as useRef8, useMemo as useMemo21, useCallback as useCallback3 } from "react";
|
|
5649
6101
|
import { useDispatch as useDispatch26, useSelector as useSelector45 } from "react-redux";
|
|
5650
6102
|
|
|
5651
6103
|
// src/components/reusable/SingleForm.tsx
|
|
5652
|
-
import
|
|
6104
|
+
import React76, { useEffect as useEffect17, useMemo as useMemo14, useState as useState13 } from "react";
|
|
5653
6105
|
import { toast as toast4 } from "react-hot-toast";
|
|
5654
6106
|
import { useDispatch as useDispatch17, useSelector as useSelector35 } from "react-redux";
|
|
5655
6107
|
|
|
5656
6108
|
// src/components/primary/NetworkSelector.tsx
|
|
5657
|
-
import
|
|
6109
|
+
import React75, { useState as useState12, useMemo as useMemo13, useRef as useRef4, useEffect as useEffect16 } from "react";
|
|
5658
6110
|
import { useSelector as useSelector33, useDispatch as useDispatch16 } from "react-redux";
|
|
5659
6111
|
var NetworkSelector = ({
|
|
5660
6112
|
type,
|
|
@@ -5666,19 +6118,43 @@ var NetworkSelector = ({
|
|
|
5666
6118
|
const dispatch = useDispatch16();
|
|
5667
6119
|
const theme = useSelector33(selectTheme);
|
|
5668
6120
|
const networkOptions3 = useSelector33(selectNetworks);
|
|
6121
|
+
const transactionOption = useSelector33(selectTransactionOption);
|
|
6122
|
+
const dAppOption = useSelector33(selectDappOption);
|
|
5669
6123
|
const mode = useSelector33(selectMode);
|
|
5670
6124
|
const sourceNetwork = useSelector33(selectSourceChain);
|
|
6125
|
+
const sourceSymbol = useSelector33(selectSourceCurrency);
|
|
5671
6126
|
const targetNetwork = useSelector33(selectTargetChain);
|
|
5672
6127
|
const { switchChainHandler } = useKimaContext();
|
|
5673
6128
|
const isOriginSelector = type === "origin";
|
|
5674
6129
|
const networks = useMemo13(() => {
|
|
5675
6130
|
return networkOptions3.filter((network) => {
|
|
6131
|
+
if (dAppOption !== "none" /* None */ && network.shortName === "CC")
|
|
6132
|
+
return false;
|
|
5676
6133
|
const isSameAsSource = isOriginSelector ? false : network.shortName === sourceNetwork.shortName;
|
|
5677
6134
|
const isAllowedInLightMode = mode !== "light" /* light */ || lightDemoNetworks.includes(network.shortName);
|
|
5678
|
-
|
|
6135
|
+
const sourceToken = sourceNetwork.supportedTokens.find(
|
|
6136
|
+
(t) => t.symbol === sourceSymbol
|
|
6137
|
+
);
|
|
6138
|
+
let supportsSourceCurrency = true;
|
|
6139
|
+
if (!isOriginSelector && !!sourceToken) {
|
|
6140
|
+
supportsSourceCurrency = network.supportedTokens.some(
|
|
6141
|
+
(token) => token.peggedTo === sourceToken?.peggedTo
|
|
6142
|
+
);
|
|
6143
|
+
}
|
|
6144
|
+
return network.supportedLocations.includes(type) && !isSameAsSource && supportsSourceCurrency && isAllowedInLightMode;
|
|
5679
6145
|
});
|
|
5680
|
-
}, [networkOptions3, sourceNetwork, type, mode]);
|
|
6146
|
+
}, [networkOptions3, sourceNetwork, sourceSymbol, type, mode, dAppOption]);
|
|
6147
|
+
const shouldLockSourceNetwork = isOriginSelector && mode === "payment" /* payment */ && dAppOption !== "none" /* None */ && !!transactionOption?.targetChain;
|
|
5681
6148
|
const selectedNetwork = useMemo13(() => {
|
|
6149
|
+
if (shouldLockSourceNetwork) {
|
|
6150
|
+
const forcedNetwork = networks.find(
|
|
6151
|
+
(n) => n.shortName === transactionOption.targetChain
|
|
6152
|
+
);
|
|
6153
|
+
return forcedNetwork || {
|
|
6154
|
+
shortName: "",
|
|
6155
|
+
name: "Invalid Source Network"
|
|
6156
|
+
};
|
|
6157
|
+
}
|
|
5682
6158
|
if (initialSelection) {
|
|
5683
6159
|
return {
|
|
5684
6160
|
shortName: "",
|
|
@@ -5695,7 +6171,32 @@ var NetworkSelector = ({
|
|
|
5695
6171
|
sourceNetwork,
|
|
5696
6172
|
targetNetwork,
|
|
5697
6173
|
isOriginSelector,
|
|
5698
|
-
initialSelection
|
|
6174
|
+
initialSelection,
|
|
6175
|
+
shouldLockSourceNetwork,
|
|
6176
|
+
transactionOption?.targetChain
|
|
6177
|
+
]);
|
|
6178
|
+
useEffect16(() => {
|
|
6179
|
+
if (shouldLockSourceNetwork && isOriginSelector && transactionOption?.targetChain) {
|
|
6180
|
+
const forcedNetwork = networks.find(
|
|
6181
|
+
(n) => n.shortName === transactionOption.targetChain
|
|
6182
|
+
);
|
|
6183
|
+
if (forcedNetwork && forcedNetwork.id !== sourceNetwork.id) {
|
|
6184
|
+
dispatch(setSourceChain(forcedNetwork));
|
|
6185
|
+
setInitialSelection({
|
|
6186
|
+
sourceSelection: false,
|
|
6187
|
+
targetSelection: false
|
|
6188
|
+
});
|
|
6189
|
+
switchChainHandler && switchChainHandler(forcedNetwork);
|
|
6190
|
+
}
|
|
6191
|
+
}
|
|
6192
|
+
}, [
|
|
6193
|
+
shouldLockSourceNetwork,
|
|
6194
|
+
transactionOption?.targetChain,
|
|
6195
|
+
sourceNetwork.id,
|
|
6196
|
+
isOriginSelector,
|
|
6197
|
+
networks,
|
|
6198
|
+
dispatch,
|
|
6199
|
+
switchChainHandler
|
|
5699
6200
|
]);
|
|
5700
6201
|
useEffect16(() => {
|
|
5701
6202
|
if (!networks.length || selectedNetwork.shortName) return;
|
|
@@ -5750,20 +6251,24 @@ var NetworkSelector = ({
|
|
|
5750
6251
|
dispatch(setTargetAddress(lightDemoAccounts.TRX));
|
|
5751
6252
|
}
|
|
5752
6253
|
}, [sourceNetwork, targetNetwork, mode]);
|
|
5753
|
-
return /* @__PURE__ */
|
|
6254
|
+
return /* @__PURE__ */ React75.createElement(
|
|
5754
6255
|
"div",
|
|
5755
6256
|
{
|
|
5756
|
-
className: `network-dropdown ${theme?.colorMode ?? ""} ${collapsed ? "collapsed" : "toggled"}`,
|
|
5757
|
-
onClick: () =>
|
|
6257
|
+
className: `network-dropdown ${theme?.colorMode ?? ""} ${collapsed ? "collapsed" : "toggled"} ${shouldLockSourceNetwork ? "disabled" : ""}`,
|
|
6258
|
+
onClick: () => {
|
|
6259
|
+
if (!shouldLockSourceNetwork) {
|
|
6260
|
+
setCollapsed((prev) => !prev);
|
|
6261
|
+
}
|
|
6262
|
+
},
|
|
5758
6263
|
ref
|
|
5759
6264
|
},
|
|
5760
|
-
/* @__PURE__ */
|
|
5761
|
-
/* @__PURE__ */
|
|
6265
|
+
/* @__PURE__ */ React75.createElement("div", { className: "network-wrapper" }, /* @__PURE__ */ React75.createElement(ChainIcon, { symbol: selectedNetwork.shortName }), /* @__PURE__ */ React75.createElement("span", null, selectedNetwork.name)),
|
|
6266
|
+
/* @__PURE__ */ React75.createElement(
|
|
5762
6267
|
"div",
|
|
5763
6268
|
{
|
|
5764
6269
|
className: `network-menu custom-scrollbar ${theme?.colorMode ?? ""} ${collapsed ? "collapsed" : "toggled"}`
|
|
5765
6270
|
},
|
|
5766
|
-
networks.filter((network) => network.shortName !== selectedNetwork.shortName).map((network) => /* @__PURE__ */
|
|
6271
|
+
networks.filter((network) => network.shortName !== selectedNetwork.shortName).map((network) => /* @__PURE__ */ React75.createElement(
|
|
5767
6272
|
"div",
|
|
5768
6273
|
{
|
|
5769
6274
|
key: network.id,
|
|
@@ -5775,15 +6280,15 @@ var NetworkSelector = ({
|
|
|
5775
6280
|
}
|
|
5776
6281
|
}
|
|
5777
6282
|
},
|
|
5778
|
-
network.disabled ? /* @__PURE__ */
|
|
5779
|
-
/* @__PURE__ */
|
|
5780
|
-
network.disabled && /* @__PURE__ */
|
|
6283
|
+
network.disabled ? /* @__PURE__ */ React75.createElement(Warning_default, { width: 25, height: 25 }) : /* @__PURE__ */ React75.createElement(ChainIcon, { symbol: network.shortName }),
|
|
6284
|
+
/* @__PURE__ */ React75.createElement("p", null, network.name),
|
|
6285
|
+
network.disabled && /* @__PURE__ */ React75.createElement("span", { className: "tooltip" }, "Temporarily unavailable")
|
|
5781
6286
|
))
|
|
5782
6287
|
),
|
|
5783
|
-
/* @__PURE__ */
|
|
6288
|
+
!shouldLockSourceNetwork && /* @__PURE__ */ React75.createElement("div", { className: `dropdown-icon ${collapsed ? "toggled" : "collapsed"}` }, /* @__PURE__ */ React75.createElement(Arrow_default, { fill: "none" }))
|
|
5784
6289
|
);
|
|
5785
6290
|
};
|
|
5786
|
-
var NetworkSelector_default =
|
|
6291
|
+
var NetworkSelector_default = React75.memo(NetworkSelector);
|
|
5787
6292
|
|
|
5788
6293
|
// src/components/reusable/SingleForm.tsx
|
|
5789
6294
|
import { parseUnits as parseUnits2 } from "viem";
|
|
@@ -5903,6 +6408,7 @@ var SingleForm = ({
|
|
|
5903
6408
|
const theme = useSelector35(selectTheme);
|
|
5904
6409
|
const feeDeduct = useSelector35(selectFeeDeduct);
|
|
5905
6410
|
const { totalFee } = useSelector35(selectServiceFee);
|
|
6411
|
+
const dAppOption = useSelector35(selectDappOption);
|
|
5906
6412
|
const compliantOption = useSelector35(selectCompliantOption);
|
|
5907
6413
|
const targetCompliant = useSelector35(selectTargetCompliant);
|
|
5908
6414
|
const sourceAddress = useSelector35(selectSourceAddress);
|
|
@@ -5951,6 +6457,12 @@ var SingleForm = ({
|
|
|
5951
6457
|
const intAmount = parseUnits2(amount, totalFee.decimals);
|
|
5952
6458
|
return balance - intAmount;
|
|
5953
6459
|
}, [balance, totalFee, feeDeduct]);
|
|
6460
|
+
const feeCurrency = useMemo14(() => {
|
|
6461
|
+
const sourceToken = sourceNetwork.supportedTokens.find(
|
|
6462
|
+
(t) => t.symbol === sourceCurrency
|
|
6463
|
+
);
|
|
6464
|
+
return sourceToken?.peggedTo ?? "USD";
|
|
6465
|
+
}, [sourceNetwork, sourceCurrency]);
|
|
5954
6466
|
useEffect17(() => {
|
|
5955
6467
|
if (!errorMessage) return;
|
|
5956
6468
|
toast4.error(errorMessage);
|
|
@@ -5984,9 +6496,12 @@ var SingleForm = ({
|
|
|
5984
6496
|
dispatch(setAmount(truncated));
|
|
5985
6497
|
};
|
|
5986
6498
|
const isConnected = useMemo14(() => {
|
|
6499
|
+
if (mode === "payment" /* payment */ && dAppOption !== "none" /* None */) {
|
|
6500
|
+
return isReady;
|
|
6501
|
+
}
|
|
5987
6502
|
return isReady && !initialSelection.sourceSelection;
|
|
5988
|
-
}, [isReady, initialSelection]);
|
|
5989
|
-
return /* @__PURE__ */
|
|
6503
|
+
}, [isReady, initialSelection, mode, dAppOption]);
|
|
6504
|
+
return /* @__PURE__ */ React76.createElement("div", { className: "single-form" }, /* @__PURE__ */ React76.createElement("div", { className: "form-item" }, /* @__PURE__ */ React76.createElement("span", { className: "label" }, dAppOption === "none" /* None */ && "Source", " Network:"), /* @__PURE__ */ React76.createElement("div", { className: "items" }, /* @__PURE__ */ React76.createElement(
|
|
5990
6505
|
NetworkSelector_default,
|
|
5991
6506
|
{
|
|
5992
6507
|
type: "origin",
|
|
@@ -5995,20 +6510,20 @@ var SingleForm = ({
|
|
|
5995
6510
|
setInitialSelection
|
|
5996
6511
|
}
|
|
5997
6512
|
}
|
|
5998
|
-
), /* @__PURE__ */
|
|
6513
|
+
), /* @__PURE__ */ React76.createElement(CoinDropdown_default, null))), /* @__PURE__ */ React76.createElement(
|
|
5999
6514
|
"div",
|
|
6000
6515
|
{
|
|
6001
6516
|
className: `dynamic-area ${sourceNetwork.shortName === "FIAT" /* FIAT */ ? "reverse" : "1"}`
|
|
6002
6517
|
},
|
|
6003
|
-
sourceNetwork.compatibility !== "CC" /* CC */ && /* @__PURE__ */
|
|
6518
|
+
sourceNetwork.compatibility !== "CC" /* CC */ && /* @__PURE__ */ React76.createElement(
|
|
6004
6519
|
"div",
|
|
6005
6520
|
{
|
|
6006
6521
|
className: `form-item wallet-button-item ${isConnected && "connected"}`
|
|
6007
6522
|
},
|
|
6008
|
-
/* @__PURE__ */
|
|
6009
|
-
/* @__PURE__ */
|
|
6523
|
+
/* @__PURE__ */ React76.createElement("span", { className: "label" }, "Wallet:"),
|
|
6524
|
+
/* @__PURE__ */ React76.createElement(WalletButton_default, { initialSelection: initialSelection.sourceSelection })
|
|
6010
6525
|
),
|
|
6011
|
-
mode !== "payment" /* payment */ && /* @__PURE__ */
|
|
6526
|
+
mode !== "payment" /* payment */ && /* @__PURE__ */ React76.createElement("div", { className: "form-item" }, /* @__PURE__ */ React76.createElement("span", { className: "label" }, "Target Network:"), /* @__PURE__ */ React76.createElement("div", { className: "items" }, /* @__PURE__ */ React76.createElement(
|
|
6012
6527
|
NetworkSelector_default,
|
|
6013
6528
|
{
|
|
6014
6529
|
type: "target",
|
|
@@ -6017,38 +6532,39 @@ var SingleForm = ({
|
|
|
6017
6532
|
setInitialSelection
|
|
6018
6533
|
}
|
|
6019
6534
|
}
|
|
6020
|
-
), /* @__PURE__ */
|
|
6021
|
-
), mode === "bridge" /* bridge */ && sourceNetwork.shortName !== "FIAT" /* FIAT */ ? targetNetwork.shortName === "FIAT" /* FIAT */ ? /* @__PURE__ */
|
|
6535
|
+
), /* @__PURE__ */ React76.createElement(CoinDropdown_default, { isSourceChain: false })))
|
|
6536
|
+
), mode === "bridge" /* bridge */ && sourceNetwork.shortName !== "FIAT" /* FIAT */ ? targetNetwork.shortName === "FIAT" /* FIAT */ ? /* @__PURE__ */ React76.createElement(BankInput_default, null) : /* @__PURE__ */ React76.createElement("div", { className: `form-item ${theme.colorMode}` }, /* @__PURE__ */ React76.createElement("span", { className: "label" }, "Target Address:"), /* @__PURE__ */ React76.createElement(
|
|
6022
6537
|
AddressInput_default,
|
|
6023
6538
|
{
|
|
6024
6539
|
theme: theme.colorMode,
|
|
6025
6540
|
placeholder: "Target address",
|
|
6026
6541
|
initialSelection
|
|
6027
6542
|
}
|
|
6028
|
-
)) : null, mode === "light" /* light */ && /* @__PURE__ */
|
|
6543
|
+
)) : null, mode === "light" /* light */ && /* @__PURE__ */ React76.createElement(
|
|
6029
6544
|
"div",
|
|
6030
6545
|
{
|
|
6031
6546
|
className: `form-item wallet-button-item ${!initialSelection.targetSelection && "connected"}`,
|
|
6032
6547
|
style: { display: "flex", alignItems: "center" }
|
|
6033
6548
|
},
|
|
6034
|
-
/* @__PURE__ */
|
|
6035
|
-
/* @__PURE__ */
|
|
6549
|
+
/* @__PURE__ */ React76.createElement("span", { className: "label" }, "Target Wallet:"),
|
|
6550
|
+
/* @__PURE__ */ React76.createElement(
|
|
6036
6551
|
WalletButton_default,
|
|
6037
6552
|
{
|
|
6038
6553
|
initialSelection: initialSelection.targetSelection,
|
|
6039
6554
|
placeholder: true
|
|
6040
6555
|
}
|
|
6041
6556
|
)
|
|
6042
|
-
),
|
|
6557
|
+
), /* @__PURE__ */ React76.createElement("div", { className: `form-item ${theme.colorMode}` }, /* @__PURE__ */ React76.createElement("span", { className: "label" }, "Amount:"), /* @__PURE__ */ React76.createElement("div", { className: `amount-label-container items ${theme.colorMode}` }, /* @__PURE__ */ React76.createElement(
|
|
6043
6558
|
"input",
|
|
6044
6559
|
{
|
|
6045
6560
|
className: `${theme.colorMode}`,
|
|
6046
6561
|
type: "text",
|
|
6047
6562
|
placeholder: "Enter amount",
|
|
6048
6563
|
value: amountValue || "",
|
|
6049
|
-
onChange: (e) => onAmountChange(e.target.value)
|
|
6564
|
+
onChange: (e) => onAmountChange(e.target.value),
|
|
6565
|
+
disabled: mode === "payment" /* payment */
|
|
6050
6566
|
}
|
|
6051
|
-
), /* @__PURE__ */
|
|
6567
|
+
), /* @__PURE__ */ React76.createElement("div", { className: "max-disclaimer" }, sourceNetwork.shortName !== "CC" && mode !== "payment" /* payment */ && /* @__PURE__ */ React76.createElement("span", { className: "max-button", onClick: onMaxClick }, "Max"), +totalFee !== -1 && dAppOption === "none" /* None */ && !initialSelection.sourceSelection && !initialSelection.targetSelection && /* @__PURE__ */ React76.createElement("p", { className: "fee-amount" }, "Est fees:", " ", /* @__PURE__ */ React76.createElement("span", { className: `${isLoadingFees ? "loading" : ""}` }, " ", isLoadingFees ? "" : `$ ${formatBigInt(totalFee)} ${feeCurrency}`))))));
|
|
6052
6568
|
};
|
|
6053
6569
|
var SingleForm_default = SingleForm;
|
|
6054
6570
|
|
|
@@ -6097,11 +6613,11 @@ function useAllowance2({
|
|
|
6097
6613
|
import { toast as toast5, Toaster as Toaster2 } from "react-hot-toast";
|
|
6098
6614
|
|
|
6099
6615
|
// plugins/solana/components/SolanaWalletConnectModal.tsx
|
|
6100
|
-
import
|
|
6616
|
+
import React79 from "react";
|
|
6101
6617
|
import { useDispatch as useDispatch20, useSelector as useSelector38 } from "react-redux";
|
|
6102
6618
|
|
|
6103
6619
|
// plugins/solana/components/SolanaWalletSelect.tsx
|
|
6104
|
-
import
|
|
6620
|
+
import React77, { useCallback as useCallback2, useEffect as useEffect18, useMemo as useMemo15, useRef as useRef5 } from "react";
|
|
6105
6621
|
import { useDispatch as useDispatch18, useSelector as useSelector36 } from "react-redux";
|
|
6106
6622
|
import { useWallet as useWallet7 } from "@solana/wallet-adapter-react";
|
|
6107
6623
|
import { WalletReadyState } from "@solana/wallet-adapter-base";
|
|
@@ -6175,28 +6691,28 @@ var SolanaWalletSelect = () => {
|
|
|
6175
6691
|
}
|
|
6176
6692
|
dispatch(setSolanaConnectModal(false));
|
|
6177
6693
|
}, [wallet, sourceChain]);
|
|
6178
|
-
return /* @__PURE__ */
|
|
6694
|
+
return /* @__PURE__ */ React77.createElement("div", { className: `wallet-select` }, /* @__PURE__ */ React77.createElement("div", { className: "slide-area hide-scrollbar", ref: sliderRef }, /* @__PURE__ */ React77.createElement("div", { className: "wallet-container" }, detected.map((wallet2, index) => /* @__PURE__ */ React77.createElement(
|
|
6179
6695
|
"div",
|
|
6180
6696
|
{
|
|
6181
6697
|
className: `card-item ${theme.colorMode}`,
|
|
6182
6698
|
onClick: () => handleWalletClick(wallet2.adapter.name),
|
|
6183
6699
|
key: `${wallet2.adapter.name}-${index}`
|
|
6184
6700
|
},
|
|
6185
|
-
/* @__PURE__ */
|
|
6186
|
-
)), undetected.map((wallet2, index) => /* @__PURE__ */
|
|
6701
|
+
/* @__PURE__ */ React77.createElement("div", { className: "wallet-item" }, /* @__PURE__ */ React77.createElement("img", { src: wallet2.adapter.icon, alt: wallet2.adapter.name }), /* @__PURE__ */ React77.createElement("span", null, wallet2.adapter.name))
|
|
6702
|
+
)), undetected.map((wallet2, index) => /* @__PURE__ */ React77.createElement(
|
|
6187
6703
|
ExternalLink_default,
|
|
6188
6704
|
{
|
|
6189
6705
|
to: wallet2.adapter.url,
|
|
6190
6706
|
className: `card-item ${theme.colorMode}`,
|
|
6191
6707
|
key: `${wallet2.adapter.name}-${index}`
|
|
6192
6708
|
},
|
|
6193
|
-
/* @__PURE__ */
|
|
6709
|
+
/* @__PURE__ */ React77.createElement("div", { className: "wallet-item" }, /* @__PURE__ */ React77.createElement("img", { src: wallet2.adapter.icon, alt: wallet2.adapter.name }), /* @__PURE__ */ React77.createElement("span", null, "Install ", wallet2.adapter.name))
|
|
6194
6710
|
)))));
|
|
6195
6711
|
};
|
|
6196
6712
|
var SolanaWalletSelect_default = SolanaWalletSelect;
|
|
6197
6713
|
|
|
6198
6714
|
// plugins/solana/components/AccountDetailsModal.tsx
|
|
6199
|
-
import
|
|
6715
|
+
import React78, { useMemo as useMemo16 } from "react";
|
|
6200
6716
|
import { useDispatch as useDispatch19, useSelector as useSelector37 } from "react-redux";
|
|
6201
6717
|
import { useWallet as useSolanaWallet3 } from "@solana/wallet-adapter-react";
|
|
6202
6718
|
var AccountDetailsModal = () => {
|
|
@@ -6217,25 +6733,25 @@ var AccountDetailsModal = () => {
|
|
|
6217
6733
|
dispatch(setAccountDetailsModal(false));
|
|
6218
6734
|
};
|
|
6219
6735
|
if (sourceChain.shortName !== "SOL") return;
|
|
6220
|
-
return /* @__PURE__ */
|
|
6736
|
+
return /* @__PURE__ */ React78.createElement(
|
|
6221
6737
|
"div",
|
|
6222
6738
|
{
|
|
6223
6739
|
className: `kima-modal ${theme.colorMode} ${accountDetailsModal && "open"}`
|
|
6224
6740
|
},
|
|
6225
|
-
/* @__PURE__ */
|
|
6226
|
-
/* @__PURE__ */
|
|
6741
|
+
/* @__PURE__ */ React78.createElement("div", { className: "modal-overlay" }),
|
|
6742
|
+
/* @__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, "Account Details")), /* @__PURE__ */ React78.createElement("div", { className: "control-buttons" }, /* @__PURE__ */ React78.createElement(
|
|
6227
6743
|
"button",
|
|
6228
6744
|
{
|
|
6229
6745
|
className: "cross-icon-button",
|
|
6230
6746
|
onClick: () => dispatch(setAccountDetailsModal(false))
|
|
6231
6747
|
},
|
|
6232
|
-
/* @__PURE__ */
|
|
6748
|
+
/* @__PURE__ */ React78.createElement(
|
|
6233
6749
|
Cross_default,
|
|
6234
6750
|
{
|
|
6235
6751
|
fill: theme.colorMode === "light" ? "black" : "white"
|
|
6236
6752
|
}
|
|
6237
6753
|
)
|
|
6238
|
-
)))), /* @__PURE__ */
|
|
6754
|
+
)))), /* @__PURE__ */ React78.createElement("div", { className: "modal-content" }, /* @__PURE__ */ React78.createElement("div", { className: "summary" }, networkDetails && /* @__PURE__ */ React78.createElement(networkDetails.icon, { width: 60, height: 60 }), /* @__PURE__ */ React78.createElement("div", { className: "address" }, /* @__PURE__ */ React78.createElement("h2", null, getShortenedAddress(walletAddress || "")), /* @__PURE__ */ React78.createElement(CopyButton_default, { text: walletAddress })), /* @__PURE__ */ React78.createElement("h3", null, formatterFloat.format(Number(solBalance)), " $SOL")), /* @__PURE__ */ React78.createElement(SecondaryButton_default, { className: "block-explorer" }, /* @__PURE__ */ React78.createElement(ExternalLink_default, { className: "link", to: explorerUrl }, /* @__PURE__ */ React78.createElement(Explorer_default, { fill: "#778DA3" }), /* @__PURE__ */ React78.createElement("p", null, "Block explorer"), /* @__PURE__ */ React78.createElement(ExternalUrl_default, { fill: "#778DA3" }))), /* @__PURE__ */ React78.createElement(PrimaryButton_default, { clickHandler: handleDisconnect }, "Discconect")))
|
|
6239
6755
|
);
|
|
6240
6756
|
};
|
|
6241
6757
|
var AccountDetailsModal_default = AccountDetailsModal;
|
|
@@ -6245,18 +6761,18 @@ var SolanaWalletConnectModal = () => {
|
|
|
6245
6761
|
const dispatch = useDispatch20();
|
|
6246
6762
|
const theme = useSelector38(selectTheme);
|
|
6247
6763
|
const connectModal = useSelector38(selectSolanaConnectModal);
|
|
6248
|
-
return /* @__PURE__ */
|
|
6764
|
+
return /* @__PURE__ */ React79.createElement("div", null, /* @__PURE__ */ React79.createElement(AccountDetailsModal_default, null), /* @__PURE__ */ React79.createElement(
|
|
6249
6765
|
"div",
|
|
6250
6766
|
{
|
|
6251
6767
|
className: `kima-modal wallet-connect ${connectModal ? "open" : ""}`
|
|
6252
6768
|
},
|
|
6253
|
-
/* @__PURE__ */
|
|
6769
|
+
/* @__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, "Connect Wallet")), /* @__PURE__ */ React79.createElement("div", { className: "control-buttons" }, /* @__PURE__ */ React79.createElement(
|
|
6254
6770
|
"button",
|
|
6255
6771
|
{
|
|
6256
6772
|
className: "cross-icon-button",
|
|
6257
6773
|
onClick: () => dispatch(setSolanaConnectModal(false))
|
|
6258
6774
|
},
|
|
6259
|
-
/* @__PURE__ */
|
|
6775
|
+
/* @__PURE__ */ React79.createElement(
|
|
6260
6776
|
Cross_default,
|
|
6261
6777
|
{
|
|
6262
6778
|
width: 30,
|
|
@@ -6264,17 +6780,17 @@ var SolanaWalletConnectModal = () => {
|
|
|
6264
6780
|
fill: theme.colorMode === "light" ? "black" : "white"
|
|
6265
6781
|
}
|
|
6266
6782
|
)
|
|
6267
|
-
)))), /* @__PURE__ */
|
|
6783
|
+
)))), /* @__PURE__ */ React79.createElement("div", { className: "modal-content" }, /* @__PURE__ */ React79.createElement(SolanaWalletSelect_default, null)))
|
|
6268
6784
|
));
|
|
6269
6785
|
};
|
|
6270
6786
|
var SolanaWalletConnectModal_default = SolanaWalletConnectModal;
|
|
6271
6787
|
|
|
6272
6788
|
// plugins/tron/components/TronWalletConnectModal.tsx
|
|
6273
|
-
import
|
|
6789
|
+
import React82 from "react";
|
|
6274
6790
|
import { useDispatch as useDispatch23, useSelector as useSelector41 } from "react-redux";
|
|
6275
6791
|
|
|
6276
6792
|
// plugins/tron/components/AccountDetailsModal.tsx
|
|
6277
|
-
import
|
|
6793
|
+
import React80, { useMemo as useMemo17 } from "react";
|
|
6278
6794
|
import { useDispatch as useDispatch21, useSelector as useSelector39 } from "react-redux";
|
|
6279
6795
|
import { useWallet as useTronWallet3 } from "@tronweb3/tronwallet-adapter-react-hooks";
|
|
6280
6796
|
var AccountDetailsModal2 = () => {
|
|
@@ -6299,31 +6815,31 @@ var AccountDetailsModal2 = () => {
|
|
|
6299
6815
|
dispatch(setAccountDetailsModal(false));
|
|
6300
6816
|
};
|
|
6301
6817
|
if (sourcheChain.shortName !== "TRX") return;
|
|
6302
|
-
return /* @__PURE__ */
|
|
6818
|
+
return /* @__PURE__ */ React80.createElement(
|
|
6303
6819
|
"div",
|
|
6304
6820
|
{
|
|
6305
6821
|
className: `kima-modal ${theme.colorMode} ${accountDetailsModal && "open"}`
|
|
6306
6822
|
},
|
|
6307
|
-
/* @__PURE__ */
|
|
6308
|
-
/* @__PURE__ */
|
|
6823
|
+
/* @__PURE__ */ React80.createElement("div", { className: "modal-overlay" }),
|
|
6824
|
+
/* @__PURE__ */ React80.createElement("div", { className: `modal-content-container ${theme.colorMode}` }, /* @__PURE__ */ React80.createElement("div", { className: "kima-card-header" }, /* @__PURE__ */ React80.createElement("div", { className: "topbar" }, /* @__PURE__ */ React80.createElement("div", { className: "title" }, /* @__PURE__ */ React80.createElement("h3", null, "Account Details")), /* @__PURE__ */ React80.createElement("div", { className: "control-buttons" }, /* @__PURE__ */ React80.createElement(
|
|
6309
6825
|
"button",
|
|
6310
6826
|
{
|
|
6311
6827
|
className: "cross-icon-button",
|
|
6312
6828
|
onClick: () => dispatch(setAccountDetailsModal(false))
|
|
6313
6829
|
},
|
|
6314
|
-
/* @__PURE__ */
|
|
6830
|
+
/* @__PURE__ */ React80.createElement(
|
|
6315
6831
|
Cross_default,
|
|
6316
6832
|
{
|
|
6317
6833
|
fill: theme.colorMode === "light" ? "black" : "white"
|
|
6318
6834
|
}
|
|
6319
6835
|
)
|
|
6320
|
-
)))), /* @__PURE__ */
|
|
6836
|
+
)))), /* @__PURE__ */ React80.createElement("div", { className: "modal-content" }, /* @__PURE__ */ React80.createElement("div", { className: "summary" }, networkDetails && /* @__PURE__ */ React80.createElement(networkDetails.icon, { width: 60, height: 60 }), /* @__PURE__ */ React80.createElement("div", { className: "address" }, /* @__PURE__ */ React80.createElement("h2", null, getShortenedAddress(connectedAddress || "")), /* @__PURE__ */ React80.createElement(CopyButton_default, { text: connectedAddress })), /* @__PURE__ */ React80.createElement("h3", null, formatterFloat.format(Number(tronBalance)), " ", selectedNetwork.shortName)), /* @__PURE__ */ React80.createElement(SecondaryButton_default, { className: "block-explorer" }, /* @__PURE__ */ React80.createElement(ExternalLink_default, { className: "link", to: explorerUrl }, /* @__PURE__ */ React80.createElement(Explorer_default, { fill: "#778DA3" }), /* @__PURE__ */ React80.createElement("p", null, "Block explorer"), /* @__PURE__ */ React80.createElement(ExternalUrl_default, { fill: "#778DA3" }))), /* @__PURE__ */ React80.createElement(PrimaryButton_default, { clickHandler: handleDisconnect }, "Disconnect")))
|
|
6321
6837
|
);
|
|
6322
6838
|
};
|
|
6323
6839
|
var AccountDetailsModal_default2 = AccountDetailsModal2;
|
|
6324
6840
|
|
|
6325
6841
|
// plugins/tron/components/TronWalletSelect.tsx
|
|
6326
|
-
import
|
|
6842
|
+
import React81, { useEffect as useEffect19, useMemo as useMemo18, useRef as useRef6 } from "react";
|
|
6327
6843
|
import { useDispatch as useDispatch22, useSelector as useSelector40 } from "react-redux";
|
|
6328
6844
|
import { useWallet as useWallet8 } from "@tronweb3/tronwallet-adapter-react-hooks";
|
|
6329
6845
|
import { AdapterState } from "@tronweb3/tronwallet-abstract-adapter";
|
|
@@ -6382,22 +6898,22 @@ var TronWalletSelect = () => {
|
|
|
6382
6898
|
const connectWallet = async (walletName) => {
|
|
6383
6899
|
currentWallet?.adapter.name === walletName ? await connect() : select(walletName);
|
|
6384
6900
|
};
|
|
6385
|
-
return /* @__PURE__ */
|
|
6901
|
+
return /* @__PURE__ */ React81.createElement("div", { className: `wallet-select` }, /* @__PURE__ */ React81.createElement("div", { className: "slide-area hide-scrollbar", ref: sliderRef }, /* @__PURE__ */ React81.createElement("div", { className: "wallet-container" }, detected.map((wallet, index) => /* @__PURE__ */ React81.createElement(
|
|
6386
6902
|
"div",
|
|
6387
6903
|
{
|
|
6388
6904
|
className: `card-item ${theme.colorMode}`,
|
|
6389
6905
|
onClick: () => connectWallet(wallet.adapter.name),
|
|
6390
6906
|
key: `${wallet.adapter.name}-${index}`
|
|
6391
6907
|
},
|
|
6392
|
-
/* @__PURE__ */
|
|
6393
|
-
)), undetected.map((wallet, index) => /* @__PURE__ */
|
|
6908
|
+
/* @__PURE__ */ React81.createElement("div", { className: "wallet-item" }, /* @__PURE__ */ React81.createElement("img", { src: wallet.adapter.icon, alt: wallet.adapter.name }), /* @__PURE__ */ React81.createElement("span", null, wallet.adapter.name))
|
|
6909
|
+
)), undetected.map((wallet, index) => /* @__PURE__ */ React81.createElement(
|
|
6394
6910
|
ExternalLink_default,
|
|
6395
6911
|
{
|
|
6396
6912
|
to: wallet.adapter.url,
|
|
6397
6913
|
className: `card-item ${theme.colorMode}`,
|
|
6398
6914
|
key: `${wallet.adapter.name}-${index}`
|
|
6399
6915
|
},
|
|
6400
|
-
/* @__PURE__ */
|
|
6916
|
+
/* @__PURE__ */ React81.createElement("div", { className: "wallet-item" }, /* @__PURE__ */ React81.createElement("img", { src: wallet.adapter.icon, alt: wallet.adapter.name }), /* @__PURE__ */ React81.createElement("span", null, "Install ", wallet.adapter.name))
|
|
6401
6917
|
)))));
|
|
6402
6918
|
};
|
|
6403
6919
|
var TronWalletSelect_default = TronWalletSelect;
|
|
@@ -6407,25 +6923,25 @@ var TronWalletConnectModal = () => {
|
|
|
6407
6923
|
const dispatch = useDispatch23();
|
|
6408
6924
|
const theme = useSelector41(selectTheme);
|
|
6409
6925
|
const connectModal = useSelector41(selectTronConnectModal);
|
|
6410
|
-
return /* @__PURE__ */
|
|
6926
|
+
return /* @__PURE__ */ React82.createElement("div", null, /* @__PURE__ */ React82.createElement(AccountDetailsModal_default2, null), /* @__PURE__ */ React82.createElement(
|
|
6411
6927
|
"div",
|
|
6412
6928
|
{
|
|
6413
6929
|
className: `kima-modal wallet-connect ${theme.colorMode} ${connectModal ? "open" : ""}`
|
|
6414
6930
|
},
|
|
6415
|
-
/* @__PURE__ */
|
|
6416
|
-
/* @__PURE__ */
|
|
6931
|
+
/* @__PURE__ */ React82.createElement("div", { className: "modal-overlay" }),
|
|
6932
|
+
/* @__PURE__ */ React82.createElement("div", { className: `modal-content-container ${theme.colorMode}` }, /* @__PURE__ */ React82.createElement("div", { className: "kima-card-header" }, /* @__PURE__ */ React82.createElement("div", { className: "topbar" }, /* @__PURE__ */ React82.createElement("div", { className: "title" }, /* @__PURE__ */ React82.createElement("h3", null, "Connect Wallet")), /* @__PURE__ */ React82.createElement("div", { className: "control-buttons" }, /* @__PURE__ */ React82.createElement(
|
|
6417
6933
|
"button",
|
|
6418
6934
|
{
|
|
6419
6935
|
className: "icon-button",
|
|
6420
6936
|
onClick: () => dispatch(setTronConnectModal(false))
|
|
6421
6937
|
},
|
|
6422
|
-
/* @__PURE__ */
|
|
6938
|
+
/* @__PURE__ */ React82.createElement(
|
|
6423
6939
|
Cross_default,
|
|
6424
6940
|
{
|
|
6425
6941
|
fill: theme.colorMode === "light" ? "black" : "white"
|
|
6426
6942
|
}
|
|
6427
6943
|
)
|
|
6428
|
-
)))), /* @__PURE__ */
|
|
6944
|
+
)))), /* @__PURE__ */ React82.createElement("div", { className: "modal-content" }, /* @__PURE__ */ React82.createElement(TronWalletSelect_default, null)))
|
|
6429
6945
|
));
|
|
6430
6946
|
};
|
|
6431
6947
|
var TronWalletConnectModal_default = TronWalletConnectModal;
|
|
@@ -6519,7 +7035,7 @@ var useValidateTransaction = (inputs) => {
|
|
|
6519
7035
|
};
|
|
6520
7036
|
}
|
|
6521
7037
|
if (compliantOption) {
|
|
6522
|
-
if (!sourceCompliant?.isCompliant) {
|
|
7038
|
+
if (!sourceCompliant?.isCompliant && sourceChain !== "CC") {
|
|
6523
7039
|
return {
|
|
6524
7040
|
error: "ValidationError" /* Error */,
|
|
6525
7041
|
message: "Source address compliance check failed"
|
|
@@ -6577,8 +7093,7 @@ var useValidateTransaction_default = useValidateTransaction;
|
|
|
6577
7093
|
// src/hooks/useSubmitTransaction.tsx
|
|
6578
7094
|
import { useDispatch as useDispatch24, useSelector as useSelector43 } from "react-redux";
|
|
6579
7095
|
import { useMutation } from "@tanstack/react-query";
|
|
6580
|
-
|
|
6581
|
-
var useSubmitTransaction = () => {
|
|
7096
|
+
var useSubmitTransaction = (isSubmitting, setIsSubmitting) => {
|
|
6582
7097
|
const dispatch = useDispatch24();
|
|
6583
7098
|
const backendUrl = useSelector43(selectBackendUrl);
|
|
6584
7099
|
const mode = useSelector43(selectMode);
|
|
@@ -6587,7 +7102,6 @@ var useSubmitTransaction = () => {
|
|
|
6587
7102
|
const txValues = feeDeduct ? transactionValues.feeFromTarget : transactionValues.feeFromOrigin;
|
|
6588
7103
|
const ccTransactionIdSeed = useSelector43(selectCCTransactionIdSeed);
|
|
6589
7104
|
const submitted = useSelector43(selectSubmitted);
|
|
6590
|
-
const [isSubmitting, setIsSubmitting] = useState14(false);
|
|
6591
7105
|
const mutation = useMutation({
|
|
6592
7106
|
mutationFn: async (signature) => {
|
|
6593
7107
|
setIsSubmitting(true);
|
|
@@ -6686,6 +7200,8 @@ var getCompliance = async (walletAddress, compliantOption, backendUrl) => {
|
|
|
6686
7200
|
|
|
6687
7201
|
// src/hooks/useComplianceCheck.tsx
|
|
6688
7202
|
var useComplianceCheck = (walletAddress, compliantOption, backendUrl) => {
|
|
7203
|
+
const enabled = !!walletAddress && walletAddress.length >= 34 && // debounce for a minimum of characters (tron length)
|
|
7204
|
+
!!compliantOption && compliantOption && !!backendUrl;
|
|
6689
7205
|
const {
|
|
6690
7206
|
data: complianceData,
|
|
6691
7207
|
error,
|
|
@@ -6695,9 +7211,7 @@ var useComplianceCheck = (walletAddress, compliantOption, backendUrl) => {
|
|
|
6695
7211
|
queryFn: async () => {
|
|
6696
7212
|
return await getCompliance(walletAddress, compliantOption, backendUrl);
|
|
6697
7213
|
},
|
|
6698
|
-
enabled
|
|
6699
|
-
!!compliantOption && compliantOption && !!backendUrl,
|
|
6700
|
-
// Only fetch when valid inputs exist
|
|
7214
|
+
enabled,
|
|
6701
7215
|
retry: 1
|
|
6702
7216
|
// Retry once on failure
|
|
6703
7217
|
});
|
|
@@ -6742,7 +7256,7 @@ function useDisconnectWallet5() {
|
|
|
6742
7256
|
}
|
|
6743
7257
|
|
|
6744
7258
|
// src/components/reusable/WarningModal.tsx
|
|
6745
|
-
import
|
|
7259
|
+
import React83 from "react";
|
|
6746
7260
|
var WarningModal = ({
|
|
6747
7261
|
message,
|
|
6748
7262
|
cancelButtonText = "Cancel",
|
|
@@ -6750,14 +7264,14 @@ var WarningModal = ({
|
|
|
6750
7264
|
onAcknowledge,
|
|
6751
7265
|
onCancel
|
|
6752
7266
|
}) => {
|
|
6753
|
-
return /* @__PURE__ */
|
|
7267
|
+
return /* @__PURE__ */ React83.createElement("div", { className: "warning-modal-overlay" }, /* @__PURE__ */ React83.createElement("div", { className: "warning-modal" }, /* @__PURE__ */ React83.createElement("h3", null, "Warning"), /* @__PURE__ */ React83.createElement("p", null, message), /* @__PURE__ */ React83.createElement("div", { className: "warning-modal-buttons" }, /* @__PURE__ */ React83.createElement(
|
|
6754
7268
|
SecondaryButton_default,
|
|
6755
7269
|
{
|
|
6756
7270
|
className: "warning-modal-cancel",
|
|
6757
7271
|
clickHandler: onCancel
|
|
6758
7272
|
},
|
|
6759
7273
|
cancelButtonText
|
|
6760
|
-
), /* @__PURE__ */
|
|
7274
|
+
), /* @__PURE__ */ React83.createElement(
|
|
6761
7275
|
PrimaryButton_default,
|
|
6762
7276
|
{
|
|
6763
7277
|
className: "warning-modal-acknowledge",
|
|
@@ -6769,7 +7283,7 @@ var WarningModal = ({
|
|
|
6769
7283
|
var WarningModal_default = WarningModal;
|
|
6770
7284
|
|
|
6771
7285
|
// src/components/reusable/CCWidget.tsx
|
|
6772
|
-
import
|
|
7286
|
+
import React84, { useEffect as useEffect20, useMemo as useMemo20, useRef as useRef7, useState as useState14 } from "react";
|
|
6773
7287
|
import { useSelector as useSelector44, useDispatch as useDispatch25 } from "react-redux";
|
|
6774
7288
|
import { v4 as uuidv4 } from "uuid";
|
|
6775
7289
|
|
|
@@ -6803,6 +7317,7 @@ var CCWidget = ({ submitCallback }) => {
|
|
|
6803
7317
|
const backendUrl = useSelector44(selectBackendUrl);
|
|
6804
7318
|
const ccTransactionStatus = useSelector44(selectCCTransactionStatus);
|
|
6805
7319
|
const networkOption = useSelector44(selectNetworkOption);
|
|
7320
|
+
const sourceCurrency = useSelector44(selectSourceCurrency);
|
|
6806
7321
|
const { transactionValues } = useSelector44(selectServiceFee);
|
|
6807
7322
|
const randomUserIdRef = useRef7(uuidv4());
|
|
6808
7323
|
const ccTransactionIdSeedRef = useRef7(uuidv4());
|
|
@@ -6825,7 +7340,7 @@ var CCWidget = ({ submitCallback }) => {
|
|
|
6825
7340
|
() => formatBigInt(txValues.allowanceAmount),
|
|
6826
7341
|
[txValues]
|
|
6827
7342
|
);
|
|
6828
|
-
const [isLoading, setIsLoading] =
|
|
7343
|
+
const [isLoading, setIsLoading] = useState14(true);
|
|
6829
7344
|
const baseUrl = useMemo20(
|
|
6830
7345
|
() => `https://widget${networkOption === "testnet" /* testnet */ ? "-sandbox" : ""}.depasify.com`,
|
|
6831
7346
|
[networkOption]
|
|
@@ -6854,12 +7369,12 @@ var CCWidget = ({ submitCallback }) => {
|
|
|
6854
7369
|
useEffect20(() => {
|
|
6855
7370
|
if (error) dispatch(setCCTransactionStatus("error-id"));
|
|
6856
7371
|
}, [dispatch, error]);
|
|
6857
|
-
return /* @__PURE__ */
|
|
7372
|
+
return /* @__PURE__ */ React84.createElement("div", { className: `cc-widget ${isLoading ? "loading" : ""}` }, (isLoading || isTransactionIdLoading || isEnvLoading || ccTransactionStatus === "success") && /* @__PURE__ */ React84.createElement("div", { className: "cc-widget-loader" }, /* @__PURE__ */ React84.createElement(ring_default, { width: 50, height: 50, fill: "#86b8ce" })), /* @__PURE__ */ React84.createElement(
|
|
6858
7373
|
"iframe",
|
|
6859
7374
|
{
|
|
6860
7375
|
width: isLoading || isTransactionIdLoading || ccTransactionStatus === "success" || error ? 0 : "100%",
|
|
6861
7376
|
height: isLoading || isTransactionIdLoading || ccTransactionStatus === "success" || error ? 0 : "100%",
|
|
6862
|
-
src: `${baseUrl}/widgets/kyc?partner=${partnerId}&user_uuid=${randomUserIdRef.current}&amount=${allowanceAmount}¤cy
|
|
7377
|
+
src: `${baseUrl}/widgets/kyc?partner=${partnerId}&user_uuid=${randomUserIdRef.current}&amount=${allowanceAmount}¤cy=${sourceCurrency}&trx_uuid=${data?.transactionId}&postmessage=true`,
|
|
6863
7378
|
loading: "lazy",
|
|
6864
7379
|
title: "Credit Card Widget",
|
|
6865
7380
|
allow: "camera; clipboard-write",
|
|
@@ -6884,10 +7399,11 @@ var TransferWidget = ({
|
|
|
6884
7399
|
}) => {
|
|
6885
7400
|
const dispatch = useDispatch26();
|
|
6886
7401
|
const mainRef = useRef8(null);
|
|
6887
|
-
const [signature, setSignature2] =
|
|
6888
|
-
const [
|
|
6889
|
-
const [
|
|
6890
|
-
const [
|
|
7402
|
+
const [signature, setSignature2] = useState15("");
|
|
7403
|
+
const [isSubmitting, setIsSubmitting] = useState15(false);
|
|
7404
|
+
const [formStep, setFormStep] = useState15(0);
|
|
7405
|
+
const [warningModalOpen, setWarningModalOpen] = useState15(null);
|
|
7406
|
+
const [resetModalOpen, setResetModalOpen] = useState15(false);
|
|
6891
7407
|
const networkOption = useSelector45(selectNetworkOption);
|
|
6892
7408
|
const dAppOption = useSelector45(selectDappOption);
|
|
6893
7409
|
const mode = useSelector45(selectMode);
|
|
@@ -6906,11 +7422,11 @@ var TransferWidget = ({
|
|
|
6906
7422
|
const feeDeduct = useSelector45(selectFeeDeduct);
|
|
6907
7423
|
const txValues = feeDeduct ? transactionValues.feeFromTarget : transactionValues.feeFromOrigin;
|
|
6908
7424
|
const { keplrHandler, closeHandler } = useKimaContext();
|
|
6909
|
-
const [isCancellingApprove, setCancellingApprove] =
|
|
6910
|
-
const [isApproving, setApproving] =
|
|
6911
|
-
const [isSigning, setSigning] =
|
|
6912
|
-
const [feeOptionDisabled, setFeeOptionDisabled] =
|
|
6913
|
-
const [initialSelection, setInitialSelection] =
|
|
7425
|
+
const [isCancellingApprove, setCancellingApprove] = useState15(false);
|
|
7426
|
+
const [isApproving, setApproving] = useState15(false);
|
|
7427
|
+
const [isSigning, setSigning] = useState15(false);
|
|
7428
|
+
const [feeOptionDisabled, setFeeOptionDisabled] = useState15(false);
|
|
7429
|
+
const [initialSelection, setInitialSelection] = useState15({
|
|
6914
7430
|
sourceSelection: true,
|
|
6915
7431
|
targetSelection: true
|
|
6916
7432
|
});
|
|
@@ -6920,6 +7436,10 @@ var TransferWidget = ({
|
|
|
6920
7436
|
const ccTransactionStatus = useSelector45(selectCCTransactionStatus);
|
|
6921
7437
|
const { width: windowWidth } = useWidth_default();
|
|
6922
7438
|
const { disconnectWallet } = useDisconnectWallet5();
|
|
7439
|
+
const { submitTransaction } = useSubmitTransaction_default(
|
|
7440
|
+
isSubmitting,
|
|
7441
|
+
setIsSubmitting
|
|
7442
|
+
);
|
|
6923
7443
|
const { allowance, balance, isApproved, approve, decimals, signMessage } = useAllowance2({
|
|
6924
7444
|
setApproving,
|
|
6925
7445
|
setCancellingApprove
|
|
@@ -6983,7 +7503,6 @@ var TransferWidget = ({
|
|
|
6983
7503
|
setInitialSelection((prev) => ({ ...prev, targetSelection: false }));
|
|
6984
7504
|
}
|
|
6985
7505
|
}, [fees, mode, transactionOption, dispatch]);
|
|
6986
|
-
const { submitTransaction, isSubmitting } = useSubmitTransaction_default();
|
|
6987
7506
|
const isBackButtonEnabled = useMemo21(() => {
|
|
6988
7507
|
if (formStep !== 0) {
|
|
6989
7508
|
if (sourceChain.shortName === "CC") {
|
|
@@ -7004,21 +7523,22 @@ var TransferWidget = ({
|
|
|
7004
7523
|
try {
|
|
7005
7524
|
await submitTransaction(signature);
|
|
7006
7525
|
} catch (err) {
|
|
7007
|
-
toast5.error("Failed to submit transaction", { icon: /* @__PURE__ */
|
|
7526
|
+
toast5.error("Failed to submit transaction", { icon: /* @__PURE__ */ React85.createElement(Error_default, null) });
|
|
7008
7527
|
dispatch(setCCTransactionStatus("error-generic"));
|
|
7009
7528
|
}
|
|
7010
7529
|
}, [signature, submitTransaction]);
|
|
7011
7530
|
const handleSubmit = async () => {
|
|
7012
7531
|
const { error: error2, message: validationMessage } = validate(true);
|
|
7013
7532
|
if (error2 === "ValidationError" /* Error */) {
|
|
7014
|
-
return toast5.error(validationMessage, { icon: /* @__PURE__ */
|
|
7533
|
+
return toast5.error(validationMessage, { icon: /* @__PURE__ */ React85.createElement(Error_default, null) });
|
|
7015
7534
|
}
|
|
7016
7535
|
if (sourceChain.shortName === "CC") {
|
|
7017
7536
|
dispatch(setCCTransactionStatus("initialized"));
|
|
7018
7537
|
return;
|
|
7019
7538
|
}
|
|
7020
|
-
if (error2 === "ApprovalNeeded" /* ApprovalNeeded */ && mode !== "light" /* light */) {
|
|
7539
|
+
if (error2 === "ApprovalNeeded" /* ApprovalNeeded */ && mode !== "light" /* light */ && dAppOption === "none" /* None */) {
|
|
7021
7540
|
if (!signature) {
|
|
7541
|
+
setApproving(true);
|
|
7022
7542
|
setFeeOptionDisabled(true);
|
|
7023
7543
|
const sig2 = await signMessage?.({
|
|
7024
7544
|
targetAddress,
|
|
@@ -7027,15 +7547,17 @@ var TransferWidget = ({
|
|
|
7027
7547
|
originChain: sourceChain.shortName
|
|
7028
7548
|
});
|
|
7029
7549
|
setSignature2(sig2);
|
|
7550
|
+
setApproving(false);
|
|
7030
7551
|
}
|
|
7031
7552
|
return approve();
|
|
7032
7553
|
}
|
|
7554
|
+
setIsSubmitting(true);
|
|
7033
7555
|
if (dAppOption === "LPDrain" /* LPDrain */ || dAppOption === "LPAdd" /* LPAdd */) {
|
|
7034
|
-
keplrHandler?.(sourceAddress);
|
|
7556
|
+
await keplrHandler?.(sourceAddress);
|
|
7035
7557
|
return;
|
|
7036
7558
|
}
|
|
7037
7559
|
let sig = signature;
|
|
7038
|
-
if (!sig && mode !== "light" /* light */) {
|
|
7560
|
+
if (!sig && mode !== "light" /* light */ && dAppOption === "none" /* None */) {
|
|
7039
7561
|
setFeeOptionDisabled(true);
|
|
7040
7562
|
sig = await signMessage?.({
|
|
7041
7563
|
targetAddress,
|
|
@@ -7060,7 +7582,7 @@ var TransferWidget = ({
|
|
|
7060
7582
|
if (error2 !== "ValidationError" /* Error */ && formStep > 0) {
|
|
7061
7583
|
return handleSubmit();
|
|
7062
7584
|
}
|
|
7063
|
-
toast5.error(validationMessage, { icon: /* @__PURE__ */
|
|
7585
|
+
toast5.error(validationMessage, { icon: /* @__PURE__ */ React85.createElement(Error_default, null) });
|
|
7064
7586
|
mainRef.current?.click();
|
|
7065
7587
|
};
|
|
7066
7588
|
const onBack = () => {
|
|
@@ -7082,9 +7604,9 @@ var TransferWidget = ({
|
|
|
7082
7604
|
return "Next";
|
|
7083
7605
|
}
|
|
7084
7606
|
if (isApproved) {
|
|
7085
|
-
return isSubmitting ? "Submitting..." : "Submit";
|
|
7607
|
+
return isSubmitting ? !signature && dAppOption === "none" /* None */ ? "Signing..." : "Submitting..." : "Submit";
|
|
7086
7608
|
} else {
|
|
7087
|
-
return isApproving ? "Approving..." : "Approve";
|
|
7609
|
+
return isApproving ? !signature && dAppOption === "none" /* None */ ? "Signing..." : "Approving..." : !signature && dAppOption === "none" /* None */ ? "Sign" : "Approve";
|
|
7088
7610
|
}
|
|
7089
7611
|
}
|
|
7090
7612
|
if (isLoadingFees) {
|
|
@@ -7099,7 +7621,6 @@ var TransferWidget = ({
|
|
|
7099
7621
|
};
|
|
7100
7622
|
const resetForm = async () => {
|
|
7101
7623
|
if (isApproving || isSubmitting || isSigning) return;
|
|
7102
|
-
closeHandler && closeHandler(0);
|
|
7103
7624
|
setSignature2("");
|
|
7104
7625
|
setSigning(false);
|
|
7105
7626
|
setFormStep(0);
|
|
@@ -7135,7 +7656,7 @@ var TransferWidget = ({
|
|
|
7135
7656
|
}
|
|
7136
7657
|
await disconnectWallet();
|
|
7137
7658
|
};
|
|
7138
|
-
return /* @__PURE__ */
|
|
7659
|
+
return /* @__PURE__ */ React85.createElement(
|
|
7139
7660
|
"div",
|
|
7140
7661
|
{
|
|
7141
7662
|
className: `kima-card ${theme.colorMode}`,
|
|
@@ -7143,7 +7664,7 @@ var TransferWidget = ({
|
|
|
7143
7664
|
background: theme.colorMode === "light" /* light */ ? theme.backgroundColorLight : theme.backgroundColorDark
|
|
7144
7665
|
}
|
|
7145
7666
|
},
|
|
7146
|
-
resetModalOpen && /* @__PURE__ */
|
|
7667
|
+
resetModalOpen && /* @__PURE__ */ React85.createElement(
|
|
7147
7668
|
WarningModal_default,
|
|
7148
7669
|
{
|
|
7149
7670
|
message: "Are you sure you want to reset the widget?",
|
|
@@ -7155,7 +7676,7 @@ var TransferWidget = ({
|
|
|
7155
7676
|
onCancel: () => setResetModalOpen(false)
|
|
7156
7677
|
}
|
|
7157
7678
|
),
|
|
7158
|
-
warningModalOpen && /* @__PURE__ */
|
|
7679
|
+
warningModalOpen && /* @__PURE__ */ React85.createElement(
|
|
7159
7680
|
WarningModal_default,
|
|
7160
7681
|
{
|
|
7161
7682
|
message: warningModalOpen.message,
|
|
@@ -7169,14 +7690,14 @@ var TransferWidget = ({
|
|
|
7169
7690
|
}
|
|
7170
7691
|
}
|
|
7171
7692
|
),
|
|
7172
|
-
mode === "payment" /* payment */ && !transactionOption && /* @__PURE__ */
|
|
7173
|
-
/* @__PURE__ */
|
|
7693
|
+
mode === "payment" /* payment */ && !transactionOption && /* @__PURE__ */ React85.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."),
|
|
7694
|
+
/* @__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", { 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__ */ React85.createElement("div", { className: "control-buttons" }, pendingTxs > 0 ? /* @__PURE__ */ React85.createElement(TxButton_default, { theme }) : null, /* @__PURE__ */ React85.createElement(
|
|
7174
7695
|
ExternalLink_default,
|
|
7175
7696
|
{
|
|
7176
7697
|
to: helpURL ? helpURL : networkOption === "testnet" /* testnet */ ? "https://docs.kima.network/kima-network/try-kima-with-the-demo-app" : "https://support.kima.network"
|
|
7177
7698
|
},
|
|
7178
|
-
/* @__PURE__ */
|
|
7179
|
-
), sourceChain.shortName === "CC" && formStep > 0 && /* @__PURE__ */
|
|
7699
|
+
/* @__PURE__ */ React85.createElement("div", { className: "menu-button" }, "I need help")
|
|
7700
|
+
), sourceChain.shortName === "CC" && formStep > 0 && /* @__PURE__ */ React85.createElement(ExternalLink_default, { to: "https://docs.kima.network/kima-network/supported-fiat#unsupported-countries-credit-cards" }, /* @__PURE__ */ React85.createElement("div", { className: "menu-button" }, "Unsupported Countries")), formStep === 0 && mode !== "payment" /* payment */ && /* @__PURE__ */ React85.createElement(
|
|
7180
7701
|
"button",
|
|
7181
7702
|
{
|
|
7182
7703
|
className: "reset-button",
|
|
@@ -7184,7 +7705,17 @@ var TransferWidget = ({
|
|
|
7184
7705
|
disabled: isApproving || isSubmitting || isSigning
|
|
7185
7706
|
},
|
|
7186
7707
|
"Reset"
|
|
7187
|
-
)
|
|
7708
|
+
), closeHandler && /* @__PURE__ */ React85.createElement(
|
|
7709
|
+
"button",
|
|
7710
|
+
{
|
|
7711
|
+
className: "cross-icon-button",
|
|
7712
|
+
onClick: () => {
|
|
7713
|
+
resetForm();
|
|
7714
|
+
closeHandler(0);
|
|
7715
|
+
}
|
|
7716
|
+
},
|
|
7717
|
+
/* @__PURE__ */ React85.createElement(Cross_default, null)
|
|
7718
|
+
))), mode === "payment" /* payment */ && paymentTitleOption?.title && /* @__PURE__ */ React85.createElement("h4", { className: "subtitle" }, paymentTitleOption.title)), /* @__PURE__ */ React85.createElement("div", { className: "kima-card-content", ref: mainRef }, formStep === 0 ? /* @__PURE__ */ React85.createElement(
|
|
7188
7719
|
SingleForm_default,
|
|
7189
7720
|
{
|
|
7190
7721
|
...{
|
|
@@ -7197,7 +7728,7 @@ var TransferWidget = ({
|
|
|
7197
7728
|
setInitialSelection
|
|
7198
7729
|
}
|
|
7199
7730
|
}
|
|
7200
|
-
) : ccTransactionStatus !== "idle" ? /* @__PURE__ */
|
|
7731
|
+
) : ccTransactionStatus !== "idle" ? /* @__PURE__ */ React85.createElement(CCWidget_default, { submitCallback: submit }) : /* @__PURE__ */ React85.createElement(
|
|
7201
7732
|
ConfirmDetails_default,
|
|
7202
7733
|
{
|
|
7203
7734
|
...{
|
|
@@ -7205,12 +7736,12 @@ var TransferWidget = ({
|
|
|
7205
7736
|
feeOptionDisabled
|
|
7206
7737
|
}
|
|
7207
7738
|
}
|
|
7208
|
-
)), /* @__PURE__ */
|
|
7739
|
+
)), /* @__PURE__ */ React85.createElement(
|
|
7209
7740
|
"div",
|
|
7210
7741
|
{
|
|
7211
7742
|
className: `kima-card-footer ${mode === "bridge" /* bridge */ && formStep !== 0 && "confirm"}`
|
|
7212
7743
|
},
|
|
7213
|
-
/* @__PURE__ */
|
|
7744
|
+
/* @__PURE__ */ React85.createElement("div", { className: `button-group` }, isBackButtonEnabled && /* @__PURE__ */ React85.createElement(
|
|
7214
7745
|
SecondaryButton_default,
|
|
7215
7746
|
{
|
|
7216
7747
|
clickHandler: onBack,
|
|
@@ -7218,7 +7749,7 @@ var TransferWidget = ({
|
|
|
7218
7749
|
disabled: isApproving || isSubmitting || isSigning
|
|
7219
7750
|
},
|
|
7220
7751
|
formStep > 0 && ccTransactionStatus !== "initialized" ? "Back" : "Cancel"
|
|
7221
|
-
), !!allowance && allowance > 0 && formStep !== 0 && sourceChain.shortName !== "CC" && mode !== "light" /* light */ ? /* @__PURE__ */
|
|
7752
|
+
), !!allowance && allowance > 0 && formStep !== 0 && sourceChain.shortName !== "CC" && mode !== "light" /* light */ && dAppOption !== "LPDrain" /* LPDrain */ ? /* @__PURE__ */ React85.createElement(
|
|
7222
7753
|
SecondaryButton_default,
|
|
7223
7754
|
{
|
|
7224
7755
|
clickHandler: onCancelApprove,
|
|
@@ -7227,7 +7758,7 @@ var TransferWidget = ({
|
|
|
7227
7758
|
disabled: isCancellingApprove || isApproving || isSubmitting || isSigning
|
|
7228
7759
|
},
|
|
7229
7760
|
isCancellingApprove ? "Cancelling Approval" : "Cancel Approve"
|
|
7230
|
-
) : null, isSubmitButtonEnabled && /* @__PURE__ */
|
|
7761
|
+
) : null, isSubmitButtonEnabled && /* @__PURE__ */ React85.createElement(
|
|
7231
7762
|
PrimaryButton_default,
|
|
7232
7763
|
{
|
|
7233
7764
|
clickHandler: onNext,
|
|
@@ -7236,7 +7767,7 @@ var TransferWidget = ({
|
|
|
7236
7767
|
},
|
|
7237
7768
|
getButtonLabel()
|
|
7238
7769
|
))
|
|
7239
|
-
), /* @__PURE__ */
|
|
7770
|
+
), /* @__PURE__ */ React85.createElement(SolanaWalletConnectModal_default, null), /* @__PURE__ */ React85.createElement(TronWalletConnectModal_default, null), /* @__PURE__ */ React85.createElement(
|
|
7240
7771
|
Toaster2,
|
|
7241
7772
|
{
|
|
7242
7773
|
position: "top-right",
|
|
@@ -7261,7 +7792,7 @@ var TransferWidget = ({
|
|
|
7261
7792
|
}
|
|
7262
7793
|
}
|
|
7263
7794
|
}
|
|
7264
|
-
), /* @__PURE__ */
|
|
7795
|
+
), /* @__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(KimaNetwork_default, null))))
|
|
7265
7796
|
);
|
|
7266
7797
|
};
|
|
7267
7798
|
|
|
@@ -7269,10 +7800,10 @@ var TransferWidget = ({
|
|
|
7269
7800
|
import { useAppKitTheme } from "@reown/appkit/react";
|
|
7270
7801
|
|
|
7271
7802
|
// src/hooks/useDebugMode.ts
|
|
7272
|
-
import { useEffect as useEffect22, useState as
|
|
7803
|
+
import { useEffect as useEffect22, useState as useState16 } from "react";
|
|
7273
7804
|
var useDebugCode = (sequence = ["D", "E", "B", "U", "G"]) => {
|
|
7274
|
-
const [debugMode, setDebugMode] =
|
|
7275
|
-
const [, setInputSequence] =
|
|
7805
|
+
const [debugMode, setDebugMode] = useState16(false);
|
|
7806
|
+
const [, setInputSequence] = useState16([]);
|
|
7276
7807
|
useEffect22(() => {
|
|
7277
7808
|
const onKeyDown = (e) => {
|
|
7278
7809
|
setInputSequence((prev) => {
|
|
@@ -7300,7 +7831,7 @@ var useDebugCode = (sequence = ["D", "E", "B", "U", "G"]) => {
|
|
|
7300
7831
|
};
|
|
7301
7832
|
|
|
7302
7833
|
// src/components/ErrorWidget.tsx
|
|
7303
|
-
import
|
|
7834
|
+
import React86 from "react";
|
|
7304
7835
|
import { useSelector as useSelector46 } from "react-redux";
|
|
7305
7836
|
var ErrorWidget = ({
|
|
7306
7837
|
theme,
|
|
@@ -7313,7 +7844,7 @@ var ErrorWidget = ({
|
|
|
7313
7844
|
const ccTransactionId = useSelector46(selectCCTransactionId);
|
|
7314
7845
|
const isCreditCardSource = sourceChain.shortName === "CC";
|
|
7315
7846
|
const isRetrying = useSelector46(selectCCTransactionRetrying);
|
|
7316
|
-
return /* @__PURE__ */
|
|
7847
|
+
return /* @__PURE__ */ React86.createElement(
|
|
7317
7848
|
"div",
|
|
7318
7849
|
{
|
|
7319
7850
|
className: `kima-card ${theme.colorMode}`,
|
|
@@ -7321,7 +7852,7 @@ var ErrorWidget = ({
|
|
|
7321
7852
|
background: theme.colorMode === "light" /* light */ ? theme.backgroundColorLight : theme.backgroundColorDark
|
|
7322
7853
|
}
|
|
7323
7854
|
},
|
|
7324
|
-
/* @__PURE__ */
|
|
7855
|
+
/* @__PURE__ */ React86.createElement("div", { className: "transfer-card" }, /* @__PURE__ */ React86.createElement("div", { className: "kima-card-header" }, /* @__PURE__ */ React86.createElement("div", { className: "topbar" }, /* @__PURE__ */ React86.createElement("div", { className: "title" }, /* @__PURE__ */ React86.createElement("h3", null, title))), /* @__PURE__ */ React86.createElement("h4", { className: "subtitle" })), /* @__PURE__ */ React86.createElement("div", { className: "kima-card-content error" }, isCreditCardSource && !isRetrying && /* @__PURE__ */ React86.createElement(Error_default, { width: 40, height: 40 }), message && message !== "" && /* @__PURE__ */ React86.createElement("h2", null, message), isCreditCardSource && /* @__PURE__ */ React86.createElement(
|
|
7325
7856
|
"div",
|
|
7326
7857
|
{
|
|
7327
7858
|
style: {
|
|
@@ -7330,8 +7861,8 @@ var ErrorWidget = ({
|
|
|
7330
7861
|
flexDirection: "column"
|
|
7331
7862
|
}
|
|
7332
7863
|
},
|
|
7333
|
-
isRetrying ? /* @__PURE__ */
|
|
7334
|
-
ccTransactionId && /* @__PURE__ */
|
|
7864
|
+
isRetrying ? /* @__PURE__ */ React86.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__ */ React86.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."),
|
|
7865
|
+
ccTransactionId && /* @__PURE__ */ React86.createElement(
|
|
7335
7866
|
"div",
|
|
7336
7867
|
{
|
|
7337
7868
|
style: {
|
|
@@ -7341,7 +7872,7 @@ var ErrorWidget = ({
|
|
|
7341
7872
|
justifyContent: "center"
|
|
7342
7873
|
}
|
|
7343
7874
|
},
|
|
7344
|
-
/* @__PURE__ */
|
|
7875
|
+
/* @__PURE__ */ React86.createElement(
|
|
7345
7876
|
"code",
|
|
7346
7877
|
{
|
|
7347
7878
|
style: {
|
|
@@ -7352,10 +7883,10 @@ var ErrorWidget = ({
|
|
|
7352
7883
|
},
|
|
7353
7884
|
ccTransactionId
|
|
7354
7885
|
),
|
|
7355
|
-
/* @__PURE__ */
|
|
7886
|
+
/* @__PURE__ */ React86.createElement(CopyButton_default, { text: ccTransactionId })
|
|
7356
7887
|
),
|
|
7357
|
-
isRetrying && /* @__PURE__ */
|
|
7358
|
-
)), backButtonEnabled && /* @__PURE__ */
|
|
7888
|
+
isRetrying && /* @__PURE__ */ React86.createElement(ring_default, { width: 30, height: 30, fill: "#86b8ce" })
|
|
7889
|
+
)), backButtonEnabled && /* @__PURE__ */ React86.createElement(
|
|
7359
7890
|
"div",
|
|
7360
7891
|
{
|
|
7361
7892
|
style: {
|
|
@@ -7364,8 +7895,8 @@ var ErrorWidget = ({
|
|
|
7364
7895
|
marginTop: 16
|
|
7365
7896
|
}
|
|
7366
7897
|
},
|
|
7367
|
-
/* @__PURE__ */
|
|
7368
|
-
), /* @__PURE__ */
|
|
7898
|
+
/* @__PURE__ */ React86.createElement(PrimaryButton_default, { clickHandler: backButtonFunction }, "Back")
|
|
7899
|
+
), /* @__PURE__ */ React86.createElement("div", { className: "kima-card-footer" }), /* @__PURE__ */ React86.createElement("div", { className: "floating-footer" }, /* @__PURE__ */ React86.createElement("div", { className: `items ${theme.colorMode}` }, /* @__PURE__ */ React86.createElement("span", null, "Powered by"), /* @__PURE__ */ React86.createElement(FooterLogo_default, { width: 50, fill: "black" }), /* @__PURE__ */ React86.createElement("strong", null, "Network"))))
|
|
7369
7900
|
);
|
|
7370
7901
|
};
|
|
7371
7902
|
var ErrorWidget_default = ErrorWidget;
|
|
@@ -7379,7 +7910,7 @@ var KimaWidgetWrapper = ({
|
|
|
7379
7910
|
titleOption,
|
|
7380
7911
|
paymentTitleOption,
|
|
7381
7912
|
helpURL = "",
|
|
7382
|
-
compliantOption =
|
|
7913
|
+
compliantOption = false,
|
|
7383
7914
|
transactionOption,
|
|
7384
7915
|
chainData,
|
|
7385
7916
|
envOptions
|
|
@@ -7443,9 +7974,9 @@ var KimaWidgetWrapper = ({
|
|
|
7443
7974
|
console.log("widget wrapper", submitted, ccTransactionStatus);
|
|
7444
7975
|
if (submitted) {
|
|
7445
7976
|
logger_default.debug("will return transaction widget on cc success");
|
|
7446
|
-
return /* @__PURE__ */
|
|
7977
|
+
return /* @__PURE__ */ React87.createElement(TransactionWidget, { theme });
|
|
7447
7978
|
} else if (ccTransactionStatus === "error-id") {
|
|
7448
|
-
return /* @__PURE__ */
|
|
7979
|
+
return /* @__PURE__ */ React87.createElement(
|
|
7449
7980
|
ErrorWidget_default,
|
|
7450
7981
|
{
|
|
7451
7982
|
theme,
|
|
@@ -7459,7 +7990,7 @@ var KimaWidgetWrapper = ({
|
|
|
7459
7990
|
}
|
|
7460
7991
|
);
|
|
7461
7992
|
} else if (ccTransactionStatus === "error-generic") {
|
|
7462
|
-
return /* @__PURE__ */
|
|
7993
|
+
return /* @__PURE__ */ React87.createElement(
|
|
7463
7994
|
ErrorWidget_default,
|
|
7464
7995
|
{
|
|
7465
7996
|
theme,
|
|
@@ -7473,7 +8004,7 @@ var KimaWidgetWrapper = ({
|
|
|
7473
8004
|
}
|
|
7474
8005
|
);
|
|
7475
8006
|
}
|
|
7476
|
-
return /* @__PURE__ */
|
|
8007
|
+
return /* @__PURE__ */ React87.createElement(
|
|
7477
8008
|
TransferWidget,
|
|
7478
8009
|
{
|
|
7479
8010
|
theme,
|
|
@@ -7483,7 +8014,7 @@ var KimaWidgetWrapper = ({
|
|
|
7483
8014
|
}
|
|
7484
8015
|
);
|
|
7485
8016
|
}
|
|
7486
|
-
return submitted ? /* @__PURE__ */
|
|
8017
|
+
return submitted ? /* @__PURE__ */ React87.createElement(TransactionWidget, { theme }) : /* @__PURE__ */ React87.createElement(
|
|
7487
8018
|
TransferWidget,
|
|
7488
8019
|
{
|
|
7489
8020
|
theme,
|
|
@@ -7499,9 +8030,9 @@ var KimaWidgetWrapper_default = KimaWidgetWrapper;
|
|
|
7499
8030
|
import { useDispatch as useDispatch28 } from "react-redux";
|
|
7500
8031
|
|
|
7501
8032
|
// src/SkeletonLoader.tsx
|
|
7502
|
-
import
|
|
8033
|
+
import React88 from "react";
|
|
7503
8034
|
var SkeletonLoader = ({ theme }) => {
|
|
7504
|
-
return /* @__PURE__ */
|
|
8035
|
+
return /* @__PURE__ */ React88.createElement(
|
|
7505
8036
|
"div",
|
|
7506
8037
|
{
|
|
7507
8038
|
className: `kima-card ${theme.colorMode}`,
|
|
@@ -7509,7 +8040,7 @@ var SkeletonLoader = ({ theme }) => {
|
|
|
7509
8040
|
background: theme.colorMode === "light" /* light */ ? theme.backgroundColorLight : theme.backgroundColorDark
|
|
7510
8041
|
}
|
|
7511
8042
|
},
|
|
7512
|
-
/* @__PURE__ */
|
|
8043
|
+
/* @__PURE__ */ React88.createElement("div", { className: "transfer-card" }, /* @__PURE__ */ React88.createElement("div", { className: "kima-card-header" }, /* @__PURE__ */ React88.createElement("div", { className: "topbar" }, /* @__PURE__ */ React88.createElement("div", { className: "title skeleton" }, /* @__PURE__ */ React88.createElement("h3", null))), /* @__PURE__ */ React88.createElement("h4", { className: "subtitle" })), /* @__PURE__ */ React88.createElement("div", { className: "kima-card-content skeleton" }, /* @__PURE__ */ React88.createElement("div", { className: "skeleton" }), /* @__PURE__ */ React88.createElement("div", { className: "skeleton" }), /* @__PURE__ */ React88.createElement("div", { className: "skeleton" }), /* @__PURE__ */ React88.createElement("div", { className: "skeleton" }), /* @__PURE__ */ React88.createElement("div", { className: "skeleton" })), /* @__PURE__ */ React88.createElement("div", { className: `kima-card-footer` }, /* @__PURE__ */ React88.createElement("div", { className: `button-group skeleton` }, /* @__PURE__ */ React88.createElement("div", { className: "skeleton" }))), /* @__PURE__ */ React88.createElement("div", { className: "floating-footer" }, /* @__PURE__ */ React88.createElement("div", { className: `items ${theme.colorMode}` }, /* @__PURE__ */ React88.createElement("span", null, "Powered by"), /* @__PURE__ */ React88.createElement(FooterLogo_default, { width: 50, fill: "black" }), /* @__PURE__ */ React88.createElement("strong", null, "Network"))))
|
|
7513
8044
|
);
|
|
7514
8045
|
};
|
|
7515
8046
|
var SkeletonLoader_default = SkeletonLoader;
|
|
@@ -7528,7 +8059,7 @@ var KimaTransactionWidget = ({
|
|
|
7528
8059
|
}) => {
|
|
7529
8060
|
const dispatch = useDispatch28();
|
|
7530
8061
|
const { kimaBackendUrl } = useKimaContext();
|
|
7531
|
-
const [hydrated, setHydrated] =
|
|
8062
|
+
const [hydrated, setHydrated] = useState17(false);
|
|
7532
8063
|
const {
|
|
7533
8064
|
data: envOptions,
|
|
7534
8065
|
error: envOptionsError,
|
|
@@ -7554,11 +8085,11 @@ var KimaTransactionWidget = ({
|
|
|
7554
8085
|
}
|
|
7555
8086
|
}, [theme?.colorMode]);
|
|
7556
8087
|
if (!hydrated || !theme?.colorMode)
|
|
7557
|
-
return /* @__PURE__ */
|
|
8088
|
+
return /* @__PURE__ */ React89.createElement(ring_default, { width: 20, height: 20, fill: "#86b8ce" });
|
|
7558
8089
|
if (isLoadingEnvs || isLoadingChainData)
|
|
7559
|
-
return /* @__PURE__ */
|
|
8090
|
+
return /* @__PURE__ */ React89.createElement(SkeletonLoader_default, { theme });
|
|
7560
8091
|
if (envOptionsError || !envOptions)
|
|
7561
|
-
return /* @__PURE__ */
|
|
8092
|
+
return /* @__PURE__ */ React89.createElement(
|
|
7562
8093
|
ErrorWidget_default,
|
|
7563
8094
|
{
|
|
7564
8095
|
theme,
|
|
@@ -7567,7 +8098,7 @@ var KimaTransactionWidget = ({
|
|
|
7567
8098
|
}
|
|
7568
8099
|
);
|
|
7569
8100
|
if (chainDataError || !chainData)
|
|
7570
|
-
return /* @__PURE__ */
|
|
8101
|
+
return /* @__PURE__ */ React89.createElement(
|
|
7571
8102
|
ErrorWidget_default,
|
|
7572
8103
|
{
|
|
7573
8104
|
theme,
|
|
@@ -7575,7 +8106,7 @@ var KimaTransactionWidget = ({
|
|
|
7575
8106
|
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 */
|
|
7576
8107
|
}
|
|
7577
8108
|
);
|
|
7578
|
-
return /* @__PURE__ */
|
|
8109
|
+
return /* @__PURE__ */ React89.createElement(
|
|
7579
8110
|
KimaWidgetWrapper_default,
|
|
7580
8111
|
{
|
|
7581
8112
|
...{
|