@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
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface TransferResult {
|
|
2
|
+
amount: string;
|
|
3
|
+
formattedAmount: string;
|
|
4
|
+
txHash?: string;
|
|
5
|
+
timestamp: number;
|
|
6
|
+
}
|
|
7
|
+
export interface UseWatchTransferProps {
|
|
8
|
+
/** Address to watch for incoming transfers */
|
|
9
|
+
address: string;
|
|
10
|
+
/** Chain ID to watch on */
|
|
11
|
+
chainId: number;
|
|
12
|
+
/** Token address (use zero address for native token) */
|
|
13
|
+
tokenAddress: string;
|
|
14
|
+
/** Token decimals */
|
|
15
|
+
tokenDecimals: number;
|
|
16
|
+
/** Whether watching is enabled */
|
|
17
|
+
enabled?: boolean;
|
|
18
|
+
/** Callback when a transfer is detected */
|
|
19
|
+
onTransferDetected?: (result: TransferResult) => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Hook to watch for incoming transfers to an address by monitoring balance changes.
|
|
23
|
+
* When a transfer is detected (balance increases), it captures the amount and notifies.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useWatchTransfer({ address, chainId, tokenAddress, tokenDecimals, enabled, onTransferDetected, }: UseWatchTransferProps): {
|
|
26
|
+
/** Whether currently watching for transfers */
|
|
27
|
+
isWatching: boolean;
|
|
28
|
+
/** The detected transfer result, if any */
|
|
29
|
+
transferResult: TransferResult | null;
|
|
30
|
+
/** Whether a transfer has been detected */
|
|
31
|
+
hasTransfer: boolean;
|
|
32
|
+
/** Reset and start watching again */
|
|
33
|
+
reset: () => void;
|
|
34
|
+
/** Manually refetch balance */
|
|
35
|
+
refetchBalance: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<{
|
|
36
|
+
decimals: number;
|
|
37
|
+
formatted: string;
|
|
38
|
+
symbol: string;
|
|
39
|
+
value: bigint;
|
|
40
|
+
}, import("viem").GetBalanceErrorType>>;
|
|
41
|
+
};
|
|
@@ -13,3 +13,8 @@ export declare function isEvmOrSolanaAddress(address: string): boolean;
|
|
|
13
13
|
export declare function isHyperliquidUSDC(chainId: number, address: string): boolean;
|
|
14
14
|
export declare function normalizeAddress(address: string): string;
|
|
15
15
|
export declare function eqci(a: string | null | undefined, b: string | null | undefined): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Check if source and destination represent the same token on the same chain.
|
|
18
|
+
* When true, this is a pure transfer (no swap/bridge needed).
|
|
19
|
+
*/
|
|
20
|
+
export declare function isSameChainAndToken(sourceChainId: number, sourceTokenAddress: string, destinationChainId: number, destinationTokenAddress: string): boolean;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CreateOnrampOrderParams } from "@b3dotfun/sdk/anyspend/react/hooks/useAnyspendCreateOnrampOrder";
|
|
2
|
+
import { CreateOrderParams } from "@b3dotfun/sdk/anyspend/react/hooks/useAnyspendCreateOrder";
|
|
3
|
+
import { PermissionsConfig } from "@b3dotfun/sdk/global-account/types/permissions";
|
|
4
|
+
import { Account } from "thirdweb/wallets";
|
|
5
|
+
import { ClientType } from "../../../client-manager";
|
|
6
|
+
export interface B3ConfigContextType {
|
|
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
|
+
}
|
|
18
|
+
export declare function B3ConfigProvider({ children, accountOverride, environment, defaultPermissions, automaticallySetFirstEoa, theme, clientType, partnerId, stripePublishableKey, createClientReferenceId, enableTurnkey, }: {
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
accountOverride?: Account;
|
|
21
|
+
environment?: "development" | "production";
|
|
22
|
+
defaultPermissions?: PermissionsConfig;
|
|
23
|
+
automaticallySetFirstEoa?: boolean;
|
|
24
|
+
theme?: "light" | "dark";
|
|
25
|
+
clientType?: ClientType;
|
|
26
|
+
partnerId: string;
|
|
27
|
+
stripePublishableKey?: string;
|
|
28
|
+
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
29
|
+
enableTurnkey?: boolean;
|
|
30
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare function useB3Config(): B3ConfigContextType;
|
|
@@ -5,15 +5,14 @@ import "@relayprotocol/relay-kit-ui/styles.css";
|
|
|
5
5
|
import { Account, Wallet } from "thirdweb/wallets";
|
|
6
6
|
import { CreateConnectorFn } from "wagmi";
|
|
7
7
|
import { ClientType } from "../../../client-manager";
|
|
8
|
-
import { B3ContextType } from "./types";
|
|
9
8
|
/**
|
|
10
9
|
* Main B3Provider component
|
|
11
10
|
*/
|
|
12
|
-
export declare function B3Provider({ theme, children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster: _toaster, clientType, rpcUrls, partnerId, stripePublishableKey, onConnect, connectors, overrideDefaultConnectors, createClientReferenceId, enableTurnkey, }: {
|
|
11
|
+
export declare function B3Provider({ theme, children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster: _toaster, clientType, rpcUrls, partnerId, stripePublishableKey, onConnect, onLogout, connectors, overrideDefaultConnectors, createClientReferenceId, enableTurnkey, defaultPermissions, }: {
|
|
13
12
|
theme: "light" | "dark";
|
|
14
13
|
children: React.ReactNode;
|
|
15
14
|
accountOverride?: Account;
|
|
16
|
-
environment
|
|
15
|
+
environment?: "development" | "production";
|
|
17
16
|
automaticallySetFirstEoa?: boolean;
|
|
18
17
|
simDuneApiKey?: string;
|
|
19
18
|
toaster?: {
|
|
@@ -26,24 +25,10 @@ export declare function B3Provider({ theme, children, accountOverride, environme
|
|
|
26
25
|
/** Partner-specific Stripe publishable key. If not provided, uses default B3 Stripe account. */
|
|
27
26
|
stripePublishableKey?: string;
|
|
28
27
|
onConnect?: (wallet: Wallet, b3Jwt: string) => void | Promise<void>;
|
|
28
|
+
onLogout?: () => void | Promise<void>;
|
|
29
29
|
connectors?: CreateConnectorFn[];
|
|
30
30
|
overrideDefaultConnectors?: boolean;
|
|
31
31
|
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
32
32
|
enableTurnkey?: boolean;
|
|
33
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
34
|
-
/**
|
|
35
|
-
* Inner provider component that provides the actual B3Context
|
|
36
|
-
*/
|
|
37
|
-
export declare function InnerProvider({ children, accountOverride, environment, defaultPermissions, automaticallySetFirstEoa, theme, clientType, partnerId, stripePublishableKey, createClientReferenceId, enableTurnkey, }: {
|
|
38
|
-
children: React.ReactNode;
|
|
39
|
-
accountOverride?: Account;
|
|
40
|
-
environment: B3ContextType["environment"];
|
|
41
33
|
defaultPermissions?: PermissionsConfig;
|
|
42
|
-
automaticallySetFirstEoa: boolean;
|
|
43
|
-
theme: "light" | "dark";
|
|
44
|
-
clientType?: ClientType;
|
|
45
|
-
partnerId: string;
|
|
46
|
-
stripePublishableKey?: string;
|
|
47
|
-
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
48
|
-
enableTurnkey?: boolean;
|
|
49
34
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { PermissionsConfig } from "@b3dotfun/sdk/global-account/types/permissions";
|
|
2
2
|
import { Account, Wallet } from "thirdweb/wallets";
|
|
3
3
|
import { ClientType } from "../../../client-manager";
|
|
4
|
-
import { B3ContextType } from "./types";
|
|
5
4
|
/**
|
|
6
|
-
* Main B3Provider component
|
|
5
|
+
* Main B3Provider component
|
|
7
6
|
*/
|
|
8
|
-
export declare function B3Provider({ theme, children, accountOverride, environment, clientType, partnerId, rpcUrls, onConnect, }: {
|
|
7
|
+
export declare function B3Provider({ theme, children, accountOverride, environment, clientType, partnerId, rpcUrls, onConnect, defaultPermissions, }: {
|
|
9
8
|
theme: "light" | "dark";
|
|
10
9
|
children: React.ReactNode;
|
|
11
10
|
accountOverride?: Account;
|
|
12
|
-
environment
|
|
11
|
+
environment?: "development" | "production";
|
|
13
12
|
clientType?: ClientType;
|
|
14
13
|
partnerId: string;
|
|
15
14
|
rpcUrls?: Record<number, string>;
|
|
16
15
|
onConnect?: (wallet: Wallet, b3Jwt: string) => void | Promise<void>;
|
|
16
|
+
defaultPermissions?: PermissionsConfig;
|
|
17
17
|
}): import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
/**
|
|
19
|
-
* Inner provider component
|
|
19
|
+
* Inner provider component for native
|
|
20
20
|
*/
|
|
21
21
|
export declare function InnerProvider({ children, accountOverride, environment, defaultPermissions, theme, clientType, partnerId, rpcUrls, }: {
|
|
22
22
|
children: React.ReactNode;
|
|
23
23
|
accountOverride?: Account;
|
|
24
|
-
environment
|
|
24
|
+
environment?: "development" | "production";
|
|
25
25
|
defaultPermissions?: PermissionsConfig;
|
|
26
26
|
theme: "light" | "dark";
|
|
27
27
|
clientType?: ClientType;
|
|
@@ -5,12 +5,14 @@ import { Wallet } from "thirdweb/wallets";
|
|
|
5
5
|
*/
|
|
6
6
|
export interface LocalSDKContextType {
|
|
7
7
|
onConnectCallback?: (wallet: Wallet, b3Jwt: string) => void | Promise<void>;
|
|
8
|
+
onLogoutCallback?: () => void | Promise<void>;
|
|
8
9
|
}
|
|
9
10
|
export declare const LocalSDKContext: import("react").Context<LocalSDKContextType>;
|
|
10
11
|
/**
|
|
11
12
|
* Local SDK Provider that wraps the app and provides internal SDK state
|
|
12
13
|
*/
|
|
13
|
-
export declare function LocalSDKProvider({ children, onConnectCallback, }: {
|
|
14
|
+
export declare function LocalSDKProvider({ children, onConnectCallback, onLogoutCallback, }: {
|
|
14
15
|
children: React.ReactNode;
|
|
15
16
|
onConnectCallback?: (wallet: Wallet, b3Jwt: string) => void | Promise<void>;
|
|
17
|
+
onLogoutCallback?: () => void | Promise<void>;
|
|
16
18
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Hook to access the B3
|
|
3
|
-
* @
|
|
2
|
+
* Hook to access the B3 configuration
|
|
3
|
+
* @deprecated This is just an alias for useB3Config. Use useB3Config directly instead.
|
|
4
4
|
*/
|
|
5
|
-
export declare function useB3(): import("./
|
|
5
|
+
export declare function useB3(): import("./B3ConfigProvider").B3ConfigContextType;
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
automaticallySetFirstEoa: boolean;
|
|
3
|
-
environment: "development" | "production" | undefined;
|
|
4
|
-
theme: "light" | "dark";
|
|
5
|
-
clientType: import("../../../client-manager").ClientType;
|
|
6
|
-
partnerId: string;
|
|
7
|
-
createClientReferenceId: ((params: import("../../../../anyspend/react").CreateOrderParams | import("../../../../anyspend/react").CreateOnrampOrderParams) => Promise<string>) | undefined;
|
|
8
|
-
enableTurnkey: boolean | undefined;
|
|
9
|
-
};
|
|
1
|
+
export { useB3Config } from "./B3ConfigProvider";
|
|
@@ -3,4 +3,4 @@ import { SignInWithB3ModalProps } from "@b3dotfun/sdk/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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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";
|
|
@@ -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";
|
|
@@ -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
|
};
|
|
@@ -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
|
};
|
|
@@ -0,0 +1,60 @@
|
|
|
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,11 +1,9 @@
|
|
|
1
1
|
import { Users } from "@b3dotfun/b3-api";
|
|
2
|
-
declare const USER_QUERY_KEY: string[];
|
|
3
2
|
/**
|
|
4
3
|
* NOTE: THIS IS ONLY MEANT FOR INTERNAL USE, from useOnConnect
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* Uses Zustand store with persistence to localStorage
|
|
5
|
+
* Custom hook to manage user state with Zustand
|
|
6
|
+
* This allows for invalidation and refetching of user data
|
|
9
7
|
*/
|
|
10
8
|
export declare function useUserQuery(): {
|
|
11
9
|
user: {
|
|
@@ -59,8 +57,9 @@ export declare function useUserQuery(): {
|
|
|
59
57
|
turnkeyId?: string | undefined;
|
|
60
58
|
turnkeyOtpId?: string | undefined;
|
|
61
59
|
};
|
|
62
|
-
} |
|
|
63
|
-
setUser: (
|
|
60
|
+
} | undefined;
|
|
61
|
+
setUser: (newUser?: Users) => void;
|
|
62
|
+
refetchUser: () => Promise<any>;
|
|
64
63
|
clearUser: () => void;
|
|
64
|
+
queryKey: string[];
|
|
65
65
|
};
|
|
66
|
-
export { USER_QUERY_KEY };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export { B3Provider } from "./components/B3Provider/B3Provider.native";
|
|
2
|
-
export { B3Context, type B3ContextType } from "./components/B3Provider/types";
|
|
3
|
-
export { useB3 } from "./components/B3Provider/useB3";
|
|
4
2
|
export { useAccountWallet } from "./hooks/useAccountWallet";
|
|
5
3
|
export { useAuthentication } from "./hooks/useAuthentication";
|
|
6
4
|
export { useProfile } from "./hooks/useProfile";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Users } from "@b3dotfun/b3-api";
|
|
1
2
|
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
2
3
|
import { GenerateSigMintResponse } from "@b3dotfun/sdk/anyspend/types/signatureMint";
|
|
3
4
|
import { AllowedStrategy } from "@b3dotfun/sdk/global-account/react";
|
|
@@ -40,6 +41,8 @@ export interface SignInWithB3ModalProps extends BaseModalProps {
|
|
|
40
41
|
source?: "signInWithB3Button" | "requestPermissions";
|
|
41
42
|
/** Whether to show the signers enabled modal */
|
|
42
43
|
signersEnabled?: boolean;
|
|
44
|
+
/** Callback for turnkey auth */
|
|
45
|
+
onTurnkeyConnect?: (user: Users) => void;
|
|
43
46
|
}
|
|
44
47
|
/**
|
|
45
48
|
* Props for the Turnkey Authentication modal
|
|
@@ -482,10 +485,70 @@ export interface AnySpendCollectorClubPurchaseProps extends BaseModalProps {
|
|
|
482
485
|
/** Force fiat payment */
|
|
483
486
|
forceFiatPayment?: boolean;
|
|
484
487
|
}
|
|
488
|
+
/**
|
|
489
|
+
* Props for the AnySpend Deposit modal
|
|
490
|
+
* Flexible deposit component with optional chain selection
|
|
491
|
+
*/
|
|
492
|
+
export interface AnySpendDepositModalProps extends BaseModalProps {
|
|
493
|
+
/** Modal type identifier */
|
|
494
|
+
type: "anySpendDeposit";
|
|
495
|
+
/** Order ID to load an existing order */
|
|
496
|
+
loadOrder?: string;
|
|
497
|
+
/** The recipient address for the deposit */
|
|
498
|
+
recipientAddress: string;
|
|
499
|
+
/** Payment type - crypto or fiat. If not set, shows chain selection first */
|
|
500
|
+
paymentType?: "crypto" | "fiat";
|
|
501
|
+
/** Source token address to pre-select */
|
|
502
|
+
sourceTokenAddress?: string;
|
|
503
|
+
/** Source chain ID to pre-select. If not provided, shows chain selection */
|
|
504
|
+
sourceTokenChainId?: number;
|
|
505
|
+
/** The destination token address */
|
|
506
|
+
destinationTokenAddress: string;
|
|
507
|
+
/** The destination chain ID */
|
|
508
|
+
destinationTokenChainId: number;
|
|
509
|
+
/** Callback when deposit succeeds */
|
|
510
|
+
onSuccess?: (amount: string) => void;
|
|
511
|
+
/** Callback for opening a custom modal (e.g., for special token handling) */
|
|
512
|
+
onOpenCustomModal?: () => void;
|
|
513
|
+
/** Custom footer content */
|
|
514
|
+
mainFooter?: React.ReactNode;
|
|
515
|
+
/** Called when a token is selected. Call event.preventDefault() to prevent default behavior */
|
|
516
|
+
onTokenSelect?: (token: components["schemas"]["Token"], event: {
|
|
517
|
+
preventDefault: () => void;
|
|
518
|
+
}) => void;
|
|
519
|
+
/** Custom USD input value presets for fiat payment */
|
|
520
|
+
customUsdInputValues?: string[];
|
|
521
|
+
/** Whether to prefer using connected EOA wallet */
|
|
522
|
+
preferEoa?: boolean;
|
|
523
|
+
/** Minimum destination amount required */
|
|
524
|
+
minDestinationAmount?: number;
|
|
525
|
+
/** Order type for the deposit */
|
|
526
|
+
orderType?: "hype_duel" | "custom_exact_in" | "swap";
|
|
527
|
+
/** Custom action label displayed on buttons */
|
|
528
|
+
actionLabel?: string;
|
|
529
|
+
/** Whether to show chain selection step. Defaults to true if sourceTokenChainId is not provided */
|
|
530
|
+
showChainSelection?: boolean;
|
|
531
|
+
/** Minimum pool size for filtering tokens (default: 1,000,000) */
|
|
532
|
+
minPoolSize?: number;
|
|
533
|
+
/** Custom title for chain selection step */
|
|
534
|
+
chainSelectionTitle?: string;
|
|
535
|
+
/** Custom description for chain selection step */
|
|
536
|
+
chainSelectionDescription?: string;
|
|
537
|
+
/** Number of top chains to show (default: 3) */
|
|
538
|
+
topChainsCount?: number;
|
|
539
|
+
/** Custom URL to redirect to when clicking "Return to Home" on complete order screen */
|
|
540
|
+
returnToHomeUrl?: string;
|
|
541
|
+
/** Custom label for recipient display (e.g., "OBSN Telegram Bot") */
|
|
542
|
+
customRecipientLabel?: string;
|
|
543
|
+
/** Custom label for the return home button (overrides "Return to Home" / "Close") */
|
|
544
|
+
returnHomeLabel?: string;
|
|
545
|
+
/** Whether the deposit requires a custom function (uses AnySpendCustomExactIn). Defaults to false. */
|
|
546
|
+
isCustomDeposit?: boolean;
|
|
547
|
+
}
|
|
485
548
|
/**
|
|
486
549
|
* Union type of all possible modal content types
|
|
487
550
|
*/
|
|
488
|
-
export type ModalContentType = SignInWithB3ModalProps | TurnkeyAuthModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | AnySpendCollectorClubPurchaseProps;
|
|
551
|
+
export type ModalContentType = SignInWithB3ModalProps | TurnkeyAuthModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | AnySpendCollectorClubPurchaseProps | AnySpendDepositModalProps;
|
|
489
552
|
/**
|
|
490
553
|
* State interface for the modal store
|
|
491
554
|
*/
|
|
@@ -514,6 +577,8 @@ interface ModalState {
|
|
|
514
577
|
linkingMethod: string | null;
|
|
515
578
|
/** Function to set the linking state */
|
|
516
579
|
setLinkingState: (isLinking: boolean, method?: string | null) => void;
|
|
580
|
+
/** Function to update closable property of current content without adding to history */
|
|
581
|
+
setClosable: (closable: boolean) => void;
|
|
517
582
|
}
|
|
518
583
|
/**
|
|
519
584
|
* Zustand store for managing modal state
|
|
@@ -0,0 +1,22 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CombinedProfile } from "../hooks/useProfile";
|
|
2
|
+
export declare const PROFILES_API_URL = "https://profiles.b3.fun";
|
|
3
|
+
/**
|
|
4
|
+
* Fetch a user profile from the B3 Profiles API
|
|
5
|
+
* @param params - Search parameters (address, name, or b3GlobalId)
|
|
6
|
+
* @returns Promise resolving to CombinedProfile or null if not found
|
|
7
|
+
*/
|
|
8
|
+
export declare function fetchProfile({ address, name, b3GlobalId, fresh, }: {
|
|
9
|
+
address?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
b3GlobalId?: string;
|
|
12
|
+
fresh?: boolean;
|
|
13
|
+
}): Promise<CombinedProfile>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@b3dotfun/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2-test.0",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"react-native": "./dist/cjs/index.native.js",
|
|
@@ -131,6 +131,11 @@
|
|
|
131
131
|
"require": "./dist/cjs/global-account/react/components/*.js"
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
|
+
"./global-account/react/components/SingleUserSearchSelector": {
|
|
135
|
+
"types": "./dist/types/global-account/react/components/SingleUserSearchSelector/index.d.ts",
|
|
136
|
+
"import": "./dist/esm/global-account/react/components/SingleUserSearchSelector/index.js",
|
|
137
|
+
"require": "./dist/cjs/global-account/react/components/SingleUserSearchSelector/index.js"
|
|
138
|
+
},
|
|
134
139
|
"./global-account/types": {
|
|
135
140
|
"types": "./dist/types/global-account/types.d.ts",
|
|
136
141
|
"import": "./dist/esm/global-account/types.js",
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
toast,
|
|
26
26
|
TransitionPanel,
|
|
27
27
|
useAccountWallet,
|
|
28
|
-
|
|
28
|
+
useB3Config,
|
|
29
29
|
useModalStore,
|
|
30
30
|
useProfile,
|
|
31
31
|
useRouter,
|
|
@@ -165,7 +165,7 @@ function AnySpendInner({
|
|
|
165
165
|
const searchParams = useSearchParamsSSR();
|
|
166
166
|
const router = useRouter();
|
|
167
167
|
|
|
168
|
-
const { partnerId } =
|
|
168
|
+
const { partnerId } = useB3Config();
|
|
169
169
|
const setB3ModalContentType = useModalStore(state => state.setB3ModalContentType);
|
|
170
170
|
|
|
171
171
|
// Determine if we're in "buy mode" based on whether destination token props are provided
|
|
@@ -1089,6 +1089,7 @@ function AnySpendInner({
|
|
|
1089
1089
|
}}
|
|
1090
1090
|
returnToHomeUrl={returnToHomeUrl}
|
|
1091
1091
|
returnHomeLabel={returnHomeLabel}
|
|
1092
|
+
disableUrlParamManagement={disableUrlParamManagement}
|
|
1092
1093
|
/>
|
|
1093
1094
|
)}
|
|
1094
1095
|
{/* {mode === "page" && <div className="h-12" />} */}
|