@swype-org/react-sdk 0.1.206 → 0.1.208

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1905,6 +1905,7 @@ function paymentReducer(state, action) {
1905
1905
  ...state,
1906
1906
  selectedAccountId: action.accountId,
1907
1907
  selectedWalletId: action.walletId,
1908
+ selectedTokenSymbol: null,
1908
1909
  step: "deposit"
1909
1910
  };
1910
1911
  case "SELECT_TOKEN":
@@ -3888,6 +3889,7 @@ function DepositScreen({
3888
3889
  const selectedAccount = accounts?.find((a) => a.id === selectedAccountId);
3889
3890
  const selectedProviderName = selectedAccount?.name ?? "Wallet";
3890
3891
  const selectedProviderLogo = KNOWN_LOGOS[selectedProviderName.toLowerCase()];
3892
+ const totalAccountBalance = selectedAccount ? selectedAccount.wallets.reduce((sum, w) => sum + w.balance.available.amount, 0) : availableBalance;
3891
3893
  const isLowBalance = availableBalance < MIN_DEPOSIT;
3892
3894
  const exceedsLimit = remainingLimit != null && amount > remainingLimit && !isLowBalance;
3893
3895
  const canDeposit = amount >= MIN_DEPOSIT && !exceedsLimit && !isLowBalance && !processing;
@@ -3934,7 +3936,7 @@ function DepositScreen({
3934
3936
  selectedProviderLogo ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: selectedProviderLogo, alt: selectedProviderName, style: providerLogoStyle }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: providerFallbackStyle(tokens.textMuted), children: selectedProviderName.charAt(0) }),
3935
3937
  /* @__PURE__ */ jsxRuntime.jsxs("span", { style: walletBalanceStyle(tokens.text), children: [
3936
3938
  "$",
3937
- availableBalance.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })
3939
+ totalAccountBalance.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })
3938
3940
  ] }),
3939
3941
  /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", style: { opacity: 0.4 }, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7 10l5-5 5 5M7 14l5 5 5-5", stroke: tokens.textMuted, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })
3940
3942
  ]
@@ -5622,7 +5624,7 @@ function StepRendererContent({
5622
5624
  {
5623
5625
  merchantName,
5624
5626
  availableBalance: selectedSource ? selectedSource.balance.available.amount : selectedAccount ? selectedAccount.wallets.reduce((sum, w) => sum + w.balance.available.amount, 0) : maxSourceBalance,
5625
- remainingLimit: selectedSource?.remainingAllowance ?? selectedAccount?.remainingAllowance ?? null,
5627
+ remainingLimit: selectedSource != null ? selectedSource.remainingAllowance ?? null : selectedAccount?.remainingAllowance ?? null,
5626
5628
  tokenCount,
5627
5629
  initialAmount: parsedAmt,
5628
5630
  processing: state.creatingTransfer,
@@ -5706,7 +5708,7 @@ function StepRendererContent({
5706
5708
  merchantName,
5707
5709
  sourceName,
5708
5710
  remainingLimit: succeeded ? (() => {
5709
- const limit = selectedSource?.remainingAllowance ?? selectedAccount?.remainingAllowance ?? null;
5711
+ const limit = selectedSource != null ? selectedSource.remainingAllowance ?? null : selectedAccount?.remainingAllowance ?? null;
5710
5712
  if (limit == null) return null;
5711
5713
  return limit > displayAmount ? limit - displayAmount : 0;
5712
5714
  })() : void 0,
@@ -5722,7 +5724,7 @@ function StepRendererContent({
5722
5724
  {
5723
5725
  merchantName,
5724
5726
  availableBalance: 0,
5725
- remainingLimit: selectedSource?.remainingAllowance ?? selectedAccount?.remainingAllowance ?? null,
5727
+ remainingLimit: selectedSource != null ? selectedSource.remainingAllowance ?? null : selectedAccount?.remainingAllowance ?? null,
5726
5728
  tokenCount,
5727
5729
  initialAmount: depositAmount ?? 5,
5728
5730
  processing: false,