@b3dotfun/sdk 0.1.69 → 0.1.70-alpha.2
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/rpc.d.ts +1 -1
- package/dist/cjs/anyspend/constants/rpc.js +1 -1
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/AnySpend.js +12 -4
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +2 -2
- 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 +2 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +7 -3
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +21 -14
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +12 -6
- package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendNFT.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/AnySpendNFT.js +4 -4
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +3 -3
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.js +3 -3
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendWorkflowTrigger.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/AnySpendWorkflowTrigger.js +2 -2
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +2 -2
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.js +2 -2
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckout.d.ts +5 -1
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckout.js +15 -6
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckoutTrigger.js +2 -2
- package/dist/cjs/anyspend/react/components/checkout/CartItemRow.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/checkout/CartSummary.d.ts +6 -4
- package/dist/cjs/anyspend/react/components/checkout/CartSummary.js +13 -11
- package/dist/cjs/anyspend/react/components/checkout/CheckoutCartPanel.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/CheckoutCartPanel.js +5 -4
- package/dist/cjs/anyspend/react/components/checkout/CheckoutFormPanel.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/CheckoutFormPanel.js +2 -2
- package/dist/cjs/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/CheckoutPaymentPanel.js +15 -7
- package/dist/cjs/anyspend/react/components/checkout/CheckoutSuccess.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/checkout/CheckoutSuccess.js +5 -3
- package/dist/cjs/anyspend/react/components/checkout/CryptoPayPanel.js +43 -23
- package/dist/cjs/anyspend/react/components/checkout/DiscountCodeInput.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/DiscountCodeInput.js +3 -6
- package/dist/cjs/anyspend/react/components/checkout/FiatCheckoutPanel.js +1 -2
- package/dist/cjs/anyspend/react/components/checkout/KycGate.js +1 -2
- package/dist/cjs/anyspend/react/components/checkout/PriceSkeleton.d.ts +5 -0
- package/dist/cjs/anyspend/react/components/checkout/PriceSkeleton.js +9 -0
- package/dist/cjs/anyspend/react/components/checkout/ShippingSelector.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/ShippingSelector.js +3 -2
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.d.ts +8 -0
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +10 -9
- package/dist/cjs/anyspend/react/components/common/InsufficientDepositPayment.js +2 -2
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +7 -2
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +2 -2
- package/dist/cjs/anyspend/react/components/common/OrderStatus.js +37 -6
- package/dist/cjs/anyspend/react/components/common/StepProgress.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/common/StepProgress.js +7 -2
- package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.js +2 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +4 -6
- package/dist/cjs/anyspend/react/hooks/useKycStatus.d.ts +3 -1
- package/dist/cjs/anyspend/react/hooks/useKycStatus.js +11 -7
- package/dist/cjs/anyspend/utils/chain.js +8 -7
- package/dist/cjs/app.shared.js +9 -7
- package/dist/cjs/global-account/better-auth-client.d.ts +1883 -0
- package/dist/cjs/global-account/better-auth-client.js +17 -0
- package/dist/cjs/global-account/bsmnt.d.ts +0 -1
- package/dist/cjs/global-account/bsmnt.js +0 -6
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +3 -1
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +5 -2
- package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +3 -1
- package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.js +2 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +4 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.js +2 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +11 -2
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +10 -13
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +6 -8
- package/dist/cjs/global-account/react/components/B3Provider/BetterAuthProvider.d.ts +16 -0
- package/dist/cjs/global-account/react/components/B3Provider/BetterAuthProvider.js +120 -0
- package/dist/cjs/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +3 -1
- package/dist/cjs/global-account/react/components/B3Provider/LocalSDKProvider.js +3 -1
- package/dist/cjs/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +3 -1
- package/dist/cjs/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +4 -2
- package/dist/cjs/global-account/react/components/LinkAccount/LinkedAccountItem.js +2 -1
- package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.js +4 -2
- package/dist/cjs/global-account/react/components/ManageAccount/Header.js +36 -4
- package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.js +4 -1
- package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +6 -0
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +17 -6
- package/dist/cjs/global-account/react/components/ManageAccount/SessionDurationContent.d.ts +5 -0
- package/dist/cjs/global-account/react/components/ManageAccount/SessionDurationContent.js +57 -0
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.js +14 -29
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +27 -16
- package/dist/cjs/global-account/react/components/Send/Send.js +5 -2
- package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthResetPassword.d.ts +21 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthResetPassword.js +68 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthSignIn.d.ts +39 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +173 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthVerifyEmail.d.ts +37 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthVerifyEmail.js +85 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +14 -4
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.d.ts +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +14 -5
- package/dist/cjs/global-account/react/components/SignInWithB3/components/AuthButton.js +10 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/components/PasswordInput.d.ts +10 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/components/PasswordInput.js +10 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.d.ts +8 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +141 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +96 -15
- package/dist/cjs/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +5 -3
- package/dist/cjs/global-account/react/components/SignInWithB3/utils/signInUtils.js +20 -3
- package/dist/cjs/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.js +2 -1
- package/dist/cjs/global-account/react/components/Toast/ToastContext.d.ts +3 -0
- package/dist/cjs/global-account/react/components/Toast/ToastContext.js +30 -7
- package/dist/cjs/global-account/react/components/UserAvatar/UserAvatar.d.ts +18 -0
- package/dist/cjs/global-account/react/components/UserAvatar/UserAvatar.js +27 -0
- package/dist/cjs/global-account/react/components/custom/Button.d.ts +1 -1
- package/dist/cjs/global-account/react/components/index.d.ts +5 -0
- package/dist/cjs/global-account/react/components/index.js +12 -3
- package/dist/cjs/global-account/react/components/ui/button.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/index.d.ts +1 -0
- package/dist/cjs/global-account/react/hooks/index.js +5 -2
- package/dist/cjs/global-account/react/hooks/useAuth.js +26 -15
- package/dist/cjs/global-account/react/hooks/useAuthentication.js +23 -12
- package/dist/cjs/global-account/react/hooks/useAutoSelectWallet.d.ts +6 -3
- package/dist/cjs/global-account/react/hooks/useAutoSelectWallet.js +31 -3
- package/dist/cjs/global-account/react/hooks/useBetterAuth.d.ts +973 -0
- package/dist/cjs/global-account/react/hooks/useBetterAuth.js +158 -0
- package/dist/cjs/global-account/react/hooks/useConnect.d.ts +2 -2
- package/dist/cjs/global-account/react/hooks/useFirstEOA.d.ts +8 -8
- package/dist/cjs/global-account/react/hooks/useTWAuth.js +0 -1
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +42 -1
- package/dist/cjs/global-account/react/utils/createWagmiConfig.d.ts +4 -31
- package/dist/cjs/global-account/react/utils/createWagmiConfig.js +5 -24
- package/dist/cjs/global-account/react/utils/index.d.ts +0 -1
- package/dist/cjs/global-account/react/utils/index.js +0 -1
- package/dist/cjs/global-account/react/utils/profileDisplay.js +17 -18
- package/dist/cjs/shared/constants/chains/b3Chain.d.ts +7 -7
- package/dist/cjs/shared/constants/chains/b3Chain.js +4 -4
- package/dist/cjs/shared/constants/chains/b3Viem.d.ts +6 -0
- package/dist/cjs/shared/constants/chains/b3Viem.js +19 -0
- package/dist/cjs/shared/constants/chains/supported.d.ts +1 -1
- package/dist/cjs/shared/constants/index.d.ts +1 -0
- package/dist/cjs/shared/constants/index.js +2 -1
- package/dist/cjs/shared/generated/chain-networks.json +2 -2
- package/dist/cjs/shared/utils/chains.d.ts +1 -1
- package/dist/cjs/shared/utils/chains.js +2 -2
- package/dist/cjs/shared/utils/session-duration.d.ts +15 -0
- package/dist/cjs/shared/utils/session-duration.js +69 -0
- package/dist/cjs/wallet/react/components/ConnectWallet.d.ts +11 -0
- package/dist/cjs/wallet/react/components/ConnectWallet.js +467 -0
- package/dist/cjs/wallet/react/components/WalletProvider.d.ts +35 -0
- package/dist/cjs/wallet/react/components/WalletProvider.js +20 -0
- package/dist/cjs/wallet/react/hooks/useWalletDisconnect.d.ts +13 -0
- package/dist/cjs/wallet/react/hooks/useWalletDisconnect.js +22 -0
- package/dist/cjs/wallet/react/hooks/useWalletState.d.ts +31 -0
- package/dist/cjs/wallet/react/hooks/useWalletState.js +63 -0
- package/dist/cjs/wallet/react/index.d.ts +5 -0
- package/dist/cjs/wallet/react/index.js +16 -0
- package/dist/cjs/wallet/utils/createWalletConfig.d.ts +21 -0
- package/dist/cjs/wallet/utils/createWalletConfig.js +24 -0
- package/dist/esm/anyspend/constants/rpc.d.ts +1 -1
- package/dist/esm/anyspend/constants/rpc.js +1 -1
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +2 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +12 -4
- package/dist/esm/anyspend/react/components/AnySpendBondKit.d.ts +1 -1
- package/dist/esm/anyspend/react/components/AnySpendBondKit.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +2 -2
- 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 +2 -0
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +7 -3
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +2 -0
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +21 -14
- package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +3 -1
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +13 -7
- package/dist/esm/anyspend/react/components/AnySpendDepositUpside.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendDepositUpside.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendNFT.d.ts +3 -1
- package/dist/esm/anyspend/react/components/AnySpendNFT.js +4 -4
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +4 -4
- package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.js +4 -4
- package/dist/esm/anyspend/react/components/AnySpendStakeUpside.d.ts +3 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeUpside.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendWorkflowTrigger.d.ts +3 -1
- package/dist/esm/anyspend/react/components/AnySpendWorkflowTrigger.js +2 -2
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +2 -2
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.js +2 -2
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckout.d.ts +5 -1
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckout.js +15 -6
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckoutTrigger.js +2 -2
- package/dist/esm/anyspend/react/components/checkout/CartItemRow.d.ts +2 -1
- package/dist/esm/anyspend/react/components/checkout/CartSummary.d.ts +6 -4
- package/dist/esm/anyspend/react/components/checkout/CartSummary.js +13 -11
- package/dist/esm/anyspend/react/components/checkout/CheckoutCartPanel.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/CheckoutCartPanel.js +5 -4
- package/dist/esm/anyspend/react/components/checkout/CheckoutFormPanel.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/CheckoutFormPanel.js +2 -2
- package/dist/esm/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/CheckoutPaymentPanel.js +16 -8
- package/dist/esm/anyspend/react/components/checkout/CheckoutSuccess.d.ts +2 -1
- package/dist/esm/anyspend/react/components/checkout/CheckoutSuccess.js +5 -3
- package/dist/esm/anyspend/react/components/checkout/CryptoPayPanel.js +44 -24
- package/dist/esm/anyspend/react/components/checkout/DiscountCodeInput.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/DiscountCodeInput.js +3 -6
- package/dist/esm/anyspend/react/components/checkout/FiatCheckoutPanel.js +2 -3
- package/dist/esm/anyspend/react/components/checkout/KycGate.js +2 -3
- package/dist/esm/anyspend/react/components/checkout/PriceSkeleton.d.ts +5 -0
- package/dist/esm/anyspend/react/components/checkout/PriceSkeleton.js +6 -0
- package/dist/esm/anyspend/react/components/checkout/ShippingSelector.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/ShippingSelector.js +3 -2
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.d.ts +8 -0
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +9 -8
- package/dist/esm/anyspend/react/components/common/InsufficientDepositPayment.js +2 -2
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +8 -3
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +2 -2
- package/dist/esm/anyspend/react/components/common/OrderStatus.js +34 -3
- package/dist/esm/anyspend/react/components/common/StepProgress.d.ts +2 -0
- package/dist/esm/anyspend/react/components/common/StepProgress.js +4 -2
- package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.js +2 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +5 -7
- package/dist/esm/anyspend/react/hooks/useKycStatus.d.ts +3 -1
- package/dist/esm/anyspend/react/hooks/useKycStatus.js +9 -5
- package/dist/esm/anyspend/utils/chain.js +10 -9
- package/dist/esm/app.shared.js +9 -7
- package/dist/esm/global-account/better-auth-client.d.ts +1883 -0
- package/dist/esm/global-account/better-auth-client.js +13 -0
- package/dist/esm/global-account/bsmnt.d.ts +0 -1
- package/dist/esm/global-account/bsmnt.js +0 -5
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +3 -1
- package/dist/esm/global-account/react/components/B3DynamicModal.js +5 -2
- package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +3 -1
- package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.js +2 -1
- package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +4 -1
- package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.js +2 -1
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +11 -2
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +5 -8
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +4 -6
- package/dist/esm/global-account/react/components/B3Provider/BetterAuthProvider.d.ts +16 -0
- package/dist/esm/global-account/react/components/B3Provider/BetterAuthProvider.js +115 -0
- package/dist/esm/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +3 -1
- package/dist/esm/global-account/react/components/B3Provider/LocalSDKProvider.js +3 -1
- package/dist/esm/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +3 -1
- package/dist/esm/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +4 -2
- package/dist/esm/global-account/react/components/LinkAccount/LinkedAccountItem.js +2 -1
- package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.js +5 -3
- package/dist/esm/global-account/react/components/ManageAccount/Header.js +37 -5
- package/dist/esm/global-account/react/components/ManageAccount/HomeContent.js +4 -1
- package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +7 -1
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +16 -8
- package/dist/esm/global-account/react/components/ManageAccount/SessionDurationContent.d.ts +5 -0
- package/dist/esm/global-account/react/components/ManageAccount/SessionDurationContent.js +52 -0
- package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.js +16 -31
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +27 -16
- package/dist/esm/global-account/react/components/Send/Send.js +5 -2
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthResetPassword.d.ts +21 -0
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthResetPassword.js +65 -0
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthSignIn.d.ts +39 -0
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +170 -0
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthVerifyEmail.d.ts +37 -0
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthVerifyEmail.js +82 -0
- package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +15 -5
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.d.ts +1 -1
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +14 -5
- package/dist/esm/global-account/react/components/SignInWithB3/components/AuthButton.js +11 -2
- package/dist/esm/global-account/react/components/SignInWithB3/components/PasswordInput.d.ts +10 -0
- package/dist/esm/global-account/react/components/SignInWithB3/components/PasswordInput.js +7 -0
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.d.ts +8 -0
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +138 -0
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +100 -19
- package/dist/esm/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +5 -3
- package/dist/esm/global-account/react/components/SignInWithB3/utils/signInUtils.js +19 -2
- package/dist/esm/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.js +2 -1
- package/dist/esm/global-account/react/components/Toast/ToastContext.d.ts +3 -0
- package/dist/esm/global-account/react/components/Toast/ToastContext.js +30 -7
- package/dist/esm/global-account/react/components/UserAvatar/UserAvatar.d.ts +18 -0
- package/dist/esm/global-account/react/components/UserAvatar/UserAvatar.js +21 -0
- package/dist/esm/global-account/react/components/custom/Button.d.ts +1 -1
- package/dist/esm/global-account/react/components/index.d.ts +5 -0
- package/dist/esm/global-account/react/components/index.js +5 -0
- package/dist/esm/global-account/react/components/ui/button.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/index.d.ts +1 -0
- package/dist/esm/global-account/react/hooks/index.js +1 -0
- package/dist/esm/global-account/react/hooks/useAuth.js +28 -17
- package/dist/esm/global-account/react/hooks/useAuthentication.js +24 -13
- package/dist/esm/global-account/react/hooks/useAutoSelectWallet.d.ts +6 -3
- package/dist/esm/global-account/react/hooks/useAutoSelectWallet.js +33 -5
- package/dist/esm/global-account/react/hooks/useBetterAuth.d.ts +973 -0
- package/dist/esm/global-account/react/hooks/useBetterAuth.js +150 -0
- package/dist/esm/global-account/react/hooks/useConnect.d.ts +2 -2
- package/dist/esm/global-account/react/hooks/useFirstEOA.d.ts +8 -8
- package/dist/esm/global-account/react/hooks/useTWAuth.js +0 -1
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +42 -1
- package/dist/esm/global-account/react/utils/createWagmiConfig.d.ts +4 -31
- package/dist/esm/global-account/react/utils/createWagmiConfig.js +5 -23
- package/dist/esm/global-account/react/utils/index.d.ts +0 -1
- package/dist/esm/global-account/react/utils/index.js +0 -1
- package/dist/esm/global-account/react/utils/profileDisplay.js +17 -18
- package/dist/esm/shared/constants/chains/b3Chain.d.ts +7 -7
- package/dist/esm/shared/constants/chains/b3Chain.js +4 -4
- package/dist/esm/shared/constants/chains/b3Viem.d.ts +6 -0
- package/dist/esm/shared/constants/chains/b3Viem.js +16 -0
- package/dist/esm/shared/constants/chains/supported.d.ts +1 -1
- package/dist/esm/shared/constants/index.d.ts +1 -0
- package/dist/esm/shared/constants/index.js +1 -0
- package/dist/esm/shared/generated/chain-networks.json +2 -2
- package/dist/esm/shared/utils/chains.d.ts +1 -1
- package/dist/esm/shared/utils/chains.js +2 -2
- package/dist/esm/shared/utils/session-duration.d.ts +15 -0
- package/dist/esm/shared/utils/session-duration.js +64 -0
- package/dist/esm/wallet/react/components/ConnectWallet.d.ts +11 -0
- package/dist/esm/wallet/react/components/ConnectWallet.js +431 -0
- package/dist/esm/wallet/react/components/WalletProvider.d.ts +35 -0
- package/dist/esm/wallet/react/components/WalletProvider.js +17 -0
- package/dist/esm/wallet/react/hooks/useWalletDisconnect.d.ts +13 -0
- package/dist/esm/wallet/react/hooks/useWalletDisconnect.js +19 -0
- package/dist/esm/wallet/react/hooks/useWalletState.d.ts +31 -0
- package/dist/esm/wallet/react/hooks/useWalletState.js +60 -0
- package/dist/esm/wallet/react/index.d.ts +5 -0
- package/dist/esm/wallet/react/index.js +8 -0
- package/dist/esm/wallet/utils/createWalletConfig.d.ts +21 -0
- package/dist/esm/wallet/utils/createWalletConfig.js +21 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/constants/rpc.d.ts +1 -1
- package/dist/types/anyspend/react/components/AnySpend.d.ts +2 -0
- package/dist/types/anyspend/react/components/AnySpendBondKit.d.ts +1 -1
- package/dist/types/anyspend/react/components/AnySpendBuySpin.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
- package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +2 -0
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +2 -0
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +3 -1
- package/dist/types/anyspend/react/components/AnySpendDepositUpside.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendNFT.d.ts +3 -1
- package/dist/types/anyspend/react/components/AnySpendStakeB3.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendStakeUpside.d.ts +3 -1
- package/dist/types/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendWorkflowTrigger.d.ts +3 -1
- package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnyspendSignatureMint.d.ts +2 -1
- package/dist/types/anyspend/react/components/checkout/AnySpendCheckout.d.ts +5 -1
- package/dist/types/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +3 -1
- package/dist/types/anyspend/react/components/checkout/CartItemRow.d.ts +2 -1
- package/dist/types/anyspend/react/components/checkout/CartSummary.d.ts +6 -4
- package/dist/types/anyspend/react/components/checkout/CheckoutCartPanel.d.ts +3 -1
- package/dist/types/anyspend/react/components/checkout/CheckoutFormPanel.d.ts +3 -1
- package/dist/types/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +3 -1
- package/dist/types/anyspend/react/components/checkout/CheckoutSuccess.d.ts +2 -1
- package/dist/types/anyspend/react/components/checkout/DiscountCodeInput.d.ts +3 -1
- package/dist/types/anyspend/react/components/checkout/PriceSkeleton.d.ts +5 -0
- package/dist/types/anyspend/react/components/checkout/ShippingSelector.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/CryptoPaymentMethod.d.ts +8 -0
- package/dist/types/anyspend/react/components/common/StepProgress.d.ts +2 -0
- package/dist/types/anyspend/react/hooks/useKycStatus.d.ts +3 -1
- package/dist/types/global-account/better-auth-client.d.ts +1883 -0
- package/dist/types/global-account/bsmnt.d.ts +0 -1
- package/dist/types/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +3 -1
- package/dist/types/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +4 -1
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +11 -2
- package/dist/types/global-account/react/components/B3Provider/BetterAuthProvider.d.ts +16 -0
- package/dist/types/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +3 -1
- package/dist/types/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +3 -1
- package/dist/types/global-account/react/components/ManageAccount/SessionDurationContent.d.ts +5 -0
- package/dist/types/global-account/react/components/SignInWithB3/BetterAuthResetPassword.d.ts +21 -0
- package/dist/types/global-account/react/components/SignInWithB3/BetterAuthSignIn.d.ts +39 -0
- package/dist/types/global-account/react/components/SignInWithB3/BetterAuthVerifyEmail.d.ts +37 -0
- package/dist/types/global-account/react/components/SignInWithB3/SignInWithB3Flow.d.ts +1 -1
- package/dist/types/global-account/react/components/SignInWithB3/components/PasswordInput.d.ts +10 -0
- package/dist/types/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.d.ts +8 -0
- package/dist/types/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +5 -3
- package/dist/types/global-account/react/components/Toast/ToastContext.d.ts +3 -0
- package/dist/types/global-account/react/components/UserAvatar/UserAvatar.d.ts +18 -0
- package/dist/types/global-account/react/components/custom/Button.d.ts +1 -1
- package/dist/types/global-account/react/components/index.d.ts +5 -0
- package/dist/types/global-account/react/components/ui/button.d.ts +1 -1
- package/dist/types/global-account/react/hooks/index.d.ts +1 -0
- package/dist/types/global-account/react/hooks/useAutoSelectWallet.d.ts +6 -3
- package/dist/types/global-account/react/hooks/useBetterAuth.d.ts +973 -0
- package/dist/types/global-account/react/hooks/useConnect.d.ts +2 -2
- package/dist/types/global-account/react/hooks/useFirstEOA.d.ts +8 -8
- package/dist/types/global-account/react/stores/useModalStore.d.ts +42 -1
- package/dist/types/global-account/react/utils/createWagmiConfig.d.ts +4 -31
- package/dist/types/global-account/react/utils/index.d.ts +0 -1
- package/dist/types/shared/constants/chains/b3Chain.d.ts +7 -7
- package/dist/types/shared/constants/chains/b3Viem.d.ts +6 -0
- package/dist/types/shared/constants/chains/supported.d.ts +1 -1
- package/dist/types/shared/constants/index.d.ts +1 -0
- package/dist/types/shared/utils/chains.d.ts +1 -1
- package/dist/types/shared/utils/session-duration.d.ts +15 -0
- package/dist/types/wallet/react/components/ConnectWallet.d.ts +11 -0
- package/dist/types/wallet/react/components/WalletProvider.d.ts +35 -0
- package/dist/types/wallet/react/hooks/useWalletDisconnect.d.ts +13 -0
- package/dist/types/wallet/react/hooks/useWalletState.d.ts +31 -0
- package/dist/types/wallet/react/index.d.ts +5 -0
- package/dist/types/wallet/utils/createWalletConfig.d.ts +21 -0
- package/package.json +15 -6
- package/src/anyspend/constants/rpc.ts +2 -1
- package/src/anyspend/react/components/AnySpend.tsx +24 -12
- package/src/anyspend/react/components/AnySpendBondKit.tsx +2 -0
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +3 -0
- package/src/anyspend/react/components/AnySpendCollectorClubPurchase.tsx +6 -0
- package/src/anyspend/react/components/AnySpendCustom.tsx +12 -2
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +29 -14
- package/src/anyspend/react/components/AnySpendDeposit.tsx +51 -34
- package/src/anyspend/react/components/AnySpendDepositUpside.tsx +3 -0
- package/src/anyspend/react/components/AnySpendNFT.tsx +6 -2
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +5 -2
- package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +5 -2
- package/src/anyspend/react/components/AnySpendStakeUpside.tsx +4 -0
- package/src/anyspend/react/components/AnySpendStakeUpsideExactIn.tsx +3 -0
- package/src/anyspend/react/components/AnySpendWorkflowTrigger.tsx +4 -0
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +3 -0
- package/src/anyspend/react/components/AnyspendSignatureMint.tsx +3 -0
- package/src/anyspend/react/components/checkout/AnySpendCheckout.tsx +29 -5
- package/src/anyspend/react/components/checkout/AnySpendCheckoutTrigger.tsx +4 -0
- package/src/anyspend/react/components/checkout/CartItemRow.tsx +2 -1
- package/src/anyspend/react/components/checkout/CartSummary.tsx +24 -20
- package/src/anyspend/react/components/checkout/CheckoutCartPanel.tsx +12 -3
- package/src/anyspend/react/components/checkout/CheckoutFormPanel.tsx +5 -0
- package/src/anyspend/react/components/checkout/CheckoutPaymentPanel.tsx +99 -83
- package/src/anyspend/react/components/checkout/CheckoutSuccess.tsx +13 -3
- package/src/anyspend/react/components/checkout/CryptoPayPanel.tsx +45 -27
- package/src/anyspend/react/components/checkout/DiscountCodeInput.tsx +15 -5
- package/src/anyspend/react/components/checkout/FiatCheckoutPanel.tsx +9 -3
- package/src/anyspend/react/components/checkout/KycGate.tsx +8 -3
- package/src/anyspend/react/components/checkout/PriceSkeleton.tsx +19 -0
- package/src/anyspend/react/components/checkout/ShippingSelector.tsx +5 -1
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +10 -8
- package/src/anyspend/react/components/common/InsufficientDepositPayment.tsx +2 -2
- package/src/anyspend/react/components/common/OrderDetails.tsx +10 -2
- package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +4 -4
- package/src/anyspend/react/components/common/OrderStatus.tsx +38 -3
- package/src/anyspend/react/components/common/StepProgress.tsx +15 -5
- package/src/anyspend/react/components/common/TransferCryptoDetails.tsx +2 -2
- package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +5 -7
- package/src/anyspend/react/hooks/useKycStatus.ts +8 -5
- package/src/anyspend/utils/chain.ts +9 -9
- package/src/app.shared.ts +9 -8
- package/src/global-account/better-auth-client.ts +17 -0
- package/src/global-account/bsmnt.ts +0 -6
- package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +3 -1
- package/src/global-account/react/components/B3DynamicModal.tsx +5 -2
- package/src/global-account/react/components/B3Provider/AuthenticationProvider.tsx +4 -0
- package/src/global-account/react/components/B3Provider/B3ConfigProvider.tsx +6 -0
- package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +16 -21
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +56 -37
- package/src/global-account/react/components/B3Provider/BetterAuthProvider.tsx +127 -0
- package/src/global-account/react/components/B3Provider/LocalSDKProvider.tsx +5 -0
- package/src/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.tsx +17 -10
- package/src/global-account/react/components/LinkAccount/LinkedAccountItem.tsx +2 -1
- package/src/global-account/react/components/ManageAccount/BottomNavigation.tsx +18 -14
- package/src/global-account/react/components/ManageAccount/Header.tsx +71 -4
- package/src/global-account/react/components/ManageAccount/HomeContent.tsx +25 -19
- package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +13 -0
- package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +40 -15
- package/src/global-account/react/components/ManageAccount/SessionDurationContent.tsx +107 -0
- package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +35 -54
- package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +31 -22
- package/src/global-account/react/components/Send/Send.tsx +8 -5
- package/src/global-account/react/components/SignInWithB3/BetterAuthResetPassword.tsx +145 -0
- package/src/global-account/react/components/SignInWithB3/BetterAuthSignIn.tsx +446 -0
- package/src/global-account/react/components/SignInWithB3/BetterAuthVerifyEmail.tsx +155 -0
- package/src/global-account/react/components/SignInWithB3/SignIn.tsx +42 -13
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +20 -4
- package/src/global-account/react/components/SignInWithB3/components/AuthButton.tsx +21 -2
- package/src/global-account/react/components/SignInWithB3/components/PasswordInput.tsx +62 -0
- package/src/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.tsx +315 -0
- package/src/global-account/react/components/SignInWithB3/steps/LoginStepCustom.tsx +207 -54
- package/src/global-account/react/components/SignInWithB3/utils/signInUtils.ts +24 -4
- package/src/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.tsx +2 -1
- package/src/global-account/react/components/Toast/ToastContext.tsx +39 -7
- package/src/global-account/react/components/UserAvatar/UserAvatar.tsx +45 -0
- package/src/global-account/react/components/index.ts +11 -0
- package/src/global-account/react/hooks/index.ts +1 -0
- package/src/global-account/react/hooks/useAuth.ts +28 -17
- package/src/global-account/react/hooks/useAuthentication.ts +24 -13
- package/src/global-account/react/hooks/useAutoSelectWallet.ts +40 -6
- package/src/global-account/react/hooks/useBetterAuth.ts +192 -0
- package/src/global-account/react/hooks/useConnect.tsx +2 -2
- package/src/global-account/react/hooks/useTWAuth.tsx +0 -1
- package/src/global-account/react/stores/useModalStore.ts +43 -0
- package/src/global-account/react/utils/createWagmiConfig.tsx +6 -25
- package/src/global-account/react/utils/index.ts +0 -1
- package/src/global-account/react/utils/profileDisplay.ts +21 -19
- package/src/shared/constants/chains/b3Chain.ts +5 -5
- package/src/shared/constants/chains/b3Viem.ts +18 -0
- package/src/shared/constants/index.ts +2 -0
- package/src/shared/generated/chain-networks.json +2 -2
- package/src/shared/utils/chains.ts +3 -2
- package/src/shared/utils/session-duration.ts +64 -0
- package/src/types/torph.d.ts +4 -0
- package/src/wallet/__tests__/createWalletConfig.test.ts +39 -0
- package/src/wallet/react/components/ConnectWallet.tsx +665 -0
- package/src/wallet/react/components/WalletProvider.tsx +64 -0
- package/src/wallet/react/hooks/useWalletDisconnect.ts +22 -0
- package/src/wallet/react/hooks/useWalletState.ts +93 -0
- package/src/wallet/react/index.ts +10 -0
- package/src/wallet/utils/createWalletConfig.ts +39 -0
- package/dist/cjs/global-account/react/components/AvatarCreator/AvatarCreator.d.ts +0 -6
- package/dist/cjs/global-account/react/components/AvatarCreator/AvatarCreator.js +0 -54
- package/dist/cjs/global-account/react/components/ProfileAvatar.d.ts +0 -0
- package/dist/cjs/global-account/react/components/ProfileAvatar.js +0 -127
- package/dist/cjs/global-account/react/hooks/useRPMToken.d.ts +0 -7
- package/dist/cjs/global-account/react/hooks/useRPMToken.js +0 -11
- package/dist/cjs/global-account/react/utils/updateAvatar.d.ts +0 -4
- package/dist/cjs/global-account/react/utils/updateAvatar.js +0 -54
- package/dist/esm/global-account/react/components/AvatarCreator/AvatarCreator.d.ts +0 -6
- package/dist/esm/global-account/react/components/AvatarCreator/AvatarCreator.js +0 -51
- package/dist/esm/global-account/react/components/ProfileAvatar.d.ts +0 -0
- package/dist/esm/global-account/react/components/ProfileAvatar.js +0 -127
- package/dist/esm/global-account/react/hooks/useRPMToken.d.ts +0 -7
- package/dist/esm/global-account/react/hooks/useRPMToken.js +0 -8
- package/dist/esm/global-account/react/utils/updateAvatar.d.ts +0 -4
- package/dist/esm/global-account/react/utils/updateAvatar.js +0 -18
- package/dist/types/global-account/react/components/AvatarCreator/AvatarCreator.d.ts +0 -6
- package/dist/types/global-account/react/components/ProfileAvatar.d.ts +0 -0
- package/dist/types/global-account/react/hooks/useRPMToken.d.ts +0 -7
- package/dist/types/global-account/react/utils/updateAvatar.d.ts +0 -4
- package/src/global-account/react/components/AvatarCreator/AvatarCreator.tsx +0 -90
- package/src/global-account/react/components/ProfileAvatar.tsx +0 -138
- package/src/global-account/react/hooks/useRPMToken.ts +0 -17
- package/src/global-account/react/utils/updateAvatar.ts +0 -21
|
@@ -6,7 +6,7 @@ import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
|
|
|
6
6
|
import { client } from "@b3dotfun/sdk/shared/utils/thirdweb";
|
|
7
7
|
import { ConnectionOptions } from "@thirdweb-dev/wagmi-adapter";
|
|
8
8
|
import { getConnectors } from "@wagmi/core";
|
|
9
|
-
import { useCallback, useContext, useEffect, useRef } from "react";
|
|
9
|
+
import { useCallback, useContext, useEffect, useMemo, useRef } from "react";
|
|
10
10
|
import {
|
|
11
11
|
useActiveWallet,
|
|
12
12
|
useAutoConnect,
|
|
@@ -18,7 +18,7 @@ import { Wallet, ecosystemWallet } from "thirdweb/wallets";
|
|
|
18
18
|
import { preAuthenticate } from "thirdweb/wallets/in-app";
|
|
19
19
|
import { useAccount, useConnect, useSwitchAccount } from "wagmi";
|
|
20
20
|
import { LocalSDKContext } from "../components/B3Provider/LocalSDKProvider";
|
|
21
|
-
import {
|
|
21
|
+
import { createWagmiConfig } from "../utils/createWagmiConfig";
|
|
22
22
|
import { useSearchParam } from "./useSearchParamsSSR";
|
|
23
23
|
import { useUserQuery } from "./useUserQuery";
|
|
24
24
|
|
|
@@ -30,7 +30,7 @@ const debug = debugB3React("useAuth");
|
|
|
30
30
|
* This hook provides 1:1 feature parity with useAuthentication.ts
|
|
31
31
|
*/
|
|
32
32
|
export function useAuth() {
|
|
33
|
-
const { onConnectCallback } = useContext(LocalSDKContext);
|
|
33
|
+
const { onConnectCallback, disableBSMNTAuthentication } = useContext(LocalSDKContext);
|
|
34
34
|
const { disconnect } = useDisconnect();
|
|
35
35
|
const wallets = useConnectedWallets();
|
|
36
36
|
const activeWallet = useActiveWallet();
|
|
@@ -47,7 +47,7 @@ export function useAuth() {
|
|
|
47
47
|
const useAutoConnectLoadingPrevious = useRef(false);
|
|
48
48
|
const referralCode = useSearchParam("referralCode");
|
|
49
49
|
const { partnerId } = useB3Config();
|
|
50
|
-
const wagmiConfig =
|
|
50
|
+
const wagmiConfig = useMemo(() => createWagmiConfig({ partnerId }), [partnerId]);
|
|
51
51
|
const { connect } = useConnect();
|
|
52
52
|
const activeWagmiAccount = useAccount();
|
|
53
53
|
const { switchAccount } = useSwitchAccount();
|
|
@@ -76,8 +76,10 @@ export function useAuth() {
|
|
|
76
76
|
|
|
77
77
|
// Authenticate with BSMNT
|
|
78
78
|
try {
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
if (!disableBSMNTAuthentication) {
|
|
80
|
+
const b3Jwt = await authenticateWithB3JWT(response.accessToken);
|
|
81
|
+
debug("BSMNT re-authentication successful", b3Jwt);
|
|
82
|
+
}
|
|
81
83
|
} catch (bsmntError) {
|
|
82
84
|
// BSMNT authentication failure shouldn't block the main auth flow
|
|
83
85
|
debug("BSMNT re-authentication failed (non-critical)", bsmntError);
|
|
@@ -88,7 +90,7 @@ export function useAuth() {
|
|
|
88
90
|
debug("Re-authentication failed", err);
|
|
89
91
|
throw err;
|
|
90
92
|
}
|
|
91
|
-
}, [setUser]);
|
|
93
|
+
}, [setUser, disableBSMNTAuthentication]);
|
|
92
94
|
|
|
93
95
|
const syncWagmi = useCallback(async () => {
|
|
94
96
|
function syncWagmiFunc() {
|
|
@@ -136,9 +138,7 @@ export function useAuth() {
|
|
|
136
138
|
});
|
|
137
139
|
}
|
|
138
140
|
syncWagmiFunc();
|
|
139
|
-
|
|
140
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
141
|
-
}, [partnerId, wallets]);
|
|
141
|
+
}, [wagmiConfig, wallets, connect, switchAccount]);
|
|
142
142
|
|
|
143
143
|
useEffect(() => {
|
|
144
144
|
syncWagmi();
|
|
@@ -159,9 +159,11 @@ export function useAuth() {
|
|
|
159
159
|
setIsAuthenticating(false);
|
|
160
160
|
debug("Re-authenticated successfully", { userAuth });
|
|
161
161
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
if (!disableBSMNTAuthentication) {
|
|
163
|
+
// Authenticate on BSMNT with B3 JWT
|
|
164
|
+
const b3Jwt = await authenticateWithB3JWT(userAuth.accessToken);
|
|
165
|
+
debug("@@b3Jwt", b3Jwt);
|
|
166
|
+
}
|
|
165
167
|
|
|
166
168
|
return userAuth;
|
|
167
169
|
} catch (error) {
|
|
@@ -171,7 +173,14 @@ export function useAuth() {
|
|
|
171
173
|
setIsAuthenticating(false);
|
|
172
174
|
throw new Error("Authentication required. Please authenticate.");
|
|
173
175
|
}
|
|
174
|
-
}, [
|
|
176
|
+
}, [
|
|
177
|
+
reAuthenticate,
|
|
178
|
+
setIsAuthenticated,
|
|
179
|
+
setIsAuthenticating,
|
|
180
|
+
setUser,
|
|
181
|
+
setHasStartedConnecting,
|
|
182
|
+
disableBSMNTAuthentication,
|
|
183
|
+
]);
|
|
175
184
|
|
|
176
185
|
/**
|
|
177
186
|
* Authenticate with B3
|
|
@@ -208,8 +217,10 @@ export function useAuth() {
|
|
|
208
217
|
|
|
209
218
|
// Step 3: Authenticate with BSMNT for basement integration
|
|
210
219
|
try {
|
|
211
|
-
|
|
212
|
-
|
|
220
|
+
if (!disableBSMNTAuthentication) {
|
|
221
|
+
const b3Jwt = await authenticateWithB3JWT(response.accessToken);
|
|
222
|
+
debug("BSMNT authentication successful", b3Jwt);
|
|
223
|
+
}
|
|
213
224
|
} catch (bsmntError) {
|
|
214
225
|
// BSMNT authentication failure shouldn't block the main auth flow
|
|
215
226
|
debug("BSMNT authentication failed (non-critical)", bsmntError);
|
|
@@ -221,7 +232,7 @@ export function useAuth() {
|
|
|
221
232
|
throw err;
|
|
222
233
|
}
|
|
223
234
|
},
|
|
224
|
-
[referralCode, setUser],
|
|
235
|
+
[referralCode, setUser, disableBSMNTAuthentication],
|
|
225
236
|
);
|
|
226
237
|
|
|
227
238
|
/**
|
|
@@ -6,7 +6,7 @@ import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
|
|
|
6
6
|
import { client } from "@b3dotfun/sdk/shared/utils/thirdweb";
|
|
7
7
|
import { ConnectionOptions } from "@thirdweb-dev/wagmi-adapter";
|
|
8
8
|
import { getConnectors } from "@wagmi/core";
|
|
9
|
-
import { useCallback, useContext, useEffect, useRef } from "react";
|
|
9
|
+
import { useCallback, useContext, useEffect, useMemo, useRef } from "react";
|
|
10
10
|
import {
|
|
11
11
|
useActiveWallet,
|
|
12
12
|
useAutoConnect,
|
|
@@ -25,7 +25,7 @@ import { useUserQuery } from "./useUserQuery";
|
|
|
25
25
|
const debug = debugB3React("useAuthentication");
|
|
26
26
|
|
|
27
27
|
export function useAuthentication(partnerId: string, { skipAutoConnect = false }: { skipAutoConnect?: boolean } = {}) {
|
|
28
|
-
const { onConnectCallback, onLogoutCallback } = useContext(LocalSDKContext);
|
|
28
|
+
const { onConnectCallback, onLogoutCallback, disableBSMNTAuthentication } = useContext(LocalSDKContext);
|
|
29
29
|
const { disconnect } = useDisconnect();
|
|
30
30
|
const wallets = useConnectedWallets();
|
|
31
31
|
// Keep refs so logout() always disconnects current wallets, not stale closure values.
|
|
@@ -57,7 +57,7 @@ export function useAuthentication(partnerId: string, { skipAutoConnect = false }
|
|
|
57
57
|
const { authenticate } = useTWAuth();
|
|
58
58
|
const { user, setUser } = useUserQuery();
|
|
59
59
|
const useAutoConnectLoadingPrevious = useRef(false);
|
|
60
|
-
const wagmiConfig = createWagmiConfig({ partnerId });
|
|
60
|
+
const wagmiConfig = useMemo(() => createWagmiConfig({ partnerId }), [partnerId]);
|
|
61
61
|
const { connect } = useConnect();
|
|
62
62
|
const activeWagmiAccount = useAccount();
|
|
63
63
|
const { switchAccount } = useSwitchAccount();
|
|
@@ -113,9 +113,7 @@ export function useAuthentication(partnerId: string, { skipAutoConnect = false }
|
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
syncWagmiFunc();
|
|
116
|
-
|
|
117
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
118
|
-
}, [partnerId, wallets]);
|
|
116
|
+
}, [wagmiConfig, wallets, connect, switchAccount]);
|
|
119
117
|
|
|
120
118
|
useEffect(() => {
|
|
121
119
|
syncWagmi();
|
|
@@ -142,9 +140,11 @@ export function useAuthentication(partnerId: string, { skipAutoConnect = false }
|
|
|
142
140
|
setIsAuthenticating(false);
|
|
143
141
|
debug("Re-authenticated successfully", { userAuth });
|
|
144
142
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
143
|
+
if (!disableBSMNTAuthentication) {
|
|
144
|
+
// Authenticate on BSMNT with B3 JWT
|
|
145
|
+
const b3Jwt = await authenticateWithB3JWT(userAuth.accessToken);
|
|
146
|
+
debug("@@b3Jwt", b3Jwt);
|
|
147
|
+
}
|
|
148
148
|
|
|
149
149
|
return userAuth;
|
|
150
150
|
} catch (error) {
|
|
@@ -156,14 +156,25 @@ export function useAuthentication(partnerId: string, { skipAutoConnect = false }
|
|
|
156
156
|
setIsAuthenticating(false);
|
|
157
157
|
debug("Fresh authentication successful", { userAuth });
|
|
158
158
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
if (!disableBSMNTAuthentication) {
|
|
160
|
+
// Authenticate on BSMNT with B3 JWT
|
|
161
|
+
const b3Jwt = await authenticateWithB3JWT(userAuth.accessToken);
|
|
162
|
+
debug("@@b3Jwt", b3Jwt);
|
|
163
|
+
}
|
|
162
164
|
|
|
163
165
|
return userAuth;
|
|
164
166
|
}
|
|
165
167
|
},
|
|
166
|
-
[
|
|
168
|
+
[
|
|
169
|
+
activeWallet,
|
|
170
|
+
partnerId,
|
|
171
|
+
authenticate,
|
|
172
|
+
setIsAuthenticated,
|
|
173
|
+
setIsAuthenticating,
|
|
174
|
+
setUser,
|
|
175
|
+
setHasStartedConnecting,
|
|
176
|
+
disableBSMNTAuthentication,
|
|
177
|
+
],
|
|
167
178
|
);
|
|
168
179
|
|
|
169
180
|
const logout = useCallback(
|
|
@@ -1,19 +1,53 @@
|
|
|
1
|
+
import { client } from "@b3dotfun/sdk/shared/utils/thirdweb";
|
|
1
2
|
import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
|
|
2
|
-
import { useCallback, useEffect } from "react";
|
|
3
|
-
import { getLastAuthProvider, useConnectedWallets, useSetActiveWallet } from "thirdweb/react";
|
|
4
|
-
import { Wallet } from "thirdweb/wallets";
|
|
3
|
+
import { useCallback, useEffect, useRef } from "react";
|
|
4
|
+
import { getLastAuthProvider, useAddConnectedWallet, useConnectedWallets, useSetActiveWallet } from "thirdweb/react";
|
|
5
|
+
import { EIP1193, Wallet } from "thirdweb/wallets";
|
|
5
6
|
import { useAuthStore } from "../stores";
|
|
6
7
|
|
|
7
8
|
const debug = debugB3React("useAutoSelectWallet");
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
|
-
* Hook to automatically
|
|
11
|
-
*
|
|
11
|
+
* Hook to automatically connect a default EOA provider (if given) and
|
|
12
|
+
* select the first EOA wallet when user is authenticated.
|
|
13
|
+
* Only auto-selects if the last auth was via wallet or no previous auth provider.
|
|
12
14
|
*/
|
|
13
|
-
export function useAutoSelectWallet({
|
|
15
|
+
export function useAutoSelectWallet({
|
|
16
|
+
enabled,
|
|
17
|
+
defaultEoaProvider,
|
|
18
|
+
}: {
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
defaultEoaProvider?: EIP1193.EIP1193Provider;
|
|
21
|
+
}) {
|
|
14
22
|
const isAuthenticated = useAuthStore(state => state.isAuthenticated);
|
|
15
23
|
const wallets = useConnectedWallets();
|
|
16
24
|
const setActiveWallet = useSetActiveWallet();
|
|
25
|
+
const addConnectedWallet = useAddConnectedWallet();
|
|
26
|
+
const hasConnectedProvider = useRef(false);
|
|
27
|
+
|
|
28
|
+
// Auto-connect the default EOA provider (e.g. Farcaster frame wallet) on mount.
|
|
29
|
+
// Uses useAddConnectedWallet instead of useConnect so the wallet is added to
|
|
30
|
+
// connectedWallets WITHOUT becoming the active wallet. This prevents
|
|
31
|
+
// useAuthentication's logout/onTimeout from disconnecting it (logout only
|
|
32
|
+
// disconnects ecosystem wallets and the active wallet).
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (!defaultEoaProvider || hasConnectedProvider.current) return;
|
|
35
|
+
hasConnectedProvider.current = true;
|
|
36
|
+
|
|
37
|
+
const connectDefaultProvider = async () => {
|
|
38
|
+
try {
|
|
39
|
+
const wallet = EIP1193.fromProvider({ provider: defaultEoaProvider });
|
|
40
|
+
await wallet.connect({ client });
|
|
41
|
+
addConnectedWallet(wallet);
|
|
42
|
+
debug("Auto-connected default EOA provider", wallet.id);
|
|
43
|
+
} catch (error) {
|
|
44
|
+
debug("Failed to auto-connect default EOA provider", error);
|
|
45
|
+
hasConnectedProvider.current = false;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
connectDefaultProvider();
|
|
50
|
+
}, [defaultEoaProvider, addConnectedWallet]);
|
|
17
51
|
|
|
18
52
|
const setWallet = useCallback(
|
|
19
53
|
(wallet: Wallet) => {
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import app from "@b3dotfun/sdk/global-account/app";
|
|
2
|
+
import { useAuthStore, useB3Config } from "@b3dotfun/sdk/global-account/react";
|
|
3
|
+
import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
|
|
4
|
+
import { useCallback } from "react";
|
|
5
|
+
import { betterAuthClient } from "../../better-auth-client";
|
|
6
|
+
import { useUserQuery } from "./useUserQuery";
|
|
7
|
+
|
|
8
|
+
const debug = debugB3React("useBetterAuth");
|
|
9
|
+
|
|
10
|
+
export type BetterAuthSocialProvider = "google" | "discord" | "apple" | "github" | "slack" | "microsoft";
|
|
11
|
+
|
|
12
|
+
/** Thrown when email verification is required before the user can sign in. */
|
|
13
|
+
export class EmailVerificationRequiredError extends Error {
|
|
14
|
+
constructor(message = "Check your email to verify your account before signing in.") {
|
|
15
|
+
super(message);
|
|
16
|
+
this.name = "EmailVerificationRequiredError";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Hook for authentication via Better Auth (email/password + social providers).
|
|
22
|
+
*
|
|
23
|
+
* Follows the same pattern as Thirdweb auth:
|
|
24
|
+
* 1. Better Auth sign-in returns a session token
|
|
25
|
+
* 2. Token is passed as accessToken to app.authenticate({ strategy: "better-auth" })
|
|
26
|
+
* 3. BetterAuthStrategy verifies the token and issues a Feathers JWT
|
|
27
|
+
*/
|
|
28
|
+
export function useBetterAuth() {
|
|
29
|
+
const { partnerId } = useB3Config();
|
|
30
|
+
const { setUser } = useUserQuery();
|
|
31
|
+
const setIsAuthenticated = useAuthStore(state => state.setIsAuthenticated);
|
|
32
|
+
const setIsAuthenticating = useAuthStore(state => state.setIsAuthenticating);
|
|
33
|
+
const setIsConnected = useAuthStore(state => state.setIsConnected);
|
|
34
|
+
const setHasStartedConnecting = useAuthStore(state => state.setHasStartedConnecting);
|
|
35
|
+
|
|
36
|
+
const exchangeForFeathersJWT = useCallback(
|
|
37
|
+
async (sessionToken: string) => {
|
|
38
|
+
debug("Exchanging Better Auth token for Feathers JWT");
|
|
39
|
+
|
|
40
|
+
const response = await app.authenticate({
|
|
41
|
+
strategy: "better-auth",
|
|
42
|
+
accessToken: sessionToken,
|
|
43
|
+
partnerId,
|
|
44
|
+
} as any);
|
|
45
|
+
|
|
46
|
+
if (!response.user) {
|
|
47
|
+
throw new Error("No user returned from authentication");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
setUser(response.user);
|
|
51
|
+
setIsAuthenticated(true);
|
|
52
|
+
setIsConnected(true);
|
|
53
|
+
setIsAuthenticating(false);
|
|
54
|
+
|
|
55
|
+
debug("Feathers JWT exchange successful", { userId: response.user?.userId });
|
|
56
|
+
return response;
|
|
57
|
+
},
|
|
58
|
+
[partnerId, setUser, setIsAuthenticated, setIsConnected, setIsAuthenticating],
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
const signInWithEmail = useCallback(
|
|
62
|
+
async (email: string, password: string) => {
|
|
63
|
+
debug("Signing in with email", { email });
|
|
64
|
+
setHasStartedConnecting(true);
|
|
65
|
+
setIsAuthenticating(true);
|
|
66
|
+
|
|
67
|
+
try {
|
|
68
|
+
const result = await betterAuthClient.signIn.email({ email, password });
|
|
69
|
+
|
|
70
|
+
if (result.error) {
|
|
71
|
+
throw new Error(result.error.message || "Sign in failed");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const token = result.data?.token;
|
|
75
|
+
if (!token) {
|
|
76
|
+
throw new Error("No session token returned from sign in");
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return await exchangeForFeathersJWT(token);
|
|
80
|
+
} catch (error) {
|
|
81
|
+
setIsAuthenticating(false);
|
|
82
|
+
debug("Sign in failed", error);
|
|
83
|
+
throw error;
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
[exchangeForFeathersJWT, setIsAuthenticating, setHasStartedConnecting],
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
const signUpWithEmail = useCallback(
|
|
90
|
+
async (email: string, password: string, name: string, verifyCallbackURL?: string) => {
|
|
91
|
+
debug("Signing up with email", { email, name });
|
|
92
|
+
setHasStartedConnecting(true);
|
|
93
|
+
setIsAuthenticating(true);
|
|
94
|
+
|
|
95
|
+
try {
|
|
96
|
+
const result = await betterAuthClient.signUp.email({ email, password, name });
|
|
97
|
+
|
|
98
|
+
if (result.error) {
|
|
99
|
+
throw new Error(result.error.message || "Sign up failed");
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const token = result.data?.token;
|
|
103
|
+
if (!token) {
|
|
104
|
+
// requireEmailVerification is enabled — send verification email with
|
|
105
|
+
// a callbackURL Better Auth redirects to after server-side verify.
|
|
106
|
+
// Pass verifyCallbackURL to land on a dedicated confirmation page.
|
|
107
|
+
await betterAuthClient.sendVerificationEmail({
|
|
108
|
+
email,
|
|
109
|
+
callbackURL: verifyCallbackURL || `${window.location.origin}?authStrategy=better-auth`,
|
|
110
|
+
});
|
|
111
|
+
throw new EmailVerificationRequiredError();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return await exchangeForFeathersJWT(token);
|
|
115
|
+
} catch (error) {
|
|
116
|
+
setIsAuthenticating(false);
|
|
117
|
+
debug("Sign up failed", error);
|
|
118
|
+
throw error;
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
[exchangeForFeathersJWT, setIsAuthenticating, setHasStartedConnecting],
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
const signInWithSocial = useCallback(
|
|
125
|
+
async (provider: BetterAuthSocialProvider) => {
|
|
126
|
+
debug("Signing in with social provider", { provider });
|
|
127
|
+
setHasStartedConnecting(true);
|
|
128
|
+
setIsAuthenticating(true);
|
|
129
|
+
|
|
130
|
+
try {
|
|
131
|
+
const result = await betterAuthClient.signIn.social({
|
|
132
|
+
provider,
|
|
133
|
+
callbackURL: window.location.href,
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
if (result.error) {
|
|
137
|
+
throw new Error(result.error.message || `${provider} sign in failed`);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Social auth redirects to provider — JWT exchange happens on callback
|
|
141
|
+
// via BetterAuthProvider session restore
|
|
142
|
+
} catch (error) {
|
|
143
|
+
setIsAuthenticating(false);
|
|
144
|
+
debug("Social sign in failed", error);
|
|
145
|
+
throw error;
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
[setIsAuthenticating, setHasStartedConnecting],
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
const requestPasswordReset = useCallback(async (email: string, redirectTo?: string) => {
|
|
152
|
+
debug("Requesting password reset", { email });
|
|
153
|
+
|
|
154
|
+
const result = await betterAuthClient.requestPasswordReset({
|
|
155
|
+
email,
|
|
156
|
+
redirectTo,
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
if (result.error) {
|
|
160
|
+
throw new Error(result.error.message || "Password reset request failed");
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
debug("Password reset email sent");
|
|
164
|
+
return result;
|
|
165
|
+
}, []);
|
|
166
|
+
|
|
167
|
+
const resetPassword = useCallback(async (newPassword: string, token: string) => {
|
|
168
|
+
debug("Resetting password");
|
|
169
|
+
|
|
170
|
+
const result = await betterAuthClient.resetPassword({
|
|
171
|
+
newPassword,
|
|
172
|
+
token,
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
if (result.error) {
|
|
176
|
+
throw new Error(result.error.message || "Password reset failed");
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
debug("Password reset successful");
|
|
180
|
+
return result;
|
|
181
|
+
}, []);
|
|
182
|
+
|
|
183
|
+
return {
|
|
184
|
+
signInWithEmail,
|
|
185
|
+
signUpWithEmail,
|
|
186
|
+
signInWithSocial,
|
|
187
|
+
requestPasswordReset,
|
|
188
|
+
resetPassword,
|
|
189
|
+
exchangeForFeathersJWT,
|
|
190
|
+
betterAuthClient,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
@@ -4,7 +4,7 @@ import { client } from "@b3dotfun/sdk/shared/utils/thirdweb";
|
|
|
4
4
|
import { useCallback, useState } from "react";
|
|
5
5
|
import { Chain } from "thirdweb";
|
|
6
6
|
import { useConnect as useConnectTW } from "thirdweb/react";
|
|
7
|
-
import { ecosystemWallet, SingleStepAuthArgsType } from "thirdweb/wallets";
|
|
7
|
+
import { ecosystemWallet, MultiStepAuthArgsType, SingleStepAuthArgsType } from "thirdweb/wallets";
|
|
8
8
|
const debug = debugB3React("useConnect");
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -23,7 +23,7 @@ export function useConnect(partnerId: string, chain?: Chain) {
|
|
|
23
23
|
* It is used to connect to a wallet using the thirdweb client.
|
|
24
24
|
*/
|
|
25
25
|
const connectTw = useCallback(
|
|
26
|
-
async (strategyOptions?: SingleStepAuthArgsType) => {
|
|
26
|
+
async (strategyOptions?: MultiStepAuthArgsType | SingleStepAuthArgsType) => {
|
|
27
27
|
setIsLoading(true);
|
|
28
28
|
return await connect(async () => {
|
|
29
29
|
if (!strategyOptions) throw new Error("Strategy options are required");
|
|
@@ -12,7 +12,6 @@ import { useSearchParam } from "./useSearchParamsSSR";
|
|
|
12
12
|
* @deprecated Use useAuth() instead
|
|
13
13
|
*/
|
|
14
14
|
export function useTWAuth() {
|
|
15
|
-
console.warn("useTWAuth is deprecated. Please migrate to useAuth() for authentication.");
|
|
16
15
|
const referralCode = useSearchParam("referralCode");
|
|
17
16
|
|
|
18
17
|
const authenticate = useCallback(
|
|
@@ -44,6 +44,8 @@ export interface SignInWithB3ModalProps extends BaseModalProps {
|
|
|
44
44
|
source?: "signInWithB3Button" | "requestPermissions";
|
|
45
45
|
/** Whether to show the signers enabled modal */
|
|
46
46
|
signersEnabled?: boolean;
|
|
47
|
+
/** URL Better Auth redirects to after server-side email verification. */
|
|
48
|
+
verifyEmailRedirectTo?: string;
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
/**
|
|
@@ -139,6 +141,8 @@ export interface AnySpendModalProps extends BaseModalProps {
|
|
|
139
141
|
disableUrlParamManagement?: boolean;
|
|
140
142
|
/** Staging environment support */
|
|
141
143
|
isStaging?: boolean;
|
|
144
|
+
/** Whether to show the "Pay with Fiat" tab. Defaults to true. When false, the fiat tab is hidden and activeTab is forced to "crypto". */
|
|
145
|
+
showFiatOption?: boolean;
|
|
142
146
|
}
|
|
143
147
|
|
|
144
148
|
/**
|
|
@@ -156,6 +160,8 @@ export interface AnySpendNftProps extends BaseModalProps {
|
|
|
156
160
|
onSuccess?: (txHash?: string) => void;
|
|
157
161
|
/** Client-provided reference ID for tracking orders */
|
|
158
162
|
clientReferenceId?: string;
|
|
163
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
164
|
+
showFiatOption?: boolean;
|
|
159
165
|
}
|
|
160
166
|
|
|
161
167
|
/**
|
|
@@ -234,6 +240,8 @@ export interface AnySpendStakeB3Props extends BaseModalProps {
|
|
|
234
240
|
stakeAmount?: string;
|
|
235
241
|
/** Callback function called when the stake is successful */
|
|
236
242
|
onSuccess?: () => void;
|
|
243
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
244
|
+
showFiatOption?: boolean;
|
|
237
245
|
}
|
|
238
246
|
|
|
239
247
|
/**
|
|
@@ -249,6 +257,8 @@ export interface AnySpendStakeB3ExactInProps extends BaseModalProps {
|
|
|
249
257
|
stakeAmount?: string;
|
|
250
258
|
/** Callback function called when the stake is successful */
|
|
251
259
|
onSuccess?: () => void;
|
|
260
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
261
|
+
showFiatOption?: boolean;
|
|
252
262
|
}
|
|
253
263
|
|
|
254
264
|
/**
|
|
@@ -270,6 +280,8 @@ export interface AnySpendStakeUpsideProps extends BaseModalProps {
|
|
|
270
280
|
activeTab?: "crypto" | "fiat";
|
|
271
281
|
/** Callback function called when the stake is successful */
|
|
272
282
|
onSuccess?: () => void;
|
|
283
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
284
|
+
showFiatOption?: boolean;
|
|
273
285
|
}
|
|
274
286
|
|
|
275
287
|
/**
|
|
@@ -287,6 +299,8 @@ export interface AnySpendStakeUpsideExactInProps extends BaseModalProps {
|
|
|
287
299
|
token: components["schemas"]["Token"];
|
|
288
300
|
/** Callback function called when the stake is successful */
|
|
289
301
|
onSuccess?: () => void;
|
|
302
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
303
|
+
showFiatOption?: boolean;
|
|
290
304
|
}
|
|
291
305
|
|
|
292
306
|
/**
|
|
@@ -310,6 +324,8 @@ export interface AnySpendDepositUpsideProps extends BaseModalProps {
|
|
|
310
324
|
destinationTokenAmount?: string;
|
|
311
325
|
/** Callback function called when the deposit is successful */
|
|
312
326
|
onSuccess?: () => void;
|
|
327
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
328
|
+
showFiatOption?: boolean;
|
|
313
329
|
}
|
|
314
330
|
|
|
315
331
|
/**
|
|
@@ -329,6 +345,8 @@ export interface AnySpendBuySpinProps extends BaseModalProps {
|
|
|
329
345
|
onSuccess?: (txHash?: string) => void;
|
|
330
346
|
/** Prefill quantity of spins to purchase */
|
|
331
347
|
prefillQuantity?: string;
|
|
348
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
349
|
+
showFiatOption?: boolean;
|
|
332
350
|
}
|
|
333
351
|
|
|
334
352
|
/**
|
|
@@ -344,6 +362,8 @@ export interface AnySpendSignatureMintProps extends BaseModalProps {
|
|
|
344
362
|
imageUrl?: string;
|
|
345
363
|
/** Callback function called when minting is successful */
|
|
346
364
|
onSuccess?: (txHash?: string) => void;
|
|
365
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
366
|
+
showFiatOption?: boolean;
|
|
347
367
|
}
|
|
348
368
|
|
|
349
369
|
/**
|
|
@@ -369,6 +389,8 @@ export interface AnySpendBondKitProps extends BaseModalProps {
|
|
|
369
389
|
b3Amount?: string;
|
|
370
390
|
/** Callback function called when purchase is successful */
|
|
371
391
|
onSuccess?: (txHash?: string) => void;
|
|
392
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
393
|
+
showFiatOption?: boolean;
|
|
372
394
|
}
|
|
373
395
|
|
|
374
396
|
export interface LinkAccountModalProps extends BaseModalProps {
|
|
@@ -418,6 +440,8 @@ export interface AnySpendDepositHypeProps extends BaseModalProps {
|
|
|
418
440
|
customRecipientLabel?: string;
|
|
419
441
|
/** Custom label for the return home button (overrides "Return to Home" / "Close") */
|
|
420
442
|
returnHomeLabel?: string;
|
|
443
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
444
|
+
showFiatOption?: boolean;
|
|
421
445
|
}
|
|
422
446
|
|
|
423
447
|
export interface AvatarEditorModalProps extends BaseModalProps {
|
|
@@ -451,6 +475,16 @@ export interface SendModalProps extends BaseModalProps {
|
|
|
451
475
|
onSuccess?: (txHash?: string) => void;
|
|
452
476
|
}
|
|
453
477
|
|
|
478
|
+
/**
|
|
479
|
+
* Props for the Session Duration modal
|
|
480
|
+
* Allows users to configure how long they stay signed in
|
|
481
|
+
*/
|
|
482
|
+
export interface SessionDurationModalProps extends BaseModalProps {
|
|
483
|
+
type: "sessionDuration";
|
|
484
|
+
partnerId: string;
|
|
485
|
+
chain: Chain;
|
|
486
|
+
}
|
|
487
|
+
|
|
454
488
|
/**
|
|
455
489
|
* Props for the Notifications modal
|
|
456
490
|
* Allows users to manage notification settings and channels
|
|
@@ -499,6 +533,8 @@ export interface AnySpendCollectorClubPurchaseProps extends BaseModalProps {
|
|
|
499
533
|
isStaging?: boolean;
|
|
500
534
|
/** Optional discount code to apply to the purchase */
|
|
501
535
|
discountCode?: string;
|
|
536
|
+
/** Whether to show the "Pay with fiat" tab. Defaults to true. */
|
|
537
|
+
showFiatOption?: boolean;
|
|
502
538
|
}
|
|
503
539
|
|
|
504
540
|
/**
|
|
@@ -557,6 +593,8 @@ export interface AnySpendCheckoutTriggerModalProps extends BaseModalProps {
|
|
|
557
593
|
returnUrl?: string;
|
|
558
594
|
/** Label for the return button */
|
|
559
595
|
returnLabel?: string;
|
|
596
|
+
/** Whether to show fiat payment options (card + coinbase). Defaults to true. */
|
|
597
|
+
showFiatOption?: boolean;
|
|
560
598
|
}
|
|
561
599
|
|
|
562
600
|
export interface AnySpendWorkflowTriggerModalProps extends BaseModalProps {
|
|
@@ -586,6 +624,8 @@ export interface AnySpendWorkflowTriggerModalProps extends BaseModalProps {
|
|
|
586
624
|
actionLabel?: string;
|
|
587
625
|
/** Custom class names */
|
|
588
626
|
classes?: AnySpendAllClasses;
|
|
627
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
628
|
+
showFiatOption?: boolean;
|
|
589
629
|
}
|
|
590
630
|
|
|
591
631
|
export interface AnySpendDepositModalProps extends BaseModalProps {
|
|
@@ -625,6 +665,8 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
|
|
|
625
665
|
actionLabel?: string;
|
|
626
666
|
/** Whether to show chain selection step. Defaults to true if sourceTokenChainId is not provided */
|
|
627
667
|
showChainSelection?: boolean;
|
|
668
|
+
/** Whether to show the "Fund with Fiat" option in the deposit options list. Defaults to true */
|
|
669
|
+
showFiatOption?: boolean;
|
|
628
670
|
/** Minimum pool size for filtering tokens (default: 1,000,000) */
|
|
629
671
|
minPoolSize?: number;
|
|
630
672
|
/** Custom title for chain selection step */
|
|
@@ -677,6 +719,7 @@ export type ModalContentType =
|
|
|
677
719
|
| DepositModalProps
|
|
678
720
|
| SendModalProps
|
|
679
721
|
| NotificationsModalProps
|
|
722
|
+
| SessionDurationModalProps
|
|
680
723
|
| AnySpendCollectorClubPurchaseProps
|
|
681
724
|
| AnySpendDepositModalProps
|
|
682
725
|
| AnySpendWorkflowTriggerModalProps
|