@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.cjs +27 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +27 -46
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -78,7 +78,7 @@ function getTheme(mode) {
|
|
|
78
78
|
var SWYPE_PRIVY_APP_ID = "cmlil87uv004n0ck0blwumwek";
|
|
79
79
|
var wagmiConfig = wagmi.createConfig({
|
|
80
80
|
chains: [chains.mainnet, chains.arbitrum, chains.base],
|
|
81
|
-
connectors: [connectors.injected()],
|
|
81
|
+
connectors: [connectors.injected({ shimDisconnect: true, unstable_shimAsyncInject: 2e3 })],
|
|
82
82
|
transports: {
|
|
83
83
|
[chains.mainnet.id]: wagmi.http(),
|
|
84
84
|
[chains.arbitrum.id]: wagmi.http(),
|
|
@@ -833,8 +833,8 @@ async function checkServerForPasskeyByToken(authToken, apiBaseUrl, verificationT
|
|
|
833
833
|
}
|
|
834
834
|
|
|
835
835
|
// src/hooks.ts
|
|
836
|
-
var WALLET_CLIENT_MAX_ATTEMPTS =
|
|
837
|
-
var WALLET_CLIENT_POLL_MS =
|
|
836
|
+
var WALLET_CLIENT_MAX_ATTEMPTS = 25;
|
|
837
|
+
var WALLET_CLIENT_POLL_MS = 400;
|
|
838
838
|
var ACTION_POLL_INTERVAL_MS = 500;
|
|
839
839
|
var ACTION_POLL_MAX_RETRIES = 20;
|
|
840
840
|
var SIGN_PERMIT2_POLL_MS = 1e3;
|
|
@@ -915,7 +915,9 @@ function resolvePasskeyRpId() {
|
|
|
915
915
|
async function waitForWalletClient(wagmiConfig2, params = {}) {
|
|
916
916
|
for (let i = 0; i < WALLET_CLIENT_MAX_ATTEMPTS; i++) {
|
|
917
917
|
try {
|
|
918
|
-
|
|
918
|
+
const account = getAccount(wagmiConfig2);
|
|
919
|
+
const enrichedParams = account.connector ? { ...params, connector: account.connector } : params;
|
|
920
|
+
return await getWalletClient(wagmiConfig2, enrichedParams);
|
|
919
921
|
} catch {
|
|
920
922
|
if (i === WALLET_CLIENT_MAX_ATTEMPTS - 1) {
|
|
921
923
|
throw new Error("Wallet not ready. Please try again.");
|
|
@@ -3273,53 +3275,32 @@ function WalletPickerScreen({
|
|
|
3273
3275
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle4(tokens.text), children: "Where are your stablecoins?" }),
|
|
3274
3276
|
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle4(tokens.textSecondary), children: "Select the wallet you want to deposit from" })
|
|
3275
3277
|
] }),
|
|
3276
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3282
|
-
"button",
|
|
3283
|
-
{
|
|
3284
|
-
onClick: () => onSelectProvider(p.id),
|
|
3285
|
-
onMouseEnter: () => setHoveredId(p.id),
|
|
3286
|
-
onMouseLeave: () => setHoveredId(null),
|
|
3287
|
-
style: cardStyle(tokens, isHovered),
|
|
3288
|
-
children: [
|
|
3289
|
-
logoSrc ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3290
|
-
"img",
|
|
3291
|
-
{
|
|
3292
|
-
src: logoSrc,
|
|
3293
|
-
alt: p.name,
|
|
3294
|
-
style: logoImgStyle2
|
|
3295
|
-
}
|
|
3296
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: emojiStyle, children: emoji }),
|
|
3297
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: nameStyle2(tokens.text), children: p.name })
|
|
3298
|
-
]
|
|
3299
|
-
},
|
|
3300
|
-
p.id
|
|
3301
|
-
);
|
|
3302
|
-
}),
|
|
3303
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3278
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: gridStyle, children: displayProviders.map((p) => {
|
|
3279
|
+
const logoSrc = "logoURI" in p && p.logoURI || KNOWN_LOGOS[p.name.toLowerCase()];
|
|
3280
|
+
const emoji = WALLET_EMOJIS[p.name.toLowerCase()] ?? p.name.charAt(0);
|
|
3281
|
+
const isHovered = hoveredId === p.id;
|
|
3282
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3304
3283
|
"button",
|
|
3305
3284
|
{
|
|
3306
|
-
onClick: () => onSelectProvider(
|
|
3307
|
-
onMouseEnter: () => setHoveredId(
|
|
3285
|
+
onClick: () => onSelectProvider(p.id),
|
|
3286
|
+
onMouseEnter: () => setHoveredId(p.id),
|
|
3308
3287
|
onMouseLeave: () => setHoveredId(null),
|
|
3309
|
-
style: cardStyle(tokens,
|
|
3288
|
+
style: cardStyle(tokens, isHovered),
|
|
3310
3289
|
children: [
|
|
3311
|
-
|
|
3312
|
-
"
|
|
3290
|
+
logoSrc ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3291
|
+
"img",
|
|
3313
3292
|
{
|
|
3314
|
-
|
|
3315
|
-
|
|
3293
|
+
src: logoSrc,
|
|
3294
|
+
alt: p.name,
|
|
3295
|
+
style: logoImgStyle2
|
|
3316
3296
|
}
|
|
3317
|
-
) }),
|
|
3318
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: nameStyle2(tokens.text), children:
|
|
3297
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: emojiStyle, children: emoji }),
|
|
3298
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: nameStyle2(tokens.text), children: p.name })
|
|
3319
3299
|
]
|
|
3320
|
-
}
|
|
3321
|
-
|
|
3322
|
-
|
|
3300
|
+
},
|
|
3301
|
+
p.id
|
|
3302
|
+
);
|
|
3303
|
+
}) })
|
|
3323
3304
|
]
|
|
3324
3305
|
}
|
|
3325
3306
|
);
|
|
@@ -4865,7 +4846,7 @@ function StepRenderer({
|
|
|
4865
4846
|
}
|
|
4866
4847
|
);
|
|
4867
4848
|
}
|
|
4868
|
-
if (step === "otp-verify"
|
|
4849
|
+
if (step === "otp-verify") {
|
|
4869
4850
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4870
4851
|
OtpVerifyScreen,
|
|
4871
4852
|
{
|
|
@@ -4877,7 +4858,7 @@ function StepRenderer({
|
|
|
4877
4858
|
onVerify: handlers.onVerifyLoginCode,
|
|
4878
4859
|
onResend: handlers.onResendLoginCode,
|
|
4879
4860
|
onBack: handlers.onBackFromOtp,
|
|
4880
|
-
verifying: activeOtpStatus === "submitting-code",
|
|
4861
|
+
verifying: activeOtpStatus === "submitting-code" || authenticated,
|
|
4881
4862
|
error: state.error
|
|
4882
4863
|
}
|
|
4883
4864
|
);
|