@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,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 ?? [],
@@ -3,7 +3,7 @@ import { useCallback, useState } from "react";
3
3
  import app from "../../app.js";
4
4
  import { useB3Config } from "../components/index.js";
5
5
  import { useAuthStore } from "../stores/index.js";
6
- import { useAuth } from "./useAuth.js";
6
+ import { useAuthentication } from "./useAuthentication.js";
7
7
  const debug = debugB3React("useTurnkeyAuth");
8
8
  /**
9
9
  * Hook for Turnkey email-based OTP authentication
@@ -19,54 +19,29 @@ export function useTurnkeyAuth() {
19
19
  const setIsAuthenticating = useAuthStore(state => state.setIsAuthenticating);
20
20
  const setIsAuthenticated = useAuthStore(state => state.setIsAuthenticated);
21
21
  const { partnerId } = useB3Config();
22
- const { authenticate } = useAuth();
22
+ const { user } = useAuthentication(partnerId);
23
23
  /**
24
24
  * Step 1: Initiate login with email
25
- * - Calls backend turnkey-jwt strategy (init action) to create sub-org (if needed) and send OTP
25
+ * - Calls backend to create sub-org (if needed) and send OTP
26
26
  * - Returns otpId to use in verification step
27
- *
28
- * Note: Uses the turnkey-jwt authentication strategy, not the service directly.
29
- * The turnkey-jwt strategy handles both OTP flow (init/verify) and final authentication.
30
27
  */
31
28
  const initiateLogin = useCallback(async (email) => {
32
29
  setIsLoading(true);
33
30
  setError(null);
34
31
  setIsAuthenticating(true);
35
32
  try {
33
+ if (!user?.userId) {
34
+ throw new Error("User ID is required to initiate Turnkey login.");
35
+ }
36
36
  debug(`Initiating login for: ${email}`);
37
- // Use authentication service with turnkey-jwt strategy (init action)
38
- // userId is resolved from authentication context on the backend (params.user.userId)
39
- // Backend will get userId from _params.user?.userId if authenticated, or handle unauthenticated case
40
- // So we only need to send email
41
- debug(`Calling app.authenticate with turnkey-jwt strategy (init action)`, { email });
42
- const response = await app.authenticate({
43
- strategy: "turnkey-jwt",
44
- action: "init",
45
- email,
46
- });
47
- // The strategy returns the TurnkeyAuthInitResponse directly
48
- const data = response;
37
+ // Call FeathersJS service to initialize OTP
38
+ const data = await app.service("turnkey-auth").init({ email, userId: user.userId });
49
39
  debug(`OTP initialized successfully. OtpId: ${data.otpId}`);
50
40
  return data;
51
41
  }
52
42
  catch (err) {
53
43
  debug("Error initiating login:", err);
54
- // Provide more detailed error information
55
- let errorMessage = "Failed to send OTP email. Please try again.";
56
- if (err.message) {
57
- errorMessage = err.message;
58
- }
59
- else if (err.name === "TypeError" && err.message?.includes("fetch")) {
60
- errorMessage = "Network error: Unable to reach the server. Please check your connection and try again.";
61
- }
62
- else if (err.code === "ECONNREFUSED" || err.code === "ENOTFOUND") {
63
- errorMessage = "Connection error: Unable to reach the server. Please check your internet connection.";
64
- }
65
- else if (err.response) {
66
- // FeathersJS error response
67
- errorMessage = err.response.message || err.message || errorMessage;
68
- debug("FeathersJS error response:", err.response);
69
- }
44
+ const errorMessage = err.message || "Failed to send OTP email. Please try again.";
70
45
  setError(errorMessage);
71
46
  throw err;
72
47
  }
@@ -74,11 +49,11 @@ export function useTurnkeyAuth() {
74
49
  setIsLoading(false);
75
50
  setIsAuthenticating(false);
76
51
  }
77
- }, [setIsAuthenticating]);
52
+ }, [user, setIsAuthenticating]);
78
53
  /**
79
54
  * Step 2: Verify OTP and authenticate
80
- * - Verifies OTP with backend via turnkey-jwt strategy (verify action)
81
- * - Gets Turnkey session JWT from the verify response
55
+ * - Verifies OTP with backend
56
+ * - Gets Turnkey session JWT
82
57
  * - Authenticates with b3-api using "turnkey-jwt" strategy
83
58
  * - JWT automatically stored in cookies by SDK
84
59
  */
@@ -87,22 +62,19 @@ export function useTurnkeyAuth() {
87
62
  setError(null);
88
63
  setIsAuthenticating(true);
89
64
  try {
90
- debug(`Verifying OTP...`, { otpId });
91
- // Step 1: Verify OTP with backend using turnkey-jwt strategy (verify action)
92
- // This returns the Turnkey session JWT
93
- const response = await app.authenticate({
94
- strategy: "turnkey-jwt",
95
- action: "verify",
65
+ debug(`Verifying OTP...`, { userId: user?.userId });
66
+ // Step 1: Verify OTP and get Turnkey session JWT
67
+ const { turnkeySessionJwt } = await app.service("turnkey-auth").verify({
96
68
  otpId,
97
69
  otpCode,
98
70
  });
99
- // The strategy returns the TurnkeyAuthVerifyResponse directly
100
- const verifyResult = response;
101
- const { turnkeySessionJwt } = verifyResult;
102
- debug(`OTP verified! Got Turnkey session JWT. Authenticating with b3-api...`);
71
+ debug(`OTP verified! Authenticating with b3-api...`);
103
72
  // Step 2: Authenticate with b3-api using Turnkey JWT
104
- // Use the unified useAuth hook for authentication with "turnkey-jwt" strategy
105
- const authResult = await authenticate(turnkeySessionJwt, partnerId || "");
73
+ // The SDK will automatically store the b3-api JWT in cookies
74
+ const authResult = await app.authenticate({
75
+ strategy: "turnkey-jwt",
76
+ accessToken: turnkeySessionJwt,
77
+ });
106
78
  debug(`Successfully authenticated with b3-api!`, authResult);
107
79
  // Update auth store to reflect authenticated state
108
80
  setIsAuthenticated(true);
@@ -122,7 +94,7 @@ export function useTurnkeyAuth() {
122
94
  setIsLoading(false);
123
95
  setIsAuthenticating(false);
124
96
  }
125
- }, [partnerId, setIsAuthenticating, setIsAuthenticated, authenticate]);
97
+ }, [user, setIsAuthenticating, setIsAuthenticated]);
126
98
  const clearError = useCallback(() => {
127
99
  setError(null);
128
100
  }, []);
@@ -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