@b3dotfun/sdk 0.1.0 → 0.1.1-test.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/anyspend/react/components/AnySpend.js +1 -1
- package/dist/cjs/anyspend/react/components/common/GasIndicator.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/common/GasIndicator.js +6 -16
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +1 -1
- package/dist/cjs/anyspend/react/components/common/PaymentStripeWeb2.js +1 -1
- package/dist/cjs/anyspend/react/components/common/TokenBalance.js +15 -4
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +1 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.js +1 -1
- package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.js +1 -1
- package/dist/cjs/anyspend/react/hooks/useValidatedClientReferenceId.js +1 -1
- package/dist/cjs/anyspend/react/providers/AnyspendProvider.js +1 -2
- package/dist/cjs/global-account/react/components/AccountAssets/AccountAssets.js +7 -3
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +1 -1
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +1 -15
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +18 -2
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +57 -35
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.d.ts +6 -6
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +36 -39
- package/dist/cjs/global-account/react/components/B3Provider/types.d.ts +27 -0
- package/dist/cjs/global-account/react/components/B3Provider/types.js +24 -0
- package/dist/cjs/global-account/react/components/B3Provider/useB3.d.ts +3 -14
- package/dist/cjs/global-account/react/components/B3Provider/useB3.js +10 -4
- package/dist/cjs/global-account/react/components/B3Provider/useB3Account.js +2 -5
- package/dist/cjs/global-account/react/components/B3Provider/useB3Config.d.ts +2 -10
- package/dist/cjs/global-account/react/components/B3Provider/useB3Config.js +17 -18
- package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.js +2 -2
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +2 -1
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +1 -1
- package/dist/cjs/global-account/react/components/ManageAccount/channels/DiscordChannel.js +1 -1
- package/dist/cjs/global-account/react/components/ManageAccount/channels/EmailChannel.js +1 -1
- package/dist/cjs/global-account/react/components/ManageAccount/channels/PhoneChannel.js +1 -1
- package/dist/cjs/global-account/react/components/ManageAccount/channels/TelegramChannel.js +1 -1
- package/dist/cjs/global-account/react/components/RequestPermissions/RequestPermissions.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +13 -2
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStep.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +1 -1
- package/dist/cjs/global-account/react/components/StyleRoot.js +2 -2
- package/dist/cjs/global-account/react/components/custom/ManageAccountButton.js +2 -1
- package/dist/cjs/global-account/react/components/index.d.ts +2 -1
- package/dist/cjs/global-account/react/components/index.js +6 -3
- package/dist/cjs/global-account/react/hooks/index.d.ts +2 -2
- package/dist/cjs/global-account/react/hooks/index.js +5 -3
- package/dist/cjs/global-account/react/hooks/useAuth.d.ts +2 -2
- package/dist/cjs/global-account/react/hooks/useAuth.js +2 -2
- package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +2 -2
- package/dist/cjs/global-account/react/hooks/useAuthentication.js +1 -1
- package/dist/cjs/global-account/react/hooks/useClient.js +1 -1
- package/dist/cjs/global-account/react/hooks/useHandleConnectWithPrivy.js +1 -1
- package/dist/cjs/global-account/react/hooks/useNotifications.js +1 -1
- package/dist/cjs/global-account/react/hooks/useSimBalance.d.ts +7 -0
- package/dist/cjs/global-account/react/hooks/useSimBalance.js +43 -11
- package/dist/cjs/global-account/react/hooks/useSimCollectibles.d.ts +45 -0
- package/dist/cjs/global-account/react/hooks/useSimCollectibles.js +190 -0
- package/dist/cjs/global-account/react/hooks/useTokenBalance.js +5 -5
- package/dist/cjs/global-account/react/hooks/useTurnkeyAuth.js +1 -1
- package/dist/cjs/global-account/react/hooks/useUserQuery.d.ts +7 -6
- package/dist/cjs/global-account/react/hooks/useUserQuery.js +39 -64
- package/dist/cjs/global-account/react/index.native.d.ts +2 -0
- package/dist/cjs/global-account/react/index.native.js +5 -1
- package/dist/cjs/global-account/react/stores/index.d.ts +0 -1
- package/dist/cjs/global-account/react/stores/index.js +1 -3
- package/dist/cjs/global-account/react/utils/simdune.d.ts +7 -0
- package/dist/cjs/global-account/react/utils/simdune.js +21 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +2 -2
- package/dist/esm/anyspend/react/components/common/GasIndicator.d.ts +1 -1
- package/dist/esm/anyspend/react/components/common/GasIndicator.js +7 -17
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +2 -2
- package/dist/esm/anyspend/react/components/common/PaymentStripeWeb2.js +2 -2
- package/dist/esm/anyspend/react/components/common/TokenBalance.js +16 -5
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +2 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.js +2 -2
- package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.js +2 -2
- package/dist/esm/anyspend/react/hooks/useValidatedClientReferenceId.js +2 -2
- package/dist/esm/anyspend/react/providers/AnyspendProvider.js +1 -2
- package/dist/esm/global-account/react/components/AccountAssets/AccountAssets.js +7 -3
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +2 -2
- package/dist/esm/global-account/react/components/B3DynamicModal.js +2 -16
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +18 -2
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +58 -34
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.d.ts +6 -6
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +37 -37
- package/dist/esm/global-account/react/components/B3Provider/types.d.ts +27 -0
- package/dist/esm/global-account/react/components/B3Provider/types.js +21 -0
- package/dist/esm/global-account/react/components/B3Provider/useB3.d.ts +3 -14
- package/dist/esm/global-account/react/components/B3Provider/useB3.js +10 -4
- package/dist/esm/global-account/react/components/B3Provider/useB3Account.js +2 -5
- package/dist/esm/global-account/react/components/B3Provider/useB3Config.d.ts +2 -10
- package/dist/esm/global-account/react/components/B3Provider/useB3Config.js +17 -18
- package/dist/esm/global-account/react/components/ManageAccount/NFTContent.js +3 -3
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +3 -2
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +2 -2
- package/dist/esm/global-account/react/components/ManageAccount/channels/DiscordChannel.js +2 -2
- package/dist/esm/global-account/react/components/ManageAccount/channels/EmailChannel.js +2 -2
- package/dist/esm/global-account/react/components/ManageAccount/channels/PhoneChannel.js +2 -2
- package/dist/esm/global-account/react/components/ManageAccount/channels/TelegramChannel.js +2 -2
- package/dist/esm/global-account/react/components/RequestPermissions/RequestPermissions.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +15 -4
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStep.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +2 -2
- package/dist/esm/global-account/react/components/StyleRoot.js +2 -2
- package/dist/esm/global-account/react/components/custom/ManageAccountButton.js +3 -2
- package/dist/esm/global-account/react/components/index.d.ts +2 -1
- package/dist/esm/global-account/react/components/index.js +2 -1
- package/dist/esm/global-account/react/hooks/index.d.ts +2 -2
- package/dist/esm/global-account/react/hooks/index.js +2 -2
- package/dist/esm/global-account/react/hooks/useAuth.d.ts +2 -2
- package/dist/esm/global-account/react/hooks/useAuth.js +3 -3
- package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +2 -2
- package/dist/esm/global-account/react/hooks/useAuthentication.js +1 -1
- package/dist/esm/global-account/react/hooks/useClient.js +2 -2
- package/dist/esm/global-account/react/hooks/useHandleConnectWithPrivy.js +2 -2
- package/dist/esm/global-account/react/hooks/useNotifications.js +2 -2
- package/dist/esm/global-account/react/hooks/useSimBalance.d.ts +7 -0
- package/dist/esm/global-account/react/hooks/useSimBalance.js +42 -11
- package/dist/esm/global-account/react/hooks/useSimCollectibles.d.ts +45 -0
- package/dist/esm/global-account/react/hooks/useSimCollectibles.js +187 -0
- package/dist/esm/global-account/react/hooks/useTokenBalance.js +6 -6
- package/dist/esm/global-account/react/hooks/useTurnkeyAuth.js +2 -2
- package/dist/esm/global-account/react/hooks/useUserQuery.d.ts +7 -6
- package/dist/esm/global-account/react/hooks/useUserQuery.js +37 -63
- package/dist/esm/global-account/react/index.native.d.ts +2 -0
- package/dist/esm/global-account/react/index.native.js +2 -0
- package/dist/esm/global-account/react/stores/index.d.ts +0 -1
- package/dist/esm/global-account/react/stores/index.js +0 -1
- package/dist/esm/global-account/react/utils/simdune.d.ts +7 -0
- package/dist/esm/global-account/react/utils/simdune.js +17 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/common/GasIndicator.d.ts +1 -1
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +18 -2
- package/dist/types/global-account/react/components/B3Provider/B3Provider.native.d.ts +6 -6
- package/dist/types/global-account/react/components/B3Provider/types.d.ts +27 -0
- package/dist/types/global-account/react/components/B3Provider/useB3.d.ts +3 -14
- package/dist/types/global-account/react/components/B3Provider/useB3Config.d.ts +2 -10
- package/dist/types/global-account/react/components/index.d.ts +2 -1
- package/dist/types/global-account/react/hooks/index.d.ts +2 -2
- package/dist/types/global-account/react/hooks/useAuth.d.ts +2 -2
- package/dist/types/global-account/react/hooks/useAuthentication.d.ts +2 -2
- package/dist/types/global-account/react/hooks/useSimBalance.d.ts +7 -0
- package/dist/types/global-account/react/hooks/useSimCollectibles.d.ts +45 -0
- package/dist/types/global-account/react/hooks/useUserQuery.d.ts +7 -6
- package/dist/types/global-account/react/index.native.d.ts +2 -0
- package/dist/types/global-account/react/stores/index.d.ts +0 -1
- package/dist/types/global-account/react/utils/simdune.d.ts +7 -0
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpend.tsx +2 -2
- package/src/anyspend/react/components/common/GasIndicator.tsx +11 -30
- package/src/anyspend/react/components/common/OrderDetails.tsx +2 -2
- package/src/anyspend/react/components/common/PaymentStripeWeb2.tsx +2 -2
- package/src/anyspend/react/components/common/TokenBalance.tsx +17 -5
- package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +2 -2
- package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +2 -2
- package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +2 -2
- package/src/anyspend/react/hooks/useValidatedClientReferenceId.ts +2 -2
- package/src/anyspend/react/providers/AnyspendProvider.tsx +2 -5
- package/src/global-account/react/components/AccountAssets/AccountAssets.tsx +25 -13
- package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +2 -2
- package/src/global-account/react/components/B3DynamicModal.tsx +2 -18
- package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +57 -46
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +117 -44
- package/src/global-account/react/components/B3Provider/types.ts +50 -0
- package/src/global-account/react/components/B3Provider/useB3.ts +12 -4
- package/src/global-account/react/components/B3Provider/useB3Account.ts +2 -6
- package/src/global-account/react/components/B3Provider/useB3Config.ts +31 -18
- package/src/global-account/react/components/ManageAccount/NFTContent.tsx +4 -4
- package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +4 -2
- package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +2 -2
- package/src/global-account/react/components/ManageAccount/channels/DiscordChannel.tsx +2 -2
- package/src/global-account/react/components/ManageAccount/channels/EmailChannel.tsx +2 -2
- package/src/global-account/react/components/ManageAccount/channels/PhoneChannel.tsx +2 -2
- package/src/global-account/react/components/ManageAccount/channels/TelegramChannel.tsx +2 -2
- package/src/global-account/react/components/RequestPermissions/RequestPermissions.tsx +2 -2
- package/src/global-account/react/components/SignInWithB3/SignIn.tsx +2 -2
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +15 -4
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Privy.tsx +2 -2
- package/src/global-account/react/components/SignInWithB3/steps/LoginStep.tsx +2 -2
- package/src/global-account/react/components/SignInWithB3/steps/LoginStepCustom.tsx +2 -2
- package/src/global-account/react/components/StyleRoot.tsx +2 -2
- package/src/global-account/react/components/custom/ManageAccountButton.tsx +3 -2
- package/src/global-account/react/components/index.ts +2 -1
- package/src/global-account/react/hooks/index.ts +2 -2
- package/src/global-account/react/hooks/useAuth.ts +3 -3
- package/src/global-account/react/hooks/useAuthentication.ts +1 -1
- package/src/global-account/react/hooks/useClient.ts +2 -2
- package/src/global-account/react/hooks/useHandleConnectWithPrivy.tsx +2 -2
- package/src/global-account/react/hooks/useNotifications.ts +2 -2
- package/src/global-account/react/hooks/useSimBalance.ts +49 -12
- package/src/global-account/react/hooks/useSimCollectibles.ts +238 -0
- package/src/global-account/react/hooks/useTokenBalance.tsx +7 -8
- package/src/global-account/react/hooks/useTurnkeyAuth.ts +2 -2
- package/src/global-account/react/hooks/useUserQuery.ts +51 -64
- package/src/global-account/react/index.native.ts +2 -0
- package/src/global-account/react/stores/index.ts +0 -1
- package/src/global-account/react/utils/simdune.ts +20 -0
- package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +0 -5
- package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.js +0 -12
- package/dist/cjs/global-account/react/hooks/useUser.d.ts +0 -60
- package/dist/cjs/global-account/react/hooks/useUser.js +0 -20
- package/dist/cjs/global-account/react/stores/configStore.d.ts +0 -24
- package/dist/cjs/global-account/react/stores/configStore.js +0 -30
- package/dist/cjs/global-account/react/stores/userStore.d.ts +0 -22
- package/dist/cjs/global-account/react/stores/userStore.js +0 -30
- package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +0 -5
- package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.js +0 -10
- package/dist/esm/global-account/react/hooks/useUser.d.ts +0 -60
- package/dist/esm/global-account/react/hooks/useUser.js +0 -17
- package/dist/esm/global-account/react/stores/configStore.d.ts +0 -24
- package/dist/esm/global-account/react/stores/configStore.js +0 -27
- package/dist/esm/global-account/react/stores/userStore.d.ts +0 -22
- package/dist/esm/global-account/react/stores/userStore.js +0 -27
- package/dist/types/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +0 -5
- package/dist/types/global-account/react/hooks/useUser.d.ts +0 -60
- package/dist/types/global-account/react/stores/configStore.d.ts +0 -24
- package/dist/types/global-account/react/stores/userStore.d.ts +0 -22
- package/src/global-account/react/components/B3Provider/AuthenticationProvider.tsx +0 -19
- package/src/global-account/react/hooks/useUser.ts +0 -20
- package/src/global-account/react/stores/configStore.ts +0 -51
- package/src/global-account/react/stores/userStore.ts +0 -41
|
@@ -1,84 +1,71 @@
|
|
|
1
1
|
import { Users } from "@b3dotfun/b3-api";
|
|
2
|
+
import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
|
|
2
3
|
import { useEffect } from "react";
|
|
3
|
-
import {
|
|
4
|
+
import { create } from "zustand";
|
|
5
|
+
import { persist } from "zustand/middleware";
|
|
6
|
+
|
|
7
|
+
const debug = debugB3React("useUserQuery");
|
|
4
8
|
|
|
5
9
|
const USER_QUERY_KEY = ["b3-user"];
|
|
6
10
|
|
|
11
|
+
interface UserStore {
|
|
12
|
+
user: Users | null;
|
|
13
|
+
setUser: (user: Users | undefined) => void;
|
|
14
|
+
clearUser: () => void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Zustand store for managing user state
|
|
19
|
+
* Persists user data to localStorage
|
|
20
|
+
*/
|
|
21
|
+
const useUserStore = create<UserStore>()(
|
|
22
|
+
persist(
|
|
23
|
+
set => ({
|
|
24
|
+
user: null,
|
|
25
|
+
setUser: (newUser: Users | undefined) => {
|
|
26
|
+
const userToSave = newUser ?? null;
|
|
27
|
+
set({ user: userToSave });
|
|
28
|
+
debug("User updated", userToSave);
|
|
29
|
+
},
|
|
30
|
+
clearUser: () => {
|
|
31
|
+
set({ user: null });
|
|
32
|
+
debug("User cleared");
|
|
33
|
+
},
|
|
34
|
+
}),
|
|
35
|
+
{
|
|
36
|
+
name: "b3-user",
|
|
37
|
+
onRehydrateStorage: () => (_, error) => {
|
|
38
|
+
if (error) {
|
|
39
|
+
console.warn("Failed to rehydrate user store:", error);
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
),
|
|
44
|
+
);
|
|
45
|
+
|
|
7
46
|
/**
|
|
8
47
|
* NOTE: THIS IS ONLY MEANT FOR INTERNAL USE, from useOnConnect
|
|
9
48
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
49
|
+
* Hook to query and manage user data
|
|
50
|
+
* Provides user state and methods to update it
|
|
51
|
+
* Uses Zustand store with persistence to localStorage
|
|
12
52
|
*/
|
|
13
53
|
export function useUserQuery() {
|
|
14
54
|
const user = useUserStore(state => state.user);
|
|
15
|
-
const
|
|
16
|
-
const
|
|
55
|
+
const setUser = useUserStore(state => state.setUser);
|
|
56
|
+
const clearUser = useUserStore(state => state.clearUser);
|
|
17
57
|
|
|
18
|
-
// Listen for storage events from other tabs/windows
|
|
19
58
|
useEffect(() => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
// Sync with changes from other tabs/windows
|
|
23
|
-
const stored = e.newValue;
|
|
24
|
-
if (stored) {
|
|
25
|
-
try {
|
|
26
|
-
const parsed = JSON.parse(stored);
|
|
27
|
-
// Zustand persist format: { state: { user: ... }, version: ... }
|
|
28
|
-
const userData = parsed?.state?.user ?? parsed?.user ?? null;
|
|
29
|
-
useUserStore.setState({ user: userData });
|
|
30
|
-
} catch (error) {
|
|
31
|
-
console.warn("Failed to parse user from storage event:", error);
|
|
32
|
-
}
|
|
33
|
-
} else {
|
|
34
|
-
useUserStore.setState({ user: null });
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
window.addEventListener("storage", handleStorageChange);
|
|
40
|
-
return () => {
|
|
41
|
-
window.removeEventListener("storage", handleStorageChange);
|
|
42
|
-
};
|
|
43
|
-
}, []);
|
|
44
|
-
|
|
45
|
-
// Helper function to set user (maintains backward compatibility)
|
|
46
|
-
const setUser = (newUser?: Users) => {
|
|
47
|
-
setUserStore(newUser);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
// Helper function to invalidate and refetch user
|
|
51
|
-
const refetchUser = async () => {
|
|
52
|
-
// Re-read from localStorage and update store
|
|
53
|
-
// Zustand persist stores data as { state: { user: ... }, version: ... }
|
|
54
|
-
const stored = localStorage.getItem("b3-user");
|
|
55
|
-
if (stored) {
|
|
56
|
-
try {
|
|
57
|
-
const parsed = JSON.parse(stored);
|
|
58
|
-
// Zustand persist format: { state: { user: ... }, version: ... }
|
|
59
|
-
const userData = parsed?.state?.user ?? parsed?.user ?? null;
|
|
60
|
-
useUserStore.setState({ user: userData });
|
|
61
|
-
return userData ?? undefined;
|
|
62
|
-
} catch (error) {
|
|
63
|
-
console.warn("Failed to refetch user from localStorage:", error);
|
|
64
|
-
// Fallback to current store state
|
|
65
|
-
return useUserStore.getState().user ?? undefined;
|
|
66
|
-
}
|
|
59
|
+
if (user) {
|
|
60
|
+
debug("User loaded from store", user);
|
|
67
61
|
}
|
|
68
|
-
|
|
69
|
-
return undefined;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
// Helper function to clear user
|
|
73
|
-
const clearUser = () => {
|
|
74
|
-
clearUserStore();
|
|
75
|
-
};
|
|
62
|
+
}, [user]);
|
|
76
63
|
|
|
77
64
|
return {
|
|
78
|
-
user
|
|
65
|
+
user,
|
|
79
66
|
setUser,
|
|
80
|
-
refetchUser,
|
|
81
67
|
clearUser,
|
|
82
|
-
queryKey: USER_QUERY_KEY,
|
|
83
68
|
};
|
|
84
69
|
}
|
|
70
|
+
|
|
71
|
+
export { USER_QUERY_KEY };
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
export { B3Provider } from "./components/B3Provider/B3Provider.native";
|
|
8
8
|
|
|
9
|
+
export { B3Context, type B3ContextType } from "./components/B3Provider/types";
|
|
10
|
+
export { useB3 } from "./components/B3Provider/useB3";
|
|
9
11
|
export { useAccountWallet } from "./hooks/useAccountWallet";
|
|
10
12
|
export { useAuthentication } from "./hooks/useAuthentication";
|
|
11
13
|
export { useProfile } from "./hooks/useProfile";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const SIMDUNE_API_HOST = "https://simdune-api.sean-430.workers.dev";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Builds a Simdune API URL with the proxy wrapper and optional dev mode key.
|
|
5
|
+
* @param endpoint - The Simdune API endpoint (e.g., "/v1/evm/balances/0x...")
|
|
6
|
+
* @param queryParams - Optional URLSearchParams to append
|
|
7
|
+
*/
|
|
8
|
+
export function buildSimduneUrl(endpoint: string, queryParams?: URLSearchParams): string {
|
|
9
|
+
const baseUrl = `${SIMDUNE_API_HOST}/?url=https://api.sim.dune.com${endpoint}`;
|
|
10
|
+
|
|
11
|
+
let url = baseUrl;
|
|
12
|
+
if (queryParams && queryParams.toString()) {
|
|
13
|
+
url += `?${queryParams.toString()}`;
|
|
14
|
+
}
|
|
15
|
+
if (process.env.NEXT_PUBLIC_DEVMODE_SHARED_SECRET) {
|
|
16
|
+
url += `${queryParams?.toString() ? "&" : "?"}localkey=${process.env.NEXT_PUBLIC_DEVMODE_SHARED_SECRET}`;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return url;
|
|
20
|
+
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const hooks_1 = require("../../hooks");
|
|
4
|
-
const useAutoSelectWallet_1 = require("../../hooks/useAutoSelectWallet");
|
|
5
|
-
const AuthenticationProvider = ({ partnerId, automaticallySetFirstEoa, }) => {
|
|
6
|
-
(0, hooks_1.useAuthentication)(partnerId);
|
|
7
|
-
(0, useAutoSelectWallet_1.useAutoSelectWallet)({
|
|
8
|
-
enabled: automaticallySetFirstEoa,
|
|
9
|
-
});
|
|
10
|
-
return null;
|
|
11
|
-
};
|
|
12
|
-
exports.default = AuthenticationProvider;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Preferred Hook to get the user data
|
|
3
|
-
*/
|
|
4
|
-
export declare function useUser(): {
|
|
5
|
-
user: {
|
|
6
|
-
email?: string | undefined;
|
|
7
|
-
username?: string | undefined;
|
|
8
|
-
telNumber?: string | undefined;
|
|
9
|
-
ens?: string | undefined;
|
|
10
|
-
avatar?: string | undefined;
|
|
11
|
-
preferences?: {} | undefined;
|
|
12
|
-
referredBy?: string | {} | undefined;
|
|
13
|
-
sourceApp?: string | undefined;
|
|
14
|
-
referralCode?: string | undefined;
|
|
15
|
-
userGroups?: number[] | undefined;
|
|
16
|
-
isMigratedFromBSMNT?: boolean | undefined;
|
|
17
|
-
privyLinkedAccounts?: {
|
|
18
|
-
name?: string | undefined;
|
|
19
|
-
address?: string | undefined;
|
|
20
|
-
email?: string | undefined;
|
|
21
|
-
chain_type?: string | undefined;
|
|
22
|
-
lv?: number | undefined;
|
|
23
|
-
wallet_client_type?: string | undefined;
|
|
24
|
-
smart_wallet_type?: string | undefined;
|
|
25
|
-
subject?: string | undefined;
|
|
26
|
-
type: string;
|
|
27
|
-
}[] | undefined;
|
|
28
|
-
twProfiles?: {
|
|
29
|
-
type: string;
|
|
30
|
-
details: {
|
|
31
|
-
id?: string | undefined;
|
|
32
|
-
name?: string | undefined;
|
|
33
|
-
address?: string | undefined;
|
|
34
|
-
email?: string | undefined;
|
|
35
|
-
username?: string | undefined;
|
|
36
|
-
phone?: string | undefined;
|
|
37
|
-
fid?: string | undefined;
|
|
38
|
-
};
|
|
39
|
-
}[] | undefined;
|
|
40
|
-
turnkeySubOrgs?: {
|
|
41
|
-
hasDelegatedUser?: boolean | undefined;
|
|
42
|
-
subOrgId: string;
|
|
43
|
-
accounts: Record<string, any>[];
|
|
44
|
-
}[] | undefined;
|
|
45
|
-
_id: string | {};
|
|
46
|
-
userId: string;
|
|
47
|
-
smartAccountAddress: string;
|
|
48
|
-
createdAt: number;
|
|
49
|
-
updatedAt: number;
|
|
50
|
-
partnerIds: {
|
|
51
|
-
privyId?: string | undefined;
|
|
52
|
-
thirdwebId?: string | undefined;
|
|
53
|
-
turnkeyId?: string | undefined;
|
|
54
|
-
turnkeyOtpId?: string | undefined;
|
|
55
|
-
};
|
|
56
|
-
} | null;
|
|
57
|
-
isConnecting: boolean;
|
|
58
|
-
isConnected: boolean;
|
|
59
|
-
isAuthenticating: boolean;
|
|
60
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useUser = useUser;
|
|
4
|
-
const react_1 = require("../../../global-account/react");
|
|
5
|
-
const userStore_1 = require("../stores/userStore");
|
|
6
|
-
/**
|
|
7
|
-
* Preferred Hook to get the user data
|
|
8
|
-
*/
|
|
9
|
-
function useUser() {
|
|
10
|
-
const user = (0, userStore_1.useUserStore)(state => state.user);
|
|
11
|
-
const isConnecting = (0, react_1.useAuthStore)(state => state.isConnecting);
|
|
12
|
-
const isConnected = (0, react_1.useAuthStore)(state => state.isConnected);
|
|
13
|
-
const isAuthenticating = (0, react_1.useAuthStore)(state => state.isAuthenticating);
|
|
14
|
-
return {
|
|
15
|
-
user,
|
|
16
|
-
isConnecting,
|
|
17
|
-
isConnected,
|
|
18
|
-
isAuthenticating,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { CreateOnrampOrderParams } from "../../../anyspend/react/hooks/useAnyspendCreateOnrampOrder";
|
|
2
|
-
import { CreateOrderParams } from "../../../anyspend/react/hooks/useAnyspendCreateOrder";
|
|
3
|
-
import { PermissionsConfig } from "../../../global-account/types/permissions";
|
|
4
|
-
import { Account } from "thirdweb/wallets";
|
|
5
|
-
import { ClientType } from "../../client-manager";
|
|
6
|
-
interface ConfigStore {
|
|
7
|
-
accountOverride?: Account;
|
|
8
|
-
automaticallySetFirstEoa: boolean;
|
|
9
|
-
environment: "development" | "production";
|
|
10
|
-
defaultPermissions: PermissionsConfig;
|
|
11
|
-
theme: "light" | "dark";
|
|
12
|
-
clientType: ClientType;
|
|
13
|
-
partnerId: string;
|
|
14
|
-
stripePublishableKey?: string;
|
|
15
|
-
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
16
|
-
enableTurnkey: boolean;
|
|
17
|
-
setConfig: (config: Partial<Omit<ConfigStore, "setConfig">>) => void;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Zustand store for B3 configuration
|
|
21
|
-
* NOT persisted - these are developer-set configuration values
|
|
22
|
-
*/
|
|
23
|
-
export declare const useB3ConfigStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ConfigStore>>;
|
|
24
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useB3ConfigStore = void 0;
|
|
4
|
-
const zustand_1 = require("zustand");
|
|
5
|
-
/**
|
|
6
|
-
* Default permissions configuration for B3 provider
|
|
7
|
-
*/
|
|
8
|
-
const DEFAULT_PERMISSIONS = {
|
|
9
|
-
approvedTargets: ["0xa8e42121e318e3D3BeD7f5969AF6D360045317DD"],
|
|
10
|
-
nativeTokenLimitPerTransaction: 0.1,
|
|
11
|
-
startDate: new Date(),
|
|
12
|
-
endDate: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365), // 1 year from now
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Zustand store for B3 configuration
|
|
16
|
-
* NOT persisted - these are developer-set configuration values
|
|
17
|
-
*/
|
|
18
|
-
exports.useB3ConfigStore = (0, zustand_1.create)(set => ({
|
|
19
|
-
accountOverride: undefined,
|
|
20
|
-
automaticallySetFirstEoa: false,
|
|
21
|
-
environment: "development",
|
|
22
|
-
defaultPermissions: DEFAULT_PERMISSIONS,
|
|
23
|
-
theme: "light",
|
|
24
|
-
clientType: "rest",
|
|
25
|
-
partnerId: "",
|
|
26
|
-
stripePublishableKey: undefined,
|
|
27
|
-
createClientReferenceId: undefined,
|
|
28
|
-
enableTurnkey: false,
|
|
29
|
-
setConfig: config => set(state => ({ ...state, ...config })),
|
|
30
|
-
}));
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Users } from "@b3dotfun/b3-api";
|
|
2
|
-
interface UserStore {
|
|
3
|
-
user: Users | null;
|
|
4
|
-
setUser: (user: Users | undefined) => void;
|
|
5
|
-
clearUser: () => void;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Zustand store for managing user state
|
|
9
|
-
* Persists user data to localStorage
|
|
10
|
-
*/
|
|
11
|
-
export declare const useUserStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<UserStore>, "persist"> & {
|
|
12
|
-
persist: {
|
|
13
|
-
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<UserStore, UserStore>>) => void;
|
|
14
|
-
clearStorage: () => void;
|
|
15
|
-
rehydrate: () => Promise<void> | void;
|
|
16
|
-
hasHydrated: () => boolean;
|
|
17
|
-
onHydrate: (fn: (state: UserStore) => void) => () => void;
|
|
18
|
-
onFinishHydration: (fn: (state: UserStore) => void) => () => void;
|
|
19
|
-
getOptions: () => Partial<import("zustand/middleware").PersistOptions<UserStore, UserStore>>;
|
|
20
|
-
};
|
|
21
|
-
}>;
|
|
22
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useUserStore = void 0;
|
|
4
|
-
const debug_1 = require("../../../shared/utils/debug");
|
|
5
|
-
const zustand_1 = require("zustand");
|
|
6
|
-
const middleware_1 = require("zustand/middleware");
|
|
7
|
-
const debug = (0, debug_1.debugB3React)("useUserQuery");
|
|
8
|
-
/**
|
|
9
|
-
* Zustand store for managing user state
|
|
10
|
-
* Persists user data to localStorage
|
|
11
|
-
*/
|
|
12
|
-
exports.useUserStore = (0, zustand_1.create)()((0, middleware_1.persist)(set => ({
|
|
13
|
-
user: null,
|
|
14
|
-
setUser: (newUser) => {
|
|
15
|
-
const userToSave = newUser ?? null;
|
|
16
|
-
set({ user: userToSave });
|
|
17
|
-
debug("User updated", userToSave);
|
|
18
|
-
},
|
|
19
|
-
clearUser: () => {
|
|
20
|
-
set({ user: null });
|
|
21
|
-
debug("User cleared");
|
|
22
|
-
},
|
|
23
|
-
}), {
|
|
24
|
-
name: "b3-user",
|
|
25
|
-
onRehydrateStorage: () => (_, error) => {
|
|
26
|
-
if (error) {
|
|
27
|
-
console.warn("Failed to rehydrate user store:", error);
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
}));
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useAuthentication } from "../../hooks/index.js";
|
|
2
|
-
import { useAutoSelectWallet } from "../../hooks/useAutoSelectWallet.js";
|
|
3
|
-
const AuthenticationProvider = ({ partnerId, automaticallySetFirstEoa, }) => {
|
|
4
|
-
useAuthentication(partnerId);
|
|
5
|
-
useAutoSelectWallet({
|
|
6
|
-
enabled: automaticallySetFirstEoa,
|
|
7
|
-
});
|
|
8
|
-
return null;
|
|
9
|
-
};
|
|
10
|
-
export default AuthenticationProvider;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Preferred Hook to get the user data
|
|
3
|
-
*/
|
|
4
|
-
export declare function useUser(): {
|
|
5
|
-
user: {
|
|
6
|
-
email?: string | undefined;
|
|
7
|
-
username?: string | undefined;
|
|
8
|
-
telNumber?: string | undefined;
|
|
9
|
-
ens?: string | undefined;
|
|
10
|
-
avatar?: string | undefined;
|
|
11
|
-
preferences?: {} | undefined;
|
|
12
|
-
referredBy?: string | {} | undefined;
|
|
13
|
-
sourceApp?: string | undefined;
|
|
14
|
-
referralCode?: string | undefined;
|
|
15
|
-
userGroups?: number[] | undefined;
|
|
16
|
-
isMigratedFromBSMNT?: boolean | undefined;
|
|
17
|
-
privyLinkedAccounts?: {
|
|
18
|
-
name?: string | undefined;
|
|
19
|
-
address?: string | undefined;
|
|
20
|
-
email?: string | undefined;
|
|
21
|
-
chain_type?: string | undefined;
|
|
22
|
-
lv?: number | undefined;
|
|
23
|
-
wallet_client_type?: string | undefined;
|
|
24
|
-
smart_wallet_type?: string | undefined;
|
|
25
|
-
subject?: string | undefined;
|
|
26
|
-
type: string;
|
|
27
|
-
}[] | undefined;
|
|
28
|
-
twProfiles?: {
|
|
29
|
-
type: string;
|
|
30
|
-
details: {
|
|
31
|
-
id?: string | undefined;
|
|
32
|
-
name?: string | undefined;
|
|
33
|
-
address?: string | undefined;
|
|
34
|
-
email?: string | undefined;
|
|
35
|
-
username?: string | undefined;
|
|
36
|
-
phone?: string | undefined;
|
|
37
|
-
fid?: string | undefined;
|
|
38
|
-
};
|
|
39
|
-
}[] | undefined;
|
|
40
|
-
turnkeySubOrgs?: {
|
|
41
|
-
hasDelegatedUser?: boolean | undefined;
|
|
42
|
-
subOrgId: string;
|
|
43
|
-
accounts: Record<string, any>[];
|
|
44
|
-
}[] | undefined;
|
|
45
|
-
_id: string | {};
|
|
46
|
-
userId: string;
|
|
47
|
-
smartAccountAddress: string;
|
|
48
|
-
createdAt: number;
|
|
49
|
-
updatedAt: number;
|
|
50
|
-
partnerIds: {
|
|
51
|
-
privyId?: string | undefined;
|
|
52
|
-
thirdwebId?: string | undefined;
|
|
53
|
-
turnkeyId?: string | undefined;
|
|
54
|
-
turnkeyOtpId?: string | undefined;
|
|
55
|
-
};
|
|
56
|
-
} | null;
|
|
57
|
-
isConnecting: boolean;
|
|
58
|
-
isConnected: boolean;
|
|
59
|
-
isAuthenticating: boolean;
|
|
60
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useAuthStore } from "../../../global-account/react/index.js";
|
|
2
|
-
import { useUserStore } from "../stores/userStore.js";
|
|
3
|
-
/**
|
|
4
|
-
* Preferred Hook to get the user data
|
|
5
|
-
*/
|
|
6
|
-
export function useUser() {
|
|
7
|
-
const user = useUserStore(state => state.user);
|
|
8
|
-
const isConnecting = useAuthStore(state => state.isConnecting);
|
|
9
|
-
const isConnected = useAuthStore(state => state.isConnected);
|
|
10
|
-
const isAuthenticating = useAuthStore(state => state.isAuthenticating);
|
|
11
|
-
return {
|
|
12
|
-
user,
|
|
13
|
-
isConnecting,
|
|
14
|
-
isConnected,
|
|
15
|
-
isAuthenticating,
|
|
16
|
-
};
|
|
17
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { CreateOnrampOrderParams } from "../../../anyspend/react/hooks/useAnyspendCreateOnrampOrder";
|
|
2
|
-
import { CreateOrderParams } from "../../../anyspend/react/hooks/useAnyspendCreateOrder";
|
|
3
|
-
import { PermissionsConfig } from "../../../global-account/types/permissions";
|
|
4
|
-
import { Account } from "thirdweb/wallets";
|
|
5
|
-
import { ClientType } from "../../client-manager";
|
|
6
|
-
interface ConfigStore {
|
|
7
|
-
accountOverride?: Account;
|
|
8
|
-
automaticallySetFirstEoa: boolean;
|
|
9
|
-
environment: "development" | "production";
|
|
10
|
-
defaultPermissions: PermissionsConfig;
|
|
11
|
-
theme: "light" | "dark";
|
|
12
|
-
clientType: ClientType;
|
|
13
|
-
partnerId: string;
|
|
14
|
-
stripePublishableKey?: string;
|
|
15
|
-
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
16
|
-
enableTurnkey: boolean;
|
|
17
|
-
setConfig: (config: Partial<Omit<ConfigStore, "setConfig">>) => void;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Zustand store for B3 configuration
|
|
21
|
-
* NOT persisted - these are developer-set configuration values
|
|
22
|
-
*/
|
|
23
|
-
export declare const useB3ConfigStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ConfigStore>>;
|
|
24
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { create } from "zustand";
|
|
2
|
-
/**
|
|
3
|
-
* Default permissions configuration for B3 provider
|
|
4
|
-
*/
|
|
5
|
-
const DEFAULT_PERMISSIONS = {
|
|
6
|
-
approvedTargets: ["0xa8e42121e318e3D3BeD7f5969AF6D360045317DD"],
|
|
7
|
-
nativeTokenLimitPerTransaction: 0.1,
|
|
8
|
-
startDate: new Date(),
|
|
9
|
-
endDate: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365), // 1 year from now
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Zustand store for B3 configuration
|
|
13
|
-
* NOT persisted - these are developer-set configuration values
|
|
14
|
-
*/
|
|
15
|
-
export const useB3ConfigStore = create(set => ({
|
|
16
|
-
accountOverride: undefined,
|
|
17
|
-
automaticallySetFirstEoa: false,
|
|
18
|
-
environment: "development",
|
|
19
|
-
defaultPermissions: DEFAULT_PERMISSIONS,
|
|
20
|
-
theme: "light",
|
|
21
|
-
clientType: "rest",
|
|
22
|
-
partnerId: "",
|
|
23
|
-
stripePublishableKey: undefined,
|
|
24
|
-
createClientReferenceId: undefined,
|
|
25
|
-
enableTurnkey: false,
|
|
26
|
-
setConfig: config => set(state => ({ ...state, ...config })),
|
|
27
|
-
}));
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Users } from "@b3dotfun/b3-api";
|
|
2
|
-
interface UserStore {
|
|
3
|
-
user: Users | null;
|
|
4
|
-
setUser: (user: Users | undefined) => void;
|
|
5
|
-
clearUser: () => void;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Zustand store for managing user state
|
|
9
|
-
* Persists user data to localStorage
|
|
10
|
-
*/
|
|
11
|
-
export declare const useUserStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<UserStore>, "persist"> & {
|
|
12
|
-
persist: {
|
|
13
|
-
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<UserStore, UserStore>>) => void;
|
|
14
|
-
clearStorage: () => void;
|
|
15
|
-
rehydrate: () => Promise<void> | void;
|
|
16
|
-
hasHydrated: () => boolean;
|
|
17
|
-
onHydrate: (fn: (state: UserStore) => void) => () => void;
|
|
18
|
-
onFinishHydration: (fn: (state: UserStore) => void) => () => void;
|
|
19
|
-
getOptions: () => Partial<import("zustand/middleware").PersistOptions<UserStore, UserStore>>;
|
|
20
|
-
};
|
|
21
|
-
}>;
|
|
22
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { debugB3React } from "../../../shared/utils/debug.js";
|
|
2
|
-
import { create } from "zustand";
|
|
3
|
-
import { persist } from "zustand/middleware";
|
|
4
|
-
const debug = debugB3React("useUserQuery");
|
|
5
|
-
/**
|
|
6
|
-
* Zustand store for managing user state
|
|
7
|
-
* Persists user data to localStorage
|
|
8
|
-
*/
|
|
9
|
-
export const useUserStore = create()(persist(set => ({
|
|
10
|
-
user: null,
|
|
11
|
-
setUser: (newUser) => {
|
|
12
|
-
const userToSave = newUser ?? null;
|
|
13
|
-
set({ user: userToSave });
|
|
14
|
-
debug("User updated", userToSave);
|
|
15
|
-
},
|
|
16
|
-
clearUser: () => {
|
|
17
|
-
set({ user: null });
|
|
18
|
-
debug("User cleared");
|
|
19
|
-
},
|
|
20
|
-
}), {
|
|
21
|
-
name: "b3-user",
|
|
22
|
-
onRehydrateStorage: () => (_, error) => {
|
|
23
|
-
if (error) {
|
|
24
|
-
console.warn("Failed to rehydrate user store:", error);
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
}));
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Preferred Hook to get the user data
|
|
3
|
-
*/
|
|
4
|
-
export declare function useUser(): {
|
|
5
|
-
user: {
|
|
6
|
-
email?: string | undefined;
|
|
7
|
-
username?: string | undefined;
|
|
8
|
-
telNumber?: string | undefined;
|
|
9
|
-
ens?: string | undefined;
|
|
10
|
-
avatar?: string | undefined;
|
|
11
|
-
preferences?: {} | undefined;
|
|
12
|
-
referredBy?: string | {} | undefined;
|
|
13
|
-
sourceApp?: string | undefined;
|
|
14
|
-
referralCode?: string | undefined;
|
|
15
|
-
userGroups?: number[] | undefined;
|
|
16
|
-
isMigratedFromBSMNT?: boolean | undefined;
|
|
17
|
-
privyLinkedAccounts?: {
|
|
18
|
-
name?: string | undefined;
|
|
19
|
-
address?: string | undefined;
|
|
20
|
-
email?: string | undefined;
|
|
21
|
-
chain_type?: string | undefined;
|
|
22
|
-
lv?: number | undefined;
|
|
23
|
-
wallet_client_type?: string | undefined;
|
|
24
|
-
smart_wallet_type?: string | undefined;
|
|
25
|
-
subject?: string | undefined;
|
|
26
|
-
type: string;
|
|
27
|
-
}[] | undefined;
|
|
28
|
-
twProfiles?: {
|
|
29
|
-
type: string;
|
|
30
|
-
details: {
|
|
31
|
-
id?: string | undefined;
|
|
32
|
-
name?: string | undefined;
|
|
33
|
-
address?: string | undefined;
|
|
34
|
-
email?: string | undefined;
|
|
35
|
-
username?: string | undefined;
|
|
36
|
-
phone?: string | undefined;
|
|
37
|
-
fid?: string | undefined;
|
|
38
|
-
};
|
|
39
|
-
}[] | undefined;
|
|
40
|
-
turnkeySubOrgs?: {
|
|
41
|
-
hasDelegatedUser?: boolean | undefined;
|
|
42
|
-
subOrgId: string;
|
|
43
|
-
accounts: Record<string, any>[];
|
|
44
|
-
}[] | undefined;
|
|
45
|
-
_id: string | {};
|
|
46
|
-
userId: string;
|
|
47
|
-
smartAccountAddress: string;
|
|
48
|
-
createdAt: number;
|
|
49
|
-
updatedAt: number;
|
|
50
|
-
partnerIds: {
|
|
51
|
-
privyId?: string | undefined;
|
|
52
|
-
thirdwebId?: string | undefined;
|
|
53
|
-
turnkeyId?: string | undefined;
|
|
54
|
-
turnkeyOtpId?: string | undefined;
|
|
55
|
-
};
|
|
56
|
-
} | null;
|
|
57
|
-
isConnecting: boolean;
|
|
58
|
-
isConnected: boolean;
|
|
59
|
-
isAuthenticating: boolean;
|
|
60
|
-
};
|