@b3dotfun/sdk 0.1.69 → 0.1.70-alpha.1
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/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/AnySpendDeposit.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +3 -3
- 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.js +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.js +1 -1
- 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/checkout/AnySpendCheckout.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckout.js +15 -6
- 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.js +2 -4
- 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 +8 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.js +3 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +27 -2
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +11 -13
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +6 -8
- package/dist/cjs/global-account/react/components/B3Provider/BetterAuthClientProvider.d.ts +17 -0
- package/dist/cjs/global-account/react/components/B3Provider/BetterAuthClientProvider.js +31 -0
- package/dist/cjs/global-account/react/components/B3Provider/BetterAuthProvider.d.ts +16 -0
- package/dist/cjs/global-account/react/components/B3Provider/BetterAuthProvider.js +121 -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 +6 -0
- package/dist/cjs/global-account/react/components/index.js +14 -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 +159 -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 +14 -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/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/AnySpendDeposit.d.ts +3 -1
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +3 -3
- 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.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
- 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/checkout/AnySpendCheckout.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckout.js +15 -6
- 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.js +2 -4
- 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 +8 -1
- package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.js +3 -1
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +27 -2
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +6 -8
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +4 -6
- package/dist/esm/global-account/react/components/B3Provider/BetterAuthClientProvider.d.ts +17 -0
- package/dist/esm/global-account/react/components/B3Provider/BetterAuthClientProvider.js +27 -0
- package/dist/esm/global-account/react/components/B3Provider/BetterAuthProvider.d.ts +16 -0
- package/dist/esm/global-account/react/components/B3Provider/BetterAuthProvider.js +116 -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 +6 -0
- package/dist/esm/global-account/react/components/index.js +6 -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 +151 -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 +14 -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/AnySpendCollectorClubPurchase.d.ts +5 -1
- package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +2 -0
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +3 -1
- package/dist/types/anyspend/react/components/AnySpendNFT.d.ts +3 -1
- package/dist/types/anyspend/react/components/AnySpendStakeUpside.d.ts +3 -1
- package/dist/types/anyspend/react/components/checkout/AnySpendCheckout.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/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 +8 -1
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +27 -2
- package/dist/types/global-account/react/components/B3Provider/BetterAuthClientProvider.d.ts +17 -0
- 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 +6 -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 +14 -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/AnySpendCollectorClubPurchase.tsx +6 -0
- package/src/anyspend/react/components/AnySpendCustom.tsx +12 -2
- package/src/anyspend/react/components/AnySpendDeposit.tsx +38 -31
- package/src/anyspend/react/components/AnySpendNFT.tsx +6 -2
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +2 -2
- package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +2 -2
- package/src/anyspend/react/components/AnySpendStakeUpside.tsx +4 -0
- package/src/anyspend/react/components/checkout/AnySpendCheckout.tsx +25 -5
- 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 +2 -4
- 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 +12 -0
- package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +16 -21
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +78 -38
- package/src/global-account/react/components/B3Provider/BetterAuthClientProvider.tsx +40 -0
- package/src/global-account/react/components/B3Provider/BetterAuthProvider.tsx +128 -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 +12 -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 +193 -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 +15 -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,159 @@
|
|
|
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 BetterAuthClientProvider_1 = require("../components/B3Provider/BetterAuthClientProvider");
|
|
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 betterAuthClient = (0, BetterAuthClientProvider_1.useBetterAuthClient)();
|
|
34
|
+
const { setUser } = (0, useUserQuery_1.useUserQuery)();
|
|
35
|
+
const setIsAuthenticated = (0, react_1.useAuthStore)(state => state.setIsAuthenticated);
|
|
36
|
+
const setIsAuthenticating = (0, react_1.useAuthStore)(state => state.setIsAuthenticating);
|
|
37
|
+
const setIsConnected = (0, react_1.useAuthStore)(state => state.setIsConnected);
|
|
38
|
+
const setHasStartedConnecting = (0, react_1.useAuthStore)(state => state.setHasStartedConnecting);
|
|
39
|
+
const exchangeForFeathersJWT = (0, react_2.useCallback)(async (sessionToken) => {
|
|
40
|
+
debug("Exchanging Better Auth token for Feathers JWT");
|
|
41
|
+
const response = await app_1.default.authenticate({
|
|
42
|
+
strategy: "better-auth",
|
|
43
|
+
accessToken: sessionToken,
|
|
44
|
+
partnerId,
|
|
45
|
+
});
|
|
46
|
+
if (!response.user) {
|
|
47
|
+
throw new Error("No user returned from authentication");
|
|
48
|
+
}
|
|
49
|
+
setUser(response.user);
|
|
50
|
+
setIsAuthenticated(true);
|
|
51
|
+
setIsConnected(true);
|
|
52
|
+
setIsAuthenticating(false);
|
|
53
|
+
debug("Feathers JWT exchange successful", { userId: response.user?.userId });
|
|
54
|
+
return response;
|
|
55
|
+
}, [partnerId, setUser, setIsAuthenticated, setIsConnected, setIsAuthenticating]);
|
|
56
|
+
const signInWithEmail = (0, react_2.useCallback)(async (email, password) => {
|
|
57
|
+
debug("Signing in with email", { email });
|
|
58
|
+
setHasStartedConnecting(true);
|
|
59
|
+
setIsAuthenticating(true);
|
|
60
|
+
try {
|
|
61
|
+
const result = await betterAuthClient.signIn.email({ email, password });
|
|
62
|
+
if (result.error) {
|
|
63
|
+
throw new Error(result.error.message || "Sign in failed");
|
|
64
|
+
}
|
|
65
|
+
const token = result.data?.token;
|
|
66
|
+
if (!token) {
|
|
67
|
+
throw new Error("No session token returned from sign in");
|
|
68
|
+
}
|
|
69
|
+
return await exchangeForFeathersJWT(token);
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
setIsAuthenticating(false);
|
|
73
|
+
debug("Sign in failed", error);
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
}, [exchangeForFeathersJWT, setIsAuthenticating, setHasStartedConnecting, betterAuthClient]);
|
|
77
|
+
const signUpWithEmail = (0, react_2.useCallback)(async (email, password, name, verifyCallbackURL) => {
|
|
78
|
+
debug("Signing up with email", { email, name });
|
|
79
|
+
setHasStartedConnecting(true);
|
|
80
|
+
setIsAuthenticating(true);
|
|
81
|
+
try {
|
|
82
|
+
const result = await betterAuthClient.signUp.email({ email, password, name });
|
|
83
|
+
if (result.error) {
|
|
84
|
+
throw new Error(result.error.message || "Sign up failed");
|
|
85
|
+
}
|
|
86
|
+
const token = result.data?.token;
|
|
87
|
+
if (!token) {
|
|
88
|
+
// requireEmailVerification is enabled — send verification email with
|
|
89
|
+
// a callbackURL Better Auth redirects to after server-side verify.
|
|
90
|
+
// Pass verifyCallbackURL to land on a dedicated confirmation page.
|
|
91
|
+
await betterAuthClient.sendVerificationEmail({
|
|
92
|
+
email,
|
|
93
|
+
callbackURL: verifyCallbackURL || `${window.location.origin}?authStrategy=better-auth`,
|
|
94
|
+
});
|
|
95
|
+
throw new EmailVerificationRequiredError();
|
|
96
|
+
}
|
|
97
|
+
return await exchangeForFeathersJWT(token);
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
setIsAuthenticating(false);
|
|
101
|
+
debug("Sign up failed", error);
|
|
102
|
+
throw error;
|
|
103
|
+
}
|
|
104
|
+
}, [exchangeForFeathersJWT, setIsAuthenticating, setHasStartedConnecting, betterAuthClient]);
|
|
105
|
+
const signInWithSocial = (0, react_2.useCallback)(async (provider) => {
|
|
106
|
+
debug("Signing in with social provider", { provider });
|
|
107
|
+
setHasStartedConnecting(true);
|
|
108
|
+
setIsAuthenticating(true);
|
|
109
|
+
try {
|
|
110
|
+
const result = await betterAuthClient.signIn.social({
|
|
111
|
+
provider,
|
|
112
|
+
callbackURL: window.location.href,
|
|
113
|
+
});
|
|
114
|
+
if (result.error) {
|
|
115
|
+
throw new Error(result.error.message || `${provider} sign in failed`);
|
|
116
|
+
}
|
|
117
|
+
// Social auth redirects to provider — JWT exchange happens on callback
|
|
118
|
+
// via BetterAuthProvider session restore
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
setIsAuthenticating(false);
|
|
122
|
+
debug("Social sign in failed", error);
|
|
123
|
+
throw error;
|
|
124
|
+
}
|
|
125
|
+
}, [setIsAuthenticating, setHasStartedConnecting, betterAuthClient]);
|
|
126
|
+
const requestPasswordReset = (0, react_2.useCallback)(async (email, redirectTo) => {
|
|
127
|
+
debug("Requesting password reset", { email });
|
|
128
|
+
const result = await betterAuthClient.requestPasswordReset({
|
|
129
|
+
email,
|
|
130
|
+
redirectTo,
|
|
131
|
+
});
|
|
132
|
+
if (result.error) {
|
|
133
|
+
throw new Error(result.error.message || "Password reset request failed");
|
|
134
|
+
}
|
|
135
|
+
debug("Password reset email sent");
|
|
136
|
+
return result;
|
|
137
|
+
}, [betterAuthClient]);
|
|
138
|
+
const resetPassword = (0, react_2.useCallback)(async (newPassword, token) => {
|
|
139
|
+
debug("Resetting password");
|
|
140
|
+
const result = await betterAuthClient.resetPassword({
|
|
141
|
+
newPassword,
|
|
142
|
+
token,
|
|
143
|
+
});
|
|
144
|
+
if (result.error) {
|
|
145
|
+
throw new Error(result.error.message || "Password reset failed");
|
|
146
|
+
}
|
|
147
|
+
debug("Password reset successful");
|
|
148
|
+
return result;
|
|
149
|
+
}, [betterAuthClient]);
|
|
150
|
+
return {
|
|
151
|
+
signInWithEmail,
|
|
152
|
+
signUpWithEmail,
|
|
153
|
+
signInWithSocial,
|
|
154
|
+
requestPasswordReset,
|
|
155
|
+
resetPassword,
|
|
156
|
+
exchangeForFeathersJWT,
|
|
157
|
+
betterAuthClient,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
@@ -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
|
|
@@ -425,6 +427,15 @@ export interface SendModalProps extends BaseModalProps {
|
|
|
425
427
|
/** Callback function called when send is successful */
|
|
426
428
|
onSuccess?: (txHash?: string) => void;
|
|
427
429
|
}
|
|
430
|
+
/**
|
|
431
|
+
* Props for the Session Duration modal
|
|
432
|
+
* Allows users to configure how long they stay signed in
|
|
433
|
+
*/
|
|
434
|
+
export interface SessionDurationModalProps extends BaseModalProps {
|
|
435
|
+
type: "sessionDuration";
|
|
436
|
+
partnerId: string;
|
|
437
|
+
chain: Chain;
|
|
438
|
+
}
|
|
428
439
|
/**
|
|
429
440
|
* Props for the Notifications modal
|
|
430
441
|
* Allows users to manage notification settings and channels
|
|
@@ -600,6 +611,8 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
|
|
|
600
611
|
actionLabel?: string;
|
|
601
612
|
/** Whether to show chain selection step. Defaults to true if sourceTokenChainId is not provided */
|
|
602
613
|
showChainSelection?: boolean;
|
|
614
|
+
/** Whether to show the "Fund with Fiat" option in the deposit options list. Defaults to true */
|
|
615
|
+
showFiatOption?: boolean;
|
|
603
616
|
/** Minimum pool size for filtering tokens (default: 1,000,000) */
|
|
604
617
|
minPoolSize?: number;
|
|
605
618
|
/** Custom title for chain selection step */
|
|
@@ -626,7 +639,7 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
|
|
|
626
639
|
/**
|
|
627
640
|
* Union type of all possible modal content types
|
|
628
641
|
*/
|
|
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;
|
|
642
|
+
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
643
|
/**
|
|
631
644
|
* State interface for the modal store
|
|
632
645
|
*/
|
|
@@ -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
|
+
};
|
|
@@ -2,6 +2,7 @@ import type { Chain as ThirdwebChain } from "thirdweb";
|
|
|
2
2
|
export declare const supportedChains: import("viem").Chain[];
|
|
3
3
|
export declare const supportedChainsTW: ThirdwebChain[];
|
|
4
4
|
export declare const supportedChainNetworks: {
|
|
5
|
+
formatters?: Record<string, any> | undefined;
|
|
5
6
|
contracts?: Record<string, {
|
|
6
7
|
blockCreated?: number | undefined;
|
|
7
8
|
address: string;
|
|
@@ -9,7 +10,6 @@ export declare const supportedChainNetworks: {
|
|
|
9
10
|
sourceId?: number | undefined;
|
|
10
11
|
testnet?: boolean | undefined;
|
|
11
12
|
fees?: Record<string, any> | undefined;
|
|
12
|
-
formatters?: Record<string, any> | undefined;
|
|
13
13
|
color?: string | undefined;
|
|
14
14
|
testnetConfigID?: number | undefined;
|
|
15
15
|
badge?: string | undefined;
|
|
@@ -16,3 +16,4 @@ export declare const CLIENT_APP_BUNDLE_ID: string;
|
|
|
16
16
|
export declare const B3_AUTH_COOKIE_NAME = "b3-auth";
|
|
17
17
|
export declare const ENS_GATEWAY_URL = "https://ens-gateway.b3.fun/";
|
|
18
18
|
export declare const PUBLIC_BASE_RPC_URL = "https://base-rpc.publicnode.com";
|
|
19
|
+
export declare const AVATAR_COLORS: string[];
|
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.PUBLIC_BASE_RPC_URL = exports.ENS_GATEWAY_URL = exports.B3_AUTH_COOKIE_NAME = exports.CLIENT_APP_BUNDLE_ID = exports.THIRDWEB_CLIENT_ID = exports.THIRDWEB_SECRET_KEY = exports.tokenIcons = exports.ecosystemWalletId = exports.b3CoinIcon = exports.siteURL = void 0;
|
|
17
|
+
exports.AVATAR_COLORS = exports.PUBLIC_BASE_RPC_URL = exports.ENS_GATEWAY_URL = exports.B3_AUTH_COOKIE_NAME = exports.CLIENT_APP_BUNDLE_ID = exports.THIRDWEB_CLIENT_ID = exports.THIRDWEB_SECRET_KEY = exports.tokenIcons = exports.ecosystemWalletId = exports.b3CoinIcon = exports.siteURL = void 0;
|
|
18
18
|
__exportStar(require("./currency"), exports);
|
|
19
19
|
exports.siteURL = "https://basement.fun";
|
|
20
20
|
exports.b3CoinIcon = "https://cdn.b3.fun/b3-coin-3d.png";
|
|
@@ -38,3 +38,4 @@ exports.CLIENT_APP_BUNDLE_ID = process.env.EXPO_PUBLIC_B3_BUNDLE_ID || "";
|
|
|
38
38
|
exports.B3_AUTH_COOKIE_NAME = "b3-auth";
|
|
39
39
|
exports.ENS_GATEWAY_URL = "https://ens-gateway.b3.fun/";
|
|
40
40
|
exports.PUBLIC_BASE_RPC_URL = "https://base-rpc.publicnode.com";
|
|
41
|
+
exports.AVATAR_COLORS = ["#3368ef", "#272727", "#6366f1", "#06b6d4", "#eeb0d9", "#ba3fbf", "#ff777b", "#dfbb53"];
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
"name": "B3",
|
|
6
6
|
"rpcUrls": {
|
|
7
7
|
"default": {
|
|
8
|
-
"http": "https://
|
|
9
|
-
"ws": "wss://
|
|
8
|
+
"http": "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2/",
|
|
9
|
+
"ws": "wss://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2/"
|
|
10
10
|
},
|
|
11
11
|
"backups": []
|
|
12
12
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Chain } from "viem
|
|
1
|
+
import type { Chain } from "viem";
|
|
2
2
|
export declare function getChainById(id: number): Chain | undefined;
|
|
3
3
|
export declare function chainIdToName(id: number): string | undefined;
|
|
4
4
|
export declare function getExplorerUrl(chain: Chain, txHash: string): string;
|
|
@@ -5,8 +5,8 @@ exports.chainIdToName = chainIdToName;
|
|
|
5
5
|
exports.getExplorerUrl = getExplorerUrl;
|
|
6
6
|
exports.getAddressExplorerUrl = getAddressExplorerUrl;
|
|
7
7
|
exports.getTokenExplorerUrl = getTokenExplorerUrl;
|
|
8
|
+
const b3Viem_1 = require("../../shared/constants/chains/b3Viem");
|
|
8
9
|
const supported_1 = require("../../shared/constants/chains/supported");
|
|
9
|
-
const chains_1 = require("viem/chains");
|
|
10
10
|
const baseChainBaseUrl = "https://basescan.org";
|
|
11
11
|
function getChainById(id) {
|
|
12
12
|
return Object.values(supported_1.supportedChains).find(chain => chain.id === id);
|
|
@@ -16,7 +16,7 @@ function chainIdToName(id) {
|
|
|
16
16
|
return name === "Base Mainnet" ? "Base" : name === "The Open Network" ? "Open Network" : name;
|
|
17
17
|
}
|
|
18
18
|
function getExplorerUrl(chain, txHash) {
|
|
19
|
-
if (chain.id ===
|
|
19
|
+
if (chain.id === b3Viem_1.b3Viem.id) {
|
|
20
20
|
return "https://explorer.b3.fun/b3/tx/" + txHash;
|
|
21
21
|
}
|
|
22
22
|
let baseUrl = chain.blockExplorers?.default.url;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const SESSION_DURATION_OPTIONS: readonly [0, 1, 7, 14, 30];
|
|
2
|
+
export type SessionDurationDays = (typeof SESSION_DURATION_OPTIONS)[number];
|
|
3
|
+
/**
|
|
4
|
+
* Read session duration for a specific partner.
|
|
5
|
+
*
|
|
6
|
+
* preferences shape: { [partnerId]: { sessionDuration: number }, sessionDuration?: number }
|
|
7
|
+
*
|
|
8
|
+
* Priority: user.preferences[partnerId].sessionDuration
|
|
9
|
+
* → user.preferences.sessionDuration (global fallback)
|
|
10
|
+
* → localStorage (per-partner) → localStorage (global) → default 7d
|
|
11
|
+
*/
|
|
12
|
+
export declare function getSessionDurationDays(userPreferences?: Record<string, any>, partnerId?: string): SessionDurationDays;
|
|
13
|
+
export declare const SESSION_DURATION_LABELS: Record<SessionDurationDays, string>;
|
|
14
|
+
/** Cache the preference locally so it's available immediately on next login */
|
|
15
|
+
export declare function setSessionDurationDays(days: SessionDurationDays, partnerId?: string): void;
|