@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
|
@@ -72,7 +72,7 @@ const SettingsProfileCard = () => {
|
|
|
72
72
|
// Better Auth: register username without wallet signing (DB-only, no ENS)
|
|
73
73
|
// Skip ens_normalize — it rejects underscores/mixed-case that are valid non-ENS usernames
|
|
74
74
|
const sanitizedUsername = editedUsername.trim().toLowerCase();
|
|
75
|
-
// Type assertion needed:
|
|
75
|
+
// Type assertion needed: API now accepts message/hash as optional for Better Auth users
|
|
76
76
|
updatedUser = (await app
|
|
77
77
|
.service("users")
|
|
78
78
|
.registerUsername({ username: sanitizedUsername }, {}));
|
|
@@ -1,25 +1,34 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { usePortfolioBalance } from "../../../../global-account/react/index.js";
|
|
3
3
|
import { getChainLogo } from "../../../../shared/constants/chains/supported.js";
|
|
4
4
|
import { useActiveWallet } from "thirdweb/react";
|
|
5
5
|
import { TokenBalanceRow } from "./TokenBalanceRow.js";
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const ETHEREUM_CHAIN_ID = 1;
|
|
7
|
+
// Chain logo URLs, keyed by chain id. Built with Object.fromEntries rather than `.map()`: an array
|
|
8
|
+
// satisfies Record<number, string> for the type checker while indexing by 0,1,2 at runtime, so
|
|
9
|
+
// every lookup by a real chain id would miss.
|
|
10
|
+
const CHAIN_LOGOS = Object.fromEntries([ETHEREUM_CHAIN_ID, 8453, 8333].map(chainId => [chainId, getChainLogo(chainId)]));
|
|
8
11
|
const TokenContent = () => {
|
|
9
12
|
// Get active wallet state
|
|
10
13
|
const activeWallet = useActiveWallet();
|
|
11
14
|
const activeAccount = activeWallet?.getAccount();
|
|
12
15
|
const activeAddress = activeAccount?.address;
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
// Base and Ethereum only. B3 (8333) is deliberately absent: the portfolio provider does not index
|
|
17
|
+
// it, so asking for it returns nothing and reads as a coverage gap rather than a choice. Restoring
|
|
18
|
+
// B3 needs a non-provider source, the way HyperEVM and Plume are served on-chain in b3os-web.
|
|
19
|
+
const { data: balances, isError: isBalanceError } = usePortfolioBalance(activeAddress, [8453, ETHEREUM_CHAIN_ID]);
|
|
15
20
|
if (!activeAddress) {
|
|
16
21
|
return _jsx("div", { className: "col-span-3 py-12 text-center text-gray-500", children: "No tokens found" });
|
|
17
22
|
}
|
|
18
|
-
|
|
23
|
+
// "Couldn't load" and "holds nothing" are different answers and must not share a message.
|
|
24
|
+
if (isBalanceError) {
|
|
25
|
+
return _jsx("div", { className: "col-span-3 py-12 text-center text-gray-500", children: "Couldn't load your tokens" });
|
|
26
|
+
}
|
|
27
|
+
if (!balances || balances.length === 0) {
|
|
19
28
|
return _jsx("div", { className: "col-span-3 py-12 text-center text-gray-500", children: "No tokens found" });
|
|
20
29
|
}
|
|
21
30
|
// Sort by USD value descending
|
|
22
|
-
const sortedBalances = [...
|
|
31
|
+
const sortedBalances = [...balances].sort((a, b) => {
|
|
23
32
|
const valueA = a.value_usd || 0;
|
|
24
33
|
const valueB = b.value_usd || 0;
|
|
25
34
|
return valueB - valueA;
|
|
@@ -33,8 +42,8 @@ const TokenContent = () => {
|
|
|
33
42
|
// Determine token logo
|
|
34
43
|
// For native tokens, use ETH logo instead of chain logo
|
|
35
44
|
let tokenLogo = token.token_metadata?.logo || "";
|
|
36
|
-
if (token.
|
|
37
|
-
tokenLogo = CHAIN_LOGOS[
|
|
45
|
+
if (token.is_native && token.symbol === "ETH") {
|
|
46
|
+
tokenLogo = CHAIN_LOGOS[ETHEREUM_CHAIN_ID];
|
|
38
47
|
}
|
|
39
48
|
return (_jsx(TokenBalanceRow, { tokenLogo: tokenLogo, chainLogo: CHAIN_LOGOS[token.chain_id] || "", name: token.name || token.symbol, balance: `${balance} ${token.symbol}`, usdValue: usdValue, priceChange: priceChange }, `${token.chain_id}-${token.address}-${index}`));
|
|
40
49
|
}) }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { ALL_CHAINS, getExplorerTxUrl } from "../../../../anyspend/index.js";
|
|
3
3
|
import { ChainTokenIcon } from "../../../../anyspend/react/components/common/ChainTokenIcon.js";
|
|
4
|
-
import { toast, useAccountWallet, useAnalytics, useModalStore, useProfile,
|
|
4
|
+
import { toast, useAccountWallet, useAnalytics, useModalStore, useProfile, usePortfolioBalance, useUnifiedChainSwitchAndExecute, } from "../../../../global-account/react/index.js";
|
|
5
5
|
import { validateImageUrl } from "../../../../global-account/react/utils/profileDisplay.js";
|
|
6
6
|
import { formatDisplayNumber, formatTokenAmount } from "../../../../shared/utils/number.js";
|
|
7
7
|
import invariant from "invariant";
|
|
@@ -31,7 +31,7 @@ export function Send({ recipientAddress: initialRecipient, onSuccess }) {
|
|
|
31
31
|
const [addressError, setAddressError] = useState("");
|
|
32
32
|
const [showValidatedResult, setShowValidatedResult] = useState(false);
|
|
33
33
|
// Hooks
|
|
34
|
-
const { data:
|
|
34
|
+
const { data: balances, refetch: refetchBalances, isLoading: isLoadingBalance, isError: isBalanceError, } = usePortfolioBalance(address);
|
|
35
35
|
const { switchChainAndExecute } = useUnifiedChainSwitchAndExecute();
|
|
36
36
|
const { sendAnalyticsEvent } = useAnalytics();
|
|
37
37
|
// Recent addresses store
|
|
@@ -95,10 +95,10 @@ export function Send({ recipientAddress: initialRecipient, onSuccess }) {
|
|
|
95
95
|
};
|
|
96
96
|
// Get current selected token from fresh balance
|
|
97
97
|
const getCurrentSelectedToken = () => {
|
|
98
|
-
if (!selectedToken || !
|
|
98
|
+
if (!selectedToken || !balances) {
|
|
99
99
|
return null;
|
|
100
100
|
}
|
|
101
|
-
const found =
|
|
101
|
+
const found = balances.find(token => token.chain_id === selectedToken.chain_id && token.address === selectedToken.address);
|
|
102
102
|
return found || null;
|
|
103
103
|
};
|
|
104
104
|
// Percentage button handler
|
|
@@ -132,11 +132,12 @@ export function Send({ recipientAddress: initialRecipient, onSuccess }) {
|
|
|
132
132
|
functionName: "transfer",
|
|
133
133
|
args: [recipientAddress, amountInWei],
|
|
134
134
|
});
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
135
|
+
// A native send carries value and no calldata; an ERC-20 send carries calldata and no value.
|
|
136
|
+
// Branch on the explicit flag, never on the address: the native sentinel is a display detail,
|
|
137
|
+
// and taking the ERC-20 path for a native coin spends gas without moving anything.
|
|
138
|
+
const tx = await switchChainAndExecute(currentToken.chain_id, currentToken.is_native
|
|
139
|
+
? { to: recipientAddress, value: amountInWei }
|
|
140
|
+
: { to: currentToken.address, data: sendTokenData, value: BigInt(0) });
|
|
140
141
|
if (tx) {
|
|
141
142
|
sendAnalyticsEvent("send_token_button_click", {
|
|
142
143
|
...analyticsData,
|
|
@@ -149,7 +150,7 @@ export function Send({ recipientAddress: initialRecipient, onSuccess }) {
|
|
|
149
150
|
onSuccess(tx);
|
|
150
151
|
}
|
|
151
152
|
setTimeout(async () => {
|
|
152
|
-
await
|
|
153
|
+
await refetchBalances();
|
|
153
154
|
}, 1000);
|
|
154
155
|
}
|
|
155
156
|
}
|
|
@@ -185,8 +186,11 @@ export function Send({ recipientAddress: initialRecipient, onSuccess }) {
|
|
|
185
186
|
return (_jsxs("div", { className: "dark:bg-b3-background flex h-[600px] w-full flex-col bg-white", children: [_jsx(ModalHeader, { handleBack: handleBack, title: getStepTitle() }), _jsxs("div", { className: "flex-1 overflow-y-auto", children: [step === "recipient" && (_jsxs("div", { className: "flex flex-col gap-6 p-5", children: [_jsxs("div", { className: "dark:border-b3-line dark:bg-b3-background flex h-12 w-full items-stretch overflow-hidden rounded-lg border border-[#d1d1d6] bg-white", children: [_jsx("div", { className: "flex w-12 items-center justify-center bg-transparent px-3 py-2", children: _jsx("span", { className: "font-neue-montreal-medium text-base text-[#3f3f46] dark:text-white", children: "To" }) }), _jsxs("div", { className: "flex flex-1 items-center border-l border-[#d1d1d6] px-3 py-2", children: [_jsx("input", { type: "text", value: recipientAddress, onChange: e => handleRecipientAddressChange(e.target.value), placeholder: "ENS or Address", className: "font-neue-montreal-medium dark:bg-b3-background flex-1 text-base text-[#70707b] outline-none placeholder:text-[#70707b] dark:text-white dark:placeholder:text-white" }), _jsx("button", { onClick: handlePaste, className: "font-inter ml-2 rounded-md border border-[#e4e4e7] bg-[#fafafa] px-2.5 py-0.5 text-sm font-medium text-[#3f3f46] transition-colors hover:bg-[#f4f4f5]", children: "Paste" })] })] }), addressError && _jsx("p", { className: "font-neue-montreal-medium -mt-4 text-xs text-red-500", children: addressError }), showValidatedResult && recipientAddress && isAddress(recipientAddress) && (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("div", { className: "flex items-center gap-1", children: _jsx("span", { className: "font-sf-pro-text text-sm font-semibold leading-[1.3] tracking-[-0.41px] text-[#0b57c2]", children: "Result" }) }), _jsxs("button", { onClick: handleSelectValidatedAddress, className: "dark:bg-b3-background dark:border-b3-line flex items-center gap-2 rounded-xl bg-[#f4f4f5] px-3 py-2 transition-colors hover:bg-[#e4e4e7]", children: [validatedRecipientAvatar ? (_jsx("img", { src: validatedRecipientAvatar, alt: validatedProfileData?.name || recipientAddress, className: "h-10 w-10 rounded-full" })) : (_jsx("div", { className: "dark:border-b3-line dark:bg-b3-background flex h-10 w-10 items-center justify-center rounded-full border border-[#e4e4e7] bg-[#f4f4f5]", children: _jsx(Wallet, { className: "h-5 w-5 text-[#a0a0ab] dark:text-white" }) })), _jsxs("span", { className: "font-neue-montreal-medium text-base tracking-[-0.32px] text-[#70707b] dark:text-white", children: [recipientAddress.slice(0, 6), "...", recipientAddress.slice(-4), validatedProfileData?.name && ` (${validatedProfileData.name})`] })] })] })), recentAddresses.length > 0 && (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs("div", { className: "flex items-center gap-1", children: [_jsx(Clock, { className: "h-3.5 w-3.5 text-[#3f3f46]" }), _jsx("span", { className: "font-sf-pro-text text-sm font-semibold leading-[1.3] tracking-[-0.41px] text-[#3f3f46]", children: "Recents" })] }), _jsx("div", { className: "flex flex-col", children: recentAddresses.map((recent, index) => (_jsx(RecentAddressItem, { address: recent.address, onClick: () => {
|
|
186
187
|
// Just fill the input and show validation - don't auto-proceed
|
|
187
188
|
handleRecipientAddressChange(recent.address);
|
|
188
|
-
} }, index))) })] }))] })), step === "token" && (_jsx("div", { className: "flex flex-col p-5", children: isLoadingBalance ? (_jsx("div", { className: "space-y-4", children: _jsx("div", { className: "space-y-1", children: [...Array(3)].map((_, index) => (_jsxs("div", { className: "flex items-center justify-between rounded-xl p-3", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "bg-b3-line h-10 w-10 animate-pulse rounded-full" }), _jsxs("div", { children: [_jsx("div", { className: "bg-b3-line mb-1 h-4 w-16 animate-pulse rounded" }), _jsx("div", { className: "bg-b3-line h-3 w-24 animate-pulse rounded" })] })] }), _jsxs("div", { className: "text-right", children: [_jsx("div", { className: "bg-b3-line mb-1 h-4 w-20 animate-pulse rounded" }), _jsx("div", { className: "bg-b3-line h-3 w-16 animate-pulse rounded" })] })] }, index))) }) })) :
|
|
189
|
+
} }, index))) })] }))] })), step === "token" && (_jsx("div", { className: "flex flex-col p-5", children: isLoadingBalance ? (_jsx("div", { className: "space-y-4", children: _jsx("div", { className: "space-y-1", children: [...Array(3)].map((_, index) => (_jsxs("div", { className: "flex items-center justify-between rounded-xl p-3", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "bg-b3-line h-10 w-10 animate-pulse rounded-full" }), _jsxs("div", { children: [_jsx("div", { className: "bg-b3-line mb-1 h-4 w-16 animate-pulse rounded" }), _jsx("div", { className: "bg-b3-line h-3 w-24 animate-pulse rounded" })] })] }), _jsxs("div", { className: "text-right", children: [_jsx("div", { className: "bg-b3-line mb-1 h-4 w-20 animate-pulse rounded" }), _jsx("div", { className: "bg-b3-line h-3 w-16 animate-pulse rounded" })] })] }, index))) }) })) : balances && balances.length > 0 ? (_jsx("div", { className: "space-y-4", children: _jsx("div", { className: "space-y-1", children: balances.map(token => (_jsxs("div", { className: "hover:bg-b3-line/60 dark:hover:bg-b3-primary-wash/40 group flex cursor-pointer items-center justify-between rounded-xl p-3 transition-all duration-200", onClick: () => {
|
|
189
190
|
setSelectedToken(token);
|
|
190
191
|
setStep("amount");
|
|
191
|
-
}, children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-full", children: ALL_CHAINS[token.chain_id]?.logoUrl ? (_jsx(ChainTokenIcon, { chainUrl: ALL_CHAINS[token.chain_id].logoUrl, tokenUrl: token.token_metadata?.logo, className: "size-10" })) : (_jsx(CircleHelp, { className: "text-b3-react-foreground size-10" })) }), _jsxs("div", { children: [_jsx("div", { className: "flex items-center gap-2", children: _jsx("span", { className: "text-b3-grey font-neue-montreal-semibold transition-colors duration-200 group-hover:font-bold group-hover:text-black", children: token.symbol }) }), _jsx("div", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm transition-colors duration-200 group-hover:text-gray-700", children: token.name })] })] }), _jsxs("div", { className: "text-right", children: [_jsx("div", { className: "text-b3-grey font-neue-montreal-semibold transition-colors duration-200 group-hover:font-bold group-hover:text-black", children: formatTokenAmount(BigInt(token.amount), token.decimals) }), _jsx("div", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm transition-colors duration-200 group-hover:text-gray-700", children: formatDisplayNumber(token.value_usd, { style: "currency", fractionDigits: 2 }) })] })] }, token.chain_id + "_" + token.address))) }) })) :
|
|
192
|
+
}, children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-full", children: ALL_CHAINS[token.chain_id]?.logoUrl ? (_jsx(ChainTokenIcon, { chainUrl: ALL_CHAINS[token.chain_id].logoUrl, tokenUrl: token.token_metadata?.logo, className: "size-10" })) : (_jsx(CircleHelp, { className: "text-b3-react-foreground size-10" })) }), _jsxs("div", { children: [_jsx("div", { className: "flex items-center gap-2", children: _jsx("span", { className: "text-b3-grey font-neue-montreal-semibold transition-colors duration-200 group-hover:font-bold group-hover:text-black", children: token.symbol }) }), _jsx("div", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm transition-colors duration-200 group-hover:text-gray-700", children: token.name })] })] }), _jsxs("div", { className: "text-right", children: [_jsx("div", { className: "text-b3-grey font-neue-montreal-semibold transition-colors duration-200 group-hover:font-bold group-hover:text-black", children: formatTokenAmount(BigInt(token.amount), token.decimals) }), _jsx("div", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm transition-colors duration-200 group-hover:text-gray-700", children: formatDisplayNumber(token.value_usd, { style: "currency", fractionDigits: 2 }) })] })] }, token.chain_id + "_" + token.address))) }) })) : isBalanceError ? (
|
|
193
|
+
// Telling someone they hold nothing, when the read simply failed, invites them to go
|
|
194
|
+
// looking for missing funds.
|
|
195
|
+
_jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [_jsx(CircleHelp, { className: "text-b3-foreground-muted mb-4 h-8 w-8" }), _jsx("p", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: "Couldn't load your tokens" }), _jsx("button", { onClick: () => refetchBalances(), className: "text-b3-foreground-muted font-neue-montreal-medium mt-2 text-sm underline", children: "Try again" })] })) : (_jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [_jsx(CircleHelp, { className: "text-b3-foreground-muted mb-4 h-8 w-8" }), _jsx("p", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: "No tokens available" })] })) })), step === "amount" && selectedToken && (_jsxs("div", { className: "flex flex-col gap-6 p-5", children: [_jsxs("div", { className: "dark:border-b3-line dark:bg-b3-background flex items-center justify-between rounded-xl border border-[#d1d1d6] bg-[#fafafa] p-3", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "flex h-10 w-10 items-center justify-center", children: ALL_CHAINS[selectedToken.chain_id]?.logoUrl ? (_jsx(ChainTokenIcon, { chainUrl: ALL_CHAINS[selectedToken.chain_id].logoUrl, tokenUrl: selectedToken.token_metadata?.logo, className: "size-10" })) : (_jsx(CircleHelp, { className: "text-b3-react-foreground size-10" })) }), _jsxs("div", { children: [_jsx("div", { className: "font-neue-montreal-semibold text-base text-[#18181b] dark:text-white", children: selectedToken.symbol }), _jsx("div", { className: "font-neue-montreal-medium text-sm text-[#70707b] dark:text-white", children: formatTokenAmount(BigInt(selectedToken.amount), selectedToken.decimals) })] })] }), _jsx("button", { onClick: () => setStep("token"), className: "text-b3-primary-blue font-neue-montreal-semibold hover:text-b3-primary-blue/80 text-sm transition-colors dark:text-white", children: "Change" })] }), _jsxs("div", { className: "space-y-3", children: [_jsx(NumericFormat, { decimalSeparator: ".", allowedDecimalSeparators: [","], thousandSeparator: true, inputMode: "decimal", autoComplete: "off", autoCorrect: "off", type: "text", placeholder: "0.00", minLength: 1, maxLength: 30, spellCheck: "false", className: "font-neue-montreal-medium placeholder:text-b3-foreground-muted dark:border-b3-line dark:bg-b3-background w-full rounded-lg border border-[#d1d1d6] bg-white px-3 py-2 text-base text-[#18181b] outline-none focus:border-[#0c68e9] dark:text-white", pattern: "^[0-9]*[.,]?[0-9]*$", disabled: isSending, value: sendAmount, allowNegative: false, onValueChange: values => setSendAmount(values.value) }), _jsx("div", { className: "grid grid-cols-4 gap-2", children: [25, 50, 75, 100].map(percentage => (_jsxs(Button, { variant: "outline", onClick: () => handlePercentageClick(percentage), className: "font-neue-montreal-medium dark:border-b3-line dark:bg-b3-background border-[#d1d1d6] text-sm text-[#18181b] hover:bg-[#fafafa] dark:text-white", disabled: isSending, children: [percentage, "%"] }, percentage))) }), _jsxs("div", { className: "font-neue-montreal-medium text-sm text-[#70707b]", children: ["Available: ", formatTokenAmount(BigInt(selectedToken.amount), selectedToken.decimals), " ", selectedToken.symbol] })] }), _jsx(Button, { onClick: () => setStep("confirm"), disabled: !sendAmount || parseFloat(sendAmount) <= 0, className: "bg-b3-primary-blue hover:bg-b3-primary-blue/90 font-neue-montreal-semibold disabled:bg-b3-line disabled:text-b3-foreground-muted h-12 w-full rounded-xl text-white", children: "Continue" })] })), step === "confirm" && selectedToken && (_jsxs("div", { className: "flex min-h-full flex-col", children: [_jsxs("div", { className: "flex flex-col items-center gap-4 px-5 pb-0 pt-6", children: [_jsx("div", { className: "dark:bg-b3-line flex h-14 w-14 items-center justify-center rounded-full bg-[#d5e5fd]", children: _jsx(SendIcon, { className: "h-7 w-7 text-[#0c68e9]" }) }), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx("span", { className: "font-neue-montreal-semibold text-[30px] leading-[38px] text-[#18181b] dark:text-white", children: sendAmount }), _jsx("span", { className: "font-neue-montreal-semibold text-[30px] leading-[38px] text-[#70707b] dark:text-white", children: selectedToken.symbol })] })] }), _jsx("div", { className: "h-5" }), _jsx("div", { className: "flex flex-col gap-3 px-5", children: _jsx("div", { className: "dark:border-b3-line dark:bg-b3-background rounded-xl border border-[#e4e4e7] bg-[#fafafa] p-4", children: _jsxs("div", { className: "flex flex-col gap-3", children: [_jsxs("div", { className: "dark:border-b3-line flex items-center justify-between border-b border-[#e4e4e7] pb-3", children: [_jsx("span", { className: "font-inter text-sm font-normal leading-5 text-[#51525c] dark:text-white", children: "To" }), _jsxs("span", { className: "font-inter text-sm font-normal leading-5 text-[#18181b] dark:text-white", children: ["Wallet (", recipientAddress.slice(0, 6), "...", recipientAddress.slice(-4), ")"] })] }), _jsxs("div", { className: "dark:border-b3-line flex items-center justify-between border-b border-[#e4e4e7] pb-3", children: [_jsx("span", { className: "font-inter text-sm font-normal leading-5 text-[#51525c] dark:text-white", children: "Network" }), _jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: "font-inter text-sm font-normal leading-5 text-[#51525c] dark:text-white", children: ALL_CHAINS[selectedToken.chain_id]?.name || "Unknown" }), ALL_CHAINS[selectedToken.chain_id]?.logoUrl && (_jsx("img", { src: ALL_CHAINS[selectedToken.chain_id].logoUrl, alt: ALL_CHAINS[selectedToken.chain_id]?.name, className: "h-4 w-4 rounded-full" }))] })] }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "font-inter text-sm font-normal leading-5 text-[#51525c] dark:text-white", children: "Network fee" }), _jsx("span", { className: "font-inter text-sm font-normal leading-5 text-[#18181b] dark:text-white", children: "$0.1" })] })] }) }) }), _jsx("div", { className: "flex-1" }), _jsxs("div", { className: "dark:border-b3-line dark:bg-b3-background flex gap-4 border-t border-[#e4e4e7] bg-[#fafafa] p-4", children: [_jsx(Button, { onClick: handleBack, disabled: isSending, variant: "outline", className: "font-inter h-12 flex-1 rounded-xl border border-[#e4e4e7] bg-white text-base font-semibold text-[#3f3f46] shadow-[inset_0px_0px_0px_1px_rgba(10,13,18,0.18),inset_0px_-2px_0px_0px_rgba(10,13,18,0.05)] hover:bg-[#fafafa]", children: "Cancel" }), _jsx(Button, { onClick: handleSend, disabled: isSending, className: "font-inter border-white/12 h-12 flex-1 rounded-xl border-2 bg-[#0c68e9] text-base font-semibold text-white shadow-[inset_0px_0px_0px_1px_rgba(10,13,18,0.18),inset_0px_-2px_0px_0px_rgba(10,13,18,0.05)] hover:bg-[#0b5fd4]", children: isSending ? (_jsxs(_Fragment, { children: [_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), "Sending..."] })) : ("Send") })] })] })), step === "success" && selectedToken && (_jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-6 p-5 text-center", children: [_jsx("div", { className: "flex h-14 w-14 items-center justify-center rounded-full bg-green-100", children: _jsx(SendIcon, { className: "h-7 w-7 text-green-600" }) }), _jsxs("div", { children: [_jsx("h3", { className: "font-neue-montreal-semibold mb-2 text-xl text-[#18181b]", children: "Sent!" }), _jsxs("p", { className: "font-neue-montreal-medium text-sm text-[#70707b]", children: [sendAmount, " ", selectedToken.symbol, " was sent to ", recipientAddress.slice(0, 6), "...", recipientAddress.slice(-4)] })] }), _jsx(Button, { onClick: () => setB3ModalOpen(false), className: "bg-b3-primary-blue hover:bg-b3-primary-blue/90 font-neue-montreal-semibold h-12 w-full rounded-xl text-white", children: "Done" })] }))] })] }));
|
|
192
196
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Button, Input, Loading, useAuthStore } from "../../../../global-account/react/index.js";
|
|
3
|
+
import { cn } from "../../../../shared/utils/index.js";
|
|
3
4
|
import { debugB3React } from "../../../../shared/utils/debug.js";
|
|
4
5
|
import { useState } from "react";
|
|
5
6
|
import { EmailVerificationRequiredError, useBetterAuth, } from "../../hooks/useBetterAuth.js";
|
|
@@ -13,6 +14,7 @@ const DEFAULT_SOCIAL_PROVIDERS = [
|
|
|
13
14
|
{ id: "discord", label: "Discord" },
|
|
14
15
|
{ id: "microsoft", label: "Microsoft" },
|
|
15
16
|
{ id: "slack", label: "Slack" },
|
|
17
|
+
{ id: "twitter", label: "X" },
|
|
16
18
|
];
|
|
17
19
|
/**
|
|
18
20
|
* Standalone inline sign-in component for Better Auth.
|
|
@@ -162,7 +164,7 @@ export function BetterAuthSignIn({ title, subtitle = "Enter your credentials to
|
|
|
162
164
|
const icon = strategyIcons[provider.id];
|
|
163
165
|
const label = strategyLabels[provider.id] || provider.label;
|
|
164
166
|
const isProviderLoading = loadingProvider === provider.id;
|
|
165
|
-
return (_jsxs("button", { onClick: () => handleSocialSignIn(provider.id), disabled: isLoading, style: { paddingTop: "12px", paddingBottom: "12px" }, className: "flex w-full items-center justify-center gap-3 rounded-lg border border-gray-200 bg-white px-4 text-[14px] font-medium text-gray-700 transition-colors hover:bg-gray-50 disabled:opacity-50 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-200 dark:hover:bg-gray-700", children: [isProviderLoading ? (_jsxs("svg", { className: "h-5 w-5 animate-spin text-gray-400", viewBox: "0 0 24 24", fill: "none", children: [_jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })] })) : (icon && _jsx("img", { src: icon, alt: "", className: "h-5 w-5" })), _jsx("span", { children: isProviderLoading ? "Redirecting..." : label })] }, provider.id));
|
|
167
|
+
return (_jsxs("button", { onClick: () => handleSocialSignIn(provider.id), disabled: isLoading, style: { paddingTop: "12px", paddingBottom: "12px" }, className: "flex w-full items-center justify-center gap-3 rounded-lg border border-gray-200 bg-white px-4 text-[14px] font-medium text-gray-700 transition-colors hover:bg-gray-50 disabled:opacity-50 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-200 dark:hover:bg-gray-700", children: [isProviderLoading ? (_jsxs("svg", { className: "h-5 w-5 animate-spin text-gray-400", viewBox: "0 0 24 24", fill: "none", children: [_jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })] })) : (icon && (_jsx("img", { src: icon, alt: "", className: cn("h-5 w-5", (provider.id === "github" || provider.id === "twitter") && "dark:invert") }))), _jsx("span", { children: isProviderLoading ? "Redirecting..." : label })] }, provider.id));
|
|
166
168
|
}) })] })), showEmail && mode !== "forgot-password" && (_jsxs("p", { className: "mt-8 text-center text-[14px] text-gray-500 dark:text-gray-400", children: [mode === "sign-in" ? "Don't have an account? " : "Already have an account? ", _jsx("button", { onClick: () => {
|
|
167
169
|
setMode(mode === "sign-in" ? "sign-up" : "sign-in");
|
|
168
170
|
setError(null);
|
|
@@ -4,7 +4,6 @@ import { LoginStepBetterAuth } from "./steps/LoginStepBetterAuth.js";
|
|
|
4
4
|
import { debugB3React } from "../../../../shared/utils/debug.js";
|
|
5
5
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
6
6
|
import { useActiveAccount } from "thirdweb/react";
|
|
7
|
-
import { SignInWithB3Privy } from "./SignInWithB3Privy.js";
|
|
8
7
|
import { LoginStep, LoginStepContainer } from "./steps/LoginStep.js";
|
|
9
8
|
import { LoginStepCustom } from "./steps/LoginStepCustom.js";
|
|
10
9
|
const debug = debugB3React("SignInWithB3Flow");
|
|
@@ -251,10 +250,7 @@ export function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySucce
|
|
|
251
250
|
}
|
|
252
251
|
else {
|
|
253
252
|
// Custom strategy
|
|
254
|
-
if (strategies
|
|
255
|
-
content = _jsx(SignInWithB3Privy, { onSuccess: handleLoginSuccess, chain: chain });
|
|
256
|
-
}
|
|
257
|
-
else if (strategies) {
|
|
253
|
+
if (strategies) {
|
|
258
254
|
// Strategies are explicitly provided
|
|
259
255
|
content = (_jsx(LoginStepCustom, { strategies: strategies, chain: chain, onSuccess: handleLoginSuccess, onError: onError, automaticallySetFirstEoa: !!automaticallySetFirstEoa }));
|
|
260
256
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Button } from "../../custom/Button.js";
|
|
3
|
+
import { cn } from "../../../../../shared/utils/index.js";
|
|
3
4
|
import { Github, Mail } from "lucide-react";
|
|
4
5
|
import { strategyIcons, strategyLabels } from "../utils/signInUtils.js";
|
|
5
6
|
const fallbackIcons = {
|
|
@@ -11,5 +12,5 @@ export function AuthButton({ strategy, onClick, isLoading, }) {
|
|
|
11
12
|
const strategyLabel = strategyLabels[strategy] || strategy;
|
|
12
13
|
const FallbackIcon = fallbackIcons[strategy];
|
|
13
14
|
const buttonLabel = `Sign in with ${strategyLabel}`;
|
|
14
|
-
return (_jsx(Button, { onClick: onClick, disabled: isLoading, "aria-label": buttonLabel, title: buttonLabel, className: "flex w-full items-center justify-center bg-gray-100 px-2 py-3 hover:bg-gray-200 dark:bg-gray-800 dark:hover:bg-gray-700", children: strategyIcon ? (_jsx("img", { src: strategyIcon, alt: `${strategyLabel} icon`, className: "h-9 w-9" })) : FallbackIcon ? (_jsx(FallbackIcon, { className: "h-9 w-9 text-gray-900 dark:text-gray-100" })) : (_jsx("span", { className: "text-sm font-semibold text-gray-900 dark:text-gray-100", children: strategyLabel.charAt(0) })) }, strategy));
|
|
15
|
+
return (_jsx(Button, { onClick: onClick, disabled: isLoading, "aria-label": buttonLabel, title: buttonLabel, className: "flex w-full items-center justify-center bg-gray-100 px-2 py-3 hover:bg-gray-200 dark:bg-gray-800 dark:hover:bg-gray-700", children: strategyIcon ? (_jsx("img", { src: strategyIcon, alt: `${strategyLabel} icon`, className: cn("h-9 w-9", (strategy === "github" || strategy === "twitter" || strategy === "x") && "dark:invert") })) : FallbackIcon ? (_jsx(FallbackIcon, { className: "h-9 w-9 text-gray-900 dark:text-gray-100" })) : (_jsx("span", { className: "text-sm font-semibold text-gray-900 dark:text-gray-100", children: strategyLabel.charAt(0) })) }, strategy));
|
|
15
16
|
}
|
|
@@ -13,6 +13,7 @@ const SOCIAL_PROVIDERS = [
|
|
|
13
13
|
{ id: "discord", label: "Discord" },
|
|
14
14
|
{ id: "microsoft", label: "Microsoft" },
|
|
15
15
|
{ id: "slack", label: "Slack" },
|
|
16
|
+
{ id: "twitter", label: "X" },
|
|
16
17
|
];
|
|
17
18
|
export function LoginStepBetterAuth({ onSuccess, onError, verifyEmailRedirectTo }) {
|
|
18
19
|
const { partnerId } = useB3Config();
|
|
@@ -2,10 +2,11 @@ import { Chain } from "thirdweb";
|
|
|
2
2
|
import { SingleStepAuthArgsType, Wallet } from "thirdweb/wallets";
|
|
3
3
|
type WalletType = Wallet["id"];
|
|
4
4
|
type StrategyType = SingleStepAuthArgsType["strategy"];
|
|
5
|
-
|
|
5
|
+
declare const customStrategies: readonly ["basement"];
|
|
6
|
+
type CustomStrategyType = (typeof customStrategies)[number];
|
|
6
7
|
type AllowedStrategies = StrategyType | WalletType | CustomStrategyType | "email";
|
|
7
8
|
type NonWalletStrategyType = Exclude<AllowedStrategies, WalletType>;
|
|
8
|
-
export declare const allowedStrategies: readonly ["apple", "google", "github", "x", "discord", "email", "guest", "walletConnect", "io.metamask", "com.coinbase.wallet", "basement"
|
|
9
|
+
export declare const allowedStrategies: readonly ["apple", "google", "github", "x", "discord", "email", "guest", "walletConnect", "io.metamask", "com.coinbase.wallet", "basement"];
|
|
9
10
|
export type AllowedStrategy = (typeof allowedStrategies)[number];
|
|
10
11
|
export declare function isWalletType(strategy: AllowedStrategies): strategy is WalletType;
|
|
11
12
|
export declare function isStrategyType(strategy: AllowedStrategies): strategy is NonWalletStrategyType;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createWallet } from "thirdweb/wallets";
|
|
2
|
-
const customStrategies = ["basement"
|
|
3
|
-
// type CustomStrategy = (typeof customStrategies)[number];
|
|
2
|
+
const customStrategies = ["basement"];
|
|
4
3
|
export const allowedStrategies = [
|
|
5
4
|
// Auth strategies
|
|
6
5
|
"apple",
|
|
@@ -15,7 +14,6 @@ export const allowedStrategies = [
|
|
|
15
14
|
"io.metamask",
|
|
16
15
|
"com.coinbase.wallet",
|
|
17
16
|
// Custom strategies
|
|
18
|
-
// TODO: Audit we don't use "privy" directly anymore
|
|
19
17
|
...customStrategies,
|
|
20
18
|
];
|
|
21
19
|
export function isWalletType(strategy) {
|
|
@@ -45,6 +43,7 @@ export const strategyIcons = {
|
|
|
45
43
|
google: "https://cdn.b3.fun/google.svg",
|
|
46
44
|
github: "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/github/github-original.svg",
|
|
47
45
|
x: "https://cdn.b3.fun/x.svg?1",
|
|
46
|
+
twitter: "https://cdn.b3.fun/x.svg?1",
|
|
48
47
|
discord: "https://cdn.b3.fun/discord.svg",
|
|
49
48
|
apple: "https://cdn.b3.fun/apple.svg",
|
|
50
49
|
guest: "https://cdn.b3.fun/incognito.svg",
|
|
@@ -54,6 +53,7 @@ export const strategyIcons = {
|
|
|
54
53
|
export const strategyLabels = {
|
|
55
54
|
google: "Google",
|
|
56
55
|
x: "X",
|
|
56
|
+
twitter: "X",
|
|
57
57
|
discord: "Discord",
|
|
58
58
|
apple: "Apple",
|
|
59
59
|
guest: "Guest",
|
|
@@ -5,6 +5,7 @@ export { RelayKitProviderWrapper } from "./B3Provider/RelayKitProviderWrapper";
|
|
|
5
5
|
export { useB3 } from "./B3Provider/useB3";
|
|
6
6
|
export { useB3Account } from "./B3Provider/useB3Account";
|
|
7
7
|
export { useB3Config } from "./B3Provider/useB3Config";
|
|
8
|
+
export { B3ConfigPartnerOverride } from "./B3Provider/B3ConfigProvider";
|
|
8
9
|
export { StyleRoot } from "./StyleRoot";
|
|
9
10
|
export { BetterAuthResetPassword, type BetterAuthResetPasswordProps } from "./SignInWithB3/BetterAuthResetPassword";
|
|
10
11
|
export { BetterAuthSignIn, type BetterAuthSignInProps } from "./SignInWithB3/BetterAuthSignIn";
|
|
@@ -14,7 +15,6 @@ export { PermissionItem } from "./SignInWithB3/components/PermissionItem";
|
|
|
14
15
|
export { WalletRow } from "./SignInWithB3/components/WalletRow";
|
|
15
16
|
export { SignInWithB3 } from "./SignInWithB3/SignInWithB3";
|
|
16
17
|
export { SignInWithB3Flow } from "./SignInWithB3/SignInWithB3Flow";
|
|
17
|
-
export { SignInWithB3Privy } from "./SignInWithB3/SignInWithB3Privy";
|
|
18
18
|
export { LoginStepContainer } from "./SignInWithB3/steps/LoginStep";
|
|
19
19
|
export { getConnectOptionsFromStrategy, isWalletType, type AllowedStrategy } from "./SignInWithB3/utils/signInUtils";
|
|
20
20
|
export { ManageAccount } from "./ManageAccount/ManageAccount";
|
|
@@ -6,6 +6,7 @@ export { RelayKitProviderWrapper } from "./B3Provider/RelayKitProviderWrapper.js
|
|
|
6
6
|
export { useB3 } from "./B3Provider/useB3.js";
|
|
7
7
|
export { useB3Account } from "./B3Provider/useB3Account.js";
|
|
8
8
|
export { useB3Config } from "./B3Provider/useB3Config.js";
|
|
9
|
+
export { B3ConfigPartnerOverride } from "./B3Provider/B3ConfigProvider.js";
|
|
9
10
|
export { StyleRoot } from "./StyleRoot.js";
|
|
10
11
|
// SignInWithB3 Components
|
|
11
12
|
export { BetterAuthResetPassword } from "./SignInWithB3/BetterAuthResetPassword.js";
|
|
@@ -16,7 +17,6 @@ export { PermissionItem } from "./SignInWithB3/components/PermissionItem.js";
|
|
|
16
17
|
export { WalletRow } from "./SignInWithB3/components/WalletRow.js";
|
|
17
18
|
export { SignInWithB3 } from "./SignInWithB3/SignInWithB3.js";
|
|
18
19
|
export { SignInWithB3Flow } from "./SignInWithB3/SignInWithB3Flow.js";
|
|
19
|
-
export { SignInWithB3Privy } from "./SignInWithB3/SignInWithB3Privy.js";
|
|
20
20
|
export { LoginStepContainer } from "./SignInWithB3/steps/LoginStep.js";
|
|
21
21
|
export { getConnectOptionsFromStrategy, isWalletType } from "./SignInWithB3/utils/signInUtils.js";
|
|
22
22
|
// ManageAccount Components
|
|
@@ -17,7 +17,6 @@ export { useFirstEOA } from "./useFirstEOA";
|
|
|
17
17
|
export { useGetAllTWSigners, type TWSignerWithMetadata } from "./useGetAllTWSigners";
|
|
18
18
|
export { useGetGeo } from "./useGetGeo";
|
|
19
19
|
export { useGlobalAccount } from "./useGlobalAccount";
|
|
20
|
-
export { useHandleConnectWithPrivy } from "./useHandleConnectWithPrivy";
|
|
21
20
|
export { useHasMounted } from "./useHasMounted";
|
|
22
21
|
export { useIsMobile } from "./useIsMobile";
|
|
23
22
|
export { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect";
|
|
@@ -31,8 +30,8 @@ export { useQueryBSMNT } from "./useQueryBSMNT";
|
|
|
31
30
|
export { useRemoveSessionKey } from "./useRemoveSessionKey";
|
|
32
31
|
export { useRouter } from "./useRouter";
|
|
33
32
|
export { useSearchParamsSSR } from "./useSearchParamsSSR";
|
|
34
|
-
export {
|
|
35
|
-
export {
|
|
33
|
+
export { usePortfolioBalance, usePortfolioTokenBalance } from "./usePortfolioBalance";
|
|
34
|
+
export { usePortfolioCollectibles } from "./usePortfolioCollectibles";
|
|
36
35
|
export { useSiwe } from "./useSiwe";
|
|
37
36
|
export { useTokenBalance } from "./useTokenBalance";
|
|
38
37
|
export { useTokenBalanceDirect } from "./useTokenBalanceDirect";
|
|
@@ -17,7 +17,6 @@ export { useFirstEOA } from "./useFirstEOA.js";
|
|
|
17
17
|
export { useGetAllTWSigners } from "./useGetAllTWSigners.js";
|
|
18
18
|
export { useGetGeo } from "./useGetGeo.js";
|
|
19
19
|
export { useGlobalAccount } from "./useGlobalAccount.js";
|
|
20
|
-
export { useHandleConnectWithPrivy } from "./useHandleConnectWithPrivy.js";
|
|
21
20
|
export { useHasMounted } from "./useHasMounted.js";
|
|
22
21
|
export { useIsMobile } from "./useIsMobile.js";
|
|
23
22
|
export { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect.js";
|
|
@@ -31,8 +30,8 @@ export { useQueryBSMNT } from "./useQueryBSMNT.js";
|
|
|
31
30
|
export { useRemoveSessionKey } from "./useRemoveSessionKey.js";
|
|
32
31
|
export { useRouter } from "./useRouter.js";
|
|
33
32
|
export { useSearchParamsSSR } from "./useSearchParamsSSR.js";
|
|
34
|
-
export {
|
|
35
|
-
export {
|
|
33
|
+
export { usePortfolioBalance, usePortfolioTokenBalance } from "./usePortfolioBalance.js";
|
|
34
|
+
export { usePortfolioCollectibles } from "./usePortfolioCollectibles.js";
|
|
36
35
|
export { useSiwe } from "./useSiwe.js";
|
|
37
36
|
export { useTokenBalance } from "./useTokenBalance.js";
|
|
38
37
|
export { useTokenBalanceDirect } from "./useTokenBalanceDirect.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type EcosystemWallet } from "../../../shared/constants";
|
|
1
2
|
import { Wallet } from "thirdweb/wallets";
|
|
2
3
|
import { preAuthenticate } from "thirdweb/wallets/in-app";
|
|
3
4
|
/**
|
|
@@ -6,14 +7,14 @@ import { preAuthenticate } from "thirdweb/wallets/in-app";
|
|
|
6
7
|
* This hook provides 1:1 feature parity with useAuthentication.ts
|
|
7
8
|
*/
|
|
8
9
|
export declare function useAuth(): {
|
|
9
|
-
authenticate: (accessToken: string, partnerId: string, strategy?: string) => Promise<
|
|
10
|
-
reAuthenticate: () => Promise<
|
|
10
|
+
authenticate: (accessToken: string, partnerId: string, strategy?: string) => Promise<Record<string, any>>;
|
|
11
|
+
reAuthenticate: () => Promise<Record<string, any>>;
|
|
11
12
|
logout: (callback?: () => void) => Promise<void>;
|
|
12
13
|
isAuthenticated: boolean;
|
|
13
14
|
isReady: boolean;
|
|
14
15
|
isConnecting: boolean;
|
|
15
16
|
isConnected: boolean;
|
|
16
|
-
wallet:
|
|
17
|
+
wallet: EcosystemWallet;
|
|
17
18
|
preAuthenticate: typeof preAuthenticate;
|
|
18
19
|
connect: (_walleAutoConnectedWith: Wallet, allConnectedWallets: Wallet[]) => Promise<void>;
|
|
19
20
|
isAuthenticating: boolean;
|
|
@@ -70,6 +71,6 @@ export declare function useAuth(): {
|
|
|
70
71
|
turnkeyOtpId?: string | undefined;
|
|
71
72
|
};
|
|
72
73
|
} | undefined;
|
|
73
|
-
refetchUser: () => Promise<
|
|
74
|
+
refetchUser: () => Promise<Record<string, any>>;
|
|
74
75
|
setUser: (newUser?: import("@b3dotfun/b3-api").Users) => void;
|
|
75
76
|
};
|
|
@@ -44,6 +44,7 @@ export function useAuth() {
|
|
|
44
44
|
const { switchAccount } = useSwitchAccount();
|
|
45
45
|
const { user, setUser } = useUserQuery();
|
|
46
46
|
debug("@@activeWagmiAccount", activeWagmiAccount);
|
|
47
|
+
// Explicit annotation keeps the hook's declaration portable (TS2742).
|
|
47
48
|
const wallet = ecosystemWallet(ecosystemWalletId, {
|
|
48
49
|
partnerId: partnerId,
|
|
49
50
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type EcosystemWallet } from "../../../shared/constants";
|
|
1
2
|
import { Wallet } from "thirdweb/wallets";
|
|
2
3
|
import { preAuthenticate } from "thirdweb/wallets/in-app";
|
|
3
4
|
export declare function useAuthentication(partnerId: string, { skipAutoConnect }?: {
|
|
@@ -8,7 +9,7 @@ export declare function useAuthentication(partnerId: string, { skipAutoConnect }
|
|
|
8
9
|
isReady: boolean;
|
|
9
10
|
isConnecting: boolean;
|
|
10
11
|
isConnected: boolean;
|
|
11
|
-
wallet:
|
|
12
|
+
wallet: EcosystemWallet;
|
|
12
13
|
preAuthenticate: typeof preAuthenticate;
|
|
13
14
|
connect: (_walleAutoConnectedWith: Wallet, allConnectedWallets: Wallet[]) => Promise<void>;
|
|
14
15
|
isAuthenticating: boolean;
|
|
@@ -65,6 +66,6 @@ export declare function useAuthentication(partnerId: string, { skipAutoConnect }
|
|
|
65
66
|
turnkeyOtpId?: string | undefined;
|
|
66
67
|
};
|
|
67
68
|
} | undefined;
|
|
68
|
-
refetchUser: (wallet?: Wallet) => Promise<
|
|
69
|
+
refetchUser: (wallet?: Wallet) => Promise<Record<string, any>>;
|
|
69
70
|
setUser: (newUser?: import("@b3dotfun/b3-api").Users) => void;
|
|
70
71
|
};
|
|
@@ -53,6 +53,7 @@ export function useAuthentication(partnerId, { skipAutoConnect = false } = {}) {
|
|
|
53
53
|
const activeWagmiAccount = useAccount();
|
|
54
54
|
const { switchAccount } = useSwitchAccount();
|
|
55
55
|
debug("@@activeWagmiAccount", activeWagmiAccount);
|
|
56
|
+
// Explicit annotation keeps the hook's declaration portable (TS2742).
|
|
56
57
|
const wallet = ecosystemWallet(ecosystemWalletId, {
|
|
57
58
|
partnerId: partnerId,
|
|
58
59
|
});
|
|
@@ -186,7 +187,7 @@ export function useAuthentication(partnerId, { skipAutoConnect = false } = {}) {
|
|
|
186
187
|
localStorage.removeItem("lastAuthProvider");
|
|
187
188
|
localStorage.removeItem("b3-user");
|
|
188
189
|
}
|
|
189
|
-
app.logout();
|
|
190
|
+
await app.logout();
|
|
190
191
|
debug("@@logout:loggedOut");
|
|
191
192
|
setIsAuthenticated(false);
|
|
192
193
|
setIsConnected(false);
|