@getpara/react-core 2.19.0
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.d.ts +37 -0
- package/dist/index.js +73 -0
- package/dist/mutations.d.ts +29 -0
- package/dist/mutations.js +60 -0
- package/dist/package.json +4 -0
- package/dist/provider/ParaProviderCore.d.ts +85 -0
- package/dist/provider/ParaProviderCore.js +124 -0
- package/dist/provider/actions/getEmbeddedAccount.d.ts +28 -0
- package/dist/provider/actions/getEmbeddedAccount.js +82 -0
- package/dist/provider/actions/getWallet.js +34 -0
- package/dist/provider/actions/index.d.ts +38 -0
- package/dist/provider/actions/index.js +75 -0
- package/dist/provider/actions/utils.d.ts +4 -0
- package/dist/provider/actions/utils.js +32 -0
- package/dist/provider/hooks/aa/alchemy.d.ts +22 -0
- package/dist/provider/hooks/aa/alchemy.js +47 -0
- package/dist/provider/hooks/aa/biconomy.d.ts +22 -0
- package/dist/provider/hooks/aa/biconomy.js +47 -0
- package/dist/provider/hooks/aa/cdp.d.ts +21 -0
- package/dist/provider/hooks/aa/cdp.js +47 -0
- package/dist/provider/hooks/aa/createSmartAccountHook.d.ts +18 -0
- package/dist/provider/hooks/aa/createSmartAccountHook.js +96 -0
- package/dist/provider/hooks/aa/gelato.d.ts +21 -0
- package/dist/provider/hooks/aa/gelato.js +47 -0
- package/dist/provider/hooks/aa/index.d.ts +12 -0
- package/dist/provider/hooks/aa/index.js +48 -0
- package/dist/provider/hooks/aa/pimlico.d.ts +22 -0
- package/dist/provider/hooks/aa/pimlico.js +47 -0
- package/dist/provider/hooks/aa/porto.d.ts +22 -0
- package/dist/provider/hooks/aa/porto.js +47 -0
- package/dist/provider/hooks/aa/rhinestone.d.ts +22 -0
- package/dist/provider/hooks/aa/rhinestone.js +47 -0
- package/dist/provider/hooks/aa/safe.d.ts +22 -0
- package/dist/provider/hooks/aa/safe.js +47 -0
- package/dist/provider/hooks/aa/thirdweb.d.ts +18 -0
- package/dist/provider/hooks/aa/thirdweb.js +47 -0
- package/dist/provider/hooks/aa/types.d.ts +34 -0
- package/dist/provider/hooks/aa/types.js +0 -0
- package/dist/provider/hooks/aa/zerodev.d.ts +22 -0
- package/dist/provider/hooks/aa/zerodev.js +47 -0
- package/dist/provider/hooks/index.d.ts +4 -0
- package/dist/provider/hooks/index.js +4 -0
- package/dist/provider/hooks/mutations/index.d.ts +30 -0
- package/dist/provider/hooks/mutations/index.js +92 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithEmailOrPhone.d.ts +34 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js +39 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithOAuth.d.ts +34 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithOAuth.js +39 -0
- package/dist/provider/hooks/mutations/useClaimPregenWallets.d.ts +34 -0
- package/dist/provider/hooks/mutations/useClaimPregenWallets.js +42 -0
- package/dist/provider/hooks/mutations/useCreateGuestWallets.d.ts +34 -0
- package/dist/provider/hooks/mutations/useCreateGuestWallets.js +42 -0
- package/dist/provider/hooks/mutations/useCreatePregenWallet.d.ts +34 -0
- package/dist/provider/hooks/mutations/useCreatePregenWallet.js +42 -0
- package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.d.ts +34 -0
- package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.js +39 -0
- package/dist/provider/hooks/mutations/useCreateWallet.d.ts +34 -0
- package/dist/provider/hooks/mutations/useCreateWallet.js +42 -0
- package/dist/provider/hooks/mutations/useCreateWalletPerType.d.ts +34 -0
- package/dist/provider/hooks/mutations/useCreateWalletPerType.js +39 -0
- package/dist/provider/hooks/mutations/useEnable2fa.d.ts +34 -0
- package/dist/provider/hooks/mutations/useEnable2fa.js +39 -0
- package/dist/provider/hooks/mutations/useExportPrivateKey.d.ts +39 -0
- package/dist/provider/hooks/mutations/useExportPrivateKey.js +63 -0
- package/dist/provider/hooks/mutations/useHasPregenWallet.d.ts +34 -0
- package/dist/provider/hooks/mutations/useHasPregenWallet.js +39 -0
- package/dist/provider/hooks/mutations/useIssueJwt.d.ts +34 -0
- package/dist/provider/hooks/mutations/useIssueJwt.js +39 -0
- package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +33 -0
- package/dist/provider/hooks/mutations/useKeepSessionAlive.js +39 -0
- package/dist/provider/hooks/mutations/useLoginExternalWallet.d.ts +34 -0
- package/dist/provider/hooks/mutations/useLoginExternalWallet.js +42 -0
- package/dist/provider/hooks/mutations/useLogout.d.ts +34 -0
- package/dist/provider/hooks/mutations/useLogout.js +39 -0
- package/dist/provider/hooks/mutations/useResendVerificationCode.d.ts +34 -0
- package/dist/provider/hooks/mutations/useResendVerificationCode.js +42 -0
- package/dist/provider/hooks/mutations/useSetup2fa.d.ts +34 -0
- package/dist/provider/hooks/mutations/useSetup2fa.js +39 -0
- package/dist/provider/hooks/mutations/useSignMessage.d.ts +34 -0
- package/dist/provider/hooks/mutations/useSignMessage.js +39 -0
- package/dist/provider/hooks/mutations/useSignTransaction.d.ts +34 -0
- package/dist/provider/hooks/mutations/useSignTransaction.js +42 -0
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.d.ts +34 -0
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.js +42 -0
- package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.d.ts +34 -0
- package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.js +42 -0
- package/dist/provider/hooks/mutations/useVerify2fa.d.ts +34 -0
- package/dist/provider/hooks/mutations/useVerify2fa.js +39 -0
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.d.ts +34 -0
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.js +42 -0
- package/dist/provider/hooks/mutations/useVerifyFarcaster.js +43 -0
- package/dist/provider/hooks/mutations/useVerifyNewAccount.d.ts +34 -0
- package/dist/provider/hooks/mutations/useVerifyNewAccount.js +42 -0
- package/dist/provider/hooks/mutations/useVerifyOAuth.js +40 -0
- package/dist/provider/hooks/mutations/useVerifyTelegram.js +40 -0
- package/dist/provider/hooks/mutations/useWaitForLogin.d.ts +34 -0
- package/dist/provider/hooks/mutations/useWaitForLogin.js +42 -0
- package/dist/provider/hooks/mutations/useWaitForSignup.d.ts +34 -0
- package/dist/provider/hooks/mutations/useWaitForSignup.js +39 -0
- package/dist/provider/hooks/mutations/useWaitForWalletCreation.d.ts +34 -0
- package/dist/provider/hooks/mutations/useWaitForWalletCreation.js +39 -0
- package/dist/provider/hooks/queries/createAccountHook.d.ts +49 -0
- package/dist/provider/hooks/queries/createAccountHook.js +132 -0
- package/dist/provider/hooks/queries/index.d.ts +5 -0
- package/dist/provider/hooks/queries/index.js +20 -0
- package/dist/provider/hooks/queries/useAccount.d.ts +65 -0
- package/dist/provider/hooks/queries/useAccount.js +65 -0
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.d.ts +7 -0
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.js +49 -0
- package/dist/provider/hooks/queries/useParaStatus.d.ts +15 -0
- package/dist/provider/hooks/queries/useParaStatus.js +32 -0
- package/dist/provider/hooks/queries/useWallet.js +43 -0
- package/dist/provider/hooks/utils/index.d.ts +2 -0
- package/dist/provider/hooks/utils/index.js +6 -0
- package/dist/provider/hooks/utils/useClient.d.ts +7 -0
- package/dist/provider/hooks/utils/useClient.js +8 -0
- package/dist/provider/hooks/utils/useCoreWalletState.d.ts +17 -0
- package/dist/provider/hooks/utils/useCoreWalletState.js +47 -0
- package/dist/provider/index.d.ts +5 -0
- package/dist/provider/index.js +11 -0
- package/dist/provider/stores/CoreStoreContext.d.ts +13 -0
- package/dist/provider/stores/CoreStoreContext.js +14 -0
- package/dist/provider/stores/createCoreStore.d.ts +26 -0
- package/dist/provider/stores/createCoreStore.js +61 -0
- package/dist/provider/stores/index.d.ts +4 -0
- package/dist/provider/stores/index.js +9 -0
- package/dist/provider/stores/slices/client.d.ts +3 -0
- package/dist/provider/stores/slices/client.js +7 -0
- package/dist/provider/stores/slices/config.d.ts +3 -0
- package/dist/provider/stores/slices/config.js +9 -0
- package/dist/provider/stores/slices/index.d.ts +4 -0
- package/dist/provider/stores/slices/index.js +10 -0
- package/dist/provider/stores/slices/paraState.d.ts +3 -0
- package/dist/provider/stores/slices/paraState.js +7 -0
- package/dist/provider/stores/slices/wallet.d.ts +3 -0
- package/dist/provider/stores/slices/wallet.js +11 -0
- package/dist/provider/stores/types.d.ts +28 -0
- package/dist/provider/stores/types.js +0 -0
- package/dist/provider/utils/renameMutations.d.ts +11 -0
- package/dist/provider/utils/renameMutations.js +39 -0
- package/dist/queries.d.ts +2 -0
- package/dist/queries.js +6 -0
- package/package.json +73 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type { CoreProviderConfig, CoreCallbacks, ParaCallbackEvent } from './provider/ParaProviderCore.js';
|
|
2
|
+
export type { ParaStorageAdapter } from './provider/stores/createCoreStore.js';
|
|
3
|
+
export { useClient } from './provider/hooks/utils/useClient.js';
|
|
4
|
+
export { useIsFullyLoggedIn } from './provider/hooks/queries/useIsFullyLoggedIn.js';
|
|
5
|
+
export { useParaStatus } from './provider/hooks/queries/useParaStatus.js';
|
|
6
|
+
export { useAccount, type Account } from './provider/hooks/queries/useAccount.js';
|
|
7
|
+
export { useWallet } from './provider/hooks/queries/useWallet.js';
|
|
8
|
+
export { useSignMessage } from './provider/hooks/mutations/useSignMessage.js';
|
|
9
|
+
export { useSignTransaction } from './provider/hooks/mutations/useSignTransaction.js';
|
|
10
|
+
export { useLogout } from './provider/hooks/mutations/useLogout.js';
|
|
11
|
+
export { useKeepSessionAlive } from './provider/hooks/mutations/useKeepSessionAlive.js';
|
|
12
|
+
export { useCreateWallet } from './provider/hooks/mutations/useCreateWallet.js';
|
|
13
|
+
export { useCreateWalletPerType } from './provider/hooks/mutations/useCreateWalletPerType.js';
|
|
14
|
+
export { useCreatePregenWallet } from './provider/hooks/mutations/useCreatePregenWallet.js';
|
|
15
|
+
export { useCreatePregenWalletPerType } from './provider/hooks/mutations/useCreatePregenWalletPerType.js';
|
|
16
|
+
export { useClaimPregenWallets } from './provider/hooks/mutations/useClaimPregenWallets.js';
|
|
17
|
+
export { useHasPregenWallet } from './provider/hooks/mutations/useHasPregenWallet.js';
|
|
18
|
+
export { useUpdatePregenWalletIdentifier } from './provider/hooks/mutations/useUpdatePregenWalletIdentifier.js';
|
|
19
|
+
export { useCreateGuestWallets } from './provider/hooks/mutations/useCreateGuestWallets.js';
|
|
20
|
+
export { useSignUpOrLogIn } from './provider/hooks/mutations/useSignUpOrLogIn.js';
|
|
21
|
+
export { useVerifyNewAccount } from './provider/hooks/mutations/useVerifyNewAccount.js';
|
|
22
|
+
export { useSetup2fa } from './provider/hooks/mutations/useSetup2fa.js';
|
|
23
|
+
export { useEnable2fa } from './provider/hooks/mutations/useEnable2fa.js';
|
|
24
|
+
export { useVerify2fa } from './provider/hooks/mutations/useVerify2fa.js';
|
|
25
|
+
export { useIssueJwt } from './provider/hooks/mutations/useIssueJwt.js';
|
|
26
|
+
export { useResendVerificationCode } from './provider/hooks/mutations/useResendVerificationCode.js';
|
|
27
|
+
export { useExportPrivateKey, EXPORT_PRIVATE_KEY_KEY } from './provider/hooks/mutations/useExportPrivateKey.js';
|
|
28
|
+
export { useAuthenticateWithEmailOrPhone } from './provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js';
|
|
29
|
+
export { useAuthenticateWithOAuth } from './provider/hooks/mutations/useAuthenticateWithOAuth.js';
|
|
30
|
+
export { useLoginExternalWallet } from './provider/hooks/mutations/useLoginExternalWallet.js';
|
|
31
|
+
export { useVerifyExternalWallet } from './provider/hooks/mutations/useVerifyExternalWallet.js';
|
|
32
|
+
export { useVerifyOAuth } from './provider/hooks/mutations/useVerifyOAuth.js';
|
|
33
|
+
export { useVerifyFarcaster } from './provider/hooks/mutations/useVerifyFarcaster.js';
|
|
34
|
+
export { useVerifyTelegram } from './provider/hooks/mutations/useVerifyTelegram.js';
|
|
35
|
+
export { useWaitForLogin } from './provider/hooks/mutations/useWaitForLogin.js';
|
|
36
|
+
export { useWaitForSignup } from './provider/hooks/mutations/useWaitForSignup.js';
|
|
37
|
+
export { useWaitForWalletCreation } from './provider/hooks/mutations/useWaitForWalletCreation.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { useClient } from "./provider/hooks/utils/useClient.js";
|
|
2
|
+
import { useIsFullyLoggedIn } from "./provider/hooks/queries/useIsFullyLoggedIn.js";
|
|
3
|
+
import { useParaStatus } from "./provider/hooks/queries/useParaStatus.js";
|
|
4
|
+
import { useAccount } from "./provider/hooks/queries/useAccount.js";
|
|
5
|
+
import { useWallet } from "./provider/hooks/queries/useWallet.js";
|
|
6
|
+
import { useSignMessage } from "./provider/hooks/mutations/useSignMessage.js";
|
|
7
|
+
import { useSignTransaction } from "./provider/hooks/mutations/useSignTransaction.js";
|
|
8
|
+
import { useLogout } from "./provider/hooks/mutations/useLogout.js";
|
|
9
|
+
import { useKeepSessionAlive } from "./provider/hooks/mutations/useKeepSessionAlive.js";
|
|
10
|
+
import { useCreateWallet } from "./provider/hooks/mutations/useCreateWallet.js";
|
|
11
|
+
import { useCreateWalletPerType } from "./provider/hooks/mutations/useCreateWalletPerType.js";
|
|
12
|
+
import { useCreatePregenWallet } from "./provider/hooks/mutations/useCreatePregenWallet.js";
|
|
13
|
+
import { useCreatePregenWalletPerType } from "./provider/hooks/mutations/useCreatePregenWalletPerType.js";
|
|
14
|
+
import { useClaimPregenWallets } from "./provider/hooks/mutations/useClaimPregenWallets.js";
|
|
15
|
+
import { useHasPregenWallet } from "./provider/hooks/mutations/useHasPregenWallet.js";
|
|
16
|
+
import { useUpdatePregenWalletIdentifier } from "./provider/hooks/mutations/useUpdatePregenWalletIdentifier.js";
|
|
17
|
+
import { useCreateGuestWallets } from "./provider/hooks/mutations/useCreateGuestWallets.js";
|
|
18
|
+
import { useSignUpOrLogIn } from "./provider/hooks/mutations/useSignUpOrLogIn.js";
|
|
19
|
+
import { useVerifyNewAccount } from "./provider/hooks/mutations/useVerifyNewAccount.js";
|
|
20
|
+
import { useSetup2fa } from "./provider/hooks/mutations/useSetup2fa.js";
|
|
21
|
+
import { useEnable2fa } from "./provider/hooks/mutations/useEnable2fa.js";
|
|
22
|
+
import { useVerify2fa } from "./provider/hooks/mutations/useVerify2fa.js";
|
|
23
|
+
import { useIssueJwt } from "./provider/hooks/mutations/useIssueJwt.js";
|
|
24
|
+
import { useResendVerificationCode } from "./provider/hooks/mutations/useResendVerificationCode.js";
|
|
25
|
+
import { useExportPrivateKey, EXPORT_PRIVATE_KEY_KEY } from "./provider/hooks/mutations/useExportPrivateKey.js";
|
|
26
|
+
import { useAuthenticateWithEmailOrPhone } from "./provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js";
|
|
27
|
+
import { useAuthenticateWithOAuth } from "./provider/hooks/mutations/useAuthenticateWithOAuth.js";
|
|
28
|
+
import { useLoginExternalWallet } from "./provider/hooks/mutations/useLoginExternalWallet.js";
|
|
29
|
+
import { useVerifyExternalWallet } from "./provider/hooks/mutations/useVerifyExternalWallet.js";
|
|
30
|
+
import { useVerifyOAuth } from "./provider/hooks/mutations/useVerifyOAuth.js";
|
|
31
|
+
import { useVerifyFarcaster } from "./provider/hooks/mutations/useVerifyFarcaster.js";
|
|
32
|
+
import { useVerifyTelegram } from "./provider/hooks/mutations/useVerifyTelegram.js";
|
|
33
|
+
import { useWaitForLogin } from "./provider/hooks/mutations/useWaitForLogin.js";
|
|
34
|
+
import { useWaitForSignup } from "./provider/hooks/mutations/useWaitForSignup.js";
|
|
35
|
+
import { useWaitForWalletCreation } from "./provider/hooks/mutations/useWaitForWalletCreation.js";
|
|
36
|
+
export {
|
|
37
|
+
EXPORT_PRIVATE_KEY_KEY,
|
|
38
|
+
useAccount,
|
|
39
|
+
useAuthenticateWithEmailOrPhone,
|
|
40
|
+
useAuthenticateWithOAuth,
|
|
41
|
+
useClaimPregenWallets,
|
|
42
|
+
useClient,
|
|
43
|
+
useCreateGuestWallets,
|
|
44
|
+
useCreatePregenWallet,
|
|
45
|
+
useCreatePregenWalletPerType,
|
|
46
|
+
useCreateWallet,
|
|
47
|
+
useCreateWalletPerType,
|
|
48
|
+
useEnable2fa,
|
|
49
|
+
useExportPrivateKey,
|
|
50
|
+
useHasPregenWallet,
|
|
51
|
+
useIsFullyLoggedIn,
|
|
52
|
+
useIssueJwt,
|
|
53
|
+
useKeepSessionAlive,
|
|
54
|
+
useLoginExternalWallet,
|
|
55
|
+
useLogout,
|
|
56
|
+
useParaStatus,
|
|
57
|
+
useResendVerificationCode,
|
|
58
|
+
useSetup2fa,
|
|
59
|
+
useSignMessage,
|
|
60
|
+
useSignTransaction,
|
|
61
|
+
useSignUpOrLogIn,
|
|
62
|
+
useUpdatePregenWalletIdentifier,
|
|
63
|
+
useVerify2fa,
|
|
64
|
+
useVerifyExternalWallet,
|
|
65
|
+
useVerifyFarcaster,
|
|
66
|
+
useVerifyNewAccount,
|
|
67
|
+
useVerifyOAuth,
|
|
68
|
+
useVerifyTelegram,
|
|
69
|
+
useWaitForLogin,
|
|
70
|
+
useWaitForSignup,
|
|
71
|
+
useWaitForWalletCreation,
|
|
72
|
+
useWallet
|
|
73
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export { useSignMessage } from './provider/hooks/mutations/useSignMessage.js';
|
|
2
|
+
export { useSignTransaction } from './provider/hooks/mutations/useSignTransaction.js';
|
|
3
|
+
export { useLogout } from './provider/hooks/mutations/useLogout.js';
|
|
4
|
+
export { useKeepSessionAlive } from './provider/hooks/mutations/useKeepSessionAlive.js';
|
|
5
|
+
export { useCreateWallet } from './provider/hooks/mutations/useCreateWallet.js';
|
|
6
|
+
export { useCreateWalletPerType } from './provider/hooks/mutations/useCreateWalletPerType.js';
|
|
7
|
+
export { useCreatePregenWallet } from './provider/hooks/mutations/useCreatePregenWallet.js';
|
|
8
|
+
export { useCreatePregenWalletPerType } from './provider/hooks/mutations/useCreatePregenWalletPerType.js';
|
|
9
|
+
export { useClaimPregenWallets } from './provider/hooks/mutations/useClaimPregenWallets.js';
|
|
10
|
+
export { useHasPregenWallet } from './provider/hooks/mutations/useHasPregenWallet.js';
|
|
11
|
+
export { useUpdatePregenWalletIdentifier } from './provider/hooks/mutations/useUpdatePregenWalletIdentifier.js';
|
|
12
|
+
export { useCreateGuestWallets } from './provider/hooks/mutations/useCreateGuestWallets.js';
|
|
13
|
+
export { useSignUpOrLogIn } from './provider/hooks/mutations/useSignUpOrLogIn.js';
|
|
14
|
+
export { useSetup2fa } from './provider/hooks/mutations/useSetup2fa.js';
|
|
15
|
+
export { useEnable2fa } from './provider/hooks/mutations/useEnable2fa.js';
|
|
16
|
+
export { useVerify2fa } from './provider/hooks/mutations/useVerify2fa.js';
|
|
17
|
+
export { useIssueJwt } from './provider/hooks/mutations/useIssueJwt.js';
|
|
18
|
+
export { useResendVerificationCode } from './provider/hooks/mutations/useResendVerificationCode.js';
|
|
19
|
+
export { useAuthenticateWithEmailOrPhone } from './provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js';
|
|
20
|
+
export { useAuthenticateWithOAuth } from './provider/hooks/mutations/useAuthenticateWithOAuth.js';
|
|
21
|
+
export { useLoginExternalWallet } from './provider/hooks/mutations/useLoginExternalWallet.js';
|
|
22
|
+
export { useVerifyExternalWallet } from './provider/hooks/mutations/useVerifyExternalWallet.js';
|
|
23
|
+
export { useVerifyOAuth } from './provider/hooks/mutations/useVerifyOAuth.js';
|
|
24
|
+
export { useVerifyFarcaster } from './provider/hooks/mutations/useVerifyFarcaster.js';
|
|
25
|
+
export { useVerifyTelegram } from './provider/hooks/mutations/useVerifyTelegram.js';
|
|
26
|
+
export { useWaitForLogin } from './provider/hooks/mutations/useWaitForLogin.js';
|
|
27
|
+
export { useWaitForSignup } from './provider/hooks/mutations/useWaitForSignup.js';
|
|
28
|
+
export { useWaitForWalletCreation } from './provider/hooks/mutations/useWaitForWalletCreation.js';
|
|
29
|
+
export { useExportPrivateKey } from './provider/hooks/mutations/useExportPrivateKey.js';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { useSignMessage } from "./provider/hooks/mutations/useSignMessage.js";
|
|
2
|
+
import { useSignTransaction } from "./provider/hooks/mutations/useSignTransaction.js";
|
|
3
|
+
import { useLogout } from "./provider/hooks/mutations/useLogout.js";
|
|
4
|
+
import { useKeepSessionAlive } from "./provider/hooks/mutations/useKeepSessionAlive.js";
|
|
5
|
+
import { useCreateWallet } from "./provider/hooks/mutations/useCreateWallet.js";
|
|
6
|
+
import { useCreateWalletPerType } from "./provider/hooks/mutations/useCreateWalletPerType.js";
|
|
7
|
+
import { useCreatePregenWallet } from "./provider/hooks/mutations/useCreatePregenWallet.js";
|
|
8
|
+
import { useCreatePregenWalletPerType } from "./provider/hooks/mutations/useCreatePregenWalletPerType.js";
|
|
9
|
+
import { useClaimPregenWallets } from "./provider/hooks/mutations/useClaimPregenWallets.js";
|
|
10
|
+
import { useHasPregenWallet } from "./provider/hooks/mutations/useHasPregenWallet.js";
|
|
11
|
+
import { useUpdatePregenWalletIdentifier } from "./provider/hooks/mutations/useUpdatePregenWalletIdentifier.js";
|
|
12
|
+
import { useCreateGuestWallets } from "./provider/hooks/mutations/useCreateGuestWallets.js";
|
|
13
|
+
import { useSignUpOrLogIn } from "./provider/hooks/mutations/useSignUpOrLogIn.js";
|
|
14
|
+
import { useSetup2fa } from "./provider/hooks/mutations/useSetup2fa.js";
|
|
15
|
+
import { useEnable2fa } from "./provider/hooks/mutations/useEnable2fa.js";
|
|
16
|
+
import { useVerify2fa } from "./provider/hooks/mutations/useVerify2fa.js";
|
|
17
|
+
import { useIssueJwt } from "./provider/hooks/mutations/useIssueJwt.js";
|
|
18
|
+
import { useResendVerificationCode } from "./provider/hooks/mutations/useResendVerificationCode.js";
|
|
19
|
+
import { useAuthenticateWithEmailOrPhone } from "./provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js";
|
|
20
|
+
import { useAuthenticateWithOAuth } from "./provider/hooks/mutations/useAuthenticateWithOAuth.js";
|
|
21
|
+
import { useLoginExternalWallet } from "./provider/hooks/mutations/useLoginExternalWallet.js";
|
|
22
|
+
import { useVerifyExternalWallet } from "./provider/hooks/mutations/useVerifyExternalWallet.js";
|
|
23
|
+
import { useVerifyOAuth } from "./provider/hooks/mutations/useVerifyOAuth.js";
|
|
24
|
+
import { useVerifyFarcaster } from "./provider/hooks/mutations/useVerifyFarcaster.js";
|
|
25
|
+
import { useVerifyTelegram } from "./provider/hooks/mutations/useVerifyTelegram.js";
|
|
26
|
+
import { useWaitForLogin } from "./provider/hooks/mutations/useWaitForLogin.js";
|
|
27
|
+
import { useWaitForSignup } from "./provider/hooks/mutations/useWaitForSignup.js";
|
|
28
|
+
import { useWaitForWalletCreation } from "./provider/hooks/mutations/useWaitForWalletCreation.js";
|
|
29
|
+
import { useExportPrivateKey } from "./provider/hooks/mutations/useExportPrivateKey.js";
|
|
30
|
+
export {
|
|
31
|
+
useAuthenticateWithEmailOrPhone,
|
|
32
|
+
useAuthenticateWithOAuth,
|
|
33
|
+
useClaimPregenWallets,
|
|
34
|
+
useCreateGuestWallets,
|
|
35
|
+
useCreatePregenWallet,
|
|
36
|
+
useCreatePregenWalletPerType,
|
|
37
|
+
useCreateWallet,
|
|
38
|
+
useCreateWalletPerType,
|
|
39
|
+
useEnable2fa,
|
|
40
|
+
useExportPrivateKey,
|
|
41
|
+
useHasPregenWallet,
|
|
42
|
+
useIssueJwt,
|
|
43
|
+
useKeepSessionAlive,
|
|
44
|
+
useLoginExternalWallet,
|
|
45
|
+
useLogout,
|
|
46
|
+
useResendVerificationCode,
|
|
47
|
+
useSetup2fa,
|
|
48
|
+
useSignMessage,
|
|
49
|
+
useSignTransaction,
|
|
50
|
+
useSignUpOrLogIn,
|
|
51
|
+
useUpdatePregenWalletIdentifier,
|
|
52
|
+
useVerify2fa,
|
|
53
|
+
useVerifyExternalWallet,
|
|
54
|
+
useVerifyFarcaster,
|
|
55
|
+
useVerifyOAuth,
|
|
56
|
+
useVerifyTelegram,
|
|
57
|
+
useWaitForLogin,
|
|
58
|
+
useWaitForSignup,
|
|
59
|
+
useWaitForWalletCreation
|
|
60
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { type PropsWithChildren } from 'react';
|
|
2
|
+
import type ParaCore from '@getpara/core-sdk';
|
|
3
|
+
import type { ConstructorOpts, Environment } from '@getpara/core-sdk';
|
|
4
|
+
import type { StoreApi } from 'zustand';
|
|
5
|
+
import { type ParaStorageAdapter } from './stores/createCoreStore.js';
|
|
6
|
+
import type { CoreStore, FarcasterMiniAppConfig } from './stores/types.js';
|
|
7
|
+
export interface CoreProviderConfig {
|
|
8
|
+
appName: string;
|
|
9
|
+
rpcUrl?: string;
|
|
10
|
+
farcasterMiniAppConfig?: FarcasterMiniAppConfig;
|
|
11
|
+
}
|
|
12
|
+
/** Shape of events delivered to callbacks via the platform-agnostic emitter. */
|
|
13
|
+
export interface ParaCallbackEvent<T = unknown> {
|
|
14
|
+
detail: {
|
|
15
|
+
data: T;
|
|
16
|
+
error?: Error;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Event callbacks forwarded to platform-specific providers.
|
|
21
|
+
* On web these are also wired up via window events in react-sdk-lite's
|
|
22
|
+
* useEventListeners; the core emitter ensures they fire on all platforms.
|
|
23
|
+
*/
|
|
24
|
+
export interface CoreCallbacks {
|
|
25
|
+
onLogin?: (event: ParaCallbackEvent) => void;
|
|
26
|
+
onLogout?: (event: ParaCallbackEvent) => void;
|
|
27
|
+
onAccountSetup?: (event: ParaCallbackEvent) => void;
|
|
28
|
+
onAccountCreation?: (event: ParaCallbackEvent) => void;
|
|
29
|
+
onSignMessage?: (event: ParaCallbackEvent) => void;
|
|
30
|
+
onSignTransaction?: (event: ParaCallbackEvent) => void;
|
|
31
|
+
onWalletCreated?: (event: ParaCallbackEvent) => void;
|
|
32
|
+
onWalletsChange?: (event: ParaCallbackEvent) => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Config object that can be passed instead of a pre-instantiated client.
|
|
36
|
+
* Platform providers (web, RN) handle client creation internally.
|
|
37
|
+
*/
|
|
38
|
+
export interface ParaClientConfig {
|
|
39
|
+
apiKey: string;
|
|
40
|
+
env?: Environment;
|
|
41
|
+
opts?: ConstructorOpts;
|
|
42
|
+
}
|
|
43
|
+
/** Internal: ParaClientConfig + the factory that platform providers supply. */
|
|
44
|
+
export interface ParaClientConfigWithFactory<TClient extends ParaCore = ParaCore> extends ParaClientConfig {
|
|
45
|
+
createClient: (apiKey: string, env?: Environment, opts?: ConstructorOpts) => TClient;
|
|
46
|
+
}
|
|
47
|
+
export interface ParaProviderCoreProps<TClient extends ParaCore = ParaCore> extends PropsWithChildren {
|
|
48
|
+
/**
|
|
49
|
+
* Either a pre-instantiated Para client or a config object with a `createClient` factory.
|
|
50
|
+
* When a config is provided, the provider creates the client and manages its lifecycle.
|
|
51
|
+
*/
|
|
52
|
+
paraClientConfig: TClient | ParaClientConfigWithFactory<TClient>;
|
|
53
|
+
/** Core configuration (appName, rpcUrl, etc.). */
|
|
54
|
+
config: CoreProviderConfig;
|
|
55
|
+
/** Optional event callbacks. Wired up by platform-specific providers. */
|
|
56
|
+
callbacks?: CoreCallbacks;
|
|
57
|
+
/**
|
|
58
|
+
* Called after the client is resolved (created or received), before it's set in the store.
|
|
59
|
+
* Use for platform-specific client configuration (e.g. portal theme, modal error handler).
|
|
60
|
+
*/
|
|
61
|
+
configureClient?: (client: TClient) => void;
|
|
62
|
+
/** Platform-specific storage adapter for Zustand persistence. Defaults to in-memory. */
|
|
63
|
+
storageAdapter?: ParaStorageAdapter;
|
|
64
|
+
/**
|
|
65
|
+
* Optional extended store from a platform SDK.
|
|
66
|
+
* When provided, ParaProviderCore uses this store instead of creating its own.
|
|
67
|
+
* This allows web/RN SDKs to extend the core store with platform-specific slices.
|
|
68
|
+
*/
|
|
69
|
+
store?: StoreApi<CoreStore>;
|
|
70
|
+
/**
|
|
71
|
+
* When true (default), children are not rendered until the SDK is ready.
|
|
72
|
+
* Set to false when the platform SDK manages its own readiness gate
|
|
73
|
+
* (e.g. web renders providers immediately but gates user children separately).
|
|
74
|
+
*/
|
|
75
|
+
waitForReady?: boolean;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Platform-agnostic Para provider. Manages the core Zustand store, syncs the
|
|
79
|
+
* Para client and config, and waits for SDK readiness before rendering children.
|
|
80
|
+
*
|
|
81
|
+
* Accepts either a pre-instantiated `ParaCore` subclass or a config object with
|
|
82
|
+
* a `createClient` factory. Platform SDKs wrap this and add platform-specific
|
|
83
|
+
* providers on top.
|
|
84
|
+
*/
|
|
85
|
+
export declare function ParaProviderCore<TClient extends ParaCore = ParaCore>({ children, paraClientConfig: paraClientInput, config, callbacks, configureClient, storageAdapter, store: externalStore, waitForReady, }: ParaProviderCoreProps<TClient>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { onParaEvent, ParaEvent } from "@getpara/core-sdk";
|
|
4
|
+
import { CoreStoreContext, useCoreStore } from "./stores/CoreStoreContext.js";
|
|
5
|
+
import { createCoreStore } from "./stores/createCoreStore.js";
|
|
6
|
+
const EVENT_TO_CALLBACK = {
|
|
7
|
+
[ParaEvent.LOGIN_EVENT]: "onLogin",
|
|
8
|
+
[ParaEvent.LOGOUT_EVENT]: "onLogout",
|
|
9
|
+
[ParaEvent.ACCOUNT_SETUP_EVENT]: "onAccountSetup",
|
|
10
|
+
[ParaEvent.ACCOUNT_CREATION_EVENT]: "onAccountCreation",
|
|
11
|
+
[ParaEvent.SIGN_MESSAGE_EVENT]: "onSignMessage",
|
|
12
|
+
[ParaEvent.SIGN_TRANSACTION_EVENT]: "onSignTransaction",
|
|
13
|
+
[ParaEvent.WALLET_CREATED]: "onWalletCreated",
|
|
14
|
+
[ParaEvent.WALLETS_CHANGE_EVENT]: "onWalletsChange"
|
|
15
|
+
};
|
|
16
|
+
function isClientConfig(v) {
|
|
17
|
+
return typeof v === "object" && v !== null && "createClient" in v;
|
|
18
|
+
}
|
|
19
|
+
const ParaProviderCoreInner = ({ children, paraClientConfig: paraClient, config, callbacks, waitForReady }) => {
|
|
20
|
+
var _a;
|
|
21
|
+
const unsubRef = useRef(null);
|
|
22
|
+
const setClient = useCoreStore((state) => state.setClient);
|
|
23
|
+
const client = useCoreStore((state) => state.client);
|
|
24
|
+
const setAppName = useCoreStore((state) => state.setAppName);
|
|
25
|
+
const appName = useCoreStore((state) => state.appName);
|
|
26
|
+
const setFarcasterMiniAppConfig = useCoreStore((state) => state.setFarcasterMiniAppConfig);
|
|
27
|
+
const farcasterMiniAppConfig = useCoreStore((state) => state.farcasterMiniAppConfig);
|
|
28
|
+
const setRpcUrl = useCoreStore((state) => state.setRpcUrl);
|
|
29
|
+
const rpcUrl = useCoreStore((state) => state.rpcUrl);
|
|
30
|
+
const setParaState = useCoreStore((state) => state.setParaState);
|
|
31
|
+
const paraState = useCoreStore((state) => state.paraState);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
setClient(paraClient);
|
|
34
|
+
}, [paraClient, setClient]);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (rpcUrl !== config.rpcUrl) setRpcUrl(config.rpcUrl);
|
|
37
|
+
}, [config.rpcUrl]);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (appName !== config.appName) setAppName(config.appName);
|
|
40
|
+
}, [config.appName]);
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (farcasterMiniAppConfig !== config.farcasterMiniAppConfig) {
|
|
43
|
+
setFarcasterMiniAppConfig(config.farcasterMiniAppConfig);
|
|
44
|
+
}
|
|
45
|
+
}, [config.farcasterMiniAppConfig]);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (!client) return;
|
|
48
|
+
let cancelled = false;
|
|
49
|
+
void client.init().then(() => {
|
|
50
|
+
if (cancelled) return;
|
|
51
|
+
const unsubscribe = client.onStatePhaseChange((snapshot) => {
|
|
52
|
+
setParaState(snapshot);
|
|
53
|
+
});
|
|
54
|
+
unsubRef.current = unsubscribe;
|
|
55
|
+
}).catch(console.error);
|
|
56
|
+
return () => {
|
|
57
|
+
var _a2;
|
|
58
|
+
cancelled = true;
|
|
59
|
+
(_a2 = unsubRef.current) == null ? void 0 : _a2.call(unsubRef);
|
|
60
|
+
};
|
|
61
|
+
}, [client, setParaState]);
|
|
62
|
+
const callbacksRef = useRef(callbacks);
|
|
63
|
+
callbacksRef.current = callbacks;
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
const unsubs = [];
|
|
66
|
+
for (const [event, cbKey] of Object.entries(EVENT_TO_CALLBACK)) {
|
|
67
|
+
unsubs.push(
|
|
68
|
+
onParaEvent(event, (e) => {
|
|
69
|
+
var _a2, _b;
|
|
70
|
+
(_b = (_a2 = callbacksRef.current) == null ? void 0 : _a2[cbKey]) == null ? void 0 : _b.call(_a2, e);
|
|
71
|
+
})
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
return () => unsubs.forEach((fn) => fn());
|
|
75
|
+
}, []);
|
|
76
|
+
const isReady = (_a = paraState == null ? void 0 : paraState.isReady) != null ? _a : false;
|
|
77
|
+
if (!client) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
if (waitForReady && !isReady) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
84
|
+
};
|
|
85
|
+
function ParaProviderCore({
|
|
86
|
+
children,
|
|
87
|
+
paraClientConfig: paraClientInput,
|
|
88
|
+
config,
|
|
89
|
+
callbacks,
|
|
90
|
+
configureClient,
|
|
91
|
+
storageAdapter,
|
|
92
|
+
store: externalStore,
|
|
93
|
+
waitForReady = true
|
|
94
|
+
}) {
|
|
95
|
+
const store = useMemo(
|
|
96
|
+
() => externalStore != null ? externalStore : createCoreStore({ storage: storageAdapter }),
|
|
97
|
+
[externalStore, storageAdapter]
|
|
98
|
+
);
|
|
99
|
+
const [resolvedClient, setResolvedClient] = useState(null);
|
|
100
|
+
const configureClientRef = useRef(configureClient);
|
|
101
|
+
configureClientRef.current = configureClient;
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
var _a;
|
|
104
|
+
const client = isClientConfig(paraClientInput) ? paraClientInput.createClient(paraClientInput.apiKey, paraClientInput.env, paraClientInput.opts) : paraClientInput;
|
|
105
|
+
(_a = configureClientRef.current) == null ? void 0 : _a.call(configureClientRef, client);
|
|
106
|
+
setResolvedClient(client);
|
|
107
|
+
}, [paraClientInput]);
|
|
108
|
+
if (!resolvedClient) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
return /* @__PURE__ */ jsx(CoreStoreContext.Provider, { value: store, children: /* @__PURE__ */ jsx(
|
|
112
|
+
ParaProviderCoreInner,
|
|
113
|
+
{
|
|
114
|
+
paraClientConfig: resolvedClient,
|
|
115
|
+
config,
|
|
116
|
+
callbacks,
|
|
117
|
+
waitForReady,
|
|
118
|
+
children
|
|
119
|
+
}
|
|
120
|
+
) });
|
|
121
|
+
}
|
|
122
|
+
export {
|
|
123
|
+
ParaProviderCore
|
|
124
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type ParaCore from '@getpara/core-sdk';
|
|
2
|
+
import type { AuthMethod, PrimaryAuthInfo } from '@getpara/core-sdk';
|
|
3
|
+
type AccountValue = PrimaryAuthInfo & {
|
|
4
|
+
email?: string;
|
|
5
|
+
phone?: `+${number}`;
|
|
6
|
+
farcasterUsername?: string;
|
|
7
|
+
telegramUserId?: string;
|
|
8
|
+
externalWalletAddress?: string;
|
|
9
|
+
wallets: ParaCore['availableWallets'];
|
|
10
|
+
userId?: string;
|
|
11
|
+
authMethods?: Set<AuthMethod>;
|
|
12
|
+
};
|
|
13
|
+
export type Account = ({
|
|
14
|
+
isConnected: false;
|
|
15
|
+
isGuestMode?: false;
|
|
16
|
+
} & {
|
|
17
|
+
[key in keyof AccountValue]?: undefined;
|
|
18
|
+
}) | ({
|
|
19
|
+
isConnected: true;
|
|
20
|
+
isGuestMode: true;
|
|
21
|
+
} & Pick<AccountValue, 'wallets'> & {
|
|
22
|
+
[key in keyof Omit<AccountValue, 'wallets'>]?: undefined;
|
|
23
|
+
}) | ({
|
|
24
|
+
isConnected: true;
|
|
25
|
+
isGuestMode: false;
|
|
26
|
+
} & AccountValue);
|
|
27
|
+
export declare const getEmbeddedAccount: (para: ParaCore | undefined, isFullyLoggedIn: boolean | undefined) => Promise<Account>;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
const getEmbeddedAccount = (para, isFullyLoggedIn) => __async(void 0, null, function* () {
|
|
22
|
+
switch (true) {
|
|
23
|
+
case !para:
|
|
24
|
+
case !(para == null ? void 0 : para.isReady):
|
|
25
|
+
case isFullyLoggedIn === void 0:
|
|
26
|
+
return { isConnected: false };
|
|
27
|
+
}
|
|
28
|
+
if (para.isGuestMode) {
|
|
29
|
+
return {
|
|
30
|
+
isConnected: true,
|
|
31
|
+
isGuestMode: true,
|
|
32
|
+
wallets: para.availableWallets
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
if (!isFullyLoggedIn) {
|
|
36
|
+
return {
|
|
37
|
+
isConnected: false
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const authInfo = para.authInfo;
|
|
41
|
+
let authMethods;
|
|
42
|
+
try {
|
|
43
|
+
authMethods = yield para.supportedUserAuthMethods();
|
|
44
|
+
} catch (e) {
|
|
45
|
+
authMethods = /* @__PURE__ */ new Set();
|
|
46
|
+
}
|
|
47
|
+
const value = {
|
|
48
|
+
auth: authInfo == null ? void 0 : authInfo.auth,
|
|
49
|
+
authType: authInfo == null ? void 0 : authInfo.authType,
|
|
50
|
+
identifier: authInfo == null ? void 0 : authInfo.identifier,
|
|
51
|
+
userId: para.userId,
|
|
52
|
+
wallets: para.availableWallets,
|
|
53
|
+
isConnected: true,
|
|
54
|
+
isGuestMode: false,
|
|
55
|
+
authMethods
|
|
56
|
+
};
|
|
57
|
+
if (authInfo) {
|
|
58
|
+
switch (authInfo.authType) {
|
|
59
|
+
case "email":
|
|
60
|
+
value.email = authInfo.identifier;
|
|
61
|
+
break;
|
|
62
|
+
case "phone":
|
|
63
|
+
value.phone = authInfo.identifier;
|
|
64
|
+
break;
|
|
65
|
+
case "farcaster":
|
|
66
|
+
value.farcasterUsername = authInfo.identifier;
|
|
67
|
+
break;
|
|
68
|
+
case "telegram":
|
|
69
|
+
value.telegramUserId = authInfo.identifier;
|
|
70
|
+
break;
|
|
71
|
+
case "externalWallet":
|
|
72
|
+
value.externalWalletAddress = authInfo.identifier;
|
|
73
|
+
break;
|
|
74
|
+
default:
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return value;
|
|
79
|
+
});
|
|
80
|
+
export {
|
|
81
|
+
getEmbeddedAccount
|
|
82
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
const getWallet = (para, selectedWallet, isConnected) => __async(void 0, null, function* () {
|
|
22
|
+
var _a;
|
|
23
|
+
if (!para) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
const isLoggedIn = isConnected != null ? isConnected : yield para == null ? void 0 : para.isFullyLoggedIn();
|
|
27
|
+
if (!isLoggedIn) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
return (_a = para.findWallet(selectedWallet == null ? void 0 : selectedWallet.id, selectedWallet == null ? void 0 : selectedWallet.type)) != null ? _a : null;
|
|
31
|
+
});
|
|
32
|
+
export {
|
|
33
|
+
getWallet
|
|
34
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type ParaCore from '@getpara/core-sdk';
|
|
2
|
+
import type { SignUpOrLogInParams, SignUpOrLogInResponse, WaitForLoginParams, WaitForLoginResponse, WaitForSignupParams, WaitForWalletCreationParams, WaitForWalletCreationResponse, VerifyOAuthProcessParams, OAuthResponse, VerifyFarcasterParams, VerifyTelegramParams, LoginExternalWalletParams, LoginExternalWalletResponse, VerifyExternalWalletParams, VerifyExternalWalletResponse, Setup2faResponse, Enable2faParams, Verify2faParams, Verify2faResponse, LogoutParams, ResendVerificationCodeParams, CreateWalletParams, CreateWalletResponse, CreateWalletPerTypeParams, CreateWalletPerTypeResponse, CreatePregenWalletParams, CreatePregenWalletResponse, CreatePregenWalletPerTypeParams, CreatePregenWalletPerTypeResponse, ClaimPregenWalletsParams, ClaimPregenWalletsResponse, HasPregenWalletParams, UpdatePregenWalletIdentifierParams, CreateGuestWalletsResponse, SignMessageParams, SignTransactionParams, FullSignatureRes, GetWalletBalanceParams, IssueJwtParams, IssueJwtResponse, GetLinkedAccountsParams, GetLinkedAccountsResponse, AddCredentialParams, ExportPrivateKeyParams, ExportPrivateKeyResponse, AuthenticateWithEmailOrPhoneParams, AuthenticateWithEmailOrPhoneResponse, AuthenticateWithOAuthParams, AuthenticateWithOAuthResponse } from '@getpara/core-sdk';
|
|
3
|
+
export { generateCoreAction, type CoreAction } from './utils.js';
|
|
4
|
+
export { getEmbeddedAccount, type Account } from './getEmbeddedAccount.js';
|
|
5
|
+
export { getWallet } from './getWallet.js';
|
|
6
|
+
export declare const signUpOrLogIn: (para?: ParaCore, args?: SignUpOrLogInParams) => Promise<SignUpOrLogInResponse>;
|
|
7
|
+
export declare const verifyNewAccount: import("./utils.js").CoreAction<"verifyNewAccount">;
|
|
8
|
+
export declare const waitForLogin: (para?: ParaCore, args?: WaitForLoginParams) => Promise<WaitForLoginResponse>;
|
|
9
|
+
export declare const waitForSignup: (para?: ParaCore, args?: WaitForSignupParams) => Promise<true>;
|
|
10
|
+
export declare const waitForWalletCreation: (para?: ParaCore, args?: WaitForWalletCreationParams) => Promise<WaitForWalletCreationResponse>;
|
|
11
|
+
export declare const verifyOAuth: (para?: ParaCore, args?: VerifyOAuthProcessParams) => Promise<OAuthResponse>;
|
|
12
|
+
export declare const verifyFarcaster: (para?: ParaCore, args?: VerifyFarcasterParams) => Promise<OAuthResponse>;
|
|
13
|
+
export declare const verifyTelegram: (para?: ParaCore, args?: VerifyTelegramParams) => Promise<OAuthResponse>;
|
|
14
|
+
export declare const loginExternalWallet: (para?: ParaCore, args?: LoginExternalWalletParams) => Promise<LoginExternalWalletResponse>;
|
|
15
|
+
export declare const verifyExternalWallet: (para?: ParaCore, args?: VerifyExternalWalletParams) => Promise<VerifyExternalWalletResponse>;
|
|
16
|
+
export declare const setup2fa: (para?: ParaCore) => Promise<Setup2faResponse>;
|
|
17
|
+
export declare const enable2fa: (para?: ParaCore, args?: Enable2faParams) => Promise<void>;
|
|
18
|
+
export declare const verify2fa: (para?: ParaCore, args?: Verify2faParams) => Promise<Verify2faResponse>;
|
|
19
|
+
export declare const keepSessionAlive: (para?: ParaCore) => Promise<boolean>;
|
|
20
|
+
export declare const logout: (para?: ParaCore, args?: LogoutParams) => Promise<void>;
|
|
21
|
+
export declare const resendVerificationCode: (para?: ParaCore, args?: ResendVerificationCodeParams) => Promise<void>;
|
|
22
|
+
export declare const createWallet: (para?: ParaCore, args?: CreateWalletParams) => Promise<CreateWalletResponse>;
|
|
23
|
+
export declare const createWalletPerType: (para?: ParaCore, args?: CreateWalletPerTypeParams) => Promise<CreateWalletPerTypeResponse>;
|
|
24
|
+
export declare const createPregenWallet: (para?: ParaCore, args?: CreatePregenWalletParams) => Promise<CreatePregenWalletResponse>;
|
|
25
|
+
export declare const createPregenWalletPerType: (para?: ParaCore, args?: CreatePregenWalletPerTypeParams) => Promise<CreatePregenWalletPerTypeResponse>;
|
|
26
|
+
export declare const claimPregenWallets: (para?: ParaCore, args?: ClaimPregenWalletsParams) => Promise<ClaimPregenWalletsResponse>;
|
|
27
|
+
export declare const hasPregenWallet: (para?: ParaCore, args?: HasPregenWalletParams) => Promise<boolean>;
|
|
28
|
+
export declare const updatePregenWalletIdentifier: (para?: ParaCore, args?: UpdatePregenWalletIdentifierParams) => Promise<void>;
|
|
29
|
+
export declare const createGuestWallets: (para?: ParaCore) => Promise<CreateGuestWalletsResponse>;
|
|
30
|
+
export declare const signMessage: (para?: ParaCore, args?: SignMessageParams) => Promise<FullSignatureRes>;
|
|
31
|
+
export declare const signTransaction: (para?: ParaCore, args?: SignTransactionParams) => Promise<FullSignatureRes>;
|
|
32
|
+
export declare const getWalletBalance: (para?: ParaCore, args?: GetWalletBalanceParams) => Promise<string>;
|
|
33
|
+
export declare const issueJwt: (para?: ParaCore, args?: IssueJwtParams) => Promise<IssueJwtResponse>;
|
|
34
|
+
export declare const getLinkedAccounts: (para?: ParaCore, args?: GetLinkedAccountsParams) => Promise<GetLinkedAccountsResponse>;
|
|
35
|
+
export declare const addCredential: (para?: ParaCore, args?: AddCredentialParams) => Promise<string>;
|
|
36
|
+
export declare const exportPrivateKey: (para?: ParaCore, args?: ExportPrivateKeyParams) => Promise<ExportPrivateKeyResponse>;
|
|
37
|
+
export declare const authenticateWithEmailOrPhone: (para?: ParaCore, args?: AuthenticateWithEmailOrPhoneParams) => Promise<AuthenticateWithEmailOrPhoneResponse>;
|
|
38
|
+
export declare const authenticateWithOAuth: (para?: ParaCore, args?: AuthenticateWithOAuthParams) => Promise<AuthenticateWithOAuthResponse>;
|