@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
@@ -1,20 +1,19 @@
1
- import { useB3ConfigStore } from "../../stores/configStore.js";
2
- /**
3
- * Hook to access B3 configuration
4
- * Returns all config values from the Zustand store
5
- * Since config is static (set once at initialization), destructuring is fine here
6
- */
1
+ import { useContext, useMemo } from "react";
2
+ import { B3Context } from "./types.js";
7
3
  export const useB3Config = () => {
8
- return useB3ConfigStore(state => ({
9
- automaticallySetFirstEoa: state.automaticallySetFirstEoa,
10
- environment: state.environment,
11
- theme: state.theme,
12
- clientType: state.clientType,
13
- partnerId: state.partnerId,
14
- createClientReferenceId: state.createClientReferenceId,
15
- enableTurnkey: state.enableTurnkey,
16
- stripePublishableKey: state.stripePublishableKey,
17
- defaultPermissions: state.defaultPermissions,
18
- accountOverride: state.accountOverride,
19
- }));
4
+ const context = useContext(B3Context);
5
+ if (!context) {
6
+ throw new Error("useB3 must be used within a B3Provider");
7
+ }
8
+ const { automaticallySetFirstEoa, environment, theme, clientType, partnerId, createClientReferenceId, enableTurnkey, } = context;
9
+ // Return a stable reference
10
+ return useMemo(() => ({
11
+ automaticallySetFirstEoa,
12
+ environment,
13
+ theme,
14
+ clientType,
15
+ partnerId,
16
+ createClientReferenceId,
17
+ enableTurnkey,
18
+ }), [automaticallySetFirstEoa, environment, theme, clientType, partnerId, createClientReferenceId, enableTurnkey]);
20
19
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useAccountWallet, useModalStore, useProfile, useSimBalance, useUser, } from "../../../../global-account/react/index.js";
2
+ import { useAccountWallet, useAuthentication, useB3Config, useModalStore, useProfile, useSimBalance, } from "../../../../global-account/react/index.js";
3
3
  import { formatUsername } from "../../../../shared/utils/index.js";
4
4
  import { formatDisplayNumber } from "../../../../shared/utils/number.js";
5
5
  import { Pencil } from "lucide-react";
@@ -15,7 +15,8 @@ const ProfileSection = () => {
15
15
  address: eoaAddress || account?.address,
16
16
  fresh: true,
17
17
  });
18
- const { user } = useUser();
18
+ const { partnerId } = useB3Config();
19
+ const { user } = useAuthentication(partnerId);
19
20
  const setB3ModalOpen = useModalStore(state => state.setB3ModalOpen);
20
21
  const setB3ModalContentType = useModalStore(state => state.setB3ModalContentType);
21
22
  const navigateBack = useModalStore(state => state.navigateBack);
@@ -1,13 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useB3Config } from "../../../../../global-account/react/index.js";
3
2
  import { debugB3React } from "../../../../../shared/utils/debug.js";
4
3
  import { useState } from "react";
5
4
  import { notificationsAPI } from "../../../utils/notificationsAPI.js";
5
+ import { useB3 } from "../../B3Provider/useB3.js";
6
6
  import { toast } from "../../Toast/toastApi.js";
7
7
  import { NotificationChannel } from "../NotificationChannel.js";
8
8
  const debug = debugB3React("DiscordChannel");
9
9
  export const DiscordChannel = ({ userId, jwtToken, discordChannel, isConnected, isOptimisticallyConnected, onConnectionChange, onToggle, }) => {
10
- const { partnerId } = useB3Config();
10
+ const { partnerId } = useB3();
11
11
  const [discordId, setDiscordId] = useState("");
12
12
  const [isConnecting, setIsConnecting] = useState(false);
13
13
  const [showInput, setShowInput] = useState(false);
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useB3Config } from "../../../../../global-account/react/index.js";
3
2
  import { debugB3React } from "../../../../../shared/utils/debug.js";
4
3
  import { useState } from "react";
5
4
  import { notificationsAPI } from "../../../utils/notificationsAPI.js";
5
+ import { useB3 } from "../../B3Provider/useB3.js";
6
6
  import { toast } from "../../Toast/toastApi.js";
7
7
  import { NotificationChannel } from "../NotificationChannel.js";
8
8
  const debug = debugB3React("EmailChannel");
@@ -11,7 +11,7 @@ const validateEmail = (email) => {
11
11
  return emailRegex.test(email);
12
12
  };
13
13
  export const EmailChannel = ({ userId, jwtToken, emailChannel, isConnected, isOptimisticallyConnected, onConnectionChange, onToggle, }) => {
14
- const { partnerId } = useB3Config();
14
+ const { partnerId } = useB3();
15
15
  const [email, setEmail] = useState("");
16
16
  const [emailError, setEmailError] = useState(null);
17
17
  const [isConnecting, setIsConnecting] = useState(false);
@@ -1,13 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useB3Config } from "../../../../../global-account/react/index.js";
3
2
  import { debugB3React } from "../../../../../shared/utils/debug.js";
4
3
  import { useState } from "react";
5
4
  import { notificationsAPI } from "../../../utils/notificationsAPI.js";
5
+ import { useB3 } from "../../B3Provider/useB3.js";
6
6
  import { toast } from "../../Toast/toastApi.js";
7
7
  import { NotificationChannel } from "../NotificationChannel.js";
8
8
  const debug = debugB3React("PhoneChannel");
9
9
  export const PhoneChannel = ({ userId, jwtToken, smsChannel, whatsappChannel, isSMSConnected, isWhatsAppConnected, isOptimisticallySMSConnected, isOptimisticallyWhatsAppConnected, onConnectionChange, onToggle, }) => {
10
- const { partnerId } = useB3Config();
10
+ const { partnerId } = useB3();
11
11
  const [phoneNumber, setPhoneNumber] = useState("");
12
12
  const [isConnectingSMS, setIsConnectingSMS] = useState(false);
13
13
  const [isConnectingWhatsApp, setIsConnectingWhatsApp] = useState(false);
@@ -1,13 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useB3Config } from "../../../../../global-account/react/index.js";
3
2
  import { debugB3React } from "../../../../../shared/utils/debug.js";
4
3
  import { useState } from "react";
5
4
  import { notificationsAPI } from "../../../utils/notificationsAPI.js";
5
+ import { useB3 } from "../../B3Provider/useB3.js";
6
6
  import { toast } from "../../Toast/toastApi.js";
7
7
  import { NotificationChannel } from "../NotificationChannel.js";
8
8
  const debug = debugB3React("TelegramChannel");
9
9
  export const TelegramChannel = ({ userId, jwtToken, telegramChannel, isConnected, isOptimisticallyConnected, onConnectionChange, onToggle, }) => {
10
- const { partnerId } = useB3Config();
10
+ const { partnerId } = useB3();
11
11
  const [isConnecting, setIsConnecting] = useState(false);
12
12
  const [status, setStatus] = useState("idle");
13
13
  // Detect if we're disconnecting
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button, PermissionItem, useAddTWSessionKey, useB3Config, useGetAllTWSigners, } from "../../../../global-account/react/index.js";
2
+ import { Button, useB3, useAddTWSessionKey, useGetAllTWSigners, } from "../../../../global-account/react/index.js";
3
+ import { PermissionItem } from "../../../../global-account/react/index.js";
3
4
  import { debugB3React } from "../../../../shared/utils/debug.js";
4
5
  import { formatAddress } from "../../../../shared/utils/formatAddress.js";
5
6
  import { CreditCard, Eye } from "lucide-react";
@@ -14,7 +15,7 @@ const debug = debugB3React("RequestPermissions");
14
15
  export function RequestPermissions({ onSuccess, onError, chain, sessionKeyAddress, permissions, }) {
15
16
  const [isApproving, setIsApproving] = useState(false);
16
17
  const account = useActiveAccount();
17
- const { defaultPermissions } = useB3Config();
18
+ const { defaultPermissions } = useB3();
18
19
  const DEFAULT_PERMISSIONS = useMemo(() => permissions ?? defaultPermissions, [defaultPermissions, permissions]);
19
20
  const { refetch: refetchSigners } = useGetAllTWSigners({
20
21
  chain,
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { IPFSMediaRenderer, SignInWithB3, StyleRoot, useAccountWallet, useAuthentication, useB3Config, useIsMobile, } from "../../../../global-account/react/index.js";
2
+ import { IPFSMediaRenderer, SignInWithB3, StyleRoot, useAccountWallet, useAuthentication, useB3, useIsMobile, } from "../../../../global-account/react/index.js";
3
3
  import Icon from "../../../../global-account/react/components/custom/Icon.js";
4
4
  import { ecosystemWalletId } from "../../../../shared/constants/index.js";
5
5
  import { cn, truncateAddress } from "../../../../shared/utils/index.js";
@@ -9,7 +9,7 @@ import { useConnectedWallets, useSetActiveWallet, useWalletImage } from "thirdwe
9
9
  import { ManageAccountButton } from "../custom/ManageAccountButton.js";
10
10
  export function SignIn(props) {
11
11
  const { className } = props;
12
- const { automaticallySetFirstEoa, partnerId } = useB3Config();
12
+ const { automaticallySetFirstEoa, partnerId } = useB3();
13
13
  const { address: globalAddress, ensName, connectedSmartWallet, connectedEOAWallet, isActiveSmartWallet, isActiveEOAWallet, smartWalletIcon, } = useAccountWallet();
14
14
  const { data: walletImage } = useWalletImage(connectedEOAWallet?.id);
15
15
  const isMobile = useIsMobile();
@@ -3,7 +3,6 @@ import { Loading, useAuthentication, useAuthStore, useB3Config, useGetAllTWSigne
3
3
  import { debugB3React } from "../../../../shared/utils/debug.js";
4
4
  import { useCallback, useEffect, useState } from "react";
5
5
  import { useActiveAccount } from "thirdweb/react";
6
- import { TurnkeyAuthModal } from "../TurnkeyAuthModal.js";
7
6
  import { SignInWithB3Privy } from "./SignInWithB3Privy.js";
8
7
  import { LoginStep, LoginStepContainer } from "./steps/LoginStep.js";
9
8
  import { LoginStepCustom } from "./steps/LoginStepCustom.js";
@@ -22,9 +21,7 @@ export function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySucce
22
21
  const account = useActiveAccount();
23
22
  const isAuthenticating = useAuthStore(state => state.isAuthenticating);
24
23
  const isAuthenticated = useAuthStore(state => state.isAuthenticated);
25
- const setIsAuthenticated = useAuthStore(state => state.setIsAuthenticated);
26
24
  const isConnected = useAuthStore(state => state.isConnected);
27
- const setIsConnected = useAuthStore(state => state.setIsConnected);
28
25
  const setJustCompletedLogin = useAuthStore(state => state.setJustCompletedLogin);
29
26
  const [refetchCount, setRefetchCount] = useState(0);
30
27
  const [refetchError, setRefetchError] = useState(null);
@@ -57,9 +54,7 @@ export function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySucce
57
54
  refetchSigners();
58
55
  setRefetchQueued(false);
59
56
  }, backoffDelay);
60
- // State setters are stable and don't need to be in dependencies
61
- // eslint-disable-next-line react-hooks/exhaustive-deps
62
- }, [refetchCount, refetchSigners, onError, refetchQueued]);
57
+ }, [refetchCount, refetchSigners, onError, setRefetchQueued, refetchQueued]);
63
58
  // Extract the completion flow logic to be reused
64
59
  const handlePostTurnkeyFlow = useCallback(() => {
65
60
  debug("Running post-Turnkey flow logic");
@@ -128,10 +123,6 @@ export function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySucce
128
123
  debug("Refetching user after Turnkey success...");
129
124
  await refetchUser();
130
125
  debug("User refetched successfully");
131
- // Set authentication and connection state so UI updates properly
132
- setIsAuthenticated(true);
133
- setIsConnected(true);
134
- setJustCompletedLogin(true);
135
126
  // After user data is refreshed, close Turnkey modal and go back to sign-in flow
136
127
  debug("Switching back to signInWithB3 modal");
137
128
  setB3ModalContentType({
@@ -150,6 +141,7 @@ export function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySucce
150
141
  // The useEffect will re-run with updated user data to complete the sign-in process
151
142
  }, [
152
143
  refetchUser,
144
+ setB3ModalContentType,
153
145
  strategies,
154
146
  onLoginSuccess,
155
147
  onSessionKeySuccess,
@@ -160,10 +152,6 @@ export function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySucce
160
152
  closeAfterLogin,
161
153
  source,
162
154
  signersEnabled,
163
- setB3ModalContentType,
164
- setIsAuthenticated,
165
- setIsConnected,
166
- setJustCompletedLogin,
167
155
  ]);
168
156
  // Handle post-login flow after signers are loaded
169
157
  useEffect(() => {
@@ -181,20 +169,15 @@ export function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySucce
181
169
  if (closeAfterLogin) {
182
170
  setJustCompletedLogin(true);
183
171
  }
184
- // Check if we should show Turnkey login form as SECONDARY option (after wallet connection)
185
- // This only applies when:
186
- // - enableTurnkey={true} is set on B3Provider
187
- // - NEXT_PUBLIC_TURNKEY_PRIMARY is NOT set to true (otherwise Turnkey shows as primary)
188
- // - User just logged in AND hasn't completed Turnkey auth in this session
172
+ // Check if we should show Turnkey login form
173
+ // Show if enableTurnkey is true AND user just logged in AND hasn't completed Turnkey auth in this session
189
174
  // For new users (!turnkeyId): Show email form
190
175
  // For returning users (turnkeyId && turnkeyEmail): Auto-skip to OTP
191
176
  // Also check that we're not already showing the Turnkey modal
192
177
  const hasTurnkeyId = user?.partnerIds?.turnkeyId;
193
178
  const hasTurnkeyEmail = !!user?.email;
194
179
  const isTurnkeyModalCurrentlyOpen = contentType?.type === "turnkeyAuth";
195
- const isTurnkeyPrimary = process.env.NEXT_PUBLIC_TURNKEY_PRIMARY === "true";
196
180
  const shouldShowTurnkeyModal = enableTurnkey &&
197
- !isTurnkeyPrimary &&
198
181
  user &&
199
182
  !turnkeyAuthCompleted &&
200
183
  !isTurnkeyModalCurrentlyOpen &&
@@ -221,9 +204,7 @@ export function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySucce
221
204
  // Normal flow continues after Turnkey auth is complete (or if not needed)
222
205
  handlePostTurnkeyFlow();
223
206
  }
224
- },
225
- // eslint-disable-next-line react-hooks/exhaustive-deps
226
- [
207
+ }, [
227
208
  signers,
228
209
  isFetchingSigners,
229
210
  partnerId,
@@ -239,10 +220,11 @@ export function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySucce
239
220
  isAuthenticating,
240
221
  isAuthenticated,
241
222
  isOpen,
223
+ setJustCompletedLogin,
242
224
  user,
243
225
  enableTurnkey,
244
226
  turnkeyAuthCompleted,
245
- // handleTurnkeySuccess, // This is causing infinite loops
227
+ handleTurnkeySuccess,
246
228
  contentType,
247
229
  handlePostTurnkeyFlow,
248
230
  ]);
@@ -259,9 +241,7 @@ export function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySucce
259
241
  if (closeAfterLogin && sessionKeyAdded) {
260
242
  setB3ModalOpen(false);
261
243
  }
262
- // setB3ModalOpen is stable
263
- // eslint-disable-next-line react-hooks/exhaustive-deps
264
- }, [closeAfterLogin, sessionKeyAdded]);
244
+ }, [closeAfterLogin, sessionKeyAdded, setB3ModalOpen]);
265
245
  const onSessionKeySuccessEnhanced = useCallback(() => {
266
246
  onSessionKeySuccess?.();
267
247
  setB3ModalContentType({
@@ -307,57 +287,21 @@ export function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySucce
307
287
  if (refetchError) {
308
288
  content = (_jsx(LoginStepContainer, { partnerId: partnerId, children: _jsx("div", { className: "p-4 text-center text-red-500", children: refetchError }) }));
309
289
  }
290
+ else if (isAuthenticating || (isFetchingSigners && step === "login") || source === "requestPermissions") {
291
+ content = (_jsx(LoginStepContainer, { partnerId: partnerId, children: _jsx("div", { className: "my-8 flex min-h-[350px] items-center justify-center", children: _jsx(Loading, { variant: "white", size: "lg" }) }) }));
292
+ }
310
293
  else if (step === "login") {
311
- // PRIORITY: If NEXT_PUBLIC_TURNKEY_PRIMARY is true, show Turnkey modal FIRST as the primary authentication option
312
- // Setting NEXT_PUBLIC_TURNKEY_PRIMARY="true" implicitly enables Turnkey
313
- const isTurnkeyPrimary = process.env.NEXT_PUBLIC_TURNKEY_PRIMARY === "true";
314
- const shouldShowTurnkeyFirst = isTurnkeyPrimary && !turnkeyAuthCompleted;
315
- if (shouldShowTurnkeyFirst) {
316
- // Don't show loading spinner for Turnkey - let the modal handle its own loading state
317
- // This prevents the infinite loop where isAuthenticating causes the modal to be replaced
318
- debug("Showing Turnkey as primary authentication option", {
319
- isTurnkeyPrimary,
320
- turnkeyAuthCompleted,
321
- isAuthenticated,
322
- });
323
- // Show Turnkey authentication as primary option
324
- content = (_jsx(LoginStepContainer, { partnerId: partnerId, children: _jsx(TurnkeyAuthModal, { onSuccess: async (authenticatedUser) => {
325
- debug("Turnkey authentication successful in primary flow", { authenticatedUser });
326
- setTurnkeyAuthCompleted(true);
327
- // After Turnkey auth, refetch user to get the full user object
328
- await refetchUser();
329
- // User is now authenticated via Turnkey
330
- // Set both isAuthenticated and isConnected to true so UI updates properly
331
- // Wallet connection is optional and can happen later for signing transactions
332
- setIsAuthenticated(true);
333
- setIsConnected(true);
334
- setJustCompletedLogin(true);
335
- // Call the login success callback
336
- onLoginSuccess?.({});
337
- }, onClose: () => {
338
- // If user closes Turnkey modal, they can still use wallet connection as fallback
339
- setTurnkeyAuthCompleted(true);
340
- }, initialEmail: "", skipToOtp: false }) }));
294
+ // Custom strategy
295
+ if (strategies?.[0] === "privy") {
296
+ content = _jsx(SignInWithB3Privy, { onSuccess: handleLoginSuccess, chain: chain });
297
+ }
298
+ else if (strategies) {
299
+ // Strategies are explicitly provided
300
+ content = (_jsx(LoginStepCustom, { strategies: strategies, chain: chain, onSuccess: handleLoginSuccess, onError: onError, automaticallySetFirstEoa: !!automaticallySetFirstEoa }));
341
301
  }
342
302
  else {
343
- // Show loading spinner only if not in Turnkey flow
344
- if (isAuthenticating || (isFetchingSigners && step === "login") || source === "requestPermissions") {
345
- content = (_jsx(LoginStepContainer, { partnerId: partnerId, children: _jsx("div", { className: "my-8 flex min-h-[350px] items-center justify-center", children: _jsx(Loading, { variant: "white", size: "lg" }) }) }));
346
- }
347
- else {
348
- // Custom strategy
349
- if (strategies?.[0] === "privy") {
350
- content = _jsx(SignInWithB3Privy, { onSuccess: handleLoginSuccess, chain: chain });
351
- }
352
- else if (strategies) {
353
- // Strategies are explicitly provided
354
- content = (_jsx(LoginStepCustom, { strategies: strategies, chain: chain, onSuccess: handleLoginSuccess, onError: onError, automaticallySetFirstEoa: !!automaticallySetFirstEoa }));
355
- }
356
- else {
357
- // Default to handle all strategies we support
358
- content = _jsx(LoginStep, { chain: chain, onSuccess: handleLoginSuccess, onError: onError });
359
- }
360
- }
303
+ // Default to handle all strategies we support
304
+ content = _jsx(LoginStep, { chain: chain, onSuccess: handleLoginSuccess, onError: onError });
361
305
  }
362
306
  }
363
307
  return content;
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Loading, useAuthentication, useAuthStore, useB3Config, useHandleConnectWithPrivy, } from "../../../../global-account/react/index.js";
2
+ import { Loading, useAuthentication, useAuthStore, useB3, useHandleConnectWithPrivy, } from "../../../../global-account/react/index.js";
3
3
  import { debugB3React } from "../../../../shared/utils/debug.js";
4
4
  import { useEffect } from "react";
5
5
  const debug = debugB3React("SignInWithB3Privy");
6
6
  export function SignInWithB3Privy({ onSuccess, onError, chain }) {
7
- const { partnerId } = useB3Config();
7
+ const { partnerId } = useB3();
8
8
  const { isLoading, connectTw, fullToken } = useHandleConnectWithPrivy(chain, onSuccess);
9
9
  const setIsAuthenticating = useAuthStore(state => state.setIsAuthenticating);
10
10
  const setIsAuthenticated = useAuthStore(state => state.setIsAuthenticated);
@@ -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,5 +1,5 @@
1
- import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useEffect, useRef, useState } from "react";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState, useEffect, useRef } from "react";
3
3
  import { useTurnkeyAuth } from "../hooks/useTurnkeyAuth.js";
4
4
  export function TurnkeyAuthModal({ onClose, onSuccess, initialEmail = "", skipToOtp = false }) {
5
5
  const [step, setStep] = useState(skipToOtp ? "otp" : "email");
@@ -77,7 +77,5 @@ export function TurnkeyAuthModal({ onClose, onSuccess, initialEmail = "", skipTo
77
77
  console.error("Failed to resend OTP:", err);
78
78
  }
79
79
  };
80
- const isTurnkeyPrimary = process.env.NEXT_PUBLIC_TURNKEY_PRIMARY === "true";
81
- const walletBrand = isTurnkeyPrimary ? "Smart Wallet" : "AnySpend Wallet";
82
- return (_jsxs("div", { className: "font-neue-montreal p-8", children: [step === "email" && (_jsxs(_Fragment, { children: [_jsxs("h2", { className: "mb-6 text-center text-2xl font-bold text-gray-900 dark:text-white", children: ["Setup your ", walletBrand] }), _jsxs("div", { className: "mb-6 space-y-3 text-center text-sm text-gray-600 dark:text-gray-400", children: [_jsxs("p", { children: [isTurnkeyPrimary ? "We use a secure," : "AnySpend uses a secure,", _jsx("br", {}), "embedded wallet to fund your workflows."] }), _jsxs("p", { children: ["Please provide an email address to secure", _jsx("br", {}), "your wallet."] })] }), _jsxs("form", { onSubmit: handleEmailSubmit, className: "space-y-4", children: [_jsx("div", { children: _jsx("input", { type: "email", placeholder: "email", value: email, onChange: e => setEmail(e.target.value), required: true, disabled: isLoading, className: "w-full rounded-lg border border-gray-300 px-4 py-3 text-center text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20 disabled:cursor-not-allowed disabled:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:text-white dark:placeholder-gray-500" }) }), error && (_jsx("div", { className: "rounded-md bg-red-50 p-3 text-sm text-red-800 dark:bg-red-900/20 dark:text-red-400", children: error })), _jsx("button", { type: "submit", disabled: isLoading || !email, className: "w-full rounded-lg bg-blue-600 px-6 py-3 font-semibold text-white transition-all duration-200 hover:bg-blue-700 disabled:cursor-not-allowed disabled:bg-gray-300 dark:disabled:bg-gray-700", children: isLoading ? (_jsxs("span", { className: "flex items-center justify-center gap-2", children: [_jsx("div", { className: "h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent" }), "Sending..."] })) : ("Continue") })] })] })), step === "otp" && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mb-4 text-center text-2xl font-bold text-gray-900 dark:text-white", children: "2FA Security" }), _jsx("div", { className: "mb-6 space-y-3 text-center text-sm text-gray-600 dark:text-gray-400", children: _jsxs("p", { children: [isTurnkeyPrimary ? "We use a secure," : "AnySpend uses a secure,", _jsx("br", {}), "embedded wallet to fund your workflows.", _jsx("br", {}), "Please provide 2FA code sent to your email."] }) }), _jsxs("form", { onSubmit: handleOtpSubmit, className: "space-y-4", children: [_jsx("div", { children: _jsx("input", { type: "text", placeholder: "Enter code", value: otpCode, onChange: e => setOtpCode(e.target.value.toUpperCase()), required: true, disabled: isLoading, autoFocus: true, className: "w-full rounded-lg border border-gray-300 px-4 py-3 text-center font-mono text-lg uppercase tracking-wider text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20 disabled:cursor-not-allowed disabled:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:text-white dark:placeholder-gray-500", maxLength: 20 }) }), error && (_jsx("div", { className: "rounded-md bg-red-50 p-3 text-sm text-red-800 dark:bg-red-900/20 dark:text-red-400", children: error })), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("button", { type: "submit", disabled: isLoading || !otpCode, className: "w-full rounded-lg bg-blue-600 px-6 py-3 font-semibold text-white transition-all duration-200 hover:bg-blue-700 disabled:cursor-not-allowed disabled:bg-gray-300 dark:disabled:bg-gray-700", children: isLoading ? (_jsxs("span", { className: "flex items-center justify-center gap-2", children: [_jsx("div", { className: "h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent" }), "Verifying..."] })) : ("Confirm") }), _jsx("button", { type: "button", onClick: handleResendOtp, disabled: isLoading, className: "text-sm text-blue-600 hover:text-blue-700 hover:underline disabled:cursor-not-allowed disabled:text-gray-400 dark:text-blue-400 dark:hover:text-blue-300", children: "Resend code" })] })] })] })), step === "success" && (_jsxs("div", { className: "text-center", children: [_jsx("div", { className: "mb-6 flex items-center justify-center", children: _jsx("div", { className: "flex h-16 w-16 items-center justify-center rounded-full bg-green-100 dark:bg-green-900/20", children: _jsx("svg", { className: "h-8 w-8 text-green-600 dark:text-green-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }) }) }), _jsx("h2", { className: "mb-2 text-2xl font-bold text-gray-900 dark:text-white", children: "Successfully Authenticated!" }), _jsx("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Redirecting..." })] }))] }));
80
+ return (_jsxs("div", { className: "font-neue-montreal p-8", children: [step === "email" && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mb-6 text-center text-2xl font-bold text-gray-900 dark:text-white", children: "Setup your AnySpend Wallet" }), _jsxs("div", { className: "mb-6 space-y-3 text-center text-sm text-gray-600 dark:text-gray-400", children: [_jsxs("p", { children: ["AnySpend uses a secure,", _jsx("br", {}), "embedded wallet to fund your workflows."] }), _jsxs("p", { children: ["Please provide an email address to secure", _jsx("br", {}), "your wallet."] })] }), _jsxs("form", { onSubmit: handleEmailSubmit, className: "space-y-4", children: [_jsx("div", { children: _jsx("input", { type: "email", placeholder: "email", value: email, onChange: e => setEmail(e.target.value), required: true, disabled: isLoading, className: "w-full rounded-lg border border-gray-300 px-4 py-3 text-center text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20 disabled:cursor-not-allowed disabled:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:text-white dark:placeholder-gray-500" }) }), error && (_jsx("div", { className: "rounded-md bg-red-50 p-3 text-sm text-red-800 dark:bg-red-900/20 dark:text-red-400", children: error })), _jsx("button", { type: "submit", disabled: isLoading || !email, className: "w-full rounded-lg bg-blue-600 px-6 py-3 font-semibold text-white transition-all duration-200 hover:bg-blue-700 disabled:cursor-not-allowed disabled:bg-gray-300 dark:disabled:bg-gray-700", children: isLoading ? (_jsxs("span", { className: "flex items-center justify-center gap-2", children: [_jsx("div", { className: "h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent" }), "Sending..."] })) : ("Continue") })] })] })), step === "otp" && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mb-4 text-center text-2xl font-bold text-gray-900 dark:text-white", children: "2FA Security" }), _jsx("div", { className: "mb-6 space-y-3 text-center text-sm text-gray-600 dark:text-gray-400", children: _jsxs("p", { children: ["AnySpend uses a secure,", _jsx("br", {}), "embedded wallet to fund your workflows.", _jsx("br", {}), "Please provide 2FA code sent to your email."] }) }), _jsxs("form", { onSubmit: handleOtpSubmit, className: "space-y-4", children: [_jsx("div", { children: _jsx("input", { type: "text", placeholder: "Enter code", value: otpCode, onChange: e => setOtpCode(e.target.value.toUpperCase()), required: true, disabled: isLoading, autoFocus: true, className: "w-full rounded-lg border border-gray-300 px-4 py-3 text-center font-mono text-lg uppercase tracking-wider text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20 disabled:cursor-not-allowed disabled:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:text-white dark:placeholder-gray-500", maxLength: 20 }) }), error && (_jsx("div", { className: "rounded-md bg-red-50 p-3 text-sm text-red-800 dark:bg-red-900/20 dark:text-red-400", children: error })), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("button", { type: "submit", disabled: isLoading || !otpCode, className: "w-full rounded-lg bg-blue-600 px-6 py-3 font-semibold text-white transition-all duration-200 hover:bg-blue-700 disabled:cursor-not-allowed disabled:bg-gray-300 dark:disabled:bg-gray-700", children: isLoading ? (_jsxs("span", { className: "flex items-center justify-center gap-2", children: [_jsx("div", { className: "h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent" }), "Verifying..."] })) : ("Confirm") }), _jsx("button", { type: "button", onClick: handleResendOtp, disabled: isLoading, className: "text-sm text-blue-600 hover:text-blue-700 hover:underline disabled:cursor-not-allowed disabled:text-gray-400 dark:text-blue-400 dark:hover:text-blue-300", children: "Resend code" })] })] })] })), step === "success" && (_jsxs("div", { className: "text-center", children: [_jsx("div", { className: "mb-6 flex items-center justify-center", children: _jsx("div", { className: "flex h-16 w-16 items-center justify-center rounded-full bg-green-100 dark:bg-green-900/20", children: _jsx("svg", { className: "h-8 w-8 text-green-600 dark:text-green-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }) }) }), _jsx("h2", { className: "mb-2 text-2xl font-bold text-gray-900 dark:text-white", children: "Successfully Authenticated!" }), _jsx("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Redirecting..." })] }))] }));
83
81
  }
@@ -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";
@@ -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";
@@ -43,4 +42,3 @@ export { useTokensFromAddress } from "./useTokensFromAddress";
43
42
  export { useTurnkeyAuth } from "./useTurnkeyAuth";
44
43
  export { useUnifiedChainSwitchAndExecute } from "./useUnifiedChainSwitchAndExecute";
45
44
  export { useURLParams } from "./useURLParams";
46
- export { useUser } from "./useUser";
@@ -3,7 +3,6 @@ export { useAccountAssets } from "./useAccountAssets.js";
3
3
  export { useAccountWallet } from "./useAccountWallet.js";
4
4
  export { useAddTWSessionKey } from "./useAddTWSessionKey.js";
5
5
  export { useAnalytics } from "./useAnalytics.js";
6
- export { useAuth } from "./useAuth.js";
7
6
  export { useAuthentication } from "./useAuthentication.js";
8
7
  export { useB3BalanceFromAddresses } from "./useB3BalanceFromAddresses.js";
9
8
  export { useB3EnsName } from "./useB3EnsName.js";
@@ -43,4 +42,3 @@ export { useTokensFromAddress } from "./useTokensFromAddress.js";
43
42
  export { useTurnkeyAuth } from "./useTurnkeyAuth.js";
44
43
  export { useUnifiedChainSwitchAndExecute } from "./useUnifiedChainSwitchAndExecute.js";
45
44
  export { useURLParams } from "./useURLParams.js";
46
- export { useUser } from "./useUser.js";
@@ -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,7 +1,4 @@
1
1
  import { Wallet } from "thirdweb/wallets";
2
- /**
3
- * @deprecated Use useAuth() with Turnkey authentication instead
4
- */
5
2
  export declare function useTWAuth(): {
6
3
  authenticate: (wallet: Wallet, partnerId: string) => Promise<import("@feathersjs/authentication").AuthenticationResult>;
7
4
  };
@@ -1,16 +1,8 @@
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 "../../../global-account/app.js";
6
2
  import debug from "../../../shared/utils/debug.js";
7
3
  import { useCallback } from "react";
8
4
  import { useSearchParam } from "./useSearchParamsSSR.js";
9
- /**
10
- * @deprecated Use useAuth() with Turnkey authentication instead
11
- */
12
5
  export function useTWAuth() {
13
- console.warn("useTWAuth is deprecated. Please migrate to useAuth() with Turnkey authentication. See useTurnkeyAuth.ts for the new implementation.");
14
6
  const referralCode = useSearchParam("referralCode");
15
7
  const authenticate = useCallback(async (wallet, partnerId) => {
16
8
  if (!wallet || !wallet?.getAuthToken?.())