@getpara/react-sdk-lite 2.0.0-alpha.34 → 2.0.0-alpha.36
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/components/Account/AccountProfileLink.js +1 -1
- package/dist/modal/components/OAuth/OAuth.js +3 -5
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +2 -2
- package/dist/modal/constants/constants.js +1 -1
- package/dist/provider/components/ExternalWalletWrapper.js +3 -26
- package/dist/provider/hooks/mutations/index.d.ts +28 -2
- package/dist/provider/hooks/mutations/index.js +57 -3
- package/dist/provider/hooks/mutations/useClaimPregenWallets.d.ts +40 -0
- package/dist/provider/hooks/mutations/useClaimPregenWallets.js +28 -0
- package/dist/provider/hooks/mutations/useCreateGuestWallets.d.ts +33 -0
- package/dist/provider/hooks/mutations/useCreateGuestWallets.js +28 -0
- package/dist/provider/hooks/mutations/useCreatePregenWallet.d.ts +120 -0
- package/dist/provider/hooks/mutations/useCreatePregenWallet.js +28 -0
- package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.d.ts +42 -0
- package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.js +28 -0
- package/dist/provider/hooks/mutations/useCreateWallet.d.ts +42 -0
- package/dist/provider/hooks/mutations/useCreateWallet.js +28 -0
- package/dist/provider/hooks/mutations/useCreateWalletPerType.d.ts +54 -0
- package/dist/provider/hooks/mutations/useCreateWalletPerType.js +28 -0
- package/dist/provider/hooks/mutations/useEnable2fa.d.ts +39 -0
- package/dist/provider/hooks/mutations/useEnable2fa.js +28 -0
- package/dist/provider/hooks/mutations/useHasPregenWallet.d.ts +40 -0
- package/dist/provider/hooks/mutations/useHasPregenWallet.js +28 -0
- package/dist/provider/hooks/mutations/useIssueJwt.d.ts +48 -0
- package/dist/provider/hooks/mutations/useIssueJwt.js +28 -0
- package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +34 -0
- package/dist/provider/hooks/mutations/useKeepSessionAlive.js +28 -0
- package/dist/provider/hooks/mutations/useLoginExternalWallet.d.ts +46 -0
- package/dist/provider/hooks/mutations/useLoginExternalWallet.js +28 -0
- package/dist/provider/hooks/mutations/useLogout.d.ts +39 -0
- package/dist/provider/hooks/mutations/useLogout.js +28 -0
- package/dist/provider/hooks/mutations/useResendVerificationCode.d.ts +40 -0
- package/dist/provider/hooks/mutations/useResendVerificationCode.js +28 -0
- package/dist/provider/hooks/mutations/useSetup2fa.d.ts +34 -0
- package/dist/provider/hooks/mutations/useSetup2fa.js +28 -0
- package/dist/provider/hooks/mutations/useSignMessage.d.ts +58 -0
- package/dist/provider/hooks/mutations/useSignMessage.js +28 -0
- package/dist/provider/hooks/mutations/useSignTransaction.d.ts +58 -0
- package/dist/provider/hooks/mutations/useSignTransaction.js +28 -0
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.d.ts +46 -0
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.js +28 -0
- package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.d.ts +42 -0
- package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.js +28 -0
- package/dist/provider/hooks/mutations/useVerify2fa.d.ts +57 -0
- package/dist/provider/hooks/mutations/useVerify2fa.js +28 -0
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.d.ts +93 -0
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.js +28 -0
- package/dist/provider/hooks/mutations/useVerifyFarcaster.d.ts +55 -0
- package/dist/provider/hooks/mutations/useVerifyFarcaster.js +28 -0
- package/dist/provider/hooks/mutations/useVerifyNewAccount.d.ts +84 -0
- package/dist/provider/hooks/mutations/useVerifyNewAccount.js +28 -0
- package/dist/provider/hooks/mutations/useVerifyOAuth.d.ts +64 -0
- package/dist/provider/hooks/mutations/useVerifyOAuth.js +28 -0
- package/dist/provider/hooks/mutations/useVerifyTelegram.d.ts +46 -0
- package/dist/provider/hooks/mutations/useVerifyTelegram.js +28 -0
- package/dist/provider/hooks/mutations/useWaitForLogin.d.ts +57 -0
- package/dist/provider/hooks/mutations/useWaitForLogin.js +28 -0
- package/dist/provider/hooks/mutations/useWaitForSignup.d.ts +45 -0
- package/dist/provider/hooks/mutations/useWaitForSignup.js +28 -0
- package/dist/provider/hooks/mutations/useWaitForWalletCreation.d.ts +54 -0
- package/dist/provider/hooks/mutations/useWaitForWalletCreation.js +28 -0
- package/dist/provider/hooks/mutations/utils.d.ts +2 -7
- package/dist/provider/hooks/mutations/utils.js +0 -24
- package/dist/provider/hooks/queries/index.d.ts +2 -1
- package/dist/provider/hooks/queries/index.js +4 -1
- package/dist/provider/hooks/queries/useAccountLinkInProgress.d.ts +6 -0
- package/dist/provider/hooks/queries/useAccountLinkInProgress.js +24 -0
- package/dist/provider/hooks/queries/useLinkedAccounts.d.ts +11 -0
- package/dist/provider/hooks/queries/useLinkedAccounts.js +24 -0
- package/dist/provider/providers/AccountLinkProvider.js +3 -8
- package/dist/provider/providers/AuthProvider.d.ts +0 -1
- package/dist/provider/providers/AuthProvider.js +18 -45
- package/dist/provider/providers/ExternalWalletProvider.js +2 -2
- package/dist/provider/utils/externalWalletDefaults.d.ts +6 -0
- package/dist/provider/utils/externalWalletDefaults.js +33 -0
- package/dist/provider/utils/renameMutations.d.ts +9 -5
- package/dist/provider/utils/renameMutations.js +3 -5
- package/package.json +8 -8
- package/dist/provider/hooks/mutations/core.d.ts +0 -27
- package/dist/provider/hooks/mutations/core.js +0 -66
- package/dist/provider/hooks/queries/core.d.ts +0 -4
- package/dist/provider/hooks/queries/core.js +0 -16
- package/dist/provider/hooks/queries/utils.d.ts +0 -7
- package/dist/provider/hooks/queries/utils.js +0 -25
|
@@ -29,7 +29,7 @@ function AccountProfileLink() {
|
|
|
29
29
|
linkAccount,
|
|
30
30
|
isLinkAccountPending,
|
|
31
31
|
resetMutations
|
|
32
|
-
} = useAccountLinking(), { wallets } = useExternalWallets(), {
|
|
32
|
+
} = useAccountLinking(), { wallets } = useExternalWallets(), { resendVerificationCode } = useResendVerificationCode(), accountLinkType = accountLinkInProgress == null ? void 0 : accountLinkInProgress.type, externalWalletProvider = (_b = accountLinkInProgress == null ? void 0 : accountLinkInProgress.pendingWalletProvider) != null ? _b : (_a = accountLinkInProgress == null ? void 0 : accountLinkInProgress.externalWallet) == null ? void 0 : _a.providerId, externalWalletType = (_d = accountLinkInProgress == null ? void 0 : accountLinkInProgress.pendingWalletType) != null ? _d : (_c = accountLinkInProgress == null ? void 0 : accountLinkInProgress.externalWallet) == null ? void 0 : _c.type, externalWallet = wallets.find((w) => w.id === externalWalletProvider), isTelegram = accountLinkType === "TELEGRAM", {
|
|
33
33
|
url,
|
|
34
34
|
status: telegramStatus,
|
|
35
35
|
isLoaded,
|
|
@@ -17,7 +17,7 @@ const OAuth = ({ methods }) => {
|
|
|
17
17
|
const isDark = useStore((state) => state.isDarkTheme);
|
|
18
18
|
const setStep = useModalStore((state) => state.setStep);
|
|
19
19
|
const showAll = useModalStore((state) => state.step === ModalStep.AUTH_MORE || state.step === ModalStep.AUTH_GUEST_SIGNUP);
|
|
20
|
-
const { verifyFarcaster, verifyOAuth
|
|
20
|
+
const { verifyFarcaster, verifyOAuth } = useAuthActions();
|
|
21
21
|
const hasMore = methods.length > HAS_MORE_LENGTH;
|
|
22
22
|
const methodsToShow = showAll || !hasMore ? methods : methods.slice(0, HAS_MORE_LENGTH - 1);
|
|
23
23
|
const handleShowAll = () => {
|
|
@@ -47,8 +47,7 @@ const OAuth = ({ methods }) => {
|
|
|
47
47
|
icon: ACCOUNT_TYPES[method][useBrandedLogos ? "logoBranded" : "logo"],
|
|
48
48
|
onClick: handleMethodClick(method),
|
|
49
49
|
$index: index,
|
|
50
|
-
$totalItems: showMoreButton ? HAS_MORE_LENGTH : methodsToShow.length
|
|
51
|
-
disabled: !isOAuthReady
|
|
50
|
+
$totalItems: showMoreButton ? HAS_MORE_LENGTH : methodsToShow.length
|
|
52
51
|
},
|
|
53
52
|
method
|
|
54
53
|
)),
|
|
@@ -59,8 +58,7 @@ const OAuth = ({ methods }) => {
|
|
|
59
58
|
icon: "moreLoginOptions",
|
|
60
59
|
onClick: handleShowAll,
|
|
61
60
|
$index: HAS_MORE_LENGTH - 1,
|
|
62
|
-
$totalItems: HAS_MORE_LENGTH
|
|
63
|
-
disabled: !isOAuthReady
|
|
61
|
+
$totalItems: HAS_MORE_LENGTH
|
|
64
62
|
}
|
|
65
63
|
)
|
|
66
64
|
] });
|
|
@@ -125,7 +125,7 @@ const VerificationCode = ({ authInfo, onResend, onSubmit, status, error }) => {
|
|
|
125
125
|
};
|
|
126
126
|
const VerificationCodeStep = () => {
|
|
127
127
|
const { verifyNewAccount, verifyNewAccountStatus, verifyNewAccountError } = useAuthActions();
|
|
128
|
-
const {
|
|
128
|
+
const { resendVerificationCodeAsync } = useResendVerificationCode();
|
|
129
129
|
const para = useInternalClient();
|
|
130
130
|
if (!para.authInfo) {
|
|
131
131
|
return null;
|
|
@@ -136,7 +136,7 @@ const VerificationCodeStep = () => {
|
|
|
136
136
|
authInfo: para.authInfo,
|
|
137
137
|
onSubmit: verifyNewAccount,
|
|
138
138
|
onResend: () => {
|
|
139
|
-
|
|
139
|
+
resendVerificationCodeAsync({ type: "SIGNUP" });
|
|
140
140
|
},
|
|
141
141
|
status: verifyNewAccountStatus,
|
|
142
142
|
error: verifyNewAccountError
|
|
@@ -11,6 +11,7 @@ import { EvmWalletWrapper } from "./EvmWalletWrapper.js";
|
|
|
11
11
|
import { CosmosWalletWrapper } from "./CosmosWalletWrapper.js";
|
|
12
12
|
import { SolanaWalletWrapper } from "./SolanaWalletWrapper.js";
|
|
13
13
|
import { useStore } from "../stores/useStore.js";
|
|
14
|
+
import { getEVMExternalWalletConfigDefault } from "../utils/externalWalletDefaults.js";
|
|
14
15
|
const ExternalWalletWrapper = ({
|
|
15
16
|
children,
|
|
16
17
|
config
|
|
@@ -29,32 +30,8 @@ const ExternalWalletWrapper = ({
|
|
|
29
30
|
}, [wallets, walletConnect]);
|
|
30
31
|
const evmProviderConfig = useMemo(
|
|
31
32
|
() => {
|
|
32
|
-
var _a2
|
|
33
|
-
return !evmConnector ? {
|
|
34
|
-
appName,
|
|
35
|
-
chains: [
|
|
36
|
-
{
|
|
37
|
-
id: 11155111,
|
|
38
|
-
name: "Sepolia",
|
|
39
|
-
nativeCurrency: { name: "Sepolia Ether", symbol: "ETH", decimals: 18 },
|
|
40
|
-
rpcUrls: { default: { http: ["https://rpc.sepolia.org"] } },
|
|
41
|
-
blockExplorers: {
|
|
42
|
-
default: {
|
|
43
|
-
name: "Etherscan",
|
|
44
|
-
url: "https://sepolia.etherscan.io",
|
|
45
|
-
apiUrl: "https://api-sepolia.etherscan.io/api"
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
contracts: {
|
|
49
|
-
multicall3: { address: "0xca11bde05977b3631167028862be2a173976ca11", blockCreated: 751532 },
|
|
50
|
-
ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
|
|
51
|
-
ensUniversalResolver: { address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC", blockCreated: 5317080 }
|
|
52
|
-
},
|
|
53
|
-
testnet: true
|
|
54
|
-
}
|
|
55
|
-
],
|
|
56
|
-
projectId: (_a2 = walletConnect == null ? void 0 : walletConnect.projectId) != null ? _a2 : ""
|
|
57
|
-
} : __spreadValues({ appName, appDescription, appIcon, appUrl, projectId: (_b = walletConnect == null ? void 0 : walletConnect.projectId) != null ? _b : "" }, evmConnector == null ? void 0 : evmConnector.config);
|
|
33
|
+
var _a2;
|
|
34
|
+
return !evmConnector ? getEVMExternalWalletConfigDefault({ appName, projectId: walletConnect == null ? void 0 : walletConnect.projectId }) : __spreadValues({ appName, appDescription, appIcon, appUrl, projectId: (_a2 = walletConnect == null ? void 0 : walletConnect.projectId) != null ? _a2 : "" }, evmConnector == null ? void 0 : evmConnector.config);
|
|
58
35
|
},
|
|
59
36
|
[appName, appDescription, appIcon, appUrl, walletConnect == null ? void 0 : walletConnect.projectId, evmConnector]
|
|
60
37
|
);
|
|
@@ -1,3 +1,29 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export { useLinkAccount } from './useLinkAccount.js';
|
|
2
|
+
export { useSignUpOrLogIn } from './useSignUpOrLogIn.js';
|
|
3
|
+
export { useVerifyNewAccount } from './useVerifyNewAccount.js';
|
|
4
|
+
export { useWaitForLogin } from './useWaitForLogin.js';
|
|
5
|
+
export { useWaitForSignup } from './useWaitForSignup.js';
|
|
6
|
+
export { useWaitForWalletCreation } from './useWaitForWalletCreation.js';
|
|
7
|
+
export { useVerifyOAuth } from './useVerifyOAuth.js';
|
|
8
|
+
export { useVerifyFarcaster } from './useVerifyFarcaster.js';
|
|
9
|
+
export { useVerifyTelegram } from './useVerifyTelegram.js';
|
|
10
|
+
export { useLoginExternalWallet } from './useLoginExternalWallet.js';
|
|
11
|
+
export { useVerifyExternalWallet } from './useVerifyExternalWallet.js';
|
|
12
|
+
export { useSetup2fa } from './useSetup2fa.js';
|
|
13
|
+
export { useEnable2fa } from './useEnable2fa.js';
|
|
14
|
+
export { useVerify2fa } from './useVerify2fa.js';
|
|
15
|
+
export { useKeepSessionAlive } from './useKeepSessionAlive.js';
|
|
16
|
+
export { useLogout } from './useLogout.js';
|
|
17
|
+
export { useResendVerificationCode } from './useResendVerificationCode.js';
|
|
18
|
+
export { useCreateWallet } from './useCreateWallet.js';
|
|
19
|
+
export { useCreateWalletPerType } from './useCreateWalletPerType.js';
|
|
20
|
+
export { useCreatePregenWallet } from './useCreatePregenWallet.js';
|
|
21
|
+
export { useCreatePregenWalletPerType } from './useCreatePregenWalletPerType.js';
|
|
22
|
+
export { useClaimPregenWallets } from './useClaimPregenWallets.js';
|
|
23
|
+
export { useHasPregenWallet } from './useHasPregenWallet.js';
|
|
24
|
+
export { useUpdatePregenWalletIdentifier } from './useUpdatePregenWalletIdentifier.js';
|
|
25
|
+
export { useCreateGuestWallets } from './useCreateGuestWallets.js';
|
|
26
|
+
export { useSignMessage } from './useSignMessage.js';
|
|
27
|
+
export { useSignTransaction } from './useSignTransaction.js';
|
|
28
|
+
export { useIssueJwt } from './useIssueJwt.js';
|
|
3
29
|
export declare const useCreateGuestWalletsState: import("../../types/utils.js").CoreMethodMutationStateHook<"createGuestWallets">;
|
|
@@ -1,9 +1,63 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../../../chunk-MMUBH76A.js";
|
|
3
3
|
import { generateStateHook } from "./utils.js";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import { useLinkAccount } from "./useLinkAccount.js";
|
|
5
|
+
import { useSignUpOrLogIn } from "./useSignUpOrLogIn.js";
|
|
6
|
+
import { useVerifyNewAccount } from "./useVerifyNewAccount.js";
|
|
7
|
+
import { useWaitForLogin } from "./useWaitForLogin.js";
|
|
8
|
+
import { useWaitForSignup } from "./useWaitForSignup.js";
|
|
9
|
+
import { useWaitForWalletCreation } from "./useWaitForWalletCreation.js";
|
|
10
|
+
import { useVerifyOAuth } from "./useVerifyOAuth.js";
|
|
11
|
+
import { useVerifyFarcaster } from "./useVerifyFarcaster.js";
|
|
12
|
+
import { useVerifyTelegram } from "./useVerifyTelegram.js";
|
|
13
|
+
import { useLoginExternalWallet } from "./useLoginExternalWallet.js";
|
|
14
|
+
import { useVerifyExternalWallet } from "./useVerifyExternalWallet.js";
|
|
15
|
+
import { useSetup2fa } from "./useSetup2fa.js";
|
|
16
|
+
import { useEnable2fa } from "./useEnable2fa.js";
|
|
17
|
+
import { useVerify2fa } from "./useVerify2fa.js";
|
|
18
|
+
import { useKeepSessionAlive } from "./useKeepSessionAlive.js";
|
|
19
|
+
import { useLogout } from "./useLogout.js";
|
|
20
|
+
import { useResendVerificationCode } from "./useResendVerificationCode.js";
|
|
21
|
+
import { useCreateWallet } from "./useCreateWallet.js";
|
|
22
|
+
import { useCreateWalletPerType } from "./useCreateWalletPerType.js";
|
|
23
|
+
import { useCreatePregenWallet } from "./useCreatePregenWallet.js";
|
|
24
|
+
import { useCreatePregenWalletPerType } from "./useCreatePregenWalletPerType.js";
|
|
25
|
+
import { useClaimPregenWallets } from "./useClaimPregenWallets.js";
|
|
26
|
+
import { useHasPregenWallet } from "./useHasPregenWallet.js";
|
|
27
|
+
import { useUpdatePregenWalletIdentifier } from "./useUpdatePregenWalletIdentifier.js";
|
|
28
|
+
import { useCreateGuestWallets } from "./useCreateGuestWallets.js";
|
|
29
|
+
import { useSignMessage } from "./useSignMessage.js";
|
|
30
|
+
import { useSignTransaction } from "./useSignTransaction.js";
|
|
31
|
+
import { useIssueJwt } from "./useIssueJwt.js";
|
|
6
32
|
const useCreateGuestWalletsState = generateStateHook("createGuestWallets");
|
|
7
33
|
export {
|
|
8
|
-
|
|
34
|
+
useClaimPregenWallets,
|
|
35
|
+
useCreateGuestWallets,
|
|
36
|
+
useCreateGuestWalletsState,
|
|
37
|
+
useCreatePregenWallet,
|
|
38
|
+
useCreatePregenWalletPerType,
|
|
39
|
+
useCreateWallet,
|
|
40
|
+
useCreateWalletPerType,
|
|
41
|
+
useEnable2fa,
|
|
42
|
+
useHasPregenWallet,
|
|
43
|
+
useIssueJwt,
|
|
44
|
+
useKeepSessionAlive,
|
|
45
|
+
useLinkAccount,
|
|
46
|
+
useLoginExternalWallet,
|
|
47
|
+
useLogout,
|
|
48
|
+
useResendVerificationCode,
|
|
49
|
+
useSetup2fa,
|
|
50
|
+
useSignMessage,
|
|
51
|
+
useSignTransaction,
|
|
52
|
+
useSignUpOrLogIn,
|
|
53
|
+
useUpdatePregenWalletIdentifier,
|
|
54
|
+
useVerify2fa,
|
|
55
|
+
useVerifyExternalWallet,
|
|
56
|
+
useVerifyFarcaster,
|
|
57
|
+
useVerifyNewAccount,
|
|
58
|
+
useVerifyOAuth,
|
|
59
|
+
useVerifyTelegram,
|
|
60
|
+
useWaitForLogin,
|
|
61
|
+
useWaitForSignup,
|
|
62
|
+
useWaitForWalletCreation
|
|
9
63
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Compute } from '../../types/utils.js';
|
|
2
|
+
export declare const CLAIM_PREGEN_WALLETS_KEY = "CLAIM_PREGEN_WALLETS";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `claimPregenWallets` mutation.
|
|
5
|
+
*
|
|
6
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
+
* - `claimPregenWallets`: function to trigger the mutation (same as `mutate`)
|
|
9
|
+
* - `claimPregenWalletsAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { claimPregenWallets, claimPregenWalletsAsync } = useClaimPregenWallets();
|
|
13
|
+
* claimPregenWallets({ ...params });
|
|
14
|
+
* // or
|
|
15
|
+
* await claimPregenWalletsAsync({ ...params });
|
|
16
|
+
*/
|
|
17
|
+
export declare const useClaimPregenWallets: () => {
|
|
18
|
+
status: "error" | "idle" | "pending" | "success";
|
|
19
|
+
data: Compute<string | undefined>;
|
|
20
|
+
isSuccess: boolean;
|
|
21
|
+
variables: {
|
|
22
|
+
pregenId?: import("@getpara/web-sdk").PregenAuth | undefined;
|
|
23
|
+
} | undefined;
|
|
24
|
+
error: Error | null;
|
|
25
|
+
isError: boolean;
|
|
26
|
+
isIdle: boolean;
|
|
27
|
+
isPending: boolean;
|
|
28
|
+
reset: () => void;
|
|
29
|
+
context: unknown;
|
|
30
|
+
failureCount: number;
|
|
31
|
+
failureReason: Error | null;
|
|
32
|
+
isPaused: boolean;
|
|
33
|
+
submittedAt: number;
|
|
34
|
+
claimPregenWallets: import("@tanstack/react-query").UseMutateFunction<Compute<string | undefined>, Error, {
|
|
35
|
+
pregenId?: import("@getpara/web-sdk").PregenAuth | undefined;
|
|
36
|
+
}, unknown>;
|
|
37
|
+
claimPregenWalletsAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Compute<string | undefined>, Error, {
|
|
38
|
+
pregenId?: import("@getpara/web-sdk").PregenAuth | undefined;
|
|
39
|
+
}, unknown>;
|
|
40
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { claimPregenWallets } from "../../actions/index.js";
|
|
9
|
+
const CLAIM_PREGEN_WALLETS_KEY = "CLAIM_PREGEN_WALLETS";
|
|
10
|
+
const useClaimPregenWallets = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [CLAIM_PREGEN_WALLETS_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield claimPregenWallets(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "claimPregenWallets");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
CLAIM_PREGEN_WALLETS_KEY,
|
|
27
|
+
useClaimPregenWallets
|
|
28
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const CREATE_GUEST_WALLETS_KEY = "CREATE_GUEST_WALLETS";
|
|
2
|
+
/**
|
|
3
|
+
* React hook for the `createGuestWallets` mutation.
|
|
4
|
+
*
|
|
5
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
6
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
7
|
+
* - `createGuestWallets`: function to trigger the mutation (same as `mutate`)
|
|
8
|
+
* - `createGuestWalletsAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const { createGuestWallets, createGuestWalletsAsync } = useCCreateGuestWallets();
|
|
12
|
+
* createGuestWallets({ ...params });
|
|
13
|
+
* // or
|
|
14
|
+
* await createGuestWalletsAsync({ ...params });
|
|
15
|
+
*/
|
|
16
|
+
export declare const useCreateGuestWallets: () => {
|
|
17
|
+
status: "error" | "idle" | "pending" | "success";
|
|
18
|
+
data: import("@getpara/web-sdk").Wallet[] | undefined;
|
|
19
|
+
isSuccess: boolean;
|
|
20
|
+
variables: void | undefined;
|
|
21
|
+
error: Error | null;
|
|
22
|
+
isError: boolean;
|
|
23
|
+
isIdle: boolean;
|
|
24
|
+
isPending: boolean;
|
|
25
|
+
reset: () => void;
|
|
26
|
+
context: unknown;
|
|
27
|
+
failureCount: number;
|
|
28
|
+
failureReason: Error | null;
|
|
29
|
+
isPaused: boolean;
|
|
30
|
+
submittedAt: number;
|
|
31
|
+
createGuestWallets: import("@tanstack/react-query").UseMutateFunction<import("@getpara/web-sdk").Wallet[], Error, void, unknown>;
|
|
32
|
+
createGuestWalletsAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/web-sdk").Wallet[], Error, void, unknown>;
|
|
33
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { createGuestWallets } from "../../actions/index.js";
|
|
9
|
+
const CREATE_GUEST_WALLETS_KEY = "CREATE_GUEST_WALLETS";
|
|
10
|
+
const useCreateGuestWallets = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [CREATE_GUEST_WALLETS_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield createGuestWallets(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "createGuestWallets");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
CREATE_GUEST_WALLETS_KEY,
|
|
27
|
+
useCreateGuestWallets
|
|
28
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export declare const CREATE_PREGEN_WALLET_KEY = "CREATE_PREGEN_WALLET";
|
|
2
|
+
/**
|
|
3
|
+
* React hook for the `createPregenWallet` mutation.
|
|
4
|
+
*
|
|
5
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
6
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
7
|
+
* - `createPregenWallet`: function to trigger the mutation (same as `mutate`)
|
|
8
|
+
* - `createPregenWalletAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const { createPregenWallet, createPregenWalletAsync } = useCreatePregenWallet();
|
|
12
|
+
* createPregenWallet({ ...params });
|
|
13
|
+
* // or
|
|
14
|
+
* await createPregenWalletAsync({ ...params });
|
|
15
|
+
*/
|
|
16
|
+
export declare const useCreatePregenWallet: () => {
|
|
17
|
+
status: "error" | "idle" | "pending" | "success";
|
|
18
|
+
data: {
|
|
19
|
+
createdAt?: string | undefined;
|
|
20
|
+
id: string;
|
|
21
|
+
name?: string | undefined;
|
|
22
|
+
signer: string;
|
|
23
|
+
address?: string | undefined;
|
|
24
|
+
addressSecondary?: string | undefined;
|
|
25
|
+
publicKey?: string | undefined;
|
|
26
|
+
scheme?: import("@getpara/web-sdk").TWalletScheme | undefined;
|
|
27
|
+
type?: (import("@getpara/user-management-client").EmbeddedWalletType | import("@getpara/user-management-client").ExternalWalletType) | undefined;
|
|
28
|
+
isPregen?: boolean | undefined;
|
|
29
|
+
pregenIdentifier?: string | undefined;
|
|
30
|
+
pregenIdentifierType?: import("@getpara/web-sdk").TPregenIdentifierType | undefined;
|
|
31
|
+
userId?: string | undefined;
|
|
32
|
+
partnerId?: string | undefined;
|
|
33
|
+
partner?: import("@getpara/web-sdk").PartnerEntity | undefined;
|
|
34
|
+
lastUsedAt?: string | undefined;
|
|
35
|
+
lastUsedPartner?: import("@getpara/web-sdk").PartnerEntity | undefined;
|
|
36
|
+
lastUsedPartnerId?: string | undefined;
|
|
37
|
+
isExternal?: boolean | undefined;
|
|
38
|
+
isExternalWithParaAuth?: boolean | undefined;
|
|
39
|
+
externalProviderId?: string | undefined;
|
|
40
|
+
isExternalWithVerification?: boolean | undefined;
|
|
41
|
+
isExternalConnectionOnly?: boolean | undefined;
|
|
42
|
+
ensName?: string | null | undefined;
|
|
43
|
+
ensAvatar?: string | null | undefined;
|
|
44
|
+
} | undefined;
|
|
45
|
+
isSuccess: boolean;
|
|
46
|
+
variables: {
|
|
47
|
+
type: import("@getpara/web-sdk").TWalletType;
|
|
48
|
+
pregenId: import("@getpara/web-sdk").PregenAuth;
|
|
49
|
+
} | undefined;
|
|
50
|
+
error: Error | null;
|
|
51
|
+
isError: boolean;
|
|
52
|
+
isIdle: boolean;
|
|
53
|
+
isPending: boolean;
|
|
54
|
+
reset: () => void;
|
|
55
|
+
context: unknown;
|
|
56
|
+
failureCount: number;
|
|
57
|
+
failureReason: Error | null;
|
|
58
|
+
isPaused: boolean;
|
|
59
|
+
submittedAt: number;
|
|
60
|
+
createPregenWallet: import("@tanstack/react-query").UseMutateFunction<{
|
|
61
|
+
createdAt?: string | undefined;
|
|
62
|
+
id: string;
|
|
63
|
+
name?: string | undefined;
|
|
64
|
+
signer: string;
|
|
65
|
+
address?: string | undefined;
|
|
66
|
+
addressSecondary?: string | undefined;
|
|
67
|
+
publicKey?: string | undefined;
|
|
68
|
+
scheme?: import("@getpara/web-sdk").TWalletScheme | undefined;
|
|
69
|
+
type?: (import("@getpara/user-management-client").EmbeddedWalletType | import("@getpara/user-management-client").ExternalWalletType) | undefined;
|
|
70
|
+
isPregen?: boolean | undefined;
|
|
71
|
+
pregenIdentifier?: string | undefined;
|
|
72
|
+
pregenIdentifierType?: import("@getpara/web-sdk").TPregenIdentifierType | undefined;
|
|
73
|
+
userId?: string | undefined;
|
|
74
|
+
partnerId?: string | undefined;
|
|
75
|
+
partner?: import("@getpara/web-sdk").PartnerEntity | undefined;
|
|
76
|
+
lastUsedAt?: string | undefined;
|
|
77
|
+
lastUsedPartner?: import("@getpara/web-sdk").PartnerEntity | undefined;
|
|
78
|
+
lastUsedPartnerId?: string | undefined;
|
|
79
|
+
isExternal?: boolean | undefined;
|
|
80
|
+
isExternalWithParaAuth?: boolean | undefined;
|
|
81
|
+
externalProviderId?: string | undefined;
|
|
82
|
+
isExternalWithVerification?: boolean | undefined;
|
|
83
|
+
isExternalConnectionOnly?: boolean | undefined;
|
|
84
|
+
ensName?: string | null | undefined;
|
|
85
|
+
ensAvatar?: string | null | undefined;
|
|
86
|
+
}, Error, {
|
|
87
|
+
type: import("@getpara/web-sdk").TWalletType;
|
|
88
|
+
pregenId: import("@getpara/web-sdk").PregenAuth;
|
|
89
|
+
}, unknown>;
|
|
90
|
+
createPregenWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
91
|
+
createdAt?: string | undefined;
|
|
92
|
+
id: string;
|
|
93
|
+
name?: string | undefined;
|
|
94
|
+
signer: string;
|
|
95
|
+
address?: string | undefined;
|
|
96
|
+
addressSecondary?: string | undefined;
|
|
97
|
+
publicKey?: string | undefined;
|
|
98
|
+
scheme?: import("@getpara/web-sdk").TWalletScheme | undefined;
|
|
99
|
+
type?: (import("@getpara/user-management-client").EmbeddedWalletType | import("@getpara/user-management-client").ExternalWalletType) | undefined;
|
|
100
|
+
isPregen?: boolean | undefined;
|
|
101
|
+
pregenIdentifier?: string | undefined;
|
|
102
|
+
pregenIdentifierType?: import("@getpara/web-sdk").TPregenIdentifierType | undefined;
|
|
103
|
+
userId?: string | undefined;
|
|
104
|
+
partnerId?: string | undefined;
|
|
105
|
+
partner?: import("@getpara/web-sdk").PartnerEntity | undefined;
|
|
106
|
+
lastUsedAt?: string | undefined;
|
|
107
|
+
lastUsedPartner?: import("@getpara/web-sdk").PartnerEntity | undefined;
|
|
108
|
+
lastUsedPartnerId?: string | undefined;
|
|
109
|
+
isExternal?: boolean | undefined;
|
|
110
|
+
isExternalWithParaAuth?: boolean | undefined;
|
|
111
|
+
externalProviderId?: string | undefined;
|
|
112
|
+
isExternalWithVerification?: boolean | undefined;
|
|
113
|
+
isExternalConnectionOnly?: boolean | undefined;
|
|
114
|
+
ensName?: string | null | undefined;
|
|
115
|
+
ensAvatar?: string | null | undefined;
|
|
116
|
+
}, Error, {
|
|
117
|
+
type: import("@getpara/web-sdk").TWalletType;
|
|
118
|
+
pregenId: import("@getpara/web-sdk").PregenAuth;
|
|
119
|
+
}, unknown>;
|
|
120
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { createPregenWallet } from "../../actions/index.js";
|
|
9
|
+
const CREATE_PREGEN_WALLET_KEY = "CREATE_PREGEN_WALLET";
|
|
10
|
+
const useCreatePregenWallet = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [CREATE_PREGEN_WALLET_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield createPregenWallet(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "createPregenWallet");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
CREATE_PREGEN_WALLET_KEY,
|
|
27
|
+
useCreatePregenWallet
|
|
28
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const CREATE_PREGEN_WALLET_PER_TYPE_KEY = "CREATE_PREGEN_WALLET_PER_TYPE";
|
|
2
|
+
/**
|
|
3
|
+
* React hook for the `createPregenWalletPerType` mutation.
|
|
4
|
+
*
|
|
5
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
6
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
7
|
+
* - `createPregenWalletPerType`: function to trigger the mutation (same as `mutate`)
|
|
8
|
+
* - `createPregenWalletPerTypeAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const { createPregenWalletPerType, createPregenWalletPerTypeAsync } = useCreatePregenWalletPerType();
|
|
12
|
+
* createPregenWalletPerType({ ...params });
|
|
13
|
+
* // or
|
|
14
|
+
* await createPregenWalletPerTypeAsync({ ...params });
|
|
15
|
+
*/
|
|
16
|
+
export declare const useCreatePregenWalletPerType: () => {
|
|
17
|
+
status: "error" | "idle" | "pending" | "success";
|
|
18
|
+
data: import("@getpara/web-sdk").Wallet[] | undefined;
|
|
19
|
+
isSuccess: boolean;
|
|
20
|
+
variables: {
|
|
21
|
+
types?: import("@getpara/web-sdk").TWalletType[] | undefined;
|
|
22
|
+
pregenId: import("@getpara/web-sdk").PregenAuth;
|
|
23
|
+
} | undefined;
|
|
24
|
+
error: Error | null;
|
|
25
|
+
isError: boolean;
|
|
26
|
+
isIdle: boolean;
|
|
27
|
+
isPending: boolean;
|
|
28
|
+
reset: () => void;
|
|
29
|
+
context: unknown;
|
|
30
|
+
failureCount: number;
|
|
31
|
+
failureReason: Error | null;
|
|
32
|
+
isPaused: boolean;
|
|
33
|
+
submittedAt: number;
|
|
34
|
+
createPregenWalletPerType: import("@tanstack/react-query").UseMutateFunction<import("@getpara/web-sdk").Wallet[], Error, {
|
|
35
|
+
types?: import("@getpara/web-sdk").TWalletType[] | undefined;
|
|
36
|
+
pregenId: import("@getpara/web-sdk").PregenAuth;
|
|
37
|
+
}, unknown>;
|
|
38
|
+
createPregenWalletPerTypeAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/web-sdk").Wallet[], Error, {
|
|
39
|
+
types?: import("@getpara/web-sdk").TWalletType[] | undefined;
|
|
40
|
+
pregenId: import("@getpara/web-sdk").PregenAuth;
|
|
41
|
+
}, unknown>;
|
|
42
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { createPregenWalletPerType } from "../../actions/index.js";
|
|
9
|
+
const CREATE_PREGEN_WALLET_PER_TYPE_KEY = "CREATE_PREGEN_WALLET_PER_TYPE";
|
|
10
|
+
const useCreatePregenWalletPerType = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [CREATE_PREGEN_WALLET_PER_TYPE_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield createPregenWalletPerType(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "createPregenWalletPerType");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
CREATE_PREGEN_WALLET_PER_TYPE_KEY,
|
|
27
|
+
useCreatePregenWalletPerType
|
|
28
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const CREATE_WALLET_KEY = "CREATE_WALLET";
|
|
2
|
+
/**
|
|
3
|
+
* React hook for the `createWallet` mutation.
|
|
4
|
+
*
|
|
5
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
6
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
7
|
+
* - `createWallet`: function to trigger the mutation (same as `mutate`)
|
|
8
|
+
* - `createWalletAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const { createWallet, createWalletAsync } = useCreateWallet();
|
|
12
|
+
* createWallet({ ...params });
|
|
13
|
+
* // or
|
|
14
|
+
* await createWalletAsync({ ...params });
|
|
15
|
+
*/
|
|
16
|
+
export declare const useCreateWallet: () => {
|
|
17
|
+
status: "error" | "idle" | "pending" | "success";
|
|
18
|
+
data: [import("@getpara/web-sdk").Wallet, string | undefined] | undefined;
|
|
19
|
+
isSuccess: boolean;
|
|
20
|
+
variables: {
|
|
21
|
+
type?: Uppercase<import("@getpara/web-sdk").TWalletType> | undefined;
|
|
22
|
+
skipDistribute?: boolean | undefined;
|
|
23
|
+
} | undefined;
|
|
24
|
+
error: Error | null;
|
|
25
|
+
isError: boolean;
|
|
26
|
+
isIdle: boolean;
|
|
27
|
+
isPending: boolean;
|
|
28
|
+
reset: () => void;
|
|
29
|
+
context: unknown;
|
|
30
|
+
failureCount: number;
|
|
31
|
+
failureReason: Error | null;
|
|
32
|
+
isPaused: boolean;
|
|
33
|
+
submittedAt: number;
|
|
34
|
+
createWallet: import("@tanstack/react-query").UseMutateFunction<[import("@getpara/web-sdk").Wallet, string | undefined], Error, {
|
|
35
|
+
type?: Uppercase<import("@getpara/web-sdk").TWalletType> | undefined;
|
|
36
|
+
skipDistribute?: boolean | undefined;
|
|
37
|
+
}, unknown>;
|
|
38
|
+
createWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<[import("@getpara/web-sdk").Wallet, string | undefined], Error, {
|
|
39
|
+
type?: Uppercase<import("@getpara/web-sdk").TWalletType> | undefined;
|
|
40
|
+
skipDistribute?: boolean | undefined;
|
|
41
|
+
}, unknown>;
|
|
42
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { createWallet } from "../../actions/index.js";
|
|
9
|
+
const CREATE_WALLET_KEY = "CREATE_WALLET";
|
|
10
|
+
const useCreateWallet = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [CREATE_WALLET_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield createWallet(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "createWallet");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
CREATE_WALLET_KEY,
|
|
27
|
+
useCreateWallet
|
|
28
|
+
};
|