@b3dotfun/sdk 0.1.69 → 0.1.70
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
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.EmailVerificationRequiredError = void 0;
|
|
7
|
+
exports.useBetterAuth = useBetterAuth;
|
|
8
|
+
const app_1 = __importDefault(require("../../../global-account/app"));
|
|
9
|
+
const react_1 = require("../../../global-account/react");
|
|
10
|
+
const debug_1 = require("../../../shared/utils/debug");
|
|
11
|
+
const react_2 = require("react");
|
|
12
|
+
const better_auth_client_1 = require("../../better-auth-client");
|
|
13
|
+
const useUserQuery_1 = require("./useUserQuery");
|
|
14
|
+
const debug = (0, debug_1.debugB3React)("useBetterAuth");
|
|
15
|
+
/** Thrown when email verification is required before the user can sign in. */
|
|
16
|
+
class EmailVerificationRequiredError extends Error {
|
|
17
|
+
constructor(message = "Check your email to verify your account before signing in.") {
|
|
18
|
+
super(message);
|
|
19
|
+
this.name = "EmailVerificationRequiredError";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.EmailVerificationRequiredError = EmailVerificationRequiredError;
|
|
23
|
+
/**
|
|
24
|
+
* Hook for authentication via Better Auth (email/password + social providers).
|
|
25
|
+
*
|
|
26
|
+
* Follows the same pattern as Thirdweb auth:
|
|
27
|
+
* 1. Better Auth sign-in returns a session token
|
|
28
|
+
* 2. Token is passed as accessToken to app.authenticate({ strategy: "better-auth" })
|
|
29
|
+
* 3. BetterAuthStrategy verifies the token and issues a Feathers JWT
|
|
30
|
+
*/
|
|
31
|
+
function useBetterAuth() {
|
|
32
|
+
const { partnerId } = (0, react_1.useB3Config)();
|
|
33
|
+
const { setUser } = (0, useUserQuery_1.useUserQuery)();
|
|
34
|
+
const setIsAuthenticated = (0, react_1.useAuthStore)(state => state.setIsAuthenticated);
|
|
35
|
+
const setIsAuthenticating = (0, react_1.useAuthStore)(state => state.setIsAuthenticating);
|
|
36
|
+
const setIsConnected = (0, react_1.useAuthStore)(state => state.setIsConnected);
|
|
37
|
+
const setHasStartedConnecting = (0, react_1.useAuthStore)(state => state.setHasStartedConnecting);
|
|
38
|
+
const exchangeForFeathersJWT = (0, react_2.useCallback)(async (sessionToken) => {
|
|
39
|
+
debug("Exchanging Better Auth token for Feathers JWT");
|
|
40
|
+
const response = await app_1.default.authenticate({
|
|
41
|
+
strategy: "better-auth",
|
|
42
|
+
accessToken: sessionToken,
|
|
43
|
+
partnerId,
|
|
44
|
+
});
|
|
45
|
+
if (!response.user) {
|
|
46
|
+
throw new Error("No user returned from authentication");
|
|
47
|
+
}
|
|
48
|
+
setUser(response.user);
|
|
49
|
+
setIsAuthenticated(true);
|
|
50
|
+
setIsConnected(true);
|
|
51
|
+
setIsAuthenticating(false);
|
|
52
|
+
debug("Feathers JWT exchange successful", { userId: response.user?.userId });
|
|
53
|
+
return response;
|
|
54
|
+
}, [partnerId, setUser, setIsAuthenticated, setIsConnected, setIsAuthenticating]);
|
|
55
|
+
const signInWithEmail = (0, react_2.useCallback)(async (email, password) => {
|
|
56
|
+
debug("Signing in with email", { email });
|
|
57
|
+
setHasStartedConnecting(true);
|
|
58
|
+
setIsAuthenticating(true);
|
|
59
|
+
try {
|
|
60
|
+
const result = await better_auth_client_1.betterAuthClient.signIn.email({ email, password });
|
|
61
|
+
if (result.error) {
|
|
62
|
+
throw new Error(result.error.message || "Sign in failed");
|
|
63
|
+
}
|
|
64
|
+
const token = result.data?.token;
|
|
65
|
+
if (!token) {
|
|
66
|
+
throw new Error("No session token returned from sign in");
|
|
67
|
+
}
|
|
68
|
+
return await exchangeForFeathersJWT(token);
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
setIsAuthenticating(false);
|
|
72
|
+
debug("Sign in failed", error);
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
}, [exchangeForFeathersJWT, setIsAuthenticating, setHasStartedConnecting]);
|
|
76
|
+
const signUpWithEmail = (0, react_2.useCallback)(async (email, password, name, verifyCallbackURL) => {
|
|
77
|
+
debug("Signing up with email", { email, name });
|
|
78
|
+
setHasStartedConnecting(true);
|
|
79
|
+
setIsAuthenticating(true);
|
|
80
|
+
try {
|
|
81
|
+
const result = await better_auth_client_1.betterAuthClient.signUp.email({ email, password, name });
|
|
82
|
+
if (result.error) {
|
|
83
|
+
throw new Error(result.error.message || "Sign up failed");
|
|
84
|
+
}
|
|
85
|
+
const token = result.data?.token;
|
|
86
|
+
if (!token) {
|
|
87
|
+
// requireEmailVerification is enabled — send verification email with
|
|
88
|
+
// a callbackURL Better Auth redirects to after server-side verify.
|
|
89
|
+
// Pass verifyCallbackURL to land on a dedicated confirmation page.
|
|
90
|
+
await better_auth_client_1.betterAuthClient.sendVerificationEmail({
|
|
91
|
+
email,
|
|
92
|
+
callbackURL: verifyCallbackURL || `${window.location.origin}?authStrategy=better-auth`,
|
|
93
|
+
});
|
|
94
|
+
throw new EmailVerificationRequiredError();
|
|
95
|
+
}
|
|
96
|
+
return await exchangeForFeathersJWT(token);
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
setIsAuthenticating(false);
|
|
100
|
+
debug("Sign up failed", error);
|
|
101
|
+
throw error;
|
|
102
|
+
}
|
|
103
|
+
}, [exchangeForFeathersJWT, setIsAuthenticating, setHasStartedConnecting]);
|
|
104
|
+
const signInWithSocial = (0, react_2.useCallback)(async (provider) => {
|
|
105
|
+
debug("Signing in with social provider", { provider });
|
|
106
|
+
setHasStartedConnecting(true);
|
|
107
|
+
setIsAuthenticating(true);
|
|
108
|
+
try {
|
|
109
|
+
const result = await better_auth_client_1.betterAuthClient.signIn.social({
|
|
110
|
+
provider,
|
|
111
|
+
callbackURL: window.location.href,
|
|
112
|
+
});
|
|
113
|
+
if (result.error) {
|
|
114
|
+
throw new Error(result.error.message || `${provider} sign in failed`);
|
|
115
|
+
}
|
|
116
|
+
// Social auth redirects to provider — JWT exchange happens on callback
|
|
117
|
+
// via BetterAuthProvider session restore
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
setIsAuthenticating(false);
|
|
121
|
+
debug("Social sign in failed", error);
|
|
122
|
+
throw error;
|
|
123
|
+
}
|
|
124
|
+
}, [setIsAuthenticating, setHasStartedConnecting]);
|
|
125
|
+
const requestPasswordReset = (0, react_2.useCallback)(async (email, redirectTo) => {
|
|
126
|
+
debug("Requesting password reset", { email });
|
|
127
|
+
const result = await better_auth_client_1.betterAuthClient.requestPasswordReset({
|
|
128
|
+
email,
|
|
129
|
+
redirectTo,
|
|
130
|
+
});
|
|
131
|
+
if (result.error) {
|
|
132
|
+
throw new Error(result.error.message || "Password reset request failed");
|
|
133
|
+
}
|
|
134
|
+
debug("Password reset email sent");
|
|
135
|
+
return result;
|
|
136
|
+
}, []);
|
|
137
|
+
const resetPassword = (0, react_2.useCallback)(async (newPassword, token) => {
|
|
138
|
+
debug("Resetting password");
|
|
139
|
+
const result = await better_auth_client_1.betterAuthClient.resetPassword({
|
|
140
|
+
newPassword,
|
|
141
|
+
token,
|
|
142
|
+
});
|
|
143
|
+
if (result.error) {
|
|
144
|
+
throw new Error(result.error.message || "Password reset failed");
|
|
145
|
+
}
|
|
146
|
+
debug("Password reset successful");
|
|
147
|
+
return result;
|
|
148
|
+
}, []);
|
|
149
|
+
return {
|
|
150
|
+
signInWithEmail,
|
|
151
|
+
signUpWithEmail,
|
|
152
|
+
signInWithSocial,
|
|
153
|
+
requestPasswordReset,
|
|
154
|
+
resetPassword,
|
|
155
|
+
exchangeForFeathersJWT,
|
|
156
|
+
betterAuthClient: better_auth_client_1.betterAuthClient,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Chain } from "thirdweb";
|
|
2
|
-
import { SingleStepAuthArgsType } from "thirdweb/wallets";
|
|
2
|
+
import { MultiStepAuthArgsType, SingleStepAuthArgsType } from "thirdweb/wallets";
|
|
3
3
|
/**
|
|
4
4
|
* This hook is used to connect to a wallet using the thirdweb client.
|
|
5
5
|
*/
|
|
6
6
|
export declare function useConnect(partnerId: string, chain?: Chain): {
|
|
7
|
-
connect: (strategyOptions?: SingleStepAuthArgsType) => Promise<import("thirdweb/wallets").Wallet | null>;
|
|
7
|
+
connect: (strategyOptions?: MultiStepAuthArgsType | SingleStepAuthArgsType) => Promise<import("thirdweb/wallets").Wallet | null>;
|
|
8
8
|
isLoading: boolean;
|
|
9
9
|
};
|
|
@@ -7451,8 +7451,10 @@ export declare function useFirstEOA(chain?: {
|
|
|
7451
7451
|
[x: `bool[${string}]`]: undefined;
|
|
7452
7452
|
[x: `bytes[${string}]`]: undefined;
|
|
7453
7453
|
[x: `bytes1[${string}]`]: undefined;
|
|
7454
|
-
[x: `
|
|
7454
|
+
[x: `bytes7[${string}]`]: undefined;
|
|
7455
|
+
[x: `bytes14[${string}]`]: undefined;
|
|
7455
7456
|
[x: `bytes30[${string}]`]: undefined;
|
|
7457
|
+
[x: `bytes5[${string}]`]: undefined;
|
|
7456
7458
|
[x: `bytes18[${string}]`]: undefined;
|
|
7457
7459
|
[x: `bytes6[${string}]`]: undefined;
|
|
7458
7460
|
[x: `bytes9[${string}]`]: undefined;
|
|
@@ -7460,12 +7462,10 @@ export declare function useFirstEOA(chain?: {
|
|
|
7460
7462
|
[x: `bytes10[${string}]`]: undefined;
|
|
7461
7463
|
[x: `bytes2[${string}]`]: undefined;
|
|
7462
7464
|
[x: `bytes3[${string}]`]: undefined;
|
|
7463
|
-
[x: `
|
|
7464
|
-
[x: `bytes7[${string}]`]: undefined;
|
|
7465
|
+
[x: `bytes4[${string}]`]: undefined;
|
|
7465
7466
|
[x: `bytes11[${string}]`]: undefined;
|
|
7466
7467
|
[x: `bytes12[${string}]`]: undefined;
|
|
7467
7468
|
[x: `bytes13[${string}]`]: undefined;
|
|
7468
|
-
[x: `bytes14[${string}]`]: undefined;
|
|
7469
7469
|
[x: `bytes15[${string}]`]: undefined;
|
|
7470
7470
|
[x: `bytes16[${string}]`]: undefined;
|
|
7471
7471
|
[x: `bytes17[${string}]`]: undefined;
|
|
@@ -7553,8 +7553,10 @@ export declare function useFirstEOA(chain?: {
|
|
|
7553
7553
|
bool?: undefined;
|
|
7554
7554
|
bytes?: undefined;
|
|
7555
7555
|
bytes1?: undefined;
|
|
7556
|
-
|
|
7556
|
+
bytes7?: undefined;
|
|
7557
|
+
bytes14?: undefined;
|
|
7557
7558
|
bytes30?: undefined;
|
|
7559
|
+
bytes5?: undefined;
|
|
7558
7560
|
bytes18?: undefined;
|
|
7559
7561
|
bytes6?: undefined;
|
|
7560
7562
|
bytes9?: undefined;
|
|
@@ -7562,12 +7564,10 @@ export declare function useFirstEOA(chain?: {
|
|
|
7562
7564
|
bytes10?: undefined;
|
|
7563
7565
|
bytes2?: undefined;
|
|
7564
7566
|
bytes3?: undefined;
|
|
7565
|
-
|
|
7566
|
-
bytes7?: undefined;
|
|
7567
|
+
bytes4?: undefined;
|
|
7567
7568
|
bytes11?: undefined;
|
|
7568
7569
|
bytes12?: undefined;
|
|
7569
7570
|
bytes13?: undefined;
|
|
7570
|
-
bytes14?: undefined;
|
|
7571
7571
|
bytes15?: undefined;
|
|
7572
7572
|
bytes16?: undefined;
|
|
7573
7573
|
bytes17?: undefined;
|
|
@@ -16,7 +16,6 @@ const useSearchParamsSSR_1 = require("./useSearchParamsSSR");
|
|
|
16
16
|
* @deprecated Use useAuth() instead
|
|
17
17
|
*/
|
|
18
18
|
function useTWAuth() {
|
|
19
|
-
console.warn("useTWAuth is deprecated. Please migrate to useAuth() for authentication.");
|
|
20
19
|
const referralCode = (0, useSearchParamsSSR_1.useSearchParam)("referralCode");
|
|
21
20
|
const authenticate = (0, react_1.useCallback)(async (wallet, partnerId) => {
|
|
22
21
|
if (!wallet || !wallet?.getAuthToken?.())
|
|
@@ -41,6 +41,8 @@ export interface SignInWithB3ModalProps extends BaseModalProps {
|
|
|
41
41
|
source?: "signInWithB3Button" | "requestPermissions";
|
|
42
42
|
/** Whether to show the signers enabled modal */
|
|
43
43
|
signersEnabled?: boolean;
|
|
44
|
+
/** URL Better Auth redirects to after server-side email verification. */
|
|
45
|
+
verifyEmailRedirectTo?: string;
|
|
44
46
|
}
|
|
45
47
|
/**
|
|
46
48
|
* Props for the Request Permissions modal
|
|
@@ -133,6 +135,8 @@ export interface AnySpendModalProps extends BaseModalProps {
|
|
|
133
135
|
disableUrlParamManagement?: boolean;
|
|
134
136
|
/** Staging environment support */
|
|
135
137
|
isStaging?: boolean;
|
|
138
|
+
/** Whether to show the "Pay with Fiat" tab. Defaults to true. When false, the fiat tab is hidden and activeTab is forced to "crypto". */
|
|
139
|
+
showFiatOption?: boolean;
|
|
136
140
|
}
|
|
137
141
|
/**
|
|
138
142
|
* Props for the AnySpend NFT modal
|
|
@@ -149,6 +153,8 @@ export interface AnySpendNftProps extends BaseModalProps {
|
|
|
149
153
|
onSuccess?: (txHash?: string) => void;
|
|
150
154
|
/** Client-provided reference ID for tracking orders */
|
|
151
155
|
clientReferenceId?: string;
|
|
156
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
157
|
+
showFiatOption?: boolean;
|
|
152
158
|
}
|
|
153
159
|
/**
|
|
154
160
|
* Props for the AnySpend tournament modal
|
|
@@ -222,6 +228,8 @@ export interface AnySpendStakeB3Props extends BaseModalProps {
|
|
|
222
228
|
stakeAmount?: string;
|
|
223
229
|
/** Callback function called when the stake is successful */
|
|
224
230
|
onSuccess?: () => void;
|
|
231
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
232
|
+
showFiatOption?: boolean;
|
|
225
233
|
}
|
|
226
234
|
/**
|
|
227
235
|
* Props for the AnySpend Stake B3 (Custom Exact In) modal
|
|
@@ -236,6 +244,8 @@ export interface AnySpendStakeB3ExactInProps extends BaseModalProps {
|
|
|
236
244
|
stakeAmount?: string;
|
|
237
245
|
/** Callback function called when the stake is successful */
|
|
238
246
|
onSuccess?: () => void;
|
|
247
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
248
|
+
showFiatOption?: boolean;
|
|
239
249
|
}
|
|
240
250
|
/**
|
|
241
251
|
* Props for the AnySpend Stake Contract modal
|
|
@@ -256,6 +266,8 @@ export interface AnySpendStakeUpsideProps extends BaseModalProps {
|
|
|
256
266
|
activeTab?: "crypto" | "fiat";
|
|
257
267
|
/** Callback function called when the stake is successful */
|
|
258
268
|
onSuccess?: () => void;
|
|
269
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
270
|
+
showFiatOption?: boolean;
|
|
259
271
|
}
|
|
260
272
|
/**
|
|
261
273
|
* Props for the AnySpend Stake Upside (Exact In) modal
|
|
@@ -272,6 +284,8 @@ export interface AnySpendStakeUpsideExactInProps extends BaseModalProps {
|
|
|
272
284
|
token: components["schemas"]["Token"];
|
|
273
285
|
/** Callback function called when the stake is successful */
|
|
274
286
|
onSuccess?: () => void;
|
|
287
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
288
|
+
showFiatOption?: boolean;
|
|
275
289
|
}
|
|
276
290
|
/**
|
|
277
291
|
* Props for the AnySpend Deposit Upside (Exact In) modal
|
|
@@ -294,6 +308,8 @@ export interface AnySpendDepositUpsideProps extends BaseModalProps {
|
|
|
294
308
|
destinationTokenAmount?: string;
|
|
295
309
|
/** Callback function called when the deposit is successful */
|
|
296
310
|
onSuccess?: () => void;
|
|
311
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
312
|
+
showFiatOption?: boolean;
|
|
297
313
|
}
|
|
298
314
|
/**
|
|
299
315
|
* Props for the AnySpend Buy Spin modal
|
|
@@ -312,6 +328,8 @@ export interface AnySpendBuySpinProps extends BaseModalProps {
|
|
|
312
328
|
onSuccess?: (txHash?: string) => void;
|
|
313
329
|
/** Prefill quantity of spins to purchase */
|
|
314
330
|
prefillQuantity?: string;
|
|
331
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
332
|
+
showFiatOption?: boolean;
|
|
315
333
|
}
|
|
316
334
|
/**
|
|
317
335
|
* Props for the AnySpend Signature Mint modal
|
|
@@ -326,6 +344,8 @@ export interface AnySpendSignatureMintProps extends BaseModalProps {
|
|
|
326
344
|
imageUrl?: string;
|
|
327
345
|
/** Callback function called when minting is successful */
|
|
328
346
|
onSuccess?: (txHash?: string) => void;
|
|
347
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
348
|
+
showFiatOption?: boolean;
|
|
329
349
|
}
|
|
330
350
|
/**
|
|
331
351
|
* Props for the AnySpend bondKit modal
|
|
@@ -350,6 +370,8 @@ export interface AnySpendBondKitProps extends BaseModalProps {
|
|
|
350
370
|
b3Amount?: string;
|
|
351
371
|
/** Callback function called when purchase is successful */
|
|
352
372
|
onSuccess?: (txHash?: string) => void;
|
|
373
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
374
|
+
showFiatOption?: boolean;
|
|
353
375
|
}
|
|
354
376
|
export interface LinkAccountModalProps extends BaseModalProps {
|
|
355
377
|
type: "linkAccount";
|
|
@@ -396,6 +418,8 @@ export interface AnySpendDepositHypeProps extends BaseModalProps {
|
|
|
396
418
|
customRecipientLabel?: string;
|
|
397
419
|
/** Custom label for the return home button (overrides "Return to Home" / "Close") */
|
|
398
420
|
returnHomeLabel?: string;
|
|
421
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
422
|
+
showFiatOption?: boolean;
|
|
399
423
|
}
|
|
400
424
|
export interface AvatarEditorModalProps extends BaseModalProps {
|
|
401
425
|
/** Modal type identifier */
|
|
@@ -425,6 +449,15 @@ export interface SendModalProps extends BaseModalProps {
|
|
|
425
449
|
/** Callback function called when send is successful */
|
|
426
450
|
onSuccess?: (txHash?: string) => void;
|
|
427
451
|
}
|
|
452
|
+
/**
|
|
453
|
+
* Props for the Session Duration modal
|
|
454
|
+
* Allows users to configure how long they stay signed in
|
|
455
|
+
*/
|
|
456
|
+
export interface SessionDurationModalProps extends BaseModalProps {
|
|
457
|
+
type: "sessionDuration";
|
|
458
|
+
partnerId: string;
|
|
459
|
+
chain: Chain;
|
|
460
|
+
}
|
|
428
461
|
/**
|
|
429
462
|
* Props for the Notifications modal
|
|
430
463
|
* Allows users to manage notification settings and channels
|
|
@@ -472,6 +505,8 @@ export interface AnySpendCollectorClubPurchaseProps extends BaseModalProps {
|
|
|
472
505
|
isStaging?: boolean;
|
|
473
506
|
/** Optional discount code to apply to the purchase */
|
|
474
507
|
discountCode?: string;
|
|
508
|
+
/** Whether to show the "Pay with fiat" tab. Defaults to true. */
|
|
509
|
+
showFiatOption?: boolean;
|
|
475
510
|
}
|
|
476
511
|
/**
|
|
477
512
|
* Props for the AnySpend Deposit modal
|
|
@@ -532,6 +567,8 @@ export interface AnySpendCheckoutTriggerModalProps extends BaseModalProps {
|
|
|
532
567
|
returnUrl?: string;
|
|
533
568
|
/** Label for the return button */
|
|
534
569
|
returnLabel?: string;
|
|
570
|
+
/** Whether to show fiat payment options (card + coinbase). Defaults to true. */
|
|
571
|
+
showFiatOption?: boolean;
|
|
535
572
|
}
|
|
536
573
|
export interface AnySpendWorkflowTriggerModalProps extends BaseModalProps {
|
|
537
574
|
/** Modal type identifier */
|
|
@@ -560,6 +597,8 @@ export interface AnySpendWorkflowTriggerModalProps extends BaseModalProps {
|
|
|
560
597
|
actionLabel?: string;
|
|
561
598
|
/** Custom class names */
|
|
562
599
|
classes?: AnySpendAllClasses;
|
|
600
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
601
|
+
showFiatOption?: boolean;
|
|
563
602
|
}
|
|
564
603
|
export interface AnySpendDepositModalProps extends BaseModalProps {
|
|
565
604
|
/** Modal type identifier */
|
|
@@ -600,6 +639,8 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
|
|
|
600
639
|
actionLabel?: string;
|
|
601
640
|
/** Whether to show chain selection step. Defaults to true if sourceTokenChainId is not provided */
|
|
602
641
|
showChainSelection?: boolean;
|
|
642
|
+
/** Whether to show the "Fund with Fiat" option in the deposit options list. Defaults to true */
|
|
643
|
+
showFiatOption?: boolean;
|
|
603
644
|
/** Minimum pool size for filtering tokens (default: 1,000,000) */
|
|
604
645
|
minPoolSize?: number;
|
|
605
646
|
/** Custom title for chain selection step */
|
|
@@ -626,7 +667,7 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
|
|
|
626
667
|
/**
|
|
627
668
|
* Union type of all possible modal content types
|
|
628
669
|
*/
|
|
629
|
-
export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | AnySpendCollectorClubPurchaseProps | AnySpendDepositModalProps | AnySpendWorkflowTriggerModalProps | AnySpendCheckoutTriggerModalProps;
|
|
670
|
+
export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | SessionDurationModalProps | AnySpendCollectorClubPurchaseProps | AnySpendDepositModalProps | AnySpendWorkflowTriggerModalProps | AnySpendCheckoutTriggerModalProps;
|
|
630
671
|
/**
|
|
631
672
|
* State interface for the modal store
|
|
632
673
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CreateConnectorFn } from "wagmi";
|
|
2
2
|
export interface CreateWagmiConfigOptions {
|
|
3
3
|
partnerId: string;
|
|
4
4
|
rpcUrls?: Record<number, string>;
|
|
@@ -6,7 +6,8 @@ export interface CreateWagmiConfigOptions {
|
|
|
6
6
|
overrideDefaultConnectors?: boolean;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* Creates a wagmi config with
|
|
9
|
+
* Creates a wagmi config with the B3 ecosystem wallet connector.
|
|
10
|
+
* Delegates to createWalletConfig and adds the ecosystem connector on top.
|
|
10
11
|
* @param options.partnerId - Partner ID for the ecosystem wallet
|
|
11
12
|
* @param options.rpcUrls - Optional mapping of chain IDs to RPC URLs
|
|
12
13
|
* @param options.connectors - Additional connectors to include
|
|
@@ -14,32 +15,4 @@ export interface CreateWagmiConfigOptions {
|
|
|
14
15
|
*/
|
|
15
16
|
export declare function createWagmiConfig(options: CreateWagmiConfigOptions): import("wagmi").Config<readonly [import("viem").Chain, ...import("viem").Chain[]], {
|
|
16
17
|
[k: string]: import("viem").HttpTransport<undefined, false>;
|
|
17
|
-
},
|
|
18
|
-
connect<withCapabilities extends boolean = false>(parameters?: import("@thirdweb-dev/wagmi-adapter").ConnectionOptions<withCapabilities> | undefined): Promise<{
|
|
19
|
-
accounts: withCapabilities extends true ? readonly {
|
|
20
|
-
address: `0x${string}`;
|
|
21
|
-
capabilities: Record<string, unknown>;
|
|
22
|
-
}[] : readonly `0x${string}`[];
|
|
23
|
-
chainId: number;
|
|
24
|
-
}>;
|
|
25
|
-
}, {
|
|
26
|
-
"thirdweb:lastChainId": number;
|
|
27
|
-
}>)[]>;
|
|
28
|
-
/**
|
|
29
|
-
* Returns a cached wagmi config for the given partnerId.
|
|
30
|
-
* Use this instead of calling createWagmiConfig() directly inside React components or hooks
|
|
31
|
-
* to avoid registering duplicate EventEmitter listeners on every render.
|
|
32
|
-
*/
|
|
33
|
-
export declare function getCachedWagmiConfig(options: CreateWagmiConfigOptions): import("wagmi").Config<readonly [import("viem").Chain, ...import("viem").Chain[]], {
|
|
34
|
-
[k: string]: import("viem").HttpTransport<undefined, false>;
|
|
35
|
-
}, (CreateConnectorFn | CreateConnectorFn<import("thirdweb/dist/types/adapters/eip1193").EIP1193Provider | undefined, {
|
|
36
|
-
connect<withCapabilities extends boolean = false>(parameters?: import("@thirdweb-dev/wagmi-adapter").ConnectionOptions<withCapabilities> | undefined): Promise<{
|
|
37
|
-
accounts: withCapabilities extends true ? readonly {
|
|
38
|
-
address: `0x${string}`;
|
|
39
|
-
capabilities: Record<string, unknown>;
|
|
40
|
-
}[] : readonly `0x${string}`[];
|
|
41
|
-
chainId: number;
|
|
42
|
-
}>;
|
|
43
|
-
}, {
|
|
44
|
-
"thirdweb:lastChainId": number;
|
|
45
|
-
}>)[]>;
|
|
18
|
+
}, CreateConnectorFn[]>;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createWagmiConfig = createWagmiConfig;
|
|
4
|
-
|
|
4
|
+
const createWalletConfig_1 = require("../../../wallet/utils/createWalletConfig");
|
|
5
5
|
const constants_1 = require("../../../shared/constants");
|
|
6
|
-
const supported_1 = require("../../../shared/constants/chains/supported");
|
|
7
6
|
const thirdweb_1 = require("../../../shared/utils/thirdweb");
|
|
8
7
|
const wagmi_adapter_1 = require("@thirdweb-dev/wagmi-adapter");
|
|
9
|
-
const viem_1 = require("viem");
|
|
10
|
-
const wagmi_1 = require("wagmi");
|
|
11
8
|
/**
|
|
12
|
-
* Creates a wagmi config with
|
|
9
|
+
* Creates a wagmi config with the B3 ecosystem wallet connector.
|
|
10
|
+
* Delegates to createWalletConfig and adds the ecosystem connector on top.
|
|
13
11
|
* @param options.partnerId - Partner ID for the ecosystem wallet
|
|
14
12
|
* @param options.rpcUrls - Optional mapping of chain IDs to RPC URLs
|
|
15
13
|
* @param options.connectors - Additional connectors to include
|
|
@@ -25,25 +23,8 @@ function createWagmiConfig(options) {
|
|
|
25
23
|
}),
|
|
26
24
|
];
|
|
27
25
|
const finalConnectors = overrideDefaultConnectors ? connectors : [...defaultConnectors, ...connectors];
|
|
28
|
-
return (0,
|
|
29
|
-
chains: [supported_1.supportedChains[0], ...supported_1.supportedChains.slice(1)],
|
|
30
|
-
transports: Object.fromEntries(supported_1.supportedChains.map(chain => [chain.id, (0, viem_1.http)(rpcUrls?.[chain.id])])),
|
|
26
|
+
return (0, createWalletConfig_1.createWalletConfig)({
|
|
31
27
|
connectors: finalConnectors,
|
|
28
|
+
rpcUrls,
|
|
32
29
|
});
|
|
33
30
|
}
|
|
34
|
-
/** Module-level cache — wagmi configs must not be recreated on every render. */
|
|
35
|
-
const wagmiConfigCache = new Map();
|
|
36
|
-
/**
|
|
37
|
-
* Returns a cached wagmi config for the given partnerId.
|
|
38
|
-
* Use this instead of calling createWagmiConfig() directly inside React components or hooks
|
|
39
|
-
* to avoid registering duplicate EventEmitter listeners on every render.
|
|
40
|
-
*/
|
|
41
|
-
function getCachedWagmiConfig(options) {
|
|
42
|
-
const key = options.partnerId;
|
|
43
|
-
let config = wagmiConfigCache.get(key);
|
|
44
|
-
if (!config) {
|
|
45
|
-
config = createWagmiConfig(options);
|
|
46
|
-
wagmiConfigCache.set(key, config);
|
|
47
|
-
}
|
|
48
|
-
return config;
|
|
49
|
-
}
|
|
@@ -17,4 +17,3 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./notificationsAPI"), exports);
|
|
18
18
|
__exportStar(require("./profileDisplay"), exports);
|
|
19
19
|
__exportStar(require("./toast"), exports);
|
|
20
|
-
__exportStar(require("./updateAvatar"), exports);
|
|
@@ -4,6 +4,18 @@ exports.validateImageUrl = validateImageUrl;
|
|
|
4
4
|
exports.getProfileDisplayInfo = getProfileDisplayInfo;
|
|
5
5
|
const debug_1 = require("../../../shared/utils/debug");
|
|
6
6
|
const debug = (0, debug_1.debugB3React)("profileDisplay");
|
|
7
|
+
const ALLOWED_IPFS_GATEWAYS = [
|
|
8
|
+
"ipfs.io",
|
|
9
|
+
"gateway.pinata.cloud",
|
|
10
|
+
"cloudflare-ipfs.com",
|
|
11
|
+
"dweb.link",
|
|
12
|
+
"nftstorage.link",
|
|
13
|
+
"w3s.link",
|
|
14
|
+
];
|
|
15
|
+
const BLOCKED_HOSTNAMES = ["models.readyplayer.me", "readyplayer.me"];
|
|
16
|
+
function isHostnameInList(hostname, list) {
|
|
17
|
+
return list.some(entry => hostname === entry || hostname.endsWith(`.${entry}`));
|
|
18
|
+
}
|
|
7
19
|
/**
|
|
8
20
|
* Validates that an image URL uses an allowed schema
|
|
9
21
|
* @param url - The URL to validate
|
|
@@ -28,27 +40,14 @@ function validateImageUrl(url) {
|
|
|
28
40
|
debug("Rejected unsafe protocol:", parsedUrl.protocol, url);
|
|
29
41
|
return null;
|
|
30
42
|
}
|
|
31
|
-
// Whitelist of allowed IPFS gateway hostnames
|
|
32
|
-
const allowedIpfsGateways = [
|
|
33
|
-
"ipfs.io",
|
|
34
|
-
"gateway.pinata.cloud",
|
|
35
|
-
"cloudflare-ipfs.com",
|
|
36
|
-
"dweb.link",
|
|
37
|
-
"nftstorage.link",
|
|
38
|
-
"w3s.link",
|
|
39
|
-
];
|
|
40
|
-
// Check if hostname matches allowed IPFS gateways
|
|
41
43
|
const hostname = parsedUrl.hostname.toLowerCase();
|
|
42
|
-
|
|
43
|
-
// Exact match or subdomain of the gateway
|
|
44
|
-
return hostname === gateway || hostname.endsWith(`.${gateway}`);
|
|
45
|
-
});
|
|
46
|
-
if (isAllowedIpfsGateway) {
|
|
44
|
+
if (isHostnameInList(hostname, ALLOWED_IPFS_GATEWAYS)) {
|
|
47
45
|
return url;
|
|
48
46
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
if (isHostnameInList(hostname, BLOCKED_HOSTNAMES)) {
|
|
48
|
+
debug("Rejected deprecated avatar service:", hostname, url);
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
52
51
|
return url;
|
|
53
52
|
}
|
|
54
53
|
catch (error) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ChainNetworks } from "../../../global-account/types/chain-networks";
|
|
1
2
|
import { Chain as ThirdwebChain } from "thirdweb";
|
|
2
3
|
import { Chain } from "viem";
|
|
3
|
-
import { ChainNetworks } from "../../../global-account/types/chain-networks";
|
|
4
4
|
export declare const nullAddress = "0x0000000000000000000000000000000000000000";
|
|
5
5
|
export declare const avatarsNFTCollectionAddress = "0x658E2F67D3121A0eA81e5854be0b7539be27Aeb0";
|
|
6
6
|
export declare const viemToThirdwebChain: (chain: Chain) => ThirdwebChain;
|
|
@@ -33,8 +33,8 @@ export declare const b3Mainnet: {
|
|
|
33
33
|
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
34
34
|
rpcUrls: {
|
|
35
35
|
readonly default: {
|
|
36
|
-
readonly http: readonly ["https://
|
|
37
|
-
readonly ws: readonly ["wss://
|
|
36
|
+
readonly http: readonly ["https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"];
|
|
37
|
+
readonly ws: readonly ["wss://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"];
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
sourceId?: number | undefined | undefined;
|
|
@@ -43,7 +43,7 @@ export declare const b3Mainnet: {
|
|
|
43
43
|
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
44
44
|
formatters?: undefined;
|
|
45
45
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
|
|
46
|
-
readonly rpc: "https://
|
|
46
|
+
readonly rpc: "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2";
|
|
47
47
|
readonly icon: {
|
|
48
48
|
readonly url: "https://cdn.b3.fun/b3_logo.svg";
|
|
49
49
|
readonly width: 32;
|
|
@@ -128,8 +128,8 @@ export declare const b3Chain: Chain | {
|
|
|
128
128
|
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
129
129
|
rpcUrls: {
|
|
130
130
|
readonly default: {
|
|
131
|
-
readonly http: readonly ["https://
|
|
132
|
-
readonly ws: readonly ["wss://
|
|
131
|
+
readonly http: readonly ["https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"];
|
|
132
|
+
readonly ws: readonly ["wss://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"];
|
|
133
133
|
};
|
|
134
134
|
};
|
|
135
135
|
sourceId?: number | undefined | undefined;
|
|
@@ -138,7 +138,7 @@ export declare const b3Chain: Chain | {
|
|
|
138
138
|
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
139
139
|
formatters?: undefined;
|
|
140
140
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
|
|
141
|
-
readonly rpc: "https://
|
|
141
|
+
readonly rpc: "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2";
|
|
142
142
|
readonly icon: {
|
|
143
143
|
readonly url: "https://cdn.b3.fun/b3_logo.svg";
|
|
144
144
|
readonly width: 32;
|
|
@@ -56,11 +56,11 @@ exports.b3Testnet = (0, viem_1.defineChain)({
|
|
|
56
56
|
exports.b3Mainnet = (0, viem_1.defineChain)({
|
|
57
57
|
id: 8333,
|
|
58
58
|
name: "B3",
|
|
59
|
-
rpc: "https://
|
|
59
|
+
rpc: "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2",
|
|
60
60
|
rpcUrls: {
|
|
61
61
|
default: {
|
|
62
|
-
http: ["https://
|
|
63
|
-
ws: ["wss://
|
|
62
|
+
http: ["https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"],
|
|
63
|
+
ws: ["wss://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"],
|
|
64
64
|
},
|
|
65
65
|
},
|
|
66
66
|
icon: {
|
|
@@ -128,7 +128,7 @@ exports.thirdwebB3Testnet = (0, thirdweb_1.defineChain)({
|
|
|
128
128
|
exports.thirdwebB3Mainnet = (0, thirdweb_1.defineChain)({
|
|
129
129
|
id: 8333,
|
|
130
130
|
name: "B3",
|
|
131
|
-
rpc: "https://
|
|
131
|
+
rpc: "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2/",
|
|
132
132
|
icon: {
|
|
133
133
|
url: "https://cdn.b3.fun/b3_logo.svg",
|
|
134
134
|
width: 32,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.b3Viem = void 0;
|
|
4
|
+
const rpc_1 = require("../../../anyspend/constants/rpc");
|
|
5
|
+
const chains_1 = require("viem/chains");
|
|
6
|
+
/**
|
|
7
|
+
* Viem's built-in `b3` chain points at mainnet-rpc.b3.fun; we spread it and override
|
|
8
|
+
* RPC URLs so all SDK call sites stay aligned with {@link B3_PUBLIC_RPC}.
|
|
9
|
+
*/
|
|
10
|
+
exports.b3Viem = {
|
|
11
|
+
...chains_1.b3,
|
|
12
|
+
rpcUrls: {
|
|
13
|
+
...chains_1.b3.rpcUrls,
|
|
14
|
+
default: {
|
|
15
|
+
...chains_1.b3.rpcUrls.default,
|
|
16
|
+
http: [rpc_1.B3_PUBLIC_RPC],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|