@b3dotfun/sdk 0.1.1-test.0 → 0.1.2-test.0

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 (255) hide show
  1. package/dist/cjs/anyspend/react/components/AnySpend.js +2 -2
  2. package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +15 -10
  3. package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +22 -14
  4. package/dist/cjs/anyspend/react/components/QRDeposit.js +31 -5
  5. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +9 -2
  6. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +1 -1
  7. package/dist/cjs/anyspend/react/components/common/PaymentStripeWeb2.js +1 -1
  8. package/dist/cjs/anyspend/react/components/common/TransferResultScreen.d.ts +22 -0
  9. package/dist/cjs/anyspend/react/components/common/TransferResultScreen.js +25 -0
  10. package/dist/cjs/anyspend/react/hooks/index.d.ts +1 -0
  11. package/dist/cjs/anyspend/react/hooks/index.js +1 -0
  12. package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +1 -1
  13. package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.js +1 -1
  14. package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.js +1 -1
  15. package/dist/cjs/anyspend/react/hooks/useValidatedClientReferenceId.js +1 -1
  16. package/dist/cjs/anyspend/react/hooks/useWatchTransfer.d.ts +41 -0
  17. package/dist/cjs/anyspend/react/hooks/useWatchTransfer.js +75 -0
  18. package/dist/cjs/anyspend/utils/address.d.ts +5 -0
  19. package/dist/cjs/anyspend/utils/address.js +8 -0
  20. package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +1 -1
  21. package/dist/cjs/global-account/react/components/B3DynamicModal.js +5 -1
  22. package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +5 -0
  23. package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.js +12 -0
  24. package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +31 -0
  25. package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.js +37 -0
  26. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +3 -18
  27. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +7 -57
  28. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.d.ts +6 -6
  29. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +11 -35
  30. package/dist/cjs/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +3 -1
  31. package/dist/cjs/global-account/react/components/B3Provider/LocalSDKProvider.js +3 -1
  32. package/dist/cjs/global-account/react/components/B3Provider/useB3.d.ts +3 -3
  33. package/dist/cjs/global-account/react/components/B3Provider/useB3.js +4 -10
  34. package/dist/cjs/global-account/react/components/B3Provider/useB3Account.js +5 -2
  35. package/dist/cjs/global-account/react/components/B3Provider/useB3Config.d.ts +1 -9
  36. package/dist/cjs/global-account/react/components/B3Provider/useB3Config.js +2 -20
  37. package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +1 -2
  38. package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +1 -1
  39. package/dist/cjs/global-account/react/components/ManageAccount/channels/DiscordChannel.js +1 -1
  40. package/dist/cjs/global-account/react/components/ManageAccount/channels/EmailChannel.js +1 -1
  41. package/dist/cjs/global-account/react/components/ManageAccount/channels/PhoneChannel.js +1 -1
  42. package/dist/cjs/global-account/react/components/ManageAccount/channels/TelegramChannel.js +1 -1
  43. package/dist/cjs/global-account/react/components/RequestPermissions/RequestPermissions.js +1 -1
  44. package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +1 -1
  45. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.d.ts +1 -1
  46. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +4 -2
  47. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +1 -1
  48. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStep.js +1 -1
  49. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +1 -1
  50. package/dist/cjs/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.d.ts +64 -0
  51. package/dist/cjs/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.js +163 -0
  52. package/dist/cjs/global-account/react/components/SingleUserSearchSelector/index.d.ts +2 -0
  53. package/dist/cjs/global-account/react/components/SingleUserSearchSelector/index.js +5 -0
  54. package/dist/cjs/global-account/react/components/StyleRoot.js +2 -2
  55. package/dist/cjs/global-account/react/components/WalletImage/WalletImage.d.ts +1 -1
  56. package/dist/cjs/global-account/react/components/custom/ManageAccountButton.js +1 -2
  57. package/dist/cjs/global-account/react/components/index.d.ts +3 -2
  58. package/dist/cjs/global-account/react/components/index.js +6 -6
  59. package/dist/cjs/global-account/react/hooks/index.d.ts +1 -0
  60. package/dist/cjs/global-account/react/hooks/index.js +3 -1
  61. package/dist/cjs/global-account/react/hooks/useAuth.d.ts +2 -2
  62. package/dist/cjs/global-account/react/hooks/useAuth.js +2 -2
  63. package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +2 -2
  64. package/dist/cjs/global-account/react/hooks/useAuthentication.js +6 -3
  65. package/dist/cjs/global-account/react/hooks/useClient.js +1 -1
  66. package/dist/cjs/global-account/react/hooks/useHandleConnectWithPrivy.js +1 -1
  67. package/dist/cjs/global-account/react/hooks/useNotifications.js +1 -1
  68. package/dist/cjs/global-account/react/hooks/useProfile.js +4 -23
  69. package/dist/cjs/global-account/react/hooks/useTokenBalance.js +5 -5
  70. package/dist/cjs/global-account/react/hooks/useTurnkeyAuth.js +1 -1
  71. package/dist/cjs/global-account/react/hooks/useUser.d.ts +60 -0
  72. package/dist/cjs/global-account/react/hooks/useUser.js +20 -0
  73. package/dist/cjs/global-account/react/hooks/useUserQuery.d.ts +6 -7
  74. package/dist/cjs/global-account/react/hooks/useUserQuery.js +64 -39
  75. package/dist/cjs/global-account/react/index.native.d.ts +0 -2
  76. package/dist/cjs/global-account/react/index.native.js +1 -5
  77. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +66 -1
  78. package/dist/cjs/global-account/react/stores/useModalStore.js +3 -0
  79. package/dist/cjs/global-account/react/stores/userStore.d.ts +22 -0
  80. package/dist/cjs/global-account/react/stores/userStore.js +30 -0
  81. package/dist/cjs/global-account/react/utils/profileApi.d.ts +13 -0
  82. package/dist/cjs/global-account/react/utils/profileApi.js +29 -0
  83. package/dist/esm/anyspend/react/components/AnySpend.js +3 -3
  84. package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +15 -10
  85. package/dist/esm/anyspend/react/components/AnySpendDeposit.js +23 -15
  86. package/dist/esm/anyspend/react/components/QRDeposit.js +32 -6
  87. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +10 -3
  88. package/dist/esm/anyspend/react/components/common/OrderDetails.js +2 -2
  89. package/dist/esm/anyspend/react/components/common/PaymentStripeWeb2.js +2 -2
  90. package/dist/esm/anyspend/react/components/common/TransferResultScreen.d.ts +22 -0
  91. package/dist/esm/anyspend/react/components/common/TransferResultScreen.js +22 -0
  92. package/dist/esm/anyspend/react/hooks/index.d.ts +1 -0
  93. package/dist/esm/anyspend/react/hooks/index.js +1 -0
  94. package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +2 -2
  95. package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.js +2 -2
  96. package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.js +2 -2
  97. package/dist/esm/anyspend/react/hooks/useValidatedClientReferenceId.js +2 -2
  98. package/dist/esm/anyspend/react/hooks/useWatchTransfer.d.ts +41 -0
  99. package/dist/esm/anyspend/react/hooks/useWatchTransfer.js +72 -0
  100. package/dist/esm/anyspend/utils/address.d.ts +5 -0
  101. package/dist/esm/anyspend/utils/address.js +7 -0
  102. package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +2 -2
  103. package/dist/esm/global-account/react/components/B3DynamicModal.js +6 -2
  104. package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +5 -0
  105. package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.js +10 -0
  106. package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +31 -0
  107. package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.js +33 -0
  108. package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +3 -18
  109. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +6 -58
  110. package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.d.ts +6 -6
  111. package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +10 -37
  112. package/dist/esm/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +3 -1
  113. package/dist/esm/global-account/react/components/B3Provider/LocalSDKProvider.js +3 -1
  114. package/dist/esm/global-account/react/components/B3Provider/useB3.d.ts +3 -3
  115. package/dist/esm/global-account/react/components/B3Provider/useB3.js +4 -10
  116. package/dist/esm/global-account/react/components/B3Provider/useB3Account.js +5 -2
  117. package/dist/esm/global-account/react/components/B3Provider/useB3Config.d.ts +1 -9
  118. package/dist/esm/global-account/react/components/B3Provider/useB3Config.js +1 -19
  119. package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +2 -3
  120. package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +2 -2
  121. package/dist/esm/global-account/react/components/ManageAccount/channels/DiscordChannel.js +2 -2
  122. package/dist/esm/global-account/react/components/ManageAccount/channels/EmailChannel.js +2 -2
  123. package/dist/esm/global-account/react/components/ManageAccount/channels/PhoneChannel.js +2 -2
  124. package/dist/esm/global-account/react/components/ManageAccount/channels/TelegramChannel.js +2 -2
  125. package/dist/esm/global-account/react/components/RequestPermissions/RequestPermissions.js +2 -2
  126. package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +2 -2
  127. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.d.ts +1 -1
  128. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +5 -3
  129. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +2 -2
  130. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStep.js +2 -2
  131. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +2 -2
  132. package/dist/esm/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.d.ts +64 -0
  133. package/dist/esm/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.js +160 -0
  134. package/dist/esm/global-account/react/components/SingleUserSearchSelector/index.d.ts +2 -0
  135. package/dist/esm/global-account/react/components/SingleUserSearchSelector/index.js +1 -0
  136. package/dist/esm/global-account/react/components/StyleRoot.js +2 -2
  137. package/dist/esm/global-account/react/components/WalletImage/WalletImage.d.ts +1 -1
  138. package/dist/esm/global-account/react/components/custom/ManageAccountButton.js +2 -3
  139. package/dist/esm/global-account/react/components/index.d.ts +3 -2
  140. package/dist/esm/global-account/react/components/index.js +3 -2
  141. package/dist/esm/global-account/react/hooks/index.d.ts +1 -0
  142. package/dist/esm/global-account/react/hooks/index.js +1 -0
  143. package/dist/esm/global-account/react/hooks/useAuth.d.ts +2 -2
  144. package/dist/esm/global-account/react/hooks/useAuth.js +3 -3
  145. package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +2 -2
  146. package/dist/esm/global-account/react/hooks/useAuthentication.js +6 -3
  147. package/dist/esm/global-account/react/hooks/useClient.js +2 -2
  148. package/dist/esm/global-account/react/hooks/useHandleConnectWithPrivy.js +2 -2
  149. package/dist/esm/global-account/react/hooks/useNotifications.js +2 -2
  150. package/dist/esm/global-account/react/hooks/useProfile.js +1 -20
  151. package/dist/esm/global-account/react/hooks/useTokenBalance.js +6 -6
  152. package/dist/esm/global-account/react/hooks/useTurnkeyAuth.js +2 -2
  153. package/dist/esm/global-account/react/hooks/useUser.d.ts +60 -0
  154. package/dist/esm/global-account/react/hooks/useUser.js +17 -0
  155. package/dist/esm/global-account/react/hooks/useUserQuery.d.ts +6 -7
  156. package/dist/esm/global-account/react/hooks/useUserQuery.js +63 -37
  157. package/dist/esm/global-account/react/index.native.d.ts +0 -2
  158. package/dist/esm/global-account/react/index.native.js +0 -2
  159. package/dist/esm/global-account/react/stores/useModalStore.d.ts +66 -1
  160. package/dist/esm/global-account/react/stores/useModalStore.js +3 -0
  161. package/dist/esm/global-account/react/stores/userStore.d.ts +22 -0
  162. package/dist/esm/global-account/react/stores/userStore.js +27 -0
  163. package/dist/esm/global-account/react/utils/profileApi.d.ts +13 -0
  164. package/dist/esm/global-account/react/utils/profileApi.js +25 -0
  165. package/dist/styles/index.css +1 -1
  166. package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +15 -10
  167. package/dist/types/anyspend/react/components/common/TransferResultScreen.d.ts +22 -0
  168. package/dist/types/anyspend/react/hooks/index.d.ts +1 -0
  169. package/dist/types/anyspend/react/hooks/useWatchTransfer.d.ts +41 -0
  170. package/dist/types/anyspend/utils/address.d.ts +5 -0
  171. package/dist/types/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +5 -0
  172. package/dist/types/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +31 -0
  173. package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +3 -18
  174. package/dist/types/global-account/react/components/B3Provider/B3Provider.native.d.ts +6 -6
  175. package/dist/types/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +3 -1
  176. package/dist/types/global-account/react/components/B3Provider/useB3.d.ts +3 -3
  177. package/dist/types/global-account/react/components/B3Provider/useB3Config.d.ts +1 -9
  178. package/dist/types/global-account/react/components/SignInWithB3/SignInWithB3Flow.d.ts +1 -1
  179. package/dist/types/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.d.ts +64 -0
  180. package/dist/types/global-account/react/components/SingleUserSearchSelector/index.d.ts +2 -0
  181. package/dist/types/global-account/react/components/WalletImage/WalletImage.d.ts +1 -1
  182. package/dist/types/global-account/react/components/index.d.ts +3 -2
  183. package/dist/types/global-account/react/hooks/index.d.ts +1 -0
  184. package/dist/types/global-account/react/hooks/useAuth.d.ts +2 -2
  185. package/dist/types/global-account/react/hooks/useAuthentication.d.ts +2 -2
  186. package/dist/types/global-account/react/hooks/useUser.d.ts +60 -0
  187. package/dist/types/global-account/react/hooks/useUserQuery.d.ts +6 -7
  188. package/dist/types/global-account/react/index.native.d.ts +0 -2
  189. package/dist/types/global-account/react/stores/useModalStore.d.ts +66 -1
  190. package/dist/types/global-account/react/stores/userStore.d.ts +22 -0
  191. package/dist/types/global-account/react/utils/profileApi.d.ts +13 -0
  192. package/package.json +6 -1
  193. package/src/anyspend/react/components/AnySpend.tsx +3 -2
  194. package/src/anyspend/react/components/AnySpendDeposit.tsx +60 -42
  195. package/src/anyspend/react/components/QRDeposit.tsx +57 -5
  196. package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +13 -3
  197. package/src/anyspend/react/components/common/OrderDetails.tsx +2 -2
  198. package/src/anyspend/react/components/common/PaymentStripeWeb2.tsx +2 -2
  199. package/src/anyspend/react/components/common/TransferResultScreen.tsx +107 -0
  200. package/src/anyspend/react/hooks/index.ts +1 -0
  201. package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +2 -2
  202. package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +2 -2
  203. package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +2 -2
  204. package/src/anyspend/react/hooks/useValidatedClientReferenceId.ts +2 -2
  205. package/src/anyspend/react/hooks/useWatchTransfer.ts +114 -0
  206. package/src/anyspend/utils/address.ts +13 -0
  207. package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +2 -2
  208. package/src/global-account/react/components/B3DynamicModal.tsx +6 -2
  209. package/src/global-account/react/components/B3Provider/AuthenticationProvider.tsx +19 -0
  210. package/src/global-account/react/components/B3Provider/B3ConfigProvider.tsx +84 -0
  211. package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +26 -45
  212. package/src/global-account/react/components/B3Provider/B3Provider.tsx +15 -103
  213. package/src/global-account/react/components/B3Provider/LocalSDKProvider.tsx +5 -0
  214. package/src/global-account/react/components/B3Provider/useB3.ts +4 -12
  215. package/src/global-account/react/components/B3Provider/useB3Account.ts +6 -2
  216. package/src/global-account/react/components/B3Provider/useB3Config.ts +1 -34
  217. package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +2 -4
  218. package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +2 -2
  219. package/src/global-account/react/components/ManageAccount/channels/DiscordChannel.tsx +2 -2
  220. package/src/global-account/react/components/ManageAccount/channels/EmailChannel.tsx +2 -2
  221. package/src/global-account/react/components/ManageAccount/channels/PhoneChannel.tsx +2 -2
  222. package/src/global-account/react/components/ManageAccount/channels/TelegramChannel.tsx +2 -2
  223. package/src/global-account/react/components/RequestPermissions/RequestPermissions.tsx +2 -2
  224. package/src/global-account/react/components/SignInWithB3/SignIn.tsx +2 -2
  225. package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +7 -3
  226. package/src/global-account/react/components/SignInWithB3/SignInWithB3Privy.tsx +2 -2
  227. package/src/global-account/react/components/SignInWithB3/steps/LoginStep.tsx +2 -2
  228. package/src/global-account/react/components/SignInWithB3/steps/LoginStepCustom.tsx +2 -2
  229. package/src/global-account/react/components/SingleUserSearchSelector/README.md +266 -0
  230. package/src/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.tsx +330 -0
  231. package/src/global-account/react/components/SingleUserSearchSelector/index.ts +2 -0
  232. package/src/global-account/react/components/StyleRoot.tsx +2 -2
  233. package/src/global-account/react/components/custom/ManageAccountButton.tsx +2 -3
  234. package/src/global-account/react/components/index.ts +8 -2
  235. package/src/global-account/react/hooks/index.ts +1 -0
  236. package/src/global-account/react/hooks/useAuth.ts +3 -3
  237. package/src/global-account/react/hooks/useAuthentication.ts +7 -3
  238. package/src/global-account/react/hooks/useClient.ts +2 -2
  239. package/src/global-account/react/hooks/useHandleConnectWithPrivy.tsx +2 -2
  240. package/src/global-account/react/hooks/useNotifications.ts +2 -2
  241. package/src/global-account/react/hooks/useProfile.ts +1 -32
  242. package/src/global-account/react/hooks/useTokenBalance.tsx +8 -7
  243. package/src/global-account/react/hooks/useTurnkeyAuth.ts +2 -2
  244. package/src/global-account/react/hooks/useUser.ts +20 -0
  245. package/src/global-account/react/hooks/useUserQuery.ts +64 -51
  246. package/src/global-account/react/index.native.ts +0 -2
  247. package/src/global-account/react/stores/useModalStore.ts +70 -1
  248. package/src/global-account/react/stores/userStore.ts +41 -0
  249. package/src/global-account/react/utils/profileApi.ts +38 -0
  250. package/dist/cjs/global-account/react/components/B3Provider/types.d.ts +0 -27
  251. package/dist/cjs/global-account/react/components/B3Provider/types.js +0 -24
  252. package/dist/esm/global-account/react/components/B3Provider/types.d.ts +0 -27
  253. package/dist/esm/global-account/react/components/B3Provider/types.js +0 -21
  254. package/dist/types/global-account/react/components/B3Provider/types.d.ts +0 -27
  255. package/src/global-account/react/components/B3Provider/types.ts +0 -50
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Preferred Hook to get the user data
3
+ */
4
+ export declare function useUser(): {
5
+ user: {
6
+ email?: string | undefined;
7
+ username?: string | undefined;
8
+ telNumber?: string | undefined;
9
+ ens?: string | undefined;
10
+ avatar?: string | undefined;
11
+ preferences?: {} | undefined;
12
+ referredBy?: string | {} | undefined;
13
+ sourceApp?: string | undefined;
14
+ referralCode?: string | undefined;
15
+ userGroups?: number[] | undefined;
16
+ isMigratedFromBSMNT?: boolean | undefined;
17
+ privyLinkedAccounts?: {
18
+ name?: string | undefined;
19
+ address?: string | undefined;
20
+ email?: string | undefined;
21
+ chain_type?: string | undefined;
22
+ lv?: number | undefined;
23
+ wallet_client_type?: string | undefined;
24
+ smart_wallet_type?: string | undefined;
25
+ subject?: string | undefined;
26
+ type: string;
27
+ }[] | undefined;
28
+ twProfiles?: {
29
+ type: string;
30
+ details: {
31
+ id?: string | undefined;
32
+ name?: string | undefined;
33
+ address?: string | undefined;
34
+ email?: string | undefined;
35
+ username?: string | undefined;
36
+ phone?: string | undefined;
37
+ fid?: string | undefined;
38
+ };
39
+ }[] | undefined;
40
+ turnkeySubOrgs?: {
41
+ hasDelegatedUser?: boolean | undefined;
42
+ subOrgId: string;
43
+ accounts: Record<string, any>[];
44
+ }[] | undefined;
45
+ _id: string | {};
46
+ userId: string;
47
+ smartAccountAddress: string;
48
+ createdAt: number;
49
+ updatedAt: number;
50
+ partnerIds: {
51
+ privyId?: string | undefined;
52
+ thirdwebId?: string | undefined;
53
+ turnkeyId?: string | undefined;
54
+ turnkeyOtpId?: string | undefined;
55
+ };
56
+ } | null;
57
+ isConnecting: boolean;
58
+ isConnected: boolean;
59
+ isAuthenticating: boolean;
60
+ };
@@ -0,0 +1,17 @@
1
+ import { useAuthStore } from "../../../global-account/react/index.js";
2
+ import { useUserStore } from "../stores/userStore.js";
3
+ /**
4
+ * Preferred Hook to get the user data
5
+ */
6
+ export function useUser() {
7
+ const user = useUserStore(state => state.user);
8
+ const isConnecting = useAuthStore(state => state.isConnecting);
9
+ const isConnected = useAuthStore(state => state.isConnected);
10
+ const isAuthenticating = useAuthStore(state => state.isAuthenticating);
11
+ return {
12
+ user,
13
+ isConnecting,
14
+ isConnected,
15
+ isAuthenticating,
16
+ };
17
+ }
@@ -1,11 +1,9 @@
1
1
  import { Users } from "@b3dotfun/b3-api";
2
- declare const USER_QUERY_KEY: string[];
3
2
  /**
4
3
  * NOTE: THIS IS ONLY MEANT FOR INTERNAL USE, from useOnConnect
5
4
  *
6
- * Hook to query and manage user data
7
- * Provides user state and methods to update it
8
- * Uses Zustand store with persistence to localStorage
5
+ * Custom hook to manage user state with Zustand
6
+ * This allows for invalidation and refetching of user data
9
7
  */
10
8
  export declare function useUserQuery(): {
11
9
  user: {
@@ -59,8 +57,9 @@ export declare function useUserQuery(): {
59
57
  turnkeyId?: string | undefined;
60
58
  turnkeyOtpId?: string | undefined;
61
59
  };
62
- } | null;
63
- setUser: (user: Users | undefined) => void;
60
+ } | undefined;
61
+ setUser: (newUser?: Users) => void;
62
+ refetchUser: () => Promise<any>;
64
63
  clearUser: () => void;
64
+ queryKey: string[];
65
65
  };
66
- export { USER_QUERY_KEY };
@@ -1,52 +1,78 @@
1
- import { debugB3React } from "../../../shared/utils/debug.js";
2
1
  import { useEffect } from "react";
3
- import { create } from "zustand";
4
- import { persist } from "zustand/middleware";
5
- const debug = debugB3React("useUserQuery");
2
+ import { useUserStore } from "../stores/userStore.js";
6
3
  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
- }));
30
4
  /**
31
5
  * NOTE: THIS IS ONLY MEANT FOR INTERNAL USE, from useOnConnect
32
6
  *
33
- * Hook to query and manage user data
34
- * Provides user state and methods to update it
35
- * Uses Zustand store with persistence to localStorage
7
+ * Custom hook to manage user state with Zustand
8
+ * This allows for invalidation and refetching of user data
36
9
  */
37
10
  export function useUserQuery() {
38
11
  const user = useUserStore(state => state.user);
39
- const setUser = useUserStore(state => state.setUser);
40
- const clearUser = useUserStore(state => state.clearUser);
12
+ const setUserStore = useUserStore(state => state.setUser);
13
+ const clearUserStore = useUserStore(state => state.clearUser);
14
+ // Listen for storage events from other tabs/windows
41
15
  useEffect(() => {
42
- if (user) {
43
- debug("User loaded from store", user);
16
+ const handleStorageChange = (e) => {
17
+ if (e.key === "b3-user") {
18
+ // Sync with changes from other tabs/windows
19
+ const stored = e.newValue;
20
+ if (stored) {
21
+ try {
22
+ const parsed = JSON.parse(stored);
23
+ // Zustand persist format: { state: { user: ... }, version: ... }
24
+ const userData = parsed?.state?.user ?? parsed?.user ?? null;
25
+ useUserStore.setState({ user: userData });
26
+ }
27
+ catch (error) {
28
+ console.warn("Failed to parse user from storage event:", error);
29
+ }
30
+ }
31
+ else {
32
+ useUserStore.setState({ user: null });
33
+ }
34
+ }
35
+ };
36
+ window.addEventListener("storage", handleStorageChange);
37
+ return () => {
38
+ window.removeEventListener("storage", handleStorageChange);
39
+ };
40
+ }, []);
41
+ // Helper function to set user (maintains backward compatibility)
42
+ const setUser = (newUser) => {
43
+ setUserStore(newUser);
44
+ };
45
+ // Helper function to invalidate and refetch user
46
+ const refetchUser = async () => {
47
+ // Re-read from localStorage and update store
48
+ // Zustand persist stores data as { state: { user: ... }, version: ... }
49
+ const stored = localStorage.getItem("b3-user");
50
+ if (stored) {
51
+ try {
52
+ const parsed = JSON.parse(stored);
53
+ // Zustand persist format: { state: { user: ... }, version: ... }
54
+ const userData = parsed?.state?.user ?? parsed?.user ?? null;
55
+ useUserStore.setState({ user: userData });
56
+ return userData ?? undefined;
57
+ }
58
+ catch (error) {
59
+ console.warn("Failed to refetch user from localStorage:", error);
60
+ // Fallback to current store state
61
+ return useUserStore.getState().user ?? undefined;
62
+ }
44
63
  }
45
- }, [user]);
64
+ useUserStore.setState({ user: null });
65
+ return undefined;
66
+ };
67
+ // Helper function to clear user
68
+ const clearUser = () => {
69
+ clearUserStore();
70
+ };
46
71
  return {
47
- user,
72
+ user: user ?? undefined,
48
73
  setUser,
74
+ refetchUser,
49
75
  clearUser,
76
+ queryKey: USER_QUERY_KEY,
50
77
  };
51
78
  }
52
- export { USER_QUERY_KEY };
@@ -1,6 +1,4 @@
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";
4
2
  export { useAccountWallet } from "./hooks/useAccountWallet";
5
3
  export { useAuthentication } from "./hooks/useAuthentication";
6
4
  export { useProfile } from "./hooks/useProfile";
@@ -3,8 +3,6 @@
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";
8
6
  export { useAccountWallet } from "./hooks/useAccountWallet.js";
9
7
  export { useAuthentication } from "./hooks/useAuthentication.js";
10
8
  export { useProfile } from "./hooks/useProfile.js";
@@ -1,3 +1,4 @@
1
+ import { Users } from "@b3dotfun/b3-api";
1
2
  import { components } from "../../../anyspend/types/api";
2
3
  import { GenerateSigMintResponse } from "../../../anyspend/types/signatureMint";
3
4
  import { AllowedStrategy } from "../../../global-account/react";
@@ -40,6 +41,8 @@ export interface SignInWithB3ModalProps extends BaseModalProps {
40
41
  source?: "signInWithB3Button" | "requestPermissions";
41
42
  /** Whether to show the signers enabled modal */
42
43
  signersEnabled?: boolean;
44
+ /** Callback for turnkey auth */
45
+ onTurnkeyConnect?: (user: Users) => void;
43
46
  }
44
47
  /**
45
48
  * Props for the Turnkey Authentication modal
@@ -482,10 +485,70 @@ export interface AnySpendCollectorClubPurchaseProps extends BaseModalProps {
482
485
  /** Force fiat payment */
483
486
  forceFiatPayment?: boolean;
484
487
  }
488
+ /**
489
+ * Props for the AnySpend Deposit modal
490
+ * Flexible deposit component with optional chain selection
491
+ */
492
+ export interface AnySpendDepositModalProps extends BaseModalProps {
493
+ /** Modal type identifier */
494
+ type: "anySpendDeposit";
495
+ /** Order ID to load an existing order */
496
+ loadOrder?: string;
497
+ /** The recipient address for the deposit */
498
+ recipientAddress: string;
499
+ /** Payment type - crypto or fiat. If not set, shows chain selection first */
500
+ paymentType?: "crypto" | "fiat";
501
+ /** Source token address to pre-select */
502
+ sourceTokenAddress?: string;
503
+ /** Source chain ID to pre-select. If not provided, shows chain selection */
504
+ sourceTokenChainId?: number;
505
+ /** The destination token address */
506
+ destinationTokenAddress: string;
507
+ /** The destination chain ID */
508
+ destinationTokenChainId: number;
509
+ /** Callback when deposit succeeds */
510
+ onSuccess?: (amount: string) => void;
511
+ /** Callback for opening a custom modal (e.g., for special token handling) */
512
+ onOpenCustomModal?: () => void;
513
+ /** Custom footer content */
514
+ mainFooter?: React.ReactNode;
515
+ /** Called when a token is selected. Call event.preventDefault() to prevent default behavior */
516
+ onTokenSelect?: (token: components["schemas"]["Token"], event: {
517
+ preventDefault: () => void;
518
+ }) => void;
519
+ /** Custom USD input value presets for fiat payment */
520
+ customUsdInputValues?: string[];
521
+ /** Whether to prefer using connected EOA wallet */
522
+ preferEoa?: boolean;
523
+ /** Minimum destination amount required */
524
+ minDestinationAmount?: number;
525
+ /** Order type for the deposit */
526
+ orderType?: "hype_duel" | "custom_exact_in" | "swap";
527
+ /** Custom action label displayed on buttons */
528
+ actionLabel?: string;
529
+ /** Whether to show chain selection step. Defaults to true if sourceTokenChainId is not provided */
530
+ showChainSelection?: boolean;
531
+ /** Minimum pool size for filtering tokens (default: 1,000,000) */
532
+ minPoolSize?: number;
533
+ /** Custom title for chain selection step */
534
+ chainSelectionTitle?: string;
535
+ /** Custom description for chain selection step */
536
+ chainSelectionDescription?: string;
537
+ /** Number of top chains to show (default: 3) */
538
+ topChainsCount?: number;
539
+ /** Custom URL to redirect to when clicking "Return to Home" on complete order screen */
540
+ returnToHomeUrl?: string;
541
+ /** Custom label for recipient display (e.g., "OBSN Telegram Bot") */
542
+ customRecipientLabel?: string;
543
+ /** Custom label for the return home button (overrides "Return to Home" / "Close") */
544
+ returnHomeLabel?: string;
545
+ /** Whether the deposit requires a custom function (uses AnySpendCustomExactIn). Defaults to false. */
546
+ isCustomDeposit?: boolean;
547
+ }
485
548
  /**
486
549
  * Union type of all possible modal content types
487
550
  */
488
- export type ModalContentType = SignInWithB3ModalProps | TurnkeyAuthModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | AnySpendCollectorClubPurchaseProps;
551
+ export type ModalContentType = SignInWithB3ModalProps | TurnkeyAuthModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | AnySpendCollectorClubPurchaseProps | AnySpendDepositModalProps;
489
552
  /**
490
553
  * State interface for the modal store
491
554
  */
@@ -514,6 +577,8 @@ interface ModalState {
514
577
  linkingMethod: string | null;
515
578
  /** Function to set the linking state */
516
579
  setLinkingState: (isLinking: boolean, method?: string | null) => void;
580
+ /** Function to update closable property of current content without adding to history */
581
+ setClosable: (closable: boolean) => void;
517
582
  }
518
583
  /**
519
584
  * Zustand store for managing modal state
@@ -33,4 +33,7 @@ export const useModalStore = create(set => ({
33
33
  isLinking: false,
34
34
  linkingMethod: null,
35
35
  setLinkingState: (isLinking, method = null) => set({ isLinking, linkingMethod: isLinking ? method : null }),
36
+ setClosable: (closable) => set(state => ({
37
+ contentType: state.contentType ? { ...state.contentType, closable } : null,
38
+ })),
36
39
  }));
@@ -0,0 +1,22 @@
1
+ import { Users } from "@b3dotfun/b3-api";
2
+ interface UserStore {
3
+ user: Users | null;
4
+ setUser: (user: Users | undefined) => void;
5
+ clearUser: () => void;
6
+ }
7
+ /**
8
+ * Zustand store for managing user state
9
+ * Persists user data to localStorage
10
+ */
11
+ export declare const useUserStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<UserStore>, "persist"> & {
12
+ persist: {
13
+ setOptions: (options: Partial<import("zustand/middleware").PersistOptions<UserStore, UserStore>>) => void;
14
+ clearStorage: () => void;
15
+ rehydrate: () => Promise<void> | void;
16
+ hasHydrated: () => boolean;
17
+ onHydrate: (fn: (state: UserStore) => void) => () => void;
18
+ onFinishHydration: (fn: (state: UserStore) => void) => () => void;
19
+ getOptions: () => Partial<import("zustand/middleware").PersistOptions<UserStore, UserStore>>;
20
+ };
21
+ }>;
22
+ export {};
@@ -0,0 +1,27 @@
1
+ import { debugB3React } from "../../../shared/utils/debug.js";
2
+ import { create } from "zustand";
3
+ import { persist } from "zustand/middleware";
4
+ const debug = debugB3React("useUserQuery");
5
+ /**
6
+ * Zustand store for managing user state
7
+ * Persists user data to localStorage
8
+ */
9
+ export const useUserStore = create()(persist(set => ({
10
+ user: null,
11
+ setUser: (newUser) => {
12
+ const userToSave = newUser ?? null;
13
+ set({ user: userToSave });
14
+ debug("User updated", userToSave);
15
+ },
16
+ clearUser: () => {
17
+ set({ user: null });
18
+ debug("User cleared");
19
+ },
20
+ }), {
21
+ name: "b3-user",
22
+ onRehydrateStorage: () => (_, error) => {
23
+ if (error) {
24
+ console.warn("Failed to rehydrate user store:", error);
25
+ }
26
+ },
27
+ }));
@@ -0,0 +1,13 @@
1
+ import type { CombinedProfile } from "../hooks/useProfile";
2
+ export declare const PROFILES_API_URL = "https://profiles.b3.fun";
3
+ /**
4
+ * Fetch a user profile from the B3 Profiles API
5
+ * @param params - Search parameters (address, name, or b3GlobalId)
6
+ * @returns Promise resolving to CombinedProfile or null if not found
7
+ */
8
+ export declare function fetchProfile({ address, name, b3GlobalId, fresh, }: {
9
+ address?: string;
10
+ name?: string;
11
+ b3GlobalId?: string;
12
+ fresh?: boolean;
13
+ }): Promise<CombinedProfile>;
@@ -0,0 +1,25 @@
1
+ export const PROFILES_API_URL = "https://profiles.b3.fun";
2
+ /**
3
+ * Fetch a user profile from the B3 Profiles API
4
+ * @param params - Search parameters (address, name, or b3GlobalId)
5
+ * @returns Promise resolving to CombinedProfile or null if not found
6
+ */
7
+ export async function fetchProfile({ address, name, b3GlobalId, fresh = false, }) {
8
+ if (!address && !name && !b3GlobalId) {
9
+ throw new Error("Either address or name or b3GlobalId must be provided");
10
+ }
11
+ const params = new URLSearchParams();
12
+ if (address)
13
+ params.append("address", address);
14
+ if (name)
15
+ params.append("name", name);
16
+ if (b3GlobalId)
17
+ params.append("b3GlobalId", b3GlobalId);
18
+ if (fresh)
19
+ params.append("fresh", "true");
20
+ const response = await fetch(`${PROFILES_API_URL}?${params.toString()}`);
21
+ if (!response.ok) {
22
+ throw new Error(`Failed to fetch profile: ${response.statusText}`);
23
+ }
24
+ return response.json();
25
+ }