@b3dotfun/sdk 0.0.88-alpha.0 → 0.0.88-alpha.10
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
|
@@ -6,6 +6,7 @@ const react_1 = require("../../../../global-account/react");
|
|
|
6
6
|
const debug_1 = require("../../../../shared/utils/debug");
|
|
7
7
|
const react_2 = require("react");
|
|
8
8
|
const react_3 = require("thirdweb/react");
|
|
9
|
+
const TurnkeyAuthModal_1 = require("../TurnkeyAuthModal");
|
|
9
10
|
const SignInWithB3Privy_1 = require("./SignInWithB3Privy");
|
|
10
11
|
const LoginStep_1 = require("./steps/LoginStep");
|
|
11
12
|
const LoginStepCustom_1 = require("./steps/LoginStepCustom");
|
|
@@ -24,7 +25,9 @@ function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onE
|
|
|
24
25
|
const account = (0, react_3.useActiveAccount)();
|
|
25
26
|
const isAuthenticating = (0, react_1.useAuthStore)(state => state.isAuthenticating);
|
|
26
27
|
const isAuthenticated = (0, react_1.useAuthStore)(state => state.isAuthenticated);
|
|
28
|
+
const setIsAuthenticated = (0, react_1.useAuthStore)(state => state.setIsAuthenticated);
|
|
27
29
|
const isConnected = (0, react_1.useAuthStore)(state => state.isConnected);
|
|
30
|
+
const setIsConnected = (0, react_1.useAuthStore)(state => state.setIsConnected);
|
|
28
31
|
const setJustCompletedLogin = (0, react_1.useAuthStore)(state => state.setJustCompletedLogin);
|
|
29
32
|
const [refetchCount, setRefetchCount] = (0, react_2.useState)(0);
|
|
30
33
|
const [refetchError, setRefetchError] = (0, react_2.useState)(null);
|
|
@@ -57,7 +60,9 @@ function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onE
|
|
|
57
60
|
refetchSigners();
|
|
58
61
|
setRefetchQueued(false);
|
|
59
62
|
}, backoffDelay);
|
|
60
|
-
|
|
63
|
+
// State setters are stable and don't need to be in dependencies
|
|
64
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
|
+
}, [refetchCount, refetchSigners, onError, refetchQueued]);
|
|
61
66
|
// Extract the completion flow logic to be reused
|
|
62
67
|
const handlePostTurnkeyFlow = (0, react_2.useCallback)(() => {
|
|
63
68
|
debug("Running post-Turnkey flow logic");
|
|
@@ -126,6 +131,10 @@ function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onE
|
|
|
126
131
|
debug("Refetching user after Turnkey success...");
|
|
127
132
|
await refetchUser();
|
|
128
133
|
debug("User refetched successfully");
|
|
134
|
+
// Set authentication and connection state so UI updates properly
|
|
135
|
+
setIsAuthenticated(true);
|
|
136
|
+
setIsConnected(true);
|
|
137
|
+
setJustCompletedLogin(true);
|
|
129
138
|
// After user data is refreshed, close Turnkey modal and go back to sign-in flow
|
|
130
139
|
debug("Switching back to signInWithB3 modal");
|
|
131
140
|
setB3ModalContentType({
|
|
@@ -144,7 +153,6 @@ function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onE
|
|
|
144
153
|
// The useEffect will re-run with updated user data to complete the sign-in process
|
|
145
154
|
}, [
|
|
146
155
|
refetchUser,
|
|
147
|
-
setB3ModalContentType,
|
|
148
156
|
strategies,
|
|
149
157
|
onLoginSuccess,
|
|
150
158
|
onSessionKeySuccess,
|
|
@@ -155,6 +163,10 @@ function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onE
|
|
|
155
163
|
closeAfterLogin,
|
|
156
164
|
source,
|
|
157
165
|
signersEnabled,
|
|
166
|
+
setB3ModalContentType,
|
|
167
|
+
setIsAuthenticated,
|
|
168
|
+
setIsConnected,
|
|
169
|
+
setJustCompletedLogin,
|
|
158
170
|
]);
|
|
159
171
|
// Handle post-login flow after signers are loaded
|
|
160
172
|
(0, react_2.useEffect)(() => {
|
|
@@ -172,15 +184,20 @@ function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onE
|
|
|
172
184
|
if (closeAfterLogin) {
|
|
173
185
|
setJustCompletedLogin(true);
|
|
174
186
|
}
|
|
175
|
-
// Check if we should show Turnkey login form
|
|
176
|
-
//
|
|
187
|
+
// Check if we should show Turnkey login form as SECONDARY option (after wallet connection)
|
|
188
|
+
// This only applies when:
|
|
189
|
+
// - enableTurnkey={true} is set on B3Provider
|
|
190
|
+
// - NEXT_PUBLIC_TURNKEY_PRIMARY is NOT set to true (otherwise Turnkey shows as primary)
|
|
191
|
+
// - User just logged in AND hasn't completed Turnkey auth in this session
|
|
177
192
|
// For new users (!turnkeyId): Show email form
|
|
178
193
|
// For returning users (turnkeyId && turnkeyEmail): Auto-skip to OTP
|
|
179
194
|
// Also check that we're not already showing the Turnkey modal
|
|
180
195
|
const hasTurnkeyId = user?.partnerIds?.turnkeyId;
|
|
181
196
|
const hasTurnkeyEmail = !!user?.email;
|
|
182
197
|
const isTurnkeyModalCurrentlyOpen = contentType?.type === "turnkeyAuth";
|
|
198
|
+
const isTurnkeyPrimary = process.env.NEXT_PUBLIC_TURNKEY_PRIMARY === "true";
|
|
183
199
|
const shouldShowTurnkeyModal = enableTurnkey &&
|
|
200
|
+
!isTurnkeyPrimary &&
|
|
184
201
|
user &&
|
|
185
202
|
!turnkeyAuthCompleted &&
|
|
186
203
|
!isTurnkeyModalCurrentlyOpen &&
|
|
@@ -207,7 +224,9 @@ function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onE
|
|
|
207
224
|
// Normal flow continues after Turnkey auth is complete (or if not needed)
|
|
208
225
|
handlePostTurnkeyFlow();
|
|
209
226
|
}
|
|
210
|
-
},
|
|
227
|
+
},
|
|
228
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
229
|
+
[
|
|
211
230
|
signers,
|
|
212
231
|
isFetchingSigners,
|
|
213
232
|
partnerId,
|
|
@@ -223,11 +242,10 @@ function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onE
|
|
|
223
242
|
isAuthenticating,
|
|
224
243
|
isAuthenticated,
|
|
225
244
|
isOpen,
|
|
226
|
-
setJustCompletedLogin,
|
|
227
245
|
user,
|
|
228
246
|
enableTurnkey,
|
|
229
247
|
turnkeyAuthCompleted,
|
|
230
|
-
handleTurnkeySuccess,
|
|
248
|
+
// handleTurnkeySuccess, // This is causing infinite loops
|
|
231
249
|
contentType,
|
|
232
250
|
handlePostTurnkeyFlow,
|
|
233
251
|
]);
|
|
@@ -244,7 +262,9 @@ function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onE
|
|
|
244
262
|
if (closeAfterLogin && sessionKeyAdded) {
|
|
245
263
|
setB3ModalOpen(false);
|
|
246
264
|
}
|
|
247
|
-
|
|
265
|
+
// setB3ModalOpen is stable
|
|
266
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
267
|
+
}, [closeAfterLogin, sessionKeyAdded]);
|
|
248
268
|
const onSessionKeySuccessEnhanced = (0, react_2.useCallback)(() => {
|
|
249
269
|
onSessionKeySuccess?.();
|
|
250
270
|
setB3ModalContentType({
|
|
@@ -290,21 +310,57 @@ function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onE
|
|
|
290
310
|
if (refetchError) {
|
|
291
311
|
content = ((0, jsx_runtime_1.jsx)(LoginStep_1.LoginStepContainer, { partnerId: partnerId, children: (0, jsx_runtime_1.jsx)("div", { className: "p-4 text-center text-red-500", children: refetchError }) }));
|
|
292
312
|
}
|
|
293
|
-
else if (isAuthenticating || (isFetchingSigners && step === "login") || source === "requestPermissions") {
|
|
294
|
-
content = ((0, jsx_runtime_1.jsx)(LoginStep_1.LoginStepContainer, { partnerId: partnerId, children: (0, jsx_runtime_1.jsx)("div", { className: "my-8 flex min-h-[350px] items-center justify-center", children: (0, jsx_runtime_1.jsx)(react_1.Loading, { variant: "white", size: "lg" }) }) }));
|
|
295
|
-
}
|
|
296
313
|
else if (step === "login") {
|
|
297
|
-
//
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
//
|
|
303
|
-
|
|
314
|
+
// PRIORITY: If NEXT_PUBLIC_TURNKEY_PRIMARY is true, show Turnkey modal FIRST as the primary authentication option
|
|
315
|
+
// Setting NEXT_PUBLIC_TURNKEY_PRIMARY="true" implicitly enables Turnkey
|
|
316
|
+
const isTurnkeyPrimary = process.env.NEXT_PUBLIC_TURNKEY_PRIMARY === "true";
|
|
317
|
+
const shouldShowTurnkeyFirst = isTurnkeyPrimary && !turnkeyAuthCompleted;
|
|
318
|
+
if (shouldShowTurnkeyFirst) {
|
|
319
|
+
// Don't show loading spinner for Turnkey - let the modal handle its own loading state
|
|
320
|
+
// This prevents the infinite loop where isAuthenticating causes the modal to be replaced
|
|
321
|
+
debug("Showing Turnkey as primary authentication option", {
|
|
322
|
+
isTurnkeyPrimary,
|
|
323
|
+
turnkeyAuthCompleted,
|
|
324
|
+
isAuthenticated,
|
|
325
|
+
});
|
|
326
|
+
// Show Turnkey authentication as primary option
|
|
327
|
+
content = ((0, jsx_runtime_1.jsx)(LoginStep_1.LoginStepContainer, { partnerId: partnerId, children: (0, jsx_runtime_1.jsx)(TurnkeyAuthModal_1.TurnkeyAuthModal, { onSuccess: async (authenticatedUser) => {
|
|
328
|
+
debug("Turnkey authentication successful in primary flow", { authenticatedUser });
|
|
329
|
+
setTurnkeyAuthCompleted(true);
|
|
330
|
+
// After Turnkey auth, refetch user to get the full user object
|
|
331
|
+
await refetchUser();
|
|
332
|
+
// User is now authenticated via Turnkey
|
|
333
|
+
// Set both isAuthenticated and isConnected to true so UI updates properly
|
|
334
|
+
// Wallet connection is optional and can happen later for signing transactions
|
|
335
|
+
setIsAuthenticated(true);
|
|
336
|
+
setIsConnected(true);
|
|
337
|
+
setJustCompletedLogin(true);
|
|
338
|
+
// Call the login success callback
|
|
339
|
+
onLoginSuccess?.({});
|
|
340
|
+
}, onClose: () => {
|
|
341
|
+
// If user closes Turnkey modal, they can still use wallet connection as fallback
|
|
342
|
+
setTurnkeyAuthCompleted(true);
|
|
343
|
+
}, initialEmail: "", skipToOtp: false }) }));
|
|
304
344
|
}
|
|
305
345
|
else {
|
|
306
|
-
//
|
|
307
|
-
|
|
346
|
+
// Show loading spinner only if not in Turnkey flow
|
|
347
|
+
if (isAuthenticating || (isFetchingSigners && step === "login") || source === "requestPermissions") {
|
|
348
|
+
content = ((0, jsx_runtime_1.jsx)(LoginStep_1.LoginStepContainer, { partnerId: partnerId, children: (0, jsx_runtime_1.jsx)("div", { className: "my-8 flex min-h-[350px] items-center justify-center", children: (0, jsx_runtime_1.jsx)(react_1.Loading, { variant: "white", size: "lg" }) }) }));
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
// Custom strategy
|
|
352
|
+
if (strategies?.[0] === "privy") {
|
|
353
|
+
content = (0, jsx_runtime_1.jsx)(SignInWithB3Privy_1.SignInWithB3Privy, { onSuccess: handleLoginSuccess, chain: chain });
|
|
354
|
+
}
|
|
355
|
+
else if (strategies) {
|
|
356
|
+
// Strategies are explicitly provided
|
|
357
|
+
content = ((0, jsx_runtime_1.jsx)(LoginStepCustom_1.LoginStepCustom, { strategies: strategies, chain: chain, onSuccess: handleLoginSuccess, onError: onError, automaticallySetFirstEoa: !!automaticallySetFirstEoa }));
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
// Default to handle all strategies we support
|
|
361
|
+
content = (0, jsx_runtime_1.jsx)(LoginStep_1.LoginStep, { chain: chain, onSuccess: handleLoginSuccess, onError: onError });
|
|
362
|
+
}
|
|
363
|
+
}
|
|
308
364
|
}
|
|
309
365
|
}
|
|
310
366
|
return content;
|
|
@@ -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);
|
|
@@ -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
|
|
8
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "b3-root", id: id, "data-theme":
|
|
7
|
+
const { theme } = (0, useB3Config_1.useB3Config)();
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "b3-root", id: id, "data-theme": theme, children: children }));
|
|
9
9
|
}
|
|
@@ -80,5 +80,7 @@ function TurnkeyAuthModal({ onClose, onSuccess, initialEmail = "", skipToOtp = f
|
|
|
80
80
|
console.error("Failed to resend OTP:", err);
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
|
-
|
|
83
|
+
const isTurnkeyPrimary = process.env.NEXT_PUBLIC_TURNKEY_PRIMARY === "true";
|
|
84
|
+
const walletBrand = isTurnkeyPrimary ? "Smart Wallet" : "AnySpend Wallet";
|
|
85
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "font-neue-montreal p-8", children: [step === "email" && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("h2", { className: "mb-6 text-center text-2xl font-bold text-gray-900 dark:text-white", children: ["Setup your ", walletBrand] }), (0, jsx_runtime_1.jsxs)("div", { className: "mb-6 space-y-3 text-center text-sm text-gray-600 dark:text-gray-400", children: [(0, jsx_runtime_1.jsxs)("p", { children: [isTurnkeyPrimary ? "We use a secure," : "AnySpend uses a secure,", (0, jsx_runtime_1.jsx)("br", {}), "embedded wallet to fund your workflows."] }), (0, jsx_runtime_1.jsxs)("p", { children: ["Please provide an email address to secure", (0, jsx_runtime_1.jsx)("br", {}), "your wallet."] })] }), (0, jsx_runtime_1.jsxs)("form", { onSubmit: handleEmailSubmit, className: "space-y-4", children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("input", { type: "email", placeholder: "email", value: email, onChange: e => setEmail(e.target.value), required: true, disabled: isLoading, className: "w-full rounded-lg border border-gray-300 px-4 py-3 text-center text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20 disabled:cursor-not-allowed disabled:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:text-white dark:placeholder-gray-500" }) }), error && ((0, jsx_runtime_1.jsx)("div", { className: "rounded-md bg-red-50 p-3 text-sm text-red-800 dark:bg-red-900/20 dark:text-red-400", children: error })), (0, jsx_runtime_1.jsx)("button", { type: "submit", disabled: isLoading || !email, className: "w-full rounded-lg bg-blue-600 px-6 py-3 font-semibold text-white transition-all duration-200 hover:bg-blue-700 disabled:cursor-not-allowed disabled:bg-gray-300 dark:disabled:bg-gray-700", children: isLoading ? ((0, jsx_runtime_1.jsxs)("span", { className: "flex items-center justify-center gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent" }), "Sending..."] })) : ("Continue") })] })] })), step === "otp" && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("h2", { className: "mb-4 text-center text-2xl font-bold text-gray-900 dark:text-white", children: "2FA Security" }), (0, jsx_runtime_1.jsx)("div", { className: "mb-6 space-y-3 text-center text-sm text-gray-600 dark:text-gray-400", children: (0, jsx_runtime_1.jsxs)("p", { children: [isTurnkeyPrimary ? "We use a secure," : "AnySpend uses a secure,", (0, jsx_runtime_1.jsx)("br", {}), "embedded wallet to fund your workflows.", (0, jsx_runtime_1.jsx)("br", {}), "Please provide 2FA code sent to your email."] }) }), (0, jsx_runtime_1.jsxs)("form", { onSubmit: handleOtpSubmit, className: "space-y-4", children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("input", { type: "text", placeholder: "Enter code", value: otpCode, onChange: e => setOtpCode(e.target.value.toUpperCase()), required: true, disabled: isLoading, autoFocus: true, className: "w-full rounded-lg border border-gray-300 px-4 py-3 text-center font-mono text-lg uppercase tracking-wider text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20 disabled:cursor-not-allowed disabled:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:text-white dark:placeholder-gray-500", maxLength: 20 }) }), error && ((0, jsx_runtime_1.jsx)("div", { className: "rounded-md bg-red-50 p-3 text-sm text-red-800 dark:bg-red-900/20 dark:text-red-400", children: error })), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-2", children: [(0, jsx_runtime_1.jsx)("button", { type: "submit", disabled: isLoading || !otpCode, className: "w-full rounded-lg bg-blue-600 px-6 py-3 font-semibold text-white transition-all duration-200 hover:bg-blue-700 disabled:cursor-not-allowed disabled:bg-gray-300 dark:disabled:bg-gray-700", children: isLoading ? ((0, jsx_runtime_1.jsxs)("span", { className: "flex items-center justify-center gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent" }), "Verifying..."] })) : ("Confirm") }), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: handleResendOtp, disabled: isLoading, className: "text-sm text-blue-600 hover:text-blue-700 hover:underline disabled:cursor-not-allowed disabled:text-gray-400 dark:text-blue-400 dark:hover:text-blue-300", children: "Resend code" })] })] })] })), step === "success" && ((0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "mb-6 flex items-center justify-center", children: (0, jsx_runtime_1.jsx)("div", { className: "flex h-16 w-16 items-center justify-center rounded-full bg-green-100 dark:bg-green-900/20", children: (0, jsx_runtime_1.jsx)("svg", { className: "h-8 w-8 text-green-600 dark:text-green-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }) }) }), (0, jsx_runtime_1.jsx)("h2", { className: "mb-2 text-2xl font-bold text-gray-900 dark:text-white", children: "Successfully Authenticated!" }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Redirecting..." })] }))] }));
|
|
84
86
|
}
|
|
@@ -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";
|
|
@@ -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 =
|
|
8
|
-
exports.WalletImage = exports.useToastContext = exports.ToastProvider = exports.ToastContainer = exports.Toast =
|
|
6
|
+
exports.DialogDescription = 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.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.toast = 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 = void 0;
|
|
8
|
+
exports.WalletImage = exports.useToastContext = exports.ToastProvider = exports.ToastContainer = 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");
|
|
@@ -3,6 +3,7 @@ export { useAccountAssets } from "./useAccountAssets";
|
|
|
3
3
|
export { useAccountWallet } from "./useAccountWallet";
|
|
4
4
|
export { useAddTWSessionKey } from "./useAddTWSessionKey";
|
|
5
5
|
export { useAnalytics } from "./useAnalytics";
|
|
6
|
+
export { useAuth } from "./useAuth";
|
|
6
7
|
export { useAuthentication } from "./useAuthentication";
|
|
7
8
|
export { useB3BalanceFromAddresses } from "./useB3BalanceFromAddresses";
|
|
8
9
|
export { useB3EnsName } from "./useB3EnsName";
|
|
@@ -42,3 +43,4 @@ export { useTokensFromAddress } from "./useTokensFromAddress";
|
|
|
42
43
|
export { useTurnkeyAuth } from "./useTurnkeyAuth";
|
|
43
44
|
export { useUnifiedChainSwitchAndExecute } from "./useUnifiedChainSwitchAndExecute";
|
|
44
45
|
export { useURLParams } from "./useURLParams";
|
|
46
|
+
export { useUser } from "./useUser";
|
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.useURLParams = exports.useUnifiedChainSwitchAndExecute = exports.useTurnkeyAuth = exports.useTokensFromAddress = exports.useTokenPriceWithFallback = exports.useTokenPrice = exports.useTokenFromUrl = exports.useTokenData = exports.useTokenBalancesByChain = exports.useTokenBalanceDirect = exports.useTokenBalance = exports.useSiwe = 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.useAnalytics = exports.useAddTWSessionKey = exports.useAccountWallet = exports.useAccountAssets = exports.createWagmiConfig = void 0;
|
|
17
|
+
exports.useUser = exports.useURLParams = exports.useUnifiedChainSwitchAndExecute = exports.useTurnkeyAuth = exports.useTokensFromAddress = exports.useTokenPriceWithFallback = exports.useTokenPrice = exports.useTokenFromUrl = exports.useTokenData = exports.useTokenBalancesByChain = exports.useTokenBalanceDirect = exports.useTokenBalance = exports.useSiwe = 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
18
|
var createWagmiConfig_1 = require("../utils/createWagmiConfig");
|
|
19
19
|
Object.defineProperty(exports, "createWagmiConfig", { enumerable: true, get: function () { return createWagmiConfig_1.createWagmiConfig; } });
|
|
20
20
|
var useAccountAssets_1 = require("./useAccountAssets");
|
|
@@ -25,6 +25,8 @@ var useAddTWSessionKey_1 = require("./useAddTWSessionKey");
|
|
|
25
25
|
Object.defineProperty(exports, "useAddTWSessionKey", { enumerable: true, get: function () { return useAddTWSessionKey_1.useAddTWSessionKey; } });
|
|
26
26
|
var useAnalytics_1 = require("./useAnalytics");
|
|
27
27
|
Object.defineProperty(exports, "useAnalytics", { enumerable: true, get: function () { return useAnalytics_1.useAnalytics; } });
|
|
28
|
+
var useAuth_1 = require("./useAuth");
|
|
29
|
+
Object.defineProperty(exports, "useAuth", { enumerable: true, get: function () { return useAuth_1.useAuth; } });
|
|
28
30
|
var useAuthentication_1 = require("./useAuthentication");
|
|
29
31
|
Object.defineProperty(exports, "useAuthentication", { enumerable: true, get: function () { return useAuthentication_1.useAuthentication; } });
|
|
30
32
|
var useB3BalanceFromAddresses_1 = require("./useB3BalanceFromAddresses");
|
|
@@ -107,3 +109,5 @@ var useUnifiedChainSwitchAndExecute_1 = require("./useUnifiedChainSwitchAndExecu
|
|
|
107
109
|
Object.defineProperty(exports, "useUnifiedChainSwitchAndExecute", { enumerable: true, get: function () { return useUnifiedChainSwitchAndExecute_1.useUnifiedChainSwitchAndExecute; } });
|
|
108
110
|
var useURLParams_1 = require("./useURLParams");
|
|
109
111
|
Object.defineProperty(exports, "useURLParams", { enumerable: true, get: function () { return useURLParams_1.useURLParams; } });
|
|
112
|
+
var useUser_1 = require("./useUser");
|
|
113
|
+
Object.defineProperty(exports, "useUser", { enumerable: true, get: function () { return useUser_1.useUser; } });
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Wallet } from "thirdweb/wallets";
|
|
2
|
+
import { preAuthenticate } from "thirdweb/wallets/in-app";
|
|
3
|
+
/**
|
|
4
|
+
* Unified authentication hook that uses Turnkey for authentication
|
|
5
|
+
* This replaces the previous Thirdweb-based authentication
|
|
6
|
+
*
|
|
7
|
+
* This hook provides 1:1 feature parity with useAuthentication.ts
|
|
8
|
+
*/
|
|
9
|
+
export declare function useAuth(): {
|
|
10
|
+
authenticate: (turnkeySessionJwt: string, partnerId: string) => Promise<import("@feathersjs/authentication").AuthenticationResult>;
|
|
11
|
+
reAuthenticate: () => Promise<import("@feathersjs/authentication").AuthenticationResult>;
|
|
12
|
+
logout: (callback?: () => void) => Promise<void>;
|
|
13
|
+
isAuthenticated: boolean;
|
|
14
|
+
isReady: boolean;
|
|
15
|
+
isConnecting: boolean;
|
|
16
|
+
isConnected: boolean;
|
|
17
|
+
wallet: import("thirdweb/dist/types/wallets/in-app/core/wallet/types").EcosystemWallet;
|
|
18
|
+
preAuthenticate: typeof preAuthenticate;
|
|
19
|
+
connect: (_walleAutoConnectedWith: Wallet, allConnectedWallets: Wallet[]) => Promise<void>;
|
|
20
|
+
isAuthenticating: boolean;
|
|
21
|
+
onConnect: (_walleAutoConnectedWith: Wallet, allConnectedWallets: Wallet[]) => Promise<void>;
|
|
22
|
+
user: {
|
|
23
|
+
email?: string | undefined;
|
|
24
|
+
username?: string | undefined;
|
|
25
|
+
telNumber?: string | undefined;
|
|
26
|
+
ens?: string | undefined;
|
|
27
|
+
avatar?: string | undefined;
|
|
28
|
+
preferences?: {} | undefined;
|
|
29
|
+
referredBy?: string | {} | undefined;
|
|
30
|
+
sourceApp?: string | undefined;
|
|
31
|
+
referralCode?: string | undefined;
|
|
32
|
+
userGroups?: number[] | undefined;
|
|
33
|
+
isMigratedFromBSMNT?: boolean | undefined;
|
|
34
|
+
privyLinkedAccounts?: {
|
|
35
|
+
name?: string | undefined;
|
|
36
|
+
address?: string | undefined;
|
|
37
|
+
email?: string | undefined;
|
|
38
|
+
chain_type?: string | undefined;
|
|
39
|
+
lv?: number | undefined;
|
|
40
|
+
wallet_client_type?: string | undefined;
|
|
41
|
+
smart_wallet_type?: string | undefined;
|
|
42
|
+
subject?: string | undefined;
|
|
43
|
+
type: string;
|
|
44
|
+
}[] | undefined;
|
|
45
|
+
twProfiles?: {
|
|
46
|
+
type: string;
|
|
47
|
+
details: {
|
|
48
|
+
id?: string | undefined;
|
|
49
|
+
name?: string | undefined;
|
|
50
|
+
address?: string | undefined;
|
|
51
|
+
email?: string | undefined;
|
|
52
|
+
username?: string | undefined;
|
|
53
|
+
phone?: string | undefined;
|
|
54
|
+
fid?: string | undefined;
|
|
55
|
+
};
|
|
56
|
+
}[] | undefined;
|
|
57
|
+
turnkeySubOrgs?: {
|
|
58
|
+
hasDelegatedUser?: boolean | undefined;
|
|
59
|
+
subOrgId: string;
|
|
60
|
+
accounts: Record<string, any>[];
|
|
61
|
+
}[] | undefined;
|
|
62
|
+
_id: string | {};
|
|
63
|
+
userId: string;
|
|
64
|
+
smartAccountAddress: string;
|
|
65
|
+
createdAt: number;
|
|
66
|
+
updatedAt: number;
|
|
67
|
+
partnerIds: {
|
|
68
|
+
privyId?: string | undefined;
|
|
69
|
+
thirdwebId?: string | undefined;
|
|
70
|
+
turnkeyId?: string | undefined;
|
|
71
|
+
turnkeyOtpId?: string | undefined;
|
|
72
|
+
};
|
|
73
|
+
} | undefined;
|
|
74
|
+
refetchUser: () => Promise<import("@feathersjs/authentication").AuthenticationResult>;
|
|
75
|
+
setUser: (newUser?: import("@b3dotfun/b3-api").Users) => void;
|
|
76
|
+
};
|