@swype-org/react-sdk 0.1.95 → 0.1.97

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
@@ -75,7 +75,7 @@ function getTheme(mode) {
75
75
  var SWYPE_PRIVY_APP_ID = "cmlil87uv004n0ck0blwumwek";
76
76
  var wagmiConfig = createConfig({
77
77
  chains: [mainnet, arbitrum, base],
78
- connectors: [injected()],
78
+ connectors: [injected({ shimDisconnect: true, unstable_shimAsyncInject: 2e3 })],
79
79
  transports: {
80
80
  [mainnet.id]: http(),
81
81
  [arbitrum.id]: http(),
@@ -830,8 +830,8 @@ async function checkServerForPasskeyByToken(authToken, apiBaseUrl, verificationT
830
830
  }
831
831
 
832
832
  // src/hooks.ts
833
- var WALLET_CLIENT_MAX_ATTEMPTS = 15;
834
- var WALLET_CLIENT_POLL_MS = 200;
833
+ var WALLET_CLIENT_MAX_ATTEMPTS = 25;
834
+ var WALLET_CLIENT_POLL_MS = 400;
835
835
  var ACTION_POLL_INTERVAL_MS = 500;
836
836
  var ACTION_POLL_MAX_RETRIES = 20;
837
837
  var SIGN_PERMIT2_POLL_MS = 1e3;
@@ -912,7 +912,9 @@ function resolvePasskeyRpId() {
912
912
  async function waitForWalletClient(wagmiConfig2, params = {}) {
913
913
  for (let i = 0; i < WALLET_CLIENT_MAX_ATTEMPTS; i++) {
914
914
  try {
915
- return await getWalletClient(wagmiConfig2, params);
915
+ const account = getAccount(wagmiConfig2);
916
+ const enrichedParams = account.connector ? { ...params, connector: account.connector } : params;
917
+ return await getWalletClient(wagmiConfig2, enrichedParams);
916
918
  } catch {
917
919
  if (i === WALLET_CLIENT_MAX_ATTEMPTS - 1) {
918
920
  throw new Error("Wallet not ready. Please try again.");
@@ -3270,53 +3272,32 @@ function WalletPickerScreen({
3270
3272
  /* @__PURE__ */ jsx("h2", { style: headingStyle4(tokens.text), children: "Where are your stablecoins?" }),
3271
3273
  /* @__PURE__ */ jsx("p", { style: subtitleStyle4(tokens.textSecondary), children: "Select the wallet you want to deposit from" })
3272
3274
  ] }),
3273
- /* @__PURE__ */ jsxs("div", { style: gridStyle, children: [
3274
- displayProviders.map((p) => {
3275
- const logoSrc = "logoURI" in p && p.logoURI || KNOWN_LOGOS[p.name.toLowerCase()];
3276
- const emoji = WALLET_EMOJIS[p.name.toLowerCase()] ?? p.name.charAt(0);
3277
- const isHovered = hoveredId === p.id;
3278
- return /* @__PURE__ */ jsxs(
3279
- "button",
3280
- {
3281
- onClick: () => onSelectProvider(p.id),
3282
- onMouseEnter: () => setHoveredId(p.id),
3283
- onMouseLeave: () => setHoveredId(null),
3284
- style: cardStyle(tokens, isHovered),
3285
- children: [
3286
- logoSrc ? /* @__PURE__ */ jsx(
3287
- "img",
3288
- {
3289
- src: logoSrc,
3290
- alt: p.name,
3291
- style: logoImgStyle2
3292
- }
3293
- ) : /* @__PURE__ */ jsx("span", { style: emojiStyle, children: emoji }),
3294
- /* @__PURE__ */ jsx("span", { style: nameStyle2(tokens.text), children: p.name })
3295
- ]
3296
- },
3297
- p.id
3298
- );
3299
- }),
3300
- /* @__PURE__ */ jsxs(
3275
+ /* @__PURE__ */ jsx("div", { style: gridStyle, children: displayProviders.map((p) => {
3276
+ const logoSrc = "logoURI" in p && p.logoURI || KNOWN_LOGOS[p.name.toLowerCase()];
3277
+ const emoji = WALLET_EMOJIS[p.name.toLowerCase()] ?? p.name.charAt(0);
3278
+ const isHovered = hoveredId === p.id;
3279
+ return /* @__PURE__ */ jsxs(
3301
3280
  "button",
3302
3281
  {
3303
- onClick: () => onSelectProvider("other"),
3304
- onMouseEnter: () => setHoveredId("other"),
3282
+ onClick: () => onSelectProvider(p.id),
3283
+ onMouseEnter: () => setHoveredId(p.id),
3305
3284
  onMouseLeave: () => setHoveredId(null),
3306
- style: cardStyle(tokens, hoveredId === "other"),
3285
+ style: cardStyle(tokens, isHovered),
3307
3286
  children: [
3308
- /* @__PURE__ */ jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", style: { margin: "0 auto" }, children: /* @__PURE__ */ jsx(
3309
- "path",
3287
+ logoSrc ? /* @__PURE__ */ jsx(
3288
+ "img",
3310
3289
  {
3311
- d: "M19 19H5V5h7V3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z",
3312
- fill: tokens.textMuted
3290
+ src: logoSrc,
3291
+ alt: p.name,
3292
+ style: logoImgStyle2
3313
3293
  }
3314
- ) }),
3315
- /* @__PURE__ */ jsx("span", { style: nameStyle2(tokens.text), children: "Other" })
3294
+ ) : /* @__PURE__ */ jsx("span", { style: emojiStyle, children: emoji }),
3295
+ /* @__PURE__ */ jsx("span", { style: nameStyle2(tokens.text), children: p.name })
3316
3296
  ]
3317
- }
3318
- )
3319
- ] })
3297
+ },
3298
+ p.id
3299
+ );
3300
+ }) })
3320
3301
  ]
3321
3302
  }
3322
3303
  );
@@ -4862,7 +4843,7 @@ function StepRenderer({
4862
4843
  }
4863
4844
  );
4864
4845
  }
4865
- if (step === "otp-verify" && !authenticated) {
4846
+ if (step === "otp-verify") {
4866
4847
  return /* @__PURE__ */ jsx(
4867
4848
  OtpVerifyScreen,
4868
4849
  {
@@ -4874,7 +4855,7 @@ function StepRenderer({
4874
4855
  onVerify: handlers.onVerifyLoginCode,
4875
4856
  onResend: handlers.onResendLoginCode,
4876
4857
  onBack: handlers.onBackFromOtp,
4877
- verifying: activeOtpStatus === "submitting-code",
4858
+ verifying: activeOtpStatus === "submitting-code" || authenticated,
4878
4859
  error: state.error
4879
4860
  }
4880
4861
  );