@mezo-org/passport 0.4.0-dev.1 → 0.4.0-dev.10
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/src/api/auth.d.ts +57 -52
- package/dist/src/api/auth.d.ts.map +1 -1
- package/dist/src/api/auth.js +22 -53
- package/dist/src/api/auth.js.map +1 -1
- package/dist/src/api/client.d.ts +24 -0
- package/dist/src/api/client.d.ts.map +1 -0
- package/dist/src/api/client.js +54 -0
- package/dist/src/api/client.js.map +1 -0
- package/dist/src/api/fetch-error.d.ts +5 -0
- package/dist/src/api/fetch-error.d.ts.map +1 -0
- package/dist/src/api/fetch-error.js +8 -0
- package/dist/src/api/fetch-error.js.map +1 -0
- package/dist/src/api/index.d.ts +3 -0
- package/dist/src/api/index.d.ts.map +1 -0
- package/dist/src/api/index.js +3 -0
- package/dist/src/api/index.js.map +1 -0
- package/dist/src/api/portal.d.ts +32 -0
- package/dist/src/api/portal.d.ts.map +1 -0
- package/dist/src/api/portal.js +23 -0
- package/dist/src/api/portal.js.map +1 -0
- package/dist/src/assets/DefaultAvatar.d.ts +5 -0
- package/dist/src/assets/DefaultAvatar.d.ts.map +1 -0
- package/dist/src/assets/DefaultAvatar.js +21 -0
- package/dist/src/assets/DefaultAvatar.js.map +1 -0
- package/dist/src/components/Dropdown/AccountAddress.d.ts +8 -0
- package/dist/src/components/Dropdown/AccountAddress.d.ts.map +1 -0
- package/dist/src/components/Dropdown/AccountAddress.js +66 -0
- package/dist/src/components/Dropdown/AccountAddress.js.map +1 -0
- package/dist/src/components/Dropdown/AccountAssets.d.ts +14 -0
- package/dist/src/components/Dropdown/AccountAssets.d.ts.map +1 -0
- package/dist/src/components/Dropdown/AccountAssets.js +44 -0
- package/dist/src/components/Dropdown/AccountAssets.js.map +1 -0
- package/dist/src/components/Dropdown/AccountBalance.d.ts +7 -0
- package/dist/src/components/Dropdown/AccountBalance.d.ts.map +1 -0
- package/dist/src/components/Dropdown/AccountBalance.js +18 -0
- package/dist/src/components/Dropdown/AccountBalance.js.map +1 -0
- package/dist/src/components/Dropdown/ConnectedTrigger.d.ts +7 -0
- package/dist/src/components/Dropdown/ConnectedTrigger.d.ts.map +1 -0
- package/dist/src/components/Dropdown/ConnectedTrigger.js +30 -0
- package/dist/src/components/Dropdown/ConnectedTrigger.js.map +1 -0
- package/dist/src/components/Dropdown/Content.d.ts +9 -0
- package/dist/src/components/Dropdown/Content.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Content.js +69 -0
- package/dist/src/components/Dropdown/Content.js.map +1 -0
- package/dist/src/components/Dropdown/DisconnectedTrigger.d.ts +7 -0
- package/dist/src/components/Dropdown/DisconnectedTrigger.d.ts.map +1 -0
- package/dist/src/components/Dropdown/DisconnectedTrigger.js +13 -0
- package/dist/src/components/Dropdown/DisconnectedTrigger.js.map +1 -0
- package/dist/src/components/Dropdown/Dropdown.d.ts +20 -0
- package/dist/src/components/Dropdown/Dropdown.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Dropdown.js +64 -0
- package/dist/src/components/Dropdown/Dropdown.js.map +1 -0
- package/dist/src/components/Dropdown/WelcomeBlock.d.ts +8 -0
- package/dist/src/components/Dropdown/WelcomeBlock.d.ts.map +1 -0
- package/dist/src/components/Dropdown/WelcomeBlock.js +44 -0
- package/dist/src/components/Dropdown/WelcomeBlock.js.map +1 -0
- package/dist/src/components/Dropdown/index.d.ts +3 -0
- package/dist/src/components/Dropdown/index.d.ts.map +1 -0
- package/dist/src/components/Dropdown/index.js +2 -0
- package/dist/src/components/Dropdown/index.js.map +1 -0
- package/dist/src/components/index.d.ts +2 -0
- package/dist/src/components/index.d.ts.map +1 -0
- package/dist/src/components/index.js +2 -0
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/hooks/constants.d.ts +3 -3
- package/dist/src/hooks/constants.js +4 -4
- package/dist/src/hooks/constants.js.map +1 -1
- package/dist/src/hooks/index.d.ts +1 -4
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/src/hooks/index.js +1 -4
- package/dist/src/hooks/index.js.map +1 -1
- package/dist/src/hooks/useAssetsUSDConversion.d.ts +8 -0
- package/dist/src/hooks/useAssetsUSDConversion.d.ts.map +1 -0
- package/dist/src/hooks/useAssetsUSDConversion.js +21 -0
- package/dist/src/hooks/useAssetsUSDConversion.js.map +1 -0
- package/dist/src/hooks/useAuthApiClient.d.ts +1 -1
- package/dist/src/hooks/useAuthApiClient.d.ts.map +1 -1
- package/dist/src/hooks/useAuthenticateWithWallet.d.ts +73 -0
- package/dist/src/hooks/useAuthenticateWithWallet.d.ts.map +1 -0
- package/dist/src/hooks/useAuthenticateWithWallet.js +69 -0
- package/dist/src/hooks/useAuthenticateWithWallet.js.map +1 -0
- package/dist/src/hooks/useCreateAccount.d.ts +41 -137
- package/dist/src/hooks/useCreateAccount.d.ts.map +1 -1
- package/dist/src/hooks/useCreateAccount.js +8 -10
- package/dist/src/hooks/useCreateAccount.js.map +1 -1
- package/dist/src/hooks/useCreateSession.d.ts +12 -182
- package/dist/src/hooks/useCreateSession.d.ts.map +1 -1
- package/dist/src/hooks/useCreateSession.js +12 -18
- package/dist/src/hooks/useCreateSession.js.map +1 -1
- package/dist/src/hooks/useDropdownData.d.ts +45 -0
- package/dist/src/hooks/useDropdownData.d.ts.map +1 -0
- package/dist/src/hooks/useDropdownData.js +74 -0
- package/dist/src/hooks/useDropdownData.js.map +1 -0
- package/dist/src/hooks/useEnsureNoSessionAndFetchNonce.d.ts +5 -0
- package/dist/src/hooks/useEnsureNoSessionAndFetchNonce.d.ts.map +1 -0
- package/dist/src/hooks/useEnsureNoSessionAndFetchNonce.js +34 -0
- package/dist/src/hooks/useEnsureNoSessionAndFetchNonce.js.map +1 -0
- package/dist/src/hooks/useGetAccountByAddress.d.ts +3 -5
- package/dist/src/hooks/useGetAccountByAddress.d.ts.map +1 -1
- package/dist/src/hooks/useGetAccountByAddress.js +3 -4
- package/dist/src/hooks/useGetAccountByAddress.js.map +1 -1
- package/dist/src/hooks/useGetAccountByMezoId.d.ts +3 -5
- package/dist/src/hooks/useGetAccountByMezoId.d.ts.map +1 -1
- package/dist/src/hooks/useGetAccountByMezoId.js +3 -4
- package/dist/src/hooks/useGetAccountByMezoId.js.map +1 -1
- package/dist/src/hooks/useGetCurrentAccount.d.ts +14 -8
- package/dist/src/hooks/useGetCurrentAccount.d.ts.map +1 -1
- package/dist/src/hooks/useGetCurrentAccount.js +28 -6
- package/dist/src/hooks/useGetCurrentAccount.js.map +1 -1
- package/dist/src/hooks/useGetSession.d.ts +3 -20
- package/dist/src/hooks/useGetSession.d.ts.map +1 -1
- package/dist/src/hooks/useGetSession.js +2 -2
- package/dist/src/hooks/useGetSession.js.map +1 -1
- package/dist/src/hooks/useLinkAccount.d.ts +15 -121
- package/dist/src/hooks/useLinkAccount.d.ts.map +1 -1
- package/dist/src/hooks/useLinkAccount.js +8 -21
- package/dist/src/hooks/useLinkAccount.js.map +1 -1
- package/dist/src/hooks/usePortalApiClient.d.ts +2 -0
- package/dist/src/hooks/usePortalApiClient.d.ts.map +1 -0
- package/dist/src/hooks/usePortalApiClient.js +6 -0
- package/dist/src/hooks/usePortalApiClient.js.map +1 -0
- package/dist/src/hooks/useSignInWithDiscord.d.ts +12 -181
- package/dist/src/hooks/useSignInWithDiscord.d.ts.map +1 -1
- package/dist/src/hooks/useSignInWithDiscord.js +11 -22
- package/dist/src/hooks/useSignInWithDiscord.js.map +1 -1
- package/dist/src/hooks/useSignInWithWallet.d.ts +12 -181
- package/dist/src/hooks/useSignInWithWallet.d.ts.map +1 -1
- package/dist/src/hooks/useSignInWithWallet.js +6 -43
- package/dist/src/hooks/useSignInWithWallet.js.map +1 -1
- package/dist/src/hooks/useSignOut.d.ts +12 -28
- package/dist/src/hooks/useSignOut.d.ts.map +1 -1
- package/dist/src/hooks/useSignOut.js +11 -6
- package/dist/src/hooks/useSignOut.js.map +1 -1
- package/dist/src/hooks/useSignUpWithWallet.d.ts +73 -0
- package/dist/src/hooks/useSignUpWithWallet.d.ts.map +1 -0
- package/dist/src/hooks/useSignUpWithWallet.js +11 -0
- package/dist/src/hooks/useSignUpWithWallet.js.map +1 -0
- package/dist/src/hooks/useUpdateMezoId.d.ts +30 -82
- package/dist/src/hooks/useUpdateMezoId.d.ts.map +1 -1
- package/dist/src/hooks/useUpdateMezoId.js +8 -12
- package/dist/src/hooks/useUpdateMezoId.js.map +1 -1
- package/dist/src/hooks/useWalletAccount.d.ts +12 -0
- package/dist/src/hooks/useWalletAccount.d.ts.map +1 -0
- package/dist/src/hooks/useWalletAccount.js +28 -0
- package/dist/src/hooks/useWalletAccount.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/provider.d.ts +10 -13
- package/dist/src/provider.d.ts.map +1 -1
- package/dist/src/provider.js +11 -20
- package/dist/src/provider.js.map +1 -1
- package/dist/src/utils/address.d.ts +15 -0
- package/dist/src/utils/address.d.ts.map +1 -0
- package/dist/src/utils/address.js +35 -0
- package/dist/src/utils/address.js.map +1 -0
- package/dist/src/utils/address.test.d.ts +2 -0
- package/dist/src/utils/address.test.d.ts.map +1 -0
- package/dist/src/utils/address.test.js +32 -0
- package/dist/src/utils/address.test.js.map +1 -0
- package/dist/src/utils/cryptoAssets.d.ts +28 -0
- package/dist/src/utils/cryptoAssets.d.ts.map +1 -0
- package/dist/src/utils/cryptoAssets.js +73 -0
- package/dist/src/utils/cryptoAssets.js.map +1 -0
- package/dist/src/utils/cryptoAssets.test.d.ts +2 -0
- package/dist/src/utils/cryptoAssets.test.d.ts.map +1 -0
- package/dist/src/utils/cryptoAssets.test.js +50 -0
- package/dist/src/utils/cryptoAssets.test.js.map +1 -0
- package/dist/src/utils/currency.d.ts +14 -0
- package/dist/src/utils/currency.d.ts.map +1 -0
- package/dist/src/utils/currency.js +27 -0
- package/dist/src/utils/currency.js.map +1 -0
- package/dist/src/utils/currency.test.d.ts +2 -0
- package/dist/src/utils/currency.test.d.ts.map +1 -0
- package/dist/src/utils/currency.test.js +34 -0
- package/dist/src/utils/currency.test.js.map +1 -0
- package/dist/src/utils/numbers.d.ts +26 -0
- package/dist/src/utils/numbers.d.ts.map +1 -0
- package/dist/src/utils/numbers.js +40 -0
- package/dist/src/utils/numbers.js.map +1 -0
- package/dist/src/utils/numbers.test.d.ts +2 -0
- package/dist/src/utils/numbers.test.d.ts.map +1 -0
- package/dist/src/utils/numbers.test.js +54 -0
- package/dist/src/utils/numbers.test.js.map +1 -0
- package/package.json +9 -3
- package/src/api/auth.ts +104 -129
- package/src/api/client.ts +78 -0
- package/src/api/fetch-error.ts +8 -0
- package/src/api/index.ts +2 -0
- package/src/api/portal.ts +56 -0
- package/src/assets/DefaultAvatar.tsx +74 -0
- package/src/components/Dropdown/AccountAddress.tsx +130 -0
- package/src/components/Dropdown/AccountAssets.tsx +110 -0
- package/src/components/Dropdown/AccountBalance.tsx +38 -0
- package/src/components/Dropdown/ConnectedTrigger.tsx +56 -0
- package/src/components/Dropdown/Content.tsx +148 -0
- package/src/components/Dropdown/DisconnectedTrigger.tsx +36 -0
- package/src/components/Dropdown/Dropdown.tsx +111 -0
- package/src/components/Dropdown/README.md +51 -0
- package/src/components/Dropdown/WelcomeBlock.tsx +92 -0
- package/src/components/Dropdown/index.ts +2 -0
- package/src/components/index.ts +1 -0
- package/src/hooks/constants.ts +4 -4
- package/src/hooks/index.ts +1 -4
- package/src/hooks/useAssetsUSDConversion.ts +31 -0
- package/src/hooks/useAuthenticateWithWallet.ts +98 -0
- package/src/hooks/useCreateAccount.ts +20 -11
- package/src/hooks/useCreateSession.ts +24 -18
- package/src/hooks/useDropdownData.ts +131 -0
- package/src/hooks/useEnsureNoSessionAndFetchNonce.ts +46 -0
- package/src/hooks/useGetAccountByAddress.ts +11 -5
- package/src/hooks/useGetAccountByMezoId.ts +11 -5
- package/src/hooks/useGetCurrentAccount.ts +53 -7
- package/src/hooks/useGetSession.ts +10 -3
- package/src/hooks/useLinkAccount.ts +19 -31
- package/src/hooks/usePortalApiClient.ts +6 -0
- package/src/hooks/useSignInWithDiscord.ts +19 -28
- package/src/hooks/useSignInWithWallet.ts +14 -54
- package/src/hooks/useSignOut.ts +22 -6
- package/src/hooks/useSignUpWithWallet.ts +21 -0
- package/src/hooks/useUpdateMezoId.ts +20 -12
- package/src/hooks/useWalletAccount.ts +53 -0
- package/src/index.ts +1 -0
- package/src/provider.ts +30 -37
- package/src/utils/address.test.ts +38 -0
- package/src/utils/address.ts +43 -0
- package/src/utils/cryptoAssets.test.ts +61 -0
- package/src/utils/cryptoAssets.ts +93 -0
- package/src/utils/currency.test.ts +38 -0
- package/src/utils/currency.ts +32 -0
- package/src/utils/numbers.test.ts +73 -0
- package/src/utils/numbers.ts +55 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { MutationOptions } from "@tanstack/react-query";
|
|
2
|
+
import type { Session } from "../api";
|
|
3
|
+
declare function useAuthenticateWithWallet(shouldCreateAccount?: boolean, mutationOptions?: Omit<MutationOptions<Session>, "mutationFn" | "mutationKey">): {
|
|
4
|
+
data: undefined;
|
|
5
|
+
variables: undefined;
|
|
6
|
+
error: null;
|
|
7
|
+
isError: false;
|
|
8
|
+
isIdle: true;
|
|
9
|
+
isPending: false;
|
|
10
|
+
isSuccess: false;
|
|
11
|
+
status: "idle";
|
|
12
|
+
reset: () => void;
|
|
13
|
+
context: unknown;
|
|
14
|
+
failureCount: number;
|
|
15
|
+
failureReason: Error | null;
|
|
16
|
+
isPaused: boolean;
|
|
17
|
+
submittedAt: number;
|
|
18
|
+
authenticateWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, void, unknown>;
|
|
19
|
+
authenticateWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, void, unknown>;
|
|
20
|
+
} | {
|
|
21
|
+
data: undefined;
|
|
22
|
+
variables: void;
|
|
23
|
+
error: null;
|
|
24
|
+
isError: false;
|
|
25
|
+
isIdle: false;
|
|
26
|
+
isPending: true;
|
|
27
|
+
isSuccess: false;
|
|
28
|
+
status: "pending";
|
|
29
|
+
reset: () => void;
|
|
30
|
+
context: unknown;
|
|
31
|
+
failureCount: number;
|
|
32
|
+
failureReason: Error | null;
|
|
33
|
+
isPaused: boolean;
|
|
34
|
+
submittedAt: number;
|
|
35
|
+
authenticateWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, void, unknown>;
|
|
36
|
+
authenticateWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, void, unknown>;
|
|
37
|
+
} | {
|
|
38
|
+
data: undefined;
|
|
39
|
+
error: Error;
|
|
40
|
+
variables: void;
|
|
41
|
+
isError: true;
|
|
42
|
+
isIdle: false;
|
|
43
|
+
isPending: false;
|
|
44
|
+
isSuccess: false;
|
|
45
|
+
status: "error";
|
|
46
|
+
reset: () => void;
|
|
47
|
+
context: unknown;
|
|
48
|
+
failureCount: number;
|
|
49
|
+
failureReason: Error | null;
|
|
50
|
+
isPaused: boolean;
|
|
51
|
+
submittedAt: number;
|
|
52
|
+
authenticateWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, void, unknown>;
|
|
53
|
+
authenticateWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, void, unknown>;
|
|
54
|
+
} | {
|
|
55
|
+
data: Session;
|
|
56
|
+
error: null;
|
|
57
|
+
variables: void;
|
|
58
|
+
isError: false;
|
|
59
|
+
isIdle: false;
|
|
60
|
+
isPending: false;
|
|
61
|
+
isSuccess: true;
|
|
62
|
+
status: "success";
|
|
63
|
+
reset: () => void;
|
|
64
|
+
context: unknown;
|
|
65
|
+
failureCount: number;
|
|
66
|
+
failureReason: Error | null;
|
|
67
|
+
isPaused: boolean;
|
|
68
|
+
submittedAt: number;
|
|
69
|
+
authenticateWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, void, unknown>;
|
|
70
|
+
authenticateWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, void, unknown>;
|
|
71
|
+
};
|
|
72
|
+
export { useAuthenticateWithWallet };
|
|
73
|
+
//# sourceMappingURL=useAuthenticateWithWallet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAuthenticateWithWallet.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAuthenticateWithWallet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAe,MAAM,uBAAuB,CAAA;AAMpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAGrC,iBAAS,yBAAyB,CAChC,mBAAmB,UAAQ,EAC3B,eAAe,GAAE,IAAI,CACnB,eAAe,CAAC,OAAO,CAAC,EACxB,YAAY,GAAG,aAAa,CACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgFP;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { useSignMessage } from "wagmi";
|
|
2
|
+
import { useMutation } from "@tanstack/react-query";
|
|
3
|
+
import { useCreateAccount } from "./useCreateAccount";
|
|
4
|
+
import { useCreateSession } from "./useCreateSession";
|
|
5
|
+
import { useEnsureNoSessionAndFetchNonce } from "./useEnsureNoSessionAndFetchNonce";
|
|
6
|
+
import { createSignInWithWalletMessage } from "../utils/siww";
|
|
7
|
+
import { useGetAccountByAddress } from "./useGetAccountByAddress";
|
|
8
|
+
import useWalletAccount from "./useWalletAccount";
|
|
9
|
+
function useAuthenticateWithWallet(shouldCreateAccount = false, mutationOptions = {}) {
|
|
10
|
+
const { address, chainId, connector, networkFamily } = useWalletAccount();
|
|
11
|
+
const { ensureNoSessionAndFetchNonce } = useEnsureNoSessionAndFetchNonce();
|
|
12
|
+
const { createSessionAsync } = useCreateSession();
|
|
13
|
+
const { createAccountAsync } = useCreateAccount();
|
|
14
|
+
const { signMessageAsync } = useSignMessage();
|
|
15
|
+
const { refetch: getAccountByAddress } = useGetAccountByAddress(address, {
|
|
16
|
+
enabled: false,
|
|
17
|
+
retry: false,
|
|
18
|
+
});
|
|
19
|
+
const { mutate, mutateAsync, ...signInMutationRestParameters } = useMutation({
|
|
20
|
+
mutationFn: async () => {
|
|
21
|
+
if (!address) {
|
|
22
|
+
throw new Error("Sign in error: Wallet not connected!");
|
|
23
|
+
}
|
|
24
|
+
const nonce = await ensureNoSessionAndFetchNonce();
|
|
25
|
+
const messageResult = createSignInWithWalletMessage(address, nonce, networkFamily, chainId);
|
|
26
|
+
const signatureResult = await signMessageAsync({
|
|
27
|
+
message: messageResult,
|
|
28
|
+
connector,
|
|
29
|
+
});
|
|
30
|
+
if (shouldCreateAccount) {
|
|
31
|
+
const getAccountByAddressResult = await getAccountByAddress();
|
|
32
|
+
if (getAccountByAddressResult.data) {
|
|
33
|
+
throw new Error("Wallet authentication failed: Account creation failed. Account already exists.");
|
|
34
|
+
}
|
|
35
|
+
if (getAccountByAddressResult.error) {
|
|
36
|
+
throw new Error(`Wallet authentication failed: Account creation failed. Could not verify if account already exists: ${getAccountByAddressResult.error}`);
|
|
37
|
+
}
|
|
38
|
+
// Fetch was successful, but no account was found
|
|
39
|
+
try {
|
|
40
|
+
const createAccountResult = await createAccountAsync({
|
|
41
|
+
type: "wallet",
|
|
42
|
+
message: messageResult,
|
|
43
|
+
signature: signatureResult,
|
|
44
|
+
});
|
|
45
|
+
if (!createAccountResult) {
|
|
46
|
+
throw new Error("Failed to create new account");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
throw new Error(`Wallet authentication failed: Account creation failed: ${error}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return (await createSessionAsync({
|
|
54
|
+
type: "wallet",
|
|
55
|
+
message: messageResult,
|
|
56
|
+
signature: signatureResult,
|
|
57
|
+
}));
|
|
58
|
+
// ^ By passing type: "wallet" we know for sure the return type is Session
|
|
59
|
+
},
|
|
60
|
+
...mutationOptions,
|
|
61
|
+
});
|
|
62
|
+
return {
|
|
63
|
+
authenticateWithWallet: mutate,
|
|
64
|
+
authenticateWithWalletAsync: mutateAsync,
|
|
65
|
+
...signInMutationRestParameters,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export { useAuthenticateWithWallet };
|
|
69
|
+
//# sourceMappingURL=useAuthenticateWithWallet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAuthenticateWithWallet.js","sourceRoot":"","sources":["../../../src/hooks/useAuthenticateWithWallet.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { MutationOptions, DefaultError } from "@tanstack/react-query";
|
|
2
|
+
import type { CreateAccountRequest, CreateAccountResponse } from "../api";
|
|
3
|
+
export declare function useCreateAccount(mutationOptions?: Omit<MutationOptions<CreateAccountResponse, DefaultError, CreateAccountRequest>, "mutationFn" | "mutationKey">): {
|
|
2
4
|
data: undefined;
|
|
3
5
|
variables: undefined;
|
|
4
6
|
error: null;
|
|
@@ -14,42 +16,18 @@ export declare function useCreateAccount(useMutationOptions?: {}): {
|
|
|
14
16
|
isPaused: boolean;
|
|
15
17
|
submittedAt: number;
|
|
16
18
|
createAccount: import("@tanstack/react-query").UseMutateFunction<{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
user_metadata: {
|
|
22
|
-
mezoId?: string | undefined;
|
|
23
|
-
btcAddress: string;
|
|
24
|
-
evmAddress: string;
|
|
25
|
-
};
|
|
26
|
-
}, Error, {
|
|
27
|
-
type: "wallet";
|
|
28
|
-
message: string;
|
|
29
|
-
signature: string;
|
|
30
|
-
}, unknown>;
|
|
19
|
+
mezoId: string;
|
|
20
|
+
hasModifiedMezoId: boolean;
|
|
21
|
+
linkedAccounts: import("../api").LinkedAccount[];
|
|
22
|
+
}, Error, CreateAccountRequest, unknown>;
|
|
31
23
|
createAccountAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
user_metadata: {
|
|
37
|
-
mezoId?: string | undefined;
|
|
38
|
-
btcAddress: string;
|
|
39
|
-
evmAddress: string;
|
|
40
|
-
};
|
|
41
|
-
}, Error, {
|
|
42
|
-
type: "wallet";
|
|
43
|
-
message: string;
|
|
44
|
-
signature: string;
|
|
45
|
-
}, unknown>;
|
|
24
|
+
mezoId: string;
|
|
25
|
+
hasModifiedMezoId: boolean;
|
|
26
|
+
linkedAccounts: import("../api").LinkedAccount[];
|
|
27
|
+
}, Error, CreateAccountRequest, unknown>;
|
|
46
28
|
} | {
|
|
47
29
|
data: undefined;
|
|
48
|
-
variables:
|
|
49
|
-
type: "wallet";
|
|
50
|
-
message: string;
|
|
51
|
-
signature: string;
|
|
52
|
-
};
|
|
30
|
+
variables: CreateAccountRequest;
|
|
53
31
|
error: null;
|
|
54
32
|
isError: false;
|
|
55
33
|
isIdle: false;
|
|
@@ -63,43 +41,19 @@ export declare function useCreateAccount(useMutationOptions?: {}): {
|
|
|
63
41
|
isPaused: boolean;
|
|
64
42
|
submittedAt: number;
|
|
65
43
|
createAccount: import("@tanstack/react-query").UseMutateFunction<{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
user_metadata: {
|
|
71
|
-
mezoId?: string | undefined;
|
|
72
|
-
btcAddress: string;
|
|
73
|
-
evmAddress: string;
|
|
74
|
-
};
|
|
75
|
-
}, Error, {
|
|
76
|
-
type: "wallet";
|
|
77
|
-
message: string;
|
|
78
|
-
signature: string;
|
|
79
|
-
}, unknown>;
|
|
44
|
+
mezoId: string;
|
|
45
|
+
hasModifiedMezoId: boolean;
|
|
46
|
+
linkedAccounts: import("../api").LinkedAccount[];
|
|
47
|
+
}, Error, CreateAccountRequest, unknown>;
|
|
80
48
|
createAccountAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
user_metadata: {
|
|
86
|
-
mezoId?: string | undefined;
|
|
87
|
-
btcAddress: string;
|
|
88
|
-
evmAddress: string;
|
|
89
|
-
};
|
|
90
|
-
}, Error, {
|
|
91
|
-
type: "wallet";
|
|
92
|
-
message: string;
|
|
93
|
-
signature: string;
|
|
94
|
-
}, unknown>;
|
|
49
|
+
mezoId: string;
|
|
50
|
+
hasModifiedMezoId: boolean;
|
|
51
|
+
linkedAccounts: import("../api").LinkedAccount[];
|
|
52
|
+
}, Error, CreateAccountRequest, unknown>;
|
|
95
53
|
} | {
|
|
96
54
|
data: undefined;
|
|
97
55
|
error: Error;
|
|
98
|
-
variables:
|
|
99
|
-
type: "wallet";
|
|
100
|
-
message: string;
|
|
101
|
-
signature: string;
|
|
102
|
-
};
|
|
56
|
+
variables: CreateAccountRequest;
|
|
103
57
|
isError: true;
|
|
104
58
|
isIdle: false;
|
|
105
59
|
isPending: false;
|
|
@@ -112,53 +66,23 @@ export declare function useCreateAccount(useMutationOptions?: {}): {
|
|
|
112
66
|
isPaused: boolean;
|
|
113
67
|
submittedAt: number;
|
|
114
68
|
createAccount: import("@tanstack/react-query").UseMutateFunction<{
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
user_metadata: {
|
|
120
|
-
mezoId?: string | undefined;
|
|
121
|
-
btcAddress: string;
|
|
122
|
-
evmAddress: string;
|
|
123
|
-
};
|
|
124
|
-
}, Error, {
|
|
125
|
-
type: "wallet";
|
|
126
|
-
message: string;
|
|
127
|
-
signature: string;
|
|
128
|
-
}, unknown>;
|
|
69
|
+
mezoId: string;
|
|
70
|
+
hasModifiedMezoId: boolean;
|
|
71
|
+
linkedAccounts: import("../api").LinkedAccount[];
|
|
72
|
+
}, Error, CreateAccountRequest, unknown>;
|
|
129
73
|
createAccountAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
user_metadata: {
|
|
135
|
-
mezoId?: string | undefined;
|
|
136
|
-
btcAddress: string;
|
|
137
|
-
evmAddress: string;
|
|
138
|
-
};
|
|
139
|
-
}, Error, {
|
|
140
|
-
type: "wallet";
|
|
141
|
-
message: string;
|
|
142
|
-
signature: string;
|
|
143
|
-
}, unknown>;
|
|
74
|
+
mezoId: string;
|
|
75
|
+
hasModifiedMezoId: boolean;
|
|
76
|
+
linkedAccounts: import("../api").LinkedAccount[];
|
|
77
|
+
}, Error, CreateAccountRequest, unknown>;
|
|
144
78
|
} | {
|
|
145
79
|
data: {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
};
|
|
150
|
-
user_metadata: {
|
|
151
|
-
mezoId?: string | undefined;
|
|
152
|
-
btcAddress: string;
|
|
153
|
-
evmAddress: string;
|
|
154
|
-
};
|
|
80
|
+
mezoId: string;
|
|
81
|
+
hasModifiedMezoId: boolean;
|
|
82
|
+
linkedAccounts: import("../api").LinkedAccount[];
|
|
155
83
|
};
|
|
156
84
|
error: null;
|
|
157
|
-
variables:
|
|
158
|
-
type: "wallet";
|
|
159
|
-
message: string;
|
|
160
|
-
signature: string;
|
|
161
|
-
};
|
|
85
|
+
variables: CreateAccountRequest;
|
|
162
86
|
isError: false;
|
|
163
87
|
isIdle: false;
|
|
164
88
|
isPending: false;
|
|
@@ -171,34 +95,14 @@ export declare function useCreateAccount(useMutationOptions?: {}): {
|
|
|
171
95
|
isPaused: boolean;
|
|
172
96
|
submittedAt: number;
|
|
173
97
|
createAccount: import("@tanstack/react-query").UseMutateFunction<{
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
user_metadata: {
|
|
179
|
-
mezoId?: string | undefined;
|
|
180
|
-
btcAddress: string;
|
|
181
|
-
evmAddress: string;
|
|
182
|
-
};
|
|
183
|
-
}, Error, {
|
|
184
|
-
type: "wallet";
|
|
185
|
-
message: string;
|
|
186
|
-
signature: string;
|
|
187
|
-
}, unknown>;
|
|
98
|
+
mezoId: string;
|
|
99
|
+
hasModifiedMezoId: boolean;
|
|
100
|
+
linkedAccounts: import("../api").LinkedAccount[];
|
|
101
|
+
}, Error, CreateAccountRequest, unknown>;
|
|
188
102
|
createAccountAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
user_metadata: {
|
|
194
|
-
mezoId?: string | undefined;
|
|
195
|
-
btcAddress: string;
|
|
196
|
-
evmAddress: string;
|
|
197
|
-
};
|
|
198
|
-
}, Error, {
|
|
199
|
-
type: "wallet";
|
|
200
|
-
message: string;
|
|
201
|
-
signature: string;
|
|
202
|
-
}, unknown>;
|
|
103
|
+
mezoId: string;
|
|
104
|
+
hasModifiedMezoId: boolean;
|
|
105
|
+
linkedAccounts: import("../api").LinkedAccount[];
|
|
106
|
+
}, Error, CreateAccountRequest, unknown>;
|
|
203
107
|
};
|
|
204
108
|
//# sourceMappingURL=useCreateAccount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCreateAccount.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCreateAccount.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCreateAccount.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCreateAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,eAAe,EACf,YAAY,EACb,MAAM,uBAAuB,CAAA;AAG9B,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAA;AAEzE,wBAAgB,gBAAgB,CAC9B,eAAe,GAAE,IAAI,CACnB,eAAe,CAAC,qBAAqB,EAAE,YAAY,EAAE,oBAAoB,CAAC,EAC1E,YAAY,GAAG,aAAa,CACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBP"}
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import { useQueryClient, useMutation } from "@tanstack/react-query";
|
|
1
|
+
import { useQueryClient, useMutation, } from "@tanstack/react-query";
|
|
2
2
|
import { useAuthApiClient } from "./useAuthApiClient";
|
|
3
3
|
import { QUERY_KEYS } from "./constants";
|
|
4
|
-
export function useCreateAccount(
|
|
4
|
+
export function useCreateAccount(mutationOptions = {}) {
|
|
5
5
|
const queryClient = useQueryClient();
|
|
6
6
|
const authApiClient = useAuthApiClient();
|
|
7
|
+
const { onSuccess: customOnSuccess, ...restMutationOptions } = mutationOptions;
|
|
7
8
|
const { mutate, mutateAsync, ...rest } = useMutation({
|
|
8
9
|
mutationFn: (createAccountRequest) => authApiClient.createAccount(createAccountRequest),
|
|
9
|
-
onSuccess: () => {
|
|
10
|
+
onSuccess: (data, variables, context) => {
|
|
10
11
|
queryClient.resetQueries({
|
|
11
|
-
queryKey: [QUERY_KEYS.
|
|
12
|
-
exact: false,
|
|
13
|
-
});
|
|
14
|
-
queryClient.resetQueries({
|
|
15
|
-
queryKey: [QUERY_KEYS.ACCOUNT_BY_MEZO_ID],
|
|
16
|
-
exact: false,
|
|
12
|
+
queryKey: [QUERY_KEYS.ACCOUNT],
|
|
17
13
|
});
|
|
14
|
+
if (customOnSuccess)
|
|
15
|
+
customOnSuccess(data, variables, context);
|
|
18
16
|
},
|
|
19
|
-
...
|
|
17
|
+
...restMutationOptions,
|
|
20
18
|
});
|
|
21
19
|
return { createAccount: mutate, createAccountAsync: mutateAsync, ...rest };
|
|
22
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCreateAccount.js","sourceRoot":"","sources":["../../../src/hooks/useCreateAccount.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"useCreateAccount.js","sourceRoot":"","sources":["../../../src/hooks/useCreateAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,WAAW,GAGZ,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAGxC,MAAM,UAAU,gBAAgB,CAC9B,kBAGI,EAAE;IAEN,MAAM,WAAW,GAAG,cAAc,EAAE,CAAA;IACpC,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAA;IAExC,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,mBAAmB,EAAE,GAAG,eAAe,CAAA;IAE9E,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,WAAW,CAAC;QACnD,UAAU,EAAE,CAAC,oBAA0C,EAAE,EAAE,CACzD,aAAa,CAAC,aAAa,CAAC,oBAAoB,CAAC;QACnD,SAAS,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE;YACtC,WAAW,CAAC,YAAY,CAAC;gBACvB,QAAQ,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;aAC/B,CAAC,CAAA;YAEF,IAAI,eAAe;gBAAE,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;QAChE,CAAC;QACD,GAAG,mBAAmB;KACvB,CAAC,CAAA;IAEF,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,kBAAkB,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,CAAA;AAC5E,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MutationOptions, DefaultError } from "@tanstack/react-query";
|
|
2
|
+
import type { CreateSessionRequest, CreateSessionResponse } from "../api";
|
|
2
3
|
/**
|
|
3
4
|
* This hook is not exposed for external consumers. For creating session they
|
|
4
5
|
* should use `useSignIn` hook related to the authentication method.
|
|
5
6
|
*/
|
|
6
|
-
export declare function useCreateSession(
|
|
7
|
+
export declare function useCreateSession(mutationOptions?: Omit<MutationOptions<CreateSessionResponse, DefaultError, CreateSessionRequest>, "mutationFn" | "mutationKey">): {
|
|
7
8
|
data: undefined;
|
|
8
9
|
variables: undefined;
|
|
9
10
|
error: null;
|
|
@@ -18,46 +19,8 @@ export declare function useCreateSession(useMutationOptions?: {}): {
|
|
|
18
19
|
failureReason: Error | null;
|
|
19
20
|
isPaused: boolean;
|
|
20
21
|
submittedAt: number;
|
|
21
|
-
createSession: import("@tanstack/react-query").UseMutateFunction<
|
|
22
|
-
|
|
23
|
-
token_type: string;
|
|
24
|
-
expires_in: number;
|
|
25
|
-
expires_at: number;
|
|
26
|
-
refresh_token: string;
|
|
27
|
-
user: {
|
|
28
|
-
app_metadata: {
|
|
29
|
-
provider: "wallet" | "discord" | "email";
|
|
30
|
-
providers: ("wallet" | "discord" | "email")[];
|
|
31
|
-
};
|
|
32
|
-
user_metadata: {
|
|
33
|
-
mezoId?: string | undefined;
|
|
34
|
-
btcAddress: string;
|
|
35
|
-
evmAddress: string;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
} | {
|
|
39
|
-
redirectTo: string;
|
|
40
|
-
}, Error, CreateSessionRequest, unknown>;
|
|
41
|
-
createSessionAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
42
|
-
access_token: string;
|
|
43
|
-
token_type: string;
|
|
44
|
-
expires_in: number;
|
|
45
|
-
expires_at: number;
|
|
46
|
-
refresh_token: string;
|
|
47
|
-
user: {
|
|
48
|
-
app_metadata: {
|
|
49
|
-
provider: "wallet" | "discord" | "email";
|
|
50
|
-
providers: ("wallet" | "discord" | "email")[];
|
|
51
|
-
};
|
|
52
|
-
user_metadata: {
|
|
53
|
-
mezoId?: string | undefined;
|
|
54
|
-
btcAddress: string;
|
|
55
|
-
evmAddress: string;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
} | {
|
|
59
|
-
redirectTo: string;
|
|
60
|
-
}, Error, CreateSessionRequest, unknown>;
|
|
22
|
+
createSession: import("@tanstack/react-query").UseMutateFunction<CreateSessionResponse, Error, CreateSessionRequest, unknown>;
|
|
23
|
+
createSessionAsync: import("@tanstack/react-query").UseMutateAsyncFunction<CreateSessionResponse, Error, CreateSessionRequest, unknown>;
|
|
61
24
|
} | {
|
|
62
25
|
data: undefined;
|
|
63
26
|
variables: CreateSessionRequest;
|
|
@@ -73,46 +36,8 @@ export declare function useCreateSession(useMutationOptions?: {}): {
|
|
|
73
36
|
failureReason: Error | null;
|
|
74
37
|
isPaused: boolean;
|
|
75
38
|
submittedAt: number;
|
|
76
|
-
createSession: import("@tanstack/react-query").UseMutateFunction<
|
|
77
|
-
|
|
78
|
-
token_type: string;
|
|
79
|
-
expires_in: number;
|
|
80
|
-
expires_at: number;
|
|
81
|
-
refresh_token: string;
|
|
82
|
-
user: {
|
|
83
|
-
app_metadata: {
|
|
84
|
-
provider: "wallet" | "discord" | "email";
|
|
85
|
-
providers: ("wallet" | "discord" | "email")[];
|
|
86
|
-
};
|
|
87
|
-
user_metadata: {
|
|
88
|
-
mezoId?: string | undefined;
|
|
89
|
-
btcAddress: string;
|
|
90
|
-
evmAddress: string;
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
} | {
|
|
94
|
-
redirectTo: string;
|
|
95
|
-
}, Error, CreateSessionRequest, unknown>;
|
|
96
|
-
createSessionAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
97
|
-
access_token: string;
|
|
98
|
-
token_type: string;
|
|
99
|
-
expires_in: number;
|
|
100
|
-
expires_at: number;
|
|
101
|
-
refresh_token: string;
|
|
102
|
-
user: {
|
|
103
|
-
app_metadata: {
|
|
104
|
-
provider: "wallet" | "discord" | "email";
|
|
105
|
-
providers: ("wallet" | "discord" | "email")[];
|
|
106
|
-
};
|
|
107
|
-
user_metadata: {
|
|
108
|
-
mezoId?: string | undefined;
|
|
109
|
-
btcAddress: string;
|
|
110
|
-
evmAddress: string;
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
} | {
|
|
114
|
-
redirectTo: string;
|
|
115
|
-
}, Error, CreateSessionRequest, unknown>;
|
|
39
|
+
createSession: import("@tanstack/react-query").UseMutateFunction<CreateSessionResponse, Error, CreateSessionRequest, unknown>;
|
|
40
|
+
createSessionAsync: import("@tanstack/react-query").UseMutateAsyncFunction<CreateSessionResponse, Error, CreateSessionRequest, unknown>;
|
|
116
41
|
} | {
|
|
117
42
|
data: undefined;
|
|
118
43
|
error: Error;
|
|
@@ -128,67 +53,10 @@ export declare function useCreateSession(useMutationOptions?: {}): {
|
|
|
128
53
|
failureReason: Error | null;
|
|
129
54
|
isPaused: boolean;
|
|
130
55
|
submittedAt: number;
|
|
131
|
-
createSession: import("@tanstack/react-query").UseMutateFunction<
|
|
132
|
-
|
|
133
|
-
token_type: string;
|
|
134
|
-
expires_in: number;
|
|
135
|
-
expires_at: number;
|
|
136
|
-
refresh_token: string;
|
|
137
|
-
user: {
|
|
138
|
-
app_metadata: {
|
|
139
|
-
provider: "wallet" | "discord" | "email";
|
|
140
|
-
providers: ("wallet" | "discord" | "email")[];
|
|
141
|
-
};
|
|
142
|
-
user_metadata: {
|
|
143
|
-
mezoId?: string | undefined;
|
|
144
|
-
btcAddress: string;
|
|
145
|
-
evmAddress: string;
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
} | {
|
|
149
|
-
redirectTo: string;
|
|
150
|
-
}, Error, CreateSessionRequest, unknown>;
|
|
151
|
-
createSessionAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
152
|
-
access_token: string;
|
|
153
|
-
token_type: string;
|
|
154
|
-
expires_in: number;
|
|
155
|
-
expires_at: number;
|
|
156
|
-
refresh_token: string;
|
|
157
|
-
user: {
|
|
158
|
-
app_metadata: {
|
|
159
|
-
provider: "wallet" | "discord" | "email";
|
|
160
|
-
providers: ("wallet" | "discord" | "email")[];
|
|
161
|
-
};
|
|
162
|
-
user_metadata: {
|
|
163
|
-
mezoId?: string | undefined;
|
|
164
|
-
btcAddress: string;
|
|
165
|
-
evmAddress: string;
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
} | {
|
|
169
|
-
redirectTo: string;
|
|
170
|
-
}, Error, CreateSessionRequest, unknown>;
|
|
56
|
+
createSession: import("@tanstack/react-query").UseMutateFunction<CreateSessionResponse, Error, CreateSessionRequest, unknown>;
|
|
57
|
+
createSessionAsync: import("@tanstack/react-query").UseMutateAsyncFunction<CreateSessionResponse, Error, CreateSessionRequest, unknown>;
|
|
171
58
|
} | {
|
|
172
|
-
data:
|
|
173
|
-
access_token: string;
|
|
174
|
-
token_type: string;
|
|
175
|
-
expires_in: number;
|
|
176
|
-
expires_at: number;
|
|
177
|
-
refresh_token: string;
|
|
178
|
-
user: {
|
|
179
|
-
app_metadata: {
|
|
180
|
-
provider: "wallet" | "discord" | "email";
|
|
181
|
-
providers: ("wallet" | "discord" | "email")[];
|
|
182
|
-
};
|
|
183
|
-
user_metadata: {
|
|
184
|
-
mezoId?: string | undefined;
|
|
185
|
-
btcAddress: string;
|
|
186
|
-
evmAddress: string;
|
|
187
|
-
};
|
|
188
|
-
};
|
|
189
|
-
} | {
|
|
190
|
-
redirectTo: string;
|
|
191
|
-
};
|
|
59
|
+
data: CreateSessionResponse;
|
|
192
60
|
error: null;
|
|
193
61
|
variables: CreateSessionRequest;
|
|
194
62
|
isError: false;
|
|
@@ -202,45 +70,7 @@ export declare function useCreateSession(useMutationOptions?: {}): {
|
|
|
202
70
|
failureReason: Error | null;
|
|
203
71
|
isPaused: boolean;
|
|
204
72
|
submittedAt: number;
|
|
205
|
-
createSession: import("@tanstack/react-query").UseMutateFunction<
|
|
206
|
-
|
|
207
|
-
token_type: string;
|
|
208
|
-
expires_in: number;
|
|
209
|
-
expires_at: number;
|
|
210
|
-
refresh_token: string;
|
|
211
|
-
user: {
|
|
212
|
-
app_metadata: {
|
|
213
|
-
provider: "wallet" | "discord" | "email";
|
|
214
|
-
providers: ("wallet" | "discord" | "email")[];
|
|
215
|
-
};
|
|
216
|
-
user_metadata: {
|
|
217
|
-
mezoId?: string | undefined;
|
|
218
|
-
btcAddress: string;
|
|
219
|
-
evmAddress: string;
|
|
220
|
-
};
|
|
221
|
-
};
|
|
222
|
-
} | {
|
|
223
|
-
redirectTo: string;
|
|
224
|
-
}, Error, CreateSessionRequest, unknown>;
|
|
225
|
-
createSessionAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
226
|
-
access_token: string;
|
|
227
|
-
token_type: string;
|
|
228
|
-
expires_in: number;
|
|
229
|
-
expires_at: number;
|
|
230
|
-
refresh_token: string;
|
|
231
|
-
user: {
|
|
232
|
-
app_metadata: {
|
|
233
|
-
provider: "wallet" | "discord" | "email";
|
|
234
|
-
providers: ("wallet" | "discord" | "email")[];
|
|
235
|
-
};
|
|
236
|
-
user_metadata: {
|
|
237
|
-
mezoId?: string | undefined;
|
|
238
|
-
btcAddress: string;
|
|
239
|
-
evmAddress: string;
|
|
240
|
-
};
|
|
241
|
-
};
|
|
242
|
-
} | {
|
|
243
|
-
redirectTo: string;
|
|
244
|
-
}, Error, CreateSessionRequest, unknown>;
|
|
73
|
+
createSession: import("@tanstack/react-query").UseMutateFunction<CreateSessionResponse, Error, CreateSessionRequest, unknown>;
|
|
74
|
+
createSessionAsync: import("@tanstack/react-query").UseMutateAsyncFunction<CreateSessionResponse, Error, CreateSessionRequest, unknown>;
|
|
245
75
|
};
|
|
246
76
|
//# sourceMappingURL=useCreateSession.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCreateSession.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCreateSession.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCreateSession.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCreateSession.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,eAAe,EACf,YAAY,EACb,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAA;AAGzE;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,eAAe,GAAE,IAAI,CACnB,eAAe,CAAC,qBAAqB,EAAE,YAAY,EAAE,oBAAoB,CAAC,EAC1E,YAAY,GAAG,aAAa,CACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBP"}
|