@swype-org/react-sdk 0.1.96 → 0.1.98
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 +26 -45
- 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.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createContext, useRef, useState, useCallback, useMemo, useContext, useEffect, useReducer, Component } from 'react';
|
|
2
2
|
import { PrivyProvider, usePrivy, useLoginWithEmail, useLoginWithSms, useLoginWithOAuth } from '@privy-io/react-auth';
|
|
3
3
|
import { createConfig, http, WagmiProvider, useConfig, useConnect, useSwitchChain } from 'wagmi';
|
|
4
|
-
import { mainnet, arbitrum, base } from 'wagmi/chains';
|
|
4
|
+
import { mainnet, arbitrum, base, polygon, bsc } from 'wagmi/chains';
|
|
5
5
|
import { injected } from 'wagmi/connectors';
|
|
6
6
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
7
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -74,12 +74,14 @@ function getTheme(mode) {
|
|
|
74
74
|
}
|
|
75
75
|
var SWYPE_PRIVY_APP_ID = "cmlil87uv004n0ck0blwumwek";
|
|
76
76
|
var wagmiConfig = createConfig({
|
|
77
|
-
chains: [mainnet, arbitrum, base],
|
|
78
|
-
connectors: [injected()],
|
|
77
|
+
chains: [mainnet, arbitrum, base, polygon, bsc],
|
|
78
|
+
connectors: [injected({ shimDisconnect: true, unstable_shimAsyncInject: 2e3 })],
|
|
79
79
|
transports: {
|
|
80
80
|
[mainnet.id]: http(),
|
|
81
81
|
[arbitrum.id]: http(),
|
|
82
|
-
[base.id]: http()
|
|
82
|
+
[base.id]: http(),
|
|
83
|
+
[polygon.id]: http(),
|
|
84
|
+
[bsc.id]: http()
|
|
83
85
|
}
|
|
84
86
|
});
|
|
85
87
|
var SwypeContext = createContext(null);
|
|
@@ -3272,53 +3274,32 @@ function WalletPickerScreen({
|
|
|
3272
3274
|
/* @__PURE__ */ jsx("h2", { style: headingStyle4(tokens.text), children: "Where are your stablecoins?" }),
|
|
3273
3275
|
/* @__PURE__ */ jsx("p", { style: subtitleStyle4(tokens.textSecondary), children: "Select the wallet you want to deposit from" })
|
|
3274
3276
|
] }),
|
|
3275
|
-
/* @__PURE__ */
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
return /* @__PURE__ */ jsxs(
|
|
3281
|
-
"button",
|
|
3282
|
-
{
|
|
3283
|
-
onClick: () => onSelectProvider(p.id),
|
|
3284
|
-
onMouseEnter: () => setHoveredId(p.id),
|
|
3285
|
-
onMouseLeave: () => setHoveredId(null),
|
|
3286
|
-
style: cardStyle(tokens, isHovered),
|
|
3287
|
-
children: [
|
|
3288
|
-
logoSrc ? /* @__PURE__ */ jsx(
|
|
3289
|
-
"img",
|
|
3290
|
-
{
|
|
3291
|
-
src: logoSrc,
|
|
3292
|
-
alt: p.name,
|
|
3293
|
-
style: logoImgStyle2
|
|
3294
|
-
}
|
|
3295
|
-
) : /* @__PURE__ */ jsx("span", { style: emojiStyle, children: emoji }),
|
|
3296
|
-
/* @__PURE__ */ jsx("span", { style: nameStyle2(tokens.text), children: p.name })
|
|
3297
|
-
]
|
|
3298
|
-
},
|
|
3299
|
-
p.id
|
|
3300
|
-
);
|
|
3301
|
-
}),
|
|
3302
|
-
/* @__PURE__ */ jsxs(
|
|
3277
|
+
/* @__PURE__ */ jsx("div", { style: gridStyle, children: displayProviders.map((p) => {
|
|
3278
|
+
const logoSrc = "logoURI" in p && p.logoURI || KNOWN_LOGOS[p.name.toLowerCase()];
|
|
3279
|
+
const emoji = WALLET_EMOJIS[p.name.toLowerCase()] ?? p.name.charAt(0);
|
|
3280
|
+
const isHovered = hoveredId === p.id;
|
|
3281
|
+
return /* @__PURE__ */ jsxs(
|
|
3303
3282
|
"button",
|
|
3304
3283
|
{
|
|
3305
|
-
onClick: () => onSelectProvider(
|
|
3306
|
-
onMouseEnter: () => setHoveredId(
|
|
3284
|
+
onClick: () => onSelectProvider(p.id),
|
|
3285
|
+
onMouseEnter: () => setHoveredId(p.id),
|
|
3307
3286
|
onMouseLeave: () => setHoveredId(null),
|
|
3308
|
-
style: cardStyle(tokens,
|
|
3287
|
+
style: cardStyle(tokens, isHovered),
|
|
3309
3288
|
children: [
|
|
3310
|
-
|
|
3311
|
-
"
|
|
3289
|
+
logoSrc ? /* @__PURE__ */ jsx(
|
|
3290
|
+
"img",
|
|
3312
3291
|
{
|
|
3313
|
-
|
|
3314
|
-
|
|
3292
|
+
src: logoSrc,
|
|
3293
|
+
alt: p.name,
|
|
3294
|
+
style: logoImgStyle2
|
|
3315
3295
|
}
|
|
3316
|
-
) }),
|
|
3317
|
-
/* @__PURE__ */ jsx("span", { style: nameStyle2(tokens.text), children:
|
|
3296
|
+
) : /* @__PURE__ */ jsx("span", { style: emojiStyle, children: emoji }),
|
|
3297
|
+
/* @__PURE__ */ jsx("span", { style: nameStyle2(tokens.text), children: p.name })
|
|
3318
3298
|
]
|
|
3319
|
-
}
|
|
3320
|
-
|
|
3321
|
-
|
|
3299
|
+
},
|
|
3300
|
+
p.id
|
|
3301
|
+
);
|
|
3302
|
+
}) })
|
|
3322
3303
|
]
|
|
3323
3304
|
}
|
|
3324
3305
|
);
|
|
@@ -4864,7 +4845,7 @@ function StepRenderer({
|
|
|
4864
4845
|
}
|
|
4865
4846
|
);
|
|
4866
4847
|
}
|
|
4867
|
-
if (step === "otp-verify"
|
|
4848
|
+
if (step === "otp-verify") {
|
|
4868
4849
|
return /* @__PURE__ */ jsx(
|
|
4869
4850
|
OtpVerifyScreen,
|
|
4870
4851
|
{
|
|
@@ -4876,7 +4857,7 @@ function StepRenderer({
|
|
|
4876
4857
|
onVerify: handlers.onVerifyLoginCode,
|
|
4877
4858
|
onResend: handlers.onResendLoginCode,
|
|
4878
4859
|
onBack: handlers.onBackFromOtp,
|
|
4879
|
-
verifying: activeOtpStatus === "submitting-code",
|
|
4860
|
+
verifying: activeOtpStatus === "submitting-code" || authenticated,
|
|
4880
4861
|
error: state.error
|
|
4881
4862
|
}
|
|
4882
4863
|
);
|