@b3dotfun/sdk 0.1.70-alpha.2 → 0.1.70-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/README.md +3 -3
- package/constants/chains/b3Chain.js +3 -1
- package/dist/cjs/anyspend/constants/rpc.d.ts +3 -1
- package/dist/cjs/anyspend/constants/rpc.js +6 -2
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +9 -1
- package/dist/cjs/anyspend/react/components/AnySpend.js +123 -46
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +8 -10
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +15 -3
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +78 -25
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +32 -13
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.js +32 -10
- package/dist/cjs/anyspend/react/components/QRDeposit.d.ts +22 -3
- package/dist/cjs/anyspend/react/components/QRDeposit.js +25 -16
- package/dist/cjs/anyspend/react/components/checkout/CryptoPayPanel.js +18 -11
- package/dist/cjs/anyspend/react/components/common/PureTransferView.d.ts +30 -0
- package/dist/cjs/anyspend/react/components/common/PureTransferView.js +64 -0
- package/dist/cjs/anyspend/react/components/common/TokenBalance.js +4 -5
- package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +3 -3
- package/dist/cjs/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/cjs/anyspend/utils/address.d.ts +2 -1
- package/dist/cjs/anyspend/utils/address.js +12 -9
- package/dist/cjs/anyspend/utils/chain.d.ts +84 -1
- package/dist/cjs/anyspend/utils/chain.js +73 -3
- package/dist/cjs/anyspend/utils/token.d.ts +2 -0
- package/dist/cjs/anyspend/utils/token.js +15 -1
- package/dist/cjs/app.shared.d.ts +9 -1
- package/dist/cjs/app.shared.js +19 -0
- package/dist/cjs/global-account/app.native.d.ts +1 -1
- package/dist/cjs/global-account/better-auth-client.d.ts +3314 -36
- package/dist/cjs/global-account/better-auth-client.js +28 -3
- package/dist/cjs/global-account/bsmnt.d.ts +2 -2
- package/dist/cjs/global-account/bsmnt.native.d.ts +1 -1
- package/dist/cjs/global-account/client-manager.d.ts +7 -5
- package/dist/cjs/global-account/client-manager.js +51 -4
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +6 -11
- package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +11 -0
- package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.js +12 -0
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +12 -2
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +25 -3
- package/dist/cjs/global-account/react/components/B3Provider/BetterAuthProvider.js +45 -4
- package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.d.ts +1 -2
- package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +11 -5
- package/dist/cjs/global-account/react/components/ManageAccount/ContentTokens.js +23 -15
- package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.js +2 -2
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +8 -6
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +1 -1
- package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.js +17 -8
- package/dist/cjs/global-account/react/components/Send/Send.js +15 -11
- package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +3 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -5
- package/dist/cjs/global-account/react/components/SignInWithB3/components/AuthButton.js +2 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +1 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +3 -2
- package/dist/cjs/global-account/react/components/SignInWithB3/utils/signInUtils.js +3 -3
- package/dist/cjs/global-account/react/components/index.d.ts +1 -1
- package/dist/cjs/global-account/react/components/index.js +3 -3
- package/dist/cjs/global-account/react/hooks/index.d.ts +2 -3
- package/dist/cjs/global-account/react/hooks/index.js +7 -10
- package/dist/cjs/global-account/react/hooks/useAuth.d.ts +5 -4
- package/dist/cjs/global-account/react/hooks/useAuth.js +1 -0
- package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +3 -2
- package/dist/cjs/global-account/react/hooks/useAuthentication.js +2 -1
- package/dist/cjs/global-account/react/hooks/useBetterAuth.d.ts +1657 -22
- package/dist/cjs/global-account/react/hooks/useBetterAuth.js +7 -7
- package/dist/cjs/global-account/react/hooks/useClient.d.ts +3 -3
- package/dist/cjs/global-account/react/hooks/useFirstEOA.d.ts +4 -7666
- package/dist/cjs/global-account/react/hooks/useFirstEOA.js +1 -0
- package/dist/cjs/global-account/react/hooks/useNativeBalance.js +2 -2
- package/dist/cjs/global-account/react/hooks/usePortfolioBalance.d.ts +15 -0
- package/dist/cjs/global-account/react/hooks/usePortfolioBalance.js +76 -0
- package/dist/cjs/global-account/react/hooks/usePortfolioCollectibles.d.ts +12 -0
- package/dist/cjs/global-account/react/hooks/usePortfolioCollectibles.js +178 -0
- package/dist/cjs/global-account/react/hooks/useSiwe.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useSiwe.native.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useTWAuth.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.d.ts +1 -0
- package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +37 -27
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +14 -2
- package/dist/cjs/global-account/types/b3-api.types.d.ts +5 -0
- package/dist/cjs/global-account/types/feature-flags.d.ts +5 -5
- package/dist/cjs/notifications/services/api.js +1 -0
- package/dist/cjs/shared/constants/chains/b3Chain.d.ts +30 -54
- package/dist/cjs/shared/constants/chains/b3Chain.js +5 -41
- package/dist/cjs/shared/constants/chains/supported.d.ts +1 -49
- package/dist/cjs/shared/constants/chains/supported.js +8 -36
- package/dist/cjs/shared/constants/index.d.ts +4 -0
- package/dist/cjs/shared/utils/chain-transformers.d.ts +4 -4
- package/dist/cjs/shared/utils/chain-transformers.js +38 -37
- package/dist/cjs/shared/utils/thirdweb-insights.js +2 -2
- package/dist/cjs/shared/utils/upload.d.ts +9 -0
- package/dist/cjs/shared/utils/upload.js +34 -0
- package/dist/cjs/shared/utils/zerionPositions.d.ts +96 -0
- package/dist/cjs/shared/utils/zerionPositions.js +188 -0
- package/dist/esm/anyspend/constants/rpc.d.ts +3 -1
- package/dist/esm/anyspend/constants/rpc.js +5 -1
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +9 -1
- package/dist/esm/anyspend/react/components/AnySpend.js +124 -47
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +9 -11
- package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +15 -3
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +80 -27
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +33 -14
- package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.js +33 -11
- package/dist/esm/anyspend/react/components/QRDeposit.d.ts +22 -3
- package/dist/esm/anyspend/react/components/QRDeposit.js +27 -18
- package/dist/esm/anyspend/react/components/checkout/CryptoPayPanel.js +21 -14
- package/dist/esm/anyspend/react/components/common/PureTransferView.d.ts +30 -0
- package/dist/esm/anyspend/react/components/common/PureTransferView.js +61 -0
- package/dist/esm/anyspend/react/components/common/TokenBalance.js +6 -7
- package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +3 -3
- package/dist/esm/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/esm/anyspend/utils/address.d.ts +2 -1
- package/dist/esm/anyspend/utils/address.js +9 -6
- package/dist/esm/anyspend/utils/chain.d.ts +84 -1
- package/dist/esm/anyspend/utils/chain.js +73 -5
- package/dist/esm/anyspend/utils/token.d.ts +2 -0
- package/dist/esm/anyspend/utils/token.js +13 -0
- package/dist/esm/app.shared.d.ts +9 -1
- package/dist/esm/app.shared.js +17 -0
- package/dist/esm/global-account/app.native.d.ts +1 -1
- package/dist/esm/global-account/better-auth-client.d.ts +3314 -36
- package/dist/esm/global-account/better-auth-client.js +27 -4
- package/dist/esm/global-account/bsmnt.d.ts +2 -2
- package/dist/esm/global-account/bsmnt.native.d.ts +1 -1
- package/dist/esm/global-account/client-manager.d.ts +7 -5
- package/dist/esm/global-account/client-manager.js +51 -5
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +6 -11
- package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +11 -0
- package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.js +11 -0
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +12 -2
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +26 -4
- package/dist/esm/global-account/react/components/B3Provider/BetterAuthProvider.js +46 -5
- package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.d.ts +1 -2
- package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +11 -5
- package/dist/esm/global-account/react/components/ManageAccount/ContentTokens.js +24 -16
- package/dist/esm/global-account/react/components/ManageAccount/NFTContent.js +3 -3
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +9 -7
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +1 -1
- package/dist/esm/global-account/react/components/ManageAccount/TokenContent.js +18 -9
- package/dist/esm/global-account/react/components/Send/Send.js +16 -12
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +3 -1
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -5
- package/dist/esm/global-account/react/components/SignInWithB3/components/AuthButton.js +2 -1
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +1 -0
- package/dist/esm/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +3 -2
- package/dist/esm/global-account/react/components/SignInWithB3/utils/signInUtils.js +3 -3
- package/dist/esm/global-account/react/components/index.d.ts +1 -1
- package/dist/esm/global-account/react/components/index.js +1 -1
- package/dist/esm/global-account/react/hooks/index.d.ts +2 -3
- package/dist/esm/global-account/react/hooks/index.js +2 -3
- package/dist/esm/global-account/react/hooks/useAuth.d.ts +5 -4
- package/dist/esm/global-account/react/hooks/useAuth.js +1 -0
- package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +3 -2
- package/dist/esm/global-account/react/hooks/useAuthentication.js +2 -1
- package/dist/esm/global-account/react/hooks/useBetterAuth.d.ts +1657 -22
- package/dist/esm/global-account/react/hooks/useBetterAuth.js +8 -8
- package/dist/esm/global-account/react/hooks/useClient.d.ts +3 -3
- package/dist/esm/global-account/react/hooks/useFirstEOA.d.ts +4 -7666
- package/dist/esm/global-account/react/hooks/useFirstEOA.js +1 -0
- package/dist/esm/global-account/react/hooks/useNativeBalance.js +1 -1
- package/dist/esm/global-account/react/hooks/usePortfolioBalance.d.ts +15 -0
- package/dist/esm/global-account/react/hooks/usePortfolioBalance.js +72 -0
- package/dist/esm/global-account/react/hooks/usePortfolioCollectibles.d.ts +12 -0
- package/dist/esm/global-account/react/hooks/usePortfolioCollectibles.js +175 -0
- package/dist/esm/global-account/react/hooks/useSiwe.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useSiwe.native.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useTWAuth.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.d.ts +1 -0
- package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +37 -27
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +14 -2
- package/dist/esm/global-account/types/b3-api.types.d.ts +5 -0
- package/dist/esm/global-account/types/feature-flags.d.ts +5 -5
- package/dist/esm/notifications/services/api.js +1 -0
- package/dist/esm/shared/constants/chains/b3Chain.d.ts +30 -54
- package/dist/esm/shared/constants/chains/b3Chain.js +4 -38
- package/dist/esm/shared/constants/chains/supported.d.ts +1 -49
- package/dist/esm/shared/constants/chains/supported.js +7 -35
- package/dist/esm/shared/constants/index.d.ts +4 -0
- package/dist/esm/shared/utils/chain-transformers.d.ts +4 -4
- package/dist/esm/shared/utils/chain-transformers.js +38 -37
- package/dist/esm/shared/utils/thirdweb-insights.js +2 -2
- package/dist/esm/shared/utils/upload.d.ts +9 -0
- package/dist/esm/shared/utils/upload.js +31 -0
- package/dist/esm/shared/utils/zerionPositions.d.ts +96 -0
- package/dist/esm/shared/utils/zerionPositions.js +180 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/constants/rpc.d.ts +3 -1
- package/dist/types/anyspend/react/components/AnySpend.d.ts +9 -1
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +15 -3
- package/dist/types/anyspend/react/components/QRDeposit.d.ts +22 -3
- package/dist/types/anyspend/react/components/common/PureTransferView.d.ts +30 -0
- package/dist/types/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +3 -3
- package/dist/types/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/types/anyspend/utils/address.d.ts +2 -1
- package/dist/types/anyspend/utils/chain.d.ts +84 -1
- package/dist/types/anyspend/utils/token.d.ts +2 -0
- package/dist/types/app.shared.d.ts +9 -1
- package/dist/types/global-account/app.native.d.ts +1 -1
- package/dist/types/global-account/better-auth-client.d.ts +3314 -36
- package/dist/types/global-account/bsmnt.d.ts +2 -2
- package/dist/types/global-account/bsmnt.native.d.ts +1 -1
- package/dist/types/global-account/client-manager.d.ts +7 -5
- package/dist/types/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +11 -0
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +12 -2
- package/dist/types/global-account/react/components/B3Provider/RelayKitProviderWrapper.d.ts +1 -2
- package/dist/types/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +3 -2
- package/dist/types/global-account/react/components/index.d.ts +1 -1
- package/dist/types/global-account/react/hooks/index.d.ts +2 -3
- package/dist/types/global-account/react/hooks/useAuth.d.ts +5 -4
- package/dist/types/global-account/react/hooks/useAuthentication.d.ts +3 -2
- package/dist/types/global-account/react/hooks/useBetterAuth.d.ts +1657 -22
- package/dist/types/global-account/react/hooks/useClient.d.ts +3 -3
- package/dist/types/global-account/react/hooks/useFirstEOA.d.ts +4 -7666
- package/dist/types/global-account/react/hooks/usePortfolioBalance.d.ts +15 -0
- package/dist/types/global-account/react/hooks/usePortfolioCollectibles.d.ts +12 -0
- package/dist/types/global-account/react/hooks/useSiwe.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useSiwe.native.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useTWAuth.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useUnifiedChainSwitchAndExecute.d.ts +1 -0
- package/dist/types/global-account/react/stores/useModalStore.d.ts +14 -2
- package/dist/types/global-account/types/b3-api.types.d.ts +5 -0
- package/dist/types/global-account/types/feature-flags.d.ts +5 -5
- package/dist/types/shared/constants/chains/b3Chain.d.ts +30 -54
- package/dist/types/shared/constants/chains/supported.d.ts +1 -49
- package/dist/types/shared/constants/index.d.ts +4 -0
- package/dist/types/shared/utils/chain-transformers.d.ts +4 -4
- package/dist/types/shared/utils/upload.d.ts +9 -0
- package/dist/types/shared/utils/zerionPositions.d.ts +96 -0
- package/node_modules/@b3/chain-registry/chains.json +1225 -0
- package/node_modules/@b3/chain-registry/dist/chains.json +1225 -0
- package/node_modules/@b3/chain-registry/dist/index.cjs +1676 -0
- package/node_modules/@b3/chain-registry/dist/index.d.cts +195 -0
- package/node_modules/@b3/chain-registry/dist/index.d.ts +195 -0
- package/node_modules/@b3/chain-registry/dist/index.mjs +1604 -0
- package/node_modules/@b3/chain-registry/dist/src/index.d.ts +193 -0
- package/node_modules/@b3/chain-registry/dist/src/index.js +408 -0
- package/node_modules/@b3/chain-registry/package.json +66 -0
- package/node_modules/@b3/chain-registry/src/index.test.ts +432 -0
- package/node_modules/@b3/chain-registry/src/index.ts +672 -0
- package/package.json +81 -30
- package/src/anyspend/README.md +2 -2
- package/src/anyspend/constants/rpc.ts +5 -2
- package/src/anyspend/docs/components.md +6 -6
- package/src/anyspend/docs/contributing.md +1 -1
- package/src/anyspend/docs/hooks.md +3 -3
- package/src/anyspend/docs/installation.md +2 -2
- package/src/anyspend/react/components/AnySpend.tsx +163 -47
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +10 -11
- package/src/anyspend/react/components/AnySpendDeposit.tsx +130 -31
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +55 -14
- package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +55 -11
- package/src/anyspend/react/components/QRDeposit.tsx +101 -22
- package/src/anyspend/react/components/__tests__/QRDeposit.test.tsx +331 -0
- package/src/anyspend/react/components/checkout/CryptoPayPanel.tsx +38 -16
- package/src/anyspend/react/components/common/PureTransferView.tsx +212 -0
- package/src/anyspend/react/components/common/TokenBalance.tsx +10 -7
- package/src/anyspend/react/hooks/useAnyspendQuote.ts +13 -13
- package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +4 -4
- package/src/anyspend/services/gas.test.ts +95 -18
- package/src/anyspend/types/api_req_res.ts +10 -5
- package/src/anyspend/utils/__tests__/address.test.ts +39 -0
- package/src/anyspend/utils/__tests__/deprecatedChains.test.ts +44 -0
- package/src/anyspend/utils/__tests__/toRegistryChainId.test.ts +17 -0
- package/src/anyspend/utils/address.ts +8 -6
- package/src/anyspend/utils/chain.ts +79 -3
- package/src/anyspend/utils/token.ts +14 -0
- package/src/app.shared.ts +21 -1
- package/src/global-account/app.native.ts +5 -1
- package/src/global-account/better-auth-client.ts +30 -4
- package/src/global-account/bsmnt.native.ts +5 -1
- package/src/global-account/bsmnt.ts +9 -2
- package/src/global-account/client-manager.ts +74 -9
- package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +6 -11
- package/src/global-account/react/components/B3Provider/B3ConfigProvider.tsx +12 -0
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +40 -4
- package/src/global-account/react/components/B3Provider/BetterAuthProvider.tsx +51 -5
- package/src/global-account/react/components/B3Provider/RelayKitProviderWrapper.tsx +11 -11
- package/src/global-account/react/components/ManageAccount/ContentTokens.tsx +50 -21
- package/src/global-account/react/components/ManageAccount/NFTContent.tsx +5 -3
- package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +10 -6
- package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +1 -1
- package/src/global-account/react/components/ManageAccount/TokenContent.tsx +22 -9
- package/src/global-account/react/components/Send/Send.tsx +39 -15
- package/src/global-account/react/components/SignInWithB3/BetterAuthSignIn.tsx +12 -1
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +1 -4
- package/src/global-account/react/components/SignInWithB3/components/AuthButton.tsx +9 -1
- package/src/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.tsx +1 -0
- package/src/global-account/react/components/SignInWithB3/utils/signInUtils.ts +4 -4
- package/src/global-account/react/components/index.ts +1 -1
- package/src/global-account/react/components/ui/button.tsx +1 -2
- package/src/global-account/react/hooks/__tests__/useUnifiedChainSwitchAndExecute.test.tsx +156 -0
- package/src/global-account/react/hooks/index.ts +2 -3
- package/src/global-account/react/hooks/useAuth.ts +5 -4
- package/src/global-account/react/hooks/useAuthentication.ts +5 -4
- package/src/global-account/react/hooks/useBetterAuth.ts +10 -10
- package/src/global-account/react/hooks/useClient.ts +11 -2
- package/src/global-account/react/hooks/useFirstEOA.tsx +9 -2
- package/src/global-account/react/hooks/useNativeBalance.tsx +1 -1
- package/src/global-account/react/hooks/usePortfolioBalance.ts +89 -0
- package/src/global-account/react/hooks/usePortfolioCollectibles.ts +212 -0
- package/src/global-account/react/hooks/useSiwe.native.tsx +1 -1
- package/src/global-account/react/hooks/useSiwe.tsx +1 -1
- package/src/global-account/react/hooks/useTWAuth.tsx +1 -1
- package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +47 -31
- package/src/global-account/react/stores/useModalStore.ts +14 -2
- package/src/global-account/types/b3-api.types.ts +5 -1
- package/src/notifications/services/api.ts +1 -0
- package/src/shared/constants/chains/b3Chain.ts +4 -43
- package/src/shared/constants/chains/supported.ts +9 -48
- package/src/shared/constants/index.ts +8 -0
- package/src/shared/react/hooks/__tests__/useCurrencyConversion.test.ts +54 -43
- package/src/shared/utils/__tests__/zerionPositions.test.ts +248 -0
- package/src/shared/utils/chain-transformers.ts +41 -39
- package/src/shared/utils/thirdweb-insights.ts +2 -2
- package/src/shared/utils/upload.ts +48 -0
- package/src/shared/utils/zerionPositions.ts +247 -0
- package/src/styles/index.css +27 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.d.ts +0 -10
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +0 -46
- package/dist/cjs/global-account/react/hooks/useHandleConnectWithPrivy.d.ts +0 -11
- package/dist/cjs/global-account/react/hooks/useHandleConnectWithPrivy.js +0 -70
- package/dist/cjs/global-account/react/hooks/useSimBalance.d.ts +0 -59
- package/dist/cjs/global-account/react/hooks/useSimBalance.js +0 -98
- package/dist/cjs/global-account/react/hooks/useSimCollectibles.d.ts +0 -45
- package/dist/cjs/global-account/react/hooks/useSimCollectibles.js +0 -190
- package/dist/cjs/global-account/react/utils/simdune.d.ts +0 -7
- package/dist/cjs/global-account/react/utils/simdune.js +0 -21
- package/dist/cjs/global-account/types/chain-networks.d.ts +0 -44
- package/dist/cjs/global-account/types/chain-networks.js +0 -48
- package/dist/cjs/shared/generated/chain-networks.json +0 -684
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.d.ts +0 -10
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +0 -43
- package/dist/esm/global-account/react/hooks/useHandleConnectWithPrivy.d.ts +0 -11
- package/dist/esm/global-account/react/hooks/useHandleConnectWithPrivy.js +0 -67
- package/dist/esm/global-account/react/hooks/useSimBalance.d.ts +0 -59
- package/dist/esm/global-account/react/hooks/useSimBalance.js +0 -93
- package/dist/esm/global-account/react/hooks/useSimCollectibles.d.ts +0 -45
- package/dist/esm/global-account/react/hooks/useSimCollectibles.js +0 -187
- package/dist/esm/global-account/react/utils/simdune.d.ts +0 -7
- package/dist/esm/global-account/react/utils/simdune.js +0 -17
- package/dist/esm/global-account/types/chain-networks.d.ts +0 -44
- package/dist/esm/global-account/types/chain-networks.js +0 -45
- package/dist/esm/shared/generated/chain-networks.json +0 -684
- package/dist/types/global-account/react/components/SignInWithB3/SignInWithB3Privy.d.ts +0 -10
- package/dist/types/global-account/react/hooks/useHandleConnectWithPrivy.d.ts +0 -11
- package/dist/types/global-account/react/hooks/useSimBalance.d.ts +0 -59
- package/dist/types/global-account/react/hooks/useSimCollectibles.d.ts +0 -45
- package/dist/types/global-account/react/utils/simdune.d.ts +0 -7
- package/dist/types/global-account/types/chain-networks.d.ts +0 -44
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Privy.tsx +0 -63
- package/src/global-account/react/hooks/useHandleConnectWithPrivy.tsx +0 -79
- package/src/global-account/react/hooks/useSimBalance.ts +0 -164
- package/src/global-account/react/hooks/useSimCollectibles.ts +0 -238
- package/src/global-account/react/utils/simdune.ts +0 -20
- package/src/global-account/types/chain-networks.ts +0 -54
- package/src/shared/generated/chain-networks.json +0 -684
|
@@ -2,16 +2,41 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.betterAuthClient = void 0;
|
|
4
4
|
exports.createB3BetterAuthClient = createB3BetterAuthClient;
|
|
5
|
+
exports.getBetterAuthClient = getBetterAuthClient;
|
|
6
|
+
exports.resetBetterAuthClient = resetBetterAuthClient;
|
|
5
7
|
const client_1 = require("better-auth/client");
|
|
8
|
+
const plugins_1 = require("better-auth/client/plugins");
|
|
6
9
|
const app_shared_1 = require("../app.shared");
|
|
7
|
-
function createB3BetterAuthClient(baseURL
|
|
10
|
+
function createB3BetterAuthClient(baseURL) {
|
|
8
11
|
return (0, client_1.createAuthClient)({
|
|
9
|
-
baseURL,
|
|
12
|
+
baseURL: baseURL ?? (0, app_shared_1.getB3ApiUrl)(),
|
|
10
13
|
basePath: "/auth",
|
|
11
14
|
fetchOptions: {
|
|
12
15
|
credentials: "include",
|
|
13
16
|
},
|
|
17
|
+
plugins: [(0, plugins_1.twoFactorClient)()],
|
|
14
18
|
});
|
|
15
19
|
}
|
|
16
|
-
//
|
|
20
|
+
// Lazily-initialized singleton. Recreated when the API URL changes via
|
|
21
|
+
// `resetBetterAuthClient()` (called by B3Provider when `apiUrl` changes).
|
|
22
|
+
let _client = null;
|
|
23
|
+
let _clientUrl = null;
|
|
24
|
+
/** Get the shared BetterAuth client, creating it if needed. */
|
|
25
|
+
function getBetterAuthClient() {
|
|
26
|
+
const url = (0, app_shared_1.getB3ApiUrl)();
|
|
27
|
+
if (!_client || _clientUrl !== url) {
|
|
28
|
+
_client = createB3BetterAuthClient(url);
|
|
29
|
+
_clientUrl = url;
|
|
30
|
+
}
|
|
31
|
+
return _client;
|
|
32
|
+
}
|
|
33
|
+
/** Force-recreate the client on next access (e.g. after API URL change). */
|
|
34
|
+
function resetBetterAuthClient() {
|
|
35
|
+
_client = null;
|
|
36
|
+
_clientUrl = null;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use `getBetterAuthClient()` instead. This static singleton
|
|
40
|
+
* does not reflect runtime API URL changes via `B3Provider apiUrl` prop.
|
|
41
|
+
*/
|
|
17
42
|
exports.betterAuthClient = createB3BetterAuthClient();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const app: import("@b3dotfun/basement-api").ClientApplication;
|
|
2
|
-
export declare const authenticate: (accessToken: string, identityToken: string, params?: Record<string, any>) => Promise<
|
|
2
|
+
export declare const authenticate: (accessToken: string, identityToken: string, params?: Record<string, any>) => Promise<Record<string, any> | null>;
|
|
3
3
|
export declare const resetSocket: () => void;
|
|
4
|
-
export declare const authenticateWithB3JWT: (fullToken: string, params?: Record<string, any>) => Promise<
|
|
4
|
+
export declare const authenticateWithB3JWT: (fullToken: string, params?: Record<string, any>) => Promise<Record<string, any> | null>;
|
|
5
5
|
export default app;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MMKV } from "react-native-mmkv";
|
|
2
2
|
export declare const localStoreInstance: MMKV;
|
|
3
3
|
declare const app: import("@b3dotfun/basement-api").ClientApplication;
|
|
4
|
-
export declare const authenticate: (accessToken: string, identityToken: string, params?: Record<string, any>) => Promise<
|
|
4
|
+
export declare const authenticate: (accessToken: string, identityToken: string, params?: Record<string, any>) => Promise<Record<string, any> | null>;
|
|
5
5
|
export default app;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ClientApplication } from "@b3dotfun/b3-api";
|
|
2
2
|
export type ClientType = "socket" | "rest";
|
|
3
|
+
/** Reset all cached clients (called when API URL changes). */
|
|
4
|
+
export declare function resetClients(): void;
|
|
3
5
|
/**
|
|
4
6
|
* Sets the active client type and creates the appropriate client
|
|
5
7
|
*
|
|
@@ -25,20 +27,20 @@ export declare function resetSocket(): void;
|
|
|
25
27
|
/**
|
|
26
28
|
* Authenticates with the current active client
|
|
27
29
|
*/
|
|
28
|
-
export declare const authenticate: (accessToken: string, identityToken: string, params?: Record<string, any>) => Promise<
|
|
30
|
+
export declare const authenticate: (accessToken: string, identityToken: string, params?: Record<string, any>) => Promise<Record<string, any> | null>;
|
|
29
31
|
/**
|
|
30
32
|
* Authenticates with a specific client type
|
|
31
33
|
*/
|
|
32
|
-
export declare const authenticateWithClient: (clientType: ClientType, accessToken: string, identityToken: string, params?: Record<string, any>) => Promise<
|
|
34
|
+
export declare const authenticateWithClient: (clientType: ClientType, accessToken: string, identityToken: string, params?: Record<string, any>) => Promise<Record<string, any> | null>;
|
|
33
35
|
/**
|
|
34
36
|
* Authenticates with both clients in parallel (useful for migration scenarios)
|
|
35
37
|
*/
|
|
36
38
|
export declare const authenticateBoth: (accessToken: string, identityToken: string, params?: Record<string, any>) => Promise<{
|
|
37
|
-
socket:
|
|
38
|
-
rest:
|
|
39
|
+
socket: Record<string, any> | null;
|
|
40
|
+
rest: Record<string, any> | null;
|
|
39
41
|
success: boolean;
|
|
40
42
|
}>;
|
|
41
43
|
/**
|
|
42
44
|
* Switches the client type and authenticates
|
|
43
45
|
*/
|
|
44
|
-
export declare function switchClientAndAuth(type: ClientType, access: string, id: string, params?: any): Promise<
|
|
46
|
+
export declare function switchClientAndAuth(type: ClientType, access: string, id: string, params?: any): Promise<Record<string, any> | null>;
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.authenticateBoth = exports.authenticateWithClient = exports.authenticate = void 0;
|
|
7
|
+
exports.resetClients = resetClients;
|
|
7
8
|
exports.setClientType = setClientType;
|
|
8
9
|
exports.getClient = getClient;
|
|
9
10
|
exports.getClientType = getClientType;
|
|
@@ -21,15 +22,50 @@ let currentClient = null;
|
|
|
21
22
|
// Socket client instance
|
|
22
23
|
let socketClient = null;
|
|
23
24
|
let socketInstance = null;
|
|
25
|
+
let socketClientUrl = null;
|
|
24
26
|
// REST client instance
|
|
25
27
|
let restClient = null;
|
|
28
|
+
let restClientUrl = null;
|
|
29
|
+
// The pinned @b3dotfun/b3-api client's generated usersMethods predates `setBio`,
|
|
30
|
+
// so `users.setBio(...)` throws "setBio is not a function". Re-register the users
|
|
31
|
+
// service with the full list (mirrors users.shared.ts). Remove once the
|
|
32
|
+
// @b3dotfun/b3-api pin includes setBio.
|
|
33
|
+
const USERS_METHODS = [
|
|
34
|
+
"find",
|
|
35
|
+
"get",
|
|
36
|
+
"create",
|
|
37
|
+
"patch",
|
|
38
|
+
"remove",
|
|
39
|
+
"setReferralCode",
|
|
40
|
+
"syncTwProfiles",
|
|
41
|
+
"setAvatar",
|
|
42
|
+
"setBio",
|
|
43
|
+
"registerUsername",
|
|
44
|
+
"getMe",
|
|
45
|
+
];
|
|
46
|
+
// Re-register on every client the manager builds — the active transport
|
|
47
|
+
// (REST/socket) switches at runtime.
|
|
48
|
+
function ensureUsersCustomMethods(client) {
|
|
49
|
+
try {
|
|
50
|
+
const connection = client.get("connection");
|
|
51
|
+
if (connection?.service) {
|
|
52
|
+
client.use("users", connection.service("users"), { methods: USERS_METHODS });
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
// Non-fatal: keep whatever methods the generated client already exposes.
|
|
57
|
+
}
|
|
58
|
+
}
|
|
26
59
|
/**
|
|
27
60
|
* Creates a socket client
|
|
28
61
|
*/
|
|
29
62
|
function createSocketClient() {
|
|
30
|
-
|
|
31
|
-
|
|
63
|
+
const url = (0, app_shared_1.getB3ApiUrl)();
|
|
64
|
+
if (!socketClient || socketClientUrl !== url) {
|
|
65
|
+
socketInstance = (0, socket_io_client_1.default)(url, { transports: ["websocket"] });
|
|
32
66
|
socketClient = (0, b3_api_1.createClient)((0, socketio_client_1.default)(socketInstance), app_shared_1.clientOptions);
|
|
67
|
+
ensureUsersCustomMethods(socketClient);
|
|
68
|
+
socketClientUrl = url;
|
|
33
69
|
}
|
|
34
70
|
return socketClient;
|
|
35
71
|
}
|
|
@@ -45,12 +81,23 @@ function resolveFetch() {
|
|
|
45
81
|
return require("cross-fetch").fetch;
|
|
46
82
|
}
|
|
47
83
|
function createRestClient() {
|
|
48
|
-
|
|
49
|
-
|
|
84
|
+
const url = (0, app_shared_1.getB3ApiUrl)();
|
|
85
|
+
if (!restClient || restClientUrl !== url) {
|
|
86
|
+
const connection = (0, rest_client_1.default)(url).fetch(resolveFetch());
|
|
50
87
|
restClient = (0, b3_api_1.createClient)(connection, app_shared_1.clientOptions);
|
|
88
|
+
ensureUsersCustomMethods(restClient);
|
|
89
|
+
restClientUrl = url;
|
|
51
90
|
}
|
|
52
91
|
return restClient;
|
|
53
92
|
}
|
|
93
|
+
/** Reset all cached clients (called when API URL changes). */
|
|
94
|
+
function resetClients() {
|
|
95
|
+
socketClient = null;
|
|
96
|
+
socketClientUrl = null;
|
|
97
|
+
restClient = null;
|
|
98
|
+
restClientUrl = null;
|
|
99
|
+
currentClient = null;
|
|
100
|
+
}
|
|
54
101
|
/**
|
|
55
102
|
* Sets the active client type and creates the appropriate client
|
|
56
103
|
*
|
|
@@ -12,13 +12,12 @@ const profileDisplay_1 = require("../../../../global-account/react/utils/profile
|
|
|
12
12
|
const cn_1 = require("../../../../shared/utils/cn");
|
|
13
13
|
const debug_1 = require("../../../../shared/utils/debug");
|
|
14
14
|
const ipfs_1 = require("../../../../shared/utils/ipfs");
|
|
15
|
-
const
|
|
15
|
+
const upload_1 = require("../../../../shared/utils/upload");
|
|
16
16
|
const lucide_react_1 = require("lucide-react");
|
|
17
17
|
const react_2 = require("react");
|
|
18
18
|
const react_easy_crop_1 = __importDefault(require("react-easy-crop"));
|
|
19
19
|
require("react-easy-crop/react-easy-crop.css");
|
|
20
20
|
const react_3 = require("thirdweb/react");
|
|
21
|
-
const storage_1 = require("thirdweb/storage");
|
|
22
21
|
const stores_1 = require("../../stores");
|
|
23
22
|
const ModalHeader_1 = __importDefault(require("../ModalHeader/ModalHeader"));
|
|
24
23
|
const debug = (0, debug_1.debugB3React)("AvatarEditor");
|
|
@@ -201,18 +200,14 @@ function AvatarEditor({ onSetAvatar, className }) {
|
|
|
201
200
|
return;
|
|
202
201
|
}
|
|
203
202
|
}
|
|
204
|
-
// Upload
|
|
203
|
+
// Upload file if we have one
|
|
205
204
|
if (fileToUpload) {
|
|
206
|
-
debug("Starting upload
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
client: thirdweb_1.client,
|
|
210
|
-
files: [fileToUpload],
|
|
211
|
-
});
|
|
212
|
-
debug("Upload successful", ipfsUrl);
|
|
205
|
+
debug("Starting upload", fileToUpload);
|
|
206
|
+
const avatarUrl = await (0, upload_1.uploadFile)(fileToUpload);
|
|
207
|
+
debug("Upload successful", avatarUrl);
|
|
213
208
|
// Save avatar URL using profiles service
|
|
214
209
|
const user = await app_1.default.service("users").setAvatar({
|
|
215
|
-
avatar:
|
|
210
|
+
avatar: avatarUrl,
|
|
216
211
|
},
|
|
217
212
|
// @ts-expect-error - our typed client is expecting context even though it's set elsewhere
|
|
218
213
|
{});
|
|
@@ -30,3 +30,14 @@ export declare function B3ConfigProvider({ children, accountOverride, environmen
|
|
|
30
30
|
authStrategy?: AuthStrategy;
|
|
31
31
|
}): import("react/jsx-runtime").JSX.Element;
|
|
32
32
|
export declare function useB3Config(): B3ConfigContextType;
|
|
33
|
+
/**
|
|
34
|
+
* Overrides ONLY `partnerId` for a subtree, inheriting every other config value from the parent
|
|
35
|
+
* B3ConfigProvider. Lets a single route attribute its AnySpend orders/quotes to a different partner
|
|
36
|
+
* (e.g. `/b3os-deposit` → the b3os partner) without standing up a second B3Provider — the config
|
|
37
|
+
* context is separate from the wallet/modal machinery, so nothing re-initializes. Must be rendered
|
|
38
|
+
* inside an existing B3ConfigProvider.
|
|
39
|
+
*/
|
|
40
|
+
export declare function B3ConfigPartnerOverride({ partnerId, children }: {
|
|
41
|
+
partnerId: string;
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.B3ConfigProvider = B3ConfigProvider;
|
|
4
4
|
exports.useB3Config = useB3Config;
|
|
5
|
+
exports.B3ConfigPartnerOverride = B3ConfigPartnerOverride;
|
|
5
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
7
|
const react_1 = require("react");
|
|
7
8
|
/**
|
|
@@ -35,3 +36,14 @@ function useB3Config() {
|
|
|
35
36
|
}
|
|
36
37
|
return context;
|
|
37
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Overrides ONLY `partnerId` for a subtree, inheriting every other config value from the parent
|
|
41
|
+
* B3ConfigProvider. Lets a single route attribute its AnySpend orders/quotes to a different partner
|
|
42
|
+
* (e.g. `/b3os-deposit` → the b3os partner) without standing up a second B3Provider — the config
|
|
43
|
+
* context is separate from the wallet/modal machinery, so nothing re-initializes. Must be rendered
|
|
44
|
+
* inside an existing B3ConfigProvider.
|
|
45
|
+
*/
|
|
46
|
+
function B3ConfigPartnerOverride({ partnerId, children }) {
|
|
47
|
+
const parent = useB3Config();
|
|
48
|
+
return (0, jsx_runtime_1.jsx)(B3ConfigContext.Provider, { value: { ...parent, partnerId }, children: children });
|
|
49
|
+
}
|
|
@@ -10,7 +10,7 @@ import { ClientType } from "../../../client-manager";
|
|
|
10
10
|
/**
|
|
11
11
|
* Main B3Provider component
|
|
12
12
|
*/
|
|
13
|
-
export declare function B3Provider({ theme, children, accountOverride, environment, automaticallySetFirstEoa, defaultEoaProvider,
|
|
13
|
+
export declare function B3Provider({ theme, children, accountOverride, environment, automaticallySetFirstEoa, defaultEoaProvider, toaster: _toaster, clientType, rpcUrls, partnerId, stripePublishableKey, onConnect, onLogout, connectors, overrideDefaultConnectors, createClientReferenceId, defaultPermissions, disableBSMNTAuthentication, queryClient, authStrategy, apiUrl, notificationsApiUrl, }: {
|
|
14
14
|
theme: "light" | "dark";
|
|
15
15
|
children: React.ReactNode;
|
|
16
16
|
accountOverride?: Account;
|
|
@@ -18,7 +18,6 @@ export declare function B3Provider({ theme, children, accountOverride, environme
|
|
|
18
18
|
automaticallySetFirstEoa?: boolean;
|
|
19
19
|
/** EIP-1193 provider to auto-connect as the default EOA wallet (e.g., Farcaster frame wallet) */
|
|
20
20
|
defaultEoaProvider?: EIP1193.EIP1193Provider;
|
|
21
|
-
simDuneApiKey?: string;
|
|
22
21
|
toaster?: {
|
|
23
22
|
position?: "top-center" | "top-right" | "bottom-center" | "bottom-right";
|
|
24
23
|
style?: React.CSSProperties;
|
|
@@ -39,4 +38,15 @@ export declare function B3Provider({ theme, children, accountOverride, environme
|
|
|
39
38
|
queryClient?: QueryClient;
|
|
40
39
|
/** Auth strategy: "thirdweb" (default, ecosystem wallet) or "better-auth" (email/password via Better Auth) */
|
|
41
40
|
authStrategy?: AuthStrategy;
|
|
41
|
+
/**
|
|
42
|
+
* Override the B3 API URL. When provided, all SDK requests (auth, Feathers,
|
|
43
|
+
* BetterAuth) will use this URL instead of the `NEXT_PUBLIC_B3_API` env var.
|
|
44
|
+
*
|
|
45
|
+
* Useful for local development: pass `http://localhost:3031` to route
|
|
46
|
+
* OAuth callbacks and session checks through your local B3 API.
|
|
47
|
+
* If omitted, defaults to `NEXT_PUBLIC_B3_API` or `https://api.b3.fun`.
|
|
48
|
+
*/
|
|
49
|
+
apiUrl?: string;
|
|
50
|
+
/** Override the notifications worker URL. Defaults to `https://notifications.b3.fun`. */
|
|
51
|
+
notificationsApiUrl?: string;
|
|
42
52
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,18 +12,40 @@ const react_2 = require("../../../../wallet/react");
|
|
|
12
12
|
require("@relayprotocol/relay-kit-ui/styles.css");
|
|
13
13
|
const react_3 = require("react");
|
|
14
14
|
const client_manager_1 = require("../../../client-manager");
|
|
15
|
+
const app_shared_1 = require("../../../../app.shared");
|
|
16
|
+
const api_1 = require("../../../../notifications/services/api");
|
|
17
|
+
const better_auth_client_1 = require("../../../better-auth-client");
|
|
15
18
|
const StyleRoot_1 = require("../StyleRoot");
|
|
16
19
|
const index_1 = require("../Toast/index");
|
|
17
20
|
const AuthenticationProvider_1 = __importDefault(require("./AuthenticationProvider"));
|
|
18
21
|
const B3ConfigProvider_1 = require("./B3ConfigProvider");
|
|
19
22
|
const BetterAuthProvider_1 = __importDefault(require("./BetterAuthProvider"));
|
|
20
23
|
const LocalSDKProvider_1 = require("./LocalSDKProvider");
|
|
24
|
+
const NOTIFICATIONS_URL_BY_ENV = {
|
|
25
|
+
development: "https://dev-notifications.b3.fun",
|
|
26
|
+
production: "https://notifications.b3.fun",
|
|
27
|
+
};
|
|
21
28
|
/**
|
|
22
29
|
* Main B3Provider component
|
|
23
30
|
*/
|
|
24
|
-
function B3Provider({ theme = "light", children, accountOverride, environment, automaticallySetFirstEoa, defaultEoaProvider,
|
|
31
|
+
function B3Provider({ theme = "light", children, accountOverride, environment, automaticallySetFirstEoa, defaultEoaProvider,
|
|
25
32
|
// deprecated since v0.0.87
|
|
26
|
-
toaster: _toaster, clientType = "rest", rpcUrls, partnerId, stripePublishableKey, onConnect, onLogout, connectors, overrideDefaultConnectors = false, createClientReferenceId, defaultPermissions, disableBSMNTAuthentication = false, queryClient, authStrategy = "thirdweb", }) {
|
|
33
|
+
toaster: _toaster, clientType = "rest", rpcUrls, partnerId, stripePublishableKey, onConnect, onLogout, connectors, overrideDefaultConnectors = false, createClientReferenceId, defaultPermissions, disableBSMNTAuthentication = false, queryClient, authStrategy = "thirdweb", apiUrl, notificationsApiUrl, }) {
|
|
34
|
+
// Override the B3 API URL when the `apiUrl` prop is provided.
|
|
35
|
+
// Must run before client initialization and auth providers mount.
|
|
36
|
+
(0, react_3.useEffect)(() => {
|
|
37
|
+
(0, app_shared_1.setB3ApiUrl)(apiUrl ?? null);
|
|
38
|
+
if (apiUrl) {
|
|
39
|
+
(0, better_auth_client_1.resetBetterAuthClient)();
|
|
40
|
+
(0, client_manager_1.resetClients)();
|
|
41
|
+
}
|
|
42
|
+
return () => {
|
|
43
|
+
(0, app_shared_1.setB3ApiUrl)(null);
|
|
44
|
+
};
|
|
45
|
+
}, [apiUrl]);
|
|
46
|
+
(0, react_3.useEffect)(() => {
|
|
47
|
+
(0, api_1.setApiUrl)(notificationsApiUrl ?? NOTIFICATIONS_URL_BY_ENV[environment ?? "production"]);
|
|
48
|
+
}, [notificationsApiUrl, environment]);
|
|
27
49
|
// Initialize Google Analytics on mount
|
|
28
50
|
(0, react_3.useEffect)(() => {
|
|
29
51
|
(0, analytics_1.loadGA4Script)();
|
|
@@ -33,7 +55,7 @@ toaster: _toaster, clientType = "rest", rpcUrls, partnerId, stripePublishableKey
|
|
|
33
55
|
(0, client_manager_1.setClientType)(clientType);
|
|
34
56
|
}, [clientType]);
|
|
35
57
|
const wagmiConfig = (0, react_3.useMemo)(() => (0, createWagmiConfig_1.createWagmiConfig)({ partnerId, rpcUrls, connectors, overrideDefaultConnectors }), [partnerId, rpcUrls, connectors, overrideDefaultConnectors]);
|
|
36
|
-
return ((0, jsx_runtime_1.jsx)(react_2.WalletProvider, { wagmiConfig: wagmiConfig, queryClient: queryClient, children: (0, jsx_runtime_1.jsx)(react_1.TooltipProvider, { children: (0, jsx_runtime_1.jsx)(index_1.ToastProvider, { children: (0, jsx_runtime_1.jsx)(LocalSDKProvider_1.LocalSDKProvider, { onConnectCallback: onConnect, onLogoutCallback: onLogout, disableBSMNTAuthentication: disableBSMNTAuthentication, children: (0, jsx_runtime_1.jsxs)(B3ConfigProvider_1.B3ConfigProvider, { accountOverride: accountOverride, environment: environment, automaticallySetFirstEoa: !!automaticallySetFirstEoa, theme: theme, clientType: clientType, partnerId: partnerId, stripePublishableKey: stripePublishableKey, createClientReferenceId: createClientReferenceId, defaultPermissions: defaultPermissions, authStrategy: authStrategy, children: [(0, jsx_runtime_1.jsx)(ToastContextConnector, {}), (0, jsx_runtime_1.jsxs)(react_1.RelayKitProviderWrapper, {
|
|
58
|
+
return ((0, jsx_runtime_1.jsx)(react_2.WalletProvider, { wagmiConfig: wagmiConfig, queryClient: queryClient, children: (0, jsx_runtime_1.jsx)(react_1.TooltipProvider, { children: (0, jsx_runtime_1.jsx)(index_1.ToastProvider, { children: (0, jsx_runtime_1.jsx)(LocalSDKProvider_1.LocalSDKProvider, { onConnectCallback: onConnect, onLogoutCallback: onLogout, disableBSMNTAuthentication: disableBSMNTAuthentication, children: (0, jsx_runtime_1.jsxs)(B3ConfigProvider_1.B3ConfigProvider, { accountOverride: accountOverride, environment: environment, automaticallySetFirstEoa: !!automaticallySetFirstEoa, theme: theme, clientType: clientType, partnerId: partnerId, stripePublishableKey: stripePublishableKey, createClientReferenceId: createClientReferenceId, defaultPermissions: defaultPermissions, authStrategy: authStrategy, children: [(0, jsx_runtime_1.jsx)(ToastContextConnector, {}), (0, jsx_runtime_1.jsxs)(react_1.RelayKitProviderWrapper, { children: [children, (0, jsx_runtime_1.jsx)(StyleRoot_1.StyleRoot, { id: "b3-root" })] }), authStrategy === "better-auth" ? ((0, jsx_runtime_1.jsx)(BetterAuthProvider_1.default, { partnerId: partnerId })) : ((0, jsx_runtime_1.jsx)(AuthenticationProvider_1.default, { partnerId: partnerId, automaticallySetFirstEoa: !!automaticallySetFirstEoa, defaultEoaProvider: defaultEoaProvider }))] }) }) }) }) }));
|
|
37
59
|
}
|
|
38
60
|
/**
|
|
39
61
|
* Component to connect the toast context to the global toast API
|
|
@@ -45,7 +45,7 @@ const BetterAuthProvider = ({ partnerId }) => {
|
|
|
45
45
|
app_1.default.logout = async () => {
|
|
46
46
|
debug("Patched logout: clearing Better Auth session");
|
|
47
47
|
try {
|
|
48
|
-
await better_auth_client_1.
|
|
48
|
+
await (0, better_auth_client_1.getBetterAuthClient)().signOut();
|
|
49
49
|
}
|
|
50
50
|
catch {
|
|
51
51
|
debug("Better Auth signOut failed (non-critical)");
|
|
@@ -79,9 +79,50 @@ const BetterAuthProvider = ({ partnerId }) => {
|
|
|
79
79
|
catch {
|
|
80
80
|
debug("No existing Feathers JWT");
|
|
81
81
|
}
|
|
82
|
-
// 2. Check for
|
|
82
|
+
// 2. Check for _ba_token in URL (OAuth callback with third-party cookie bypass).
|
|
83
|
+
// When the API and frontend are on different domains, browsers with third-party
|
|
84
|
+
// cookie blocking (Firefox TCP, Safari ITP, Chrome Privacy Sandbox) prevent the
|
|
85
|
+
// better-auth.session_token cookie from being sent on cross-origin requests.
|
|
86
|
+
// The B3 API injects the session token into the redirect URL as _ba_token,
|
|
87
|
+
// allowing direct exchange without relying on cookies.
|
|
88
|
+
const params = new URLSearchParams(window.location.search);
|
|
89
|
+
const baToken = params.get("_ba_token");
|
|
90
|
+
if (baToken) {
|
|
91
|
+
debug("Found _ba_token in URL, exchanging for Feathers JWT");
|
|
92
|
+
// Clean the token from the URL immediately (security)
|
|
93
|
+
params.delete("_ba_token");
|
|
94
|
+
const cleanSearch = params.toString();
|
|
95
|
+
const cleanUrl = window.location.pathname + (cleanSearch ? `?${cleanSearch}` : "") + window.location.hash;
|
|
96
|
+
window.history.replaceState({}, "", cleanUrl);
|
|
97
|
+
try {
|
|
98
|
+
const response = await app_1.default.authenticate({
|
|
99
|
+
strategy: "better-auth",
|
|
100
|
+
accessToken: baToken,
|
|
101
|
+
partnerId,
|
|
102
|
+
});
|
|
103
|
+
if (response.accessToken) {
|
|
104
|
+
js_cookie_1.default.set(constants_1.B3_AUTH_COOKIE_NAME, response.accessToken, {
|
|
105
|
+
secure: true,
|
|
106
|
+
sameSite: "Lax",
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
if (response.user) {
|
|
110
|
+
setUser(response.user);
|
|
111
|
+
setIsAuthenticated(true);
|
|
112
|
+
setIsConnected(true);
|
|
113
|
+
}
|
|
114
|
+
debug("_ba_token exchanged for Feathers JWT", { userId: response.user?.userId });
|
|
115
|
+
setIsAuthenticating(false);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
catch (err) {
|
|
119
|
+
debug("_ba_token exchange failed", err);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// 3. Check for a Better Auth session via cookie (works when API and frontend
|
|
123
|
+
// share a domain or when cookies aren't partitioned)
|
|
83
124
|
try {
|
|
84
|
-
const session = await better_auth_client_1.
|
|
125
|
+
const session = await (0, better_auth_client_1.getBetterAuthClient)().getSession();
|
|
85
126
|
if (session.data?.session?.token) {
|
|
86
127
|
debug("Better Auth session found, exchanging for Feathers JWT", {
|
|
87
128
|
betterAuthUserId: session.data.user?.id,
|
|
@@ -110,7 +151,7 @@ const BetterAuthProvider = ({ partnerId }) => {
|
|
|
110
151
|
catch {
|
|
111
152
|
debug("No Better Auth session to restore");
|
|
112
153
|
}
|
|
113
|
-
//
|
|
154
|
+
// 4. Nothing found — show login UI
|
|
114
155
|
setIsAuthenticating(false);
|
|
115
156
|
};
|
|
116
157
|
restoreSession();
|
|
@@ -5,7 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const relay_kit_ui_1 = require("@relayprotocol/relay-kit-ui");
|
|
6
6
|
const relay_sdk_1 = require("@relayprotocol/relay-sdk");
|
|
7
7
|
const react_1 = require("react");
|
|
8
|
-
function RelayKitProviderWrapper({ children
|
|
8
|
+
function RelayKitProviderWrapper({ children }) {
|
|
9
9
|
const [relayChains, setRelayChains] = (0, react_1.useState)([]);
|
|
10
10
|
(0, react_1.useEffect)(() => {
|
|
11
11
|
const fetchChains = async () => {
|
|
@@ -14,16 +14,22 @@ function RelayKitProviderWrapper({ children, simDuneApiKey, }) {
|
|
|
14
14
|
};
|
|
15
15
|
fetchChains();
|
|
16
16
|
}, []);
|
|
17
|
+
// Balances for Relay's token selector come from the b3-zerion-api Zerion proxy, not Relay's own Dune
|
|
18
|
+
// integration. Relay only fires the balance query when duneConfig.apiKey is set, so apiBaseUrl points
|
|
19
|
+
// it at our proxy; the proxy ignores the client-sent key and holds the real Zerion credential itself.
|
|
17
20
|
return ((0, jsx_runtime_1.jsx)(relay_kit_ui_1.RelayKitProvider, { options: {
|
|
18
21
|
baseApiUrl: relay_sdk_1.MAINNET_RELAY_API,
|
|
19
22
|
source: "anyspend",
|
|
20
|
-
duneConfig: {
|
|
21
|
-
apiKey: simDuneApiKey,
|
|
22
|
-
apiBaseUrl: "https://api.sim.dune.com",
|
|
23
|
-
},
|
|
24
23
|
chains: relayChains,
|
|
25
24
|
privateChainIds: undefined,
|
|
26
25
|
appName: "AnySpend",
|
|
27
26
|
useGasFeeEstimations: true,
|
|
27
|
+
duneConfig: {
|
|
28
|
+
// Non-secret placeholder. Relay only fires its balance query when apiKey is defined; the value is sent
|
|
29
|
+
// as X-Sim-Api-Key to our proxy, which ignores it. The real Zerion key stays server-side in b3-zerion-api.
|
|
30
|
+
apiKey: "proxied-via-portfolio-api",
|
|
31
|
+
// Relay appends /v1/evm/balances/{address}. Our b3-zerion-api worker serves that route, backed by Zerion.
|
|
32
|
+
apiBaseUrl: "https://portfolio-api.b3.fun",
|
|
33
|
+
},
|
|
28
34
|
}, children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }) }));
|
|
29
35
|
}
|
|
@@ -47,7 +47,7 @@ function ContentTokens({ activeTab }) {
|
|
|
47
47
|
const animationDirection = (0, react_2.useRef)(null);
|
|
48
48
|
// === DATA FETCHING ===
|
|
49
49
|
const account = (0, react_3.useActiveAccount)();
|
|
50
|
-
const { data:
|
|
50
|
+
const { data: balances, refetch: refetchBalances, isLoading: isLoadingBalance, isError: isBalanceError, } = (0, react_1.usePortfolioBalance)(account?.address);
|
|
51
51
|
// === BLOCKCHAIN INTERACTION ===
|
|
52
52
|
const { switchChainAndExecute } = (0, react_1.useUnifiedChainSwitchAndExecute)();
|
|
53
53
|
// === ANALYTICS ===
|
|
@@ -81,13 +81,13 @@ function ContentTokens({ activeTab }) {
|
|
|
81
81
|
// === HELPER FUNCTION ===
|
|
82
82
|
// Get current version of selected token from fresh balance data
|
|
83
83
|
// 🔧 FIX: Prevents auto-navigation back to token list when balance refreshes
|
|
84
|
-
// The
|
|
84
|
+
// The balance hook refreshes data, creating new token object references
|
|
85
85
|
// This helper ensures we always get the fresh token data instead of stale references
|
|
86
86
|
const getCurrentSelectedToken = () => {
|
|
87
|
-
if (!selectedToken || !
|
|
87
|
+
if (!selectedToken || !balances) {
|
|
88
88
|
return null;
|
|
89
89
|
}
|
|
90
|
-
const found =
|
|
90
|
+
const found = balances.find(token => token.chain_id === selectedToken.chain_id && token.address === selectedToken.address);
|
|
91
91
|
return found || null;
|
|
92
92
|
};
|
|
93
93
|
// ==================================================================================
|
|
@@ -153,11 +153,13 @@ function ContentTokens({ activeTab }) {
|
|
|
153
153
|
functionName: "transfer",
|
|
154
154
|
args: [recipientAddress, amountInWei],
|
|
155
155
|
});
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
156
|
+
// A native send carries value and no calldata; an ERC-20 send carries calldata and no
|
|
157
|
+
// value. Branch on the explicit flag, never on the address: the native sentinel is a
|
|
158
|
+
// display detail, and taking the ERC-20 path for a native coin spends gas without moving
|
|
159
|
+
// anything.
|
|
160
|
+
const tx = await switchChainAndExecute(displayToken.chain_id, displayToken.is_native
|
|
161
|
+
? { to: recipientAddress, value: amountInWei }
|
|
162
|
+
: { to: displayToken.address, data: sendTokenData, value: BigInt(0) });
|
|
161
163
|
if (tx) {
|
|
162
164
|
// Track successful send
|
|
163
165
|
sendAnalyticsEvent("send_token_button_click", {
|
|
@@ -183,7 +185,7 @@ function ContentTokens({ activeTab }) {
|
|
|
183
185
|
// Wait 1 second to make sure the tx is indexed on sim api.
|
|
184
186
|
setTimeout(async () => {
|
|
185
187
|
// Force refetch to bypass cache and get fresh balance data
|
|
186
|
-
await
|
|
188
|
+
await refetchBalances();
|
|
187
189
|
}, 1000);
|
|
188
190
|
setIsSending(false);
|
|
189
191
|
}
|
|
@@ -217,21 +219,27 @@ function ContentTokens({ activeTab }) {
|
|
|
217
219
|
if (isLoadingBalance) {
|
|
218
220
|
return (0, jsx_runtime_1.jsx)(LoadingIndicator, {});
|
|
219
221
|
}
|
|
220
|
-
//
|
|
221
|
-
|
|
222
|
+
// A wallet IS connected here — only the read failed. Prompting the user to connect would send
|
|
223
|
+
// them to fix something that is not broken.
|
|
224
|
+
// `isBalanceError` as well as the absent list: after a first success a later refetch failure
|
|
225
|
+
// keeps `data` populated, so `!balances` alone would show stale numbers as if they were fresh.
|
|
226
|
+
if (account?.address && (isBalanceError || !balances)) {
|
|
227
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-line/50 mb-4 rounded-full p-4", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "text-b3-foreground-muted h-8 w-8" }) }), (0, jsx_runtime_1.jsx)("h3", { className: "text-b3-grey font-neue-montreal-semibold mb-2", children: "Couldn't load your tokens" }), (0, jsx_runtime_1.jsx)("button", { onClick: () => refetchBalances(), className: "text-b3-foreground-muted font-neue-montreal-medium text-sm underline", children: "Try again" })] }));
|
|
228
|
+
}
|
|
229
|
+
if (!account?.address) {
|
|
222
230
|
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-line/50 mb-4 rounded-full p-4", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "text-b3-foreground-muted h-8 w-8" }) }), (0, jsx_runtime_1.jsx)("h3", { className: "text-b3-grey font-neue-montreal-semibold mb-2", children: "No wallet connected" }), (0, jsx_runtime_1.jsx)("p", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: "Connect your wallet to view token balances" })] }));
|
|
223
231
|
}
|
|
224
232
|
// === SMART FILTERING LOGIC ===
|
|
225
233
|
// Filter tokens with value >= $1 to reduce noise from dust tokens
|
|
226
|
-
const filteredTokens =
|
|
234
|
+
const filteredTokens = balances?.filter(token => token.value_usd !== undefined && token.value_usd >= 1) || [];
|
|
227
235
|
// 🧠 INTELLIGENT DISPLAY LOGIC:
|
|
228
236
|
// Show all tokens automatically when filtering would be unhelpful:
|
|
229
237
|
// 1. User explicitly requested to show all, OR
|
|
230
238
|
// 2. No tokens with value >= $1 (user has only dust), OR
|
|
231
239
|
// 3. 5 or fewer tokens with value >= $1 (not enough to warrant filtering)
|
|
232
240
|
const shouldShowAllTokens = showAllTokens || filteredTokens.length === 0 || filteredTokens.length <= 5;
|
|
233
|
-
const tokensToShow = shouldShowAllTokens ?
|
|
234
|
-
const hasHiddenTokens = !shouldShowAllTokens && (
|
|
241
|
+
const tokensToShow = shouldShowAllTokens ? balances || [] : filteredTokens;
|
|
242
|
+
const hasHiddenTokens = !shouldShowAllTokens && (balances?.length || 0) > filteredTokens.length;
|
|
235
243
|
// Handle token selection and navigate to send form
|
|
236
244
|
const handleTokenClick = (token) => {
|
|
237
245
|
setSelectedToken(token);
|
|
@@ -9,7 +9,7 @@ const NFTContent = () => {
|
|
|
9
9
|
const activeWallet = (0, react_1.useActiveWallet)();
|
|
10
10
|
const activeAccount = activeWallet?.getAccount();
|
|
11
11
|
const activeAddress = activeAccount?.address;
|
|
12
|
-
const { data: nfts, isLoading } = (0, hooks_1.
|
|
13
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: { minHeight: "100px" }, children: nfts ? ((0, jsx_runtime_1.jsx)(__1.AccountAssets, { nfts: nfts, isLoading: isLoading })) : ((0, jsx_runtime_1.jsx)("div", { className: "py-12 text-center text-gray-500", children: "No NFTs found" })) }));
|
|
12
|
+
const { data: nfts, isLoading, isError } = (0, hooks_1.usePortfolioCollectibles)(activeAddress, [1, 8453], { filterSpam: true });
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: { minHeight: "100px" }, children: isError ? ((0, jsx_runtime_1.jsx)("div", { className: "py-12 text-center text-gray-500", children: "Couldn't load your NFTs" })) : nfts ? ((0, jsx_runtime_1.jsx)(__1.AccountAssets, { nfts: nfts, isLoading: isLoading })) : ((0, jsx_runtime_1.jsx)("div", { className: "py-12 text-center text-gray-500", children: "No NFTs found" })) }));
|
|
14
14
|
};
|
|
15
15
|
exports.default = NFTContent;
|
|
@@ -29,14 +29,16 @@ const ProfileSection = () => {
|
|
|
29
29
|
const setB3ModalOpen = (0, react_1.useModalStore)(state => state.setB3ModalOpen);
|
|
30
30
|
const setB3ModalContentType = (0, react_1.useModalStore)(state => state.setB3ModalContentType);
|
|
31
31
|
const navigateBack = (0, react_1.useModalStore)(state => state.navigateBack);
|
|
32
|
-
const { data:
|
|
32
|
+
const { data: balances, isError: isBalanceError } = (0, react_1.usePortfolioBalance)(smartWalletAddress);
|
|
33
33
|
const [imgError, setImgError] = (0, react_2.useState)(false);
|
|
34
34
|
const handleImgError = (0, react_2.useCallback)(() => setImgError(true), []);
|
|
35
|
+
// Null while the holdings are unknown. Summing an absent list to $0.00 would report an empty
|
|
36
|
+
// portfolio to someone whose balances merely failed to load.
|
|
35
37
|
const totalBalanceUsd = (0, react_2.useMemo)(() => {
|
|
36
|
-
if (!
|
|
37
|
-
return
|
|
38
|
-
return
|
|
39
|
-
}, [
|
|
38
|
+
if (isBalanceError || !balances)
|
|
39
|
+
return null;
|
|
40
|
+
return balances.reduce((sum, token) => sum + (token.value_usd || 0), 0);
|
|
41
|
+
}, [balances, isBalanceError]);
|
|
40
42
|
const handleEditAvatar = () => {
|
|
41
43
|
setB3ModalOpen(true);
|
|
42
44
|
setB3ModalContentType({
|
|
@@ -53,6 +55,6 @@ const ProfileSection = () => {
|
|
|
53
55
|
}, [avatarSrc]);
|
|
54
56
|
const currentUsername = user?.username || profile?.displayName || (0, utils_1.formatUsername)(profile?.name || "");
|
|
55
57
|
const avatarSeed = eoaAddress || account?.address || smartWalletAddress || currentUsername || user?.email || "user";
|
|
56
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-between px-5 py-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "global-account-profile flex items-center gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "global-account-profile-avatar relative", children: [(0, jsx_runtime_1.jsx)("div", { className: "border-b3-line border-1 bg-b3-primary-wash size-14 overflow-hidden rounded-full border", children: avatarSrc && !imgError ? ((0, jsx_runtime_1.jsx)(IPFSMediaRenderer_1.IPFSMediaRenderer, { src: avatarSrc, alt: "Profile Avatar", className: "h-full w-full object-cover", onError: handleImgError })) : ((0, jsx_runtime_1.jsx)(boring_avatars_1.default, { name: avatarSeed, variant: "beam", size: 56, colors: constants_1.AVATAR_COLORS })) }), (0, jsx_runtime_1.jsx)("button", { onClick: handleEditAvatar, className: "border-b3-background hover:bg-b3-grey/80 absolute -bottom-1 -right-1 flex size-6 items-center justify-center rounded-full border-4 bg-[#a0a0ab] transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Pencil, { size: 10, className: "text-b3-background" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "global-account-profile-info flex flex-col gap-1", children: [!isBetterAuth && ((0, jsx_runtime_1.jsxs)("h2", { className: "text-b3-grey font-neue-montreal-semibold flex h-[38px] items-center gap-1 text-xl", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-b3-foreground-muted", children: " $" }), (0, jsx_runtime_1.jsx)("div", { className: "text-[30px]", children: (0, number_1.formatDisplayNumber)(totalBalanceUsd, { fractionDigits: 2 }) })] })), (0, jsx_runtime_1.jsx)("div", { className: "b3-modal-username font-neue-montreal-semibold text-base leading-none text-[#0B57C2]", children: currentUsername }), isBetterAuth && user?.email && ((0, jsx_runtime_1.jsx)("div", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: user.email }))] })] }) }));
|
|
58
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-between px-5 py-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "global-account-profile flex items-center gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "global-account-profile-avatar relative", children: [(0, jsx_runtime_1.jsx)("div", { className: "border-b3-line border-1 bg-b3-primary-wash size-14 overflow-hidden rounded-full border", children: avatarSrc && !imgError ? ((0, jsx_runtime_1.jsx)(IPFSMediaRenderer_1.IPFSMediaRenderer, { src: avatarSrc, alt: "Profile Avatar", className: "h-full w-full object-cover", onError: handleImgError })) : ((0, jsx_runtime_1.jsx)(boring_avatars_1.default, { name: avatarSeed, variant: "beam", size: 56, colors: constants_1.AVATAR_COLORS })) }), (0, jsx_runtime_1.jsx)("button", { onClick: handleEditAvatar, className: "border-b3-background hover:bg-b3-grey/80 absolute -bottom-1 -right-1 flex size-6 items-center justify-center rounded-full border-4 bg-[#a0a0ab] transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Pencil, { size: 10, className: "text-b3-background" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "global-account-profile-info flex flex-col gap-1", children: [!isBetterAuth && ((0, jsx_runtime_1.jsxs)("h2", { className: "text-b3-grey font-neue-montreal-semibold flex h-[38px] items-center gap-1 text-xl", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-b3-foreground-muted", children: " $" }), (0, jsx_runtime_1.jsx)("div", { className: "text-[30px]", children: totalBalanceUsd === null ? "—" : (0, number_1.formatDisplayNumber)(totalBalanceUsd, { fractionDigits: 2 }) })] })), (0, jsx_runtime_1.jsx)("div", { className: "b3-modal-username font-neue-montreal-semibold text-base leading-none text-[#0B57C2]", children: currentUsername }), isBetterAuth && user?.email && ((0, jsx_runtime_1.jsx)("div", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: user.email }))] })] }) }));
|
|
57
59
|
};
|
|
58
60
|
exports.default = ProfileSection;
|
|
@@ -77,7 +77,7 @@ const SettingsProfileCard = () => {
|
|
|
77
77
|
// Better Auth: register username without wallet signing (DB-only, no ENS)
|
|
78
78
|
// Skip ens_normalize — it rejects underscores/mixed-case that are valid non-ENS usernames
|
|
79
79
|
const sanitizedUsername = editedUsername.trim().toLowerCase();
|
|
80
|
-
// Type assertion needed:
|
|
80
|
+
// Type assertion needed: API now accepts message/hash as optional for Better Auth users
|
|
81
81
|
updatedUser = (await app_1.default
|
|
82
82
|
.service("users")
|
|
83
83
|
.registerUsername({ username: sanitizedUsername }, {}));
|