@b3dotfun/sdk 0.1.70-alpha.1 → 0.1.70-alpha.11
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/constants/chains/b3Chain.js +3 -1
- package/dist/cjs/anyspend/constants/rpc.d.ts +2 -1
- package/dist/cjs/anyspend/constants/rpc.js +4 -2
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +21 -14
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +9 -3
- package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendWorkflowTrigger.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/AnySpendWorkflowTrigger.js +2 -2
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +2 -2
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.js +2 -2
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckout.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckout.js +2 -2
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckoutTrigger.js +2 -2
- package/dist/cjs/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/CheckoutPaymentPanel.js +13 -3
- package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +3 -3
- package/dist/cjs/anyspend/utils/chain.d.ts +39 -1
- package/dist/cjs/anyspend/utils/chain.js +23 -2
- 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 +19 -4
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +6 -11
- package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +1 -5
- package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.js +1 -2
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +8 -13
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +24 -3
- package/dist/cjs/global-account/react/components/B3Provider/BetterAuthProvider.js +48 -8
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -5
- 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 +1 -3
- package/dist/cjs/global-account/react/components/index.d.ts +0 -2
- package/dist/cjs/global-account/react/components/index.js +3 -7
- package/dist/cjs/global-account/react/hooks/index.d.ts +0 -1
- package/dist/cjs/global-account/react/hooks/index.js +2 -4
- package/dist/cjs/global-account/react/hooks/useAuth.d.ts +3 -3
- package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useAuthentication.js +1 -1
- package/dist/cjs/global-account/react/hooks/useBetterAuth.d.ts +1656 -21
- package/dist/cjs/global-account/react/hooks/useBetterAuth.js +13 -14
- package/dist/cjs/global-account/react/hooks/useClient.d.ts +3 -3
- package/dist/cjs/global-account/react/hooks/useNativeBalance.js +2 -2
- 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.js +20 -17
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +28 -0
- 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 +6 -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/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/esm/anyspend/constants/rpc.d.ts +2 -1
- package/dist/esm/anyspend/constants/rpc.js +3 -1
- package/dist/esm/anyspend/react/components/AnySpendBondKit.d.ts +1 -1
- package/dist/esm/anyspend/react/components/AnySpendBondKit.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +2 -0
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +21 -14
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +10 -4
- package/dist/esm/anyspend/react/components/AnySpendDepositUpside.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendDepositUpside.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendWorkflowTrigger.d.ts +3 -1
- package/dist/esm/anyspend/react/components/AnySpendWorkflowTrigger.js +2 -2
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +2 -2
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.js +2 -2
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckout.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckout.js +2 -2
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckoutTrigger.js +2 -2
- package/dist/esm/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/CheckoutPaymentPanel.js +14 -4
- package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +3 -3
- package/dist/esm/anyspend/utils/chain.d.ts +39 -1
- package/dist/esm/anyspend/utils/chain.js +24 -3
- 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 +19 -5
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +6 -11
- package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +1 -5
- package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.js +1 -2
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +8 -13
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +25 -4
- package/dist/esm/global-account/react/components/B3Provider/BetterAuthProvider.js +48 -8
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +1 -1
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -5
- 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 +1 -3
- package/dist/esm/global-account/react/components/index.d.ts +0 -2
- package/dist/esm/global-account/react/components/index.js +0 -2
- package/dist/esm/global-account/react/hooks/index.d.ts +0 -1
- package/dist/esm/global-account/react/hooks/index.js +0 -1
- package/dist/esm/global-account/react/hooks/useAuth.d.ts +3 -3
- package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useAuthentication.js +1 -1
- package/dist/esm/global-account/react/hooks/useBetterAuth.d.ts +1656 -21
- package/dist/esm/global-account/react/hooks/useBetterAuth.js +13 -14
- package/dist/esm/global-account/react/hooks/useClient.d.ts +3 -3
- package/dist/esm/global-account/react/hooks/useNativeBalance.js +1 -1
- 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.js +20 -17
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +28 -0
- 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 +6 -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/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/styles/index.css +1 -1
- package/dist/types/anyspend/constants/rpc.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendBondKit.d.ts +1 -1
- package/dist/types/anyspend/react/components/AnySpendBuySpin.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +2 -0
- package/dist/types/anyspend/react/components/AnySpendDepositUpside.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendStakeB3.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendWorkflowTrigger.d.ts +3 -1
- package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnyspendSignatureMint.d.ts +2 -1
- package/dist/types/anyspend/react/components/checkout/AnySpendCheckout.d.ts +3 -1
- package/dist/types/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +3 -1
- package/dist/types/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +3 -1
- package/dist/types/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +3 -3
- package/dist/types/anyspend/utils/chain.d.ts +39 -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 +1 -5
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +8 -13
- package/dist/types/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +3 -2
- package/dist/types/global-account/react/components/index.d.ts +0 -2
- package/dist/types/global-account/react/hooks/index.d.ts +0 -1
- package/dist/types/global-account/react/hooks/useAuth.d.ts +3 -3
- package/dist/types/global-account/react/hooks/useAuthentication.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useBetterAuth.d.ts +1656 -21
- package/dist/types/global-account/react/hooks/useClient.d.ts +3 -3
- 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/stores/useModalStore.d.ts +28 -0
- 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 +6 -54
- package/dist/types/shared/constants/chains/supported.d.ts +1 -49
- package/dist/types/shared/utils/chain-transformers.d.ts +4 -4
- package/dist/types/shared/utils/upload.d.ts +9 -0
- package/node_modules/@b3/chain-registry/chains.json +1160 -0
- package/node_modules/@b3/chain-registry/package.json +14 -0
- package/node_modules/@b3/chain-registry/src/index.ts +169 -0
- package/node_modules/@b3/chain-registry/tsconfig.json +16 -0
- package/package.json +76 -28
- package/src/anyspend/constants/rpc.ts +3 -2
- package/src/anyspend/react/components/AnySpendBondKit.tsx +2 -0
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +3 -0
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +29 -14
- package/src/anyspend/react/components/AnySpendDeposit.tsx +13 -3
- package/src/anyspend/react/components/AnySpendDepositUpside.tsx +3 -0
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +3 -0
- package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +3 -0
- package/src/anyspend/react/components/AnySpendStakeUpsideExactIn.tsx +3 -0
- package/src/anyspend/react/components/AnySpendWorkflowTrigger.tsx +4 -0
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +3 -0
- package/src/anyspend/react/components/AnyspendSignatureMint.tsx +3 -0
- package/src/anyspend/react/components/checkout/AnySpendCheckout.tsx +4 -0
- package/src/anyspend/react/components/checkout/AnySpendCheckoutTrigger.tsx +4 -0
- package/src/anyspend/react/components/checkout/CheckoutPaymentPanel.tsx +97 -79
- package/src/anyspend/react/hooks/useAnyspendQuote.ts +13 -13
- package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +4 -4
- package/src/anyspend/types/api_req_res.ts +10 -5
- package/src/anyspend/utils/chain.ts +26 -1
- 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 +41 -9
- package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +6 -11
- package/src/global-account/react/components/B3Provider/B3ConfigProvider.tsx +0 -6
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +49 -32
- package/src/global-account/react/components/B3Provider/BetterAuthProvider.tsx +53 -8
- package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +1 -1
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +1 -4
- package/src/global-account/react/components/SignInWithB3/utils/signInUtils.ts +2 -4
- package/src/global-account/react/components/index.ts +0 -2
- package/src/global-account/react/components/ui/button.tsx +1 -2
- package/src/global-account/react/hooks/index.ts +0 -1
- package/src/global-account/react/hooks/useAuth.ts +2 -2
- package/src/global-account/react/hooks/useAuthentication.ts +2 -2
- package/src/global-account/react/hooks/useBetterAuth.ts +14 -15
- package/src/global-account/react/hooks/useClient.ts +11 -2
- package/src/global-account/react/hooks/useNativeBalance.tsx +1 -1
- 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 +22 -20
- package/src/global-account/react/stores/useModalStore.ts +28 -0
- 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/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/styles/index.css +27 -0
- package/dist/cjs/global-account/react/components/B3Provider/BetterAuthClientProvider.d.ts +0 -17
- package/dist/cjs/global-account/react/components/B3Provider/BetterAuthClientProvider.js +0 -31
- 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/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/B3Provider/BetterAuthClientProvider.d.ts +0 -17
- package/dist/esm/global-account/react/components/B3Provider/BetterAuthClientProvider.js +0 -27
- 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/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/B3Provider/BetterAuthClientProvider.d.ts +0 -17
- 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/types/chain-networks.d.ts +0 -44
- package/src/global-account/react/components/B3Provider/BetterAuthClientProvider.tsx +0 -40
- 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/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,19 @@ 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;
|
|
26
29
|
/**
|
|
27
30
|
* Creates a socket client
|
|
28
31
|
*/
|
|
29
32
|
function createSocketClient() {
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
const url = (0, app_shared_1.getB3ApiUrl)();
|
|
34
|
+
if (!socketClient || socketClientUrl !== url) {
|
|
35
|
+
socketInstance = (0, socket_io_client_1.default)(url, { transports: ["websocket"] });
|
|
32
36
|
socketClient = (0, b3_api_1.createClient)((0, socketio_client_1.default)(socketInstance), app_shared_1.clientOptions);
|
|
37
|
+
socketClientUrl = url;
|
|
33
38
|
}
|
|
34
39
|
return socketClient;
|
|
35
40
|
}
|
|
@@ -45,12 +50,22 @@ function resolveFetch() {
|
|
|
45
50
|
return require("cross-fetch").fetch;
|
|
46
51
|
}
|
|
47
52
|
function createRestClient() {
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
const url = (0, app_shared_1.getB3ApiUrl)();
|
|
54
|
+
if (!restClient || restClientUrl !== url) {
|
|
55
|
+
const connection = (0, rest_client_1.default)(url).fetch(resolveFetch());
|
|
50
56
|
restClient = (0, b3_api_1.createClient)(connection, app_shared_1.clientOptions);
|
|
57
|
+
restClientUrl = url;
|
|
51
58
|
}
|
|
52
59
|
return restClient;
|
|
53
60
|
}
|
|
61
|
+
/** Reset all cached clients (called when API URL changes). */
|
|
62
|
+
function resetClients() {
|
|
63
|
+
socketClient = null;
|
|
64
|
+
socketClientUrl = null;
|
|
65
|
+
restClient = null;
|
|
66
|
+
restClientUrl = null;
|
|
67
|
+
currentClient = null;
|
|
68
|
+
}
|
|
54
69
|
/**
|
|
55
70
|
* Sets the active client type and creates the appropriate client
|
|
56
71
|
*
|
|
@@ -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
|
{});
|
|
@@ -15,10 +15,8 @@ export interface B3ConfigContextType {
|
|
|
15
15
|
stripePublishableKey?: string;
|
|
16
16
|
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
17
17
|
authStrategy: AuthStrategy;
|
|
18
|
-
/** Override the API base URL for all auth operations (Better Auth client, Feathers JWT exchange). */
|
|
19
|
-
apiUrl?: string;
|
|
20
18
|
}
|
|
21
|
-
export declare function B3ConfigProvider({ children, accountOverride, environment, defaultPermissions, automaticallySetFirstEoa, theme, clientType, partnerId, stripePublishableKey, createClientReferenceId, authStrategy,
|
|
19
|
+
export declare function B3ConfigProvider({ children, accountOverride, environment, defaultPermissions, automaticallySetFirstEoa, theme, clientType, partnerId, stripePublishableKey, createClientReferenceId, authStrategy, }: {
|
|
22
20
|
children: React.ReactNode;
|
|
23
21
|
accountOverride?: Account;
|
|
24
22
|
environment?: "development" | "production";
|
|
@@ -30,7 +28,5 @@ export declare function B3ConfigProvider({ children, accountOverride, environmen
|
|
|
30
28
|
stripePublishableKey?: string;
|
|
31
29
|
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
32
30
|
authStrategy?: AuthStrategy;
|
|
33
|
-
/** Override the API base URL for all auth operations (Better Auth client, Feathers JWT exchange). */
|
|
34
|
-
apiUrl?: string;
|
|
35
31
|
}): import("react/jsx-runtime").JSX.Element;
|
|
36
32
|
export declare function useB3Config(): B3ConfigContextType;
|
|
@@ -14,7 +14,7 @@ const DEFAULT_PERMISSIONS = {
|
|
|
14
14
|
endDate: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365), // 1 year from now
|
|
15
15
|
};
|
|
16
16
|
const B3ConfigContext = (0, react_1.createContext)(null);
|
|
17
|
-
function B3ConfigProvider({ children, accountOverride, environment = "development", defaultPermissions = DEFAULT_PERMISSIONS, automaticallySetFirstEoa = false, theme = "light", clientType = "rest", partnerId, stripePublishableKey, createClientReferenceId, authStrategy = "thirdweb",
|
|
17
|
+
function B3ConfigProvider({ children, accountOverride, environment = "development", defaultPermissions = DEFAULT_PERMISSIONS, automaticallySetFirstEoa = false, theme = "light", clientType = "rest", partnerId, stripePublishableKey, createClientReferenceId, authStrategy = "thirdweb", }) {
|
|
18
18
|
return ((0, jsx_runtime_1.jsx)(B3ConfigContext.Provider, { value: {
|
|
19
19
|
accountOverride,
|
|
20
20
|
environment,
|
|
@@ -26,7 +26,6 @@ function B3ConfigProvider({ children, accountOverride, environment = "developmen
|
|
|
26
26
|
stripePublishableKey,
|
|
27
27
|
createClientReferenceId,
|
|
28
28
|
authStrategy,
|
|
29
|
-
apiUrl,
|
|
30
29
|
}, children: children }));
|
|
31
30
|
}
|
|
32
31
|
function useB3Config() {
|
|
@@ -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, simDuneApiKey, toaster: _toaster, clientType, rpcUrls, partnerId, stripePublishableKey, onConnect, onLogout, connectors, overrideDefaultConnectors, createClientReferenceId, defaultPermissions, disableBSMNTAuthentication, queryClient, authStrategy, apiUrl, }: {
|
|
13
|
+
export declare function B3Provider({ theme, children, accountOverride, environment, automaticallySetFirstEoa, defaultEoaProvider, simDuneApiKey, 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;
|
|
@@ -40,19 +40,14 @@ export declare function B3Provider({ theme, children, accountOverride, environme
|
|
|
40
40
|
/** Auth strategy: "thirdweb" (default, ecosystem wallet) or "better-auth" (email/password via Better Auth) */
|
|
41
41
|
authStrategy?: AuthStrategy;
|
|
42
42
|
/**
|
|
43
|
-
* Override the API
|
|
43
|
+
* Override the B3 API URL. When provided, all SDK requests (auth, Feathers,
|
|
44
|
+
* BetterAuth) will use this URL instead of the `NEXT_PUBLIC_B3_API` env var.
|
|
44
45
|
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* Useful for local development where the frontend runs on localhost:3003 and
|
|
49
|
-
* the b3-api runs on localhost:3031 — keeps the entire OAuth flow local so
|
|
50
|
-
* sessions, cookies, and token exchange all hit the same server.
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* ```tsx
|
|
54
|
-
* <B3Provider apiUrl="http://localhost:3031" ... />
|
|
55
|
-
* ```
|
|
46
|
+
* Useful for local development: pass `http://localhost:3031` to route
|
|
47
|
+
* OAuth callbacks and session checks through your local B3 API.
|
|
48
|
+
* If omitted, defaults to `NEXT_PUBLIC_B3_API` or `https://api.b3.fun`.
|
|
56
49
|
*/
|
|
57
50
|
apiUrl?: string;
|
|
51
|
+
/** Override the notifications worker URL. Defaults to `https://notifications.b3.fun`. */
|
|
52
|
+
notificationsApiUrl?: string;
|
|
58
53
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,19 +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
|
-
const BetterAuthClientProvider_1 = require("./BetterAuthClientProvider");
|
|
20
22
|
const BetterAuthProvider_1 = __importDefault(require("./BetterAuthProvider"));
|
|
21
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
|
+
};
|
|
22
28
|
/**
|
|
23
29
|
* Main B3Provider component
|
|
24
30
|
*/
|
|
25
31
|
function B3Provider({ theme = "light", children, accountOverride, environment, automaticallySetFirstEoa, defaultEoaProvider, simDuneApiKey,
|
|
26
32
|
// deprecated since v0.0.87
|
|
27
|
-
toaster: _toaster, clientType = "rest", rpcUrls, partnerId, stripePublishableKey, onConnect, onLogout, connectors, overrideDefaultConnectors = false, createClientReferenceId, defaultPermissions, disableBSMNTAuthentication = false, queryClient, authStrategy = "thirdweb", apiUrl, }) {
|
|
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]);
|
|
28
49
|
// Initialize Google Analytics on mount
|
|
29
50
|
(0, react_3.useEffect)(() => {
|
|
30
51
|
(0, analytics_1.loadGA4Script)();
|
|
@@ -34,7 +55,7 @@ toaster: _toaster, clientType = "rest", rpcUrls, partnerId, stripePublishableKey
|
|
|
34
55
|
(0, client_manager_1.setClientType)(clientType);
|
|
35
56
|
}, [clientType]);
|
|
36
57
|
const wagmiConfig = (0, react_3.useMemo)(() => (0, createWagmiConfig_1.createWagmiConfig)({ partnerId, rpcUrls, connectors, overrideDefaultConnectors }), [partnerId, rpcUrls, connectors, overrideDefaultConnectors]);
|
|
37
|
-
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.
|
|
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, { simDuneApiKey: simDuneApiKey, 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 }))] }) }) }) }) }));
|
|
38
59
|
}
|
|
39
60
|
/**
|
|
40
61
|
* Component to connect the toast context to the global toast API
|
|
@@ -9,8 +9,8 @@ const constants_1 = require("../../../../shared/constants");
|
|
|
9
9
|
const debug_1 = require("../../../../shared/utils/debug");
|
|
10
10
|
const js_cookie_1 = __importDefault(require("js-cookie"));
|
|
11
11
|
const react_2 = require("react");
|
|
12
|
+
const better_auth_client_1 = require("../../../better-auth-client");
|
|
12
13
|
const useUserQuery_1 = require("../../hooks/useUserQuery");
|
|
13
|
-
const BetterAuthClientProvider_1 = require("./BetterAuthClientProvider");
|
|
14
14
|
const debug = (0, debug_1.debugB3React)("BetterAuthProvider");
|
|
15
15
|
/**
|
|
16
16
|
* Parallel to AuthenticationProvider for Better Auth strategy.
|
|
@@ -25,7 +25,6 @@ const debug = (0, debug_1.debugB3React)("BetterAuthProvider");
|
|
|
25
25
|
* useAuth, SignIn component, etc.) automatically clears the Better Auth session.
|
|
26
26
|
*/
|
|
27
27
|
const BetterAuthProvider = ({ partnerId }) => {
|
|
28
|
-
const betterAuthClient = (0, BetterAuthClientProvider_1.useBetterAuthClient)();
|
|
29
28
|
const setIsAuthenticated = (0, react_1.useAuthStore)(state => state.setIsAuthenticated);
|
|
30
29
|
const setIsAuthenticating = (0, react_1.useAuthStore)(state => state.setIsAuthenticating);
|
|
31
30
|
const setIsConnected = (0, react_1.useAuthStore)(state => state.setIsConnected);
|
|
@@ -46,7 +45,7 @@ const BetterAuthProvider = ({ partnerId }) => {
|
|
|
46
45
|
app_1.default.logout = async () => {
|
|
47
46
|
debug("Patched logout: clearing Better Auth session");
|
|
48
47
|
try {
|
|
49
|
-
await
|
|
48
|
+
await (0, better_auth_client_1.getBetterAuthClient)().signOut();
|
|
50
49
|
}
|
|
51
50
|
catch {
|
|
52
51
|
debug("Better Auth signOut failed (non-critical)");
|
|
@@ -57,7 +56,7 @@ const BetterAuthProvider = ({ partnerId }) => {
|
|
|
57
56
|
app_1.default.logout = originalLogout;
|
|
58
57
|
hasPatched.current = false;
|
|
59
58
|
};
|
|
60
|
-
}, [
|
|
59
|
+
}, []);
|
|
61
60
|
// Session restore on mount
|
|
62
61
|
(0, react_2.useEffect)(() => {
|
|
63
62
|
if (hasAttemptedRestore.current)
|
|
@@ -80,9 +79,50 @@ const BetterAuthProvider = ({ partnerId }) => {
|
|
|
80
79
|
catch {
|
|
81
80
|
debug("No existing Feathers JWT");
|
|
82
81
|
}
|
|
83
|
-
// 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)
|
|
84
124
|
try {
|
|
85
|
-
const session = await
|
|
125
|
+
const session = await (0, better_auth_client_1.getBetterAuthClient)().getSession();
|
|
86
126
|
if (session.data?.session?.token) {
|
|
87
127
|
debug("Better Auth session found, exchanging for Feathers JWT", {
|
|
88
128
|
betterAuthUserId: session.data.user?.id,
|
|
@@ -111,11 +151,11 @@ const BetterAuthProvider = ({ partnerId }) => {
|
|
|
111
151
|
catch {
|
|
112
152
|
debug("No Better Auth session to restore");
|
|
113
153
|
}
|
|
114
|
-
//
|
|
154
|
+
// 4. Nothing found — show login UI
|
|
115
155
|
setIsAuthenticating(false);
|
|
116
156
|
};
|
|
117
157
|
restoreSession();
|
|
118
|
-
}, [setIsAuthenticated, setIsAuthenticating, setIsConnected, setUser, partnerId
|
|
158
|
+
}, [setIsAuthenticated, setIsAuthenticating, setIsConnected, setUser, partnerId]);
|
|
119
159
|
return null;
|
|
120
160
|
};
|
|
121
161
|
exports.default = BetterAuthProvider;
|
|
@@ -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 }, {}));
|
|
@@ -7,7 +7,6 @@ const LoginStepBetterAuth_1 = require("./steps/LoginStepBetterAuth");
|
|
|
7
7
|
const debug_1 = require("../../../../shared/utils/debug");
|
|
8
8
|
const react_2 = require("react");
|
|
9
9
|
const react_3 = require("thirdweb/react");
|
|
10
|
-
const SignInWithB3Privy_1 = require("./SignInWithB3Privy");
|
|
11
10
|
const LoginStep_1 = require("./steps/LoginStep");
|
|
12
11
|
const LoginStepCustom_1 = require("./steps/LoginStepCustom");
|
|
13
12
|
const debug = (0, debug_1.debugB3React)("SignInWithB3Flow");
|
|
@@ -254,10 +253,7 @@ function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onE
|
|
|
254
253
|
}
|
|
255
254
|
else {
|
|
256
255
|
// Custom strategy
|
|
257
|
-
if (strategies
|
|
258
|
-
content = (0, jsx_runtime_1.jsx)(SignInWithB3Privy_1.SignInWithB3Privy, { onSuccess: handleLoginSuccess, chain: chain });
|
|
259
|
-
}
|
|
260
|
-
else if (strategies) {
|
|
256
|
+
if (strategies) {
|
|
261
257
|
// Strategies are explicitly provided
|
|
262
258
|
content = ((0, jsx_runtime_1.jsx)(LoginStepCustom_1.LoginStepCustom, { strategies: strategies, chain: chain, onSuccess: handleLoginSuccess, onError: onError, automaticallySetFirstEoa: !!automaticallySetFirstEoa }));
|
|
263
259
|
}
|
|
@@ -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;
|
|
@@ -5,8 +5,7 @@ exports.isWalletType = isWalletType;
|
|
|
5
5
|
exports.isStrategyType = isStrategyType;
|
|
6
6
|
exports.getConnectOptionsFromStrategy = getConnectOptionsFromStrategy;
|
|
7
7
|
const wallets_1 = require("thirdweb/wallets");
|
|
8
|
-
const customStrategies = ["basement"
|
|
9
|
-
// type CustomStrategy = (typeof customStrategies)[number];
|
|
8
|
+
const customStrategies = ["basement"];
|
|
10
9
|
exports.allowedStrategies = [
|
|
11
10
|
// Auth strategies
|
|
12
11
|
"apple",
|
|
@@ -21,7 +20,6 @@ exports.allowedStrategies = [
|
|
|
21
20
|
"io.metamask",
|
|
22
21
|
"com.coinbase.wallet",
|
|
23
22
|
// Custom strategies
|
|
24
|
-
// TODO: Audit we don't use "privy" directly anymore
|
|
25
23
|
...customStrategies,
|
|
26
24
|
];
|
|
27
25
|
function isWalletType(strategy) {
|
|
@@ -5,7 +5,6 @@ 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 { useBetterAuthClient } from "./B3Provider/BetterAuthClientProvider";
|
|
9
8
|
export { StyleRoot } from "./StyleRoot";
|
|
10
9
|
export { BetterAuthResetPassword, type BetterAuthResetPasswordProps } from "./SignInWithB3/BetterAuthResetPassword";
|
|
11
10
|
export { BetterAuthSignIn, type BetterAuthSignInProps } from "./SignInWithB3/BetterAuthSignIn";
|
|
@@ -15,7 +14,6 @@ export { PermissionItem } from "./SignInWithB3/components/PermissionItem";
|
|
|
15
14
|
export { WalletRow } from "./SignInWithB3/components/WalletRow";
|
|
16
15
|
export { SignInWithB3 } from "./SignInWithB3/SignInWithB3";
|
|
17
16
|
export { SignInWithB3Flow } from "./SignInWithB3/SignInWithB3Flow";
|
|
18
|
-
export { SignInWithB3Privy } from "./SignInWithB3/SignInWithB3Privy";
|
|
19
17
|
export { LoginStepContainer } from "./SignInWithB3/steps/LoginStep";
|
|
20
18
|
export { getConnectOptionsFromStrategy, isWalletType, type AllowedStrategy } from "./SignInWithB3/utils/signInUtils";
|
|
21
19
|
export { ManageAccount } from "./ManageAccount/ManageAccount";
|
|
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CommandSeparator = exports.CommandList = exports.CommandItem = exports.CommandInput = exports.CommandGroup = exports.CommandEmpty = exports.CommandDialog = exports.Command = exports.buttonVariants = exports.Button = exports.badgeVariants = exports.Badge = exports.WalletConnectorIcon = exports.StaggeredFadeLoader = exports.CopyToClipboard = exports.ClientOnly = exports.customButtonVariants = exports.CustomButton = exports.SingleUserSearchSelector = exports.SendERC20Button = exports.SendETHButton = exports.MintButton = exports.AccountAssets = exports.RequestPermissionsButton = exports.RequestPermissions = exports.IPFSMediaRenderer = exports.Send = exports.Deposit = exports.UserAvatar = exports.ManageAccount = exports.isWalletType = exports.getConnectOptionsFromStrategy = exports.LoginStepContainer = exports.
|
|
7
|
-
exports.TooltipContent = exports.Tooltip = exports.TextShimmer = exports.TextLoop = exports.TabTrigger = exports.TabsTransitionWrapper = exports.TabsList = exports.TabsContent = exports.Tabs = exports.TabTriggerPrimitive = exports.TabsPrimitive = exports.TabsListPrimitive = exports.TabsContentPrimitive = exports.Skeleton = exports.ShinyButton = exports.ScrollBar = exports.ScrollArea = exports.PopoverTrigger = exports.PopoverContent = exports.Popover = exports.Loading = exports.Input = exports.GlareCardRounded = exports.GlareCard = exports.DropdownMenuTrigger = exports.DropdownMenuSeparator = exports.DropdownMenuItem = exports.DropdownMenuContent = exports.DropdownMenu = exports.DrawerTrigger = exports.DrawerTitle = exports.DrawerPortal = exports.DrawerOverlay = exports.DrawerHeader = exports.DrawerFooter = exports.DrawerDescription = exports.DrawerContent = exports.DrawerClose = exports.Drawer = exports.DialogTrigger = exports.DialogTitle = exports.DialogPortal = exports.DialogOverlay = exports.DialogHeader = exports.DialogFooter = exports.DialogDescription = exports.DialogContent = exports.DialogClose =
|
|
8
|
-
exports.WalletImage = exports.useToastContext = exports.ToastProvider = exports.ToastContainer = exports.Toast = exports.toast = exports.AnimatedLottie = exports.TransitionPanel =
|
|
6
|
+
exports.Dialog = exports.CommandShortcut = exports.CommandSeparator = exports.CommandList = exports.CommandItem = exports.CommandInput = exports.CommandGroup = exports.CommandEmpty = exports.CommandDialog = exports.Command = exports.buttonVariants = exports.Button = exports.badgeVariants = exports.Badge = exports.WalletConnectorIcon = exports.StaggeredFadeLoader = exports.CopyToClipboard = exports.ClientOnly = exports.customButtonVariants = exports.CustomButton = exports.SingleUserSearchSelector = exports.SendERC20Button = exports.SendETHButton = exports.MintButton = exports.AccountAssets = exports.RequestPermissionsButton = exports.RequestPermissions = exports.IPFSMediaRenderer = exports.Send = exports.Deposit = exports.UserAvatar = exports.ManageAccount = exports.isWalletType = exports.getConnectOptionsFromStrategy = exports.LoginStepContainer = exports.SignInWithB3Flow = exports.SignInWithB3 = exports.WalletRow = exports.PermissionItem = exports.AuthButton = exports.BetterAuthVerifyEmail = exports.BetterAuthSignIn = exports.BetterAuthResetPassword = exports.StyleRoot = exports.useB3Config = exports.useB3Account = exports.useB3 = exports.RelayKitProviderWrapper = exports.B3Provider = exports.B3DynamicModal = void 0;
|
|
7
|
+
exports.TooltipTrigger = exports.TooltipProvider = exports.TooltipContent = exports.Tooltip = exports.TextShimmer = exports.TextLoop = exports.TabTrigger = exports.TabsTransitionWrapper = exports.TabsList = exports.TabsContent = exports.Tabs = exports.TabTriggerPrimitive = exports.TabsPrimitive = exports.TabsListPrimitive = exports.TabsContentPrimitive = exports.Skeleton = exports.ShinyButton = exports.ScrollBar = exports.ScrollArea = exports.PopoverTrigger = exports.PopoverContent = exports.Popover = exports.Loading = exports.Input = exports.GlareCardRounded = exports.GlareCard = exports.DropdownMenuTrigger = exports.DropdownMenuSeparator = exports.DropdownMenuItem = exports.DropdownMenuContent = exports.DropdownMenu = exports.DrawerTrigger = exports.DrawerTitle = exports.DrawerPortal = exports.DrawerOverlay = exports.DrawerHeader = exports.DrawerFooter = exports.DrawerDescription = exports.DrawerContent = exports.DrawerClose = exports.Drawer = exports.DialogTrigger = exports.DialogTitle = exports.DialogPortal = exports.DialogOverlay = exports.DialogHeader = exports.DialogFooter = exports.DialogDescription = exports.DialogContent = exports.DialogClose = void 0;
|
|
8
|
+
exports.WalletImage = exports.useToastContext = exports.ToastProvider = exports.ToastContainer = exports.Toast = exports.toast = exports.AnimatedLottie = exports.TransitionPanel = void 0;
|
|
9
9
|
// TODO woj: Barrel file for all components, this might be reason of bundle size issues
|
|
10
10
|
// Core Components
|
|
11
11
|
var B3DynamicModal_1 = require("./B3DynamicModal");
|
|
@@ -20,8 +20,6 @@ var useB3Account_1 = require("./B3Provider/useB3Account");
|
|
|
20
20
|
Object.defineProperty(exports, "useB3Account", { enumerable: true, get: function () { return useB3Account_1.useB3Account; } });
|
|
21
21
|
var useB3Config_1 = require("./B3Provider/useB3Config");
|
|
22
22
|
Object.defineProperty(exports, "useB3Config", { enumerable: true, get: function () { return useB3Config_1.useB3Config; } });
|
|
23
|
-
var BetterAuthClientProvider_1 = require("./B3Provider/BetterAuthClientProvider");
|
|
24
|
-
Object.defineProperty(exports, "useBetterAuthClient", { enumerable: true, get: function () { return BetterAuthClientProvider_1.useBetterAuthClient; } });
|
|
25
23
|
var StyleRoot_1 = require("./StyleRoot");
|
|
26
24
|
Object.defineProperty(exports, "StyleRoot", { enumerable: true, get: function () { return StyleRoot_1.StyleRoot; } });
|
|
27
25
|
// SignInWithB3 Components
|
|
@@ -41,8 +39,6 @@ var SignInWithB3_1 = require("./SignInWithB3/SignInWithB3");
|
|
|
41
39
|
Object.defineProperty(exports, "SignInWithB3", { enumerable: true, get: function () { return SignInWithB3_1.SignInWithB3; } });
|
|
42
40
|
var SignInWithB3Flow_1 = require("./SignInWithB3/SignInWithB3Flow");
|
|
43
41
|
Object.defineProperty(exports, "SignInWithB3Flow", { enumerable: true, get: function () { return SignInWithB3Flow_1.SignInWithB3Flow; } });
|
|
44
|
-
var SignInWithB3Privy_1 = require("./SignInWithB3/SignInWithB3Privy");
|
|
45
|
-
Object.defineProperty(exports, "SignInWithB3Privy", { enumerable: true, get: function () { return SignInWithB3Privy_1.SignInWithB3Privy; } });
|
|
46
42
|
var LoginStep_1 = require("./SignInWithB3/steps/LoginStep");
|
|
47
43
|
Object.defineProperty(exports, "LoginStepContainer", { enumerable: true, get: function () { return LoginStep_1.LoginStepContainer; } });
|
|
48
44
|
var signInUtils_1 = require("./SignInWithB3/utils/signInUtils");
|
|
@@ -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";
|
|
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.useTokensFromAddress = exports.useTokenPriceWithFallback = exports.useTokenPrice = exports.useTokenFromUrl = exports.useTokenData = exports.useTokenBalancesByChain = exports.useTokenBalanceDirect = exports.useTokenBalance = exports.useSiwe = exports.useSimCollectibles = exports.useSimTokenBalance = exports.useSimSvmBalance = exports.useSimBalance = exports.useSearchParamsSSR = exports.useRouter = exports.useRemoveSessionKey = exports.useQueryBSMNT = exports.useQueryB3 = exports.useProfileSettings = exports.useProfilePreference = exports.useProfile = exports.useDisplayName = exports.useOneBalance = exports.useNotifications = exports.useNativeBalanceFromRPC = exports.useNativeBalance = exports.useMediaQuery = exports.useIsomorphicLayoutEffect = exports.useIsMobile = exports.useHasMounted = exports.
|
|
18
|
-
exports.useUser = exports.useURLParams =
|
|
17
|
+
exports.useUnifiedChainSwitchAndExecute = exports.useTokensFromAddress = exports.useTokenPriceWithFallback = exports.useTokenPrice = exports.useTokenFromUrl = exports.useTokenData = exports.useTokenBalancesByChain = exports.useTokenBalanceDirect = exports.useTokenBalance = exports.useSiwe = exports.useSimCollectibles = exports.useSimTokenBalance = exports.useSimSvmBalance = exports.useSimBalance = exports.useSearchParamsSSR = exports.useRouter = exports.useRemoveSessionKey = exports.useQueryBSMNT = exports.useQueryB3 = exports.useProfileSettings = exports.useProfilePreference = exports.useProfile = exports.useDisplayName = exports.useOneBalance = exports.useNotifications = exports.useNativeBalanceFromRPC = exports.useNativeBalance = exports.useMediaQuery = exports.useIsomorphicLayoutEffect = exports.useIsMobile = exports.useHasMounted = exports.useGlobalAccount = exports.useGetGeo = exports.useGetAllTWSigners = exports.useFirstEOA = exports.useExchangeRate = exports.useConnect = exports.useClient = exports.useChainSwitchWithAction = exports.useB3EnsName = exports.useB3BalanceFromAddresses = exports.EmailVerificationRequiredError = exports.useBetterAuth = exports.useAuthentication = exports.useAuth = exports.useAnalytics = exports.useAddTWSessionKey = exports.useAccountWallet = exports.useAccountAssets = exports.createWagmiConfig = void 0;
|
|
18
|
+
exports.useUser = exports.useURLParams = void 0;
|
|
19
19
|
var createWagmiConfig_1 = require("../utils/createWagmiConfig");
|
|
20
20
|
Object.defineProperty(exports, "createWagmiConfig", { enumerable: true, get: function () { return createWagmiConfig_1.createWagmiConfig; } });
|
|
21
21
|
var useAccountAssets_1 = require("./useAccountAssets");
|
|
@@ -54,8 +54,6 @@ var useGetGeo_1 = require("./useGetGeo");
|
|
|
54
54
|
Object.defineProperty(exports, "useGetGeo", { enumerable: true, get: function () { return useGetGeo_1.useGetGeo; } });
|
|
55
55
|
var useGlobalAccount_1 = require("./useGlobalAccount");
|
|
56
56
|
Object.defineProperty(exports, "useGlobalAccount", { enumerable: true, get: function () { return useGlobalAccount_1.useGlobalAccount; } });
|
|
57
|
-
var useHandleConnectWithPrivy_1 = require("./useHandleConnectWithPrivy");
|
|
58
|
-
Object.defineProperty(exports, "useHandleConnectWithPrivy", { enumerable: true, get: function () { return useHandleConnectWithPrivy_1.useHandleConnectWithPrivy; } });
|
|
59
57
|
var useHasMounted_1 = require("./useHasMounted");
|
|
60
58
|
Object.defineProperty(exports, "useHasMounted", { enumerable: true, get: function () { return useHasMounted_1.useHasMounted; } });
|
|
61
59
|
var useIsMobile_1 = require("./useIsMobile");
|
|
@@ -6,8 +6,8 @@ import { preAuthenticate } from "thirdweb/wallets/in-app";
|
|
|
6
6
|
* This hook provides 1:1 feature parity with useAuthentication.ts
|
|
7
7
|
*/
|
|
8
8
|
export declare function useAuth(): {
|
|
9
|
-
authenticate: (accessToken: string, partnerId: string, strategy?: string) => Promise<
|
|
10
|
-
reAuthenticate: () => Promise<
|
|
9
|
+
authenticate: (accessToken: string, partnerId: string, strategy?: string) => Promise<Record<string, any>>;
|
|
10
|
+
reAuthenticate: () => Promise<Record<string, any>>;
|
|
11
11
|
logout: (callback?: () => void) => Promise<void>;
|
|
12
12
|
isAuthenticated: boolean;
|
|
13
13
|
isReady: boolean;
|
|
@@ -70,6 +70,6 @@ export declare function useAuth(): {
|
|
|
70
70
|
turnkeyOtpId?: string | undefined;
|
|
71
71
|
};
|
|
72
72
|
} | undefined;
|
|
73
|
-
refetchUser: () => Promise<
|
|
73
|
+
refetchUser: () => Promise<Record<string, any>>;
|
|
74
74
|
setUser: (newUser?: import("@b3dotfun/b3-api").Users) => void;
|
|
75
75
|
};
|
|
@@ -65,6 +65,6 @@ export declare function useAuthentication(partnerId: string, { skipAutoConnect }
|
|
|
65
65
|
turnkeyOtpId?: string | undefined;
|
|
66
66
|
};
|
|
67
67
|
} | undefined;
|
|
68
|
-
refetchUser: (wallet?: Wallet) => Promise<
|
|
68
|
+
refetchUser: (wallet?: Wallet) => Promise<Record<string, any>>;
|
|
69
69
|
setUser: (newUser?: import("@b3dotfun/b3-api").Users) => void;
|
|
70
70
|
};
|