@trustware/sdk-staging 1.1.3-staging.20 → 1.1.3-staging.31
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/constants.cjs +4 -1
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.cts +2 -1
- package/dist/constants.d.ts +2 -1
- package/dist/constants.mjs +3 -1
- package/dist/constants.mjs.map +1 -1
- package/dist/{core-B0-MyOv6.d.cts → core-DIWJpcYO.d.cts} +4 -0
- package/dist/{core-qSEzIBWs.d.ts → core-DtweriN4.d.ts} +4 -0
- package/dist/core.cjs +25 -3
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.mjs +25 -3
- package/dist/core.mjs.map +1 -1
- package/dist/index.cjs +1024 -636
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +979 -592
- package/dist/index.mjs.map +1 -1
- package/dist/wallet.cjs +5 -3
- package/dist/wallet.cjs.map +1 -1
- package/dist/wallet.mjs +5 -3
- package/dist/wallet.mjs.map +1 -1
- package/dist/widget.cjs +1022 -636
- package/dist/widget.cjs.map +1 -1
- package/dist/widget.mjs +978 -592
- package/dist/widget.mjs.map +1 -1
- package/package.json +1 -1
package/dist/widget.mjs
CHANGED
|
@@ -45,19 +45,21 @@ var init_config = __esm({
|
|
|
45
45
|
};
|
|
46
46
|
DEFAULT_FEATURE_FLAGS = {
|
|
47
47
|
tokensPagination: false,
|
|
48
|
-
balanceStreaming: false
|
|
48
|
+
balanceStreaming: false,
|
|
49
|
+
shouldAllowGA4: true
|
|
49
50
|
};
|
|
50
51
|
}
|
|
51
52
|
});
|
|
52
53
|
|
|
53
54
|
// src/constants.ts
|
|
54
|
-
var SDK_NAME, SDK_VERSION, API_ROOT, API_PREFIX, ASSETS_BASE_URL, WALLETCONNECT_PROJECT_ID;
|
|
55
|
+
var SDK_NAME, SDK_VERSION, API_ROOT, GTM_ID, API_PREFIX, ASSETS_BASE_URL, WALLETCONNECT_PROJECT_ID;
|
|
55
56
|
var init_constants = __esm({
|
|
56
57
|
"src/constants.ts"() {
|
|
57
58
|
"use strict";
|
|
58
59
|
SDK_NAME = "@trustware/sdk";
|
|
59
|
-
SDK_VERSION = "1.1.3-staging.
|
|
60
|
+
SDK_VERSION = "1.1.3-staging.31";
|
|
60
61
|
API_ROOT = "https://bv-staging-api.trustware.io";
|
|
62
|
+
GTM_ID = "";
|
|
61
63
|
API_PREFIX = "/api";
|
|
62
64
|
ASSETS_BASE_URL = "https://app.trustware.io";
|
|
63
65
|
WALLETCONNECT_PROJECT_ID = "4ead125c-63be-4b1a-a835-cef2dce67b84";
|
|
@@ -149,7 +151,8 @@ function resolveConfig(input) {
|
|
|
149
151
|
const walletConnect = resolveWalletConnectConfig(input.walletConnect);
|
|
150
152
|
const features = {
|
|
151
153
|
tokensPagination: input.features?.tokensPagination ?? DEFAULT_FEATURE_FLAGS.tokensPagination,
|
|
152
|
-
balanceStreaming: input.features?.balanceStreaming ?? DEFAULT_FEATURE_FLAGS.balanceStreaming
|
|
154
|
+
balanceStreaming: input.features?.balanceStreaming ?? DEFAULT_FEATURE_FLAGS.balanceStreaming,
|
|
155
|
+
shouldAllowGA4: input.features?.shouldAllowGA4 ?? DEFAULT_FEATURE_FLAGS.shouldAllowGA4
|
|
153
156
|
};
|
|
154
157
|
return {
|
|
155
158
|
apiKey: input.apiKey,
|
|
@@ -808,7 +811,7 @@ __export(ConfettiEffect_exports, {
|
|
|
808
811
|
ConfettiEffect: () => ConfettiEffect,
|
|
809
812
|
default: () => ConfettiEffect_default
|
|
810
813
|
});
|
|
811
|
-
import { useEffect as
|
|
814
|
+
import { useEffect as useEffect13, useState as useState15 } from "react";
|
|
812
815
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
813
816
|
function ConfettiEffect({
|
|
814
817
|
isActive,
|
|
@@ -816,7 +819,7 @@ function ConfettiEffect({
|
|
|
816
819
|
pieceCount = 50
|
|
817
820
|
}) {
|
|
818
821
|
const [pieces, setPieces] = useState15([]);
|
|
819
|
-
|
|
822
|
+
useEffect13(() => {
|
|
820
823
|
if (isActive) {
|
|
821
824
|
const colors2 = [
|
|
822
825
|
"#10b981",
|
|
@@ -902,10 +905,10 @@ var init_ConfettiEffect = __esm({
|
|
|
902
905
|
|
|
903
906
|
// src/widget/TrustwareWidgetV2.tsx
|
|
904
907
|
import {
|
|
905
|
-
useState as
|
|
906
|
-
useEffect as
|
|
907
|
-
useRef as
|
|
908
|
-
useCallback as
|
|
908
|
+
useState as useState23,
|
|
909
|
+
useEffect as useEffect27,
|
|
910
|
+
useRef as useRef13,
|
|
911
|
+
useCallback as useCallback15,
|
|
909
912
|
useImperativeHandle,
|
|
910
913
|
forwardRef
|
|
911
914
|
} from "react";
|
|
@@ -4627,6 +4630,26 @@ var Trustware = {
|
|
|
4627
4630
|
});
|
|
4628
4631
|
return Trustware;
|
|
4629
4632
|
},
|
|
4633
|
+
setDestinationChain(chain) {
|
|
4634
|
+
const prev = TrustwareConfigStore.get();
|
|
4635
|
+
TrustwareConfigStore.update({
|
|
4636
|
+
routes: {
|
|
4637
|
+
...prev.routes,
|
|
4638
|
+
toChain: chain
|
|
4639
|
+
}
|
|
4640
|
+
});
|
|
4641
|
+
return Trustware;
|
|
4642
|
+
},
|
|
4643
|
+
setDestinationToken(token) {
|
|
4644
|
+
const prev = TrustwareConfigStore.get();
|
|
4645
|
+
TrustwareConfigStore.update({
|
|
4646
|
+
routes: {
|
|
4647
|
+
...prev.routes,
|
|
4648
|
+
toToken: token
|
|
4649
|
+
}
|
|
4650
|
+
});
|
|
4651
|
+
return Trustware;
|
|
4652
|
+
},
|
|
4630
4653
|
/** Read active wallet */
|
|
4631
4654
|
getWallet() {
|
|
4632
4655
|
return walletManager.wallet;
|
|
@@ -4813,7 +4836,7 @@ function useWalletSessionState() {
|
|
|
4813
4836
|
}
|
|
4814
4837
|
|
|
4815
4838
|
// src/widget/state/deposit/useWalletTokenState.ts
|
|
4816
|
-
import { useEffect as
|
|
4839
|
+
import { useEffect as useEffect12, useRef as useRef4, useState as useState12 } from "react";
|
|
4817
4840
|
|
|
4818
4841
|
// src/widget/hooks/useRouteBuilder.ts
|
|
4819
4842
|
import { useEffect as useEffect8, useMemo as useMemo5, useRef, useState as useState8 } from "react";
|
|
@@ -5112,7 +5135,8 @@ function useTrustwareConfig() {
|
|
|
5112
5135
|
},
|
|
5113
5136
|
features: {
|
|
5114
5137
|
tokensPagination: false,
|
|
5115
|
-
balanceStreaming: false
|
|
5138
|
+
balanceStreaming: false,
|
|
5139
|
+
shouldAllowGA4: true
|
|
5116
5140
|
}
|
|
5117
5141
|
};
|
|
5118
5142
|
}
|
|
@@ -5316,7 +5340,144 @@ function mapTransactionError(err) {
|
|
|
5316
5340
|
}
|
|
5317
5341
|
|
|
5318
5342
|
// src/widget/hooks/useTransactionPolling.ts
|
|
5319
|
-
import { useCallback as
|
|
5343
|
+
import { useCallback as useCallback7, useEffect as useEffect11, useRef as useRef3, useState as useState11 } from "react";
|
|
5344
|
+
init_constants();
|
|
5345
|
+
|
|
5346
|
+
// src/hooks/useGTM.ts
|
|
5347
|
+
import { useEffect as useEffect10, useRef as useRef2, useCallback as useCallback6 } from "react";
|
|
5348
|
+
function useGTM(gtmId) {
|
|
5349
|
+
const isInitialized = useRef2(false);
|
|
5350
|
+
const scriptRef = useRef2(null);
|
|
5351
|
+
const isGA4Allowed = useCallback6(() => {
|
|
5352
|
+
try {
|
|
5353
|
+
return Trustware.getConfig().features.shouldAllowGA4;
|
|
5354
|
+
} catch {
|
|
5355
|
+
return false;
|
|
5356
|
+
}
|
|
5357
|
+
}, []);
|
|
5358
|
+
useEffect10(() => {
|
|
5359
|
+
if (!isGA4Allowed()) {
|
|
5360
|
+
console.warn(
|
|
5361
|
+
"useGTM: GA4 tracking is disabled or Trustware config not initialized."
|
|
5362
|
+
);
|
|
5363
|
+
return;
|
|
5364
|
+
}
|
|
5365
|
+
if (!gtmId || typeof gtmId !== "string") {
|
|
5366
|
+
console.error(
|
|
5367
|
+
"useGTM: A valid GTM Container ID is required (format: GTM-XXXXX)."
|
|
5368
|
+
);
|
|
5369
|
+
return;
|
|
5370
|
+
}
|
|
5371
|
+
if (isInitialized.current) return;
|
|
5372
|
+
const alreadyLoaded = document.querySelector(
|
|
5373
|
+
`script[src*="googletagmanager.com/gtm.js?id=${gtmId}"]`
|
|
5374
|
+
);
|
|
5375
|
+
if (alreadyLoaded) {
|
|
5376
|
+
window.dataLayer = window.dataLayer || [];
|
|
5377
|
+
isInitialized.current = true;
|
|
5378
|
+
return;
|
|
5379
|
+
}
|
|
5380
|
+
window.dataLayer = window.dataLayer || [];
|
|
5381
|
+
window.dataLayer.push({
|
|
5382
|
+
"gtm.start": (/* @__PURE__ */ new Date()).getTime(),
|
|
5383
|
+
event: "gtm.js"
|
|
5384
|
+
});
|
|
5385
|
+
const firstScript = document.getElementsByTagName("script")[0];
|
|
5386
|
+
const script = document.createElement("script");
|
|
5387
|
+
script.async = true;
|
|
5388
|
+
script.src = `https://www.googletagmanager.com/gtm.js?id=${gtmId}`;
|
|
5389
|
+
firstScript.parentNode?.insertBefore(script, firstScript);
|
|
5390
|
+
scriptRef.current = script;
|
|
5391
|
+
isInitialized.current = true;
|
|
5392
|
+
return () => {
|
|
5393
|
+
if (scriptRef.current) {
|
|
5394
|
+
scriptRef.current.parentNode?.removeChild(scriptRef.current);
|
|
5395
|
+
scriptRef.current = null;
|
|
5396
|
+
}
|
|
5397
|
+
isInitialized.current = false;
|
|
5398
|
+
};
|
|
5399
|
+
}, [gtmId, isGA4Allowed]);
|
|
5400
|
+
const addNoscriptIframe = useCallback6(() => {
|
|
5401
|
+
if (!isGA4Allowed()) return;
|
|
5402
|
+
if (document.querySelector('iframe[src*="googletagmanager.com/ns.html"]'))
|
|
5403
|
+
return;
|
|
5404
|
+
const noscript = document.createElement("noscript");
|
|
5405
|
+
const iframe = document.createElement("iframe");
|
|
5406
|
+
iframe.src = `https://www.googletagmanager.com/ns.html?id=${gtmId}`;
|
|
5407
|
+
iframe.height = "0";
|
|
5408
|
+
iframe.width = "0";
|
|
5409
|
+
iframe.style.display = "none";
|
|
5410
|
+
iframe.style.visibility = "hidden";
|
|
5411
|
+
noscript.appendChild(iframe);
|
|
5412
|
+
document.body.insertBefore(noscript, document.body.firstChild);
|
|
5413
|
+
}, [gtmId, isGA4Allowed]);
|
|
5414
|
+
const trackEvent = useCallback6(
|
|
5415
|
+
(eventName, eventParams = {}) => {
|
|
5416
|
+
if (!isInitialized.current) {
|
|
5417
|
+
console.warn(
|
|
5418
|
+
"useGTM: Not initialized. Ensure a valid GTM Container ID was provided."
|
|
5419
|
+
);
|
|
5420
|
+
return;
|
|
5421
|
+
}
|
|
5422
|
+
if (!eventName || typeof eventName !== "string") {
|
|
5423
|
+
console.error("useGTM: A valid event name is required.");
|
|
5424
|
+
return;
|
|
5425
|
+
}
|
|
5426
|
+
const payload = { event: eventName, ...eventParams };
|
|
5427
|
+
window.dataLayer.push(payload);
|
|
5428
|
+
},
|
|
5429
|
+
[]
|
|
5430
|
+
);
|
|
5431
|
+
const trackPageView = useCallback6(
|
|
5432
|
+
(pagePath, pageTitle = document.title) => {
|
|
5433
|
+
trackEvent("page_view", {
|
|
5434
|
+
page_path: pagePath,
|
|
5435
|
+
page_title: pageTitle,
|
|
5436
|
+
page_location: window.location.href
|
|
5437
|
+
});
|
|
5438
|
+
},
|
|
5439
|
+
[trackEvent]
|
|
5440
|
+
);
|
|
5441
|
+
const setUserProperty = useCallback6(
|
|
5442
|
+
(propertyName, value) => {
|
|
5443
|
+
if (!isInitialized.current) {
|
|
5444
|
+
console.warn(
|
|
5445
|
+
"useGTM: Not initialized. Ensure a valid GTM Container ID was provided."
|
|
5446
|
+
);
|
|
5447
|
+
return;
|
|
5448
|
+
}
|
|
5449
|
+
const payload = {
|
|
5450
|
+
event: "user_property",
|
|
5451
|
+
user_property_name: propertyName,
|
|
5452
|
+
user_property_value: value
|
|
5453
|
+
};
|
|
5454
|
+
window.dataLayer.push(payload);
|
|
5455
|
+
},
|
|
5456
|
+
[]
|
|
5457
|
+
);
|
|
5458
|
+
const directGtag = useCallback6(
|
|
5459
|
+
(command, ...args) => {
|
|
5460
|
+
if (!isGA4Allowed()) return;
|
|
5461
|
+
if (!window.gtag) {
|
|
5462
|
+
console.warn(
|
|
5463
|
+
"useGTM: window.gtag is not available. Load gtag.js separately to use this method."
|
|
5464
|
+
);
|
|
5465
|
+
return;
|
|
5466
|
+
}
|
|
5467
|
+
window.gtag(command, ...args);
|
|
5468
|
+
},
|
|
5469
|
+
[isGA4Allowed]
|
|
5470
|
+
);
|
|
5471
|
+
return {
|
|
5472
|
+
trackEvent,
|
|
5473
|
+
trackPageView,
|
|
5474
|
+
setUserProperty,
|
|
5475
|
+
directGtag,
|
|
5476
|
+
addNoscriptIframe
|
|
5477
|
+
};
|
|
5478
|
+
}
|
|
5479
|
+
|
|
5480
|
+
// src/widget/hooks/useTransactionPolling.ts
|
|
5320
5481
|
var FAST_POLL_INTERVAL_MS = 1500;
|
|
5321
5482
|
var NORMAL_POLL_INTERVAL_MS = 2500;
|
|
5322
5483
|
var POLL_TIMEOUT_MS = 5 * 60 * 1e3;
|
|
@@ -5324,6 +5485,15 @@ function useTransactionPolling() {
|
|
|
5324
5485
|
const { setCurrentStep } = useDepositNavigation();
|
|
5325
5486
|
const { setTransactionStatus, setErrorMessage } = useDepositTransaction();
|
|
5326
5487
|
const { emitSuccess } = useTrustware();
|
|
5488
|
+
const { selectedChain, selectedToken } = useDepositForm();
|
|
5489
|
+
const destinationConfig = (() => {
|
|
5490
|
+
try {
|
|
5491
|
+
return Trustware.getConfig();
|
|
5492
|
+
} catch {
|
|
5493
|
+
return void 0;
|
|
5494
|
+
}
|
|
5495
|
+
})();
|
|
5496
|
+
const { trackEvent } = useGTM(GTM_ID);
|
|
5327
5497
|
const [state, setState] = useState11({
|
|
5328
5498
|
isPolling: false,
|
|
5329
5499
|
apiStatus: null,
|
|
@@ -5331,12 +5501,12 @@ function useTransactionPolling() {
|
|
|
5331
5501
|
transaction: null,
|
|
5332
5502
|
receiptSubmitted: false
|
|
5333
5503
|
});
|
|
5334
|
-
const pollingRef =
|
|
5335
|
-
const timeoutRef =
|
|
5336
|
-
const abortRef =
|
|
5337
|
-
const startTimeRef =
|
|
5338
|
-
const pollCountRef =
|
|
5339
|
-
const clearPolling =
|
|
5504
|
+
const pollingRef = useRef3(null);
|
|
5505
|
+
const timeoutRef = useRef3(null);
|
|
5506
|
+
const abortRef = useRef3(false);
|
|
5507
|
+
const startTimeRef = useRef3(0);
|
|
5508
|
+
const pollCountRef = useRef3(0);
|
|
5509
|
+
const clearPolling = useCallback7(() => {
|
|
5340
5510
|
abortRef.current = true;
|
|
5341
5511
|
if (pollingRef.current) {
|
|
5342
5512
|
clearTimeout(pollingRef.current);
|
|
@@ -5347,7 +5517,7 @@ function useTransactionPolling() {
|
|
|
5347
5517
|
timeoutRef.current = null;
|
|
5348
5518
|
}
|
|
5349
5519
|
}, []);
|
|
5350
|
-
const startPolling =
|
|
5520
|
+
const startPolling = useCallback7(
|
|
5351
5521
|
async (intentId, _txHash) => {
|
|
5352
5522
|
clearPolling();
|
|
5353
5523
|
abortRef.current = false;
|
|
@@ -5394,6 +5564,13 @@ function useTransactionPolling() {
|
|
|
5394
5564
|
}));
|
|
5395
5565
|
setTransactionStatus("success");
|
|
5396
5566
|
setCurrentStep("success");
|
|
5567
|
+
trackEvent("payment_completed", {
|
|
5568
|
+
from_chain: selectedChain?.networkName ?? selectedChain?.axelarChainName ?? selectedChain?.chainId ?? "unknown",
|
|
5569
|
+
from_token: selectedToken?.symbol ?? "unknown",
|
|
5570
|
+
to_chain: destinationConfig?.routes?.toChain ?? "unknown",
|
|
5571
|
+
to_token: destinationConfig?.routes?.toToken ?? "unknown",
|
|
5572
|
+
domain: window.origin
|
|
5573
|
+
});
|
|
5397
5574
|
emitSuccess?.(tx);
|
|
5398
5575
|
return;
|
|
5399
5576
|
}
|
|
@@ -5456,20 +5633,27 @@ function useTransactionPolling() {
|
|
|
5456
5633
|
},
|
|
5457
5634
|
[
|
|
5458
5635
|
clearPolling,
|
|
5636
|
+
destinationConfig?.routes.toChain,
|
|
5637
|
+
destinationConfig?.routes.toToken,
|
|
5459
5638
|
emitSuccess,
|
|
5460
|
-
|
|
5639
|
+
selectedChain?.axelarChainName,
|
|
5640
|
+
selectedChain?.chainId,
|
|
5641
|
+
selectedChain?.networkName,
|
|
5642
|
+
selectedToken?.symbol,
|
|
5461
5643
|
setCurrentStep,
|
|
5462
|
-
setErrorMessage
|
|
5644
|
+
setErrorMessage,
|
|
5645
|
+
setTransactionStatus,
|
|
5646
|
+
trackEvent
|
|
5463
5647
|
]
|
|
5464
5648
|
);
|
|
5465
|
-
const stopPolling =
|
|
5649
|
+
const stopPolling = useCallback7(() => {
|
|
5466
5650
|
clearPolling();
|
|
5467
5651
|
setState((prev) => ({
|
|
5468
5652
|
...prev,
|
|
5469
5653
|
isPolling: false
|
|
5470
5654
|
}));
|
|
5471
5655
|
}, [clearPolling]);
|
|
5472
|
-
const resetPolling =
|
|
5656
|
+
const resetPolling = useCallback7(() => {
|
|
5473
5657
|
clearPolling();
|
|
5474
5658
|
setState({
|
|
5475
5659
|
isPolling: false,
|
|
@@ -5479,9 +5663,9 @@ function useTransactionPolling() {
|
|
|
5479
5663
|
receiptSubmitted: false
|
|
5480
5664
|
});
|
|
5481
5665
|
}, [clearPolling]);
|
|
5482
|
-
const clearPollingRef =
|
|
5666
|
+
const clearPollingRef = useRef3(clearPolling);
|
|
5483
5667
|
clearPollingRef.current = clearPolling;
|
|
5484
|
-
|
|
5668
|
+
useEffect11(() => {
|
|
5485
5669
|
return () => {
|
|
5486
5670
|
clearPollingRef.current();
|
|
5487
5671
|
};
|
|
@@ -5552,10 +5736,10 @@ function useWalletTokenState({
|
|
|
5552
5736
|
}) {
|
|
5553
5737
|
const [yourWalletTokens, setYourWalletTokens] = useState12([]);
|
|
5554
5738
|
const [walletTokensReloadNonce, setWalletTokensReloadNonce] = useState12(0);
|
|
5555
|
-
const lastLoadedWalletRef =
|
|
5739
|
+
const lastLoadedWalletRef = useRef4(null);
|
|
5556
5740
|
const { tokens } = useTokens(null);
|
|
5557
5741
|
const { chains } = useChains();
|
|
5558
|
-
|
|
5742
|
+
useEffect12(() => {
|
|
5559
5743
|
if (!walletAddress || chains.length === 0 || tokens.length === 0) {
|
|
5560
5744
|
setYourWalletTokens([]);
|
|
5561
5745
|
if (!walletAddress) {
|
|
@@ -5950,7 +6134,7 @@ function useDepositUi() {
|
|
|
5950
6134
|
}
|
|
5951
6135
|
|
|
5952
6136
|
// src/widget/components/AmountSlider.tsx
|
|
5953
|
-
import { useCallback as
|
|
6137
|
+
import { useCallback as useCallback8, useMemo as useMemo8 } from "react";
|
|
5954
6138
|
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
5955
6139
|
var roundToNiceNumber = (value, range) => {
|
|
5956
6140
|
let roundingFactor;
|
|
@@ -6000,7 +6184,7 @@ function AmountSlider({
|
|
|
6000
6184
|
style,
|
|
6001
6185
|
disabled = false
|
|
6002
6186
|
}) {
|
|
6003
|
-
const generateTickMarks =
|
|
6187
|
+
const generateTickMarks = useCallback8(
|
|
6004
6188
|
(minValue, maxValue) => {
|
|
6005
6189
|
const range = maxValue - minValue;
|
|
6006
6190
|
if (range <= 0) {
|
|
@@ -6052,21 +6236,21 @@ function AmountSlider({
|
|
|
6052
6236
|
() => generateTickMarks(min, max),
|
|
6053
6237
|
[generateTickMarks, min, max]
|
|
6054
6238
|
);
|
|
6055
|
-
const getPercentage =
|
|
6239
|
+
const getPercentage = useCallback8(() => {
|
|
6056
6240
|
const range = max - min;
|
|
6057
6241
|
if (range <= 0) return 0;
|
|
6058
6242
|
const clampedValue = Math.min(Math.max(value, min), max);
|
|
6059
6243
|
return (clampedValue - min) / range * 100;
|
|
6060
6244
|
}, [max, min, value]);
|
|
6061
6245
|
const percentage = useMemo8(() => getPercentage(), [getPercentage]);
|
|
6062
|
-
const handleChange =
|
|
6246
|
+
const handleChange = useCallback8(
|
|
6063
6247
|
(e2) => {
|
|
6064
6248
|
const newValue = Math.min(Math.max(Number(e2.target.value), min), max);
|
|
6065
6249
|
onChange(newValue);
|
|
6066
6250
|
},
|
|
6067
6251
|
[onChange, min, max]
|
|
6068
6252
|
);
|
|
6069
|
-
const handleTickClick =
|
|
6253
|
+
const handleTickClick = useCallback8(
|
|
6070
6254
|
(tickValue) => {
|
|
6071
6255
|
if (disabled) return;
|
|
6072
6256
|
onChange(tickValue);
|
|
@@ -6284,7 +6468,7 @@ function AmountSlider({
|
|
|
6284
6468
|
}
|
|
6285
6469
|
|
|
6286
6470
|
// src/widget/components/AmountInputDisplay.tsx
|
|
6287
|
-
import { useRef as
|
|
6471
|
+
import { useRef as useRef5, useState as useState14 } from "react";
|
|
6288
6472
|
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
6289
6473
|
function formatDisplayAmount(value) {
|
|
6290
6474
|
if (!Number.isFinite(value) || value <= 0) return "0";
|
|
@@ -6324,7 +6508,7 @@ function AmountInputDisplay({
|
|
|
6324
6508
|
inputAriaLabel = "Deposit amount"
|
|
6325
6509
|
}) {
|
|
6326
6510
|
const [isEditing, setIsEditing] = useState14(false);
|
|
6327
|
-
const inputRef =
|
|
6511
|
+
const inputRef = useRef5(null);
|
|
6328
6512
|
const handleAmountClick = () => {
|
|
6329
6513
|
if (isFixedAmount) return;
|
|
6330
6514
|
const isZeroish = !amount || parseFloat(amount) === 0;
|
|
@@ -6539,7 +6723,7 @@ function CircularProgress({
|
|
|
6539
6723
|
}
|
|
6540
6724
|
|
|
6541
6725
|
// src/widget/components/Dialog.tsx
|
|
6542
|
-
import { useEffect as
|
|
6726
|
+
import { useEffect as useEffect14, useRef as useRef6 } from "react";
|
|
6543
6727
|
import { Fragment, jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
6544
6728
|
var Dialog = ({
|
|
6545
6729
|
open,
|
|
@@ -6551,11 +6735,11 @@ var Dialog = ({
|
|
|
6551
6735
|
confirmText = "Close Anyway",
|
|
6552
6736
|
isDark = false
|
|
6553
6737
|
}) => {
|
|
6554
|
-
const dialogRef =
|
|
6555
|
-
const overlayRef =
|
|
6556
|
-
const firstButtonRef =
|
|
6557
|
-
const lastButtonRef =
|
|
6558
|
-
|
|
6738
|
+
const dialogRef = useRef6(null);
|
|
6739
|
+
const overlayRef = useRef6(null);
|
|
6740
|
+
const firstButtonRef = useRef6(null);
|
|
6741
|
+
const lastButtonRef = useRef6(null);
|
|
6742
|
+
useEffect14(() => {
|
|
6559
6743
|
const handleEscape = (e2) => {
|
|
6560
6744
|
if (e2.key === "Escape" && open) {
|
|
6561
6745
|
e2.preventDefault();
|
|
@@ -6569,7 +6753,7 @@ var Dialog = ({
|
|
|
6569
6753
|
document.removeEventListener("keydown", handleEscape);
|
|
6570
6754
|
};
|
|
6571
6755
|
}, [open, onCancel]);
|
|
6572
|
-
|
|
6756
|
+
useEffect14(() => {
|
|
6573
6757
|
const handleTabKey = (e2) => {
|
|
6574
6758
|
if (!open) return;
|
|
6575
6759
|
if (e2.key === "Tab") {
|
|
@@ -6593,7 +6777,7 @@ var Dialog = ({
|
|
|
6593
6777
|
document.removeEventListener("keydown", handleTabKey);
|
|
6594
6778
|
};
|
|
6595
6779
|
}, [open]);
|
|
6596
|
-
|
|
6780
|
+
useEffect14(() => {
|
|
6597
6781
|
if (open) {
|
|
6598
6782
|
const originalStyle = window.getComputedStyle(document.body).overflow;
|
|
6599
6783
|
document.body.style.overflow = "hidden";
|
|
@@ -6891,7 +7075,7 @@ function TransactionHashLink({
|
|
|
6891
7075
|
}
|
|
6892
7076
|
|
|
6893
7077
|
// src/widget/components/SwipeToConfirmTokens.tsx
|
|
6894
|
-
import { useState as useState16, useRef as
|
|
7078
|
+
import { useState as useState16, useRef as useRef7, useCallback as useCallback9, useEffect as useEffect15 } from "react";
|
|
6895
7079
|
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
6896
7080
|
function SwipeToConfirmTokens({
|
|
6897
7081
|
fromToken,
|
|
@@ -6909,30 +7093,30 @@ function SwipeToConfirmTokens({
|
|
|
6909
7093
|
const [dragX, setDragX] = useState16(0);
|
|
6910
7094
|
const [isDragging, setIsDragging] = useState16(false);
|
|
6911
7095
|
const [isComplete, setIsComplete] = useState16(false);
|
|
6912
|
-
const trackRef =
|
|
6913
|
-
const thumbRef =
|
|
7096
|
+
const trackRef = useRef7(null);
|
|
7097
|
+
const thumbRef = useRef7(null);
|
|
6914
7098
|
const [isLongPressing, setIsLongPressing] = useState16(false);
|
|
6915
7099
|
const [longPressProgress, setLongPressProgress] = useState16(0);
|
|
6916
|
-
const longPressTimerRef =
|
|
6917
|
-
const longPressStartRef =
|
|
6918
|
-
const longPressAnimationRef =
|
|
7100
|
+
const longPressTimerRef = useRef7(null);
|
|
7101
|
+
const longPressStartRef = useRef7(null);
|
|
7102
|
+
const longPressAnimationRef = useRef7(null);
|
|
6919
7103
|
const LONG_PRESS_DURATION = 1500;
|
|
6920
7104
|
const thumbSize = 48;
|
|
6921
7105
|
const padding = 4;
|
|
6922
7106
|
const threshold = 0.8;
|
|
6923
|
-
const getMaxDrag =
|
|
7107
|
+
const getMaxDrag = useCallback9(() => {
|
|
6924
7108
|
if (!trackRef.current) return 0;
|
|
6925
7109
|
return trackRef.current.offsetWidth - thumbSize - padding * 2;
|
|
6926
7110
|
}, []);
|
|
6927
|
-
const getProgress =
|
|
7111
|
+
const getProgress = useCallback9(() => {
|
|
6928
7112
|
const maxDrag = getMaxDrag();
|
|
6929
7113
|
return maxDrag > 0 ? dragX / maxDrag : 0;
|
|
6930
7114
|
}, [dragX, getMaxDrag]);
|
|
6931
|
-
const handleDragStart =
|
|
7115
|
+
const handleDragStart = useCallback9(() => {
|
|
6932
7116
|
if (disabled || isComplete) return;
|
|
6933
7117
|
setIsDragging(true);
|
|
6934
7118
|
}, [disabled, isComplete]);
|
|
6935
|
-
const handleDragMove =
|
|
7119
|
+
const handleDragMove = useCallback9(
|
|
6936
7120
|
(clientX) => {
|
|
6937
7121
|
if (!isDragging || !trackRef.current || isComplete) return;
|
|
6938
7122
|
const rect = trackRef.current.getBoundingClientRect();
|
|
@@ -6943,7 +7127,7 @@ function SwipeToConfirmTokens({
|
|
|
6943
7127
|
},
|
|
6944
7128
|
[isDragging, isComplete, getMaxDrag]
|
|
6945
7129
|
);
|
|
6946
|
-
const handleDragEnd =
|
|
7130
|
+
const handleDragEnd = useCallback9(() => {
|
|
6947
7131
|
if (!isDragging) return;
|
|
6948
7132
|
setIsDragging(false);
|
|
6949
7133
|
const progress2 = getProgress();
|
|
@@ -6956,14 +7140,14 @@ function SwipeToConfirmTokens({
|
|
|
6956
7140
|
setDragX(0);
|
|
6957
7141
|
}
|
|
6958
7142
|
}, [isDragging, getProgress, getMaxDrag, onConfirm]);
|
|
6959
|
-
const triggerConfirmation =
|
|
7143
|
+
const triggerConfirmation = useCallback9(() => {
|
|
6960
7144
|
if (isComplete) return;
|
|
6961
7145
|
setDragX(getMaxDrag());
|
|
6962
7146
|
setIsComplete(true);
|
|
6963
7147
|
if (navigator.vibrate) navigator.vibrate(50);
|
|
6964
7148
|
setTimeout(() => onConfirm(), 150);
|
|
6965
7149
|
}, [isComplete, getMaxDrag, onConfirm]);
|
|
6966
|
-
const cancelLongPress =
|
|
7150
|
+
const cancelLongPress = useCallback9(() => {
|
|
6967
7151
|
setIsLongPressing(false);
|
|
6968
7152
|
setLongPressProgress(0);
|
|
6969
7153
|
longPressStartRef.current = null;
|
|
@@ -6976,7 +7160,7 @@ function SwipeToConfirmTokens({
|
|
|
6976
7160
|
longPressAnimationRef.current = null;
|
|
6977
7161
|
}
|
|
6978
7162
|
}, []);
|
|
6979
|
-
const startLongPress =
|
|
7163
|
+
const startLongPress = useCallback9(() => {
|
|
6980
7164
|
if (disabled || isComplete || isDragging) return;
|
|
6981
7165
|
setIsLongPressing(true);
|
|
6982
7166
|
longPressStartRef.current = Date.now();
|
|
@@ -6994,7 +7178,7 @@ function SwipeToConfirmTokens({
|
|
|
6994
7178
|
};
|
|
6995
7179
|
longPressAnimationRef.current = requestAnimationFrame(animateProgress);
|
|
6996
7180
|
}, [disabled, isComplete, isDragging, triggerConfirmation, cancelLongPress]);
|
|
6997
|
-
const handleKeyDown =
|
|
7181
|
+
const handleKeyDown = useCallback9(
|
|
6998
7182
|
(e2) => {
|
|
6999
7183
|
if (disabled || isComplete) return;
|
|
7000
7184
|
if (e2.key === "Enter" || e2.key === " ") {
|
|
@@ -7004,7 +7188,7 @@ function SwipeToConfirmTokens({
|
|
|
7004
7188
|
},
|
|
7005
7189
|
[disabled, isComplete, startLongPress]
|
|
7006
7190
|
);
|
|
7007
|
-
const handleKeyUp =
|
|
7191
|
+
const handleKeyUp = useCallback9(
|
|
7008
7192
|
(e2) => {
|
|
7009
7193
|
if (e2.key === "Enter" || e2.key === " ") {
|
|
7010
7194
|
e2.preventDefault();
|
|
@@ -7013,7 +7197,7 @@ function SwipeToConfirmTokens({
|
|
|
7013
7197
|
},
|
|
7014
7198
|
[cancelLongPress]
|
|
7015
7199
|
);
|
|
7016
|
-
|
|
7200
|
+
useEffect15(() => {
|
|
7017
7201
|
return () => {
|
|
7018
7202
|
if (longPressTimerRef.current) clearTimeout(longPressTimerRef.current);
|
|
7019
7203
|
if (longPressAnimationRef.current)
|
|
@@ -7024,15 +7208,15 @@ function SwipeToConfirmTokens({
|
|
|
7024
7208
|
e2.preventDefault();
|
|
7025
7209
|
handleDragStart();
|
|
7026
7210
|
};
|
|
7027
|
-
const handleMouseMove =
|
|
7211
|
+
const handleMouseMove = useCallback9(
|
|
7028
7212
|
(e2) => handleDragMove(e2.clientX),
|
|
7029
7213
|
[handleDragMove]
|
|
7030
7214
|
);
|
|
7031
|
-
const handleMouseUp =
|
|
7215
|
+
const handleMouseUp = useCallback9(() => handleDragEnd(), [handleDragEnd]);
|
|
7032
7216
|
const handleTouchStart = () => handleDragStart();
|
|
7033
7217
|
const handleTouchMove = (e2) => handleDragMove(e2.touches[0].clientX);
|
|
7034
7218
|
const handleTouchEnd = () => handleDragEnd();
|
|
7035
|
-
|
|
7219
|
+
useEffect15(() => {
|
|
7036
7220
|
if (isDragging) {
|
|
7037
7221
|
window.addEventListener("mousemove", handleMouseMove);
|
|
7038
7222
|
window.addEventListener("mouseup", handleMouseUp);
|
|
@@ -7044,7 +7228,29 @@ function SwipeToConfirmTokens({
|
|
|
7044
7228
|
}, [isDragging, handleMouseMove, handleMouseUp]);
|
|
7045
7229
|
const progress = getProgress();
|
|
7046
7230
|
const effectiveProgress = isLongPressing ? longPressProgress : progress;
|
|
7047
|
-
const
|
|
7231
|
+
const [blinkOpacity, setBlinkOpacity] = useState16(1);
|
|
7232
|
+
useEffect15(() => {
|
|
7233
|
+
if (disabled || isComplete || isDragging || isLongPressing) {
|
|
7234
|
+
setBlinkOpacity(1);
|
|
7235
|
+
return;
|
|
7236
|
+
}
|
|
7237
|
+
let direction = -1;
|
|
7238
|
+
const interval = setInterval(() => {
|
|
7239
|
+
setBlinkOpacity((prev) => {
|
|
7240
|
+
const newVal = prev + direction * 0.8;
|
|
7241
|
+
if (newVal <= 0.2) {
|
|
7242
|
+
direction = 1;
|
|
7243
|
+
return 0.2;
|
|
7244
|
+
}
|
|
7245
|
+
if (newVal >= 1) {
|
|
7246
|
+
direction = -1;
|
|
7247
|
+
return 1;
|
|
7248
|
+
}
|
|
7249
|
+
return newVal;
|
|
7250
|
+
});
|
|
7251
|
+
}, 700);
|
|
7252
|
+
return () => clearInterval(interval);
|
|
7253
|
+
}, [disabled, isComplete, isDragging, isLongPressing]);
|
|
7048
7254
|
const getAriaLabel = () => {
|
|
7049
7255
|
if (!isWalletConnected) return "Connect your wallet to deposit";
|
|
7050
7256
|
if (isComplete) return "Transaction confirmed";
|
|
@@ -7264,27 +7470,52 @@ function SwipeToConfirmTokens({
|
|
|
7264
7470
|
onTouchStart: handleTouchStart,
|
|
7265
7471
|
onTouchMove: handleTouchMove,
|
|
7266
7472
|
onTouchEnd: handleTouchEnd,
|
|
7267
|
-
children:
|
|
7268
|
-
|
|
7473
|
+
children: /* @__PURE__ */ jsx9(
|
|
7474
|
+
ImageLoader,
|
|
7269
7475
|
{
|
|
7270
|
-
src: fromToken.iconUrl,
|
|
7476
|
+
src: fromToken.iconUrl || "",
|
|
7271
7477
|
alt: fromToken.symbol,
|
|
7272
|
-
|
|
7478
|
+
imgStyle: {
|
|
7273
7479
|
width: "2.5rem",
|
|
7274
7480
|
height: "2.5rem",
|
|
7275
7481
|
objectFit: "contain",
|
|
7276
7482
|
borderRadius: "9999px"
|
|
7277
|
-
}
|
|
7278
|
-
}
|
|
7279
|
-
) : /* @__PURE__ */ jsx9(
|
|
7280
|
-
"span",
|
|
7281
|
-
{
|
|
7282
|
-
style: {
|
|
7283
|
-
fontSize: fontSize.sm,
|
|
7284
|
-
fontWeight: fontWeight.bold,
|
|
7285
|
-
color: colors.white
|
|
7286
7483
|
},
|
|
7287
|
-
|
|
7484
|
+
retry: 1,
|
|
7485
|
+
Fallback: /* @__PURE__ */ jsx9(
|
|
7486
|
+
"span",
|
|
7487
|
+
{
|
|
7488
|
+
style: {
|
|
7489
|
+
fontSize: fontSize.sm,
|
|
7490
|
+
fontWeight: fontWeight.bold,
|
|
7491
|
+
color: colors.white,
|
|
7492
|
+
opacity: blinkOpacity,
|
|
7493
|
+
transition: "opacity 0.5s ease-in-out"
|
|
7494
|
+
},
|
|
7495
|
+
children: /* @__PURE__ */ jsx9(
|
|
7496
|
+
"svg",
|
|
7497
|
+
{
|
|
7498
|
+
style: {
|
|
7499
|
+
width: "2rem",
|
|
7500
|
+
height: "2rem",
|
|
7501
|
+
color: colors.zinc[500]
|
|
7502
|
+
},
|
|
7503
|
+
fill: "none",
|
|
7504
|
+
stroke: "currentColor",
|
|
7505
|
+
viewBox: "0 0 24 24",
|
|
7506
|
+
children: /* @__PURE__ */ jsx9(
|
|
7507
|
+
"path",
|
|
7508
|
+
{
|
|
7509
|
+
strokeLinecap: "round",
|
|
7510
|
+
strokeLinejoin: "round",
|
|
7511
|
+
strokeWidth: 2,
|
|
7512
|
+
d: "M9 5l7 7-7 7"
|
|
7513
|
+
}
|
|
7514
|
+
)
|
|
7515
|
+
}
|
|
7516
|
+
)
|
|
7517
|
+
}
|
|
7518
|
+
)
|
|
7288
7519
|
}
|
|
7289
7520
|
)
|
|
7290
7521
|
}
|
|
@@ -7320,47 +7551,6 @@ function SwipeToConfirmTokens({
|
|
|
7320
7551
|
}
|
|
7321
7552
|
)
|
|
7322
7553
|
}
|
|
7323
|
-
),
|
|
7324
|
-
!toTokenIcon && !isComplete && /* @__PURE__ */ jsx9(
|
|
7325
|
-
"div",
|
|
7326
|
-
{
|
|
7327
|
-
style: {
|
|
7328
|
-
position: "absolute",
|
|
7329
|
-
top: "50%",
|
|
7330
|
-
transform: "translateY(-50%)",
|
|
7331
|
-
width: "3rem",
|
|
7332
|
-
height: "3rem",
|
|
7333
|
-
borderRadius: "9999px",
|
|
7334
|
-
display: "flex",
|
|
7335
|
-
alignItems: "center",
|
|
7336
|
-
justifyContent: "center",
|
|
7337
|
-
transition: "opacity 0.2s",
|
|
7338
|
-
right: `${padding}px`,
|
|
7339
|
-
opacity: 0.3 + effectiveProgress * 0.7
|
|
7340
|
-
},
|
|
7341
|
-
children: /* @__PURE__ */ jsx9(
|
|
7342
|
-
"svg",
|
|
7343
|
-
{
|
|
7344
|
-
style: {
|
|
7345
|
-
width: "1.5rem",
|
|
7346
|
-
height: "1.5rem",
|
|
7347
|
-
color: colors.white
|
|
7348
|
-
},
|
|
7349
|
-
fill: "none",
|
|
7350
|
-
stroke: "currentColor",
|
|
7351
|
-
viewBox: "0 0 24 24",
|
|
7352
|
-
children: /* @__PURE__ */ jsx9(
|
|
7353
|
-
"path",
|
|
7354
|
-
{
|
|
7355
|
-
strokeLinecap: "round",
|
|
7356
|
-
strokeLinejoin: "round",
|
|
7357
|
-
strokeWidth: 2,
|
|
7358
|
-
d: "M9 5l7 7-7 7"
|
|
7359
|
-
}
|
|
7360
|
-
)
|
|
7361
|
-
}
|
|
7362
|
-
)
|
|
7363
|
-
}
|
|
7364
7554
|
)
|
|
7365
7555
|
]
|
|
7366
7556
|
}
|
|
@@ -7473,7 +7663,7 @@ function ThemeToggle({
|
|
|
7473
7663
|
}
|
|
7474
7664
|
|
|
7475
7665
|
// src/widget/components/Toast.tsx
|
|
7476
|
-
import { useEffect as
|
|
7666
|
+
import { useEffect as useEffect16, useState as useState17, useCallback as useCallback10 } from "react";
|
|
7477
7667
|
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
7478
7668
|
var variantStyles = {
|
|
7479
7669
|
default: {
|
|
@@ -7504,13 +7694,13 @@ function ToastItem({
|
|
|
7504
7694
|
onDismiss
|
|
7505
7695
|
}) {
|
|
7506
7696
|
const [isExiting, setIsExiting] = useState17(false);
|
|
7507
|
-
|
|
7697
|
+
useEffect16(() => {
|
|
7508
7698
|
const timer = setTimeout(() => {
|
|
7509
7699
|
setIsExiting(true);
|
|
7510
7700
|
}, duration);
|
|
7511
7701
|
return () => clearTimeout(timer);
|
|
7512
7702
|
}, [duration]);
|
|
7513
|
-
|
|
7703
|
+
useEffect16(() => {
|
|
7514
7704
|
if (isExiting) {
|
|
7515
7705
|
const exitTimer = setTimeout(() => {
|
|
7516
7706
|
onDismiss(id);
|
|
@@ -7715,7 +7905,7 @@ toast.error = (title, description) => toast({ title, description, variant: "dest
|
|
|
7715
7905
|
toast.success = (title, description) => toast({ title, description, variant: "success" });
|
|
7716
7906
|
function ToastContainer() {
|
|
7717
7907
|
const [activeToasts, setActiveToasts] = useState17([]);
|
|
7718
|
-
|
|
7908
|
+
useEffect16(() => {
|
|
7719
7909
|
const listener = (newToasts) => {
|
|
7720
7910
|
setActiveToasts(newToasts);
|
|
7721
7911
|
};
|
|
@@ -7727,7 +7917,7 @@ function ToastContainer() {
|
|
|
7727
7917
|
}
|
|
7728
7918
|
};
|
|
7729
7919
|
}, []);
|
|
7730
|
-
const handleDismiss =
|
|
7920
|
+
const handleDismiss = useCallback10((id) => {
|
|
7731
7921
|
toasts = toasts.filter((t) => t.id !== id);
|
|
7732
7922
|
notifyListeners();
|
|
7733
7923
|
}, []);
|
|
@@ -7766,9 +7956,9 @@ function ToastContainer() {
|
|
|
7766
7956
|
// src/widget/components/TokenSwipePill.tsx
|
|
7767
7957
|
import React9, {
|
|
7768
7958
|
useState as useState18,
|
|
7769
|
-
useRef as
|
|
7770
|
-
useCallback as
|
|
7771
|
-
useEffect as
|
|
7959
|
+
useRef as useRef8,
|
|
7960
|
+
useCallback as useCallback11,
|
|
7961
|
+
useEffect as useEffect17,
|
|
7772
7962
|
useMemo as useMemo9
|
|
7773
7963
|
} from "react";
|
|
7774
7964
|
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
@@ -7784,8 +7974,8 @@ function TokenSwipePill({
|
|
|
7784
7974
|
}) {
|
|
7785
7975
|
const [isDragging, setIsDragging] = useState18(false);
|
|
7786
7976
|
const [dragOffset, setDragOffset] = useState18(0);
|
|
7787
|
-
const startXRef =
|
|
7788
|
-
const containerRef =
|
|
7977
|
+
const startXRef = useRef8(0);
|
|
7978
|
+
const containerRef = useRef8(null);
|
|
7789
7979
|
const currentIndex = tokens.findIndex(
|
|
7790
7980
|
(t) => normalizeAddress2(
|
|
7791
7981
|
t.address,
|
|
@@ -7806,11 +7996,11 @@ function TokenSwipePill({
|
|
|
7806
7996
|
}
|
|
7807
7997
|
return pos;
|
|
7808
7998
|
};
|
|
7809
|
-
const handleDragStart =
|
|
7999
|
+
const handleDragStart = useCallback11((clientX) => {
|
|
7810
8000
|
setIsDragging(true);
|
|
7811
8001
|
startXRef.current = clientX;
|
|
7812
8002
|
}, []);
|
|
7813
|
-
const handleDragMove =
|
|
8003
|
+
const handleDragMove = useCallback11(
|
|
7814
8004
|
(clientX) => {
|
|
7815
8005
|
if (!isDragging) return;
|
|
7816
8006
|
const delta = startXRef.current - clientX;
|
|
@@ -7818,7 +8008,7 @@ function TokenSwipePill({
|
|
|
7818
8008
|
},
|
|
7819
8009
|
[isDragging]
|
|
7820
8010
|
);
|
|
7821
|
-
const handleDragEnd =
|
|
8011
|
+
const handleDragEnd = useCallback11(() => {
|
|
7822
8012
|
if (!isDragging) return;
|
|
7823
8013
|
setIsDragging(false);
|
|
7824
8014
|
if (Math.abs(dragOffset) > swipeThreshold) {
|
|
@@ -7836,13 +8026,13 @@ function TokenSwipePill({
|
|
|
7836
8026
|
e2.preventDefault();
|
|
7837
8027
|
handleDragStart(e2.clientX);
|
|
7838
8028
|
};
|
|
7839
|
-
const handleMouseMove =
|
|
8029
|
+
const handleMouseMove = useCallback11(
|
|
7840
8030
|
(e2) => {
|
|
7841
8031
|
handleDragMove(e2.clientX);
|
|
7842
8032
|
},
|
|
7843
8033
|
[handleDragMove]
|
|
7844
8034
|
);
|
|
7845
|
-
const handleMouseUp =
|
|
8035
|
+
const handleMouseUp = useCallback11(() => {
|
|
7846
8036
|
handleDragEnd();
|
|
7847
8037
|
}, [handleDragEnd]);
|
|
7848
8038
|
const handleTouchStart = (e2) => {
|
|
@@ -7856,7 +8046,7 @@ function TokenSwipePill({
|
|
|
7856
8046
|
const handleTouchEnd = () => {
|
|
7857
8047
|
handleDragEnd();
|
|
7858
8048
|
};
|
|
7859
|
-
|
|
8049
|
+
useEffect17(() => {
|
|
7860
8050
|
if (isDragging) {
|
|
7861
8051
|
window.addEventListener("mousemove", handleMouseMove);
|
|
7862
8052
|
window.addEventListener("mouseup", handleMouseUp);
|
|
@@ -7867,8 +8057,8 @@ function TokenSwipePill({
|
|
|
7867
8057
|
}
|
|
7868
8058
|
}, [isDragging, handleMouseMove, handleMouseUp]);
|
|
7869
8059
|
const visualOffset = Math.max(-40, Math.min(40, dragOffset * 0.5));
|
|
7870
|
-
const
|
|
7871
|
-
return
|
|
8060
|
+
const getChainInitials = (chain) => {
|
|
8061
|
+
return chain?.slice(0, 2).toUpperCase();
|
|
7872
8062
|
};
|
|
7873
8063
|
const chainBadge = useMemo9(() => {
|
|
7874
8064
|
const url = selectedToken.chainData?.chainIconURI || selectedToken.chainData?.iconUrl;
|
|
@@ -7895,6 +8085,7 @@ function TokenSwipePill({
|
|
|
7895
8085
|
alignItems: "flex-start",
|
|
7896
8086
|
gap: spacing[2],
|
|
7897
8087
|
padding: `${spacing[1.5]} ${spacing[4]}`,
|
|
8088
|
+
minWidth: "16.875rem",
|
|
7898
8089
|
backgroundColor: colors.background,
|
|
7899
8090
|
borderRadius: borderRadius.full,
|
|
7900
8091
|
border: `1px solid ${colors.border}`,
|
|
@@ -7915,7 +8106,8 @@ function TokenSwipePill({
|
|
|
7915
8106
|
style: {
|
|
7916
8107
|
display: "flex",
|
|
7917
8108
|
flexDirection: "column",
|
|
7918
|
-
alignItems: "center"
|
|
8109
|
+
alignItems: "center",
|
|
8110
|
+
width: "70%"
|
|
7919
8111
|
},
|
|
7920
8112
|
children: [
|
|
7921
8113
|
/* @__PURE__ */ jsxs9(
|
|
@@ -7995,26 +8187,31 @@ function TokenSwipePill({
|
|
|
7995
8187
|
alignItems: "center",
|
|
7996
8188
|
justifyContent: "center"
|
|
7997
8189
|
},
|
|
7998
|
-
children:
|
|
7999
|
-
|
|
8190
|
+
children: /* @__PURE__ */ jsx12(
|
|
8191
|
+
ImageLoader,
|
|
8000
8192
|
{
|
|
8001
8193
|
src: validateIconUrl(token.iconUrl, isCenter),
|
|
8002
8194
|
alt: token.symbol,
|
|
8003
|
-
|
|
8195
|
+
imgStyle: {
|
|
8004
8196
|
width: "2rem",
|
|
8005
8197
|
height: "2rem",
|
|
8006
8198
|
objectFit: "contain"
|
|
8007
|
-
}
|
|
8008
|
-
}
|
|
8009
|
-
) : /* @__PURE__ */ jsx12(
|
|
8010
|
-
"span",
|
|
8011
|
-
{
|
|
8012
|
-
style: {
|
|
8013
|
-
fontSize: fontSize.xs,
|
|
8014
|
-
fontWeight: fontWeight.bold,
|
|
8015
|
-
color: colors.zinc[800]
|
|
8016
8199
|
},
|
|
8017
|
-
|
|
8200
|
+
Fallback: /* @__PURE__ */ jsx12(
|
|
8201
|
+
"span",
|
|
8202
|
+
{
|
|
8203
|
+
style: {
|
|
8204
|
+
fontSize: fontSize.xs,
|
|
8205
|
+
fontWeight: fontWeight.bold,
|
|
8206
|
+
color: colors.zinc[800],
|
|
8207
|
+
width: "2rem",
|
|
8208
|
+
height: "2rem",
|
|
8209
|
+
objectFit: "contain",
|
|
8210
|
+
textAlign: "center"
|
|
8211
|
+
},
|
|
8212
|
+
children: token.symbol
|
|
8213
|
+
}
|
|
8214
|
+
)
|
|
8018
8215
|
}
|
|
8019
8216
|
)
|
|
8020
8217
|
}
|
|
@@ -8037,16 +8234,27 @@ function TokenSwipePill({
|
|
|
8037
8234
|
overflow: "hidden"
|
|
8038
8235
|
},
|
|
8039
8236
|
children: /* @__PURE__ */ jsx12(
|
|
8040
|
-
|
|
8237
|
+
ImageLoader,
|
|
8041
8238
|
{
|
|
8042
|
-
src: chainBadge,
|
|
8239
|
+
src: chainBadge || "",
|
|
8043
8240
|
alt: selectedToken.chainData?.networkName,
|
|
8044
|
-
|
|
8241
|
+
imgStyle: {
|
|
8045
8242
|
width: "0.75rem",
|
|
8046
8243
|
height: "0.75rem",
|
|
8047
8244
|
borderRadius: "9999px",
|
|
8048
8245
|
objectFit: "cover"
|
|
8049
|
-
}
|
|
8246
|
+
},
|
|
8247
|
+
Fallback: /* @__PURE__ */ jsx12(
|
|
8248
|
+
"span",
|
|
8249
|
+
{
|
|
8250
|
+
style: {
|
|
8251
|
+
fontSize: "10px"
|
|
8252
|
+
},
|
|
8253
|
+
children: getChainInitials(
|
|
8254
|
+
selectedToken.chainData?.networkName
|
|
8255
|
+
)
|
|
8256
|
+
}
|
|
8257
|
+
)
|
|
8050
8258
|
}
|
|
8051
8259
|
)
|
|
8052
8260
|
}
|
|
@@ -8526,7 +8734,7 @@ function TransactionSteps({
|
|
|
8526
8734
|
}
|
|
8527
8735
|
|
|
8528
8736
|
// src/widget/components/WidgetContainer.tsx
|
|
8529
|
-
import { useEffect as
|
|
8737
|
+
import { useEffect as useEffect18, useState as useState19 } from "react";
|
|
8530
8738
|
import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
8531
8739
|
var INJECTED_STYLES = ALL_THEME_STYLES + ALL_ANIMATION_STYLES;
|
|
8532
8740
|
function WidgetContainer({
|
|
@@ -8536,7 +8744,7 @@ function WidgetContainer({
|
|
|
8536
8744
|
style
|
|
8537
8745
|
}) {
|
|
8538
8746
|
const [resolvedTheme, setResolvedTheme] = useState19("light");
|
|
8539
|
-
|
|
8747
|
+
useEffect18(() => {
|
|
8540
8748
|
if (theme === "system") {
|
|
8541
8749
|
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
8542
8750
|
setResolvedTheme(mediaQuery.matches ? "dark" : "light");
|
|
@@ -8779,8 +8987,147 @@ function WidgetSecurityFooter({
|
|
|
8779
8987
|
);
|
|
8780
8988
|
}
|
|
8781
8989
|
|
|
8782
|
-
// src/widget/components/
|
|
8990
|
+
// src/widget/components/ImageLoader.tsx
|
|
8991
|
+
import { useEffect as useEffect19, useMemo as useMemo11, useRef as useRef9, useState as useState20 } from "react";
|
|
8783
8992
|
import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
8993
|
+
function Skeleton({
|
|
8994
|
+
background,
|
|
8995
|
+
height,
|
|
8996
|
+
borderRadius: borderRadius2
|
|
8997
|
+
}) {
|
|
8998
|
+
return /* @__PURE__ */ jsx17(
|
|
8999
|
+
"div",
|
|
9000
|
+
{
|
|
9001
|
+
style: {
|
|
9002
|
+
background: background || "#eee",
|
|
9003
|
+
height: height || "50px",
|
|
9004
|
+
borderRadius: borderRadius2 || "100%"
|
|
9005
|
+
}
|
|
9006
|
+
}
|
|
9007
|
+
);
|
|
9008
|
+
}
|
|
9009
|
+
function ImageLoader({
|
|
9010
|
+
src,
|
|
9011
|
+
alt = "",
|
|
9012
|
+
retry = 0,
|
|
9013
|
+
retryDelay = 1e3,
|
|
9014
|
+
lazy: lazy2 = true,
|
|
9015
|
+
Fallback = null,
|
|
9016
|
+
// skeleton = null,
|
|
9017
|
+
imgStyle,
|
|
9018
|
+
onLoad,
|
|
9019
|
+
onError
|
|
9020
|
+
}) {
|
|
9021
|
+
const [status, setStatus] = useState20("idle");
|
|
9022
|
+
const [attempt, setAttempt] = useState20(0);
|
|
9023
|
+
const [srcIsEmpty, setSrcIsEmpty] = useState20(false);
|
|
9024
|
+
const imgRef = useRef9(null);
|
|
9025
|
+
const observerRef = useRef9(null);
|
|
9026
|
+
useEffect19(() => {
|
|
9027
|
+
if (status === "error" && attempt < retry) {
|
|
9028
|
+
const timer = setTimeout(() => {
|
|
9029
|
+
setAttempt((prev) => prev + 1);
|
|
9030
|
+
setStatus("loading");
|
|
9031
|
+
}, retryDelay);
|
|
9032
|
+
return () => clearTimeout(timer);
|
|
9033
|
+
}
|
|
9034
|
+
}, [status, attempt, retry, retryDelay]);
|
|
9035
|
+
const loadImage = () => {
|
|
9036
|
+
if (!src) {
|
|
9037
|
+
setSrcIsEmpty(true);
|
|
9038
|
+
return;
|
|
9039
|
+
}
|
|
9040
|
+
setStatus("loading");
|
|
9041
|
+
const img = new Image();
|
|
9042
|
+
img.src = src;
|
|
9043
|
+
img.onload = () => {
|
|
9044
|
+
setStatus("success");
|
|
9045
|
+
onLoad?.();
|
|
9046
|
+
};
|
|
9047
|
+
img.onerror = () => {
|
|
9048
|
+
setStatus("error");
|
|
9049
|
+
onError?.();
|
|
9050
|
+
};
|
|
9051
|
+
};
|
|
9052
|
+
useEffect19(() => {
|
|
9053
|
+
if (!lazy2) {
|
|
9054
|
+
setTimeout(() => {
|
|
9055
|
+
loadImage();
|
|
9056
|
+
}, 0);
|
|
9057
|
+
return;
|
|
9058
|
+
}
|
|
9059
|
+
observerRef.current = new IntersectionObserver(
|
|
9060
|
+
(entries) => {
|
|
9061
|
+
entries.forEach((entry) => {
|
|
9062
|
+
if (entry.isIntersecting) {
|
|
9063
|
+
loadImage();
|
|
9064
|
+
observerRef.current?.disconnect();
|
|
9065
|
+
}
|
|
9066
|
+
});
|
|
9067
|
+
},
|
|
9068
|
+
{ threshold: 0.1 }
|
|
9069
|
+
);
|
|
9070
|
+
if (imgRef.current) {
|
|
9071
|
+
observerRef.current.observe(imgRef.current);
|
|
9072
|
+
}
|
|
9073
|
+
return () => observerRef.current?.disconnect();
|
|
9074
|
+
}, [lazy2, src, loadImage]);
|
|
9075
|
+
const showFallback = useMemo11(() => {
|
|
9076
|
+
return (status === "error" && attempt >= retry || srcIsEmpty) && Fallback;
|
|
9077
|
+
}, [status, attempt, retry, srcIsEmpty, Fallback]);
|
|
9078
|
+
return /* @__PURE__ */ jsxs14("div", { ref: imgRef, style: { position: "relative" }, children: [
|
|
9079
|
+
status === "loading" && /* @__PURE__ */ jsx17(
|
|
9080
|
+
Skeleton,
|
|
9081
|
+
{
|
|
9082
|
+
height: imgStyle?.height,
|
|
9083
|
+
borderRadius: imgStyle?.borderRadius
|
|
9084
|
+
}
|
|
9085
|
+
),
|
|
9086
|
+
status === "success" && /* @__PURE__ */ jsx17(
|
|
9087
|
+
"img",
|
|
9088
|
+
{
|
|
9089
|
+
src,
|
|
9090
|
+
alt,
|
|
9091
|
+
style: {
|
|
9092
|
+
// Css guards to prevent external styles from interfering with image rendering
|
|
9093
|
+
all: "revert",
|
|
9094
|
+
// Undo any inherited/global resets (e.g. Tailwind, normalize.css)
|
|
9095
|
+
display: "block",
|
|
9096
|
+
// Prevent inline baseline gap
|
|
9097
|
+
width: "100%",
|
|
9098
|
+
// Restore intended sizing
|
|
9099
|
+
maxWidth: "100%",
|
|
9100
|
+
// Prevent overflow
|
|
9101
|
+
height: "auto",
|
|
9102
|
+
// Maintain aspect ratio
|
|
9103
|
+
border: "none",
|
|
9104
|
+
// Strip any border resets
|
|
9105
|
+
padding: 0,
|
|
9106
|
+
// Strip padding resets
|
|
9107
|
+
margin: 0,
|
|
9108
|
+
// Strip margin resets
|
|
9109
|
+
objectFit: "cover",
|
|
9110
|
+
// Preserve visual intent
|
|
9111
|
+
verticalAlign: "middle",
|
|
9112
|
+
// Guard against inline stripping
|
|
9113
|
+
filter: "none",
|
|
9114
|
+
// Prevent inherited filter washes
|
|
9115
|
+
opacity: 1,
|
|
9116
|
+
// Prevent inherited opacity stripping
|
|
9117
|
+
mixBlendMode: "normal",
|
|
9118
|
+
// Prevent blend mode interference
|
|
9119
|
+
colorScheme: "normal",
|
|
9120
|
+
// Prevent dark-mode inversion
|
|
9121
|
+
...imgStyle
|
|
9122
|
+
}
|
|
9123
|
+
}
|
|
9124
|
+
),
|
|
9125
|
+
showFallback && Fallback
|
|
9126
|
+
] });
|
|
9127
|
+
}
|
|
9128
|
+
|
|
9129
|
+
// src/widget/components/Skeletons/LoadingSkeleton.tsx
|
|
9130
|
+
import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
8784
9131
|
var containerStyle = {
|
|
8785
9132
|
display: "flex",
|
|
8786
9133
|
flexDirection: "column",
|
|
@@ -8816,11 +9163,11 @@ var lineSmStyle = {
|
|
|
8816
9163
|
function LoadingSkeleton({
|
|
8817
9164
|
style
|
|
8818
9165
|
}) {
|
|
8819
|
-
return /* @__PURE__ */
|
|
8820
|
-
/* @__PURE__ */
|
|
8821
|
-
/* @__PURE__ */
|
|
8822
|
-
/* @__PURE__ */
|
|
8823
|
-
/* @__PURE__ */
|
|
9166
|
+
return /* @__PURE__ */ jsx18("div", { style: { ...containerStyle, ...style }, children: [0, 1, 2].map((i) => /* @__PURE__ */ jsxs15("div", { style: rowStyle, children: [
|
|
9167
|
+
/* @__PURE__ */ jsx18("div", { style: circleStyle, className: "tw-animate-pulse" }),
|
|
9168
|
+
/* @__PURE__ */ jsxs15("div", { style: { flex: 1 }, children: [
|
|
9169
|
+
/* @__PURE__ */ jsx18("div", { style: lineLgStyle, className: "tw-animate-pulse" }),
|
|
9170
|
+
/* @__PURE__ */ jsx18(
|
|
8824
9171
|
"div",
|
|
8825
9172
|
{
|
|
8826
9173
|
style: { ...lineSmStyle, marginTop: spacing[2] },
|
|
@@ -8847,14 +9194,14 @@ function clearPersistedState() {
|
|
|
8847
9194
|
}
|
|
8848
9195
|
|
|
8849
9196
|
// src/widget/app/WidgetShellOverlays.tsx
|
|
8850
|
-
import { jsx as
|
|
9197
|
+
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
8851
9198
|
function ConfirmCloseDialog({
|
|
8852
9199
|
open,
|
|
8853
9200
|
onConfirm,
|
|
8854
9201
|
onCancel,
|
|
8855
9202
|
theme
|
|
8856
9203
|
}) {
|
|
8857
|
-
return /* @__PURE__ */
|
|
9204
|
+
return /* @__PURE__ */ jsx19(
|
|
8858
9205
|
Dialog,
|
|
8859
9206
|
{
|
|
8860
9207
|
open,
|
|
@@ -8873,7 +9220,7 @@ function InitErrorOverlay({
|
|
|
8873
9220
|
onRefresh
|
|
8874
9221
|
}) {
|
|
8875
9222
|
if (!open) return null;
|
|
8876
|
-
return /* @__PURE__ */
|
|
9223
|
+
return /* @__PURE__ */ jsx19(
|
|
8877
9224
|
"div",
|
|
8878
9225
|
{
|
|
8879
9226
|
role: "dialog",
|
|
@@ -8891,7 +9238,7 @@ function InitErrorOverlay({
|
|
|
8891
9238
|
padding: spacing[6],
|
|
8892
9239
|
borderRadius: "20px"
|
|
8893
9240
|
},
|
|
8894
|
-
children: /* @__PURE__ */
|
|
9241
|
+
children: /* @__PURE__ */ jsxs16(
|
|
8895
9242
|
"div",
|
|
8896
9243
|
{
|
|
8897
9244
|
style: {
|
|
@@ -8906,7 +9253,7 @@ function InitErrorOverlay({
|
|
|
8906
9253
|
border: `1px solid ${colors.border}`
|
|
8907
9254
|
},
|
|
8908
9255
|
children: [
|
|
8909
|
-
/* @__PURE__ */
|
|
9256
|
+
/* @__PURE__ */ jsx19(
|
|
8910
9257
|
"h2",
|
|
8911
9258
|
{
|
|
8912
9259
|
id: "init-error-title",
|
|
@@ -8918,7 +9265,7 @@ function InitErrorOverlay({
|
|
|
8918
9265
|
children: "API key validation failed"
|
|
8919
9266
|
}
|
|
8920
9267
|
),
|
|
8921
|
-
/* @__PURE__ */
|
|
9268
|
+
/* @__PURE__ */ jsx19(
|
|
8922
9269
|
"p",
|
|
8923
9270
|
{
|
|
8924
9271
|
id: "init-error-description",
|
|
@@ -8930,7 +9277,7 @@ function InitErrorOverlay({
|
|
|
8930
9277
|
children: "We could not validate your Trustware API key. Please refresh to retry."
|
|
8931
9278
|
}
|
|
8932
9279
|
),
|
|
8933
|
-
/* @__PURE__ */
|
|
9280
|
+
/* @__PURE__ */ jsx19(
|
|
8934
9281
|
"button",
|
|
8935
9282
|
{
|
|
8936
9283
|
onClick: onRefresh,
|
|
@@ -8961,7 +9308,7 @@ function InitErrorOverlay({
|
|
|
8961
9308
|
}
|
|
8962
9309
|
|
|
8963
9310
|
// src/widget/app/WidgetRouter.tsx
|
|
8964
|
-
import { useMemo as
|
|
9311
|
+
import { useMemo as useMemo22 } from "react";
|
|
8965
9312
|
|
|
8966
9313
|
// src/widget/helpers/tokenAmount.ts
|
|
8967
9314
|
function rawToDecimal(rawAmount, decimals) {
|
|
@@ -9024,12 +9371,12 @@ function resolveChainLabel(chain) {
|
|
|
9024
9371
|
}
|
|
9025
9372
|
|
|
9026
9373
|
// src/widget/features/token-selection/components/AvailableTokenListItem.tsx
|
|
9027
|
-
import { jsx as
|
|
9374
|
+
import { jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
9028
9375
|
function AvailableTokenListItem({
|
|
9029
9376
|
onSelect,
|
|
9030
9377
|
token
|
|
9031
9378
|
}) {
|
|
9032
|
-
return /* @__PURE__ */
|
|
9379
|
+
return /* @__PURE__ */ jsxs17(
|
|
9033
9380
|
"button",
|
|
9034
9381
|
{
|
|
9035
9382
|
type: "button",
|
|
@@ -9047,7 +9394,7 @@ function AvailableTokenListItem({
|
|
|
9047
9394
|
cursor: "pointer"
|
|
9048
9395
|
},
|
|
9049
9396
|
children: [
|
|
9050
|
-
token.iconUrl ? /* @__PURE__ */
|
|
9397
|
+
token.iconUrl ? /* @__PURE__ */ jsx20(
|
|
9051
9398
|
"img",
|
|
9052
9399
|
{
|
|
9053
9400
|
src: token.iconUrl,
|
|
@@ -9068,7 +9415,7 @@ function AvailableTokenListItem({
|
|
|
9068
9415
|
}
|
|
9069
9416
|
}
|
|
9070
9417
|
) : null,
|
|
9071
|
-
/* @__PURE__ */
|
|
9418
|
+
/* @__PURE__ */ jsx20(
|
|
9072
9419
|
"div",
|
|
9073
9420
|
{
|
|
9074
9421
|
style: {
|
|
@@ -9081,7 +9428,7 @@ function AvailableTokenListItem({
|
|
|
9081
9428
|
flexShrink: 0,
|
|
9082
9429
|
display: token.iconUrl ? "none" : "flex"
|
|
9083
9430
|
},
|
|
9084
|
-
children: /* @__PURE__ */
|
|
9431
|
+
children: /* @__PURE__ */ jsx20(
|
|
9085
9432
|
"span",
|
|
9086
9433
|
{
|
|
9087
9434
|
style: {
|
|
@@ -9094,8 +9441,8 @@ function AvailableTokenListItem({
|
|
|
9094
9441
|
)
|
|
9095
9442
|
}
|
|
9096
9443
|
),
|
|
9097
|
-
/* @__PURE__ */
|
|
9098
|
-
/* @__PURE__ */
|
|
9444
|
+
/* @__PURE__ */ jsxs17("div", { style: { flex: 1, textAlign: "left", minWidth: 0 }, children: [
|
|
9445
|
+
/* @__PURE__ */ jsx20(
|
|
9099
9446
|
"div",
|
|
9100
9447
|
{
|
|
9101
9448
|
style: {
|
|
@@ -9103,7 +9450,7 @@ function AvailableTokenListItem({
|
|
|
9103
9450
|
alignItems: "center",
|
|
9104
9451
|
gap: spacing[1.5]
|
|
9105
9452
|
},
|
|
9106
|
-
children: /* @__PURE__ */
|
|
9453
|
+
children: /* @__PURE__ */ jsx20(
|
|
9107
9454
|
"span",
|
|
9108
9455
|
{
|
|
9109
9456
|
style: {
|
|
@@ -9119,7 +9466,7 @@ function AvailableTokenListItem({
|
|
|
9119
9466
|
)
|
|
9120
9467
|
}
|
|
9121
9468
|
),
|
|
9122
|
-
/* @__PURE__ */
|
|
9469
|
+
/* @__PURE__ */ jsx20(
|
|
9123
9470
|
"span",
|
|
9124
9471
|
{
|
|
9125
9472
|
style: {
|
|
@@ -9134,7 +9481,7 @@ function AvailableTokenListItem({
|
|
|
9134
9481
|
}
|
|
9135
9482
|
)
|
|
9136
9483
|
] }),
|
|
9137
|
-
token.balance !== void 0 ? /* @__PURE__ */
|
|
9484
|
+
token.balance !== void 0 ? /* @__PURE__ */ jsx20("div", { style: { textAlign: "right", flexShrink: 0 }, children: /* @__PURE__ */ jsx20(
|
|
9138
9485
|
"span",
|
|
9139
9486
|
{
|
|
9140
9487
|
style: {
|
|
@@ -9145,7 +9492,7 @@ function AvailableTokenListItem({
|
|
|
9145
9492
|
children: formatTokenBalance(token.balance, token.decimals)
|
|
9146
9493
|
}
|
|
9147
9494
|
) }) : null,
|
|
9148
|
-
/* @__PURE__ */
|
|
9495
|
+
/* @__PURE__ */ jsx20(
|
|
9149
9496
|
"svg",
|
|
9150
9497
|
{
|
|
9151
9498
|
style: {
|
|
@@ -9158,7 +9505,7 @@ function AvailableTokenListItem({
|
|
|
9158
9505
|
fill: "none",
|
|
9159
9506
|
stroke: "currentColor",
|
|
9160
9507
|
strokeWidth: 2,
|
|
9161
|
-
children: /* @__PURE__ */
|
|
9508
|
+
children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m9 18 6-6-6-6" })
|
|
9162
9509
|
}
|
|
9163
9510
|
)
|
|
9164
9511
|
]
|
|
@@ -9167,7 +9514,7 @@ function AvailableTokenListItem({
|
|
|
9167
9514
|
}
|
|
9168
9515
|
|
|
9169
9516
|
// src/widget/features/token-selection/components/ChainSelectorPanel.tsx
|
|
9170
|
-
import { Fragment as Fragment3, jsx as
|
|
9517
|
+
import { Fragment as Fragment3, jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
9171
9518
|
function ChainItem({
|
|
9172
9519
|
chain,
|
|
9173
9520
|
index,
|
|
@@ -9176,7 +9523,7 @@ function ChainItem({
|
|
|
9176
9523
|
}) {
|
|
9177
9524
|
const key = chain.id ?? chain.chainId ?? chain.networkIdentifier ?? `chain-${index}`;
|
|
9178
9525
|
const label = resolveChainLabel(chain);
|
|
9179
|
-
return /* @__PURE__ */
|
|
9526
|
+
return /* @__PURE__ */ jsxs18(
|
|
9180
9527
|
"button",
|
|
9181
9528
|
{
|
|
9182
9529
|
type: "button",
|
|
@@ -9198,7 +9545,7 @@ function ChainItem({
|
|
|
9198
9545
|
}
|
|
9199
9546
|
},
|
|
9200
9547
|
children: [
|
|
9201
|
-
chain.chainIconURI ? /* @__PURE__ */
|
|
9548
|
+
chain.chainIconURI ? /* @__PURE__ */ jsx21(
|
|
9202
9549
|
"img",
|
|
9203
9550
|
{
|
|
9204
9551
|
src: chain.chainIconURI,
|
|
@@ -9211,7 +9558,7 @@ function ChainItem({
|
|
|
9211
9558
|
flexShrink: 0
|
|
9212
9559
|
}
|
|
9213
9560
|
}
|
|
9214
|
-
) : /* @__PURE__ */
|
|
9561
|
+
) : /* @__PURE__ */ jsx21(
|
|
9215
9562
|
"div",
|
|
9216
9563
|
{
|
|
9217
9564
|
style: {
|
|
@@ -9224,7 +9571,7 @@ function ChainItem({
|
|
|
9224
9571
|
justifyContent: "center",
|
|
9225
9572
|
flexShrink: 0
|
|
9226
9573
|
},
|
|
9227
|
-
children: /* @__PURE__ */
|
|
9574
|
+
children: /* @__PURE__ */ jsx21(
|
|
9228
9575
|
"span",
|
|
9229
9576
|
{
|
|
9230
9577
|
style: {
|
|
@@ -9237,7 +9584,7 @@ function ChainItem({
|
|
|
9237
9584
|
)
|
|
9238
9585
|
}
|
|
9239
9586
|
),
|
|
9240
|
-
/* @__PURE__ */
|
|
9587
|
+
/* @__PURE__ */ jsx21("div", { style: { flex: 1, textAlign: "left", minWidth: 0 }, children: /* @__PURE__ */ jsx21(
|
|
9241
9588
|
"span",
|
|
9242
9589
|
{
|
|
9243
9590
|
style: {
|
|
@@ -9252,7 +9599,7 @@ function ChainItem({
|
|
|
9252
9599
|
children: label
|
|
9253
9600
|
}
|
|
9254
9601
|
) }),
|
|
9255
|
-
isSelected && /* @__PURE__ */
|
|
9602
|
+
isSelected && /* @__PURE__ */ jsx21(
|
|
9256
9603
|
"div",
|
|
9257
9604
|
{
|
|
9258
9605
|
style: {
|
|
@@ -9265,7 +9612,7 @@ function ChainItem({
|
|
|
9265
9612
|
justifyContent: "center",
|
|
9266
9613
|
flexShrink: 0
|
|
9267
9614
|
},
|
|
9268
|
-
children: /* @__PURE__ */
|
|
9615
|
+
children: /* @__PURE__ */ jsx21(
|
|
9269
9616
|
"svg",
|
|
9270
9617
|
{
|
|
9271
9618
|
style: {
|
|
@@ -9277,7 +9624,7 @@ function ChainItem({
|
|
|
9277
9624
|
fill: "none",
|
|
9278
9625
|
stroke: "currentColor",
|
|
9279
9626
|
strokeWidth: 3,
|
|
9280
|
-
children: /* @__PURE__ */
|
|
9627
|
+
children: /* @__PURE__ */ jsx21(
|
|
9281
9628
|
"path",
|
|
9282
9629
|
{
|
|
9283
9630
|
strokeLinecap: "round",
|
|
@@ -9302,7 +9649,7 @@ function ChainSelectorPanel({
|
|
|
9302
9649
|
otherChains,
|
|
9303
9650
|
popularChains
|
|
9304
9651
|
}) {
|
|
9305
|
-
return /* @__PURE__ */
|
|
9652
|
+
return /* @__PURE__ */ jsxs18(
|
|
9306
9653
|
"div",
|
|
9307
9654
|
{
|
|
9308
9655
|
style: {
|
|
@@ -9313,14 +9660,14 @@ function ChainSelectorPanel({
|
|
|
9313
9660
|
overflow: "hidden"
|
|
9314
9661
|
},
|
|
9315
9662
|
children: [
|
|
9316
|
-
/* @__PURE__ */
|
|
9663
|
+
/* @__PURE__ */ jsx21(
|
|
9317
9664
|
"div",
|
|
9318
9665
|
{
|
|
9319
9666
|
style: {
|
|
9320
9667
|
padding: `${spacing[2]} ${spacing[3]}`,
|
|
9321
9668
|
borderBottom: `1px solid rgba(63, 63, 70, 0.5)`
|
|
9322
9669
|
},
|
|
9323
|
-
children: /* @__PURE__ */
|
|
9670
|
+
children: /* @__PURE__ */ jsx21(
|
|
9324
9671
|
"span",
|
|
9325
9672
|
{
|
|
9326
9673
|
style: {
|
|
@@ -9335,7 +9682,7 @@ function ChainSelectorPanel({
|
|
|
9335
9682
|
)
|
|
9336
9683
|
}
|
|
9337
9684
|
),
|
|
9338
|
-
/* @__PURE__ */
|
|
9685
|
+
/* @__PURE__ */ jsx21(
|
|
9339
9686
|
"div",
|
|
9340
9687
|
{
|
|
9341
9688
|
style: {
|
|
@@ -9343,7 +9690,7 @@ function ChainSelectorPanel({
|
|
|
9343
9690
|
overflowY: "auto",
|
|
9344
9691
|
padding: `${spacing[2]} ${spacing[1]}`
|
|
9345
9692
|
},
|
|
9346
|
-
children: isLoading ? /* @__PURE__ */
|
|
9693
|
+
children: isLoading ? /* @__PURE__ */ jsx21(
|
|
9347
9694
|
"div",
|
|
9348
9695
|
{
|
|
9349
9696
|
style: {
|
|
@@ -9352,7 +9699,7 @@ function ChainSelectorPanel({
|
|
|
9352
9699
|
gap: spacing[2],
|
|
9353
9700
|
padding: `0 ${spacing[2]}`
|
|
9354
9701
|
},
|
|
9355
|
-
children: [1, 2, 3, 4, 5].map((i) => /* @__PURE__ */
|
|
9702
|
+
children: [1, 2, 3, 4, 5].map((i) => /* @__PURE__ */ jsxs18(
|
|
9356
9703
|
"div",
|
|
9357
9704
|
{
|
|
9358
9705
|
style: {
|
|
@@ -9362,7 +9709,7 @@ function ChainSelectorPanel({
|
|
|
9362
9709
|
padding: `${spacing[2]} 0`
|
|
9363
9710
|
},
|
|
9364
9711
|
children: [
|
|
9365
|
-
/* @__PURE__ */
|
|
9712
|
+
/* @__PURE__ */ jsx21(
|
|
9366
9713
|
"div",
|
|
9367
9714
|
{
|
|
9368
9715
|
style: {
|
|
@@ -9374,7 +9721,7 @@ function ChainSelectorPanel({
|
|
|
9374
9721
|
className: "tw-animate-pulse"
|
|
9375
9722
|
}
|
|
9376
9723
|
),
|
|
9377
|
-
/* @__PURE__ */
|
|
9724
|
+
/* @__PURE__ */ jsx21(
|
|
9378
9725
|
"div",
|
|
9379
9726
|
{
|
|
9380
9727
|
style: {
|
|
@@ -9391,7 +9738,7 @@ function ChainSelectorPanel({
|
|
|
9391
9738
|
i
|
|
9392
9739
|
))
|
|
9393
9740
|
}
|
|
9394
|
-
) : error ? /* @__PURE__ */
|
|
9741
|
+
) : error ? /* @__PURE__ */ jsxs18(
|
|
9395
9742
|
"div",
|
|
9396
9743
|
{
|
|
9397
9744
|
style: {
|
|
@@ -9399,8 +9746,8 @@ function ChainSelectorPanel({
|
|
|
9399
9746
|
textAlign: "center"
|
|
9400
9747
|
},
|
|
9401
9748
|
children: [
|
|
9402
|
-
/* @__PURE__ */
|
|
9403
|
-
/* @__PURE__ */
|
|
9749
|
+
/* @__PURE__ */ jsx21("p", { style: { fontSize: fontSize.sm, color: colors.destructive }, children: error }),
|
|
9750
|
+
/* @__PURE__ */ jsx21(
|
|
9404
9751
|
"button",
|
|
9405
9752
|
{
|
|
9406
9753
|
type: "button",
|
|
@@ -9419,9 +9766,9 @@ function ChainSelectorPanel({
|
|
|
9419
9766
|
)
|
|
9420
9767
|
]
|
|
9421
9768
|
}
|
|
9422
|
-
) : /* @__PURE__ */
|
|
9423
|
-
popularChains.length > 0 && /* @__PURE__ */
|
|
9424
|
-
/* @__PURE__ */
|
|
9769
|
+
) : /* @__PURE__ */ jsxs18(Fragment3, { children: [
|
|
9770
|
+
popularChains.length > 0 && /* @__PURE__ */ jsxs18("div", { style: { marginBottom: spacing[2] }, children: [
|
|
9771
|
+
/* @__PURE__ */ jsx21("div", { style: { padding: `${spacing[1.5]} ${spacing[3]}` }, children: /* @__PURE__ */ jsx21(
|
|
9425
9772
|
"span",
|
|
9426
9773
|
{
|
|
9427
9774
|
style: {
|
|
@@ -9434,7 +9781,7 @@ function ChainSelectorPanel({
|
|
|
9434
9781
|
children: "Popular"
|
|
9435
9782
|
}
|
|
9436
9783
|
) }),
|
|
9437
|
-
popularChains.map((chain, idx) => /* @__PURE__ */
|
|
9784
|
+
popularChains.map((chain, idx) => /* @__PURE__ */ jsx21(
|
|
9438
9785
|
ChainItem,
|
|
9439
9786
|
{
|
|
9440
9787
|
chain,
|
|
@@ -9447,15 +9794,15 @@ function ChainSelectorPanel({
|
|
|
9447
9794
|
)
|
|
9448
9795
|
))
|
|
9449
9796
|
] }),
|
|
9450
|
-
otherChains.length > 0 && /* @__PURE__ */
|
|
9451
|
-
popularChains.length > 0 && /* @__PURE__ */
|
|
9797
|
+
otherChains.length > 0 && /* @__PURE__ */ jsxs18("div", { children: [
|
|
9798
|
+
popularChains.length > 0 && /* @__PURE__ */ jsx21(
|
|
9452
9799
|
"div",
|
|
9453
9800
|
{
|
|
9454
9801
|
style: {
|
|
9455
9802
|
padding: `${spacing[1.5]} ${spacing[3]}`,
|
|
9456
9803
|
marginTop: spacing[2]
|
|
9457
9804
|
},
|
|
9458
|
-
children: /* @__PURE__ */
|
|
9805
|
+
children: /* @__PURE__ */ jsx21(
|
|
9459
9806
|
"span",
|
|
9460
9807
|
{
|
|
9461
9808
|
style: {
|
|
@@ -9470,7 +9817,7 @@ function ChainSelectorPanel({
|
|
|
9470
9817
|
)
|
|
9471
9818
|
}
|
|
9472
9819
|
),
|
|
9473
|
-
otherChains.map((chain, idx) => /* @__PURE__ */
|
|
9820
|
+
otherChains.map((chain, idx) => /* @__PURE__ */ jsx21(
|
|
9474
9821
|
ChainItem,
|
|
9475
9822
|
{
|
|
9476
9823
|
chain,
|
|
@@ -9483,14 +9830,14 @@ function ChainSelectorPanel({
|
|
|
9483
9830
|
)
|
|
9484
9831
|
))
|
|
9485
9832
|
] }),
|
|
9486
|
-
popularChains.length === 0 && otherChains.length === 0 && /* @__PURE__ */
|
|
9833
|
+
popularChains.length === 0 && otherChains.length === 0 && /* @__PURE__ */ jsx21(
|
|
9487
9834
|
"div",
|
|
9488
9835
|
{
|
|
9489
9836
|
style: {
|
|
9490
9837
|
padding: `${spacing[3]} ${spacing[4]}`,
|
|
9491
9838
|
textAlign: "center"
|
|
9492
9839
|
},
|
|
9493
|
-
children: /* @__PURE__ */
|
|
9840
|
+
children: /* @__PURE__ */ jsx21(
|
|
9494
9841
|
"p",
|
|
9495
9842
|
{
|
|
9496
9843
|
style: {
|
|
@@ -9511,13 +9858,13 @@ function ChainSelectorPanel({
|
|
|
9511
9858
|
}
|
|
9512
9859
|
|
|
9513
9860
|
// src/widget/features/token-selection/components/TokenSearchInput.tsx
|
|
9514
|
-
import { jsx as
|
|
9861
|
+
import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
9515
9862
|
function TokenSearchInput({
|
|
9516
9863
|
searchQuery,
|
|
9517
9864
|
setSearchQuery
|
|
9518
9865
|
}) {
|
|
9519
|
-
return /* @__PURE__ */
|
|
9520
|
-
/* @__PURE__ */
|
|
9866
|
+
return /* @__PURE__ */ jsxs19("div", { style: { position: "relative" }, children: [
|
|
9867
|
+
/* @__PURE__ */ jsxs19(
|
|
9521
9868
|
"svg",
|
|
9522
9869
|
{
|
|
9523
9870
|
style: {
|
|
@@ -9534,12 +9881,12 @@ function TokenSearchInput({
|
|
|
9534
9881
|
stroke: "currentColor",
|
|
9535
9882
|
strokeWidth: 2,
|
|
9536
9883
|
children: [
|
|
9537
|
-
/* @__PURE__ */
|
|
9538
|
-
/* @__PURE__ */
|
|
9884
|
+
/* @__PURE__ */ jsx22("circle", { cx: "11", cy: "11", r: "8" }),
|
|
9885
|
+
/* @__PURE__ */ jsx22("path", { strokeLinecap: "round", d: "m21 21-4.35-4.35" })
|
|
9539
9886
|
]
|
|
9540
9887
|
}
|
|
9541
9888
|
),
|
|
9542
|
-
/* @__PURE__ */
|
|
9889
|
+
/* @__PURE__ */ jsx22(
|
|
9543
9890
|
"input",
|
|
9544
9891
|
{
|
|
9545
9892
|
type: "text",
|
|
@@ -9562,7 +9909,7 @@ function TokenSearchInput({
|
|
|
9562
9909
|
}
|
|
9563
9910
|
}
|
|
9564
9911
|
),
|
|
9565
|
-
searchQuery ? /* @__PURE__ */
|
|
9912
|
+
searchQuery ? /* @__PURE__ */ jsx22(
|
|
9566
9913
|
"button",
|
|
9567
9914
|
{
|
|
9568
9915
|
type: "button",
|
|
@@ -9580,7 +9927,7 @@ function TokenSearchInput({
|
|
|
9580
9927
|
transition: "background-color 0.2s"
|
|
9581
9928
|
},
|
|
9582
9929
|
"aria-label": "Clear search",
|
|
9583
|
-
children: /* @__PURE__ */
|
|
9930
|
+
children: /* @__PURE__ */ jsx22(
|
|
9584
9931
|
"svg",
|
|
9585
9932
|
{
|
|
9586
9933
|
style: {
|
|
@@ -9592,7 +9939,7 @@ function TokenSearchInput({
|
|
|
9592
9939
|
fill: "none",
|
|
9593
9940
|
stroke: "currentColor",
|
|
9594
9941
|
strokeWidth: 2,
|
|
9595
|
-
children: /* @__PURE__ */
|
|
9942
|
+
children: /* @__PURE__ */ jsx22("path", { strokeLinecap: "round", d: "M18 6 6 18M6 6l12 12" })
|
|
9596
9943
|
}
|
|
9597
9944
|
)
|
|
9598
9945
|
}
|
|
@@ -9601,7 +9948,7 @@ function TokenSearchInput({
|
|
|
9601
9948
|
}
|
|
9602
9949
|
|
|
9603
9950
|
// src/widget/features/token-selection/components/TokenSelectorStateView.tsx
|
|
9604
|
-
import { jsx as
|
|
9951
|
+
import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
9605
9952
|
function TokenSelectorStateView({
|
|
9606
9953
|
isLoadingTokens,
|
|
9607
9954
|
searchQuery,
|
|
@@ -9610,7 +9957,7 @@ function TokenSelectorStateView({
|
|
|
9610
9957
|
tokensError
|
|
9611
9958
|
}) {
|
|
9612
9959
|
if (isLoadingTokens) {
|
|
9613
|
-
return /* @__PURE__ */
|
|
9960
|
+
return /* @__PURE__ */ jsx23(
|
|
9614
9961
|
"div",
|
|
9615
9962
|
{
|
|
9616
9963
|
style: {
|
|
@@ -9619,7 +9966,7 @@ function TokenSelectorStateView({
|
|
|
9619
9966
|
gap: spacing[2],
|
|
9620
9967
|
padding: `0 ${spacing[2]}`
|
|
9621
9968
|
},
|
|
9622
|
-
children: [1, 2, 3, 4, 5, 6].map((i) => /* @__PURE__ */
|
|
9969
|
+
children: [1, 2, 3, 4, 5, 6].map((i) => /* @__PURE__ */ jsxs20(
|
|
9623
9970
|
"div",
|
|
9624
9971
|
{
|
|
9625
9972
|
style: {
|
|
@@ -9629,7 +9976,7 @@ function TokenSelectorStateView({
|
|
|
9629
9976
|
padding: `${spacing[2.5]} ${spacing[2]}`
|
|
9630
9977
|
},
|
|
9631
9978
|
children: [
|
|
9632
|
-
/* @__PURE__ */
|
|
9979
|
+
/* @__PURE__ */ jsx23(
|
|
9633
9980
|
"div",
|
|
9634
9981
|
{
|
|
9635
9982
|
style: {
|
|
@@ -9641,8 +9988,8 @@ function TokenSelectorStateView({
|
|
|
9641
9988
|
className: "tw-animate-pulse"
|
|
9642
9989
|
}
|
|
9643
9990
|
),
|
|
9644
|
-
/* @__PURE__ */
|
|
9645
|
-
/* @__PURE__ */
|
|
9991
|
+
/* @__PURE__ */ jsxs20("div", { style: { flex: 1 }, children: [
|
|
9992
|
+
/* @__PURE__ */ jsx23(
|
|
9646
9993
|
"div",
|
|
9647
9994
|
{
|
|
9648
9995
|
style: {
|
|
@@ -9655,7 +10002,7 @@ function TokenSelectorStateView({
|
|
|
9655
10002
|
className: "tw-animate-pulse"
|
|
9656
10003
|
}
|
|
9657
10004
|
),
|
|
9658
|
-
/* @__PURE__ */
|
|
10005
|
+
/* @__PURE__ */ jsx23(
|
|
9659
10006
|
"div",
|
|
9660
10007
|
{
|
|
9661
10008
|
style: {
|
|
@@ -9668,7 +10015,7 @@ function TokenSelectorStateView({
|
|
|
9668
10015
|
}
|
|
9669
10016
|
)
|
|
9670
10017
|
] }),
|
|
9671
|
-
/* @__PURE__ */
|
|
10018
|
+
/* @__PURE__ */ jsx23(
|
|
9672
10019
|
"div",
|
|
9673
10020
|
{
|
|
9674
10021
|
style: {
|
|
@@ -9688,7 +10035,7 @@ function TokenSelectorStateView({
|
|
|
9688
10035
|
);
|
|
9689
10036
|
}
|
|
9690
10037
|
if (state === "no-chain") {
|
|
9691
|
-
return /* @__PURE__ */
|
|
10038
|
+
return /* @__PURE__ */ jsx23(
|
|
9692
10039
|
"div",
|
|
9693
10040
|
{
|
|
9694
10041
|
style: {
|
|
@@ -9698,8 +10045,8 @@ function TokenSelectorStateView({
|
|
|
9698
10045
|
justifyContent: "center",
|
|
9699
10046
|
padding: `0 ${spacing[4]}`
|
|
9700
10047
|
},
|
|
9701
|
-
children: /* @__PURE__ */
|
|
9702
|
-
/* @__PURE__ */
|
|
10048
|
+
children: /* @__PURE__ */ jsxs20("div", { style: { textAlign: "center" }, children: [
|
|
10049
|
+
/* @__PURE__ */ jsx23(
|
|
9703
10050
|
"svg",
|
|
9704
10051
|
{
|
|
9705
10052
|
style: {
|
|
@@ -9712,7 +10059,7 @@ function TokenSelectorStateView({
|
|
|
9712
10059
|
fill: "none",
|
|
9713
10060
|
stroke: "currentColor",
|
|
9714
10061
|
strokeWidth: 1.5,
|
|
9715
|
-
children: /* @__PURE__ */
|
|
10062
|
+
children: /* @__PURE__ */ jsx23(
|
|
9716
10063
|
"path",
|
|
9717
10064
|
{
|
|
9718
10065
|
strokeLinecap: "round",
|
|
@@ -9722,7 +10069,7 @@ function TokenSelectorStateView({
|
|
|
9722
10069
|
)
|
|
9723
10070
|
}
|
|
9724
10071
|
),
|
|
9725
|
-
/* @__PURE__ */
|
|
10072
|
+
/* @__PURE__ */ jsx23(
|
|
9726
10073
|
"p",
|
|
9727
10074
|
{
|
|
9728
10075
|
style: {
|
|
@@ -9737,7 +10084,7 @@ function TokenSelectorStateView({
|
|
|
9737
10084
|
);
|
|
9738
10085
|
}
|
|
9739
10086
|
if (state === "error") {
|
|
9740
|
-
return /* @__PURE__ */
|
|
10087
|
+
return /* @__PURE__ */ jsx23(
|
|
9741
10088
|
"div",
|
|
9742
10089
|
{
|
|
9743
10090
|
style: {
|
|
@@ -9747,8 +10094,8 @@ function TokenSelectorStateView({
|
|
|
9747
10094
|
justifyContent: "center",
|
|
9748
10095
|
padding: `0 ${spacing[4]}`
|
|
9749
10096
|
},
|
|
9750
|
-
children: /* @__PURE__ */
|
|
9751
|
-
/* @__PURE__ */
|
|
10097
|
+
children: /* @__PURE__ */ jsxs20("div", { style: { textAlign: "center" }, children: [
|
|
10098
|
+
/* @__PURE__ */ jsxs20(
|
|
9752
10099
|
"svg",
|
|
9753
10100
|
{
|
|
9754
10101
|
style: {
|
|
@@ -9762,12 +10109,12 @@ function TokenSelectorStateView({
|
|
|
9762
10109
|
stroke: "currentColor",
|
|
9763
10110
|
strokeWidth: 2,
|
|
9764
10111
|
children: [
|
|
9765
|
-
/* @__PURE__ */
|
|
9766
|
-
/* @__PURE__ */
|
|
10112
|
+
/* @__PURE__ */ jsx23("circle", { cx: "12", cy: "12", r: "10" }),
|
|
10113
|
+
/* @__PURE__ */ jsx23("path", { strokeLinecap: "round", d: "M12 8v4M12 16h.01" })
|
|
9767
10114
|
]
|
|
9768
10115
|
}
|
|
9769
10116
|
),
|
|
9770
|
-
/* @__PURE__ */
|
|
10117
|
+
/* @__PURE__ */ jsx23(
|
|
9771
10118
|
"p",
|
|
9772
10119
|
{
|
|
9773
10120
|
style: {
|
|
@@ -9778,7 +10125,7 @@ function TokenSelectorStateView({
|
|
|
9778
10125
|
children: tokensError
|
|
9779
10126
|
}
|
|
9780
10127
|
),
|
|
9781
|
-
/* @__PURE__ */
|
|
10128
|
+
/* @__PURE__ */ jsx23(
|
|
9782
10129
|
"button",
|
|
9783
10130
|
{
|
|
9784
10131
|
type: "button",
|
|
@@ -9799,7 +10146,7 @@ function TokenSelectorStateView({
|
|
|
9799
10146
|
}
|
|
9800
10147
|
);
|
|
9801
10148
|
}
|
|
9802
|
-
return /* @__PURE__ */
|
|
10149
|
+
return /* @__PURE__ */ jsx23(
|
|
9803
10150
|
"div",
|
|
9804
10151
|
{
|
|
9805
10152
|
style: {
|
|
@@ -9809,8 +10156,8 @@ function TokenSelectorStateView({
|
|
|
9809
10156
|
justifyContent: "center",
|
|
9810
10157
|
padding: `0 ${spacing[4]}`
|
|
9811
10158
|
},
|
|
9812
|
-
children: /* @__PURE__ */
|
|
9813
|
-
/* @__PURE__ */
|
|
10159
|
+
children: /* @__PURE__ */ jsxs20("div", { style: { textAlign: "center" }, children: [
|
|
10160
|
+
/* @__PURE__ */ jsxs20(
|
|
9814
10161
|
"svg",
|
|
9815
10162
|
{
|
|
9816
10163
|
style: {
|
|
@@ -9823,13 +10170,13 @@ function TokenSelectorStateView({
|
|
|
9823
10170
|
stroke: "currentColor",
|
|
9824
10171
|
strokeWidth: 1.5,
|
|
9825
10172
|
children: [
|
|
9826
|
-
/* @__PURE__ */
|
|
9827
|
-
/* @__PURE__ */
|
|
9828
|
-
/* @__PURE__ */
|
|
10173
|
+
/* @__PURE__ */ jsx23("circle", { cx: "11", cy: "11", r: "8" }),
|
|
10174
|
+
/* @__PURE__ */ jsx23("path", { strokeLinecap: "round", d: "m21 21-4.35-4.35" }),
|
|
10175
|
+
/* @__PURE__ */ jsx23("path", { strokeLinecap: "round", d: "M8 11h6" })
|
|
9829
10176
|
]
|
|
9830
10177
|
}
|
|
9831
10178
|
),
|
|
9832
|
-
/* @__PURE__ */
|
|
10179
|
+
/* @__PURE__ */ jsx23(
|
|
9833
10180
|
"p",
|
|
9834
10181
|
{
|
|
9835
10182
|
style: {
|
|
@@ -9839,7 +10186,7 @@ function TokenSelectorStateView({
|
|
|
9839
10186
|
children: searchQuery ? `No tokens matching "${searchQuery}"` : "No tokens available"
|
|
9840
10187
|
}
|
|
9841
10188
|
),
|
|
9842
|
-
searchQuery ? /* @__PURE__ */
|
|
10189
|
+
searchQuery ? /* @__PURE__ */ jsx23(
|
|
9843
10190
|
"button",
|
|
9844
10191
|
{
|
|
9845
10192
|
type: "button",
|
|
@@ -9862,13 +10209,13 @@ function TokenSelectorStateView({
|
|
|
9862
10209
|
}
|
|
9863
10210
|
|
|
9864
10211
|
// src/widget/features/token-selection/components/WalletTokenListItem.tsx
|
|
9865
|
-
import { jsx as
|
|
10212
|
+
import { jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
9866
10213
|
function WalletTokenListItem({
|
|
9867
10214
|
onSelect,
|
|
9868
10215
|
token
|
|
9869
10216
|
}) {
|
|
9870
10217
|
const logoUrl = token.iconUrl || token.logo_url;
|
|
9871
|
-
return /* @__PURE__ */
|
|
10218
|
+
return /* @__PURE__ */ jsxs21(
|
|
9872
10219
|
"button",
|
|
9873
10220
|
{
|
|
9874
10221
|
type: "button",
|
|
@@ -9886,8 +10233,8 @@ function WalletTokenListItem({
|
|
|
9886
10233
|
cursor: "pointer"
|
|
9887
10234
|
},
|
|
9888
10235
|
children: [
|
|
9889
|
-
/* @__PURE__ */
|
|
9890
|
-
logoUrl ? /* @__PURE__ */
|
|
10236
|
+
/* @__PURE__ */ jsxs21("div", { style: { position: "relative" }, children: [
|
|
10237
|
+
logoUrl ? /* @__PURE__ */ jsx24(
|
|
9891
10238
|
"img",
|
|
9892
10239
|
{
|
|
9893
10240
|
src: logoUrl,
|
|
@@ -9900,7 +10247,7 @@ function WalletTokenListItem({
|
|
|
9900
10247
|
flexShrink: 0
|
|
9901
10248
|
}
|
|
9902
10249
|
}
|
|
9903
|
-
) : /* @__PURE__ */
|
|
10250
|
+
) : /* @__PURE__ */ jsx24(
|
|
9904
10251
|
"div",
|
|
9905
10252
|
{
|
|
9906
10253
|
style: {
|
|
@@ -9910,7 +10257,7 @@ function WalletTokenListItem({
|
|
|
9910
10257
|
objectFit: "cover",
|
|
9911
10258
|
flexShrink: 0
|
|
9912
10259
|
},
|
|
9913
|
-
children: /* @__PURE__ */
|
|
10260
|
+
children: /* @__PURE__ */ jsx24(
|
|
9914
10261
|
"span",
|
|
9915
10262
|
{
|
|
9916
10263
|
style: {
|
|
@@ -9926,7 +10273,7 @@ function WalletTokenListItem({
|
|
|
9926
10273
|
)
|
|
9927
10274
|
}
|
|
9928
10275
|
),
|
|
9929
|
-
/* @__PURE__ */
|
|
10276
|
+
/* @__PURE__ */ jsx24(
|
|
9930
10277
|
"div",
|
|
9931
10278
|
{
|
|
9932
10279
|
style: {
|
|
@@ -9942,7 +10289,7 @@ function WalletTokenListItem({
|
|
|
9942
10289
|
alignItems: "center",
|
|
9943
10290
|
justifyContent: "center"
|
|
9944
10291
|
},
|
|
9945
|
-
children: /* @__PURE__ */
|
|
10292
|
+
children: /* @__PURE__ */ jsx24(
|
|
9946
10293
|
"img",
|
|
9947
10294
|
{
|
|
9948
10295
|
src: token.chainIconURI,
|
|
@@ -9957,8 +10304,8 @@ function WalletTokenListItem({
|
|
|
9957
10304
|
}
|
|
9958
10305
|
)
|
|
9959
10306
|
] }),
|
|
9960
|
-
/* @__PURE__ */
|
|
9961
|
-
/* @__PURE__ */
|
|
10307
|
+
/* @__PURE__ */ jsxs21("div", { style: { flex: 1, textAlign: "left", minWidth: 0 }, children: [
|
|
10308
|
+
/* @__PURE__ */ jsx24(
|
|
9962
10309
|
"div",
|
|
9963
10310
|
{
|
|
9964
10311
|
style: {
|
|
@@ -9966,7 +10313,7 @@ function WalletTokenListItem({
|
|
|
9966
10313
|
alignItems: "center",
|
|
9967
10314
|
gap: spacing[1.5]
|
|
9968
10315
|
},
|
|
9969
|
-
children: /* @__PURE__ */
|
|
10316
|
+
children: /* @__PURE__ */ jsx24(
|
|
9970
10317
|
"span",
|
|
9971
10318
|
{
|
|
9972
10319
|
style: {
|
|
@@ -9982,7 +10329,7 @@ function WalletTokenListItem({
|
|
|
9982
10329
|
)
|
|
9983
10330
|
}
|
|
9984
10331
|
),
|
|
9985
|
-
/* @__PURE__ */
|
|
10332
|
+
/* @__PURE__ */ jsxs21(
|
|
9986
10333
|
"span",
|
|
9987
10334
|
{
|
|
9988
10335
|
style: {
|
|
@@ -10007,7 +10354,7 @@ function WalletTokenListItem({
|
|
|
10007
10354
|
}
|
|
10008
10355
|
|
|
10009
10356
|
// src/widget/features/token-selection/components/TokenSelectorPanel.tsx
|
|
10010
|
-
import { jsx as
|
|
10357
|
+
import { jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
10011
10358
|
function TokenSelectorPanel({
|
|
10012
10359
|
filteredTokens,
|
|
10013
10360
|
filteredWalletTokens,
|
|
@@ -10023,7 +10370,7 @@ function TokenSelectorPanel({
|
|
|
10023
10370
|
tokensError,
|
|
10024
10371
|
walletAddress
|
|
10025
10372
|
}) {
|
|
10026
|
-
return /* @__PURE__ */
|
|
10373
|
+
return /* @__PURE__ */ jsxs22(
|
|
10027
10374
|
"div",
|
|
10028
10375
|
{
|
|
10029
10376
|
style: {
|
|
@@ -10033,7 +10380,7 @@ function TokenSelectorPanel({
|
|
|
10033
10380
|
overflow: "hidden"
|
|
10034
10381
|
},
|
|
10035
10382
|
children: [
|
|
10036
|
-
/* @__PURE__ */
|
|
10383
|
+
/* @__PURE__ */ jsxs22(
|
|
10037
10384
|
"div",
|
|
10038
10385
|
{
|
|
10039
10386
|
style: {
|
|
@@ -10041,7 +10388,7 @@ function TokenSelectorPanel({
|
|
|
10041
10388
|
borderBottom: `1px solid rgba(63, 63, 70, 0.5)`
|
|
10042
10389
|
},
|
|
10043
10390
|
children: [
|
|
10044
|
-
/* @__PURE__ */
|
|
10391
|
+
/* @__PURE__ */ jsxs22(
|
|
10045
10392
|
"div",
|
|
10046
10393
|
{
|
|
10047
10394
|
style: {
|
|
@@ -10051,7 +10398,7 @@ function TokenSelectorPanel({
|
|
|
10051
10398
|
marginBottom: spacing[2]
|
|
10052
10399
|
},
|
|
10053
10400
|
children: [
|
|
10054
|
-
/* @__PURE__ */
|
|
10401
|
+
/* @__PURE__ */ jsx25(
|
|
10055
10402
|
"span",
|
|
10056
10403
|
{
|
|
10057
10404
|
style: {
|
|
@@ -10064,7 +10411,7 @@ function TokenSelectorPanel({
|
|
|
10064
10411
|
children: "Token"
|
|
10065
10412
|
}
|
|
10066
10413
|
),
|
|
10067
|
-
walletAddress && /* @__PURE__ */
|
|
10414
|
+
walletAddress && /* @__PURE__ */ jsx25(
|
|
10068
10415
|
"span",
|
|
10069
10416
|
{
|
|
10070
10417
|
style: {
|
|
@@ -10080,7 +10427,7 @@ function TokenSelectorPanel({
|
|
|
10080
10427
|
]
|
|
10081
10428
|
}
|
|
10082
10429
|
),
|
|
10083
|
-
selectedChain ? /* @__PURE__ */
|
|
10430
|
+
selectedChain ? /* @__PURE__ */ jsx25(
|
|
10084
10431
|
TokenSearchInput,
|
|
10085
10432
|
{
|
|
10086
10433
|
searchQuery,
|
|
@@ -10090,7 +10437,7 @@ function TokenSelectorPanel({
|
|
|
10090
10437
|
]
|
|
10091
10438
|
}
|
|
10092
10439
|
),
|
|
10093
|
-
/* @__PURE__ */
|
|
10440
|
+
/* @__PURE__ */ jsx25(
|
|
10094
10441
|
"div",
|
|
10095
10442
|
{
|
|
10096
10443
|
style: {
|
|
@@ -10098,7 +10445,7 @@ function TokenSelectorPanel({
|
|
|
10098
10445
|
overflowY: "auto",
|
|
10099
10446
|
padding: `${spacing[2]} ${spacing[1]}`
|
|
10100
10447
|
},
|
|
10101
|
-
children: !selectedChain || isLoadingTokens || tokensError || filteredTokens.length === 0 ? /* @__PURE__ */
|
|
10448
|
+
children: !selectedChain || isLoadingTokens || tokensError || filteredTokens.length === 0 ? /* @__PURE__ */ jsx25(
|
|
10102
10449
|
TokenSelectorStateView,
|
|
10103
10450
|
{
|
|
10104
10451
|
isLoadingTokens,
|
|
@@ -10107,7 +10454,7 @@ function TokenSelectorPanel({
|
|
|
10107
10454
|
state: !selectedChain ? "no-chain" : tokensError ? "error" : "empty",
|
|
10108
10455
|
tokensError
|
|
10109
10456
|
}
|
|
10110
|
-
) : /* @__PURE__ */
|
|
10457
|
+
) : /* @__PURE__ */ jsxs22(
|
|
10111
10458
|
"div",
|
|
10112
10459
|
{
|
|
10113
10460
|
style: {
|
|
@@ -10116,7 +10463,7 @@ function TokenSelectorPanel({
|
|
|
10116
10463
|
gap: spacing[0.5]
|
|
10117
10464
|
},
|
|
10118
10465
|
children: [
|
|
10119
|
-
filteredWalletTokens.length > 0 ? /* @__PURE__ */
|
|
10466
|
+
filteredWalletTokens.length > 0 ? /* @__PURE__ */ jsx25(
|
|
10120
10467
|
"div",
|
|
10121
10468
|
{
|
|
10122
10469
|
style: {
|
|
@@ -10127,7 +10474,7 @@ function TokenSelectorPanel({
|
|
|
10127
10474
|
paddingRight: "0.5rem",
|
|
10128
10475
|
marginBottom: spacing[2]
|
|
10129
10476
|
},
|
|
10130
|
-
children: /* @__PURE__ */
|
|
10477
|
+
children: /* @__PURE__ */ jsx25(
|
|
10131
10478
|
"span",
|
|
10132
10479
|
{
|
|
10133
10480
|
style: {
|
|
@@ -10140,7 +10487,7 @@ function TokenSelectorPanel({
|
|
|
10140
10487
|
)
|
|
10141
10488
|
}
|
|
10142
10489
|
) : null,
|
|
10143
|
-
filteredWalletTokens.map((token, i) => /* @__PURE__ */
|
|
10490
|
+
filteredWalletTokens.map((token, i) => /* @__PURE__ */ jsx25(
|
|
10144
10491
|
WalletTokenListItem,
|
|
10145
10492
|
{
|
|
10146
10493
|
token,
|
|
@@ -10148,7 +10495,7 @@ function TokenSelectorPanel({
|
|
|
10148
10495
|
},
|
|
10149
10496
|
`${token.address}-${i}`
|
|
10150
10497
|
)),
|
|
10151
|
-
/* @__PURE__ */
|
|
10498
|
+
/* @__PURE__ */ jsx25(
|
|
10152
10499
|
"div",
|
|
10153
10500
|
{
|
|
10154
10501
|
style: {
|
|
@@ -10159,7 +10506,7 @@ function TokenSelectorPanel({
|
|
|
10159
10506
|
paddingRight: "0.5rem",
|
|
10160
10507
|
marginBottom: spacing[2]
|
|
10161
10508
|
},
|
|
10162
|
-
children: /* @__PURE__ */
|
|
10509
|
+
children: /* @__PURE__ */ jsx25(
|
|
10163
10510
|
"span",
|
|
10164
10511
|
{
|
|
10165
10512
|
style: {
|
|
@@ -10172,7 +10519,7 @@ function TokenSelectorPanel({
|
|
|
10172
10519
|
)
|
|
10173
10520
|
}
|
|
10174
10521
|
),
|
|
10175
|
-
filteredTokens.map((token, i) => /* @__PURE__ */
|
|
10522
|
+
filteredTokens.map((token, i) => /* @__PURE__ */ jsx25(
|
|
10176
10523
|
AvailableTokenListItem,
|
|
10177
10524
|
{
|
|
10178
10525
|
token,
|
|
@@ -10180,7 +10527,7 @@ function TokenSelectorPanel({
|
|
|
10180
10527
|
},
|
|
10181
10528
|
`${token.address}-${i}`
|
|
10182
10529
|
)),
|
|
10183
|
-
hasNextPage ? /* @__PURE__ */
|
|
10530
|
+
hasNextPage ? /* @__PURE__ */ jsx25(
|
|
10184
10531
|
"button",
|
|
10185
10532
|
{
|
|
10186
10533
|
type: "button",
|
|
@@ -10213,7 +10560,7 @@ function TokenSelectorPanel({
|
|
|
10213
10560
|
}
|
|
10214
10561
|
|
|
10215
10562
|
// src/widget/features/token-selection/hooks/useOrderedWalletTokens.ts
|
|
10216
|
-
import { useCallback as
|
|
10563
|
+
import { useCallback as useCallback12, useMemo as useMemo12 } from "react";
|
|
10217
10564
|
function useOrderedWalletTokens({
|
|
10218
10565
|
amount,
|
|
10219
10566
|
amountInputMode,
|
|
@@ -10222,7 +10569,7 @@ function useOrderedWalletTokens({
|
|
|
10222
10569
|
setSelectedToken,
|
|
10223
10570
|
yourWalletTokens
|
|
10224
10571
|
}) {
|
|
10225
|
-
const handleTokenChange =
|
|
10572
|
+
const handleTokenChange = useCallback12(
|
|
10226
10573
|
async (token) => {
|
|
10227
10574
|
if (token) {
|
|
10228
10575
|
setSelectedToken(token);
|
|
@@ -10231,7 +10578,7 @@ function useOrderedWalletTokens({
|
|
|
10231
10578
|
},
|
|
10232
10579
|
[setSelectedChain, setSelectedToken]
|
|
10233
10580
|
);
|
|
10234
|
-
const orderedTokens =
|
|
10581
|
+
const orderedTokens = useMemo12(() => {
|
|
10235
10582
|
const selectedTokenChainType = selectedToken?.chainData?.type ?? selectedToken?.chainData?.chainType;
|
|
10236
10583
|
const index = yourWalletTokens.findIndex(
|
|
10237
10584
|
(token) => normalizeAddress2(
|
|
@@ -10300,7 +10647,7 @@ function filterTokenAmountCompatibleTokens(tokens, parsedAmount) {
|
|
|
10300
10647
|
}
|
|
10301
10648
|
|
|
10302
10649
|
// src/widget/features/token-selection/hooks/useSelectTokenModel.ts
|
|
10303
|
-
import { useCallback as
|
|
10650
|
+
import { useCallback as useCallback13, useMemo as useMemo13 } from "react";
|
|
10304
10651
|
function useSelectTokenModel({
|
|
10305
10652
|
goBack,
|
|
10306
10653
|
searchQuery,
|
|
@@ -10324,7 +10671,7 @@ function useSelectTokenModel({
|
|
|
10324
10671
|
explorerUrl: chain.blockExplorerUrls?.[0]
|
|
10325
10672
|
});
|
|
10326
10673
|
};
|
|
10327
|
-
const handleTokenSelect =
|
|
10674
|
+
const handleTokenSelect = useCallback13(
|
|
10328
10675
|
async (token) => {
|
|
10329
10676
|
if (token.balance !== void 0) {
|
|
10330
10677
|
setSelectedToken(token);
|
|
@@ -10348,7 +10695,7 @@ function useSelectTokenModel({
|
|
|
10348
10695
|
},
|
|
10349
10696
|
[goBack, selectedChain, setSelectedToken, walletAddress]
|
|
10350
10697
|
);
|
|
10351
|
-
const handleYourTokenSelect =
|
|
10698
|
+
const handleYourTokenSelect = useCallback13(
|
|
10352
10699
|
(token) => {
|
|
10353
10700
|
setSelectedToken(token);
|
|
10354
10701
|
setSelectedChain(token.chainData);
|
|
@@ -10370,7 +10717,7 @@ function useSelectTokenModel({
|
|
|
10370
10717
|
const address = token.address?.toLowerCase() ?? "";
|
|
10371
10718
|
return symbol.includes(normalizedSearchQuery) || name.includes(normalizedSearchQuery) || address.includes(normalizedSearchQuery);
|
|
10372
10719
|
};
|
|
10373
|
-
const filteredWalletTokens =
|
|
10720
|
+
const filteredWalletTokens = useMemo13(() => {
|
|
10374
10721
|
if (!selectedChain?.chainId) {
|
|
10375
10722
|
return [];
|
|
10376
10723
|
}
|
|
@@ -10463,7 +10810,7 @@ var feeSummaryValueStyle = {
|
|
|
10463
10810
|
};
|
|
10464
10811
|
|
|
10465
10812
|
// src/widget/features/amount/components/AmountBalanceRow.tsx
|
|
10466
|
-
import { jsx as
|
|
10813
|
+
import { jsx as jsx26, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
10467
10814
|
function formatBalanceLabel({
|
|
10468
10815
|
amountInputMode,
|
|
10469
10816
|
hasUsdPrice,
|
|
@@ -10494,8 +10841,8 @@ function AmountBalanceRow({
|
|
|
10494
10841
|
selectedTokenSymbol,
|
|
10495
10842
|
tokenPriceUSD
|
|
10496
10843
|
}) {
|
|
10497
|
-
return /* @__PURE__ */
|
|
10498
|
-
/* @__PURE__ */
|
|
10844
|
+
return /* @__PURE__ */ jsxs23("div", { style: balanceRowStyle, children: [
|
|
10845
|
+
/* @__PURE__ */ jsx26(
|
|
10499
10846
|
"span",
|
|
10500
10847
|
{
|
|
10501
10848
|
style: {
|
|
@@ -10513,7 +10860,7 @@ function AmountBalanceRow({
|
|
|
10513
10860
|
})
|
|
10514
10861
|
}
|
|
10515
10862
|
),
|
|
10516
|
-
/* @__PURE__ */
|
|
10863
|
+
/* @__PURE__ */ jsx26(
|
|
10517
10864
|
"button",
|
|
10518
10865
|
{
|
|
10519
10866
|
type: "button",
|
|
@@ -10527,7 +10874,7 @@ function AmountBalanceRow({
|
|
|
10527
10874
|
}
|
|
10528
10875
|
|
|
10529
10876
|
// src/widget/features/amount/components/AmountConversionRow.tsx
|
|
10530
|
-
import { Fragment as Fragment4, jsx as
|
|
10877
|
+
import { Fragment as Fragment4, jsx as jsx27, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
10531
10878
|
function formatTokenAmount(value) {
|
|
10532
10879
|
const amount = Number(value ?? 0);
|
|
10533
10880
|
if (amount <= 0) return "0";
|
|
@@ -10551,22 +10898,22 @@ function AmountConversionRow({
|
|
|
10551
10898
|
selectedTokenSymbol,
|
|
10552
10899
|
setAmountInputMode
|
|
10553
10900
|
}) {
|
|
10554
|
-
return /* @__PURE__ */
|
|
10555
|
-
/* @__PURE__ */
|
|
10901
|
+
return /* @__PURE__ */ jsxs24("div", { style: tokenConversionRowStyle, children: [
|
|
10902
|
+
/* @__PURE__ */ jsx27(
|
|
10556
10903
|
"span",
|
|
10557
10904
|
{
|
|
10558
10905
|
style: {
|
|
10559
10906
|
fontSize: fontSize.lg,
|
|
10560
10907
|
color: colors.mutedForeground
|
|
10561
10908
|
},
|
|
10562
|
-
children: amountInputMode === "usd" ? /* @__PURE__ */
|
|
10909
|
+
children: amountInputMode === "usd" ? /* @__PURE__ */ jsxs24(Fragment4, { children: [
|
|
10563
10910
|
formatTokenAmount(amountComputation.tokenAmount),
|
|
10564
10911
|
" ",
|
|
10565
10912
|
selectedTokenSymbol
|
|
10566
|
-
] }) : /* @__PURE__ */
|
|
10913
|
+
] }) : /* @__PURE__ */ jsx27(Fragment4, { children: hasUsdPrice ? formatUsdAmount2(amountComputation.usdAmount) : "USD pricing unavailable" })
|
|
10567
10914
|
}
|
|
10568
10915
|
),
|
|
10569
|
-
/* @__PURE__ */
|
|
10916
|
+
/* @__PURE__ */ jsx27(
|
|
10570
10917
|
"svg",
|
|
10571
10918
|
{
|
|
10572
10919
|
style: {
|
|
@@ -10583,7 +10930,7 @@ function AmountConversionRow({
|
|
|
10583
10930
|
if (isFixedAmount) return;
|
|
10584
10931
|
setAmountInputMode((mode) => mode === "usd" ? "token" : "usd");
|
|
10585
10932
|
},
|
|
10586
|
-
children: /* @__PURE__ */
|
|
10933
|
+
children: /* @__PURE__ */ jsx27(
|
|
10587
10934
|
"path",
|
|
10588
10935
|
{
|
|
10589
10936
|
strokeLinecap: "round",
|
|
@@ -10597,7 +10944,7 @@ function AmountConversionRow({
|
|
|
10597
10944
|
}
|
|
10598
10945
|
|
|
10599
10946
|
// src/widget/features/amount/components/AmountFeeSummary.tsx
|
|
10600
|
-
import { Fragment as Fragment5, jsx as
|
|
10947
|
+
import { Fragment as Fragment5, jsx as jsx28, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
10601
10948
|
function formatEstimatedReceive(estimatedReceive, parsedAmount) {
|
|
10602
10949
|
if (estimatedReceive) {
|
|
10603
10950
|
return `~$${parseFloat(estimatedReceive).toLocaleString(void 0, {
|
|
@@ -10618,8 +10965,8 @@ function AmountFeeSummary({
|
|
|
10618
10965
|
parsedAmount,
|
|
10619
10966
|
selectedTokenDecimals
|
|
10620
10967
|
}) {
|
|
10621
|
-
return /* @__PURE__ */
|
|
10622
|
-
/* @__PURE__ */
|
|
10968
|
+
return /* @__PURE__ */ jsx28("div", { style: feeSummaryContainerStyle, children: isLoadingRoute ? /* @__PURE__ */ jsxs25("div", { style: loadingFeeSummaryStyle, children: [
|
|
10969
|
+
/* @__PURE__ */ jsxs25(
|
|
10623
10970
|
"svg",
|
|
10624
10971
|
{
|
|
10625
10972
|
style: {
|
|
@@ -10631,7 +10978,7 @@ function AmountFeeSummary({
|
|
|
10631
10978
|
fill: "none",
|
|
10632
10979
|
className: "tw-animate-spin",
|
|
10633
10980
|
children: [
|
|
10634
|
-
/* @__PURE__ */
|
|
10981
|
+
/* @__PURE__ */ jsx28(
|
|
10635
10982
|
"circle",
|
|
10636
10983
|
{
|
|
10637
10984
|
style: { opacity: 0.25 },
|
|
@@ -10642,7 +10989,7 @@ function AmountFeeSummary({
|
|
|
10642
10989
|
strokeWidth: "4"
|
|
10643
10990
|
}
|
|
10644
10991
|
),
|
|
10645
|
-
/* @__PURE__ */
|
|
10992
|
+
/* @__PURE__ */ jsx28(
|
|
10646
10993
|
"path",
|
|
10647
10994
|
{
|
|
10648
10995
|
style: { opacity: 0.75 },
|
|
@@ -10653,7 +11000,7 @@ function AmountFeeSummary({
|
|
|
10653
11000
|
]
|
|
10654
11001
|
}
|
|
10655
11002
|
),
|
|
10656
|
-
/* @__PURE__ */
|
|
11003
|
+
/* @__PURE__ */ jsx28(
|
|
10657
11004
|
"span",
|
|
10658
11005
|
{
|
|
10659
11006
|
style: {
|
|
@@ -10664,7 +11011,7 @@ function AmountFeeSummary({
|
|
|
10664
11011
|
children: "Calculating fees..."
|
|
10665
11012
|
}
|
|
10666
11013
|
)
|
|
10667
|
-
] }) : !amount.trim() ? /* @__PURE__ */
|
|
11014
|
+
] }) : !amount.trim() ? /* @__PURE__ */ jsx28("div", { style: emptyFeeSummaryStyle, children: /* @__PURE__ */ jsx28(
|
|
10668
11015
|
"p",
|
|
10669
11016
|
{
|
|
10670
11017
|
style: {
|
|
@@ -10673,10 +11020,10 @@ function AmountFeeSummary({
|
|
|
10673
11020
|
},
|
|
10674
11021
|
children: "Enter an amount to continue."
|
|
10675
11022
|
}
|
|
10676
|
-
) }) : /* @__PURE__ */
|
|
10677
|
-
/* @__PURE__ */
|
|
10678
|
-
/* @__PURE__ */
|
|
10679
|
-
/* @__PURE__ */
|
|
11023
|
+
) }) : /* @__PURE__ */ jsxs25(Fragment5, { children: [
|
|
11024
|
+
/* @__PURE__ */ jsxs25("div", { style: feeSummaryRowStyle, children: [
|
|
11025
|
+
/* @__PURE__ */ jsx28("span", { style: { color: colors.mutedForeground }, children: "Network fee" }),
|
|
11026
|
+
/* @__PURE__ */ jsxs25("span", { style: feeSummaryValueStyle, children: [
|
|
10680
11027
|
weiToDecimalString(
|
|
10681
11028
|
gasReservationWei,
|
|
10682
11029
|
selectedTokenDecimals ?? 0,
|
|
@@ -10685,9 +11032,9 @@ function AmountFeeSummary({
|
|
|
10685
11032
|
" "
|
|
10686
11033
|
] })
|
|
10687
11034
|
] }),
|
|
10688
|
-
/* @__PURE__ */
|
|
10689
|
-
/* @__PURE__ */
|
|
10690
|
-
/* @__PURE__ */
|
|
11035
|
+
/* @__PURE__ */ jsx28("div", { style: feeSummaryDividerStyle }),
|
|
11036
|
+
/* @__PURE__ */ jsxs25("div", { style: feeSummaryRowStyle, children: [
|
|
11037
|
+
/* @__PURE__ */ jsx28(
|
|
10691
11038
|
"span",
|
|
10692
11039
|
{
|
|
10693
11040
|
style: {
|
|
@@ -10697,7 +11044,7 @@ function AmountFeeSummary({
|
|
|
10697
11044
|
children: "You'll receive"
|
|
10698
11045
|
}
|
|
10699
11046
|
),
|
|
10700
|
-
/* @__PURE__ */
|
|
11047
|
+
/* @__PURE__ */ jsx28(
|
|
10701
11048
|
"span",
|
|
10702
11049
|
{
|
|
10703
11050
|
style: {
|
|
@@ -10712,7 +11059,7 @@ function AmountFeeSummary({
|
|
|
10712
11059
|
}
|
|
10713
11060
|
|
|
10714
11061
|
// src/widget/features/amount/components/CryptoPayAmountSection.tsx
|
|
10715
|
-
import { jsx as
|
|
11062
|
+
import { jsx as jsx29, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
10716
11063
|
function CryptoPayAmountSection({
|
|
10717
11064
|
amount,
|
|
10718
11065
|
amountComputation,
|
|
@@ -10739,8 +11086,8 @@ function CryptoPayAmountSection({
|
|
|
10739
11086
|
walletAddress,
|
|
10740
11087
|
yourWalletTokensLength
|
|
10741
11088
|
}) {
|
|
10742
|
-
return /* @__PURE__ */
|
|
10743
|
-
/* @__PURE__ */
|
|
11089
|
+
return /* @__PURE__ */ jsxs26("div", { style: amountSectionContainerStyle, children: [
|
|
11090
|
+
/* @__PURE__ */ jsx29(
|
|
10744
11091
|
"p",
|
|
10745
11092
|
{
|
|
10746
11093
|
style: {
|
|
@@ -10752,7 +11099,7 @@ function CryptoPayAmountSection({
|
|
|
10752
11099
|
children: "Enter an amount"
|
|
10753
11100
|
}
|
|
10754
11101
|
),
|
|
10755
|
-
/* @__PURE__ */
|
|
11102
|
+
/* @__PURE__ */ jsx29(
|
|
10756
11103
|
AmountInputDisplay,
|
|
10757
11104
|
{
|
|
10758
11105
|
amount,
|
|
@@ -10764,7 +11111,7 @@ function CryptoPayAmountSection({
|
|
|
10764
11111
|
style: { marginBottom: spacing[4] }
|
|
10765
11112
|
}
|
|
10766
11113
|
),
|
|
10767
|
-
selectedToken ? /* @__PURE__ */
|
|
11114
|
+
selectedToken ? /* @__PURE__ */ jsx29(
|
|
10768
11115
|
AmountConversionRow,
|
|
10769
11116
|
{
|
|
10770
11117
|
amountComputation,
|
|
@@ -10775,7 +11122,7 @@ function CryptoPayAmountSection({
|
|
|
10775
11122
|
setAmountInputMode
|
|
10776
11123
|
}
|
|
10777
11124
|
) : null,
|
|
10778
|
-
selectedToken?.balance ? /* @__PURE__ */
|
|
11125
|
+
selectedToken?.balance ? /* @__PURE__ */ jsx29(
|
|
10779
11126
|
AmountBalanceRow,
|
|
10780
11127
|
{
|
|
10781
11128
|
amountInputMode,
|
|
@@ -10788,7 +11135,7 @@ function CryptoPayAmountSection({
|
|
|
10788
11135
|
tokenPriceUSD
|
|
10789
11136
|
}
|
|
10790
11137
|
) : null,
|
|
10791
|
-
selectedToken && yourWalletTokensLength > 0 ? /* @__PURE__ */
|
|
11138
|
+
selectedToken && yourWalletTokensLength > 0 ? /* @__PURE__ */ jsx29("div", { style: tokenPickerContainerStyle, children: /* @__PURE__ */ jsx29(
|
|
10792
11139
|
TokenSwipePill,
|
|
10793
11140
|
{
|
|
10794
11141
|
tokens: orderedTokens,
|
|
@@ -10799,8 +11146,8 @@ function CryptoPayAmountSection({
|
|
|
10799
11146
|
walletAddress
|
|
10800
11147
|
}
|
|
10801
11148
|
) }) : null,
|
|
10802
|
-
!isFixedAmount && selectedToken && effectiveSliderMax !== void 0 ? /* @__PURE__ */
|
|
10803
|
-
/* @__PURE__ */
|
|
11149
|
+
!isFixedAmount && selectedToken && effectiveSliderMax !== void 0 ? /* @__PURE__ */ jsxs26("div", { style: amountSliderContainerStyle, children: [
|
|
11150
|
+
/* @__PURE__ */ jsxs26(
|
|
10804
11151
|
"p",
|
|
10805
11152
|
{
|
|
10806
11153
|
style: {
|
|
@@ -10816,7 +11163,7 @@ function CryptoPayAmountSection({
|
|
|
10816
11163
|
]
|
|
10817
11164
|
}
|
|
10818
11165
|
),
|
|
10819
|
-
/* @__PURE__ */
|
|
11166
|
+
/* @__PURE__ */ jsx29(
|
|
10820
11167
|
AmountSlider,
|
|
10821
11168
|
{
|
|
10822
11169
|
value: Math.min(parsedAmount, effectiveSliderMax),
|
|
@@ -10827,7 +11174,7 @@ function CryptoPayAmountSection({
|
|
|
10827
11174
|
}
|
|
10828
11175
|
)
|
|
10829
11176
|
] }) : null,
|
|
10830
|
-
showFeeSummary ? /* @__PURE__ */
|
|
11177
|
+
showFeeSummary ? /* @__PURE__ */ jsx29(
|
|
10831
11178
|
AmountFeeSummary,
|
|
10832
11179
|
{
|
|
10833
11180
|
amount,
|
|
@@ -10842,7 +11189,7 @@ function CryptoPayAmountSection({
|
|
|
10842
11189
|
}
|
|
10843
11190
|
|
|
10844
11191
|
// src/widget/features/amount/hooks/useDepositAmountModel.ts
|
|
10845
|
-
import { useEffect as
|
|
11192
|
+
import { useEffect as useEffect20, useMemo as useMemo14 } from "react";
|
|
10846
11193
|
var BALANCE_TOLERANCE = 1e-9;
|
|
10847
11194
|
function useDepositAmountModel({
|
|
10848
11195
|
amount,
|
|
@@ -10857,14 +11204,14 @@ function useDepositAmountModel({
|
|
|
10857
11204
|
}) {
|
|
10858
11205
|
const tokenPriceUSD = typeof selectedToken?.usdPrice === "number" && Number.isFinite(selectedToken.usdPrice) && selectedToken.usdPrice > 0 ? selectedToken.usdPrice : 0;
|
|
10859
11206
|
const hasUsdPrice = typeof tokenPriceUSD === "number" && Number.isFinite(tokenPriceUSD) && tokenPriceUSD > 0;
|
|
10860
|
-
const normalizedTokenBalance =
|
|
11207
|
+
const normalizedTokenBalance = useMemo14(() => {
|
|
10861
11208
|
if (!selectedToken?.balance) return 0;
|
|
10862
11209
|
const normalized = Number(
|
|
10863
11210
|
rawToDecimal(selectedToken.balance, selectedToken.decimals ?? 18)
|
|
10864
11211
|
);
|
|
10865
11212
|
return Number.isFinite(normalized) ? normalized : 0;
|
|
10866
11213
|
}, [selectedToken?.balance, selectedToken?.decimals]);
|
|
10867
|
-
|
|
11214
|
+
useEffect20(() => {
|
|
10868
11215
|
if (fixedFromAmountString) return;
|
|
10869
11216
|
if (isReady && !hasUsdPrice && amountInputMode === "usd") {
|
|
10870
11217
|
setAmountInputMode("token");
|
|
@@ -10876,7 +11223,7 @@ function useDepositAmountModel({
|
|
|
10876
11223
|
isReady,
|
|
10877
11224
|
setAmountInputMode
|
|
10878
11225
|
]);
|
|
10879
|
-
|
|
11226
|
+
useEffect20(() => {
|
|
10880
11227
|
if (!fixedFromAmountString) return;
|
|
10881
11228
|
if (amount !== fixedFromAmountString) {
|
|
10882
11229
|
setAmount(fixedFromAmountString);
|
|
@@ -10891,7 +11238,7 @@ function useDepositAmountModel({
|
|
|
10891
11238
|
setAmount,
|
|
10892
11239
|
setAmountInputMode
|
|
10893
11240
|
]);
|
|
10894
|
-
const amountComputation =
|
|
11241
|
+
const amountComputation = useMemo14(() => {
|
|
10895
11242
|
const rawAmount = (fixedFromAmountString ?? amount)?.trim();
|
|
10896
11243
|
if (!rawAmount) {
|
|
10897
11244
|
return {
|
|
@@ -10958,11 +11305,11 @@ function useDepositAmountModel({
|
|
|
10958
11305
|
selectedToken?.decimals,
|
|
10959
11306
|
tokenPriceUSD
|
|
10960
11307
|
]);
|
|
10961
|
-
const requestedTokenAmount =
|
|
11308
|
+
const requestedTokenAmount = useMemo14(() => {
|
|
10962
11309
|
const tokenAmount = Number(amountComputation.tokenAmount);
|
|
10963
11310
|
return Number.isFinite(tokenAmount) ? tokenAmount : 0;
|
|
10964
11311
|
}, [amountComputation.tokenAmount]);
|
|
10965
|
-
const amountValidationError =
|
|
11312
|
+
const amountValidationError = useMemo14(() => {
|
|
10966
11313
|
if (amountComputation.parseError) {
|
|
10967
11314
|
return amountComputation.parseError;
|
|
10968
11315
|
}
|
|
@@ -10995,15 +11342,15 @@ function useDepositAmountModel({
|
|
|
10995
11342
|
]);
|
|
10996
11343
|
const amountWei = amountValidationError ? 0n : amountComputation.fromAmountWei ?? 0n;
|
|
10997
11344
|
const parsedAmount = parseFloat(fixedFromAmountString ?? amount) || 0;
|
|
10998
|
-
const maxTokenAmount =
|
|
11345
|
+
const maxTokenAmount = useMemo14(
|
|
10999
11346
|
() => Math.min(normalizedTokenBalance, 1e4),
|
|
11000
11347
|
[normalizedTokenBalance]
|
|
11001
11348
|
);
|
|
11002
|
-
const maxUsdAmount =
|
|
11349
|
+
const maxUsdAmount = useMemo14(() => {
|
|
11003
11350
|
if (!hasUsdPrice) return void 0;
|
|
11004
11351
|
return Math.min(maxTokenAmount * tokenPriceUSD, 1e4);
|
|
11005
11352
|
}, [hasUsdPrice, maxTokenAmount, tokenPriceUSD]);
|
|
11006
|
-
const minAmountForMode =
|
|
11353
|
+
const minAmountForMode = useMemo14(() => {
|
|
11007
11354
|
if (minAmountUsd == null) return 0;
|
|
11008
11355
|
if (amountInputMode === "usd") {
|
|
11009
11356
|
return minAmountUsd;
|
|
@@ -11012,11 +11359,11 @@ function useDepositAmountModel({
|
|
|
11012
11359
|
return minAmountUsd / tokenPriceUSD;
|
|
11013
11360
|
}, [amountInputMode, hasUsdPrice, minAmountUsd, tokenPriceUSD]);
|
|
11014
11361
|
const sliderMax = amountInputMode === "usd" ? maxUsdAmount : maxTokenAmount;
|
|
11015
|
-
const effectiveSliderMax =
|
|
11362
|
+
const effectiveSliderMax = useMemo14(() => {
|
|
11016
11363
|
if (sliderMax == null || !Number.isFinite(sliderMax)) return void 0;
|
|
11017
11364
|
return Math.max(sliderMax, 0);
|
|
11018
11365
|
}, [sliderMax]);
|
|
11019
|
-
const effectiveSliderMin =
|
|
11366
|
+
const effectiveSliderMin = useMemo14(() => {
|
|
11020
11367
|
if (effectiveSliderMax == null || !Number.isFinite(effectiveSliderMax) || effectiveSliderMax <= 0) {
|
|
11021
11368
|
return 0;
|
|
11022
11369
|
}
|
|
@@ -11043,7 +11390,7 @@ function useDepositAmountModel({
|
|
|
11043
11390
|
}
|
|
11044
11391
|
|
|
11045
11392
|
// src/widget/features/amount/hooks/useHomeAmountModel.ts
|
|
11046
|
-
import { useEffect as
|
|
11393
|
+
import { useEffect as useEffect21, useMemo as useMemo15 } from "react";
|
|
11047
11394
|
function useHomeAmountModel({
|
|
11048
11395
|
amount,
|
|
11049
11396
|
setAmount,
|
|
@@ -11054,7 +11401,7 @@ function useHomeAmountModel({
|
|
|
11054
11401
|
minAmountUsd,
|
|
11055
11402
|
maxAmountUsd
|
|
11056
11403
|
}) {
|
|
11057
|
-
|
|
11404
|
+
useEffect21(() => {
|
|
11058
11405
|
if (!fixedFromAmountString) return;
|
|
11059
11406
|
if (amount !== fixedFromAmountString) {
|
|
11060
11407
|
setAmount(fixedFromAmountString);
|
|
@@ -11070,7 +11417,7 @@ function useHomeAmountModel({
|
|
|
11070
11417
|
setAmountInputMode
|
|
11071
11418
|
]);
|
|
11072
11419
|
const parsedAmount = parseFloat(fixedFromAmountString ?? amount) || 0;
|
|
11073
|
-
const amountValidationMessage =
|
|
11420
|
+
const amountValidationMessage = useMemo15(() => {
|
|
11074
11421
|
const rawAmount = (fixedFromAmountString ?? amount)?.trim();
|
|
11075
11422
|
if (!rawAmount) return null;
|
|
11076
11423
|
if (!/^\d*\.?\d*$/.test(rawAmount)) {
|
|
@@ -11161,7 +11508,7 @@ var mutedOrDividerStyle = (isDarkTheme) => ({
|
|
|
11161
11508
|
});
|
|
11162
11509
|
|
|
11163
11510
|
// src/widget/features/wallet/components/PaymentOptionRow.tsx
|
|
11164
|
-
import { jsx as
|
|
11511
|
+
import { jsx as jsx30, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
11165
11512
|
function PaymentOptionRow({
|
|
11166
11513
|
disabled = false,
|
|
11167
11514
|
icon,
|
|
@@ -11169,7 +11516,7 @@ function PaymentOptionRow({
|
|
|
11169
11516
|
onClick,
|
|
11170
11517
|
trailing
|
|
11171
11518
|
}) {
|
|
11172
|
-
return /* @__PURE__ */
|
|
11519
|
+
return /* @__PURE__ */ jsxs27(
|
|
11173
11520
|
"button",
|
|
11174
11521
|
{
|
|
11175
11522
|
type: "button",
|
|
@@ -11192,7 +11539,7 @@ function PaymentOptionRow({
|
|
|
11192
11539
|
opacity: disabled ? 0.5 : 1
|
|
11193
11540
|
},
|
|
11194
11541
|
children: [
|
|
11195
|
-
/* @__PURE__ */
|
|
11542
|
+
/* @__PURE__ */ jsxs27(
|
|
11196
11543
|
"div",
|
|
11197
11544
|
{
|
|
11198
11545
|
style: {
|
|
@@ -11202,7 +11549,7 @@ function PaymentOptionRow({
|
|
|
11202
11549
|
},
|
|
11203
11550
|
children: [
|
|
11204
11551
|
icon,
|
|
11205
|
-
/* @__PURE__ */
|
|
11552
|
+
/* @__PURE__ */ jsx30(
|
|
11206
11553
|
"span",
|
|
11207
11554
|
{
|
|
11208
11555
|
style: {
|
|
@@ -11216,24 +11563,24 @@ function PaymentOptionRow({
|
|
|
11216
11563
|
]
|
|
11217
11564
|
}
|
|
11218
11565
|
),
|
|
11219
|
-
trailing ?? /* @__PURE__ */
|
|
11566
|
+
trailing ?? /* @__PURE__ */ jsx30("div", { style: selectionRingStyle })
|
|
11220
11567
|
]
|
|
11221
11568
|
}
|
|
11222
11569
|
);
|
|
11223
11570
|
}
|
|
11224
11571
|
|
|
11225
11572
|
// src/widget/features/wallet/components/DetectedWalletRow.tsx
|
|
11226
|
-
import { jsx as
|
|
11573
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
11227
11574
|
function DetectedWalletRow({
|
|
11228
11575
|
onSelect,
|
|
11229
11576
|
wallet
|
|
11230
11577
|
}) {
|
|
11231
|
-
return /* @__PURE__ */
|
|
11578
|
+
return /* @__PURE__ */ jsx31(
|
|
11232
11579
|
PaymentOptionRow,
|
|
11233
11580
|
{
|
|
11234
11581
|
onClick: () => void onSelect(wallet),
|
|
11235
11582
|
label: wallet.meta.name,
|
|
11236
|
-
icon: wallet.meta.logo ? /* @__PURE__ */
|
|
11583
|
+
icon: wallet.meta.logo ? /* @__PURE__ */ jsx31(
|
|
11237
11584
|
"img",
|
|
11238
11585
|
{
|
|
11239
11586
|
src: wallet.meta.logo,
|
|
@@ -11245,7 +11592,7 @@ function DetectedWalletRow({
|
|
|
11245
11592
|
objectFit: "cover"
|
|
11246
11593
|
}
|
|
11247
11594
|
}
|
|
11248
|
-
) : /* @__PURE__ */
|
|
11595
|
+
) : /* @__PURE__ */ jsx31(
|
|
11249
11596
|
"div",
|
|
11250
11597
|
{
|
|
11251
11598
|
style: {
|
|
@@ -11257,7 +11604,7 @@ function DetectedWalletRow({
|
|
|
11257
11604
|
alignItems: "center",
|
|
11258
11605
|
justifyContent: "center"
|
|
11259
11606
|
},
|
|
11260
|
-
children: /* @__PURE__ */
|
|
11607
|
+
children: /* @__PURE__ */ jsx31(
|
|
11261
11608
|
"span",
|
|
11262
11609
|
{
|
|
11263
11610
|
style: {
|
|
@@ -11275,16 +11622,16 @@ function DetectedWalletRow({
|
|
|
11275
11622
|
}
|
|
11276
11623
|
|
|
11277
11624
|
// src/widget/features/wallet/components/WalletConnectRow.tsx
|
|
11278
|
-
import { jsx as
|
|
11625
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
11279
11626
|
function WalletConnectRow({
|
|
11280
11627
|
onClick
|
|
11281
11628
|
}) {
|
|
11282
|
-
return /* @__PURE__ */
|
|
11629
|
+
return /* @__PURE__ */ jsx32(
|
|
11283
11630
|
PaymentOptionRow,
|
|
11284
11631
|
{
|
|
11285
11632
|
onClick: () => void onClick(),
|
|
11286
11633
|
label: "WalletConnect",
|
|
11287
|
-
icon: /* @__PURE__ */
|
|
11634
|
+
icon: /* @__PURE__ */ jsx32("div", { style: walletActionIconBoxStyle, children: /* @__PURE__ */ jsx32(
|
|
11288
11635
|
"svg",
|
|
11289
11636
|
{
|
|
11290
11637
|
style: {
|
|
@@ -11294,10 +11641,10 @@ function WalletConnectRow({
|
|
|
11294
11641
|
},
|
|
11295
11642
|
viewBox: "0 0 24 24",
|
|
11296
11643
|
fill: "currentColor",
|
|
11297
|
-
children: /* @__PURE__ */
|
|
11644
|
+
children: /* @__PURE__ */ jsx32("path", { d: "M6.09 10.56c3.26-3.2 8.56-3.2 11.82 0l.39.39a.4.4 0 010 .58l-1.34 1.31a.21.21 0 01-.3 0l-.54-.53c-2.28-2.23-5.97-2.23-8.24 0l-.58.56a.21.21 0 01-.3 0L5.66 11.6a.4.4 0 010-.58l.43-.46zm14.6 2.72l1.2 1.17a.4.4 0 010 .58l-5.38 5.27a.43.43 0 01-.6 0l-3.82-3.74a.11.11 0 00-.15 0l-3.82 3.74a.43.43 0 01-.6 0L2.15 15.03a.4.4 0 010-.58l1.2-1.17a.43.43 0 01.6 0l3.82 3.74c.04.04.1.04.15 0l3.82-3.74a.43.43 0 01.6 0l3.82 3.74c.04.04.1.04.15 0l3.82-3.74a.43.43 0 01.6 0z" })
|
|
11298
11645
|
}
|
|
11299
11646
|
) }),
|
|
11300
|
-
trailing: /* @__PURE__ */
|
|
11647
|
+
trailing: /* @__PURE__ */ jsx32(
|
|
11301
11648
|
"svg",
|
|
11302
11649
|
{
|
|
11303
11650
|
style: {
|
|
@@ -11309,7 +11656,7 @@ function WalletConnectRow({
|
|
|
11309
11656
|
fill: "none",
|
|
11310
11657
|
stroke: "currentColor",
|
|
11311
11658
|
strokeWidth: 2,
|
|
11312
|
-
children: /* @__PURE__ */
|
|
11659
|
+
children: /* @__PURE__ */ jsx32("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" })
|
|
11313
11660
|
}
|
|
11314
11661
|
)
|
|
11315
11662
|
}
|
|
@@ -11317,9 +11664,9 @@ function WalletConnectRow({
|
|
|
11317
11664
|
}
|
|
11318
11665
|
|
|
11319
11666
|
// src/widget/features/wallet/components/WalletDropdownEmptyState.tsx
|
|
11320
|
-
import { jsx as
|
|
11667
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
11321
11668
|
function WalletDropdownEmptyState() {
|
|
11322
|
-
return /* @__PURE__ */
|
|
11669
|
+
return /* @__PURE__ */ jsx33(
|
|
11323
11670
|
"p",
|
|
11324
11671
|
{
|
|
11325
11672
|
style: {
|
|
@@ -11334,13 +11681,13 @@ function WalletDropdownEmptyState() {
|
|
|
11334
11681
|
}
|
|
11335
11682
|
|
|
11336
11683
|
// src/widget/features/wallet/components/CryptoWalletDropdownContent.tsx
|
|
11337
|
-
import { jsx as
|
|
11684
|
+
import { jsx as jsx34, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
11338
11685
|
function CryptoWalletDropdownContent({
|
|
11339
11686
|
browserWallets,
|
|
11340
11687
|
handleWalletConnect,
|
|
11341
11688
|
handleWalletSelect
|
|
11342
11689
|
}) {
|
|
11343
|
-
return /* @__PURE__ */
|
|
11690
|
+
return /* @__PURE__ */ jsxs28(
|
|
11344
11691
|
"div",
|
|
11345
11692
|
{
|
|
11346
11693
|
style: {
|
|
@@ -11357,10 +11704,10 @@ function CryptoWalletDropdownContent({
|
|
|
11357
11704
|
scrollbarColor: `${colors.muted} transparent`
|
|
11358
11705
|
},
|
|
11359
11706
|
children: [
|
|
11360
|
-
/* @__PURE__ */
|
|
11361
|
-
/* @__PURE__ */
|
|
11362
|
-
/* @__PURE__ */
|
|
11363
|
-
/* @__PURE__ */
|
|
11707
|
+
/* @__PURE__ */ jsxs28("div", { style: { padding: spacing[3] }, children: [
|
|
11708
|
+
/* @__PURE__ */ jsxs28("div", { style: dropdownSectionHeadingStyle, children: [
|
|
11709
|
+
/* @__PURE__ */ jsx34("div", { style: dropdownStatusDotStyle(colors.green[500]) }),
|
|
11710
|
+
/* @__PURE__ */ jsx34(
|
|
11364
11711
|
"span",
|
|
11365
11712
|
{
|
|
11366
11713
|
style: {
|
|
@@ -11372,7 +11719,7 @@ function CryptoWalletDropdownContent({
|
|
|
11372
11719
|
}
|
|
11373
11720
|
)
|
|
11374
11721
|
] }),
|
|
11375
|
-
browserWallets.length > 0 ? /* @__PURE__ */
|
|
11722
|
+
browserWallets.length > 0 ? /* @__PURE__ */ jsx34(
|
|
11376
11723
|
"div",
|
|
11377
11724
|
{
|
|
11378
11725
|
style: {
|
|
@@ -11380,7 +11727,7 @@ function CryptoWalletDropdownContent({
|
|
|
11380
11727
|
flexDirection: "column",
|
|
11381
11728
|
gap: spacing[1]
|
|
11382
11729
|
},
|
|
11383
|
-
children: browserWallets.map((wallet) => /* @__PURE__ */
|
|
11730
|
+
children: browserWallets.map((wallet) => /* @__PURE__ */ jsx34(
|
|
11384
11731
|
DetectedWalletRow,
|
|
11385
11732
|
{
|
|
11386
11733
|
wallet,
|
|
@@ -11389,19 +11736,19 @@ function CryptoWalletDropdownContent({
|
|
|
11389
11736
|
wallet.meta.id
|
|
11390
11737
|
))
|
|
11391
11738
|
}
|
|
11392
|
-
) : /* @__PURE__ */
|
|
11739
|
+
) : /* @__PURE__ */ jsx34(WalletDropdownEmptyState, {})
|
|
11393
11740
|
] }),
|
|
11394
|
-
/* @__PURE__ */
|
|
11395
|
-
/* @__PURE__ */
|
|
11741
|
+
/* @__PURE__ */ jsx34("div", { style: dividerBorderStyle }),
|
|
11742
|
+
/* @__PURE__ */ jsx34("div", { style: { padding: spacing[3] }, children: /* @__PURE__ */ jsx34(WalletConnectRow, { onClick: handleWalletConnect }) })
|
|
11396
11743
|
]
|
|
11397
11744
|
}
|
|
11398
11745
|
);
|
|
11399
11746
|
}
|
|
11400
11747
|
|
|
11401
11748
|
// src/widget/features/wallet/components/FiatComingSoonBanner.tsx
|
|
11402
|
-
import { jsx as
|
|
11749
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
11403
11750
|
function FiatComingSoonBanner() {
|
|
11404
|
-
return /* @__PURE__ */
|
|
11751
|
+
return /* @__PURE__ */ jsx35(
|
|
11405
11752
|
"div",
|
|
11406
11753
|
{
|
|
11407
11754
|
style: {
|
|
@@ -11409,7 +11756,7 @@ function FiatComingSoonBanner() {
|
|
|
11409
11756
|
backgroundColor: "rgba(245, 158, 11, 0.1)",
|
|
11410
11757
|
borderBottom: "1px solid rgba(245, 158, 11, 0.2)"
|
|
11411
11758
|
},
|
|
11412
|
-
children: /* @__PURE__ */
|
|
11759
|
+
children: /* @__PURE__ */ jsx35(
|
|
11413
11760
|
"p",
|
|
11414
11761
|
{
|
|
11415
11762
|
style: {
|
|
@@ -11426,29 +11773,29 @@ function FiatComingSoonBanner() {
|
|
|
11426
11773
|
}
|
|
11427
11774
|
|
|
11428
11775
|
// src/widget/features/wallet/components/FiatMethodRow.tsx
|
|
11429
|
-
import { jsx as
|
|
11776
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
11430
11777
|
function FiatMethodRow({
|
|
11431
11778
|
method,
|
|
11432
11779
|
onSelect
|
|
11433
11780
|
}) {
|
|
11434
|
-
return /* @__PURE__ */
|
|
11781
|
+
return /* @__PURE__ */ jsx36(
|
|
11435
11782
|
PaymentOptionRow,
|
|
11436
11783
|
{
|
|
11437
11784
|
onClick: onSelect,
|
|
11438
11785
|
disabled: true,
|
|
11439
11786
|
label: method.name,
|
|
11440
|
-
icon: /* @__PURE__ */
|
|
11787
|
+
icon: /* @__PURE__ */ jsx36("span", { style: { color: colors.mutedForeground }, children: method.icon })
|
|
11441
11788
|
}
|
|
11442
11789
|
);
|
|
11443
11790
|
}
|
|
11444
11791
|
|
|
11445
11792
|
// src/widget/features/wallet/components/FiatPaymentDropdownContent.tsx
|
|
11446
|
-
import { jsx as
|
|
11793
|
+
import { jsx as jsx37, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
11447
11794
|
function FiatPaymentDropdownContent({
|
|
11448
11795
|
fiatOptions: fiatOptions2,
|
|
11449
11796
|
handleFiatSelect
|
|
11450
11797
|
}) {
|
|
11451
|
-
return /* @__PURE__ */
|
|
11798
|
+
return /* @__PURE__ */ jsxs29(
|
|
11452
11799
|
"div",
|
|
11453
11800
|
{
|
|
11454
11801
|
style: {
|
|
@@ -11462,11 +11809,11 @@ function FiatPaymentDropdownContent({
|
|
|
11462
11809
|
animation: "tw-fade-in 0.2s ease-out"
|
|
11463
11810
|
},
|
|
11464
11811
|
children: [
|
|
11465
|
-
/* @__PURE__ */
|
|
11466
|
-
/* @__PURE__ */
|
|
11467
|
-
/* @__PURE__ */
|
|
11468
|
-
/* @__PURE__ */
|
|
11469
|
-
/* @__PURE__ */
|
|
11812
|
+
/* @__PURE__ */ jsx37(FiatComingSoonBanner, {}),
|
|
11813
|
+
/* @__PURE__ */ jsxs29("div", { style: { padding: spacing[3] }, children: [
|
|
11814
|
+
/* @__PURE__ */ jsxs29("div", { style: dropdownSectionHeadingStyle, children: [
|
|
11815
|
+
/* @__PURE__ */ jsx37("div", { style: dropdownStatusDotStyle(colors.primary) }),
|
|
11816
|
+
/* @__PURE__ */ jsx37(
|
|
11470
11817
|
"span",
|
|
11471
11818
|
{
|
|
11472
11819
|
style: {
|
|
@@ -11478,7 +11825,7 @@ function FiatPaymentDropdownContent({
|
|
|
11478
11825
|
}
|
|
11479
11826
|
)
|
|
11480
11827
|
] }),
|
|
11481
|
-
/* @__PURE__ */
|
|
11828
|
+
/* @__PURE__ */ jsx37(
|
|
11482
11829
|
"div",
|
|
11483
11830
|
{
|
|
11484
11831
|
style: {
|
|
@@ -11486,7 +11833,7 @@ function FiatPaymentDropdownContent({
|
|
|
11486
11833
|
flexDirection: "column",
|
|
11487
11834
|
gap: spacing[1]
|
|
11488
11835
|
},
|
|
11489
|
-
children: fiatOptions2.map((method) => /* @__PURE__ */
|
|
11836
|
+
children: fiatOptions2.map((method) => /* @__PURE__ */ jsx37(
|
|
11490
11837
|
FiatMethodRow,
|
|
11491
11838
|
{
|
|
11492
11839
|
method,
|
|
@@ -11503,9 +11850,9 @@ function FiatPaymentDropdownContent({
|
|
|
11503
11850
|
}
|
|
11504
11851
|
|
|
11505
11852
|
// src/widget/features/wallet/components/paymentOptionIcons.tsx
|
|
11506
|
-
import { jsx as
|
|
11853
|
+
import { jsx as jsx38, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
11507
11854
|
function CryptoPaymentIcon() {
|
|
11508
|
-
return /* @__PURE__ */
|
|
11855
|
+
return /* @__PURE__ */ jsx38(
|
|
11509
11856
|
"svg",
|
|
11510
11857
|
{
|
|
11511
11858
|
style: {
|
|
@@ -11517,7 +11864,7 @@ function CryptoPaymentIcon() {
|
|
|
11517
11864
|
fill: "none",
|
|
11518
11865
|
stroke: "currentColor",
|
|
11519
11866
|
strokeWidth: 2,
|
|
11520
|
-
children: /* @__PURE__ */
|
|
11867
|
+
children: /* @__PURE__ */ jsx38(
|
|
11521
11868
|
"path",
|
|
11522
11869
|
{
|
|
11523
11870
|
strokeLinecap: "round",
|
|
@@ -11529,7 +11876,7 @@ function CryptoPaymentIcon() {
|
|
|
11529
11876
|
);
|
|
11530
11877
|
}
|
|
11531
11878
|
function FiatPaymentIcon() {
|
|
11532
|
-
return /* @__PURE__ */
|
|
11879
|
+
return /* @__PURE__ */ jsxs30(
|
|
11533
11880
|
"svg",
|
|
11534
11881
|
{
|
|
11535
11882
|
style: {
|
|
@@ -11542,94 +11889,94 @@ function FiatPaymentIcon() {
|
|
|
11542
11889
|
stroke: "currentColor",
|
|
11543
11890
|
strokeWidth: 2,
|
|
11544
11891
|
children: [
|
|
11545
|
-
/* @__PURE__ */
|
|
11546
|
-
/* @__PURE__ */
|
|
11892
|
+
/* @__PURE__ */ jsx38("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }),
|
|
11893
|
+
/* @__PURE__ */ jsx38("line", { x1: "1", y1: "10", x2: "23", y2: "10" })
|
|
11547
11894
|
]
|
|
11548
11895
|
}
|
|
11549
11896
|
);
|
|
11550
11897
|
}
|
|
11551
11898
|
function ApplePayIcon() {
|
|
11552
|
-
return /* @__PURE__ */
|
|
11899
|
+
return /* @__PURE__ */ jsxs30(
|
|
11553
11900
|
"svg",
|
|
11554
11901
|
{
|
|
11555
11902
|
style: { width: "2rem", height: "1.25rem" },
|
|
11556
11903
|
viewBox: "0 0 50 20",
|
|
11557
11904
|
fill: "currentColor",
|
|
11558
11905
|
children: [
|
|
11559
|
-
/* @__PURE__ */
|
|
11560
|
-
/* @__PURE__ */
|
|
11906
|
+
/* @__PURE__ */ jsx38("path", { d: "M9.6 4.8c-.6.7-1.5 1.3-2.4 1.2-.1-.9.3-1.9.9-2.5.6-.7 1.6-1.2 2.4-1.2.1 1-.3 1.9-.9 2.5zm.9 1.3c-1.3-.1-2.5.8-3.1.8-.6 0-1.6-.7-2.7-.7-1.4 0-2.6.8-3.4 2-.7 1.2-.5 3.5.6 5.5.5.9 1.2 1.9 2.1 1.9.8 0 1.2-.5 2.3-.5s1.4.5 2.4.5c.9 0 1.5-.9 2-1.8.4-.6.5-1.2.7-1.8-1.6-.6-2-2.6-1.4-4-.4-.5-1-1.3-1.5-1.9z" }),
|
|
11907
|
+
/* @__PURE__ */ jsx38("path", { d: "M18.4 2.1c2.3 0 4 1.6 4 3.9s-1.7 3.9-4.1 3.9h-2.6v4h-1.8V2.1h4.5zm-2.7 6.2h2.2c1.6 0 2.5-.9 2.5-2.4s-.9-2.4-2.5-2.4h-2.2v4.8zm6.4 3.2c0-1.5 1.2-2.5 3.3-2.6l2.4-.1v-.7c0-1-.7-1.6-1.8-1.6-1 0-1.7.5-1.8 1.3h-1.6c.1-1.5 1.4-2.7 3.5-2.7 2.1 0 3.4 1.1 3.4 2.9v6h-1.6v-1.4c-.5 1-1.5 1.6-2.7 1.6-1.7 0-2.9-1-2.9-2.7h-.2zm5.7-.8v-.7l-2.2.1c-1.1.1-1.8.6-1.8 1.4 0 .8.6 1.3 1.6 1.3 1.3 0 2.4-.9 2.4-2.1zm3.2 5.8v-1.4c.1 0 .5.1.7.1 1 0 1.5-.4 1.8-1.5l.2-.6-3.1-8.6h1.9l2.2 6.9 2.2-6.9h1.8l-3.2 9c-.7 2-1.5 2.7-3.3 2.7-.2 0-.6 0-.8-.1l-.4.4z" })
|
|
11561
11908
|
]
|
|
11562
11909
|
}
|
|
11563
11910
|
);
|
|
11564
11911
|
}
|
|
11565
11912
|
function MPesaIcon() {
|
|
11566
|
-
return /* @__PURE__ */
|
|
11913
|
+
return /* @__PURE__ */ jsx38(
|
|
11567
11914
|
"svg",
|
|
11568
11915
|
{
|
|
11569
11916
|
style: { width: "2rem", height: "1.25rem" },
|
|
11570
11917
|
viewBox: "0 0 24 24",
|
|
11571
11918
|
fill: "currentColor",
|
|
11572
|
-
children: /* @__PURE__ */
|
|
11919
|
+
children: /* @__PURE__ */ jsx38("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z" })
|
|
11573
11920
|
}
|
|
11574
11921
|
);
|
|
11575
11922
|
}
|
|
11576
11923
|
function VenmoIcon() {
|
|
11577
|
-
return /* @__PURE__ */
|
|
11924
|
+
return /* @__PURE__ */ jsx38(
|
|
11578
11925
|
"svg",
|
|
11579
11926
|
{
|
|
11580
11927
|
style: { width: "2rem", height: "1.25rem" },
|
|
11581
11928
|
viewBox: "0 0 24 24",
|
|
11582
11929
|
fill: "currentColor",
|
|
11583
|
-
children: /* @__PURE__ */
|
|
11930
|
+
children: /* @__PURE__ */ jsx38("path", { d: "M19.5 3h-15C3.12 3 2 4.12 2 5.5v13C2 19.88 3.12 21 4.5 21h15c1.38 0 2.5-1.12 2.5-2.5v-13C22 4.12 20.88 3 19.5 3zm-4.77 11.58c-.64 1.56-2.13 3.42-3.86 3.42H8.69l-.61-3.55 1.13-.21.28 1.64c.25.14.52.22.79.22.68 0 1.31-.48 1.74-1.34.33-.67.44-1.34.44-1.92 0-.45-.11-.82-.38-1.06-.24-.22-.58-.33-.98-.33-.64 0-1.29.28-1.86.61l-.05-.02.61-4.04h4.13l-.16 1.11H11l-.21 1.4c.41-.13.85-.19 1.28-.19.71 0 1.31.2 1.73.61.46.44.67 1.08.67 1.88 0 .68-.15 1.35-.48 2.01z" })
|
|
11584
11931
|
}
|
|
11585
11932
|
);
|
|
11586
11933
|
}
|
|
11587
11934
|
function ZelleIcon() {
|
|
11588
|
-
return /* @__PURE__ */
|
|
11935
|
+
return /* @__PURE__ */ jsx38(
|
|
11589
11936
|
"svg",
|
|
11590
11937
|
{
|
|
11591
11938
|
style: { width: "2rem", height: "1.25rem" },
|
|
11592
11939
|
viewBox: "0 0 24 24",
|
|
11593
11940
|
fill: "currentColor",
|
|
11594
|
-
children: /* @__PURE__ */
|
|
11941
|
+
children: /* @__PURE__ */ jsx38("path", { d: "M13.25 4H5.5C4.67 4 4 4.67 4 5.5v13c0 .83.67 1.5 1.5 1.5h13c.83 0 1.5-.67 1.5-1.5v-7.75h-2v6.25H6V7h7.25V4zm3.91 2.83L9.83 14.17l-1.42-1.41 7.33-7.34L13.83 3.5h6.67v6.67l-1.92-1.92-1.42-1.42z" })
|
|
11595
11942
|
}
|
|
11596
11943
|
);
|
|
11597
11944
|
}
|
|
11598
11945
|
|
|
11599
11946
|
// src/widget/features/wallet/components/fiatOptions.tsx
|
|
11600
|
-
import { jsx as
|
|
11947
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
11601
11948
|
var fiatOptions = [
|
|
11602
11949
|
{
|
|
11603
11950
|
id: "applepay",
|
|
11604
11951
|
name: "Apple Pay",
|
|
11605
|
-
icon: /* @__PURE__ */
|
|
11952
|
+
icon: /* @__PURE__ */ jsx39(ApplePayIcon, {})
|
|
11606
11953
|
},
|
|
11607
11954
|
{
|
|
11608
11955
|
id: "mpesa",
|
|
11609
11956
|
name: "M-Pesa",
|
|
11610
|
-
icon: /* @__PURE__ */
|
|
11957
|
+
icon: /* @__PURE__ */ jsx39(MPesaIcon, {})
|
|
11611
11958
|
},
|
|
11612
11959
|
{
|
|
11613
11960
|
id: "venmo",
|
|
11614
11961
|
name: "Venmo",
|
|
11615
|
-
icon: /* @__PURE__ */
|
|
11962
|
+
icon: /* @__PURE__ */ jsx39(VenmoIcon, {})
|
|
11616
11963
|
},
|
|
11617
11964
|
{
|
|
11618
11965
|
id: "zelle",
|
|
11619
11966
|
name: "Zelle",
|
|
11620
|
-
icon: /* @__PURE__ */
|
|
11967
|
+
icon: /* @__PURE__ */ jsx39(ZelleIcon, {})
|
|
11621
11968
|
}
|
|
11622
11969
|
];
|
|
11623
11970
|
|
|
11624
11971
|
// src/widget/features/wallet/components/PaymentDropdownButton.tsx
|
|
11625
|
-
import { jsx as
|
|
11972
|
+
import { jsx as jsx40, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
11626
11973
|
function PaymentDropdownButton({
|
|
11627
11974
|
icon,
|
|
11628
11975
|
isOpen,
|
|
11629
11976
|
label,
|
|
11630
11977
|
onClick
|
|
11631
11978
|
}) {
|
|
11632
|
-
return /* @__PURE__ */
|
|
11979
|
+
return /* @__PURE__ */ jsxs31(
|
|
11633
11980
|
"button",
|
|
11634
11981
|
{
|
|
11635
11982
|
type: "button",
|
|
@@ -11655,7 +12002,7 @@ function PaymentDropdownButton({
|
|
|
11655
12002
|
},
|
|
11656
12003
|
children: [
|
|
11657
12004
|
icon,
|
|
11658
|
-
/* @__PURE__ */
|
|
12005
|
+
/* @__PURE__ */ jsx40(
|
|
11659
12006
|
"span",
|
|
11660
12007
|
{
|
|
11661
12008
|
style: {
|
|
@@ -11668,7 +12015,7 @@ function PaymentDropdownButton({
|
|
|
11668
12015
|
children: label
|
|
11669
12016
|
}
|
|
11670
12017
|
),
|
|
11671
|
-
/* @__PURE__ */
|
|
12018
|
+
/* @__PURE__ */ jsx40(
|
|
11672
12019
|
"svg",
|
|
11673
12020
|
{
|
|
11674
12021
|
style: {
|
|
@@ -11682,7 +12029,7 @@ function PaymentDropdownButton({
|
|
|
11682
12029
|
fill: "none",
|
|
11683
12030
|
stroke: "currentColor",
|
|
11684
12031
|
strokeWidth: 2,
|
|
11685
|
-
children: /* @__PURE__ */
|
|
12032
|
+
children: /* @__PURE__ */ jsx40("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" })
|
|
11686
12033
|
}
|
|
11687
12034
|
)
|
|
11688
12035
|
]
|
|
@@ -11691,7 +12038,7 @@ function PaymentDropdownButton({
|
|
|
11691
12038
|
}
|
|
11692
12039
|
|
|
11693
12040
|
// src/widget/features/wallet/components/HomePaymentOptions.tsx
|
|
11694
|
-
import { jsx as
|
|
12041
|
+
import { jsx as jsx41, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
11695
12042
|
function HomePaymentOptions({
|
|
11696
12043
|
browserWallets,
|
|
11697
12044
|
cryptoDropdownRef,
|
|
@@ -11705,7 +12052,7 @@ function HomePaymentOptions({
|
|
|
11705
12052
|
setIsCryptoDropdownOpen,
|
|
11706
12053
|
setIsFiatDropdownOpen
|
|
11707
12054
|
}) {
|
|
11708
|
-
return /* @__PURE__ */
|
|
12055
|
+
return /* @__PURE__ */ jsxs32(
|
|
11709
12056
|
"div",
|
|
11710
12057
|
{
|
|
11711
12058
|
style: {
|
|
@@ -11718,16 +12065,16 @@ function HomePaymentOptions({
|
|
|
11718
12065
|
minHeight: "6rem"
|
|
11719
12066
|
},
|
|
11720
12067
|
children: [
|
|
11721
|
-
/* @__PURE__ */
|
|
12068
|
+
/* @__PURE__ */ jsxs32(
|
|
11722
12069
|
"div",
|
|
11723
12070
|
{
|
|
11724
12071
|
style: isCryptoDropdownOpen ? dropdownWrapperOpenStyle : dropdownWrapperStyle,
|
|
11725
12072
|
ref: cryptoDropdownRef,
|
|
11726
12073
|
children: [
|
|
11727
|
-
/* @__PURE__ */
|
|
12074
|
+
/* @__PURE__ */ jsx41(
|
|
11728
12075
|
PaymentDropdownButton,
|
|
11729
12076
|
{
|
|
11730
|
-
icon: /* @__PURE__ */
|
|
12077
|
+
icon: /* @__PURE__ */ jsx41(CryptoPaymentIcon, {}),
|
|
11731
12078
|
isOpen: isCryptoDropdownOpen,
|
|
11732
12079
|
label: "Pay with crypto",
|
|
11733
12080
|
onClick: () => {
|
|
@@ -11736,7 +12083,7 @@ function HomePaymentOptions({
|
|
|
11736
12083
|
}
|
|
11737
12084
|
}
|
|
11738
12085
|
),
|
|
11739
|
-
isCryptoDropdownOpen ? /* @__PURE__ */
|
|
12086
|
+
isCryptoDropdownOpen ? /* @__PURE__ */ jsx41(
|
|
11740
12087
|
CryptoWalletDropdownContent,
|
|
11741
12088
|
{
|
|
11742
12089
|
browserWallets,
|
|
@@ -11747,9 +12094,9 @@ function HomePaymentOptions({
|
|
|
11747
12094
|
]
|
|
11748
12095
|
}
|
|
11749
12096
|
),
|
|
11750
|
-
/* @__PURE__ */
|
|
11751
|
-
/* @__PURE__ */
|
|
11752
|
-
/* @__PURE__ */
|
|
12097
|
+
/* @__PURE__ */ jsxs32("div", { style: dividerRowStyle, children: [
|
|
12098
|
+
/* @__PURE__ */ jsx41("div", { style: mutedOrDividerStyle(isDarkTheme) }),
|
|
12099
|
+
/* @__PURE__ */ jsx41(
|
|
11753
12100
|
"span",
|
|
11754
12101
|
{
|
|
11755
12102
|
style: {
|
|
@@ -11760,18 +12107,18 @@ function HomePaymentOptions({
|
|
|
11760
12107
|
children: "Or"
|
|
11761
12108
|
}
|
|
11762
12109
|
),
|
|
11763
|
-
/* @__PURE__ */
|
|
12110
|
+
/* @__PURE__ */ jsx41("div", { style: mutedOrDividerStyle(isDarkTheme) })
|
|
11764
12111
|
] }),
|
|
11765
|
-
/* @__PURE__ */
|
|
12112
|
+
/* @__PURE__ */ jsxs32(
|
|
11766
12113
|
"div",
|
|
11767
12114
|
{
|
|
11768
12115
|
style: isFiatDropdownOpen ? dropdownWrapperOpenStyle : dropdownWrapperStyle,
|
|
11769
12116
|
ref: fiatDropdownRef,
|
|
11770
12117
|
children: [
|
|
11771
|
-
/* @__PURE__ */
|
|
12118
|
+
/* @__PURE__ */ jsx41(
|
|
11772
12119
|
PaymentDropdownButton,
|
|
11773
12120
|
{
|
|
11774
|
-
icon: /* @__PURE__ */
|
|
12121
|
+
icon: /* @__PURE__ */ jsx41(FiatPaymentIcon, {}),
|
|
11775
12122
|
isOpen: isFiatDropdownOpen,
|
|
11776
12123
|
label: "Pay with fiat",
|
|
11777
12124
|
onClick: () => {
|
|
@@ -11780,7 +12127,7 @@ function HomePaymentOptions({
|
|
|
11780
12127
|
}
|
|
11781
12128
|
}
|
|
11782
12129
|
),
|
|
11783
|
-
isFiatDropdownOpen ? /* @__PURE__ */
|
|
12130
|
+
isFiatDropdownOpen ? /* @__PURE__ */ jsx41(
|
|
11784
12131
|
FiatPaymentDropdownContent,
|
|
11785
12132
|
{
|
|
11786
12133
|
fiatOptions,
|
|
@@ -11796,7 +12143,7 @@ function HomePaymentOptions({
|
|
|
11796
12143
|
}
|
|
11797
12144
|
|
|
11798
12145
|
// src/widget/features/wallet/hooks/useHomeWalletActions.ts
|
|
11799
|
-
import { useEffect as
|
|
12146
|
+
import { useEffect as useEffect22, useRef as useRef10, useState as useState21 } from "react";
|
|
11800
12147
|
|
|
11801
12148
|
// src/config/walletconnect.ts
|
|
11802
12149
|
init_store();
|
|
@@ -11919,12 +12266,12 @@ function useHomeWalletActions({
|
|
|
11919
12266
|
detectedWallets,
|
|
11920
12267
|
setCurrentStep
|
|
11921
12268
|
}) {
|
|
11922
|
-
const [isCryptoDropdownOpen, setIsCryptoDropdownOpen] =
|
|
11923
|
-
const [isFiatDropdownOpen, setIsFiatDropdownOpen] =
|
|
11924
|
-
const [universalConnector, setUniversalConnector] =
|
|
11925
|
-
const cryptoDropdownRef =
|
|
11926
|
-
const fiatDropdownRef =
|
|
11927
|
-
|
|
12269
|
+
const [isCryptoDropdownOpen, setIsCryptoDropdownOpen] = useState21(false);
|
|
12270
|
+
const [isFiatDropdownOpen, setIsFiatDropdownOpen] = useState21(false);
|
|
12271
|
+
const [universalConnector, setUniversalConnector] = useState21();
|
|
12272
|
+
const cryptoDropdownRef = useRef10(null);
|
|
12273
|
+
const fiatDropdownRef = useRef10(null);
|
|
12274
|
+
useEffect22(() => {
|
|
11928
12275
|
const handleClickOutside = (event) => {
|
|
11929
12276
|
if (cryptoDropdownRef.current && !cryptoDropdownRef.current.contains(event.target)) {
|
|
11930
12277
|
setIsCryptoDropdownOpen(false);
|
|
@@ -11936,7 +12283,7 @@ function useHomeWalletActions({
|
|
|
11936
12283
|
document.addEventListener("mousedown", handleClickOutside);
|
|
11937
12284
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
11938
12285
|
}, []);
|
|
11939
|
-
|
|
12286
|
+
useEffect22(() => {
|
|
11940
12287
|
getUniversalConnector().then(setUniversalConnector);
|
|
11941
12288
|
}, []);
|
|
11942
12289
|
const handleWalletSelect = async (wallet) => {
|
|
@@ -11977,7 +12324,7 @@ function useHomeWalletActions({
|
|
|
11977
12324
|
}
|
|
11978
12325
|
|
|
11979
12326
|
// src/widget/pages/Home.tsx
|
|
11980
|
-
import { jsx as
|
|
12327
|
+
import { jsx as jsx42, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
11981
12328
|
function Home({ style: _style }) {
|
|
11982
12329
|
const { amount, setAmount, amountInputMode, setAmountInputMode } = useDepositForm();
|
|
11983
12330
|
const { setCurrentStep } = useDepositNavigation();
|
|
@@ -12011,7 +12358,7 @@ function Home({ style: _style }) {
|
|
|
12011
12358
|
detectedWallets,
|
|
12012
12359
|
setCurrentStep
|
|
12013
12360
|
});
|
|
12014
|
-
return /* @__PURE__ */
|
|
12361
|
+
return /* @__PURE__ */ jsxs33(
|
|
12015
12362
|
"div",
|
|
12016
12363
|
{
|
|
12017
12364
|
style: {
|
|
@@ -12020,7 +12367,7 @@ function Home({ style: _style }) {
|
|
|
12020
12367
|
minHeight: "500px"
|
|
12021
12368
|
},
|
|
12022
12369
|
children: [
|
|
12023
|
-
/* @__PURE__ */
|
|
12370
|
+
/* @__PURE__ */ jsx42(
|
|
12024
12371
|
"div",
|
|
12025
12372
|
{
|
|
12026
12373
|
style: {
|
|
@@ -12030,7 +12377,7 @@ function Home({ style: _style }) {
|
|
|
12030
12377
|
padding: `${spacing[4]} ${spacing[4]}`,
|
|
12031
12378
|
borderBottom: `1px solid ${colors.border}`
|
|
12032
12379
|
},
|
|
12033
|
-
children: /* @__PURE__ */
|
|
12380
|
+
children: /* @__PURE__ */ jsx42(
|
|
12034
12381
|
"h1",
|
|
12035
12382
|
{
|
|
12036
12383
|
style: {
|
|
@@ -12043,7 +12390,7 @@ function Home({ style: _style }) {
|
|
|
12043
12390
|
)
|
|
12044
12391
|
}
|
|
12045
12392
|
),
|
|
12046
|
-
/* @__PURE__ */
|
|
12393
|
+
/* @__PURE__ */ jsxs33(
|
|
12047
12394
|
"div",
|
|
12048
12395
|
{
|
|
12049
12396
|
style: {
|
|
@@ -12057,7 +12404,7 @@ function Home({ style: _style }) {
|
|
|
12057
12404
|
position: "relative"
|
|
12058
12405
|
},
|
|
12059
12406
|
children: [
|
|
12060
|
-
/* @__PURE__ */
|
|
12407
|
+
/* @__PURE__ */ jsx42(
|
|
12061
12408
|
"p",
|
|
12062
12409
|
{
|
|
12063
12410
|
style: {
|
|
@@ -12068,7 +12415,7 @@ function Home({ style: _style }) {
|
|
|
12068
12415
|
children: "Enter an amount"
|
|
12069
12416
|
}
|
|
12070
12417
|
),
|
|
12071
|
-
/* @__PURE__ */
|
|
12418
|
+
/* @__PURE__ */ jsx42(
|
|
12072
12419
|
AmountInputDisplay,
|
|
12073
12420
|
{
|
|
12074
12421
|
amount,
|
|
@@ -12079,7 +12426,7 @@ function Home({ style: _style }) {
|
|
|
12079
12426
|
style: { marginBottom: spacing[8] }
|
|
12080
12427
|
}
|
|
12081
12428
|
),
|
|
12082
|
-
amountValidationMessage ? /* @__PURE__ */
|
|
12429
|
+
amountValidationMessage ? /* @__PURE__ */ jsx42(
|
|
12083
12430
|
"p",
|
|
12084
12431
|
{
|
|
12085
12432
|
style: {
|
|
@@ -12092,7 +12439,7 @@ function Home({ style: _style }) {
|
|
|
12092
12439
|
},
|
|
12093
12440
|
children: amountValidationMessage
|
|
12094
12441
|
}
|
|
12095
|
-
) : minAmountUsd != null || maxAmountUsd != null ? /* @__PURE__ */
|
|
12442
|
+
) : minAmountUsd != null || maxAmountUsd != null ? /* @__PURE__ */ jsx42(
|
|
12096
12443
|
"p",
|
|
12097
12444
|
{
|
|
12098
12445
|
style: {
|
|
@@ -12108,7 +12455,7 @@ function Home({ style: _style }) {
|
|
|
12108
12455
|
].filter(Boolean).join(" \u2022 ")
|
|
12109
12456
|
}
|
|
12110
12457
|
) : null,
|
|
12111
|
-
/* @__PURE__ */
|
|
12458
|
+
/* @__PURE__ */ jsx42(
|
|
12112
12459
|
HomePaymentOptions,
|
|
12113
12460
|
{
|
|
12114
12461
|
browserWallets,
|
|
@@ -12127,14 +12474,14 @@ function Home({ style: _style }) {
|
|
|
12127
12474
|
]
|
|
12128
12475
|
}
|
|
12129
12476
|
),
|
|
12130
|
-
/* @__PURE__ */
|
|
12477
|
+
/* @__PURE__ */ jsx42(WidgetSecurityFooter, {})
|
|
12131
12478
|
]
|
|
12132
12479
|
}
|
|
12133
12480
|
);
|
|
12134
12481
|
}
|
|
12135
12482
|
|
|
12136
12483
|
// src/widget/pages/SelectToken.tsx
|
|
12137
|
-
import { jsx as
|
|
12484
|
+
import { jsx as jsx43, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
12138
12485
|
function SelectToken({ style }) {
|
|
12139
12486
|
const { selectedChain, setSelectedChain, setSelectedToken } = useDepositForm();
|
|
12140
12487
|
const { goBack } = useDepositNavigation();
|
|
@@ -12165,7 +12512,7 @@ function SelectToken({ style }) {
|
|
|
12165
12512
|
walletAddress,
|
|
12166
12513
|
yourWalletTokens
|
|
12167
12514
|
});
|
|
12168
|
-
return /* @__PURE__ */
|
|
12515
|
+
return /* @__PURE__ */ jsxs34(
|
|
12169
12516
|
"div",
|
|
12170
12517
|
{
|
|
12171
12518
|
style: {
|
|
@@ -12176,7 +12523,7 @@ function SelectToken({ style }) {
|
|
|
12176
12523
|
...style
|
|
12177
12524
|
},
|
|
12178
12525
|
children: [
|
|
12179
|
-
/* @__PURE__ */
|
|
12526
|
+
/* @__PURE__ */ jsxs34(
|
|
12180
12527
|
"div",
|
|
12181
12528
|
{
|
|
12182
12529
|
style: {
|
|
@@ -12186,7 +12533,7 @@ function SelectToken({ style }) {
|
|
|
12186
12533
|
borderBottom: `1px solid ${colors.border}`
|
|
12187
12534
|
},
|
|
12188
12535
|
children: [
|
|
12189
|
-
/* @__PURE__ */
|
|
12536
|
+
/* @__PURE__ */ jsx43(
|
|
12190
12537
|
"button",
|
|
12191
12538
|
{
|
|
12192
12539
|
type: "button",
|
|
@@ -12201,7 +12548,7 @@ function SelectToken({ style }) {
|
|
|
12201
12548
|
cursor: "pointer"
|
|
12202
12549
|
},
|
|
12203
12550
|
"aria-label": "Go back",
|
|
12204
|
-
children: /* @__PURE__ */
|
|
12551
|
+
children: /* @__PURE__ */ jsx43(
|
|
12205
12552
|
"svg",
|
|
12206
12553
|
{
|
|
12207
12554
|
style: {
|
|
@@ -12213,7 +12560,7 @@ function SelectToken({ style }) {
|
|
|
12213
12560
|
fill: "none",
|
|
12214
12561
|
stroke: "currentColor",
|
|
12215
12562
|
strokeWidth: 2,
|
|
12216
|
-
children: /* @__PURE__ */
|
|
12563
|
+
children: /* @__PURE__ */ jsx43(
|
|
12217
12564
|
"path",
|
|
12218
12565
|
{
|
|
12219
12566
|
strokeLinecap: "round",
|
|
@@ -12225,7 +12572,7 @@ function SelectToken({ style }) {
|
|
|
12225
12572
|
)
|
|
12226
12573
|
}
|
|
12227
12574
|
),
|
|
12228
|
-
/* @__PURE__ */
|
|
12575
|
+
/* @__PURE__ */ jsx43(
|
|
12229
12576
|
"h1",
|
|
12230
12577
|
{
|
|
12231
12578
|
style: {
|
|
@@ -12242,7 +12589,7 @@ function SelectToken({ style }) {
|
|
|
12242
12589
|
]
|
|
12243
12590
|
}
|
|
12244
12591
|
),
|
|
12245
|
-
/* @__PURE__ */
|
|
12592
|
+
/* @__PURE__ */ jsxs34(
|
|
12246
12593
|
"div",
|
|
12247
12594
|
{
|
|
12248
12595
|
style: {
|
|
@@ -12251,7 +12598,7 @@ function SelectToken({ style }) {
|
|
|
12251
12598
|
overflow: "hidden"
|
|
12252
12599
|
},
|
|
12253
12600
|
children: [
|
|
12254
|
-
/* @__PURE__ */
|
|
12601
|
+
/* @__PURE__ */ jsx43(
|
|
12255
12602
|
ChainSelectorPanel,
|
|
12256
12603
|
{
|
|
12257
12604
|
error,
|
|
@@ -12262,7 +12609,7 @@ function SelectToken({ style }) {
|
|
|
12262
12609
|
popularChains
|
|
12263
12610
|
}
|
|
12264
12611
|
),
|
|
12265
|
-
/* @__PURE__ */
|
|
12612
|
+
/* @__PURE__ */ jsx43(
|
|
12266
12613
|
TokenSelectorPanel,
|
|
12267
12614
|
{
|
|
12268
12615
|
filteredTokens,
|
|
@@ -12283,17 +12630,17 @@ function SelectToken({ style }) {
|
|
|
12283
12630
|
]
|
|
12284
12631
|
}
|
|
12285
12632
|
),
|
|
12286
|
-
/* @__PURE__ */
|
|
12633
|
+
/* @__PURE__ */ jsx43(WidgetSecurityFooter, {})
|
|
12287
12634
|
]
|
|
12288
12635
|
}
|
|
12289
12636
|
);
|
|
12290
12637
|
}
|
|
12291
12638
|
|
|
12292
12639
|
// src/widget/pages/CryptoPay.tsx
|
|
12293
|
-
import { useEffect as
|
|
12640
|
+
import { useEffect as useEffect24, useMemo as useMemo18 } from "react";
|
|
12294
12641
|
|
|
12295
12642
|
// src/widget/features/route-preview/hooks/useRoutePreviewModel.ts
|
|
12296
|
-
import { useMemo as
|
|
12643
|
+
import { useMemo as useMemo16 } from "react";
|
|
12297
12644
|
function useRoutePreviewModel({
|
|
12298
12645
|
amountUsd,
|
|
12299
12646
|
amountValidationError,
|
|
@@ -12306,7 +12653,7 @@ function useRoutePreviewModel({
|
|
|
12306
12653
|
walletAddress
|
|
12307
12654
|
}) {
|
|
12308
12655
|
const { chains } = useChains();
|
|
12309
|
-
const destinationConfig =
|
|
12656
|
+
const destinationConfig = useMemo16(
|
|
12310
12657
|
() => ({
|
|
12311
12658
|
dappName: config.messages?.title || "DApp",
|
|
12312
12659
|
toChain: config.routes.toChain,
|
|
@@ -12320,7 +12667,7 @@ function useRoutePreviewModel({
|
|
|
12320
12667
|
config.routes.toToken
|
|
12321
12668
|
]
|
|
12322
12669
|
);
|
|
12323
|
-
const routeConfig =
|
|
12670
|
+
const routeConfig = useMemo16(() => {
|
|
12324
12671
|
const toChainId = config.routes.toChain;
|
|
12325
12672
|
const toChainKey = normalizeChainKey2(toChainId);
|
|
12326
12673
|
const toChain = toChainKey ? chains.find(
|
|
@@ -12354,7 +12701,7 @@ function useRoutePreviewModel({
|
|
|
12354
12701
|
walletAddress
|
|
12355
12702
|
]);
|
|
12356
12703
|
const routeBuilderState = useRouteBuilder(routeConfig);
|
|
12357
|
-
const routePrerequisiteError =
|
|
12704
|
+
const routePrerequisiteError = useMemo16(() => {
|
|
12358
12705
|
if (!isReady) return;
|
|
12359
12706
|
if (!selectedChain) {
|
|
12360
12707
|
return "Select a source chain to fetch a route.";
|
|
@@ -12394,7 +12741,7 @@ function useRoutePreviewModel({
|
|
|
12394
12741
|
}
|
|
12395
12742
|
|
|
12396
12743
|
// src/widget/features/transaction/components/CryptoPaySwipeSection.tsx
|
|
12397
|
-
import { jsx as
|
|
12744
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
12398
12745
|
function CryptoPaySwipeSection({
|
|
12399
12746
|
actionErrorMessage,
|
|
12400
12747
|
canSwipe,
|
|
@@ -12410,13 +12757,13 @@ function CryptoPaySwipeSection({
|
|
|
12410
12757
|
swipeResetKey
|
|
12411
12758
|
}) {
|
|
12412
12759
|
const swipeText = actionErrorMessage ? actionErrorMessage : !isWalletConnected ? "Connect your wallet to deposit" : isLoadingRoute ? "Loading route..." : isApproving ? "Approving..." : isReadingAllowance ? "Checking allowance..." : needsApproval ? "Swipe to approve" : "Swipe to confirm";
|
|
12413
|
-
return /* @__PURE__ */
|
|
12760
|
+
return /* @__PURE__ */ jsx44(
|
|
12414
12761
|
"div",
|
|
12415
12762
|
{
|
|
12416
12763
|
style: {
|
|
12417
12764
|
padding: `${spacing[4]} ${spacing[6]}`
|
|
12418
12765
|
},
|
|
12419
|
-
children: selectedToken?.chainData ? /* @__PURE__ */
|
|
12766
|
+
children: selectedToken?.chainData ? /* @__PURE__ */ jsx44(
|
|
12420
12767
|
SwipeToConfirmTokens,
|
|
12421
12768
|
{
|
|
12422
12769
|
text: swipeText,
|
|
@@ -12436,7 +12783,7 @@ function CryptoPaySwipeSection({
|
|
|
12436
12783
|
}
|
|
12437
12784
|
|
|
12438
12785
|
// src/widget/features/transaction/components/ErrorRecoveryCard.tsx
|
|
12439
|
-
import { jsx as
|
|
12786
|
+
import { jsx as jsx45, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
12440
12787
|
function ErrorRecoveryCard({
|
|
12441
12788
|
errorMessage,
|
|
12442
12789
|
errorSuggestion,
|
|
@@ -12447,7 +12794,7 @@ function ErrorRecoveryCard({
|
|
|
12447
12794
|
renderErrorIcon,
|
|
12448
12795
|
transactionHash
|
|
12449
12796
|
}) {
|
|
12450
|
-
return /* @__PURE__ */
|
|
12797
|
+
return /* @__PURE__ */ jsxs35(
|
|
12451
12798
|
"div",
|
|
12452
12799
|
{
|
|
12453
12800
|
style: {
|
|
@@ -12459,7 +12806,7 @@ function ErrorRecoveryCard({
|
|
|
12459
12806
|
padding: `${spacing[8]} ${spacing[6]}`
|
|
12460
12807
|
},
|
|
12461
12808
|
children: [
|
|
12462
|
-
/* @__PURE__ */
|
|
12809
|
+
/* @__PURE__ */ jsx45(
|
|
12463
12810
|
"div",
|
|
12464
12811
|
{
|
|
12465
12812
|
style: {
|
|
@@ -12475,7 +12822,7 @@ function ErrorRecoveryCard({
|
|
|
12475
12822
|
children: renderErrorIcon()
|
|
12476
12823
|
}
|
|
12477
12824
|
),
|
|
12478
|
-
/* @__PURE__ */
|
|
12825
|
+
/* @__PURE__ */ jsx45(
|
|
12479
12826
|
"h2",
|
|
12480
12827
|
{
|
|
12481
12828
|
style: {
|
|
@@ -12488,7 +12835,7 @@ function ErrorRecoveryCard({
|
|
|
12488
12835
|
children: errorTitle
|
|
12489
12836
|
}
|
|
12490
12837
|
),
|
|
12491
|
-
errorMessage ? /* @__PURE__ */
|
|
12838
|
+
errorMessage ? /* @__PURE__ */ jsx45(
|
|
12492
12839
|
"p",
|
|
12493
12840
|
{
|
|
12494
12841
|
style: {
|
|
@@ -12500,7 +12847,7 @@ function ErrorRecoveryCard({
|
|
|
12500
12847
|
children: errorMessage
|
|
12501
12848
|
}
|
|
12502
12849
|
) : null,
|
|
12503
|
-
/* @__PURE__ */
|
|
12850
|
+
/* @__PURE__ */ jsx45(
|
|
12504
12851
|
"p",
|
|
12505
12852
|
{
|
|
12506
12853
|
style: {
|
|
@@ -12513,13 +12860,13 @@ function ErrorRecoveryCard({
|
|
|
12513
12860
|
children: errorSuggestion
|
|
12514
12861
|
}
|
|
12515
12862
|
),
|
|
12516
|
-
explorerUrl && transactionHash ? /* @__PURE__ */
|
|
12863
|
+
explorerUrl && transactionHash ? /* @__PURE__ */ jsx45(
|
|
12517
12864
|
"div",
|
|
12518
12865
|
{
|
|
12519
12866
|
style: {
|
|
12520
12867
|
marginBottom: spacing[6]
|
|
12521
12868
|
},
|
|
12522
|
-
children: /* @__PURE__ */
|
|
12869
|
+
children: /* @__PURE__ */ jsx45(
|
|
12523
12870
|
TransactionHashLink,
|
|
12524
12871
|
{
|
|
12525
12872
|
explorerUrl,
|
|
@@ -12529,7 +12876,7 @@ function ErrorRecoveryCard({
|
|
|
12529
12876
|
)
|
|
12530
12877
|
}
|
|
12531
12878
|
) : null,
|
|
12532
|
-
/* @__PURE__ */
|
|
12879
|
+
/* @__PURE__ */ jsxs35(
|
|
12533
12880
|
"div",
|
|
12534
12881
|
{
|
|
12535
12882
|
style: {
|
|
@@ -12540,7 +12887,7 @@ function ErrorRecoveryCard({
|
|
|
12540
12887
|
maxWidth: "20rem"
|
|
12541
12888
|
},
|
|
12542
12889
|
children: [
|
|
12543
|
-
/* @__PURE__ */
|
|
12890
|
+
/* @__PURE__ */ jsx45(
|
|
12544
12891
|
"button",
|
|
12545
12892
|
{
|
|
12546
12893
|
type: "button",
|
|
@@ -12560,7 +12907,7 @@ function ErrorRecoveryCard({
|
|
|
12560
12907
|
children: "Try Again"
|
|
12561
12908
|
}
|
|
12562
12909
|
),
|
|
12563
|
-
/* @__PURE__ */
|
|
12910
|
+
/* @__PURE__ */ jsx45(
|
|
12564
12911
|
"button",
|
|
12565
12912
|
{
|
|
12566
12913
|
type: "button",
|
|
@@ -12589,7 +12936,7 @@ function ErrorRecoveryCard({
|
|
|
12589
12936
|
}
|
|
12590
12937
|
|
|
12591
12938
|
// src/widget/features/transaction/components/SuccessSummaryCard.tsx
|
|
12592
|
-
import { jsx as
|
|
12939
|
+
import { jsx as jsx46, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
12593
12940
|
function SuccessSummaryCard({
|
|
12594
12941
|
amount,
|
|
12595
12942
|
explorerUrl,
|
|
@@ -12599,7 +12946,7 @@ function SuccessSummaryCard({
|
|
|
12599
12946
|
selectedTokenSymbol,
|
|
12600
12947
|
transactionHash
|
|
12601
12948
|
}) {
|
|
12602
|
-
return /* @__PURE__ */
|
|
12949
|
+
return /* @__PURE__ */ jsxs36(
|
|
12603
12950
|
"div",
|
|
12604
12951
|
{
|
|
12605
12952
|
style: {
|
|
@@ -12613,7 +12960,7 @@ function SuccessSummaryCard({
|
|
|
12613
12960
|
animation: "fade-in 0.3s ease-out"
|
|
12614
12961
|
},
|
|
12615
12962
|
children: [
|
|
12616
|
-
/* @__PURE__ */
|
|
12963
|
+
/* @__PURE__ */ jsxs36(
|
|
12617
12964
|
"div",
|
|
12618
12965
|
{
|
|
12619
12966
|
style: {
|
|
@@ -12623,7 +12970,7 @@ function SuccessSummaryCard({
|
|
|
12623
12970
|
marginBottom: "2rem"
|
|
12624
12971
|
},
|
|
12625
12972
|
children: [
|
|
12626
|
-
/* @__PURE__ */
|
|
12973
|
+
/* @__PURE__ */ jsx46(
|
|
12627
12974
|
"div",
|
|
12628
12975
|
{
|
|
12629
12976
|
style: {
|
|
@@ -12637,7 +12984,7 @@ function SuccessSummaryCard({
|
|
|
12637
12984
|
animation: "scale-in 0.3s ease-out",
|
|
12638
12985
|
marginBottom: "0.75rem"
|
|
12639
12986
|
},
|
|
12640
|
-
children: /* @__PURE__ */
|
|
12987
|
+
children: /* @__PURE__ */ jsx46(
|
|
12641
12988
|
"svg",
|
|
12642
12989
|
{
|
|
12643
12990
|
style: {
|
|
@@ -12650,7 +12997,7 @@ function SuccessSummaryCard({
|
|
|
12650
12997
|
stroke: "currentColor",
|
|
12651
12998
|
strokeWidth: 2.5,
|
|
12652
12999
|
"aria-hidden": "true",
|
|
12653
|
-
children: /* @__PURE__ */
|
|
13000
|
+
children: /* @__PURE__ */ jsx46(
|
|
12654
13001
|
"path",
|
|
12655
13002
|
{
|
|
12656
13003
|
strokeLinecap: "round",
|
|
@@ -12662,7 +13009,7 @@ function SuccessSummaryCard({
|
|
|
12662
13009
|
)
|
|
12663
13010
|
}
|
|
12664
13011
|
),
|
|
12665
|
-
/* @__PURE__ */
|
|
13012
|
+
/* @__PURE__ */ jsx46(
|
|
12666
13013
|
"div",
|
|
12667
13014
|
{
|
|
12668
13015
|
style: {
|
|
@@ -12676,7 +13023,7 @@ function SuccessSummaryCard({
|
|
|
12676
13023
|
]
|
|
12677
13024
|
}
|
|
12678
13025
|
),
|
|
12679
|
-
/* @__PURE__ */
|
|
13026
|
+
/* @__PURE__ */ jsxs36(
|
|
12680
13027
|
"div",
|
|
12681
13028
|
{
|
|
12682
13029
|
style: {
|
|
@@ -12686,7 +13033,7 @@ function SuccessSummaryCard({
|
|
|
12686
13033
|
marginBottom: "2rem"
|
|
12687
13034
|
},
|
|
12688
13035
|
children: [
|
|
12689
|
-
/* @__PURE__ */
|
|
13036
|
+
/* @__PURE__ */ jsxs36(
|
|
12690
13037
|
"div",
|
|
12691
13038
|
{
|
|
12692
13039
|
style: {
|
|
@@ -12703,7 +13050,7 @@ function SuccessSummaryCard({
|
|
|
12703
13050
|
]
|
|
12704
13051
|
}
|
|
12705
13052
|
),
|
|
12706
|
-
selectedTokenIconUrl && selectedTokenSymbol ? /* @__PURE__ */
|
|
13053
|
+
selectedTokenIconUrl && selectedTokenSymbol ? /* @__PURE__ */ jsxs36(
|
|
12707
13054
|
"div",
|
|
12708
13055
|
{
|
|
12709
13056
|
style: {
|
|
@@ -12713,7 +13060,7 @@ function SuccessSummaryCard({
|
|
|
12713
13060
|
marginTop: "0.375rem"
|
|
12714
13061
|
},
|
|
12715
13062
|
children: [
|
|
12716
|
-
/* @__PURE__ */
|
|
13063
|
+
/* @__PURE__ */ jsx46(
|
|
12717
13064
|
"img",
|
|
12718
13065
|
{
|
|
12719
13066
|
src: selectedTokenIconUrl,
|
|
@@ -12725,7 +13072,7 @@ function SuccessSummaryCard({
|
|
|
12725
13072
|
}
|
|
12726
13073
|
}
|
|
12727
13074
|
),
|
|
12728
|
-
/* @__PURE__ */
|
|
13075
|
+
/* @__PURE__ */ jsxs36(
|
|
12729
13076
|
"span",
|
|
12730
13077
|
{
|
|
12731
13078
|
style: {
|
|
@@ -12744,13 +13091,13 @@ function SuccessSummaryCard({
|
|
|
12744
13091
|
]
|
|
12745
13092
|
}
|
|
12746
13093
|
),
|
|
12747
|
-
transactionHash ? /* @__PURE__ */
|
|
13094
|
+
transactionHash ? /* @__PURE__ */ jsx46(
|
|
12748
13095
|
"div",
|
|
12749
13096
|
{
|
|
12750
13097
|
style: {
|
|
12751
13098
|
marginBottom: "2rem"
|
|
12752
13099
|
},
|
|
12753
|
-
children: /* @__PURE__ */
|
|
13100
|
+
children: /* @__PURE__ */ jsx46(
|
|
12754
13101
|
TransactionHashLink,
|
|
12755
13102
|
{
|
|
12756
13103
|
explorerUrl,
|
|
@@ -12760,14 +13107,14 @@ function SuccessSummaryCard({
|
|
|
12760
13107
|
)
|
|
12761
13108
|
}
|
|
12762
13109
|
) : null,
|
|
12763
|
-
/* @__PURE__ */
|
|
13110
|
+
/* @__PURE__ */ jsx46(
|
|
12764
13111
|
"div",
|
|
12765
13112
|
{
|
|
12766
13113
|
style: {
|
|
12767
13114
|
width: "100%",
|
|
12768
13115
|
padding: "1rem"
|
|
12769
13116
|
},
|
|
12770
|
-
children: /* @__PURE__ */
|
|
13117
|
+
children: /* @__PURE__ */ jsx46(
|
|
12771
13118
|
"button",
|
|
12772
13119
|
{
|
|
12773
13120
|
type: "button",
|
|
@@ -12793,8 +13140,9 @@ function SuccessSummaryCard({
|
|
|
12793
13140
|
}
|
|
12794
13141
|
|
|
12795
13142
|
// src/widget/features/transaction/hooks/useTransactionActionModel.ts
|
|
12796
|
-
import { useCallback as
|
|
13143
|
+
import { useCallback as useCallback14, useEffect as useEffect23, useMemo as useMemo17, useRef as useRef11, useState as useState22 } from "react";
|
|
12797
13144
|
import { encodeFunctionData, erc20Abi } from "viem";
|
|
13145
|
+
init_constants();
|
|
12798
13146
|
function normalizeTokenAddressForCompare(chain, addr) {
|
|
12799
13147
|
const chainType = (chain.type ?? chain.chainType ?? "").toLowerCase();
|
|
12800
13148
|
const value = (addr ?? "").trim();
|
|
@@ -12815,12 +13163,20 @@ function useTransactionActionModel({
|
|
|
12815
13163
|
walletAddress,
|
|
12816
13164
|
walletStatus
|
|
12817
13165
|
}) {
|
|
12818
|
-
const feeDataCacheRef =
|
|
13166
|
+
const feeDataCacheRef = useRef11({});
|
|
12819
13167
|
const { isSubmitting, submitTransaction } = useTransactionSubmit();
|
|
13168
|
+
const { trackEvent } = useGTM(GTM_ID);
|
|
13169
|
+
const destinationConfig = (() => {
|
|
13170
|
+
try {
|
|
13171
|
+
return Trustware.getConfig();
|
|
13172
|
+
} catch {
|
|
13173
|
+
return void 0;
|
|
13174
|
+
}
|
|
13175
|
+
})();
|
|
12820
13176
|
const chainType = selectedChain?.type ?? selectedChain?.chainType;
|
|
12821
13177
|
const chainTypeNormalized = (chainType ?? "").toLowerCase();
|
|
12822
13178
|
const isEvm = chainTypeNormalized === "evm";
|
|
12823
|
-
const backendChainId2 =
|
|
13179
|
+
const backendChainId2 = useMemo17(() => {
|
|
12824
13180
|
const chainRef = routeResult?.txReq?.chainId ?? selectedChain?.networkIdentifier ?? selectedChain?.chainId ?? selectedChain?.id;
|
|
12825
13181
|
if (chainRef == null) return null;
|
|
12826
13182
|
return String(chainRef);
|
|
@@ -12830,23 +13186,23 @@ function useTransactionActionModel({
|
|
|
12830
13186
|
selectedChain?.id,
|
|
12831
13187
|
selectedChain?.networkIdentifier
|
|
12832
13188
|
]);
|
|
12833
|
-
const isNativeSelected =
|
|
13189
|
+
const isNativeSelected = useMemo17(() => {
|
|
12834
13190
|
const address = selectedToken?.address;
|
|
12835
13191
|
return isNativeTokenAddress(address, chainType) || isZeroAddrLike(address, chainType) || normalizeTokenAddressForCompare(selectedChain, address) === normalizeTokenAddressForCompare(
|
|
12836
13192
|
selectedChain,
|
|
12837
13193
|
getNativeTokenAddress2(chainType)
|
|
12838
13194
|
);
|
|
12839
13195
|
}, [chainType, selectedChain, selectedToken?.address]);
|
|
12840
|
-
const spender =
|
|
13196
|
+
const spender = useMemo17(() => {
|
|
12841
13197
|
const txReq = routeResult?.txReq;
|
|
12842
13198
|
const addr = txReq?.to ?? txReq?.target;
|
|
12843
13199
|
return addr ?? null;
|
|
12844
13200
|
}, [routeResult?.txReq]);
|
|
12845
|
-
const [allowanceWei, setAllowanceWei] =
|
|
12846
|
-
const [isReadingAllowance, setIsReadingAllowance] =
|
|
12847
|
-
const [isApproving, setIsApproving] =
|
|
12848
|
-
const [gasReservationWei, setGasReservationWei] =
|
|
12849
|
-
const readAllowance =
|
|
13201
|
+
const [allowanceWei, setAllowanceWei] = useState22(0n);
|
|
13202
|
+
const [isReadingAllowance, setIsReadingAllowance] = useState22(false);
|
|
13203
|
+
const [isApproving, setIsApproving] = useState22(false);
|
|
13204
|
+
const [gasReservationWei, setGasReservationWei] = useState22(0n);
|
|
13205
|
+
const readAllowance = useCallback14(async () => {
|
|
12850
13206
|
if (!isEvm || isNativeSelected || !backendChainId2 || !walletAddress || !spender || !selectedToken?.address) {
|
|
12851
13207
|
setAllowanceWei(0n);
|
|
12852
13208
|
return;
|
|
@@ -12873,11 +13229,11 @@ function useTransactionActionModel({
|
|
|
12873
13229
|
spender,
|
|
12874
13230
|
walletAddress
|
|
12875
13231
|
]);
|
|
12876
|
-
|
|
13232
|
+
useEffect23(() => {
|
|
12877
13233
|
void readAllowance();
|
|
12878
13234
|
}, [readAllowance]);
|
|
12879
13235
|
const needsApproval = isEvm && !isNativeSelected && !!walletAddress && !!spender && amountWei > 0n && allowanceWei < amountWei;
|
|
12880
|
-
const waitForApprovalConfirmation =
|
|
13236
|
+
const waitForApprovalConfirmation = useCallback14(
|
|
12881
13237
|
async (chainId, txHash) => {
|
|
12882
13238
|
const timeoutMs = 12e4;
|
|
12883
13239
|
const intervalMs = 2e3;
|
|
@@ -12896,7 +13252,7 @@ function useTransactionActionModel({
|
|
|
12896
13252
|
},
|
|
12897
13253
|
[]
|
|
12898
13254
|
);
|
|
12899
|
-
const handleApproveExact =
|
|
13255
|
+
const handleApproveExact = useCallback14(async () => {
|
|
12900
13256
|
if (isApproving || amountWei <= 0n || !walletAddress || !spender || !selectedToken?.address) {
|
|
12901
13257
|
return;
|
|
12902
13258
|
}
|
|
@@ -12904,6 +13260,13 @@ function useTransactionActionModel({
|
|
|
12904
13260
|
if (!wallet || wallet.ecosystem !== "evm") {
|
|
12905
13261
|
return;
|
|
12906
13262
|
}
|
|
13263
|
+
trackEvent("token_approval_initiated", {
|
|
13264
|
+
from_chain: selectedChain?.networkName ?? selectedChain?.axelarChainName ?? selectedChain?.chainId,
|
|
13265
|
+
from_token: selectedToken?.symbol,
|
|
13266
|
+
to_chain: destinationConfig?.routes.toChain,
|
|
13267
|
+
to_token: destinationConfig?.routes.toToken,
|
|
13268
|
+
domain: window.origin
|
|
13269
|
+
});
|
|
12907
13270
|
setIsApproving(true);
|
|
12908
13271
|
try {
|
|
12909
13272
|
const targetChain = Number(
|
|
@@ -12961,17 +13324,23 @@ function useTransactionActionModel({
|
|
|
12961
13324
|
}, [
|
|
12962
13325
|
amountWei,
|
|
12963
13326
|
backendChainId2,
|
|
13327
|
+
destinationConfig?.routes.toChain,
|
|
13328
|
+
destinationConfig?.routes.toToken,
|
|
12964
13329
|
isApproving,
|
|
12965
13330
|
readAllowance,
|
|
12966
13331
|
routeResult?.txReq?.chainId,
|
|
13332
|
+
selectedChain?.axelarChainName,
|
|
12967
13333
|
selectedChain?.chainId,
|
|
12968
13334
|
selectedChain?.id,
|
|
13335
|
+
selectedChain?.networkName,
|
|
12969
13336
|
selectedToken?.address,
|
|
13337
|
+
selectedToken?.symbol,
|
|
12970
13338
|
spender,
|
|
13339
|
+
trackEvent,
|
|
12971
13340
|
waitForApprovalConfirmation,
|
|
12972
13341
|
walletAddress
|
|
12973
13342
|
]);
|
|
12974
|
-
const getCachedFeeData =
|
|
13343
|
+
const getCachedFeeData = useCallback14(async () => {
|
|
12975
13344
|
if (!backendChainId2) return {};
|
|
12976
13345
|
const now = Date.now();
|
|
12977
13346
|
const cache = feeDataCacheRef.current;
|
|
@@ -12994,7 +13363,7 @@ function useTransactionActionModel({
|
|
|
12994
13363
|
}
|
|
12995
13364
|
return cache.inflight;
|
|
12996
13365
|
}, [backendChainId2]);
|
|
12997
|
-
const estimateGasReservationWei =
|
|
13366
|
+
const estimateGasReservationWei = useCallback14(async () => {
|
|
12998
13367
|
if (!isNativeSelected) {
|
|
12999
13368
|
setGasReservationWei(0n);
|
|
13000
13369
|
return 0n;
|
|
@@ -13058,18 +13427,35 @@ function useTransactionActionModel({
|
|
|
13058
13427
|
routeResult?.txReq,
|
|
13059
13428
|
walletAddress
|
|
13060
13429
|
]);
|
|
13061
|
-
|
|
13430
|
+
useEffect23(() => {
|
|
13062
13431
|
if (routeResult) {
|
|
13063
13432
|
void estimateGasReservationWei();
|
|
13064
13433
|
}
|
|
13065
13434
|
}, [estimateGasReservationWei, routeResult]);
|
|
13066
|
-
const handleConfirm =
|
|
13435
|
+
const handleConfirm = useCallback14(async () => {
|
|
13067
13436
|
if (!routeResult) {
|
|
13068
13437
|
return;
|
|
13069
13438
|
}
|
|
13439
|
+
trackEvent("payment_initiated", {
|
|
13440
|
+
from_chain: selectedChain?.networkName ?? selectedChain?.axelarChainName ?? selectedChain?.chainId,
|
|
13441
|
+
from_token: selectedToken?.symbol,
|
|
13442
|
+
to_chain: destinationConfig?.routes.toChain,
|
|
13443
|
+
to_token: destinationConfig?.routes.toToken,
|
|
13444
|
+
domain: window.origin
|
|
13445
|
+
});
|
|
13070
13446
|
await submitTransaction(routeResult);
|
|
13071
|
-
}, [
|
|
13072
|
-
|
|
13447
|
+
}, [
|
|
13448
|
+
destinationConfig?.routes.toChain,
|
|
13449
|
+
destinationConfig?.routes.toToken,
|
|
13450
|
+
routeResult,
|
|
13451
|
+
selectedChain?.axelarChainName,
|
|
13452
|
+
selectedChain?.chainId,
|
|
13453
|
+
selectedChain?.networkName,
|
|
13454
|
+
selectedToken?.symbol,
|
|
13455
|
+
submitTransaction,
|
|
13456
|
+
trackEvent
|
|
13457
|
+
]);
|
|
13458
|
+
const handleSwipeConfirm = useCallback14(async () => {
|
|
13073
13459
|
if (needsApproval) {
|
|
13074
13460
|
await handleApproveExact();
|
|
13075
13461
|
return;
|
|
@@ -13078,7 +13464,7 @@ function useTransactionActionModel({
|
|
|
13078
13464
|
}, [handleApproveExact, handleConfirm, needsApproval]);
|
|
13079
13465
|
const isWalletConnected = walletStatus === "connected";
|
|
13080
13466
|
const canSwipe = parsedAmount > 0 && !!selectedToken && isWalletConnected && !isLoadingRoute && !isSubmitting && !!routeResult && !actionErrorMessage && !isApproving && !isReadingAllowance;
|
|
13081
|
-
const swipeResetKey =
|
|
13467
|
+
const swipeResetKey = useMemo17(() => {
|
|
13082
13468
|
const tokenAddress = selectedToken ? normalizeAddress2(
|
|
13083
13469
|
selectedToken.address,
|
|
13084
13470
|
selectedToken?.chainData?.type ?? selectedToken?.chainData?.chainType
|
|
@@ -13105,7 +13491,7 @@ function useTransactionActionModel({
|
|
|
13105
13491
|
}
|
|
13106
13492
|
|
|
13107
13493
|
// src/widget/pages/CryptoPay.tsx
|
|
13108
|
-
import { Fragment as Fragment6, jsx as
|
|
13494
|
+
import { Fragment as Fragment6, jsx as jsx47, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
13109
13495
|
var SHOW_FEE_SUMMARY = false;
|
|
13110
13496
|
function CryptoPay({ style: _style }) {
|
|
13111
13497
|
const {
|
|
@@ -13122,12 +13508,12 @@ function CryptoPay({ style: _style }) {
|
|
|
13122
13508
|
const { goBack, setCurrentStep, currentStep } = useDepositNavigation();
|
|
13123
13509
|
const config = useTrustwareConfig();
|
|
13124
13510
|
const { fixedFromAmountString, isFixedAmount, minAmountUsd, maxAmountUsd } = useAmountConstraints();
|
|
13125
|
-
const routeRefreshMs =
|
|
13511
|
+
const routeRefreshMs = useMemo18(() => {
|
|
13126
13512
|
const raw = config.routes?.options?.routeRefreshMs;
|
|
13127
13513
|
const n = Number(raw);
|
|
13128
13514
|
return Number.isFinite(n) && n > 0 ? n : void 0;
|
|
13129
13515
|
}, [config.routes?.options?.routeRefreshMs]);
|
|
13130
|
-
const isReady =
|
|
13516
|
+
const isReady = useMemo18(() => {
|
|
13131
13517
|
if (selectedToken !== null && yourWalletTokens.length > 0 && selectedToken?.chainData !== void 0) {
|
|
13132
13518
|
return true;
|
|
13133
13519
|
}
|
|
@@ -13202,7 +13588,7 @@ function CryptoPay({ style: _style }) {
|
|
|
13202
13588
|
});
|
|
13203
13589
|
const { emitError } = useTrustware();
|
|
13204
13590
|
const readySelectedToken = isReady ? selectedToken : null;
|
|
13205
|
-
|
|
13591
|
+
useEffect24(() => {
|
|
13206
13592
|
if (currentStep !== "crypto-pay" || !actionErrorMessage) return;
|
|
13207
13593
|
emitError?.(
|
|
13208
13594
|
new TrustwareError({
|
|
@@ -13234,7 +13620,7 @@ function CryptoPay({ style: _style }) {
|
|
|
13234
13620
|
const handleExpandTokens = () => {
|
|
13235
13621
|
setCurrentStep("select-token");
|
|
13236
13622
|
};
|
|
13237
|
-
return /* @__PURE__ */
|
|
13623
|
+
return /* @__PURE__ */ jsxs37(
|
|
13238
13624
|
"div",
|
|
13239
13625
|
{
|
|
13240
13626
|
style: {
|
|
@@ -13243,9 +13629,9 @@ function CryptoPay({ style: _style }) {
|
|
|
13243
13629
|
minHeight: "500px"
|
|
13244
13630
|
},
|
|
13245
13631
|
children: [
|
|
13246
|
-
/* @__PURE__ */
|
|
13247
|
-
isReady ? /* @__PURE__ */
|
|
13248
|
-
/* @__PURE__ */
|
|
13632
|
+
/* @__PURE__ */ jsx47(WidgetPageHeader, { onBack: goBack, title: "Confirm Deposit" }),
|
|
13633
|
+
isReady ? /* @__PURE__ */ jsxs37(Fragment6, { children: [
|
|
13634
|
+
/* @__PURE__ */ jsx47(
|
|
13249
13635
|
CryptoPayAmountSection,
|
|
13250
13636
|
{
|
|
13251
13637
|
amount,
|
|
@@ -13274,7 +13660,7 @@ function CryptoPay({ style: _style }) {
|
|
|
13274
13660
|
yourWalletTokensLength: yourWalletTokens.length
|
|
13275
13661
|
}
|
|
13276
13662
|
),
|
|
13277
|
-
/* @__PURE__ */
|
|
13663
|
+
/* @__PURE__ */ jsx47(
|
|
13278
13664
|
CryptoPaySwipeSection,
|
|
13279
13665
|
{
|
|
13280
13666
|
actionErrorMessage,
|
|
@@ -13291,8 +13677,8 @@ function CryptoPay({ style: _style }) {
|
|
|
13291
13677
|
swipeResetKey
|
|
13292
13678
|
}
|
|
13293
13679
|
),
|
|
13294
|
-
/* @__PURE__ */
|
|
13295
|
-
] }) : /* @__PURE__ */
|
|
13680
|
+
/* @__PURE__ */ jsx47(WidgetSecurityFooter, {})
|
|
13681
|
+
] }) : /* @__PURE__ */ jsx47(
|
|
13296
13682
|
"div",
|
|
13297
13683
|
{
|
|
13298
13684
|
style: {
|
|
@@ -13301,7 +13687,7 @@ function CryptoPay({ style: _style }) {
|
|
|
13301
13687
|
alignItems: "center",
|
|
13302
13688
|
justifyContent: "center"
|
|
13303
13689
|
},
|
|
13304
|
-
children: /* @__PURE__ */
|
|
13690
|
+
children: /* @__PURE__ */ jsx47(LoadingSkeleton, {})
|
|
13305
13691
|
}
|
|
13306
13692
|
)
|
|
13307
13693
|
]
|
|
@@ -13310,8 +13696,8 @@ function CryptoPay({ style: _style }) {
|
|
|
13310
13696
|
}
|
|
13311
13697
|
|
|
13312
13698
|
// src/widget/pages/Processing.tsx
|
|
13313
|
-
import { useEffect as
|
|
13314
|
-
import { jsx as
|
|
13699
|
+
import { useEffect as useEffect25, useMemo as useMemo19, useRef as useRef12 } from "react";
|
|
13700
|
+
import { jsx as jsx48, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
13315
13701
|
function getProgressFromStatus(status) {
|
|
13316
13702
|
switch (status) {
|
|
13317
13703
|
case "confirming":
|
|
@@ -13349,27 +13735,27 @@ function Processing({ style }) {
|
|
|
13349
13735
|
const { resetState, setCurrentStep } = useDepositNavigation();
|
|
13350
13736
|
const { transactionStatus, transactionHash, intentId } = useDepositTransaction();
|
|
13351
13737
|
const { transaction, startPolling, isPolling } = useTransactionPolling();
|
|
13352
|
-
const hasStartedPolling =
|
|
13353
|
-
|
|
13738
|
+
const hasStartedPolling = useRef12(false);
|
|
13739
|
+
useEffect25(() => {
|
|
13354
13740
|
return () => {
|
|
13355
13741
|
hasStartedPolling.current = false;
|
|
13356
13742
|
};
|
|
13357
13743
|
}, []);
|
|
13358
|
-
|
|
13744
|
+
useEffect25(() => {
|
|
13359
13745
|
if (intentId && transactionHash && !isPolling && !hasStartedPolling.current && transactionStatus !== "success" && transactionStatus !== "error") {
|
|
13360
13746
|
hasStartedPolling.current = true;
|
|
13361
13747
|
startPolling(intentId, transactionHash);
|
|
13362
13748
|
}
|
|
13363
13749
|
}, [intentId, transactionHash, isPolling, transactionStatus, startPolling]);
|
|
13364
|
-
const progress =
|
|
13750
|
+
const progress = useMemo19(
|
|
13365
13751
|
() => getProgressFromStatus(transactionStatus),
|
|
13366
13752
|
[transactionStatus]
|
|
13367
13753
|
);
|
|
13368
|
-
const stepText =
|
|
13754
|
+
const stepText = useMemo19(
|
|
13369
13755
|
() => getStepText(transactionStatus),
|
|
13370
13756
|
[transactionStatus]
|
|
13371
13757
|
);
|
|
13372
|
-
const explorerUrl =
|
|
13758
|
+
const explorerUrl = useMemo19(() => {
|
|
13373
13759
|
if (transaction?.fromChainTxUrl) {
|
|
13374
13760
|
return transaction.fromChainTxUrl;
|
|
13375
13761
|
}
|
|
@@ -13387,7 +13773,7 @@ function Processing({ style }) {
|
|
|
13387
13773
|
};
|
|
13388
13774
|
const isIndeterminate = transactionStatus === "confirming" || transactionStatus === "idle";
|
|
13389
13775
|
const headerTitle = transactionStatus === "success" ? "Complete" : transactionStatus === "error" ? "Failed" : "Processing";
|
|
13390
|
-
return /* @__PURE__ */
|
|
13776
|
+
return /* @__PURE__ */ jsxs38(
|
|
13391
13777
|
"div",
|
|
13392
13778
|
{
|
|
13393
13779
|
style: {
|
|
@@ -13397,8 +13783,8 @@ function Processing({ style }) {
|
|
|
13397
13783
|
...style
|
|
13398
13784
|
},
|
|
13399
13785
|
children: [
|
|
13400
|
-
/* @__PURE__ */
|
|
13401
|
-
/* @__PURE__ */
|
|
13786
|
+
/* @__PURE__ */ jsx48(WidgetPageHeader, { onClose: handleClose, title: headerTitle }),
|
|
13787
|
+
/* @__PURE__ */ jsxs38(
|
|
13402
13788
|
"div",
|
|
13403
13789
|
{
|
|
13404
13790
|
style: {
|
|
@@ -13410,13 +13796,13 @@ function Processing({ style }) {
|
|
|
13410
13796
|
padding: `${spacing[8]} ${spacing[6]}`
|
|
13411
13797
|
},
|
|
13412
13798
|
children: [
|
|
13413
|
-
/* @__PURE__ */
|
|
13799
|
+
/* @__PURE__ */ jsx48(
|
|
13414
13800
|
"div",
|
|
13415
13801
|
{
|
|
13416
13802
|
style: {
|
|
13417
13803
|
marginBottom: spacing[6]
|
|
13418
13804
|
},
|
|
13419
|
-
children: /* @__PURE__ */
|
|
13805
|
+
children: /* @__PURE__ */ jsx48(
|
|
13420
13806
|
CircularProgress,
|
|
13421
13807
|
{
|
|
13422
13808
|
progress,
|
|
@@ -13428,7 +13814,7 @@ function Processing({ style }) {
|
|
|
13428
13814
|
)
|
|
13429
13815
|
}
|
|
13430
13816
|
),
|
|
13431
|
-
/* @__PURE__ */
|
|
13817
|
+
/* @__PURE__ */ jsx48(
|
|
13432
13818
|
"p",
|
|
13433
13819
|
{
|
|
13434
13820
|
style: {
|
|
@@ -13441,7 +13827,7 @@ function Processing({ style }) {
|
|
|
13441
13827
|
children: stepText
|
|
13442
13828
|
}
|
|
13443
13829
|
),
|
|
13444
|
-
selectedToken && parsedAmount > 0 && /* @__PURE__ */
|
|
13830
|
+
selectedToken && parsedAmount > 0 && /* @__PURE__ */ jsxs38(
|
|
13445
13831
|
"p",
|
|
13446
13832
|
{
|
|
13447
13833
|
style: {
|
|
@@ -13458,7 +13844,7 @@ function Processing({ style }) {
|
|
|
13458
13844
|
]
|
|
13459
13845
|
}
|
|
13460
13846
|
),
|
|
13461
|
-
/* @__PURE__ */
|
|
13847
|
+
/* @__PURE__ */ jsx48(
|
|
13462
13848
|
TransactionSteps,
|
|
13463
13849
|
{
|
|
13464
13850
|
transactionStatus,
|
|
@@ -13469,7 +13855,7 @@ function Processing({ style }) {
|
|
|
13469
13855
|
}
|
|
13470
13856
|
}
|
|
13471
13857
|
),
|
|
13472
|
-
transactionHash ? /* @__PURE__ */
|
|
13858
|
+
transactionHash ? /* @__PURE__ */ jsx48(
|
|
13473
13859
|
TransactionHashLink,
|
|
13474
13860
|
{
|
|
13475
13861
|
explorerUrl,
|
|
@@ -13477,7 +13863,7 @@ function Processing({ style }) {
|
|
|
13477
13863
|
label: "Transaction"
|
|
13478
13864
|
}
|
|
13479
13865
|
) : null,
|
|
13480
|
-
transactionStatus === "error" && /* @__PURE__ */
|
|
13866
|
+
transactionStatus === "error" && /* @__PURE__ */ jsx48(
|
|
13481
13867
|
"button",
|
|
13482
13868
|
{
|
|
13483
13869
|
type: "button",
|
|
@@ -13499,23 +13885,23 @@ function Processing({ style }) {
|
|
|
13499
13885
|
]
|
|
13500
13886
|
}
|
|
13501
13887
|
),
|
|
13502
|
-
/* @__PURE__ */
|
|
13888
|
+
/* @__PURE__ */ jsx48(WidgetSecurityFooter, {})
|
|
13503
13889
|
]
|
|
13504
13890
|
}
|
|
13505
13891
|
);
|
|
13506
13892
|
}
|
|
13507
13893
|
|
|
13508
13894
|
// src/widget/pages/Success.tsx
|
|
13509
|
-
import { lazy, Suspense, useMemo as
|
|
13510
|
-
import { jsx as
|
|
13895
|
+
import { lazy, Suspense, useMemo as useMemo20 } from "react";
|
|
13896
|
+
import { jsx as jsx49, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
13511
13897
|
var ConfettiEffect2 = lazy(() => Promise.resolve().then(() => (init_ConfettiEffect(), ConfettiEffect_exports)));
|
|
13512
13898
|
function Success({ style }) {
|
|
13513
13899
|
const { selectedToken, selectedChain, amount } = useDepositForm();
|
|
13514
13900
|
const { resetState } = useDepositNavigation();
|
|
13515
13901
|
const { transactionHash } = useDepositTransaction();
|
|
13516
13902
|
const { transaction } = useTransactionPolling();
|
|
13517
|
-
const parsedAmount =
|
|
13518
|
-
const explorerUrl =
|
|
13903
|
+
const parsedAmount = useMemo20(() => parseFloat(amount) || 0, [amount]);
|
|
13904
|
+
const explorerUrl = useMemo20(() => {
|
|
13519
13905
|
if (transaction?.toChainTxUrl) {
|
|
13520
13906
|
return transaction.toChainTxUrl;
|
|
13521
13907
|
}
|
|
@@ -13530,7 +13916,7 @@ function Success({ style }) {
|
|
|
13530
13916
|
const handleDone = () => {
|
|
13531
13917
|
resetState();
|
|
13532
13918
|
};
|
|
13533
|
-
return /* @__PURE__ */
|
|
13919
|
+
return /* @__PURE__ */ jsxs39(
|
|
13534
13920
|
"div",
|
|
13535
13921
|
{
|
|
13536
13922
|
style: {
|
|
@@ -13543,9 +13929,9 @@ function Success({ style }) {
|
|
|
13543
13929
|
...style
|
|
13544
13930
|
},
|
|
13545
13931
|
children: [
|
|
13546
|
-
/* @__PURE__ */
|
|
13547
|
-
/* @__PURE__ */
|
|
13548
|
-
/* @__PURE__ */
|
|
13932
|
+
/* @__PURE__ */ jsx49(Suspense, { fallback: null, children: /* @__PURE__ */ jsx49(ConfettiEffect2, { isActive: true, pieceCount: 60, clearDelay: 4e3 }) }),
|
|
13933
|
+
/* @__PURE__ */ jsx49(WidgetPageHeader, { title: "Deposit Complete" }),
|
|
13934
|
+
/* @__PURE__ */ jsx49(
|
|
13549
13935
|
"div",
|
|
13550
13936
|
{
|
|
13551
13937
|
style: {
|
|
@@ -13557,7 +13943,7 @@ function Success({ style }) {
|
|
|
13557
13943
|
flexDirection: "column",
|
|
13558
13944
|
alignItems: "center"
|
|
13559
13945
|
},
|
|
13560
|
-
children: /* @__PURE__ */
|
|
13946
|
+
children: /* @__PURE__ */ jsx49(
|
|
13561
13947
|
SuccessSummaryCard,
|
|
13562
13948
|
{
|
|
13563
13949
|
amount: parsedAmount,
|
|
@@ -13571,16 +13957,16 @@ function Success({ style }) {
|
|
|
13571
13957
|
)
|
|
13572
13958
|
}
|
|
13573
13959
|
),
|
|
13574
|
-
/* @__PURE__ */
|
|
13960
|
+
/* @__PURE__ */ jsx49(WidgetSecurityFooter, {})
|
|
13575
13961
|
]
|
|
13576
13962
|
}
|
|
13577
13963
|
);
|
|
13578
13964
|
}
|
|
13579
13965
|
|
|
13580
13966
|
// src/widget/pages/Error.tsx
|
|
13581
|
-
import { useMemo as
|
|
13967
|
+
import { useMemo as useMemo21, useEffect as useEffect26 } from "react";
|
|
13582
13968
|
init_store();
|
|
13583
|
-
import { jsx as
|
|
13969
|
+
import { jsx as jsx50, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
13584
13970
|
function categorizeError(errorMessage) {
|
|
13585
13971
|
if (!errorMessage) return "unknown";
|
|
13586
13972
|
const msg = errorMessage.toLowerCase();
|
|
@@ -13667,20 +14053,20 @@ function Error2({ style }) {
|
|
|
13667
14053
|
setErrorMessage,
|
|
13668
14054
|
transactionHash
|
|
13669
14055
|
} = useDepositTransaction();
|
|
13670
|
-
const errorCategory =
|
|
14056
|
+
const errorCategory = useMemo21(
|
|
13671
14057
|
() => categorizeError(errorMessage),
|
|
13672
14058
|
[errorMessage]
|
|
13673
14059
|
);
|
|
13674
|
-
const errorTitle =
|
|
14060
|
+
const errorTitle = useMemo21(
|
|
13675
14061
|
() => getErrorTitle(errorCategory),
|
|
13676
14062
|
[errorCategory]
|
|
13677
14063
|
);
|
|
13678
|
-
const errorSuggestion =
|
|
14064
|
+
const errorSuggestion = useMemo21(
|
|
13679
14065
|
() => getErrorSuggestion(errorCategory),
|
|
13680
14066
|
[errorCategory]
|
|
13681
14067
|
);
|
|
13682
|
-
const retryStep =
|
|
13683
|
-
|
|
14068
|
+
const retryStep = useMemo21(() => getRetryStep(errorCategory), [errorCategory]);
|
|
14069
|
+
useEffect26(() => {
|
|
13684
14070
|
if (errorMessage) {
|
|
13685
14071
|
try {
|
|
13686
14072
|
const config = TrustwareConfigStore.get();
|
|
@@ -13702,7 +14088,7 @@ function Error2({ style }) {
|
|
|
13702
14088
|
const handleStartOver = () => {
|
|
13703
14089
|
resetState();
|
|
13704
14090
|
};
|
|
13705
|
-
const explorerUrl =
|
|
14091
|
+
const explorerUrl = useMemo21(() => {
|
|
13706
14092
|
if (transactionHash && selectedChain?.blockExplorerUrls?.length) {
|
|
13707
14093
|
return `${selectedChain.blockExplorerUrls[0].replace(/\/+$/, "")}/tx/${transactionHash}`;
|
|
13708
14094
|
}
|
|
@@ -13710,7 +14096,7 @@ function Error2({ style }) {
|
|
|
13710
14096
|
}, [transactionHash, selectedChain]);
|
|
13711
14097
|
const renderErrorIcon = () => {
|
|
13712
14098
|
if (errorCategory === "wallet_rejected") {
|
|
13713
|
-
return /* @__PURE__ */
|
|
14099
|
+
return /* @__PURE__ */ jsx50(
|
|
13714
14100
|
"svg",
|
|
13715
14101
|
{
|
|
13716
14102
|
style: {
|
|
@@ -13723,7 +14109,7 @@ function Error2({ style }) {
|
|
|
13723
14109
|
stroke: "currentColor",
|
|
13724
14110
|
strokeWidth: 2.5,
|
|
13725
14111
|
"aria-hidden": "true",
|
|
13726
|
-
children: /* @__PURE__ */
|
|
14112
|
+
children: /* @__PURE__ */ jsx50(
|
|
13727
14113
|
"path",
|
|
13728
14114
|
{
|
|
13729
14115
|
strokeLinecap: "round",
|
|
@@ -13735,7 +14121,7 @@ function Error2({ style }) {
|
|
|
13735
14121
|
);
|
|
13736
14122
|
}
|
|
13737
14123
|
if (errorCategory === "network_error") {
|
|
13738
|
-
return /* @__PURE__ */
|
|
14124
|
+
return /* @__PURE__ */ jsx50(
|
|
13739
14125
|
"svg",
|
|
13740
14126
|
{
|
|
13741
14127
|
style: {
|
|
@@ -13748,7 +14134,7 @@ function Error2({ style }) {
|
|
|
13748
14134
|
stroke: "currentColor",
|
|
13749
14135
|
strokeWidth: 2,
|
|
13750
14136
|
"aria-hidden": "true",
|
|
13751
|
-
children: /* @__PURE__ */
|
|
14137
|
+
children: /* @__PURE__ */ jsx50(
|
|
13752
14138
|
"path",
|
|
13753
14139
|
{
|
|
13754
14140
|
strokeLinecap: "round",
|
|
@@ -13759,7 +14145,7 @@ function Error2({ style }) {
|
|
|
13759
14145
|
}
|
|
13760
14146
|
);
|
|
13761
14147
|
}
|
|
13762
|
-
return /* @__PURE__ */
|
|
14148
|
+
return /* @__PURE__ */ jsx50(
|
|
13763
14149
|
"svg",
|
|
13764
14150
|
{
|
|
13765
14151
|
style: {
|
|
@@ -13772,7 +14158,7 @@ function Error2({ style }) {
|
|
|
13772
14158
|
stroke: "currentColor",
|
|
13773
14159
|
strokeWidth: 2,
|
|
13774
14160
|
"aria-hidden": "true",
|
|
13775
|
-
children: /* @__PURE__ */
|
|
14161
|
+
children: /* @__PURE__ */ jsx50(
|
|
13776
14162
|
"path",
|
|
13777
14163
|
{
|
|
13778
14164
|
strokeLinecap: "round",
|
|
@@ -13783,7 +14169,7 @@ function Error2({ style }) {
|
|
|
13783
14169
|
}
|
|
13784
14170
|
);
|
|
13785
14171
|
};
|
|
13786
|
-
return /* @__PURE__ */
|
|
14172
|
+
return /* @__PURE__ */ jsxs40(
|
|
13787
14173
|
"div",
|
|
13788
14174
|
{
|
|
13789
14175
|
style: {
|
|
@@ -13793,8 +14179,8 @@ function Error2({ style }) {
|
|
|
13793
14179
|
...style
|
|
13794
14180
|
},
|
|
13795
14181
|
children: [
|
|
13796
|
-
/* @__PURE__ */
|
|
13797
|
-
/* @__PURE__ */
|
|
14182
|
+
/* @__PURE__ */ jsx50(WidgetPageHeader, { title: errorTitle }),
|
|
14183
|
+
/* @__PURE__ */ jsx50(
|
|
13798
14184
|
ErrorRecoveryCard,
|
|
13799
14185
|
{
|
|
13800
14186
|
errorMessage,
|
|
@@ -13807,7 +14193,7 @@ function Error2({ style }) {
|
|
|
13807
14193
|
transactionHash
|
|
13808
14194
|
}
|
|
13809
14195
|
),
|
|
13810
|
-
/* @__PURE__ */
|
|
14196
|
+
/* @__PURE__ */ jsx50(WidgetSecurityFooter, {})
|
|
13811
14197
|
]
|
|
13812
14198
|
}
|
|
13813
14199
|
);
|
|
@@ -13829,7 +14215,7 @@ var ACTIVE_TRANSACTION_STATUSES = [
|
|
|
13829
14215
|
];
|
|
13830
14216
|
|
|
13831
14217
|
// src/widget/app/WidgetRouter.tsx
|
|
13832
|
-
import { jsx as
|
|
14218
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
13833
14219
|
var pageContainerBaseStyle = {
|
|
13834
14220
|
width: "100%",
|
|
13835
14221
|
height: "100%",
|
|
@@ -13840,26 +14226,26 @@ function WidgetRouter({
|
|
|
13840
14226
|
navigationDirection,
|
|
13841
14227
|
stepHistory
|
|
13842
14228
|
}) {
|
|
13843
|
-
const PageComponent =
|
|
14229
|
+
const PageComponent = useMemo22(
|
|
13844
14230
|
() => PAGE_COMPONENTS[currentStep],
|
|
13845
14231
|
[currentStep]
|
|
13846
14232
|
);
|
|
13847
|
-
const animationClass =
|
|
14233
|
+
const animationClass = useMemo22(() => {
|
|
13848
14234
|
return navigationDirection === "forward" ? "tw-animate-slide-in-right" : "tw-animate-slide-in-left";
|
|
13849
14235
|
}, [navigationDirection]);
|
|
13850
|
-
return /* @__PURE__ */
|
|
14236
|
+
return /* @__PURE__ */ jsx51(
|
|
13851
14237
|
"div",
|
|
13852
14238
|
{
|
|
13853
14239
|
className: animationClass,
|
|
13854
14240
|
style: mergeStyles(pageContainerBaseStyle),
|
|
13855
|
-
children: /* @__PURE__ */
|
|
14241
|
+
children: /* @__PURE__ */ jsx51(PageComponent, {})
|
|
13856
14242
|
},
|
|
13857
14243
|
`${currentStep}-${stepHistory.length}`
|
|
13858
14244
|
);
|
|
13859
14245
|
}
|
|
13860
14246
|
|
|
13861
14247
|
// src/widget/TrustwareWidgetV2.tsx
|
|
13862
|
-
import { Fragment as Fragment7, jsx as
|
|
14248
|
+
import { Fragment as Fragment7, jsx as jsx52, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
13863
14249
|
var widgetContentContainerStyle = {
|
|
13864
14250
|
position: "relative",
|
|
13865
14251
|
width: "100%",
|
|
@@ -13881,7 +14267,7 @@ function WidgetContent({
|
|
|
13881
14267
|
const { amount, selectedChain, selectedToken } = useDepositForm();
|
|
13882
14268
|
const { transactionHash, transactionStatus } = useDepositTransaction();
|
|
13883
14269
|
const { resolvedTheme, toggleTheme } = useDepositUi();
|
|
13884
|
-
|
|
14270
|
+
useEffect27(() => {
|
|
13885
14271
|
const state = {
|
|
13886
14272
|
currentStep,
|
|
13887
14273
|
amount,
|
|
@@ -13901,9 +14287,9 @@ function WidgetContent({
|
|
|
13901
14287
|
transactionStatus,
|
|
13902
14288
|
onStateChange
|
|
13903
14289
|
]);
|
|
13904
|
-
return /* @__PURE__ */
|
|
13905
|
-
showThemeToggle && /* @__PURE__ */
|
|
13906
|
-
/* @__PURE__ */
|
|
14290
|
+
return /* @__PURE__ */ jsxs41("div", { style: mergeStyles(widgetContentContainerStyle, style), children: [
|
|
14291
|
+
showThemeToggle && /* @__PURE__ */ jsx52("div", { style: themeToggleContainerStyle, children: /* @__PURE__ */ jsx52(ThemeToggle, { theme: resolvedTheme, onToggle: toggleTheme }) }),
|
|
14292
|
+
/* @__PURE__ */ jsx52(
|
|
13907
14293
|
WidgetRouter,
|
|
13908
14294
|
{
|
|
13909
14295
|
currentStep,
|
|
@@ -13924,8 +14310,8 @@ function WidgetInner({
|
|
|
13924
14310
|
const { transactionStatus } = useDepositTransaction();
|
|
13925
14311
|
const { resolvedTheme } = useDepositUi();
|
|
13926
14312
|
const { status, revalidate } = useTrustware();
|
|
13927
|
-
const [showConfirmDialog, setShowConfirmDialog] =
|
|
13928
|
-
const handleCloseRequest =
|
|
14313
|
+
const [showConfirmDialog, setShowConfirmDialog] = useState23(false);
|
|
14314
|
+
const handleCloseRequest = useCallback15(() => {
|
|
13929
14315
|
if (ACTIVE_TRANSACTION_STATUSES.includes(transactionStatus)) {
|
|
13930
14316
|
setShowConfirmDialog(true);
|
|
13931
14317
|
} else {
|
|
@@ -13936,32 +14322,32 @@ function WidgetInner({
|
|
|
13936
14322
|
onClose?.();
|
|
13937
14323
|
}
|
|
13938
14324
|
}, [transactionStatus, onClose, resetState]);
|
|
13939
|
-
|
|
14325
|
+
useEffect27(() => {
|
|
13940
14326
|
closeRequestRef.current = handleCloseRequest;
|
|
13941
14327
|
}, [handleCloseRequest, closeRequestRef]);
|
|
13942
|
-
const handleConfirmClose =
|
|
14328
|
+
const handleConfirmClose = useCallback15(() => {
|
|
13943
14329
|
setShowConfirmDialog(false);
|
|
13944
14330
|
onClose?.();
|
|
13945
14331
|
}, [onClose]);
|
|
13946
|
-
const handleCancelClose =
|
|
14332
|
+
const handleCancelClose = useCallback15(() => {
|
|
13947
14333
|
setShowConfirmDialog(false);
|
|
13948
14334
|
}, []);
|
|
13949
14335
|
const effectiveTheme = resolvedTheme;
|
|
13950
14336
|
const isRefreshing = status === "initializing";
|
|
13951
14337
|
const initBlocked = status === "error";
|
|
13952
|
-
const handleRefresh =
|
|
14338
|
+
const handleRefresh = useCallback15(() => {
|
|
13953
14339
|
revalidate?.();
|
|
13954
14340
|
}, [revalidate]);
|
|
13955
|
-
return /* @__PURE__ */
|
|
13956
|
-
/* @__PURE__ */
|
|
13957
|
-
/* @__PURE__ */
|
|
14341
|
+
return /* @__PURE__ */ jsxs41(Fragment7, { children: [
|
|
14342
|
+
/* @__PURE__ */ jsxs41(WidgetContainer, { theme: effectiveTheme, style, children: [
|
|
14343
|
+
/* @__PURE__ */ jsx52(
|
|
13958
14344
|
WidgetContent,
|
|
13959
14345
|
{
|
|
13960
14346
|
onStateChange,
|
|
13961
14347
|
showThemeToggle
|
|
13962
14348
|
}
|
|
13963
14349
|
),
|
|
13964
|
-
/* @__PURE__ */
|
|
14350
|
+
/* @__PURE__ */ jsx52(
|
|
13965
14351
|
InitErrorOverlay,
|
|
13966
14352
|
{
|
|
13967
14353
|
open: initBlocked,
|
|
@@ -13971,7 +14357,7 @@ function WidgetInner({
|
|
|
13971
14357
|
}
|
|
13972
14358
|
)
|
|
13973
14359
|
] }),
|
|
13974
|
-
/* @__PURE__ */
|
|
14360
|
+
/* @__PURE__ */ jsx52(
|
|
13975
14361
|
ConfirmCloseDialog,
|
|
13976
14362
|
{
|
|
13977
14363
|
open: showConfirmDialog,
|
|
@@ -13991,14 +14377,14 @@ var TrustwareWidgetV2 = forwardRef(function TrustwareWidgetV22({
|
|
|
13991
14377
|
onOpen,
|
|
13992
14378
|
showThemeToggle = true
|
|
13993
14379
|
}, ref) {
|
|
13994
|
-
const [isOpen, setIsOpen] =
|
|
13995
|
-
const closeRequestRef =
|
|
14380
|
+
const [isOpen, setIsOpen] = useState23(defaultOpen);
|
|
14381
|
+
const closeRequestRef = useRef13(null);
|
|
13996
14382
|
const effectiveInitialStep = initialStep;
|
|
13997
|
-
const open =
|
|
14383
|
+
const open = useCallback15(() => {
|
|
13998
14384
|
setIsOpen(true);
|
|
13999
14385
|
onOpen?.();
|
|
14000
14386
|
}, [onOpen]);
|
|
14001
|
-
const close =
|
|
14387
|
+
const close = useCallback15(() => {
|
|
14002
14388
|
if (closeRequestRef.current) {
|
|
14003
14389
|
closeRequestRef.current();
|
|
14004
14390
|
} else {
|
|
@@ -14006,7 +14392,7 @@ var TrustwareWidgetV2 = forwardRef(function TrustwareWidgetV22({
|
|
|
14006
14392
|
onClose?.();
|
|
14007
14393
|
}
|
|
14008
14394
|
}, [onClose]);
|
|
14009
|
-
const handleClose =
|
|
14395
|
+
const handleClose = useCallback15(() => {
|
|
14010
14396
|
setIsOpen(false);
|
|
14011
14397
|
onClose?.();
|
|
14012
14398
|
}, [onClose]);
|
|
@@ -14022,7 +14408,7 @@ var TrustwareWidgetV2 = forwardRef(function TrustwareWidgetV22({
|
|
|
14022
14408
|
if (!isOpen) {
|
|
14023
14409
|
return null;
|
|
14024
14410
|
}
|
|
14025
|
-
return /* @__PURE__ */
|
|
14411
|
+
return /* @__PURE__ */ jsx52(DepositProvider, { initialStep: effectiveInitialStep, children: /* @__PURE__ */ jsx52(
|
|
14026
14412
|
WidgetInner,
|
|
14027
14413
|
{
|
|
14028
14414
|
theme,
|