@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.
Files changed (281) hide show
  1. package/dist/cjs/anyspend/constants/index.d.ts +0 -2
  2. package/dist/cjs/anyspend/constants/index.js +1 -3
  3. package/dist/cjs/anyspend/index.d.ts +0 -2
  4. package/dist/cjs/anyspend/index.js +0 -3
  5. package/dist/cjs/anyspend/react/components/AnySpend.d.ts +0 -6
  6. package/dist/cjs/anyspend/react/components/AnySpend.js +6 -9
  7. package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +1 -5
  8. package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
  9. package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +0 -1
  10. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +3 -3
  11. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +0 -6
  12. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +20 -24
  13. package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +1 -7
  14. package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +3 -3
  15. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +0 -4
  16. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +1 -14
  17. package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.d.ts +1 -3
  18. package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +2 -3
  19. package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +0 -4
  20. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +6 -34
  21. package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +1 -3
  22. package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +2 -3
  23. package/dist/cjs/anyspend/react/components/common/PaymentStripeWeb2.js +4 -3
  24. package/dist/cjs/anyspend/react/hooks/index.d.ts +0 -1
  25. package/dist/cjs/anyspend/react/hooks/index.js +0 -1
  26. package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +1 -1
  27. package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.js +1 -1
  28. package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.js +1 -1
  29. package/dist/cjs/anyspend/react/hooks/useValidatedClientReferenceId.js +1 -1
  30. package/dist/cjs/global-account/react/components/B3DynamicModal.js +3 -2
  31. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +18 -2
  32. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +57 -35
  33. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
  34. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +35 -38
  35. package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +1 -3
  36. package/dist/cjs/global-account/react/components/B3Provider/types.d.ts +27 -0
  37. package/dist/cjs/global-account/react/components/B3Provider/types.js +24 -0
  38. package/dist/cjs/global-account/react/components/B3Provider/useB3.d.ts +4 -14
  39. package/dist/cjs/global-account/react/components/B3Provider/useB3.js +11 -4
  40. package/dist/cjs/global-account/react/components/B3Provider/useB3Account.js +2 -5
  41. package/dist/cjs/global-account/react/components/B3Provider/useB3Config.d.ts +2 -10
  42. package/dist/cjs/global-account/react/components/B3Provider/useB3Config.js +17 -18
  43. package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +2 -1
  44. package/dist/cjs/global-account/react/components/ManageAccount/channels/DiscordChannel.js +6 -6
  45. package/dist/cjs/global-account/react/components/ManageAccount/channels/EmailChannel.js +7 -7
  46. package/dist/cjs/global-account/react/components/ManageAccount/channels/PhoneChannel.js +7 -7
  47. package/dist/cjs/global-account/react/components/ManageAccount/channels/TelegramChannel.js +5 -5
  48. package/dist/cjs/global-account/react/components/RequestPermissions/RequestPermissions.js +9 -8
  49. package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +1 -1
  50. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +20 -76
  51. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +1 -1
  52. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStep.js +1 -1
  53. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +1 -1
  54. package/dist/cjs/global-account/react/components/StyleRoot.js +3 -3
  55. package/dist/cjs/global-account/react/components/TurnkeyAuthModal.js +1 -3
  56. package/dist/cjs/global-account/react/components/custom/ManageAccountButton.js +2 -1
  57. package/dist/cjs/global-account/react/components/index.d.ts +2 -1
  58. package/dist/cjs/global-account/react/components/index.js +6 -3
  59. package/dist/cjs/global-account/react/hooks/index.d.ts +0 -2
  60. package/dist/cjs/global-account/react/hooks/index.js +1 -5
  61. package/dist/cjs/global-account/react/hooks/useClient.js +1 -1
  62. package/dist/cjs/global-account/react/hooks/useHandleConnectWithPrivy.js +1 -1
  63. package/dist/cjs/global-account/react/hooks/useNotifications.js +14 -14
  64. package/dist/cjs/global-account/react/hooks/useTWAuth.d.ts +0 -3
  65. package/dist/cjs/global-account/react/hooks/useTWAuth.js +0 -8
  66. package/dist/cjs/global-account/react/hooks/useTokenBalance.js +5 -5
  67. package/dist/cjs/global-account/react/hooks/useTokenBalancesByChain.js +2 -4
  68. package/dist/cjs/global-account/react/hooks/useTurnkeyAuth.js +22 -50
  69. package/dist/cjs/global-account/react/hooks/useUserQuery.js +35 -9
  70. package/dist/cjs/global-account/react/index.native.d.ts +2 -0
  71. package/dist/cjs/global-account/react/index.native.js +5 -1
  72. package/dist/cjs/global-account/react/stores/index.d.ts +0 -1
  73. package/dist/cjs/global-account/react/stores/index.js +1 -3
  74. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +0 -10
  75. package/dist/esm/anyspend/constants/index.d.ts +0 -2
  76. package/dist/esm/anyspend/constants/index.js +0 -2
  77. package/dist/esm/anyspend/index.d.ts +0 -2
  78. package/dist/esm/anyspend/index.js +0 -3
  79. package/dist/esm/anyspend/react/components/AnySpend.d.ts +0 -6
  80. package/dist/esm/anyspend/react/components/AnySpend.js +8 -11
  81. package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +1 -5
  82. package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
  83. package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +0 -1
  84. package/dist/esm/anyspend/react/components/AnySpendCustom.js +3 -3
  85. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +0 -6
  86. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +4 -8
  87. package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +1 -7
  88. package/dist/esm/anyspend/react/components/AnySpendDeposit.js +3 -3
  89. package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +0 -4
  90. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +1 -14
  91. package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +1 -3
  92. package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +2 -3
  93. package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +0 -4
  94. package/dist/esm/anyspend/react/components/common/OrderDetails.js +8 -36
  95. package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +1 -3
  96. package/dist/esm/anyspend/react/components/common/PanelOnramp.js +2 -3
  97. package/dist/esm/anyspend/react/components/common/PaymentStripeWeb2.js +4 -3
  98. package/dist/esm/anyspend/react/hooks/index.d.ts +0 -1
  99. package/dist/esm/anyspend/react/hooks/index.js +0 -1
  100. package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +2 -2
  101. package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.js +2 -2
  102. package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.js +2 -2
  103. package/dist/esm/anyspend/react/hooks/useValidatedClientReferenceId.js +2 -2
  104. package/dist/esm/global-account/react/components/B3DynamicModal.js +4 -3
  105. package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +18 -2
  106. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +58 -34
  107. package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
  108. package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +36 -36
  109. package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +1 -3
  110. package/dist/esm/global-account/react/components/B3Provider/types.d.ts +27 -0
  111. package/dist/esm/global-account/react/components/B3Provider/types.js +21 -0
  112. package/dist/esm/global-account/react/components/B3Provider/useB3.d.ts +4 -14
  113. package/dist/esm/global-account/react/components/B3Provider/useB3.js +11 -4
  114. package/dist/esm/global-account/react/components/B3Provider/useB3Account.js +2 -5
  115. package/dist/esm/global-account/react/components/B3Provider/useB3Config.d.ts +2 -10
  116. package/dist/esm/global-account/react/components/B3Provider/useB3Config.js +17 -18
  117. package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +3 -2
  118. package/dist/esm/global-account/react/components/ManageAccount/channels/DiscordChannel.js +2 -2
  119. package/dist/esm/global-account/react/components/ManageAccount/channels/EmailChannel.js +2 -2
  120. package/dist/esm/global-account/react/components/ManageAccount/channels/PhoneChannel.js +2 -2
  121. package/dist/esm/global-account/react/components/ManageAccount/channels/TelegramChannel.js +2 -2
  122. package/dist/esm/global-account/react/components/RequestPermissions/RequestPermissions.js +3 -2
  123. package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +2 -2
  124. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +20 -76
  125. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +2 -2
  126. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStep.js +2 -2
  127. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +2 -2
  128. package/dist/esm/global-account/react/components/StyleRoot.js +3 -3
  129. package/dist/esm/global-account/react/components/TurnkeyAuthModal.js +3 -5
  130. package/dist/esm/global-account/react/components/custom/ManageAccountButton.js +3 -2
  131. package/dist/esm/global-account/react/components/index.d.ts +2 -1
  132. package/dist/esm/global-account/react/components/index.js +2 -1
  133. package/dist/esm/global-account/react/hooks/index.d.ts +0 -2
  134. package/dist/esm/global-account/react/hooks/index.js +0 -2
  135. package/dist/esm/global-account/react/hooks/useClient.js +2 -2
  136. package/dist/esm/global-account/react/hooks/useHandleConnectWithPrivy.js +2 -2
  137. package/dist/esm/global-account/react/hooks/useNotifications.js +2 -2
  138. package/dist/esm/global-account/react/hooks/useTWAuth.d.ts +0 -3
  139. package/dist/esm/global-account/react/hooks/useTWAuth.js +0 -8
  140. package/dist/esm/global-account/react/hooks/useTokenBalance.js +6 -6
  141. package/dist/esm/global-account/react/hooks/useTokenBalancesByChain.js +2 -4
  142. package/dist/esm/global-account/react/hooks/useTurnkeyAuth.js +22 -50
  143. package/dist/esm/global-account/react/hooks/useUserQuery.js +27 -1
  144. package/dist/esm/global-account/react/index.native.d.ts +2 -0
  145. package/dist/esm/global-account/react/index.native.js +2 -0
  146. package/dist/esm/global-account/react/stores/index.d.ts +0 -1
  147. package/dist/esm/global-account/react/stores/index.js +0 -1
  148. package/dist/esm/global-account/react/stores/useModalStore.d.ts +0 -10
  149. package/dist/styles/index.css +1 -1
  150. package/dist/types/anyspend/constants/index.d.ts +0 -2
  151. package/dist/types/anyspend/index.d.ts +0 -2
  152. package/dist/types/anyspend/react/components/AnySpend.d.ts +0 -6
  153. package/dist/types/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +1 -5
  154. package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +0 -1
  155. package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +0 -6
  156. package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +1 -7
  157. package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +0 -4
  158. package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +1 -3
  159. package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +0 -4
  160. package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +1 -3
  161. package/dist/types/anyspend/react/hooks/index.d.ts +0 -1
  162. package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +18 -2
  163. package/dist/types/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
  164. package/dist/types/global-account/react/components/B3Provider/types.d.ts +27 -0
  165. package/dist/types/global-account/react/components/B3Provider/useB3.d.ts +4 -14
  166. package/dist/types/global-account/react/components/B3Provider/useB3Config.d.ts +2 -10
  167. package/dist/types/global-account/react/components/index.d.ts +2 -1
  168. package/dist/types/global-account/react/hooks/index.d.ts +0 -2
  169. package/dist/types/global-account/react/hooks/useTWAuth.d.ts +0 -3
  170. package/dist/types/global-account/react/index.native.d.ts +2 -0
  171. package/dist/types/global-account/react/stores/index.d.ts +0 -1
  172. package/dist/types/global-account/react/stores/useModalStore.d.ts +0 -10
  173. package/package.json +1 -1
  174. package/src/anyspend/constants/index.ts +0 -3
  175. package/src/anyspend/index.ts +0 -4
  176. package/src/anyspend/react/components/AnySpend.tsx +2 -28
  177. package/src/anyspend/react/components/AnySpendCollectorClubPurchase.tsx +0 -6
  178. package/src/anyspend/react/components/AnySpendCustom.tsx +47 -52
  179. package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +0 -23
  180. package/src/anyspend/react/components/AnySpendDeposit.tsx +1 -18
  181. package/src/anyspend/react/components/AnyspendDepositHype.tsx +0 -4
  182. package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +1 -15
  183. package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +1 -5
  184. package/src/anyspend/react/components/common/OrderDetails.tsx +42 -60
  185. package/src/anyspend/react/components/common/PanelOnramp.tsx +1 -5
  186. package/src/anyspend/react/components/common/PaymentStripeWeb2.tsx +4 -3
  187. package/src/anyspend/react/hooks/index.ts +0 -1
  188. package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +2 -2
  189. package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +2 -2
  190. package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +2 -2
  191. package/src/anyspend/react/hooks/useValidatedClientReferenceId.ts +2 -2
  192. package/src/global-account/react/components/B3DynamicModal.tsx +4 -3
  193. package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +54 -43
  194. package/src/global-account/react/components/B3Provider/B3Provider.tsx +117 -44
  195. package/src/global-account/react/components/B3Provider/RelayKitProviderWrapper.tsx +1 -4
  196. package/src/global-account/react/components/B3Provider/types.ts +50 -0
  197. package/src/global-account/react/components/B3Provider/useB3.ts +13 -4
  198. package/src/global-account/react/components/B3Provider/useB3Account.ts +2 -6
  199. package/src/global-account/react/components/B3Provider/useB3Config.ts +31 -18
  200. package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +4 -2
  201. package/src/global-account/react/components/ManageAccount/channels/DiscordChannel.tsx +2 -2
  202. package/src/global-account/react/components/ManageAccount/channels/EmailChannel.tsx +2 -2
  203. package/src/global-account/react/components/ManageAccount/channels/PhoneChannel.tsx +2 -2
  204. package/src/global-account/react/components/ManageAccount/channels/TelegramChannel.tsx +2 -2
  205. package/src/global-account/react/components/RequestPermissions/RequestPermissions.tsx +4 -4
  206. package/src/global-account/react/components/SignInWithB3/SignIn.tsx +2 -2
  207. package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +100 -168
  208. package/src/global-account/react/components/SignInWithB3/SignInWithB3Privy.tsx +2 -2
  209. package/src/global-account/react/components/SignInWithB3/steps/LoginStep.tsx +2 -2
  210. package/src/global-account/react/components/SignInWithB3/steps/LoginStepCustom.tsx +2 -2
  211. package/src/global-account/react/components/StyleRoot.tsx +3 -3
  212. package/src/global-account/react/components/TurnkeyAuthModal.tsx +4 -7
  213. package/src/global-account/react/components/custom/ManageAccountButton.tsx +3 -2
  214. package/src/global-account/react/components/index.ts +2 -1
  215. package/src/global-account/react/hooks/index.ts +0 -2
  216. package/src/global-account/react/hooks/useClient.ts +2 -2
  217. package/src/global-account/react/hooks/useHandleConnectWithPrivy.tsx +2 -2
  218. package/src/global-account/react/hooks/useNotifications.ts +2 -2
  219. package/src/global-account/react/hooks/useTWAuth.tsx +0 -10
  220. package/src/global-account/react/hooks/useTokenBalance.tsx +7 -8
  221. package/src/global-account/react/hooks/useTokenBalancesByChain.tsx +2 -4
  222. package/src/global-account/react/hooks/useTurnkeyAuth.ts +23 -54
  223. package/src/global-account/react/hooks/useUserQuery.ts +40 -1
  224. package/src/global-account/react/index.native.ts +2 -0
  225. package/src/global-account/react/stores/index.ts +0 -1
  226. package/src/global-account/react/stores/useModalStore.ts +0 -10
  227. package/dist/cjs/anyspend/react/components/common/GasIndicator.d.ts +0 -6
  228. package/dist/cjs/anyspend/react/components/common/GasIndicator.js +0 -34
  229. package/dist/cjs/anyspend/react/hooks/useGasPrice.d.ts +0 -37
  230. package/dist/cjs/anyspend/react/hooks/useGasPrice.js +0 -43
  231. package/dist/cjs/anyspend/services/gas.d.ts +0 -21
  232. package/dist/cjs/anyspend/services/gas.js +0 -65
  233. package/dist/cjs/anyspend/types/gas.d.ts +0 -61
  234. package/dist/cjs/anyspend/types/gas.js +0 -2
  235. package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +0 -5
  236. package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.js +0 -12
  237. package/dist/cjs/global-account/react/hooks/useAuth.d.ts +0 -76
  238. package/dist/cjs/global-account/react/hooks/useAuth.js +0 -337
  239. package/dist/cjs/global-account/react/hooks/useUser.d.ts +0 -60
  240. package/dist/cjs/global-account/react/hooks/useUser.js +0 -20
  241. package/dist/cjs/global-account/react/stores/configStore.d.ts +0 -24
  242. package/dist/cjs/global-account/react/stores/configStore.js +0 -30
  243. package/dist/cjs/global-account/react/stores/userStore.d.ts +0 -22
  244. package/dist/cjs/global-account/react/stores/userStore.js +0 -30
  245. package/dist/esm/anyspend/react/components/common/GasIndicator.d.ts +0 -6
  246. package/dist/esm/anyspend/react/components/common/GasIndicator.js +0 -31
  247. package/dist/esm/anyspend/react/hooks/useGasPrice.d.ts +0 -37
  248. package/dist/esm/anyspend/react/hooks/useGasPrice.js +0 -40
  249. package/dist/esm/anyspend/services/gas.d.ts +0 -21
  250. package/dist/esm/anyspend/services/gas.js +0 -59
  251. package/dist/esm/anyspend/types/gas.d.ts +0 -61
  252. package/dist/esm/anyspend/types/gas.js +0 -1
  253. package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +0 -5
  254. package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.js +0 -10
  255. package/dist/esm/global-account/react/hooks/useAuth.d.ts +0 -76
  256. package/dist/esm/global-account/react/hooks/useAuth.js +0 -331
  257. package/dist/esm/global-account/react/hooks/useUser.d.ts +0 -60
  258. package/dist/esm/global-account/react/hooks/useUser.js +0 -17
  259. package/dist/esm/global-account/react/stores/configStore.d.ts +0 -24
  260. package/dist/esm/global-account/react/stores/configStore.js +0 -27
  261. package/dist/esm/global-account/react/stores/userStore.d.ts +0 -22
  262. package/dist/esm/global-account/react/stores/userStore.js +0 -27
  263. package/dist/types/anyspend/react/components/common/GasIndicator.d.ts +0 -6
  264. package/dist/types/anyspend/react/hooks/useGasPrice.d.ts +0 -37
  265. package/dist/types/anyspend/services/gas.d.ts +0 -21
  266. package/dist/types/anyspend/types/gas.d.ts +0 -61
  267. package/dist/types/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +0 -5
  268. package/dist/types/global-account/react/hooks/useAuth.d.ts +0 -76
  269. package/dist/types/global-account/react/hooks/useUser.d.ts +0 -60
  270. package/dist/types/global-account/react/stores/configStore.d.ts +0 -24
  271. package/dist/types/global-account/react/stores/userStore.d.ts +0 -22
  272. package/src/anyspend/react/components/common/GasIndicator.tsx +0 -59
  273. package/src/anyspend/react/hooks/useGasPrice.ts +0 -70
  274. package/src/anyspend/services/gas.test.ts +0 -31
  275. package/src/anyspend/services/gas.ts +0 -73
  276. package/src/anyspend/types/gas.ts +0 -66
  277. package/src/global-account/react/components/B3Provider/AuthenticationProvider.tsx +0 -19
  278. package/src/global-account/react/hooks/useAuth.ts +0 -379
  279. package/src/global-account/react/hooks/useUser.ts +0 -20
  280. package/src/global-account/react/stores/configStore.ts +0 -51
  281. package/src/global-account/react/stores/userStore.ts +0 -41
@@ -11,7 +11,6 @@ import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
11
11
  import { useCallback, useEffect, useState } from "react";
12
12
  import { useActiveAccount } from "thirdweb/react";
13
13
  import { Account } from "thirdweb/wallets";
14
- import { TurnkeyAuthModal } from "../TurnkeyAuthModal";
15
14
  import { SignInWithB3Privy } from "./SignInWithB3Privy";
16
15
  import { LoginStep, LoginStepContainer } from "./steps/LoginStep";
17
16
  import { LoginStepCustom } from "./steps/LoginStepCustom";
@@ -44,9 +43,7 @@ export function SignInWithB3Flow({
44
43
  const account = useActiveAccount();
45
44
  const isAuthenticating = useAuthStore(state => state.isAuthenticating);
46
45
  const isAuthenticated = useAuthStore(state => state.isAuthenticated);
47
- const setIsAuthenticated = useAuthStore(state => state.setIsAuthenticated);
48
46
  const isConnected = useAuthStore(state => state.isConnected);
49
- const setIsConnected = useAuthStore(state => state.setIsConnected);
50
47
  const setJustCompletedLogin = useAuthStore(state => state.setJustCompletedLogin);
51
48
  const [refetchCount, setRefetchCount] = useState(0);
52
49
  const [refetchError, setRefetchError] = useState<string | null>(null);
@@ -88,9 +85,7 @@ export function SignInWithB3Flow({
88
85
  refetchSigners();
89
86
  setRefetchQueued(false);
90
87
  }, backoffDelay);
91
- // State setters are stable and don't need to be in dependencies
92
- // eslint-disable-next-line react-hooks/exhaustive-deps
93
- }, [refetchCount, refetchSigners, onError, refetchQueued]);
88
+ }, [refetchCount, refetchSigners, onError, setRefetchQueued, refetchQueued]);
94
89
 
95
90
  // Extract the completion flow logic to be reused
96
91
  const handlePostTurnkeyFlow = useCallback(() => {
@@ -162,11 +157,6 @@ export function SignInWithB3Flow({
162
157
  await refetchUser();
163
158
  debug("User refetched successfully");
164
159
 
165
- // Set authentication and connection state so UI updates properly
166
- setIsAuthenticated(true);
167
- setIsConnected(true);
168
- setJustCompletedLogin(true);
169
-
170
160
  // After user data is refreshed, close Turnkey modal and go back to sign-in flow
171
161
  debug("Switching back to signInWithB3 modal");
172
162
  setB3ModalContentType({
@@ -186,6 +176,7 @@ export function SignInWithB3Flow({
186
176
  },
187
177
  [
188
178
  refetchUser,
179
+ setB3ModalContentType,
189
180
  strategies,
190
181
  onLoginSuccess,
191
182
  onSessionKeySuccess,
@@ -196,102 +187,90 @@ export function SignInWithB3Flow({
196
187
  closeAfterLogin,
197
188
  source,
198
189
  signersEnabled,
199
- setB3ModalContentType,
200
- setIsAuthenticated,
201
- setIsConnected,
202
- setJustCompletedLogin,
203
190
  ],
204
191
  );
205
192
 
206
193
  // Handle post-login flow after signers are loaded
207
- useEffect(
208
- () => {
209
- debug("@@SignInWithB3Flow:useEffect", {
210
- isConnected,
211
- isAuthenticating,
212
- isFetchingSigners,
213
- closeAfterLogin,
214
- isOpen,
215
- source,
216
- });
217
-
218
- if (isConnected && isAuthenticated && user) {
219
- // Mark that login just completed BEFORE opening manage account or closing modal
220
- // This allows Turnkey modal to show (if enableTurnkey is true)
221
- if (closeAfterLogin) {
222
- setJustCompletedLogin(true);
223
- }
194
+ useEffect(() => {
195
+ debug("@@SignInWithB3Flow:useEffect", {
196
+ isConnected,
197
+ isAuthenticating,
198
+ isFetchingSigners,
199
+ closeAfterLogin,
200
+ isOpen,
201
+ source,
202
+ });
224
203
 
225
- // Check if we should show Turnkey login form as SECONDARY option (after wallet connection)
226
- // This only applies when:
227
- // - enableTurnkey={true} is set on B3Provider
228
- // - NEXT_PUBLIC_TURNKEY_PRIMARY is NOT set to true (otherwise Turnkey shows as primary)
229
- // - User just logged in AND hasn't completed Turnkey auth in this session
230
- // For new users (!turnkeyId): Show email form
231
- // For returning users (turnkeyId && turnkeyEmail): Auto-skip to OTP
232
- // Also check that we're not already showing the Turnkey modal
233
- const hasTurnkeyId = user?.partnerIds?.turnkeyId;
234
- const hasTurnkeyEmail = !!user?.email;
235
- const isTurnkeyModalCurrentlyOpen = contentType?.type === "turnkeyAuth";
236
- const isTurnkeyPrimary = process.env.NEXT_PUBLIC_TURNKEY_PRIMARY === "true";
237
- const shouldShowTurnkeyModal =
238
- enableTurnkey &&
239
- !isTurnkeyPrimary &&
240
- user &&
241
- !turnkeyAuthCompleted &&
242
- !isTurnkeyModalCurrentlyOpen &&
243
- (!hasTurnkeyId || (hasTurnkeyId && hasTurnkeyEmail));
204
+ if (isConnected && isAuthenticated && user) {
205
+ // Mark that login just completed BEFORE opening manage account or closing modal
206
+ // This allows Turnkey modal to show (if enableTurnkey is true)
207
+ if (closeAfterLogin) {
208
+ setJustCompletedLogin(true);
209
+ }
244
210
 
245
- if (shouldShowTurnkeyModal) {
246
- // Extract email from user object - check partnerIds.turnkeyEmail first, then twProfiles, then user.email
247
- const email = user?.email || user?.twProfiles?.find((profile: any) => profile.details?.email)?.details?.email;
211
+ // Check if we should show Turnkey login form
212
+ // Show if enableTurnkey is true AND user just logged in AND hasn't completed Turnkey auth in this session
213
+ // For new users (!turnkeyId): Show email form
214
+ // For returning users (turnkeyId && turnkeyEmail): Auto-skip to OTP
215
+ // Also check that we're not already showing the Turnkey modal
216
+ const hasTurnkeyId = user?.partnerIds?.turnkeyId;
217
+ const hasTurnkeyEmail = !!user?.email;
218
+ const isTurnkeyModalCurrentlyOpen = contentType?.type === "turnkeyAuth";
219
+ const shouldShowTurnkeyModal =
220
+ enableTurnkey &&
221
+ user &&
222
+ !turnkeyAuthCompleted &&
223
+ !isTurnkeyModalCurrentlyOpen &&
224
+ (!hasTurnkeyId || (hasTurnkeyId && hasTurnkeyEmail));
248
225
 
249
- // Open Turnkey modal through the modal store
250
- setB3ModalContentType({
251
- type: "turnkeyAuth",
252
- onSuccess: handleTurnkeySuccess,
253
- onClose: () => {
254
- // After closing Turnkey modal, continue with the rest of the flow
255
- setTurnkeyAuthCompleted(true);
256
- debug("Turnkey modal closed, running post-Turnkey flow");
257
- handlePostTurnkeyFlow();
258
- },
259
- initialEmail: email,
260
- skipToOtp: !!(hasTurnkeyId && hasTurnkeyEmail),
261
- closable: false, // Turnkey modal cannot be closed until auth is complete
262
- });
263
- return;
264
- }
226
+ if (shouldShowTurnkeyModal) {
227
+ // Extract email from user object - check partnerIds.turnkeyEmail first, then twProfiles, then user.email
228
+ const email = user?.email || user?.twProfiles?.find((profile: any) => profile.details?.email)?.details?.email;
265
229
 
266
- // Normal flow continues after Turnkey auth is complete (or if not needed)
267
- handlePostTurnkeyFlow();
230
+ // Open Turnkey modal through the modal store
231
+ setB3ModalContentType({
232
+ type: "turnkeyAuth",
233
+ onSuccess: handleTurnkeySuccess,
234
+ onClose: () => {
235
+ // After closing Turnkey modal, continue with the rest of the flow
236
+ setTurnkeyAuthCompleted(true);
237
+ debug("Turnkey modal closed, running post-Turnkey flow");
238
+ handlePostTurnkeyFlow();
239
+ },
240
+ initialEmail: email,
241
+ skipToOtp: !!(hasTurnkeyId && hasTurnkeyEmail),
242
+ closable: false, // Turnkey modal cannot be closed until auth is complete
243
+ });
244
+ return;
268
245
  }
269
- },
270
- // eslint-disable-next-line react-hooks/exhaustive-deps
271
- [
272
- signers,
273
- isFetchingSigners,
274
- partnerId,
275
- handleRefetchSigners,
276
- source,
277
- closeAfterLogin,
278
- setB3ModalContentType,
279
- chain,
280
- onSessionKeySuccess,
281
- setB3ModalOpen,
282
- signersEnabled,
283
- isConnected,
284
- isAuthenticating,
285
- isAuthenticated,
286
- isOpen,
287
- user,
288
- enableTurnkey,
289
- turnkeyAuthCompleted,
290
- // handleTurnkeySuccess, // This is causing infinite loops
291
- contentType,
292
- handlePostTurnkeyFlow,
293
- ],
294
- );
246
+
247
+ // Normal flow continues after Turnkey auth is complete (or if not needed)
248
+ handlePostTurnkeyFlow();
249
+ }
250
+ }, [
251
+ signers,
252
+ isFetchingSigners,
253
+ partnerId,
254
+ handleRefetchSigners,
255
+ source,
256
+ closeAfterLogin,
257
+ setB3ModalContentType,
258
+ chain,
259
+ onSessionKeySuccess,
260
+ setB3ModalOpen,
261
+ signersEnabled,
262
+ isConnected,
263
+ isAuthenticating,
264
+ isAuthenticated,
265
+ isOpen,
266
+ setJustCompletedLogin,
267
+ user,
268
+ enableTurnkey,
269
+ turnkeyAuthCompleted,
270
+ handleTurnkeySuccess,
271
+ contentType,
272
+ handlePostTurnkeyFlow,
273
+ ]);
295
274
 
296
275
  debug("render", {
297
276
  step,
@@ -307,9 +286,7 @@ export function SignInWithB3Flow({
307
286
  if (closeAfterLogin && sessionKeyAdded) {
308
287
  setB3ModalOpen(false);
309
288
  }
310
- // setB3ModalOpen is stable
311
- // eslint-disable-next-line react-hooks/exhaustive-deps
312
- }, [closeAfterLogin, sessionKeyAdded]);
289
+ }, [closeAfterLogin, sessionKeyAdded, setB3ModalOpen]);
313
290
 
314
291
  const onSessionKeySuccessEnhanced = useCallback(() => {
315
292
  onSessionKeySuccess?.();
@@ -366,77 +343,32 @@ export function SignInWithB3Flow({
366
343
  <div className="p-4 text-center text-red-500">{refetchError}</div>
367
344
  </LoginStepContainer>
368
345
  );
346
+ } else if (isAuthenticating || (isFetchingSigners && step === "login") || source === "requestPermissions") {
347
+ content = (
348
+ <LoginStepContainer partnerId={partnerId}>
349
+ <div className="my-8 flex min-h-[350px] items-center justify-center">
350
+ <Loading variant="white" size="lg" />
351
+ </div>
352
+ </LoginStepContainer>
353
+ );
369
354
  } else if (step === "login") {
370
- // PRIORITY: If NEXT_PUBLIC_TURNKEY_PRIMARY is true, show Turnkey modal FIRST as the primary authentication option
371
- // Setting NEXT_PUBLIC_TURNKEY_PRIMARY="true" implicitly enables Turnkey
372
- const isTurnkeyPrimary = process.env.NEXT_PUBLIC_TURNKEY_PRIMARY === "true";
373
- const shouldShowTurnkeyFirst = isTurnkeyPrimary && !turnkeyAuthCompleted;
374
-
375
- if (shouldShowTurnkeyFirst) {
376
- // Don't show loading spinner for Turnkey - let the modal handle its own loading state
377
- // This prevents the infinite loop where isAuthenticating causes the modal to be replaced
378
- debug("Showing Turnkey as primary authentication option", {
379
- isTurnkeyPrimary,
380
- turnkeyAuthCompleted,
381
- isAuthenticated,
382
- });
383
- // Show Turnkey authentication as primary option
355
+ // Custom strategy
356
+ if (strategies?.[0] === "privy") {
357
+ content = <SignInWithB3Privy onSuccess={handleLoginSuccess} chain={chain} />;
358
+ } else if (strategies) {
359
+ // Strategies are explicitly provided
384
360
  content = (
385
- <LoginStepContainer partnerId={partnerId}>
386
- <TurnkeyAuthModal
387
- onSuccess={async (authenticatedUser: any) => {
388
- debug("Turnkey authentication successful in primary flow", { authenticatedUser });
389
- setTurnkeyAuthCompleted(true);
390
- // After Turnkey auth, refetch user to get the full user object
391
- await refetchUser();
392
- // User is now authenticated via Turnkey
393
- // Set both isAuthenticated and isConnected to true so UI updates properly
394
- // Wallet connection is optional and can happen later for signing transactions
395
- setIsAuthenticated(true);
396
- setIsConnected(true);
397
- setJustCompletedLogin(true);
398
- // Call the login success callback
399
- onLoginSuccess?.({} as Account);
400
- }}
401
- onClose={() => {
402
- // If user closes Turnkey modal, they can still use wallet connection as fallback
403
- setTurnkeyAuthCompleted(true);
404
- }}
405
- initialEmail=""
406
- skipToOtp={false}
407
- />
408
- </LoginStepContainer>
361
+ <LoginStepCustom
362
+ strategies={strategies}
363
+ chain={chain}
364
+ onSuccess={handleLoginSuccess}
365
+ onError={onError}
366
+ automaticallySetFirstEoa={!!automaticallySetFirstEoa}
367
+ />
409
368
  );
410
369
  } else {
411
- // Show loading spinner only if not in Turnkey flow
412
- if (isAuthenticating || (isFetchingSigners && step === "login") || source === "requestPermissions") {
413
- content = (
414
- <LoginStepContainer partnerId={partnerId}>
415
- <div className="my-8 flex min-h-[350px] items-center justify-center">
416
- <Loading variant="white" size="lg" />
417
- </div>
418
- </LoginStepContainer>
419
- );
420
- } else {
421
- // Custom strategy
422
- if (strategies?.[0] === "privy") {
423
- content = <SignInWithB3Privy onSuccess={handleLoginSuccess} chain={chain} />;
424
- } else if (strategies) {
425
- // Strategies are explicitly provided
426
- content = (
427
- <LoginStepCustom
428
- strategies={strategies}
429
- chain={chain}
430
- onSuccess={handleLoginSuccess}
431
- onError={onError}
432
- automaticallySetFirstEoa={!!automaticallySetFirstEoa}
433
- />
434
- );
435
- } else {
436
- // Default to handle all strategies we support
437
- content = <LoginStep chain={chain} onSuccess={handleLoginSuccess} onError={onError} />;
438
- }
439
- }
370
+ // Default to handle all strategies we support
371
+ content = <LoginStep chain={chain} onSuccess={handleLoginSuccess} onError={onError} />;
440
372
  }
441
373
  }
442
374
 
@@ -2,7 +2,7 @@ import {
2
2
  Loading,
3
3
  useAuthentication,
4
4
  useAuthStore,
5
- useB3Config,
5
+ useB3,
6
6
  useHandleConnectWithPrivy,
7
7
  } from "@b3dotfun/sdk/global-account/react";
8
8
  import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
@@ -19,7 +19,7 @@ interface SignInWithB3PrivyProps {
19
19
  }
20
20
 
21
21
  export function SignInWithB3Privy({ onSuccess, onError, chain }: SignInWithB3PrivyProps) {
22
- const { partnerId } = useB3Config();
22
+ const { partnerId } = useB3();
23
23
  const { isLoading, connectTw, fullToken } = useHandleConnectWithPrivy(chain, onSuccess);
24
24
  const setIsAuthenticating = useAuthStore(state => state.setIsAuthenticating);
25
25
  const setIsAuthenticated = useAuthStore(state => state.setIsAuthenticated);
@@ -1,4 +1,4 @@
1
- import { useAuthentication, useB3Config, useQueryB3 } from "@b3dotfun/sdk/global-account/react";
1
+ import { useAuthentication, useB3, useQueryB3 } from "@b3dotfun/sdk/global-account/react";
2
2
  import { ecosystemWalletId } from "@b3dotfun/sdk/shared/constants";
3
3
  import { client } from "@b3dotfun/sdk/shared/utils/thirdweb";
4
4
  import { Chain } from "thirdweb";
@@ -50,7 +50,7 @@ export function LoginStepContainer({ children, partnerId }: LoginStepContainerPr
50
50
  }
51
51
 
52
52
  export function LoginStep({ onSuccess, chain }: LoginStepProps) {
53
- const { partnerId, theme } = useB3Config();
53
+ const { partnerId, theme } = useB3();
54
54
  const wallet = ecosystemWallet(ecosystemWalletId, {
55
55
  partnerId: partnerId,
56
56
  });
@@ -7,7 +7,7 @@ import {
7
7
  LoginStepContainer,
8
8
  useAuthentication,
9
9
  useAuthStore,
10
- useB3Config,
10
+ useB3,
11
11
  useConnect,
12
12
  WalletRow,
13
13
  } from "@b3dotfun/sdk/global-account/react";
@@ -37,7 +37,7 @@ export function LoginStepCustom({
37
37
  maxInitialWallets = 2,
38
38
  automaticallySetFirstEoa,
39
39
  }: LoginStepCustomProps) {
40
- const { partnerId } = useB3Config();
40
+ const { partnerId } = useB3();
41
41
  const [isLoading, setIsLoading] = useState(false);
42
42
  const [showAllWallets, setShowAllWallets] = useState(false);
43
43
  const { connect } = useConnect(partnerId, chain);
@@ -1,11 +1,11 @@
1
1
  import { PropsWithChildren } from "react";
2
- import { useB3Config } from "./B3Provider/useB3Config";
2
+ import { useB3 } from "./B3Provider/useB3";
3
3
 
4
4
  export function StyleRoot({ children, id }: PropsWithChildren<{ id?: string }>) {
5
- const { theme } = useB3Config();
5
+ const { theme: b3Theme } = useB3();
6
6
 
7
7
  return (
8
- <div className="b3-root" id={id} data-theme={theme}>
8
+ <div className="b3-root" id={id} data-theme={b3Theme}>
9
9
  {children}
10
10
  </div>
11
11
  );
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useRef, useState } from "react";
1
+ import React, { useState, useEffect, useRef } from "react";
2
2
  import { useTurnkeyAuth } from "../hooks/useTurnkeyAuth";
3
3
 
4
4
  type ModalStep = "email" | "otp" | "success";
@@ -94,20 +94,17 @@ export function TurnkeyAuthModal({ onClose, onSuccess, initialEmail = "", skipTo
94
94
  }
95
95
  };
96
96
 
97
- const isTurnkeyPrimary = process.env.NEXT_PUBLIC_TURNKEY_PRIMARY === "true";
98
- const walletBrand = isTurnkeyPrimary ? "Smart Wallet" : "AnySpend Wallet";
99
-
100
97
  return (
101
98
  <div className="font-neue-montreal p-8">
102
99
  {/* Email Step */}
103
100
  {step === "email" && (
104
101
  <>
105
102
  <h2 className="mb-6 text-center text-2xl font-bold text-gray-900 dark:text-white">
106
- Setup your {walletBrand}
103
+ Setup your AnySpend Wallet
107
104
  </h2>
108
105
  <div className="mb-6 space-y-3 text-center text-sm text-gray-600 dark:text-gray-400">
109
106
  <p>
110
- {isTurnkeyPrimary ? "We use a secure," : "AnySpend uses a secure,"}
107
+ AnySpend uses a secure,
111
108
  <br />
112
109
  embedded wallet to fund your workflows.
113
110
  </p>
@@ -161,7 +158,7 @@ export function TurnkeyAuthModal({ onClose, onSuccess, initialEmail = "", skipTo
161
158
  <h2 className="mb-4 text-center text-2xl font-bold text-gray-900 dark:text-white">2FA Security</h2>
162
159
  <div className="mb-6 space-y-3 text-center text-sm text-gray-600 dark:text-gray-400">
163
160
  <p>
164
- {isTurnkeyPrimary ? "We use a secure," : "AnySpend uses a secure,"}
161
+ AnySpend uses a secure,
165
162
  <br />
166
163
  embedded wallet to fund your workflows.
167
164
  <br />
@@ -1,10 +1,11 @@
1
- import { Button, StyleRoot, useModalStore, useUser } from "@b3dotfun/sdk/global-account/react";
1
+ import { Button, StyleRoot, useAuthentication, useB3, useModalStore } from "@b3dotfun/sdk/global-account/react";
2
2
  import { cn } from "@b3dotfun/sdk/shared/utils";
3
3
  import { SignInWithB3Props } from "../SignInWithB3/SignInWithB3";
4
4
 
5
5
  export function ManageAccountButton(props: SignInWithB3Props & { className?: string }) {
6
+ const { partnerId } = useB3();
6
7
  const { setB3ModalOpen, setB3ModalContentType } = useModalStore();
7
- const { isConnected } = useUser();
8
+ const { isConnected } = useAuthentication(partnerId);
8
9
 
9
10
  const handleClickManageAccount = () => {
10
11
  setB3ModalContentType({
@@ -1,8 +1,9 @@
1
1
  // TODO woj: Barrel file for all components, this might be reason of bundle size issues
2
2
  // Core Components
3
3
  export { B3DynamicModal } from "./B3DynamicModal";
4
- export { B3Provider } from "./B3Provider/B3Provider";
4
+ export { B3Provider, InnerProvider } from "./B3Provider/B3Provider";
5
5
  export { RelayKitProviderWrapper } from "./B3Provider/RelayKitProviderWrapper";
6
+ export { B3Context, type B3ContextType } from "./B3Provider/types";
6
7
  export { useB3 } from "./B3Provider/useB3";
7
8
  export { useB3Account } from "./B3Provider/useB3Account";
8
9
  export { useB3Config } from "./B3Provider/useB3Config";
@@ -3,7 +3,6 @@ export { useAccountAssets } from "./useAccountAssets";
3
3
  export { useAccountWallet } from "./useAccountWallet";
4
4
  export { useAddTWSessionKey } from "./useAddTWSessionKey";
5
5
  export { useAnalytics } from "./useAnalytics";
6
- export { useAuth } from "./useAuth";
7
6
  export { useAuthentication } from "./useAuthentication";
8
7
  export { useB3BalanceFromAddresses } from "./useB3BalanceFromAddresses";
9
8
  export { useB3EnsName } from "./useB3EnsName";
@@ -52,4 +51,3 @@ export { useTokensFromAddress } from "./useTokensFromAddress";
52
51
  export { useTurnkeyAuth } from "./useTurnkeyAuth";
53
52
  export { useUnifiedChainSwitchAndExecute } from "./useUnifiedChainSwitchAndExecute";
54
53
  export { useURLParams } from "./useURLParams";
55
- export { useUser } from "./useUser";
@@ -1,4 +1,4 @@
1
- import { useB3Config } from "@b3dotfun/sdk/global-account/react";
1
+ import { useB3 } from "@b3dotfun/sdk/global-account/react";
2
2
  import { useCallback } from "react";
3
3
  import {
4
4
  ClientType,
@@ -13,7 +13,7 @@ import {
13
13
  * Hook to access the current FeathersJS client and client management utilities
14
14
  */
15
15
  export function useClient() {
16
- const { clientType } = useB3Config();
16
+ const { clientType } = useB3();
17
17
 
18
18
  const getCurrentClient = useCallback(() => {
19
19
  return getClient();
@@ -1,4 +1,4 @@
1
- import { useB3Config, useConnect } from "@b3dotfun/sdk/global-account/react";
1
+ import { useB3, useConnect } from "@b3dotfun/sdk/global-account/react";
2
2
  import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
3
3
  import { useIdentityToken, usePrivy } from "@privy-io/react-auth";
4
4
  import { useCallback, useRef, useState } from "react";
@@ -11,7 +11,7 @@ const debug = debugB3React("@@b3:useHandleConnectWithPrivy");
11
11
  * Currently, this is for the basement-privy strategy
12
12
  */
13
13
  export function useHandleConnectWithPrivy(chain?: Chain, onSuccess?: (account: Account) => void) {
14
- const { partnerId } = useB3Config();
14
+ const { partnerId } = useB3();
15
15
  if (!chain) {
16
16
  throw new Error("Chain is required");
17
17
  }
@@ -1,7 +1,7 @@
1
- import { useB3Config } from "@b3dotfun/sdk/global-account/react";
2
1
  import { getAuthToken } from "@b3dotfun/sdk/shared/utils/auth-token";
3
2
  import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
4
3
  import { useCallback, useEffect, useState } from "react";
4
+ import { useB3 } from "../components";
5
5
  import { notificationsAPI, UserData } from "../utils/notificationsAPI";
6
6
  import { useUserQuery } from "./useUserQuery";
7
7
 
@@ -56,7 +56,7 @@ export interface UseNotificationsReturn {
56
56
  */
57
57
  export function useNotifications(): UseNotificationsReturn {
58
58
  const { user } = useUserQuery();
59
- const { partnerId } = useB3Config();
59
+ const { partnerId } = useB3();
60
60
  const [userData, setUserData] = useState<UserData | null>(null);
61
61
  const [loading, setLoading] = useState(true);
62
62
  const [error, setError] = useState<string | null>(null);
@@ -1,20 +1,10 @@
1
- /**
2
- * @deprecated This hook is deprecated. Use useAuth() with Turnkey authentication instead.
3
- * This file is kept for backward compatibility but should not be used in new code.
4
- */
5
1
  import app from "@b3dotfun/sdk/global-account/app";
6
2
  import debug from "@b3dotfun/sdk/shared/utils/debug";
7
3
  import { useCallback } from "react";
8
4
  import { Wallet } from "thirdweb/wallets";
9
5
  import { useSearchParam } from "./useSearchParamsSSR";
10
6
 
11
- /**
12
- * @deprecated Use useAuth() with Turnkey authentication instead
13
- */
14
7
  export function useTWAuth() {
15
- console.warn(
16
- "useTWAuth is deprecated. Please migrate to useAuth() with Turnkey authentication. See useTurnkeyAuth.ts for the new implementation.",
17
- );
18
8
  const referralCode = useSearchParam("referralCode");
19
9
 
20
10
  const authenticate = useCallback(
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
 
3
3
  import { isNativeToken } from "@b3dotfun/sdk/anyspend";
4
- import { components } from "@b3dotfun/sdk/anyspend/types/api";
5
- import { useAccountWallet, useAuthStore } from "@b3dotfun/sdk/global-account/react";
4
+ import { useB3, useAccountWallet } from "@b3dotfun/sdk/global-account/react";
6
5
  import { formatTokenAmount } from "@b3dotfun/sdk/shared/utils/number";
7
6
  import { getERC20Balances, getNativeTokenBalance } from "@b3dotfun/sdk/shared/utils/thirdweb-insights";
8
7
  import { useQuery } from "@tanstack/react-query";
9
8
  import { useEffect } from "react";
9
+ import { components } from "@b3dotfun/sdk/anyspend/types/api";
10
10
 
11
11
  interface UseTokenBalanceProps {
12
12
  token: components["schemas"]["Token"];
@@ -20,8 +20,7 @@ export interface TokenBalanceResult {
20
20
  }
21
21
 
22
22
  export function useTokenBalance({ token, address }: UseTokenBalanceProps): TokenBalanceResult {
23
- const isAuthenticated = useAuthStore(state => state.isAuthenticated);
24
-
23
+ const { ready } = useB3();
25
24
  const account = useAccountWallet();
26
25
 
27
26
  const effectiveAddress = address || account?.address;
@@ -61,7 +60,7 @@ export function useTokenBalance({ token, address }: UseTokenBalanceProps): Token
61
60
  }
62
61
  return { formatted: "0", raw: null };
63
62
  },
64
- enabled: isAuthenticated && !!effectiveAddress,
63
+ enabled: ready && !!effectiveAddress,
65
64
  staleTime: 30000,
66
65
  gcTime: 5 * 60 * 1000,
67
66
  retry: 2,
@@ -70,13 +69,13 @@ export function useTokenBalance({ token, address }: UseTokenBalanceProps): Token
70
69
 
71
70
  // Force a refetch when the wallet or token changes
72
71
  useEffect(() => {
73
- if (isAuthenticated && effectiveAddress) {
72
+ if (ready && effectiveAddress) {
74
73
  refetch();
75
74
  }
76
- }, [isAuthenticated, effectiveAddress, token.address, token.chainId, token.symbol, refetch]);
75
+ }, [ready, effectiveAddress, token.address, token.chainId, token.symbol, refetch]);
77
76
 
78
77
  // Determine if we're actually loading
79
- const isActuallyLoading = !isAuthenticated || !effectiveAddress || isLoading || (isFetching && !tokenBalance);
78
+ const isActuallyLoading = !ready || !effectiveAddress || isLoading || (isFetching && !tokenBalance);
80
79
 
81
80
  return {
82
81
  rawBalance: tokenBalance?.raw || BigInt(0),
@@ -6,8 +6,8 @@ import { useQuery } from "@tanstack/react-query";
6
6
  import { viemToThirdwebChain } from "@b3dotfun/sdk/shared/constants/chains/b3Chain";
7
7
  import { getChainById } from "@b3dotfun/sdk/shared/utils/chains";
8
8
  import { client } from "@b3dotfun/sdk/shared/utils/thirdweb";
9
- import invariant from "invariant";
10
9
  import { getWalletBalance } from "thirdweb/wallets";
10
+ import invariant from "invariant";
11
11
 
12
12
  type GetWalletBalanceResult = {
13
13
  value: bigint;
@@ -83,9 +83,7 @@ export function useTokenBalancesByChain({
83
83
  staleTime: 30000, // Consider data fresh for 30 seconds
84
84
  gcTime: 5 * 60 * 1000, // Keep in cache for 5 minutes
85
85
  retry: 2, // Limit retries on failure
86
- // Enable structural sharing to prevent infinite loops
87
- // This ensures we only get new references when data actually changes
88
- structuralSharing: true,
86
+ structuralSharing: false,
89
87
  });
90
88
 
91
89
  return {