@b3dotfun/sdk 0.1.70-alpha.2 → 0.1.70-alpha.21

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 (355) hide show
  1. package/README.md +3 -3
  2. package/constants/chains/b3Chain.js +3 -1
  3. package/dist/cjs/anyspend/constants/rpc.d.ts +3 -1
  4. package/dist/cjs/anyspend/constants/rpc.js +6 -2
  5. package/dist/cjs/anyspend/react/components/AnySpend.d.ts +9 -1
  6. package/dist/cjs/anyspend/react/components/AnySpend.js +123 -46
  7. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +8 -10
  8. package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +15 -3
  9. package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +78 -25
  10. package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +32 -13
  11. package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.js +32 -10
  12. package/dist/cjs/anyspend/react/components/QRDeposit.d.ts +22 -3
  13. package/dist/cjs/anyspend/react/components/QRDeposit.js +25 -16
  14. package/dist/cjs/anyspend/react/components/checkout/CryptoPayPanel.js +18 -11
  15. package/dist/cjs/anyspend/react/components/common/PureTransferView.d.ts +30 -0
  16. package/dist/cjs/anyspend/react/components/common/PureTransferView.js +64 -0
  17. package/dist/cjs/anyspend/react/components/common/TokenBalance.js +4 -5
  18. package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +3 -3
  19. package/dist/cjs/anyspend/react/hooks/useSigMint.d.ts +1 -1
  20. package/dist/cjs/anyspend/utils/address.d.ts +2 -1
  21. package/dist/cjs/anyspend/utils/address.js +12 -9
  22. package/dist/cjs/anyspend/utils/chain.d.ts +84 -1
  23. package/dist/cjs/anyspend/utils/chain.js +73 -3
  24. package/dist/cjs/anyspend/utils/token.d.ts +2 -0
  25. package/dist/cjs/anyspend/utils/token.js +15 -1
  26. package/dist/cjs/app.shared.d.ts +9 -1
  27. package/dist/cjs/app.shared.js +19 -0
  28. package/dist/cjs/global-account/app.native.d.ts +1 -1
  29. package/dist/cjs/global-account/better-auth-client.d.ts +3314 -36
  30. package/dist/cjs/global-account/better-auth-client.js +28 -3
  31. package/dist/cjs/global-account/bsmnt.d.ts +2 -2
  32. package/dist/cjs/global-account/bsmnt.native.d.ts +1 -1
  33. package/dist/cjs/global-account/client-manager.d.ts +7 -5
  34. package/dist/cjs/global-account/client-manager.js +51 -4
  35. package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +6 -11
  36. package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +11 -0
  37. package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.js +12 -0
  38. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +12 -2
  39. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +25 -3
  40. package/dist/cjs/global-account/react/components/B3Provider/BetterAuthProvider.js +45 -4
  41. package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.d.ts +1 -2
  42. package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +11 -5
  43. package/dist/cjs/global-account/react/components/ManageAccount/ContentTokens.js +23 -15
  44. package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.js +2 -2
  45. package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +8 -6
  46. package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +1 -1
  47. package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.js +17 -8
  48. package/dist/cjs/global-account/react/components/Send/Send.js +15 -11
  49. package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +3 -1
  50. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -5
  51. package/dist/cjs/global-account/react/components/SignInWithB3/components/AuthButton.js +2 -1
  52. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +1 -0
  53. package/dist/cjs/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +3 -2
  54. package/dist/cjs/global-account/react/components/SignInWithB3/utils/signInUtils.js +3 -3
  55. package/dist/cjs/global-account/react/components/index.d.ts +1 -1
  56. package/dist/cjs/global-account/react/components/index.js +3 -3
  57. package/dist/cjs/global-account/react/hooks/index.d.ts +2 -3
  58. package/dist/cjs/global-account/react/hooks/index.js +7 -10
  59. package/dist/cjs/global-account/react/hooks/useAuth.d.ts +5 -4
  60. package/dist/cjs/global-account/react/hooks/useAuth.js +1 -0
  61. package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +3 -2
  62. package/dist/cjs/global-account/react/hooks/useAuthentication.js +2 -1
  63. package/dist/cjs/global-account/react/hooks/useBetterAuth.d.ts +1657 -22
  64. package/dist/cjs/global-account/react/hooks/useBetterAuth.js +7 -7
  65. package/dist/cjs/global-account/react/hooks/useClient.d.ts +3 -3
  66. package/dist/cjs/global-account/react/hooks/useFirstEOA.d.ts +4 -7666
  67. package/dist/cjs/global-account/react/hooks/useFirstEOA.js +1 -0
  68. package/dist/cjs/global-account/react/hooks/useNativeBalance.js +2 -2
  69. package/dist/cjs/global-account/react/hooks/usePortfolioBalance.d.ts +15 -0
  70. package/dist/cjs/global-account/react/hooks/usePortfolioBalance.js +76 -0
  71. package/dist/cjs/global-account/react/hooks/usePortfolioCollectibles.d.ts +12 -0
  72. package/dist/cjs/global-account/react/hooks/usePortfolioCollectibles.js +178 -0
  73. package/dist/cjs/global-account/react/hooks/useSiwe.d.ts +1 -1
  74. package/dist/cjs/global-account/react/hooks/useSiwe.native.d.ts +1 -1
  75. package/dist/cjs/global-account/react/hooks/useTWAuth.d.ts +1 -1
  76. package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.d.ts +1 -0
  77. package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +37 -27
  78. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +14 -2
  79. package/dist/cjs/global-account/types/b3-api.types.d.ts +5 -0
  80. package/dist/cjs/global-account/types/feature-flags.d.ts +5 -5
  81. package/dist/cjs/notifications/services/api.js +1 -0
  82. package/dist/cjs/shared/constants/chains/b3Chain.d.ts +30 -54
  83. package/dist/cjs/shared/constants/chains/b3Chain.js +5 -41
  84. package/dist/cjs/shared/constants/chains/supported.d.ts +1 -49
  85. package/dist/cjs/shared/constants/chains/supported.js +8 -36
  86. package/dist/cjs/shared/constants/index.d.ts +4 -0
  87. package/dist/cjs/shared/utils/chain-transformers.d.ts +4 -4
  88. package/dist/cjs/shared/utils/chain-transformers.js +38 -37
  89. package/dist/cjs/shared/utils/thirdweb-insights.js +2 -2
  90. package/dist/cjs/shared/utils/upload.d.ts +9 -0
  91. package/dist/cjs/shared/utils/upload.js +34 -0
  92. package/dist/cjs/shared/utils/zerionPositions.d.ts +96 -0
  93. package/dist/cjs/shared/utils/zerionPositions.js +188 -0
  94. package/dist/esm/anyspend/constants/rpc.d.ts +3 -1
  95. package/dist/esm/anyspend/constants/rpc.js +5 -1
  96. package/dist/esm/anyspend/react/components/AnySpend.d.ts +9 -1
  97. package/dist/esm/anyspend/react/components/AnySpend.js +124 -47
  98. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +9 -11
  99. package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +15 -3
  100. package/dist/esm/anyspend/react/components/AnySpendDeposit.js +80 -27
  101. package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +33 -14
  102. package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.js +33 -11
  103. package/dist/esm/anyspend/react/components/QRDeposit.d.ts +22 -3
  104. package/dist/esm/anyspend/react/components/QRDeposit.js +27 -18
  105. package/dist/esm/anyspend/react/components/checkout/CryptoPayPanel.js +21 -14
  106. package/dist/esm/anyspend/react/components/common/PureTransferView.d.ts +30 -0
  107. package/dist/esm/anyspend/react/components/common/PureTransferView.js +61 -0
  108. package/dist/esm/anyspend/react/components/common/TokenBalance.js +6 -7
  109. package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +3 -3
  110. package/dist/esm/anyspend/react/hooks/useSigMint.d.ts +1 -1
  111. package/dist/esm/anyspend/utils/address.d.ts +2 -1
  112. package/dist/esm/anyspend/utils/address.js +9 -6
  113. package/dist/esm/anyspend/utils/chain.d.ts +84 -1
  114. package/dist/esm/anyspend/utils/chain.js +73 -5
  115. package/dist/esm/anyspend/utils/token.d.ts +2 -0
  116. package/dist/esm/anyspend/utils/token.js +13 -0
  117. package/dist/esm/app.shared.d.ts +9 -1
  118. package/dist/esm/app.shared.js +17 -0
  119. package/dist/esm/global-account/app.native.d.ts +1 -1
  120. package/dist/esm/global-account/better-auth-client.d.ts +3314 -36
  121. package/dist/esm/global-account/better-auth-client.js +27 -4
  122. package/dist/esm/global-account/bsmnt.d.ts +2 -2
  123. package/dist/esm/global-account/bsmnt.native.d.ts +1 -1
  124. package/dist/esm/global-account/client-manager.d.ts +7 -5
  125. package/dist/esm/global-account/client-manager.js +51 -5
  126. package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +6 -11
  127. package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +11 -0
  128. package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.js +11 -0
  129. package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +12 -2
  130. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +26 -4
  131. package/dist/esm/global-account/react/components/B3Provider/BetterAuthProvider.js +46 -5
  132. package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.d.ts +1 -2
  133. package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +11 -5
  134. package/dist/esm/global-account/react/components/ManageAccount/ContentTokens.js +24 -16
  135. package/dist/esm/global-account/react/components/ManageAccount/NFTContent.js +3 -3
  136. package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +9 -7
  137. package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +1 -1
  138. package/dist/esm/global-account/react/components/ManageAccount/TokenContent.js +18 -9
  139. package/dist/esm/global-account/react/components/Send/Send.js +16 -12
  140. package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +3 -1
  141. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -5
  142. package/dist/esm/global-account/react/components/SignInWithB3/components/AuthButton.js +2 -1
  143. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +1 -0
  144. package/dist/esm/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +3 -2
  145. package/dist/esm/global-account/react/components/SignInWithB3/utils/signInUtils.js +3 -3
  146. package/dist/esm/global-account/react/components/index.d.ts +1 -1
  147. package/dist/esm/global-account/react/components/index.js +1 -1
  148. package/dist/esm/global-account/react/hooks/index.d.ts +2 -3
  149. package/dist/esm/global-account/react/hooks/index.js +2 -3
  150. package/dist/esm/global-account/react/hooks/useAuth.d.ts +5 -4
  151. package/dist/esm/global-account/react/hooks/useAuth.js +1 -0
  152. package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +3 -2
  153. package/dist/esm/global-account/react/hooks/useAuthentication.js +2 -1
  154. package/dist/esm/global-account/react/hooks/useBetterAuth.d.ts +1657 -22
  155. package/dist/esm/global-account/react/hooks/useBetterAuth.js +8 -8
  156. package/dist/esm/global-account/react/hooks/useClient.d.ts +3 -3
  157. package/dist/esm/global-account/react/hooks/useFirstEOA.d.ts +4 -7666
  158. package/dist/esm/global-account/react/hooks/useFirstEOA.js +1 -0
  159. package/dist/esm/global-account/react/hooks/useNativeBalance.js +1 -1
  160. package/dist/esm/global-account/react/hooks/usePortfolioBalance.d.ts +15 -0
  161. package/dist/esm/global-account/react/hooks/usePortfolioBalance.js +72 -0
  162. package/dist/esm/global-account/react/hooks/usePortfolioCollectibles.d.ts +12 -0
  163. package/dist/esm/global-account/react/hooks/usePortfolioCollectibles.js +175 -0
  164. package/dist/esm/global-account/react/hooks/useSiwe.d.ts +1 -1
  165. package/dist/esm/global-account/react/hooks/useSiwe.native.d.ts +1 -1
  166. package/dist/esm/global-account/react/hooks/useTWAuth.d.ts +1 -1
  167. package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.d.ts +1 -0
  168. package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +37 -27
  169. package/dist/esm/global-account/react/stores/useModalStore.d.ts +14 -2
  170. package/dist/esm/global-account/types/b3-api.types.d.ts +5 -0
  171. package/dist/esm/global-account/types/feature-flags.d.ts +5 -5
  172. package/dist/esm/notifications/services/api.js +1 -0
  173. package/dist/esm/shared/constants/chains/b3Chain.d.ts +30 -54
  174. package/dist/esm/shared/constants/chains/b3Chain.js +4 -38
  175. package/dist/esm/shared/constants/chains/supported.d.ts +1 -49
  176. package/dist/esm/shared/constants/chains/supported.js +7 -35
  177. package/dist/esm/shared/constants/index.d.ts +4 -0
  178. package/dist/esm/shared/utils/chain-transformers.d.ts +4 -4
  179. package/dist/esm/shared/utils/chain-transformers.js +38 -37
  180. package/dist/esm/shared/utils/thirdweb-insights.js +2 -2
  181. package/dist/esm/shared/utils/upload.d.ts +9 -0
  182. package/dist/esm/shared/utils/upload.js +31 -0
  183. package/dist/esm/shared/utils/zerionPositions.d.ts +96 -0
  184. package/dist/esm/shared/utils/zerionPositions.js +180 -0
  185. package/dist/styles/index.css +1 -1
  186. package/dist/types/anyspend/constants/rpc.d.ts +3 -1
  187. package/dist/types/anyspend/react/components/AnySpend.d.ts +9 -1
  188. package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +15 -3
  189. package/dist/types/anyspend/react/components/QRDeposit.d.ts +22 -3
  190. package/dist/types/anyspend/react/components/common/PureTransferView.d.ts +30 -0
  191. package/dist/types/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +3 -3
  192. package/dist/types/anyspend/react/hooks/useSigMint.d.ts +1 -1
  193. package/dist/types/anyspend/utils/address.d.ts +2 -1
  194. package/dist/types/anyspend/utils/chain.d.ts +84 -1
  195. package/dist/types/anyspend/utils/token.d.ts +2 -0
  196. package/dist/types/app.shared.d.ts +9 -1
  197. package/dist/types/global-account/app.native.d.ts +1 -1
  198. package/dist/types/global-account/better-auth-client.d.ts +3314 -36
  199. package/dist/types/global-account/bsmnt.d.ts +2 -2
  200. package/dist/types/global-account/bsmnt.native.d.ts +1 -1
  201. package/dist/types/global-account/client-manager.d.ts +7 -5
  202. package/dist/types/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +11 -0
  203. package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +12 -2
  204. package/dist/types/global-account/react/components/B3Provider/RelayKitProviderWrapper.d.ts +1 -2
  205. package/dist/types/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +3 -2
  206. package/dist/types/global-account/react/components/index.d.ts +1 -1
  207. package/dist/types/global-account/react/hooks/index.d.ts +2 -3
  208. package/dist/types/global-account/react/hooks/useAuth.d.ts +5 -4
  209. package/dist/types/global-account/react/hooks/useAuthentication.d.ts +3 -2
  210. package/dist/types/global-account/react/hooks/useBetterAuth.d.ts +1657 -22
  211. package/dist/types/global-account/react/hooks/useClient.d.ts +3 -3
  212. package/dist/types/global-account/react/hooks/useFirstEOA.d.ts +4 -7666
  213. package/dist/types/global-account/react/hooks/usePortfolioBalance.d.ts +15 -0
  214. package/dist/types/global-account/react/hooks/usePortfolioCollectibles.d.ts +12 -0
  215. package/dist/types/global-account/react/hooks/useSiwe.d.ts +1 -1
  216. package/dist/types/global-account/react/hooks/useSiwe.native.d.ts +1 -1
  217. package/dist/types/global-account/react/hooks/useTWAuth.d.ts +1 -1
  218. package/dist/types/global-account/react/hooks/useUnifiedChainSwitchAndExecute.d.ts +1 -0
  219. package/dist/types/global-account/react/stores/useModalStore.d.ts +14 -2
  220. package/dist/types/global-account/types/b3-api.types.d.ts +5 -0
  221. package/dist/types/global-account/types/feature-flags.d.ts +5 -5
  222. package/dist/types/shared/constants/chains/b3Chain.d.ts +30 -54
  223. package/dist/types/shared/constants/chains/supported.d.ts +1 -49
  224. package/dist/types/shared/constants/index.d.ts +4 -0
  225. package/dist/types/shared/utils/chain-transformers.d.ts +4 -4
  226. package/dist/types/shared/utils/upload.d.ts +9 -0
  227. package/dist/types/shared/utils/zerionPositions.d.ts +96 -0
  228. package/node_modules/@b3/chain-registry/chains.json +1225 -0
  229. package/node_modules/@b3/chain-registry/dist/chains.json +1225 -0
  230. package/node_modules/@b3/chain-registry/dist/index.cjs +1676 -0
  231. package/node_modules/@b3/chain-registry/dist/index.d.cts +195 -0
  232. package/node_modules/@b3/chain-registry/dist/index.d.ts +195 -0
  233. package/node_modules/@b3/chain-registry/dist/index.mjs +1604 -0
  234. package/node_modules/@b3/chain-registry/dist/src/index.d.ts +193 -0
  235. package/node_modules/@b3/chain-registry/dist/src/index.js +408 -0
  236. package/node_modules/@b3/chain-registry/package.json +66 -0
  237. package/node_modules/@b3/chain-registry/src/index.test.ts +432 -0
  238. package/node_modules/@b3/chain-registry/src/index.ts +672 -0
  239. package/package.json +81 -30
  240. package/src/anyspend/README.md +2 -2
  241. package/src/anyspend/constants/rpc.ts +5 -2
  242. package/src/anyspend/docs/components.md +6 -6
  243. package/src/anyspend/docs/contributing.md +1 -1
  244. package/src/anyspend/docs/hooks.md +3 -3
  245. package/src/anyspend/docs/installation.md +2 -2
  246. package/src/anyspend/react/components/AnySpend.tsx +163 -47
  247. package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +10 -11
  248. package/src/anyspend/react/components/AnySpendDeposit.tsx +130 -31
  249. package/src/anyspend/react/components/AnySpendStakeB3.tsx +55 -14
  250. package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +55 -11
  251. package/src/anyspend/react/components/QRDeposit.tsx +101 -22
  252. package/src/anyspend/react/components/__tests__/QRDeposit.test.tsx +331 -0
  253. package/src/anyspend/react/components/checkout/CryptoPayPanel.tsx +38 -16
  254. package/src/anyspend/react/components/common/PureTransferView.tsx +212 -0
  255. package/src/anyspend/react/components/common/TokenBalance.tsx +10 -7
  256. package/src/anyspend/react/hooks/useAnyspendQuote.ts +13 -13
  257. package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +4 -4
  258. package/src/anyspend/services/gas.test.ts +95 -18
  259. package/src/anyspend/types/api_req_res.ts +10 -5
  260. package/src/anyspend/utils/__tests__/address.test.ts +39 -0
  261. package/src/anyspend/utils/__tests__/deprecatedChains.test.ts +44 -0
  262. package/src/anyspend/utils/__tests__/toRegistryChainId.test.ts +17 -0
  263. package/src/anyspend/utils/address.ts +8 -6
  264. package/src/anyspend/utils/chain.ts +79 -3
  265. package/src/anyspend/utils/token.ts +14 -0
  266. package/src/app.shared.ts +21 -1
  267. package/src/global-account/app.native.ts +5 -1
  268. package/src/global-account/better-auth-client.ts +30 -4
  269. package/src/global-account/bsmnt.native.ts +5 -1
  270. package/src/global-account/bsmnt.ts +9 -2
  271. package/src/global-account/client-manager.ts +74 -9
  272. package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +6 -11
  273. package/src/global-account/react/components/B3Provider/B3ConfigProvider.tsx +12 -0
  274. package/src/global-account/react/components/B3Provider/B3Provider.tsx +40 -4
  275. package/src/global-account/react/components/B3Provider/BetterAuthProvider.tsx +51 -5
  276. package/src/global-account/react/components/B3Provider/RelayKitProviderWrapper.tsx +11 -11
  277. package/src/global-account/react/components/ManageAccount/ContentTokens.tsx +50 -21
  278. package/src/global-account/react/components/ManageAccount/NFTContent.tsx +5 -3
  279. package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +10 -6
  280. package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +1 -1
  281. package/src/global-account/react/components/ManageAccount/TokenContent.tsx +22 -9
  282. package/src/global-account/react/components/Send/Send.tsx +39 -15
  283. package/src/global-account/react/components/SignInWithB3/BetterAuthSignIn.tsx +12 -1
  284. package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +1 -4
  285. package/src/global-account/react/components/SignInWithB3/components/AuthButton.tsx +9 -1
  286. package/src/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.tsx +1 -0
  287. package/src/global-account/react/components/SignInWithB3/utils/signInUtils.ts +4 -4
  288. package/src/global-account/react/components/index.ts +1 -1
  289. package/src/global-account/react/components/ui/button.tsx +1 -2
  290. package/src/global-account/react/hooks/__tests__/useUnifiedChainSwitchAndExecute.test.tsx +156 -0
  291. package/src/global-account/react/hooks/index.ts +2 -3
  292. package/src/global-account/react/hooks/useAuth.ts +5 -4
  293. package/src/global-account/react/hooks/useAuthentication.ts +5 -4
  294. package/src/global-account/react/hooks/useBetterAuth.ts +10 -10
  295. package/src/global-account/react/hooks/useClient.ts +11 -2
  296. package/src/global-account/react/hooks/useFirstEOA.tsx +9 -2
  297. package/src/global-account/react/hooks/useNativeBalance.tsx +1 -1
  298. package/src/global-account/react/hooks/usePortfolioBalance.ts +89 -0
  299. package/src/global-account/react/hooks/usePortfolioCollectibles.ts +212 -0
  300. package/src/global-account/react/hooks/useSiwe.native.tsx +1 -1
  301. package/src/global-account/react/hooks/useSiwe.tsx +1 -1
  302. package/src/global-account/react/hooks/useTWAuth.tsx +1 -1
  303. package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +47 -31
  304. package/src/global-account/react/stores/useModalStore.ts +14 -2
  305. package/src/global-account/types/b3-api.types.ts +5 -1
  306. package/src/notifications/services/api.ts +1 -0
  307. package/src/shared/constants/chains/b3Chain.ts +4 -43
  308. package/src/shared/constants/chains/supported.ts +9 -48
  309. package/src/shared/constants/index.ts +8 -0
  310. package/src/shared/react/hooks/__tests__/useCurrencyConversion.test.ts +54 -43
  311. package/src/shared/utils/__tests__/zerionPositions.test.ts +248 -0
  312. package/src/shared/utils/chain-transformers.ts +41 -39
  313. package/src/shared/utils/thirdweb-insights.ts +2 -2
  314. package/src/shared/utils/upload.ts +48 -0
  315. package/src/shared/utils/zerionPositions.ts +247 -0
  316. package/src/styles/index.css +27 -0
  317. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.d.ts +0 -10
  318. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +0 -46
  319. package/dist/cjs/global-account/react/hooks/useHandleConnectWithPrivy.d.ts +0 -11
  320. package/dist/cjs/global-account/react/hooks/useHandleConnectWithPrivy.js +0 -70
  321. package/dist/cjs/global-account/react/hooks/useSimBalance.d.ts +0 -59
  322. package/dist/cjs/global-account/react/hooks/useSimBalance.js +0 -98
  323. package/dist/cjs/global-account/react/hooks/useSimCollectibles.d.ts +0 -45
  324. package/dist/cjs/global-account/react/hooks/useSimCollectibles.js +0 -190
  325. package/dist/cjs/global-account/react/utils/simdune.d.ts +0 -7
  326. package/dist/cjs/global-account/react/utils/simdune.js +0 -21
  327. package/dist/cjs/global-account/types/chain-networks.d.ts +0 -44
  328. package/dist/cjs/global-account/types/chain-networks.js +0 -48
  329. package/dist/cjs/shared/generated/chain-networks.json +0 -684
  330. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.d.ts +0 -10
  331. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +0 -43
  332. package/dist/esm/global-account/react/hooks/useHandleConnectWithPrivy.d.ts +0 -11
  333. package/dist/esm/global-account/react/hooks/useHandleConnectWithPrivy.js +0 -67
  334. package/dist/esm/global-account/react/hooks/useSimBalance.d.ts +0 -59
  335. package/dist/esm/global-account/react/hooks/useSimBalance.js +0 -93
  336. package/dist/esm/global-account/react/hooks/useSimCollectibles.d.ts +0 -45
  337. package/dist/esm/global-account/react/hooks/useSimCollectibles.js +0 -187
  338. package/dist/esm/global-account/react/utils/simdune.d.ts +0 -7
  339. package/dist/esm/global-account/react/utils/simdune.js +0 -17
  340. package/dist/esm/global-account/types/chain-networks.d.ts +0 -44
  341. package/dist/esm/global-account/types/chain-networks.js +0 -45
  342. package/dist/esm/shared/generated/chain-networks.json +0 -684
  343. package/dist/types/global-account/react/components/SignInWithB3/SignInWithB3Privy.d.ts +0 -10
  344. package/dist/types/global-account/react/hooks/useHandleConnectWithPrivy.d.ts +0 -11
  345. package/dist/types/global-account/react/hooks/useSimBalance.d.ts +0 -59
  346. package/dist/types/global-account/react/hooks/useSimCollectibles.d.ts +0 -45
  347. package/dist/types/global-account/react/utils/simdune.d.ts +0 -7
  348. package/dist/types/global-account/types/chain-networks.d.ts +0 -44
  349. package/src/global-account/react/components/SignInWithB3/SignInWithB3Privy.tsx +0 -63
  350. package/src/global-account/react/hooks/useHandleConnectWithPrivy.tsx +0 -79
  351. package/src/global-account/react/hooks/useSimBalance.ts +0 -164
  352. package/src/global-account/react/hooks/useSimCollectibles.ts +0 -238
  353. package/src/global-account/react/utils/simdune.ts +0 -20
  354. package/src/global-account/types/chain-networks.ts +0 -54
  355. package/src/shared/generated/chain-networks.json +0 -684
@@ -5,6 +5,7 @@ import { useEffect, useMemo, useState } from "react";
5
5
  import { viemAdapter } from "thirdweb/adapters/viem";
6
6
  import { useConnectedWallets, useWalletInfo } from "thirdweb/react";
7
7
  const debug = debugB3React("useFirstEOA");
8
+ // Explicit return annotation keeps the hook's declaration portable (TS2742).
8
9
  export function useFirstEOA(chain) {
9
10
  const wallets = useConnectedWallets();
10
11
  const isConnected = useAuthStore(state => state.isConnected);
@@ -1,6 +1,6 @@
1
1
  import { toast } from "../../../global-account/react/index.js";
2
2
  import { PUBLIC_BASE_RPC_URL } from "../../../shared/constants/index.js";
3
- import { b3Mainnet, b3Testnet } from "../../../shared/constants/chains/supported.js";
3
+ import { b3Mainnet, b3Testnet } from "../../../shared/constants/chains/b3Chain.js";
4
4
  import { formatNumber } from "../../../shared/utils/formatNumber.js";
5
5
  import { useQuery } from "@tanstack/react-query";
6
6
  import { createPublicClient, formatEther, formatUnits, http } from "viem";
@@ -0,0 +1,15 @@
1
+ import { type B3TokenBalance } from "../../../shared/utils/zerionPositions";
2
+ /**
3
+ * Holdings for a wallet, optionally narrowed to specific chains.
4
+ *
5
+ * Read `isError` before reading `data`: a failed read and an empty wallet are different facts, and
6
+ * rendering the first as the second tells the user they hold nothing when nobody knows.
7
+ */
8
+ export declare function usePortfolioBalance(address?: string, chainIds?: number[]): import("@tanstack/react-query").UseQueryResult<B3TokenBalance[], Error>;
9
+ /**
10
+ * One token's balance for a wallet, served from the same per-wallet fetch as {@link usePortfolioBalance}.
11
+ *
12
+ * `tokenAddress` may be a contract address or the chain's native sentinel; matching is
13
+ * case-insensitive because callers pass addresses in whatever casing their source used.
14
+ */
15
+ export declare function usePortfolioTokenBalance(walletAddress?: string, tokenAddress?: string, chainId?: number): import("@tanstack/react-query").UseQueryResult<B3TokenBalance | undefined, Error>;
@@ -0,0 +1,72 @@
1
+ import { useQuery } from "@tanstack/react-query";
2
+ import { adaptZerionPositions, balanceMatchesToken, } from "../../../shared/utils/zerionPositions.js";
3
+ /**
4
+ * Wallet holdings, read through the b3 portfolio proxy.
5
+ *
6
+ * The proxy holds the upstream API key server-side and authorizes browsers by Origin allowlist, so
7
+ * nothing secret ships to the client and no key is accepted from it. A consumer served from an
8
+ * origin the proxy does not know will be refused — adding an origin is a proxy config change, not
9
+ * an SDK change.
10
+ */
11
+ const PORTFOLIO_API_BASE_URL = "https://portfolio-api.b3.fun";
12
+ /**
13
+ * Fetch every spendable holding for a wallet in one request.
14
+ *
15
+ * Deliberately unpaginated and unfiltered by chain. The positions endpoint returns a wallet's full
16
+ * simple-position list in a single response, and passing a chain filter is actively harmful: the
17
+ * upstream rejects a handful of otherwise-valid chain slugs and fails the WHOLE request when one
18
+ * appears, so a caller asking for five chains can lose all five. Callers narrow the result instead.
19
+ */
20
+ async function fetchWalletPositions(address) {
21
+ const url = `${PORTFOLIO_API_BASE_URL}/v1/wallets/${encodeURIComponent(address)}/positions/?filter[positions]=only_simple`;
22
+ const response = await fetch(url, { headers: { Accept: "application/json" } });
23
+ if (!response.ok) {
24
+ throw new Error(`Failed to fetch wallet balances: ${response.status} ${response.statusText}`);
25
+ }
26
+ const body = (await response.json());
27
+ return adaptZerionPositions(body.data ?? []);
28
+ }
29
+ /**
30
+ * Keyed by wallet alone so every consumer of the same wallet shares one fetch and one cache entry.
31
+ * Keying by the requested chain subset instead would refetch per caller and share nothing.
32
+ */
33
+ function walletPositionsQueryKey(address) {
34
+ return ["walletPositions", address];
35
+ }
36
+ /**
37
+ * Holdings for a wallet, optionally narrowed to specific chains.
38
+ *
39
+ * Read `isError` before reading `data`: a failed read and an empty wallet are different facts, and
40
+ * rendering the first as the second tells the user they hold nothing when nobody knows.
41
+ */
42
+ export function usePortfolioBalance(address, chainIds) {
43
+ const wantedChainIds = chainIds && chainIds.length > 0 ? chainIds : undefined;
44
+ return useQuery({
45
+ queryKey: walletPositionsQueryKey(address),
46
+ queryFn: () => {
47
+ if (!address)
48
+ throw new Error("Address is required");
49
+ return fetchWalletPositions(address);
50
+ },
51
+ enabled: Boolean(address),
52
+ select: (balances) => wantedChainIds ? balances.filter(balance => wantedChainIds.includes(balance.chain_id)) : balances,
53
+ });
54
+ }
55
+ /**
56
+ * One token's balance for a wallet, served from the same per-wallet fetch as {@link usePortfolioBalance}.
57
+ *
58
+ * `tokenAddress` may be a contract address or the chain's native sentinel; matching is
59
+ * case-insensitive because callers pass addresses in whatever casing their source used.
60
+ */
61
+ export function usePortfolioTokenBalance(walletAddress, tokenAddress, chainId) {
62
+ return useQuery({
63
+ queryKey: walletPositionsQueryKey(walletAddress),
64
+ queryFn: () => {
65
+ if (!walletAddress)
66
+ throw new Error("Address is required");
67
+ return fetchWalletPositions(walletAddress);
68
+ },
69
+ enabled: Boolean(walletAddress) && Boolean(tokenAddress) && Boolean(chainId),
70
+ select: (balances) => balances.find(balance => balance.chain_id === chainId && balanceMatchesToken(balance, tokenAddress ?? "")),
71
+ });
72
+ }
@@ -0,0 +1,12 @@
1
+ import type { SimpleHashNFTResponse } from "../../../global-account/types/simplehash.types";
2
+ /**
3
+ * NFTs held by a wallet, in the SimpleHash shape `AccountAssets` already renders.
4
+ *
5
+ * Chain narrowing happens here rather than in the request: the upstream rejects some valid chain
6
+ * slugs outright and fails the whole request when one is present, so asking for a subset can cost
7
+ * you the whole answer.
8
+ */
9
+ export declare function usePortfolioCollectibles(address?: string, chainIds?: number[], options?: {
10
+ limit?: number;
11
+ filterSpam?: boolean;
12
+ }): import("@tanstack/react-query").UseQueryResult<SimpleHashNFTResponse, Error>;
@@ -0,0 +1,175 @@
1
+ import { zerionSlugToChainId } from "../../../shared/utils/zerionPositions.js";
2
+ import { useQuery } from "@tanstack/react-query";
3
+ const PORTFOLIO_API_BASE_URL = "https://portfolio-api.b3.fun";
4
+ /** Caps an ERC-1155 balance string at MAX_SAFE_INTEGER so a huge supply cannot overflow. */
5
+ function safeParseBalance(balance) {
6
+ if (!balance)
7
+ return 1;
8
+ const parsed = parseInt(balance, 10);
9
+ if (Number.isNaN(parsed))
10
+ return 1;
11
+ return Math.min(parsed, Number.MAX_SAFE_INTEGER);
12
+ }
13
+ /**
14
+ * Reshape one Zerion NFT position into the SimpleHash record `AccountAssets` renders.
15
+ *
16
+ * Fields Zerion does not carry — traits, rarity, royalties, sale history — stay empty rather than
17
+ * being synthesised from something adjacent. In particular the position's `price` is a current
18
+ * estimate, not a sale, so it must not be written into `last_sale`.
19
+ */
20
+ function toSimpleHashNft(position, ownerAddress) {
21
+ const attributes = position.attributes ?? {};
22
+ const nftInfo = attributes.nft_info;
23
+ const slug = position.relationships?.chain?.data?.id;
24
+ if (!nftInfo?.contract_address || !nftInfo.token_id || !slug)
25
+ return null;
26
+ const imageUrl = nftInfo.content?.detail?.url ?? nftInfo.content?.preview?.url ?? "";
27
+ const collectionInfo = attributes.collection_info ?? {};
28
+ const acquiredAt = attributes.changed_at ?? "";
29
+ return {
30
+ nft_id: `${slug}.${nftInfo.contract_address}.${nftInfo.token_id}`,
31
+ chain: slug,
32
+ contract_address: nftInfo.contract_address,
33
+ token_id: nftInfo.token_id,
34
+ name: nftInfo.name || "",
35
+ description: collectionInfo.description || "",
36
+ previews: {
37
+ image_small_url: nftInfo.content?.preview?.url ?? imageUrl,
38
+ image_medium_url: imageUrl,
39
+ image_large_url: imageUrl,
40
+ image_opengraph_url: imageUrl,
41
+ blurhash: "",
42
+ predominant_color: "",
43
+ },
44
+ image_url: imageUrl,
45
+ image_properties: { width: 0, height: 0, size: 0, mime_type: "", exif_orientation: null },
46
+ video_url: null,
47
+ video_properties: null,
48
+ audio_url: null,
49
+ audio_properties: null,
50
+ model_url: null,
51
+ model_properties: null,
52
+ other_url: null,
53
+ other_properties: null,
54
+ background_color: null,
55
+ external_url: null,
56
+ created_date: "",
57
+ status: "minted",
58
+ token_count: 1,
59
+ owner_count: 1,
60
+ owners: [
61
+ {
62
+ owner_address: ownerAddress,
63
+ quantity: safeParseBalance(attributes.amount),
64
+ quantity_string: attributes.amount || "1",
65
+ first_acquired_date: acquiredAt,
66
+ last_acquired_date: acquiredAt,
67
+ },
68
+ ],
69
+ contract: {
70
+ type: nftInfo.interface === "ERC1155" ? "ERC1155" : "ERC721",
71
+ name: collectionInfo.name || "",
72
+ symbol: null,
73
+ deployed_by: "",
74
+ deployed_via_contract: "",
75
+ owned_by: "",
76
+ has_multiple_collections: false,
77
+ },
78
+ collection: {
79
+ collection_id: nftInfo.contract_address,
80
+ name: collectionInfo.name || "Unknown Collection",
81
+ description: collectionInfo.description ?? null,
82
+ image_url: collectionInfo.content?.icon?.url ?? "",
83
+ image_properties: { width: 0, height: 0, mime_type: "" },
84
+ banner_image_url: null,
85
+ category: null,
86
+ is_nsfw: null,
87
+ external_url: null,
88
+ twitter_username: null,
89
+ discord_url: null,
90
+ instagram_username: null,
91
+ medium_username: null,
92
+ telegram_url: null,
93
+ marketplace_pages: [],
94
+ metaplex_mint: null,
95
+ metaplex_candy_machine: null,
96
+ metaplex_first_verified_creator: null,
97
+ floor_prices: [],
98
+ top_bids: [],
99
+ distinct_owner_count: 0,
100
+ distinct_nft_count: 0,
101
+ total_quantity: 0,
102
+ chains: [slug],
103
+ top_contracts: [nftInfo.contract_address],
104
+ collection_royalties: [],
105
+ },
106
+ last_sale: null,
107
+ primary_sale: null,
108
+ first_created: {
109
+ minted_to: ownerAddress,
110
+ quantity: 1,
111
+ quantity_string: "1",
112
+ timestamp: "",
113
+ block_number: 0,
114
+ transaction: "",
115
+ transaction_initiator: "",
116
+ },
117
+ rarity: { rank: null, score: null, unique_attributes: null },
118
+ royalty: [],
119
+ extra_metadata: {
120
+ attributes: [],
121
+ image_original_url: imageUrl,
122
+ animation_original_url: null,
123
+ metadata_original_url: "",
124
+ },
125
+ };
126
+ }
127
+ /**
128
+ * NFTs held by a wallet, in the SimpleHash shape `AccountAssets` already renders.
129
+ *
130
+ * Chain narrowing happens here rather than in the request: the upstream rejects some valid chain
131
+ * slugs outright and fails the whole request when one is present, so asking for a subset can cost
132
+ * you the whole answer.
133
+ */
134
+ export function usePortfolioCollectibles(address, chainIds, options) {
135
+ const limit = options?.limit;
136
+ const filterSpam = options?.filterSpam;
137
+ const wantedChainIds = chainIds && chainIds.length > 0 ? chainIds : undefined;
138
+ return useQuery({
139
+ queryKey: ["walletCollectibles", address, limit, filterSpam],
140
+ queryFn: async () => {
141
+ if (!address)
142
+ throw new Error("Address is required");
143
+ const params = new URLSearchParams();
144
+ if (limit)
145
+ params.set("page[size]", String(limit));
146
+ const query = params.toString();
147
+ const url = `${PORTFOLIO_API_BASE_URL}/v1/wallets/${encodeURIComponent(address)}/nft-positions/${query ? `?${query}` : ""}`;
148
+ const response = await fetch(url, { headers: { Accept: "application/json" } });
149
+ if (!response.ok) {
150
+ throw new Error(`Failed to fetch collectibles: ${response.status} ${response.statusText}`);
151
+ }
152
+ const body = (await response.json());
153
+ // Spam is dropped here, not in `select`: the flag lives on the raw position and the
154
+ // SimpleHash shape has nowhere to carry it downstream.
155
+ const nfts = (body.data ?? [])
156
+ .filter(position => !(filterSpam && position.attributes?.nft_info?.flags?.is_spam === true))
157
+ .map(position => toSimpleHashNft(position, address))
158
+ .filter((nft) => nft !== null);
159
+ return { next_cursor: null, next: null, previous: null, nfts };
160
+ },
161
+ enabled: Boolean(address),
162
+ staleTime: 30 * 1000,
163
+ gcTime: 5 * 60 * 1000,
164
+ select: (data) => {
165
+ if (!wantedChainIds)
166
+ return data;
167
+ const all = data.nfts ?? [];
168
+ const nfts = all.filter(nft => {
169
+ const chainId = zerionSlugToChainId(nft.chain);
170
+ return chainId !== undefined && wantedChainIds.includes(chainId);
171
+ });
172
+ return nfts.length === all.length ? data : { ...data, nfts };
173
+ },
174
+ });
175
+ }
@@ -1,4 +1,4 @@
1
1
  import { Account } from "thirdweb/wallets";
2
2
  export declare function useSiwe(): {
3
- authenticate: (account: Account, partnerId: string) => Promise<import("@feathersjs/authentication").AuthenticationResult>;
3
+ authenticate: (account: Account, partnerId: string) => Promise<Record<string, any>>;
4
4
  };
@@ -1,4 +1,4 @@
1
1
  import { Account } from "thirdweb/wallets";
2
2
  export declare function useSiwe(): {
3
- authenticate: (account: Account, partnerId: string) => Promise<import("@feathersjs/authentication").AuthenticationResult>;
3
+ authenticate: (account: Account, partnerId: string) => Promise<Record<string, any>>;
4
4
  };
@@ -3,5 +3,5 @@ import { Wallet } from "thirdweb/wallets";
3
3
  * @deprecated Use useAuth() instead
4
4
  */
5
5
  export declare function useTWAuth(): {
6
- authenticate: (wallet: Wallet, partnerId: string) => Promise<import("@feathersjs/authentication").AuthenticationResult>;
6
+ authenticate: (wallet: Wallet, partnerId: string) => Promise<Record<string, any>>;
7
7
  };
@@ -5,6 +5,7 @@ export interface UnifiedTransactionParams {
5
5
  }
6
6
  export declare function useUnifiedChainSwitchAndExecute(): {
7
7
  switchChainAndExecute: (targetChainId: number, params: UnifiedTransactionParams) => Promise<string | undefined>;
8
+ switchChainAndExecuteWithGlobalAccount: (targetChainId: number, params: UnifiedTransactionParams, expectedGlobalAccountAddress?: string) => Promise<string | undefined>;
8
9
  switchChainAndExecuteWithEOA: (targetChainId: number, params: UnifiedTransactionParams) => Promise<string | undefined>;
9
10
  isSwitchingOrExecuting: boolean;
10
11
  isActiveSmartWallet: boolean | undefined;
@@ -8,18 +8,14 @@ import { useCallback, useState } from "react";
8
8
  import { prepareTransaction, sendTransaction as twSendTransaction } from "thirdweb";
9
9
  import { isAddress } from "viem";
10
10
  import { useSwitchChain } from "wagmi";
11
- import { useB3Account } from "../components/B3Provider/useB3Account.js";
11
+ import { useB3Config } from "../components/B3Provider/B3ConfigProvider.js";
12
12
  import { useAccountWallet } from "./useAccountWallet.js";
13
- const partnerId = String(process.env.PUBLIC_THIRDWEB_PARTNER_ID ||
14
- process.env.NEXT_PUBLIC_THIRDWEB_PARTNER_ID ||
15
- process.env.PUBLIC_GLOBAL_ACCOUNTS_PARTNER_ID ||
16
- process.env.NEXT_PUBLIC_GLOBAL_ACCOUNTS_PARTNER_ID);
17
- invariant(partnerId, "Partner ID is required");
18
13
  export function useUnifiedChainSwitchAndExecute() {
19
14
  const { switchChainAsync } = useSwitchChain();
20
15
  const [isSwitchingOrExecuting, setIsSwitchingOrExecuting] = useState(false);
21
- const { isActiveSmartWallet, isActiveEOAWallet, connectedEOAWallet } = useAccountWallet();
22
- const aaAccount = useB3Account();
16
+ const { isActiveSmartWallet, isActiveEOAWallet, connectedSmartWallet, connectedEOAWallet } = useAccountWallet();
17
+ // From context, not process.env: partnerId is hashed into the server intent key and must match the ecosystem wallet.
18
+ const { partnerId } = useB3Config();
23
19
  // Handle EOA wallet chain switch and execute transaction
24
20
  const handleEOASwitchChainAndSendTransaction = useCallback(async (targetChainId, params) => {
25
21
  if (!connectedEOAWallet) {
@@ -96,10 +92,18 @@ export function useUnifiedChainSwitchAndExecute() {
96
92
  setIsSwitchingOrExecuting(false);
97
93
  }
98
94
  }, [connectedEOAWallet, switchChainAsync]);
99
- // Handle AA wallet transaction (no chain switch needed for AA)
100
- const handleAASendTransaction = useCallback(async (targetChainId, params) => {
101
- if (!aaAccount) {
102
- toast.error("Smart wallet not connected");
95
+ // Handle Global Account transaction (no chain switch needed for AA).
96
+ // Resolve the signer from the connected ecosystem wallet rather than the active
97
+ // wallet so callers can explicitly require the Global Account.
98
+ const handleGlobalAccountSendTransaction = useCallback(async (targetChainId, params, expectedGlobalAccountAddress) => {
99
+ const globalAccount = connectedSmartWallet?.getAccount();
100
+ if (!globalAccount) {
101
+ toast.error("Global Account not connected");
102
+ return;
103
+ }
104
+ if (expectedGlobalAccountAddress &&
105
+ globalAccount.address.toLowerCase() !== expectedGlobalAccountAddress.toLowerCase()) {
106
+ toast.error("Connected Global Account does not match the authenticated account");
103
107
  return;
104
108
  }
105
109
  try {
@@ -112,23 +116,28 @@ export function useUnifiedChainSwitchAndExecute() {
112
116
  data: params.data,
113
117
  value: params.value,
114
118
  });
115
- // Check if we can use global-accounts-intents, if yes, create an intent.
116
- try {
117
- await app.service("global-accounts-intents").create({
118
- partnerId: partnerId,
119
- chainId: targetChainId,
120
- to: params.to,
121
- data: params.data || "0x",
122
- value: params.value.toString(),
123
- });
119
+ // Pre-register an intent to authorize the signature server-side; skip if partnerId is missing.
120
+ if (partnerId) {
121
+ try {
122
+ await app.service("global-accounts-intents").create({
123
+ partnerId,
124
+ chainId: targetChainId,
125
+ to: params.to,
126
+ data: params.data || "0x",
127
+ value: params.value.toString(),
128
+ });
129
+ }
130
+ catch (err) {
131
+ console.error("Create global-accounts-intents error", err);
132
+ }
124
133
  }
125
- catch (err) {
126
- console.error("Create global-accounts-intents error", err);
134
+ else if (process.env.NODE_ENV !== "production") {
135
+ console.warn("useUnifiedChainSwitchAndExecute: missing partnerId from B3Config — skipping intent pre-authorization");
127
136
  }
128
137
  toast.info("Sending transaction…");
129
138
  const start = performance.now();
130
139
  const sendTxResponse = await twSendTransaction({
131
- account: aaAccount,
140
+ account: globalAccount,
132
141
  transaction,
133
142
  });
134
143
  const end = performance.now();
@@ -144,17 +153,18 @@ export function useUnifiedChainSwitchAndExecute() {
144
153
  finally {
145
154
  setIsSwitchingOrExecuting(false);
146
155
  }
147
- }, [aaAccount]);
156
+ }, [connectedSmartWallet, partnerId]);
148
157
  // Unified switch chain and execute function
149
158
  const switchChainAndExecute = useCallback(async (targetChainId, params) => {
150
159
  // Check which wallet type is active
151
160
  if (isActiveSmartWallet) {
152
- return handleAASendTransaction(targetChainId, params);
161
+ return handleGlobalAccountSendTransaction(targetChainId, params);
153
162
  }
154
163
  return handleEOASwitchChainAndSendTransaction(targetChainId, params);
155
- }, [isActiveSmartWallet, handleAASendTransaction, handleEOASwitchChainAndSendTransaction]);
164
+ }, [isActiveSmartWallet, handleGlobalAccountSendTransaction, handleEOASwitchChainAndSendTransaction]);
156
165
  return {
157
166
  switchChainAndExecute,
167
+ switchChainAndExecuteWithGlobalAccount: handleGlobalAccountSendTransaction,
158
168
  switchChainAndExecuteWithEOA: handleEOASwitchChainAndSendTransaction,
159
169
  isSwitchingOrExecuting,
160
170
  isActiveSmartWallet,
@@ -617,8 +617,16 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
617
617
  destinationTokenAddress: string;
618
618
  /** The destination chain ID */
619
619
  destinationTokenChainId: number;
620
+ /**
621
+ * When false, the destination token is user-selectable even though a default destination token is
622
+ * provided (the provided destination is used only as the initial/default value). Used by the
623
+ * wallet-funding deposit flow so the user can change the receive token away from the default
624
+ * (Base USDC). Defaults to true (locked destination). Does not affect the QR/pure-transfer path. */
625
+ lockDestinationToken?: boolean;
620
626
  /** Callback when deposit succeeds */
621
627
  onSuccess?: (amount: string) => void;
628
+ /** Callback when the modal's close control is pressed. */
629
+ onClose?: () => void;
622
630
  /** Callback for opening a custom modal (e.g., for special token handling) */
623
631
  onOpenCustomModal?: () => void;
624
632
  /** Custom footer content */
@@ -641,8 +649,6 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
641
649
  showChainSelection?: boolean;
642
650
  /** Whether to show the "Fund with Fiat" option in the deposit options list. Defaults to true */
643
651
  showFiatOption?: boolean;
644
- /** Minimum pool size for filtering tokens (default: 1,000,000) */
645
- minPoolSize?: number;
646
652
  /** Custom title for chain selection step */
647
653
  chainSelectionTitle?: string;
648
654
  /** Custom description for chain selection step */
@@ -661,6 +667,12 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
661
667
  classes?: AnySpendAllClasses;
662
668
  /** Whether to allow direct transfer without swap */
663
669
  allowDirectTransfer?: boolean;
670
+ /**
671
+ * When true, the QR-deposit path is a PURE TRANSFER: the destination token/chain
672
+ * mirror the user's selected source token, so the exact token they send lands in
673
+ * their wallet on the same chain (no swap/bridge).
674
+ */
675
+ pureTransferOnly?: boolean;
664
676
  /** Opaque metadata passed to the order for callbacks (e.g., workflow form data) */
665
677
  callbackMetadata?: Record<string, unknown>;
666
678
  }
@@ -3,9 +3,13 @@
3
3
  */
4
4
  type ObjectId = string;
5
5
  interface PartnerIds {
6
+ /** @deprecated Privy is no longer used for authentication. This field exists for legacy data compatibility only. */
6
7
  privyId?: string;
7
8
  thirdwebId?: string;
8
9
  }
10
+ /**
11
+ * @deprecated Privy is no longer used for authentication. This type exists for legacy data compatibility only.
12
+ */
9
13
  interface PrivyLinkedAccount {
10
14
  type: string;
11
15
  address?: string;
@@ -45,6 +49,7 @@ interface User {
45
49
  createdAt: number;
46
50
  updatedAt: number;
47
51
  partnerIds: PartnerIds;
52
+ /** @deprecated Privy is no longer used for authentication. This field exists for legacy data compatibility only. */
48
53
  privyLinkedAccounts?: PrivyLinkedAccount[];
49
54
  twProfiles?: TWProfile[];
50
55
  }
@@ -1,8 +1,8 @@
1
1
  import { Static } from "@feathersjs/typebox";
2
- export declare const featureFlagsSchema: import("@feathersjs/typebox").TObject<{
3
- _id: import("@feathersjs/typebox").TUnion<[import("@feathersjs/typebox").TString<string>, import("@feathersjs/typebox").TObject<{}>]>;
4
- id: import("@feathersjs/typebox").TString<string>;
5
- enabled: import("@feathersjs/typebox").TBoolean;
6
- description: import("@feathersjs/typebox").TString<string>;
2
+ export declare const featureFlagsSchema: import("@sinclair/typebox").TObject<{
3
+ _id: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TObject<{}>]>;
4
+ id: import("@sinclair/typebox").TString<string>;
5
+ enabled: import("@sinclair/typebox").TBoolean;
6
+ description: import("@sinclair/typebox").TString<string>;
7
7
  }>;
8
8
  export type FeatureFlags = Static<typeof featureFlagsSchema>;
@@ -1,4 +1,5 @@
1
1
  import { getAuthToken } from "../../shared/utils/auth-token.js";
2
+ // Hardcoded default; consumers override via `B3Provider.notificationsApiUrl`.
2
3
  const DEFAULT_API_URL = "https://notifications.b3.fun";
3
4
  let apiUrl = DEFAULT_API_URL;
4
5
  export function setApiUrl(url) {
@@ -1,4 +1,3 @@
1
- import { ChainNetworks } from "../../../global-account/types/chain-networks";
2
1
  import { Chain as ThirdwebChain } from "thirdweb";
3
2
  import { Chain } from "viem";
4
3
  export declare const nullAddress = "0x0000000000000000000000000000000000000000";
@@ -33,17 +32,29 @@ export declare const b3Mainnet: {
33
32
  experimental_preconfirmationTime?: number | undefined | undefined;
34
33
  rpcUrls: {
35
34
  readonly default: {
36
- readonly http: readonly ["https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"];
37
- readonly ws: readonly ["wss://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"];
35
+ readonly http: readonly ["https://mainnet-rpc.b3.fun"];
36
+ readonly ws: readonly ["wss://mainnet-rpc.b3.fun/ws"];
38
37
  };
39
38
  };
40
39
  sourceId?: number | undefined | undefined;
40
+ supportsTransactionReplacementDetection?: boolean | undefined | undefined;
41
41
  testnet?: boolean | undefined | undefined;
42
42
  custom?: Record<string, unknown> | undefined;
43
+ extendSchema?: Record<string, unknown> | undefined;
43
44
  fees?: import("viem").ChainFees<undefined> | undefined;
44
45
  formatters?: undefined;
46
+ prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
47
+ client: import("viem").Client;
48
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
49
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
50
+ client: import("viem").Client;
51
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
52
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
53
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
54
+ }] | undefined;
45
55
  serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
46
- readonly rpc: "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2";
56
+ verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
57
+ readonly rpc: "https://mainnet-rpc.b3.fun";
47
58
  readonly icon: {
48
59
  readonly url: "https://cdn.b3.fun/b3_logo.svg";
49
60
  readonly width: 32;
@@ -51,55 +62,8 @@ export declare const b3Mainnet: {
51
62
  readonly format: "svg";
52
63
  };
53
64
  };
54
- export declare const getViemChainConfig: (config: ChainNetworks) => {
55
- blockExplorers: {
56
- readonly default: {
57
- readonly name: string;
58
- readonly url: string;
59
- };
60
- };
61
- blockTime?: number | undefined | undefined;
62
- contracts?: {
63
- [x: string]: import("viem").ChainContract | {
64
- [sourceId: number]: import("viem").ChainContract | undefined;
65
- } | undefined;
66
- ensRegistry?: import("viem").ChainContract | undefined;
67
- ensUniversalResolver?: import("viem").ChainContract | undefined;
68
- multicall3?: import("viem").ChainContract | undefined;
69
- erc6492Verifier?: import("viem").ChainContract | undefined;
70
- } | undefined;
71
- ensTlds?: readonly string[] | undefined;
72
- id: number;
73
- name: string;
74
- nativeCurrency: {
75
- symbol: string;
76
- name: string;
77
- decimals: number;
78
- };
79
- experimental_preconfirmationTime?: number | undefined | undefined;
80
- rpcUrls: {
81
- readonly default: {
82
- readonly http: readonly [string];
83
- readonly ws: readonly [string];
84
- };
85
- };
86
- sourceId?: number | undefined | undefined;
87
- testnet: true | undefined;
88
- custom?: Record<string, unknown> | undefined;
89
- fees?: import("viem").ChainFees<undefined> | undefined;
90
- formatters?: undefined;
91
- serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
92
- readonly rpc: string;
93
- readonly icon: {
94
- format: string;
95
- url: string;
96
- width: number;
97
- height: number;
98
- };
99
- };
100
65
  export declare const thirdwebB3Testnet: ThirdwebChain;
101
66
  export declare const thirdwebB3Mainnet: ThirdwebChain;
102
- export declare const getThirdwebChainConfig: (config: ChainNetworks) => ThirdwebChain;
103
67
  export declare const b3Chain: Chain | {
104
68
  blockExplorers: {
105
69
  readonly default: {
@@ -128,17 +92,29 @@ export declare const b3Chain: Chain | {
128
92
  experimental_preconfirmationTime?: number | undefined | undefined;
129
93
  rpcUrls: {
130
94
  readonly default: {
131
- readonly http: readonly ["https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"];
132
- readonly ws: readonly ["wss://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"];
95
+ readonly http: readonly ["https://mainnet-rpc.b3.fun"];
96
+ readonly ws: readonly ["wss://mainnet-rpc.b3.fun/ws"];
133
97
  };
134
98
  };
135
99
  sourceId?: number | undefined | undefined;
100
+ supportsTransactionReplacementDetection?: boolean | undefined | undefined;
136
101
  testnet?: boolean | undefined | undefined;
137
102
  custom?: Record<string, unknown> | undefined;
103
+ extendSchema?: Record<string, unknown> | undefined;
138
104
  fees?: import("viem").ChainFees<undefined> | undefined;
139
105
  formatters?: undefined;
106
+ prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
107
+ client: import("viem").Client;
108
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
109
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
110
+ client: import("viem").Client;
111
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
112
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
113
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
114
+ }] | undefined;
140
115
  serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
141
- readonly rpc: "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2";
116
+ verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
117
+ readonly rpc: "https://mainnet-rpc.b3.fun";
142
118
  readonly icon: {
143
119
  readonly url: "https://cdn.b3.fun/b3_logo.svg";
144
120
  readonly width: 32;