@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
@@ -9,7 +9,7 @@ const thirdweb_insights_1 = require("../../../shared/utils/thirdweb-insights");
9
9
  const react_query_1 = require("@tanstack/react-query");
10
10
  const react_2 = require("react");
11
11
  function useTokenBalance({ token, address }) {
12
- const { ready } = (0, react_1.useB3)();
12
+ const isAuthenticated = (0, react_1.useAuthStore)(state => state.isAuthenticated);
13
13
  const account = (0, react_1.useAccountWallet)();
14
14
  const effectiveAddress = address || account?.address;
15
15
  const { data: tokenBalance, isLoading, isFetching, refetch, } = (0, react_query_1.useQuery)({
@@ -41,7 +41,7 @@ function useTokenBalance({ token, address }) {
41
41
  }
42
42
  return { formatted: "0", raw: null };
43
43
  },
44
- enabled: ready && !!effectiveAddress,
44
+ enabled: isAuthenticated && !!effectiveAddress,
45
45
  staleTime: 30000,
46
46
  gcTime: 5 * 60 * 1000,
47
47
  retry: 2,
@@ -49,12 +49,12 @@ function useTokenBalance({ token, address }) {
49
49
  });
50
50
  // Force a refetch when the wallet or token changes
51
51
  (0, react_2.useEffect)(() => {
52
- if (ready && effectiveAddress) {
52
+ if (isAuthenticated && effectiveAddress) {
53
53
  refetch();
54
54
  }
55
- }, [ready, effectiveAddress, token.address, token.chainId, token.symbol, refetch]);
55
+ }, [isAuthenticated, effectiveAddress, token.address, token.chainId, token.symbol, refetch]);
56
56
  // Determine if we're actually loading
57
- const isActuallyLoading = !ready || !effectiveAddress || isLoading || (isFetching && !tokenBalance);
57
+ const isActuallyLoading = !isAuthenticated || !effectiveAddress || isLoading || (isFetching && !tokenBalance);
58
58
  return {
59
59
  rawBalance: tokenBalance?.raw || BigInt(0),
60
60
  formattedBalance: tokenBalance?.formatted || "0",
@@ -24,7 +24,7 @@ function useTurnkeyAuth() {
24
24
  const [error, setError] = (0, react_1.useState)(null);
25
25
  const setIsAuthenticating = (0, stores_1.useAuthStore)(state => state.setIsAuthenticating);
26
26
  const setIsAuthenticated = (0, stores_1.useAuthStore)(state => state.setIsAuthenticated);
27
- const { partnerId } = (0, components_1.useB3)();
27
+ const { partnerId } = (0, components_1.useB3Config)();
28
28
  const { authenticate } = (0, useAuth_1.useAuth)();
29
29
  /**
30
30
  * Step 1: Initiate login with email
@@ -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,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useUser = useUser;
4
+ const react_1 = require("../../../global-account/react");
5
+ const userStore_1 = require("../stores/userStore");
6
+ /**
7
+ * Preferred Hook to get the user data
8
+ */
9
+ function useUser() {
10
+ const user = (0, userStore_1.useUserStore)(state => state.user);
11
+ const isConnecting = (0, react_1.useAuthStore)(state => state.isConnecting);
12
+ const isConnected = (0, react_1.useAuthStore)(state => state.isConnected);
13
+ const isAuthenticating = (0, react_1.useAuthStore)(state => state.isAuthenticating);
14
+ return {
15
+ user,
16
+ isConnecting,
17
+ isConnected,
18
+ isAuthenticating,
19
+ };
20
+ }
@@ -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,56 +1,81 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.USER_QUERY_KEY = void 0;
4
3
  exports.useUserQuery = useUserQuery;
5
- const debug_1 = require("../../../shared/utils/debug");
6
4
  const react_1 = require("react");
7
- const zustand_1 = require("zustand");
8
- const middleware_1 = require("zustand/middleware");
9
- const debug = (0, debug_1.debugB3React)("useUserQuery");
5
+ const userStore_1 = require("../stores/userStore");
10
6
  const USER_QUERY_KEY = ["b3-user"];
11
- exports.USER_QUERY_KEY = USER_QUERY_KEY;
12
- /**
13
- * Zustand store for managing user state
14
- * Persists user data to localStorage
15
- */
16
- const useUserStore = (0, zustand_1.create)()((0, middleware_1.persist)(set => ({
17
- user: null,
18
- setUser: (newUser) => {
19
- const userToSave = newUser ?? null;
20
- set({ user: userToSave });
21
- debug("User updated", userToSave);
22
- },
23
- clearUser: () => {
24
- set({ user: null });
25
- debug("User cleared");
26
- },
27
- }), {
28
- name: "b3-user",
29
- onRehydrateStorage: () => (_, error) => {
30
- if (error) {
31
- console.warn("Failed to rehydrate user store:", error);
32
- }
33
- },
34
- }));
35
7
  /**
36
8
  * NOTE: THIS IS ONLY MEANT FOR INTERNAL USE, from useOnConnect
37
9
  *
38
- * Hook to query and manage user data
39
- * Provides user state and methods to update it
40
- * Uses Zustand store with persistence to localStorage
10
+ * Custom hook to manage user state with Zustand
11
+ * This allows for invalidation and refetching of user data
41
12
  */
42
13
  function useUserQuery() {
43
- const user = useUserStore(state => state.user);
44
- const setUser = useUserStore(state => state.setUser);
45
- const clearUser = useUserStore(state => state.clearUser);
14
+ const user = (0, userStore_1.useUserStore)(state => state.user);
15
+ const setUserStore = (0, userStore_1.useUserStore)(state => state.setUser);
16
+ const clearUserStore = (0, userStore_1.useUserStore)(state => state.clearUser);
17
+ // Listen for storage events from other tabs/windows
46
18
  (0, react_1.useEffect)(() => {
47
- if (user) {
48
- debug("User loaded from store", user);
19
+ const handleStorageChange = (e) => {
20
+ if (e.key === "b3-user") {
21
+ // Sync with changes from other tabs/windows
22
+ const stored = e.newValue;
23
+ if (stored) {
24
+ try {
25
+ const parsed = JSON.parse(stored);
26
+ // Zustand persist format: { state: { user: ... }, version: ... }
27
+ const userData = parsed?.state?.user ?? parsed?.user ?? null;
28
+ userStore_1.useUserStore.setState({ user: userData });
29
+ }
30
+ catch (error) {
31
+ console.warn("Failed to parse user from storage event:", error);
32
+ }
33
+ }
34
+ else {
35
+ userStore_1.useUserStore.setState({ user: null });
36
+ }
37
+ }
38
+ };
39
+ window.addEventListener("storage", handleStorageChange);
40
+ return () => {
41
+ window.removeEventListener("storage", handleStorageChange);
42
+ };
43
+ }, []);
44
+ // Helper function to set user (maintains backward compatibility)
45
+ const setUser = (newUser) => {
46
+ setUserStore(newUser);
47
+ };
48
+ // Helper function to invalidate and refetch user
49
+ const refetchUser = async () => {
50
+ // Re-read from localStorage and update store
51
+ // Zustand persist stores data as { state: { user: ... }, version: ... }
52
+ const stored = localStorage.getItem("b3-user");
53
+ if (stored) {
54
+ try {
55
+ const parsed = JSON.parse(stored);
56
+ // Zustand persist format: { state: { user: ... }, version: ... }
57
+ const userData = parsed?.state?.user ?? parsed?.user ?? null;
58
+ userStore_1.useUserStore.setState({ user: userData });
59
+ return userData ?? undefined;
60
+ }
61
+ catch (error) {
62
+ console.warn("Failed to refetch user from localStorage:", error);
63
+ // Fallback to current store state
64
+ return userStore_1.useUserStore.getState().user ?? undefined;
65
+ }
49
66
  }
50
- }, [user]);
67
+ userStore_1.useUserStore.setState({ user: null });
68
+ return undefined;
69
+ };
70
+ // Helper function to clear user
71
+ const clearUser = () => {
72
+ clearUserStore();
73
+ };
51
74
  return {
52
- user,
75
+ user: user ?? undefined,
53
76
  setUser,
77
+ refetchUser,
54
78
  clearUser,
79
+ queryKey: USER_QUERY_KEY,
55
80
  };
56
81
  }
@@ -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,14 +3,10 @@
3
3
  // export * from "./hooks";
4
4
  // export * from "./stores";
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.useAuthStore = exports.useSiwe = exports.useProfile = exports.useAuthentication = exports.useAccountWallet = exports.useB3 = exports.B3Context = exports.B3Provider = void 0;
6
+ exports.useAuthStore = exports.useSiwe = exports.useProfile = exports.useAuthentication = exports.useAccountWallet = exports.B3Provider = void 0;
7
7
  // We only export the components and hooks that are needed for the native app
8
8
  var B3Provider_native_1 = require("./components/B3Provider/B3Provider.native");
9
9
  Object.defineProperty(exports, "B3Provider", { enumerable: true, get: function () { return B3Provider_native_1.B3Provider; } });
10
- var types_1 = require("./components/B3Provider/types");
11
- Object.defineProperty(exports, "B3Context", { enumerable: true, get: function () { return types_1.B3Context; } });
12
- var useB3_1 = require("./components/B3Provider/useB3");
13
- Object.defineProperty(exports, "useB3", { enumerable: true, get: function () { return useB3_1.useB3; } });
14
10
  var useAccountWallet_1 = require("./hooks/useAccountWallet");
15
11
  Object.defineProperty(exports, "useAccountWallet", { enumerable: true, get: function () { return useAccountWallet_1.useAccountWallet; } });
16
12
  var useAuthentication_1 = require("./hooks/useAuthentication");
@@ -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
@@ -36,4 +36,7 @@ exports.useModalStore = (0, zustand_1.create)(set => ({
36
36
  isLinking: false,
37
37
  linkingMethod: null,
38
38
  setLinkingState: (isLinking, method = null) => set({ isLinking, linkingMethod: isLinking ? method : null }),
39
+ setClosable: (closable) => set(state => ({
40
+ contentType: state.contentType ? { ...state.contentType, closable } : null,
41
+ })),
39
42
  }));
@@ -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,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useUserStore = void 0;
4
+ const debug_1 = require("../../../shared/utils/debug");
5
+ const zustand_1 = require("zustand");
6
+ const middleware_1 = require("zustand/middleware");
7
+ const debug = (0, debug_1.debugB3React)("useUserQuery");
8
+ /**
9
+ * Zustand store for managing user state
10
+ * Persists user data to localStorage
11
+ */
12
+ exports.useUserStore = (0, zustand_1.create)()((0, middleware_1.persist)(set => ({
13
+ user: null,
14
+ setUser: (newUser) => {
15
+ const userToSave = newUser ?? null;
16
+ set({ user: userToSave });
17
+ debug("User updated", userToSave);
18
+ },
19
+ clearUser: () => {
20
+ set({ user: null });
21
+ debug("User cleared");
22
+ },
23
+ }), {
24
+ name: "b3-user",
25
+ onRehydrateStorage: () => (_, error) => {
26
+ if (error) {
27
+ console.warn("Failed to rehydrate user store:", error);
28
+ }
29
+ },
30
+ }));
@@ -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,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PROFILES_API_URL = void 0;
4
+ exports.fetchProfile = fetchProfile;
5
+ exports.PROFILES_API_URL = "https://profiles.b3.fun";
6
+ /**
7
+ * Fetch a user profile from the B3 Profiles API
8
+ * @param params - Search parameters (address, name, or b3GlobalId)
9
+ * @returns Promise resolving to CombinedProfile or null if not found
10
+ */
11
+ async function fetchProfile({ address, name, b3GlobalId, fresh = false, }) {
12
+ if (!address && !name && !b3GlobalId) {
13
+ throw new Error("Either address or name or b3GlobalId must be provided");
14
+ }
15
+ const params = new URLSearchParams();
16
+ if (address)
17
+ params.append("address", address);
18
+ if (name)
19
+ params.append("name", name);
20
+ if (b3GlobalId)
21
+ params.append("b3GlobalId", b3GlobalId);
22
+ if (fresh)
23
+ params.append("fresh", "true");
24
+ const response = await fetch(`${exports.PROFILES_API_URL}?${params.toString()}`);
25
+ if (!response.ok) {
26
+ throw new Error(`Failed to fetch profile: ${response.statusText}`);
27
+ }
28
+ return response.json();
29
+ }
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { eqci, getDefaultToken, getHyperliquidUSDCToken, HYPERLIQUID_CHAIN_ID, HYPERLIQUID_USDC_ADDRESS, USDC_BASE, ZERO_ADDRESS, } from "../../../anyspend/index.js";
4
4
  import { useAnyspendCreateOnrampOrder, useAnyspendCreateOrder, useAnyspendOrderAndTransactions, useAnyspendQuote, useGasPrice, useGeoOnrampOptions, } from "../../../anyspend/react/index.js";
5
- import { Button, ShinyButton, StyleRoot, TabsPrimitive, toast, TransitionPanel, useAccountWallet, useB3, useModalStore, useProfile, useRouter, useSearchParamsSSR, useTokenBalanceDirect, useTokenData, useTokenFromUrl, } from "../../../global-account/react/index.js";
5
+ import { Button, ShinyButton, StyleRoot, TabsPrimitive, toast, TransitionPanel, useAccountWallet, useB3Config, useModalStore, useProfile, useRouter, useSearchParamsSSR, useTokenBalanceDirect, useTokenData, useTokenFromUrl, } from "../../../global-account/react/index.js";
6
6
  import BottomNavigation from "../../../global-account/react/components/ManageAccount/BottomNavigation.js";
7
7
  import { useAccountWalletImage } from "../../../global-account/react/hooks/useAccountWallet.js";
8
8
  import { getThirdwebChain } from "../../../shared/constants/chains/supported.js";
@@ -54,7 +54,7 @@ export function AnySpend(props) {
54
54
  function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationTokenChainId, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, onTokenSelect, onSuccess, customUsdInputValues, hideHeader, hideBottomNavigation = false, disableUrlParamManagement = false, returnToHomeUrl, customRecipientLabel, returnHomeLabel, }) {
55
55
  const searchParams = useSearchParamsSSR();
56
56
  const router = useRouter();
57
- const { partnerId } = useB3();
57
+ const { partnerId } = useB3Config();
58
58
  const setB3ModalContentType = useModalStore(state => state.setB3ModalContentType);
59
59
  // Determine if we're in "buy mode" based on whether destination token props are provided
60
60
  const isBuyMode = !!(destinationTokenAddress && destinationTokenChainId);
@@ -824,7 +824,7 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
824
824
  navigateBack();
825
825
  // Reset payment methods when going back
826
826
  resetPaymentMethods();
827
- }, returnToHomeUrl: returnToHomeUrl, returnHomeLabel: returnHomeLabel })) }) }));
827
+ }, returnToHomeUrl: returnToHomeUrl, returnHomeLabel: returnHomeLabel, disableUrlParamManagement: disableUrlParamManagement })) }) }));
828
828
  const mainView = (_jsxs("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2 pt-5", children: [_jsxs("div", { className: "flex w-full max-w-full flex-col items-center gap-2 px-5", children: [isBuyMode && !hideHeader && (_jsxs("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: [selectedDstToken.metadata?.logoURI && (_jsx("div", { className: "relative", children: _jsx("img", { src: selectedDstToken.metadata.logoURI, alt: selectedDstToken.symbol, className: "border-as-stroke h-12 w-12 rounded-full border-2 shadow-md" }) })), _jsx("div", { children: _jsxs("h1", { className: "text-as-primary text-xl font-bold", children: ["Buy ", selectedDstToken.symbol] }) })] })), _jsx(TabSection, { activeTab: activeTab, setActiveTab: tab => {
829
829
  setActiveTab(tab);
830
830
  // Reset payment methods when switching tabs
@@ -35,10 +35,10 @@ export interface AnySpendDepositProps {
35
35
  sourceTokenAddress?: string;
36
36
  /** Source chain ID to pre-select. If not provided, shows chain selection */
37
37
  sourceTokenChainId?: number;
38
- /** The destination token to receive */
39
- destinationToken: components["schemas"]["Token"];
38
+ /** The destination token address */
39
+ destinationTokenAddress: string;
40
40
  /** The destination chain ID */
41
- destinationChainId: number;
41
+ destinationTokenChainId: number;
42
42
  /** Callback when deposit succeeds */
43
43
  onSuccess?: (amount: string) => void;
44
44
  /** Callback for opening a custom modal (e.g., for special token handling) */
@@ -89,6 +89,11 @@ export interface AnySpendDepositProps {
89
89
  customRecipientLabel?: string;
90
90
  /** Custom label for the return home button (overrides "Return to Home" / "Close") */
91
91
  returnHomeLabel?: string;
92
+ /** Whether the deposit requires a custom function (uses AnySpendCustomExactIn).
93
+ * When false, uses simple swap flow (AnySpend).
94
+ * Defaults to false.
95
+ */
96
+ isCustomDeposit?: boolean;
92
97
  }
93
98
  /**
94
99
  * A flexible deposit component that wraps AnySpendCustomExactIn with optional chain selection.
@@ -97,8 +102,8 @@ export interface AnySpendDepositProps {
97
102
  * // Simple deposit with chain selection
98
103
  * <AnySpendDeposit
99
104
  * recipientAddress={userAddress}
100
- * destinationToken={myToken}
101
- * destinationChainId={base.id}
105
+ * destinationTokenAddress="0x..."
106
+ * destinationTokenChainId={base.id}
102
107
  * onSuccess={(amount) => console.log(`Deposited ${amount}`)}
103
108
  * />
104
109
  *
@@ -106,8 +111,8 @@ export interface AnySpendDepositProps {
106
111
  * // Skip chain selection by providing sourceTokenChainId
107
112
  * <AnySpendDeposit
108
113
  * recipientAddress={userAddress}
109
- * destinationToken={myToken}
110
- * destinationChainId={base.id}
114
+ * destinationTokenAddress="0x..."
115
+ * destinationTokenChainId={base.id}
111
116
  * sourceTokenChainId={base.id}
112
117
  * onSuccess={(amount) => console.log(`Deposited ${amount}`)}
113
118
  * />
@@ -116,8 +121,8 @@ export interface AnySpendDepositProps {
116
121
  * // Deposit with custom contract
117
122
  * <AnySpendDeposit
118
123
  * recipientAddress={userAddress}
119
- * destinationToken={myToken}
120
- * destinationChainId={base.id}
124
+ * destinationTokenAddress="0x..."
125
+ * destinationTokenChainId={base.id}
121
126
  * depositContractConfig={{
122
127
  * contractAddress: "0x...",
123
128
  * functionName: "depositFor",
@@ -125,4 +130,4 @@ export interface AnySpendDepositProps {
125
130
  * onSuccess={(amount) => console.log(`Deposited ${amount}`)}
126
131
  * />
127
132
  */
128
- export declare function AnySpendDeposit({ loadOrder, mode, recipientAddress, paymentType: initialPaymentType, sourceTokenAddress, sourceTokenChainId: initialSourceChainId, destinationToken, destinationChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, minDestinationAmount, header, orderType, depositContractConfig, showChainSelection, supportedChains, minPoolSize, topChainsCount, onClose, returnToHomeUrl, customRecipientLabel, returnHomeLabel, }: AnySpendDepositProps): import("react/jsx-runtime").JSX.Element | null;
133
+ export declare function AnySpendDeposit({ loadOrder, mode, recipientAddress, paymentType: initialPaymentType, sourceTokenAddress, sourceTokenChainId: initialSourceChainId, destinationTokenAddress, destinationTokenChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, minDestinationAmount, header, orderType, depositContractConfig, showChainSelection, supportedChains, minPoolSize, topChainsCount, onClose, returnToHomeUrl, customRecipientLabel, returnHomeLabel, isCustomDeposit, }: AnySpendDepositProps): import("react/jsx-runtime").JSX.Element | null;