@swype-org/react-sdk 0.1.103 → 0.1.105

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
@@ -223,6 +223,9 @@ async function createAccount(apiBaseUrl, token, params) {
223
223
  credentialId: params.credentialId,
224
224
  providerId: params.providerId
225
225
  };
226
+ if (params.nickname) {
227
+ body.nickname = params.nickname;
228
+ }
226
229
  const res = await fetch(`${apiBaseUrl}/v1/accounts`, {
227
230
  method: "POST",
228
231
  headers: {
@@ -2647,6 +2650,8 @@ function SourceCard({
2647
2650
  accounts.map((account) => {
2648
2651
  const active = hasActiveWallet2(account);
2649
2652
  const isSelected = account.id === selectedAccountId;
2653
+ const displayName = account.nickname ?? account.name;
2654
+ const walletAddress = account.wallets[0]?.name;
2650
2655
  return /* @__PURE__ */ jsxRuntime.jsxs(
2651
2656
  "button",
2652
2657
  {
@@ -2670,18 +2675,12 @@ function SourceCard({
2670
2675
  style: dropdownLogoStyle
2671
2676
  }
2672
2677
  ) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: dropdownFallbackIconStyle(active ? tokens.textMuted : tokens.border), children: account.name.charAt(0) }),
2673
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: dropdownNameStyle(active ? tokens.text : tokens.textMuted), children: account.name })
2678
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: dropdownNameColumnStyle, children: [
2679
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: dropdownNameStyle(active ? tokens.text : tokens.textMuted), children: displayName }),
2680
+ walletAddress && /* @__PURE__ */ jsxRuntime.jsx("span", { style: dropdownAddressStyle(active ? tokens.textMuted : tokens.border), children: walletAddress })
2681
+ ] })
2674
2682
  ] }),
2675
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: dropdownRowRightStyle, children: [
2676
- active ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: activeBadgeStyle(tokens), children: "Active" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: inactiveBadgeStyle(tokens), children: "Setup incomplete" }),
2677
- isSelected && /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
2678
- "path",
2679
- {
2680
- d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",
2681
- fill: tokens.accent
2682
- }
2683
- ) })
2684
- ] })
2683
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: dropdownRowRightStyle, children: active ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: activeBadgeStyle(tokens), children: "Active" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: inactiveBadgeStyle(tokens), children: "Setup incomplete" }) })
2685
2684
  ]
2686
2685
  },
2687
2686
  account.id
@@ -2700,7 +2699,7 @@ function SourceCard({
2700
2699
  style: addProviderStyle(tokens),
2701
2700
  children: [
2702
2701
  /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 5v14M5 12h14", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round" }) }),
2703
- "Add Provider"
2702
+ "Add Account"
2704
2703
  ]
2705
2704
  }
2706
2705
  )
@@ -2822,6 +2821,12 @@ var dropdownFallbackIconStyle = (color) => ({
2822
2821
  color,
2823
2822
  flexShrink: 0
2824
2823
  });
2824
+ var dropdownNameColumnStyle = {
2825
+ display: "flex",
2826
+ flexDirection: "column",
2827
+ gap: 2,
2828
+ minWidth: 0
2829
+ };
2825
2830
  var dropdownNameStyle = (color) => ({
2826
2831
  fontWeight: 500,
2827
2832
  color,
@@ -2829,6 +2834,14 @@ var dropdownNameStyle = (color) => ({
2829
2834
  overflow: "hidden",
2830
2835
  textOverflow: "ellipsis"
2831
2836
  });
2837
+ var dropdownAddressStyle = (color) => ({
2838
+ fontSize: "0.72rem",
2839
+ color,
2840
+ fontFamily: '"SF Mono", "Fira Code", monospace',
2841
+ whiteSpace: "nowrap",
2842
+ overflow: "hidden",
2843
+ textOverflow: "ellipsis"
2844
+ });
2832
2845
  var activeBadgeStyle = (tokens) => ({
2833
2846
  fontSize: "0.6rem",
2834
2847
  fontWeight: 600,
@@ -5189,7 +5202,7 @@ function StepRenderer({
5189
5202
  sourceName,
5190
5203
  sourceAddress,
5191
5204
  sourceVerified,
5192
- availableBalance: maxSourceBalance,
5205
+ availableBalance: selectedAccount ? selectedAccount.wallets.reduce((sum, w) => sum + w.balance.available.amount, 0) : maxSourceBalance,
5193
5206
  remainingLimit: selectedAccount?.remainingAllowance ?? state.oneTapLimit,
5194
5207
  tokenCount,
5195
5208
  initialAmount: parsedAmt,