@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.js CHANGED
@@ -1902,6 +1902,7 @@ function paymentReducer(state, action) {
1902
1902
  ...state,
1903
1903
  selectedAccountId: action.accountId,
1904
1904
  selectedWalletId: action.walletId,
1905
+ selectedTokenSymbol: null,
1905
1906
  step: "deposit"
1906
1907
  };
1907
1908
  case "SELECT_TOKEN":
@@ -3885,6 +3886,7 @@ function DepositScreen({
3885
3886
  const selectedAccount = accounts?.find((a) => a.id === selectedAccountId);
3886
3887
  const selectedProviderName = selectedAccount?.name ?? "Wallet";
3887
3888
  const selectedProviderLogo = KNOWN_LOGOS[selectedProviderName.toLowerCase()];
3889
+ const totalAccountBalance = selectedAccount ? selectedAccount.wallets.reduce((sum, w) => sum + w.balance.available.amount, 0) : availableBalance;
3888
3890
  const isLowBalance = availableBalance < MIN_DEPOSIT;
3889
3891
  const exceedsLimit = remainingLimit != null && amount > remainingLimit && !isLowBalance;
3890
3892
  const canDeposit = amount >= MIN_DEPOSIT && !exceedsLimit && !isLowBalance && !processing;
@@ -3931,7 +3933,7 @@ function DepositScreen({
3931
3933
  selectedProviderLogo ? /* @__PURE__ */ jsx("img", { src: selectedProviderLogo, alt: selectedProviderName, style: providerLogoStyle }) : /* @__PURE__ */ jsx("div", { style: providerFallbackStyle(tokens.textMuted), children: selectedProviderName.charAt(0) }),
3932
3934
  /* @__PURE__ */ jsxs("span", { style: walletBalanceStyle(tokens.text), children: [
3933
3935
  "$",
3934
- availableBalance.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })
3936
+ totalAccountBalance.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })
3935
3937
  ] }),
3936
3938
  /* @__PURE__ */ jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", style: { opacity: 0.4 }, children: /* @__PURE__ */ jsx("path", { d: "M7 10l5-5 5 5M7 14l5 5 5-5", stroke: tokens.textMuted, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })
3937
3939
  ]
@@ -5619,7 +5621,7 @@ function StepRendererContent({
5619
5621
  {
5620
5622
  merchantName,
5621
5623
  availableBalance: selectedSource ? selectedSource.balance.available.amount : selectedAccount ? selectedAccount.wallets.reduce((sum, w) => sum + w.balance.available.amount, 0) : maxSourceBalance,
5622
- remainingLimit: selectedSource?.remainingAllowance ?? selectedAccount?.remainingAllowance ?? null,
5624
+ remainingLimit: selectedSource != null ? selectedSource.remainingAllowance ?? null : selectedAccount?.remainingAllowance ?? null,
5623
5625
  tokenCount,
5624
5626
  initialAmount: parsedAmt,
5625
5627
  processing: state.creatingTransfer,
@@ -5703,7 +5705,7 @@ function StepRendererContent({
5703
5705
  merchantName,
5704
5706
  sourceName,
5705
5707
  remainingLimit: succeeded ? (() => {
5706
- const limit = selectedSource?.remainingAllowance ?? selectedAccount?.remainingAllowance ?? null;
5708
+ const limit = selectedSource != null ? selectedSource.remainingAllowance ?? null : selectedAccount?.remainingAllowance ?? null;
5707
5709
  if (limit == null) return null;
5708
5710
  return limit > displayAmount ? limit - displayAmount : 0;
5709
5711
  })() : void 0,
@@ -5719,7 +5721,7 @@ function StepRendererContent({
5719
5721
  {
5720
5722
  merchantName,
5721
5723
  availableBalance: 0,
5722
- remainingLimit: selectedSource?.remainingAllowance ?? selectedAccount?.remainingAllowance ?? null,
5724
+ remainingLimit: selectedSource != null ? selectedSource.remainingAllowance ?? null : selectedAccount?.remainingAllowance ?? null,
5723
5725
  tokenCount,
5724
5726
  initialAmount: depositAmount ?? 5,
5725
5727
  processing: false,