@swype-org/react-sdk 0.1.216 → 0.1.218

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
@@ -17,19 +17,6 @@ var __export = (target, all) => {
17
17
  __defProp(target, name, { get: all[name], enumerable: true });
18
18
  };
19
19
 
20
- // src/contentsquare.ts
21
- var SCRIPT_SRC = "https://t.contentsquare.net/uxa/9537de3817f8f.js";
22
- var injected = false;
23
- function loadContentsquare() {
24
- if (injected) return;
25
- if (typeof document === "undefined") return;
26
- injected = true;
27
- const script = document.createElement("script");
28
- script.src = SCRIPT_SRC;
29
- script.async = true;
30
- document.head.appendChild(script);
31
- }
32
-
33
20
  // src/theme.ts
34
21
  var darkTheme = {
35
22
  bg: "#071216",
@@ -104,15 +91,13 @@ var BlinkContext = react.createContext(null);
104
91
  function BlinkProvider({
105
92
  apiBaseUrl,
106
93
  theme = "dark",
94
+ privyAppId,
107
95
  children
108
96
  }) {
109
97
  const queryClientRef = react.useRef(null);
110
98
  if (!queryClientRef.current) {
111
99
  queryClientRef.current = new reactQuery.QueryClient();
112
100
  }
113
- react.useEffect(() => {
114
- loadContentsquare();
115
- }, []);
116
101
  const [depositAmount, setDepositAmountRaw] = react.useState(null);
117
102
  const setDepositAmount = react.useCallback((amount) => {
118
103
  setDepositAmountRaw(amount);
@@ -130,7 +115,7 @@ function BlinkProvider({
130
115
  return /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClientRef.current, children: /* @__PURE__ */ jsxRuntime.jsx(wagmi.WagmiProvider, { config: wagmiConfig, children: /* @__PURE__ */ jsxRuntime.jsx(
131
116
  reactAuth.PrivyProvider,
132
117
  {
133
- appId: BLINK_PRIVY_APP_ID,
118
+ appId: privyAppId ?? BLINK_PRIVY_APP_ID,
134
119
  config: {
135
120
  appearance: {
136
121
  theme,
@@ -3282,13 +3267,8 @@ function WalletPickerScreen({
3282
3267
  }
3283
3268
  }, [onPrepareProvider]);
3284
3269
  const hasPending = pendingConnections != null && pendingConnections.length > 0;
3285
- const displayProviders = providers.length > 0 ? providers : [
3286
- { id: "metamask", name: "MetaMask" },
3287
- { id: "rabby", name: "Rabby" },
3288
- { id: "ora", name: "Ora" },
3289
- { id: "phantom", name: "Phantom" }
3290
- ];
3291
- const selectedProvider = displayProviders.find((p) => p.id === selectedProviderId);
3270
+ const providersLoading = providers.length === 0;
3271
+ const selectedProvider = providers.find((p) => p.id === selectedProviderId);
3292
3272
  if (loading) {
3293
3273
  return /* @__PURE__ */ jsxRuntime.jsxs(ScreenLayout, { children: [
3294
3274
  /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { title: "Set up Blink", onBack, onLogout }),
@@ -3383,7 +3363,8 @@ function WalletPickerScreen({
3383
3363
  ]
3384
3364
  }
3385
3365
  ),
3386
- cryptoExpanded && /* @__PURE__ */ jsxRuntime.jsx("div", { style: gridStyle, children: displayProviders.map((p) => {
3366
+ cryptoExpanded && providersLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { textAlign: "center", padding: "24px 0" }, children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, { label: "Loading wallets..." }) }),
3367
+ cryptoExpanded && !providersLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { style: gridStyle, children: providers.map((p) => {
3387
3368
  const logoSrc = "logoURI" in p && p.logoURI || KNOWN_LOGOS[p.name.toLowerCase()];
3388
3369
  const emoji = WALLET_EMOJIS[p.name.toLowerCase()] ?? p.name.charAt(0);
3389
3370
  const isSelected = selectedProviderId === p.id;