@kimafinance/kima-transaction-widget 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +684 -692
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +357 -3
- package/dist/index.d.ts +357 -3
- package/dist/index.js +692 -700
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -201,7 +201,7 @@ import { jsx as jsx6 } from "react/jsx-runtime";
|
|
|
201
201
|
|
|
202
202
|
// src/assets/icons/Arrow.tsx
|
|
203
203
|
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
204
|
-
var
|
|
204
|
+
var Arrow = ({ width = 22, height = 25, fill = "none", ...rest }) => {
|
|
205
205
|
return /* @__PURE__ */ jsxs3(
|
|
206
206
|
"svg",
|
|
207
207
|
{
|
|
@@ -225,7 +225,7 @@ var Arrow2 = ({ width = 22, height = 25, fill = "none", ...rest }) => {
|
|
|
225
225
|
}
|
|
226
226
|
);
|
|
227
227
|
};
|
|
228
|
-
var Arrow_default =
|
|
228
|
+
var Arrow_default = Arrow;
|
|
229
229
|
|
|
230
230
|
// src/assets/icons/Lock.tsx
|
|
231
231
|
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
@@ -5235,12 +5235,8 @@ var ExternalLink = ({ to, children, className, rest }) => /* @__PURE__ */ jsx55(
|
|
|
5235
5235
|
);
|
|
5236
5236
|
var ExternalLink_default = ExternalLink;
|
|
5237
5237
|
|
|
5238
|
-
// src/components/reusable/NetworkLabel.tsx
|
|
5239
|
-
import { useSelector as useSelector26 } from "react-redux";
|
|
5240
|
-
import { jsx as jsx56, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
5241
|
-
|
|
5242
5238
|
// src/components/reusable/PrimaryButton.tsx
|
|
5243
|
-
import { jsx as
|
|
5239
|
+
import { jsx as jsx56, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
5244
5240
|
var PrimaryButton = ({
|
|
5245
5241
|
className,
|
|
5246
5242
|
clickHandler,
|
|
@@ -5249,7 +5245,7 @@ var PrimaryButton = ({
|
|
|
5249
5245
|
disabled = false,
|
|
5250
5246
|
ref
|
|
5251
5247
|
}) => {
|
|
5252
|
-
return /* @__PURE__ */
|
|
5248
|
+
return /* @__PURE__ */ jsx56("div", { className: "primary-button-wrapper", children: /* @__PURE__ */ jsxs31(
|
|
5253
5249
|
"button",
|
|
5254
5250
|
{
|
|
5255
5251
|
className: `primary-button ${className}`,
|
|
@@ -5257,7 +5253,7 @@ var PrimaryButton = ({
|
|
|
5257
5253
|
ref,
|
|
5258
5254
|
disabled,
|
|
5259
5255
|
children: [
|
|
5260
|
-
isLoading && /* @__PURE__ */
|
|
5256
|
+
isLoading && /* @__PURE__ */ jsx56("div", { className: "loading-indicator", children: /* @__PURE__ */ jsx56(ring_default, { width: 24, height: 24, fill: "white" }) }),
|
|
5261
5257
|
children
|
|
5262
5258
|
]
|
|
5263
5259
|
}
|
|
@@ -5266,7 +5262,7 @@ var PrimaryButton = ({
|
|
|
5266
5262
|
var PrimaryButton_default = PrimaryButton;
|
|
5267
5263
|
|
|
5268
5264
|
// src/components/reusable/SecondaryButton.tsx
|
|
5269
|
-
import { jsx as
|
|
5265
|
+
import { jsx as jsx57, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
5270
5266
|
var SecondaryButton = ({
|
|
5271
5267
|
className,
|
|
5272
5268
|
clickHandler,
|
|
@@ -5275,7 +5271,7 @@ var SecondaryButton = ({
|
|
|
5275
5271
|
style,
|
|
5276
5272
|
disabled = false,
|
|
5277
5273
|
isLoading
|
|
5278
|
-
}) => /* @__PURE__ */
|
|
5274
|
+
}) => /* @__PURE__ */ jsxs32(
|
|
5279
5275
|
"button",
|
|
5280
5276
|
{
|
|
5281
5277
|
className: `secondary-button ${className} ${theme}`,
|
|
@@ -5283,7 +5279,7 @@ var SecondaryButton = ({
|
|
|
5283
5279
|
...style,
|
|
5284
5280
|
disabled,
|
|
5285
5281
|
children: [
|
|
5286
|
-
isLoading && /* @__PURE__ */
|
|
5282
|
+
isLoading && /* @__PURE__ */ jsx57("div", { className: "loading-indicator", children: /* @__PURE__ */ jsx57(ring_default, { width: 24, height: 24, fill: "black" }) }),
|
|
5287
5283
|
children
|
|
5288
5284
|
]
|
|
5289
5285
|
}
|
|
@@ -5292,14 +5288,14 @@ var SecondaryButton_default = SecondaryButton;
|
|
|
5292
5288
|
|
|
5293
5289
|
// src/components/reusable/WalletButton.tsx
|
|
5294
5290
|
import { useEffect as useEffect12, useMemo as useMemo24 } from "react";
|
|
5295
|
-
import { useDispatch as useDispatch5, useSelector as
|
|
5291
|
+
import { useDispatch as useDispatch5, useSelector as useSelector27 } from "react-redux";
|
|
5296
5292
|
|
|
5297
5293
|
// src/shared/lib/hooks/useGetCurrentPlugin.ts
|
|
5298
5294
|
import { useMemo as useMemo22 } from "react";
|
|
5299
|
-
import { useSelector as
|
|
5295
|
+
import { useSelector as useSelector26 } from "react-redux";
|
|
5300
5296
|
var useGetCurrentPlugin = () => {
|
|
5301
|
-
const isIndexed =
|
|
5302
|
-
const sourceChain =
|
|
5297
|
+
const isIndexed = useSelector26(selectPluginIsIndexed);
|
|
5298
|
+
const sourceChain = useSelector26(selectSourceChain);
|
|
5303
5299
|
const currentPlugin = useMemo22(() => {
|
|
5304
5300
|
if (!isIndexed || !sourceChain?.shortName) return null;
|
|
5305
5301
|
const plugin = getPlugin(sourceChain.shortName) ?? null;
|
|
@@ -5319,7 +5315,7 @@ var useGetCurrentPlugin_default = useGetCurrentPlugin;
|
|
|
5319
5315
|
|
|
5320
5316
|
// src/shared/plugins/default.tsx
|
|
5321
5317
|
import { useCallback as useCallback11, useMemo as useMemo23 } from "react";
|
|
5322
|
-
import { Fragment as Fragment5, jsx as
|
|
5318
|
+
import { Fragment as Fragment5, jsx as jsx58 } from "react/jsx-runtime";
|
|
5323
5319
|
var DefaultPlugin = class extends PluginBase {
|
|
5324
5320
|
constructor(storeArg) {
|
|
5325
5321
|
super({
|
|
@@ -5359,7 +5355,7 @@ var DefaultPlugin = class extends PluginBase {
|
|
|
5359
5355
|
// Never “compatible” so it won’t be picked for any chain
|
|
5360
5356
|
isCompatible = () => false;
|
|
5361
5357
|
// Transparent provider: renders children as-is
|
|
5362
|
-
Provider = ({ children }) => /* @__PURE__ */
|
|
5358
|
+
Provider = ({ children }) => /* @__PURE__ */ jsx58(Fragment5, { children });
|
|
5363
5359
|
};
|
|
5364
5360
|
var defaultPlugin = new DefaultPlugin(store_default);
|
|
5365
5361
|
var default_default = defaultPlugin;
|
|
@@ -5438,7 +5434,7 @@ import { useAppKit, useAppKitState } from "@reown/appkit/react";
|
|
|
5438
5434
|
|
|
5439
5435
|
// src/components/reusable/CopyButton.tsx
|
|
5440
5436
|
import { useEffect as useEffect10, useState as useState4 } from "react";
|
|
5441
|
-
import { jsx as
|
|
5437
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
5442
5438
|
var CopyButton = ({ text }) => {
|
|
5443
5439
|
const [copyClicked, setCopyClicked] = useState4(false);
|
|
5444
5440
|
useEffect10(() => {
|
|
@@ -5447,7 +5443,7 @@ var CopyButton = ({ text }) => {
|
|
|
5447
5443
|
setCopyClicked(false);
|
|
5448
5444
|
}, 2e3);
|
|
5449
5445
|
}, [copyClicked]);
|
|
5450
|
-
return /* @__PURE__ */
|
|
5446
|
+
return /* @__PURE__ */ jsx59(
|
|
5451
5447
|
"span",
|
|
5452
5448
|
{
|
|
5453
5449
|
className: "copy-btn",
|
|
@@ -5455,71 +5451,71 @@ var CopyButton = ({ text }) => {
|
|
|
5455
5451
|
setCopyClicked(true);
|
|
5456
5452
|
navigator.clipboard.writeText(text);
|
|
5457
5453
|
},
|
|
5458
|
-
children: copyClicked ? /* @__PURE__ */
|
|
5454
|
+
children: copyClicked ? /* @__PURE__ */ jsx59(Check_default, {}) : /* @__PURE__ */ jsx59(Copy_default, {})
|
|
5459
5455
|
}
|
|
5460
5456
|
);
|
|
5461
5457
|
};
|
|
5462
5458
|
var CopyButton_default = CopyButton;
|
|
5463
5459
|
|
|
5464
5460
|
// src/hooks/useHideActivityTab.tsx
|
|
5465
|
-
import { useEffect as useEffect11 } from "react";
|
|
5461
|
+
import { useEffect as useEffect11, useRef } from "react";
|
|
5466
5462
|
function useHideWuiListItem(isModalOpen) {
|
|
5463
|
+
const observerRef = useRef(null);
|
|
5467
5464
|
useEffect11(() => {
|
|
5468
5465
|
const modalSelector = "w3m-modal";
|
|
5469
|
-
let observer;
|
|
5470
5466
|
const hideFirstWuiListItem = (parent) => {
|
|
5471
5467
|
const stack = [parent];
|
|
5472
|
-
while (stack.length
|
|
5468
|
+
while (stack.length) {
|
|
5473
5469
|
const current = stack.shift();
|
|
5474
|
-
if (
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5470
|
+
if (current instanceof Element) {
|
|
5471
|
+
if (current.tagName === "WUI-LIST-ITEM") {
|
|
5472
|
+
;
|
|
5473
|
+
current.style.display = "none";
|
|
5474
|
+
break;
|
|
5475
|
+
}
|
|
5476
|
+
const sr = current.shadowRoot;
|
|
5477
|
+
if (sr) stack.push(sr);
|
|
5478
|
+
stack.push(...Array.from(current.children ?? []));
|
|
5479
|
+
} else if (current instanceof ShadowRoot) {
|
|
5480
|
+
stack.push(...Array.from(current.children));
|
|
5481
5481
|
}
|
|
5482
|
-
stack.push(...Array.from(current.children));
|
|
5483
5482
|
}
|
|
5484
5483
|
};
|
|
5485
5484
|
const observeModal = () => {
|
|
5486
5485
|
const modal = document.querySelector(modalSelector);
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
hideFirstWuiListItem(wuiFlex);
|
|
5492
|
-
}
|
|
5493
|
-
}
|
|
5486
|
+
const sr = modal?.shadowRoot;
|
|
5487
|
+
if (!sr) return;
|
|
5488
|
+
const wuiFlex = sr.querySelector("wui-flex");
|
|
5489
|
+
if (wuiFlex) hideFirstWuiListItem(wuiFlex);
|
|
5494
5490
|
};
|
|
5495
|
-
const
|
|
5496
|
-
|
|
5491
|
+
const startObserver = () => {
|
|
5492
|
+
observerRef.current?.disconnect();
|
|
5493
|
+
observerRef.current = new MutationObserver(() => {
|
|
5497
5494
|
const modal = document.querySelector(modalSelector);
|
|
5498
|
-
if (modal)
|
|
5499
|
-
|
|
5500
|
-
|
|
5495
|
+
if (modal) observeModal();
|
|
5496
|
+
});
|
|
5497
|
+
observerRef.current.observe(document.body, {
|
|
5498
|
+
childList: true,
|
|
5499
|
+
subtree: true
|
|
5501
5500
|
});
|
|
5502
|
-
observer.observe(document.body, { childList: true, subtree: true });
|
|
5503
5501
|
};
|
|
5504
5502
|
if (isModalOpen) {
|
|
5505
|
-
|
|
5503
|
+
startObserver();
|
|
5506
5504
|
observeModal();
|
|
5507
5505
|
} else {
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
}
|
|
5506
|
+
observerRef.current?.disconnect();
|
|
5507
|
+
observerRef.current = null;
|
|
5511
5508
|
}
|
|
5512
5509
|
return () => {
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
}
|
|
5510
|
+
observerRef.current?.disconnect();
|
|
5511
|
+
observerRef.current = null;
|
|
5516
5512
|
};
|
|
5517
5513
|
}, [isModalOpen]);
|
|
5518
5514
|
}
|
|
5519
5515
|
var useHideActivityTab_default = useHideWuiListItem;
|
|
5520
5516
|
|
|
5521
5517
|
// src/components/reusable/WalletButton.tsx
|
|
5522
|
-
import { Fragment as Fragment6, jsx as
|
|
5518
|
+
import { Fragment as Fragment6, jsx as jsx60, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
5523
5519
|
var TAG = "[WalletButton]";
|
|
5524
5520
|
var WalletButton = ({
|
|
5525
5521
|
errorBelow = false,
|
|
@@ -5527,15 +5523,15 @@ var WalletButton = ({
|
|
|
5527
5523
|
placeholder = false
|
|
5528
5524
|
}) => {
|
|
5529
5525
|
const dispatch = useDispatch5();
|
|
5530
|
-
const theme =
|
|
5531
|
-
const mode =
|
|
5532
|
-
const selectedCoin =
|
|
5533
|
-
const sourceCompliant =
|
|
5534
|
-
const compliantOption =
|
|
5535
|
-
const sourceNetwork =
|
|
5536
|
-
const targetNetwork =
|
|
5537
|
-
const targetAddress =
|
|
5538
|
-
const dAppOption =
|
|
5526
|
+
const theme = useSelector27(selectTheme);
|
|
5527
|
+
const mode = useSelector27(selectMode);
|
|
5528
|
+
const selectedCoin = useSelector27(selectSourceCurrency);
|
|
5529
|
+
const sourceCompliant = useSelector27(selectSourceCompliant);
|
|
5530
|
+
const compliantOption = useSelector27(selectCompliantOption);
|
|
5531
|
+
const sourceNetwork = useSelector27(selectSourceChain);
|
|
5532
|
+
const targetNetwork = useSelector27(selectTargetChain);
|
|
5533
|
+
const targetAddress = useSelector27(selectTargetAddress);
|
|
5534
|
+
const dAppOption = useSelector27(selectDappOption);
|
|
5539
5535
|
const { externalProvider } = useKimaContext();
|
|
5540
5536
|
const { connected: isSolanaConnected } = useSolanaWallet();
|
|
5541
5537
|
const { connected: isTronConnected } = useTronWallet3();
|
|
@@ -5679,12 +5675,12 @@ var WalletButton = ({
|
|
|
5679
5675
|
}, [mode, isReady, statusMessage, compliantOption, sourceCompliant]);
|
|
5680
5676
|
const renderConnectedLabel = () => {
|
|
5681
5677
|
if (isEvmSwitching) {
|
|
5682
|
-
return /* @__PURE__ */
|
|
5678
|
+
return /* @__PURE__ */ jsxs33(Fragment6, { children: [
|
|
5683
5679
|
"Switching network\u2026",
|
|
5684
|
-
/* @__PURE__ */
|
|
5685
|
-
/* @__PURE__ */
|
|
5686
|
-
/* @__PURE__ */
|
|
5687
|
-
/* @__PURE__ */
|
|
5680
|
+
/* @__PURE__ */ jsxs33("span", { className: "loading-indicator-inline", "aria-hidden": "true", children: [
|
|
5681
|
+
/* @__PURE__ */ jsx60("span", { className: "dot" }),
|
|
5682
|
+
/* @__PURE__ */ jsx60("span", { className: "dot" }),
|
|
5683
|
+
/* @__PURE__ */ jsx60("span", { className: "dot" })
|
|
5688
5684
|
] })
|
|
5689
5685
|
] });
|
|
5690
5686
|
}
|
|
@@ -5696,38 +5692,38 @@ var WalletButton = ({
|
|
|
5696
5692
|
theme.colorMode,
|
|
5697
5693
|
isEvmSwitching ? "network-switching" : ""
|
|
5698
5694
|
].filter(Boolean).join(" ");
|
|
5699
|
-
return /* @__PURE__ */
|
|
5695
|
+
return /* @__PURE__ */ jsxs33(
|
|
5700
5696
|
"div",
|
|
5701
5697
|
{
|
|
5702
5698
|
className: `wallet-button ${isConnected ? "connected" : "disconnected"} ${theme.colorMode} ${errorBelow ? "error-below" : ""}`,
|
|
5703
5699
|
"data-testid": "connect-wallet-btn",
|
|
5704
5700
|
children: [
|
|
5705
|
-
/* @__PURE__ */
|
|
5706
|
-
/* @__PURE__ */
|
|
5701
|
+
/* @__PURE__ */ jsxs33("div", { className: "info-wrapper", children: [
|
|
5702
|
+
/* @__PURE__ */ jsx60(
|
|
5707
5703
|
"button",
|
|
5708
5704
|
{
|
|
5709
5705
|
className: btnClasses,
|
|
5710
5706
|
onClick: handleClick,
|
|
5711
5707
|
disabled: !isWalletApplicable || isEvmSwitching,
|
|
5712
5708
|
"aria-busy": isEvmSwitching ? "true" : void 0,
|
|
5713
|
-
children: isConnected ? renderConnectedLabel() : /* @__PURE__ */
|
|
5709
|
+
children: isConnected ? renderConnectedLabel() : /* @__PURE__ */ jsxs33(Fragment6, { children: [
|
|
5714
5710
|
mode === "light" /* light */ && "Select Network to Load Account",
|
|
5715
5711
|
mode !== "light" /* light */ && !hasSelectedSourceNetwork && "Select Network to Connect",
|
|
5716
|
-
mode !== "light" /* light */ && hasSelectedSourceNetwork && /* @__PURE__ */
|
|
5717
|
-
/* @__PURE__ */
|
|
5712
|
+
mode !== "light" /* light */ && hasSelectedSourceNetwork && /* @__PURE__ */ jsxs33(Fragment6, { children: [
|
|
5713
|
+
/* @__PURE__ */ jsx60(Wallet_default, {}),
|
|
5718
5714
|
"Connect Wallet"
|
|
5719
5715
|
] })
|
|
5720
5716
|
] })
|
|
5721
5717
|
}
|
|
5722
5718
|
),
|
|
5723
|
-
isConnected && !placeholder && displayedAddress && !isEvmSwitching && /* @__PURE__ */
|
|
5719
|
+
isConnected && !placeholder && displayedAddress && !isEvmSwitching && /* @__PURE__ */ jsx60(CopyButton_default, { text: displayedAddress })
|
|
5724
5720
|
] }),
|
|
5725
|
-
isConnected && mode !== "light" /* light */ && !placeholder && /* @__PURE__ */
|
|
5721
|
+
isConnected && mode !== "light" /* light */ && !placeholder && /* @__PURE__ */ jsx60(Fragment6, { children: balance !== void 0 && decimals !== void 0 ? /* @__PURE__ */ jsxs33("p", { className: "balance-info", children: [
|
|
5726
5722
|
formatUSD(bigIntToNumber({ value: balance, decimals })),
|
|
5727
5723
|
" ",
|
|
5728
5724
|
selectedCoin,
|
|
5729
5725
|
" available"
|
|
5730
|
-
] }) : /* @__PURE__ */
|
|
5726
|
+
] }) : /* @__PURE__ */ jsx60("div", { className: "loading", "aria-label": "balance-loading" }) })
|
|
5731
5727
|
]
|
|
5732
5728
|
}
|
|
5733
5729
|
);
|
|
@@ -5735,20 +5731,20 @@ var WalletButton = ({
|
|
|
5735
5731
|
var WalletButton_default = WalletButton;
|
|
5736
5732
|
|
|
5737
5733
|
// src/components/reusable/CoinDropdown.tsx
|
|
5738
|
-
import { useEffect as useEffect14, useRef, useState as useState5 } from "react";
|
|
5739
|
-
import { useDispatch as useDispatch7, useSelector as
|
|
5734
|
+
import { useEffect as useEffect14, useRef as useRef2, useState as useState5 } from "react";
|
|
5735
|
+
import { useDispatch as useDispatch7, useSelector as useSelector29 } from "react-redux";
|
|
5740
5736
|
|
|
5741
5737
|
// src/widgets/transfer/hooks/useCurrencyOptions.tsx
|
|
5742
5738
|
import { useEffect as useEffect13, useMemo as useMemo25 } from "react";
|
|
5743
|
-
import { useSelector as
|
|
5739
|
+
import { useSelector as useSelector28, useDispatch as useDispatch6 } from "react-redux";
|
|
5744
5740
|
var emptyTokenList = { tokenList: [] };
|
|
5745
5741
|
function useCurrencyOptions(isSourceChain) {
|
|
5746
5742
|
const dispatch = useDispatch6();
|
|
5747
|
-
const mode =
|
|
5748
|
-
const sourceChain =
|
|
5749
|
-
const sourceSymbol =
|
|
5750
|
-
const targetChain =
|
|
5751
|
-
const targetSymbol =
|
|
5743
|
+
const mode = useSelector28(selectMode);
|
|
5744
|
+
const sourceChain = useSelector28(selectSourceChain);
|
|
5745
|
+
const sourceSymbol = useSelector28(selectSourceCurrency);
|
|
5746
|
+
const targetChain = useSelector28(selectTargetChain);
|
|
5747
|
+
const targetSymbol = useSelector28(selectTargetCurrency);
|
|
5752
5748
|
const output = useMemo25(() => {
|
|
5753
5749
|
const chain = isSourceChain ? sourceChain : targetChain;
|
|
5754
5750
|
const location = isSourceChain ? "origin" : "target";
|
|
@@ -5806,7 +5802,7 @@ function useCurrencyOptions(isSourceChain) {
|
|
|
5806
5802
|
}
|
|
5807
5803
|
|
|
5808
5804
|
// src/components/reusable/TokenIcon.tsx
|
|
5809
|
-
import { jsx as
|
|
5805
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
5810
5806
|
var COIN_LIST2 = {
|
|
5811
5807
|
EUR: KEUR_default,
|
|
5812
5808
|
EURC: EURC_default,
|
|
@@ -5831,27 +5827,27 @@ function TokenIcon({
|
|
|
5831
5827
|
logger_default.warn(`Token icon not found for symbol: ${symbol}`);
|
|
5832
5828
|
return null;
|
|
5833
5829
|
}
|
|
5834
|
-
return /* @__PURE__ */
|
|
5830
|
+
return /* @__PURE__ */ jsx61("div", { className: "icon-wrapper", children: /* @__PURE__ */ jsx61(Icon, { width, height }) });
|
|
5835
5831
|
}
|
|
5836
5832
|
|
|
5837
5833
|
// src/components/reusable/CoinDropdown.tsx
|
|
5838
|
-
import { Fragment as Fragment7, jsx as
|
|
5834
|
+
import { Fragment as Fragment7, jsx as jsx62, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
5839
5835
|
var CoinDropdown = ({
|
|
5840
5836
|
isSourceChain = true
|
|
5841
5837
|
}) => {
|
|
5842
|
-
const ref =
|
|
5838
|
+
const ref = useRef2(null);
|
|
5843
5839
|
const dispatch = useDispatch7();
|
|
5844
5840
|
const [collapsed, setCollapsed] = useState5(true);
|
|
5845
|
-
const theme =
|
|
5846
|
-
const mode =
|
|
5847
|
-
const dAppOption =
|
|
5848
|
-
const transactionOption =
|
|
5849
|
-
const sourceCurrency =
|
|
5850
|
-
const targetCurrency =
|
|
5841
|
+
const theme = useSelector29(selectTheme);
|
|
5842
|
+
const mode = useSelector29(selectMode);
|
|
5843
|
+
const dAppOption = useSelector29(selectDappOption);
|
|
5844
|
+
const transactionOption = useSelector29(selectTransactionOption);
|
|
5845
|
+
const sourceCurrency = useSelector29(selectSourceCurrency);
|
|
5846
|
+
const targetCurrency = useSelector29(selectTargetCurrency);
|
|
5851
5847
|
const { tokenList } = useCurrencyOptions(isSourceChain);
|
|
5852
5848
|
const tokenSymbol = isSourceChain ? sourceCurrency : targetCurrency;
|
|
5853
5849
|
const shouldLockToken = isSourceChain && mode === "payment" /* payment */ && dAppOption !== "none" /* None */ && !!transactionOption?.currency;
|
|
5854
|
-
const appliedLockRef =
|
|
5850
|
+
const appliedLockRef = useRef2(null);
|
|
5855
5851
|
useEffect14(() => {
|
|
5856
5852
|
if (!shouldLockToken) return;
|
|
5857
5853
|
const desired = transactionOption?.currency;
|
|
@@ -5893,7 +5889,7 @@ var CoinDropdown = ({
|
|
|
5893
5889
|
}
|
|
5894
5890
|
setCollapsed(true);
|
|
5895
5891
|
};
|
|
5896
|
-
return /* @__PURE__ */
|
|
5892
|
+
return /* @__PURE__ */ jsxs34(
|
|
5897
5893
|
"div",
|
|
5898
5894
|
{
|
|
5899
5895
|
className: `coin-dropdown ${theme.colorMode} ${collapsed ? "collapsed" : "toggled"} ${shouldLockToken ? "disabled" : ""}`,
|
|
@@ -5902,15 +5898,15 @@ var CoinDropdown = ({
|
|
|
5902
5898
|
},
|
|
5903
5899
|
ref,
|
|
5904
5900
|
children: [
|
|
5905
|
-
/* @__PURE__ */
|
|
5906
|
-
/* @__PURE__ */
|
|
5907
|
-
/* @__PURE__ */
|
|
5908
|
-
] }) : /* @__PURE__ */
|
|
5909
|
-
/* @__PURE__ */
|
|
5901
|
+
/* @__PURE__ */ jsx62("div", { className: "coin-wrapper", children: tokenSymbol ? /* @__PURE__ */ jsxs34(Fragment7, { children: [
|
|
5902
|
+
/* @__PURE__ */ jsx62(TokenIcon, { symbol: tokenSymbol, width: 24, height: 24 }),
|
|
5903
|
+
/* @__PURE__ */ jsx62("span", { className: "coin", children: tokenSymbol })
|
|
5904
|
+
] }) : /* @__PURE__ */ jsx62("span", { className: "coin placeholder", children: "Select token" }) }),
|
|
5905
|
+
/* @__PURE__ */ jsx62(
|
|
5910
5906
|
"div",
|
|
5911
5907
|
{
|
|
5912
5908
|
className: `coin-menu ${theme.colorMode} ${collapsed ? "collapsed" : "toggled"}`,
|
|
5913
|
-
children: tokenList.map((token) => /* @__PURE__ */
|
|
5909
|
+
children: tokenList.map((token) => /* @__PURE__ */ jsxs34(
|
|
5914
5910
|
"div",
|
|
5915
5911
|
{
|
|
5916
5912
|
className: `coin-item ${theme.colorMode}`,
|
|
@@ -5919,15 +5915,15 @@ var CoinDropdown = ({
|
|
|
5919
5915
|
handleDropdownItemClick(token.symbol);
|
|
5920
5916
|
},
|
|
5921
5917
|
children: [
|
|
5922
|
-
/* @__PURE__ */
|
|
5923
|
-
/* @__PURE__ */
|
|
5918
|
+
/* @__PURE__ */ jsx62(TokenIcon, { symbol: token.symbol, width: 24, height: 24 }),
|
|
5919
|
+
/* @__PURE__ */ jsx62("p", { children: token.symbol })
|
|
5924
5920
|
]
|
|
5925
5921
|
},
|
|
5926
5922
|
token.symbol
|
|
5927
5923
|
))
|
|
5928
5924
|
}
|
|
5929
5925
|
),
|
|
5930
|
-
!shouldLockToken && /* @__PURE__ */
|
|
5926
|
+
!shouldLockToken && /* @__PURE__ */ jsx62("div", { className: `dropdown-icon ${collapsed ? "toggled" : "collapsed"}`, children: /* @__PURE__ */ jsx62(Arrow_default, { fill: "none" }) })
|
|
5931
5927
|
]
|
|
5932
5928
|
}
|
|
5933
5929
|
);
|
|
@@ -5936,10 +5932,10 @@ var CoinDropdown_default = CoinDropdown;
|
|
|
5936
5932
|
|
|
5937
5933
|
// src/components/reusable/ConfirmDetails.tsx
|
|
5938
5934
|
import { useEffect as useEffect15, useMemo as useMemo26, useState as useState6 } from "react";
|
|
5939
|
-
import { useSelector as
|
|
5935
|
+
import { useSelector as useSelector31 } from "react-redux";
|
|
5940
5936
|
|
|
5941
5937
|
// src/components/reusable/ChainIcon.tsx
|
|
5942
|
-
import { jsx as
|
|
5938
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
5943
5939
|
var chainIcons = {
|
|
5944
5940
|
ARB: Arbitrum_default,
|
|
5945
5941
|
AVX: Avalanche_default,
|
|
@@ -5961,32 +5957,32 @@ function ChainIcon({ symbol }) {
|
|
|
5961
5957
|
const Icon = symbol === "FIAT" ? chainIcons["CC"] : chainIcons[symbol];
|
|
5962
5958
|
if (!Icon) {
|
|
5963
5959
|
if (symbol) logger_default.warn(`Chain icon not found for symbol: ${symbol}`);
|
|
5964
|
-
return /* @__PURE__ */
|
|
5960
|
+
return /* @__PURE__ */ jsx63("div", {});
|
|
5965
5961
|
}
|
|
5966
|
-
return /* @__PURE__ */
|
|
5962
|
+
return /* @__PURE__ */ jsx63("div", { className: "icon", children: /* @__PURE__ */ jsx63(Icon, {}) });
|
|
5967
5963
|
}
|
|
5968
5964
|
|
|
5969
5965
|
// src/components/reusable/FeeDeductionRadioButtons.tsx
|
|
5970
|
-
import { useDispatch as useDispatch8, useSelector as
|
|
5971
|
-
import { jsx as
|
|
5966
|
+
import { useDispatch as useDispatch8, useSelector as useSelector30 } from "react-redux";
|
|
5967
|
+
import { jsx as jsx64, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
5972
5968
|
var FeeDeductionRadioButtons = ({ disabled }) => {
|
|
5973
5969
|
const dispatch = useDispatch8();
|
|
5974
|
-
const feeDeduct =
|
|
5975
|
-
const amount =
|
|
5976
|
-
const sourceNetwork =
|
|
5977
|
-
const targetNetwork =
|
|
5978
|
-
const { totalFee: feeTotalBigInt } =
|
|
5970
|
+
const feeDeduct = useSelector30(selectFeeDeduct);
|
|
5971
|
+
const amount = useSelector30(selectAmount);
|
|
5972
|
+
const sourceNetwork = useSelector30(selectSourceChain);
|
|
5973
|
+
const targetNetwork = useSelector30(selectTargetChain);
|
|
5974
|
+
const { totalFee: feeTotalBigInt } = useSelector30(selectServiceFee);
|
|
5979
5975
|
const totalFee = bigIntToNumber(feeTotalBigInt);
|
|
5980
|
-
const sourceCurrency =
|
|
5981
|
-
const targetCurrency =
|
|
5982
|
-
const theme =
|
|
5983
|
-
const isSubmitted =
|
|
5976
|
+
const sourceCurrency = useSelector30(selectSourceCurrency);
|
|
5977
|
+
const targetCurrency = useSelector30(selectTargetCurrency);
|
|
5978
|
+
const theme = useSelector30(selectTheme);
|
|
5979
|
+
const isSubmitted = useSelector30(selectSubmitted);
|
|
5984
5980
|
const handleChange = (value) => {
|
|
5985
5981
|
dispatch(setFeeDeduct(value));
|
|
5986
5982
|
};
|
|
5987
|
-
return /* @__PURE__ */
|
|
5988
|
-
Number(amount) - totalFee > 0 && /* @__PURE__ */
|
|
5989
|
-
/* @__PURE__ */
|
|
5983
|
+
return /* @__PURE__ */ jsx64("div", { className: `fee-deduction-radio-container ${theme.colorMode}`, children: /* @__PURE__ */ jsxs35("div", { className: "fee-options", children: [
|
|
5984
|
+
Number(amount) - totalFee > 0 && /* @__PURE__ */ jsxs35("label", { className: `fee-option ${disabled ? "disabled" : ""}`, children: [
|
|
5985
|
+
/* @__PURE__ */ jsx64(
|
|
5990
5986
|
"input",
|
|
5991
5987
|
{
|
|
5992
5988
|
type: "radio",
|
|
@@ -5996,14 +5992,14 @@ var FeeDeductionRadioButtons = ({ disabled }) => {
|
|
|
5996
5992
|
onChange: () => handleChange(true)
|
|
5997
5993
|
}
|
|
5998
5994
|
),
|
|
5999
|
-
/* @__PURE__ */
|
|
5995
|
+
/* @__PURE__ */ jsx64("span", { className: `radio-label ${theme.colorMode}`, children: `Pay $${formatterFloat.format(
|
|
6000
5996
|
Number(amount)
|
|
6001
5997
|
)} ${sourceCurrency} ${["BANK", "CC"].includes(sourceNetwork.shortName) ? "with" : "in"} ${sourceNetwork.name} to receive $${formatterFloat.format(
|
|
6002
5998
|
Number(amount) - totalFee
|
|
6003
5999
|
)} ${targetCurrency} ${["BANK", "CC"].includes(targetNetwork.shortName) ? "with" : "in"} ${targetNetwork.name}` })
|
|
6004
6000
|
] }),
|
|
6005
|
-
/* @__PURE__ */
|
|
6006
|
-
/* @__PURE__ */
|
|
6001
|
+
/* @__PURE__ */ jsxs35("label", { className: `fee-option ${disabled ? "disabled" : ""}`, children: [
|
|
6002
|
+
/* @__PURE__ */ jsx64(
|
|
6007
6003
|
"input",
|
|
6008
6004
|
{
|
|
6009
6005
|
type: "radio",
|
|
@@ -6013,7 +6009,7 @@ var FeeDeductionRadioButtons = ({ disabled }) => {
|
|
|
6013
6009
|
onChange: () => handleChange(false)
|
|
6014
6010
|
}
|
|
6015
6011
|
),
|
|
6016
|
-
/* @__PURE__ */
|
|
6012
|
+
/* @__PURE__ */ jsx64("span", { className: `radio-label ${theme.colorMode}`, children: `Pay $${formatterFloat.format(
|
|
6017
6013
|
Number(amount) + totalFee
|
|
6018
6014
|
)} ${sourceCurrency} ${["BANK", "CC"].includes(sourceNetwork.shortName) ? "with" : "in"} ${sourceNetwork.name} to receive $${formatterFloat.format(
|
|
6019
6015
|
Number(amount)
|
|
@@ -6024,7 +6020,7 @@ var FeeDeductionRadioButtons = ({ disabled }) => {
|
|
|
6024
6020
|
var FeeDeductionRadioButtons_default = FeeDeductionRadioButtons;
|
|
6025
6021
|
|
|
6026
6022
|
// src/components/reusable/ConfirmDetails.tsx
|
|
6027
|
-
import { Fragment as Fragment8, jsx as
|
|
6023
|
+
import { Fragment as Fragment8, jsx as jsx65, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
6028
6024
|
var scaleUp = (value, diff) => diff <= 0 ? value : value * 10n ** BigInt(diff);
|
|
6029
6025
|
var sumBigAmts = (amts) => {
|
|
6030
6026
|
const present = amts.filter(Boolean);
|
|
@@ -6040,10 +6036,10 @@ var ConfirmDetails = ({
|
|
|
6040
6036
|
isApproved,
|
|
6041
6037
|
feeOptionDisabled
|
|
6042
6038
|
}) => {
|
|
6043
|
-
const feeDeduct =
|
|
6044
|
-
const mode =
|
|
6045
|
-
const dAppOption =
|
|
6046
|
-
const theme =
|
|
6039
|
+
const feeDeduct = useSelector31(selectFeeDeduct);
|
|
6040
|
+
const mode = useSelector31(selectMode);
|
|
6041
|
+
const dAppOption = useSelector31(selectDappOption);
|
|
6042
|
+
const theme = useSelector31(selectTheme);
|
|
6047
6043
|
const {
|
|
6048
6044
|
transactionValues,
|
|
6049
6045
|
sourceFee,
|
|
@@ -6052,13 +6048,13 @@ var ConfirmDetails = ({
|
|
|
6052
6048
|
totalFee,
|
|
6053
6049
|
swapFee,
|
|
6054
6050
|
swapInfo
|
|
6055
|
-
} =
|
|
6056
|
-
const originNetwork =
|
|
6057
|
-
const targetNetwork =
|
|
6058
|
-
const targetAddress =
|
|
6059
|
-
const networkOptions =
|
|
6051
|
+
} = useSelector31(selectServiceFee);
|
|
6052
|
+
const originNetwork = useSelector31(selectSourceChain);
|
|
6053
|
+
const targetNetwork = useSelector31(selectTargetChain);
|
|
6054
|
+
const targetAddress = useSelector31(selectTargetAddress);
|
|
6055
|
+
const networkOptions = useSelector31(selectNetworks);
|
|
6060
6056
|
const [feeCollapsed, setFeeCollapsed] = useState6(true);
|
|
6061
|
-
const transactionOption =
|
|
6057
|
+
const transactionOption = useSelector31(selectTransactionOption);
|
|
6062
6058
|
const { connectedAddress } = useIsWalletReady_default();
|
|
6063
6059
|
const targetNetworkOption = useMemo26(
|
|
6064
6060
|
() => networkOptions.filter(
|
|
@@ -6072,8 +6068,8 @@ var ConfirmDetails = ({
|
|
|
6072
6068
|
targetNetwork.shortName
|
|
6073
6069
|
]
|
|
6074
6070
|
);
|
|
6075
|
-
const sourceCurrency =
|
|
6076
|
-
const targetCurrency =
|
|
6071
|
+
const sourceCurrency = useSelector31(selectSourceCurrency);
|
|
6072
|
+
const targetCurrency = useSelector31(selectTargetCurrency);
|
|
6077
6073
|
const { width, updateWidth } = useWidth_default();
|
|
6078
6074
|
const isSwap = useMemo26(
|
|
6079
6075
|
() => !!swapInfo || !isSamePeggedToken(
|
|
@@ -6108,45 +6104,45 @@ var ConfirmDetails = ({
|
|
|
6108
6104
|
hasSwapInfo: !!swapInfo
|
|
6109
6105
|
});
|
|
6110
6106
|
}, [isSwap, sourceCurrency, targetCurrency, totalFee, swapInfo]);
|
|
6111
|
-
return /* @__PURE__ */
|
|
6112
|
-
/* @__PURE__ */
|
|
6107
|
+
return /* @__PURE__ */ jsxs36("div", { className: `confirm-details ${theme.colorMode}`, children: [
|
|
6108
|
+
/* @__PURE__ */ jsxs36("p", { children: [
|
|
6113
6109
|
"Step ",
|
|
6114
6110
|
isApproved ? "2" : "1",
|
|
6115
6111
|
"\xA0of 2\xA0\xA0\xA0",
|
|
6116
6112
|
isApproved ? "Submit transaction" : originNetwork.shortName === "FIAT" /* FIAT */ ? "Bank Details" : "Approval"
|
|
6117
6113
|
] }),
|
|
6118
|
-
/* @__PURE__ */
|
|
6119
|
-
/* @__PURE__ */
|
|
6114
|
+
/* @__PURE__ */ jsxs36("div", { className: "detail-item", children: [
|
|
6115
|
+
/* @__PURE__ */ jsxs36("span", { className: "label", children: [
|
|
6120
6116
|
"Source",
|
|
6121
6117
|
!["BANK", "CC"].includes(originNetwork.shortName) && " wallet",
|
|
6122
6118
|
":"
|
|
6123
6119
|
] }),
|
|
6124
|
-
/* @__PURE__ */
|
|
6125
|
-
/* @__PURE__ */
|
|
6126
|
-
/* @__PURE__ */
|
|
6120
|
+
/* @__PURE__ */ jsxs36("div", { className: "network-details", children: [
|
|
6121
|
+
/* @__PURE__ */ jsx65("div", { className: "kima-card-network-container", children: /* @__PURE__ */ jsxs36("span", { className: `kima-card-network-label ${theme.colorMode}`, children: [
|
|
6122
|
+
/* @__PURE__ */ jsx65(ChainIcon, { symbol: originNetwork?.shortName }),
|
|
6127
6123
|
originNetwork.name
|
|
6128
6124
|
] }) }),
|
|
6129
|
-
!["CC", "BANK"].includes(originNetwork.shortName) && /* @__PURE__ */
|
|
6125
|
+
!["CC", "BANK"].includes(originNetwork.shortName) && /* @__PURE__ */ jsx65("p", { className: theme.colorMode, children: dAppOption === "LPDrain" /* LPDrain */ ? targetAddress : connectedAddress })
|
|
6130
6126
|
] })
|
|
6131
6127
|
] }),
|
|
6132
|
-
/* @__PURE__ */
|
|
6133
|
-
dAppOption === "none" /* None */ && /* @__PURE__ */
|
|
6134
|
-
/* @__PURE__ */
|
|
6135
|
-
/* @__PURE__ */
|
|
6128
|
+
/* @__PURE__ */ jsx65("div", { className: "detail-item amount", children: /* @__PURE__ */ jsxs36("span", { className: "amount-container", children: [
|
|
6129
|
+
dAppOption === "none" /* None */ && /* @__PURE__ */ jsxs36("div", { className: "amount-details", children: [
|
|
6130
|
+
/* @__PURE__ */ jsx65("span", { children: "Amount to Transfer" }),
|
|
6131
|
+
/* @__PURE__ */ jsx65("div", { className: "coin-details", children: /* @__PURE__ */ jsxs36("p", { children: [
|
|
6136
6132
|
formatBigInt(txValues.allowanceAmount),
|
|
6137
6133
|
" ",
|
|
6138
6134
|
sourceCurrency
|
|
6139
6135
|
] }) })
|
|
6140
6136
|
] }),
|
|
6141
|
-
dAppOption === "none" /* None */ && /* @__PURE__ */
|
|
6142
|
-
/* @__PURE__ */
|
|
6143
|
-
/* @__PURE__ */
|
|
6137
|
+
dAppOption === "none" /* None */ && /* @__PURE__ */ jsxs36("div", { className: "amount-details", children: [
|
|
6138
|
+
/* @__PURE__ */ jsx65("span", { children: "Total Fees" }),
|
|
6139
|
+
/* @__PURE__ */ jsxs36(
|
|
6144
6140
|
"div",
|
|
6145
6141
|
{
|
|
6146
6142
|
className: "fee-collapse",
|
|
6147
6143
|
onClick: () => setFeeCollapsed(!feeCollapsed),
|
|
6148
6144
|
children: [
|
|
6149
|
-
/* @__PURE__ */
|
|
6145
|
+
/* @__PURE__ */ jsx65(
|
|
6150
6146
|
MiniArrow_default,
|
|
6151
6147
|
{
|
|
6152
6148
|
width: 15,
|
|
@@ -6157,7 +6153,7 @@ var ConfirmDetails = ({
|
|
|
6157
6153
|
}
|
|
6158
6154
|
}
|
|
6159
6155
|
),
|
|
6160
|
-
/* @__PURE__ */
|
|
6156
|
+
/* @__PURE__ */ jsxs36("span", { className: "service-fee", children: [
|
|
6161
6157
|
formatBigInt(totalFee),
|
|
6162
6158
|
" ",
|
|
6163
6159
|
sourceCurrency
|
|
@@ -6166,92 +6162,92 @@ var ConfirmDetails = ({
|
|
|
6166
6162
|
}
|
|
6167
6163
|
)
|
|
6168
6164
|
] }),
|
|
6169
|
-
/* @__PURE__ */
|
|
6170
|
-
/* @__PURE__ */
|
|
6171
|
-
/* @__PURE__ */
|
|
6172
|
-
/* @__PURE__ */
|
|
6165
|
+
/* @__PURE__ */ jsx65("div", { className: `fee-breakdown ${feeCollapsed ? "collapsed" : ""}`, children: isSwap ? /* @__PURE__ */ jsxs36(Fragment8, { children: [
|
|
6166
|
+
/* @__PURE__ */ jsxs36("div", { className: "amount-details", children: [
|
|
6167
|
+
/* @__PURE__ */ jsx65("span", { children: "Swap Fees" }),
|
|
6168
|
+
/* @__PURE__ */ jsxs36("span", { className: "service-fee", children: [
|
|
6173
6169
|
formatBigInt(combinedSwapFees),
|
|
6174
6170
|
" ",
|
|
6175
6171
|
sourceCurrency
|
|
6176
6172
|
] })
|
|
6177
6173
|
] }),
|
|
6178
|
-
/* @__PURE__ */
|
|
6179
|
-
/* @__PURE__ */
|
|
6180
|
-
/* @__PURE__ */
|
|
6174
|
+
/* @__PURE__ */ jsxs36("div", { className: "amount-details", children: [
|
|
6175
|
+
/* @__PURE__ */ jsx65("span", { children: "Kima Processing Fees" }),
|
|
6176
|
+
/* @__PURE__ */ jsxs36("span", { className: "service-fee", children: [
|
|
6181
6177
|
formatBigInt(kimaFee),
|
|
6182
6178
|
" ",
|
|
6183
6179
|
sourceCurrency
|
|
6184
6180
|
] })
|
|
6185
6181
|
] })
|
|
6186
|
-
] }) : /* @__PURE__ */
|
|
6187
|
-
/* @__PURE__ */
|
|
6188
|
-
/* @__PURE__ */
|
|
6189
|
-
/* @__PURE__ */
|
|
6182
|
+
] }) : /* @__PURE__ */ jsxs36(Fragment8, { children: [
|
|
6183
|
+
/* @__PURE__ */ jsxs36("div", { className: "amount-details", children: [
|
|
6184
|
+
/* @__PURE__ */ jsx65("span", { children: ["BANK", "CC"].includes(originNetwork.shortName) ? `${originNetwork.name} Processing Fee` : `Source Network Fee (${originNetwork.shortName})` }),
|
|
6185
|
+
/* @__PURE__ */ jsxs36("span", { className: "service-fee", children: [
|
|
6190
6186
|
formatBigInt(sourceFee),
|
|
6191
6187
|
" ",
|
|
6192
6188
|
sourceCurrency
|
|
6193
6189
|
] })
|
|
6194
6190
|
] }),
|
|
6195
|
-
/* @__PURE__ */
|
|
6196
|
-
/* @__PURE__ */
|
|
6191
|
+
/* @__PURE__ */ jsxs36("div", { className: "amount-details", children: [
|
|
6192
|
+
/* @__PURE__ */ jsxs36("span", { children: [
|
|
6197
6193
|
"Target Network Fee (",
|
|
6198
6194
|
targetNetwork.shortName,
|
|
6199
6195
|
")"
|
|
6200
6196
|
] }),
|
|
6201
|
-
/* @__PURE__ */
|
|
6197
|
+
/* @__PURE__ */ jsxs36("span", { className: "service-fee", children: [
|
|
6202
6198
|
formatBigInt(targetFee),
|
|
6203
6199
|
" ",
|
|
6204
6200
|
targetCurrency
|
|
6205
6201
|
] })
|
|
6206
6202
|
] }),
|
|
6207
|
-
/* @__PURE__ */
|
|
6208
|
-
/* @__PURE__ */
|
|
6209
|
-
/* @__PURE__ */
|
|
6203
|
+
/* @__PURE__ */ jsxs36("div", { className: "amount-details", children: [
|
|
6204
|
+
/* @__PURE__ */ jsx65("span", { children: "KIMA Service Fee" }),
|
|
6205
|
+
/* @__PURE__ */ jsxs36("span", { className: "service-fee", children: [
|
|
6210
6206
|
formatBigInt(kimaFee),
|
|
6211
6207
|
" ",
|
|
6212
6208
|
sourceCurrency
|
|
6213
6209
|
] })
|
|
6214
6210
|
] })
|
|
6215
6211
|
] }) }),
|
|
6216
|
-
/* @__PURE__ */
|
|
6217
|
-
/* @__PURE__ */
|
|
6218
|
-
/* @__PURE__ */
|
|
6212
|
+
/* @__PURE__ */ jsxs36("div", { className: "amount-details", children: [
|
|
6213
|
+
/* @__PURE__ */ jsx65("span", { children: "Target Transfer Amount" }),
|
|
6214
|
+
/* @__PURE__ */ jsxs36("span", { className: "service-fee", children: [
|
|
6219
6215
|
formatBigInt(targetDisplayAmount),
|
|
6220
6216
|
" ",
|
|
6221
6217
|
targetCurrency
|
|
6222
6218
|
] })
|
|
6223
6219
|
] })
|
|
6224
6220
|
] }) }),
|
|
6225
|
-
/* @__PURE__ */
|
|
6226
|
-
/* @__PURE__ */
|
|
6227
|
-
/* @__PURE__ */
|
|
6228
|
-
/* @__PURE__ */
|
|
6229
|
-
/* @__PURE__ */
|
|
6221
|
+
/* @__PURE__ */ jsxs36("div", { className: "detail-item", children: [
|
|
6222
|
+
/* @__PURE__ */ jsx65("span", { className: "label", children: "Target wallet:" }),
|
|
6223
|
+
/* @__PURE__ */ jsxs36("div", { className: "network-details", children: [
|
|
6224
|
+
/* @__PURE__ */ jsx65("div", { className: "kima-card-network-container", children: /* @__PURE__ */ jsxs36("span", { className: `kima-card-network-label ${theme.colorMode}`, children: [
|
|
6225
|
+
/* @__PURE__ */ jsx65(ChainIcon, { symbol: targetNetworkOption?.shortName }),
|
|
6230
6226
|
targetNetworkOption?.name
|
|
6231
6227
|
] }) }),
|
|
6232
|
-
/* @__PURE__ */
|
|
6228
|
+
/* @__PURE__ */ jsx65("p", { className: theme.colorMode, children: mode === "light" /* light */ ? targetNetwork.shortName === "SOL" ? "Ff6z...demoSol" : targetNetwork.shortName === "TRX" ? "TQx...demoTrx" : "0xDEMO...EVM" : dAppOption === "LPDrain" /* LPDrain */ ? connectedAddress : targetAddress })
|
|
6233
6229
|
] })
|
|
6234
6230
|
] }),
|
|
6235
|
-
!isSwap && mode === "bridge" /* bridge */ && BigInt(totalFee.value) > 0n && /* @__PURE__ */
|
|
6231
|
+
!isSwap && mode === "bridge" /* bridge */ && BigInt(totalFee.value) > 0n && /* @__PURE__ */ jsx65(FeeDeductionRadioButtons_default, { disabled: feeOptionDisabled })
|
|
6236
6232
|
] });
|
|
6237
6233
|
};
|
|
6238
6234
|
var ConfirmDetails_default = ConfirmDetails;
|
|
6239
6235
|
|
|
6240
6236
|
// src/components/reusable/AddressInput.tsx
|
|
6241
|
-
import { useEffect as useEffect16, useRef as
|
|
6242
|
-
import { useDispatch as useDispatch9, useSelector as
|
|
6243
|
-
import { jsx as
|
|
6237
|
+
import { useEffect as useEffect16, useRef as useRef3 } from "react";
|
|
6238
|
+
import { useDispatch as useDispatch9, useSelector as useSelector32 } from "react-redux";
|
|
6239
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
6244
6240
|
var AddressInput = ({
|
|
6245
6241
|
theme,
|
|
6246
6242
|
placeholder
|
|
6247
6243
|
}) => {
|
|
6248
6244
|
const dispatch = useDispatch9();
|
|
6249
|
-
const mode =
|
|
6250
|
-
const sourceChain =
|
|
6251
|
-
const targetChain =
|
|
6245
|
+
const mode = useSelector32(selectMode);
|
|
6246
|
+
const sourceChain = useSelector32(selectSourceChain);
|
|
6247
|
+
const targetChain = useSelector32(selectTargetChain);
|
|
6252
6248
|
const { connectedAddress: sourceAddress, isReady } = useIsWalletReady_default();
|
|
6253
|
-
const targetAddress =
|
|
6254
|
-
const didAutofill =
|
|
6249
|
+
const targetAddress = useSelector32(selectTargetAddress);
|
|
6250
|
+
const didAutofill = useRef3(null);
|
|
6255
6251
|
useEffect16(() => {
|
|
6256
6252
|
didAutofill.current = null;
|
|
6257
6253
|
}, [targetChain.shortName]);
|
|
@@ -6280,7 +6276,7 @@ var AddressInput = ({
|
|
|
6280
6276
|
targetChain.shortName,
|
|
6281
6277
|
dispatch
|
|
6282
6278
|
]);
|
|
6283
|
-
return /* @__PURE__ */
|
|
6279
|
+
return /* @__PURE__ */ jsx66(
|
|
6284
6280
|
"input",
|
|
6285
6281
|
{
|
|
6286
6282
|
className: `kima-address-input ${theme}`,
|
|
@@ -6295,13 +6291,13 @@ var AddressInput = ({
|
|
|
6295
6291
|
var AddressInput_default = AddressInput;
|
|
6296
6292
|
|
|
6297
6293
|
// src/components/reusable/CustomCheckbox.tsx
|
|
6298
|
-
import { useSelector as
|
|
6299
|
-
import { jsx as
|
|
6294
|
+
import { useSelector as useSelector33 } from "react-redux";
|
|
6295
|
+
import { jsx as jsx67, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
6300
6296
|
|
|
6301
6297
|
// src/components/reusable/StepBox.tsx
|
|
6302
6298
|
import { useMemo as useMemo27 } from "react";
|
|
6303
|
-
import { useSelector as
|
|
6304
|
-
import { jsx as
|
|
6299
|
+
import { useSelector as useSelector34 } from "react-redux";
|
|
6300
|
+
import { jsx as jsx68, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
6305
6301
|
var stepInfo = [
|
|
6306
6302
|
{
|
|
6307
6303
|
title: "Initialize"
|
|
@@ -6320,10 +6316,10 @@ var stepInfo = [
|
|
|
6320
6316
|
}
|
|
6321
6317
|
];
|
|
6322
6318
|
var StepBox = ({ step, errorStep, loadingStep, data }) => {
|
|
6323
|
-
const theme =
|
|
6324
|
-
const explorerUrl =
|
|
6325
|
-
const networkOption =
|
|
6326
|
-
const networks =
|
|
6319
|
+
const theme = useSelector34(selectTheme);
|
|
6320
|
+
const explorerUrl = useSelector34(selectKimaExplorer);
|
|
6321
|
+
const networkOption = useSelector34(selectNetworkOption);
|
|
6322
|
+
const networks = useSelector34(selectNetworks);
|
|
6327
6323
|
const { width: windowWidth } = useWidth_default();
|
|
6328
6324
|
const sourceChain = useMemo27(() => {
|
|
6329
6325
|
const sourceKey = data?.sourceChain === "FIAT" ? "CC" : data?.sourceChain;
|
|
@@ -6333,94 +6329,94 @@ var StepBox = ({ step, errorStep, loadingStep, data }) => {
|
|
|
6333
6329
|
() => networks.find((network) => network.shortName === data?.targetChain),
|
|
6334
6330
|
[data, networks]
|
|
6335
6331
|
);
|
|
6336
|
-
return /* @__PURE__ */
|
|
6337
|
-
/* @__PURE__ */
|
|
6332
|
+
return /* @__PURE__ */ jsx68("div", { className: "kima-stepbox", children: /* @__PURE__ */ jsx68("div", { className: `content-wrapper ${theme.colorMode}`, children: stepInfo.map((item, index) => /* @__PURE__ */ jsxs38("div", { className: "step-item", children: [
|
|
6333
|
+
/* @__PURE__ */ jsxs38(
|
|
6338
6334
|
"div",
|
|
6339
6335
|
{
|
|
6340
6336
|
className: `info-item
|
|
6341
6337
|
${step >= index ? index === loadingStep ? "active" : index === errorStep ? "error" : "completed" : ""}
|
|
6342
6338
|
${step < index && "locked"} ${theme.colorMode}`,
|
|
6343
6339
|
children: [
|
|
6344
|
-
/* @__PURE__ */
|
|
6345
|
-
step < index && /* @__PURE__ */
|
|
6346
|
-
step >= index ? index === loadingStep ? /* @__PURE__ */
|
|
6340
|
+
/* @__PURE__ */ jsxs38("div", { className: "info-icon", children: [
|
|
6341
|
+
step < index && /* @__PURE__ */ jsx68(Lock_default, { width: 24, height: 24 }),
|
|
6342
|
+
step >= index ? index === loadingStep ? /* @__PURE__ */ jsx68(Loader_default, { width: 24, height: 24, className: "loader" }) : index === errorStep ? /* @__PURE__ */ jsx68(Warning_default, { width: 24, height: 24 }) : /* @__PURE__ */ jsx68(Check_default, { width: 24, height: 24 }) : null
|
|
6347
6343
|
] }),
|
|
6348
|
-
/* @__PURE__ */
|
|
6344
|
+
/* @__PURE__ */ jsx68("p", { children: item.title })
|
|
6349
6345
|
]
|
|
6350
6346
|
}
|
|
6351
6347
|
),
|
|
6352
|
-
index === 0 && data?.kimaTxHash ? /* @__PURE__ */
|
|
6353
|
-
/* @__PURE__ */
|
|
6354
|
-
/* @__PURE__ */
|
|
6355
|
-
/* @__PURE__ */
|
|
6356
|
-
/* @__PURE__ */
|
|
6348
|
+
index === 0 && data?.kimaTxHash ? /* @__PURE__ */ jsxs38("div", { className: `info-item ${theme.colorMode}`, children: [
|
|
6349
|
+
/* @__PURE__ */ jsx68("div", { className: "icon", children: /* @__PURE__ */ jsx68(USDK_default, { width: 30, height: 30 }) }),
|
|
6350
|
+
/* @__PURE__ */ jsx68("p", { className: "chain-name", children: "Kima TX Hash:" }),
|
|
6351
|
+
/* @__PURE__ */ jsxs38("p", { children: [
|
|
6352
|
+
/* @__PURE__ */ jsx68(
|
|
6357
6353
|
ExternalLink_default,
|
|
6358
6354
|
{
|
|
6359
6355
|
to: `${explorerUrl}/transactions/?tx=${data?.kimaTxHash}`,
|
|
6360
6356
|
children: getShortenedAddress(data?.kimaTxHash || "")
|
|
6361
6357
|
}
|
|
6362
6358
|
),
|
|
6363
|
-
/* @__PURE__ */
|
|
6359
|
+
/* @__PURE__ */ jsx68(CopyButton_default, { text: data?.kimaTxHash })
|
|
6364
6360
|
] })
|
|
6365
6361
|
] }) : null,
|
|
6366
|
-
index === 1 && data?.tssPullHash && sourceChain?.shortName !== "CC" ? /* @__PURE__ */
|
|
6362
|
+
index === 1 && data?.tssPullHash && sourceChain?.shortName !== "CC" ? /* @__PURE__ */ jsxs38(
|
|
6367
6363
|
"div",
|
|
6368
6364
|
{
|
|
6369
6365
|
className: `info-item ${theme.colorMode} source-chain ${step >= 3 ? "paid" : ""}`,
|
|
6370
6366
|
children: [
|
|
6371
|
-
/* @__PURE__ */
|
|
6372
|
-
/* @__PURE__ */
|
|
6367
|
+
/* @__PURE__ */ jsx68(ChainIcon, { symbol: data.sourceChain }),
|
|
6368
|
+
/* @__PURE__ */ jsxs38("p", { className: "chain-name", children: [
|
|
6373
6369
|
windowWidth >= 770 ? sourceChain?.name : sourceChain?.shortName,
|
|
6374
6370
|
" ",
|
|
6375
6371
|
"TX Hash:"
|
|
6376
6372
|
] }),
|
|
6377
|
-
/* @__PURE__ */
|
|
6378
|
-
/* @__PURE__ */
|
|
6373
|
+
/* @__PURE__ */ jsxs38("p", { children: [
|
|
6374
|
+
/* @__PURE__ */ jsx68(
|
|
6379
6375
|
ExternalLink_default,
|
|
6380
6376
|
{
|
|
6381
6377
|
to: `${sourceChain?.blockExplorers?.default.url}/${data?.sourceChain === "TRX" /* TRON */ ? "#/transaction" : "tx"}/${data?.tssPullHash}${data?.sourceChain === "SOL" /* SOLANA */ && networkOption === "testnet" /* testnet */ ? "?cluster=devnet" : ""}`,
|
|
6382
6378
|
children: getShortenedAddress(data?.tssPullHash || "")
|
|
6383
6379
|
}
|
|
6384
6380
|
),
|
|
6385
|
-
/* @__PURE__ */
|
|
6381
|
+
/* @__PURE__ */ jsx68(CopyButton_default, { text: data?.tssPullHash || "" })
|
|
6386
6382
|
] })
|
|
6387
6383
|
]
|
|
6388
6384
|
}
|
|
6389
6385
|
) : null,
|
|
6390
|
-
index === 3 && data?.tssRefundHash ? /* @__PURE__ */
|
|
6391
|
-
/* @__PURE__ */
|
|
6392
|
-
/* @__PURE__ */
|
|
6386
|
+
index === 3 && data?.tssRefundHash ? /* @__PURE__ */ jsxs38("div", { className: `info-item ${theme.colorMode} target-chain`, children: [
|
|
6387
|
+
/* @__PURE__ */ jsx68(ChainIcon, { symbol: data.sourceChain }),
|
|
6388
|
+
/* @__PURE__ */ jsxs38("p", { className: "chain-name", children: [
|
|
6393
6389
|
windowWidth >= 770 ? sourceChain?.name : sourceChain?.shortName,
|
|
6394
6390
|
" ",
|
|
6395
6391
|
"TX Hash:"
|
|
6396
6392
|
] }),
|
|
6397
|
-
/* @__PURE__ */
|
|
6398
|
-
/* @__PURE__ */
|
|
6393
|
+
/* @__PURE__ */ jsxs38("p", { children: [
|
|
6394
|
+
/* @__PURE__ */ jsx68(
|
|
6399
6395
|
ExternalLink_default,
|
|
6400
6396
|
{
|
|
6401
6397
|
to: `${sourceChain?.blockExplorers?.default.url}/${data?.sourceChain === "TRX" /* TRON */ ? "#/transaction" : "tx"}/${data?.tssRefundHash}${data?.sourceChain === "SOL" /* SOLANA */ && networkOption === "testnet" /* testnet */ ? "?cluster=devnet" : ""}`,
|
|
6402
6398
|
children: getShortenedAddress(data?.tssRefundHash || "")
|
|
6403
6399
|
}
|
|
6404
6400
|
),
|
|
6405
|
-
/* @__PURE__ */
|
|
6401
|
+
/* @__PURE__ */ jsx68(CopyButton_default, { text: data?.tssRefundHash || "" })
|
|
6406
6402
|
] })
|
|
6407
6403
|
] }) : null,
|
|
6408
|
-
index === 3 && data?.tssReleaseHash ? /* @__PURE__ */
|
|
6409
|
-
/* @__PURE__ */
|
|
6410
|
-
/* @__PURE__ */
|
|
6404
|
+
index === 3 && data?.tssReleaseHash ? /* @__PURE__ */ jsxs38("div", { className: `info-item ${theme.colorMode} target-chain`, children: [
|
|
6405
|
+
/* @__PURE__ */ jsx68(ChainIcon, { symbol: data.targetChain }),
|
|
6406
|
+
/* @__PURE__ */ jsxs38("p", { className: "chain-name", children: [
|
|
6411
6407
|
windowWidth >= 770 ? targetChain?.name : targetChain?.shortName,
|
|
6412
6408
|
" ",
|
|
6413
6409
|
"TX Hash:"
|
|
6414
6410
|
] }),
|
|
6415
|
-
/* @__PURE__ */
|
|
6416
|
-
/* @__PURE__ */
|
|
6411
|
+
/* @__PURE__ */ jsxs38("p", { children: [
|
|
6412
|
+
/* @__PURE__ */ jsx68(
|
|
6417
6413
|
ExternalLink_default,
|
|
6418
6414
|
{
|
|
6419
6415
|
to: `${targetChain?.blockExplorers?.default.url}/${data?.targetChain === "TRX" /* TRON */ ? "#/transaction" : "tx"}/${data?.tssReleaseHash}${data?.targetChain === "SOL" /* SOLANA */ && networkOption === "testnet" /* testnet */ ? "?cluster=devnet" : ""}`,
|
|
6420
6416
|
children: getShortenedAddress(data?.tssReleaseHash || "")
|
|
6421
6417
|
}
|
|
6422
6418
|
),
|
|
6423
|
-
/* @__PURE__ */
|
|
6419
|
+
/* @__PURE__ */ jsx68(CopyButton_default, { text: data?.tssReleaseHash || "" })
|
|
6424
6420
|
] })
|
|
6425
6421
|
] }) : null
|
|
6426
6422
|
] }, item.title)) }) });
|
|
@@ -6428,8 +6424,8 @@ var StepBox = ({ step, errorStep, loadingStep, data }) => {
|
|
|
6428
6424
|
var StepBox_default = StepBox;
|
|
6429
6425
|
|
|
6430
6426
|
// src/widgets/common/ErrorWidget.tsx
|
|
6431
|
-
import { useSelector as
|
|
6432
|
-
import { jsx as
|
|
6427
|
+
import { useSelector as useSelector35 } from "react-redux";
|
|
6428
|
+
import { jsx as jsx69, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
6433
6429
|
var ErrorWidget = ({
|
|
6434
6430
|
theme,
|
|
6435
6431
|
title,
|
|
@@ -6437,26 +6433,26 @@ var ErrorWidget = ({
|
|
|
6437
6433
|
backButtonEnabled = false,
|
|
6438
6434
|
backButtonFunction
|
|
6439
6435
|
}) => {
|
|
6440
|
-
const sourceChain =
|
|
6441
|
-
const ccTransactionId =
|
|
6436
|
+
const sourceChain = useSelector35(selectSourceChain);
|
|
6437
|
+
const ccTransactionId = useSelector35(selectCCTransactionId);
|
|
6442
6438
|
const isCreditCardSource = sourceChain.shortName === "CC";
|
|
6443
|
-
const isRetrying =
|
|
6444
|
-
return /* @__PURE__ */
|
|
6439
|
+
const isRetrying = useSelector35(selectCCTransactionRetrying);
|
|
6440
|
+
return /* @__PURE__ */ jsx69(
|
|
6445
6441
|
"div",
|
|
6446
6442
|
{
|
|
6447
6443
|
className: `kima-card ${theme.colorMode}`,
|
|
6448
6444
|
style: {
|
|
6449
6445
|
background: theme.colorMode === "light" /* light */ ? theme.backgroundColorLight : theme.backgroundColorDark
|
|
6450
6446
|
},
|
|
6451
|
-
children: /* @__PURE__ */
|
|
6452
|
-
/* @__PURE__ */
|
|
6453
|
-
/* @__PURE__ */
|
|
6454
|
-
/* @__PURE__ */
|
|
6447
|
+
children: /* @__PURE__ */ jsxs39("div", { className: "transfer-card", children: [
|
|
6448
|
+
/* @__PURE__ */ jsxs39("div", { className: "kima-card-header", children: [
|
|
6449
|
+
/* @__PURE__ */ jsx69("div", { className: "topbar", children: /* @__PURE__ */ jsx69("div", { className: "title", children: /* @__PURE__ */ jsx69("h3", { children: title }) }) }),
|
|
6450
|
+
/* @__PURE__ */ jsx69("h4", { className: "subtitle" })
|
|
6455
6451
|
] }),
|
|
6456
|
-
/* @__PURE__ */
|
|
6457
|
-
isCreditCardSource && !isRetrying && /* @__PURE__ */
|
|
6458
|
-
message && message !== "" && /* @__PURE__ */
|
|
6459
|
-
isCreditCardSource && /* @__PURE__ */
|
|
6452
|
+
/* @__PURE__ */ jsxs39("div", { className: "kima-card-content error", children: [
|
|
6453
|
+
isCreditCardSource && !isRetrying && /* @__PURE__ */ jsx69(Error_default, { width: 40, height: 40 }),
|
|
6454
|
+
message && message !== "" && /* @__PURE__ */ jsx69("h2", { children: message }),
|
|
6455
|
+
isCreditCardSource && /* @__PURE__ */ jsxs39(
|
|
6460
6456
|
"div",
|
|
6461
6457
|
{
|
|
6462
6458
|
style: {
|
|
@@ -6465,8 +6461,8 @@ var ErrorWidget = ({
|
|
|
6465
6461
|
flexDirection: "column"
|
|
6466
6462
|
},
|
|
6467
6463
|
children: [
|
|
6468
|
-
isRetrying ? /* @__PURE__ */
|
|
6469
|
-
ccTransactionId && /* @__PURE__ */
|
|
6464
|
+
isRetrying ? /* @__PURE__ */ jsx69("p", { children: "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__ */ jsx69("p", { children: "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." }),
|
|
6465
|
+
ccTransactionId && /* @__PURE__ */ jsxs39(
|
|
6470
6466
|
"div",
|
|
6471
6467
|
{
|
|
6472
6468
|
style: {
|
|
@@ -6476,7 +6472,7 @@ var ErrorWidget = ({
|
|
|
6476
6472
|
justifyContent: "center"
|
|
6477
6473
|
},
|
|
6478
6474
|
children: [
|
|
6479
|
-
/* @__PURE__ */
|
|
6475
|
+
/* @__PURE__ */ jsx69(
|
|
6480
6476
|
"code",
|
|
6481
6477
|
{
|
|
6482
6478
|
style: {
|
|
@@ -6487,16 +6483,16 @@ var ErrorWidget = ({
|
|
|
6487
6483
|
children: ccTransactionId
|
|
6488
6484
|
}
|
|
6489
6485
|
),
|
|
6490
|
-
/* @__PURE__ */
|
|
6486
|
+
/* @__PURE__ */ jsx69(CopyButton_default, { text: ccTransactionId })
|
|
6491
6487
|
]
|
|
6492
6488
|
}
|
|
6493
6489
|
),
|
|
6494
|
-
isRetrying && /* @__PURE__ */
|
|
6490
|
+
isRetrying && /* @__PURE__ */ jsx69(ring_default, { width: 30, height: 30, fill: "#86b8ce" })
|
|
6495
6491
|
]
|
|
6496
6492
|
}
|
|
6497
6493
|
)
|
|
6498
6494
|
] }),
|
|
6499
|
-
backButtonEnabled && /* @__PURE__ */
|
|
6495
|
+
backButtonEnabled && /* @__PURE__ */ jsx69(
|
|
6500
6496
|
"div",
|
|
6501
6497
|
{
|
|
6502
6498
|
style: {
|
|
@@ -6504,14 +6500,14 @@ var ErrorWidget = ({
|
|
|
6504
6500
|
justifyContent: "flex-end",
|
|
6505
6501
|
marginTop: 16
|
|
6506
6502
|
},
|
|
6507
|
-
children: /* @__PURE__ */
|
|
6503
|
+
children: /* @__PURE__ */ jsx69(PrimaryButton_default, { clickHandler: backButtonFunction, children: "Back" })
|
|
6508
6504
|
}
|
|
6509
6505
|
),
|
|
6510
|
-
/* @__PURE__ */
|
|
6511
|
-
/* @__PURE__ */
|
|
6512
|
-
/* @__PURE__ */
|
|
6513
|
-
/* @__PURE__ */
|
|
6514
|
-
/* @__PURE__ */
|
|
6506
|
+
/* @__PURE__ */ jsx69("div", { className: "kima-card-footer" }),
|
|
6507
|
+
/* @__PURE__ */ jsx69("div", { className: "floating-footer", children: /* @__PURE__ */ jsxs39("div", { className: `items ${theme.colorMode}`, children: [
|
|
6508
|
+
/* @__PURE__ */ jsx69("span", { children: "Powered by" }),
|
|
6509
|
+
/* @__PURE__ */ jsx69(FooterLogo_default, { width: 50, fill: "black" }),
|
|
6510
|
+
/* @__PURE__ */ jsx69("strong", { children: "Network" })
|
|
6515
6511
|
] }) })
|
|
6516
6512
|
] })
|
|
6517
6513
|
}
|
|
@@ -6552,15 +6548,15 @@ var useDebugCode = (sequence = ["D", "E", "B", "U", "G"]) => {
|
|
|
6552
6548
|
|
|
6553
6549
|
// src/widgets/common/KimaWidgetWrapper.tsx
|
|
6554
6550
|
import { useAppKitTheme } from "@reown/appkit/react";
|
|
6555
|
-
import { useEffect as useEffect25, useMemo as useMemo40, useRef as
|
|
6556
|
-
import { useDispatch as useDispatch23, useSelector as
|
|
6551
|
+
import { useEffect as useEffect25, useMemo as useMemo40, useRef as useRef11 } from "react";
|
|
6552
|
+
import { useDispatch as useDispatch23, useSelector as useSelector53 } from "react-redux";
|
|
6557
6553
|
|
|
6558
6554
|
// src/widgets/transaction/components/TransactionWidget.tsx
|
|
6559
6555
|
import { useEffect as useEffect18, useMemo as useMemo28, useState as useState9 } from "react";
|
|
6560
6556
|
|
|
6561
6557
|
// src/components/reusable/Progressbar.tsx
|
|
6562
|
-
import { useSelector as
|
|
6563
|
-
import { jsx as
|
|
6558
|
+
import { useSelector as useSelector36 } from "react-redux";
|
|
6559
|
+
import { jsx as jsx70, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
6564
6560
|
var stepInfo2 = [
|
|
6565
6561
|
{
|
|
6566
6562
|
title: "Initialize"
|
|
@@ -6579,10 +6575,10 @@ var stepInfo2 = [
|
|
|
6579
6575
|
}
|
|
6580
6576
|
];
|
|
6581
6577
|
var Progressbar = ({ step, errorStep, setFocus, loadingStep }) => {
|
|
6582
|
-
const theme =
|
|
6583
|
-
return /* @__PURE__ */
|
|
6584
|
-
/* @__PURE__ */
|
|
6585
|
-
/* @__PURE__ */
|
|
6578
|
+
const theme = useSelector36(selectTheme);
|
|
6579
|
+
return /* @__PURE__ */ jsxs40("div", { className: "kima-progressbar", children: [
|
|
6580
|
+
/* @__PURE__ */ jsx70("div", { className: `value step-${step * 100 / 4}` }),
|
|
6581
|
+
/* @__PURE__ */ jsx70("div", { className: "step-indicators", children: stepInfo2.map((item, index) => /* @__PURE__ */ jsx70(
|
|
6586
6582
|
"div",
|
|
6587
6583
|
{
|
|
6588
6584
|
className: `step ${step === index && "active"}
|
|
@@ -6591,10 +6587,10 @@ var Progressbar = ({ step, errorStep, setFocus, loadingStep }) => {
|
|
|
6591
6587
|
onClick: () => {
|
|
6592
6588
|
if (index < 4) setFocus(index);
|
|
6593
6589
|
},
|
|
6594
|
-
children: /* @__PURE__ */
|
|
6595
|
-
step < index && /* @__PURE__ */
|
|
6596
|
-
step >= index ? index === loadingStep ? /* @__PURE__ */
|
|
6597
|
-
/* @__PURE__ */
|
|
6590
|
+
children: /* @__PURE__ */ jsxs40("div", { className: "step-info", children: [
|
|
6591
|
+
step < index && /* @__PURE__ */ jsx70(Lock_default, {}),
|
|
6592
|
+
step >= index ? index === loadingStep ? /* @__PURE__ */ jsx70(Loader_default, { className: "loader" }) : index === errorStep ? /* @__PURE__ */ jsx70(Warning_default, {}) : /* @__PURE__ */ jsx70(Check_default, {}) : null,
|
|
6593
|
+
/* @__PURE__ */ jsx70("span", { children: item.title })
|
|
6598
6594
|
] })
|
|
6599
6595
|
},
|
|
6600
6596
|
item.title
|
|
@@ -6605,12 +6601,12 @@ var Progressbar_default = Progressbar;
|
|
|
6605
6601
|
|
|
6606
6602
|
// src/widgets/transaction/components/TransactionWidget.tsx
|
|
6607
6603
|
import { Provider as Provider2 } from "react-redux";
|
|
6608
|
-
import { useSelector as
|
|
6604
|
+
import { useSelector as useSelector38 } from "react-redux";
|
|
6609
6605
|
import { useDispatch as useDispatch11 } from "react-redux";
|
|
6610
6606
|
import { toast as toast2, Toaster } from "react-hot-toast";
|
|
6611
6607
|
|
|
6612
6608
|
// src/widgets/transaction/hooks/useTxData.ts
|
|
6613
|
-
import { useRef as
|
|
6609
|
+
import { useRef as useRef4 } from "react";
|
|
6614
6610
|
import { useQuery as useQuery13 } from "@tanstack/react-query";
|
|
6615
6611
|
|
|
6616
6612
|
// src/services/transactionApi.ts
|
|
@@ -6709,7 +6705,7 @@ var getTxData = async ({
|
|
|
6709
6705
|
// src/widgets/transaction/hooks/useTxData.ts
|
|
6710
6706
|
var POLLING_INTERVAL_MS = 1e3 * 10;
|
|
6711
6707
|
var useTxData = (txId, dAppOption, backendUrl, isSwap) => {
|
|
6712
|
-
const refPollForUpdates =
|
|
6708
|
+
const refPollForUpdates = useRef4(false);
|
|
6713
6709
|
const isLP = dAppOption === "LPAdd" /* LPAdd */ || dAppOption === "LPDrain" /* LPDrain */;
|
|
6714
6710
|
const validTxId = typeof txId === "number" ? txId > 0 : txId.toString().length > 0;
|
|
6715
6711
|
return useQuery13({
|
|
@@ -6730,41 +6726,41 @@ var useTxData = (txId, dAppOption, backendUrl, isSwap) => {
|
|
|
6730
6726
|
var useTxData_default = useTxData;
|
|
6731
6727
|
|
|
6732
6728
|
// src/components/reusable/TransactionStatusMessage.tsx
|
|
6733
|
-
import { jsx as
|
|
6729
|
+
import { jsx as jsx71, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
6734
6730
|
var TransactionStatusMessage = ({
|
|
6735
6731
|
isCompleted,
|
|
6736
6732
|
transactionId
|
|
6737
6733
|
}) => {
|
|
6738
|
-
return /* @__PURE__ */
|
|
6739
|
-
/* @__PURE__ */
|
|
6734
|
+
return /* @__PURE__ */ jsxs41("div", { className: "transaction-status-message", children: [
|
|
6735
|
+
/* @__PURE__ */ jsxs41("h2", { children: [
|
|
6740
6736
|
isCompleted !== "Completed" /* COMPLETED */ && "Your transaction is currently being processed.",
|
|
6741
6737
|
" ",
|
|
6742
6738
|
"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."
|
|
6743
6739
|
] }),
|
|
6744
|
-
/* @__PURE__ */
|
|
6745
|
-
/* @__PURE__ */
|
|
6746
|
-
/* @__PURE__ */
|
|
6740
|
+
/* @__PURE__ */ jsxs41("span", { className: "transaction-copy", children: [
|
|
6741
|
+
/* @__PURE__ */ jsx71("h3", { children: transactionId }),
|
|
6742
|
+
/* @__PURE__ */ jsx71(CopyButton_default, { text: transactionId })
|
|
6747
6743
|
] })
|
|
6748
6744
|
] });
|
|
6749
6745
|
};
|
|
6750
6746
|
var TransactionStatusMessage_default = TransactionStatusMessage;
|
|
6751
6747
|
|
|
6752
6748
|
// src/components/reusable/TransactionSearch.tsx
|
|
6753
|
-
import { useRef as
|
|
6754
|
-
import { useSelector as
|
|
6749
|
+
import { useRef as useRef5, useState as useState8 } from "react";
|
|
6750
|
+
import { useSelector as useSelector37 } from "react-redux";
|
|
6755
6751
|
import { useDispatch as useDispatch10 } from "react-redux";
|
|
6756
6752
|
import toast from "react-hot-toast";
|
|
6757
|
-
import { jsx as
|
|
6753
|
+
import { jsx as jsx72, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
6758
6754
|
var TransactionSearch = () => {
|
|
6759
|
-
const theme =
|
|
6760
|
-
const backendUrl =
|
|
6755
|
+
const theme = useSelector37(selectTheme);
|
|
6756
|
+
const backendUrl = useSelector37(selectBackendUrl);
|
|
6761
6757
|
const dispatch = useDispatch10();
|
|
6762
6758
|
const [transactionId, setTransactionId] = useState8("");
|
|
6763
|
-
const refPollForUpdates =
|
|
6759
|
+
const refPollForUpdates = useRef5(false);
|
|
6764
6760
|
const handleSearch = async () => {
|
|
6765
6761
|
if (transactionId.length <= 0)
|
|
6766
6762
|
return toast.error("You must provide a valid transaction id", {
|
|
6767
|
-
icon: /* @__PURE__ */
|
|
6763
|
+
icon: /* @__PURE__ */ jsx72(Error_default, {})
|
|
6768
6764
|
});
|
|
6769
6765
|
try {
|
|
6770
6766
|
const data = await getTxData({
|
|
@@ -6782,14 +6778,14 @@ var TransactionSearch = () => {
|
|
|
6782
6778
|
logger_default.error("Error searching transaction: ", error);
|
|
6783
6779
|
return toast.error(
|
|
6784
6780
|
"Transaction not found. Please check for the proper transaction id.",
|
|
6785
|
-
{ icon: /* @__PURE__ */
|
|
6781
|
+
{ icon: /* @__PURE__ */ jsx72(Error_default, {}) }
|
|
6786
6782
|
);
|
|
6787
6783
|
}
|
|
6788
6784
|
};
|
|
6789
|
-
return /* @__PURE__ */
|
|
6790
|
-
/* @__PURE__ */
|
|
6791
|
-
/* @__PURE__ */
|
|
6792
|
-
/* @__PURE__ */
|
|
6785
|
+
return /* @__PURE__ */ jsxs42("div", { className: "form-item transaction-search", children: [
|
|
6786
|
+
/* @__PURE__ */ jsxs42("div", { className: "transaction-input", children: [
|
|
6787
|
+
/* @__PURE__ */ jsx72("span", { className: "label", children: "Search Transaction:" }),
|
|
6788
|
+
/* @__PURE__ */ jsx72(
|
|
6793
6789
|
"input",
|
|
6794
6790
|
{
|
|
6795
6791
|
className: `${theme.colorMode}`,
|
|
@@ -6801,13 +6797,13 @@ var TransactionSearch = () => {
|
|
|
6801
6797
|
}
|
|
6802
6798
|
)
|
|
6803
6799
|
] }),
|
|
6804
|
-
/* @__PURE__ */
|
|
6800
|
+
/* @__PURE__ */ jsx72(SecondaryButton_default, { clickHandler: handleSearch, children: "Search" })
|
|
6805
6801
|
] });
|
|
6806
6802
|
};
|
|
6807
6803
|
var TransactionSearch_default = TransactionSearch;
|
|
6808
6804
|
|
|
6809
6805
|
// src/widgets/transaction/components/TransactionWidget.tsx
|
|
6810
|
-
import { Fragment as Fragment9, jsx as
|
|
6806
|
+
import { Fragment as Fragment9, jsx as jsx73, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
6811
6807
|
var TransactionWidget = ({ theme }) => {
|
|
6812
6808
|
const [step, setStep] = useState9(0);
|
|
6813
6809
|
const [focus, setFocus] = useState9(-1);
|
|
@@ -6817,22 +6813,22 @@ var TransactionWidget = ({ theme }) => {
|
|
|
6817
6813
|
const [minimized, setMinimized] = useState9(false);
|
|
6818
6814
|
const [isComplete, setIsComplete] = useState9(false);
|
|
6819
6815
|
const dispatch = useDispatch11();
|
|
6820
|
-
const explorerUrl =
|
|
6821
|
-
const mode =
|
|
6822
|
-
const feeDeduct =
|
|
6823
|
-
const amount =
|
|
6824
|
-
const txId =
|
|
6825
|
-
const dAppOption =
|
|
6826
|
-
const { transactionValues } =
|
|
6816
|
+
const explorerUrl = useSelector38(selectKimaExplorer);
|
|
6817
|
+
const mode = useSelector38(selectMode);
|
|
6818
|
+
const feeDeduct = useSelector38(selectFeeDeduct);
|
|
6819
|
+
const amount = useSelector38(selectAmount);
|
|
6820
|
+
const txId = useSelector38(selectTxId);
|
|
6821
|
+
const dAppOption = useSelector38(selectDappOption);
|
|
6822
|
+
const { transactionValues } = useSelector38(selectServiceFee);
|
|
6827
6823
|
const txValues = feeDeduct ? transactionValues.feeFromTarget : transactionValues.feeFromOrigin;
|
|
6828
|
-
const transactionOption =
|
|
6829
|
-
const sourceChain =
|
|
6830
|
-
const targetChain =
|
|
6831
|
-
const sourceSymbol =
|
|
6832
|
-
const targetSymbol =
|
|
6833
|
-
const networks =
|
|
6824
|
+
const transactionOption = useSelector38(selectTransactionOption);
|
|
6825
|
+
const sourceChain = useSelector38(selectSourceChain);
|
|
6826
|
+
const targetChain = useSelector38(selectTargetChain);
|
|
6827
|
+
const sourceSymbol = useSelector38(selectSourceCurrency);
|
|
6828
|
+
const targetSymbol = useSelector38(selectTargetCurrency);
|
|
6829
|
+
const networks = useSelector38(selectNetworks);
|
|
6834
6830
|
const { successHandler, closeHandler } = useKimaContext();
|
|
6835
|
-
const backendUrl =
|
|
6831
|
+
const backendUrl = useSelector38(selectBackendUrl);
|
|
6836
6832
|
const three = (s) => (s ?? "").trim().toLowerCase().slice(0, 3);
|
|
6837
6833
|
const isSwapByPegged = !isSamePeggedToken(
|
|
6838
6834
|
sourceChain,
|
|
@@ -6842,11 +6838,17 @@ var TransactionWidget = ({ theme }) => {
|
|
|
6842
6838
|
);
|
|
6843
6839
|
const isSwapBy3Letters = three(sourceSymbol) !== three(targetSymbol);
|
|
6844
6840
|
const widgetIsSwap = mode === "status" /* status */ ? isSwapBy3Letters : isSwapByPegged;
|
|
6845
|
-
const { data, error } = useTxData_default(txId, dAppOption, backendUrl, widgetIsSwap);
|
|
6846
6841
|
const { width: windowWidth, updateWidth } = useWidth_default();
|
|
6847
6842
|
useEffect18(() => {
|
|
6848
6843
|
windowWidth === 0 && updateWidth(window.innerWidth);
|
|
6849
6844
|
}, [windowWidth, updateWidth]);
|
|
6845
|
+
const safeTxId = typeof txId === "string" || typeof txId === "number" ? txId : -1;
|
|
6846
|
+
const { data, error } = useTxData_default(
|
|
6847
|
+
safeTxId,
|
|
6848
|
+
dAppOption,
|
|
6849
|
+
backendUrl,
|
|
6850
|
+
widgetIsSwap
|
|
6851
|
+
);
|
|
6850
6852
|
const transactionSourceChain = useMemo28(
|
|
6851
6853
|
() => networks.find(
|
|
6852
6854
|
(network) => network.shortName === (mode === "status" /* status */ ? data?.sourceChain === "FIAT" ? "CC" : data?.sourceChain : sourceChain.shortName)
|
|
@@ -6860,8 +6862,8 @@ var TransactionWidget = ({ theme }) => {
|
|
|
6860
6862
|
[data, mode, targetChain, networks]
|
|
6861
6863
|
);
|
|
6862
6864
|
const isValidTxId = useMemo28(() => {
|
|
6863
|
-
return !(
|
|
6864
|
-
}, [
|
|
6865
|
+
return !(safeTxId === -1 || typeof safeTxId === "string" && safeTxId.length === 0);
|
|
6866
|
+
}, [safeTxId]);
|
|
6865
6867
|
const isEmptyStatus = useMemo28(() => {
|
|
6866
6868
|
if (!data) return true;
|
|
6867
6869
|
return data?.amount === "";
|
|
@@ -6870,9 +6872,9 @@ var TransactionWidget = ({ theme }) => {
|
|
|
6870
6872
|
useEffect18(() => {
|
|
6871
6873
|
if (!data || data.status !== "Completed" /* COMPLETED */) return;
|
|
6872
6874
|
successHandler && successHandler({
|
|
6873
|
-
txId
|
|
6875
|
+
txId: safeTxId
|
|
6874
6876
|
});
|
|
6875
|
-
}, [data, successHandler,
|
|
6877
|
+
}, [data, successHandler, safeTxId]);
|
|
6876
6878
|
useEffect18(() => {
|
|
6877
6879
|
if (!data) return;
|
|
6878
6880
|
if (data.status === "Completed" /* COMPLETED */) {
|
|
@@ -6883,9 +6885,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
6883
6885
|
if (error)
|
|
6884
6886
|
toast2.error(
|
|
6885
6887
|
"The provided transaction id is not valid, please use a different one or contact support for further assistance",
|
|
6886
|
-
{
|
|
6887
|
-
icon: /* @__PURE__ */ jsx74(Error_default, {})
|
|
6888
|
-
}
|
|
6888
|
+
{ icon: /* @__PURE__ */ jsx73(Error_default, {}) }
|
|
6889
6889
|
);
|
|
6890
6890
|
}, [error]);
|
|
6891
6891
|
useEffect18(() => {
|
|
@@ -6913,7 +6913,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
6913
6913
|
setErrorStep(1);
|
|
6914
6914
|
setLoadingStep(-1);
|
|
6915
6915
|
logger_default.error("transaction failed:", data?.failReason);
|
|
6916
|
-
toast2.error("Unavailable", { icon: /* @__PURE__ */
|
|
6916
|
+
toast2.error("Unavailable", { icon: /* @__PURE__ */ jsx73(Error_default, {}) });
|
|
6917
6917
|
setErrorMessage("Unavailable");
|
|
6918
6918
|
return;
|
|
6919
6919
|
}
|
|
@@ -6927,9 +6927,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
6927
6927
|
setLoadingStep(3);
|
|
6928
6928
|
toast2.error(
|
|
6929
6929
|
"Failed to release tokens to target! Starting refund process.",
|
|
6930
|
-
{
|
|
6931
|
-
icon: /* @__PURE__ */ jsx74(Error_default, {})
|
|
6932
|
-
}
|
|
6930
|
+
{ icon: /* @__PURE__ */ jsx73(Error_default, {}) }
|
|
6933
6931
|
);
|
|
6934
6932
|
setErrorMessage(
|
|
6935
6933
|
"Failed to release tokens to target! Starting refund process."
|
|
@@ -6940,7 +6938,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
6940
6938
|
setStep(3);
|
|
6941
6939
|
setErrorStep(3);
|
|
6942
6940
|
setLoadingStep(-1);
|
|
6943
|
-
toast2.error("Failed to refund tokens to source!", { icon: /* @__PURE__ */
|
|
6941
|
+
toast2.error("Failed to refund tokens to source!", { icon: /* @__PURE__ */ jsx73(Error_default, {}) });
|
|
6944
6942
|
setErrorMessage("Failed to refund tokens to source!");
|
|
6945
6943
|
return;
|
|
6946
6944
|
}
|
|
@@ -6948,7 +6946,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
6948
6946
|
setStep(4);
|
|
6949
6947
|
setErrorStep(3);
|
|
6950
6948
|
setLoadingStep(-1);
|
|
6951
|
-
toast2.success("Refund completed!", { icon: /* @__PURE__ */
|
|
6949
|
+
toast2.success("Refund completed!", { icon: /* @__PURE__ */ jsx73(Error_default, {}) });
|
|
6952
6950
|
setErrorMessage("Refund completed!");
|
|
6953
6951
|
return;
|
|
6954
6952
|
}
|
|
@@ -6958,7 +6956,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
6958
6956
|
setLoadingStep(-1);
|
|
6959
6957
|
logger_default.error("transaction failed:", data?.failReason);
|
|
6960
6958
|
toast2.error("Failed to release tokens to target!", {
|
|
6961
|
-
icon: /* @__PURE__ */
|
|
6959
|
+
icon: /* @__PURE__ */ jsx73(Error_default, {})
|
|
6962
6960
|
});
|
|
6963
6961
|
setErrorMessage("Failed to release tokens to target!");
|
|
6964
6962
|
return;
|
|
@@ -6968,7 +6966,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
6968
6966
|
setErrorStep(1);
|
|
6969
6967
|
setLoadingStep(-1);
|
|
6970
6968
|
logger_default.error("transaction failed:", data?.failReason);
|
|
6971
|
-
toast2.error("Failed to pull tokens from source!", { icon: /* @__PURE__ */
|
|
6969
|
+
toast2.error("Failed to pull tokens from source!", { icon: /* @__PURE__ */ jsx73(Error_default, {}) });
|
|
6972
6970
|
setErrorMessage("Failed to pull tokens from source!");
|
|
6973
6971
|
return;
|
|
6974
6972
|
}
|
|
@@ -6985,6 +6983,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
6985
6983
|
return;
|
|
6986
6984
|
}
|
|
6987
6985
|
}, [data?.status]);
|
|
6986
|
+
const fmt3 = (v) => formatterFloat.format(Number(Number(v ?? 0).toFixed(3)));
|
|
6988
6987
|
const verb = useMemo28(() => {
|
|
6989
6988
|
if (mode === "status" /* status */) {
|
|
6990
6989
|
if (isEmptyStatus) return "Fetching transaction status ";
|
|
@@ -7082,14 +7081,13 @@ var TransactionWidget = ({ theme }) => {
|
|
|
7082
7081
|
logger_default.error("[TransactionWidget] reset failed", e);
|
|
7083
7082
|
toast2.error(
|
|
7084
7083
|
"Unable to reset the transaction view. Please contact support for assistance.",
|
|
7085
|
-
{ icon: /* @__PURE__ */
|
|
7084
|
+
{ icon: /* @__PURE__ */ jsx73(Error_default, {}) }
|
|
7086
7085
|
);
|
|
7087
7086
|
}
|
|
7088
7087
|
};
|
|
7089
7088
|
const swapSrcAmt = data?.amountIn ?? amount;
|
|
7090
7089
|
const swapDstAmt = data?.amount;
|
|
7091
|
-
|
|
7092
|
-
return /* @__PURE__ */ jsx74(Provider2, { store: store_default, children: /* @__PURE__ */ jsxs44(
|
|
7090
|
+
return /* @__PURE__ */ jsx73(Provider2, { store: store_default, children: /* @__PURE__ */ jsxs43(
|
|
7093
7091
|
"div",
|
|
7094
7092
|
{
|
|
7095
7093
|
className: `kima-card transaction-card ${isComplete ? "transaction-complete" : ""} ${theme.colorMode} ${minimized ? "minimized" : ""}`,
|
|
@@ -7097,9 +7095,9 @@ var TransactionWidget = ({ theme }) => {
|
|
|
7097
7095
|
background: theme.colorMode === "light" /* light */ ? theme.backgroundColorLight : theme.backgroundColorDark
|
|
7098
7096
|
},
|
|
7099
7097
|
children: [
|
|
7100
|
-
/* @__PURE__ */
|
|
7101
|
-
/* @__PURE__ */
|
|
7102
|
-
!isComplete && /* @__PURE__ */
|
|
7098
|
+
/* @__PURE__ */ jsxs43("div", { className: "kima-card-header", children: [
|
|
7099
|
+
/* @__PURE__ */ jsxs43("div", { className: "topbar", children: [
|
|
7100
|
+
!isComplete && /* @__PURE__ */ jsx73("div", { className: "title", children: isValidTxId && !error ? /* @__PURE__ */ jsx73("div", { className: "transaction-title", children: showFetchingTitle ? /* @__PURE__ */ jsx73(Fragment9, { children: "Getting transaction details\u2026" }) : /* @__PURE__ */ jsxs43(Fragment9, { children: [
|
|
7103
7101
|
verb,
|
|
7104
7102
|
leftAmt,
|
|
7105
7103
|
" ",
|
|
@@ -7108,35 +7106,31 @@ var TransactionWidget = ({ theme }) => {
|
|
|
7108
7106
|
rightAmt,
|
|
7109
7107
|
" ",
|
|
7110
7108
|
rightSym
|
|
7111
|
-
] }) }) : /* @__PURE__ */
|
|
7112
|
-
!minimized ? /* @__PURE__ */
|
|
7109
|
+
] }) }) : /* @__PURE__ */ jsx73("div", { children: /* @__PURE__ */ jsx73("h3", { className: "transaction", children: "Transaction Status" }) }) }),
|
|
7110
|
+
!minimized ? /* @__PURE__ */ jsxs43(
|
|
7113
7111
|
"div",
|
|
7114
7112
|
{
|
|
7115
7113
|
className: `control-buttons ${isComplete ? "complete" : ""}`,
|
|
7116
7114
|
children: [
|
|
7117
|
-
isComplete && /* @__PURE__ */
|
|
7115
|
+
isComplete && /* @__PURE__ */ jsx73(
|
|
7118
7116
|
"button",
|
|
7119
7117
|
{
|
|
7120
7118
|
className: "menu-button",
|
|
7121
7119
|
style: { marginRight: "auto" },
|
|
7122
|
-
onClick: () =>
|
|
7123
|
-
setIsComplete(false);
|
|
7124
|
-
},
|
|
7120
|
+
onClick: () => setIsComplete(false),
|
|
7125
7121
|
children: "< Back"
|
|
7126
7122
|
}
|
|
7127
7123
|
),
|
|
7128
|
-
/* @__PURE__ */
|
|
7124
|
+
/* @__PURE__ */ jsx73(
|
|
7129
7125
|
"button",
|
|
7130
7126
|
{
|
|
7131
7127
|
className: "icon-button minimize",
|
|
7132
|
-
onClick: () =>
|
|
7133
|
-
|
|
7134
|
-
},
|
|
7135
|
-
children: /* @__PURE__ */ jsx74(Minimize_default, {})
|
|
7128
|
+
onClick: () => setMinimized(true),
|
|
7129
|
+
children: /* @__PURE__ */ jsx73(Minimize_default, {})
|
|
7136
7130
|
}
|
|
7137
7131
|
),
|
|
7138
|
-
!isComplete && (!isValidTxId || loadingStep < 0 || error && dAppOption !== "none" /* None */) ? /* @__PURE__ */
|
|
7139
|
-
closeHandler && /* @__PURE__ */
|
|
7132
|
+
!isComplete && (!isValidTxId || loadingStep < 0 || error && dAppOption !== "none" /* None */) ? /* @__PURE__ */ jsx73("button", { className: "reset-button", onClick: resetForm, children: "Reset" }) : null,
|
|
7133
|
+
closeHandler && /* @__PURE__ */ jsx73(
|
|
7140
7134
|
"button",
|
|
7141
7135
|
{
|
|
7142
7136
|
className: "cross-icon-button",
|
|
@@ -7144,44 +7138,44 @@ var TransactionWidget = ({ theme }) => {
|
|
|
7144
7138
|
resetForm();
|
|
7145
7139
|
closeHandler(0);
|
|
7146
7140
|
},
|
|
7147
|
-
children: /* @__PURE__ */
|
|
7141
|
+
children: /* @__PURE__ */ jsx73(Cross_default, {})
|
|
7148
7142
|
}
|
|
7149
7143
|
)
|
|
7150
7144
|
]
|
|
7151
7145
|
}
|
|
7152
|
-
) : /* @__PURE__ */
|
|
7146
|
+
) : /* @__PURE__ */ jsx73("div", { className: "control-buttons", children: /* @__PURE__ */ jsx73("div", { className: "maximize", onClick: () => setMinimized(false), children: "View" }) })
|
|
7153
7147
|
] }),
|
|
7154
|
-
data && !isComplete && /* @__PURE__ */
|
|
7155
|
-
/* @__PURE__ */
|
|
7156
|
-
/* @__PURE__ */
|
|
7148
|
+
data && !isComplete && /* @__PURE__ */ jsxs43("div", { className: "header-network-labels", children: [
|
|
7149
|
+
/* @__PURE__ */ jsxs43("div", { className: `kima-card-network-label ${theme.colorMode}`, children: [
|
|
7150
|
+
/* @__PURE__ */ jsx73(
|
|
7157
7151
|
ChainIcon,
|
|
7158
7152
|
{
|
|
7159
7153
|
symbol: transactionSourceChain?.shortName
|
|
7160
7154
|
}
|
|
7161
7155
|
),
|
|
7162
|
-
windowWidth > 450 && /* @__PURE__ */
|
|
7156
|
+
windowWidth > 450 && /* @__PURE__ */ jsx73("h3", { children: transactionSourceChain?.name })
|
|
7163
7157
|
] }),
|
|
7164
|
-
/* @__PURE__ */
|
|
7158
|
+
/* @__PURE__ */ jsx73(
|
|
7165
7159
|
"div",
|
|
7166
7160
|
{
|
|
7167
7161
|
style: { display: "inline-block", transform: "rotate(-90deg)" },
|
|
7168
|
-
children: /* @__PURE__ */
|
|
7162
|
+
children: /* @__PURE__ */ jsx73(Arrow_default, { width: 25, height: 25 })
|
|
7169
7163
|
}
|
|
7170
7164
|
),
|
|
7171
|
-
/* @__PURE__ */
|
|
7172
|
-
/* @__PURE__ */
|
|
7165
|
+
/* @__PURE__ */ jsxs43("div", { className: `kima-card-network-label ${theme.colorMode}`, children: [
|
|
7166
|
+
/* @__PURE__ */ jsx73(
|
|
7173
7167
|
ChainIcon,
|
|
7174
7168
|
{
|
|
7175
7169
|
symbol: transactionTargetChain?.shortName
|
|
7176
7170
|
}
|
|
7177
7171
|
),
|
|
7178
|
-
windowWidth > 450 && /* @__PURE__ */
|
|
7172
|
+
windowWidth > 450 && /* @__PURE__ */ jsx73("h3", { children: transactionTargetChain?.name })
|
|
7179
7173
|
] })
|
|
7180
7174
|
] })
|
|
7181
7175
|
] }),
|
|
7182
|
-
isValidTxId && !error ? /* @__PURE__ */
|
|
7183
|
-
!isComplete ? /* @__PURE__ */
|
|
7184
|
-
/* @__PURE__ */
|
|
7176
|
+
isValidTxId && !error ? /* @__PURE__ */ jsxs43("div", { className: "kima-card-content", children: [
|
|
7177
|
+
!isComplete ? /* @__PURE__ */ jsxs43("div", { className: "transaction-content", children: [
|
|
7178
|
+
/* @__PURE__ */ jsx73(
|
|
7185
7179
|
Progressbar_default,
|
|
7186
7180
|
{
|
|
7187
7181
|
step,
|
|
@@ -7191,7 +7185,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
7191
7185
|
loadingStep
|
|
7192
7186
|
}
|
|
7193
7187
|
),
|
|
7194
|
-
/* @__PURE__ */
|
|
7188
|
+
/* @__PURE__ */ jsx73(
|
|
7195
7189
|
StepBox_default,
|
|
7196
7190
|
{
|
|
7197
7191
|
step,
|
|
@@ -7200,15 +7194,15 @@ var TransactionWidget = ({ theme }) => {
|
|
|
7200
7194
|
data
|
|
7201
7195
|
}
|
|
7202
7196
|
)
|
|
7203
|
-
] }) : /* @__PURE__ */
|
|
7204
|
-
/* @__PURE__ */
|
|
7205
|
-
/* @__PURE__ */
|
|
7206
|
-
/* @__PURE__ */
|
|
7197
|
+
] }) : /* @__PURE__ */ jsxs43("div", { className: "transaction-content transaction-complete", children: [
|
|
7198
|
+
/* @__PURE__ */ jsx73(TransactionComplete_default, {}),
|
|
7199
|
+
/* @__PURE__ */ jsx73("h2", { children: widgetIsSwap ? "Swap Complete" : "Transaction Complete" }),
|
|
7200
|
+
/* @__PURE__ */ jsx73("div", { className: "kima-stepbox", children: /* @__PURE__ */ jsxs43(
|
|
7207
7201
|
"div",
|
|
7208
7202
|
{
|
|
7209
7203
|
className: `content-wrapper transaction-complete ${theme.colorMode}`,
|
|
7210
7204
|
children: [
|
|
7211
|
-
/* @__PURE__ */
|
|
7205
|
+
/* @__PURE__ */ jsx73("p", { children: widgetIsSwap ? /* @__PURE__ */ jsxs43(Fragment9, { children: [
|
|
7212
7206
|
"You just swapped ",
|
|
7213
7207
|
fmt3(swapSrcAmt),
|
|
7214
7208
|
" ",
|
|
@@ -7217,50 +7211,50 @@ var TransactionWidget = ({ theme }) => {
|
|
|
7217
7211
|
fmt3(swapDstAmt),
|
|
7218
7212
|
" ",
|
|
7219
7213
|
data?.targetSymbol
|
|
7220
|
-
] }) : /* @__PURE__ */
|
|
7214
|
+
] }) : /* @__PURE__ */ jsxs43(Fragment9, { children: [
|
|
7221
7215
|
"You just transferred ",
|
|
7222
7216
|
data?.amount,
|
|
7223
7217
|
" ",
|
|
7224
7218
|
data?.sourceSymbol
|
|
7225
7219
|
] }) }),
|
|
7226
|
-
/* @__PURE__ */
|
|
7227
|
-
/* @__PURE__ */
|
|
7220
|
+
/* @__PURE__ */ jsxs43("div", { className: "header-network-labels", children: [
|
|
7221
|
+
/* @__PURE__ */ jsxs43(
|
|
7228
7222
|
"div",
|
|
7229
7223
|
{
|
|
7230
7224
|
className: `kima-card-network-label ${theme.colorMode}`,
|
|
7231
7225
|
children: [
|
|
7232
|
-
/* @__PURE__ */
|
|
7226
|
+
/* @__PURE__ */ jsx73(
|
|
7233
7227
|
ChainIcon,
|
|
7234
7228
|
{
|
|
7235
7229
|
symbol: transactionSourceChain?.shortName
|
|
7236
7230
|
}
|
|
7237
7231
|
),
|
|
7238
|
-
windowWidth > 450 && /* @__PURE__ */
|
|
7232
|
+
windowWidth > 450 && /* @__PURE__ */ jsx73("h3", { children: transactionSourceChain?.name })
|
|
7239
7233
|
]
|
|
7240
7234
|
}
|
|
7241
7235
|
),
|
|
7242
|
-
/* @__PURE__ */
|
|
7236
|
+
/* @__PURE__ */ jsx73(
|
|
7243
7237
|
"div",
|
|
7244
7238
|
{
|
|
7245
7239
|
style: {
|
|
7246
7240
|
display: "inline-block",
|
|
7247
7241
|
transform: "rotate(-90deg)"
|
|
7248
7242
|
},
|
|
7249
|
-
children: /* @__PURE__ */
|
|
7243
|
+
children: /* @__PURE__ */ jsx73(Arrow_default, { width: 25, height: 25 })
|
|
7250
7244
|
}
|
|
7251
7245
|
),
|
|
7252
|
-
/* @__PURE__ */
|
|
7246
|
+
/* @__PURE__ */ jsxs43(
|
|
7253
7247
|
"div",
|
|
7254
7248
|
{
|
|
7255
7249
|
className: `kima-card-network-label ${theme.colorMode}`,
|
|
7256
7250
|
children: [
|
|
7257
|
-
/* @__PURE__ */
|
|
7251
|
+
/* @__PURE__ */ jsx73(
|
|
7258
7252
|
ChainIcon,
|
|
7259
7253
|
{
|
|
7260
7254
|
symbol: transactionTargetChain?.shortName
|
|
7261
7255
|
}
|
|
7262
7256
|
),
|
|
7263
|
-
windowWidth > 450 && /* @__PURE__ */
|
|
7257
|
+
windowWidth > 450 && /* @__PURE__ */ jsx73("h3", { children: transactionTargetChain?.name })
|
|
7264
7258
|
]
|
|
7265
7259
|
}
|
|
7266
7260
|
)
|
|
@@ -7268,8 +7262,8 @@ var TransactionWidget = ({ theme }) => {
|
|
|
7268
7262
|
]
|
|
7269
7263
|
}
|
|
7270
7264
|
) }),
|
|
7271
|
-
/* @__PURE__ */
|
|
7272
|
-
/* @__PURE__ */
|
|
7265
|
+
/* @__PURE__ */ jsxs43("div", { className: "transaction-buttons", children: [
|
|
7266
|
+
/* @__PURE__ */ jsx73(
|
|
7273
7267
|
SecondaryButton_default,
|
|
7274
7268
|
{
|
|
7275
7269
|
clickHandler: resetForm,
|
|
@@ -7277,34 +7271,32 @@ var TransactionWidget = ({ theme }) => {
|
|
|
7277
7271
|
children: "New Transaction"
|
|
7278
7272
|
}
|
|
7279
7273
|
),
|
|
7280
|
-
/* @__PURE__ */
|
|
7274
|
+
/* @__PURE__ */ jsx73(
|
|
7281
7275
|
ExternalLink_default,
|
|
7282
7276
|
{
|
|
7283
7277
|
to: `${explorerUrl}/transactions/?tx=${data?.kimaTxHash}`,
|
|
7284
|
-
children: /* @__PURE__ */
|
|
7278
|
+
children: /* @__PURE__ */ jsx73(PrimaryButton_default, { children: "View Details" })
|
|
7285
7279
|
}
|
|
7286
7280
|
)
|
|
7287
7281
|
] })
|
|
7288
7282
|
] }),
|
|
7289
|
-
!error && !isEmptyStatus && !isComplete && /* @__PURE__ */
|
|
7283
|
+
!error && !isEmptyStatus && !isComplete && /* @__PURE__ */ jsx73(
|
|
7290
7284
|
TransactionStatusMessage_default,
|
|
7291
7285
|
{
|
|
7292
7286
|
isCompleted: data?.status,
|
|
7293
|
-
transactionId:
|
|
7287
|
+
transactionId: String(safeTxId)
|
|
7294
7288
|
}
|
|
7295
7289
|
)
|
|
7296
|
-
] }) : /* @__PURE__ */
|
|
7297
|
-
/* @__PURE__ */
|
|
7298
|
-
/* @__PURE__ */
|
|
7290
|
+
] }) : /* @__PURE__ */ jsxs43("div", { className: "kima-card-content", children: [
|
|
7291
|
+
/* @__PURE__ */ jsx73("h4", { className: "subtitle", children: "You can follow the status of a previous submitted transaction by entering the provided transaction id" }),
|
|
7292
|
+
/* @__PURE__ */ jsx73("div", { className: "single-form", children: /* @__PURE__ */ jsx73(TransactionSearch_default, {}) })
|
|
7299
7293
|
] }),
|
|
7300
|
-
/* @__PURE__ */
|
|
7294
|
+
/* @__PURE__ */ jsx73(
|
|
7301
7295
|
Toaster,
|
|
7302
7296
|
{
|
|
7303
7297
|
position: "top-right",
|
|
7304
7298
|
reverseOrder: false,
|
|
7305
|
-
containerStyle: {
|
|
7306
|
-
position: "absolute"
|
|
7307
|
-
},
|
|
7299
|
+
containerStyle: { position: "absolute" },
|
|
7308
7300
|
toastOptions: {
|
|
7309
7301
|
duration: 5 * 1e3,
|
|
7310
7302
|
style: {
|
|
@@ -7324,13 +7316,13 @@ var TransactionWidget = ({ theme }) => {
|
|
|
7324
7316
|
}
|
|
7325
7317
|
}
|
|
7326
7318
|
),
|
|
7327
|
-
/* @__PURE__ */
|
|
7319
|
+
/* @__PURE__ */ jsx73(
|
|
7328
7320
|
"div",
|
|
7329
7321
|
{
|
|
7330
7322
|
className: `floating-footer ${isComplete ? "complete" : "status"}`,
|
|
7331
|
-
children: /* @__PURE__ */
|
|
7332
|
-
/* @__PURE__ */
|
|
7333
|
-
/* @__PURE__ */
|
|
7323
|
+
children: /* @__PURE__ */ jsxs43("div", { className: `items ${theme.colorMode}`, children: [
|
|
7324
|
+
/* @__PURE__ */ jsx73("span", { children: "Powered by" }),
|
|
7325
|
+
/* @__PURE__ */ jsx73(KimaNetwork_default, {})
|
|
7334
7326
|
] })
|
|
7335
7327
|
}
|
|
7336
7328
|
)
|
|
@@ -7341,7 +7333,7 @@ var TransactionWidget = ({ theme }) => {
|
|
|
7341
7333
|
|
|
7342
7334
|
// src/hooks/useGetFees.tsx
|
|
7343
7335
|
import { useQuery as useQuery14 } from "@tanstack/react-query";
|
|
7344
|
-
import { useSelector as
|
|
7336
|
+
import { useSelector as useSelector39 } from "react-redux";
|
|
7345
7337
|
|
|
7346
7338
|
// src/services/feesApi.ts
|
|
7347
7339
|
var getFees = async (amount, originChain, originAddress, originSymbol, targetChain, targetAddress, targetSymbol, backendUrl) => {
|
|
@@ -7436,7 +7428,7 @@ var useGetFees = ({
|
|
|
7436
7428
|
targetSymbol,
|
|
7437
7429
|
backendUrl
|
|
7438
7430
|
}) => {
|
|
7439
|
-
const mode =
|
|
7431
|
+
const mode = useSelector39(selectMode);
|
|
7440
7432
|
const isFiat = sourceNetwork === "BANK" || sourceNetwork === "CC";
|
|
7441
7433
|
const haveBasics = !!backendUrl && !!amount && !!sourceNetwork && !!sourceSymbol && !!targetNetwork && !!targetAddress && !!targetSymbol;
|
|
7442
7434
|
const enabled = haveBasics && (isFiat ? true : !!sourceAddress);
|
|
@@ -7484,24 +7476,24 @@ var useGetFees = ({
|
|
|
7484
7476
|
var useGetFees_default = useGetFees;
|
|
7485
7477
|
|
|
7486
7478
|
// src/widgets/transfer/hooks/useSubmitTransaction.tsx
|
|
7487
|
-
import { useDispatch as useDispatch12, useSelector as
|
|
7479
|
+
import { useDispatch as useDispatch12, useSelector as useSelector40 } from "react-redux";
|
|
7488
7480
|
import { useMutation } from "@tanstack/react-query";
|
|
7489
7481
|
var useSubmitTransaction = (isSubmitting, setIsSubmitting) => {
|
|
7490
7482
|
const dispatch = useDispatch12();
|
|
7491
|
-
const backendUrl =
|
|
7492
|
-
const mode =
|
|
7483
|
+
const backendUrl = useSelector40(selectBackendUrl);
|
|
7484
|
+
const mode = useSelector40(selectMode);
|
|
7493
7485
|
const {
|
|
7494
7486
|
feeId,
|
|
7495
7487
|
transactionValues,
|
|
7496
7488
|
totalFee,
|
|
7497
7489
|
options: feeOptions,
|
|
7498
7490
|
swapInfo
|
|
7499
|
-
} =
|
|
7500
|
-
const originChainData =
|
|
7501
|
-
const targetChainData =
|
|
7502
|
-
const feeDeduct =
|
|
7503
|
-
const ccTransactionIdSeed =
|
|
7504
|
-
const submitted =
|
|
7491
|
+
} = useSelector40(selectServiceFee);
|
|
7492
|
+
const originChainData = useSelector40(selectSourceChain);
|
|
7493
|
+
const targetChainData = useSelector40(selectTargetChain);
|
|
7494
|
+
const feeDeduct = useSelector40(selectFeeDeduct);
|
|
7495
|
+
const ccTransactionIdSeed = useSelector40(selectCCTransactionIdSeed);
|
|
7496
|
+
const submitted = useSelector40(selectSubmitted);
|
|
7505
7497
|
const doSwap = !isSamePeggedToken(
|
|
7506
7498
|
originChainData,
|
|
7507
7499
|
transactionValues.originSymbol,
|
|
@@ -7626,7 +7618,7 @@ var useSubmitTransaction_default = useSubmitTransaction;
|
|
|
7626
7618
|
// src/widgets/transfer/hooks/useValidateTransaction.tsx
|
|
7627
7619
|
import { useMemo as useMemo29 } from "react";
|
|
7628
7620
|
import { formatUnits as formatUnits2, parseUnits as parseUnits2 } from "viem";
|
|
7629
|
-
import { useSelector as
|
|
7621
|
+
import { useSelector as useSelector41 } from "react-redux";
|
|
7630
7622
|
var useValidateTransaction = (inputs) => {
|
|
7631
7623
|
const {
|
|
7632
7624
|
allowance = 0n,
|
|
@@ -7649,8 +7641,8 @@ var useValidateTransaction = (inputs) => {
|
|
|
7649
7641
|
} = inputs;
|
|
7650
7642
|
const { kimaBackendUrl } = useKimaContext();
|
|
7651
7643
|
const { data: envOptions } = useGetEnvOptions({ kimaBackendUrl });
|
|
7652
|
-
const mode =
|
|
7653
|
-
const networkOption =
|
|
7644
|
+
const mode = useSelector41(selectMode);
|
|
7645
|
+
const networkOption = useSelector41(selectNetworkOption);
|
|
7654
7646
|
const maxValue = useMemo29(() => {
|
|
7655
7647
|
logger_default.debug("useValidateTransaction: maxValue: ", inputs);
|
|
7656
7648
|
if (!balance) return 0n;
|
|
@@ -7766,13 +7758,13 @@ var useValidateTransaction = (inputs) => {
|
|
|
7766
7758
|
var useValidateTransaction_default = useValidateTransaction;
|
|
7767
7759
|
|
|
7768
7760
|
// src/widgets/transfer/components/TransferWidget.tsx
|
|
7769
|
-
import { useEffect as useEffect24, useState as useState13, useRef as
|
|
7761
|
+
import { useEffect as useEffect24, useState as useState13, useRef as useRef10, useMemo as useMemo39, useCallback as useCallback15 } from "react";
|
|
7770
7762
|
import toast4, { Toaster as Toaster2 } from "react-hot-toast";
|
|
7771
|
-
import { useDispatch as useDispatch22, useSelector as
|
|
7763
|
+
import { useDispatch as useDispatch22, useSelector as useSelector52 } from "react-redux";
|
|
7772
7764
|
import { parseUnits as parseUnits4 } from "viem";
|
|
7773
7765
|
|
|
7774
7766
|
// src/components/reusable/WarningModal.tsx
|
|
7775
|
-
import { jsx as
|
|
7767
|
+
import { jsx as jsx74, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
7776
7768
|
var WarningModal = ({
|
|
7777
7769
|
message,
|
|
7778
7770
|
cancelButtonText = "Cancel",
|
|
@@ -7780,11 +7772,11 @@ var WarningModal = ({
|
|
|
7780
7772
|
onAcknowledge,
|
|
7781
7773
|
onCancel
|
|
7782
7774
|
}) => {
|
|
7783
|
-
return /* @__PURE__ */
|
|
7784
|
-
/* @__PURE__ */
|
|
7785
|
-
/* @__PURE__ */
|
|
7786
|
-
/* @__PURE__ */
|
|
7787
|
-
/* @__PURE__ */
|
|
7775
|
+
return /* @__PURE__ */ jsx74("div", { className: "warning-modal-overlay", children: /* @__PURE__ */ jsxs44("div", { className: "warning-modal", children: [
|
|
7776
|
+
/* @__PURE__ */ jsx74("h3", { children: "Warning" }),
|
|
7777
|
+
/* @__PURE__ */ jsx74("p", { children: message }),
|
|
7778
|
+
/* @__PURE__ */ jsxs44("div", { className: "warning-modal-buttons", children: [
|
|
7779
|
+
/* @__PURE__ */ jsx74(
|
|
7788
7780
|
SecondaryButton_default,
|
|
7789
7781
|
{
|
|
7790
7782
|
className: "warning-modal-cancel",
|
|
@@ -7792,7 +7784,7 @@ var WarningModal = ({
|
|
|
7792
7784
|
children: cancelButtonText
|
|
7793
7785
|
}
|
|
7794
7786
|
),
|
|
7795
|
-
/* @__PURE__ */
|
|
7787
|
+
/* @__PURE__ */ jsx74(
|
|
7796
7788
|
PrimaryButton_default,
|
|
7797
7789
|
{
|
|
7798
7790
|
className: "warning-modal-acknowledge",
|
|
@@ -7809,30 +7801,30 @@ var WarningModal_default = WarningModal;
|
|
|
7809
7801
|
import { parseUnits as parseUnits3 } from "viem";
|
|
7810
7802
|
import { useEffect as useEffect20, useMemo as useMemo31, useState as useState11 } from "react";
|
|
7811
7803
|
import { toast as toast3 } from "react-hot-toast";
|
|
7812
|
-
import { useDispatch as useDispatch14, useSelector as
|
|
7804
|
+
import { useDispatch as useDispatch14, useSelector as useSelector43 } from "react-redux";
|
|
7813
7805
|
|
|
7814
7806
|
// src/components/primary/NetworkSelector.tsx
|
|
7815
|
-
import React11, { useState as useState10, useMemo as useMemo30, useRef as
|
|
7816
|
-
import { useSelector as
|
|
7817
|
-
import { jsx as
|
|
7807
|
+
import React11, { useState as useState10, useMemo as useMemo30, useRef as useRef6, useEffect as useEffect19 } from "react";
|
|
7808
|
+
import { useSelector as useSelector42, useDispatch as useDispatch13 } from "react-redux";
|
|
7809
|
+
import { jsx as jsx75, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
7818
7810
|
var NetworkSelector = ({
|
|
7819
7811
|
type,
|
|
7820
7812
|
initialSelection,
|
|
7821
7813
|
setInitialSelection
|
|
7822
7814
|
}) => {
|
|
7823
7815
|
const [collapsed, setCollapsed] = useState10(true);
|
|
7824
|
-
const ref =
|
|
7816
|
+
const ref = useRef6(null);
|
|
7825
7817
|
const dispatch = useDispatch13();
|
|
7826
|
-
const theme =
|
|
7827
|
-
const networkOptions =
|
|
7828
|
-
const transactionOption =
|
|
7829
|
-
const dAppOption =
|
|
7830
|
-
const mode =
|
|
7831
|
-
const sourceNetwork =
|
|
7832
|
-
const sourceSymbol =
|
|
7833
|
-
const targetNetwork =
|
|
7834
|
-
const currentSourceAddr =
|
|
7835
|
-
const currentTargetAddr =
|
|
7818
|
+
const theme = useSelector42(selectTheme);
|
|
7819
|
+
const networkOptions = useSelector42(selectNetworks);
|
|
7820
|
+
const transactionOption = useSelector42(selectTransactionOption);
|
|
7821
|
+
const dAppOption = useSelector42(selectDappOption);
|
|
7822
|
+
const mode = useSelector42(selectMode);
|
|
7823
|
+
const sourceNetwork = useSelector42(selectSourceChain);
|
|
7824
|
+
const sourceSymbol = useSelector42(selectSourceCurrency);
|
|
7825
|
+
const targetNetwork = useSelector42(selectTargetChain);
|
|
7826
|
+
const currentSourceAddr = useSelector42(selectSourceAddress);
|
|
7827
|
+
const currentTargetAddr = useSelector42(selectTargetAddress);
|
|
7836
7828
|
const { switchChainHandler } = useKimaContext();
|
|
7837
7829
|
const isOriginSelector = type === "origin";
|
|
7838
7830
|
useEffect19(() => {
|
|
@@ -7908,7 +7900,7 @@ var NetworkSelector = ({
|
|
|
7908
7900
|
shouldLockSourceNetwork,
|
|
7909
7901
|
transactionOption?.targetChain
|
|
7910
7902
|
]);
|
|
7911
|
-
const lastForcedShort =
|
|
7903
|
+
const lastForcedShort = useRef6();
|
|
7912
7904
|
useEffect19(() => {
|
|
7913
7905
|
if (!shouldLockSourceNetwork || !isOriginSelector || !transactionOption?.targetChain)
|
|
7914
7906
|
return;
|
|
@@ -8055,7 +8047,7 @@ var NetworkSelector = ({
|
|
|
8055
8047
|
currentTargetAddr,
|
|
8056
8048
|
dispatch
|
|
8057
8049
|
]);
|
|
8058
|
-
return /* @__PURE__ */
|
|
8050
|
+
return /* @__PURE__ */ jsxs45(
|
|
8059
8051
|
"div",
|
|
8060
8052
|
{
|
|
8061
8053
|
className: `network-dropdown ${theme?.colorMode ?? ""} ${collapsed ? "collapsed" : "toggled"} ${shouldLockSourceNetwork ? "disabled" : ""}`,
|
|
@@ -8064,15 +8056,15 @@ var NetworkSelector = ({
|
|
|
8064
8056
|
},
|
|
8065
8057
|
ref,
|
|
8066
8058
|
children: [
|
|
8067
|
-
/* @__PURE__ */
|
|
8068
|
-
/* @__PURE__ */
|
|
8069
|
-
/* @__PURE__ */
|
|
8059
|
+
/* @__PURE__ */ jsxs45("div", { className: "network-wrapper", children: [
|
|
8060
|
+
/* @__PURE__ */ jsx75(ChainIcon, { symbol: selectedNetwork.shortName }),
|
|
8061
|
+
/* @__PURE__ */ jsx75("span", { children: selectedNetwork.name })
|
|
8070
8062
|
] }),
|
|
8071
|
-
/* @__PURE__ */
|
|
8063
|
+
/* @__PURE__ */ jsx75(
|
|
8072
8064
|
"div",
|
|
8073
8065
|
{
|
|
8074
8066
|
className: `network-menu custom-scrollbar ${theme?.colorMode ?? ""} ${collapsed ? "collapsed" : "toggled"}`,
|
|
8075
|
-
children: networks.filter((network) => network.shortName !== selectedNetwork.shortName).map((network) => /* @__PURE__ */
|
|
8067
|
+
children: networks.filter((network) => network.shortName !== selectedNetwork.shortName).map((network) => /* @__PURE__ */ jsxs45(
|
|
8076
8068
|
"div",
|
|
8077
8069
|
{
|
|
8078
8070
|
className: `network-menu-item ${theme?.colorMode ?? ""} ${network.disabled ? "disabled has-tooltip" : "enabled"}`,
|
|
@@ -8081,16 +8073,16 @@ var NetworkSelector = ({
|
|
|
8081
8073
|
if (!network.disabled) handleNetworkChange(network);
|
|
8082
8074
|
},
|
|
8083
8075
|
children: [
|
|
8084
|
-
network.disabled ? /* @__PURE__ */
|
|
8085
|
-
/* @__PURE__ */
|
|
8086
|
-
network.disabled && /* @__PURE__ */
|
|
8076
|
+
network.disabled ? /* @__PURE__ */ jsx75(Warning_default, { width: 25, height: 25 }) : /* @__PURE__ */ jsx75(ChainIcon, { symbol: network.shortName }),
|
|
8077
|
+
/* @__PURE__ */ jsx75("p", { children: network.name }),
|
|
8078
|
+
network.disabled && /* @__PURE__ */ jsx75("span", { className: "tooltip", children: "Temporarily unavailable" })
|
|
8087
8079
|
]
|
|
8088
8080
|
},
|
|
8089
8081
|
network.id ?? network.shortName
|
|
8090
8082
|
))
|
|
8091
8083
|
}
|
|
8092
8084
|
),
|
|
8093
|
-
!shouldLockSourceNetwork && /* @__PURE__ */
|
|
8085
|
+
!shouldLockSourceNetwork && /* @__PURE__ */ jsx75("div", { className: `dropdown-icon ${collapsed ? "toggled" : "collapsed"}`, children: /* @__PURE__ */ jsx75(Arrow_default, { fill: "none" }) })
|
|
8094
8086
|
]
|
|
8095
8087
|
}
|
|
8096
8088
|
);
|
|
@@ -8098,30 +8090,30 @@ var NetworkSelector = ({
|
|
|
8098
8090
|
var NetworkSelector_default = React11.memo(NetworkSelector);
|
|
8099
8091
|
|
|
8100
8092
|
// src/components/reusable/SingleForm.tsx
|
|
8101
|
-
import { jsx as
|
|
8093
|
+
import { jsx as jsx76, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
8102
8094
|
var SingleForm = ({
|
|
8103
8095
|
isLoadingFees,
|
|
8104
8096
|
initialSelection,
|
|
8105
8097
|
setInitialSelection
|
|
8106
8098
|
}) => {
|
|
8107
8099
|
const dispatch = useDispatch14();
|
|
8108
|
-
const mode =
|
|
8109
|
-
const theme =
|
|
8110
|
-
const feeDeduct =
|
|
8111
|
-
const { totalFee } =
|
|
8112
|
-
const dAppOption =
|
|
8113
|
-
const compliantOption =
|
|
8114
|
-
const targetCompliant =
|
|
8115
|
-
const sourceAddress =
|
|
8116
|
-
const sourceNetwork =
|
|
8117
|
-
const targetNetwork =
|
|
8118
|
-
const targetAddress =
|
|
8100
|
+
const mode = useSelector43(selectMode);
|
|
8101
|
+
const theme = useSelector43(selectTheme);
|
|
8102
|
+
const feeDeduct = useSelector43(selectFeeDeduct);
|
|
8103
|
+
const { totalFee } = useSelector43(selectServiceFee);
|
|
8104
|
+
const dAppOption = useSelector43(selectDappOption);
|
|
8105
|
+
const compliantOption = useSelector43(selectCompliantOption);
|
|
8106
|
+
const targetCompliant = useSelector43(selectTargetCompliant);
|
|
8107
|
+
const sourceAddress = useSelector43(selectSourceAddress);
|
|
8108
|
+
const sourceNetwork = useSelector43(selectSourceChain);
|
|
8109
|
+
const targetNetwork = useSelector43(selectTargetChain);
|
|
8110
|
+
const targetAddress = useSelector43(selectTargetAddress);
|
|
8119
8111
|
const { isReady } = useIsWalletReady_default();
|
|
8120
8112
|
const [amountValue, setAmountValue] = useState11("");
|
|
8121
|
-
const amount =
|
|
8122
|
-
const sourceCurrency =
|
|
8123
|
-
const targetCurrency =
|
|
8124
|
-
const backendUrl =
|
|
8113
|
+
const amount = useSelector43(selectAmount);
|
|
8114
|
+
const sourceCurrency = useSelector43(selectSourceCurrency);
|
|
8115
|
+
const targetCurrency = useSelector43(selectTargetCurrency);
|
|
8116
|
+
const backendUrl = useSelector43(selectBackendUrl);
|
|
8125
8117
|
const { balance, decimals } = useBalance_default();
|
|
8126
8118
|
const { kimaBackendUrl } = useKimaContext();
|
|
8127
8119
|
const { data: envOptions } = useGetEnvOptions({ kimaBackendUrl });
|
|
@@ -8292,14 +8284,14 @@ var SingleForm = ({
|
|
|
8292
8284
|
demoSourceAddress,
|
|
8293
8285
|
feeDeduct
|
|
8294
8286
|
]);
|
|
8295
|
-
return /* @__PURE__ */
|
|
8296
|
-
/* @__PURE__ */
|
|
8297
|
-
/* @__PURE__ */
|
|
8287
|
+
return /* @__PURE__ */ jsxs46("div", { className: "single-form", children: [
|
|
8288
|
+
/* @__PURE__ */ jsxs46("div", { className: "form-item", children: [
|
|
8289
|
+
/* @__PURE__ */ jsxs46("span", { className: "label", children: [
|
|
8298
8290
|
dAppOption === "none" /* None */ && "Source",
|
|
8299
8291
|
" Network:"
|
|
8300
8292
|
] }),
|
|
8301
|
-
/* @__PURE__ */
|
|
8302
|
-
/* @__PURE__ */
|
|
8293
|
+
/* @__PURE__ */ jsxs46("div", { className: "items", children: [
|
|
8294
|
+
/* @__PURE__ */ jsx76(
|
|
8303
8295
|
NetworkSelector_default,
|
|
8304
8296
|
{
|
|
8305
8297
|
type: "origin",
|
|
@@ -8309,30 +8301,30 @@ var SingleForm = ({
|
|
|
8309
8301
|
}
|
|
8310
8302
|
}
|
|
8311
8303
|
),
|
|
8312
|
-
/* @__PURE__ */
|
|
8304
|
+
/* @__PURE__ */ jsx76(CoinDropdown_default, { isSourceChain: true })
|
|
8313
8305
|
] })
|
|
8314
8306
|
] }),
|
|
8315
|
-
/* @__PURE__ */
|
|
8307
|
+
/* @__PURE__ */ jsxs46(
|
|
8316
8308
|
"div",
|
|
8317
8309
|
{
|
|
8318
8310
|
className: `dynamic-area ${sourceNetwork.shortName === "FIAT" /* FIAT */ ? "reverse" : "1"}`,
|
|
8319
8311
|
children: [
|
|
8320
8312
|
!["CC" /* CC */, "BANK" /* BANK */].includes(
|
|
8321
8313
|
sourceNetwork.compatibility
|
|
8322
|
-
) && /* @__PURE__ */
|
|
8314
|
+
) && /* @__PURE__ */ jsxs46(
|
|
8323
8315
|
"div",
|
|
8324
8316
|
{
|
|
8325
8317
|
className: `form-item wallet-button-item ${isConnectedSourceWrapper ? "connected" : ""}`,
|
|
8326
8318
|
children: [
|
|
8327
|
-
/* @__PURE__ */
|
|
8328
|
-
/* @__PURE__ */
|
|
8319
|
+
/* @__PURE__ */ jsx76("span", { className: "label", children: "Wallet:" }),
|
|
8320
|
+
/* @__PURE__ */ jsx76(WalletButton_default, { initialSelection: initialSelection.sourceSelection })
|
|
8329
8321
|
]
|
|
8330
8322
|
}
|
|
8331
8323
|
),
|
|
8332
|
-
mode !== "payment" /* payment */ && /* @__PURE__ */
|
|
8333
|
-
/* @__PURE__ */
|
|
8334
|
-
/* @__PURE__ */
|
|
8335
|
-
/* @__PURE__ */
|
|
8324
|
+
mode !== "payment" /* payment */ && /* @__PURE__ */ jsxs46("div", { className: "form-item", children: [
|
|
8325
|
+
/* @__PURE__ */ jsx76("span", { className: "label", children: "Target Network:" }),
|
|
8326
|
+
/* @__PURE__ */ jsxs46("div", { className: "items", children: [
|
|
8327
|
+
/* @__PURE__ */ jsx76(
|
|
8336
8328
|
NetworkSelector_default,
|
|
8337
8329
|
{
|
|
8338
8330
|
type: "target",
|
|
@@ -8342,15 +8334,15 @@ var SingleForm = ({
|
|
|
8342
8334
|
}
|
|
8343
8335
|
}
|
|
8344
8336
|
),
|
|
8345
|
-
/* @__PURE__ */
|
|
8337
|
+
/* @__PURE__ */ jsx76(CoinDropdown_default, { isSourceChain: false })
|
|
8346
8338
|
] })
|
|
8347
8339
|
] })
|
|
8348
8340
|
]
|
|
8349
8341
|
}
|
|
8350
8342
|
),
|
|
8351
|
-
mode === "bridge" /* bridge */ && /* @__PURE__ */
|
|
8352
|
-
/* @__PURE__ */
|
|
8353
|
-
/* @__PURE__ */
|
|
8343
|
+
mode === "bridge" /* bridge */ && /* @__PURE__ */ jsxs46("div", { className: `form-item ${theme.colorMode}`, children: [
|
|
8344
|
+
/* @__PURE__ */ jsx76("span", { className: "label", children: "Target Address:" }),
|
|
8345
|
+
/* @__PURE__ */ jsx76(
|
|
8354
8346
|
AddressInput_default,
|
|
8355
8347
|
{
|
|
8356
8348
|
theme: theme.colorMode,
|
|
@@ -8358,14 +8350,14 @@ var SingleForm = ({
|
|
|
8358
8350
|
}
|
|
8359
8351
|
)
|
|
8360
8352
|
] }),
|
|
8361
|
-
mode === "light" /* light */ && /* @__PURE__ */
|
|
8353
|
+
mode === "light" /* light */ && /* @__PURE__ */ jsxs46(
|
|
8362
8354
|
"div",
|
|
8363
8355
|
{
|
|
8364
8356
|
className: `form-item wallet-button-item ${isConnectedTargetWrapper ? "connected" : ""}`,
|
|
8365
8357
|
style: { display: "flex", alignItems: "center" },
|
|
8366
8358
|
children: [
|
|
8367
|
-
/* @__PURE__ */
|
|
8368
|
-
/* @__PURE__ */
|
|
8359
|
+
/* @__PURE__ */ jsx76("span", { className: "label", children: "Target Wallet:" }),
|
|
8360
|
+
/* @__PURE__ */ jsx76(
|
|
8369
8361
|
WalletButton_default,
|
|
8370
8362
|
{
|
|
8371
8363
|
initialSelection: initialSelection.targetSelection,
|
|
@@ -8375,10 +8367,10 @@ var SingleForm = ({
|
|
|
8375
8367
|
]
|
|
8376
8368
|
}
|
|
8377
8369
|
),
|
|
8378
|
-
/* @__PURE__ */
|
|
8379
|
-
/* @__PURE__ */
|
|
8380
|
-
/* @__PURE__ */
|
|
8381
|
-
/* @__PURE__ */
|
|
8370
|
+
/* @__PURE__ */ jsxs46("div", { className: `form-item ${theme.colorMode}`, children: [
|
|
8371
|
+
/* @__PURE__ */ jsx76("span", { className: "label", children: "Amount:" }),
|
|
8372
|
+
/* @__PURE__ */ jsxs46("div", { className: `amount-label-container items ${theme.colorMode}`, children: [
|
|
8373
|
+
/* @__PURE__ */ jsx76(
|
|
8382
8374
|
"input",
|
|
8383
8375
|
{
|
|
8384
8376
|
className: `${theme.colorMode}`,
|
|
@@ -8389,21 +8381,21 @@ var SingleForm = ({
|
|
|
8389
8381
|
disabled: mode === "payment" /* payment */
|
|
8390
8382
|
}
|
|
8391
8383
|
),
|
|
8392
|
-
/* @__PURE__ */
|
|
8393
|
-
sourceNetwork.shortName !== "CC" && mode !== "payment" /* payment */ && /* @__PURE__ */
|
|
8394
|
-
dAppOption === "none" /* None */ && canQuoteFees && /* @__PURE__ */
|
|
8384
|
+
/* @__PURE__ */ jsxs46("div", { className: "max-disclaimer", children: [
|
|
8385
|
+
sourceNetwork.shortName !== "CC" && mode !== "payment" /* payment */ && /* @__PURE__ */ jsx76("span", { className: "max-button", onClick: onMaxClick, children: "Max" }),
|
|
8386
|
+
dAppOption === "none" /* None */ && canQuoteFees && /* @__PURE__ */ jsxs46("p", { className: "fee-amount", children: [
|
|
8395
8387
|
"Est fees:",
|
|
8396
8388
|
" ",
|
|
8397
|
-
isLoadingFees ? /* @__PURE__ */
|
|
8398
|
-
/* @__PURE__ */
|
|
8399
|
-
/* @__PURE__ */
|
|
8400
|
-
/* @__PURE__ */
|
|
8401
|
-
] }) : totalFee.value >= 0n ? /* @__PURE__ */
|
|
8389
|
+
isLoadingFees ? /* @__PURE__ */ jsxs46("span", { className: "inline-spinner loading", "aria-live": "polite", children: [
|
|
8390
|
+
/* @__PURE__ */ jsx76("span", { className: "dot" }),
|
|
8391
|
+
/* @__PURE__ */ jsx76("span", { className: "dot" }),
|
|
8392
|
+
/* @__PURE__ */ jsx76("span", { className: "dot" })
|
|
8393
|
+
] }) : totalFee.value >= 0n ? /* @__PURE__ */ jsxs46("span", { className: "fee-value", children: [
|
|
8402
8394
|
"$ ",
|
|
8403
8395
|
formatBigInt(totalFee),
|
|
8404
8396
|
" ",
|
|
8405
8397
|
feeCurrency
|
|
8406
|
-
] }) : /* @__PURE__ */
|
|
8398
|
+
] }) : /* @__PURE__ */ jsx76("span", { className: "fee-value", children: "\u2014" })
|
|
8407
8399
|
] })
|
|
8408
8400
|
] })
|
|
8409
8401
|
] })
|
|
@@ -8413,8 +8405,8 @@ var SingleForm = ({
|
|
|
8413
8405
|
var SingleForm_default = SingleForm;
|
|
8414
8406
|
|
|
8415
8407
|
// src/components/reusable/FiatWidget.tsx
|
|
8416
|
-
import { useEffect as useEffect21, useMemo as useMemo32, useRef as
|
|
8417
|
-
import { useSelector as
|
|
8408
|
+
import { useEffect as useEffect21, useMemo as useMemo32, useRef as useRef7, useState as useState12 } from "react";
|
|
8409
|
+
import { useSelector as useSelector44, useDispatch as useDispatch15 } from "react-redux";
|
|
8418
8410
|
import { v4 as uuidv4 } from "uuid";
|
|
8419
8411
|
|
|
8420
8412
|
// src/widgets/transfer/hooks/useCCTransactionId.tsx
|
|
@@ -8441,18 +8433,18 @@ var useCCTransactionId = (backendUrl, transactionIdSeed) => {
|
|
|
8441
8433
|
};
|
|
8442
8434
|
|
|
8443
8435
|
// src/components/reusable/FiatWidget.tsx
|
|
8444
|
-
import { jsx as
|
|
8436
|
+
import { jsx as jsx77, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
8445
8437
|
var FiatWidget = ({ submitCallback }) => {
|
|
8446
8438
|
const dispatch = useDispatch15();
|
|
8447
|
-
const feeDeduct =
|
|
8448
|
-
const backendUrl =
|
|
8449
|
-
const ccTransactionStatus =
|
|
8450
|
-
const networkOption =
|
|
8451
|
-
const sourceCurrency =
|
|
8452
|
-
const sourceChain =
|
|
8453
|
-
const { transactionValues } =
|
|
8454
|
-
const ccTransactionIdSeedRef =
|
|
8455
|
-
const ccTransactionSubmittedRef =
|
|
8439
|
+
const feeDeduct = useSelector44(selectFeeDeduct);
|
|
8440
|
+
const backendUrl = useSelector44(selectBackendUrl);
|
|
8441
|
+
const ccTransactionStatus = useSelector44(selectCCTransactionStatus);
|
|
8442
|
+
const networkOption = useSelector44(selectNetworkOption);
|
|
8443
|
+
const sourceCurrency = useSelector44(selectSourceCurrency);
|
|
8444
|
+
const sourceChain = useSelector44(selectSourceChain);
|
|
8445
|
+
const { transactionValues } = useSelector44(selectServiceFee);
|
|
8446
|
+
const ccTransactionIdSeedRef = useRef7(uuidv4());
|
|
8447
|
+
const ccTransactionSubmittedRef = useRef7(false);
|
|
8456
8448
|
const { data: envOptions, isLoading: isEnvLoading } = useGetEnvOptions({
|
|
8457
8449
|
kimaBackendUrl: backendUrl
|
|
8458
8450
|
});
|
|
@@ -8512,9 +8504,9 @@ var FiatWidget = ({ submitCallback }) => {
|
|
|
8512
8504
|
useEffect21(() => {
|
|
8513
8505
|
if (error) dispatch(setCCTransactionStatus("error-id"));
|
|
8514
8506
|
}, [dispatch, error]);
|
|
8515
|
-
return /* @__PURE__ */
|
|
8516
|
-
(isLoading || isTransactionIdLoading || isEnvLoading || ccTransactionStatus === "success") && /* @__PURE__ */
|
|
8517
|
-
/* @__PURE__ */
|
|
8507
|
+
return /* @__PURE__ */ jsxs47("div", { className: `cc-widget ${isLoading ? "loading" : ""}`, children: [
|
|
8508
|
+
(isLoading || isTransactionIdLoading || isEnvLoading || ccTransactionStatus === "success") && /* @__PURE__ */ jsx77("div", { className: "cc-widget-loader", children: /* @__PURE__ */ jsx77(ring_default, { width: 50, height: 50, fill: "#86b8ce" }) }),
|
|
8509
|
+
/* @__PURE__ */ jsx77(
|
|
8518
8510
|
"iframe",
|
|
8519
8511
|
{
|
|
8520
8512
|
width: isLoading || isTransactionIdLoading || ccTransactionStatus === "success" || error ? 0 : "100%",
|
|
@@ -8610,20 +8602,20 @@ var useDisconnectWallet_default = useDisconnectWallet6;
|
|
|
8610
8602
|
|
|
8611
8603
|
// src/widgets/transfer/components/solana/SolanaConnectModal.tsx
|
|
8612
8604
|
import React16, { useCallback as useCallback13, useMemo as useMemo35 } from "react";
|
|
8613
|
-
import { useDispatch as useDispatch18, useSelector as
|
|
8605
|
+
import { useDispatch as useDispatch18, useSelector as useSelector48 } from "react-redux";
|
|
8614
8606
|
import { useWallet as useSolanaWallet3 } from "@solana/wallet-adapter-react";
|
|
8615
8607
|
|
|
8616
8608
|
// src/widgets/transfer/components/solana/SolanaWalletSelect.tsx
|
|
8617
|
-
import { useCallback as useCallback12, useEffect as useEffect22, useMemo as useMemo33, useRef as
|
|
8618
|
-
import { useDispatch as useDispatch16, useSelector as
|
|
8609
|
+
import { useCallback as useCallback12, useEffect as useEffect22, useMemo as useMemo33, useRef as useRef8 } from "react";
|
|
8610
|
+
import { useDispatch as useDispatch16, useSelector as useSelector45 } from "react-redux";
|
|
8619
8611
|
import { useWallet as useWallet5 } from "@solana/wallet-adapter-react";
|
|
8620
8612
|
import { WalletReadyState } from "@solana/wallet-adapter-base";
|
|
8621
|
-
import { jsx as
|
|
8613
|
+
import { jsx as jsx78, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
8622
8614
|
var SolanaWalletSelect = () => {
|
|
8623
|
-
const theme =
|
|
8624
|
-
const sourceChain =
|
|
8615
|
+
const theme = useSelector45(selectTheme);
|
|
8616
|
+
const sourceChain = useSelector45(selectSourceChain);
|
|
8625
8617
|
const dispatch = useDispatch16();
|
|
8626
|
-
const sliderRef =
|
|
8618
|
+
const sliderRef = useRef8();
|
|
8627
8619
|
const { wallet, wallets, select, connect, connected } = useWallet5();
|
|
8628
8620
|
const [detected, undetected] = useMemo33(() => {
|
|
8629
8621
|
const detected2 = [];
|
|
@@ -8683,27 +8675,27 @@ var SolanaWalletSelect = () => {
|
|
|
8683
8675
|
}
|
|
8684
8676
|
dispatch(setSolanaConnectModal(false));
|
|
8685
8677
|
}, [wallet, sourceChain]);
|
|
8686
|
-
return /* @__PURE__ */
|
|
8687
|
-
detected.map((wallet2, index) => /* @__PURE__ */
|
|
8678
|
+
return /* @__PURE__ */ jsx78("div", { className: `wallet-select`, children: /* @__PURE__ */ jsx78("div", { className: "slide-area hide-scrollbar", ref: sliderRef, children: /* @__PURE__ */ jsxs48("div", { className: "wallet-container", children: [
|
|
8679
|
+
detected.map((wallet2, index) => /* @__PURE__ */ jsx78(
|
|
8688
8680
|
"div",
|
|
8689
8681
|
{
|
|
8690
8682
|
className: `card-item ${theme.colorMode}`,
|
|
8691
8683
|
onClick: () => handleWalletClick(wallet2.adapter.name),
|
|
8692
|
-
children: /* @__PURE__ */
|
|
8693
|
-
/* @__PURE__ */
|
|
8694
|
-
/* @__PURE__ */
|
|
8684
|
+
children: /* @__PURE__ */ jsxs48("div", { className: "wallet-item", children: [
|
|
8685
|
+
/* @__PURE__ */ jsx78("img", { src: wallet2.adapter.icon, alt: wallet2.adapter.name }),
|
|
8686
|
+
/* @__PURE__ */ jsx78("span", { children: wallet2.adapter.name })
|
|
8695
8687
|
] })
|
|
8696
8688
|
},
|
|
8697
8689
|
`${wallet2.adapter.name}-${index}`
|
|
8698
8690
|
)),
|
|
8699
|
-
undetected.map((wallet2, index) => /* @__PURE__ */
|
|
8691
|
+
undetected.map((wallet2, index) => /* @__PURE__ */ jsx78(
|
|
8700
8692
|
ExternalLink_default,
|
|
8701
8693
|
{
|
|
8702
8694
|
to: wallet2.adapter.url,
|
|
8703
8695
|
className: `card-item ${theme.colorMode}`,
|
|
8704
|
-
children: /* @__PURE__ */
|
|
8705
|
-
/* @__PURE__ */
|
|
8706
|
-
/* @__PURE__ */
|
|
8696
|
+
children: /* @__PURE__ */ jsxs48("div", { className: "wallet-item", children: [
|
|
8697
|
+
/* @__PURE__ */ jsx78("img", { src: wallet2.adapter.icon, alt: wallet2.adapter.name }),
|
|
8698
|
+
/* @__PURE__ */ jsxs48("span", { children: [
|
|
8707
8699
|
"Install ",
|
|
8708
8700
|
wallet2.adapter.name
|
|
8709
8701
|
] })
|
|
@@ -8717,12 +8709,12 @@ var SolanaWalletSelect_default = SolanaWalletSelect;
|
|
|
8717
8709
|
|
|
8718
8710
|
// src/widgets/transfer/components/solana/AccountDetailsModal.tsx
|
|
8719
8711
|
import { useMemo as useMemo34 } from "react";
|
|
8720
|
-
import { useDispatch as useDispatch17, useSelector as
|
|
8712
|
+
import { useDispatch as useDispatch17, useSelector as useSelector47 } from "react-redux";
|
|
8721
8713
|
import { useWallet as useSolanaWallet2 } from "@solana/wallet-adapter-react";
|
|
8722
8714
|
|
|
8723
8715
|
// src/widgets/transfer/components/WalletModalShell.tsx
|
|
8724
|
-
import { useSelector as
|
|
8725
|
-
import { jsx as
|
|
8716
|
+
import { useSelector as useSelector46 } from "react-redux";
|
|
8717
|
+
import { jsx as jsx79, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
8726
8718
|
var WalletModalShell = ({
|
|
8727
8719
|
isOpen,
|
|
8728
8720
|
title,
|
|
@@ -8731,20 +8723,20 @@ var WalletModalShell = ({
|
|
|
8731
8723
|
className = "",
|
|
8732
8724
|
rightHeader
|
|
8733
8725
|
}) => {
|
|
8734
|
-
const theme =
|
|
8726
|
+
const theme = useSelector46(selectTheme);
|
|
8735
8727
|
if (!isOpen) return null;
|
|
8736
|
-
return /* @__PURE__ */
|
|
8728
|
+
return /* @__PURE__ */ jsxs49(
|
|
8737
8729
|
"div",
|
|
8738
8730
|
{
|
|
8739
8731
|
className: `kima-modal ${theme.colorMode} ${isOpen ? "open" : ""} ${className}`,
|
|
8740
8732
|
children: [
|
|
8741
|
-
/* @__PURE__ */
|
|
8742
|
-
/* @__PURE__ */
|
|
8743
|
-
/* @__PURE__ */
|
|
8744
|
-
/* @__PURE__ */
|
|
8745
|
-
/* @__PURE__ */
|
|
8733
|
+
/* @__PURE__ */ jsx79("div", { className: "modal-overlay", onClick: onClose }),
|
|
8734
|
+
/* @__PURE__ */ jsxs49("div", { className: `modal-content-container ${theme.colorMode}`, children: [
|
|
8735
|
+
/* @__PURE__ */ jsx79("div", { className: "kima-card-header", children: /* @__PURE__ */ jsxs49("div", { className: "topbar", children: [
|
|
8736
|
+
/* @__PURE__ */ jsx79("div", { className: "title", children: /* @__PURE__ */ jsx79("h3", { children: title }) }),
|
|
8737
|
+
/* @__PURE__ */ jsx79("div", { className: "control-buttons", children: rightHeader })
|
|
8746
8738
|
] }) }),
|
|
8747
|
-
/* @__PURE__ */
|
|
8739
|
+
/* @__PURE__ */ jsx79("div", { className: "modal-content", children })
|
|
8748
8740
|
] })
|
|
8749
8741
|
]
|
|
8750
8742
|
}
|
|
@@ -8753,15 +8745,15 @@ var WalletModalShell = ({
|
|
|
8753
8745
|
var WalletModalShell_default = WalletModalShell;
|
|
8754
8746
|
|
|
8755
8747
|
// src/widgets/transfer/components/solana/AccountDetailsModal.tsx
|
|
8756
|
-
import { jsx as
|
|
8748
|
+
import { jsx as jsx80, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
8757
8749
|
var AccountDetailsModal = () => {
|
|
8758
8750
|
const dispatch = useDispatch17();
|
|
8759
|
-
const theme =
|
|
8760
|
-
const mode =
|
|
8761
|
-
const sourceAddress =
|
|
8762
|
-
const networkOption =
|
|
8763
|
-
const sourceChain =
|
|
8764
|
-
const isOpen =
|
|
8751
|
+
const theme = useSelector47(selectTheme);
|
|
8752
|
+
const mode = useSelector47(selectMode);
|
|
8753
|
+
const sourceAddress = useSelector47(selectSourceAddress);
|
|
8754
|
+
const networkOption = useSelector47(selectNetworkOption);
|
|
8755
|
+
const sourceChain = useSelector47(selectSourceChain);
|
|
8756
|
+
const isOpen = useSelector47(selectAccountDetailsModal);
|
|
8765
8757
|
const { disconnect: solanaWalletDisconnect } = useSolanaWallet2();
|
|
8766
8758
|
const { balance: solBalance } = useSolNativeBalance();
|
|
8767
8759
|
const isSol = sourceChain.shortName === "SOL" /* SOLANA */;
|
|
@@ -8784,30 +8776,30 @@ var AccountDetailsModal = () => {
|
|
|
8784
8776
|
close();
|
|
8785
8777
|
}
|
|
8786
8778
|
};
|
|
8787
|
-
return /* @__PURE__ */
|
|
8779
|
+
return /* @__PURE__ */ jsxs50(
|
|
8788
8780
|
WalletModalShell_default,
|
|
8789
8781
|
{
|
|
8790
8782
|
isOpen: !!isOpen,
|
|
8791
8783
|
title: "Account Details",
|
|
8792
8784
|
onClose: close,
|
|
8793
|
-
rightHeader: /* @__PURE__ */
|
|
8785
|
+
rightHeader: /* @__PURE__ */ jsx80("button", { className: "cross-icon-button", onClick: close, children: /* @__PURE__ */ jsx80(Cross_default, { fill: theme.colorMode === "light" ? "black" : "white" }) }),
|
|
8794
8786
|
children: [
|
|
8795
|
-
/* @__PURE__ */
|
|
8796
|
-
/* @__PURE__ */
|
|
8797
|
-
/* @__PURE__ */
|
|
8798
|
-
sourceAddress && /* @__PURE__ */
|
|
8787
|
+
/* @__PURE__ */ jsxs50("div", { className: "summary", children: [
|
|
8788
|
+
/* @__PURE__ */ jsxs50("div", { className: "address", children: [
|
|
8789
|
+
/* @__PURE__ */ jsx80("h2", { children: sourceAddress ? getShortenedAddress(sourceAddress) : "\u2014" }),
|
|
8790
|
+
sourceAddress && /* @__PURE__ */ jsx80(CopyButton_default, { text: sourceAddress })
|
|
8799
8791
|
] }),
|
|
8800
|
-
/* @__PURE__ */
|
|
8792
|
+
/* @__PURE__ */ jsxs50("h3", { children: [
|
|
8801
8793
|
formatterFloat.format(Number(solBalance || 0)),
|
|
8802
8794
|
" SOL"
|
|
8803
8795
|
] })
|
|
8804
8796
|
] }),
|
|
8805
|
-
/* @__PURE__ */
|
|
8806
|
-
/* @__PURE__ */
|
|
8807
|
-
/* @__PURE__ */
|
|
8808
|
-
/* @__PURE__ */
|
|
8797
|
+
/* @__PURE__ */ jsx80(SecondaryButton_default, { className: "block-explorer", children: /* @__PURE__ */ jsxs50(ExternalLink_default, { className: "link", to: explorerUrl, children: [
|
|
8798
|
+
/* @__PURE__ */ jsx80(Explorer_default, { fill: "#778DA3" }),
|
|
8799
|
+
/* @__PURE__ */ jsx80("p", { children: "Block explorer" }),
|
|
8800
|
+
/* @__PURE__ */ jsx80(ExternalUrl_default, { fill: "#778DA3" })
|
|
8809
8801
|
] }) }),
|
|
8810
|
-
/* @__PURE__ */
|
|
8802
|
+
/* @__PURE__ */ jsx80(
|
|
8811
8803
|
PrimaryButton_default,
|
|
8812
8804
|
{
|
|
8813
8805
|
clickHandler: handleDisconnect,
|
|
@@ -8822,13 +8814,13 @@ var AccountDetailsModal = () => {
|
|
|
8822
8814
|
var AccountDetailsModal_default = AccountDetailsModal;
|
|
8823
8815
|
|
|
8824
8816
|
// src/widgets/transfer/components/solana/SolanaConnectModal.tsx
|
|
8825
|
-
import { Fragment as Fragment10, jsx as
|
|
8817
|
+
import { Fragment as Fragment10, jsx as jsx81, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
8826
8818
|
var SolanaWalletConnectModal = () => {
|
|
8827
8819
|
const dispatch = useDispatch18();
|
|
8828
|
-
const theme =
|
|
8829
|
-
const isOpen =
|
|
8830
|
-
const mode =
|
|
8831
|
-
const sourceChain =
|
|
8820
|
+
const theme = useSelector48(selectTheme);
|
|
8821
|
+
const isOpen = useSelector48(selectSolanaConnectModal);
|
|
8822
|
+
const mode = useSelector48(selectMode);
|
|
8823
|
+
const sourceChain = useSelector48(selectSourceChain);
|
|
8832
8824
|
const { connect, connecting, connected, publicKey } = useSolanaWallet3();
|
|
8833
8825
|
const isSol = sourceChain.shortName === "SOL" /* SOLANA */;
|
|
8834
8826
|
const close = useCallback13(() => {
|
|
@@ -8861,16 +8853,16 @@ var SolanaWalletConnectModal = () => {
|
|
|
8861
8853
|
() => mode === "light" /* light */ ? `Light mode uses a demo Solana address (${lightDemoAccounts.SOL}).` : "",
|
|
8862
8854
|
[mode]
|
|
8863
8855
|
);
|
|
8864
|
-
return /* @__PURE__ */
|
|
8865
|
-
/* @__PURE__ */
|
|
8866
|
-
/* @__PURE__ */
|
|
8856
|
+
return /* @__PURE__ */ jsxs51(Fragment10, { children: [
|
|
8857
|
+
/* @__PURE__ */ jsx81(AccountDetailsModal_default, {}),
|
|
8858
|
+
/* @__PURE__ */ jsxs51(
|
|
8867
8859
|
WalletModalShell_default,
|
|
8868
8860
|
{
|
|
8869
8861
|
isOpen: !!isOpen,
|
|
8870
8862
|
title: "Connect Wallet",
|
|
8871
8863
|
onClose: close,
|
|
8872
8864
|
className: "wallet-connect",
|
|
8873
|
-
rightHeader: /* @__PURE__ */
|
|
8865
|
+
rightHeader: /* @__PURE__ */ jsx81("button", { className: "cross-icon-button", onClick: close, children: /* @__PURE__ */ jsx81(
|
|
8874
8866
|
Cross_default,
|
|
8875
8867
|
{
|
|
8876
8868
|
width: 30,
|
|
@@ -8879,10 +8871,10 @@ var SolanaWalletConnectModal = () => {
|
|
|
8879
8871
|
}
|
|
8880
8872
|
) }),
|
|
8881
8873
|
children: [
|
|
8882
|
-
demoMsg && /* @__PURE__ */
|
|
8883
|
-
mode !== "light" /* light */ ? /* @__PURE__ */
|
|
8884
|
-
/* @__PURE__ */
|
|
8885
|
-
/* @__PURE__ */
|
|
8874
|
+
demoMsg && /* @__PURE__ */ jsx81("p", { className: "muted", children: demoMsg }),
|
|
8875
|
+
mode !== "light" /* light */ ? /* @__PURE__ */ jsxs51(Fragment10, { children: [
|
|
8876
|
+
/* @__PURE__ */ jsx81(SolanaWalletSelect_default, {}),
|
|
8877
|
+
/* @__PURE__ */ jsx81("div", { style: { marginTop: 12 }, children: /* @__PURE__ */ jsx81(
|
|
8886
8878
|
"button",
|
|
8887
8879
|
{
|
|
8888
8880
|
className: "primary",
|
|
@@ -8891,8 +8883,8 @@ var SolanaWalletConnectModal = () => {
|
|
|
8891
8883
|
children: connecting ? "Connecting\u2026" : connected ? "Connected" : "Connect"
|
|
8892
8884
|
}
|
|
8893
8885
|
) })
|
|
8894
|
-
] }) : /* @__PURE__ */
|
|
8895
|
-
/* @__PURE__ */
|
|
8886
|
+
] }) : /* @__PURE__ */ jsxs51("div", { style: { display: "flex", gap: 8 }, children: [
|
|
8887
|
+
/* @__PURE__ */ jsx81(
|
|
8896
8888
|
"button",
|
|
8897
8889
|
{
|
|
8898
8890
|
className: "secondary",
|
|
@@ -8900,7 +8892,7 @@ var SolanaWalletConnectModal = () => {
|
|
|
8900
8892
|
children: "View Account"
|
|
8901
8893
|
}
|
|
8902
8894
|
),
|
|
8903
|
-
/* @__PURE__ */
|
|
8895
|
+
/* @__PURE__ */ jsx81("button", { className: "primary", onClick: close, children: "Close" })
|
|
8904
8896
|
] })
|
|
8905
8897
|
]
|
|
8906
8898
|
}
|
|
@@ -8911,22 +8903,22 @@ var SolanaConnectModal_default = SolanaWalletConnectModal;
|
|
|
8911
8903
|
|
|
8912
8904
|
// src/widgets/transfer/components/tron/TronWalletConnectModal.tsx
|
|
8913
8905
|
import { useCallback as useCallback14, useMemo as useMemo38 } from "react";
|
|
8914
|
-
import { useDispatch as useDispatch21, useSelector as
|
|
8906
|
+
import { useDispatch as useDispatch21, useSelector as useSelector51 } from "react-redux";
|
|
8915
8907
|
import { useWallet as useTronWallet5 } from "@tronweb3/tronwallet-adapter-react-hooks";
|
|
8916
8908
|
|
|
8917
8909
|
// src/widgets/transfer/components/tron/AccountDetailsModal.tsx
|
|
8918
8910
|
import { useMemo as useMemo36 } from "react";
|
|
8919
|
-
import { useDispatch as useDispatch19, useSelector as
|
|
8911
|
+
import { useDispatch as useDispatch19, useSelector as useSelector49 } from "react-redux";
|
|
8920
8912
|
import { useWallet as useTronWallet4 } from "@tronweb3/tronwallet-adapter-react-hooks";
|
|
8921
|
-
import { jsx as
|
|
8913
|
+
import { jsx as jsx82, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
8922
8914
|
var AccountDetailsModal2 = () => {
|
|
8923
8915
|
const dispatch = useDispatch19();
|
|
8924
|
-
const theme =
|
|
8925
|
-
const mode =
|
|
8926
|
-
const networkOption =
|
|
8927
|
-
const sourceChain =
|
|
8928
|
-
const sourceAddress =
|
|
8929
|
-
const isOpen =
|
|
8916
|
+
const theme = useSelector49(selectTheme);
|
|
8917
|
+
const mode = useSelector49(selectMode);
|
|
8918
|
+
const networkOption = useSelector49(selectNetworkOption);
|
|
8919
|
+
const sourceChain = useSelector49(selectSourceChain);
|
|
8920
|
+
const sourceAddress = useSelector49(selectSourceAddress);
|
|
8921
|
+
const isOpen = useSelector49(selectAccountDetailsModal);
|
|
8930
8922
|
const { disconnect: tronWalletDisconnect } = useTronWallet4();
|
|
8931
8923
|
const { balance: tronBalance } = useTronNativeBalance();
|
|
8932
8924
|
const isTrx = sourceChain.shortName === "TRX" /* TRON */;
|
|
@@ -8949,30 +8941,30 @@ var AccountDetailsModal2 = () => {
|
|
|
8949
8941
|
close();
|
|
8950
8942
|
}
|
|
8951
8943
|
};
|
|
8952
|
-
return /* @__PURE__ */
|
|
8944
|
+
return /* @__PURE__ */ jsxs52(
|
|
8953
8945
|
WalletModalShell_default,
|
|
8954
8946
|
{
|
|
8955
8947
|
isOpen: !!isOpen,
|
|
8956
8948
|
title: "Account Details",
|
|
8957
8949
|
onClose: close,
|
|
8958
|
-
rightHeader: /* @__PURE__ */
|
|
8950
|
+
rightHeader: /* @__PURE__ */ jsx82("button", { className: "cross-icon-button", onClick: close, children: /* @__PURE__ */ jsx82(Cross_default, { fill: theme.colorMode === "light" ? "black" : "white" }) }),
|
|
8959
8951
|
children: [
|
|
8960
|
-
/* @__PURE__ */
|
|
8961
|
-
/* @__PURE__ */
|
|
8962
|
-
/* @__PURE__ */
|
|
8963
|
-
sourceAddress && /* @__PURE__ */
|
|
8952
|
+
/* @__PURE__ */ jsxs52("div", { className: "summary", children: [
|
|
8953
|
+
/* @__PURE__ */ jsxs52("div", { className: "address", children: [
|
|
8954
|
+
/* @__PURE__ */ jsx82("h2", { children: sourceAddress ? getShortenedAddress(sourceAddress) : "\u2014" }),
|
|
8955
|
+
sourceAddress && /* @__PURE__ */ jsx82(CopyButton_default, { text: sourceAddress })
|
|
8964
8956
|
] }),
|
|
8965
|
-
/* @__PURE__ */
|
|
8957
|
+
/* @__PURE__ */ jsxs52("h3", { children: [
|
|
8966
8958
|
formatterFloat.format(Number(tronBalance || 0)),
|
|
8967
8959
|
" TRX"
|
|
8968
8960
|
] })
|
|
8969
8961
|
] }),
|
|
8970
|
-
/* @__PURE__ */
|
|
8971
|
-
/* @__PURE__ */
|
|
8972
|
-
/* @__PURE__ */
|
|
8973
|
-
/* @__PURE__ */
|
|
8962
|
+
/* @__PURE__ */ jsx82(SecondaryButton_default, { className: "block-explorer", children: /* @__PURE__ */ jsxs52(ExternalLink_default, { className: "link", to: explorerUrl, children: [
|
|
8963
|
+
/* @__PURE__ */ jsx82(Explorer_default, { fill: "#778DA3" }),
|
|
8964
|
+
/* @__PURE__ */ jsx82("p", { children: "Block explorer" }),
|
|
8965
|
+
/* @__PURE__ */ jsx82(ExternalUrl_default, { fill: "#778DA3" })
|
|
8974
8966
|
] }) }),
|
|
8975
|
-
/* @__PURE__ */
|
|
8967
|
+
/* @__PURE__ */ jsx82(
|
|
8976
8968
|
PrimaryButton_default,
|
|
8977
8969
|
{
|
|
8978
8970
|
clickHandler: handleDisconnect,
|
|
@@ -8987,14 +8979,14 @@ var AccountDetailsModal2 = () => {
|
|
|
8987
8979
|
var AccountDetailsModal_default2 = AccountDetailsModal2;
|
|
8988
8980
|
|
|
8989
8981
|
// src/widgets/transfer/components/tron/TronWalletSelect.tsx
|
|
8990
|
-
import { useEffect as useEffect23, useMemo as useMemo37, useRef as
|
|
8991
|
-
import { useDispatch as useDispatch20, useSelector as
|
|
8982
|
+
import { useEffect as useEffect23, useMemo as useMemo37, useRef as useRef9 } from "react";
|
|
8983
|
+
import { useDispatch as useDispatch20, useSelector as useSelector50 } from "react-redux";
|
|
8992
8984
|
import { useWallet as useWallet6 } from "@tronweb3/tronwallet-adapter-react-hooks";
|
|
8993
8985
|
import { AdapterState } from "@tronweb3/tronwallet-abstract-adapter";
|
|
8994
|
-
import { jsx as
|
|
8986
|
+
import { jsx as jsx83, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
8995
8987
|
var TronWalletSelect = () => {
|
|
8996
|
-
const theme =
|
|
8997
|
-
const sliderRef =
|
|
8988
|
+
const theme = useSelector50(selectTheme);
|
|
8989
|
+
const sliderRef = useRef9();
|
|
8998
8990
|
const dispatch = useDispatch20();
|
|
8999
8991
|
const {
|
|
9000
8992
|
wallets,
|
|
@@ -9047,27 +9039,27 @@ var TronWalletSelect = () => {
|
|
|
9047
9039
|
const connectWallet = async (walletName) => {
|
|
9048
9040
|
currentWallet?.adapter.name === walletName ? await connect() : select(walletName);
|
|
9049
9041
|
};
|
|
9050
|
-
return /* @__PURE__ */
|
|
9051
|
-
detected.map((wallet, index) => /* @__PURE__ */
|
|
9042
|
+
return /* @__PURE__ */ jsx83("div", { className: `wallet-select`, children: /* @__PURE__ */ jsx83("div", { className: "slide-area hide-scrollbar", ref: sliderRef, children: /* @__PURE__ */ jsxs53("div", { className: "wallet-container", children: [
|
|
9043
|
+
detected.map((wallet, index) => /* @__PURE__ */ jsx83(
|
|
9052
9044
|
"div",
|
|
9053
9045
|
{
|
|
9054
9046
|
className: `card-item ${theme.colorMode}`,
|
|
9055
9047
|
onClick: () => connectWallet(wallet.adapter.name),
|
|
9056
|
-
children: /* @__PURE__ */
|
|
9057
|
-
/* @__PURE__ */
|
|
9058
|
-
/* @__PURE__ */
|
|
9048
|
+
children: /* @__PURE__ */ jsxs53("div", { className: "wallet-item", children: [
|
|
9049
|
+
/* @__PURE__ */ jsx83("img", { src: wallet.adapter.icon, alt: wallet.adapter.name }),
|
|
9050
|
+
/* @__PURE__ */ jsx83("span", { children: wallet.adapter.name })
|
|
9059
9051
|
] })
|
|
9060
9052
|
},
|
|
9061
9053
|
`${wallet.adapter.name}-${index}`
|
|
9062
9054
|
)),
|
|
9063
|
-
undetected.map((wallet, index) => /* @__PURE__ */
|
|
9055
|
+
undetected.map((wallet, index) => /* @__PURE__ */ jsx83(
|
|
9064
9056
|
ExternalLink_default,
|
|
9065
9057
|
{
|
|
9066
9058
|
to: wallet.adapter.url,
|
|
9067
9059
|
className: `card-item ${theme.colorMode}`,
|
|
9068
|
-
children: /* @__PURE__ */
|
|
9069
|
-
/* @__PURE__ */
|
|
9070
|
-
/* @__PURE__ */
|
|
9060
|
+
children: /* @__PURE__ */ jsxs53("div", { className: "wallet-item", children: [
|
|
9061
|
+
/* @__PURE__ */ jsx83("img", { src: wallet.adapter.icon, alt: wallet.adapter.name }),
|
|
9062
|
+
/* @__PURE__ */ jsxs53("span", { children: [
|
|
9071
9063
|
"Install ",
|
|
9072
9064
|
wallet.adapter.name
|
|
9073
9065
|
] })
|
|
@@ -9080,13 +9072,13 @@ var TronWalletSelect = () => {
|
|
|
9080
9072
|
var TronWalletSelect_default = TronWalletSelect;
|
|
9081
9073
|
|
|
9082
9074
|
// src/widgets/transfer/components/tron/TronWalletConnectModal.tsx
|
|
9083
|
-
import { Fragment as Fragment11, jsx as
|
|
9075
|
+
import { Fragment as Fragment11, jsx as jsx84, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
9084
9076
|
var TronWalletConnectModal = () => {
|
|
9085
9077
|
const dispatch = useDispatch21();
|
|
9086
|
-
const theme =
|
|
9087
|
-
const isOpen =
|
|
9088
|
-
const mode =
|
|
9089
|
-
const sourceChain =
|
|
9078
|
+
const theme = useSelector51(selectTheme);
|
|
9079
|
+
const isOpen = useSelector51(selectTronConnectModal);
|
|
9080
|
+
const mode = useSelector51(selectMode);
|
|
9081
|
+
const sourceChain = useSelector51(selectSourceChain);
|
|
9090
9082
|
const { connect, connected, connecting } = useTronWallet5();
|
|
9091
9083
|
const isTrx = sourceChain.shortName === "TRX" /* TRON */;
|
|
9092
9084
|
const close = useCallback14(() => {
|
|
@@ -9112,21 +9104,21 @@ var TronWalletConnectModal = () => {
|
|
|
9112
9104
|
() => mode === "light" /* light */ ? `Light mode uses a demo Tron address (${lightDemoAccounts.TRX}).` : "",
|
|
9113
9105
|
[mode]
|
|
9114
9106
|
);
|
|
9115
|
-
return /* @__PURE__ */
|
|
9116
|
-
/* @__PURE__ */
|
|
9117
|
-
/* @__PURE__ */
|
|
9107
|
+
return /* @__PURE__ */ jsxs54(Fragment11, { children: [
|
|
9108
|
+
/* @__PURE__ */ jsx84(AccountDetailsModal_default2, {}),
|
|
9109
|
+
/* @__PURE__ */ jsxs54(
|
|
9118
9110
|
WalletModalShell_default,
|
|
9119
9111
|
{
|
|
9120
9112
|
isOpen: !!isOpen,
|
|
9121
9113
|
title: "Connect Wallet",
|
|
9122
9114
|
onClose: close,
|
|
9123
9115
|
className: "wallet-connect",
|
|
9124
|
-
rightHeader: /* @__PURE__ */
|
|
9116
|
+
rightHeader: /* @__PURE__ */ jsx84("button", { className: "icon-button", onClick: close, children: /* @__PURE__ */ jsx84(Cross_default, { fill: theme.colorMode === "light" ? "black" : "white" }) }),
|
|
9125
9117
|
children: [
|
|
9126
|
-
demoMsg && /* @__PURE__ */
|
|
9127
|
-
mode !== "light" /* light */ ? /* @__PURE__ */
|
|
9128
|
-
/* @__PURE__ */
|
|
9129
|
-
/* @__PURE__ */
|
|
9118
|
+
demoMsg && /* @__PURE__ */ jsx84("p", { className: "muted", children: demoMsg }),
|
|
9119
|
+
mode !== "light" /* light */ ? /* @__PURE__ */ jsxs54(Fragment11, { children: [
|
|
9120
|
+
/* @__PURE__ */ jsx84(TronWalletSelect_default, {}),
|
|
9121
|
+
/* @__PURE__ */ jsx84("div", { style: { marginTop: 12 }, children: /* @__PURE__ */ jsx84(
|
|
9130
9122
|
"button",
|
|
9131
9123
|
{
|
|
9132
9124
|
className: "primary",
|
|
@@ -9135,8 +9127,8 @@ var TronWalletConnectModal = () => {
|
|
|
9135
9127
|
children: connecting ? "Connecting\u2026" : connected ? "Connected" : "Connect"
|
|
9136
9128
|
}
|
|
9137
9129
|
) })
|
|
9138
|
-
] }) : /* @__PURE__ */
|
|
9139
|
-
/* @__PURE__ */
|
|
9130
|
+
] }) : /* @__PURE__ */ jsxs54("div", { style: { display: "flex", gap: 8 }, children: [
|
|
9131
|
+
/* @__PURE__ */ jsx84(
|
|
9140
9132
|
"button",
|
|
9141
9133
|
{
|
|
9142
9134
|
className: "secondary",
|
|
@@ -9144,7 +9136,7 @@ var TronWalletConnectModal = () => {
|
|
|
9144
9136
|
children: "View Account"
|
|
9145
9137
|
}
|
|
9146
9138
|
),
|
|
9147
|
-
/* @__PURE__ */
|
|
9139
|
+
/* @__PURE__ */ jsx84("button", { className: "primary", onClick: close, children: "Close" })
|
|
9148
9140
|
] })
|
|
9149
9141
|
]
|
|
9150
9142
|
}
|
|
@@ -9154,7 +9146,7 @@ var TronWalletConnectModal = () => {
|
|
|
9154
9146
|
var TronWalletConnectModal_default = TronWalletConnectModal;
|
|
9155
9147
|
|
|
9156
9148
|
// src/widgets/transfer/components/TransferWidget.tsx
|
|
9157
|
-
import { jsx as
|
|
9149
|
+
import { jsx as jsx85, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
9158
9150
|
var TransferWidget = ({
|
|
9159
9151
|
theme,
|
|
9160
9152
|
helpURL,
|
|
@@ -9163,7 +9155,7 @@ var TransferWidget = ({
|
|
|
9163
9155
|
}) => {
|
|
9164
9156
|
logger_default.debug("[TransferWidget] mount");
|
|
9165
9157
|
const dispatch = useDispatch22();
|
|
9166
|
-
const mainRef =
|
|
9158
|
+
const mainRef = useRef10(null);
|
|
9167
9159
|
const [signature, setSignature2] = useState13("");
|
|
9168
9160
|
const [isSubmitting, setIsSubmitting] = useState13(false);
|
|
9169
9161
|
const [formStep, setFormStep] = useState13(0);
|
|
@@ -9173,26 +9165,26 @@ var TransferWidget = ({
|
|
|
9173
9165
|
const [isApproving, setApproving] = useState13(false);
|
|
9174
9166
|
const [isSigning, setSigning] = useState13(false);
|
|
9175
9167
|
const [feeOptionDisabled, setFeeOptionDisabled] = useState13(false);
|
|
9176
|
-
const networkOption =
|
|
9177
|
-
const dAppOption =
|
|
9178
|
-
const mode =
|
|
9179
|
-
const transactionOption =
|
|
9180
|
-
const backendUrl =
|
|
9181
|
-
const sourceAddress =
|
|
9182
|
-
const targetAddress =
|
|
9183
|
-
const sourceChain =
|
|
9184
|
-
const targetChain =
|
|
9185
|
-
const sourceCurrency =
|
|
9186
|
-
const targetCurrency =
|
|
9187
|
-
const amount =
|
|
9188
|
-
const { totalFee, transactionValues } =
|
|
9189
|
-
const compliantOption =
|
|
9190
|
-
const networkOptions =
|
|
9191
|
-
const feeDeduct =
|
|
9192
|
-
const pendingTxs =
|
|
9193
|
-
const networks =
|
|
9194
|
-
const submitted =
|
|
9195
|
-
const ccTransactionStatus =
|
|
9168
|
+
const networkOption = useSelector52(selectNetworkOption);
|
|
9169
|
+
const dAppOption = useSelector52(selectDappOption);
|
|
9170
|
+
const mode = useSelector52(selectMode);
|
|
9171
|
+
const transactionOption = useSelector52(selectTransactionOption);
|
|
9172
|
+
const backendUrl = useSelector52(selectBackendUrl);
|
|
9173
|
+
const sourceAddress = useSelector52(selectSourceAddress);
|
|
9174
|
+
const targetAddress = useSelector52(selectTargetAddress);
|
|
9175
|
+
const sourceChain = useSelector52(selectSourceChain);
|
|
9176
|
+
const targetChain = useSelector52(selectTargetChain);
|
|
9177
|
+
const sourceCurrency = useSelector52(selectSourceCurrency);
|
|
9178
|
+
const targetCurrency = useSelector52(selectTargetCurrency);
|
|
9179
|
+
const amount = useSelector52(selectAmount);
|
|
9180
|
+
const { totalFee, transactionValues } = useSelector52(selectServiceFee);
|
|
9181
|
+
const compliantOption = useSelector52(selectCompliantOption);
|
|
9182
|
+
const networkOptions = useSelector52(selectNetworkOption);
|
|
9183
|
+
const feeDeduct = useSelector52(selectFeeDeduct);
|
|
9184
|
+
const pendingTxs = useSelector52(selectPendingTxs);
|
|
9185
|
+
const networks = useSelector52(selectNetworks);
|
|
9186
|
+
const submitted = useSelector52(selectSubmitted);
|
|
9187
|
+
const ccTransactionStatus = useSelector52(selectCCTransactionStatus);
|
|
9196
9188
|
const txValues = feeDeduct ? transactionValues.feeFromTarget : transactionValues.feeFromOrigin;
|
|
9197
9189
|
const { keplrHandler, closeHandler } = useKimaContext();
|
|
9198
9190
|
const { width: windowWidth } = useWidth_default();
|
|
@@ -9247,7 +9239,7 @@ var TransferWidget = ({
|
|
|
9247
9239
|
);
|
|
9248
9240
|
toast4.error(
|
|
9249
9241
|
"An unexpected error occurred while preparing the transfer. Please contact support for assistance.",
|
|
9250
|
-
{ icon: /* @__PURE__ */
|
|
9242
|
+
{ icon: /* @__PURE__ */ jsx85(Error_default, {}) }
|
|
9251
9243
|
);
|
|
9252
9244
|
}
|
|
9253
9245
|
}, [fees, mode, transactionOption, dispatch]);
|
|
@@ -9305,7 +9297,7 @@ var TransferWidget = ({
|
|
|
9305
9297
|
logger_default.error("[TransferWidget] submit failed", err);
|
|
9306
9298
|
toast4.error(
|
|
9307
9299
|
"Failed to submit your transaction. Please contact support for assistance.",
|
|
9308
|
-
{ icon: /* @__PURE__ */
|
|
9300
|
+
{ icon: /* @__PURE__ */ jsx85(Error_default, {}) }
|
|
9309
9301
|
);
|
|
9310
9302
|
dispatch(setCCTransactionStatus("error-generic"));
|
|
9311
9303
|
}
|
|
@@ -9313,7 +9305,7 @@ var TransferWidget = ({
|
|
|
9313
9305
|
const handleSubmit = async () => {
|
|
9314
9306
|
const { error, message: validationMessage } = validate(true);
|
|
9315
9307
|
if (error === "ValidationError" /* Error */) {
|
|
9316
|
-
toast4.error(validationMessage, { icon: /* @__PURE__ */
|
|
9308
|
+
toast4.error(validationMessage, { icon: /* @__PURE__ */ jsx85(Error_default, {}) });
|
|
9317
9309
|
return;
|
|
9318
9310
|
}
|
|
9319
9311
|
if (["BANK", "CC"].includes(sourceChain.shortName)) {
|
|
@@ -9352,14 +9344,14 @@ var TransferWidget = ({
|
|
|
9352
9344
|
if (msg.includes("ChainMismatch")) {
|
|
9353
9345
|
toast4.error(
|
|
9354
9346
|
`Your wallet is on the wrong network. Please switch to ${sourceChain.name} and try again.`,
|
|
9355
|
-
{ icon: /* @__PURE__ */
|
|
9347
|
+
{ icon: /* @__PURE__ */ jsx85(Error_default, {}) }
|
|
9356
9348
|
);
|
|
9357
9349
|
return;
|
|
9358
9350
|
}
|
|
9359
9351
|
logger_default.error("[TransferWidget] approval failed", err);
|
|
9360
9352
|
toast4.error(
|
|
9361
9353
|
"Failed to approve the token allowance. Please contact support for assistance.",
|
|
9362
|
-
{ icon: /* @__PURE__ */
|
|
9354
|
+
{ icon: /* @__PURE__ */ jsx85(Error_default, {}) }
|
|
9363
9355
|
);
|
|
9364
9356
|
}
|
|
9365
9357
|
return;
|
|
@@ -9394,7 +9386,7 @@ var TransferWidget = ({
|
|
|
9394
9386
|
logger_default.error("[TransferWidget] handleSubmit failed", err);
|
|
9395
9387
|
toast4.error(
|
|
9396
9388
|
"An unexpected error occurred while submitting. Please contact support for assistance.",
|
|
9397
|
-
{ icon: /* @__PURE__ */
|
|
9389
|
+
{ icon: /* @__PURE__ */ jsx85(Error_default, {}) }
|
|
9398
9390
|
);
|
|
9399
9391
|
setIsSubmitting(false);
|
|
9400
9392
|
}
|
|
@@ -9414,7 +9406,7 @@ var TransferWidget = ({
|
|
|
9414
9406
|
void handleSubmit();
|
|
9415
9407
|
return;
|
|
9416
9408
|
}
|
|
9417
|
-
toast4.error(validationMessage, { icon: /* @__PURE__ */
|
|
9409
|
+
toast4.error(validationMessage, { icon: /* @__PURE__ */ jsx85(Error_default, {}) });
|
|
9418
9410
|
mainRef.current?.click();
|
|
9419
9411
|
};
|
|
9420
9412
|
const onBack = () => {
|
|
@@ -9442,7 +9434,7 @@ var TransferWidget = ({
|
|
|
9442
9434
|
logger_default.error("[TransferWidget] cancel approve failed", err);
|
|
9443
9435
|
toast4.error(
|
|
9444
9436
|
"Unable to cancel the approval. Please contact support for assistance.",
|
|
9445
|
-
{ icon: /* @__PURE__ */
|
|
9437
|
+
{ icon: /* @__PURE__ */ jsx85(Error_default, {}) }
|
|
9446
9438
|
);
|
|
9447
9439
|
}
|
|
9448
9440
|
} finally {
|
|
@@ -9487,11 +9479,11 @@ var TransferWidget = ({
|
|
|
9487
9479
|
logger_default.error("[TransferWidget] reset failed", e);
|
|
9488
9480
|
toast4.error(
|
|
9489
9481
|
"Unable to reset the form. Please contact support for assistance.",
|
|
9490
|
-
{ icon: /* @__PURE__ */
|
|
9482
|
+
{ icon: /* @__PURE__ */ jsx85(Error_default, {}) }
|
|
9491
9483
|
);
|
|
9492
9484
|
}
|
|
9493
9485
|
};
|
|
9494
|
-
return /* @__PURE__ */
|
|
9486
|
+
return /* @__PURE__ */ jsxs55(
|
|
9495
9487
|
"div",
|
|
9496
9488
|
{
|
|
9497
9489
|
className: `kima-card ${theme.colorMode}`,
|
|
@@ -9499,7 +9491,7 @@ var TransferWidget = ({
|
|
|
9499
9491
|
background: theme.colorMode === "light" /* light */ ? theme.backgroundColorLight : theme.backgroundColorDark
|
|
9500
9492
|
},
|
|
9501
9493
|
children: [
|
|
9502
|
-
resetModalOpen && /* @__PURE__ */
|
|
9494
|
+
resetModalOpen && /* @__PURE__ */ jsx85(
|
|
9503
9495
|
WarningModal_default,
|
|
9504
9496
|
{
|
|
9505
9497
|
message: "Are you sure you want to reset the widget?",
|
|
@@ -9511,7 +9503,7 @@ var TransferWidget = ({
|
|
|
9511
9503
|
onCancel: () => setResetModalOpen(false)
|
|
9512
9504
|
}
|
|
9513
9505
|
),
|
|
9514
|
-
warningModalOpen && /* @__PURE__ */
|
|
9506
|
+
warningModalOpen && /* @__PURE__ */ jsx85(
|
|
9515
9507
|
WarningModal_default,
|
|
9516
9508
|
{
|
|
9517
9509
|
message: warningModalOpen.message,
|
|
@@ -9525,21 +9517,21 @@ var TransferWidget = ({
|
|
|
9525
9517
|
}
|
|
9526
9518
|
}
|
|
9527
9519
|
),
|
|
9528
|
-
mode === "payment" /* payment */ && !transactionOption && /* @__PURE__ */
|
|
9529
|
-
/* @__PURE__ */
|
|
9530
|
-
/* @__PURE__ */
|
|
9531
|
-
/* @__PURE__ */
|
|
9532
|
-
/* @__PURE__ */
|
|
9533
|
-
/* @__PURE__ */
|
|
9534
|
-
/* @__PURE__ */
|
|
9520
|
+
mode === "payment" /* payment */ && !transactionOption && /* @__PURE__ */ jsx85("h2", { className: "invalid-option-banner", children: "We're unable to process your payment. Please ensure the necessary transaction details are provided. Contact support if the issue persists." }),
|
|
9521
|
+
/* @__PURE__ */ jsxs55("div", { className: "transfer-card", children: [
|
|
9522
|
+
/* @__PURE__ */ jsxs55("div", { className: "kima-card-header", children: [
|
|
9523
|
+
/* @__PURE__ */ jsxs55("div", { className: "topbar", children: [
|
|
9524
|
+
/* @__PURE__ */ jsx85("div", { className: "title", children: /* @__PURE__ */ jsx85("h3", { style: { marginRight: "5px" }, children: formStep === 0 ? titleOption?.initialTitle ?? (mode === "payment" /* payment */ ? "New Purchase" : "New Transfer") : titleOption?.confirmTitle ?? (mode === "payment" /* payment */ ? "Confirm Purchase" : "Transfer Details") }) }),
|
|
9525
|
+
/* @__PURE__ */ jsxs55("div", { className: "control-buttons", children: [
|
|
9526
|
+
/* @__PURE__ */ jsx85(
|
|
9535
9527
|
ExternalLink_default,
|
|
9536
9528
|
{
|
|
9537
9529
|
to: helpURL ? helpURL : networkOption === "testnet" /* testnet */ ? "https://docs.kima.network/kima-network/try-kima-with-the-demo-app" : "https://support.kima.network",
|
|
9538
|
-
children: /* @__PURE__ */
|
|
9530
|
+
children: /* @__PURE__ */ jsx85("div", { className: "menu-button", children: "I need help" })
|
|
9539
9531
|
}
|
|
9540
9532
|
),
|
|
9541
|
-
["BANK", "CC"].includes(sourceChain.shortName) && formStep > 0 && /* @__PURE__ */
|
|
9542
|
-
formStep === 0 && mode !== "payment" /* payment */ && /* @__PURE__ */
|
|
9533
|
+
["BANK", "CC"].includes(sourceChain.shortName) && formStep > 0 && /* @__PURE__ */ jsx85(ExternalLink_default, { to: "https://docs.kima.network/kima-network/supported-fiat#unsupported-countries-credit-cards", children: /* @__PURE__ */ jsx85("div", { className: "menu-button", children: "Unsupported Countries" }) }),
|
|
9534
|
+
formStep === 0 && mode !== "payment" /* payment */ && /* @__PURE__ */ jsx85(
|
|
9543
9535
|
"button",
|
|
9544
9536
|
{
|
|
9545
9537
|
className: "reset-button",
|
|
@@ -9548,7 +9540,7 @@ var TransferWidget = ({
|
|
|
9548
9540
|
children: "Reset"
|
|
9549
9541
|
}
|
|
9550
9542
|
),
|
|
9551
|
-
closeHandler && /* @__PURE__ */
|
|
9543
|
+
closeHandler && /* @__PURE__ */ jsx85(
|
|
9552
9544
|
"button",
|
|
9553
9545
|
{
|
|
9554
9546
|
className: "cross-icon-button",
|
|
@@ -9556,14 +9548,14 @@ var TransferWidget = ({
|
|
|
9556
9548
|
resetForm();
|
|
9557
9549
|
closeHandler(0);
|
|
9558
9550
|
},
|
|
9559
|
-
children: /* @__PURE__ */
|
|
9551
|
+
children: /* @__PURE__ */ jsx85(Cross_default, {})
|
|
9560
9552
|
}
|
|
9561
9553
|
)
|
|
9562
9554
|
] })
|
|
9563
9555
|
] }),
|
|
9564
|
-
mode === "payment" /* payment */ && paymentTitleOption?.title && /* @__PURE__ */
|
|
9556
|
+
mode === "payment" /* payment */ && paymentTitleOption?.title && /* @__PURE__ */ jsx85("h4", { className: "subtitle", children: paymentTitleOption.title })
|
|
9565
9557
|
] }),
|
|
9566
|
-
/* @__PURE__ */
|
|
9558
|
+
/* @__PURE__ */ jsx85("div", { className: "kima-card-content", ref: mainRef, children: formStep === 0 ? /* @__PURE__ */ jsx85(
|
|
9567
9559
|
SingleForm_default,
|
|
9568
9560
|
{
|
|
9569
9561
|
...{
|
|
@@ -9576,7 +9568,7 @@ var TransferWidget = ({
|
|
|
9576
9568
|
setInitialSelection
|
|
9577
9569
|
}
|
|
9578
9570
|
}
|
|
9579
|
-
) : ccTransactionStatus !== "idle" ? /* @__PURE__ */
|
|
9571
|
+
) : ccTransactionStatus !== "idle" ? /* @__PURE__ */ jsx85(FiatWidget_default, { submitCallback: submit }) : /* @__PURE__ */ jsx85(
|
|
9580
9572
|
ConfirmDetails_default,
|
|
9581
9573
|
{
|
|
9582
9574
|
...{
|
|
@@ -9585,12 +9577,12 @@ var TransferWidget = ({
|
|
|
9585
9577
|
}
|
|
9586
9578
|
}
|
|
9587
9579
|
) }),
|
|
9588
|
-
/* @__PURE__ */
|
|
9580
|
+
/* @__PURE__ */ jsx85(
|
|
9589
9581
|
"div",
|
|
9590
9582
|
{
|
|
9591
9583
|
className: `kima-card-footer ${mode === "bridge" /* bridge */ && formStep !== 0 && "confirm"}`,
|
|
9592
|
-
children: /* @__PURE__ */
|
|
9593
|
-
isBackButtonEnabled && /* @__PURE__ */
|
|
9584
|
+
children: /* @__PURE__ */ jsxs55("div", { className: "button-group", children: [
|
|
9585
|
+
isBackButtonEnabled && /* @__PURE__ */ jsx85(
|
|
9594
9586
|
SecondaryButton_default,
|
|
9595
9587
|
{
|
|
9596
9588
|
clickHandler: onBack,
|
|
@@ -9600,7 +9592,7 @@ var TransferWidget = ({
|
|
|
9600
9592
|
}
|
|
9601
9593
|
),
|
|
9602
9594
|
!!allowance && allowance > 0n && formStep !== 0 && !["BANK", "CC"].includes(sourceChain.shortName) && // EVM path
|
|
9603
|
-
mode !== "light" /* light */ && /* @__PURE__ */
|
|
9595
|
+
mode !== "light" /* light */ && /* @__PURE__ */ jsx85(
|
|
9604
9596
|
SecondaryButton_default,
|
|
9605
9597
|
{
|
|
9606
9598
|
clickHandler: onCancelApprove,
|
|
@@ -9610,7 +9602,7 @@ var TransferWidget = ({
|
|
|
9610
9602
|
children: isCancellingApprove ? "Cancelling Approval" : "Cancel Approve"
|
|
9611
9603
|
}
|
|
9612
9604
|
),
|
|
9613
|
-
isSubmitButtonEnabled && /* @__PURE__ */
|
|
9605
|
+
isSubmitButtonEnabled && /* @__PURE__ */ jsx85(
|
|
9614
9606
|
PrimaryButton_default,
|
|
9615
9607
|
{
|
|
9616
9608
|
clickHandler: onNext,
|
|
@@ -9622,9 +9614,9 @@ var TransferWidget = ({
|
|
|
9622
9614
|
] })
|
|
9623
9615
|
}
|
|
9624
9616
|
),
|
|
9625
|
-
/* @__PURE__ */
|
|
9626
|
-
/* @__PURE__ */
|
|
9627
|
-
/* @__PURE__ */
|
|
9617
|
+
/* @__PURE__ */ jsx85(SolanaConnectModal_default, {}),
|
|
9618
|
+
/* @__PURE__ */ jsx85(TronWalletConnectModal_default, {}),
|
|
9619
|
+
/* @__PURE__ */ jsx85(
|
|
9628
9620
|
Toaster2,
|
|
9629
9621
|
{
|
|
9630
9622
|
position: "top-right",
|
|
@@ -9648,9 +9640,9 @@ var TransferWidget = ({
|
|
|
9648
9640
|
}
|
|
9649
9641
|
}
|
|
9650
9642
|
),
|
|
9651
|
-
/* @__PURE__ */
|
|
9652
|
-
/* @__PURE__ */
|
|
9653
|
-
/* @__PURE__ */
|
|
9643
|
+
/* @__PURE__ */ jsx85("div", { className: "floating-footer", children: /* @__PURE__ */ jsxs55("div", { className: `items ${theme.colorMode}`, children: [
|
|
9644
|
+
/* @__PURE__ */ jsx85("span", { children: "Powered by" }),
|
|
9645
|
+
/* @__PURE__ */ jsx85(KimaNetwork_default, {})
|
|
9654
9646
|
] }) })
|
|
9655
9647
|
] })
|
|
9656
9648
|
]
|
|
@@ -9659,7 +9651,7 @@ var TransferWidget = ({
|
|
|
9659
9651
|
};
|
|
9660
9652
|
|
|
9661
9653
|
// src/widgets/common/KimaWidgetWrapper.tsx
|
|
9662
|
-
import { jsx as
|
|
9654
|
+
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
9663
9655
|
var KimaWidgetWrapper = ({
|
|
9664
9656
|
mode,
|
|
9665
9657
|
txId,
|
|
@@ -9677,14 +9669,14 @@ var KimaWidgetWrapper = ({
|
|
|
9677
9669
|
const { kimaBackendUrl } = useKimaContext();
|
|
9678
9670
|
const dispatch = useDispatch23();
|
|
9679
9671
|
const { setThemeMode, setThemeVariables } = useAppKitTheme();
|
|
9680
|
-
const submitted =
|
|
9681
|
-
const sourceChain =
|
|
9682
|
-
const ccTransactionStatus =
|
|
9683
|
-
const ccTransactionRetrying =
|
|
9672
|
+
const submitted = useSelector53(selectSubmitted);
|
|
9673
|
+
const sourceChain = useSelector53(selectSourceChain);
|
|
9674
|
+
const ccTransactionStatus = useSelector53(selectCCTransactionStatus);
|
|
9675
|
+
const ccTransactionRetrying = useSelector53(selectCCTransactionRetrying);
|
|
9684
9676
|
const networkOption = envOptions?.env;
|
|
9685
9677
|
const kimaExplorer = envOptions?.kimaExplorer || "https://explorer.sardis.kima.network";
|
|
9686
9678
|
const { currentPlugin } = useGetCurrentPlugin_default();
|
|
9687
|
-
const prevColorMode =
|
|
9679
|
+
const prevColorMode = useRef11(void 0);
|
|
9688
9680
|
useEffect25(() => {
|
|
9689
9681
|
if (prevColorMode.current !== theme?.colorMode) {
|
|
9690
9682
|
dispatch(setTheme(theme));
|
|
@@ -9698,7 +9690,7 @@ var KimaWidgetWrapper = ({
|
|
|
9698
9690
|
prevColorMode.current = theme?.colorMode;
|
|
9699
9691
|
}
|
|
9700
9692
|
}, [theme?.colorMode, dispatch, setThemeMode, setThemeVariables, theme]);
|
|
9701
|
-
const prevConfigRef =
|
|
9693
|
+
const prevConfigRef = useRef11({
|
|
9702
9694
|
compliantOption: void 0,
|
|
9703
9695
|
backendUrl: void 0,
|
|
9704
9696
|
mode: void 0,
|
|
@@ -9740,7 +9732,7 @@ var KimaWidgetWrapper = ({
|
|
|
9740
9732
|
kimaExplorer,
|
|
9741
9733
|
dispatch
|
|
9742
9734
|
]);
|
|
9743
|
-
const prevTxOptJson =
|
|
9735
|
+
const prevTxOptJson = useRef11(null);
|
|
9744
9736
|
useEffect25(() => {
|
|
9745
9737
|
const nextJson = transactionOption ? JSON.stringify(transactionOption) : null;
|
|
9746
9738
|
if (nextJson === prevTxOptJson.current) return;
|
|
@@ -9770,8 +9762,8 @@ var KimaWidgetWrapper = ({
|
|
|
9770
9762
|
}
|
|
9771
9763
|
prevTxOptJson.current = nextJson;
|
|
9772
9764
|
}, [transactionOption, chainData, dispatch]);
|
|
9773
|
-
const prevModeRef =
|
|
9774
|
-
const prevTxIdRef =
|
|
9765
|
+
const prevModeRef = useRef11(void 0);
|
|
9766
|
+
const prevTxIdRef = useRef11(void 0);
|
|
9775
9767
|
useEffect25(() => {
|
|
9776
9768
|
const modeChanged = prevModeRef.current !== mode;
|
|
9777
9769
|
const txChanged = prevTxIdRef.current !== txId;
|
|
@@ -9803,7 +9795,7 @@ var KimaWidgetWrapper = ({
|
|
|
9803
9795
|
prevTxIdRef.current = txId;
|
|
9804
9796
|
}
|
|
9805
9797
|
}, [mode, txId, transactionOption, dispatch]);
|
|
9806
|
-
const didIndex =
|
|
9798
|
+
const didIndex = useRef11(false);
|
|
9807
9799
|
useEffect25(() => {
|
|
9808
9800
|
if (!chainData?.length || didIndex.current) return;
|
|
9809
9801
|
logger_default.debug(
|
|
@@ -9829,10 +9821,10 @@ var KimaWidgetWrapper = ({
|
|
|
9829
9821
|
}, [currentPlugin?.id, sourceChain?.shortName]);
|
|
9830
9822
|
const content = useMemo40(() => {
|
|
9831
9823
|
if (mode === "status" /* status */) {
|
|
9832
|
-
return /* @__PURE__ */
|
|
9824
|
+
return /* @__PURE__ */ jsx86(TransactionWidget, { theme });
|
|
9833
9825
|
}
|
|
9834
9826
|
if (!currentPlugin && !sourceChain?.shortName) {
|
|
9835
|
-
return /* @__PURE__ */
|
|
9827
|
+
return /* @__PURE__ */ jsx86(
|
|
9836
9828
|
TransferWidget,
|
|
9837
9829
|
{
|
|
9838
9830
|
theme,
|
|
@@ -9844,15 +9836,15 @@ var KimaWidgetWrapper = ({
|
|
|
9844
9836
|
);
|
|
9845
9837
|
}
|
|
9846
9838
|
if (!currentPlugin) {
|
|
9847
|
-
return /* @__PURE__ */
|
|
9839
|
+
return /* @__PURE__ */ jsx86(SkeletonLoader_default, { theme });
|
|
9848
9840
|
}
|
|
9849
9841
|
if (sourceChain.shortName === "CC") {
|
|
9850
9842
|
if (submitted) {
|
|
9851
9843
|
logger_default.debug("[KimaWidgetWrapper] CC mode -> TransactionWidget");
|
|
9852
|
-
return /* @__PURE__ */
|
|
9844
|
+
return /* @__PURE__ */ jsx86(TransactionWidget, { theme });
|
|
9853
9845
|
}
|
|
9854
9846
|
if (ccTransactionStatus === "error-id") {
|
|
9855
|
-
return /* @__PURE__ */
|
|
9847
|
+
return /* @__PURE__ */ jsx86(
|
|
9856
9848
|
ErrorWidget_default,
|
|
9857
9849
|
{
|
|
9858
9850
|
theme,
|
|
@@ -9867,7 +9859,7 @@ var KimaWidgetWrapper = ({
|
|
|
9867
9859
|
);
|
|
9868
9860
|
}
|
|
9869
9861
|
if (ccTransactionStatus === "error-generic") {
|
|
9870
|
-
return /* @__PURE__ */
|
|
9862
|
+
return /* @__PURE__ */ jsx86(
|
|
9871
9863
|
ErrorWidget_default,
|
|
9872
9864
|
{
|
|
9873
9865
|
theme,
|
|
@@ -9881,7 +9873,7 @@ var KimaWidgetWrapper = ({
|
|
|
9881
9873
|
}
|
|
9882
9874
|
);
|
|
9883
9875
|
}
|
|
9884
|
-
return /* @__PURE__ */
|
|
9876
|
+
return /* @__PURE__ */ jsx86(
|
|
9885
9877
|
TransferWidget,
|
|
9886
9878
|
{
|
|
9887
9879
|
theme,
|
|
@@ -9896,7 +9888,7 @@ var KimaWidgetWrapper = ({
|
|
|
9896
9888
|
"[KimaWidgetWrapper] rendering TransferWidget with plugin",
|
|
9897
9889
|
currentPlugin?.id
|
|
9898
9890
|
);
|
|
9899
|
-
return submitted ? /* @__PURE__ */
|
|
9891
|
+
return submitted ? /* @__PURE__ */ jsx86(TransactionWidget, { theme }) : /* @__PURE__ */ jsx86(
|
|
9900
9892
|
TransferWidget,
|
|
9901
9893
|
{
|
|
9902
9894
|
theme,
|
|
@@ -9925,7 +9917,7 @@ var KimaWidgetWrapper = ({
|
|
|
9925
9917
|
var KimaWidgetWrapper_default = KimaWidgetWrapper;
|
|
9926
9918
|
|
|
9927
9919
|
// src/widgets/common/KimaTransactionWidget.tsx
|
|
9928
|
-
import { jsx as
|
|
9920
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
9929
9921
|
var KimaTransactionWidget = ({
|
|
9930
9922
|
mode,
|
|
9931
9923
|
txId,
|
|
@@ -9959,11 +9951,11 @@ var KimaTransactionWidget = ({
|
|
|
9959
9951
|
}
|
|
9960
9952
|
}, [theme?.colorMode, dispatch, theme]);
|
|
9961
9953
|
if (!hydrated || !theme?.colorMode)
|
|
9962
|
-
return /* @__PURE__ */
|
|
9954
|
+
return /* @__PURE__ */ jsx87(ring_default, { width: 20, height: 20, fill: "#86b8ce" });
|
|
9963
9955
|
if (isLoadingEnvs || isLoadingChainData)
|
|
9964
|
-
return /* @__PURE__ */
|
|
9956
|
+
return /* @__PURE__ */ jsx87(SkeletonLoader_default, { theme });
|
|
9965
9957
|
if (envOptionsError || !envOptions)
|
|
9966
|
-
return /* @__PURE__ */
|
|
9958
|
+
return /* @__PURE__ */ jsx87(
|
|
9967
9959
|
ErrorWidget_default,
|
|
9968
9960
|
{
|
|
9969
9961
|
theme,
|
|
@@ -9972,7 +9964,7 @@ var KimaTransactionWidget = ({
|
|
|
9972
9964
|
}
|
|
9973
9965
|
);
|
|
9974
9966
|
if (chainDataError || !chainData)
|
|
9975
|
-
return /* @__PURE__ */
|
|
9967
|
+
return /* @__PURE__ */ jsx87(
|
|
9976
9968
|
ErrorWidget_default,
|
|
9977
9969
|
{
|
|
9978
9970
|
theme,
|
|
@@ -9980,7 +9972,7 @@ var KimaTransactionWidget = ({
|
|
|
9980
9972
|
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 */
|
|
9981
9973
|
}
|
|
9982
9974
|
);
|
|
9983
|
-
return /* @__PURE__ */
|
|
9975
|
+
return /* @__PURE__ */ jsx87(
|
|
9984
9976
|
KimaWidgetWrapper_default,
|
|
9985
9977
|
{
|
|
9986
9978
|
...{
|