@b3dotfun/sdk 0.0.88-alpha.0 → 0.0.88-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/dist/cjs/anyspend/constants/index.d.ts +2 -0
- package/dist/cjs/anyspend/constants/index.js +3 -1
- package/dist/cjs/anyspend/index.d.ts +2 -0
- package/dist/cjs/anyspend/index.js +3 -0
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +6 -0
- package/dist/cjs/anyspend/react/components/AnySpend.js +9 -6
- package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
- package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +1 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +3 -3
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +6 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +24 -20
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +7 -1
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +3 -3
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +4 -0
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +14 -1
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +3 -2
- package/dist/cjs/anyspend/react/components/common/GasIndicator.d.ts +6 -0
- package/dist/cjs/anyspend/react/components/common/GasIndicator.js +34 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +4 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +34 -6
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +3 -2
- package/dist/cjs/anyspend/react/components/common/PaymentStripeWeb2.js +3 -4
- package/dist/cjs/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/cjs/anyspend/react/hooks/index.js +1 -0
- 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/useGasPrice.d.ts +37 -0
- package/dist/cjs/anyspend/react/hooks/useGasPrice.js +43 -0
- package/dist/cjs/anyspend/react/hooks/useValidatedClientReferenceId.js +1 -1
- package/dist/cjs/anyspend/services/gas.d.ts +21 -0
- package/dist/cjs/anyspend/services/gas.js +65 -0
- package/dist/cjs/anyspend/types/gas.d.ts +61 -0
- package/dist/cjs/anyspend/types/gas.js +2 -0
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +2 -3
- package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +5 -0
- package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.js +12 -0
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +2 -18
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +35 -52
- 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 +38 -35
- package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +3 -1
- package/dist/cjs/global-account/react/components/B3Provider/useB3.d.ts +14 -4
- package/dist/cjs/global-account/react/components/B3Provider/useB3.js +4 -11
- package/dist/cjs/global-account/react/components/B3Provider/useB3Account.js +5 -2
- package/dist/cjs/global-account/react/components/B3Provider/useB3Config.d.ts +10 -2
- package/dist/cjs/global-account/react/components/B3Provider/useB3Config.js +18 -17
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +1 -2
- 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 +8 -9
- package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +76 -20
- 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 +3 -1
- package/dist/cjs/global-account/react/components/custom/ManageAccountButton.js +1 -2
- package/dist/cjs/global-account/react/components/index.d.ts +1 -2
- package/dist/cjs/global-account/react/components/index.js +3 -6
- package/dist/cjs/global-account/react/hooks/index.d.ts +2 -0
- package/dist/cjs/global-account/react/hooks/index.js +5 -1
- package/dist/cjs/global-account/react/hooks/useAuth.d.ts +76 -0
- package/dist/cjs/global-account/react/hooks/useAuth.js +337 -0
- 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 +3 -0
- package/dist/cjs/global-account/react/hooks/useTWAuth.js +8 -0
- package/dist/cjs/global-account/react/hooks/useTokenBalance.js +5 -5
- package/dist/cjs/global-account/react/hooks/useTokenBalancesByChain.js +4 -2
- package/dist/cjs/global-account/react/hooks/useTurnkeyAuth.js +50 -22
- package/dist/cjs/global-account/react/hooks/useUser.d.ts +60 -0
- package/dist/cjs/global-account/react/hooks/useUser.js +20 -0
- package/dist/cjs/global-account/react/hooks/useUserQuery.js +9 -35
- package/dist/cjs/global-account/react/index.native.d.ts +0 -2
- package/dist/cjs/global-account/react/index.native.js +1 -5
- package/dist/cjs/global-account/react/stores/configStore.d.ts +24 -0
- package/dist/cjs/global-account/react/stores/configStore.js +30 -0
- package/dist/cjs/global-account/react/stores/index.d.ts +1 -0
- package/dist/cjs/global-account/react/stores/index.js +3 -1
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +10 -0
- package/dist/cjs/global-account/react/stores/userStore.d.ts +22 -0
- package/dist/cjs/global-account/react/stores/userStore.js +30 -0
- package/dist/esm/anyspend/constants/index.d.ts +2 -0
- package/dist/esm/anyspend/constants/index.js +2 -0
- package/dist/esm/anyspend/index.d.ts +2 -0
- package/dist/esm/anyspend/index.js +3 -0
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +6 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +11 -8
- package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
- package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +1 -0
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +3 -3
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +6 -0
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +8 -4
- package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +7 -1
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +3 -3
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +4 -0
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +14 -1
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +3 -2
- package/dist/esm/anyspend/react/components/common/GasIndicator.d.ts +6 -0
- package/dist/esm/anyspend/react/components/common/GasIndicator.js +31 -0
- package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +4 -0
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +36 -8
- package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/PanelOnramp.js +3 -2
- package/dist/esm/anyspend/react/components/common/PaymentStripeWeb2.js +3 -4
- package/dist/esm/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/esm/anyspend/react/hooks/index.js +1 -0
- 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/useGasPrice.d.ts +37 -0
- package/dist/esm/anyspend/react/hooks/useGasPrice.js +40 -0
- package/dist/esm/anyspend/react/hooks/useValidatedClientReferenceId.js +2 -2
- package/dist/esm/anyspend/services/gas.d.ts +21 -0
- package/dist/esm/anyspend/services/gas.js +59 -0
- package/dist/esm/anyspend/types/gas.d.ts +61 -0
- package/dist/esm/anyspend/types/gas.js +1 -0
- package/dist/esm/global-account/react/components/B3DynamicModal.js +3 -4
- package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +5 -0
- package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.js +10 -0
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +2 -18
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +34 -53
- 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 +3 -1
- package/dist/esm/global-account/react/components/B3Provider/useB3.d.ts +14 -4
- package/dist/esm/global-account/react/components/B3Provider/useB3.js +4 -11
- package/dist/esm/global-account/react/components/B3Provider/useB3Account.js +5 -2
- package/dist/esm/global-account/react/components/B3Provider/useB3Config.d.ts +10 -2
- package/dist/esm/global-account/react/components/B3Provider/useB3Config.js +18 -17
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +2 -3
- 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 +2 -3
- package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +76 -20
- 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 +5 -3
- package/dist/esm/global-account/react/components/custom/ManageAccountButton.js +2 -3
- package/dist/esm/global-account/react/components/index.d.ts +1 -2
- package/dist/esm/global-account/react/components/index.js +1 -2
- package/dist/esm/global-account/react/hooks/index.d.ts +2 -0
- package/dist/esm/global-account/react/hooks/index.js +2 -0
- package/dist/esm/global-account/react/hooks/useAuth.d.ts +76 -0
- package/dist/esm/global-account/react/hooks/useAuth.js +331 -0
- 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 +3 -0
- package/dist/esm/global-account/react/hooks/useTWAuth.js +8 -0
- package/dist/esm/global-account/react/hooks/useTokenBalance.js +6 -6
- package/dist/esm/global-account/react/hooks/useTokenBalancesByChain.js +4 -2
- package/dist/esm/global-account/react/hooks/useTurnkeyAuth.js +50 -22
- package/dist/esm/global-account/react/hooks/useUser.d.ts +60 -0
- package/dist/esm/global-account/react/hooks/useUser.js +17 -0
- package/dist/esm/global-account/react/hooks/useUserQuery.js +1 -27
- package/dist/esm/global-account/react/index.native.d.ts +0 -2
- package/dist/esm/global-account/react/index.native.js +0 -2
- package/dist/esm/global-account/react/stores/configStore.d.ts +24 -0
- package/dist/esm/global-account/react/stores/configStore.js +27 -0
- package/dist/esm/global-account/react/stores/index.d.ts +1 -0
- package/dist/esm/global-account/react/stores/index.js +1 -0
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +10 -0
- package/dist/esm/global-account/react/stores/userStore.d.ts +22 -0
- package/dist/esm/global-account/react/stores/userStore.js +27 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/constants/index.d.ts +2 -0
- package/dist/types/anyspend/index.d.ts +2 -0
- package/dist/types/anyspend/react/components/AnySpend.d.ts +6 -0
- package/dist/types/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
- package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +1 -0
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +6 -0
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +7 -1
- package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +4 -0
- package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/GasIndicator.d.ts +6 -0
- package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +4 -0
- package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
- package/dist/types/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/types/anyspend/react/hooks/useGasPrice.d.ts +37 -0
- package/dist/types/anyspend/services/gas.d.ts +21 -0
- package/dist/types/anyspend/types/gas.d.ts +61 -0
- package/dist/types/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +5 -0
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +2 -18
- package/dist/types/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
- package/dist/types/global-account/react/components/B3Provider/useB3.d.ts +14 -4
- package/dist/types/global-account/react/components/B3Provider/useB3Config.d.ts +10 -2
- package/dist/types/global-account/react/components/index.d.ts +1 -2
- package/dist/types/global-account/react/hooks/index.d.ts +2 -0
- package/dist/types/global-account/react/hooks/useAuth.d.ts +76 -0
- package/dist/types/global-account/react/hooks/useTWAuth.d.ts +3 -0
- package/dist/types/global-account/react/hooks/useUser.d.ts +60 -0
- package/dist/types/global-account/react/index.native.d.ts +0 -2
- package/dist/types/global-account/react/stores/configStore.d.ts +24 -0
- package/dist/types/global-account/react/stores/index.d.ts +1 -0
- package/dist/types/global-account/react/stores/useModalStore.d.ts +10 -0
- package/dist/types/global-account/react/stores/userStore.d.ts +22 -0
- package/package.json +1 -1
- package/src/anyspend/constants/index.ts +3 -0
- package/src/anyspend/index.ts +4 -0
- package/src/anyspend/react/components/AnySpend.tsx +28 -2
- package/src/anyspend/react/components/AnySpendCollectorClubPurchase.tsx +6 -0
- package/src/anyspend/react/components/AnySpendCustom.tsx +52 -47
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +23 -0
- package/src/anyspend/react/components/AnySpendDeposit.tsx +27 -18
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +4 -0
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +15 -1
- package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +5 -1
- package/src/anyspend/react/components/common/GasIndicator.tsx +59 -0
- package/src/anyspend/react/components/common/OrderDetails.tsx +60 -42
- package/src/anyspend/react/components/common/PanelOnramp.tsx +5 -1
- package/src/anyspend/react/components/common/PaymentStripeWeb2.tsx +3 -4
- package/src/anyspend/react/hooks/index.ts +1 -0
- 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/useGasPrice.ts +70 -0
- package/src/anyspend/react/hooks/useValidatedClientReferenceId.ts +2 -2
- package/src/anyspend/services/gas.test.ts +31 -0
- package/src/anyspend/services/gas.ts +73 -0
- package/src/anyspend/types/gas.ts +66 -0
- package/src/global-account/react/components/B3DynamicModal.tsx +3 -4
- package/src/global-account/react/components/B3Provider/AuthenticationProvider.tsx +19 -0
- package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +43 -54
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +44 -106
- package/src/global-account/react/components/B3Provider/RelayKitProviderWrapper.tsx +4 -1
- package/src/global-account/react/components/B3Provider/useB3.ts +4 -13
- package/src/global-account/react/components/B3Provider/useB3Account.ts +6 -2
- package/src/global-account/react/components/B3Provider/useB3Config.ts +18 -31
- package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +2 -4
- 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 +168 -100
- 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 +7 -4
- package/src/global-account/react/components/custom/ManageAccountButton.tsx +2 -3
- package/src/global-account/react/components/index.ts +1 -2
- package/src/global-account/react/hooks/index.ts +2 -0
- package/src/global-account/react/hooks/useAuth.ts +379 -0
- 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 +10 -0
- package/src/global-account/react/hooks/useTokenBalance.tsx +8 -7
- package/src/global-account/react/hooks/useTokenBalancesByChain.tsx +4 -2
- package/src/global-account/react/hooks/useTurnkeyAuth.ts +54 -23
- package/src/global-account/react/hooks/useUser.ts +20 -0
- package/src/global-account/react/hooks/useUserQuery.ts +1 -40
- package/src/global-account/react/index.native.ts +0 -2
- package/src/global-account/react/stores/configStore.ts +51 -0
- package/src/global-account/react/stores/index.ts +1 -0
- package/src/global-account/react/stores/useModalStore.ts +10 -0
- package/src/global-account/react/stores/userStore.ts +41 -0
- package/dist/cjs/global-account/react/components/B3Provider/types.d.ts +0 -27
- package/dist/cjs/global-account/react/components/B3Provider/types.js +0 -24
- package/dist/esm/global-account/react/components/B3Provider/types.d.ts +0 -27
- package/dist/esm/global-account/react/components/B3Provider/types.js +0 -21
- package/dist/types/global-account/react/components/B3Provider/types.d.ts +0 -27
- package/src/global-account/react/components/B3Provider/types.ts +0 -50
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.B3Provider = B3Provider;
|
|
4
|
-
exports.InnerProvider = InnerProvider;
|
|
5
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
8
|
const react_1 = require("../../../../global-account/react");
|
|
7
|
-
const useAutoSelectWallet_1 = require("../../../../global-account/react/hooks/useAutoSelectWallet");
|
|
8
9
|
const createWagmiConfig_1 = require("../../../../global-account/react/utils/createWagmiConfig");
|
|
9
10
|
const analytics_1 = require("../../../../global-account/utils/analytics");
|
|
10
11
|
require("@relayprotocol/relay-kit-ui/styles.css");
|
|
@@ -13,19 +14,11 @@ const react_2 = require("react");
|
|
|
13
14
|
const react_3 = require("thirdweb/react");
|
|
14
15
|
const wagmi_1 = require("wagmi");
|
|
15
16
|
const client_manager_1 = require("../../../client-manager");
|
|
17
|
+
const configStore_1 = require("../../stores/configStore");
|
|
16
18
|
const StyleRoot_1 = require("../StyleRoot");
|
|
17
19
|
const index_1 = require("../Toast/index");
|
|
20
|
+
const AuthenticationProvider_1 = __importDefault(require("./AuthenticationProvider"));
|
|
18
21
|
const LocalSDKProvider_1 = require("./LocalSDKProvider");
|
|
19
|
-
const types_1 = require("./types");
|
|
20
|
-
/**
|
|
21
|
-
* Default permissions configuration for B3 provider
|
|
22
|
-
*/
|
|
23
|
-
const DEFAULT_PERMISSIONS = {
|
|
24
|
-
approvedTargets: ["0xa8e42121e318e3D3BeD7f5969AF6D360045317DD"], // Example contract
|
|
25
|
-
nativeTokenLimitPerTransaction: 0.1, // in ETH
|
|
26
|
-
startDate: new Date(),
|
|
27
|
-
endDate: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365), // 1 year from now
|
|
28
|
-
};
|
|
29
22
|
// Create queryClient instance
|
|
30
23
|
const queryClient = new react_query_1.QueryClient();
|
|
31
24
|
/**
|
|
@@ -33,7 +26,35 @@ const queryClient = new react_query_1.QueryClient();
|
|
|
33
26
|
*/
|
|
34
27
|
function B3Provider({ theme = "light", children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey,
|
|
35
28
|
// deprecated since v0.0.87
|
|
36
|
-
toaster: _toaster, clientType = "rest", rpcUrls, partnerId, stripePublishableKey, onConnect, connectors, overrideDefaultConnectors = false, createClientReferenceId, enableTurnkey = false, }) {
|
|
29
|
+
toaster: _toaster, clientType = "rest", rpcUrls, partnerId, stripePublishableKey, onConnect, connectors, overrideDefaultConnectors = false, createClientReferenceId, enableTurnkey = false, defaultPermissions, }) {
|
|
30
|
+
const setConfig = (0, configStore_1.useB3ConfigStore)(state => state.setConfig);
|
|
31
|
+
// Initialize config store on mount
|
|
32
|
+
(0, react_2.useEffect)(() => {
|
|
33
|
+
setConfig({
|
|
34
|
+
accountOverride,
|
|
35
|
+
environment: environment ?? "development",
|
|
36
|
+
automaticallySetFirstEoa: !!automaticallySetFirstEoa,
|
|
37
|
+
theme,
|
|
38
|
+
clientType,
|
|
39
|
+
partnerId,
|
|
40
|
+
stripePublishableKey,
|
|
41
|
+
createClientReferenceId,
|
|
42
|
+
enableTurnkey,
|
|
43
|
+
defaultPermissions,
|
|
44
|
+
});
|
|
45
|
+
}, [
|
|
46
|
+
accountOverride,
|
|
47
|
+
environment,
|
|
48
|
+
automaticallySetFirstEoa,
|
|
49
|
+
theme,
|
|
50
|
+
clientType,
|
|
51
|
+
partnerId,
|
|
52
|
+
stripePublishableKey,
|
|
53
|
+
createClientReferenceId,
|
|
54
|
+
enableTurnkey,
|
|
55
|
+
defaultPermissions,
|
|
56
|
+
setConfig,
|
|
57
|
+
]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
37
58
|
// Initialize Google Analytics on mount
|
|
38
59
|
(0, react_2.useEffect)(() => {
|
|
39
60
|
(0, analytics_1.loadGA4Script)();
|
|
@@ -43,45 +64,7 @@ toaster: _toaster, clientType = "rest", rpcUrls, partnerId, stripePublishableKey
|
|
|
43
64
|
(0, client_manager_1.setClientType)(clientType);
|
|
44
65
|
}, [clientType]);
|
|
45
66
|
const wagmiConfig = (0, react_2.useMemo)(() => (0, createWagmiConfig_1.createWagmiConfig)({ partnerId, rpcUrls, connectors, overrideDefaultConnectors }), [partnerId, rpcUrls, connectors, overrideDefaultConnectors]);
|
|
46
|
-
return ((0, jsx_runtime_1.jsx)(react_3.ThirdwebProvider, { children: (0, jsx_runtime_1.jsx)(wagmi_1.WagmiProvider, { config: wagmiConfig, reconnectOnMount: false, children: (0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: queryClient, children: (0, jsx_runtime_1.jsx)(react_1.TooltipProvider, { children: (0, jsx_runtime_1.jsx)(index_1.ToastProvider, { children: (0, jsx_runtime_1.
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Inner provider component that provides the actual B3Context
|
|
50
|
-
*/
|
|
51
|
-
function InnerProvider({ children, accountOverride, environment, defaultPermissions = DEFAULT_PERMISSIONS, automaticallySetFirstEoa, theme = "light", clientType = "socket", partnerId, stripePublishableKey, createClientReferenceId, enableTurnkey, }) {
|
|
52
|
-
const activeAccount = (0, react_3.useActiveAccount)();
|
|
53
|
-
const isAuthenticated = (0, react_1.useAuthStore)(state => state.isAuthenticated);
|
|
54
|
-
//const isConnected = useAuthStore(state => state.isConnected);
|
|
55
|
-
//const justCompletedLogin = useAuthStore(state => state.justCompletedLogin);
|
|
56
|
-
// Use given accountOverride or activeAccount from thirdweb
|
|
57
|
-
// WOJ: why if isAuthenticated is false, we don't use activeAccount, which should be undefined?
|
|
58
|
-
// skip isAuthenticated check ?
|
|
59
|
-
const effectiveAccount = isAuthenticated ? accountOverride || activeAccount : undefined;
|
|
60
|
-
// Wrapper to set active wallet via thirdweb
|
|
61
|
-
// Note: `wallet` in context is deprecated - use useActiveWallet() from thirdweb/react instead
|
|
62
|
-
// Auto-select first EOA wallet when enabled
|
|
63
|
-
(0, useAutoSelectWallet_1.useAutoSelectWallet)({
|
|
64
|
-
enabled: automaticallySetFirstEoa,
|
|
65
|
-
});
|
|
66
|
-
return ((0, jsx_runtime_1.jsx)(types_1.B3Context.Provider, { value: {
|
|
67
|
-
account: effectiveAccount,
|
|
68
|
-
// setWallet,
|
|
69
|
-
//wallet: undefined, // Deprecated: use useActiveWallet() from thirdweb/react instead
|
|
70
|
-
//user,
|
|
71
|
-
//setUser,
|
|
72
|
-
//refetchUser,
|
|
73
|
-
initialized: true,
|
|
74
|
-
ready: !!effectiveAccount,
|
|
75
|
-
automaticallySetFirstEoa,
|
|
76
|
-
environment,
|
|
77
|
-
defaultPermissions,
|
|
78
|
-
theme,
|
|
79
|
-
clientType,
|
|
80
|
-
partnerId: partnerId,
|
|
81
|
-
stripePublishableKey,
|
|
82
|
-
createClientReferenceId,
|
|
83
|
-
enableTurnkey,
|
|
84
|
-
}, children: children }));
|
|
67
|
+
return ((0, jsx_runtime_1.jsx)(react_3.ThirdwebProvider, { children: (0, jsx_runtime_1.jsx)(wagmi_1.WagmiProvider, { config: wagmiConfig, reconnectOnMount: false, children: (0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: queryClient, children: (0, jsx_runtime_1.jsx)(react_1.TooltipProvider, { children: (0, jsx_runtime_1.jsx)(index_1.ToastProvider, { children: (0, jsx_runtime_1.jsxs)(LocalSDKProvider_1.LocalSDKProvider, { onConnectCallback: onConnect, 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" })] }), (0, jsx_runtime_1.jsx)(AuthenticationProvider_1.default, { partnerId: partnerId, automaticallySetFirstEoa: !!automaticallySetFirstEoa })] }) }) }) }) }) }));
|
|
85
68
|
}
|
|
86
69
|
/**
|
|
87
70
|
* Component to connect the toast context to the global toast API
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { PermissionsConfig } from "../../../../global-account/types/permissions";
|
|
2
2
|
import { Account, Wallet } from "thirdweb/wallets";
|
|
3
3
|
import { ClientType } from "../../../client-manager";
|
|
4
|
-
import { B3ContextType } from "./types";
|
|
5
4
|
/**
|
|
6
5
|
* Main B3Provider component
|
|
7
6
|
*/
|
|
8
|
-
export declare function B3Provider({ theme, children, accountOverride, environment, clientType, partnerId, rpcUrls, onConnect, }: {
|
|
7
|
+
export declare function B3Provider({ theme, children, accountOverride, environment, clientType, partnerId, rpcUrls, onConnect, defaultPermissions, }: {
|
|
9
8
|
theme: "light" | "dark";
|
|
10
9
|
children: React.ReactNode;
|
|
11
10
|
accountOverride?: Account;
|
|
12
|
-
environment
|
|
11
|
+
environment?: "development" | "production";
|
|
13
12
|
clientType?: ClientType;
|
|
14
13
|
partnerId: string;
|
|
15
14
|
rpcUrls?: Record<number, string>;
|
|
16
15
|
onConnect?: (wallet: Wallet, b3Jwt: string) => void | Promise<void>;
|
|
16
|
+
defaultPermissions?: PermissionsConfig;
|
|
17
17
|
}): import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
/**
|
|
19
|
-
* Inner provider component
|
|
19
|
+
* Inner provider component for native
|
|
20
20
|
*/
|
|
21
21
|
export declare function InnerProvider({ children, accountOverride, environment, defaultPermissions, theme, clientType, partnerId, rpcUrls, }: {
|
|
22
22
|
children: React.ReactNode;
|
|
23
23
|
accountOverride?: Account;
|
|
24
|
-
environment
|
|
24
|
+
environment?: "development" | "production";
|
|
25
25
|
defaultPermissions?: PermissionsConfig;
|
|
26
26
|
theme: "light" | "dark";
|
|
27
27
|
clientType?: ClientType;
|
|
@@ -1,54 +1,57 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.B3Provider = B3Provider;
|
|
4
7
|
exports.InnerProvider = InnerProvider;
|
|
5
8
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
9
|
const react_query_1 = require("@tanstack/react-query");
|
|
7
|
-
const react_1 = require("
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
const react_2 = require("thirdweb/react");
|
|
8
12
|
const wagmi_1 = require("wagmi");
|
|
13
|
+
const configStore_1 = require("../../stores/configStore");
|
|
9
14
|
const createWagmiConfig_1 = require("../../utils/createWagmiConfig");
|
|
15
|
+
const AuthenticationProvider_1 = __importDefault(require("./AuthenticationProvider"));
|
|
10
16
|
const LocalSDKProvider_1 = require("./LocalSDKProvider");
|
|
11
|
-
const types_1 = require("./types");
|
|
12
|
-
/**
|
|
13
|
-
* Default permissions configuration for B3 provider
|
|
14
|
-
*/
|
|
15
|
-
const DEFAULT_PERMISSIONS = {
|
|
16
|
-
approvedTargets: ["0xa8e42121e318e3D3BeD7f5969AF6D360045317DD"], // Example contract
|
|
17
|
-
nativeTokenLimitPerTransaction: 0.1, // in ETH
|
|
18
|
-
startDate: new Date(),
|
|
19
|
-
endDate: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365), // 1 year from now
|
|
20
|
-
};
|
|
21
17
|
// Create queryClient instance
|
|
22
18
|
const queryClient = new react_query_1.QueryClient();
|
|
23
19
|
/**
|
|
24
20
|
* Main B3Provider component
|
|
25
21
|
*/
|
|
26
|
-
function B3Provider({ theme = "light", children, accountOverride, environment, clientType = "socket", partnerId, rpcUrls, onConnect, }) {
|
|
27
|
-
|
|
22
|
+
function B3Provider({ theme = "light", children, accountOverride, environment, clientType = "socket", partnerId, rpcUrls, onConnect, defaultPermissions, }) {
|
|
23
|
+
const setConfig = (0, configStore_1.useB3ConfigStore)(state => state.setConfig);
|
|
24
|
+
// Initialize config store on mount - props are static and never change
|
|
25
|
+
(0, react_1.useEffect)(() => {
|
|
26
|
+
setConfig({
|
|
27
|
+
accountOverride,
|
|
28
|
+
environment: environment ?? "development",
|
|
29
|
+
automaticallySetFirstEoa: false,
|
|
30
|
+
theme,
|
|
31
|
+
clientType,
|
|
32
|
+
partnerId,
|
|
33
|
+
defaultPermissions,
|
|
34
|
+
});
|
|
35
|
+
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
36
|
+
return ((0, jsx_runtime_1.jsx)(react_2.ThirdwebProvider, { children: (0, jsx_runtime_1.jsxs)(LocalSDKProvider_1.LocalSDKProvider, { onConnectCallback: onConnect, children: [children, (0, jsx_runtime_1.jsx)(AuthenticationProvider_1.default, { partnerId: partnerId, automaticallySetFirstEoa: false })] }) }));
|
|
28
37
|
}
|
|
29
38
|
/**
|
|
30
|
-
* Inner provider component
|
|
39
|
+
* Inner provider component for native
|
|
31
40
|
*/
|
|
32
|
-
function InnerProvider({ children, accountOverride, environment, defaultPermissions
|
|
33
|
-
const
|
|
34
|
-
//const { user, setUser, refetchUser } = useAuthentication(partnerId);
|
|
41
|
+
function InnerProvider({ children, accountOverride, environment, defaultPermissions, theme = "light", clientType = "socket", partnerId, rpcUrls, }) {
|
|
42
|
+
const setConfig = (0, configStore_1.useB3ConfigStore)(state => state.setConfig);
|
|
35
43
|
const wagmiConfig = (0, createWagmiConfig_1.createWagmiConfig)({ partnerId, rpcUrls });
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
theme,
|
|
50
|
-
clientType,
|
|
51
|
-
partnerId,
|
|
52
|
-
//refetchUser,
|
|
53
|
-
}, children: children }) }) }));
|
|
44
|
+
// Initialize config store on mount - props are static and never change
|
|
45
|
+
(0, react_1.useEffect)(() => {
|
|
46
|
+
setConfig({
|
|
47
|
+
accountOverride,
|
|
48
|
+
environment: environment ?? "development",
|
|
49
|
+
automaticallySetFirstEoa: false,
|
|
50
|
+
theme,
|
|
51
|
+
clientType,
|
|
52
|
+
partnerId,
|
|
53
|
+
defaultPermissions,
|
|
54
|
+
});
|
|
55
|
+
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
56
|
+
return ((0, jsx_runtime_1.jsx)(wagmi_1.WagmiProvider, { config: wagmiConfig, children: (0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: queryClient, children: children }) }));
|
|
54
57
|
}
|
|
@@ -14,6 +14,8 @@ function RelayKitProviderWrapper({ children, simDuneApiKey, }) {
|
|
|
14
14
|
};
|
|
15
15
|
fetchChains();
|
|
16
16
|
}, []);
|
|
17
|
+
const isTurnkeyPrimary = process.env.NEXT_PUBLIC_TURNKEY_PRIMARY === "true";
|
|
18
|
+
const appName = isTurnkeyPrimary ? "Smart Wallet" : "AnySpend";
|
|
17
19
|
return ((0, jsx_runtime_1.jsx)(relay_kit_ui_1.RelayKitProvider, { options: {
|
|
18
20
|
baseApiUrl: relay_sdk_1.MAINNET_RELAY_API,
|
|
19
21
|
source: "anyspend",
|
|
@@ -23,7 +25,7 @@ function RelayKitProviderWrapper({ children, simDuneApiKey, }) {
|
|
|
23
25
|
},
|
|
24
26
|
chains: relayChains,
|
|
25
27
|
privateChainIds: undefined,
|
|
26
|
-
appName
|
|
28
|
+
appName,
|
|
27
29
|
useGasFeeEstimations: true,
|
|
28
30
|
}, children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }) }));
|
|
29
31
|
}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Hook to access the B3
|
|
3
|
-
* @
|
|
4
|
-
* @deprecated Use useB3Config or useB3Account instead
|
|
2
|
+
* Hook to access the B3 configuration
|
|
3
|
+
* @deprecated This is just an alias for useB3Config. Use useB3Config directly instead.
|
|
5
4
|
*/
|
|
6
|
-
export declare function useB3():
|
|
5
|
+
export declare function useB3(): {
|
|
6
|
+
automaticallySetFirstEoa: boolean;
|
|
7
|
+
environment: "development" | "production";
|
|
8
|
+
theme: "light" | "dark";
|
|
9
|
+
clientType: import("../../../client-manager").ClientType;
|
|
10
|
+
partnerId: string;
|
|
11
|
+
createClientReferenceId: ((params: import("../../../../anyspend/react").CreateOrderParams | import("../../../../anyspend/react").CreateOnrampOrderParams) => Promise<string>) | undefined;
|
|
12
|
+
enableTurnkey: boolean;
|
|
13
|
+
stripePublishableKey: string | undefined;
|
|
14
|
+
defaultPermissions: import("../../../types/permissions").PermissionsConfig;
|
|
15
|
+
accountOverride: import("thirdweb/wallets").Account | undefined;
|
|
16
|
+
};
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useB3 = useB3;
|
|
4
|
-
const
|
|
5
|
-
const types_1 = require("./types");
|
|
4
|
+
const useB3Config_1 = require("./useB3Config");
|
|
6
5
|
/**
|
|
7
|
-
* Hook to access the B3
|
|
8
|
-
* @
|
|
9
|
-
* @deprecated Use useB3Config or useB3Account instead
|
|
6
|
+
* Hook to access the B3 configuration
|
|
7
|
+
* @deprecated This is just an alias for useB3Config. Use useB3Config directly instead.
|
|
10
8
|
*/
|
|
11
9
|
function useB3() {
|
|
12
|
-
|
|
13
|
-
if (!context.initialized) {
|
|
14
|
-
throw new Error("useB3 must be used within a B3Provider");
|
|
15
|
-
}
|
|
16
|
-
// Return a stable reference
|
|
17
|
-
return (0, react_1.useMemo)(() => context, [context]);
|
|
10
|
+
return (0, useB3Config_1.useB3Config)();
|
|
18
11
|
}
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useB3Account = void 0;
|
|
4
4
|
const react_1 = require("thirdweb/react");
|
|
5
|
+
const useAuthStore_1 = require("../../stores/useAuthStore");
|
|
5
6
|
// Wrapper around useActiveAccount
|
|
6
7
|
const useB3Account = () => {
|
|
7
|
-
const
|
|
8
|
-
|
|
8
|
+
const isAuthenticated = (0, useAuthStore_1.useAuthStore)(state => state.isAuthenticated);
|
|
9
|
+
const activeAccount = (0, react_1.useActiveAccount)();
|
|
10
|
+
const effectiveAccount = isAuthenticated ? activeAccount : undefined;
|
|
11
|
+
return effectiveAccount;
|
|
9
12
|
};
|
|
10
13
|
exports.useB3Account = useB3Account;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to access B3 configuration
|
|
3
|
+
* Returns all config values from the Zustand store
|
|
4
|
+
* Since config is static (set once at initialization), destructuring is fine here
|
|
5
|
+
*/
|
|
1
6
|
export declare const useB3Config: () => {
|
|
2
7
|
automaticallySetFirstEoa: boolean;
|
|
3
|
-
environment: "development" | "production"
|
|
8
|
+
environment: "development" | "production";
|
|
4
9
|
theme: "light" | "dark";
|
|
5
10
|
clientType: import("../../../client-manager").ClientType;
|
|
6
11
|
partnerId: string;
|
|
7
12
|
createClientReferenceId: ((params: import("../../../../anyspend/react").CreateOrderParams | import("../../../../anyspend/react").CreateOnrampOrderParams) => Promise<string>) | undefined;
|
|
8
|
-
enableTurnkey: boolean
|
|
13
|
+
enableTurnkey: boolean;
|
|
14
|
+
stripePublishableKey: string | undefined;
|
|
15
|
+
defaultPermissions: import("../../../types/permissions").PermissionsConfig;
|
|
16
|
+
accountOverride: import("thirdweb/wallets").Account | undefined;
|
|
9
17
|
};
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useB3Config = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
const configStore_1 = require("../../stores/configStore");
|
|
5
|
+
/**
|
|
6
|
+
* Hook to access B3 configuration
|
|
7
|
+
* Returns all config values from the Zustand store
|
|
8
|
+
* Since config is static (set once at initialization), destructuring is fine here
|
|
9
|
+
*/
|
|
6
10
|
const useB3Config = () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
createClientReferenceId,
|
|
20
|
-
enableTurnkey,
|
|
21
|
-
}), [automaticallySetFirstEoa, environment, theme, clientType, partnerId, createClientReferenceId, enableTurnkey]);
|
|
11
|
+
return (0, configStore_1.useB3ConfigStore)(state => ({
|
|
12
|
+
automaticallySetFirstEoa: state.automaticallySetFirstEoa,
|
|
13
|
+
environment: state.environment,
|
|
14
|
+
theme: state.theme,
|
|
15
|
+
clientType: state.clientType,
|
|
16
|
+
partnerId: state.partnerId,
|
|
17
|
+
createClientReferenceId: state.createClientReferenceId,
|
|
18
|
+
enableTurnkey: state.enableTurnkey,
|
|
19
|
+
stripePublishableKey: state.stripePublishableKey,
|
|
20
|
+
defaultPermissions: state.defaultPermissions,
|
|
21
|
+
accountOverride: state.accountOverride,
|
|
22
|
+
}));
|
|
22
23
|
};
|
|
23
24
|
exports.useB3Config = useB3Config;
|
|
@@ -17,8 +17,7 @@ const ProfileSection = () => {
|
|
|
17
17
|
address: eoaAddress || account?.address,
|
|
18
18
|
fresh: true,
|
|
19
19
|
});
|
|
20
|
-
const {
|
|
21
|
-
const { user } = (0, react_1.useAuthentication)(partnerId);
|
|
20
|
+
const { user } = (0, react_1.useUser)();
|
|
22
21
|
const setB3ModalOpen = (0, react_1.useModalStore)(state => state.setB3ModalOpen);
|
|
23
22
|
const setB3ModalContentType = (0, react_1.useModalStore)(state => state.setB3ModalContentType);
|
|
24
23
|
const navigateBack = (0, react_1.useModalStore)(state => state.navigateBack);
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DiscordChannel = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("../../../../../global-account/react");
|
|
5
6
|
const debug_1 = require("../../../../../shared/utils/debug");
|
|
6
|
-
const
|
|
7
|
+
const react_2 = require("react");
|
|
7
8
|
const notificationsAPI_1 = require("../../../utils/notificationsAPI");
|
|
8
|
-
const useB3_1 = require("../../B3Provider/useB3");
|
|
9
9
|
const toastApi_1 = require("../../Toast/toastApi");
|
|
10
10
|
const NotificationChannel_1 = require("../NotificationChannel");
|
|
11
11
|
const debug = (0, debug_1.debugB3React)("DiscordChannel");
|
|
12
12
|
const DiscordChannel = ({ userId, jwtToken, discordChannel, isConnected, isOptimisticallyConnected, onConnectionChange, onToggle, }) => {
|
|
13
|
-
const { partnerId } = (0,
|
|
14
|
-
const [discordId, setDiscordId] = (0,
|
|
15
|
-
const [isConnecting, setIsConnecting] = (0,
|
|
16
|
-
const [showInput, setShowInput] = (0,
|
|
13
|
+
const { partnerId } = (0, react_1.useB3Config)();
|
|
14
|
+
const [discordId, setDiscordId] = (0, react_2.useState)("");
|
|
15
|
+
const [isConnecting, setIsConnecting] = (0, react_2.useState)(false);
|
|
16
|
+
const [showInput, setShowInput] = (0, react_2.useState)(false);
|
|
17
17
|
// Detect if we're disconnecting
|
|
18
18
|
const isDisconnecting = isConnected && !isOptimisticallyConnected;
|
|
19
19
|
const handleConnect = async () => {
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EmailChannel = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("../../../../../global-account/react");
|
|
5
6
|
const debug_1 = require("../../../../../shared/utils/debug");
|
|
6
|
-
const
|
|
7
|
+
const react_2 = require("react");
|
|
7
8
|
const notificationsAPI_1 = require("../../../utils/notificationsAPI");
|
|
8
|
-
const useB3_1 = require("../../B3Provider/useB3");
|
|
9
9
|
const toastApi_1 = require("../../Toast/toastApi");
|
|
10
10
|
const NotificationChannel_1 = require("../NotificationChannel");
|
|
11
11
|
const debug = (0, debug_1.debugB3React)("EmailChannel");
|
|
@@ -14,11 +14,11 @@ const validateEmail = (email) => {
|
|
|
14
14
|
return emailRegex.test(email);
|
|
15
15
|
};
|
|
16
16
|
const EmailChannel = ({ userId, jwtToken, emailChannel, isConnected, isOptimisticallyConnected, onConnectionChange, onToggle, }) => {
|
|
17
|
-
const { partnerId } = (0,
|
|
18
|
-
const [email, setEmail] = (0,
|
|
19
|
-
const [emailError, setEmailError] = (0,
|
|
20
|
-
const [isConnecting, setIsConnecting] = (0,
|
|
21
|
-
const [showInput, setShowInput] = (0,
|
|
17
|
+
const { partnerId } = (0, react_1.useB3Config)();
|
|
18
|
+
const [email, setEmail] = (0, react_2.useState)("");
|
|
19
|
+
const [emailError, setEmailError] = (0, react_2.useState)(null);
|
|
20
|
+
const [isConnecting, setIsConnecting] = (0, react_2.useState)(false);
|
|
21
|
+
const [showInput, setShowInput] = (0, react_2.useState)(false);
|
|
22
22
|
// Detect if we're disconnecting by comparing real vs optimistic state
|
|
23
23
|
const isDisconnecting = isConnected && !isOptimisticallyConnected;
|
|
24
24
|
const handleConnect = async () => {
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PhoneChannel = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("../../../../../global-account/react");
|
|
5
6
|
const debug_1 = require("../../../../../shared/utils/debug");
|
|
6
|
-
const
|
|
7
|
+
const react_2 = require("react");
|
|
7
8
|
const notificationsAPI_1 = require("../../../utils/notificationsAPI");
|
|
8
|
-
const useB3_1 = require("../../B3Provider/useB3");
|
|
9
9
|
const toastApi_1 = require("../../Toast/toastApi");
|
|
10
10
|
const NotificationChannel_1 = require("../NotificationChannel");
|
|
11
11
|
const debug = (0, debug_1.debugB3React)("PhoneChannel");
|
|
12
12
|
const PhoneChannel = ({ userId, jwtToken, smsChannel, whatsappChannel, isSMSConnected, isWhatsAppConnected, isOptimisticallySMSConnected, isOptimisticallyWhatsAppConnected, onConnectionChange, onToggle, }) => {
|
|
13
|
-
const { partnerId } = (0,
|
|
14
|
-
const [phoneNumber, setPhoneNumber] = (0,
|
|
15
|
-
const [isConnectingSMS, setIsConnectingSMS] = (0,
|
|
16
|
-
const [isConnectingWhatsApp, setIsConnectingWhatsApp] = (0,
|
|
17
|
-
const [showInput, setShowInput] = (0,
|
|
13
|
+
const { partnerId } = (0, react_1.useB3Config)();
|
|
14
|
+
const [phoneNumber, setPhoneNumber] = (0, react_2.useState)("");
|
|
15
|
+
const [isConnectingSMS, setIsConnectingSMS] = (0, react_2.useState)(false);
|
|
16
|
+
const [isConnectingWhatsApp, setIsConnectingWhatsApp] = (0, react_2.useState)(false);
|
|
17
|
+
const [showInput, setShowInput] = (0, react_2.useState)(false);
|
|
18
18
|
// Detect if we're disconnecting
|
|
19
19
|
const isDisconnecting = (isSMSConnected && !isOptimisticallySMSConnected) || (isWhatsAppConnected && !isOptimisticallyWhatsAppConnected);
|
|
20
20
|
const handleConnectSMS = async () => {
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TelegramChannel = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("../../../../../global-account/react");
|
|
5
6
|
const debug_1 = require("../../../../../shared/utils/debug");
|
|
6
|
-
const
|
|
7
|
+
const react_2 = require("react");
|
|
7
8
|
const notificationsAPI_1 = require("../../../utils/notificationsAPI");
|
|
8
|
-
const useB3_1 = require("../../B3Provider/useB3");
|
|
9
9
|
const toastApi_1 = require("../../Toast/toastApi");
|
|
10
10
|
const NotificationChannel_1 = require("../NotificationChannel");
|
|
11
11
|
const debug = (0, debug_1.debugB3React)("TelegramChannel");
|
|
12
12
|
const TelegramChannel = ({ userId, jwtToken, telegramChannel, isConnected, isOptimisticallyConnected, onConnectionChange, onToggle, }) => {
|
|
13
|
-
const { partnerId } = (0,
|
|
14
|
-
const [isConnecting, setIsConnecting] = (0,
|
|
15
|
-
const [status, setStatus] = (0,
|
|
13
|
+
const { partnerId } = (0, react_1.useB3Config)();
|
|
14
|
+
const [isConnecting, setIsConnecting] = (0, react_2.useState)(false);
|
|
15
|
+
const [status, setStatus] = (0, react_2.useState)("idle");
|
|
16
16
|
// Detect if we're disconnecting
|
|
17
17
|
const isDisconnecting = isConnected && !isOptimisticallyConnected;
|
|
18
18
|
const handleConnect = async () => {
|
|
@@ -6,23 +6,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.RequestPermissions = RequestPermissions;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = require("../../../../global-account/react");
|
|
9
|
-
const react_2 = require("../../../../global-account/react");
|
|
10
9
|
const debug_1 = require("../../../../shared/utils/debug");
|
|
11
10
|
const formatAddress_1 = require("../../../../shared/utils/formatAddress");
|
|
12
11
|
const lucide_react_1 = require("lucide-react");
|
|
13
|
-
const
|
|
12
|
+
const react_2 = require("react");
|
|
14
13
|
const react_timeago_1 = __importDefault(require("react-timeago"));
|
|
15
|
-
const
|
|
14
|
+
const react_3 = require("thirdweb/react");
|
|
16
15
|
const debug = (0, debug_1.debugB3React)("RequestPermissions");
|
|
17
16
|
/**
|
|
18
17
|
* Component for requesting permissions to access user accounts and contracts
|
|
19
18
|
* Allows users to approve session keys with specific permission settings
|
|
20
19
|
*/
|
|
21
20
|
function RequestPermissions({ onSuccess, onError, chain, sessionKeyAddress, permissions, }) {
|
|
22
|
-
const [isApproving, setIsApproving] = (0,
|
|
23
|
-
const account = (0,
|
|
24
|
-
const { defaultPermissions } = (0, react_1.
|
|
25
|
-
const DEFAULT_PERMISSIONS = (0,
|
|
21
|
+
const [isApproving, setIsApproving] = (0, react_2.useState)(false);
|
|
22
|
+
const account = (0, react_3.useActiveAccount)();
|
|
23
|
+
const { defaultPermissions } = (0, react_1.useB3Config)();
|
|
24
|
+
const DEFAULT_PERMISSIONS = (0, react_2.useMemo)(() => permissions ?? defaultPermissions, [defaultPermissions, permissions]);
|
|
26
25
|
const { refetch: refetchSigners } = (0, react_1.useGetAllTWSigners)({
|
|
27
26
|
chain,
|
|
28
27
|
accountAddress: account?.address,
|
|
@@ -41,7 +40,7 @@ function RequestPermissions({ onSuccess, onError, chain, sessionKeyAddress, perm
|
|
|
41
40
|
},
|
|
42
41
|
chain,
|
|
43
42
|
});
|
|
44
|
-
const handleApprove = (0,
|
|
43
|
+
const handleApprove = (0, react_2.useCallback)(async () => {
|
|
45
44
|
debug("@@handleApprove");
|
|
46
45
|
try {
|
|
47
46
|
setIsApproving(true);
|
|
@@ -71,7 +70,7 @@ function RequestPermissions({ onSuccess, onError, chain, sessionKeyAddress, perm
|
|
|
71
70
|
timeStyle: "short",
|
|
72
71
|
}).format(date);
|
|
73
72
|
};
|
|
74
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("h2", { className: "mb-2 text-2xl font-bold", children: "Allow Access" }), (0, jsx_runtime_1.jsx)("p", { className: "text-b3-react-muted-foreground opacity-70", children: "This app would like permission to:" })] }), (0, jsx_runtime_1.jsx)(
|
|
73
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("h2", { className: "mb-2 text-2xl font-bold", children: "Allow Access" }), (0, jsx_runtime_1.jsx)("p", { className: "text-b3-react-muted-foreground opacity-70", children: "This app would like permission to:" })] }), (0, jsx_runtime_1.jsx)(react_1.PermissionItem, { title: "Make transactions on your behalf", description: (0, jsx_runtime_1.jsxs)("span", { children: ["Up to", " ", (0, jsx_runtime_1.jsxs)("span", { className: "text-b3-react-primary font-medium", children: [DEFAULT_PERMISSIONS.nativeTokenLimitPerTransaction, " ETH"] }), " ", "per transaction"] }), icon: (0, jsx_runtime_1.jsx)(lucide_react_1.CreditCard, { className: "h-5 w-5" }) }), (0, jsx_runtime_1.jsx)(react_1.PermissionItem, { title: "View your account", description: "See your wallet address and balance", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Eye, { className: "h-5 w-5" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-b3-react-card rounded-lg border p-5 py-4", children: [(0, jsx_runtime_1.jsx)("h3", { className: "mb-2 text-base font-medium", children: "Approved Contracts" }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-2", children: DEFAULT_PERMISSIONS.approvedTargets.map((target) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-react-background text-b3-react-muted-foreground rounded-md border px-3 py-2 font-mono text-sm", children: (0, formatAddress_1.formatAddress)(target) }), (0, jsx_runtime_1.jsx)("span", { className: "text-b3-react-muted-foreground text-sm", children: "\u2022 Game Contract" })] }, target))) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-b3-react-card rounded-lg border p-5 py-4", children: [(0, jsx_runtime_1.jsx)("h3", { className: "mb-2 text-base font-medium", children: "Permission" }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-1 text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-b3-react-muted-foreground", children: [(0, jsx_runtime_1.jsx)("span", { children: `Valid for ` }), (0, jsx_runtime_1.jsx)("span", { children: (0, jsx_runtime_1.jsx)(react_timeago_1.default, { date: DEFAULT_PERMISSIONS.endDate, live: false, formatter: (value, unit) => {
|
|
75
74
|
if (unit === "year") {
|
|
76
75
|
return "1 year";
|
|
77
76
|
}
|
|
@@ -15,7 +15,7 @@ const react_4 = require("thirdweb/react");
|
|
|
15
15
|
const ManageAccountButton_1 = require("../custom/ManageAccountButton");
|
|
16
16
|
function SignIn(props) {
|
|
17
17
|
const { className } = props;
|
|
18
|
-
const { automaticallySetFirstEoa, partnerId } = (0, react_1.
|
|
18
|
+
const { automaticallySetFirstEoa, partnerId } = (0, react_1.useB3Config)();
|
|
19
19
|
const { address: globalAddress, ensName, connectedSmartWallet, connectedEOAWallet, isActiveSmartWallet, isActiveEOAWallet, smartWalletIcon, } = (0, react_1.useAccountWallet)();
|
|
20
20
|
const { data: walletImage } = (0, react_4.useWalletImage)(connectedEOAWallet?.id);
|
|
21
21
|
const isMobile = (0, react_1.useIsMobile)();
|