@trustware/sdk-staging 1.1.3-staging.32 → 1.1.4-staging.34
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 +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/{core-DIWJpcYO.d.cts → core-DMGD8t0k.d.cts} +1 -1
- package/dist/{core-DtweriN4.d.ts → core-Dioy8MFJ.d.ts} +1 -1
- package/dist/core.cjs +27 -10
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.mjs +27 -10
- package/dist/core.mjs.map +1 -1
- package/dist/{detect-DxT7Xlae.d.cts → detect-BGnIuj2P.d.cts} +2 -1
- package/dist/{detect-BS03Cycm.d.ts → detect-DSka5hlR.d.ts} +2 -1
- package/dist/index.cjs +384 -136
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.mjs +385 -137
- package/dist/index.mjs.map +1 -1
- package/dist/{manager-BPgytsNL.d.cts → manager-D3wU_WjU.d.cts} +8 -2
- package/dist/{manager-BPgytsNL.d.ts → manager-D3wU_WjU.d.ts} +8 -2
- package/dist/wallet.cjs +27 -10
- package/dist/wallet.cjs.map +1 -1
- package/dist/wallet.d.cts +3 -3
- package/dist/wallet.d.ts +3 -3
- package/dist/wallet.mjs +27 -10
- package/dist/wallet.mjs.map +1 -1
- package/dist/widget.cjs +384 -136
- package/dist/widget.cjs.map +1 -1
- package/dist/widget.mjs +385 -137
- package/dist/widget.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -81,7 +81,7 @@ var init_constants = __esm({
|
|
|
81
81
|
"src/constants.ts"() {
|
|
82
82
|
"use strict";
|
|
83
83
|
SDK_NAME = "@trustware/sdk";
|
|
84
|
-
SDK_VERSION = "1.1.
|
|
84
|
+
SDK_VERSION = "1.1.4-staging.34";
|
|
85
85
|
API_ROOT = "https://bv-staging-api.trustware.io";
|
|
86
86
|
GTM_ID = "GTM-TZDGNCXB";
|
|
87
87
|
API_PREFIX = "/api";
|
|
@@ -1376,9 +1376,18 @@ async function connectDetectedWallet(dw, opts) {
|
|
|
1376
1376
|
throw new Error("WalletConnect connection failed. Please try again.");
|
|
1377
1377
|
}
|
|
1378
1378
|
if (dw.via === "solana-window" || dw.meta.ecosystem === "solana") {
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1379
|
+
try {
|
|
1380
|
+
const provider = dw.provider;
|
|
1381
|
+
await provider.connect();
|
|
1382
|
+
return {
|
|
1383
|
+
via: "eip1193",
|
|
1384
|
+
api: toWalletInterfaceFromDetected(dw),
|
|
1385
|
+
error: null
|
|
1386
|
+
};
|
|
1387
|
+
} catch (err) {
|
|
1388
|
+
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
1389
|
+
return { via: "eip1193", api: null, error: errorMsg };
|
|
1390
|
+
}
|
|
1382
1391
|
}
|
|
1383
1392
|
if (wagmi) {
|
|
1384
1393
|
const conn = pickWagmiConnector(
|
|
@@ -1389,12 +1398,12 @@ async function connectDetectedWallet(dw, opts) {
|
|
|
1389
1398
|
);
|
|
1390
1399
|
if (conn) {
|
|
1391
1400
|
await wagmi.connect(conn);
|
|
1392
|
-
return { via: "wagmi", api: null };
|
|
1401
|
+
return { via: "wagmi", api: null, error: null };
|
|
1393
1402
|
}
|
|
1394
1403
|
}
|
|
1395
1404
|
const api = toWalletInterfaceFromDetected(dw);
|
|
1396
1405
|
if (touchAddress) await api.getAddress();
|
|
1397
|
-
return { via: "eip1193", api };
|
|
1406
|
+
return { via: "eip1193", api, error: null };
|
|
1398
1407
|
}
|
|
1399
1408
|
|
|
1400
1409
|
// src/wallets/detect.ts
|
|
@@ -2917,6 +2926,7 @@ var WalletManager = class {
|
|
|
2917
2926
|
this._wallet = null;
|
|
2918
2927
|
this._detected = [];
|
|
2919
2928
|
this._listeners = /* @__PURE__ */ new Set();
|
|
2929
|
+
this._error = null;
|
|
2920
2930
|
this._identity = new IdentityStore();
|
|
2921
2931
|
this._providerCleanup = null;
|
|
2922
2932
|
this._connectedWalletId = null;
|
|
@@ -2971,18 +2981,25 @@ var WalletManager = class {
|
|
|
2971
2981
|
this.clearConnectedWalletState();
|
|
2972
2982
|
this.emit();
|
|
2973
2983
|
try {
|
|
2974
|
-
const { api } = await connectDetectedWallet(target, {
|
|
2984
|
+
const { api, error } = await connectDetectedWallet(target, {
|
|
2975
2985
|
wagmi: opts?.wagmi
|
|
2976
2986
|
});
|
|
2977
|
-
if (api) {
|
|
2987
|
+
if (api && !error) {
|
|
2978
2988
|
this._wallet = api;
|
|
2979
2989
|
this._connectedWalletId = target.meta.id;
|
|
2980
2990
|
this.bindProviderEvents(target);
|
|
2981
2991
|
await this.syncIdentityFromWallet(target.meta.id);
|
|
2992
|
+
this._status = "connected";
|
|
2993
|
+
this._error = null;
|
|
2994
|
+
return { error: null, api };
|
|
2995
|
+
}
|
|
2996
|
+
if (error) {
|
|
2997
|
+
this._status = "error";
|
|
2998
|
+
this._error = error;
|
|
2999
|
+
return { error, api };
|
|
2982
3000
|
}
|
|
2983
|
-
this._status = "connected";
|
|
2984
3001
|
} catch (e2) {
|
|
2985
|
-
this._error = e2;
|
|
3002
|
+
this._error = e2 instanceof Error ? e2.message : String(e2);
|
|
2986
3003
|
this._status = "error";
|
|
2987
3004
|
this.clearConnectedWalletState();
|
|
2988
3005
|
} finally {
|
|
@@ -4979,7 +4996,8 @@ function useDepositNavigationState(initialStep) {
|
|
|
4979
4996
|
navigationDirection,
|
|
4980
4997
|
setCurrentStep,
|
|
4981
4998
|
goBack,
|
|
4982
|
-
resetNavigation
|
|
4999
|
+
resetNavigation,
|
|
5000
|
+
setCurrentStepInternal
|
|
4983
5001
|
};
|
|
4984
5002
|
}
|
|
4985
5003
|
|
|
@@ -5059,6 +5077,9 @@ function useWalletSessionState() {
|
|
|
5059
5077
|
}, []);
|
|
5060
5078
|
const connectWallet = (0, import_react9.useCallback)(async (wallet) => {
|
|
5061
5079
|
await walletManager.connectDetected(wallet);
|
|
5080
|
+
const error = walletManager.error;
|
|
5081
|
+
const api = walletManager.wallet;
|
|
5082
|
+
return { error, api };
|
|
5062
5083
|
}, []);
|
|
5063
5084
|
const disconnectWallet = (0, import_react9.useCallback)(async () => {
|
|
5064
5085
|
await walletManager.disconnect();
|
|
@@ -5972,6 +5993,7 @@ function useWalletTokenState({
|
|
|
5972
5993
|
setSelectedToken
|
|
5973
5994
|
}) {
|
|
5974
5995
|
const [yourWalletTokens, setYourWalletTokens] = (0, import_react16.useState)([]);
|
|
5996
|
+
const [yourWalletTokensLoading, setYourWalletTokensLoading] = (0, import_react16.useState)(false);
|
|
5975
5997
|
const [walletTokensReloadNonce, setWalletTokensReloadNonce] = (0, import_react16.useState)(0);
|
|
5976
5998
|
const lastLoadedWalletRef = (0, import_react16.useRef)(null);
|
|
5977
5999
|
const { tokens } = useTokens(null);
|
|
@@ -5992,6 +6014,7 @@ function useWalletTokenState({
|
|
|
5992
6014
|
let cancelled = false;
|
|
5993
6015
|
async function loadWalletTokens() {
|
|
5994
6016
|
try {
|
|
6017
|
+
setYourWalletTokensLoading(true);
|
|
5995
6018
|
if (TrustwareConfigStore.get().features.balanceStreaming) {
|
|
5996
6019
|
let accumulatedBalances = [];
|
|
5997
6020
|
for await (const chunk of getBalancesByAddressStream(
|
|
@@ -6036,6 +6059,10 @@ function useWalletTokenState({
|
|
|
6036
6059
|
if (!cancelled) {
|
|
6037
6060
|
setYourWalletTokens([]);
|
|
6038
6061
|
}
|
|
6062
|
+
} finally {
|
|
6063
|
+
if (!cancelled) {
|
|
6064
|
+
setYourWalletTokensLoading(false);
|
|
6065
|
+
}
|
|
6039
6066
|
}
|
|
6040
6067
|
}
|
|
6041
6068
|
void loadWalletTokens();
|
|
@@ -6050,7 +6077,8 @@ function useWalletTokenState({
|
|
|
6050
6077
|
setSelectedToken,
|
|
6051
6078
|
tokens,
|
|
6052
6079
|
walletAddress,
|
|
6053
|
-
walletTokensReloadNonce
|
|
6080
|
+
walletTokensReloadNonce,
|
|
6081
|
+
setYourWalletTokensLoading
|
|
6054
6082
|
]);
|
|
6055
6083
|
const reloadWalletTokens = () => {
|
|
6056
6084
|
setWalletTokensReloadNonce((prev) => prev + 1);
|
|
@@ -6058,7 +6086,9 @@ function useWalletTokenState({
|
|
|
6058
6086
|
return {
|
|
6059
6087
|
yourWalletTokens,
|
|
6060
6088
|
setYourWalletTokens,
|
|
6061
|
-
reloadWalletTokens
|
|
6089
|
+
reloadWalletTokens,
|
|
6090
|
+
yourWalletTokensLoading,
|
|
6091
|
+
setYourWalletTokensLoading
|
|
6062
6092
|
};
|
|
6063
6093
|
}
|
|
6064
6094
|
function applyWalletTokenState({
|
|
@@ -6214,7 +6244,8 @@ function DepositProvider({
|
|
|
6214
6244
|
navigationDirection,
|
|
6215
6245
|
setCurrentStep,
|
|
6216
6246
|
goBack,
|
|
6217
|
-
resetNavigation
|
|
6247
|
+
resetNavigation,
|
|
6248
|
+
setCurrentStepInternal
|
|
6218
6249
|
} = useDepositNavigationState(initialStep);
|
|
6219
6250
|
const { resolvedTheme, toggleTheme } = useThemePreference();
|
|
6220
6251
|
const {
|
|
@@ -6230,7 +6261,12 @@ function DepositProvider({
|
|
|
6230
6261
|
const [selectedToken, setSelectedToken] = (0, import_react17.useState)(null);
|
|
6231
6262
|
const [selectedChain, setSelectedChain] = (0, import_react17.useState)(null);
|
|
6232
6263
|
const [amount, setAmount] = (0, import_react17.useState)("");
|
|
6233
|
-
const {
|
|
6264
|
+
const {
|
|
6265
|
+
yourWalletTokens,
|
|
6266
|
+
setYourWalletTokens,
|
|
6267
|
+
reloadWalletTokens,
|
|
6268
|
+
yourWalletTokensLoading
|
|
6269
|
+
} = useWalletTokenState({
|
|
6234
6270
|
walletAddress,
|
|
6235
6271
|
selectedChain,
|
|
6236
6272
|
setSelectedChain,
|
|
@@ -6262,7 +6298,8 @@ function DepositProvider({
|
|
|
6262
6298
|
goBack,
|
|
6263
6299
|
resetState,
|
|
6264
6300
|
stepHistory,
|
|
6265
|
-
navigationDirection
|
|
6301
|
+
navigationDirection,
|
|
6302
|
+
setCurrentStepInternal
|
|
6266
6303
|
}),
|
|
6267
6304
|
[
|
|
6268
6305
|
currentStep,
|
|
@@ -6270,6 +6307,7 @@ function DepositProvider({
|
|
|
6270
6307
|
navigationDirection,
|
|
6271
6308
|
resetState,
|
|
6272
6309
|
setCurrentStep,
|
|
6310
|
+
setCurrentStepInternal,
|
|
6273
6311
|
stepHistory
|
|
6274
6312
|
]
|
|
6275
6313
|
);
|
|
@@ -6281,7 +6319,8 @@ function DepositProvider({
|
|
|
6281
6319
|
connectWallet,
|
|
6282
6320
|
disconnectWallet,
|
|
6283
6321
|
yourWalletTokens,
|
|
6284
|
-
setYourWalletTokens
|
|
6322
|
+
setYourWalletTokens,
|
|
6323
|
+
yourWalletTokensLoading
|
|
6285
6324
|
}),
|
|
6286
6325
|
[
|
|
6287
6326
|
connectWallet,
|
|
@@ -6290,7 +6329,8 @@ function DepositProvider({
|
|
|
6290
6329
|
setYourWalletTokens,
|
|
6291
6330
|
walletAddress,
|
|
6292
6331
|
walletStatus,
|
|
6293
|
-
yourWalletTokens
|
|
6332
|
+
yourWalletTokens,
|
|
6333
|
+
yourWalletTokensLoading
|
|
6294
6334
|
]
|
|
6295
6335
|
);
|
|
6296
6336
|
const formValue = (0, import_react17.useMemo)(
|
|
@@ -7546,23 +7586,39 @@ function SwipeToConfirmTokens({
|
|
|
7546
7586
|
justifyContent: "center",
|
|
7547
7587
|
padding: `0 ${spacing[7]}`,
|
|
7548
7588
|
transition: "opacity 0.2s",
|
|
7549
|
-
...effectiveProgress > 0.15 && { opacity: 0 }
|
|
7589
|
+
...effectiveProgress > 0.15 && { opacity: 0 },
|
|
7590
|
+
width: "100%"
|
|
7550
7591
|
},
|
|
7551
7592
|
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
7552
|
-
"
|
|
7593
|
+
"div",
|
|
7553
7594
|
{
|
|
7554
7595
|
style: {
|
|
7555
|
-
|
|
7556
|
-
|
|
7557
|
-
|
|
7558
|
-
lineHeight: 1.15,
|
|
7559
|
-
textAlign: "center",
|
|
7596
|
+
minWidth: 0,
|
|
7597
|
+
flex: 1,
|
|
7598
|
+
overflowX: "hidden",
|
|
7560
7599
|
whiteSpace: "nowrap",
|
|
7561
|
-
|
|
7562
|
-
|
|
7563
|
-
maxWidth: "100%"
|
|
7600
|
+
scrollbarWidth: "none",
|
|
7601
|
+
maxWidth: "85%"
|
|
7564
7602
|
},
|
|
7565
|
-
children:
|
|
7603
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
7604
|
+
"span",
|
|
7605
|
+
{
|
|
7606
|
+
style: {
|
|
7607
|
+
display: "block",
|
|
7608
|
+
// + width: "100%",
|
|
7609
|
+
fontSize: isVeryLongText ? fontSize.xs : isLongText ? "0.8125rem" : fontSize.sm,
|
|
7610
|
+
color: colors.mutedForeground,
|
|
7611
|
+
fontWeight: fontWeight.bold,
|
|
7612
|
+
lineHeight: 1.15,
|
|
7613
|
+
textAlign: "center",
|
|
7614
|
+
whiteSpace: "nowrap",
|
|
7615
|
+
overflow: "hidden",
|
|
7616
|
+
textOverflow: "ellipsis",
|
|
7617
|
+
maxWidth: "100%"
|
|
7618
|
+
},
|
|
7619
|
+
children: text
|
|
7620
|
+
}
|
|
7621
|
+
)
|
|
7566
7622
|
}
|
|
7567
7623
|
)
|
|
7568
7624
|
}
|
|
@@ -12496,6 +12552,7 @@ function useHomeWalletActions({
|
|
|
12496
12552
|
connectWallet,
|
|
12497
12553
|
detectedWallets,
|
|
12498
12554
|
setCurrentStep
|
|
12555
|
+
// setCurrentStepInternal,
|
|
12499
12556
|
}) {
|
|
12500
12557
|
const [isCryptoDropdownOpen, setIsCryptoDropdownOpen] = (0, import_react32.useState)(false);
|
|
12501
12558
|
const [isFiatDropdownOpen, setIsFiatDropdownOpen] = (0, import_react32.useState)(false);
|
|
@@ -12517,12 +12574,18 @@ function useHomeWalletActions({
|
|
|
12517
12574
|
(0, import_react32.useEffect)(() => {
|
|
12518
12575
|
getUniversalConnector().then(setUniversalConnector);
|
|
12519
12576
|
}, []);
|
|
12577
|
+
const { resetNavigation } = useDepositNavigationState("home");
|
|
12520
12578
|
const handleWalletSelect = async (wallet) => {
|
|
12521
12579
|
setIsCryptoDropdownOpen(false);
|
|
12522
12580
|
try {
|
|
12523
|
-
await connectWallet(wallet);
|
|
12581
|
+
const { error } = await connectWallet(wallet);
|
|
12582
|
+
if (error) {
|
|
12583
|
+
resetNavigation();
|
|
12584
|
+
return;
|
|
12585
|
+
}
|
|
12524
12586
|
setCurrentStep("crypto-pay");
|
|
12525
12587
|
} catch {
|
|
12588
|
+
resetNavigation();
|
|
12526
12589
|
}
|
|
12527
12590
|
};
|
|
12528
12591
|
const handleFiatSelect = () => {
|
|
@@ -12558,7 +12621,7 @@ function useHomeWalletActions({
|
|
|
12558
12621
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
12559
12622
|
function Home({ style: _style }) {
|
|
12560
12623
|
const { amount, setAmount, amountInputMode, setAmountInputMode } = useDepositForm();
|
|
12561
|
-
const { setCurrentStep } = useDepositNavigation();
|
|
12624
|
+
const { setCurrentStep, setCurrentStepInternal } = useDepositNavigation();
|
|
12562
12625
|
const { connectWallet } = useDepositWallet();
|
|
12563
12626
|
const { resolvedTheme } = useDepositUi();
|
|
12564
12627
|
const { fixedFromAmountString, isFixedAmount, minAmountUsd, maxAmountUsd } = useAmountConstraints();
|
|
@@ -12587,7 +12650,8 @@ function Home({ style: _style }) {
|
|
|
12587
12650
|
} = useHomeWalletActions({
|
|
12588
12651
|
connectWallet,
|
|
12589
12652
|
detectedWallets,
|
|
12590
|
-
setCurrentStep
|
|
12653
|
+
setCurrentStep,
|
|
12654
|
+
setCurrentStepInternal
|
|
12591
12655
|
});
|
|
12592
12656
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
12593
12657
|
"div",
|
|
@@ -12867,7 +12931,7 @@ function SelectToken({ style }) {
|
|
|
12867
12931
|
);
|
|
12868
12932
|
}
|
|
12869
12933
|
|
|
12870
|
-
// src/widget/pages/CryptoPay.tsx
|
|
12934
|
+
// src/widget/pages/CryptoPay/index.tsx
|
|
12871
12935
|
var import_react35 = require("react");
|
|
12872
12936
|
|
|
12873
12937
|
// src/widget/features/route-preview/hooks/useRoutePreviewModel.ts
|
|
@@ -13721,8 +13785,180 @@ function useTransactionActionModel({
|
|
|
13721
13785
|
};
|
|
13722
13786
|
}
|
|
13723
13787
|
|
|
13724
|
-
// src/widget/pages/CryptoPay.tsx
|
|
13788
|
+
// src/widget/pages/CryptoPay/DefaultCryptoPay.tsx
|
|
13725
13789
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
13790
|
+
var IconWallet = ({ style }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
13791
|
+
"svg",
|
|
13792
|
+
{
|
|
13793
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13794
|
+
width: "24",
|
|
13795
|
+
height: "24",
|
|
13796
|
+
viewBox: "0 0 24 24",
|
|
13797
|
+
fill: "none",
|
|
13798
|
+
stroke: "currentColor",
|
|
13799
|
+
strokeWidth: "1.75",
|
|
13800
|
+
strokeLinecap: "round",
|
|
13801
|
+
strokeLinejoin: "round",
|
|
13802
|
+
style,
|
|
13803
|
+
children: [
|
|
13804
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("path", { d: "M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1" }),
|
|
13805
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("path", { d: "M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4" })
|
|
13806
|
+
]
|
|
13807
|
+
}
|
|
13808
|
+
);
|
|
13809
|
+
var IconSparkles = ({ style }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
13810
|
+
"svg",
|
|
13811
|
+
{
|
|
13812
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13813
|
+
width: "24",
|
|
13814
|
+
height: "24",
|
|
13815
|
+
viewBox: "0 0 24 24",
|
|
13816
|
+
fill: "none",
|
|
13817
|
+
stroke: "currentColor",
|
|
13818
|
+
strokeWidth: "2",
|
|
13819
|
+
strokeLinecap: "round",
|
|
13820
|
+
strokeLinejoin: "round",
|
|
13821
|
+
style,
|
|
13822
|
+
children: [
|
|
13823
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("path", { d: "m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z" }),
|
|
13824
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("path", { d: "M5 3v4" }),
|
|
13825
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("path", { d: "M19 17v4" }),
|
|
13826
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("path", { d: "M3 5h4" }),
|
|
13827
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("path", { d: "M17 19h4" })
|
|
13828
|
+
]
|
|
13829
|
+
}
|
|
13830
|
+
);
|
|
13831
|
+
function DefaultCryptoPay() {
|
|
13832
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
13833
|
+
"div",
|
|
13834
|
+
{
|
|
13835
|
+
style: {
|
|
13836
|
+
width: "100%",
|
|
13837
|
+
minHeight: "100%",
|
|
13838
|
+
display: "flex",
|
|
13839
|
+
alignItems: "center",
|
|
13840
|
+
justifyContent: "center",
|
|
13841
|
+
flexDirection: "column"
|
|
13842
|
+
},
|
|
13843
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
13844
|
+
"div",
|
|
13845
|
+
{
|
|
13846
|
+
style: {
|
|
13847
|
+
textAlign: "center",
|
|
13848
|
+
flexDirection: "column",
|
|
13849
|
+
display: "flex",
|
|
13850
|
+
alignItems: "center",
|
|
13851
|
+
justifyContent: "center",
|
|
13852
|
+
padding: "2rem"
|
|
13853
|
+
},
|
|
13854
|
+
children: [
|
|
13855
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
13856
|
+
"div",
|
|
13857
|
+
{
|
|
13858
|
+
style: {
|
|
13859
|
+
position: "relative",
|
|
13860
|
+
marginBottom: "1.25rem",
|
|
13861
|
+
display: "inline-block"
|
|
13862
|
+
},
|
|
13863
|
+
children: [
|
|
13864
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
13865
|
+
"div",
|
|
13866
|
+
{
|
|
13867
|
+
style: {
|
|
13868
|
+
position: "absolute",
|
|
13869
|
+
inset: 0,
|
|
13870
|
+
borderRadius: "9999px",
|
|
13871
|
+
background: `linear-gradient(135deg, ${colors.green[500]} 0%, ${colors.green[300]} 100%)`,
|
|
13872
|
+
opacity: 0.2,
|
|
13873
|
+
filter: "blur(1rem)"
|
|
13874
|
+
}
|
|
13875
|
+
}
|
|
13876
|
+
),
|
|
13877
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
13878
|
+
"div",
|
|
13879
|
+
{
|
|
13880
|
+
style: {
|
|
13881
|
+
position: "relative",
|
|
13882
|
+
height: "5rem",
|
|
13883
|
+
width: "5rem",
|
|
13884
|
+
borderRadius: "9999px",
|
|
13885
|
+
backgroundColor: colors.card,
|
|
13886
|
+
border: `1px solid ${colors.border}`,
|
|
13887
|
+
display: "flex",
|
|
13888
|
+
alignItems: "center",
|
|
13889
|
+
justifyContent: "center"
|
|
13890
|
+
},
|
|
13891
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
13892
|
+
IconWallet,
|
|
13893
|
+
{
|
|
13894
|
+
style: {
|
|
13895
|
+
color: colors.green[300]
|
|
13896
|
+
}
|
|
13897
|
+
}
|
|
13898
|
+
)
|
|
13899
|
+
}
|
|
13900
|
+
)
|
|
13901
|
+
]
|
|
13902
|
+
}
|
|
13903
|
+
),
|
|
13904
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
13905
|
+
"div",
|
|
13906
|
+
{
|
|
13907
|
+
style: {
|
|
13908
|
+
display: "inline-flex",
|
|
13909
|
+
alignItems: "center",
|
|
13910
|
+
gap: "0.375rem",
|
|
13911
|
+
fontSize: "0.75rem",
|
|
13912
|
+
fontWeight: 500,
|
|
13913
|
+
color: "hsl(158, 84%, 52%)",
|
|
13914
|
+
backgroundColor: "hsla(158, 84%, 52%, 0.1)",
|
|
13915
|
+
border: `1px solid hsla(158, 84%, 52%, 0.2)`,
|
|
13916
|
+
borderRadius: "9999px",
|
|
13917
|
+
padding: "0.25rem 0.75rem",
|
|
13918
|
+
marginBottom: "0.75rem"
|
|
13919
|
+
},
|
|
13920
|
+
children: [
|
|
13921
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(IconSparkles, {}),
|
|
13922
|
+
"Wallet is empty"
|
|
13923
|
+
]
|
|
13924
|
+
}
|
|
13925
|
+
),
|
|
13926
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
13927
|
+
"h2",
|
|
13928
|
+
{
|
|
13929
|
+
style: {
|
|
13930
|
+
fontSize: "1.5rem",
|
|
13931
|
+
fontWeight: 600,
|
|
13932
|
+
letterSpacing: "-0.025em",
|
|
13933
|
+
marginBottom: "0.375rem",
|
|
13934
|
+
color: colors.foreground
|
|
13935
|
+
},
|
|
13936
|
+
children: "Deposit assets to swap or bridge."
|
|
13937
|
+
}
|
|
13938
|
+
),
|
|
13939
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
13940
|
+
"p",
|
|
13941
|
+
{
|
|
13942
|
+
style: {
|
|
13943
|
+
fontSize: "0.875rem",
|
|
13944
|
+
color: colors.mutedForeground,
|
|
13945
|
+
maxWidth: "24rem",
|
|
13946
|
+
margin: "0 auto",
|
|
13947
|
+
lineHeight: 1.625
|
|
13948
|
+
},
|
|
13949
|
+
children: "You'll need tokens before you can swap or bridge."
|
|
13950
|
+
}
|
|
13951
|
+
)
|
|
13952
|
+
]
|
|
13953
|
+
}
|
|
13954
|
+
)
|
|
13955
|
+
}
|
|
13956
|
+
);
|
|
13957
|
+
}
|
|
13958
|
+
var DefaultCryptoPay_default = DefaultCryptoPay;
|
|
13959
|
+
|
|
13960
|
+
// src/widget/pages/CryptoPay/index.tsx
|
|
13961
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
13726
13962
|
var SHOW_FEE_SUMMARY = false;
|
|
13727
13963
|
function CryptoPay({ style: _style }) {
|
|
13728
13964
|
const {
|
|
@@ -13735,7 +13971,12 @@ function CryptoPay({ style: _style }) {
|
|
|
13735
13971
|
amountInputMode,
|
|
13736
13972
|
setAmountInputMode
|
|
13737
13973
|
} = useDepositForm();
|
|
13738
|
-
const {
|
|
13974
|
+
const {
|
|
13975
|
+
walletAddress,
|
|
13976
|
+
walletStatus,
|
|
13977
|
+
yourWalletTokens,
|
|
13978
|
+
yourWalletTokensLoading
|
|
13979
|
+
} = useDepositWallet();
|
|
13739
13980
|
const { goBack, setCurrentStep, currentStep } = useDepositNavigation();
|
|
13740
13981
|
const config = useTrustwareConfig();
|
|
13741
13982
|
const { fixedFromAmountString, isFixedAmount, minAmountUsd, maxAmountUsd } = useAmountConstraints();
|
|
@@ -13744,11 +13985,15 @@ function CryptoPay({ style: _style }) {
|
|
|
13744
13985
|
const n = Number(raw);
|
|
13745
13986
|
return Number.isFinite(n) && n > 0 ? n : void 0;
|
|
13746
13987
|
}, [config.routes?.options?.routeRefreshMs]);
|
|
13747
|
-
const
|
|
13748
|
-
|
|
13749
|
-
|
|
13750
|
-
|
|
13751
|
-
}, [
|
|
13988
|
+
const IsPos = (x) => x !== null && x !== void 0 && x.balance !== "0";
|
|
13989
|
+
const showDefaultCryptoPay = (0, import_react35.useMemo)(() => {
|
|
13990
|
+
const nonZer0Tks = (yourWalletTokens ?? []).filter(IsPos);
|
|
13991
|
+
return !yourWalletTokensLoading && nonZer0Tks.length === 0 && yourWalletTokens.length > 0;
|
|
13992
|
+
}, [yourWalletTokens, yourWalletTokensLoading]);
|
|
13993
|
+
const showSkeleton = (0, import_react35.useMemo)(() => {
|
|
13994
|
+
return yourWalletTokensLoading || (yourWalletTokens ?? []).length === 0;
|
|
13995
|
+
}, [yourWalletTokens, yourWalletTokensLoading]);
|
|
13996
|
+
const isReady = !yourWalletTokensLoading && selectedToken != null && selectedToken?.chainData !== void 0 && !showDefaultCryptoPay && !showSkeleton;
|
|
13752
13997
|
const {
|
|
13753
13998
|
amountComputation,
|
|
13754
13999
|
amountValidationError,
|
|
@@ -13851,7 +14096,7 @@ function CryptoPay({ style: _style }) {
|
|
|
13851
14096
|
const handleExpandTokens = () => {
|
|
13852
14097
|
setCurrentStep("select-token");
|
|
13853
14098
|
};
|
|
13854
|
-
return /* @__PURE__ */ (0,
|
|
14099
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
13855
14100
|
"div",
|
|
13856
14101
|
{
|
|
13857
14102
|
style: {
|
|
@@ -13860,56 +14105,8 @@ function CryptoPay({ style: _style }) {
|
|
|
13860
14105
|
minHeight: "500px"
|
|
13861
14106
|
},
|
|
13862
14107
|
children: [
|
|
13863
|
-
/* @__PURE__ */ (0,
|
|
13864
|
-
|
|
13865
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
13866
|
-
CryptoPayAmountSection,
|
|
13867
|
-
{
|
|
13868
|
-
amount,
|
|
13869
|
-
amountComputation,
|
|
13870
|
-
amountInputMode,
|
|
13871
|
-
estimatedReceive,
|
|
13872
|
-
effectiveSliderMax,
|
|
13873
|
-
effectiveSliderMin,
|
|
13874
|
-
gasReservationWei,
|
|
13875
|
-
handleAmountChange,
|
|
13876
|
-
handleExpandTokens,
|
|
13877
|
-
handleSliderChange,
|
|
13878
|
-
handleTokenChange,
|
|
13879
|
-
hasUsdPrice,
|
|
13880
|
-
isFixedAmount,
|
|
13881
|
-
isLoadingRoute,
|
|
13882
|
-
normalizedTokenBalance,
|
|
13883
|
-
orderedTokens,
|
|
13884
|
-
parsedAmount,
|
|
13885
|
-
selectedChain,
|
|
13886
|
-
selectedToken: readySelectedToken,
|
|
13887
|
-
setAmountInputMode,
|
|
13888
|
-
showFeeSummary: SHOW_FEE_SUMMARY,
|
|
13889
|
-
tokenPriceUSD,
|
|
13890
|
-
walletAddress,
|
|
13891
|
-
yourWalletTokensLength: yourWalletTokens.length
|
|
13892
|
-
}
|
|
13893
|
-
),
|
|
13894
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
13895
|
-
CryptoPaySwipeSection,
|
|
13896
|
-
{
|
|
13897
|
-
actionErrorMessage,
|
|
13898
|
-
canSwipe,
|
|
13899
|
-
destinationConfig,
|
|
13900
|
-
fromChainName: selectedChain?.networkName,
|
|
13901
|
-
handleSwipeConfirm,
|
|
13902
|
-
isApproving,
|
|
13903
|
-
isLoadingRoute,
|
|
13904
|
-
isReadingAllowance,
|
|
13905
|
-
isWalletConnected,
|
|
13906
|
-
needsApproval,
|
|
13907
|
-
selectedToken: readySelectedToken,
|
|
13908
|
-
swipeResetKey
|
|
13909
|
-
}
|
|
13910
|
-
),
|
|
13911
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(WidgetSecurityFooter, {})
|
|
13912
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
14108
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(WidgetPageHeader, { onBack: goBack, title: "Confirm Deposit" }),
|
|
14109
|
+
showSkeleton ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_jsx_runtime48.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
13913
14110
|
"div",
|
|
13914
14111
|
{
|
|
13915
14112
|
style: {
|
|
@@ -13918,9 +14115,60 @@ function CryptoPay({ style: _style }) {
|
|
|
13918
14115
|
alignItems: "center",
|
|
13919
14116
|
justifyContent: "center"
|
|
13920
14117
|
},
|
|
13921
|
-
children: /* @__PURE__ */ (0,
|
|
14118
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(LoadingSkeleton, {})
|
|
13922
14119
|
}
|
|
13923
|
-
)
|
|
14120
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
14121
|
+
isReady && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
14122
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
14123
|
+
CryptoPayAmountSection,
|
|
14124
|
+
{
|
|
14125
|
+
amount,
|
|
14126
|
+
amountComputation,
|
|
14127
|
+
amountInputMode,
|
|
14128
|
+
estimatedReceive,
|
|
14129
|
+
effectiveSliderMax,
|
|
14130
|
+
effectiveSliderMin,
|
|
14131
|
+
gasReservationWei,
|
|
14132
|
+
handleAmountChange,
|
|
14133
|
+
handleExpandTokens,
|
|
14134
|
+
handleSliderChange,
|
|
14135
|
+
handleTokenChange,
|
|
14136
|
+
hasUsdPrice,
|
|
14137
|
+
isFixedAmount,
|
|
14138
|
+
isLoadingRoute,
|
|
14139
|
+
normalizedTokenBalance,
|
|
14140
|
+
orderedTokens,
|
|
14141
|
+
parsedAmount,
|
|
14142
|
+
selectedChain,
|
|
14143
|
+
selectedToken: readySelectedToken,
|
|
14144
|
+
setAmountInputMode,
|
|
14145
|
+
showFeeSummary: SHOW_FEE_SUMMARY,
|
|
14146
|
+
tokenPriceUSD,
|
|
14147
|
+
walletAddress,
|
|
14148
|
+
yourWalletTokensLength: yourWalletTokens.length
|
|
14149
|
+
}
|
|
14150
|
+
),
|
|
14151
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
14152
|
+
CryptoPaySwipeSection,
|
|
14153
|
+
{
|
|
14154
|
+
actionErrorMessage,
|
|
14155
|
+
canSwipe,
|
|
14156
|
+
destinationConfig,
|
|
14157
|
+
fromChainName: selectedChain?.networkName,
|
|
14158
|
+
handleSwipeConfirm,
|
|
14159
|
+
isApproving,
|
|
14160
|
+
isLoadingRoute,
|
|
14161
|
+
isReadingAllowance,
|
|
14162
|
+
isWalletConnected,
|
|
14163
|
+
needsApproval,
|
|
14164
|
+
selectedToken: readySelectedToken,
|
|
14165
|
+
swipeResetKey
|
|
14166
|
+
}
|
|
14167
|
+
),
|
|
14168
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(WidgetSecurityFooter, {})
|
|
14169
|
+
] }),
|
|
14170
|
+
showDefaultCryptoPay && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DefaultCryptoPay_default, {})
|
|
14171
|
+
] })
|
|
13924
14172
|
]
|
|
13925
14173
|
}
|
|
13926
14174
|
);
|
|
@@ -13928,7 +14176,7 @@ function CryptoPay({ style: _style }) {
|
|
|
13928
14176
|
|
|
13929
14177
|
// src/widget/pages/Processing.tsx
|
|
13930
14178
|
var import_react36 = require("react");
|
|
13931
|
-
var
|
|
14179
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
13932
14180
|
function getProgressFromStatus(status) {
|
|
13933
14181
|
switch (status) {
|
|
13934
14182
|
case "confirming":
|
|
@@ -14004,7 +14252,7 @@ function Processing({ style }) {
|
|
|
14004
14252
|
};
|
|
14005
14253
|
const isIndeterminate = transactionStatus === "confirming" || transactionStatus === "idle";
|
|
14006
14254
|
const headerTitle = transactionStatus === "success" ? "Complete" : transactionStatus === "error" ? "Failed" : "Processing";
|
|
14007
|
-
return /* @__PURE__ */ (0,
|
|
14255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
14008
14256
|
"div",
|
|
14009
14257
|
{
|
|
14010
14258
|
style: {
|
|
@@ -14014,8 +14262,8 @@ function Processing({ style }) {
|
|
|
14014
14262
|
...style
|
|
14015
14263
|
},
|
|
14016
14264
|
children: [
|
|
14017
|
-
/* @__PURE__ */ (0,
|
|
14018
|
-
/* @__PURE__ */ (0,
|
|
14265
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(WidgetPageHeader, { onClose: handleClose, title: headerTitle }),
|
|
14266
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
14019
14267
|
"div",
|
|
14020
14268
|
{
|
|
14021
14269
|
style: {
|
|
@@ -14027,13 +14275,13 @@ function Processing({ style }) {
|
|
|
14027
14275
|
padding: `${spacing[8]} ${spacing[6]}`
|
|
14028
14276
|
},
|
|
14029
14277
|
children: [
|
|
14030
|
-
/* @__PURE__ */ (0,
|
|
14278
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
14031
14279
|
"div",
|
|
14032
14280
|
{
|
|
14033
14281
|
style: {
|
|
14034
14282
|
marginBottom: spacing[6]
|
|
14035
14283
|
},
|
|
14036
|
-
children: /* @__PURE__ */ (0,
|
|
14284
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
14037
14285
|
CircularProgress,
|
|
14038
14286
|
{
|
|
14039
14287
|
progress,
|
|
@@ -14045,7 +14293,7 @@ function Processing({ style }) {
|
|
|
14045
14293
|
)
|
|
14046
14294
|
}
|
|
14047
14295
|
),
|
|
14048
|
-
/* @__PURE__ */ (0,
|
|
14296
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
14049
14297
|
"p",
|
|
14050
14298
|
{
|
|
14051
14299
|
style: {
|
|
@@ -14058,7 +14306,7 @@ function Processing({ style }) {
|
|
|
14058
14306
|
children: stepText
|
|
14059
14307
|
}
|
|
14060
14308
|
),
|
|
14061
|
-
selectedToken && parsedAmount > 0 && /* @__PURE__ */ (0,
|
|
14309
|
+
selectedToken && parsedAmount > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
14062
14310
|
"p",
|
|
14063
14311
|
{
|
|
14064
14312
|
style: {
|
|
@@ -14075,7 +14323,7 @@ function Processing({ style }) {
|
|
|
14075
14323
|
]
|
|
14076
14324
|
}
|
|
14077
14325
|
),
|
|
14078
|
-
/* @__PURE__ */ (0,
|
|
14326
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
14079
14327
|
TransactionSteps,
|
|
14080
14328
|
{
|
|
14081
14329
|
transactionStatus,
|
|
@@ -14086,7 +14334,7 @@ function Processing({ style }) {
|
|
|
14086
14334
|
}
|
|
14087
14335
|
}
|
|
14088
14336
|
),
|
|
14089
|
-
transactionHash ? /* @__PURE__ */ (0,
|
|
14337
|
+
transactionHash ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
14090
14338
|
TransactionHashLink,
|
|
14091
14339
|
{
|
|
14092
14340
|
explorerUrl,
|
|
@@ -14094,7 +14342,7 @@ function Processing({ style }) {
|
|
|
14094
14342
|
label: "Transaction"
|
|
14095
14343
|
}
|
|
14096
14344
|
) : null,
|
|
14097
|
-
transactionStatus === "error" && /* @__PURE__ */ (0,
|
|
14345
|
+
transactionStatus === "error" && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
14098
14346
|
"button",
|
|
14099
14347
|
{
|
|
14100
14348
|
type: "button",
|
|
@@ -14116,7 +14364,7 @@ function Processing({ style }) {
|
|
|
14116
14364
|
]
|
|
14117
14365
|
}
|
|
14118
14366
|
),
|
|
14119
|
-
/* @__PURE__ */ (0,
|
|
14367
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(WidgetSecurityFooter, {})
|
|
14120
14368
|
]
|
|
14121
14369
|
}
|
|
14122
14370
|
);
|
|
@@ -14124,7 +14372,7 @@ function Processing({ style }) {
|
|
|
14124
14372
|
|
|
14125
14373
|
// src/widget/pages/Success.tsx
|
|
14126
14374
|
var import_react37 = require("react");
|
|
14127
|
-
var
|
|
14375
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
14128
14376
|
var ConfettiEffect2 = (0, import_react37.lazy)(() => Promise.resolve().then(() => (init_ConfettiEffect(), ConfettiEffect_exports)));
|
|
14129
14377
|
function Success({ style }) {
|
|
14130
14378
|
const { selectedToken, selectedChain, amount } = useDepositForm();
|
|
@@ -14147,7 +14395,7 @@ function Success({ style }) {
|
|
|
14147
14395
|
const handleDone = () => {
|
|
14148
14396
|
resetState();
|
|
14149
14397
|
};
|
|
14150
|
-
return /* @__PURE__ */ (0,
|
|
14398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
14151
14399
|
"div",
|
|
14152
14400
|
{
|
|
14153
14401
|
style: {
|
|
@@ -14160,9 +14408,9 @@ function Success({ style }) {
|
|
|
14160
14408
|
...style
|
|
14161
14409
|
},
|
|
14162
14410
|
children: [
|
|
14163
|
-
/* @__PURE__ */ (0,
|
|
14164
|
-
/* @__PURE__ */ (0,
|
|
14165
|
-
/* @__PURE__ */ (0,
|
|
14411
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react37.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ConfettiEffect2, { isActive: true, pieceCount: 60, clearDelay: 4e3 }) }),
|
|
14412
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(WidgetPageHeader, { title: "Deposit Complete" }),
|
|
14413
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
14166
14414
|
"div",
|
|
14167
14415
|
{
|
|
14168
14416
|
style: {
|
|
@@ -14174,7 +14422,7 @@ function Success({ style }) {
|
|
|
14174
14422
|
flexDirection: "column",
|
|
14175
14423
|
alignItems: "center"
|
|
14176
14424
|
},
|
|
14177
|
-
children: /* @__PURE__ */ (0,
|
|
14425
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
14178
14426
|
SuccessSummaryCard,
|
|
14179
14427
|
{
|
|
14180
14428
|
amount: parsedAmount,
|
|
@@ -14188,7 +14436,7 @@ function Success({ style }) {
|
|
|
14188
14436
|
)
|
|
14189
14437
|
}
|
|
14190
14438
|
),
|
|
14191
|
-
/* @__PURE__ */ (0,
|
|
14439
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(WidgetSecurityFooter, {})
|
|
14192
14440
|
]
|
|
14193
14441
|
}
|
|
14194
14442
|
);
|
|
@@ -14197,7 +14445,7 @@ function Success({ style }) {
|
|
|
14197
14445
|
// src/widget/pages/Error.tsx
|
|
14198
14446
|
var import_react38 = require("react");
|
|
14199
14447
|
init_store();
|
|
14200
|
-
var
|
|
14448
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
14201
14449
|
function categorizeError(errorMessage) {
|
|
14202
14450
|
if (!errorMessage) return "unknown";
|
|
14203
14451
|
const msg = errorMessage.toLowerCase();
|
|
@@ -14327,7 +14575,7 @@ function Error2({ style }) {
|
|
|
14327
14575
|
}, [transactionHash, selectedChain]);
|
|
14328
14576
|
const renderErrorIcon = () => {
|
|
14329
14577
|
if (errorCategory === "wallet_rejected") {
|
|
14330
|
-
return /* @__PURE__ */ (0,
|
|
14578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14331
14579
|
"svg",
|
|
14332
14580
|
{
|
|
14333
14581
|
style: {
|
|
@@ -14340,7 +14588,7 @@ function Error2({ style }) {
|
|
|
14340
14588
|
stroke: "currentColor",
|
|
14341
14589
|
strokeWidth: 2.5,
|
|
14342
14590
|
"aria-hidden": "true",
|
|
14343
|
-
children: /* @__PURE__ */ (0,
|
|
14591
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14344
14592
|
"path",
|
|
14345
14593
|
{
|
|
14346
14594
|
strokeLinecap: "round",
|
|
@@ -14352,7 +14600,7 @@ function Error2({ style }) {
|
|
|
14352
14600
|
);
|
|
14353
14601
|
}
|
|
14354
14602
|
if (errorCategory === "network_error") {
|
|
14355
|
-
return /* @__PURE__ */ (0,
|
|
14603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14356
14604
|
"svg",
|
|
14357
14605
|
{
|
|
14358
14606
|
style: {
|
|
@@ -14365,7 +14613,7 @@ function Error2({ style }) {
|
|
|
14365
14613
|
stroke: "currentColor",
|
|
14366
14614
|
strokeWidth: 2,
|
|
14367
14615
|
"aria-hidden": "true",
|
|
14368
|
-
children: /* @__PURE__ */ (0,
|
|
14616
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14369
14617
|
"path",
|
|
14370
14618
|
{
|
|
14371
14619
|
strokeLinecap: "round",
|
|
@@ -14376,7 +14624,7 @@ function Error2({ style }) {
|
|
|
14376
14624
|
}
|
|
14377
14625
|
);
|
|
14378
14626
|
}
|
|
14379
|
-
return /* @__PURE__ */ (0,
|
|
14627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14380
14628
|
"svg",
|
|
14381
14629
|
{
|
|
14382
14630
|
style: {
|
|
@@ -14389,7 +14637,7 @@ function Error2({ style }) {
|
|
|
14389
14637
|
stroke: "currentColor",
|
|
14390
14638
|
strokeWidth: 2,
|
|
14391
14639
|
"aria-hidden": "true",
|
|
14392
|
-
children: /* @__PURE__ */ (0,
|
|
14640
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14393
14641
|
"path",
|
|
14394
14642
|
{
|
|
14395
14643
|
strokeLinecap: "round",
|
|
@@ -14400,7 +14648,7 @@ function Error2({ style }) {
|
|
|
14400
14648
|
}
|
|
14401
14649
|
);
|
|
14402
14650
|
};
|
|
14403
|
-
return /* @__PURE__ */ (0,
|
|
14651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
14404
14652
|
"div",
|
|
14405
14653
|
{
|
|
14406
14654
|
style: {
|
|
@@ -14410,8 +14658,8 @@ function Error2({ style }) {
|
|
|
14410
14658
|
...style
|
|
14411
14659
|
},
|
|
14412
14660
|
children: [
|
|
14413
|
-
/* @__PURE__ */ (0,
|
|
14414
|
-
/* @__PURE__ */ (0,
|
|
14661
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(WidgetPageHeader, { title: errorTitle }),
|
|
14662
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14415
14663
|
ErrorRecoveryCard,
|
|
14416
14664
|
{
|
|
14417
14665
|
errorMessage,
|
|
@@ -14424,7 +14672,7 @@ function Error2({ style }) {
|
|
|
14424
14672
|
transactionHash
|
|
14425
14673
|
}
|
|
14426
14674
|
),
|
|
14427
|
-
/* @__PURE__ */ (0,
|
|
14675
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(WidgetSecurityFooter, {})
|
|
14428
14676
|
]
|
|
14429
14677
|
}
|
|
14430
14678
|
);
|
|
@@ -14446,7 +14694,7 @@ var ACTIVE_TRANSACTION_STATUSES = [
|
|
|
14446
14694
|
];
|
|
14447
14695
|
|
|
14448
14696
|
// src/widget/app/WidgetRouter.tsx
|
|
14449
|
-
var
|
|
14697
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
14450
14698
|
var pageContainerBaseStyle = {
|
|
14451
14699
|
width: "100%",
|
|
14452
14700
|
height: "100%",
|
|
@@ -14464,19 +14712,19 @@ function WidgetRouter({
|
|
|
14464
14712
|
const animationClass = (0, import_react39.useMemo)(() => {
|
|
14465
14713
|
return navigationDirection === "forward" ? "tw-animate-slide-in-right" : "tw-animate-slide-in-left";
|
|
14466
14714
|
}, [navigationDirection]);
|
|
14467
|
-
return /* @__PURE__ */ (0,
|
|
14715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
14468
14716
|
"div",
|
|
14469
14717
|
{
|
|
14470
14718
|
className: animationClass,
|
|
14471
14719
|
style: mergeStyles(pageContainerBaseStyle),
|
|
14472
|
-
children: /* @__PURE__ */ (0,
|
|
14720
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(PageComponent, {})
|
|
14473
14721
|
},
|
|
14474
14722
|
`${currentStep}-${stepHistory.length}`
|
|
14475
14723
|
);
|
|
14476
14724
|
}
|
|
14477
14725
|
|
|
14478
14726
|
// src/widget/TrustwareWidgetV2.tsx
|
|
14479
|
-
var
|
|
14727
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
14480
14728
|
var widgetContentContainerStyle = {
|
|
14481
14729
|
position: "relative",
|
|
14482
14730
|
width: "100%",
|
|
@@ -14518,9 +14766,9 @@ function WidgetContent({
|
|
|
14518
14766
|
transactionStatus,
|
|
14519
14767
|
onStateChange
|
|
14520
14768
|
]);
|
|
14521
|
-
return /* @__PURE__ */ (0,
|
|
14522
|
-
showThemeToggle && /* @__PURE__ */ (0,
|
|
14523
|
-
/* @__PURE__ */ (0,
|
|
14769
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { style: mergeStyles(widgetContentContainerStyle, style), children: [
|
|
14770
|
+
showThemeToggle && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { style: themeToggleContainerStyle, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ThemeToggle, { theme: resolvedTheme, onToggle: toggleTheme }) }),
|
|
14771
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
14524
14772
|
WidgetRouter,
|
|
14525
14773
|
{
|
|
14526
14774
|
currentStep,
|
|
@@ -14569,16 +14817,16 @@ function WidgetInner({
|
|
|
14569
14817
|
const handleRefresh = (0, import_react40.useCallback)(() => {
|
|
14570
14818
|
revalidate?.();
|
|
14571
14819
|
}, [revalidate]);
|
|
14572
|
-
return /* @__PURE__ */ (0,
|
|
14573
|
-
/* @__PURE__ */ (0,
|
|
14574
|
-
/* @__PURE__ */ (0,
|
|
14820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
|
|
14821
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(WidgetContainer, { theme: effectiveTheme, style, children: [
|
|
14822
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
14575
14823
|
WidgetContent,
|
|
14576
14824
|
{
|
|
14577
14825
|
onStateChange,
|
|
14578
14826
|
showThemeToggle
|
|
14579
14827
|
}
|
|
14580
14828
|
),
|
|
14581
|
-
/* @__PURE__ */ (0,
|
|
14829
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
14582
14830
|
InitErrorOverlay,
|
|
14583
14831
|
{
|
|
14584
14832
|
open: initBlocked,
|
|
@@ -14588,7 +14836,7 @@ function WidgetInner({
|
|
|
14588
14836
|
}
|
|
14589
14837
|
)
|
|
14590
14838
|
] }),
|
|
14591
|
-
/* @__PURE__ */ (0,
|
|
14839
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
14592
14840
|
ConfirmCloseDialog,
|
|
14593
14841
|
{
|
|
14594
14842
|
open: showConfirmDialog,
|
|
@@ -14639,7 +14887,7 @@ var TrustwareWidgetV2 = (0, import_react40.forwardRef)(function TrustwareWidgetV
|
|
|
14639
14887
|
if (!isOpen) {
|
|
14640
14888
|
return null;
|
|
14641
14889
|
}
|
|
14642
|
-
return /* @__PURE__ */ (0,
|
|
14890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(DepositProvider, { initialStep: effectiveInitialStep, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
14643
14891
|
WidgetInner,
|
|
14644
14892
|
{
|
|
14645
14893
|
theme,
|