@b3dotfun/sdk 0.1.1-test.0 → 0.1.2-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 +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +15 -10
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +22 -14
- package/dist/cjs/anyspend/react/components/QRDeposit.js +31 -5
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +9 -2
- 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/TransferResultScreen.d.ts +22 -0
- package/dist/cjs/anyspend/react/components/common/TransferResultScreen.js +25 -0
- package/dist/cjs/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/cjs/anyspend/react/hooks/index.js +1 -0
- 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/hooks/useWatchTransfer.d.ts +41 -0
- package/dist/cjs/anyspend/react/hooks/useWatchTransfer.js +75 -0
- package/dist/cjs/anyspend/utils/address.d.ts +5 -0
- package/dist/cjs/anyspend/utils/address.js +8 -0
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +1 -1
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +5 -1
- package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +5 -0
- package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.js +12 -0
- package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +31 -0
- package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.js +37 -0
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +3 -18
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +7 -57
- 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 +11 -35
- package/dist/cjs/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +3 -1
- package/dist/cjs/global-account/react/components/B3Provider/LocalSDKProvider.js +3 -1
- package/dist/cjs/global-account/react/components/B3Provider/useB3.d.ts +3 -3
- package/dist/cjs/global-account/react/components/B3Provider/useB3.js +4 -10
- package/dist/cjs/global-account/react/components/B3Provider/useB3Account.js +5 -2
- package/dist/cjs/global-account/react/components/B3Provider/useB3Config.d.ts +1 -9
- package/dist/cjs/global-account/react/components/B3Provider/useB3Config.js +2 -20
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +1 -2
- 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.d.ts +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +4 -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/SingleUserSearchSelector/SingleUserSearchSelector.d.ts +64 -0
- package/dist/cjs/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.js +163 -0
- package/dist/cjs/global-account/react/components/SingleUserSearchSelector/index.d.ts +2 -0
- package/dist/cjs/global-account/react/components/SingleUserSearchSelector/index.js +5 -0
- package/dist/cjs/global-account/react/components/StyleRoot.js +2 -2
- package/dist/cjs/global-account/react/components/WalletImage/WalletImage.d.ts +1 -1
- package/dist/cjs/global-account/react/components/custom/ManageAccountButton.js +1 -2
- package/dist/cjs/global-account/react/components/index.d.ts +3 -2
- package/dist/cjs/global-account/react/components/index.js +6 -6
- package/dist/cjs/global-account/react/hooks/index.d.ts +1 -0
- package/dist/cjs/global-account/react/hooks/index.js +3 -1
- 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 +6 -3
- 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/useProfile.js +4 -23
- 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/useUser.d.ts +60 -0
- package/dist/cjs/global-account/react/hooks/useUser.js +20 -0
- package/dist/cjs/global-account/react/hooks/useUserQuery.d.ts +6 -7
- package/dist/cjs/global-account/react/hooks/useUserQuery.js +64 -39
- package/dist/cjs/global-account/react/index.native.d.ts +0 -2
- package/dist/cjs/global-account/react/index.native.js +1 -5
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +66 -1
- package/dist/cjs/global-account/react/stores/useModalStore.js +3 -0
- package/dist/cjs/global-account/react/stores/userStore.d.ts +22 -0
- package/dist/cjs/global-account/react/stores/userStore.js +30 -0
- package/dist/cjs/global-account/react/utils/profileApi.d.ts +13 -0
- package/dist/cjs/global-account/react/utils/profileApi.js +29 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +3 -3
- package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +15 -10
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +23 -15
- package/dist/esm/anyspend/react/components/QRDeposit.js +32 -6
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +10 -3
- 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/TransferResultScreen.d.ts +22 -0
- package/dist/esm/anyspend/react/components/common/TransferResultScreen.js +22 -0
- package/dist/esm/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/esm/anyspend/react/hooks/index.js +1 -0
- 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/hooks/useWatchTransfer.d.ts +41 -0
- package/dist/esm/anyspend/react/hooks/useWatchTransfer.js +72 -0
- package/dist/esm/anyspend/utils/address.d.ts +5 -0
- package/dist/esm/anyspend/utils/address.js +7 -0
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +2 -2
- package/dist/esm/global-account/react/components/B3DynamicModal.js +6 -2
- package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +5 -0
- package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.js +10 -0
- package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +31 -0
- package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.js +33 -0
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +3 -18
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +6 -58
- 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 +10 -37
- package/dist/esm/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +3 -1
- package/dist/esm/global-account/react/components/B3Provider/LocalSDKProvider.js +3 -1
- package/dist/esm/global-account/react/components/B3Provider/useB3.d.ts +3 -3
- package/dist/esm/global-account/react/components/B3Provider/useB3.js +4 -10
- package/dist/esm/global-account/react/components/B3Provider/useB3Account.js +5 -2
- package/dist/esm/global-account/react/components/B3Provider/useB3Config.d.ts +1 -9
- package/dist/esm/global-account/react/components/B3Provider/useB3Config.js +1 -19
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +2 -3
- 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.d.ts +1 -1
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +5 -3
- 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/SingleUserSearchSelector/SingleUserSearchSelector.d.ts +64 -0
- package/dist/esm/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.js +160 -0
- package/dist/esm/global-account/react/components/SingleUserSearchSelector/index.d.ts +2 -0
- package/dist/esm/global-account/react/components/SingleUserSearchSelector/index.js +1 -0
- package/dist/esm/global-account/react/components/StyleRoot.js +2 -2
- package/dist/esm/global-account/react/components/WalletImage/WalletImage.d.ts +1 -1
- package/dist/esm/global-account/react/components/custom/ManageAccountButton.js +2 -3
- package/dist/esm/global-account/react/components/index.d.ts +3 -2
- package/dist/esm/global-account/react/components/index.js +3 -2
- package/dist/esm/global-account/react/hooks/index.d.ts +1 -0
- package/dist/esm/global-account/react/hooks/index.js +1 -0
- 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 +6 -3
- 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/useProfile.js +1 -20
- 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/useUser.d.ts +60 -0
- package/dist/esm/global-account/react/hooks/useUser.js +17 -0
- package/dist/esm/global-account/react/hooks/useUserQuery.d.ts +6 -7
- package/dist/esm/global-account/react/hooks/useUserQuery.js +63 -37
- package/dist/esm/global-account/react/index.native.d.ts +0 -2
- package/dist/esm/global-account/react/index.native.js +0 -2
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +66 -1
- package/dist/esm/global-account/react/stores/useModalStore.js +3 -0
- package/dist/esm/global-account/react/stores/userStore.d.ts +22 -0
- package/dist/esm/global-account/react/stores/userStore.js +27 -0
- package/dist/esm/global-account/react/utils/profileApi.d.ts +13 -0
- package/dist/esm/global-account/react/utils/profileApi.js +25 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +15 -10
- package/dist/types/anyspend/react/components/common/TransferResultScreen.d.ts +22 -0
- package/dist/types/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/types/anyspend/react/hooks/useWatchTransfer.d.ts +41 -0
- package/dist/types/anyspend/utils/address.d.ts +5 -0
- package/dist/types/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +5 -0
- package/dist/types/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +31 -0
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +3 -18
- package/dist/types/global-account/react/components/B3Provider/B3Provider.native.d.ts +6 -6
- package/dist/types/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +3 -1
- package/dist/types/global-account/react/components/B3Provider/useB3.d.ts +3 -3
- package/dist/types/global-account/react/components/B3Provider/useB3Config.d.ts +1 -9
- package/dist/types/global-account/react/components/SignInWithB3/SignInWithB3Flow.d.ts +1 -1
- package/dist/types/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.d.ts +64 -0
- package/dist/types/global-account/react/components/SingleUserSearchSelector/index.d.ts +2 -0
- package/dist/types/global-account/react/components/WalletImage/WalletImage.d.ts +1 -1
- package/dist/types/global-account/react/components/index.d.ts +3 -2
- package/dist/types/global-account/react/hooks/index.d.ts +1 -0
- 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/useUser.d.ts +60 -0
- package/dist/types/global-account/react/hooks/useUserQuery.d.ts +6 -7
- package/dist/types/global-account/react/index.native.d.ts +0 -2
- package/dist/types/global-account/react/stores/useModalStore.d.ts +66 -1
- package/dist/types/global-account/react/stores/userStore.d.ts +22 -0
- package/dist/types/global-account/react/utils/profileApi.d.ts +13 -0
- package/package.json +6 -1
- package/src/anyspend/react/components/AnySpend.tsx +3 -2
- package/src/anyspend/react/components/AnySpendDeposit.tsx +60 -42
- package/src/anyspend/react/components/QRDeposit.tsx +57 -5
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +13 -3
- 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/TransferResultScreen.tsx +107 -0
- package/src/anyspend/react/hooks/index.ts +1 -0
- 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/hooks/useWatchTransfer.ts +114 -0
- package/src/anyspend/utils/address.ts +13 -0
- package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +2 -2
- package/src/global-account/react/components/B3DynamicModal.tsx +6 -2
- package/src/global-account/react/components/B3Provider/AuthenticationProvider.tsx +19 -0
- package/src/global-account/react/components/B3Provider/B3ConfigProvider.tsx +84 -0
- package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +26 -45
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +15 -103
- package/src/global-account/react/components/B3Provider/LocalSDKProvider.tsx +5 -0
- package/src/global-account/react/components/B3Provider/useB3.ts +4 -12
- package/src/global-account/react/components/B3Provider/useB3Account.ts +6 -2
- package/src/global-account/react/components/B3Provider/useB3Config.ts +1 -34
- package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +2 -4
- 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 +7 -3
- 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/SingleUserSearchSelector/README.md +266 -0
- package/src/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.tsx +330 -0
- package/src/global-account/react/components/SingleUserSearchSelector/index.ts +2 -0
- package/src/global-account/react/components/StyleRoot.tsx +2 -2
- package/src/global-account/react/components/custom/ManageAccountButton.tsx +2 -3
- package/src/global-account/react/components/index.ts +8 -2
- package/src/global-account/react/hooks/index.ts +1 -0
- package/src/global-account/react/hooks/useAuth.ts +3 -3
- package/src/global-account/react/hooks/useAuthentication.ts +7 -3
- 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/useProfile.ts +1 -32
- package/src/global-account/react/hooks/useTokenBalance.tsx +8 -7
- package/src/global-account/react/hooks/useTurnkeyAuth.ts +2 -2
- package/src/global-account/react/hooks/useUser.ts +20 -0
- package/src/global-account/react/hooks/useUserQuery.ts +64 -51
- package/src/global-account/react/index.native.ts +0 -2
- package/src/global-account/react/stores/useModalStore.ts +70 -1
- package/src/global-account/react/stores/userStore.ts +41 -0
- package/src/global-account/react/utils/profileApi.ts +38 -0
- package/dist/cjs/global-account/react/components/B3Provider/types.d.ts +0 -27
- package/dist/cjs/global-account/react/components/B3Provider/types.js +0 -24
- package/dist/esm/global-account/react/components/B3Provider/types.d.ts +0 -27
- package/dist/esm/global-account/react/components/B3Provider/types.js +0 -21
- package/dist/types/global-account/react/components/B3Provider/types.d.ts +0 -27
- package/src/global-account/react/components/B3Provider/types.ts +0 -50
|
@@ -14,7 +14,7 @@ const validateEmail = (email) => {
|
|
|
14
14
|
return emailRegex.test(email);
|
|
15
15
|
};
|
|
16
16
|
const EmailChannel = ({ userId, jwtToken, emailChannel, isConnected, isOptimisticallyConnected, onConnectionChange, onToggle, }) => {
|
|
17
|
-
const { partnerId } = (0, react_1.
|
|
17
|
+
const { partnerId } = (0, react_1.useB3Config)();
|
|
18
18
|
const [email, setEmail] = (0, react_2.useState)("");
|
|
19
19
|
const [emailError, setEmailError] = (0, react_2.useState)(null);
|
|
20
20
|
const [isConnecting, setIsConnecting] = (0, react_2.useState)(false);
|
|
@@ -10,7 +10,7 @@ const toastApi_1 = require("../../Toast/toastApi");
|
|
|
10
10
|
const NotificationChannel_1 = require("../NotificationChannel");
|
|
11
11
|
const debug = (0, debug_1.debugB3React)("PhoneChannel");
|
|
12
12
|
const PhoneChannel = ({ userId, jwtToken, smsChannel, whatsappChannel, isSMSConnected, isWhatsAppConnected, isOptimisticallySMSConnected, isOptimisticallyWhatsAppConnected, onConnectionChange, onToggle, }) => {
|
|
13
|
-
const { partnerId } = (0, react_1.
|
|
13
|
+
const { partnerId } = (0, react_1.useB3Config)();
|
|
14
14
|
const [phoneNumber, setPhoneNumber] = (0, react_2.useState)("");
|
|
15
15
|
const [isConnectingSMS, setIsConnectingSMS] = (0, react_2.useState)(false);
|
|
16
16
|
const [isConnectingWhatsApp, setIsConnectingWhatsApp] = (0, react_2.useState)(false);
|
|
@@ -10,7 +10,7 @@ const toastApi_1 = require("../../Toast/toastApi");
|
|
|
10
10
|
const NotificationChannel_1 = require("../NotificationChannel");
|
|
11
11
|
const debug = (0, debug_1.debugB3React)("TelegramChannel");
|
|
12
12
|
const TelegramChannel = ({ userId, jwtToken, telegramChannel, isConnected, isOptimisticallyConnected, onConnectionChange, onToggle, }) => {
|
|
13
|
-
const { partnerId } = (0, react_1.
|
|
13
|
+
const { partnerId } = (0, react_1.useB3Config)();
|
|
14
14
|
const [isConnecting, setIsConnecting] = (0, react_2.useState)(false);
|
|
15
15
|
const [status, setStatus] = (0, react_2.useState)("idle");
|
|
16
16
|
// Detect if we're disconnecting
|
|
@@ -20,7 +20,7 @@ const debug = (0, debug_1.debugB3React)("RequestPermissions");
|
|
|
20
20
|
function RequestPermissions({ onSuccess, onError, chain, sessionKeyAddress, permissions, }) {
|
|
21
21
|
const [isApproving, setIsApproving] = (0, react_2.useState)(false);
|
|
22
22
|
const account = (0, react_3.useActiveAccount)();
|
|
23
|
-
const { defaultPermissions } = (0, react_1.
|
|
23
|
+
const { defaultPermissions } = (0, react_1.useB3Config)();
|
|
24
24
|
const DEFAULT_PERMISSIONS = (0, react_2.useMemo)(() => permissions ?? defaultPermissions, [defaultPermissions, permissions]);
|
|
25
25
|
const { refetch: refetchSigners } = (0, react_1.useGetAllTWSigners)({
|
|
26
26
|
chain,
|
|
@@ -15,7 +15,7 @@ const react_4 = require("thirdweb/react");
|
|
|
15
15
|
const ManageAccountButton_1 = require("../custom/ManageAccountButton");
|
|
16
16
|
function SignIn(props) {
|
|
17
17
|
const { className } = props;
|
|
18
|
-
const { automaticallySetFirstEoa, partnerId } = (0, react_1.
|
|
18
|
+
const { automaticallySetFirstEoa, partnerId } = (0, react_1.useB3Config)();
|
|
19
19
|
const { address: globalAddress, ensName, connectedSmartWallet, connectedEOAWallet, isActiveSmartWallet, isActiveEOAWallet, smartWalletIcon, } = (0, react_1.useAccountWallet)();
|
|
20
20
|
const { data: walletImage } = (0, react_4.useWalletImage)(connectedEOAWallet?.id);
|
|
21
21
|
const isMobile = (0, react_1.useIsMobile)();
|
|
@@ -3,4 +3,4 @@ import { SignInWithB3ModalProps } from "../../../../global-account/react";
|
|
|
3
3
|
* Component that manages the authentication flow for Sign In With B3
|
|
4
4
|
* Handles different login providers, authentication steps, and session key management
|
|
5
5
|
*/
|
|
6
|
-
export declare function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onError, chain, sessionKeyAddress, partnerId, closeAfterLogin, source, signersEnabled, }: SignInWithB3ModalProps): import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
export declare function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onError, chain, sessionKeyAddress, partnerId, closeAfterLogin, source, signersEnabled, onTurnkeyConnect, }: SignInWithB3ModalProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -16,8 +16,8 @@ const MAX_REFETCH_ATTEMPTS = 20;
|
|
|
16
16
|
* Component that manages the authentication flow for Sign In With B3
|
|
17
17
|
* Handles different login providers, authentication steps, and session key management
|
|
18
18
|
*/
|
|
19
|
-
function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onError, chain, sessionKeyAddress, partnerId, closeAfterLogin = false, source = "signInWithB3Button", signersEnabled = false, }) {
|
|
20
|
-
const { automaticallySetFirstEoa, enableTurnkey } = (0, react_1.
|
|
19
|
+
function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onError, chain, sessionKeyAddress, partnerId, closeAfterLogin = false, source = "signInWithB3Button", signersEnabled = false, onTurnkeyConnect, }) {
|
|
20
|
+
const { automaticallySetFirstEoa, enableTurnkey } = (0, react_1.useB3Config)();
|
|
21
21
|
const { user, refetchUser, logout } = (0, react_1.useAuthentication)(partnerId);
|
|
22
22
|
// FIXME Logout before login to ensure a clean state
|
|
23
23
|
const hasLoggedOutRef = (0, react_2.useRef)(false);
|
|
@@ -348,6 +348,8 @@ function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onE
|
|
|
348
348
|
setJustCompletedLogin(true);
|
|
349
349
|
// Call the login success callback
|
|
350
350
|
onLoginSuccess?.({});
|
|
351
|
+
// Call the onTurnkeyConnect callback
|
|
352
|
+
onTurnkeyConnect?.(authenticatedUser);
|
|
351
353
|
}, onClose: () => {
|
|
352
354
|
// If user closes Turnkey modal, they can still use wallet connection as fallback
|
|
353
355
|
setTurnkeyAuthCompleted(true);
|
|
@@ -7,7 +7,7 @@ const debug_1 = require("../../../../shared/utils/debug");
|
|
|
7
7
|
const react_2 = require("react");
|
|
8
8
|
const debug = (0, debug_1.debugB3React)("SignInWithB3Privy");
|
|
9
9
|
function SignInWithB3Privy({ onSuccess, onError, chain }) {
|
|
10
|
-
const { partnerId } = (0, react_1.
|
|
10
|
+
const { partnerId } = (0, react_1.useB3Config)();
|
|
11
11
|
const { isLoading, connectTw, fullToken } = (0, react_1.useHandleConnectWithPrivy)(chain, onSuccess);
|
|
12
12
|
const setIsAuthenticating = (0, react_1.useAuthStore)(state => state.setIsAuthenticating);
|
|
13
13
|
const setIsAuthenticated = (0, react_1.useAuthStore)(state => state.setIsAuthenticated);
|
|
@@ -19,7 +19,7 @@ function LoginStepContainer({ children, partnerId }) {
|
|
|
19
19
|
return ((0, jsx_runtime_1.jsxs)("div", { className: "bg-b3-react-background flex flex-col items-center justify-center pt-6", children: [partnerLogo && ((0, jsx_runtime_1.jsx)("img", { src: partnerLogo, alt: "Partner Logo", className: "partner-logo mb-6 h-12 w-auto object-contain" })), children] }));
|
|
20
20
|
}
|
|
21
21
|
function LoginStep({ onSuccess, chain }) {
|
|
22
|
-
const { partnerId, theme } = (0, react_1.
|
|
22
|
+
const { partnerId, theme } = (0, react_1.useB3Config)();
|
|
23
23
|
const wallet = (0, wallets_1.ecosystemWallet)(constants_1.ecosystemWalletId, {
|
|
24
24
|
partnerId: partnerId,
|
|
25
25
|
});
|
|
@@ -10,7 +10,7 @@ const react_3 = require("thirdweb/react");
|
|
|
10
10
|
const wallets_1 = require("thirdweb/wallets");
|
|
11
11
|
const debug = (0, debug_1.debugB3React)("LoginStepCustom");
|
|
12
12
|
function LoginStepCustom({ onSuccess, onError, chain, strategies, maxInitialWallets = 2, automaticallySetFirstEoa, }) {
|
|
13
|
-
const { partnerId } = (0, react_1.
|
|
13
|
+
const { partnerId } = (0, react_1.useB3Config)();
|
|
14
14
|
const [isLoading, setIsLoading] = (0, react_2.useState)(false);
|
|
15
15
|
const [showAllWallets, setShowAllWallets] = (0, react_2.useState)(false);
|
|
16
16
|
const { connect } = (0, react_1.useConnect)(partnerId, chain);
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { CombinedProfile } from "../../hooks/useProfile";
|
|
2
|
+
/**
|
|
3
|
+
* Profile type filter options for SingleUserSearchSelector
|
|
4
|
+
* - b3-ens: B3 ENS profiles
|
|
5
|
+
* - thirdweb-${string}: Thirdweb profiles (e.g., thirdweb-email, thirdweb-wallet)
|
|
6
|
+
* - ens-data: ENS data profiles
|
|
7
|
+
* - global-account: Global account profiles
|
|
8
|
+
*/
|
|
9
|
+
export type ProfileTypeFilter = "b3-ens" | `thirdweb-${string}` | "ens-data" | "global-account";
|
|
10
|
+
export interface SingleUserSearchSelectorProps {
|
|
11
|
+
/**
|
|
12
|
+
* Callback function when a user is selected
|
|
13
|
+
* Returns the complete profile data including all profile types
|
|
14
|
+
*/
|
|
15
|
+
onSelectUser: (profile: CombinedProfile) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Optional: Filter results to only show profiles that include specific types
|
|
18
|
+
* If provided, only profiles containing at least one of these types will be shown
|
|
19
|
+
*/
|
|
20
|
+
profileTypeFilter?: ProfileTypeFilter[];
|
|
21
|
+
/**
|
|
22
|
+
* Optional: Custom placeholder text for the search input
|
|
23
|
+
*/
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Optional: Custom class name for the container
|
|
27
|
+
*/
|
|
28
|
+
className?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Optional: Show clear button when there's input
|
|
31
|
+
*/
|
|
32
|
+
showClearButton?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Optional: Show profile type badges in the result
|
|
35
|
+
*/
|
|
36
|
+
showBadges?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Optional: Minimum characters before triggering search
|
|
39
|
+
*/
|
|
40
|
+
minSearchLength?: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* SingleUserSearchSelector Component
|
|
44
|
+
*
|
|
45
|
+
* A specialized component for searching and selecting a single user profile.
|
|
46
|
+
* This component is designed specifically for single-user selection scenarios,
|
|
47
|
+
* not for multi-user or general profile browsing.
|
|
48
|
+
*
|
|
49
|
+
* Features:
|
|
50
|
+
* - Search by address or name
|
|
51
|
+
* - Filter results by profile type (b3-ens, thirdweb-*, ens-data, global-account)
|
|
52
|
+
* - Shows a single result in a dropdown
|
|
53
|
+
* - Callback with complete profile data on selection
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* <SingleUserSearchSelector
|
|
58
|
+
* onSelectUser={(profile) => console.log('Selected:', profile)}
|
|
59
|
+
* profileTypeFilter={['b3-ens', 'global-account']}
|
|
60
|
+
* placeholder="Search by address or name..."
|
|
61
|
+
* />
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare function SingleUserSearchSelector({ onSelectUser, profileTypeFilter, placeholder, className, showClearButton, showBadges, minSearchLength, }: SingleUserSearchSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.SingleUserSearchSelector = SingleUserSearchSelector;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const utils_1 = require("../../../../shared/utils");
|
|
7
|
+
const lucide_react_1 = require("lucide-react");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const profileApi_1 = require("../../utils/profileApi");
|
|
10
|
+
const IPFSMediaRenderer_1 = require("../IPFSMediaRenderer/IPFSMediaRenderer");
|
|
11
|
+
const input_1 = require("../ui/input");
|
|
12
|
+
/**
|
|
13
|
+
* SingleUserSearchSelector Component
|
|
14
|
+
*
|
|
15
|
+
* A specialized component for searching and selecting a single user profile.
|
|
16
|
+
* This component is designed specifically for single-user selection scenarios,
|
|
17
|
+
* not for multi-user or general profile browsing.
|
|
18
|
+
*
|
|
19
|
+
* Features:
|
|
20
|
+
* - Search by address or name
|
|
21
|
+
* - Filter results by profile type (b3-ens, thirdweb-*, ens-data, global-account)
|
|
22
|
+
* - Shows a single result in a dropdown
|
|
23
|
+
* - Callback with complete profile data on selection
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <SingleUserSearchSelector
|
|
28
|
+
* onSelectUser={(profile) => console.log('Selected:', profile)}
|
|
29
|
+
* profileTypeFilter={['b3-ens', 'global-account']}
|
|
30
|
+
* placeholder="Search by address or name..."
|
|
31
|
+
* />
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
function SingleUserSearchSelector({ onSelectUser, profileTypeFilter, placeholder = "Search by address, name, or ID...", className, showClearButton = true, showBadges = false, minSearchLength = 3, }) {
|
|
35
|
+
const [searchQuery, setSearchQuery] = (0, react_1.useState)("");
|
|
36
|
+
const [isSearching, setIsSearching] = (0, react_1.useState)(false);
|
|
37
|
+
const [searchResult, setSearchResult] = (0, react_1.useState)(null);
|
|
38
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
39
|
+
const [showDropdown, setShowDropdown] = (0, react_1.useState)(false);
|
|
40
|
+
const dropdownRef = (0, react_1.useRef)(null);
|
|
41
|
+
const inputRef = (0, react_1.useRef)(null);
|
|
42
|
+
const searchTimeoutRef = (0, react_1.useRef)(undefined);
|
|
43
|
+
// Fetch profile from API using shared utility
|
|
44
|
+
const fetchProfile = (0, react_1.useCallback)(async (query) => {
|
|
45
|
+
if (!query || query.length < minSearchLength) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
// Determine if query is an address (starts with 0x) or a name
|
|
50
|
+
const params = query.startsWith("0x") ? { address: query } : { name: query };
|
|
51
|
+
const profile = await (0, profileApi_1.fetchProfile)(params);
|
|
52
|
+
return profile;
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
// Return null for 404s (user not found)
|
|
56
|
+
if (err instanceof Error && err.message.includes("404")) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
console.error("Error fetching profile:", err);
|
|
60
|
+
throw err;
|
|
61
|
+
}
|
|
62
|
+
}, [minSearchLength]);
|
|
63
|
+
// Filter profile by type
|
|
64
|
+
const filterProfileByType = (0, react_1.useCallback)((profile) => {
|
|
65
|
+
if (!profileTypeFilter || profileTypeFilter.length === 0) {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
// Check if any of the profile's types match the filter
|
|
69
|
+
return profile.profiles.some(p => {
|
|
70
|
+
return profileTypeFilter.some(filter => {
|
|
71
|
+
// Handle thirdweb-* wildcard matching
|
|
72
|
+
if (filter.startsWith("thirdweb-")) {
|
|
73
|
+
return p.type.startsWith("thirdweb-");
|
|
74
|
+
}
|
|
75
|
+
return p.type === filter;
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}, [profileTypeFilter]);
|
|
79
|
+
// Handle search with debouncing
|
|
80
|
+
(0, react_1.useEffect)(() => {
|
|
81
|
+
if (searchTimeoutRef.current) {
|
|
82
|
+
clearTimeout(searchTimeoutRef.current);
|
|
83
|
+
}
|
|
84
|
+
if (!searchQuery || searchQuery.length < minSearchLength) {
|
|
85
|
+
setSearchResult(null);
|
|
86
|
+
setShowDropdown(false);
|
|
87
|
+
setError(null);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
setIsSearching(true);
|
|
91
|
+
setError(null);
|
|
92
|
+
searchTimeoutRef.current = setTimeout(async () => {
|
|
93
|
+
try {
|
|
94
|
+
const result = await fetchProfile(searchQuery);
|
|
95
|
+
if (result) {
|
|
96
|
+
// Apply profile type filter
|
|
97
|
+
if (filterProfileByType(result)) {
|
|
98
|
+
setSearchResult(result);
|
|
99
|
+
setShowDropdown(true);
|
|
100
|
+
setError(null); // Clear any previous errors
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
setSearchResult(null);
|
|
104
|
+
setShowDropdown(false);
|
|
105
|
+
setError("No matching profile types found");
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
setSearchResult(null);
|
|
110
|
+
setShowDropdown(false);
|
|
111
|
+
setError("No user found");
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
setError(err instanceof Error ? err.message : "Failed to search");
|
|
116
|
+
setSearchResult(null);
|
|
117
|
+
setShowDropdown(false);
|
|
118
|
+
}
|
|
119
|
+
finally {
|
|
120
|
+
setIsSearching(false);
|
|
121
|
+
}
|
|
122
|
+
}, 500); // 500ms debounce
|
|
123
|
+
return () => {
|
|
124
|
+
if (searchTimeoutRef.current) {
|
|
125
|
+
clearTimeout(searchTimeoutRef.current);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}, [searchQuery, fetchProfile, filterProfileByType, minSearchLength]);
|
|
129
|
+
// Handle click outside to close dropdown
|
|
130
|
+
(0, react_1.useEffect)(() => {
|
|
131
|
+
const handleClickOutside = (event) => {
|
|
132
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
133
|
+
setShowDropdown(false);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
137
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
138
|
+
}, []);
|
|
139
|
+
// Handle user selection
|
|
140
|
+
const handleSelectUser = (0, react_1.useCallback)((profile) => {
|
|
141
|
+
onSelectUser(profile);
|
|
142
|
+
setShowDropdown(false);
|
|
143
|
+
setSearchQuery("");
|
|
144
|
+
setSearchResult(null);
|
|
145
|
+
}, [onSelectUser]);
|
|
146
|
+
// Handle clear search
|
|
147
|
+
const handleClear = (0, react_1.useCallback)(() => {
|
|
148
|
+
setSearchQuery("");
|
|
149
|
+
setSearchResult(null);
|
|
150
|
+
setShowDropdown(false);
|
|
151
|
+
setError(null);
|
|
152
|
+
inputRef.current?.focus();
|
|
153
|
+
}, []);
|
|
154
|
+
// Get display name for profile
|
|
155
|
+
const getDisplayName = (profile) => {
|
|
156
|
+
return profile.displayName || profile.name || profile.address || "Unknown";
|
|
157
|
+
};
|
|
158
|
+
// Get profile type badges
|
|
159
|
+
const getProfileTypeBadges = (profiles) => {
|
|
160
|
+
return profiles.map(p => p.type);
|
|
161
|
+
};
|
|
162
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)("single-user-search-selector b3-root relative w-full", className), ref: dropdownRef, children: [(0, jsx_runtime_1.jsxs)("div", { className: "single-user-search-input-wrapper relative flex items-center", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Search, { className: "single-user-search-icon pointer-events-none absolute text-gray-400", style: { left: "12px", width: "16px", height: "16px" } }), (0, jsx_runtime_1.jsx)(input_1.Input, { ref: inputRef, type: "text", value: searchQuery, onChange: e => setSearchQuery(e.target.value), placeholder: placeholder, className: (0, utils_1.cn)("single-user-search-input w-full border-gray-300 focus:border-blue-500 focus:ring-blue-500"), style: { paddingLeft: "44px", paddingRight: "44px" } }), showClearButton && searchQuery && ((0, jsx_runtime_1.jsx)("button", { onClick: handleClear, className: "single-user-search-clear-button absolute text-gray-400 transition-colors hover:text-gray-600", style: { right: "12px" }, type: "button", children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { style: { width: "16px", height: "16px" } }) }))] }), isSearching && (0, jsx_runtime_1.jsx)("div", { className: "single-user-search-loading mt-2 text-sm text-gray-500", children: "Searching..." }), error && !isSearching && (0, jsx_runtime_1.jsx)("div", { className: "single-user-search-error mt-2 text-sm text-red-500", children: error }), showDropdown && searchResult && !isSearching && ((0, jsx_runtime_1.jsx)("div", { className: "single-user-search-dropdown absolute z-50 mt-2 w-full rounded-lg border border-gray-200 bg-white shadow-lg", children: (0, jsx_runtime_1.jsx)("button", { onClick: () => handleSelectUser(searchResult), className: "single-user-search-result-button w-full px-4 py-3 text-left transition-colors hover:bg-gray-50", type: "button", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "single-user-search-result-avatar h-11 w-11 shrink-0", children: (0, jsx_runtime_1.jsx)(IPFSMediaRenderer_1.IPFSMediaRenderer, { src: searchResult.avatar, alt: getDisplayName(searchResult), className: "h-full w-full rounded-full object-cover" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "single-user-search-result-info min-w-0 flex-1 pt-0.5", children: [(0, jsx_runtime_1.jsx)("div", { className: "single-user-search-result-name text-base font-semibold text-gray-900", children: getDisplayName(searchResult) }), searchResult.address && ((0, jsx_runtime_1.jsxs)("div", { className: "single-user-search-result-address mt-1 font-mono text-xs text-gray-500", children: [searchResult.address.slice(0, 6), "...", searchResult.address.slice(-4)] })), searchResult.bio && ((0, jsx_runtime_1.jsx)("div", { className: "single-user-search-result-bio mt-1.5 line-clamp-2 text-sm text-gray-600", children: searchResult.bio })), showBadges && ((0, jsx_runtime_1.jsx)("div", { className: "single-user-search-result-badges mt-2 flex flex-wrap gap-1.5", children: getProfileTypeBadges(searchResult.profiles).map((type, index) => ((0, jsx_runtime_1.jsx)("span", { className: "single-user-search-result-badge inline-flex items-center rounded-full bg-blue-100 px-2.5 py-0.5 text-xs font-medium text-blue-800", children: type }, `${type}-${index}`))) }))] })] }) }) }))] }));
|
|
163
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SingleUserSearchSelector = void 0;
|
|
4
|
+
var SingleUserSearchSelector_1 = require("./SingleUserSearchSelector");
|
|
5
|
+
Object.defineProperty(exports, "SingleUserSearchSelector", { enumerable: true, get: function () { return SingleUserSearchSelector_1.SingleUserSearchSelector; } });
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StyleRoot = StyleRoot;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
5
|
+
const useB3Config_1 = require("./B3Provider/useB3Config");
|
|
6
6
|
function StyleRoot({ children, id }) {
|
|
7
|
-
const { theme } = (0,
|
|
7
|
+
const { theme } = (0, useB3Config_1.useB3Config)();
|
|
8
8
|
return ((0, jsx_runtime_1.jsx)("div", { className: "b3-root", id: id, "data-theme": theme, children: children }));
|
|
9
9
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
declare const WalletImage: ({ fallback }: {
|
|
2
2
|
fallback?: React.ReactNode;
|
|
3
|
-
}) => string | number | bigint | true |
|
|
3
|
+
}) => string | number | bigint | true | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null;
|
|
4
4
|
export default WalletImage;
|
|
@@ -5,9 +5,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("../../../../global-account/react");
|
|
6
6
|
const utils_1 = require("../../../../shared/utils");
|
|
7
7
|
function ManageAccountButton(props) {
|
|
8
|
-
const { partnerId } = (0, react_1.useB3)();
|
|
9
8
|
const { setB3ModalOpen, setB3ModalContentType } = (0, react_1.useModalStore)();
|
|
10
|
-
const { isConnected } = (0, react_1.
|
|
9
|
+
const { isConnected } = (0, react_1.useUser)();
|
|
11
10
|
const handleClickManageAccount = () => {
|
|
12
11
|
setB3ModalContentType({
|
|
13
12
|
...props,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { B3DynamicModal } from "./B3DynamicModal";
|
|
2
|
-
export { B3Provider
|
|
2
|
+
export { B3Provider } from "./B3Provider/B3Provider";
|
|
3
3
|
export { RelayKitProviderWrapper } from "./B3Provider/RelayKitProviderWrapper";
|
|
4
|
-
export { B3Context, type B3ContextType } from "./B3Provider/types";
|
|
5
4
|
export { useB3 } from "./B3Provider/useB3";
|
|
6
5
|
export { useB3Account } from "./B3Provider/useB3Account";
|
|
7
6
|
export { useB3Config } from "./B3Provider/useB3Config";
|
|
@@ -25,6 +24,8 @@ export { AccountAssets } from "./AccountAssets/AccountAssets";
|
|
|
25
24
|
export { MintButton } from "./MintButton/MintButton";
|
|
26
25
|
export { SendETHButton } from "./SendETHButton/SendETHButton";
|
|
27
26
|
export { SendERC20Button } from "./SendERC20Button/SendERC20Button";
|
|
27
|
+
export { SingleUserSearchSelector } from "./SingleUserSearchSelector/SingleUserSearchSelector";
|
|
28
|
+
export type { ProfileTypeFilter, SingleUserSearchSelectorProps, } from "./SingleUserSearchSelector/SingleUserSearchSelector";
|
|
28
29
|
export { Button as CustomButton, buttonVariants as customButtonVariants } from "./custom/Button";
|
|
29
30
|
export { ClientOnly } from "./custom/ClientOnly";
|
|
30
31
|
export { CopyToClipboard } from "./custom/CopyToClipboard";
|
|
@@ -3,20 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DialogClose = exports.Dialog = exports.CommandShortcut = exports.CommandSeparator = exports.CommandList = exports.CommandItem = exports.CommandInput = exports.CommandGroup = exports.CommandEmpty = exports.CommandDialog = exports.Command = exports.buttonVariants = exports.Button = exports.badgeVariants = exports.Badge = exports.WalletConnectorIcon = exports.StaggeredFadeLoader = exports.CopyToClipboard = exports.ClientOnly = exports.customButtonVariants = exports.CustomButton = exports.SendERC20Button = exports.SendETHButton = exports.MintButton = exports.AccountAssets = exports.RequestPermissionsButton = exports.RequestPermissions = exports.IPFSMediaRenderer = exports.Send = exports.Deposit = exports.ManageAccount = exports.TurnkeyAuthModal = exports.isWalletType = exports.getConnectOptionsFromStrategy = exports.LoginStepContainer = exports.SignInWithB3Privy = exports.SignInWithB3Flow = exports.SignInWithB3 = exports.WalletRow = exports.PermissionItem = exports.AuthButton = exports.StyleRoot = exports.useB3Config = exports.useB3Account = exports.useB3 = exports.
|
|
7
|
-
exports.TransitionPanel = exports.TooltipTrigger = exports.TooltipProvider = exports.TooltipContent = exports.Tooltip = exports.TextShimmer = exports.TextLoop = exports.TabTrigger = exports.TabsTransitionWrapper = exports.TabsList = exports.TabsContent = exports.Tabs = exports.TabTriggerPrimitive = exports.TabsPrimitive = exports.TabsListPrimitive = exports.TabsContentPrimitive = exports.Skeleton = exports.ShinyButton = exports.ScrollBar = exports.ScrollArea = exports.PopoverTrigger = exports.PopoverContent = exports.Popover = exports.Loading = exports.Input = exports.GlareCardRounded = exports.GlareCard = exports.DropdownMenuTrigger = exports.DropdownMenuSeparator = exports.DropdownMenuItem = exports.DropdownMenuContent = exports.DropdownMenu = exports.DrawerTrigger = exports.DrawerTitle = exports.DrawerPortal = exports.DrawerOverlay = exports.DrawerHeader = exports.DrawerFooter = exports.DrawerDescription = exports.DrawerContent = exports.DrawerClose = exports.Drawer = exports.DialogTrigger = exports.DialogTitle = exports.DialogPortal = exports.DialogOverlay = exports.DialogHeader = exports.DialogFooter = exports.DialogDescription =
|
|
8
|
-
exports.WalletImage = exports.useToastContext = exports.ToastProvider = exports.ToastContainer = exports.Toast = exports.toast =
|
|
6
|
+
exports.DialogContent = exports.DialogClose = exports.Dialog = exports.CommandShortcut = exports.CommandSeparator = exports.CommandList = exports.CommandItem = exports.CommandInput = exports.CommandGroup = exports.CommandEmpty = exports.CommandDialog = exports.Command = exports.buttonVariants = exports.Button = exports.badgeVariants = exports.Badge = exports.WalletConnectorIcon = exports.StaggeredFadeLoader = exports.CopyToClipboard = exports.ClientOnly = exports.customButtonVariants = exports.CustomButton = exports.SingleUserSearchSelector = exports.SendERC20Button = exports.SendETHButton = exports.MintButton = exports.AccountAssets = exports.RequestPermissionsButton = exports.RequestPermissions = exports.IPFSMediaRenderer = exports.Send = exports.Deposit = exports.ManageAccount = exports.TurnkeyAuthModal = exports.isWalletType = exports.getConnectOptionsFromStrategy = exports.LoginStepContainer = exports.SignInWithB3Privy = exports.SignInWithB3Flow = exports.SignInWithB3 = exports.WalletRow = exports.PermissionItem = exports.AuthButton = exports.StyleRoot = exports.useB3Config = exports.useB3Account = exports.useB3 = exports.RelayKitProviderWrapper = exports.B3Provider = exports.B3DynamicModal = void 0;
|
|
7
|
+
exports.AnimatedLottie = exports.TransitionPanel = exports.TooltipTrigger = exports.TooltipProvider = exports.TooltipContent = exports.Tooltip = exports.TextShimmer = exports.TextLoop = exports.TabTrigger = exports.TabsTransitionWrapper = exports.TabsList = exports.TabsContent = exports.Tabs = exports.TabTriggerPrimitive = exports.TabsPrimitive = exports.TabsListPrimitive = exports.TabsContentPrimitive = exports.Skeleton = exports.ShinyButton = exports.ScrollBar = exports.ScrollArea = exports.PopoverTrigger = exports.PopoverContent = exports.Popover = exports.Loading = exports.Input = exports.GlareCardRounded = exports.GlareCard = exports.DropdownMenuTrigger = exports.DropdownMenuSeparator = exports.DropdownMenuItem = exports.DropdownMenuContent = exports.DropdownMenu = exports.DrawerTrigger = exports.DrawerTitle = exports.DrawerPortal = exports.DrawerOverlay = exports.DrawerHeader = exports.DrawerFooter = exports.DrawerDescription = exports.DrawerContent = exports.DrawerClose = exports.Drawer = exports.DialogTrigger = exports.DialogTitle = exports.DialogPortal = exports.DialogOverlay = exports.DialogHeader = exports.DialogFooter = exports.DialogDescription = void 0;
|
|
8
|
+
exports.WalletImage = exports.useToastContext = exports.ToastProvider = exports.ToastContainer = exports.Toast = exports.toast = void 0;
|
|
9
9
|
// TODO woj: Barrel file for all components, this might be reason of bundle size issues
|
|
10
10
|
// Core Components
|
|
11
11
|
var B3DynamicModal_1 = require("./B3DynamicModal");
|
|
12
12
|
Object.defineProperty(exports, "B3DynamicModal", { enumerable: true, get: function () { return B3DynamicModal_1.B3DynamicModal; } });
|
|
13
13
|
var B3Provider_1 = require("./B3Provider/B3Provider");
|
|
14
14
|
Object.defineProperty(exports, "B3Provider", { enumerable: true, get: function () { return B3Provider_1.B3Provider; } });
|
|
15
|
-
Object.defineProperty(exports, "InnerProvider", { enumerable: true, get: function () { return B3Provider_1.InnerProvider; } });
|
|
16
15
|
var RelayKitProviderWrapper_1 = require("./B3Provider/RelayKitProviderWrapper");
|
|
17
16
|
Object.defineProperty(exports, "RelayKitProviderWrapper", { enumerable: true, get: function () { return RelayKitProviderWrapper_1.RelayKitProviderWrapper; } });
|
|
18
|
-
var types_1 = require("./B3Provider/types");
|
|
19
|
-
Object.defineProperty(exports, "B3Context", { enumerable: true, get: function () { return types_1.B3Context; } });
|
|
20
17
|
var useB3_1 = require("./B3Provider/useB3");
|
|
21
18
|
Object.defineProperty(exports, "useB3", { enumerable: true, get: function () { return useB3_1.useB3; } });
|
|
22
19
|
var useB3Account_1 = require("./B3Provider/useB3Account");
|
|
@@ -75,6 +72,9 @@ Object.defineProperty(exports, "SendETHButton", { enumerable: true, get: functio
|
|
|
75
72
|
// SendERC20Button Components
|
|
76
73
|
var SendERC20Button_1 = require("./SendERC20Button/SendERC20Button");
|
|
77
74
|
Object.defineProperty(exports, "SendERC20Button", { enumerable: true, get: function () { return SendERC20Button_1.SendERC20Button; } });
|
|
75
|
+
// SingleUserSearchSelector Components
|
|
76
|
+
var SingleUserSearchSelector_1 = require("./SingleUserSearchSelector/SingleUserSearchSelector");
|
|
77
|
+
Object.defineProperty(exports, "SingleUserSearchSelector", { enumerable: true, get: function () { return SingleUserSearchSelector_1.SingleUserSearchSelector; } });
|
|
78
78
|
// Custom Components
|
|
79
79
|
var Button_1 = require("./custom/Button");
|
|
80
80
|
Object.defineProperty(exports, "CustomButton", { enumerable: true, get: function () { return Button_1.Button; } });
|
|
@@ -44,3 +44,4 @@ export { useTokensFromAddress } from "./useTokensFromAddress";
|
|
|
44
44
|
export { useTurnkeyAuth } from "./useTurnkeyAuth";
|
|
45
45
|
export { useUnifiedChainSwitchAndExecute } from "./useUnifiedChainSwitchAndExecute";
|
|
46
46
|
export { useURLParams } from "./useURLParams";
|
|
47
|
+
export { useUser } from "./useUser";
|
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.useUnifiedChainSwitchAndExecute = exports.useTurnkeyAuth = exports.useTokensFromAddress = exports.useTokenPriceWithFallback = exports.useTokenPrice = exports.useTokenFromUrl = exports.useTokenData = exports.useTokenBalancesByChain = exports.useTokenBalanceDirect = exports.useTokenBalance = exports.useSiwe = exports.useSimCollectibles = exports.useSimTokenBalance = exports.useSimSvmBalance = exports.useSimBalance = exports.useSearchParamsSSR = exports.useRouter = exports.useRemoveSessionKey = exports.useQueryBSMNT = exports.useQueryB3 = exports.useProfileSettings = exports.useProfilePreference = exports.useProfile = exports.useDisplayName = exports.useOneBalance = exports.useNotifications = exports.useNativeBalanceFromRPC = exports.useNativeBalance = exports.useMediaQuery = exports.useIsomorphicLayoutEffect = exports.useIsMobile = exports.useHasMounted = exports.useHandleConnectWithPrivy = exports.useGlobalAccount = exports.useGetGeo = exports.useGetAllTWSigners = exports.useFirstEOA = exports.useExchangeRate = exports.useConnect = exports.useClient = exports.useChainSwitchWithAction = exports.useB3EnsName = exports.useB3BalanceFromAddresses = exports.useAuthentication = exports.useAuth = exports.useAnalytics = exports.useAddTWSessionKey = exports.useAccountWallet = exports.useAccountAssets = exports.createWagmiConfig = void 0;
|
|
18
|
-
exports.useURLParams = void 0;
|
|
18
|
+
exports.useUser = exports.useURLParams = void 0;
|
|
19
19
|
var createWagmiConfig_1 = require("../utils/createWagmiConfig");
|
|
20
20
|
Object.defineProperty(exports, "createWagmiConfig", { enumerable: true, get: function () { return createWagmiConfig_1.createWagmiConfig; } });
|
|
21
21
|
var useAccountAssets_1 = require("./useAccountAssets");
|
|
@@ -113,3 +113,5 @@ var useUnifiedChainSwitchAndExecute_1 = require("./useUnifiedChainSwitchAndExecu
|
|
|
113
113
|
Object.defineProperty(exports, "useUnifiedChainSwitchAndExecute", { enumerable: true, get: function () { return useUnifiedChainSwitchAndExecute_1.useUnifiedChainSwitchAndExecute; } });
|
|
114
114
|
var useURLParams_1 = require("./useURLParams");
|
|
115
115
|
Object.defineProperty(exports, "useURLParams", { enumerable: true, get: function () { return useURLParams_1.useURLParams; } });
|
|
116
|
+
var useUser_1 = require("./useUser");
|
|
117
|
+
Object.defineProperty(exports, "useUser", { enumerable: true, get: function () { return useUser_1.useUser; } });
|
|
@@ -70,7 +70,7 @@ export declare function useAuth(): {
|
|
|
70
70
|
turnkeyId?: string | undefined;
|
|
71
71
|
turnkeyOtpId?: string | undefined;
|
|
72
72
|
};
|
|
73
|
-
} |
|
|
73
|
+
} | undefined;
|
|
74
74
|
refetchUser: () => Promise<import("@feathersjs/authentication").AuthenticationResult>;
|
|
75
|
-
setUser: (
|
|
75
|
+
setUser: (newUser?: import("@b3dotfun/b3-api").Users) => void;
|
|
76
76
|
};
|
|
@@ -44,7 +44,7 @@ function useAuth() {
|
|
|
44
44
|
const hasStartedConnecting = (0, react_1.useAuthStore)(state => state.hasStartedConnecting);
|
|
45
45
|
const useAutoConnectLoadingPrevious = (0, react_2.useRef)(false);
|
|
46
46
|
const referralCode = (0, useSearchParamsSSR_1.useSearchParam)("referralCode");
|
|
47
|
-
const { partnerId } = (0, react_1.
|
|
47
|
+
const { partnerId } = (0, react_1.useB3Config)();
|
|
48
48
|
const wagmiConfig = (0, createWagmiConfig_1.createWagmiConfig)({ partnerId });
|
|
49
49
|
const { connect } = (0, wagmi_1.useConnect)();
|
|
50
50
|
const activeWagmiAccount = (0, wagmi_1.useAccount)();
|
|
@@ -294,7 +294,7 @@ function useAuth() {
|
|
|
294
294
|
debug("@@logout:loggedOut");
|
|
295
295
|
setIsAuthenticated(false);
|
|
296
296
|
setIsConnected(false);
|
|
297
|
-
setUser(
|
|
297
|
+
setUser();
|
|
298
298
|
callback?.();
|
|
299
299
|
}, [activeWallet, disconnect, wallets, setIsAuthenticated, setUser, setIsConnected]);
|
|
300
300
|
const { isLoading: useAutoConnectLoading } = (0, react_3.useAutoConnect)({
|
|
@@ -62,7 +62,7 @@ export declare function useAuthentication(partnerId: string): {
|
|
|
62
62
|
turnkeyId?: string | undefined;
|
|
63
63
|
turnkeyOtpId?: string | undefined;
|
|
64
64
|
};
|
|
65
|
-
} |
|
|
65
|
+
} | undefined;
|
|
66
66
|
refetchUser: (wallet?: Wallet) => Promise<import("@feathersjs/authentication").AuthenticationResult>;
|
|
67
|
-
setUser: (
|
|
67
|
+
setUser: (newUser?: import("@b3dotfun/b3-api").Users) => void;
|
|
68
68
|
};
|
|
@@ -22,7 +22,7 @@ const useTWAuth_1 = require("./useTWAuth");
|
|
|
22
22
|
const useUserQuery_1 = require("./useUserQuery");
|
|
23
23
|
const debug = (0, debug_1.debugB3React)("useAuthentication");
|
|
24
24
|
function useAuthentication(partnerId) {
|
|
25
|
-
const { onConnectCallback } = (0, react_2.useContext)(LocalSDKProvider_1.LocalSDKContext);
|
|
25
|
+
const { onConnectCallback, onLogoutCallback } = (0, react_2.useContext)(LocalSDKProvider_1.LocalSDKContext);
|
|
26
26
|
const { disconnect } = (0, react_3.useDisconnect)();
|
|
27
27
|
const wallets = (0, react_3.useConnectedWallets)();
|
|
28
28
|
const activeWallet = (0, react_3.useActiveWallet)();
|
|
@@ -154,9 +154,12 @@ function useAuthentication(partnerId) {
|
|
|
154
154
|
debug("@@logout:loggedOut");
|
|
155
155
|
setIsAuthenticated(false);
|
|
156
156
|
setIsConnected(false);
|
|
157
|
-
setUser(
|
|
157
|
+
setUser();
|
|
158
158
|
callback?.();
|
|
159
|
-
|
|
159
|
+
if (onLogoutCallback) {
|
|
160
|
+
await onLogoutCallback();
|
|
161
|
+
}
|
|
162
|
+
}, [activeWallet, disconnect, wallets, setIsAuthenticated, setUser, setIsConnected, onLogoutCallback]);
|
|
160
163
|
const onConnect = (0, react_2.useCallback)(async (_walleAutoConnectedWith, allConnectedWallets) => {
|
|
161
164
|
debug("@@useAuthentication:onConnect", { _walleAutoConnectedWith, allConnectedWallets });
|
|
162
165
|
try {
|
|
@@ -8,7 +8,7 @@ const client_manager_1 = require("../../client-manager");
|
|
|
8
8
|
* Hook to access the current FeathersJS client and client management utilities
|
|
9
9
|
*/
|
|
10
10
|
function useClient() {
|
|
11
|
-
const { clientType } = (0, react_1.
|
|
11
|
+
const { clientType } = (0, react_1.useB3Config)();
|
|
12
12
|
const getCurrentClient = (0, react_2.useCallback)(() => {
|
|
13
13
|
return (0, client_manager_1.getClient)();
|
|
14
14
|
}, []);
|
|
@@ -11,7 +11,7 @@ const debug = (0, debug_1.debugB3React)("@@b3:useHandleConnectWithPrivy");
|
|
|
11
11
|
* Currently, this is for the basement-privy strategy
|
|
12
12
|
*/
|
|
13
13
|
function useHandleConnectWithPrivy(chain, onSuccess) {
|
|
14
|
-
const { partnerId } = (0, react_1.
|
|
14
|
+
const { partnerId } = (0, react_1.useB3Config)();
|
|
15
15
|
if (!chain) {
|
|
16
16
|
throw new Error("Chain is required");
|
|
17
17
|
}
|
|
@@ -30,7 +30,7 @@ const debug = (0, debug_1.debugB3React)("useNotifications");
|
|
|
30
30
|
*/
|
|
31
31
|
function useNotifications() {
|
|
32
32
|
const { user } = (0, useUserQuery_1.useUserQuery)();
|
|
33
|
-
const { partnerId } = (0, react_1.
|
|
33
|
+
const { partnerId } = (0, react_1.useB3Config)();
|
|
34
34
|
const [userData, setUserData] = (0, react_2.useState)(null);
|
|
35
35
|
const [loading, setLoading] = (0, react_2.useState)(true);
|
|
36
36
|
const [error, setError] = (0, react_2.useState)(null);
|
|
@@ -5,28 +5,9 @@ exports.useProfilePreference = useProfilePreference;
|
|
|
5
5
|
exports.useDisplayName = useDisplayName;
|
|
6
6
|
exports.useProfileSettings = useProfileSettings;
|
|
7
7
|
const react_query_1 = require("@tanstack/react-query");
|
|
8
|
-
const
|
|
9
|
-
async function fetchProfile({ address, name, b3GlobalId, fresh = false, }) {
|
|
10
|
-
if (!address && !name && !b3GlobalId) {
|
|
11
|
-
throw new Error("Either address or name or b3GlobalId must be provided");
|
|
12
|
-
}
|
|
13
|
-
const params = new URLSearchParams();
|
|
14
|
-
if (address)
|
|
15
|
-
params.append("address", address);
|
|
16
|
-
if (name)
|
|
17
|
-
params.append("name", name);
|
|
18
|
-
if (b3GlobalId)
|
|
19
|
-
params.append("b3GlobalId", b3GlobalId);
|
|
20
|
-
if (fresh)
|
|
21
|
-
params.append("fresh", "true");
|
|
22
|
-
const response = await fetch(`${PROFILES_API_URL}?${params.toString()}`);
|
|
23
|
-
if (!response.ok) {
|
|
24
|
-
throw new Error(`Failed to fetch profile: ${response.statusText}`);
|
|
25
|
-
}
|
|
26
|
-
return response.json();
|
|
27
|
-
}
|
|
8
|
+
const profileApi_1 = require("../utils/profileApi");
|
|
28
9
|
async function setProfilePreference({ key, preferredType, signature, signer, timestamp, }) {
|
|
29
|
-
const response = await fetch(`${PROFILES_API_URL}/preference`, {
|
|
10
|
+
const response = await fetch(`${profileApi_1.PROFILES_API_URL}/preference`, {
|
|
30
11
|
method: "POST",
|
|
31
12
|
headers: {
|
|
32
13
|
"Content-Type": "application/json",
|
|
@@ -45,7 +26,7 @@ async function setProfilePreference({ key, preferredType, signature, signer, tim
|
|
|
45
26
|
return response.json();
|
|
46
27
|
}
|
|
47
28
|
async function setDisplayName({ key, displayName, signature, signer, timestamp, }) {
|
|
48
|
-
const response = await fetch(`${PROFILES_API_URL}/display-name`, {
|
|
29
|
+
const response = await fetch(`${profileApi_1.PROFILES_API_URL}/display-name`, {
|
|
49
30
|
method: "POST",
|
|
50
31
|
headers: {
|
|
51
32
|
"Content-Type": "application/json",
|
|
@@ -66,7 +47,7 @@ async function setDisplayName({ key, displayName, signature, signer, timestamp,
|
|
|
66
47
|
function useProfile({ address, name, b3GlobalId, fresh = false, }, options) {
|
|
67
48
|
return (0, react_query_1.useQuery)({
|
|
68
49
|
queryKey: ["profile", address || name || b3GlobalId, fresh],
|
|
69
|
-
queryFn: () => fetchProfile({ address, name, b3GlobalId, fresh }),
|
|
50
|
+
queryFn: () => (0, profileApi_1.fetchProfile)({ address, name, b3GlobalId, fresh }),
|
|
70
51
|
enabled: (options?.enabled ?? true) && (!!address || !!name || !!b3GlobalId),
|
|
71
52
|
refetchInterval: options?.refetchInterval,
|
|
72
53
|
staleTime: options?.staleTime ?? 5 * 60 * 1000, // 5 minutes default
|