@mezo-org/passport 0.4.0-dev.4 → 0.4.0-dev.6
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 +36 -59
- package/dist/src/api/auth.d.ts.map +1 -1
- package/dist/src/api/auth.js +21 -49
- 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 +58 -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 +8 -0
- package/dist/src/components/Dropdown/Content.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Content.js +65 -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 +18 -0
- package/dist/src/components/Dropdown/Dropdown.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Dropdown.js +42 -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 +1 -0
- package/dist/src/hooks/constants.d.ts.map +1 -1
- package/dist/src/hooks/constants.js +1 -0
- package/dist/src/hooks/constants.js.map +1 -1
- package/dist/src/hooks/index.d.ts +1 -1
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/src/hooks/index.js +1 -1
- 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 +70 -0
- package/dist/src/hooks/useAuthenticateWithWallet.js.map +1 -0
- package/dist/src/hooks/useCreateAccount.d.ts +23 -173
- package/dist/src/hooks/useCreateAccount.d.ts.map +1 -1
- package/dist/src/hooks/useCreateAccount.js +7 -4
- package/dist/src/hooks/useCreateAccount.js.map +1 -1
- package/dist/src/hooks/useCreateSession.d.ts +12 -101
- package/dist/src/hooks/useCreateSession.d.ts.map +1 -1
- package/dist/src/hooks/useCreateSession.js +10 -8
- package/dist/src/hooks/useCreateSession.js.map +1 -1
- package/dist/src/hooks/useDropdownData.d.ts +44 -0
- package/dist/src/hooks/useDropdownData.d.ts.map +1 -0
- package/dist/src/hooks/useDropdownData.js +73 -0
- package/dist/src/hooks/useDropdownData.js.map +1 -0
- package/dist/src/hooks/useEnsureNoSessionAndFetchNonce.d.ts.map +1 -1
- package/dist/src/hooks/useEnsureNoSessionAndFetchNonce.js +1 -0
- package/dist/src/hooks/useEnsureNoSessionAndFetchNonce.js.map +1 -1
- package/dist/src/hooks/useGetAccountByAddress.d.ts +2 -2
- package/dist/src/hooks/useGetAccountByAddress.d.ts.map +1 -1
- package/dist/src/hooks/useGetAccountByMezoId.d.ts +2 -2
- package/dist/src/hooks/useGetAccountByMezoId.d.ts.map +1 -1
- package/dist/src/hooks/useGetCurrentAccount.d.ts +16 -2
- package/dist/src/hooks/useGetCurrentAccount.d.ts.map +1 -1
- package/dist/src/hooks/useGetCurrentAccount.js +25 -3
- package/dist/src/hooks/useGetCurrentAccount.js.map +1 -1
- package/dist/src/hooks/useGetSession.d.ts +1 -1
- package/dist/src/hooks/useGetSession.d.ts.map +1 -1
- package/dist/src/hooks/useLinkAccount.d.ts +15 -175
- package/dist/src/hooks/useLinkAccount.d.ts.map +1 -1
- package/dist/src/hooks/useLinkAccount.js +7 -4
- 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 -100
- package/dist/src/hooks/useSignInWithDiscord.d.ts.map +1 -1
- package/dist/src/hooks/useSignInWithDiscord.js +6 -3
- package/dist/src/hooks/useSignInWithDiscord.js.map +1 -1
- package/dist/src/hooks/useSignInWithWallet.d.ts +12 -100
- package/dist/src/hooks/useSignInWithWallet.d.ts.map +1 -1
- package/dist/src/hooks/useSignInWithWallet.js +6 -34
- 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 +7 -4
- 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 -136
- package/dist/src/hooks/useUpdateMezoId.d.ts.map +1 -1
- package/dist/src/hooks/useUpdateMezoId.js +7 -4
- 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 +25 -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 +37 -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 +49 -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 +43 -0
- package/dist/src/utils/numbers.d.ts.map +1 -0
- package/dist/src/utils/numbers.js +81 -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 +68 -0
- package/dist/src/utils/numbers.test.js.map +1 -0
- package/package.json +9 -3
- package/src/api/auth.ts +72 -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 +111 -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 +142 -0
- package/src/components/Dropdown/DisconnectedTrigger.tsx +35 -0
- package/src/components/Dropdown/Dropdown.tsx +81 -0
- package/src/components/Dropdown/README.md +46 -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 +1 -0
- package/src/hooks/index.ts +1 -1
- package/src/hooks/useAssetsUSDConversion.ts +31 -0
- package/src/hooks/useAuthenticateWithWallet.ts +105 -0
- package/src/hooks/useCreateAccount.ts +19 -5
- package/src/hooks/useCreateSession.ts +22 -9
- package/src/hooks/useDropdownData.ts +130 -0
- package/src/hooks/useEnsureNoSessionAndFetchNonce.ts +1 -0
- package/src/hooks/useGetAccountByAddress.ts +2 -2
- package/src/hooks/useGetAccountByMezoId.ts +2 -2
- package/src/hooks/useGetCurrentAccount.ts +46 -6
- package/src/hooks/useGetSession.ts +1 -1
- package/src/hooks/useLinkAccount.ts +18 -5
- package/src/hooks/usePortalApiClient.ts +6 -0
- package/src/hooks/useSignInWithDiscord.ts +14 -5
- package/src/hooks/useSignInWithWallet.ts +14 -42
- package/src/hooks/useSignOut.ts +18 -4
- package/src/hooks/useSignUpWithWallet.ts +21 -0
- package/src/hooks/useUpdateMezoId.ts +19 -4
- package/src/hooks/useWalletAccount.ts +41 -0
- package/src/index.ts +1 -0
- package/src/provider.ts +30 -37
- package/src/utils/address.test.ts +44 -0
- package/src/utils/address.ts +43 -0
- package/src/utils/cryptoAssets.test.ts +59 -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 +89 -0
- package/src/utils/numbers.ts +110 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { MutationOptions } from "@tanstack/react-query";
|
|
2
|
+
import type { AuthenticationProviderRedirectResponse } from "../api";
|
|
3
|
+
declare function useSignInWithDiscord(mutationOptions?: Omit<MutationOptions<AuthenticationProviderRedirectResponse>, "mutationFn" | "mutationKey">): {
|
|
2
4
|
data: undefined;
|
|
3
5
|
variables: undefined;
|
|
4
6
|
error: null;
|
|
@@ -13,28 +15,8 @@ declare function useSignInWithDiscord(): {
|
|
|
13
15
|
failureReason: Error | null;
|
|
14
16
|
isPaused: boolean;
|
|
15
17
|
submittedAt: number;
|
|
16
|
-
signInWithDiscord: import("@tanstack/react-query").UseMutateFunction<
|
|
17
|
-
|
|
18
|
-
expiresAt: number;
|
|
19
|
-
sessionLinks: {
|
|
20
|
-
_links: {
|
|
21
|
-
account: "/session/account";
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
} | {
|
|
25
|
-
redirectTo: string;
|
|
26
|
-
}, Error, void, unknown>;
|
|
27
|
-
signInWithDiscordAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
28
|
-
expiresIn: number;
|
|
29
|
-
expiresAt: number;
|
|
30
|
-
sessionLinks: {
|
|
31
|
-
_links: {
|
|
32
|
-
account: "/session/account";
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
} | {
|
|
36
|
-
redirectTo: string;
|
|
37
|
-
}, Error, void, unknown>;
|
|
18
|
+
signInWithDiscord: import("@tanstack/react-query").UseMutateFunction<AuthenticationProviderRedirectResponse, Error, void, unknown>;
|
|
19
|
+
signInWithDiscordAsync: import("@tanstack/react-query").UseMutateAsyncFunction<AuthenticationProviderRedirectResponse, Error, void, unknown>;
|
|
38
20
|
} | {
|
|
39
21
|
data: undefined;
|
|
40
22
|
variables: void;
|
|
@@ -50,28 +32,8 @@ declare function useSignInWithDiscord(): {
|
|
|
50
32
|
failureReason: Error | null;
|
|
51
33
|
isPaused: boolean;
|
|
52
34
|
submittedAt: number;
|
|
53
|
-
signInWithDiscord: import("@tanstack/react-query").UseMutateFunction<
|
|
54
|
-
|
|
55
|
-
expiresAt: number;
|
|
56
|
-
sessionLinks: {
|
|
57
|
-
_links: {
|
|
58
|
-
account: "/session/account";
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
} | {
|
|
62
|
-
redirectTo: string;
|
|
63
|
-
}, Error, void, unknown>;
|
|
64
|
-
signInWithDiscordAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
65
|
-
expiresIn: number;
|
|
66
|
-
expiresAt: number;
|
|
67
|
-
sessionLinks: {
|
|
68
|
-
_links: {
|
|
69
|
-
account: "/session/account";
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
} | {
|
|
73
|
-
redirectTo: string;
|
|
74
|
-
}, Error, void, unknown>;
|
|
35
|
+
signInWithDiscord: import("@tanstack/react-query").UseMutateFunction<AuthenticationProviderRedirectResponse, Error, void, unknown>;
|
|
36
|
+
signInWithDiscordAsync: import("@tanstack/react-query").UseMutateAsyncFunction<AuthenticationProviderRedirectResponse, Error, void, unknown>;
|
|
75
37
|
} | {
|
|
76
38
|
data: undefined;
|
|
77
39
|
error: Error;
|
|
@@ -87,40 +49,10 @@ declare function useSignInWithDiscord(): {
|
|
|
87
49
|
failureReason: Error | null;
|
|
88
50
|
isPaused: boolean;
|
|
89
51
|
submittedAt: number;
|
|
90
|
-
signInWithDiscord: import("@tanstack/react-query").UseMutateFunction<
|
|
91
|
-
|
|
92
|
-
expiresAt: number;
|
|
93
|
-
sessionLinks: {
|
|
94
|
-
_links: {
|
|
95
|
-
account: "/session/account";
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
} | {
|
|
99
|
-
redirectTo: string;
|
|
100
|
-
}, Error, void, unknown>;
|
|
101
|
-
signInWithDiscordAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
102
|
-
expiresIn: number;
|
|
103
|
-
expiresAt: number;
|
|
104
|
-
sessionLinks: {
|
|
105
|
-
_links: {
|
|
106
|
-
account: "/session/account";
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
} | {
|
|
110
|
-
redirectTo: string;
|
|
111
|
-
}, Error, void, unknown>;
|
|
52
|
+
signInWithDiscord: import("@tanstack/react-query").UseMutateFunction<AuthenticationProviderRedirectResponse, Error, void, unknown>;
|
|
53
|
+
signInWithDiscordAsync: import("@tanstack/react-query").UseMutateAsyncFunction<AuthenticationProviderRedirectResponse, Error, void, unknown>;
|
|
112
54
|
} | {
|
|
113
|
-
data:
|
|
114
|
-
expiresIn: number;
|
|
115
|
-
expiresAt: number;
|
|
116
|
-
sessionLinks: {
|
|
117
|
-
_links: {
|
|
118
|
-
account: "/session/account";
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
} | {
|
|
122
|
-
redirectTo: string;
|
|
123
|
-
};
|
|
55
|
+
data: AuthenticationProviderRedirectResponse;
|
|
124
56
|
error: null;
|
|
125
57
|
variables: void;
|
|
126
58
|
isError: false;
|
|
@@ -134,28 +66,8 @@ declare function useSignInWithDiscord(): {
|
|
|
134
66
|
failureReason: Error | null;
|
|
135
67
|
isPaused: boolean;
|
|
136
68
|
submittedAt: number;
|
|
137
|
-
signInWithDiscord: import("@tanstack/react-query").UseMutateFunction<
|
|
138
|
-
|
|
139
|
-
expiresAt: number;
|
|
140
|
-
sessionLinks: {
|
|
141
|
-
_links: {
|
|
142
|
-
account: "/session/account";
|
|
143
|
-
};
|
|
144
|
-
};
|
|
145
|
-
} | {
|
|
146
|
-
redirectTo: string;
|
|
147
|
-
}, Error, void, unknown>;
|
|
148
|
-
signInWithDiscordAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
149
|
-
expiresIn: number;
|
|
150
|
-
expiresAt: number;
|
|
151
|
-
sessionLinks: {
|
|
152
|
-
_links: {
|
|
153
|
-
account: "/session/account";
|
|
154
|
-
};
|
|
155
|
-
};
|
|
156
|
-
} | {
|
|
157
|
-
redirectTo: string;
|
|
158
|
-
}, Error, void, unknown>;
|
|
69
|
+
signInWithDiscord: import("@tanstack/react-query").UseMutateFunction<AuthenticationProviderRedirectResponse, Error, void, unknown>;
|
|
70
|
+
signInWithDiscordAsync: import("@tanstack/react-query").UseMutateAsyncFunction<AuthenticationProviderRedirectResponse, Error, void, unknown>;
|
|
159
71
|
};
|
|
160
72
|
export { useSignInWithDiscord };
|
|
161
73
|
//# sourceMappingURL=useSignInWithDiscord.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignInWithDiscord.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSignInWithDiscord.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSignInWithDiscord.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSignInWithDiscord.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAe,MAAM,uBAAuB,CAAA;AAGpE,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,QAAQ,CAAA;AAEpE,iBAAS,oBAAoB,CAC3B,eAAe,GAAE,IAAI,CACnB,eAAe,CAAC,sCAAsC,CAAC,EACvD,YAAY,GAAG,aAAa,CACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBP;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { useMutation } from "@tanstack/react-query";
|
|
2
2
|
import { useCreateSession } from "./useCreateSession";
|
|
3
3
|
import { useEnsureNoSessionAndFetchNonce } from "./useEnsureNoSessionAndFetchNonce";
|
|
4
|
-
function useSignInWithDiscord() {
|
|
4
|
+
function useSignInWithDiscord(mutationOptions = {}) {
|
|
5
5
|
const { ensureNoSessionAndFetchNonce } = useEnsureNoSessionAndFetchNonce();
|
|
6
6
|
const { createSessionAsync } = useCreateSession();
|
|
7
7
|
const { mutate, mutateAsync, ...signInMutationRestParameters } = useMutation({
|
|
8
8
|
mutationFn: async () => {
|
|
9
9
|
await ensureNoSessionAndFetchNonce();
|
|
10
|
-
return createSessionAsync({
|
|
10
|
+
return (await createSessionAsync({
|
|
11
11
|
type: "discord",
|
|
12
|
-
});
|
|
12
|
+
}));
|
|
13
|
+
// ^ By passing type: "discord" we know for sure the return type is
|
|
14
|
+
// AuthenticationProviderRedirectResponse
|
|
13
15
|
},
|
|
16
|
+
...mutationOptions,
|
|
14
17
|
});
|
|
15
18
|
return {
|
|
16
19
|
signInWithDiscord: mutate,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignInWithDiscord.js","sourceRoot":"","sources":["../../../src/hooks/useSignInWithDiscord.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"useSignInWithDiscord.js","sourceRoot":"","sources":["../../../src/hooks/useSignInWithDiscord.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAA;AAGnF,SAAS,oBAAoB,CAC3B,kBAGI,EAAE;IAEN,MAAM,EAAE,4BAA4B,EAAE,GAAG,+BAA+B,EAAE,CAAA;IAC1E,MAAM,EAAE,kBAAkB,EAAE,GAAG,gBAAgB,EAAE,CAAA;IAEjD,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,4BAA4B,EAAE,GAAG,WAAW,CAAC;QAC3E,UAAU,EAAE,KAAK,IAAqD,EAAE;YACtE,MAAM,4BAA4B,EAAE,CAAA;YAEpC,OAAO,CAAC,MAAM,kBAAkB,CAAC;gBAC/B,IAAI,EAAE,SAAS;aAChB,CAAC,CAA2C,CAAA;YAC7C,mEAAmE;YACnE,yCAAyC;QAC3C,CAAC;QACD,GAAG,eAAe;KACnB,CAAC,CAAA;IAEF,OAAO;QACL,iBAAiB,EAAE,MAAM;QACzB,sBAAsB,EAAE,WAAW;QACnC,GAAG,4BAA4B;KAChC,CAAA;AACH,CAAC;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { MutationOptions } from "@tanstack/react-query";
|
|
2
|
+
import type { Session } from "../api";
|
|
3
|
+
declare function useSignInWithWallet(mutationOptions?: Omit<MutationOptions<Session>, "mutationFn" | "mutationKey">): {
|
|
2
4
|
data: undefined;
|
|
3
5
|
variables: undefined;
|
|
4
6
|
error: null;
|
|
@@ -13,28 +15,8 @@ declare function useSignInWithWallet(): {
|
|
|
13
15
|
failureReason: Error | null;
|
|
14
16
|
isPaused: boolean;
|
|
15
17
|
submittedAt: number;
|
|
16
|
-
signInWithWallet: import("@tanstack/react-query").UseMutateFunction<
|
|
17
|
-
|
|
18
|
-
expiresAt: number;
|
|
19
|
-
sessionLinks: {
|
|
20
|
-
_links: {
|
|
21
|
-
account: "/session/account";
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
} | {
|
|
25
|
-
redirectTo: string;
|
|
26
|
-
}, Error, void, unknown>;
|
|
27
|
-
signInWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
28
|
-
expiresIn: number;
|
|
29
|
-
expiresAt: number;
|
|
30
|
-
sessionLinks: {
|
|
31
|
-
_links: {
|
|
32
|
-
account: "/session/account";
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
} | {
|
|
36
|
-
redirectTo: string;
|
|
37
|
-
}, Error, void, unknown>;
|
|
18
|
+
signInWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, void, unknown>;
|
|
19
|
+
signInWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, void, unknown>;
|
|
38
20
|
} | {
|
|
39
21
|
data: undefined;
|
|
40
22
|
variables: void;
|
|
@@ -50,28 +32,8 @@ declare function useSignInWithWallet(): {
|
|
|
50
32
|
failureReason: Error | null;
|
|
51
33
|
isPaused: boolean;
|
|
52
34
|
submittedAt: number;
|
|
53
|
-
signInWithWallet: import("@tanstack/react-query").UseMutateFunction<
|
|
54
|
-
|
|
55
|
-
expiresAt: number;
|
|
56
|
-
sessionLinks: {
|
|
57
|
-
_links: {
|
|
58
|
-
account: "/session/account";
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
} | {
|
|
62
|
-
redirectTo: string;
|
|
63
|
-
}, Error, void, unknown>;
|
|
64
|
-
signInWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
65
|
-
expiresIn: number;
|
|
66
|
-
expiresAt: number;
|
|
67
|
-
sessionLinks: {
|
|
68
|
-
_links: {
|
|
69
|
-
account: "/session/account";
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
} | {
|
|
73
|
-
redirectTo: string;
|
|
74
|
-
}, Error, void, unknown>;
|
|
35
|
+
signInWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, void, unknown>;
|
|
36
|
+
signInWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, void, unknown>;
|
|
75
37
|
} | {
|
|
76
38
|
data: undefined;
|
|
77
39
|
error: Error;
|
|
@@ -87,40 +49,10 @@ declare function useSignInWithWallet(): {
|
|
|
87
49
|
failureReason: Error | null;
|
|
88
50
|
isPaused: boolean;
|
|
89
51
|
submittedAt: number;
|
|
90
|
-
signInWithWallet: import("@tanstack/react-query").UseMutateFunction<
|
|
91
|
-
|
|
92
|
-
expiresAt: number;
|
|
93
|
-
sessionLinks: {
|
|
94
|
-
_links: {
|
|
95
|
-
account: "/session/account";
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
} | {
|
|
99
|
-
redirectTo: string;
|
|
100
|
-
}, Error, void, unknown>;
|
|
101
|
-
signInWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
102
|
-
expiresIn: number;
|
|
103
|
-
expiresAt: number;
|
|
104
|
-
sessionLinks: {
|
|
105
|
-
_links: {
|
|
106
|
-
account: "/session/account";
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
} | {
|
|
110
|
-
redirectTo: string;
|
|
111
|
-
}, Error, void, unknown>;
|
|
52
|
+
signInWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, void, unknown>;
|
|
53
|
+
signInWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, void, unknown>;
|
|
112
54
|
} | {
|
|
113
|
-
data:
|
|
114
|
-
expiresIn: number;
|
|
115
|
-
expiresAt: number;
|
|
116
|
-
sessionLinks: {
|
|
117
|
-
_links: {
|
|
118
|
-
account: "/session/account";
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
} | {
|
|
122
|
-
redirectTo: string;
|
|
123
|
-
};
|
|
55
|
+
data: Session;
|
|
124
56
|
error: null;
|
|
125
57
|
variables: void;
|
|
126
58
|
isError: false;
|
|
@@ -134,28 +66,8 @@ declare function useSignInWithWallet(): {
|
|
|
134
66
|
failureReason: Error | null;
|
|
135
67
|
isPaused: boolean;
|
|
136
68
|
submittedAt: number;
|
|
137
|
-
signInWithWallet: import("@tanstack/react-query").UseMutateFunction<
|
|
138
|
-
|
|
139
|
-
expiresAt: number;
|
|
140
|
-
sessionLinks: {
|
|
141
|
-
_links: {
|
|
142
|
-
account: "/session/account";
|
|
143
|
-
};
|
|
144
|
-
};
|
|
145
|
-
} | {
|
|
146
|
-
redirectTo: string;
|
|
147
|
-
}, Error, void, unknown>;
|
|
148
|
-
signInWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
149
|
-
expiresIn: number;
|
|
150
|
-
expiresAt: number;
|
|
151
|
-
sessionLinks: {
|
|
152
|
-
_links: {
|
|
153
|
-
account: "/session/account";
|
|
154
|
-
};
|
|
155
|
-
};
|
|
156
|
-
} | {
|
|
157
|
-
redirectTo: string;
|
|
158
|
-
}, Error, void, unknown>;
|
|
69
|
+
signInWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, void, unknown>;
|
|
70
|
+
signInWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, void, unknown>;
|
|
159
71
|
};
|
|
160
72
|
export { useSignInWithWallet };
|
|
161
73
|
//# sourceMappingURL=useSignInWithWallet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignInWithWallet.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSignInWithWallet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSignInWithWallet.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSignInWithWallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAErC,iBAAS,mBAAmB,CAC1B,eAAe,GAAE,IAAI,CACnB,eAAe,CAAC,OAAO,CAAC,EACxB,YAAY,GAAG,aAAa,CACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUP;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -1,38 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { useCreateSession } from "./useCreateSession";
|
|
5
|
-
import { createSignInWithWalletMessage } from "../utils/siww";
|
|
6
|
-
import { useEnsureNoSessionAndFetchNonce } from "./useEnsureNoSessionAndFetchNonce";
|
|
7
|
-
function useSignInWithWallet() {
|
|
8
|
-
const { chainId, address, connector } = useAccount();
|
|
9
|
-
const { btcAddress } = useBitcoinAccount();
|
|
10
|
-
const { ensureNoSessionAndFetchNonce } = useEnsureNoSessionAndFetchNonce();
|
|
11
|
-
const { createSessionAsync } = useCreateSession();
|
|
12
|
-
const { signMessageAsync } = useSignMessage();
|
|
13
|
-
const { mutate, mutateAsync, ...signInMutationRestParameters } = useMutation({
|
|
14
|
-
mutationFn: async () => {
|
|
15
|
-
if (!address) {
|
|
16
|
-
throw new Error("Sign in error: Wallet not connected!");
|
|
17
|
-
}
|
|
18
|
-
const nonce = await ensureNoSessionAndFetchNonce();
|
|
19
|
-
const networkFamily = btcAddress ? "bitcoin" : "evm";
|
|
20
|
-
const messageResult = createSignInWithWalletMessage(btcAddress ? btcAddress : address, nonce, networkFamily, chainId);
|
|
21
|
-
const signatureResult = await signMessageAsync({
|
|
22
|
-
message: messageResult,
|
|
23
|
-
connector,
|
|
24
|
-
});
|
|
25
|
-
return createSessionAsync({
|
|
26
|
-
type: "wallet",
|
|
27
|
-
message: messageResult,
|
|
28
|
-
signature: signatureResult,
|
|
29
|
-
});
|
|
30
|
-
},
|
|
31
|
-
});
|
|
1
|
+
import { useAuthenticateWithWallet } from "./useAuthenticateWithWallet";
|
|
2
|
+
function useSignInWithWallet(mutationOptions = {}) {
|
|
3
|
+
const { authenticateWithWallet, authenticateWithWalletAsync, ...rest } = useAuthenticateWithWallet(false, mutationOptions);
|
|
32
4
|
return {
|
|
33
|
-
signInWithWallet:
|
|
34
|
-
signInWithWalletAsync:
|
|
35
|
-
...
|
|
5
|
+
signInWithWallet: authenticateWithWallet,
|
|
6
|
+
signInWithWalletAsync: authenticateWithWalletAsync,
|
|
7
|
+
...rest,
|
|
36
8
|
};
|
|
37
9
|
}
|
|
38
10
|
export { useSignInWithWallet };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignInWithWallet.js","sourceRoot":"","sources":["../../../src/hooks/useSignInWithWallet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSignInWithWallet.js","sourceRoot":"","sources":["../../../src/hooks/useSignInWithWallet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAGvE,SAAS,mBAAmB,CAC1B,kBAGI,EAAE;IAEN,MAAM,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,GAAG,IAAI,EAAE,GACpE,yBAAyB,CAAC,KAAK,EAAE,eAAe,CAAC,CAAA;IAEnD,OAAO;QACL,gBAAgB,EAAE,sBAAsB;QACxC,qBAAqB,EAAE,2BAA2B;QAClD,GAAG,IAAI;KACR,CAAA;AACH,CAAC;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { MutationOptions } from "@tanstack/react-query";
|
|
2
|
+
import type { DeleteSessionResponse } from "../api";
|
|
3
|
+
export declare function useSignOut(mutationOptions?: Omit<MutationOptions<DeleteSessionResponse>, "mutationFn" | "mutationKey">): {
|
|
2
4
|
data: undefined;
|
|
3
5
|
variables: undefined;
|
|
4
6
|
error: null;
|
|
@@ -13,12 +15,8 @@ export declare function useSignOut(useMutationOptions?: {}): {
|
|
|
13
15
|
failureReason: Error | null;
|
|
14
16
|
isPaused: boolean;
|
|
15
17
|
submittedAt: number;
|
|
16
|
-
signOut: import("@tanstack/react-query").UseMutateFunction<
|
|
17
|
-
|
|
18
|
-
}, Error, void, unknown>;
|
|
19
|
-
signOutAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
20
|
-
message: string;
|
|
21
|
-
}, Error, void, unknown>;
|
|
18
|
+
signOut: import("@tanstack/react-query").UseMutateFunction<DeleteSessionResponse, Error, void, unknown>;
|
|
19
|
+
signOutAsync: import("@tanstack/react-query").UseMutateAsyncFunction<DeleteSessionResponse, Error, void, unknown>;
|
|
22
20
|
} | {
|
|
23
21
|
data: undefined;
|
|
24
22
|
variables: void;
|
|
@@ -34,12 +32,8 @@ export declare function useSignOut(useMutationOptions?: {}): {
|
|
|
34
32
|
failureReason: Error | null;
|
|
35
33
|
isPaused: boolean;
|
|
36
34
|
submittedAt: number;
|
|
37
|
-
signOut: import("@tanstack/react-query").UseMutateFunction<
|
|
38
|
-
|
|
39
|
-
}, Error, void, unknown>;
|
|
40
|
-
signOutAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
41
|
-
message: string;
|
|
42
|
-
}, Error, void, unknown>;
|
|
35
|
+
signOut: import("@tanstack/react-query").UseMutateFunction<DeleteSessionResponse, Error, void, unknown>;
|
|
36
|
+
signOutAsync: import("@tanstack/react-query").UseMutateAsyncFunction<DeleteSessionResponse, Error, void, unknown>;
|
|
43
37
|
} | {
|
|
44
38
|
data: undefined;
|
|
45
39
|
error: Error;
|
|
@@ -55,16 +49,10 @@ export declare function useSignOut(useMutationOptions?: {}): {
|
|
|
55
49
|
failureReason: Error | null;
|
|
56
50
|
isPaused: boolean;
|
|
57
51
|
submittedAt: number;
|
|
58
|
-
signOut: import("@tanstack/react-query").UseMutateFunction<
|
|
59
|
-
|
|
60
|
-
}, Error, void, unknown>;
|
|
61
|
-
signOutAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
62
|
-
message: string;
|
|
63
|
-
}, Error, void, unknown>;
|
|
52
|
+
signOut: import("@tanstack/react-query").UseMutateFunction<DeleteSessionResponse, Error, void, unknown>;
|
|
53
|
+
signOutAsync: import("@tanstack/react-query").UseMutateAsyncFunction<DeleteSessionResponse, Error, void, unknown>;
|
|
64
54
|
} | {
|
|
65
|
-
data:
|
|
66
|
-
message: string;
|
|
67
|
-
};
|
|
55
|
+
data: DeleteSessionResponse;
|
|
68
56
|
error: null;
|
|
69
57
|
variables: void;
|
|
70
58
|
isError: false;
|
|
@@ -78,11 +66,7 @@ export declare function useSignOut(useMutationOptions?: {}): {
|
|
|
78
66
|
failureReason: Error | null;
|
|
79
67
|
isPaused: boolean;
|
|
80
68
|
submittedAt: number;
|
|
81
|
-
signOut: import("@tanstack/react-query").UseMutateFunction<
|
|
82
|
-
|
|
83
|
-
}, Error, void, unknown>;
|
|
84
|
-
signOutAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
85
|
-
message: string;
|
|
86
|
-
}, Error, void, unknown>;
|
|
69
|
+
signOut: import("@tanstack/react-query").UseMutateFunction<DeleteSessionResponse, Error, void, unknown>;
|
|
70
|
+
signOutAsync: import("@tanstack/react-query").UseMutateAsyncFunction<DeleteSessionResponse, Error, void, unknown>;
|
|
87
71
|
};
|
|
88
72
|
//# sourceMappingURL=useSignOut.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignOut.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSignOut.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSignOut.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSignOut.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAGhB,MAAM,uBAAuB,CAAA;AAG9B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAA;AAEnD,wBAAgB,UAAU,CACxB,eAAe,GAAE,IAAI,CACnB,eAAe,CAAC,qBAAqB,CAAC,EACtC,YAAY,GAAG,aAAa,CACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBP"}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
1
|
+
import { useMutation, useQueryClient, } from "@tanstack/react-query";
|
|
2
2
|
import { useAuthApiClient } from "./useAuthApiClient";
|
|
3
3
|
import { QUERY_KEYS } from "./constants";
|
|
4
|
-
export function useSignOut(
|
|
4
|
+
export function useSignOut(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: () => authApiClient.deleteSession(),
|
|
9
|
-
onSuccess: () => {
|
|
10
|
+
onSuccess: (data, variables, context) => {
|
|
10
11
|
queryClient.resetQueries({ queryKey: [QUERY_KEYS.SESSION] });
|
|
11
12
|
queryClient.resetQueries({
|
|
12
13
|
queryKey: [QUERY_KEYS.ACCOUNT, QUERY_KEYS.CURRENT],
|
|
13
14
|
});
|
|
15
|
+
if (customOnSuccess)
|
|
16
|
+
customOnSuccess(data, variables, context);
|
|
14
17
|
},
|
|
15
|
-
...
|
|
18
|
+
...restMutationOptions,
|
|
16
19
|
});
|
|
17
20
|
return { signOut: mutate, signOutAsync: mutateAsync, ...rest };
|
|
18
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignOut.js","sourceRoot":"","sources":["../../../src/hooks/useSignOut.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"useSignOut.js","sourceRoot":"","sources":["../../../src/hooks/useSignOut.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EACX,cAAc,GACf,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAGxC,MAAM,UAAU,UAAU,CACxB,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,GAAG,EAAE,CAAC,aAAa,CAAC,aAAa,EAAE;QAC/C,SAAS,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE;YACtC,WAAW,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;YAC5D,WAAW,CAAC,YAAY,CAAC;gBACvB,QAAQ,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC;aACnD,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,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,CAAA;AAChE,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { MutationOptions } from "@tanstack/react-query";
|
|
2
|
+
import type { Session } from "../api";
|
|
3
|
+
declare function useSignUpWithWallet(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
|
+
signUpWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, void, unknown>;
|
|
19
|
+
signUpWithWalletAsync: 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
|
+
signUpWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, void, unknown>;
|
|
36
|
+
signUpWithWalletAsync: 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
|
+
signUpWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, void, unknown>;
|
|
53
|
+
signUpWithWalletAsync: 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
|
+
signUpWithWallet: import("@tanstack/react-query").UseMutateFunction<Session, Error, void, unknown>;
|
|
70
|
+
signUpWithWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Session, Error, void, unknown>;
|
|
71
|
+
};
|
|
72
|
+
export { useSignUpWithWallet };
|
|
73
|
+
//# sourceMappingURL=useSignUpWithWallet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSignUpWithWallet.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSignUpWithWallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAErC,iBAAS,mBAAmB,CAC1B,eAAe,GAAE,IAAI,CACnB,eAAe,CAAC,OAAO,CAAC,EACxB,YAAY,GAAG,aAAa,CACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUP;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useAuthenticateWithWallet } from "./useAuthenticateWithWallet";
|
|
2
|
+
function useSignUpWithWallet(mutationOptions = {}) {
|
|
3
|
+
const { authenticateWithWallet, authenticateWithWalletAsync, ...rest } = useAuthenticateWithWallet(true, mutationOptions);
|
|
4
|
+
return {
|
|
5
|
+
signUpWithWallet: authenticateWithWallet,
|
|
6
|
+
signUpWithWalletAsync: authenticateWithWalletAsync,
|
|
7
|
+
...rest,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export { useSignUpWithWallet };
|
|
11
|
+
//# sourceMappingURL=useSignUpWithWallet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSignUpWithWallet.js","sourceRoot":"","sources":["../../../src/hooks/useSignUpWithWallet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAGvE,SAAS,mBAAmB,CAC1B,kBAGI,EAAE;IAEN,MAAM,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,GAAG,IAAI,EAAE,GACpE,yBAAyB,CAAC,IAAI,EAAE,eAAe,CAAC,CAAA;IAElD,OAAO;QACL,gBAAgB,EAAE,sBAAsB;QACxC,qBAAqB,EAAE,2BAA2B;QAClD,GAAG,IAAI;KACR,CAAA;AACH,CAAC;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|