@b3dotfun/sdk 0.0.88-alpha.10 → 0.0.88-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/anyspend/constants/index.d.ts +0 -2
- package/dist/cjs/anyspend/constants/index.js +1 -3
- package/dist/cjs/anyspend/index.d.ts +0 -2
- package/dist/cjs/anyspend/index.js +0 -3
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +0 -6
- package/dist/cjs/anyspend/react/components/AnySpend.js +6 -9
- package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +1 -5
- package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +0 -1
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +3 -3
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +0 -6
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +20 -24
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +1 -7
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +3 -3
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +0 -4
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +1 -14
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.d.ts +1 -3
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +2 -3
- package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +0 -4
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +6 -34
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +1 -3
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +2 -3
- package/dist/cjs/anyspend/react/components/common/PaymentStripeWeb2.js +4 -3
- package/dist/cjs/anyspend/react/hooks/index.d.ts +0 -1
- package/dist/cjs/anyspend/react/hooks/index.js +0 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +1 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.js +1 -1
- package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.js +1 -1
- package/dist/cjs/anyspend/react/hooks/useValidatedClientReferenceId.js +1 -1
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +3 -2
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +18 -2
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +57 -35
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +35 -38
- package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +1 -3
- package/dist/cjs/global-account/react/components/B3Provider/types.d.ts +27 -0
- package/dist/cjs/global-account/react/components/B3Provider/types.js +24 -0
- package/dist/cjs/global-account/react/components/B3Provider/useB3.d.ts +4 -14
- package/dist/cjs/global-account/react/components/B3Provider/useB3.js +11 -4
- package/dist/cjs/global-account/react/components/B3Provider/useB3Account.js +2 -5
- package/dist/cjs/global-account/react/components/B3Provider/useB3Config.d.ts +2 -10
- package/dist/cjs/global-account/react/components/B3Provider/useB3Config.js +17 -18
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +2 -1
- package/dist/cjs/global-account/react/components/ManageAccount/channels/DiscordChannel.js +6 -6
- package/dist/cjs/global-account/react/components/ManageAccount/channels/EmailChannel.js +7 -7
- package/dist/cjs/global-account/react/components/ManageAccount/channels/PhoneChannel.js +7 -7
- package/dist/cjs/global-account/react/components/ManageAccount/channels/TelegramChannel.js +5 -5
- package/dist/cjs/global-account/react/components/RequestPermissions/RequestPermissions.js +9 -8
- package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +20 -76
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStep.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +1 -1
- package/dist/cjs/global-account/react/components/StyleRoot.js +3 -3
- package/dist/cjs/global-account/react/components/TurnkeyAuthModal.js +1 -3
- package/dist/cjs/global-account/react/components/custom/ManageAccountButton.js +2 -1
- package/dist/cjs/global-account/react/components/index.d.ts +2 -1
- package/dist/cjs/global-account/react/components/index.js +6 -3
- package/dist/cjs/global-account/react/hooks/index.d.ts +0 -2
- package/dist/cjs/global-account/react/hooks/index.js +1 -5
- package/dist/cjs/global-account/react/hooks/useClient.js +1 -1
- package/dist/cjs/global-account/react/hooks/useHandleConnectWithPrivy.js +1 -1
- package/dist/cjs/global-account/react/hooks/useNotifications.js +14 -14
- package/dist/cjs/global-account/react/hooks/useTWAuth.d.ts +0 -3
- package/dist/cjs/global-account/react/hooks/useTWAuth.js +0 -8
- package/dist/cjs/global-account/react/hooks/useTokenBalance.js +5 -5
- package/dist/cjs/global-account/react/hooks/useTokenBalancesByChain.js +2 -4
- package/dist/cjs/global-account/react/hooks/useTurnkeyAuth.js +22 -50
- package/dist/cjs/global-account/react/hooks/useUserQuery.js +35 -9
- package/dist/cjs/global-account/react/index.native.d.ts +2 -0
- package/dist/cjs/global-account/react/index.native.js +5 -1
- package/dist/cjs/global-account/react/stores/index.d.ts +0 -1
- package/dist/cjs/global-account/react/stores/index.js +1 -3
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +0 -10
- package/dist/esm/anyspend/constants/index.d.ts +0 -2
- package/dist/esm/anyspend/constants/index.js +0 -2
- package/dist/esm/anyspend/index.d.ts +0 -2
- package/dist/esm/anyspend/index.js +0 -3
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +0 -6
- package/dist/esm/anyspend/react/components/AnySpend.js +8 -11
- package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +1 -5
- package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +0 -1
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +3 -3
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +0 -6
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +4 -8
- package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +1 -7
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +3 -3
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +0 -4
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +1 -14
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +1 -3
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +2 -3
- package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +0 -4
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +8 -36
- package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +1 -3
- package/dist/esm/anyspend/react/components/common/PanelOnramp.js +2 -3
- package/dist/esm/anyspend/react/components/common/PaymentStripeWeb2.js +4 -3
- package/dist/esm/anyspend/react/hooks/index.d.ts +0 -1
- package/dist/esm/anyspend/react/hooks/index.js +0 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +2 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.js +2 -2
- package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.js +2 -2
- package/dist/esm/anyspend/react/hooks/useValidatedClientReferenceId.js +2 -2
- package/dist/esm/global-account/react/components/B3DynamicModal.js +4 -3
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +18 -2
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +58 -34
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +36 -36
- package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +1 -3
- package/dist/esm/global-account/react/components/B3Provider/types.d.ts +27 -0
- package/dist/esm/global-account/react/components/B3Provider/types.js +21 -0
- package/dist/esm/global-account/react/components/B3Provider/useB3.d.ts +4 -14
- package/dist/esm/global-account/react/components/B3Provider/useB3.js +11 -4
- package/dist/esm/global-account/react/components/B3Provider/useB3Account.js +2 -5
- package/dist/esm/global-account/react/components/B3Provider/useB3Config.d.ts +2 -10
- package/dist/esm/global-account/react/components/B3Provider/useB3Config.js +17 -18
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +3 -2
- package/dist/esm/global-account/react/components/ManageAccount/channels/DiscordChannel.js +2 -2
- package/dist/esm/global-account/react/components/ManageAccount/channels/EmailChannel.js +2 -2
- package/dist/esm/global-account/react/components/ManageAccount/channels/PhoneChannel.js +2 -2
- package/dist/esm/global-account/react/components/ManageAccount/channels/TelegramChannel.js +2 -2
- package/dist/esm/global-account/react/components/RequestPermissions/RequestPermissions.js +3 -2
- package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +20 -76
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStep.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +2 -2
- package/dist/esm/global-account/react/components/StyleRoot.js +3 -3
- package/dist/esm/global-account/react/components/TurnkeyAuthModal.js +3 -5
- package/dist/esm/global-account/react/components/custom/ManageAccountButton.js +3 -2
- package/dist/esm/global-account/react/components/index.d.ts +2 -1
- package/dist/esm/global-account/react/components/index.js +2 -1
- package/dist/esm/global-account/react/hooks/index.d.ts +0 -2
- package/dist/esm/global-account/react/hooks/index.js +0 -2
- package/dist/esm/global-account/react/hooks/useClient.js +2 -2
- package/dist/esm/global-account/react/hooks/useHandleConnectWithPrivy.js +2 -2
- package/dist/esm/global-account/react/hooks/useNotifications.js +2 -2
- package/dist/esm/global-account/react/hooks/useTWAuth.d.ts +0 -3
- package/dist/esm/global-account/react/hooks/useTWAuth.js +0 -8
- package/dist/esm/global-account/react/hooks/useTokenBalance.js +6 -6
- package/dist/esm/global-account/react/hooks/useTokenBalancesByChain.js +2 -4
- package/dist/esm/global-account/react/hooks/useTurnkeyAuth.js +22 -50
- package/dist/esm/global-account/react/hooks/useUserQuery.js +27 -1
- package/dist/esm/global-account/react/index.native.d.ts +2 -0
- package/dist/esm/global-account/react/index.native.js +2 -0
- package/dist/esm/global-account/react/stores/index.d.ts +0 -1
- package/dist/esm/global-account/react/stores/index.js +0 -1
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +0 -10
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/constants/index.d.ts +0 -2
- package/dist/types/anyspend/index.d.ts +0 -2
- package/dist/types/anyspend/react/components/AnySpend.d.ts +0 -6
- package/dist/types/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +1 -5
- package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +0 -1
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +0 -6
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +1 -7
- package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +0 -4
- package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +1 -3
- package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +0 -4
- package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +1 -3
- package/dist/types/anyspend/react/hooks/index.d.ts +0 -1
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +18 -2
- package/dist/types/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
- package/dist/types/global-account/react/components/B3Provider/types.d.ts +27 -0
- package/dist/types/global-account/react/components/B3Provider/useB3.d.ts +4 -14
- package/dist/types/global-account/react/components/B3Provider/useB3Config.d.ts +2 -10
- package/dist/types/global-account/react/components/index.d.ts +2 -1
- package/dist/types/global-account/react/hooks/index.d.ts +0 -2
- package/dist/types/global-account/react/hooks/useTWAuth.d.ts +0 -3
- package/dist/types/global-account/react/index.native.d.ts +2 -0
- package/dist/types/global-account/react/stores/index.d.ts +0 -1
- package/dist/types/global-account/react/stores/useModalStore.d.ts +0 -10
- package/package.json +1 -1
- package/src/anyspend/constants/index.ts +0 -3
- package/src/anyspend/index.ts +0 -4
- package/src/anyspend/react/components/AnySpend.tsx +2 -28
- package/src/anyspend/react/components/AnySpendCollectorClubPurchase.tsx +0 -6
- package/src/anyspend/react/components/AnySpendCustom.tsx +47 -52
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +0 -23
- package/src/anyspend/react/components/AnySpendDeposit.tsx +1 -18
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +0 -4
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +1 -15
- package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +1 -5
- package/src/anyspend/react/components/common/OrderDetails.tsx +42 -60
- package/src/anyspend/react/components/common/PanelOnramp.tsx +1 -5
- package/src/anyspend/react/components/common/PaymentStripeWeb2.tsx +4 -3
- package/src/anyspend/react/hooks/index.ts +0 -1
- package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +2 -2
- package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +2 -2
- package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +2 -2
- package/src/anyspend/react/hooks/useValidatedClientReferenceId.ts +2 -2
- package/src/global-account/react/components/B3DynamicModal.tsx +4 -3
- package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +54 -43
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +117 -44
- package/src/global-account/react/components/B3Provider/RelayKitProviderWrapper.tsx +1 -4
- package/src/global-account/react/components/B3Provider/types.ts +50 -0
- package/src/global-account/react/components/B3Provider/useB3.ts +13 -4
- package/src/global-account/react/components/B3Provider/useB3Account.ts +2 -6
- package/src/global-account/react/components/B3Provider/useB3Config.ts +31 -18
- package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +4 -2
- package/src/global-account/react/components/ManageAccount/channels/DiscordChannel.tsx +2 -2
- package/src/global-account/react/components/ManageAccount/channels/EmailChannel.tsx +2 -2
- package/src/global-account/react/components/ManageAccount/channels/PhoneChannel.tsx +2 -2
- package/src/global-account/react/components/ManageAccount/channels/TelegramChannel.tsx +2 -2
- package/src/global-account/react/components/RequestPermissions/RequestPermissions.tsx +4 -4
- package/src/global-account/react/components/SignInWithB3/SignIn.tsx +2 -2
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +100 -168
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Privy.tsx +2 -2
- package/src/global-account/react/components/SignInWithB3/steps/LoginStep.tsx +2 -2
- package/src/global-account/react/components/SignInWithB3/steps/LoginStepCustom.tsx +2 -2
- package/src/global-account/react/components/StyleRoot.tsx +3 -3
- package/src/global-account/react/components/TurnkeyAuthModal.tsx +4 -7
- package/src/global-account/react/components/custom/ManageAccountButton.tsx +3 -2
- package/src/global-account/react/components/index.ts +2 -1
- package/src/global-account/react/hooks/index.ts +0 -2
- package/src/global-account/react/hooks/useClient.ts +2 -2
- package/src/global-account/react/hooks/useHandleConnectWithPrivy.tsx +2 -2
- package/src/global-account/react/hooks/useNotifications.ts +2 -2
- package/src/global-account/react/hooks/useTWAuth.tsx +0 -10
- package/src/global-account/react/hooks/useTokenBalance.tsx +7 -8
- package/src/global-account/react/hooks/useTokenBalancesByChain.tsx +2 -4
- package/src/global-account/react/hooks/useTurnkeyAuth.ts +23 -54
- package/src/global-account/react/hooks/useUserQuery.ts +40 -1
- package/src/global-account/react/index.native.ts +2 -0
- package/src/global-account/react/stores/index.ts +0 -1
- package/src/global-account/react/stores/useModalStore.ts +0 -10
- package/dist/cjs/anyspend/react/components/common/GasIndicator.d.ts +0 -6
- package/dist/cjs/anyspend/react/components/common/GasIndicator.js +0 -34
- package/dist/cjs/anyspend/react/hooks/useGasPrice.d.ts +0 -37
- package/dist/cjs/anyspend/react/hooks/useGasPrice.js +0 -43
- package/dist/cjs/anyspend/services/gas.d.ts +0 -21
- package/dist/cjs/anyspend/services/gas.js +0 -65
- package/dist/cjs/anyspend/types/gas.d.ts +0 -61
- package/dist/cjs/anyspend/types/gas.js +0 -2
- package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +0 -5
- package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.js +0 -12
- package/dist/cjs/global-account/react/hooks/useAuth.d.ts +0 -76
- package/dist/cjs/global-account/react/hooks/useAuth.js +0 -337
- package/dist/cjs/global-account/react/hooks/useUser.d.ts +0 -60
- package/dist/cjs/global-account/react/hooks/useUser.js +0 -20
- package/dist/cjs/global-account/react/stores/configStore.d.ts +0 -24
- package/dist/cjs/global-account/react/stores/configStore.js +0 -30
- package/dist/cjs/global-account/react/stores/userStore.d.ts +0 -22
- package/dist/cjs/global-account/react/stores/userStore.js +0 -30
- package/dist/esm/anyspend/react/components/common/GasIndicator.d.ts +0 -6
- package/dist/esm/anyspend/react/components/common/GasIndicator.js +0 -31
- package/dist/esm/anyspend/react/hooks/useGasPrice.d.ts +0 -37
- package/dist/esm/anyspend/react/hooks/useGasPrice.js +0 -40
- package/dist/esm/anyspend/services/gas.d.ts +0 -21
- package/dist/esm/anyspend/services/gas.js +0 -59
- package/dist/esm/anyspend/types/gas.d.ts +0 -61
- package/dist/esm/anyspend/types/gas.js +0 -1
- package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +0 -5
- package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.js +0 -10
- package/dist/esm/global-account/react/hooks/useAuth.d.ts +0 -76
- package/dist/esm/global-account/react/hooks/useAuth.js +0 -331
- package/dist/esm/global-account/react/hooks/useUser.d.ts +0 -60
- package/dist/esm/global-account/react/hooks/useUser.js +0 -17
- package/dist/esm/global-account/react/stores/configStore.d.ts +0 -24
- package/dist/esm/global-account/react/stores/configStore.js +0 -27
- package/dist/esm/global-account/react/stores/userStore.d.ts +0 -22
- package/dist/esm/global-account/react/stores/userStore.js +0 -27
- package/dist/types/anyspend/react/components/common/GasIndicator.d.ts +0 -6
- package/dist/types/anyspend/react/hooks/useGasPrice.d.ts +0 -37
- package/dist/types/anyspend/services/gas.d.ts +0 -21
- package/dist/types/anyspend/types/gas.d.ts +0 -61
- package/dist/types/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +0 -5
- package/dist/types/global-account/react/hooks/useAuth.d.ts +0 -76
- package/dist/types/global-account/react/hooks/useUser.d.ts +0 -60
- package/dist/types/global-account/react/stores/configStore.d.ts +0 -24
- package/dist/types/global-account/react/stores/userStore.d.ts +0 -22
- package/src/anyspend/react/components/common/GasIndicator.tsx +0 -59
- package/src/anyspend/react/hooks/useGasPrice.ts +0 -70
- package/src/anyspend/services/gas.test.ts +0 -31
- package/src/anyspend/services/gas.ts +0 -73
- package/src/anyspend/types/gas.ts +0 -66
- package/src/global-account/react/components/B3Provider/AuthenticationProvider.tsx +0 -19
- package/src/global-account/react/hooks/useAuth.ts +0 -379
- package/src/global-account/react/hooks/useUser.ts +0 -20
- package/src/global-account/react/stores/configStore.ts +0 -51
- package/src/global-account/react/stores/userStore.ts +0 -41
|
@@ -1,21 +1,36 @@
|
|
|
1
1
|
import { CreateOnrampOrderParams } from "@b3dotfun/sdk/anyspend/react/hooks/useAnyspendCreateOnrampOrder";
|
|
2
2
|
import { CreateOrderParams } from "@b3dotfun/sdk/anyspend/react/hooks/useAnyspendCreateOrder";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
RelayKitProviderWrapper,
|
|
5
|
+
TooltipProvider,
|
|
6
|
+
useAuthentication,
|
|
7
|
+
useAuthStore,
|
|
8
|
+
} from "@b3dotfun/sdk/global-account/react";
|
|
9
|
+
import { useAutoSelectWallet } from "@b3dotfun/sdk/global-account/react/hooks/useAutoSelectWallet";
|
|
4
10
|
import { createWagmiConfig } from "@b3dotfun/sdk/global-account/react/utils/createWagmiConfig";
|
|
5
11
|
import { PermissionsConfig } from "@b3dotfun/sdk/global-account/types/permissions";
|
|
6
12
|
import { loadGA4Script } from "@b3dotfun/sdk/global-account/utils/analytics";
|
|
7
13
|
import "@relayprotocol/relay-kit-ui/styles.css";
|
|
8
14
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
9
15
|
import { useEffect, useMemo } from "react";
|
|
10
|
-
import { ThirdwebProvider } from "thirdweb/react";
|
|
16
|
+
import { ThirdwebProvider, useActiveAccount } from "thirdweb/react";
|
|
11
17
|
import { Account, Wallet } from "thirdweb/wallets";
|
|
12
18
|
import { CreateConnectorFn, WagmiProvider } from "wagmi";
|
|
13
19
|
import { ClientType, setClientType } from "../../../client-manager";
|
|
14
|
-
import { useB3ConfigStore } from "../../stores/configStore";
|
|
15
20
|
import { StyleRoot } from "../StyleRoot";
|
|
16
21
|
import { setToastContext, ToastProvider, useToastContext } from "../Toast/index";
|
|
17
|
-
import AuthenticationProvider from "./AuthenticationProvider";
|
|
18
22
|
import { LocalSDKProvider } from "./LocalSDKProvider";
|
|
23
|
+
import { B3Context, B3ContextType } from "./types";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Default permissions configuration for B3 provider
|
|
27
|
+
*/
|
|
28
|
+
const DEFAULT_PERMISSIONS = {
|
|
29
|
+
approvedTargets: ["0xa8e42121e318e3D3BeD7f5969AF6D360045317DD"], // Example contract
|
|
30
|
+
nativeTokenLimitPerTransaction: 0.1, // in ETH
|
|
31
|
+
startDate: new Date(),
|
|
32
|
+
endDate: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365), // 1 year from now
|
|
33
|
+
};
|
|
19
34
|
|
|
20
35
|
// Create queryClient instance
|
|
21
36
|
const queryClient = new QueryClient();
|
|
@@ -41,12 +56,11 @@ export function B3Provider({
|
|
|
41
56
|
overrideDefaultConnectors = false,
|
|
42
57
|
createClientReferenceId,
|
|
43
58
|
enableTurnkey = false,
|
|
44
|
-
defaultPermissions,
|
|
45
59
|
}: {
|
|
46
60
|
theme: "light" | "dark";
|
|
47
61
|
children: React.ReactNode;
|
|
48
62
|
accountOverride?: Account;
|
|
49
|
-
environment
|
|
63
|
+
environment: B3ContextType["environment"];
|
|
50
64
|
automaticallySetFirstEoa?: boolean;
|
|
51
65
|
simDuneApiKey?: string;
|
|
52
66
|
toaster?: {
|
|
@@ -63,38 +77,7 @@ export function B3Provider({
|
|
|
63
77
|
overrideDefaultConnectors?: boolean;
|
|
64
78
|
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
65
79
|
enableTurnkey?: boolean;
|
|
66
|
-
defaultPermissions?: PermissionsConfig;
|
|
67
80
|
}) {
|
|
68
|
-
const setConfig = useB3ConfigStore(state => state.setConfig);
|
|
69
|
-
|
|
70
|
-
// Initialize config store on mount
|
|
71
|
-
useEffect(() => {
|
|
72
|
-
setConfig({
|
|
73
|
-
accountOverride,
|
|
74
|
-
environment: environment ?? "development",
|
|
75
|
-
automaticallySetFirstEoa: !!automaticallySetFirstEoa,
|
|
76
|
-
theme,
|
|
77
|
-
clientType,
|
|
78
|
-
partnerId,
|
|
79
|
-
stripePublishableKey,
|
|
80
|
-
createClientReferenceId,
|
|
81
|
-
enableTurnkey,
|
|
82
|
-
defaultPermissions,
|
|
83
|
-
});
|
|
84
|
-
}, [
|
|
85
|
-
accountOverride,
|
|
86
|
-
environment,
|
|
87
|
-
automaticallySetFirstEoa,
|
|
88
|
-
theme,
|
|
89
|
-
clientType,
|
|
90
|
-
partnerId,
|
|
91
|
-
stripePublishableKey,
|
|
92
|
-
createClientReferenceId,
|
|
93
|
-
enableTurnkey,
|
|
94
|
-
defaultPermissions,
|
|
95
|
-
setConfig,
|
|
96
|
-
]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
97
|
-
|
|
98
81
|
// Initialize Google Analytics on mount
|
|
99
82
|
useEffect(() => {
|
|
100
83
|
loadGA4Script();
|
|
@@ -117,13 +100,24 @@ export function B3Provider({
|
|
|
117
100
|
<TooltipProvider>
|
|
118
101
|
<ToastProvider>
|
|
119
102
|
<LocalSDKProvider onConnectCallback={onConnect}>
|
|
120
|
-
<
|
|
121
|
-
|
|
122
|
-
{
|
|
123
|
-
{
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
103
|
+
<InnerProvider
|
|
104
|
+
accountOverride={accountOverride}
|
|
105
|
+
environment={environment}
|
|
106
|
+
theme={theme}
|
|
107
|
+
automaticallySetFirstEoa={!!automaticallySetFirstEoa}
|
|
108
|
+
clientType={clientType}
|
|
109
|
+
partnerId={partnerId}
|
|
110
|
+
stripePublishableKey={stripePublishableKey}
|
|
111
|
+
createClientReferenceId={createClientReferenceId}
|
|
112
|
+
enableTurnkey={enableTurnkey}
|
|
113
|
+
>
|
|
114
|
+
<ToastContextConnector />
|
|
115
|
+
<RelayKitProviderWrapper simDuneApiKey={simDuneApiKey}>
|
|
116
|
+
{children}
|
|
117
|
+
{/* For the modal https://github.com/b3-fun/b3/blob/main/packages/sdk/src/global-account/react/components/ui/dialog.tsx#L46 */}
|
|
118
|
+
<StyleRoot id="b3-root" />
|
|
119
|
+
</RelayKitProviderWrapper>
|
|
120
|
+
</InnerProvider>
|
|
127
121
|
</LocalSDKProvider>
|
|
128
122
|
</ToastProvider>
|
|
129
123
|
</TooltipProvider>
|
|
@@ -133,6 +127,85 @@ export function B3Provider({
|
|
|
133
127
|
);
|
|
134
128
|
}
|
|
135
129
|
|
|
130
|
+
/**
|
|
131
|
+
* Inner provider component that provides the actual B3Context
|
|
132
|
+
*/
|
|
133
|
+
export function InnerProvider({
|
|
134
|
+
children,
|
|
135
|
+
accountOverride,
|
|
136
|
+
environment,
|
|
137
|
+
defaultPermissions = DEFAULT_PERMISSIONS,
|
|
138
|
+
automaticallySetFirstEoa,
|
|
139
|
+
theme = "light",
|
|
140
|
+
clientType = "socket",
|
|
141
|
+
partnerId,
|
|
142
|
+
stripePublishableKey,
|
|
143
|
+
createClientReferenceId,
|
|
144
|
+
enableTurnkey,
|
|
145
|
+
}: {
|
|
146
|
+
children: React.ReactNode;
|
|
147
|
+
accountOverride?: Account;
|
|
148
|
+
environment: B3ContextType["environment"];
|
|
149
|
+
defaultPermissions?: PermissionsConfig;
|
|
150
|
+
automaticallySetFirstEoa: boolean;
|
|
151
|
+
theme: "light" | "dark";
|
|
152
|
+
clientType?: ClientType;
|
|
153
|
+
partnerId: string;
|
|
154
|
+
stripePublishableKey?: string;
|
|
155
|
+
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
156
|
+
enableTurnkey?: boolean;
|
|
157
|
+
}) {
|
|
158
|
+
const activeAccount = useActiveAccount();
|
|
159
|
+
const isAuthenticated = useAuthStore(state => state.isAuthenticated);
|
|
160
|
+
//const isConnected = useAuthStore(state => state.isConnected);
|
|
161
|
+
//const justCompletedLogin = useAuthStore(state => state.justCompletedLogin);
|
|
162
|
+
|
|
163
|
+
// Note: This fixes a bug where useAuthentication is no longer rendered on every page, as of this PR https://github.com/b3-fun/b3/pull/385/files#diff-3ef996931b8fc8e49021ba1b42ddaa97535214681610dc5fdacf63542e261af7
|
|
164
|
+
// The above PR removes useAuthentication from the overall B3Provider. useAuthentication should be everywhere the provider is, since it sets the overall auth state
|
|
165
|
+
// By just calling it manually, we fix that issue
|
|
166
|
+
// As a follow up, we should fix the SDK directly
|
|
167
|
+
useAuthentication(partnerId);
|
|
168
|
+
|
|
169
|
+
// Use given accountOverride or activeAccount from thirdweb
|
|
170
|
+
// WOJ: why if isAuthenticated is false, we don't use activeAccount, which should be undefined?
|
|
171
|
+
// skip isAuthenticated check ?
|
|
172
|
+
const effectiveAccount = isAuthenticated ? accountOverride || activeAccount : undefined;
|
|
173
|
+
|
|
174
|
+
// Wrapper to set active wallet via thirdweb
|
|
175
|
+
// Note: `wallet` in context is deprecated - use useActiveWallet() from thirdweb/react instead
|
|
176
|
+
|
|
177
|
+
// Auto-select first EOA wallet when enabled
|
|
178
|
+
useAutoSelectWallet({
|
|
179
|
+
enabled: automaticallySetFirstEoa,
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
return (
|
|
183
|
+
<B3Context.Provider
|
|
184
|
+
value={{
|
|
185
|
+
account: effectiveAccount,
|
|
186
|
+
// setWallet,
|
|
187
|
+
//wallet: undefined, // Deprecated: use useActiveWallet() from thirdweb/react instead
|
|
188
|
+
//user,
|
|
189
|
+
//setUser,
|
|
190
|
+
//refetchUser,
|
|
191
|
+
initialized: true,
|
|
192
|
+
ready: !!effectiveAccount,
|
|
193
|
+
automaticallySetFirstEoa,
|
|
194
|
+
environment,
|
|
195
|
+
defaultPermissions,
|
|
196
|
+
theme,
|
|
197
|
+
clientType,
|
|
198
|
+
partnerId: partnerId,
|
|
199
|
+
stripePublishableKey,
|
|
200
|
+
createClientReferenceId,
|
|
201
|
+
enableTurnkey,
|
|
202
|
+
}}
|
|
203
|
+
>
|
|
204
|
+
{children}
|
|
205
|
+
</B3Context.Provider>
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
136
209
|
/**
|
|
137
210
|
* Component to connect the toast context to the global toast API
|
|
138
211
|
*/
|
|
@@ -19,9 +19,6 @@ export function RelayKitProviderWrapper({
|
|
|
19
19
|
fetchChains();
|
|
20
20
|
}, []);
|
|
21
21
|
|
|
22
|
-
const isTurnkeyPrimary = process.env.NEXT_PUBLIC_TURNKEY_PRIMARY === "true";
|
|
23
|
-
const appName = isTurnkeyPrimary ? "Smart Wallet" : "AnySpend";
|
|
24
|
-
|
|
25
22
|
return (
|
|
26
23
|
<RelayKitProvider
|
|
27
24
|
options={{
|
|
@@ -33,7 +30,7 @@ export function RelayKitProviderWrapper({
|
|
|
33
30
|
},
|
|
34
31
|
chains: relayChains,
|
|
35
32
|
privateChainIds: undefined,
|
|
36
|
-
appName,
|
|
33
|
+
appName: "AnySpend",
|
|
37
34
|
useGasFeeEstimations: true,
|
|
38
35
|
}}
|
|
39
36
|
>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { CreateOnrampOrderParams } from "@b3dotfun/sdk/anyspend/react/hooks/useAnyspendCreateOnrampOrder";
|
|
2
|
+
import { CreateOrderParams } from "@b3dotfun/sdk/anyspend/react/hooks/useAnyspendCreateOrder";
|
|
3
|
+
import { PermissionsConfig } from "@b3dotfun/sdk/global-account/types/permissions";
|
|
4
|
+
import { createContext } from "react";
|
|
5
|
+
import { Account, Wallet } from "thirdweb/wallets";
|
|
6
|
+
import { ClientType } from "../../../client-manager";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Context type for B3Provider
|
|
10
|
+
*/
|
|
11
|
+
export interface B3ContextType {
|
|
12
|
+
account?: Account;
|
|
13
|
+
automaticallySetFirstEoa: boolean;
|
|
14
|
+
//user?: Users;
|
|
15
|
+
//setWallet: (wallet: Wallet) => void;
|
|
16
|
+
wallet?: Wallet;
|
|
17
|
+
//setUser: (user?: Users) => void;
|
|
18
|
+
//refetchUser: () => Promise<any>;
|
|
19
|
+
initialized: boolean;
|
|
20
|
+
ready: boolean;
|
|
21
|
+
environment?: "development" | "production";
|
|
22
|
+
defaultPermissions?: PermissionsConfig;
|
|
23
|
+
theme: "light" | "dark";
|
|
24
|
+
clientType: ClientType;
|
|
25
|
+
partnerId: string;
|
|
26
|
+
stripePublishableKey?: string;
|
|
27
|
+
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
28
|
+
enableTurnkey?: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Context for B3 provider
|
|
33
|
+
*/
|
|
34
|
+
export const B3Context = createContext<B3ContextType>({
|
|
35
|
+
account: undefined,
|
|
36
|
+
automaticallySetFirstEoa: false,
|
|
37
|
+
//user: undefined,
|
|
38
|
+
//setWallet: () => {},
|
|
39
|
+
wallet: undefined,
|
|
40
|
+
//setUser: () => {},
|
|
41
|
+
//refetchUser: async () => {},
|
|
42
|
+
initialized: false,
|
|
43
|
+
ready: false,
|
|
44
|
+
environment: "development",
|
|
45
|
+
theme: "light",
|
|
46
|
+
clientType: "rest",
|
|
47
|
+
partnerId: "",
|
|
48
|
+
createClientReferenceId: undefined,
|
|
49
|
+
enableTurnkey: false,
|
|
50
|
+
});
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useContext, useMemo } from "react";
|
|
2
|
+
import { B3Context } from "./types";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
* Hook to access the B3
|
|
5
|
-
* @
|
|
5
|
+
* Hook to access the B3 context
|
|
6
|
+
* @throws Error if used outside a B3Provider
|
|
7
|
+
* @deprecated Use useB3Config or useB3Account instead
|
|
6
8
|
*/
|
|
7
9
|
export function useB3() {
|
|
8
|
-
|
|
10
|
+
const context = useContext(B3Context);
|
|
11
|
+
|
|
12
|
+
if (!context.initialized) {
|
|
13
|
+
throw new Error("useB3 must be used within a B3Provider");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Return a stable reference
|
|
17
|
+
return useMemo(() => context, [context]);
|
|
9
18
|
}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { useActiveAccount } from "thirdweb/react";
|
|
2
|
-
import { useAuthStore } from "../../stores/useAuthStore";
|
|
3
2
|
|
|
4
3
|
// Wrapper around useActiveAccount
|
|
5
4
|
export const useB3Account = () => {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const effectiveAccount = isAuthenticated ? activeAccount : undefined;
|
|
9
|
-
|
|
10
|
-
return effectiveAccount;
|
|
5
|
+
const account = useActiveAccount();
|
|
6
|
+
return account;
|
|
11
7
|
};
|
|
@@ -1,21 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useContext, useMemo } from "react";
|
|
2
|
+
import { B3Context } from "./types";
|
|
2
3
|
|
|
3
|
-
/**
|
|
4
|
-
* Hook to access B3 configuration
|
|
5
|
-
* Returns all config values from the Zustand store
|
|
6
|
-
* Since config is static (set once at initialization), destructuring is fine here
|
|
7
|
-
*/
|
|
8
4
|
export const useB3Config = () => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
5
|
+
const context = useContext(B3Context);
|
|
6
|
+
|
|
7
|
+
if (!context) {
|
|
8
|
+
throw new Error("useB3 must be used within a B3Provider");
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
automaticallySetFirstEoa,
|
|
13
|
+
environment,
|
|
14
|
+
theme,
|
|
15
|
+
clientType,
|
|
16
|
+
partnerId,
|
|
17
|
+
createClientReferenceId,
|
|
18
|
+
enableTurnkey,
|
|
19
|
+
} = context;
|
|
20
|
+
|
|
21
|
+
// Return a stable reference
|
|
22
|
+
return useMemo(
|
|
23
|
+
() => ({
|
|
24
|
+
automaticallySetFirstEoa,
|
|
25
|
+
environment,
|
|
26
|
+
theme,
|
|
27
|
+
clientType,
|
|
28
|
+
partnerId,
|
|
29
|
+
createClientReferenceId,
|
|
30
|
+
enableTurnkey,
|
|
31
|
+
}),
|
|
32
|
+
[automaticallySetFirstEoa, environment, theme, clientType, partnerId, createClientReferenceId, enableTurnkey],
|
|
33
|
+
);
|
|
21
34
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useAccountWallet,
|
|
3
|
+
useAuthentication,
|
|
4
|
+
useB3Config,
|
|
3
5
|
useModalStore,
|
|
4
6
|
useProfile,
|
|
5
7
|
useSimBalance,
|
|
6
|
-
useUser,
|
|
7
8
|
} from "@b3dotfun/sdk/global-account/react";
|
|
8
9
|
import { formatUsername } from "@b3dotfun/sdk/shared/utils";
|
|
9
10
|
import { formatDisplayNumber } from "@b3dotfun/sdk/shared/utils/number";
|
|
@@ -21,7 +22,8 @@ const ProfileSection = () => {
|
|
|
21
22
|
address: eoaAddress || account?.address,
|
|
22
23
|
fresh: true,
|
|
23
24
|
});
|
|
24
|
-
const {
|
|
25
|
+
const { partnerId } = useB3Config();
|
|
26
|
+
const { user } = useAuthentication(partnerId);
|
|
25
27
|
const setB3ModalOpen = useModalStore(state => state.setB3ModalOpen);
|
|
26
28
|
const setB3ModalContentType = useModalStore(state => state.setB3ModalContentType);
|
|
27
29
|
const navigateBack = useModalStore(state => state.navigateBack);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useB3Config } from "@b3dotfun/sdk/global-account/react";
|
|
2
1
|
import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
|
|
3
2
|
import { useState } from "react";
|
|
4
3
|
import { notificationsAPI } from "../../../utils/notificationsAPI";
|
|
4
|
+
import { useB3 } from "../../B3Provider/useB3";
|
|
5
5
|
import { toast } from "../../Toast/toastApi";
|
|
6
6
|
import { NotificationChannel } from "../NotificationChannel";
|
|
7
7
|
|
|
@@ -26,7 +26,7 @@ export const DiscordChannel = ({
|
|
|
26
26
|
onConnectionChange,
|
|
27
27
|
onToggle,
|
|
28
28
|
}: DiscordChannelProps) => {
|
|
29
|
-
const { partnerId } =
|
|
29
|
+
const { partnerId } = useB3();
|
|
30
30
|
|
|
31
31
|
const [discordId, setDiscordId] = useState("");
|
|
32
32
|
const [isConnecting, setIsConnecting] = useState(false);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useB3Config } from "@b3dotfun/sdk/global-account/react";
|
|
2
1
|
import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
|
|
3
2
|
import { useState } from "react";
|
|
4
3
|
import { notificationsAPI } from "../../../utils/notificationsAPI";
|
|
4
|
+
import { useB3 } from "../../B3Provider/useB3";
|
|
5
5
|
import { toast } from "../../Toast/toastApi";
|
|
6
6
|
import { NotificationChannel } from "../NotificationChannel";
|
|
7
7
|
|
|
@@ -31,7 +31,7 @@ export const EmailChannel = ({
|
|
|
31
31
|
onConnectionChange,
|
|
32
32
|
onToggle,
|
|
33
33
|
}: EmailChannelProps) => {
|
|
34
|
-
const { partnerId } =
|
|
34
|
+
const { partnerId } = useB3();
|
|
35
35
|
|
|
36
36
|
const [email, setEmail] = useState("");
|
|
37
37
|
const [emailError, setEmailError] = useState<string | null>(null);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useB3Config } from "@b3dotfun/sdk/global-account/react";
|
|
2
1
|
import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
|
|
3
2
|
import { useState } from "react";
|
|
4
3
|
import { notificationsAPI } from "../../../utils/notificationsAPI";
|
|
4
|
+
import { useB3 } from "../../B3Provider/useB3";
|
|
5
5
|
import { toast } from "../../Toast/toastApi";
|
|
6
6
|
import { NotificationChannel } from "../NotificationChannel";
|
|
7
7
|
|
|
@@ -32,7 +32,7 @@ export const PhoneChannel = ({
|
|
|
32
32
|
onConnectionChange,
|
|
33
33
|
onToggle,
|
|
34
34
|
}: PhoneChannelProps) => {
|
|
35
|
-
const { partnerId } =
|
|
35
|
+
const { partnerId } = useB3();
|
|
36
36
|
|
|
37
37
|
const [phoneNumber, setPhoneNumber] = useState("");
|
|
38
38
|
const [isConnectingSMS, setIsConnectingSMS] = useState(false);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useB3Config } from "@b3dotfun/sdk/global-account/react";
|
|
2
1
|
import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
|
|
3
2
|
import { useState } from "react";
|
|
4
3
|
import { notificationsAPI } from "../../../utils/notificationsAPI";
|
|
4
|
+
import { useB3 } from "../../B3Provider/useB3";
|
|
5
5
|
import { toast } from "../../Toast/toastApi";
|
|
6
6
|
import { NotificationChannel } from "../NotificationChannel";
|
|
7
7
|
|
|
@@ -26,7 +26,7 @@ export const TelegramChannel = ({
|
|
|
26
26
|
onConnectionChange,
|
|
27
27
|
onToggle,
|
|
28
28
|
}: TelegramChannelProps) => {
|
|
29
|
-
const { partnerId } =
|
|
29
|
+
const { partnerId } = useB3();
|
|
30
30
|
|
|
31
31
|
const [isConnecting, setIsConnecting] = useState(false);
|
|
32
32
|
const [status, setStatus] = useState<"idle" | "pending" | "connected">("idle");
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Button,
|
|
3
|
-
|
|
4
|
-
RequestPermissionsModalProps,
|
|
3
|
+
useB3,
|
|
5
4
|
useAddTWSessionKey,
|
|
6
|
-
useB3Config,
|
|
7
5
|
useGetAllTWSigners,
|
|
6
|
+
RequestPermissionsModalProps,
|
|
8
7
|
} from "@b3dotfun/sdk/global-account/react";
|
|
8
|
+
import { PermissionItem } from "@b3dotfun/sdk/global-account/react";
|
|
9
9
|
import { PermissionsConfig } from "@b3dotfun/sdk/global-account/types/permissions";
|
|
10
10
|
import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
|
|
11
11
|
import { formatAddress } from "@b3dotfun/sdk/shared/utils/formatAddress";
|
|
@@ -30,7 +30,7 @@ export function RequestPermissions({
|
|
|
30
30
|
}: RequestPermissionsModalProps) {
|
|
31
31
|
const [isApproving, setIsApproving] = useState(false);
|
|
32
32
|
const account = useActiveAccount();
|
|
33
|
-
const { defaultPermissions } =
|
|
33
|
+
const { defaultPermissions } = useB3();
|
|
34
34
|
const DEFAULT_PERMISSIONS = useMemo(
|
|
35
35
|
() => permissions ?? (defaultPermissions as PermissionsConfig),
|
|
36
36
|
[defaultPermissions, permissions],
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
StyleRoot,
|
|
6
6
|
useAccountWallet,
|
|
7
7
|
useAuthentication,
|
|
8
|
-
|
|
8
|
+
useB3,
|
|
9
9
|
useIsMobile,
|
|
10
10
|
} from "@b3dotfun/sdk/global-account/react";
|
|
11
11
|
import Icon from "@b3dotfun/sdk/global-account/react/components/custom/Icon";
|
|
@@ -30,7 +30,7 @@ type SignInWithB3Props = Omit<SignInWithB3ModalProps, "type" | "showBackButton">
|
|
|
30
30
|
|
|
31
31
|
export function SignIn(props: SignInWithB3Props) {
|
|
32
32
|
const { className } = props;
|
|
33
|
-
const { automaticallySetFirstEoa, partnerId } =
|
|
33
|
+
const { automaticallySetFirstEoa, partnerId } = useB3();
|
|
34
34
|
const {
|
|
35
35
|
address: globalAddress,
|
|
36
36
|
ensName,
|