@b3dotfun/sdk 0.0.88-alpha.10 → 0.0.88-alpha.3

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 (263) 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/types.d.ts +27 -0
  36. package/dist/cjs/global-account/react/components/B3Provider/types.js +24 -0
  37. package/dist/cjs/global-account/react/components/B3Provider/useB3.d.ts +4 -14
  38. package/dist/cjs/global-account/react/components/B3Provider/useB3.js +11 -4
  39. package/dist/cjs/global-account/react/components/B3Provider/useB3Account.js +2 -5
  40. package/dist/cjs/global-account/react/components/B3Provider/useB3Config.d.ts +2 -10
  41. package/dist/cjs/global-account/react/components/B3Provider/useB3Config.js +17 -18
  42. package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +2 -1
  43. package/dist/cjs/global-account/react/components/ManageAccount/channels/DiscordChannel.js +6 -6
  44. package/dist/cjs/global-account/react/components/ManageAccount/channels/EmailChannel.js +7 -7
  45. package/dist/cjs/global-account/react/components/ManageAccount/channels/PhoneChannel.js +7 -7
  46. package/dist/cjs/global-account/react/components/ManageAccount/channels/TelegramChannel.js +5 -5
  47. package/dist/cjs/global-account/react/components/RequestPermissions/RequestPermissions.js +9 -8
  48. package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +1 -1
  49. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +15 -11
  50. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +1 -1
  51. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStep.js +1 -1
  52. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +1 -1
  53. package/dist/cjs/global-account/react/components/StyleRoot.js +3 -3
  54. package/dist/cjs/global-account/react/components/custom/ManageAccountButton.js +2 -1
  55. package/dist/cjs/global-account/react/components/index.d.ts +2 -1
  56. package/dist/cjs/global-account/react/components/index.js +6 -3
  57. package/dist/cjs/global-account/react/hooks/index.d.ts +0 -1
  58. package/dist/cjs/global-account/react/hooks/index.js +1 -3
  59. package/dist/cjs/global-account/react/hooks/useAuth.js +2 -1
  60. package/dist/cjs/global-account/react/hooks/useClient.js +1 -1
  61. package/dist/cjs/global-account/react/hooks/useHandleConnectWithPrivy.js +1 -1
  62. package/dist/cjs/global-account/react/hooks/useNotifications.js +14 -14
  63. package/dist/cjs/global-account/react/hooks/useTokenBalance.js +5 -5
  64. package/dist/cjs/global-account/react/hooks/useTokenBalancesByChain.js +2 -4
  65. package/dist/cjs/global-account/react/hooks/useUserQuery.js +35 -9
  66. package/dist/cjs/global-account/react/index.native.d.ts +2 -0
  67. package/dist/cjs/global-account/react/index.native.js +5 -1
  68. package/dist/cjs/global-account/react/stores/index.d.ts +0 -1
  69. package/dist/cjs/global-account/react/stores/index.js +1 -3
  70. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +0 -10
  71. package/dist/esm/anyspend/constants/index.d.ts +0 -2
  72. package/dist/esm/anyspend/constants/index.js +0 -2
  73. package/dist/esm/anyspend/index.d.ts +0 -2
  74. package/dist/esm/anyspend/index.js +0 -3
  75. package/dist/esm/anyspend/react/components/AnySpend.d.ts +0 -6
  76. package/dist/esm/anyspend/react/components/AnySpend.js +8 -11
  77. package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +1 -5
  78. package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
  79. package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +0 -1
  80. package/dist/esm/anyspend/react/components/AnySpendCustom.js +3 -3
  81. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +0 -6
  82. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +4 -8
  83. package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +1 -7
  84. package/dist/esm/anyspend/react/components/AnySpendDeposit.js +3 -3
  85. package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +0 -4
  86. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +1 -14
  87. package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +1 -3
  88. package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +2 -3
  89. package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +0 -4
  90. package/dist/esm/anyspend/react/components/common/OrderDetails.js +8 -36
  91. package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +1 -3
  92. package/dist/esm/anyspend/react/components/common/PanelOnramp.js +2 -3
  93. package/dist/esm/anyspend/react/components/common/PaymentStripeWeb2.js +4 -3
  94. package/dist/esm/anyspend/react/hooks/index.d.ts +0 -1
  95. package/dist/esm/anyspend/react/hooks/index.js +0 -1
  96. package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +2 -2
  97. package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.js +2 -2
  98. package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.js +2 -2
  99. package/dist/esm/anyspend/react/hooks/useValidatedClientReferenceId.js +2 -2
  100. package/dist/esm/global-account/react/components/B3DynamicModal.js +4 -3
  101. package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +18 -2
  102. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +58 -34
  103. package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
  104. package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +36 -36
  105. package/dist/esm/global-account/react/components/B3Provider/types.d.ts +27 -0
  106. package/dist/esm/global-account/react/components/B3Provider/types.js +21 -0
  107. package/dist/esm/global-account/react/components/B3Provider/useB3.d.ts +4 -14
  108. package/dist/esm/global-account/react/components/B3Provider/useB3.js +11 -4
  109. package/dist/esm/global-account/react/components/B3Provider/useB3Account.js +2 -5
  110. package/dist/esm/global-account/react/components/B3Provider/useB3Config.d.ts +2 -10
  111. package/dist/esm/global-account/react/components/B3Provider/useB3Config.js +17 -18
  112. package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +3 -2
  113. package/dist/esm/global-account/react/components/ManageAccount/channels/DiscordChannel.js +2 -2
  114. package/dist/esm/global-account/react/components/ManageAccount/channels/EmailChannel.js +2 -2
  115. package/dist/esm/global-account/react/components/ManageAccount/channels/PhoneChannel.js +2 -2
  116. package/dist/esm/global-account/react/components/ManageAccount/channels/TelegramChannel.js +2 -2
  117. package/dist/esm/global-account/react/components/RequestPermissions/RequestPermissions.js +3 -2
  118. package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +2 -2
  119. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +16 -12
  120. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +2 -2
  121. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStep.js +2 -2
  122. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +2 -2
  123. package/dist/esm/global-account/react/components/StyleRoot.js +3 -3
  124. package/dist/esm/global-account/react/components/custom/ManageAccountButton.js +3 -2
  125. package/dist/esm/global-account/react/components/index.d.ts +2 -1
  126. package/dist/esm/global-account/react/components/index.js +2 -1
  127. package/dist/esm/global-account/react/hooks/index.d.ts +0 -1
  128. package/dist/esm/global-account/react/hooks/index.js +0 -1
  129. package/dist/esm/global-account/react/hooks/useAuth.js +3 -2
  130. package/dist/esm/global-account/react/hooks/useClient.js +2 -2
  131. package/dist/esm/global-account/react/hooks/useHandleConnectWithPrivy.js +2 -2
  132. package/dist/esm/global-account/react/hooks/useNotifications.js +2 -2
  133. package/dist/esm/global-account/react/hooks/useTokenBalance.js +6 -6
  134. package/dist/esm/global-account/react/hooks/useTokenBalancesByChain.js +2 -4
  135. package/dist/esm/global-account/react/hooks/useUserQuery.js +27 -1
  136. package/dist/esm/global-account/react/index.native.d.ts +2 -0
  137. package/dist/esm/global-account/react/index.native.js +2 -0
  138. package/dist/esm/global-account/react/stores/index.d.ts +0 -1
  139. package/dist/esm/global-account/react/stores/index.js +0 -1
  140. package/dist/esm/global-account/react/stores/useModalStore.d.ts +0 -10
  141. package/dist/styles/index.css +1 -1
  142. package/dist/types/anyspend/constants/index.d.ts +0 -2
  143. package/dist/types/anyspend/index.d.ts +0 -2
  144. package/dist/types/anyspend/react/components/AnySpend.d.ts +0 -6
  145. package/dist/types/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +1 -5
  146. package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +0 -1
  147. package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +0 -6
  148. package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +1 -7
  149. package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +0 -4
  150. package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +1 -3
  151. package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +0 -4
  152. package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +1 -3
  153. package/dist/types/anyspend/react/hooks/index.d.ts +0 -1
  154. package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +18 -2
  155. package/dist/types/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
  156. package/dist/types/global-account/react/components/B3Provider/types.d.ts +27 -0
  157. package/dist/types/global-account/react/components/B3Provider/useB3.d.ts +4 -14
  158. package/dist/types/global-account/react/components/B3Provider/useB3Config.d.ts +2 -10
  159. package/dist/types/global-account/react/components/index.d.ts +2 -1
  160. package/dist/types/global-account/react/hooks/index.d.ts +0 -1
  161. package/dist/types/global-account/react/index.native.d.ts +2 -0
  162. package/dist/types/global-account/react/stores/index.d.ts +0 -1
  163. package/dist/types/global-account/react/stores/useModalStore.d.ts +0 -10
  164. package/package.json +1 -1
  165. package/src/anyspend/constants/index.ts +0 -3
  166. package/src/anyspend/index.ts +0 -4
  167. package/src/anyspend/react/components/AnySpend.tsx +2 -28
  168. package/src/anyspend/react/components/AnySpendCollectorClubPurchase.tsx +0 -6
  169. package/src/anyspend/react/components/AnySpendCustom.tsx +47 -52
  170. package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +0 -23
  171. package/src/anyspend/react/components/AnySpendDeposit.tsx +1 -18
  172. package/src/anyspend/react/components/AnyspendDepositHype.tsx +0 -4
  173. package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +1 -15
  174. package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +1 -5
  175. package/src/anyspend/react/components/common/OrderDetails.tsx +42 -60
  176. package/src/anyspend/react/components/common/PanelOnramp.tsx +1 -5
  177. package/src/anyspend/react/components/common/PaymentStripeWeb2.tsx +4 -3
  178. package/src/anyspend/react/hooks/index.ts +0 -1
  179. package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +2 -2
  180. package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +2 -2
  181. package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +2 -2
  182. package/src/anyspend/react/hooks/useValidatedClientReferenceId.ts +2 -2
  183. package/src/global-account/react/components/B3DynamicModal.tsx +4 -3
  184. package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +54 -43
  185. package/src/global-account/react/components/B3Provider/B3Provider.tsx +117 -44
  186. package/src/global-account/react/components/B3Provider/types.ts +50 -0
  187. package/src/global-account/react/components/B3Provider/useB3.ts +13 -4
  188. package/src/global-account/react/components/B3Provider/useB3Account.ts +2 -6
  189. package/src/global-account/react/components/B3Provider/useB3Config.ts +31 -18
  190. package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +4 -2
  191. package/src/global-account/react/components/ManageAccount/channels/DiscordChannel.tsx +2 -2
  192. package/src/global-account/react/components/ManageAccount/channels/EmailChannel.tsx +2 -2
  193. package/src/global-account/react/components/ManageAccount/channels/PhoneChannel.tsx +2 -2
  194. package/src/global-account/react/components/ManageAccount/channels/TelegramChannel.tsx +2 -2
  195. package/src/global-account/react/components/RequestPermissions/RequestPermissions.tsx +4 -4
  196. package/src/global-account/react/components/SignInWithB3/SignIn.tsx +2 -2
  197. package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +14 -11
  198. package/src/global-account/react/components/SignInWithB3/SignInWithB3Privy.tsx +2 -2
  199. package/src/global-account/react/components/SignInWithB3/steps/LoginStep.tsx +2 -2
  200. package/src/global-account/react/components/SignInWithB3/steps/LoginStepCustom.tsx +2 -2
  201. package/src/global-account/react/components/StyleRoot.tsx +3 -3
  202. package/src/global-account/react/components/custom/ManageAccountButton.tsx +3 -2
  203. package/src/global-account/react/components/index.ts +2 -1
  204. package/src/global-account/react/hooks/index.ts +0 -1
  205. package/src/global-account/react/hooks/useAuth.ts +3 -2
  206. package/src/global-account/react/hooks/useClient.ts +2 -2
  207. package/src/global-account/react/hooks/useHandleConnectWithPrivy.tsx +2 -2
  208. package/src/global-account/react/hooks/useNotifications.ts +2 -2
  209. package/src/global-account/react/hooks/useTokenBalance.tsx +7 -8
  210. package/src/global-account/react/hooks/useTokenBalancesByChain.tsx +2 -4
  211. package/src/global-account/react/hooks/useUserQuery.ts +40 -1
  212. package/src/global-account/react/index.native.ts +2 -0
  213. package/src/global-account/react/stores/index.ts +0 -1
  214. package/src/global-account/react/stores/useModalStore.ts +0 -10
  215. package/dist/cjs/anyspend/react/components/common/GasIndicator.d.ts +0 -6
  216. package/dist/cjs/anyspend/react/components/common/GasIndicator.js +0 -34
  217. package/dist/cjs/anyspend/react/hooks/useGasPrice.d.ts +0 -37
  218. package/dist/cjs/anyspend/react/hooks/useGasPrice.js +0 -43
  219. package/dist/cjs/anyspend/services/gas.d.ts +0 -21
  220. package/dist/cjs/anyspend/services/gas.js +0 -65
  221. package/dist/cjs/anyspend/types/gas.d.ts +0 -61
  222. package/dist/cjs/anyspend/types/gas.js +0 -2
  223. package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +0 -5
  224. package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.js +0 -12
  225. package/dist/cjs/global-account/react/hooks/useUser.d.ts +0 -60
  226. package/dist/cjs/global-account/react/hooks/useUser.js +0 -20
  227. package/dist/cjs/global-account/react/stores/configStore.d.ts +0 -24
  228. package/dist/cjs/global-account/react/stores/configStore.js +0 -30
  229. package/dist/cjs/global-account/react/stores/userStore.d.ts +0 -22
  230. package/dist/cjs/global-account/react/stores/userStore.js +0 -30
  231. package/dist/esm/anyspend/react/components/common/GasIndicator.d.ts +0 -6
  232. package/dist/esm/anyspend/react/components/common/GasIndicator.js +0 -31
  233. package/dist/esm/anyspend/react/hooks/useGasPrice.d.ts +0 -37
  234. package/dist/esm/anyspend/react/hooks/useGasPrice.js +0 -40
  235. package/dist/esm/anyspend/services/gas.d.ts +0 -21
  236. package/dist/esm/anyspend/services/gas.js +0 -59
  237. package/dist/esm/anyspend/types/gas.d.ts +0 -61
  238. package/dist/esm/anyspend/types/gas.js +0 -1
  239. package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +0 -5
  240. package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.js +0 -10
  241. package/dist/esm/global-account/react/hooks/useUser.d.ts +0 -60
  242. package/dist/esm/global-account/react/hooks/useUser.js +0 -17
  243. package/dist/esm/global-account/react/stores/configStore.d.ts +0 -24
  244. package/dist/esm/global-account/react/stores/configStore.js +0 -27
  245. package/dist/esm/global-account/react/stores/userStore.d.ts +0 -22
  246. package/dist/esm/global-account/react/stores/userStore.js +0 -27
  247. package/dist/types/anyspend/react/components/common/GasIndicator.d.ts +0 -6
  248. package/dist/types/anyspend/react/hooks/useGasPrice.d.ts +0 -37
  249. package/dist/types/anyspend/services/gas.d.ts +0 -21
  250. package/dist/types/anyspend/types/gas.d.ts +0 -61
  251. package/dist/types/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +0 -5
  252. package/dist/types/global-account/react/hooks/useUser.d.ts +0 -60
  253. package/dist/types/global-account/react/stores/configStore.d.ts +0 -24
  254. package/dist/types/global-account/react/stores/userStore.d.ts +0 -22
  255. package/src/anyspend/react/components/common/GasIndicator.tsx +0 -59
  256. package/src/anyspend/react/hooks/useGasPrice.ts +0 -70
  257. package/src/anyspend/services/gas.test.ts +0 -31
  258. package/src/anyspend/services/gas.ts +0 -73
  259. package/src/anyspend/types/gas.ts +0 -66
  260. package/src/global-account/react/components/B3Provider/AuthenticationProvider.tsx +0 -19
  261. package/src/global-account/react/hooks/useUser.ts +0 -20
  262. package/src/global-account/react/stores/configStore.ts +0 -51
  263. package/src/global-account/react/stores/userStore.ts +0 -41
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useAuthentication, useB3Config, useQueryB3 } from "../../../../../global-account/react/index.js";
2
+ import { useAuthentication, useB3, useQueryB3 } from "../../../../../global-account/react/index.js";
3
3
  import { ecosystemWalletId } from "../../../../../shared/constants/index.js";
4
4
  import { client } from "../../../../../shared/utils/thirdweb.js";
5
5
  import { ConnectEmbed, darkTheme, lightTheme } from "thirdweb/react";
@@ -15,7 +15,7 @@ export function LoginStepContainer({ children, partnerId }) {
15
15
  return (_jsxs("div", { className: "bg-b3-react-background flex flex-col items-center justify-center pt-6", children: [partnerLogo && (_jsx("img", { src: partnerLogo, alt: "Partner Logo", className: "partner-logo mb-6 h-12 w-auto object-contain" })), children] }));
16
16
  }
17
17
  export function LoginStep({ onSuccess, chain }) {
18
- const { partnerId, theme } = useB3Config();
18
+ const { partnerId, theme } = useB3();
19
19
  const wallet = ecosystemWallet(ecosystemWalletId, {
20
20
  partnerId: partnerId,
21
21
  });
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { AuthButton, Button, getConnectOptionsFromStrategy, isWalletType, LoginStepContainer, useAuthentication, useAuthStore, useB3Config, useConnect, WalletRow, } from "../../../../../global-account/react/index.js";
2
+ import { AuthButton, Button, getConnectOptionsFromStrategy, isWalletType, LoginStepContainer, useAuthentication, useAuthStore, useB3, useConnect, WalletRow, } from "../../../../../global-account/react/index.js";
3
3
  import { debugB3React } from "../../../../../shared/utils/debug.js";
4
4
  import { client } from "../../../../../shared/utils/thirdweb.js";
5
5
  import { useState } from "react";
@@ -7,7 +7,7 @@ import { useConnect as useConnectTW } from "thirdweb/react";
7
7
  import { createWallet } from "thirdweb/wallets";
8
8
  const debug = debugB3React("LoginStepCustom");
9
9
  export function LoginStepCustom({ onSuccess, onError, chain, strategies, maxInitialWallets = 2, automaticallySetFirstEoa, }) {
10
- const { partnerId } = useB3Config();
10
+ const { partnerId } = useB3();
11
11
  const [isLoading, setIsLoading] = useState(false);
12
12
  const [showAllWallets, setShowAllWallets] = useState(false);
13
13
  const { connect } = useConnect(partnerId, chain);
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useB3Config } from "./B3Provider/useB3Config.js";
2
+ import { useB3 } from "./B3Provider/useB3.js";
3
3
  export function StyleRoot({ children, id }) {
4
- const { theme } = useB3Config();
5
- return (_jsx("div", { className: "b3-root", id: id, "data-theme": theme, children: children }));
4
+ const { theme: b3Theme } = useB3();
5
+ return (_jsx("div", { className: "b3-root", id: id, "data-theme": b3Theme, children: children }));
6
6
  }
@@ -1,9 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button, StyleRoot, useModalStore, useUser } from "../../../../global-account/react/index.js";
2
+ import { Button, StyleRoot, useAuthentication, useB3, useModalStore } from "../../../../global-account/react/index.js";
3
3
  import { cn } from "../../../../shared/utils/index.js";
4
4
  export function ManageAccountButton(props) {
5
+ const { partnerId } = useB3();
5
6
  const { setB3ModalOpen, setB3ModalContentType } = useModalStore();
6
- const { isConnected } = useUser();
7
+ const { isConnected } = useAuthentication(partnerId);
7
8
  const handleClickManageAccount = () => {
8
9
  setB3ModalContentType({
9
10
  ...props,
@@ -1,6 +1,7 @@
1
1
  export { B3DynamicModal } from "./B3DynamicModal";
2
- export { B3Provider } from "./B3Provider/B3Provider";
2
+ export { B3Provider, InnerProvider } from "./B3Provider/B3Provider";
3
3
  export { RelayKitProviderWrapper } from "./B3Provider/RelayKitProviderWrapper";
4
+ export { B3Context, type B3ContextType } from "./B3Provider/types";
4
5
  export { useB3 } from "./B3Provider/useB3";
5
6
  export { useB3Account } from "./B3Provider/useB3Account";
6
7
  export { useB3Config } from "./B3Provider/useB3Config";
@@ -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.js";
4
- export { B3Provider } from "./B3Provider/B3Provider.js";
4
+ export { B3Provider, InnerProvider } from "./B3Provider/B3Provider.js";
5
5
  export { RelayKitProviderWrapper } from "./B3Provider/RelayKitProviderWrapper.js";
6
+ export { B3Context } from "./B3Provider/types.js";
6
7
  export { useB3 } from "./B3Provider/useB3.js";
7
8
  export { useB3Account } from "./B3Provider/useB3Account.js";
8
9
  export { useB3Config } from "./B3Provider/useB3Config.js";
@@ -43,4 +43,3 @@ export { useTokensFromAddress } from "./useTokensFromAddress";
43
43
  export { useTurnkeyAuth } from "./useTurnkeyAuth";
44
44
  export { useUnifiedChainSwitchAndExecute } from "./useUnifiedChainSwitchAndExecute";
45
45
  export { useURLParams } from "./useURLParams";
46
- export { useUser } from "./useUser";
@@ -43,4 +43,3 @@ export { useTokensFromAddress } from "./useTokensFromAddress.js";
43
43
  export { useTurnkeyAuth } from "./useTurnkeyAuth.js";
44
44
  export { useUnifiedChainSwitchAndExecute } from "./useUnifiedChainSwitchAndExecute.js";
45
45
  export { useURLParams } from "./useURLParams.js";
46
- export { useUser } from "./useUser.js";
@@ -1,6 +1,6 @@
1
1
  import app from "../../../global-account/app.js";
2
2
  import { authenticateWithB3JWT } from "../../../global-account/bsmnt.js";
3
- import { useAuthStore, useB3Config } from "../../../global-account/react/index.js";
3
+ import { useAuthStore } from "../../../global-account/react/index.js";
4
4
  import { ecosystemWalletId } from "../../../shared/constants/index.js";
5
5
  import { debugB3React } from "../../../shared/utils/debug.js";
6
6
  import { client } from "../../../shared/utils/thirdweb.js";
@@ -11,6 +11,7 @@ import { ecosystemWallet } from "thirdweb/wallets";
11
11
  import { preAuthenticate } from "thirdweb/wallets/in-app";
12
12
  import { useAccount, useConnect, useSwitchAccount } from "wagmi";
13
13
  import { LocalSDKContext } from "../components/B3Provider/LocalSDKProvider.js";
14
+ import { useB3 } from "../components/B3Provider/useB3.js";
14
15
  import { createWagmiConfig } from "../utils/createWagmiConfig.js";
15
16
  import { useSearchParam } from "./useSearchParamsSSR.js";
16
17
  import { useUserQuery } from "./useUserQuery.js";
@@ -38,7 +39,7 @@ export function useAuth() {
38
39
  const hasStartedConnecting = useAuthStore(state => state.hasStartedConnecting);
39
40
  const useAutoConnectLoadingPrevious = useRef(false);
40
41
  const referralCode = useSearchParam("referralCode");
41
- const { partnerId } = useB3Config();
42
+ const { partnerId } = useB3();
42
43
  const wagmiConfig = createWagmiConfig({ partnerId });
43
44
  const { connect } = useConnect();
44
45
  const activeWagmiAccount = useAccount();
@@ -1,11 +1,11 @@
1
- import { useB3Config } from "../../../global-account/react/index.js";
1
+ import { useB3 } from "../../../global-account/react/index.js";
2
2
  import { useCallback } from "react";
3
3
  import { authenticateBoth, authenticateWithClient, getClient, getClientByType, setClientType, } from "../../client-manager.js";
4
4
  /**
5
5
  * Hook to access the current FeathersJS client and client management utilities
6
6
  */
7
7
  export function useClient() {
8
- const { clientType } = useB3Config();
8
+ const { clientType } = useB3();
9
9
  const getCurrentClient = useCallback(() => {
10
10
  return getClient();
11
11
  }, []);
@@ -1,4 +1,4 @@
1
- import { useB3Config, useConnect } from "../../../global-account/react/index.js";
1
+ import { useB3, useConnect } from "../../../global-account/react/index.js";
2
2
  import { debugB3React } from "../../../shared/utils/debug.js";
3
3
  import { useIdentityToken, usePrivy } from "@privy-io/react-auth";
4
4
  import { useCallback, useRef, useState } from "react";
@@ -8,7 +8,7 @@ const debug = debugB3React("@@b3:useHandleConnectWithPrivy");
8
8
  * Currently, this is for the basement-privy strategy
9
9
  */
10
10
  export function useHandleConnectWithPrivy(chain, onSuccess) {
11
- const { partnerId } = useB3Config();
11
+ const { partnerId } = useB3();
12
12
  if (!chain) {
13
13
  throw new Error("Chain is required");
14
14
  }
@@ -1,7 +1,7 @@
1
- import { useB3Config } from "../../../global-account/react/index.js";
2
1
  import { getAuthToken } from "../../../shared/utils/auth-token.js";
3
2
  import { debugB3React } from "../../../shared/utils/debug.js";
4
3
  import { useCallback, useEffect, useState } from "react";
4
+ import { useB3 } from "../components/index.js";
5
5
  import { notificationsAPI } from "../utils/notificationsAPI.js";
6
6
  import { useUserQuery } from "./useUserQuery.js";
7
7
  const debug = debugB3React("useNotifications");
@@ -27,7 +27,7 @@ const debug = debugB3React("useNotifications");
27
27
  */
28
28
  export function useNotifications() {
29
29
  const { user } = useUserQuery();
30
- const { partnerId } = useB3Config();
30
+ const { partnerId } = useB3();
31
31
  const [userData, setUserData] = useState(null);
32
32
  const [loading, setLoading] = useState(true);
33
33
  const [error, setError] = useState(null);
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { isNativeToken } from "../../../anyspend/index.js";
3
- import { useAccountWallet, useAuthStore } from "../../../global-account/react/index.js";
3
+ import { useB3, useAccountWallet } from "../../../global-account/react/index.js";
4
4
  import { formatTokenAmount } from "../../../shared/utils/number.js";
5
5
  import { getERC20Balances, getNativeTokenBalance } from "../../../shared/utils/thirdweb-insights.js";
6
6
  import { useQuery } from "@tanstack/react-query";
7
7
  import { useEffect } from "react";
8
8
  export function useTokenBalance({ token, address }) {
9
- const isAuthenticated = useAuthStore(state => state.isAuthenticated);
9
+ const { ready } = useB3();
10
10
  const account = useAccountWallet();
11
11
  const effectiveAddress = address || account?.address;
12
12
  const { data: tokenBalance, isLoading, isFetching, refetch, } = useQuery({
@@ -38,7 +38,7 @@ export function useTokenBalance({ token, address }) {
38
38
  }
39
39
  return { formatted: "0", raw: null };
40
40
  },
41
- enabled: isAuthenticated && !!effectiveAddress,
41
+ enabled: ready && !!effectiveAddress,
42
42
  staleTime: 30000,
43
43
  gcTime: 5 * 60 * 1000,
44
44
  retry: 2,
@@ -46,12 +46,12 @@ export function useTokenBalance({ token, address }) {
46
46
  });
47
47
  // Force a refetch when the wallet or token changes
48
48
  useEffect(() => {
49
- if (isAuthenticated && effectiveAddress) {
49
+ if (ready && effectiveAddress) {
50
50
  refetch();
51
51
  }
52
- }, [isAuthenticated, effectiveAddress, token.address, token.chainId, token.symbol, refetch]);
52
+ }, [ready, effectiveAddress, token.address, token.chainId, token.symbol, refetch]);
53
53
  // Determine if we're actually loading
54
- const isActuallyLoading = !isAuthenticated || !effectiveAddress || isLoading || (isFetching && !tokenBalance);
54
+ const isActuallyLoading = !ready || !effectiveAddress || isLoading || (isFetching && !tokenBalance);
55
55
  return {
56
56
  rawBalance: tokenBalance?.raw || BigInt(0),
57
57
  formattedBalance: tokenBalance?.formatted || "0",
@@ -4,8 +4,8 @@ import { useQuery } from "@tanstack/react-query";
4
4
  import { viemToThirdwebChain } from "../../../shared/constants/chains/b3Chain.js";
5
5
  import { getChainById } from "../../../shared/utils/chains.js";
6
6
  import { client } from "../../../shared/utils/thirdweb.js";
7
- import invariant from "invariant";
8
7
  import { getWalletBalance } from "thirdweb/wallets";
8
+ import invariant from "invariant";
9
9
  export function useTokenBalancesByChain({ address, chainsIds, enabled = true, }) {
10
10
  // Normalize chains to array
11
11
  const chainIds = Array.isArray(chainsIds) ? chainsIds : [chainsIds];
@@ -46,9 +46,7 @@ export function useTokenBalancesByChain({ address, chainsIds, enabled = true, })
46
46
  staleTime: 30000, // Consider data fresh for 30 seconds
47
47
  gcTime: 5 * 60 * 1000, // Keep in cache for 5 minutes
48
48
  retry: 2, // Limit retries on failure
49
- // Enable structural sharing to prevent infinite loops
50
- // This ensures we only get new references when data actually changes
51
- structuralSharing: true,
49
+ structuralSharing: false,
52
50
  });
53
51
  return {
54
52
  nativeTokens: combinedData?.nativeTokens ?? [],
@@ -1,6 +1,32 @@
1
+ import { debugB3React } from "../../../shared/utils/debug.js";
1
2
  import { useEffect } from "react";
2
- import { useUserStore } from "../stores/userStore.js";
3
+ import { create } from "zustand";
4
+ import { persist } from "zustand/middleware";
5
+ const debug = debugB3React("useUserQuery");
3
6
  const USER_QUERY_KEY = ["b3-user"];
7
+ /**
8
+ * Zustand store for managing user state
9
+ * Persists user data to localStorage
10
+ */
11
+ const useUserStore = create()(persist(set => ({
12
+ user: null,
13
+ setUser: (newUser) => {
14
+ const userToSave = newUser ?? null;
15
+ set({ user: userToSave });
16
+ debug("User updated", userToSave);
17
+ },
18
+ clearUser: () => {
19
+ set({ user: null });
20
+ debug("User cleared");
21
+ },
22
+ }), {
23
+ name: "b3-user",
24
+ onRehydrateStorage: () => (_, error) => {
25
+ if (error) {
26
+ console.warn("Failed to rehydrate user store:", error);
27
+ }
28
+ },
29
+ }));
4
30
  /**
5
31
  * NOTE: THIS IS ONLY MEANT FOR INTERNAL USE, from useOnConnect
6
32
  *
@@ -1,4 +1,6 @@
1
1
  export { B3Provider } from "./components/B3Provider/B3Provider.native";
2
+ export { B3Context, type B3ContextType } from "./components/B3Provider/types";
3
+ export { useB3 } from "./components/B3Provider/useB3";
2
4
  export { useAccountWallet } from "./hooks/useAccountWallet";
3
5
  export { useAuthentication } from "./hooks/useAuthentication";
4
6
  export { useProfile } from "./hooks/useProfile";
@@ -3,6 +3,8 @@
3
3
  // export * from "./stores/index.js";
4
4
  // We only export the components and hooks that are needed for the native app
5
5
  export { B3Provider } from "./components/B3Provider/B3Provider.native.js";
6
+ export { B3Context } from "./components/B3Provider/types.js";
7
+ export { useB3 } from "./components/B3Provider/useB3.js";
6
8
  export { useAccountWallet } from "./hooks/useAccountWallet.js";
7
9
  export { useAuthentication } from "./hooks/useAuthentication.js";
8
10
  export { useProfile } from "./hooks/useProfile.js";
@@ -1,5 +1,4 @@
1
1
  export { useAuthStore } from "./useAuthStore";
2
- export { useB3ConfigStore } from "./configStore";
3
2
  export { useModalStore } from "./useModalStore";
4
3
  export { useRecentAddressesStore } from "./useRecentAddressesStore";
5
4
  export type { AnySpendBuySpinProps, AnySpendFundTournamentProps, AnySpendJoinTournamentProps, AnySpendModalProps, AnySpendNftProps, AnySpendOrderHistoryProps, AnySpendStakeB3Props, AnyspendOrderDetailsProps, ManageAccountModalProps, ModalContentType, RequestPermissionsModalProps, SignInWithB3ModalProps, } from "./useModalStore";
@@ -1,4 +1,3 @@
1
1
  export { useAuthStore } from "./useAuthStore.js";
2
- export { useB3ConfigStore } from "./configStore.js";
3
2
  export { useModalStore } from "./useModalStore.js";
4
3
  export { useRecentAddressesStore } from "./useRecentAddressesStore.js";
@@ -403,12 +403,6 @@ export interface AnySpendDepositHypeProps extends BaseModalProps {
403
403
  customUsdInputValues?: string[];
404
404
  /** prefer eoa wallet */
405
405
  preferEoa?: boolean;
406
- /** Custom URL to redirect to when clicking "Return to Home" on complete order screen */
407
- returnToHomeUrl?: string;
408
- /** Custom label for recipient display (e.g., "OBSN Telegram Bot") */
409
- customRecipientLabel?: string;
410
- /** Custom label for the return home button (overrides "Return to Home" / "Close") */
411
- returnHomeLabel?: string;
412
406
  }
413
407
  export interface AvatarEditorModalProps extends BaseModalProps {
414
408
  /** Modal type identifier */
@@ -477,10 +471,6 @@ export interface AnySpendCollectorClubPurchaseProps extends BaseModalProps {
477
471
  vendingMachineId: string;
478
472
  /** The pack type */
479
473
  packType: string;
480
- /** Active tab */
481
- activeTab?: "crypto" | "fiat";
482
- /** Force fiat payment */
483
- forceFiatPayment?: boolean;
484
474
  }
485
475
  /**
486
476
  * Union type of all possible modal content types