@trustware/sdk-staging 1.1.3-staging.33 → 1.1.4-staging.35

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/widget.mjs CHANGED
@@ -57,7 +57,7 @@ var init_constants = __esm({
57
57
  "src/constants.ts"() {
58
58
  "use strict";
59
59
  SDK_NAME = "@trustware/sdk";
60
- SDK_VERSION = "1.1.3-staging.33";
60
+ SDK_VERSION = "1.1.4-staging.35";
61
61
  API_ROOT = "https://bv-staging-api.trustware.io";
62
62
  GTM_ID = "GTM-TZDGNCXB";
63
63
  API_PREFIX = "/api";
@@ -1730,9 +1730,18 @@ async function connectDetectedWallet(dw, opts) {
1730
1730
  throw new Error("WalletConnect connection failed. Please try again.");
1731
1731
  }
1732
1732
  if (dw.via === "solana-window" || dw.meta.ecosystem === "solana") {
1733
- const api2 = toWalletInterfaceFromDetected(dw);
1734
- if (touchAddress) await api2.getAddress();
1735
- return { via: "eip1193", api: api2 };
1733
+ try {
1734
+ const provider = dw.provider;
1735
+ await provider.connect();
1736
+ return {
1737
+ via: "eip1193",
1738
+ api: toWalletInterfaceFromDetected(dw),
1739
+ error: null
1740
+ };
1741
+ } catch (err) {
1742
+ const errorMsg = err instanceof Error ? err.message : String(err);
1743
+ return { via: "eip1193", api: null, error: errorMsg };
1744
+ }
1736
1745
  }
1737
1746
  if (wagmi) {
1738
1747
  const conn = pickWagmiConnector(
@@ -1743,12 +1752,12 @@ async function connectDetectedWallet(dw, opts) {
1743
1752
  );
1744
1753
  if (conn) {
1745
1754
  await wagmi.connect(conn);
1746
- return { via: "wagmi", api: null };
1755
+ return { via: "wagmi", api: null, error: null };
1747
1756
  }
1748
1757
  }
1749
1758
  const api = toWalletInterfaceFromDetected(dw);
1750
1759
  if (touchAddress) await api.getAddress();
1751
- return { via: "eip1193", api };
1760
+ return { via: "eip1193", api, error: null };
1752
1761
  }
1753
1762
 
1754
1763
  // src/wallets/detect.ts
@@ -3271,6 +3280,7 @@ var WalletManager = class {
3271
3280
  this._wallet = null;
3272
3281
  this._detected = [];
3273
3282
  this._listeners = /* @__PURE__ */ new Set();
3283
+ this._error = null;
3274
3284
  this._identity = new IdentityStore();
3275
3285
  this._providerCleanup = null;
3276
3286
  this._connectedWalletId = null;
@@ -3325,18 +3335,25 @@ var WalletManager = class {
3325
3335
  this.clearConnectedWalletState();
3326
3336
  this.emit();
3327
3337
  try {
3328
- const { api } = await connectDetectedWallet(target, {
3338
+ const { api, error } = await connectDetectedWallet(target, {
3329
3339
  wagmi: opts?.wagmi
3330
3340
  });
3331
- if (api) {
3341
+ if (api && !error) {
3332
3342
  this._wallet = api;
3333
3343
  this._connectedWalletId = target.meta.id;
3334
3344
  this.bindProviderEvents(target);
3335
3345
  await this.syncIdentityFromWallet(target.meta.id);
3346
+ this._status = "connected";
3347
+ this._error = null;
3348
+ return { error: null, api };
3349
+ }
3350
+ if (error) {
3351
+ this._status = "error";
3352
+ this._error = error;
3353
+ return { error, api };
3336
3354
  }
3337
- this._status = "connected";
3338
3355
  } catch (e2) {
3339
- this._error = e2;
3356
+ this._error = e2 instanceof Error ? e2.message : String(e2);
3340
3357
  this._status = "error";
3341
3358
  this.clearConnectedWalletState();
3342
3359
  } finally {
@@ -4742,7 +4759,8 @@ function useDepositNavigationState(initialStep) {
4742
4759
  navigationDirection,
4743
4760
  setCurrentStep,
4744
4761
  goBack,
4745
- resetNavigation
4762
+ resetNavigation,
4763
+ setCurrentStepInternal
4746
4764
  };
4747
4765
  }
4748
4766
 
@@ -4822,6 +4840,9 @@ function useWalletSessionState() {
4822
4840
  }, []);
4823
4841
  const connectWallet = useCallback4(async (wallet) => {
4824
4842
  await walletManager.connectDetected(wallet);
4843
+ const error = walletManager.error;
4844
+ const api = walletManager.wallet;
4845
+ return { error, api };
4825
4846
  }, []);
4826
4847
  const disconnectWallet = useCallback4(async () => {
4827
4848
  await walletManager.disconnect();
@@ -5735,6 +5756,7 @@ function useWalletTokenState({
5735
5756
  setSelectedToken
5736
5757
  }) {
5737
5758
  const [yourWalletTokens, setYourWalletTokens] = useState12([]);
5759
+ const [yourWalletTokensLoading, setYourWalletTokensLoading] = useState12(false);
5738
5760
  const [walletTokensReloadNonce, setWalletTokensReloadNonce] = useState12(0);
5739
5761
  const lastLoadedWalletRef = useRef4(null);
5740
5762
  const { tokens } = useTokens(null);
@@ -5755,6 +5777,7 @@ function useWalletTokenState({
5755
5777
  let cancelled = false;
5756
5778
  async function loadWalletTokens() {
5757
5779
  try {
5780
+ setYourWalletTokensLoading(true);
5758
5781
  if (TrustwareConfigStore.get().features.balanceStreaming) {
5759
5782
  let accumulatedBalances = [];
5760
5783
  for await (const chunk of getBalancesByAddressStream(
@@ -5799,6 +5822,10 @@ function useWalletTokenState({
5799
5822
  if (!cancelled) {
5800
5823
  setYourWalletTokens([]);
5801
5824
  }
5825
+ } finally {
5826
+ if (!cancelled) {
5827
+ setYourWalletTokensLoading(false);
5828
+ }
5802
5829
  }
5803
5830
  }
5804
5831
  void loadWalletTokens();
@@ -5813,7 +5840,8 @@ function useWalletTokenState({
5813
5840
  setSelectedToken,
5814
5841
  tokens,
5815
5842
  walletAddress,
5816
- walletTokensReloadNonce
5843
+ walletTokensReloadNonce,
5844
+ setYourWalletTokensLoading
5817
5845
  ]);
5818
5846
  const reloadWalletTokens = () => {
5819
5847
  setWalletTokensReloadNonce((prev) => prev + 1);
@@ -5821,7 +5849,9 @@ function useWalletTokenState({
5821
5849
  return {
5822
5850
  yourWalletTokens,
5823
5851
  setYourWalletTokens,
5824
- reloadWalletTokens
5852
+ reloadWalletTokens,
5853
+ yourWalletTokensLoading,
5854
+ setYourWalletTokensLoading
5825
5855
  };
5826
5856
  }
5827
5857
  function applyWalletTokenState({
@@ -5977,7 +6007,8 @@ function DepositProvider({
5977
6007
  navigationDirection,
5978
6008
  setCurrentStep,
5979
6009
  goBack,
5980
- resetNavigation
6010
+ resetNavigation,
6011
+ setCurrentStepInternal
5981
6012
  } = useDepositNavigationState(initialStep);
5982
6013
  const { resolvedTheme, toggleTheme } = useThemePreference();
5983
6014
  const {
@@ -5993,7 +6024,12 @@ function DepositProvider({
5993
6024
  const [selectedToken, setSelectedToken] = useState13(null);
5994
6025
  const [selectedChain, setSelectedChain] = useState13(null);
5995
6026
  const [amount, setAmount] = useState13("");
5996
- const { yourWalletTokens, setYourWalletTokens, reloadWalletTokens } = useWalletTokenState({
6027
+ const {
6028
+ yourWalletTokens,
6029
+ setYourWalletTokens,
6030
+ reloadWalletTokens,
6031
+ yourWalletTokensLoading
6032
+ } = useWalletTokenState({
5997
6033
  walletAddress,
5998
6034
  selectedChain,
5999
6035
  setSelectedChain,
@@ -6025,7 +6061,8 @@ function DepositProvider({
6025
6061
  goBack,
6026
6062
  resetState,
6027
6063
  stepHistory,
6028
- navigationDirection
6064
+ navigationDirection,
6065
+ setCurrentStepInternal
6029
6066
  }),
6030
6067
  [
6031
6068
  currentStep,
@@ -6033,6 +6070,7 @@ function DepositProvider({
6033
6070
  navigationDirection,
6034
6071
  resetState,
6035
6072
  setCurrentStep,
6073
+ setCurrentStepInternal,
6036
6074
  stepHistory
6037
6075
  ]
6038
6076
  );
@@ -6044,7 +6082,8 @@ function DepositProvider({
6044
6082
  connectWallet,
6045
6083
  disconnectWallet,
6046
6084
  yourWalletTokens,
6047
- setYourWalletTokens
6085
+ setYourWalletTokens,
6086
+ yourWalletTokensLoading
6048
6087
  }),
6049
6088
  [
6050
6089
  connectWallet,
@@ -6053,7 +6092,8 @@ function DepositProvider({
6053
6092
  setYourWalletTokens,
6054
6093
  walletAddress,
6055
6094
  walletStatus,
6056
- yourWalletTokens
6095
+ yourWalletTokens,
6096
+ yourWalletTokensLoading
6057
6097
  ]
6058
6098
  );
6059
6099
  const formValue = useMemo7(
@@ -7309,23 +7349,39 @@ function SwipeToConfirmTokens({
7309
7349
  justifyContent: "center",
7310
7350
  padding: `0 ${spacing[7]}`,
7311
7351
  transition: "opacity 0.2s",
7312
- ...effectiveProgress > 0.15 && { opacity: 0 }
7352
+ ...effectiveProgress > 0.15 && { opacity: 0 },
7353
+ width: "100%"
7313
7354
  },
7314
7355
  children: /* @__PURE__ */ jsx9(
7315
- "span",
7356
+ "div",
7316
7357
  {
7317
7358
  style: {
7318
- fontSize: isVeryLongText ? fontSize.xs : isLongText ? "0.8125rem" : fontSize.sm,
7319
- color: colors.mutedForeground,
7320
- fontWeight: fontWeight.bold,
7321
- lineHeight: 1.15,
7322
- textAlign: "center",
7359
+ minWidth: 0,
7360
+ flex: 1,
7361
+ overflowX: "hidden",
7323
7362
  whiteSpace: "nowrap",
7324
- overflow: "hidden",
7325
- textOverflow: "ellipsis",
7326
- maxWidth: "100%"
7363
+ scrollbarWidth: "none",
7364
+ maxWidth: "85%"
7327
7365
  },
7328
- children: text
7366
+ children: /* @__PURE__ */ jsx9(
7367
+ "span",
7368
+ {
7369
+ style: {
7370
+ display: "block",
7371
+ // + width: "100%",
7372
+ fontSize: isVeryLongText ? fontSize.xs : isLongText ? "0.8125rem" : fontSize.sm,
7373
+ color: colors.mutedForeground,
7374
+ fontWeight: fontWeight.bold,
7375
+ lineHeight: 1.15,
7376
+ textAlign: "center",
7377
+ whiteSpace: "nowrap",
7378
+ overflow: "hidden",
7379
+ textOverflow: "ellipsis",
7380
+ maxWidth: "100%"
7381
+ },
7382
+ children: text
7383
+ }
7384
+ )
7329
7385
  }
7330
7386
  )
7331
7387
  }
@@ -12265,6 +12321,7 @@ function useHomeWalletActions({
12265
12321
  connectWallet,
12266
12322
  detectedWallets,
12267
12323
  setCurrentStep
12324
+ // setCurrentStepInternal,
12268
12325
  }) {
12269
12326
  const [isCryptoDropdownOpen, setIsCryptoDropdownOpen] = useState21(false);
12270
12327
  const [isFiatDropdownOpen, setIsFiatDropdownOpen] = useState21(false);
@@ -12286,12 +12343,18 @@ function useHomeWalletActions({
12286
12343
  useEffect22(() => {
12287
12344
  getUniversalConnector().then(setUniversalConnector);
12288
12345
  }, []);
12346
+ const { resetNavigation } = useDepositNavigationState("home");
12289
12347
  const handleWalletSelect = async (wallet) => {
12290
12348
  setIsCryptoDropdownOpen(false);
12291
12349
  try {
12292
- await connectWallet(wallet);
12350
+ const { error } = await connectWallet(wallet);
12351
+ if (error) {
12352
+ resetNavigation();
12353
+ return;
12354
+ }
12293
12355
  setCurrentStep("crypto-pay");
12294
12356
  } catch {
12357
+ resetNavigation();
12295
12358
  }
12296
12359
  };
12297
12360
  const handleFiatSelect = () => {
@@ -12327,7 +12390,7 @@ function useHomeWalletActions({
12327
12390
  import { jsx as jsx42, jsxs as jsxs33 } from "react/jsx-runtime";
12328
12391
  function Home({ style: _style }) {
12329
12392
  const { amount, setAmount, amountInputMode, setAmountInputMode } = useDepositForm();
12330
- const { setCurrentStep } = useDepositNavigation();
12393
+ const { setCurrentStep, setCurrentStepInternal } = useDepositNavigation();
12331
12394
  const { connectWallet } = useDepositWallet();
12332
12395
  const { resolvedTheme } = useDepositUi();
12333
12396
  const { fixedFromAmountString, isFixedAmount, minAmountUsd, maxAmountUsd } = useAmountConstraints();
@@ -12356,7 +12419,8 @@ function Home({ style: _style }) {
12356
12419
  } = useHomeWalletActions({
12357
12420
  connectWallet,
12358
12421
  detectedWallets,
12359
- setCurrentStep
12422
+ setCurrentStep,
12423
+ setCurrentStepInternal
12360
12424
  });
12361
12425
  return /* @__PURE__ */ jsxs33(
12362
12426
  "div",
@@ -12636,7 +12700,7 @@ function SelectToken({ style }) {
12636
12700
  );
12637
12701
  }
12638
12702
 
12639
- // src/widget/pages/CryptoPay.tsx
12703
+ // src/widget/pages/CryptoPay/index.tsx
12640
12704
  import { useEffect as useEffect24, useMemo as useMemo18 } from "react";
12641
12705
 
12642
12706
  // src/widget/features/route-preview/hooks/useRoutePreviewModel.ts
@@ -13490,8 +13554,180 @@ function useTransactionActionModel({
13490
13554
  };
13491
13555
  }
13492
13556
 
13493
- // src/widget/pages/CryptoPay.tsx
13494
- import { Fragment as Fragment6, jsx as jsx47, jsxs as jsxs37 } from "react/jsx-runtime";
13557
+ // src/widget/pages/CryptoPay/DefaultCryptoPay.tsx
13558
+ import { jsx as jsx47, jsxs as jsxs37 } from "react/jsx-runtime";
13559
+ var IconWallet = ({ style }) => /* @__PURE__ */ jsxs37(
13560
+ "svg",
13561
+ {
13562
+ xmlns: "http://www.w3.org/2000/svg",
13563
+ width: "24",
13564
+ height: "24",
13565
+ viewBox: "0 0 24 24",
13566
+ fill: "none",
13567
+ stroke: "currentColor",
13568
+ strokeWidth: "1.75",
13569
+ strokeLinecap: "round",
13570
+ strokeLinejoin: "round",
13571
+ style,
13572
+ children: [
13573
+ /* @__PURE__ */ jsx47("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" }),
13574
+ /* @__PURE__ */ jsx47("path", { d: "M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4" })
13575
+ ]
13576
+ }
13577
+ );
13578
+ var IconSparkles = ({ style }) => /* @__PURE__ */ jsxs37(
13579
+ "svg",
13580
+ {
13581
+ xmlns: "http://www.w3.org/2000/svg",
13582
+ width: "24",
13583
+ height: "24",
13584
+ viewBox: "0 0 24 24",
13585
+ fill: "none",
13586
+ stroke: "currentColor",
13587
+ strokeWidth: "2",
13588
+ strokeLinecap: "round",
13589
+ strokeLinejoin: "round",
13590
+ style,
13591
+ children: [
13592
+ /* @__PURE__ */ jsx47("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" }),
13593
+ /* @__PURE__ */ jsx47("path", { d: "M5 3v4" }),
13594
+ /* @__PURE__ */ jsx47("path", { d: "M19 17v4" }),
13595
+ /* @__PURE__ */ jsx47("path", { d: "M3 5h4" }),
13596
+ /* @__PURE__ */ jsx47("path", { d: "M17 19h4" })
13597
+ ]
13598
+ }
13599
+ );
13600
+ function DefaultCryptoPay() {
13601
+ return /* @__PURE__ */ jsx47(
13602
+ "div",
13603
+ {
13604
+ style: {
13605
+ width: "100%",
13606
+ minHeight: "100%",
13607
+ display: "flex",
13608
+ alignItems: "center",
13609
+ justifyContent: "center",
13610
+ flexDirection: "column"
13611
+ },
13612
+ children: /* @__PURE__ */ jsxs37(
13613
+ "div",
13614
+ {
13615
+ style: {
13616
+ textAlign: "center",
13617
+ flexDirection: "column",
13618
+ display: "flex",
13619
+ alignItems: "center",
13620
+ justifyContent: "center",
13621
+ padding: "2rem"
13622
+ },
13623
+ children: [
13624
+ /* @__PURE__ */ jsxs37(
13625
+ "div",
13626
+ {
13627
+ style: {
13628
+ position: "relative",
13629
+ marginBottom: "1.25rem",
13630
+ display: "inline-block"
13631
+ },
13632
+ children: [
13633
+ /* @__PURE__ */ jsx47(
13634
+ "div",
13635
+ {
13636
+ style: {
13637
+ position: "absolute",
13638
+ inset: 0,
13639
+ borderRadius: "9999px",
13640
+ background: `linear-gradient(135deg, ${colors.green[500]} 0%, ${colors.green[300]} 100%)`,
13641
+ opacity: 0.2,
13642
+ filter: "blur(1rem)"
13643
+ }
13644
+ }
13645
+ ),
13646
+ /* @__PURE__ */ jsx47(
13647
+ "div",
13648
+ {
13649
+ style: {
13650
+ position: "relative",
13651
+ height: "5rem",
13652
+ width: "5rem",
13653
+ borderRadius: "9999px",
13654
+ backgroundColor: colors.card,
13655
+ border: `1px solid ${colors.border}`,
13656
+ display: "flex",
13657
+ alignItems: "center",
13658
+ justifyContent: "center"
13659
+ },
13660
+ children: /* @__PURE__ */ jsx47(
13661
+ IconWallet,
13662
+ {
13663
+ style: {
13664
+ color: colors.green[300]
13665
+ }
13666
+ }
13667
+ )
13668
+ }
13669
+ )
13670
+ ]
13671
+ }
13672
+ ),
13673
+ /* @__PURE__ */ jsxs37(
13674
+ "div",
13675
+ {
13676
+ style: {
13677
+ display: "inline-flex",
13678
+ alignItems: "center",
13679
+ gap: "0.375rem",
13680
+ fontSize: "0.75rem",
13681
+ fontWeight: 500,
13682
+ color: "hsl(158, 84%, 52%)",
13683
+ backgroundColor: "hsla(158, 84%, 52%, 0.1)",
13684
+ border: `1px solid hsla(158, 84%, 52%, 0.2)`,
13685
+ borderRadius: "9999px",
13686
+ padding: "0.25rem 0.75rem",
13687
+ marginBottom: "0.75rem"
13688
+ },
13689
+ children: [
13690
+ /* @__PURE__ */ jsx47(IconSparkles, {}),
13691
+ "Wallet is empty"
13692
+ ]
13693
+ }
13694
+ ),
13695
+ /* @__PURE__ */ jsx47(
13696
+ "h2",
13697
+ {
13698
+ style: {
13699
+ fontSize: "1.5rem",
13700
+ fontWeight: 600,
13701
+ letterSpacing: "-0.025em",
13702
+ marginBottom: "0.375rem",
13703
+ color: colors.foreground
13704
+ },
13705
+ children: "Deposit assets to swap or bridge."
13706
+ }
13707
+ ),
13708
+ /* @__PURE__ */ jsx47(
13709
+ "p",
13710
+ {
13711
+ style: {
13712
+ fontSize: "0.875rem",
13713
+ color: colors.mutedForeground,
13714
+ maxWidth: "24rem",
13715
+ margin: "0 auto",
13716
+ lineHeight: 1.625
13717
+ },
13718
+ children: "You'll need tokens before you can swap or bridge."
13719
+ }
13720
+ )
13721
+ ]
13722
+ }
13723
+ )
13724
+ }
13725
+ );
13726
+ }
13727
+ var DefaultCryptoPay_default = DefaultCryptoPay;
13728
+
13729
+ // src/widget/pages/CryptoPay/index.tsx
13730
+ import { Fragment as Fragment6, jsx as jsx48, jsxs as jsxs38 } from "react/jsx-runtime";
13495
13731
  var SHOW_FEE_SUMMARY = false;
13496
13732
  function CryptoPay({ style: _style }) {
13497
13733
  const {
@@ -13504,7 +13740,12 @@ function CryptoPay({ style: _style }) {
13504
13740
  amountInputMode,
13505
13741
  setAmountInputMode
13506
13742
  } = useDepositForm();
13507
- const { walletAddress, walletStatus, yourWalletTokens } = useDepositWallet();
13743
+ const {
13744
+ walletAddress,
13745
+ walletStatus,
13746
+ yourWalletTokens,
13747
+ yourWalletTokensLoading
13748
+ } = useDepositWallet();
13508
13749
  const { goBack, setCurrentStep, currentStep } = useDepositNavigation();
13509
13750
  const config = useTrustwareConfig();
13510
13751
  const { fixedFromAmountString, isFixedAmount, minAmountUsd, maxAmountUsd } = useAmountConstraints();
@@ -13513,11 +13754,15 @@ function CryptoPay({ style: _style }) {
13513
13754
  const n = Number(raw);
13514
13755
  return Number.isFinite(n) && n > 0 ? n : void 0;
13515
13756
  }, [config.routes?.options?.routeRefreshMs]);
13516
- const isReady = useMemo18(() => {
13517
- if (selectedToken !== null && yourWalletTokens.length > 0 && selectedToken?.chainData !== void 0) {
13518
- return true;
13519
- }
13520
- }, [selectedToken, yourWalletTokens.length]);
13757
+ const IsPos = (x) => x !== null && x !== void 0 && x.balance !== "0";
13758
+ const showDefaultCryptoPay = useMemo18(() => {
13759
+ const nonZer0Tks = (yourWalletTokens ?? []).filter(IsPos);
13760
+ return !yourWalletTokensLoading && nonZer0Tks.length === 0 && yourWalletTokens.length > 0;
13761
+ }, [yourWalletTokens, yourWalletTokensLoading]);
13762
+ const showSkeleton = useMemo18(() => {
13763
+ return yourWalletTokensLoading || (yourWalletTokens ?? []).length === 0;
13764
+ }, [yourWalletTokens, yourWalletTokensLoading]);
13765
+ const isReady = !yourWalletTokensLoading && selectedToken != null && selectedToken?.chainData !== void 0 && !showDefaultCryptoPay && !showSkeleton;
13521
13766
  const {
13522
13767
  amountComputation,
13523
13768
  amountValidationError,
@@ -13620,7 +13865,7 @@ function CryptoPay({ style: _style }) {
13620
13865
  const handleExpandTokens = () => {
13621
13866
  setCurrentStep("select-token");
13622
13867
  };
13623
- return /* @__PURE__ */ jsxs37(
13868
+ return /* @__PURE__ */ jsxs38(
13624
13869
  "div",
13625
13870
  {
13626
13871
  style: {
@@ -13629,56 +13874,8 @@ function CryptoPay({ style: _style }) {
13629
13874
  minHeight: "500px"
13630
13875
  },
13631
13876
  children: [
13632
- /* @__PURE__ */ jsx47(WidgetPageHeader, { onBack: goBack, title: "Confirm Deposit" }),
13633
- isReady ? /* @__PURE__ */ jsxs37(Fragment6, { children: [
13634
- /* @__PURE__ */ jsx47(
13635
- CryptoPayAmountSection,
13636
- {
13637
- amount,
13638
- amountComputation,
13639
- amountInputMode,
13640
- estimatedReceive,
13641
- effectiveSliderMax,
13642
- effectiveSliderMin,
13643
- gasReservationWei,
13644
- handleAmountChange,
13645
- handleExpandTokens,
13646
- handleSliderChange,
13647
- handleTokenChange,
13648
- hasUsdPrice,
13649
- isFixedAmount,
13650
- isLoadingRoute,
13651
- normalizedTokenBalance,
13652
- orderedTokens,
13653
- parsedAmount,
13654
- selectedChain,
13655
- selectedToken: readySelectedToken,
13656
- setAmountInputMode,
13657
- showFeeSummary: SHOW_FEE_SUMMARY,
13658
- tokenPriceUSD,
13659
- walletAddress,
13660
- yourWalletTokensLength: yourWalletTokens.length
13661
- }
13662
- ),
13663
- /* @__PURE__ */ jsx47(
13664
- CryptoPaySwipeSection,
13665
- {
13666
- actionErrorMessage,
13667
- canSwipe,
13668
- destinationConfig,
13669
- fromChainName: selectedChain?.networkName,
13670
- handleSwipeConfirm,
13671
- isApproving,
13672
- isLoadingRoute,
13673
- isReadingAllowance,
13674
- isWalletConnected,
13675
- needsApproval,
13676
- selectedToken: readySelectedToken,
13677
- swipeResetKey
13678
- }
13679
- ),
13680
- /* @__PURE__ */ jsx47(WidgetSecurityFooter, {})
13681
- ] }) : /* @__PURE__ */ jsx47(
13877
+ /* @__PURE__ */ jsx48(WidgetPageHeader, { onBack: goBack, title: "Confirm Deposit" }),
13878
+ showSkeleton ? /* @__PURE__ */ jsx48(Fragment6, { children: /* @__PURE__ */ jsx48(
13682
13879
  "div",
13683
13880
  {
13684
13881
  style: {
@@ -13687,9 +13884,60 @@ function CryptoPay({ style: _style }) {
13687
13884
  alignItems: "center",
13688
13885
  justifyContent: "center"
13689
13886
  },
13690
- children: /* @__PURE__ */ jsx47(LoadingSkeleton, {})
13887
+ children: /* @__PURE__ */ jsx48(LoadingSkeleton, {})
13691
13888
  }
13692
- )
13889
+ ) }) : /* @__PURE__ */ jsxs38(Fragment6, { children: [
13890
+ isReady && /* @__PURE__ */ jsxs38(Fragment6, { children: [
13891
+ /* @__PURE__ */ jsx48(
13892
+ CryptoPayAmountSection,
13893
+ {
13894
+ amount,
13895
+ amountComputation,
13896
+ amountInputMode,
13897
+ estimatedReceive,
13898
+ effectiveSliderMax,
13899
+ effectiveSliderMin,
13900
+ gasReservationWei,
13901
+ handleAmountChange,
13902
+ handleExpandTokens,
13903
+ handleSliderChange,
13904
+ handleTokenChange,
13905
+ hasUsdPrice,
13906
+ isFixedAmount,
13907
+ isLoadingRoute,
13908
+ normalizedTokenBalance,
13909
+ orderedTokens,
13910
+ parsedAmount,
13911
+ selectedChain,
13912
+ selectedToken: readySelectedToken,
13913
+ setAmountInputMode,
13914
+ showFeeSummary: SHOW_FEE_SUMMARY,
13915
+ tokenPriceUSD,
13916
+ walletAddress,
13917
+ yourWalletTokensLength: yourWalletTokens.length
13918
+ }
13919
+ ),
13920
+ /* @__PURE__ */ jsx48(
13921
+ CryptoPaySwipeSection,
13922
+ {
13923
+ actionErrorMessage,
13924
+ canSwipe,
13925
+ destinationConfig,
13926
+ fromChainName: selectedChain?.networkName,
13927
+ handleSwipeConfirm,
13928
+ isApproving,
13929
+ isLoadingRoute,
13930
+ isReadingAllowance,
13931
+ isWalletConnected,
13932
+ needsApproval,
13933
+ selectedToken: readySelectedToken,
13934
+ swipeResetKey
13935
+ }
13936
+ ),
13937
+ /* @__PURE__ */ jsx48(WidgetSecurityFooter, {})
13938
+ ] }),
13939
+ showDefaultCryptoPay && /* @__PURE__ */ jsx48(DefaultCryptoPay_default, {})
13940
+ ] })
13693
13941
  ]
13694
13942
  }
13695
13943
  );
@@ -13697,7 +13945,7 @@ function CryptoPay({ style: _style }) {
13697
13945
 
13698
13946
  // src/widget/pages/Processing.tsx
13699
13947
  import { useEffect as useEffect25, useMemo as useMemo19, useRef as useRef12 } from "react";
13700
- import { jsx as jsx48, jsxs as jsxs38 } from "react/jsx-runtime";
13948
+ import { jsx as jsx49, jsxs as jsxs39 } from "react/jsx-runtime";
13701
13949
  function getProgressFromStatus(status) {
13702
13950
  switch (status) {
13703
13951
  case "confirming":
@@ -13773,7 +14021,7 @@ function Processing({ style }) {
13773
14021
  };
13774
14022
  const isIndeterminate = transactionStatus === "confirming" || transactionStatus === "idle";
13775
14023
  const headerTitle = transactionStatus === "success" ? "Complete" : transactionStatus === "error" ? "Failed" : "Processing";
13776
- return /* @__PURE__ */ jsxs38(
14024
+ return /* @__PURE__ */ jsxs39(
13777
14025
  "div",
13778
14026
  {
13779
14027
  style: {
@@ -13783,8 +14031,8 @@ function Processing({ style }) {
13783
14031
  ...style
13784
14032
  },
13785
14033
  children: [
13786
- /* @__PURE__ */ jsx48(WidgetPageHeader, { onClose: handleClose, title: headerTitle }),
13787
- /* @__PURE__ */ jsxs38(
14034
+ /* @__PURE__ */ jsx49(WidgetPageHeader, { onClose: handleClose, title: headerTitle }),
14035
+ /* @__PURE__ */ jsxs39(
13788
14036
  "div",
13789
14037
  {
13790
14038
  style: {
@@ -13796,13 +14044,13 @@ function Processing({ style }) {
13796
14044
  padding: `${spacing[8]} ${spacing[6]}`
13797
14045
  },
13798
14046
  children: [
13799
- /* @__PURE__ */ jsx48(
14047
+ /* @__PURE__ */ jsx49(
13800
14048
  "div",
13801
14049
  {
13802
14050
  style: {
13803
14051
  marginBottom: spacing[6]
13804
14052
  },
13805
- children: /* @__PURE__ */ jsx48(
14053
+ children: /* @__PURE__ */ jsx49(
13806
14054
  CircularProgress,
13807
14055
  {
13808
14056
  progress,
@@ -13814,7 +14062,7 @@ function Processing({ style }) {
13814
14062
  )
13815
14063
  }
13816
14064
  ),
13817
- /* @__PURE__ */ jsx48(
14065
+ /* @__PURE__ */ jsx49(
13818
14066
  "p",
13819
14067
  {
13820
14068
  style: {
@@ -13827,7 +14075,7 @@ function Processing({ style }) {
13827
14075
  children: stepText
13828
14076
  }
13829
14077
  ),
13830
- selectedToken && parsedAmount > 0 && /* @__PURE__ */ jsxs38(
14078
+ selectedToken && parsedAmount > 0 && /* @__PURE__ */ jsxs39(
13831
14079
  "p",
13832
14080
  {
13833
14081
  style: {
@@ -13844,7 +14092,7 @@ function Processing({ style }) {
13844
14092
  ]
13845
14093
  }
13846
14094
  ),
13847
- /* @__PURE__ */ jsx48(
14095
+ /* @__PURE__ */ jsx49(
13848
14096
  TransactionSteps,
13849
14097
  {
13850
14098
  transactionStatus,
@@ -13855,7 +14103,7 @@ function Processing({ style }) {
13855
14103
  }
13856
14104
  }
13857
14105
  ),
13858
- transactionHash ? /* @__PURE__ */ jsx48(
14106
+ transactionHash ? /* @__PURE__ */ jsx49(
13859
14107
  TransactionHashLink,
13860
14108
  {
13861
14109
  explorerUrl,
@@ -13863,7 +14111,7 @@ function Processing({ style }) {
13863
14111
  label: "Transaction"
13864
14112
  }
13865
14113
  ) : null,
13866
- transactionStatus === "error" && /* @__PURE__ */ jsx48(
14114
+ transactionStatus === "error" && /* @__PURE__ */ jsx49(
13867
14115
  "button",
13868
14116
  {
13869
14117
  type: "button",
@@ -13885,7 +14133,7 @@ function Processing({ style }) {
13885
14133
  ]
13886
14134
  }
13887
14135
  ),
13888
- /* @__PURE__ */ jsx48(WidgetSecurityFooter, {})
14136
+ /* @__PURE__ */ jsx49(WidgetSecurityFooter, {})
13889
14137
  ]
13890
14138
  }
13891
14139
  );
@@ -13893,7 +14141,7 @@ function Processing({ style }) {
13893
14141
 
13894
14142
  // src/widget/pages/Success.tsx
13895
14143
  import { lazy, Suspense, useMemo as useMemo20 } from "react";
13896
- import { jsx as jsx49, jsxs as jsxs39 } from "react/jsx-runtime";
14144
+ import { jsx as jsx50, jsxs as jsxs40 } from "react/jsx-runtime";
13897
14145
  var ConfettiEffect2 = lazy(() => Promise.resolve().then(() => (init_ConfettiEffect(), ConfettiEffect_exports)));
13898
14146
  function Success({ style }) {
13899
14147
  const { selectedToken, selectedChain, amount } = useDepositForm();
@@ -13916,7 +14164,7 @@ function Success({ style }) {
13916
14164
  const handleDone = () => {
13917
14165
  resetState();
13918
14166
  };
13919
- return /* @__PURE__ */ jsxs39(
14167
+ return /* @__PURE__ */ jsxs40(
13920
14168
  "div",
13921
14169
  {
13922
14170
  style: {
@@ -13929,9 +14177,9 @@ function Success({ style }) {
13929
14177
  ...style
13930
14178
  },
13931
14179
  children: [
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(
14180
+ /* @__PURE__ */ jsx50(Suspense, { fallback: null, children: /* @__PURE__ */ jsx50(ConfettiEffect2, { isActive: true, pieceCount: 60, clearDelay: 4e3 }) }),
14181
+ /* @__PURE__ */ jsx50(WidgetPageHeader, { title: "Deposit Complete" }),
14182
+ /* @__PURE__ */ jsx50(
13935
14183
  "div",
13936
14184
  {
13937
14185
  style: {
@@ -13943,7 +14191,7 @@ function Success({ style }) {
13943
14191
  flexDirection: "column",
13944
14192
  alignItems: "center"
13945
14193
  },
13946
- children: /* @__PURE__ */ jsx49(
14194
+ children: /* @__PURE__ */ jsx50(
13947
14195
  SuccessSummaryCard,
13948
14196
  {
13949
14197
  amount: parsedAmount,
@@ -13957,7 +14205,7 @@ function Success({ style }) {
13957
14205
  )
13958
14206
  }
13959
14207
  ),
13960
- /* @__PURE__ */ jsx49(WidgetSecurityFooter, {})
14208
+ /* @__PURE__ */ jsx50(WidgetSecurityFooter, {})
13961
14209
  ]
13962
14210
  }
13963
14211
  );
@@ -13966,7 +14214,7 @@ function Success({ style }) {
13966
14214
  // src/widget/pages/Error.tsx
13967
14215
  import { useMemo as useMemo21, useEffect as useEffect26 } from "react";
13968
14216
  init_store();
13969
- import { jsx as jsx50, jsxs as jsxs40 } from "react/jsx-runtime";
14217
+ import { jsx as jsx51, jsxs as jsxs41 } from "react/jsx-runtime";
13970
14218
  function categorizeError(errorMessage) {
13971
14219
  if (!errorMessage) return "unknown";
13972
14220
  const msg = errorMessage.toLowerCase();
@@ -14096,7 +14344,7 @@ function Error2({ style }) {
14096
14344
  }, [transactionHash, selectedChain]);
14097
14345
  const renderErrorIcon = () => {
14098
14346
  if (errorCategory === "wallet_rejected") {
14099
- return /* @__PURE__ */ jsx50(
14347
+ return /* @__PURE__ */ jsx51(
14100
14348
  "svg",
14101
14349
  {
14102
14350
  style: {
@@ -14109,7 +14357,7 @@ function Error2({ style }) {
14109
14357
  stroke: "currentColor",
14110
14358
  strokeWidth: 2.5,
14111
14359
  "aria-hidden": "true",
14112
- children: /* @__PURE__ */ jsx50(
14360
+ children: /* @__PURE__ */ jsx51(
14113
14361
  "path",
14114
14362
  {
14115
14363
  strokeLinecap: "round",
@@ -14121,7 +14369,7 @@ function Error2({ style }) {
14121
14369
  );
14122
14370
  }
14123
14371
  if (errorCategory === "network_error") {
14124
- return /* @__PURE__ */ jsx50(
14372
+ return /* @__PURE__ */ jsx51(
14125
14373
  "svg",
14126
14374
  {
14127
14375
  style: {
@@ -14134,7 +14382,7 @@ function Error2({ style }) {
14134
14382
  stroke: "currentColor",
14135
14383
  strokeWidth: 2,
14136
14384
  "aria-hidden": "true",
14137
- children: /* @__PURE__ */ jsx50(
14385
+ children: /* @__PURE__ */ jsx51(
14138
14386
  "path",
14139
14387
  {
14140
14388
  strokeLinecap: "round",
@@ -14145,7 +14393,7 @@ function Error2({ style }) {
14145
14393
  }
14146
14394
  );
14147
14395
  }
14148
- return /* @__PURE__ */ jsx50(
14396
+ return /* @__PURE__ */ jsx51(
14149
14397
  "svg",
14150
14398
  {
14151
14399
  style: {
@@ -14158,7 +14406,7 @@ function Error2({ style }) {
14158
14406
  stroke: "currentColor",
14159
14407
  strokeWidth: 2,
14160
14408
  "aria-hidden": "true",
14161
- children: /* @__PURE__ */ jsx50(
14409
+ children: /* @__PURE__ */ jsx51(
14162
14410
  "path",
14163
14411
  {
14164
14412
  strokeLinecap: "round",
@@ -14169,7 +14417,7 @@ function Error2({ style }) {
14169
14417
  }
14170
14418
  );
14171
14419
  };
14172
- return /* @__PURE__ */ jsxs40(
14420
+ return /* @__PURE__ */ jsxs41(
14173
14421
  "div",
14174
14422
  {
14175
14423
  style: {
@@ -14179,8 +14427,8 @@ function Error2({ style }) {
14179
14427
  ...style
14180
14428
  },
14181
14429
  children: [
14182
- /* @__PURE__ */ jsx50(WidgetPageHeader, { title: errorTitle }),
14183
- /* @__PURE__ */ jsx50(
14430
+ /* @__PURE__ */ jsx51(WidgetPageHeader, { title: errorTitle }),
14431
+ /* @__PURE__ */ jsx51(
14184
14432
  ErrorRecoveryCard,
14185
14433
  {
14186
14434
  errorMessage,
@@ -14193,7 +14441,7 @@ function Error2({ style }) {
14193
14441
  transactionHash
14194
14442
  }
14195
14443
  ),
14196
- /* @__PURE__ */ jsx50(WidgetSecurityFooter, {})
14444
+ /* @__PURE__ */ jsx51(WidgetSecurityFooter, {})
14197
14445
  ]
14198
14446
  }
14199
14447
  );
@@ -14215,7 +14463,7 @@ var ACTIVE_TRANSACTION_STATUSES = [
14215
14463
  ];
14216
14464
 
14217
14465
  // src/widget/app/WidgetRouter.tsx
14218
- import { jsx as jsx51 } from "react/jsx-runtime";
14466
+ import { jsx as jsx52 } from "react/jsx-runtime";
14219
14467
  var pageContainerBaseStyle = {
14220
14468
  width: "100%",
14221
14469
  height: "100%",
@@ -14233,19 +14481,19 @@ function WidgetRouter({
14233
14481
  const animationClass = useMemo22(() => {
14234
14482
  return navigationDirection === "forward" ? "tw-animate-slide-in-right" : "tw-animate-slide-in-left";
14235
14483
  }, [navigationDirection]);
14236
- return /* @__PURE__ */ jsx51(
14484
+ return /* @__PURE__ */ jsx52(
14237
14485
  "div",
14238
14486
  {
14239
14487
  className: animationClass,
14240
14488
  style: mergeStyles(pageContainerBaseStyle),
14241
- children: /* @__PURE__ */ jsx51(PageComponent, {})
14489
+ children: /* @__PURE__ */ jsx52(PageComponent, {})
14242
14490
  },
14243
14491
  `${currentStep}-${stepHistory.length}`
14244
14492
  );
14245
14493
  }
14246
14494
 
14247
14495
  // src/widget/TrustwareWidgetV2.tsx
14248
- import { Fragment as Fragment7, jsx as jsx52, jsxs as jsxs41 } from "react/jsx-runtime";
14496
+ import { Fragment as Fragment7, jsx as jsx53, jsxs as jsxs42 } from "react/jsx-runtime";
14249
14497
  var widgetContentContainerStyle = {
14250
14498
  position: "relative",
14251
14499
  width: "100%",
@@ -14287,9 +14535,9 @@ function WidgetContent({
14287
14535
  transactionStatus,
14288
14536
  onStateChange
14289
14537
  ]);
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(
14538
+ return /* @__PURE__ */ jsxs42("div", { style: mergeStyles(widgetContentContainerStyle, style), children: [
14539
+ showThemeToggle && /* @__PURE__ */ jsx53("div", { style: themeToggleContainerStyle, children: /* @__PURE__ */ jsx53(ThemeToggle, { theme: resolvedTheme, onToggle: toggleTheme }) }),
14540
+ /* @__PURE__ */ jsx53(
14293
14541
  WidgetRouter,
14294
14542
  {
14295
14543
  currentStep,
@@ -14338,16 +14586,16 @@ function WidgetInner({
14338
14586
  const handleRefresh = useCallback15(() => {
14339
14587
  revalidate?.();
14340
14588
  }, [revalidate]);
14341
- return /* @__PURE__ */ jsxs41(Fragment7, { children: [
14342
- /* @__PURE__ */ jsxs41(WidgetContainer, { theme: effectiveTheme, style, children: [
14343
- /* @__PURE__ */ jsx52(
14589
+ return /* @__PURE__ */ jsxs42(Fragment7, { children: [
14590
+ /* @__PURE__ */ jsxs42(WidgetContainer, { theme: effectiveTheme, style, children: [
14591
+ /* @__PURE__ */ jsx53(
14344
14592
  WidgetContent,
14345
14593
  {
14346
14594
  onStateChange,
14347
14595
  showThemeToggle
14348
14596
  }
14349
14597
  ),
14350
- /* @__PURE__ */ jsx52(
14598
+ /* @__PURE__ */ jsx53(
14351
14599
  InitErrorOverlay,
14352
14600
  {
14353
14601
  open: initBlocked,
@@ -14357,7 +14605,7 @@ function WidgetInner({
14357
14605
  }
14358
14606
  )
14359
14607
  ] }),
14360
- /* @__PURE__ */ jsx52(
14608
+ /* @__PURE__ */ jsx53(
14361
14609
  ConfirmCloseDialog,
14362
14610
  {
14363
14611
  open: showConfirmDialog,
@@ -14408,7 +14656,7 @@ var TrustwareWidgetV2 = forwardRef(function TrustwareWidgetV22({
14408
14656
  if (!isOpen) {
14409
14657
  return null;
14410
14658
  }
14411
- return /* @__PURE__ */ jsx52(DepositProvider, { initialStep: effectiveInitialStep, children: /* @__PURE__ */ jsx52(
14659
+ return /* @__PURE__ */ jsx53(DepositProvider, { initialStep: effectiveInitialStep, children: /* @__PURE__ */ jsx53(
14412
14660
  WidgetInner,
14413
14661
  {
14414
14662
  theme,