@b3dotfun/sdk 0.0.88 → 0.0.89-alpha.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/constants/index.d.ts +2 -0
- package/dist/cjs/anyspend/constants/index.js +3 -1
- package/dist/cjs/anyspend/index.d.ts +2 -0
- package/dist/cjs/anyspend/index.js +3 -0
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +6 -0
- package/dist/cjs/anyspend/react/components/AnySpend.js +9 -6
- package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
- package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +1 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +3 -3
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +6 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +24 -20
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +7 -1
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +3 -3
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +4 -0
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +14 -1
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +3 -2
- package/dist/cjs/anyspend/react/components/common/GasIndicator.d.ts +6 -0
- package/dist/cjs/anyspend/react/components/common/GasIndicator.js +34 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +4 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +34 -6
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +3 -2
- package/dist/cjs/anyspend/react/components/common/PaymentStripeWeb2.js +3 -4
- 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/useGasPrice.d.ts +37 -0
- package/dist/cjs/anyspend/react/hooks/useGasPrice.js +43 -0
- package/dist/cjs/anyspend/react/hooks/useValidatedClientReferenceId.js +1 -1
- package/dist/cjs/anyspend/services/gas.d.ts +21 -0
- package/dist/cjs/anyspend/services/gas.js +65 -0
- package/dist/cjs/anyspend/types/gas.d.ts +61 -0
- package/dist/cjs/anyspend/types/gas.js +2 -0
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +2 -3
- 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/B3Provider.d.ts +2 -18
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +35 -52
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +38 -35
- package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +3 -1
- package/dist/cjs/global-account/react/components/B3Provider/useB3.d.ts +14 -4
- package/dist/cjs/global-account/react/components/B3Provider/useB3.js +4 -11
- package/dist/cjs/global-account/react/components/B3Provider/useB3Account.js +5 -2
- package/dist/cjs/global-account/react/components/B3Provider/useB3Config.d.ts +10 -2
- package/dist/cjs/global-account/react/components/B3Provider/useB3Config.js +18 -17
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +1 -2
- package/dist/cjs/global-account/react/components/ManageAccount/channels/DiscordChannel.js +6 -6
- package/dist/cjs/global-account/react/components/ManageAccount/channels/EmailChannel.js +7 -7
- package/dist/cjs/global-account/react/components/ManageAccount/channels/PhoneChannel.js +7 -7
- package/dist/cjs/global-account/react/components/ManageAccount/channels/TelegramChannel.js +5 -5
- package/dist/cjs/global-account/react/components/RequestPermissions/RequestPermissions.js +8 -9
- package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +76 -20
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStep.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +1 -1
- package/dist/cjs/global-account/react/components/StyleRoot.js +3 -3
- package/dist/cjs/global-account/react/components/TurnkeyAuthModal.js +3 -1
- package/dist/cjs/global-account/react/components/custom/ManageAccountButton.js +1 -2
- package/dist/cjs/global-account/react/components/index.d.ts +1 -2
- package/dist/cjs/global-account/react/components/index.js +3 -6
- package/dist/cjs/global-account/react/hooks/index.d.ts +2 -0
- package/dist/cjs/global-account/react/hooks/index.js +5 -1
- package/dist/cjs/global-account/react/hooks/useAuth.d.ts +76 -0
- package/dist/cjs/global-account/react/hooks/useAuth.js +337 -0
- 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 +14 -14
- package/dist/cjs/global-account/react/hooks/useTWAuth.d.ts +3 -0
- package/dist/cjs/global-account/react/hooks/useTWAuth.js +8 -0
- package/dist/cjs/global-account/react/hooks/useTokenBalance.js +5 -5
- package/dist/cjs/global-account/react/hooks/useTokenBalancesByChain.js +4 -2
- package/dist/cjs/global-account/react/hooks/useTurnkeyAuth.js +50 -22
- 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.js +9 -35
- 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/configStore.d.ts +24 -0
- package/dist/cjs/global-account/react/stores/configStore.js +30 -0
- package/dist/cjs/global-account/react/stores/index.d.ts +1 -0
- package/dist/cjs/global-account/react/stores/index.js +3 -1
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +10 -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/esm/anyspend/constants/index.d.ts +2 -0
- package/dist/esm/anyspend/constants/index.js +2 -0
- package/dist/esm/anyspend/index.d.ts +2 -0
- package/dist/esm/anyspend/index.js +3 -0
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +6 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +11 -8
- package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
- package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +1 -0
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +3 -3
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +6 -0
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +8 -4
- package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +7 -1
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +3 -3
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +4 -0
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +14 -1
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +3 -2
- package/dist/esm/anyspend/react/components/common/GasIndicator.d.ts +6 -0
- package/dist/esm/anyspend/react/components/common/GasIndicator.js +31 -0
- package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +4 -0
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +36 -8
- package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/PanelOnramp.js +3 -2
- package/dist/esm/anyspend/react/components/common/PaymentStripeWeb2.js +3 -4
- 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/useGasPrice.d.ts +37 -0
- package/dist/esm/anyspend/react/hooks/useGasPrice.js +40 -0
- package/dist/esm/anyspend/react/hooks/useValidatedClientReferenceId.js +2 -2
- package/dist/esm/anyspend/services/gas.d.ts +21 -0
- package/dist/esm/anyspend/services/gas.js +59 -0
- package/dist/esm/anyspend/types/gas.d.ts +61 -0
- package/dist/esm/anyspend/types/gas.js +1 -0
- package/dist/esm/global-account/react/components/B3DynamicModal.js +3 -4
- 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/B3Provider.d.ts +2 -18
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +34 -53
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +36 -36
- package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +3 -1
- package/dist/esm/global-account/react/components/B3Provider/useB3.d.ts +14 -4
- package/dist/esm/global-account/react/components/B3Provider/useB3.js +4 -11
- package/dist/esm/global-account/react/components/B3Provider/useB3Account.js +5 -2
- package/dist/esm/global-account/react/components/B3Provider/useB3Config.d.ts +10 -2
- package/dist/esm/global-account/react/components/B3Provider/useB3Config.js +18 -17
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +2 -3
- 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 -3
- package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +76 -20
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStep.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +2 -2
- package/dist/esm/global-account/react/components/StyleRoot.js +3 -3
- package/dist/esm/global-account/react/components/TurnkeyAuthModal.js +5 -3
- package/dist/esm/global-account/react/components/custom/ManageAccountButton.js +2 -3
- package/dist/esm/global-account/react/components/index.d.ts +1 -2
- package/dist/esm/global-account/react/components/index.js +1 -2
- package/dist/esm/global-account/react/hooks/index.d.ts +2 -0
- package/dist/esm/global-account/react/hooks/index.js +2 -0
- package/dist/esm/global-account/react/hooks/useAuth.d.ts +76 -0
- package/dist/esm/global-account/react/hooks/useAuth.js +331 -0
- 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/useTWAuth.d.ts +3 -0
- package/dist/esm/global-account/react/hooks/useTWAuth.js +8 -0
- package/dist/esm/global-account/react/hooks/useTokenBalance.js +6 -6
- package/dist/esm/global-account/react/hooks/useTokenBalancesByChain.js +4 -2
- package/dist/esm/global-account/react/hooks/useTurnkeyAuth.js +50 -22
- 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.js +1 -27
- 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/configStore.d.ts +24 -0
- package/dist/esm/global-account/react/stores/configStore.js +27 -0
- package/dist/esm/global-account/react/stores/index.d.ts +1 -0
- package/dist/esm/global-account/react/stores/index.js +1 -0
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +10 -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/styles/index.css +1 -1
- package/dist/types/anyspend/constants/index.d.ts +2 -0
- package/dist/types/anyspend/index.d.ts +2 -0
- package/dist/types/anyspend/react/components/AnySpend.d.ts +6 -0
- package/dist/types/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
- package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +1 -0
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +6 -0
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +7 -1
- package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +4 -0
- package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/GasIndicator.d.ts +6 -0
- package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +4 -0
- package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
- package/dist/types/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/types/anyspend/react/hooks/useGasPrice.d.ts +37 -0
- package/dist/types/anyspend/services/gas.d.ts +21 -0
- package/dist/types/anyspend/types/gas.d.ts +61 -0
- package/dist/types/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +5 -0
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +2 -18
- package/dist/types/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
- package/dist/types/global-account/react/components/B3Provider/useB3.d.ts +14 -4
- package/dist/types/global-account/react/components/B3Provider/useB3Config.d.ts +10 -2
- package/dist/types/global-account/react/components/index.d.ts +1 -2
- package/dist/types/global-account/react/hooks/index.d.ts +2 -0
- package/dist/types/global-account/react/hooks/useAuth.d.ts +76 -0
- package/dist/types/global-account/react/hooks/useTWAuth.d.ts +3 -0
- package/dist/types/global-account/react/hooks/useUser.d.ts +60 -0
- package/dist/types/global-account/react/index.native.d.ts +0 -2
- package/dist/types/global-account/react/stores/configStore.d.ts +24 -0
- package/dist/types/global-account/react/stores/index.d.ts +1 -0
- package/dist/types/global-account/react/stores/useModalStore.d.ts +10 -0
- package/dist/types/global-account/react/stores/userStore.d.ts +22 -0
- package/package.json +1 -1
- package/src/anyspend/constants/index.ts +3 -0
- package/src/anyspend/index.ts +4 -0
- package/src/anyspend/react/components/AnySpend.tsx +28 -2
- package/src/anyspend/react/components/AnySpendCollectorClubPurchase.tsx +6 -0
- package/src/anyspend/react/components/AnySpendCustom.tsx +52 -47
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +23 -0
- package/src/anyspend/react/components/AnySpendDeposit.tsx +27 -18
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +4 -0
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +15 -1
- package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +5 -1
- package/src/anyspend/react/components/common/GasIndicator.tsx +59 -0
- package/src/anyspend/react/components/common/OrderDetails.tsx +60 -42
- package/src/anyspend/react/components/common/PanelOnramp.tsx +5 -1
- package/src/anyspend/react/components/common/PaymentStripeWeb2.tsx +3 -4
- 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/useGasPrice.ts +70 -0
- package/src/anyspend/react/hooks/useValidatedClientReferenceId.ts +2 -2
- package/src/anyspend/services/gas.test.ts +31 -0
- package/src/anyspend/services/gas.ts +73 -0
- package/src/anyspend/types/gas.ts +66 -0
- package/src/global-account/react/components/B3DynamicModal.tsx +3 -4
- package/src/global-account/react/components/B3Provider/AuthenticationProvider.tsx +19 -0
- package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +43 -54
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +44 -106
- package/src/global-account/react/components/B3Provider/RelayKitProviderWrapper.tsx +4 -1
- package/src/global-account/react/components/B3Provider/useB3.ts +4 -13
- package/src/global-account/react/components/B3Provider/useB3Account.ts +6 -2
- package/src/global-account/react/components/B3Provider/useB3Config.ts +18 -31
- package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +2 -4
- 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 +4 -4
- package/src/global-account/react/components/SignInWithB3/SignIn.tsx +2 -2
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +168 -100
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Privy.tsx +2 -2
- package/src/global-account/react/components/SignInWithB3/steps/LoginStep.tsx +2 -2
- package/src/global-account/react/components/SignInWithB3/steps/LoginStepCustom.tsx +2 -2
- package/src/global-account/react/components/StyleRoot.tsx +3 -3
- package/src/global-account/react/components/TurnkeyAuthModal.tsx +7 -4
- package/src/global-account/react/components/custom/ManageAccountButton.tsx +2 -3
- package/src/global-account/react/components/index.ts +1 -2
- package/src/global-account/react/hooks/index.ts +2 -0
- package/src/global-account/react/hooks/useAuth.ts +379 -0
- 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/useTWAuth.tsx +10 -0
- package/src/global-account/react/hooks/useTokenBalance.tsx +8 -7
- package/src/global-account/react/hooks/useTokenBalancesByChain.tsx +4 -2
- package/src/global-account/react/hooks/useTurnkeyAuth.ts +54 -23
- package/src/global-account/react/hooks/useUser.ts +20 -0
- package/src/global-account/react/hooks/useUserQuery.ts +1 -40
- package/src/global-account/react/index.native.ts +0 -2
- package/src/global-account/react/stores/configStore.ts +51 -0
- package/src/global-account/react/stores/index.ts +1 -0
- package/src/global-account/react/stores/useModalStore.ts +10 -0
- package/src/global-account/react/stores/userStore.ts +41 -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
|
@@ -1,48 +1,9 @@
|
|
|
1
1
|
import { Users } from "@b3dotfun/b3-api";
|
|
2
|
-
import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
|
|
3
2
|
import { useEffect } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import { persist } from "zustand/middleware";
|
|
6
|
-
|
|
7
|
-
const debug = debugB3React("useUserQuery");
|
|
3
|
+
import { useUserStore } from "../stores/userStore";
|
|
8
4
|
|
|
9
5
|
const USER_QUERY_KEY = ["b3-user"];
|
|
10
6
|
|
|
11
|
-
interface UserStore {
|
|
12
|
-
user: Users | null;
|
|
13
|
-
setUser: (user: Users | undefined) => void;
|
|
14
|
-
clearUser: () => void;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Zustand store for managing user state
|
|
19
|
-
* Persists user data to localStorage
|
|
20
|
-
*/
|
|
21
|
-
const useUserStore = create<UserStore>()(
|
|
22
|
-
persist(
|
|
23
|
-
set => ({
|
|
24
|
-
user: null,
|
|
25
|
-
setUser: (newUser: Users | undefined) => {
|
|
26
|
-
const userToSave = newUser ?? null;
|
|
27
|
-
set({ user: userToSave });
|
|
28
|
-
debug("User updated", userToSave);
|
|
29
|
-
},
|
|
30
|
-
clearUser: () => {
|
|
31
|
-
set({ user: null });
|
|
32
|
-
debug("User cleared");
|
|
33
|
-
},
|
|
34
|
-
}),
|
|
35
|
-
{
|
|
36
|
-
name: "b3-user",
|
|
37
|
-
onRehydrateStorage: () => (_, error) => {
|
|
38
|
-
if (error) {
|
|
39
|
-
console.warn("Failed to rehydrate user store:", error);
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
),
|
|
44
|
-
);
|
|
45
|
-
|
|
46
7
|
/**
|
|
47
8
|
* NOTE: THIS IS ONLY MEANT FOR INTERNAL USE, from useOnConnect
|
|
48
9
|
*
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
export { B3Provider } from "./components/B3Provider/B3Provider.native";
|
|
8
8
|
|
|
9
|
-
export { B3Context, type B3ContextType } from "./components/B3Provider/types";
|
|
10
|
-
export { useB3 } from "./components/B3Provider/useB3";
|
|
11
9
|
export { useAccountWallet } from "./hooks/useAccountWallet";
|
|
12
10
|
export { useAuthentication } from "./hooks/useAuthentication";
|
|
13
11
|
export { useProfile } from "./hooks/useProfile";
|
|
@@ -0,0 +1,51 @@
|
|
|
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 { create } from "zustand";
|
|
6
|
+
import { ClientType } from "../../client-manager";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Default permissions configuration for B3 provider
|
|
10
|
+
*/
|
|
11
|
+
const DEFAULT_PERMISSIONS: PermissionsConfig = {
|
|
12
|
+
approvedTargets: ["0xa8e42121e318e3D3BeD7f5969AF6D360045317DD"],
|
|
13
|
+
nativeTokenLimitPerTransaction: 0.1,
|
|
14
|
+
startDate: new Date(),
|
|
15
|
+
endDate: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365), // 1 year from now
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
interface ConfigStore {
|
|
19
|
+
accountOverride?: Account;
|
|
20
|
+
automaticallySetFirstEoa: boolean;
|
|
21
|
+
environment: "development" | "production";
|
|
22
|
+
defaultPermissions: PermissionsConfig;
|
|
23
|
+
theme: "light" | "dark";
|
|
24
|
+
clientType: ClientType;
|
|
25
|
+
partnerId: string;
|
|
26
|
+
stripePublishableKey?: string;
|
|
27
|
+
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
28
|
+
enableTurnkey: boolean;
|
|
29
|
+
|
|
30
|
+
// Actions
|
|
31
|
+
setConfig: (config: Partial<Omit<ConfigStore, "setConfig">>) => void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Zustand store for B3 configuration
|
|
36
|
+
* NOT persisted - these are developer-set configuration values
|
|
37
|
+
*/
|
|
38
|
+
export const useB3ConfigStore = create<ConfigStore>(set => ({
|
|
39
|
+
accountOverride: undefined,
|
|
40
|
+
automaticallySetFirstEoa: false,
|
|
41
|
+
environment: "development",
|
|
42
|
+
defaultPermissions: DEFAULT_PERMISSIONS,
|
|
43
|
+
theme: "light",
|
|
44
|
+
clientType: "rest",
|
|
45
|
+
partnerId: "",
|
|
46
|
+
stripePublishableKey: undefined,
|
|
47
|
+
createClientReferenceId: undefined,
|
|
48
|
+
enableTurnkey: false,
|
|
49
|
+
|
|
50
|
+
setConfig: config => set(state => ({ ...state, ...config })),
|
|
51
|
+
}));
|
|
@@ -426,6 +426,12 @@ export interface AnySpendDepositHypeProps extends BaseModalProps {
|
|
|
426
426
|
customUsdInputValues?: string[];
|
|
427
427
|
/** prefer eoa wallet */
|
|
428
428
|
preferEoa?: boolean;
|
|
429
|
+
/** Custom URL to redirect to when clicking "Return to Home" on complete order screen */
|
|
430
|
+
returnToHomeUrl?: string;
|
|
431
|
+
/** Custom label for recipient display (e.g., "OBSN Telegram Bot") */
|
|
432
|
+
customRecipientLabel?: string;
|
|
433
|
+
/** Custom label for the return home button (overrides "Return to Home" / "Close") */
|
|
434
|
+
returnHomeLabel?: string;
|
|
429
435
|
}
|
|
430
436
|
|
|
431
437
|
export interface AvatarEditorModalProps extends BaseModalProps {
|
|
@@ -499,6 +505,10 @@ export interface AnySpendCollectorClubPurchaseProps extends BaseModalProps {
|
|
|
499
505
|
vendingMachineId: string;
|
|
500
506
|
/** The pack type */
|
|
501
507
|
packType: string;
|
|
508
|
+
/** Active tab */
|
|
509
|
+
activeTab?: "crypto" | "fiat";
|
|
510
|
+
/** Force fiat payment */
|
|
511
|
+
forceFiatPayment?: boolean;
|
|
502
512
|
}
|
|
503
513
|
|
|
504
514
|
/**
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Users } from "@b3dotfun/b3-api";
|
|
2
|
+
import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
|
|
3
|
+
import { create } from "zustand";
|
|
4
|
+
import { persist } from "zustand/middleware";
|
|
5
|
+
|
|
6
|
+
const debug = debugB3React("useUserQuery");
|
|
7
|
+
|
|
8
|
+
interface UserStore {
|
|
9
|
+
user: Users | null;
|
|
10
|
+
setUser: (user: Users | undefined) => void;
|
|
11
|
+
clearUser: () => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Zustand store for managing user state
|
|
16
|
+
* Persists user data to localStorage
|
|
17
|
+
*/
|
|
18
|
+
export const useUserStore = create<UserStore>()(
|
|
19
|
+
persist(
|
|
20
|
+
set => ({
|
|
21
|
+
user: null,
|
|
22
|
+
setUser: (newUser: Users | undefined) => {
|
|
23
|
+
const userToSave = newUser ?? null;
|
|
24
|
+
set({ user: userToSave });
|
|
25
|
+
debug("User updated", userToSave);
|
|
26
|
+
},
|
|
27
|
+
clearUser: () => {
|
|
28
|
+
set({ user: null });
|
|
29
|
+
debug("User cleared");
|
|
30
|
+
},
|
|
31
|
+
}),
|
|
32
|
+
{
|
|
33
|
+
name: "b3-user",
|
|
34
|
+
onRehydrateStorage: () => (_, error) => {
|
|
35
|
+
if (error) {
|
|
36
|
+
console.warn("Failed to rehydrate user store:", error);
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
),
|
|
41
|
+
);
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { CreateOnrampOrderParams } from "../../../../anyspend/react/hooks/useAnyspendCreateOnrampOrder";
|
|
2
|
-
import { CreateOrderParams } from "../../../../anyspend/react/hooks/useAnyspendCreateOrder";
|
|
3
|
-
import { PermissionsConfig } from "../../../../global-account/types/permissions";
|
|
4
|
-
import { Account, Wallet } from "thirdweb/wallets";
|
|
5
|
-
import { ClientType } from "../../../client-manager";
|
|
6
|
-
/**
|
|
7
|
-
* Context type for B3Provider
|
|
8
|
-
*/
|
|
9
|
-
export interface B3ContextType {
|
|
10
|
-
account?: Account;
|
|
11
|
-
automaticallySetFirstEoa: boolean;
|
|
12
|
-
wallet?: Wallet;
|
|
13
|
-
initialized: boolean;
|
|
14
|
-
ready: boolean;
|
|
15
|
-
environment?: "development" | "production";
|
|
16
|
-
defaultPermissions?: PermissionsConfig;
|
|
17
|
-
theme: "light" | "dark";
|
|
18
|
-
clientType: ClientType;
|
|
19
|
-
partnerId: string;
|
|
20
|
-
stripePublishableKey?: string;
|
|
21
|
-
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
22
|
-
enableTurnkey?: boolean;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Context for B3 provider
|
|
26
|
-
*/
|
|
27
|
-
export declare const B3Context: import("react").Context<B3ContextType>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.B3Context = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
/**
|
|
6
|
-
* Context for B3 provider
|
|
7
|
-
*/
|
|
8
|
-
exports.B3Context = (0, react_1.createContext)({
|
|
9
|
-
account: undefined,
|
|
10
|
-
automaticallySetFirstEoa: false,
|
|
11
|
-
//user: undefined,
|
|
12
|
-
//setWallet: () => {},
|
|
13
|
-
wallet: undefined,
|
|
14
|
-
//setUser: () => {},
|
|
15
|
-
//refetchUser: async () => {},
|
|
16
|
-
initialized: false,
|
|
17
|
-
ready: false,
|
|
18
|
-
environment: "development",
|
|
19
|
-
theme: "light",
|
|
20
|
-
clientType: "rest",
|
|
21
|
-
partnerId: "",
|
|
22
|
-
createClientReferenceId: undefined,
|
|
23
|
-
enableTurnkey: false,
|
|
24
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { CreateOnrampOrderParams } from "../../../../anyspend/react/hooks/useAnyspendCreateOnrampOrder";
|
|
2
|
-
import { CreateOrderParams } from "../../../../anyspend/react/hooks/useAnyspendCreateOrder";
|
|
3
|
-
import { PermissionsConfig } from "../../../../global-account/types/permissions";
|
|
4
|
-
import { Account, Wallet } from "thirdweb/wallets";
|
|
5
|
-
import { ClientType } from "../../../client-manager";
|
|
6
|
-
/**
|
|
7
|
-
* Context type for B3Provider
|
|
8
|
-
*/
|
|
9
|
-
export interface B3ContextType {
|
|
10
|
-
account?: Account;
|
|
11
|
-
automaticallySetFirstEoa: boolean;
|
|
12
|
-
wallet?: Wallet;
|
|
13
|
-
initialized: boolean;
|
|
14
|
-
ready: boolean;
|
|
15
|
-
environment?: "development" | "production";
|
|
16
|
-
defaultPermissions?: PermissionsConfig;
|
|
17
|
-
theme: "light" | "dark";
|
|
18
|
-
clientType: ClientType;
|
|
19
|
-
partnerId: string;
|
|
20
|
-
stripePublishableKey?: string;
|
|
21
|
-
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
22
|
-
enableTurnkey?: boolean;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Context for B3 provider
|
|
26
|
-
*/
|
|
27
|
-
export declare const B3Context: import("react").Context<B3ContextType>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { createContext } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Context for B3 provider
|
|
4
|
-
*/
|
|
5
|
-
export const B3Context = createContext({
|
|
6
|
-
account: undefined,
|
|
7
|
-
automaticallySetFirstEoa: false,
|
|
8
|
-
//user: undefined,
|
|
9
|
-
//setWallet: () => {},
|
|
10
|
-
wallet: undefined,
|
|
11
|
-
//setUser: () => {},
|
|
12
|
-
//refetchUser: async () => {},
|
|
13
|
-
initialized: false,
|
|
14
|
-
ready: false,
|
|
15
|
-
environment: "development",
|
|
16
|
-
theme: "light",
|
|
17
|
-
clientType: "rest",
|
|
18
|
-
partnerId: "",
|
|
19
|
-
createClientReferenceId: undefined,
|
|
20
|
-
enableTurnkey: false,
|
|
21
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
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, Wallet } from "thirdweb/wallets";
|
|
5
|
-
import { ClientType } from "../../../client-manager";
|
|
6
|
-
/**
|
|
7
|
-
* Context type for B3Provider
|
|
8
|
-
*/
|
|
9
|
-
export interface B3ContextType {
|
|
10
|
-
account?: Account;
|
|
11
|
-
automaticallySetFirstEoa: boolean;
|
|
12
|
-
wallet?: Wallet;
|
|
13
|
-
initialized: boolean;
|
|
14
|
-
ready: boolean;
|
|
15
|
-
environment?: "development" | "production";
|
|
16
|
-
defaultPermissions?: PermissionsConfig;
|
|
17
|
-
theme: "light" | "dark";
|
|
18
|
-
clientType: ClientType;
|
|
19
|
-
partnerId: string;
|
|
20
|
-
stripePublishableKey?: string;
|
|
21
|
-
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
22
|
-
enableTurnkey?: boolean;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Context for B3 provider
|
|
26
|
-
*/
|
|
27
|
-
export declare const B3Context: import("react").Context<B3ContextType>;
|
|
@@ -1,50 +0,0 @@
|
|
|
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 { createContext } from "react";
|
|
5
|
-
import { Account, Wallet } from "thirdweb/wallets";
|
|
6
|
-
import { ClientType } from "../../../client-manager";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Context type for B3Provider
|
|
10
|
-
*/
|
|
11
|
-
export interface B3ContextType {
|
|
12
|
-
account?: Account;
|
|
13
|
-
automaticallySetFirstEoa: boolean;
|
|
14
|
-
//user?: Users;
|
|
15
|
-
//setWallet: (wallet: Wallet) => void;
|
|
16
|
-
wallet?: Wallet;
|
|
17
|
-
//setUser: (user?: Users) => void;
|
|
18
|
-
//refetchUser: () => Promise<any>;
|
|
19
|
-
initialized: boolean;
|
|
20
|
-
ready: boolean;
|
|
21
|
-
environment?: "development" | "production";
|
|
22
|
-
defaultPermissions?: PermissionsConfig;
|
|
23
|
-
theme: "light" | "dark";
|
|
24
|
-
clientType: ClientType;
|
|
25
|
-
partnerId: string;
|
|
26
|
-
stripePublishableKey?: string;
|
|
27
|
-
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
28
|
-
enableTurnkey?: boolean;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Context for B3 provider
|
|
33
|
-
*/
|
|
34
|
-
export const B3Context = createContext<B3ContextType>({
|
|
35
|
-
account: undefined,
|
|
36
|
-
automaticallySetFirstEoa: false,
|
|
37
|
-
//user: undefined,
|
|
38
|
-
//setWallet: () => {},
|
|
39
|
-
wallet: undefined,
|
|
40
|
-
//setUser: () => {},
|
|
41
|
-
//refetchUser: async () => {},
|
|
42
|
-
initialized: false,
|
|
43
|
-
ready: false,
|
|
44
|
-
environment: "development",
|
|
45
|
-
theme: "light",
|
|
46
|
-
clientType: "rest",
|
|
47
|
-
partnerId: "",
|
|
48
|
-
createClientReferenceId: undefined,
|
|
49
|
-
enableTurnkey: false,
|
|
50
|
-
});
|