@b3dotfun/sdk 0.1.70-alpha.1 → 0.1.70-alpha.10
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
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext, useMemo } from "react";
|
|
3
|
-
import { betterAuthClient, createB3BetterAuthClient, } from "../../../better-auth-client.js";
|
|
4
|
-
const BetterAuthClientContext = createContext(betterAuthClient);
|
|
5
|
-
/**
|
|
6
|
-
* Provides a Better Auth client instance to the subtree.
|
|
7
|
-
*
|
|
8
|
-
* When `apiUrl` is supplied, a custom client targeting that URL is created
|
|
9
|
-
* (e.g. `http://localhost:3031` for local development). Otherwise, the
|
|
10
|
-
* default singleton (which uses `B3_API_URL` / `NEXT_PUBLIC_B3_API`) is used.
|
|
11
|
-
*/
|
|
12
|
-
export function BetterAuthClientProvider({ children, apiUrl, }) {
|
|
13
|
-
const client = useMemo(() => {
|
|
14
|
-
if (apiUrl) {
|
|
15
|
-
return createB3BetterAuthClient(apiUrl);
|
|
16
|
-
}
|
|
17
|
-
return betterAuthClient;
|
|
18
|
-
}, [apiUrl]);
|
|
19
|
-
return _jsx(BetterAuthClientContext.Provider, { value: client, children: children });
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Returns the Better Auth client from the nearest `BetterAuthClientProvider`.
|
|
23
|
-
* Falls back to the default singleton if no provider is present.
|
|
24
|
-
*/
|
|
25
|
-
export function useBetterAuthClient() {
|
|
26
|
-
return useContext(BetterAuthClientContext);
|
|
27
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Chain } from "thirdweb";
|
|
2
|
-
import { Account } from "thirdweb/wallets";
|
|
3
|
-
interface SignInWithB3PrivyProps {
|
|
4
|
-
onError?: (error: Error) => Promise<void>;
|
|
5
|
-
onSuccess: (account: Account) => Promise<void>;
|
|
6
|
-
accessToken?: string;
|
|
7
|
-
chain: Chain;
|
|
8
|
-
}
|
|
9
|
-
export declare function SignInWithB3Privy({ onSuccess, onError, chain }: SignInWithB3PrivyProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Loading, useAuthentication, useAuthStore, useB3Config, useHandleConnectWithPrivy, } from "../../../../global-account/react/index.js";
|
|
3
|
-
import { debugB3React } from "../../../../shared/utils/debug.js";
|
|
4
|
-
import { useEffect } from "react";
|
|
5
|
-
const debug = debugB3React("SignInWithB3Privy");
|
|
6
|
-
export function SignInWithB3Privy({ onSuccess, onError, chain }) {
|
|
7
|
-
const { partnerId } = useB3Config();
|
|
8
|
-
const { isLoading, connectTw, fullToken } = useHandleConnectWithPrivy(chain, onSuccess);
|
|
9
|
-
const setIsAuthenticating = useAuthStore(state => state.setIsAuthenticating);
|
|
10
|
-
const setIsAuthenticated = useAuthStore(state => state.setIsAuthenticated);
|
|
11
|
-
const { logout } = useAuthentication(partnerId, { skipAutoConnect: true });
|
|
12
|
-
debug("@@SignInWithB3Privy", {
|
|
13
|
-
isLoading,
|
|
14
|
-
fullToken,
|
|
15
|
-
});
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
async function autoConnect() {
|
|
18
|
-
try {
|
|
19
|
-
const connectResult = await connectTw();
|
|
20
|
-
const account = connectResult?.getAccount();
|
|
21
|
-
if (!account) {
|
|
22
|
-
setIsAuthenticated(false);
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
await onSuccess(account);
|
|
26
|
-
setIsAuthenticated(true);
|
|
27
|
-
}
|
|
28
|
-
catch (error) {
|
|
29
|
-
console.error("Failed to connect:", error);
|
|
30
|
-
await onError?.(error);
|
|
31
|
-
await logout();
|
|
32
|
-
setIsAuthenticated(false);
|
|
33
|
-
}
|
|
34
|
-
finally {
|
|
35
|
-
debug("setIsAuthenticating:false:7");
|
|
36
|
-
setIsAuthenticating(false);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
autoConnect();
|
|
40
|
-
}, [connectTw, onSuccess, onError, setIsAuthenticated, logout, setIsAuthenticating]);
|
|
41
|
-
// Currently we auto login, so we can show loading immediately and the onSuccess will proceed to the next modal
|
|
42
|
-
return (_jsx("div", { className: "flex aspect-square items-center justify-center p-6", children: _jsx(Loading, { variant: "white", size: "lg" }) }));
|
|
43
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Chain } from "thirdweb";
|
|
2
|
-
import { Account } from "thirdweb/wallets";
|
|
3
|
-
/**
|
|
4
|
-
* This essentially wraps our useConnect hook to handle the Privy auth flow.
|
|
5
|
-
* Currently, this is for the basement-privy strategy
|
|
6
|
-
*/
|
|
7
|
-
export declare function useHandleConnectWithPrivy(chain?: Chain, onSuccess?: (account: Account) => void): {
|
|
8
|
-
connectTw: () => Promise<import("thirdweb/wallets").Wallet | null | undefined>;
|
|
9
|
-
isLoading: boolean;
|
|
10
|
-
fullToken: string | null;
|
|
11
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { useB3Config, useConnect } from "../../../global-account/react/index.js";
|
|
2
|
-
import { debugB3React } from "../../../shared/utils/debug.js";
|
|
3
|
-
import { useIdentityToken, usePrivy } from "@privy-io/react-auth";
|
|
4
|
-
import { useCallback, useRef, useState } from "react";
|
|
5
|
-
const debug = debugB3React("@@b3:useHandleConnectWithPrivy");
|
|
6
|
-
/**
|
|
7
|
-
* This essentially wraps our useConnect hook to handle the Privy auth flow.
|
|
8
|
-
* Currently, this is for the basement-privy strategy
|
|
9
|
-
*/
|
|
10
|
-
export function useHandleConnectWithPrivy(chain, onSuccess) {
|
|
11
|
-
const { partnerId } = useB3Config();
|
|
12
|
-
if (!chain) {
|
|
13
|
-
throw new Error("Chain is required");
|
|
14
|
-
}
|
|
15
|
-
const { connect } = useConnect(partnerId, chain);
|
|
16
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
17
|
-
const isConnecting = useRef(false);
|
|
18
|
-
const { identityToken } = useIdentityToken();
|
|
19
|
-
const { getAccessToken } = usePrivy();
|
|
20
|
-
const [fullToken, setFullToken] = useState(null);
|
|
21
|
-
const connectTw = useCallback(async () => {
|
|
22
|
-
if (isConnecting.current) {
|
|
23
|
-
debug("@@connectTw:skipping:isConnecting", isConnecting.current);
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
setIsLoading(true);
|
|
27
|
-
isConnecting.current = true;
|
|
28
|
-
// Form token
|
|
29
|
-
const accessToken = await getAccessToken();
|
|
30
|
-
const fullToken = `${accessToken}+${identityToken}`;
|
|
31
|
-
setFullToken(fullToken);
|
|
32
|
-
debug("@@connectTw:fullToken", fullToken);
|
|
33
|
-
if (!fullToken)
|
|
34
|
-
throw new Error("Token is not set");
|
|
35
|
-
// Connect to TW via privy
|
|
36
|
-
const wallet = await connect({
|
|
37
|
-
strategy: "auth_endpoint",
|
|
38
|
-
payload: JSON.stringify({
|
|
39
|
-
strategy: "basement",
|
|
40
|
-
accessToken: fullToken,
|
|
41
|
-
}),
|
|
42
|
-
});
|
|
43
|
-
debug("@@useHandleConnectWithPrivy:connect:return", wallet);
|
|
44
|
-
setIsLoading(false);
|
|
45
|
-
// Handle onsuccess & more
|
|
46
|
-
try {
|
|
47
|
-
debug("@@autoLogin:starting", fullToken);
|
|
48
|
-
const account = wallet?.getAccount();
|
|
49
|
-
if (!account) {
|
|
50
|
-
throw new Error("Failed to connect");
|
|
51
|
-
}
|
|
52
|
-
onSuccess?.(account);
|
|
53
|
-
if (!account) {
|
|
54
|
-
throw new Error("Failed to connect");
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
catch (error) {
|
|
58
|
-
console.error("@@Error signing in with Privy", error);
|
|
59
|
-
}
|
|
60
|
-
finally {
|
|
61
|
-
isConnecting.current = false;
|
|
62
|
-
setIsLoading(false);
|
|
63
|
-
}
|
|
64
|
-
return wallet;
|
|
65
|
-
}, [connect, getAccessToken, identityToken, onSuccess]);
|
|
66
|
-
return { connectTw, isLoading, fullToken };
|
|
67
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Static } from "@feathersjs/typebox";
|
|
2
|
-
export declare const chainNetworksSchema: import("@feathersjs/typebox").TObject<{
|
|
3
|
-
_id: import("@feathersjs/typebox").TUnion<[import("@feathersjs/typebox").TString<string>, import("@feathersjs/typebox").TObject<{}>]>;
|
|
4
|
-
id: import("@feathersjs/typebox").TInteger;
|
|
5
|
-
name: import("@feathersjs/typebox").TString<string>;
|
|
6
|
-
rpcUrls: import("@feathersjs/typebox").TObject<{
|
|
7
|
-
default: import("@feathersjs/typebox").TObject<{
|
|
8
|
-
http: import("@feathersjs/typebox").TString<"uri">;
|
|
9
|
-
ws: import("@feathersjs/typebox").TString<"uri">;
|
|
10
|
-
}>;
|
|
11
|
-
backups: import("@feathersjs/typebox").TArray<import("@feathersjs/typebox").TObject<{
|
|
12
|
-
type: import("@feathersjs/typebox").TUnion<[import("@feathersjs/typebox").TLiteral<"http">, import("@feathersjs/typebox").TLiteral<"ws">]>;
|
|
13
|
-
uri: import("@feathersjs/typebox").TString<string>;
|
|
14
|
-
}>>;
|
|
15
|
-
}>;
|
|
16
|
-
icon: import("@feathersjs/typebox").TObject<{
|
|
17
|
-
url: import("@feathersjs/typebox").TString<"uri">;
|
|
18
|
-
width: import("@feathersjs/typebox").TInteger;
|
|
19
|
-
height: import("@feathersjs/typebox").TInteger;
|
|
20
|
-
format: import("@feathersjs/typebox").TString<string>;
|
|
21
|
-
}>;
|
|
22
|
-
blockExplorers: import("@feathersjs/typebox").TObject<{
|
|
23
|
-
explorerTitle: import("@feathersjs/typebox").TString<string>;
|
|
24
|
-
default: import("@feathersjs/typebox").TString<"uri">;
|
|
25
|
-
}>;
|
|
26
|
-
nativeCurrency: import("@feathersjs/typebox").TObject<{
|
|
27
|
-
name: import("@feathersjs/typebox").TString<string>;
|
|
28
|
-
symbol: import("@feathersjs/typebox").TString<string>;
|
|
29
|
-
decimals: import("@feathersjs/typebox").TInteger;
|
|
30
|
-
}>;
|
|
31
|
-
testnet: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TBoolean>;
|
|
32
|
-
testnetConfigID: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TInteger>;
|
|
33
|
-
sourceId: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TInteger>;
|
|
34
|
-
contracts: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TRecord<import("@feathersjs/typebox").TString<string>, import("@feathersjs/typebox").TObject<{
|
|
35
|
-
address: import("@feathersjs/typebox").TString<string>;
|
|
36
|
-
blockCreated: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TInteger>;
|
|
37
|
-
}>>>;
|
|
38
|
-
formatters: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TRecord<import("@feathersjs/typebox").TString<string>, import("@feathersjs/typebox").TAny>>;
|
|
39
|
-
fees: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TRecord<import("@feathersjs/typebox").TString<string>, import("@feathersjs/typebox").TAny>>;
|
|
40
|
-
badge: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TString<"uri">>;
|
|
41
|
-
color: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TString<string>>;
|
|
42
|
-
enabledFeatures: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TArray<import("@feathersjs/typebox").TString<string>>>;
|
|
43
|
-
}>;
|
|
44
|
-
export type ChainNetworks = Static<typeof chainNetworksSchema>;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { ObjectIdSchema, Type } from "@feathersjs/typebox";
|
|
2
|
-
const ChainContractSchema = Type.Object({
|
|
3
|
-
address: Type.String(),
|
|
4
|
-
blockCreated: Type.Optional(Type.Integer()),
|
|
5
|
-
});
|
|
6
|
-
export const chainNetworksSchema = Type.Object({
|
|
7
|
-
_id: ObjectIdSchema(),
|
|
8
|
-
id: Type.Integer(),
|
|
9
|
-
name: Type.String(),
|
|
10
|
-
rpcUrls: Type.Object({
|
|
11
|
-
default: Type.Object({
|
|
12
|
-
http: Type.String({ format: "uri" }),
|
|
13
|
-
ws: Type.String({ format: "uri" }),
|
|
14
|
-
}),
|
|
15
|
-
backups: Type.Array(Type.Object({
|
|
16
|
-
type: Type.Union([Type.Literal("http"), Type.Literal("ws")]),
|
|
17
|
-
uri: Type.String(),
|
|
18
|
-
})),
|
|
19
|
-
}),
|
|
20
|
-
icon: Type.Object({
|
|
21
|
-
url: Type.String({ format: "uri" }),
|
|
22
|
-
width: Type.Integer(),
|
|
23
|
-
height: Type.Integer(),
|
|
24
|
-
format: Type.String(),
|
|
25
|
-
}),
|
|
26
|
-
blockExplorers: Type.Object({
|
|
27
|
-
explorerTitle: Type.String(),
|
|
28
|
-
default: Type.String({ format: "uri" }),
|
|
29
|
-
}),
|
|
30
|
-
nativeCurrency: Type.Object({
|
|
31
|
-
name: Type.String(),
|
|
32
|
-
symbol: Type.String(),
|
|
33
|
-
decimals: Type.Integer(),
|
|
34
|
-
}),
|
|
35
|
-
testnet: Type.Optional(Type.Boolean()),
|
|
36
|
-
testnetConfigID: Type.Optional(Type.Integer()),
|
|
37
|
-
// Additional required Viem fields that can't be derived
|
|
38
|
-
sourceId: Type.Optional(Type.Integer()),
|
|
39
|
-
contracts: Type.Optional(Type.Record(Type.String(), ChainContractSchema)),
|
|
40
|
-
formatters: Type.Optional(Type.Record(Type.String(), Type.Any())),
|
|
41
|
-
fees: Type.Optional(Type.Record(Type.String(), Type.Any())),
|
|
42
|
-
badge: Type.Optional(Type.String({ format: "uri" })),
|
|
43
|
-
color: Type.Optional(Type.String()),
|
|
44
|
-
enabledFeatures: Type.Optional(Type.Array(Type.String())),
|
|
45
|
-
}, { $id: "ChainNetworks", additionalProperties: false });
|