@b3dotfun/sdk 0.1.69-alpha.2 → 0.1.69-alpha.21
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/AnySpendNFT.js +2 -2
- 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/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/B3DynamicModal.js +5 -2
- 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 +8 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +9 -12
- 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/ProfileSection.js +15 -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 +12 -29
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +2 -2
- 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 +67 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthSignIn.d.ts +34 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +163 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +13 -4
- package/dist/cjs/global-account/react/components/SignInWithB3/components/AuthButton.js +10 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.d.ts +6 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +138 -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/custom/Button.d.ts +1 -1
- package/dist/cjs/global-account/react/components/index.d.ts +3 -0
- package/dist/cjs/global-account/react/components/index.js +7 -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/useBetterAuth.d.ts +973 -0
- package/dist/cjs/global-account/react/hooks/useBetterAuth.js +157 -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/stores/useModalStore.d.ts +10 -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/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/AnySpendNFT.js +2 -2
- 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/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/B3DynamicModal.js +5 -2
- 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 +8 -1
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +4 -7
- 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/ProfileSection.js +13 -7
- 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 +12 -29
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +2 -2
- 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 +64 -0
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthSignIn.d.ts +34 -0
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +160 -0
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +13 -4
- package/dist/esm/global-account/react/components/SignInWithB3/components/AuthButton.js +11 -2
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.d.ts +6 -0
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +135 -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/custom/Button.d.ts +1 -1
- package/dist/esm/global-account/react/components/index.d.ts +3 -0
- package/dist/esm/global-account/react/components/index.js +2 -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/useBetterAuth.d.ts +973 -0
- package/dist/esm/global-account/react/hooks/useBetterAuth.js +149 -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/stores/useModalStore.d.ts +10 -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/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/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/B3ConfigProvider.d.ts +4 -1
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +8 -1
- 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 +34 -0
- package/dist/types/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.d.ts +6 -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/custom/Button.d.ts +1 -1
- package/dist/types/global-account/react/components/index.d.ts +3 -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/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 +10 -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/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/AnySpendNFT.tsx +2 -2
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +2 -2
- package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +2 -2
- 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/B3DynamicModal.tsx +5 -2
- 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 +52 -40
- 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/ProfileSection.tsx +29 -11
- package/src/global-account/react/components/ManageAccount/SessionDurationContent.tsx +107 -0
- package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +28 -30
- package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +2 -2
- package/src/global-account/react/components/Send/Send.tsx +8 -5
- package/src/global-account/react/components/SignInWithB3/BetterAuthResetPassword.tsx +146 -0
- package/src/global-account/react/components/SignInWithB3/BetterAuthSignIn.tsx +426 -0
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +13 -4
- package/src/global-account/react/components/SignInWithB3/components/AuthButton.tsx +21 -2
- package/src/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.tsx +308 -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/index.ts +3 -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/useBetterAuth.ts +191 -0
- package/src/global-account/react/hooks/useConnect.tsx +2 -2
- package/src/global-account/react/stores/useModalStore.ts +11 -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/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
|
@@ -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;
|
|
@@ -425,6 +425,15 @@ export interface SendModalProps extends BaseModalProps {
|
|
|
425
425
|
/** Callback function called when send is successful */
|
|
426
426
|
onSuccess?: (txHash?: string) => void;
|
|
427
427
|
}
|
|
428
|
+
/**
|
|
429
|
+
* Props for the Session Duration modal
|
|
430
|
+
* Allows users to configure how long they stay signed in
|
|
431
|
+
*/
|
|
432
|
+
export interface SessionDurationModalProps extends BaseModalProps {
|
|
433
|
+
type: "sessionDuration";
|
|
434
|
+
partnerId: string;
|
|
435
|
+
chain: Chain;
|
|
436
|
+
}
|
|
428
437
|
/**
|
|
429
438
|
* Props for the Notifications modal
|
|
430
439
|
* Allows users to manage notification settings and channels
|
|
@@ -626,7 +635,7 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
|
|
|
626
635
|
/**
|
|
627
636
|
* Union type of all possible modal content types
|
|
628
637
|
*/
|
|
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;
|
|
638
|
+
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
639
|
/**
|
|
631
640
|
* State interface for the modal store
|
|
632
641
|
*/
|
|
@@ -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,6 +1,6 @@
|
|
|
1
|
+
import { ChainNetworks } from "@b3dotfun/sdk/global-account/types/chain-networks";
|
|
1
2
|
import { Chain as ThirdwebChain } from "thirdweb";
|
|
2
3
|
import { Chain } from "viem";
|
|
3
|
-
import { ChainNetworks } from "@b3dotfun/sdk/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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ConnectWalletProps {
|
|
2
|
+
/** Theme for the modal and button. Defaults to "light". */
|
|
3
|
+
theme?: "light" | "dark";
|
|
4
|
+
/** Label for the connect button. Defaults to "Connect Wallet". */
|
|
5
|
+
buttonLabel?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Drop-in wallet connection component styled to match the B3 design system.
|
|
9
|
+
* Uses inline styles — works in any app without tailwind configuration.
|
|
10
|
+
*/
|
|
11
|
+
export declare function ConnectWallet({ theme: themeProp, buttonLabel }: ConnectWalletProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { QueryClient } from "@tanstack/react-query";
|
|
2
|
+
import { type Config, type CreateConnectorFn } from "wagmi";
|
|
3
|
+
import type { Chain } from "viem";
|
|
4
|
+
export interface WalletProviderProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* Chains to support. Defaults to SDK's supportedChains.
|
|
8
|
+
* Must be memoized or defined outside the component — inline arrays cause the
|
|
9
|
+
* wagmi config to rebuild on every render, losing wallet connection state.
|
|
10
|
+
*/
|
|
11
|
+
chains?: Chain[];
|
|
12
|
+
/**
|
|
13
|
+
* Wagmi connectors. Must be memoized or defined outside the component — inline
|
|
14
|
+
* arrays cause the wagmi config to rebuild on every render, losing wallet connection state.
|
|
15
|
+
*/
|
|
16
|
+
connectors?: CreateConnectorFn[];
|
|
17
|
+
/**
|
|
18
|
+
* Optional RPC URL overrides per chain ID.
|
|
19
|
+
* Must be memoized or defined outside the component — inline objects cause the
|
|
20
|
+
* wagmi config to rebuild on every render, losing wallet connection state.
|
|
21
|
+
*/
|
|
22
|
+
rpcUrls?: Record<number, string>;
|
|
23
|
+
/** Escape hatch: pass a fully custom wagmi config. Overrides chains/connectors/rpcUrls. */
|
|
24
|
+
wagmiConfig?: Config;
|
|
25
|
+
/** Provide your own QueryClient for React Query. Defaults to an internal instance. */
|
|
26
|
+
queryClient?: QueryClient;
|
|
27
|
+
/** Whether to auto-reconnect the last wallet on mount. Defaults to false. */
|
|
28
|
+
reconnectOnMount?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Standalone wallet connection provider.
|
|
32
|
+
* Wraps ThirdwebProvider, WagmiProvider, and QueryClientProvider.
|
|
33
|
+
* Use wagmi hooks (useAccount, useConnect, useDisconnect) directly inside.
|
|
34
|
+
*/
|
|
35
|
+
export declare function WalletProvider({ children, chains, connectors, rpcUrls, wagmiConfig: wagmiConfigProp, queryClient: queryClientProp, reconnectOnMount, }: WalletProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disconnect the current wallet via wagmi.
|
|
3
|
+
* Consumers should use this instead of wagmi's useDisconnect directly
|
|
4
|
+
* to ensure a consistent disconnect API across the wallet module.
|
|
5
|
+
*
|
|
6
|
+
* Note: this only disconnects the wagmi layer. When used inside B3Provider,
|
|
7
|
+
* the thirdweb auth session is managed separately by B3Provider's own logout
|
|
8
|
+
* flow (useAuthentication). ConnectWallet is intended for standalone
|
|
9
|
+
* WalletProvider usage where thirdweb auth is not involved.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useWalletDisconnect(): {
|
|
12
|
+
disconnect: () => void;
|
|
13
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Chain } from "viem";
|
|
2
|
+
import type { Connector } from "wagmi";
|
|
3
|
+
export interface WalletConnector {
|
|
4
|
+
/** Display name of the wallet */
|
|
5
|
+
name: string;
|
|
6
|
+
/** Unique identifier for this connector instance */
|
|
7
|
+
uid: string;
|
|
8
|
+
/** Whether the wallet extension/app is detected in the browser */
|
|
9
|
+
isInstalled: boolean;
|
|
10
|
+
/** Connect using this connector. Returns a promise that resolves on success or rejects on failure/rejection. */
|
|
11
|
+
connect: () => Promise<void>;
|
|
12
|
+
/** Raw wagmi connector for advanced use */
|
|
13
|
+
connector: Connector;
|
|
14
|
+
}
|
|
15
|
+
export interface WalletState {
|
|
16
|
+
/** Connected wallet address, or undefined if not connected */
|
|
17
|
+
address: string | undefined;
|
|
18
|
+
/** Whether a wallet is currently connected */
|
|
19
|
+
isConnected: boolean;
|
|
20
|
+
/** Current chain the wallet is connected to */
|
|
21
|
+
chain: Chain | undefined;
|
|
22
|
+
/** Whether a connection attempt is in progress */
|
|
23
|
+
isPending: boolean;
|
|
24
|
+
/** Available wallet connectors, deduplicated by name */
|
|
25
|
+
connectors: WalletConnector[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Unified wallet state from both thirdweb and wagmi layers.
|
|
29
|
+
* Provides available connectors with install status and connect functions.
|
|
30
|
+
*/
|
|
31
|
+
export declare function useWalletState(): WalletState;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { WalletProvider, type WalletProviderProps } from "./components/WalletProvider";
|
|
2
|
+
export { createWalletConfig, type CreateWalletConfigOptions } from "../utils/createWalletConfig";
|
|
3
|
+
export { useWalletDisconnect } from "./hooks/useWalletDisconnect";
|
|
4
|
+
export { useWalletState, type WalletConnector, type WalletState } from "./hooks/useWalletState";
|
|
5
|
+
export { ConnectWallet, type ConnectWalletProps } from "./components/ConnectWallet";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type CreateConnectorFn } from "wagmi";
|
|
2
|
+
import type { Chain } from "viem";
|
|
3
|
+
export interface CreateWalletConfigOptions {
|
|
4
|
+
/** Chains to support. Defaults to SDK's supportedChains. Must be non-empty. */
|
|
5
|
+
chains?: Chain[];
|
|
6
|
+
/**
|
|
7
|
+
* Wagmi connectors. Defaults to injected + Coinbase Wallet.
|
|
8
|
+
* Must be memoized if passed to WalletProvider — inline arrays
|
|
9
|
+
* will cause the config to rebuild on every render, losing wallet connection state.
|
|
10
|
+
*/
|
|
11
|
+
connectors?: CreateConnectorFn[];
|
|
12
|
+
/** Optional RPC URL overrides per chain ID. */
|
|
13
|
+
rpcUrls?: Record<number, string>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Creates a generic wagmi config with sensible defaults.
|
|
17
|
+
* No ecosystem wallet, no B3-specific concerns.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createWalletConfig(options?: CreateWalletConfigOptions): import("wagmi").Config<readonly [Chain, ...Chain[]], {
|
|
20
|
+
[k: string]: import("viem").HttpTransport<undefined, false>;
|
|
21
|
+
}, CreateConnectorFn[]>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@b3dotfun/sdk",
|
|
3
|
-
"version": "0.1.69-alpha.
|
|
3
|
+
"version": "0.1.69-alpha.21",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"react-native": "./dist/cjs/index.native.js",
|
|
@@ -205,6 +205,16 @@
|
|
|
205
205
|
"import": "./dist/esm/notifications/types/index.js",
|
|
206
206
|
"require": "./dist/cjs/notifications/types/index.js"
|
|
207
207
|
},
|
|
208
|
+
"./wallet/react": {
|
|
209
|
+
"types": "./dist/types/wallet/react/index.d.ts",
|
|
210
|
+
"import": "./dist/esm/wallet/react/index.js",
|
|
211
|
+
"require": "./dist/cjs/wallet/react/index.js"
|
|
212
|
+
},
|
|
213
|
+
"./wallet/utils/*": {
|
|
214
|
+
"types": "./dist/types/wallet/utils/*.d.ts",
|
|
215
|
+
"import": "./dist/esm/wallet/utils/*.js",
|
|
216
|
+
"require": "./dist/cjs/wallet/utils/*.js"
|
|
217
|
+
},
|
|
208
218
|
"./shared/utils": {
|
|
209
219
|
"types": "./dist/types/shared/utils/index.d.ts",
|
|
210
220
|
"import": "./dist/esm/shared/utils/index.js",
|
|
@@ -319,7 +329,9 @@
|
|
|
319
329
|
"@stripe/stripe-js": "^7.3.1",
|
|
320
330
|
"@thirdweb-dev/wagmi-adapter": "0.2.165",
|
|
321
331
|
"@web3icons/react": "3.16.0",
|
|
332
|
+
"better-auth": "^1.5.6",
|
|
322
333
|
"big.js": "^7.0.1",
|
|
334
|
+
"boring-avatars": "^2.0.4",
|
|
323
335
|
"class-variance-authority": "0.7.0",
|
|
324
336
|
"clsx": "2.0.0",
|
|
325
337
|
"cmdk": "1.0.0",
|
|
@@ -338,6 +350,7 @@
|
|
|
338
350
|
"socket.io-client": "4.7.5",
|
|
339
351
|
"sonner": "1.7.4",
|
|
340
352
|
"tailwind-merge": "2.6.0",
|
|
353
|
+
"torph": "^0.0.9",
|
|
341
354
|
"typescript": "5.8.2",
|
|
342
355
|
"vaul": "^1.1.2",
|
|
343
356
|
"zustand": "4.5.6"
|
|
@@ -374,6 +387,7 @@
|
|
|
374
387
|
"thirdweb": "5.116.1",
|
|
375
388
|
"tsc-alias": "^1.8.16",
|
|
376
389
|
"tsc-watch": "^7.1.1",
|
|
390
|
+
"vite-tsconfig-paths": "^6.1.1",
|
|
377
391
|
"vitest": "^3.2.4"
|
|
378
392
|
},
|
|
379
393
|
"typesVersions": {
|
|
@@ -387,8 +401,6 @@
|
|
|
387
401
|
"@fingerprintjs/fingerprintjs-pro-react": "^2.7.0",
|
|
388
402
|
"@privy-io/react-auth": "^2.8.0",
|
|
389
403
|
"@react-three/postprocessing": "2.16.6",
|
|
390
|
-
"@readyplayerme/react-avatar-creator": "0.5.0",
|
|
391
|
-
"@readyplayerme/visage": "6.10.0",
|
|
392
404
|
"@tanstack/react-query": "5.55.0",
|
|
393
405
|
"@wagmi/core": "2.20.3",
|
|
394
406
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -403,9 +415,6 @@
|
|
|
403
415
|
"@react-three/postprocessing": {
|
|
404
416
|
"optional": true
|
|
405
417
|
},
|
|
406
|
-
"@readyplayerme/visage": {
|
|
407
|
-
"optional": true
|
|
408
|
-
},
|
|
409
418
|
"react-native-mmkv": {
|
|
410
419
|
"optional": true
|
|
411
420
|
},
|
|
@@ -17,7 +17,8 @@ export const AVALANCHE_PUBLIC_RPC = "https://avalanche-c-chain-rpc.publicnode.co
|
|
|
17
17
|
export const BSC_PUBLIC_RPC = "https://bsc-rpc.publicnode.com";
|
|
18
18
|
|
|
19
19
|
// Chain-specific public endpoints
|
|
20
|
-
export const B3_PUBLIC_RPC =
|
|
20
|
+
export const B3_PUBLIC_RPC =
|
|
21
|
+
"https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2/";
|
|
21
22
|
export const ABSTRACT_PUBLIC_RPC = "https://api.mainnet.abs.xyz";
|
|
22
23
|
export const HYPEREVM_PUBLIC_RPC = "https://rpc.hyperliquid.xyz/evm";
|
|
23
24
|
|
|
@@ -8,7 +8,7 @@ import { formatDisplayNumber, formatTokenAmount } from "@b3dotfun/sdk/shared/uti
|
|
|
8
8
|
import { MoreVertical } from "lucide-react";
|
|
9
9
|
import { AnimatePresence } from "motion/react";
|
|
10
10
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
11
|
-
import {
|
|
11
|
+
import { b3Viem } from "@b3dotfun/sdk/shared/constants/chains/b3Viem";
|
|
12
12
|
import { GetQuoteResponse } from "../../types/api_req_res";
|
|
13
13
|
import { AnySpendCustom } from "./AnySpendCustom";
|
|
14
14
|
import type { AnySpendContent, AnySpendSlots, AnySpendTheme } from "./types/customization";
|
|
@@ -215,7 +215,7 @@ function DropdownMenu({ nftContract }: { nftContract: components["schemas"]["Nft
|
|
|
215
215
|
</div>
|
|
216
216
|
|
|
217
217
|
<div className="hover:bg-as-on-surface-3 flex cursor-default items-center gap-2 rounded px-2">
|
|
218
|
-
<img src={chain?.logoUrl} className={cn("h-5 w-5", nftContract.chainId !==
|
|
218
|
+
<img src={chain?.logoUrl} className={cn("h-5 w-5", nftContract.chainId !== b3Viem.id && "rounded-full")} />
|
|
219
219
|
<span className="text-sm">
|
|
220
220
|
Minted on <span className="font-semibold">{chain ? getChainName(nftContract.chainId) : "Unknown"}</span>
|
|
221
221
|
</span>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ABI_ERC20_STAKING, B3_TOKEN, eqci } from "@b3dotfun/sdk/anyspend";
|
|
1
|
+
import { ABI_ERC20_STAKING, B3_TOKEN, eqci, getExplorerTxUrl } from "@b3dotfun/sdk/anyspend";
|
|
2
2
|
import {
|
|
3
3
|
Button,
|
|
4
4
|
GlareCardRounded,
|
|
@@ -474,7 +474,7 @@ export function AnySpendStakeB3({
|
|
|
474
474
|
>
|
|
475
475
|
<div className="mb-6">
|
|
476
476
|
<a
|
|
477
|
-
href={
|
|
477
|
+
href={getExplorerTxUrl(base.id, stakingTxHash)}
|
|
478
478
|
target="_blank"
|
|
479
479
|
rel="noopener noreferrer"
|
|
480
480
|
className="text-as-primary/70 hover:text-as-primary block break-all text-center font-mono text-sm underline transition-colors"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ABI_ERC20_STAKING, B3_TOKEN, eqci } from "@b3dotfun/sdk/anyspend";
|
|
1
|
+
import { ABI_ERC20_STAKING, B3_TOKEN, eqci, getExplorerTxUrl } from "@b3dotfun/sdk/anyspend";
|
|
2
2
|
import { normalizeAddress } from "@b3dotfun/sdk/anyspend/utils";
|
|
3
3
|
import {
|
|
4
4
|
Button,
|
|
@@ -492,7 +492,7 @@ export function AnySpendStakeB3ExactIn({
|
|
|
492
492
|
>
|
|
493
493
|
<div className="mb-6">
|
|
494
494
|
<a
|
|
495
|
-
href={
|
|
495
|
+
href={getExplorerTxUrl(base.id, stakingTxHash)}
|
|
496
496
|
target="_blank"
|
|
497
497
|
rel="noopener noreferrer"
|
|
498
498
|
className="text-as-primary/70 hover:text-as-primary block break-all text-center font-mono text-sm underline transition-colors"
|
|
@@ -138,6 +138,8 @@ export interface AnySpendCheckoutProps {
|
|
|
138
138
|
feeOnTop?: boolean;
|
|
139
139
|
/** When true, identity verification (KYC) is required before card payment. Defaults to false. */
|
|
140
140
|
kycEnabled?: boolean;
|
|
141
|
+
/** Extra metadata included under the 'callbackMetadata' key in the order's callbackMetadata (e.g. workflowId, orgId from checkout session) */
|
|
142
|
+
callbackMetadata?: Record<string, unknown>;
|
|
141
143
|
}
|
|
142
144
|
|
|
143
145
|
const emptyAddress: AddressData = { street: "", city: "", state: "", zip: "", country: "" };
|
|
@@ -187,6 +189,7 @@ export function AnySpendCheckout({
|
|
|
187
189
|
variablePricing,
|
|
188
190
|
feeOnTop,
|
|
189
191
|
kycEnabled = false,
|
|
192
|
+
callbackMetadata: callbackMetadataProp,
|
|
190
193
|
}: AnySpendCheckoutProps) {
|
|
191
194
|
// ===== Variable pricing state =====
|
|
192
195
|
const [variablePricingAmount, setVariablePricingAmount] = useState<string>("0");
|
|
@@ -292,10 +295,14 @@ export function AnySpendCheckout({
|
|
|
292
295
|
variablePricingAmount,
|
|
293
296
|
]);
|
|
294
297
|
|
|
295
|
-
// Get destination token metadata
|
|
296
|
-
|
|
297
|
-
const
|
|
298
|
-
|
|
298
|
+
// Get destination token metadata. While loading, skip price-dependent UI
|
|
299
|
+
// since the 18-decimal fallback is wrong for non-18 tokens (e.g. USDC).
|
|
300
|
+
const { data: tokenData, isLoading: isTokenDataLoading } = useTokenData(
|
|
301
|
+
destinationTokenChainId,
|
|
302
|
+
destinationTokenAddress,
|
|
303
|
+
);
|
|
304
|
+
const tokenSymbol = tokenData?.symbol ?? "";
|
|
305
|
+
const tokenDecimals = tokenData?.decimals ?? 18;
|
|
299
306
|
|
|
300
307
|
// Resolve USD equivalent for non-stablecoin tokens (shown in cart summary)
|
|
301
308
|
const isStablecoin = useMemo(() => {
|
|
@@ -342,8 +349,11 @@ export function AnySpendCheckout({
|
|
|
342
349
|
if (isVariablePricingActive && variablePricingAmount !== "0") {
|
|
343
350
|
meta.variablePricingAmount = variablePricingAmount;
|
|
344
351
|
}
|
|
352
|
+
// Namespace caller-supplied metadata to avoid collisions with internal keys
|
|
353
|
+
if (callbackMetadataProp) meta.callbackMetadata = callbackMetadataProp;
|
|
345
354
|
return Object.keys(meta).length > 0 ? meta : undefined;
|
|
346
355
|
}, [
|
|
356
|
+
callbackMetadataProp,
|
|
347
357
|
formData,
|
|
348
358
|
selectedShipping,
|
|
349
359
|
shippingAddress,
|
|
@@ -371,7 +381,15 @@ export function AnySpendCheckout({
|
|
|
371
381
|
|
|
372
382
|
return (
|
|
373
383
|
<AnySpendFingerprintWrapper fingerprint={fingerprint}>
|
|
374
|
-
<AnySpendCustomizationProvider
|
|
384
|
+
<AnySpendCustomizationProvider
|
|
385
|
+
slots={slots}
|
|
386
|
+
content={{
|
|
387
|
+
successTitle: "Payment Successful",
|
|
388
|
+
successDescription: "Your payment has been processed successfully.",
|
|
389
|
+
...content,
|
|
390
|
+
}}
|
|
391
|
+
theme={theme}
|
|
392
|
+
>
|
|
375
393
|
<CheckoutLayout
|
|
376
394
|
mode={mode}
|
|
377
395
|
paymentPanel={
|
|
@@ -398,6 +416,7 @@ export function AnySpendCheckout({
|
|
|
398
416
|
validateDiscount={validateDiscount}
|
|
399
417
|
tokenSymbol={tokenSymbol}
|
|
400
418
|
tokenDecimals={tokenDecimals}
|
|
419
|
+
pricesLoading={isTokenDataLoading}
|
|
401
420
|
classes={classes}
|
|
402
421
|
formData={formData}
|
|
403
422
|
onFormDataChange={handleFormDataChange}
|
|
@@ -442,6 +461,7 @@ export function AnySpendCheckout({
|
|
|
442
461
|
totalAmount={computedTotal}
|
|
443
462
|
tokenSymbol={tokenSymbol}
|
|
444
463
|
tokenDecimals={tokenDecimals}
|
|
464
|
+
pricesLoading={isTokenDataLoading}
|
|
445
465
|
organizationName={organizationName}
|
|
446
466
|
organizationLogo={organizationLogo}
|
|
447
467
|
classes={classes}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { cn } from "@b3dotfun/sdk/shared/utils/cn";
|
|
4
|
+
import type { ReactNode } from "react";
|
|
4
5
|
import type { CheckoutItem, AnySpendCheckoutClasses } from "./AnySpendCheckout";
|
|
5
6
|
|
|
6
7
|
interface CartItemRowProps {
|
|
7
8
|
item: CheckoutItem;
|
|
8
|
-
formattedPrice:
|
|
9
|
+
formattedPrice: ReactNode;
|
|
9
10
|
classes?: AnySpendCheckoutClasses;
|
|
10
11
|
}
|
|
11
12
|
|