@getpara/react-sdk-lite 2.0.0-dev.5 → 2.0.0-dev.7
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/modal/ParaModal.js +1 -1
- package/dist/modal/components/Account/Account.js +3 -3
- package/dist/modal/components/Account/AccountProfileLink.js +3 -3
- package/dist/modal/components/AddFunds/AddFunds.js +5 -7
- package/dist/modal/components/AwaitingAccountStep/AwaitingAccountStep.d.ts +1 -0
- package/dist/modal/components/AwaitingAccountStep/AwaitingAccountStep.js +20 -0
- package/dist/modal/components/Body/Body.js +4 -4
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +20 -1
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.js +6 -3
- package/dist/modal/components/Header/hooks/useStepTitle.js +2 -1
- package/dist/modal/components/OAuth/FarcasterLink.d.ts +2 -0
- package/dist/modal/components/OAuth/FarcasterLink.js +30 -0
- package/dist/modal/components/OAuth/FarcasterOAuthStep.d.ts +1 -3
- package/dist/modal/components/OAuth/FarcasterOAuthStep.js +47 -26
- package/dist/modal/components/OAuth/OAuth.js +2 -2
- package/dist/modal/components/OAuth/TelegramOAuthStep.js +35 -19
- package/dist/modal/constants/constants.js +1 -1
- package/dist/modal/hooks/useFarcasterLogin.d.ts +9 -0
- package/dist/modal/hooks/useFarcasterLogin.js +70 -0
- package/dist/modal/hooks/useTelegramLogin.d.ts +4 -3
- package/dist/modal/hooks/useTelegramLogin.js +11 -3
- package/dist/modal/stores/modal/useModalStore.js +2 -1
- package/dist/modal/utils/steps.d.ts +6 -3
- package/dist/modal/utils/steps.js +14 -8
- package/dist/provider/ParaProviderMin.js +3 -3
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.d.ts +3 -3
- package/dist/provider/hooks/mutations/useVerifyFarcaster.d.ts +6 -3
- package/dist/provider/hooks/mutations/useVerifyOAuth.d.ts +3 -3
- package/dist/provider/hooks/mutations/useVerifyTelegram.d.ts +9 -6
- package/dist/provider/providers/AuthProvider.d.ts +6 -4
- package/dist/provider/providers/AuthProvider.js +120 -52
- package/dist/provider/providers/ExternalWalletProvider.d.ts +2 -0
- package/dist/provider/providers/ExternalWalletProvider.js +23 -4
- package/dist/provider/stores/useStore.js +2 -1
- package/dist/provider/types/provider.d.ts +1 -1
- package/dist/provider/utils/paraConfigTypeGuards.d.ts +1 -1
- package/dist/provider/utils/paraConfigTypeGuards.js +1 -1
- package/package.json +8 -8
- package/dist/modal/components/AwaitingIFrameStep/AwaitingIFrameStep.d.ts +0 -1
- package/dist/modal/components/AwaitingIFrameStep/AwaitingIFrameStep.js +0 -12
|
@@ -47,7 +47,8 @@ const defaultExternalWallet = {
|
|
|
47
47
|
getWalletBalance: () => Promise.resolve(void 0),
|
|
48
48
|
requestInfo: (_) => Promise.resolve({}),
|
|
49
49
|
disconnectBase: (_, __) => Promise.resolve(),
|
|
50
|
-
connectFarcasterMiniApp: () => Promise.resolve()
|
|
50
|
+
connectFarcasterMiniApp: () => Promise.resolve(),
|
|
51
|
+
verificationStage: void 0
|
|
51
52
|
};
|
|
52
53
|
const ExternalWalletContext = createContext(defaultExternalWallet);
|
|
53
54
|
function ExternalWalletProvider({ children }) {
|
|
@@ -76,7 +77,8 @@ function ExternalWalletProvider({ children }) {
|
|
|
76
77
|
getWalletBalance: evmGetWalletBalance,
|
|
77
78
|
requestInfo: evmRequestInfo,
|
|
78
79
|
disconnectBase: evmDisconnectBase,
|
|
79
|
-
farcasterStatus: evmFarcasterStatus
|
|
80
|
+
farcasterStatus: evmFarcasterStatus,
|
|
81
|
+
verificationStage: evmVerificationStage
|
|
80
82
|
} = useContext(evmContext);
|
|
81
83
|
const {
|
|
82
84
|
wallets: solanaWallets,
|
|
@@ -187,6 +189,18 @@ function ExternalWalletProvider({ children }) {
|
|
|
187
189
|
}
|
|
188
190
|
}
|
|
189
191
|
}, [cosmosChains, evmChains, selectedExternalWallet]);
|
|
192
|
+
const verificationStage = useMemo(() => {
|
|
193
|
+
var _a;
|
|
194
|
+
const walletType = (_a = Object.values(para.externalWallets || {})[0]) == null ? void 0 : _a.type;
|
|
195
|
+
switch (walletType) {
|
|
196
|
+
case "EVM": {
|
|
197
|
+
return evmVerificationStage;
|
|
198
|
+
}
|
|
199
|
+
default: {
|
|
200
|
+
return "verifying";
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}, [selectedExternalWallet, evmVerificationStage]);
|
|
190
204
|
const switchChain = useCallback(
|
|
191
205
|
(chainId2) => __async(this, null, function* () {
|
|
192
206
|
var _a;
|
|
@@ -245,6 +259,7 @@ function ExternalWalletProvider({ children }) {
|
|
|
245
259
|
const { address, signature, error, cosmosPublicKeyHex, cosmosSigner, addressBech32 } = yield cosmosSignVerificationMessage();
|
|
246
260
|
if (error) {
|
|
247
261
|
setExternalWalletError([error]);
|
|
262
|
+
return;
|
|
248
263
|
} else if (signature && address) {
|
|
249
264
|
verifyExternalWalletParams = {
|
|
250
265
|
externalWallet: __spreadValues({
|
|
@@ -265,6 +280,7 @@ function ExternalWalletProvider({ children }) {
|
|
|
265
280
|
const { signature, error, address } = yield evmSignVerificationMessage();
|
|
266
281
|
if (error) {
|
|
267
282
|
setExternalWalletError([error]);
|
|
283
|
+
return;
|
|
268
284
|
} else if (signature && address) {
|
|
269
285
|
verifyExternalWalletParams = {
|
|
270
286
|
externalWallet: __spreadValues({
|
|
@@ -282,6 +298,7 @@ function ExternalWalletProvider({ children }) {
|
|
|
282
298
|
const { signature, error, address } = yield solanaSignVerificationMessage();
|
|
283
299
|
if (error) {
|
|
284
300
|
setExternalWalletError([error]);
|
|
301
|
+
return;
|
|
285
302
|
} else if (signature && address) {
|
|
286
303
|
verifyExternalWalletParams = {
|
|
287
304
|
externalWallet: __spreadValues({
|
|
@@ -585,7 +602,8 @@ function ExternalWalletProvider({ children }) {
|
|
|
585
602
|
getWalletBalance,
|
|
586
603
|
requestInfo,
|
|
587
604
|
disconnectBase,
|
|
588
|
-
connectFarcasterMiniApp
|
|
605
|
+
connectFarcasterMiniApp,
|
|
606
|
+
verificationStage
|
|
589
607
|
}),
|
|
590
608
|
[
|
|
591
609
|
wallets,
|
|
@@ -608,7 +626,8 @@ function ExternalWalletProvider({ children }) {
|
|
|
608
626
|
getWalletBalance,
|
|
609
627
|
requestInfo,
|
|
610
628
|
disconnectBase,
|
|
611
|
-
connectFarcasterMiniApp
|
|
629
|
+
connectFarcasterMiniApp,
|
|
630
|
+
verificationStage
|
|
612
631
|
]
|
|
613
632
|
),
|
|
614
633
|
children
|
|
@@ -12,12 +12,13 @@ import {
|
|
|
12
12
|
} from "./slices/index.js";
|
|
13
13
|
import { createJSONStorage, persist } from "zustand/middleware";
|
|
14
14
|
import { createConfigSlice } from "./slices/config.js";
|
|
15
|
+
import { PARA_STORAGE_PREFIX } from "@getpara/core-sdk";
|
|
15
16
|
const vanillaStore = createStore()(
|
|
16
17
|
persist(
|
|
17
18
|
(...a) => __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, createClientSlice(...a)), createModalSlice(...a)), createWalletSlice(...a)), createExternalWalletsSlice(...a)), createConfigSlice(...a)), createAnalyticsSlice(...a)),
|
|
18
19
|
{
|
|
19
20
|
version: 1,
|
|
20
|
-
name:
|
|
21
|
+
name: `${PARA_STORAGE_PREFIX}provider-state`,
|
|
21
22
|
storage: createJSONStorage(() => localStorage),
|
|
22
23
|
partialize: (state) => ({
|
|
23
24
|
selectedWalletId: state.selectedWalletId,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ParaWeb, { ConstructorOpts, Environment } from '@getpara/web-sdk';
|
|
2
2
|
export declare function isConfigType(obj: any): obj is {
|
|
3
|
-
env: Environment;
|
|
4
3
|
apiKey: string;
|
|
4
|
+
env: Environment | undefined;
|
|
5
5
|
opts?: ConstructorOpts;
|
|
6
6
|
};
|
|
7
7
|
export declare function isParaWeb(obj: any): obj is ParaWeb;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import "../../chunk-MMUBH76A.js";
|
|
3
3
|
import ParaWeb from "@getpara/web-sdk";
|
|
4
4
|
function isConfigType(obj) {
|
|
5
|
-
return !!obj && typeof obj === "object" && "
|
|
5
|
+
return !!obj && typeof obj === "object" && "apiKey" in obj;
|
|
6
6
|
}
|
|
7
7
|
function isParaWeb(obj) {
|
|
8
8
|
return obj instanceof ParaWeb;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/react-sdk-lite",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.7",
|
|
4
4
|
"bin": {
|
|
5
5
|
"setup-para": "dist/cli/cli.mjs"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@getpara/react-common": "2.0.0-
|
|
9
|
-
"@getpara/react-components": "2.0.0-
|
|
10
|
-
"@getpara/web-sdk": "2.0.0-
|
|
8
|
+
"@getpara/react-common": "2.0.0-dev.7",
|
|
9
|
+
"@getpara/react-components": "2.0.0-dev.7",
|
|
10
|
+
"@getpara/web-sdk": "2.0.0-dev.7",
|
|
11
11
|
"date-fns": "^3.6.0",
|
|
12
12
|
"framer-motion": "^11.3.31",
|
|
13
13
|
"libphonenumber-js": "^1.11.7",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"zustand-sync-tabs": "^0.2.2"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@getpara/cosmos-wallet-connectors": "2.0.0-
|
|
20
|
-
"@getpara/evm-wallet-connectors": "2.0.0-
|
|
21
|
-
"@getpara/solana-wallet-connectors": "2.0.0-
|
|
19
|
+
"@getpara/cosmos-wallet-connectors": "2.0.0-dev.7",
|
|
20
|
+
"@getpara/evm-wallet-connectors": "2.0.0-dev.7",
|
|
21
|
+
"@getpara/solana-wallet-connectors": "2.0.0-dev.7",
|
|
22
22
|
"@tanstack/react-query": "^5.74.0",
|
|
23
23
|
"@testing-library/dom": "^10.4.0",
|
|
24
24
|
"@testing-library/react": "^16.3.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"package.json",
|
|
39
39
|
"styles.css"
|
|
40
40
|
],
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "225cd3693edaab4dac81df7285956d2616e5717f",
|
|
42
42
|
"main": "dist/index.js",
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@tanstack/react-query": ">=5.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const AwaitingIFrameStep: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../../chunk-MMUBH76A.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { useModalStore } from "../../stores/index.js";
|
|
5
|
-
import { Waiting } from "../Waiting/Waiting.js";
|
|
6
|
-
const AwaitingIFrameStep = () => {
|
|
7
|
-
const isLogin = useModalStore((state) => state.isLogin());
|
|
8
|
-
return /* @__PURE__ */ jsx(Waiting, { heading: isLogin ? "Logging you in..." : "Creating your account..." });
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
AwaitingIFrameStep
|
|
12
|
-
};
|