@b3dotfun/sdk 0.0.24 → 0.0.25

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 (253) hide show
  1. package/README.md +3 -8
  2. package/dist/cjs/anyspend/constants/index.d.ts +0 -1
  3. package/dist/cjs/anyspend/constants/index.js +1 -2
  4. package/dist/cjs/anyspend/react/components/AnySpend.d.ts +0 -1
  5. package/dist/cjs/anyspend/react/components/AnySpend.js +11 -15
  6. package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +1 -1
  7. package/dist/cjs/anyspend/react/components/AnySpendBuySpin.d.ts +1 -2
  8. package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +2 -2
  9. package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +0 -1
  10. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +9 -10
  11. package/dist/cjs/anyspend/react/components/AnySpendNFT.d.ts +1 -2
  12. package/dist/cjs/anyspend/react/components/AnySpendNFT.js +2 -2
  13. package/dist/cjs/anyspend/react/components/AnySpendStakeB3.d.ts +1 -2
  14. package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +2 -2
  15. package/dist/cjs/anyspend/react/components/AnySpendTournament.d.ts +0 -2
  16. package/dist/cjs/anyspend/react/components/AnySpendTournament.js +2 -2
  17. package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.js +1 -1
  18. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +4 -4
  19. package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.d.ts +1 -2
  20. package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.js +5 -5
  21. package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +0 -1
  22. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +2 -2
  23. package/dist/cjs/anyspend/react/components/common/OrderHistory.js +1 -2
  24. package/dist/cjs/anyspend/react/components/common/OrderStatus.js +9 -3
  25. package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +2 -2
  26. package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.d.ts +0 -1
  27. package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +2 -3
  28. package/dist/cjs/anyspend/react/components/common/PaymentStripeWeb2.d.ts +1 -2
  29. package/dist/cjs/anyspend/react/components/common/PaymentStripeWeb2.js +2 -2
  30. package/dist/cjs/anyspend/react/components/common/PaymentVendorUI.d.ts +1 -2
  31. package/dist/cjs/anyspend/react/components/common/PaymentVendorUI.js +2 -2
  32. package/dist/cjs/anyspend/react/components/common/RecipientSelection.js +1 -1
  33. package/dist/cjs/anyspend/react/components/webview/WebviewOnrampPayment.js +2 -3
  34. package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +1 -2
  35. package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +0 -1
  36. package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.js +1 -2
  37. package/dist/cjs/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +1 -1
  38. package/dist/cjs/anyspend/react/hooks/useAnyspendOrderAndTransactions.js +2 -2
  39. package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +1 -1
  40. package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.js +2 -2
  41. package/dist/cjs/anyspend/react/hooks/useAnyspendQuote.d.ts +1 -2
  42. package/dist/cjs/anyspend/react/hooks/useAnyspendQuote.js +3 -3
  43. package/dist/cjs/anyspend/react/hooks/useAnyspendTokens.d.ts +1 -1
  44. package/dist/cjs/anyspend/react/hooks/useAnyspendTokens.js +2 -2
  45. package/dist/cjs/anyspend/react/hooks/useCoinbaseOnrampOptions.d.ts +1 -1
  46. package/dist/cjs/anyspend/react/hooks/useCoinbaseOnrampOptions.js +3 -3
  47. package/dist/cjs/anyspend/react/hooks/useGeoOnrampOptions.d.ts +1 -1
  48. package/dist/cjs/anyspend/react/hooks/useGeoOnrampOptions.js +3 -3
  49. package/dist/cjs/anyspend/react/hooks/useStripeClientSecret.d.ts +1 -1
  50. package/dist/cjs/anyspend/react/hooks/useStripeClientSecret.js +3 -3
  51. package/dist/cjs/anyspend/react/hooks/useStripeSupport.d.ts +1 -1
  52. package/dist/cjs/anyspend/react/hooks/useStripeSupport.js +3 -3
  53. package/dist/cjs/anyspend/services/anyspend.d.ts +9 -10
  54. package/dist/cjs/anyspend/services/anyspend.js +18 -18
  55. package/dist/cjs/global-account/react/components/B3DynamicModal.js +13 -15
  56. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +1 -2
  57. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +2 -2
  58. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.d.ts +1 -2
  59. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +1 -3
  60. package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.d.ts +1 -2
  61. package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +4 -4
  62. package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.d.ts +1 -0
  63. package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +31 -20
  64. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStep.js +2 -2
  65. package/dist/cjs/global-account/react/components/custom/CopyToClipboard.d.ts +2 -1
  66. package/dist/cjs/global-account/react/components/custom/CopyToClipboard.js +3 -2
  67. package/dist/cjs/global-account/react/components/icons/BankIcon.d.ts +9 -0
  68. package/dist/cjs/global-account/react/components/icons/BankIcon.js +8 -0
  69. package/dist/cjs/global-account/react/components/icons/EditIcon.d.ts +9 -0
  70. package/dist/cjs/global-account/react/components/icons/EditIcon.js +8 -0
  71. package/dist/cjs/global-account/react/components/icons/SignOutIcon.d.ts +9 -0
  72. package/dist/cjs/global-account/react/components/icons/SignOutIcon.js +8 -0
  73. package/dist/cjs/global-account/react/components/icons/SwapIcon.d.ts +9 -0
  74. package/dist/cjs/global-account/react/components/icons/SwapIcon.js +8 -0
  75. package/dist/cjs/global-account/react/hooks/useB3BalanceFromAddresses.d.ts +6 -0
  76. package/dist/cjs/global-account/react/hooks/useB3BalanceFromAddresses.js +11 -0
  77. package/dist/cjs/global-account/react/hooks/useNativeBalance.d.ts +6 -0
  78. package/dist/cjs/global-account/react/hooks/useNativeBalance.js +39 -6
  79. package/dist/cjs/global-account/react/hooks/useTokenPrice.d.ts +10 -0
  80. package/dist/cjs/global-account/react/hooks/useTokenPrice.js +81 -2
  81. package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +6 -1
  82. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +1 -1
  83. package/dist/esm/anyspend/constants/index.d.ts +0 -1
  84. package/dist/esm/anyspend/constants/index.js +0 -1
  85. package/dist/esm/anyspend/react/components/AnySpend.d.ts +0 -1
  86. package/dist/esm/anyspend/react/components/AnySpend.js +13 -17
  87. package/dist/esm/anyspend/react/components/AnySpendBondKit.js +1 -1
  88. package/dist/esm/anyspend/react/components/AnySpendBuySpin.d.ts +1 -2
  89. package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +2 -2
  90. package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +0 -1
  91. package/dist/esm/anyspend/react/components/AnySpendCustom.js +10 -11
  92. package/dist/esm/anyspend/react/components/AnySpendNFT.d.ts +1 -2
  93. package/dist/esm/anyspend/react/components/AnySpendNFT.js +2 -2
  94. package/dist/esm/anyspend/react/components/AnySpendStakeB3.d.ts +1 -2
  95. package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +2 -2
  96. package/dist/esm/anyspend/react/components/AnySpendTournament.d.ts +0 -2
  97. package/dist/esm/anyspend/react/components/AnySpendTournament.js +2 -2
  98. package/dist/esm/anyspend/react/components/AnyspendSignatureMint.js +1 -1
  99. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +4 -4
  100. package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.d.ts +1 -2
  101. package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.js +5 -5
  102. package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +0 -1
  103. package/dist/esm/anyspend/react/components/common/OrderDetails.js +2 -2
  104. package/dist/esm/anyspend/react/components/common/OrderHistory.js +1 -2
  105. package/dist/esm/anyspend/react/components/common/OrderStatus.js +7 -1
  106. package/dist/esm/anyspend/react/components/common/PanelOnramp.js +2 -2
  107. package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.d.ts +0 -1
  108. package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +2 -3
  109. package/dist/esm/anyspend/react/components/common/PaymentStripeWeb2.d.ts +1 -2
  110. package/dist/esm/anyspend/react/components/common/PaymentStripeWeb2.js +2 -2
  111. package/dist/esm/anyspend/react/components/common/PaymentVendorUI.d.ts +1 -2
  112. package/dist/esm/anyspend/react/components/common/PaymentVendorUI.js +2 -2
  113. package/dist/esm/anyspend/react/components/common/RecipientSelection.js +1 -1
  114. package/dist/esm/anyspend/react/components/webview/WebviewOnrampPayment.js +2 -3
  115. package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +1 -2
  116. package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +0 -1
  117. package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.js +1 -2
  118. package/dist/esm/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +1 -1
  119. package/dist/esm/anyspend/react/hooks/useAnyspendOrderAndTransactions.js +2 -2
  120. package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +1 -1
  121. package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.js +2 -2
  122. package/dist/esm/anyspend/react/hooks/useAnyspendQuote.d.ts +1 -2
  123. package/dist/esm/anyspend/react/hooks/useAnyspendQuote.js +3 -3
  124. package/dist/esm/anyspend/react/hooks/useAnyspendTokens.d.ts +1 -1
  125. package/dist/esm/anyspend/react/hooks/useAnyspendTokens.js +2 -2
  126. package/dist/esm/anyspend/react/hooks/useCoinbaseOnrampOptions.d.ts +1 -1
  127. package/dist/esm/anyspend/react/hooks/useCoinbaseOnrampOptions.js +3 -3
  128. package/dist/esm/anyspend/react/hooks/useGeoOnrampOptions.d.ts +1 -1
  129. package/dist/esm/anyspend/react/hooks/useGeoOnrampOptions.js +3 -3
  130. package/dist/esm/anyspend/react/hooks/useStripeClientSecret.d.ts +1 -1
  131. package/dist/esm/anyspend/react/hooks/useStripeClientSecret.js +3 -3
  132. package/dist/esm/anyspend/react/hooks/useStripeSupport.d.ts +1 -1
  133. package/dist/esm/anyspend/react/hooks/useStripeSupport.js +3 -3
  134. package/dist/esm/anyspend/services/anyspend.d.ts +9 -10
  135. package/dist/esm/anyspend/services/anyspend.js +19 -19
  136. package/dist/esm/global-account/react/components/B3DynamicModal.js +13 -15
  137. package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +1 -2
  138. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +2 -2
  139. package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.d.ts +1 -2
  140. package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +1 -3
  141. package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.d.ts +1 -2
  142. package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +5 -5
  143. package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.d.ts +1 -0
  144. package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +33 -22
  145. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStep.js +2 -2
  146. package/dist/esm/global-account/react/components/custom/CopyToClipboard.d.ts +2 -1
  147. package/dist/esm/global-account/react/components/custom/CopyToClipboard.js +4 -3
  148. package/dist/esm/global-account/react/components/icons/BankIcon.d.ts +9 -0
  149. package/dist/esm/global-account/react/components/icons/BankIcon.js +5 -0
  150. package/dist/esm/global-account/react/components/icons/EditIcon.d.ts +9 -0
  151. package/dist/esm/global-account/react/components/icons/EditIcon.js +5 -0
  152. package/dist/esm/global-account/react/components/icons/SignOutIcon.d.ts +9 -0
  153. package/dist/esm/global-account/react/components/icons/SignOutIcon.js +5 -0
  154. package/dist/esm/global-account/react/components/icons/SwapIcon.d.ts +9 -0
  155. package/dist/esm/global-account/react/components/icons/SwapIcon.js +5 -0
  156. package/dist/esm/global-account/react/hooks/useB3BalanceFromAddresses.d.ts +6 -0
  157. package/dist/esm/global-account/react/hooks/useB3BalanceFromAddresses.js +11 -0
  158. package/dist/esm/global-account/react/hooks/useNativeBalance.d.ts +6 -0
  159. package/dist/esm/global-account/react/hooks/useNativeBalance.js +39 -6
  160. package/dist/esm/global-account/react/hooks/useTokenPrice.d.ts +10 -0
  161. package/dist/esm/global-account/react/hooks/useTokenPrice.js +78 -3
  162. package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +6 -1
  163. package/dist/esm/global-account/react/stores/useModalStore.d.ts +1 -1
  164. package/dist/styles/index.css +1 -1
  165. package/dist/types/anyspend/constants/index.d.ts +0 -1
  166. package/dist/types/anyspend/react/components/AnySpend.d.ts +0 -1
  167. package/dist/types/anyspend/react/components/AnySpendBuySpin.d.ts +1 -2
  168. package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +0 -1
  169. package/dist/types/anyspend/react/components/AnySpendNFT.d.ts +1 -2
  170. package/dist/types/anyspend/react/components/AnySpendStakeB3.d.ts +1 -2
  171. package/dist/types/anyspend/react/components/AnySpendTournament.d.ts +0 -2
  172. package/dist/types/anyspend/react/components/common/FiatPaymentMethod.d.ts +1 -2
  173. package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +0 -1
  174. package/dist/types/anyspend/react/components/common/PanelOnrampPayment.d.ts +0 -1
  175. package/dist/types/anyspend/react/components/common/PaymentStripeWeb2.d.ts +1 -2
  176. package/dist/types/anyspend/react/components/common/PaymentVendorUI.d.ts +1 -2
  177. package/dist/types/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +0 -1
  178. package/dist/types/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +1 -1
  179. package/dist/types/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +1 -1
  180. package/dist/types/anyspend/react/hooks/useAnyspendQuote.d.ts +1 -2
  181. package/dist/types/anyspend/react/hooks/useAnyspendTokens.d.ts +1 -1
  182. package/dist/types/anyspend/react/hooks/useCoinbaseOnrampOptions.d.ts +1 -1
  183. package/dist/types/anyspend/react/hooks/useGeoOnrampOptions.d.ts +1 -1
  184. package/dist/types/anyspend/react/hooks/useStripeClientSecret.d.ts +1 -1
  185. package/dist/types/anyspend/react/hooks/useStripeSupport.d.ts +1 -1
  186. package/dist/types/anyspend/services/anyspend.d.ts +9 -10
  187. package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +1 -2
  188. package/dist/types/global-account/react/components/B3Provider/B3Provider.native.d.ts +1 -2
  189. package/dist/types/global-account/react/components/B3Provider/RelayKitProviderWrapper.d.ts +1 -2
  190. package/dist/types/global-account/react/components/ManageAccount/ManageAccount.d.ts +1 -0
  191. package/dist/types/global-account/react/components/custom/CopyToClipboard.d.ts +2 -1
  192. package/dist/types/global-account/react/components/icons/BankIcon.d.ts +9 -0
  193. package/dist/types/global-account/react/components/icons/EditIcon.d.ts +9 -0
  194. package/dist/types/global-account/react/components/icons/SignOutIcon.d.ts +9 -0
  195. package/dist/types/global-account/react/components/icons/SwapIcon.d.ts +9 -0
  196. package/dist/types/global-account/react/hooks/useB3BalanceFromAddresses.d.ts +6 -0
  197. package/dist/types/global-account/react/hooks/useNativeBalance.d.ts +6 -0
  198. package/dist/types/global-account/react/hooks/useTokenPrice.d.ts +10 -0
  199. package/dist/types/global-account/react/stores/useModalStore.d.ts +1 -1
  200. package/package.json +2 -1
  201. package/src/anyspend/constants/index.ts +0 -1
  202. package/src/anyspend/docs/components.md +1 -5
  203. package/src/anyspend/docs/error-handling.md +47 -47
  204. package/src/anyspend/docs/examples.md +29 -29
  205. package/src/anyspend/docs/hooks.md +22 -27
  206. package/src/anyspend/docs/installation.md +1 -5
  207. package/src/anyspend/react/components/AnySpend.tsx +8 -28
  208. package/src/anyspend/react/components/AnySpendBondKit.tsx +0 -1
  209. package/src/anyspend/react/components/AnySpendBuySpin.tsx +0 -3
  210. package/src/anyspend/react/components/AnySpendCustom.tsx +8 -16
  211. package/src/anyspend/react/components/AnySpendNFT.tsx +0 -3
  212. package/src/anyspend/react/components/AnySpendStakeB3.tsx +0 -3
  213. package/src/anyspend/react/components/AnySpendTournament.tsx +0 -4
  214. package/src/anyspend/react/components/AnyspendSignatureMint.tsx +0 -1
  215. package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +7 -7
  216. package/src/anyspend/react/components/common/FiatPaymentMethod.tsx +5 -7
  217. package/src/anyspend/react/components/common/OrderDetails.tsx +1 -3
  218. package/src/anyspend/react/components/common/OrderHistory.tsx +1 -3
  219. package/src/anyspend/react/components/common/OrderStatus.tsx +7 -1
  220. package/src/anyspend/react/components/common/PanelOnramp.tsx +2 -2
  221. package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +1 -4
  222. package/src/anyspend/react/components/common/PaymentStripeWeb2.tsx +1 -3
  223. package/src/anyspend/react/components/common/PaymentVendorUI.tsx +2 -3
  224. package/src/anyspend/react/components/common/RecipientSelection.tsx +1 -1
  225. package/src/anyspend/react/components/webview/WebviewOnrampPayment.tsx +1 -3
  226. package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +0 -2
  227. package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +1 -13
  228. package/src/anyspend/react/hooks/useAnyspendOrderAndTransactions.ts +2 -2
  229. package/src/anyspend/react/hooks/useAnyspendOrderHistory.ts +2 -7
  230. package/src/anyspend/react/hooks/useAnyspendQuote.ts +3 -4
  231. package/src/anyspend/react/hooks/useAnyspendTokens.ts +2 -2
  232. package/src/anyspend/react/hooks/useCoinbaseOnrampOptions.ts +3 -8
  233. package/src/anyspend/react/hooks/useGeoOnrampOptions.ts +2 -3
  234. package/src/anyspend/react/hooks/useStripeClientSecret.ts +3 -3
  235. package/src/anyspend/react/hooks/useStripeSupport.ts +3 -8
  236. package/src/anyspend/services/anyspend.ts +19 -45
  237. package/src/global-account/react/components/B3DynamicModal.tsx +66 -39
  238. package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +1 -4
  239. package/src/global-account/react/components/B3Provider/B3Provider.tsx +1 -3
  240. package/src/global-account/react/components/B3Provider/RelayKitProviderWrapper.tsx +4 -6
  241. package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +309 -137
  242. package/src/global-account/react/components/SignInWithB3/steps/LoginStep.tsx +4 -3
  243. package/src/global-account/react/components/custom/CopyToClipboard.tsx +7 -4
  244. package/src/global-account/react/components/icons/BankIcon.tsx +38 -0
  245. package/src/global-account/react/components/icons/EditIcon.tsx +33 -0
  246. package/src/global-account/react/components/icons/SignOutIcon.tsx +28 -0
  247. package/src/global-account/react/components/icons/SwapIcon.tsx +41 -0
  248. package/src/global-account/react/hooks/useB3BalanceFromAddresses.ts +18 -0
  249. package/src/global-account/react/hooks/useNativeBalance.tsx +51 -6
  250. package/src/global-account/react/hooks/useTokenPrice.tsx +138 -3
  251. package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +9 -3
  252. package/src/global-account/react/stores/useModalStore.ts +1 -1
  253. package/src/styles/index.css +328 -0
@@ -4,6 +4,7 @@ exports.B3DynamicModal = B3DynamicModal;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("../../../anyspend/react");
6
6
  const react_2 = require("../../../global-account/react");
7
+ const cn_1 = require("../../../shared/utils/cn");
7
8
  const debug_1 = require("../../../shared/utils/debug");
8
9
  const useB3_1 = require("./B3Provider/useB3");
9
10
  const ManageAccount_1 = require("./ManageAccount/ManageAccount");
@@ -17,9 +18,9 @@ function B3DynamicModal() {
17
18
  const { isOpen, setB3ModalOpen, contentType, history, navigateBack } = (0, react_2.useModalStore)();
18
19
  const { theme } = (0, useB3_1.useB3)();
19
20
  const isMobile = (0, react_2.useIsMobile)();
20
- let contentClass = `b3-modal ${theme === "dark" ? "dark" : ""}`;
21
21
  let hideCloseButton = false;
22
- if ([
22
+ // Define arrays for different modal type groups
23
+ const fullWidthTypes = [
23
24
  "anySpend",
24
25
  "anySpendNft",
25
26
  "anySpendJoinTournament",
@@ -30,10 +31,8 @@ function B3DynamicModal() {
30
31
  "signInWithB3",
31
32
  "anySpendSignatureMint",
32
33
  "anySpendBondKit",
33
- ].find(type => contentType?.type === type)) {
34
- contentClass += " w-full";
35
- }
36
- if ([
34
+ ];
35
+ const freestyleTypes = [
37
36
  "anySpendNft",
38
37
  "anySpendJoinTournament",
39
38
  "anySpendFundTournament",
@@ -41,16 +40,15 @@ function B3DynamicModal() {
41
40
  "anySpendBuySpin",
42
41
  "anySpendSignatureMint",
43
42
  "anySpendBondKit",
44
- ].find(type => contentType?.type === type)) {
45
- // Due to the dynamic of (Pay with crypto),(Pay with fiat), we want the height fixed to 90dvh but still scrollable.
46
- // NOTE: Just leave it here in case we want the fixed height
47
- // contentClass += " min-h-[90dvh] b3-modal-freestyle";
48
- contentClass += " b3-modal-freestyle";
43
+ ];
44
+ // Check if current content type is in freestyle types
45
+ const isFreestyleType = freestyleTypes.includes(contentType?.type);
46
+ if (isFreestyleType) {
49
47
  hideCloseButton = true;
50
48
  }
51
- if (contentType?.type === "transak") {
52
- contentClass += " transak-modal";
53
- }
49
+ // Build content class using cn utility
50
+ // eslint-disable-next-line tailwindcss/no-custom-classname
51
+ const contentClass = (0, cn_1.cn)("b3-modal", theme === "dark" && "dark", fullWidthTypes.includes(contentType?.type) && "w-full", isFreestyleType && "b3-modal-freestyle", contentType?.type === "signInWithB3" && "p-0", contentType?.type === "anySpend" && "md:px-6", contentType?.type === "transak" && "transak-modal");
54
52
  debug("contentType", contentType);
55
53
  const renderContent = () => {
56
54
  if (!contentType)
@@ -93,5 +91,5 @@ function B3DynamicModal() {
93
91
  const ModalContent = isMobile ? drawer_1.DrawerContent : dialog_1.DialogContent;
94
92
  const ModalTitle = isMobile ? drawer_1.DrawerTitle : dialog_1.DialogTitle;
95
93
  const ModalDescription = isMobile ? drawer_1.DrawerDescription : dialog_1.DialogDescription;
96
- return ((0, jsx_runtime_1.jsx)(ModalComponent, { open: isOpen, onOpenChange: setB3ModalOpen, children: (0, jsx_runtime_1.jsxs)(ModalContent, { className: contentClass, hideCloseButton: hideCloseButton, children: [(0, jsx_runtime_1.jsx)(ModalTitle, { className: "sr-only hidden", children: contentType?.type || "Modal" }), (0, jsx_runtime_1.jsx)(ModalDescription, { className: "sr-only hidden", children: contentType?.type || "Modal Body" }), (0, jsx_runtime_1.jsxs)("div", { className: "no-scrollbar max-h-[90dvh] overflow-auto sm:max-h-[80dvh]", children: [history.length > 0 && contentType?.showBackButton && ((0, jsx_runtime_1.jsxs)("button", { onClick: navigateBack, className: "b3-modal-back-button mb-4 flex items-center gap-2 transition-colors hover:text-white", children: [(0, jsx_runtime_1.jsx)("span", { children: "\u2190" }), (0, jsx_runtime_1.jsx)("span", { className: "text-sm", children: "Back" })] })), renderContent()] })] }) }));
94
+ return ((0, jsx_runtime_1.jsx)(ModalComponent, { open: isOpen, onOpenChange: setB3ModalOpen, children: (0, jsx_runtime_1.jsxs)(ModalContent, { className: (0, cn_1.cn)(contentClass, "rounded-2xl bg-white shadow-xl dark:bg-gray-900", "border border-gray-200 dark:border-gray-800", "mx-auto w-full max-w-md", "sm:max-w-lg"), hideCloseButton: hideCloseButton, children: [(0, jsx_runtime_1.jsx)(ModalTitle, { className: "sr-only hidden", children: contentType?.type || "Modal" }), (0, jsx_runtime_1.jsx)(ModalDescription, { className: "sr-only hidden", children: contentType?.type || "Modal Body" }), (0, jsx_runtime_1.jsxs)("div", { className: "no-scrollbar max-h-[90dvh] overflow-auto sm:max-h-[80dvh]", children: [history.length > 0 && contentType?.showBackButton && ((0, jsx_runtime_1.jsxs)("button", { onClick: navigateBack, className: "flex items-center gap-2 px-6 py-4 text-gray-600 transition-colors hover:text-gray-900 dark:text-gray-400 dark:hover:text-white", children: [(0, jsx_runtime_1.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("path", { d: "M15.8337 10H4.16699", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M10.0003 15.8334L4.16699 10L10.0003 4.16669", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }), (0, jsx_runtime_1.jsx)("span", { className: "text-sm font-medium", children: "Back" })] })), renderContent()] })] }) }));
97
95
  }
@@ -6,8 +6,7 @@ export declare const wagmiConfig: import("wagmi").Config<readonly [import("viem"
6
6
  /**
7
7
  * Main B3Provider component
8
8
  */
9
- export declare function B3Provider({ isMainnetAnySpend, theme, children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster, }: {
10
- isMainnetAnySpend?: boolean;
9
+ export declare function B3Provider({ theme, children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster, }: {
11
10
  theme: "light" | "dark";
12
11
  children: React.ReactNode;
13
12
  accountOverride?: Account;
@@ -32,8 +32,8 @@ const queryClient = new react_query_1.QueryClient();
32
32
  /**
33
33
  * Main B3Provider component
34
34
  */
35
- function B3Provider({ isMainnetAnySpend = true, theme = "light", children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster, }) {
36
- return ((0, jsx_runtime_1.jsx)(wagmi_1.WagmiProvider, { config: exports.wagmiConfig, children: (0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: queryClient, children: (0, jsx_runtime_1.jsx)(react_3.ThirdwebProvider, { children: (0, jsx_runtime_1.jsx)(react_1.TooltipProvider, { children: (0, jsx_runtime_1.jsx)(InnerProvider, { accountOverride: accountOverride, environment: environment, theme: theme, automaticallySetFirstEoa: !!automaticallySetFirstEoa, children: (0, jsx_runtime_1.jsxs)(react_1.RelayKitProviderWrapper, { isMainnet: isMainnetAnySpend, simDuneApiKey: simDuneApiKey, children: [children, (0, jsx_runtime_1.jsx)(StyleRoot_1.StyleRoot, { id: "b3-root" }), (0, jsx_runtime_1.jsx)(sonner_1.Toaster, { theme: theme, position: toaster?.position, style: toaster?.style })] }) }) }) }) }) }));
35
+ function B3Provider({ theme = "light", children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster, }) {
36
+ return ((0, jsx_runtime_1.jsx)(wagmi_1.WagmiProvider, { config: exports.wagmiConfig, children: (0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: queryClient, children: (0, jsx_runtime_1.jsx)(react_3.ThirdwebProvider, { children: (0, jsx_runtime_1.jsx)(react_1.TooltipProvider, { children: (0, jsx_runtime_1.jsx)(InnerProvider, { accountOverride: accountOverride, environment: environment, theme: theme, automaticallySetFirstEoa: !!automaticallySetFirstEoa, children: (0, jsx_runtime_1.jsxs)(react_1.RelayKitProviderWrapper, { simDuneApiKey: simDuneApiKey, children: [children, (0, jsx_runtime_1.jsx)(StyleRoot_1.StyleRoot, { id: "b3-root" }), (0, jsx_runtime_1.jsx)(sonner_1.Toaster, { theme: theme, position: toaster?.position, style: toaster?.style })] }) }) }) }) }) }));
37
37
  }
38
38
  /**
39
39
  * Inner provider component that provides the actual B3Context
@@ -4,8 +4,7 @@ import { B3ContextType } from "./types";
4
4
  /**
5
5
  * Main B3Provider component
6
6
  */
7
- export declare function B3Provider({ isMainnetAnySpend, theme, children, accountOverride, environment, }: {
8
- isMainnetAnySpend?: boolean;
7
+ export declare function B3Provider({ theme, children, accountOverride, environment, }: {
9
8
  theme: "light" | "dark";
10
9
  children: React.ReactNode;
11
10
  accountOverride?: Account;
@@ -21,9 +21,7 @@ const queryClient = new react_query_1.QueryClient();
21
21
  /**
22
22
  * Main B3Provider component
23
23
  */
24
- function B3Provider({
25
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
26
- isMainnetAnySpend = true, theme = "light", children, accountOverride, environment, }) {
24
+ function B3Provider({ theme = "light", children, accountOverride, environment, }) {
27
25
  return ((0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: queryClient, children: (0, jsx_runtime_1.jsx)(react_2.ThirdwebProvider, { children: (0, jsx_runtime_1.jsx)(InnerProvider, { accountOverride: accountOverride, environment: environment, theme: theme, children: children }) }) }));
28
26
  }
29
27
  /**
@@ -1,5 +1,4 @@
1
- export declare function RelayKitProviderWrapper({ isMainnet, children, simDuneApiKey, }: {
2
- isMainnet: boolean;
1
+ export declare function RelayKitProviderWrapper({ children, simDuneApiKey, }: {
3
2
  children: React.ReactNode;
4
3
  simDuneApiKey?: string;
5
4
  }): import("react/jsx-runtime").JSX.Element;
@@ -5,17 +5,17 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const relay_kit_ui_1 = require("@reservoir0x/relay-kit-ui");
6
6
  const relay_sdk_1 = require("@reservoir0x/relay-sdk");
7
7
  const react_1 = require("react");
8
- function RelayKitProviderWrapper({ isMainnet, children, simDuneApiKey, }) {
8
+ function RelayKitProviderWrapper({ children, simDuneApiKey, }) {
9
9
  const [relayChains, setRelayChains] = (0, react_1.useState)([]);
10
10
  (0, react_1.useEffect)(() => {
11
11
  const fetchChains = async () => {
12
- const chains = await (0, relay_sdk_1.fetchChainConfigs)(isMainnet ? relay_sdk_1.MAINNET_RELAY_API : relay_sdk_1.TESTNET_RELAY_API);
12
+ const chains = await (0, relay_sdk_1.fetchChainConfigs)(relay_sdk_1.MAINNET_RELAY_API);
13
13
  setRelayChains(chains);
14
14
  };
15
15
  fetchChains();
16
- }, [isMainnet]);
16
+ }, []);
17
17
  return ((0, jsx_runtime_1.jsx)(relay_kit_ui_1.RelayKitProvider, { options: {
18
- baseApiUrl: isMainnet ? relay_sdk_1.MAINNET_RELAY_API : relay_sdk_1.TESTNET_RELAY_API,
18
+ baseApiUrl: relay_sdk_1.MAINNET_RELAY_API,
19
19
  source: "anyspend",
20
20
  duneConfig: {
21
21
  apiKey: simDuneApiKey,
@@ -6,6 +6,7 @@ interface ManageAccountProps {
6
6
  onViewProfile?: () => void;
7
7
  chain: Chain;
8
8
  partnerId: string;
9
+ containerClassName?: string;
9
10
  }
10
11
  export declare function ManageAccount({ onLogout, onSwap: _onSwap, onDeposit: _onDeposit, chain, partnerId, }: ManageAccountProps): import("react/jsx-runtime").JSX.Element;
11
12
  export {};
@@ -6,7 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ManageAccount = ManageAccount;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_1 = require("../../../../global-account/react");
9
- const formatAddress_1 = require("../../../../shared/utils/formatAddress");
9
+ const BankIcon_1 = require("../../../../global-account/react/components/icons/BankIcon");
10
+ const SignOutIcon_1 = require("../../../../global-account/react/components/icons/SignOutIcon");
11
+ const SwapIcon_1 = require("../../../../global-account/react/components/icons/SwapIcon");
12
+ const utils_1 = require("../../../../shared/utils");
10
13
  const formatNumber_1 = require("../../../../shared/utils/formatNumber");
11
14
  const lucide_react_1 = require("lucide-react");
12
15
  const react_2 = require("react");
@@ -20,14 +23,17 @@ function centerTruncate(str, length = 4) {
20
23
  return `${str.slice(0, length)}...${str.slice(-length)}`;
21
24
  }
22
25
  function ManageAccount({ onLogout, onSwap: _onSwap, onDeposit: _onDeposit, chain, partnerId, }) {
23
- const { automaticallySetFirstEoa } = (0, react_1.useB3)();
24
26
  const [activeTab, setActiveTab] = (0, react_2.useState)("balance");
25
27
  const [revokingSignerId, setRevokingSignerId] = (0, react_2.useState)(null);
26
28
  const account = (0, react_3.useActiveAccount)();
27
- const { address: eoaAddress, info: { data: eoaInfo }, } = (0, useFirstEOA_1.default)();
28
29
  const { data: assets, isLoading } = (0, react_1.useAccountAssets)(account?.address);
29
30
  const { data: b3Balance } = (0, react_1.useB3BalanceFromAddresses)(account?.address);
30
31
  const { data: nativeBalance } = (0, react_1.useNativeBalance)(account?.address);
32
+ const { address: eoaAddress } = (0, useFirstEOA_1.default)();
33
+ const { data: profile } = (0, react_1.useProfile)({
34
+ address: eoaAddress || account?.address,
35
+ fresh: true,
36
+ });
31
37
  const { data: eoaNativeBalance } = (0, react_1.useNativeBalance)(eoaAddress);
32
38
  const { data: eoaB3Balance } = (0, react_1.useB3BalanceFromAddresses)(eoaAddress);
33
39
  const { data: signers, refetch: refetchSigners } = (0, react_1.useGetAllTWSigners)({
@@ -37,6 +43,8 @@ function ManageAccount({ onLogout, onSwap: _onSwap, onDeposit: _onDeposit, chain
37
43
  const { setB3ModalOpen, setB3ModalContentType } = (0, react_1.useModalStore)();
38
44
  const { logout } = (0, react_1.useAuthentication)(partnerId);
39
45
  const [logoutLoading, setLogoutLoading] = (0, react_2.useState)(false);
46
+ console.log("account", account);
47
+ console.log("eoaAddress", eoaAddress);
40
48
  const { removeSessionKey } = (0, react_1.useRemoveSessionKey)({
41
49
  chain,
42
50
  onSuccess: tx => {
@@ -60,21 +68,24 @@ function ManageAccount({ onLogout, onSwap: _onSwap, onDeposit: _onDeposit, chain
60
68
  setB3ModalOpen(false);
61
69
  setLogoutLoading(false);
62
70
  };
63
- const BalanceContent = () => ((0, jsx_runtime_1.jsxs)("div", { className: "flex h-full flex-col items-center justify-between gap-8", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-full", children: (0, jsx_runtime_1.jsxs)("div", { className: "border-b3-react-border bg-b3-react-subtle flex flex-col rounded-lg border p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "mb-4 flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("img", { src: "https://cdn.b3.fun/b3_logo.svg", alt: "B3", className: "h-6 w-6" }), (0, jsx_runtime_1.jsx)("h2", { className: "font-neue-montreal-bold text-b3-react-primary text-lg", children: "Global Account" })] }), !automaticallySetFirstEoa && ((0, jsx_runtime_1.jsxs)("div", { className: "mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("img", { src: "https://cdn.b3.fun/b3-coin-3d.png", alt: "B3", className: "h-10 w-10" }), (0, jsx_runtime_1.jsxs)("span", { className: "font-neue-montreal-bold text-2xl", children: [b3Balance?.formattedTotal || "--", " B3"] })] }), (0, jsx_runtime_1.jsx)("div", { className: "border-b3-react-border my-4 border-t" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("img", { src: "https://cdn.b3.fun/ethereum.svg", alt: "ETH", className: "h-10 w-10" }), (0, jsx_runtime_1.jsxs)("span", { className: "font-neue-montreal-bold text-2xl", children: [nativeBalance?.formattedTotal || "--", " ETH"] })] })] })), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-2", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-b3-react-secondary-foreground text-sm", children: "Your universal account for all B3-powered apps" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-b3-react-muted-foreground font-mono text-sm", children: centerTruncate(account?.address || "", 6) }), (0, jsx_runtime_1.jsx)(react_1.CopyToClipboard, { text: account?.address || "" })] })] })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "border-b3-react-border bg-b3-react-subtle w-full rounded-lg border p-4", children: eoaAddress && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h3", { className: "font-neue-montreal-bold text-b3-react-primary mb-2", children: ["Connected ", eoaInfo?.name] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("img", { src: "https://cdn.b3.fun/ethereum.svg", alt: "ETH", className: "h-10 w-10" }), (0, jsx_runtime_1.jsxs)("span", { className: "font-neue-montreal-bold text-2xl", children: [eoaNativeBalance?.formattedTotal || "--", " ETH"] })] }), (0, jsx_runtime_1.jsx)("div", { className: "border-b3-react-border my-4 border-t" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("img", { src: "https://cdn.b3.fun/b3-coin-3d.png", alt: "B3", className: "h-10 w-10" }), (0, jsx_runtime_1.jsxs)("span", { className: "font-neue-montreal-bold text-2xl", children: [eoaB3Balance?.formattedTotal || "--", " B3"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-b3-react-muted-foreground mt-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-mono text-sm", children: centerTruncate(eoaAddress, 6) }), (0, jsx_runtime_1.jsx)(react_1.CopyToClipboard, { text: eoaAddress })] })] }) })) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex w-full gap-4", children: [(0, jsx_runtime_1.jsx)(react_1.Button, { className: "font-neue-montreal-medium flex-1", onClick: () => {
64
- setB3ModalOpen(true);
65
- setB3ModalContentType({
66
- type: "anySpend",
67
- defaultActiveTab: "fiat",
68
- showBackButton: true,
69
- });
70
- }, children: "Deposit" }), (0, jsx_runtime_1.jsxs)(react_1.Button, { variant: "default", className: "font-neue-montreal-medium flex-1", onClick: () => {
71
- setB3ModalOpen(true);
72
- setB3ModalContentType({
73
- type: "anySpend",
74
- showBackButton: true,
75
- });
76
- }, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.ArrowRightLeft, { className: "mr-2 h-4 w-4" }), "Swap"] })] })] }));
77
- const AssetsContent = () => ((0, jsx_runtime_1.jsx)("div", { className: "bg-b3-react-card border-b3-react-border rounded-lg border p-4", children: assets?.nftResponse && (0, jsx_runtime_1.jsx)(AccountAssets_1.AccountAssets, { nfts: assets.nftResponse, isLoading: isLoading }) }));
78
- const AppsContent = () => ((0, jsx_runtime_1.jsxs)("div", { className: "bg-b3-react-card border-b3-react-border rounded-lg border p-4", children: [signers?.map((signer) => ((0, jsx_runtime_1.jsxs)("div", { className: "border-b3-react-border flex items-center justify-between border-b py-4 last:border-b-0", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-react-muted flex h-8 w-8 items-center justify-center rounded-full", children: (0, jsx_runtime_1.jsx)("span", { className: "text-b3-react-muted-foreground text-xs", children: "App" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-neue-montreal-bold mb-2 text-base", children: signer.partner.name }), (0, jsx_runtime_1.jsxs)("div", { className: "text-b3-react-muted-foreground flex flex-col gap-1.5", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-b3-react-muted-foreground font-mono text-xs", children: ["Added: ", new Date(signer.createdAt).toLocaleDateString()] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-b3-react-muted-foreground font-mono text-xs", children: ["Expires: ", new Date(Number(signer.endTimestamp) * 1000).toLocaleDateString()] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-b3-react-muted-foreground font-mono text-xs", children: ["Max spend: ", (0, formatNumber_1.formatNumber)(Number((0, viem_1.formatUnits)(signer.nativeTokenLimitPerTransaction, 18))), " ETH"] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-b3-react-muted-foreground font-mono text-xs", children: ["Approved Contracts: ", signer.approvedTargets.map(formatAddress_1.formatAddress).join(", ")] })] })] })] }), (0, jsx_runtime_1.jsx)(react_1.Button, { variant: "outline", size: "sm", className: "h-8 border-0 bg-red-500/80 px-4 text-xs font-medium text-white hover:bg-red-600/90", onClick: () => handleRevoke(signer), disabled: revokingSignerId === signer.id, children: revokingSignerId === signer.id ? "Revoking..." : "Revoke" })] }, signer.id))), !signers?.length && (0, jsx_runtime_1.jsx)("div", { className: "text-b3-react-muted-foreground py-8 text-center", children: "No connected apps" })] }));
79
- return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-4 p-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-1", children: (0, jsx_runtime_1.jsxs)(react_1.TabsPrimitive, { defaultValue: activeTab, onValueChange: setActiveTab, children: [(0, jsx_runtime_1.jsxs)(react_1.TabsListPrimitive, { className: "mb-4 w-full", children: [(0, jsx_runtime_1.jsx)(react_1.TabTriggerPrimitive, { value: "balance", className: "font-neue-montreal-bold text-base", children: "Balance" }), (0, jsx_runtime_1.jsx)(react_1.TabTriggerPrimitive, { value: "assets", className: "font-neue-montreal-bold text-base", children: "NFTs" }), (0, jsx_runtime_1.jsx)(react_1.TabTriggerPrimitive, { value: "apps", className: "font-neue-montreal-bold text-base", children: "Apps" })] }), (0, jsx_runtime_1.jsx)(react_1.TabsContentPrimitive, { value: "balance", children: (0, jsx_runtime_1.jsx)(BalanceContent, {}) }), (0, jsx_runtime_1.jsx)(react_1.TabsContentPrimitive, { value: "assets", children: (0, jsx_runtime_1.jsx)(AssetsContent, {}) }), (0, jsx_runtime_1.jsx)(react_1.TabsContentPrimitive, { value: "apps", children: (0, jsx_runtime_1.jsx)(AppsContent, {}) })] }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "border-b3-react-border border-t" }), (0, jsx_runtime_1.jsx)(react_1.Button, { variant: "outline", size: "sm", className: "font-neue-montreal-medium text-b3-react-muted-foreground hover:text-b3-react-foreground", onClick: onLogoutEnhanced, children: logoutLoading ? "Logging out..." : "Logout" })] })] }));
71
+ const BalanceContent = () => {
72
+ const { info: eoaInfo } = (0, useFirstEOA_1.default)();
73
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-between", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [profile?.avatar ? ((0, jsx_runtime_1.jsx)("img", { src: profile?.avatar, alt: "Profile", className: "size-24 rounded-full" })) : ((0, jsx_runtime_1.jsx)("div", { className: "bg-b3-primary-wash size-24 rounded-full" })), (0, jsx_runtime_1.jsx)("div", { className: "bg-b3-grey border-b3-background absolute -bottom-1 -right-1 flex size-8 items-center justify-center rounded-full border-4", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Pencil, { size: 16, className: "text-b3-background" }) })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h2", { className: "text-b3-grey text-xl font-semibold", children: profile?.displayName || (0, utils_1.formatUsername)(profile?.name || "") }), (0, jsx_runtime_1.jsx)("span", { className: "text-b3-foreground-muted", children: (0, utils_1.formatUsername)(profile?.name || "") })] })] }) }), (0, jsx_runtime_1.jsxs)("div", { className: "manage-account-address bg-b3-line flex h-11 items-center gap-2 rounded-full px-4", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-b3-grey font-neue-montreal-semibold", children: centerTruncate(account?.address || "") }), (0, jsx_runtime_1.jsx)(react_1.CopyToClipboard, { text: account?.address || "" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [(0, jsx_runtime_1.jsxs)(react_1.Button, { className: "manage-account-deposit bg-b3-primary-wash hover:bg-b3-primary-wash/70 h-[84px] w-full flex-col items-start gap-2 rounded-2xl", onClick: () => {
74
+ setB3ModalOpen(true);
75
+ setB3ModalContentType({
76
+ type: "anySpend",
77
+ defaultActiveTab: "fiat",
78
+ showBackButton: true,
79
+ });
80
+ }, children: [(0, jsx_runtime_1.jsx)(BankIcon_1.BankIcon, { size: 24, className: "text-b3-primary-blue shrink-0" }), (0, jsx_runtime_1.jsx)("div", { className: "text-b3-grey font-neue-montreal-semibold", children: "Deposit" })] }), (0, jsx_runtime_1.jsxs)(react_1.Button, { className: "manage-account-swap bg-b3-primary-wash hover:bg-b3-primary-wash/70 flex h-[84px] w-full flex-col items-start gap-2 rounded-2xl", onClick: () => {
81
+ setB3ModalOpen(true);
82
+ setB3ModalContentType({
83
+ type: "anySpend",
84
+ showBackButton: true,
85
+ });
86
+ }, children: [(0, jsx_runtime_1.jsx)(SwapIcon_1.SwapIcon, { size: 24, className: "text-b3-primary-blue" }), (0, jsx_runtime_1.jsx)("div", { className: "text-b3-grey font-neue-montreal-semibold", children: "Swap" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-b3-grey font-neue-montreal-semibold", children: "Balance" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-10 w-10 items-center justify-center rounded-full", children: (0, jsx_runtime_1.jsx)("img", { src: "https://cdn.b3.fun/b3-coin-3d.png", alt: "B3", className: "size-10" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-b3-grey font-neue-montreal-semibold", children: "B3" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: [b3Balance?.formattedTotal || "0.00", " B3"] })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-right", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-b3-grey font-neue-montreal-semibold", children: ["$", b3Balance?.balanceUsdFormatted || "0.00"] }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1", children: b3Balance?.priceChange24h !== null && b3Balance?.priceChange24h !== undefined ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Triangle, { className: `size-3 ${b3Balance.priceChange24h >= 0 ? "text-b3-positive fill-b3-positive" : "text-b3-negative fill-b3-negative rotate-180"}` }), (0, jsx_runtime_1.jsxs)("span", { className: `font-neue-montreal-medium text-sm ${b3Balance.priceChange24h >= 0 ? "text-b3-positive" : "text-b3-negative"}`, children: [b3Balance.priceChange24h >= 0 ? "+" : "", b3Balance.priceChange24h.toFixed(2), "%"] })] })) : ((0, jsx_runtime_1.jsx)("span", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: "--" })) })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-10 w-10 items-center justify-center rounded-full", children: (0, jsx_runtime_1.jsx)("img", { src: "https://cdn.b3.fun/ethereum.svg", alt: "ETH", className: "size-10" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-b3-grey font-neue-montreal-semibold", children: "Ethereum" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: [nativeBalance?.formattedTotal || "0.00", " ETH"] })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-right", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-b3-grey font-neue-montreal-semibold", children: ["$", nativeBalance?.formattedTotalUsd || "0.00"] }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: nativeBalance?.priceChange24h !== null && nativeBalance?.priceChange24h !== undefined ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Triangle, { className: `size-3 ${nativeBalance.priceChange24h >= 0 ? "text-b3-positive fill-b3-positive" : "text-b3-negative fill-b3-negative rotate-180"}` }), (0, jsx_runtime_1.jsxs)("span", { className: `font-neue-montreal-medium text-sm ${nativeBalance.priceChange24h >= 0 ? "text-b3-positive" : "text-b3-negative"}`, children: [nativeBalance.priceChange24h >= 0 ? "+" : "", nativeBalance.priceChange24h.toFixed(2), "%"] })] })) : ((0, jsx_runtime_1.jsx)("span", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: "--" })) })] })] })] }), eoaAddress && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsxs)("h3", { className: "text-b3-grey font-neue-montreal-semibold", children: ["Connected ", eoaInfo?.data?.name || "Wallet"] }), (0, jsx_runtime_1.jsxs)("div", { className: "manage-account-address bg-b3-line flex h-11 items-center gap-2 rounded-full px-4", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-b3-grey font-neue-montreal-semibold", children: centerTruncate(eoaAddress) }), (0, jsx_runtime_1.jsx)(react_1.CopyToClipboard, { text: eoaAddress })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-10 w-10 items-center justify-center rounded-full", children: (0, jsx_runtime_1.jsx)("img", { src: "https://cdn.b3.fun/b3-coin-3d.png", alt: "B3", className: "size-10" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-b3-grey font-neue-montreal-semibold", children: "B3" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: [eoaB3Balance?.formattedTotal || "0.00", " B3"] })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-right", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-b3-grey font-neue-montreal-semibold", children: ["$", eoaB3Balance?.balanceUsdFormatted || "0.00"] }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1", children: eoaB3Balance?.priceChange24h !== null && eoaB3Balance?.priceChange24h !== undefined ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Triangle, { className: `size-3 ${eoaB3Balance.priceChange24h >= 0 ? "text-b3-positive fill-b3-positive" : "text-b3-negative fill-b3-negative rotate-180"}` }), (0, jsx_runtime_1.jsxs)("span", { className: `font-neue-montreal-medium text-sm ${eoaB3Balance.priceChange24h >= 0 ? "text-b3-positive" : "text-b3-negative"}`, children: [eoaB3Balance.priceChange24h >= 0 ? "+" : "", eoaB3Balance.priceChange24h.toFixed(2), "%"] })] })) : ((0, jsx_runtime_1.jsx)("span", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: "--" })) })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-10 w-10 items-center justify-center rounded-full", children: (0, jsx_runtime_1.jsx)("img", { src: "https://cdn.b3.fun/ethereum.svg", alt: "ETH", className: "size-10" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-b3-grey font-neue-montreal-semibold", children: "Ethereum" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: [eoaNativeBalance?.formattedTotal || "0.00", " ETH"] })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-right", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-b3-grey font-neue-montreal-semibold", children: ["$", eoaNativeBalance?.formattedTotalUsd || "0.00"] }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: eoaNativeBalance?.priceChange24h !== null && eoaNativeBalance?.priceChange24h !== undefined ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Triangle, { className: `size-3 ${eoaNativeBalance.priceChange24h >= 0 ? "text-b3-positive fill-b3-positive" : "text-b3-negative fill-b3-negative rotate-180"}` }), (0, jsx_runtime_1.jsxs)("span", { className: `font-neue-montreal-medium text-sm ${eoaNativeBalance.priceChange24h >= 0 ? "text-b3-positive" : "text-b3-negative"}`, children: [eoaNativeBalance.priceChange24h >= 0 ? "+" : "", eoaNativeBalance.priceChange24h.toFixed(2), "%"] })] })) : ((0, jsx_runtime_1.jsx)("span", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: "--" })) })] })] })] })), (0, jsx_runtime_1.jsxs)("div", { className: "border-b3-line flex items-center justify-between rounded-2xl border p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("img", { src: "https://cdn.b3.fun/b3_logo.svg", alt: "B3", className: "h-4" }), (0, jsx_runtime_1.jsx)("h3", { className: "font-neue-montreal-semibold text-b3-grey", children: "Global Account" })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-b3-foreground-muted font-neue-montreal-medium mt-2 text-sm", children: "Your universal account for all B3-powered apps" })] }), (0, jsx_runtime_1.jsx)("button", { className: "text-b3-grey hover:text-b3-grey/80 hover:bg-b3-line border-b3-line flex size-12 items-center justify-center rounded-full border", onClick: onLogoutEnhanced, children: logoutLoading ? (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "animate-spin" }) : (0, jsx_runtime_1.jsx)(SignOutIcon_1.SignOutIcon, { size: 16, className: "text-b3-grey" }) })] })] }));
87
+ };
88
+ const AssetsContent = () => ((0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-3 gap-4", children: assets?.nftResponse ? ((0, jsx_runtime_1.jsx)(AccountAssets_1.AccountAssets, { nfts: assets.nftResponse, isLoading: isLoading })) : ((0, jsx_runtime_1.jsx)("div", { className: "col-span-3 py-12 text-center text-gray-500", children: "No NFTs found" })) }));
89
+ const AppsContent = () => ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [signers?.map((signer) => ((0, jsx_runtime_1.jsx)("div", { className: "rounded-xl border border-gray-200 p-4 dark:border-gray-800", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-gray-100 dark:bg-gray-800", children: (0, jsx_runtime_1.jsx)("span", { className: "text-xs font-medium text-gray-600 dark:text-gray-400", children: "App" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h3", { className: "font-medium text-gray-900 dark:text-white", children: signer.partner.name }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-2 space-y-1", children: [(0, jsx_runtime_1.jsxs)("p", { className: "text-xs text-gray-500", children: ["Added ", new Date(signer.createdAt).toLocaleDateString()] }), (0, jsx_runtime_1.jsxs)("p", { className: "text-xs text-gray-500", children: ["Expires ", new Date(Number(signer.endTimestamp) * 1000).toLocaleDateString()] }), (0, jsx_runtime_1.jsxs)("p", { className: "text-xs text-gray-500", children: ["Max spend: ", (0, formatNumber_1.formatNumber)(Number((0, viem_1.formatUnits)(signer.nativeTokenLimitPerTransaction, 18))), " ETH"] })] })] })] }), (0, jsx_runtime_1.jsx)(react_1.Button, { variant: "outline", size: "sm", className: "border-red-200 text-red-500 hover:border-red-300 hover:text-red-600", onClick: () => handleRevoke(signer), disabled: revokingSignerId === signer.id, children: revokingSignerId === signer.id ? "Revoking..." : "Revoke" })] }) }, signer.id))), !signers?.length && (0, jsx_runtime_1.jsx)("div", { className: "py-12 text-center text-gray-500", children: "No connected apps" })] }));
90
+ return ((0, jsx_runtime_1.jsx)("div", { className: "b3-manage-account bg-b3-background flex flex-col rounded-xl", children: (0, jsx_runtime_1.jsx)("div", { className: "flex-1", children: (0, jsx_runtime_1.jsxs)(react_1.TabsPrimitive, { defaultValue: activeTab, onValueChange: setActiveTab, children: [(0, jsx_runtime_1.jsxs)(react_1.TabsListPrimitive, { className: "font-neue-montreal-semibold text-b3-grey flex h-8 w-full items-start justify-start gap-8 border-0 text-xl md:p-4", children: [(0, jsx_runtime_1.jsx)(react_1.TabTriggerPrimitive, { value: "balance", className: "data-[state=active]:text-b3-primary-blue data-[state=active]:border-b-b3-primary-blue flex-none rounded-none border-0 p-0 pb-1 text-xl leading-none tracking-wide transition-colors data-[state=active]:border-b data-[state=active]:bg-white md:pb-4", children: "Overview" }), (0, jsx_runtime_1.jsx)(react_1.TabTriggerPrimitive, { value: "assets", className: "data-[state=active]:text-b3-primary-blue data-[state=active]:border-b-b3-primary-blue flex-none rounded-none border-0 p-0 pb-1 text-xl leading-none tracking-wide transition-colors data-[state=active]:border-b data-[state=active]:bg-white md:pb-4", children: "Mints" }), (0, jsx_runtime_1.jsx)(react_1.TabTriggerPrimitive, { value: "apps", className: "data-[state=active]:text-b3-primary-blue data-[state=active]:border-b-b3-primary-blue flex-none rounded-none border-0 p-0 pb-1 text-xl leading-none tracking-wide transition-colors data-[state=active]:border-b data-[state=active]:bg-white md:pb-4", children: "Apps" })] }), (0, jsx_runtime_1.jsx)(react_1.TabsContentPrimitive, { value: "balance", className: "pt-4 md:p-4", children: (0, jsx_runtime_1.jsx)(BalanceContent, {}) }), (0, jsx_runtime_1.jsx)(react_1.TabsContentPrimitive, { value: "assets", className: "pt-4 md:p-4", children: (0, jsx_runtime_1.jsx)(AssetsContent, {}) }), (0, jsx_runtime_1.jsx)(react_1.TabsContentPrimitive, { value: "apps", className: "pt-4 md:p-4", children: (0, jsx_runtime_1.jsx)(AppsContent, {}) })] }) }) }));
80
91
  }
@@ -17,7 +17,7 @@ function LoginStepContainer({ children, partnerId }) {
17
17
  },
18
18
  }, !!partnerId);
19
19
  const partnerLogo = partner?.data?.[0]?.loginCustomization?.logoUrl;
20
- return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center justify-center py-6", children: [partnerLogo && (0, jsx_runtime_1.jsx)("img", { src: partnerLogo, alt: "Partner Logo", className: "mb-4 h-12 w-auto object-contain" }), children, (0, jsx_runtime_1.jsxs)("h2", { className: "mt-3 flex items-center gap-2 text-lg font-bold", children: ["Powered by", (0, jsx_runtime_1.jsx)("img", { alt: "B3 Logo", className: "h-5", src: "https://cdn.b3.fun/b3_logo.svg" }), "Connect"] })] }));
20
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center justify-center", children: [partnerLogo && (0, jsx_runtime_1.jsx)("img", { src: partnerLogo, alt: "Partner Logo", className: "mb-6 mt-6 h-12 w-auto object-contain" }), children, (0, jsx_runtime_1.jsxs)("h2", { className: "mt-6 flex items-center gap-2 text-lg font-bold", children: ["Powered by", (0, jsx_runtime_1.jsx)("img", { alt: "B3 Logo", className: "h-5", src: "https://cdn.b3.fun/b3_logo.svg" }), "Connect"] })] }));
21
21
  }
22
22
  function LoginStep({ onSuccess, onError, partnerId, chain }) {
23
23
  const wallet = (0, wallets_1.ecosystemWallet)(constants_1.ecosystemWalletId, {
@@ -62,7 +62,7 @@ function LoginStep({ onSuccess, onError, partnerId, chain }) {
62
62
  header: {
63
63
  title: "Sign in with B3",
64
64
  titleIcon: "https://cdn.b3.fun/b3_logo.svg",
65
- }, onConnect: async (wallet) => {
65
+ }, className: "b3-login-step", onConnect: async (wallet) => {
66
66
  try {
67
67
  setIsAuthenticating(true);
68
68
  (0, debug_1.debug)("setIsAuthenticating:true:6");
@@ -2,6 +2,7 @@ interface CopyToClipboardProps {
2
2
  text?: string;
3
3
  onCopy?: () => void;
4
4
  children?: React.ReactNode;
5
+ className?: string;
5
6
  }
6
- export declare function CopyToClipboard({ text, onCopy, children }: CopyToClipboardProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function CopyToClipboard({ text, onCopy, children, className }: CopyToClipboardProps): import("react/jsx-runtime").JSX.Element;
7
8
  export {};
@@ -2,9 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CopyToClipboard = CopyToClipboard;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const utils_1 = require("../../../../shared/utils");
5
6
  const lucide_react_1 = require("lucide-react");
6
7
  const react_1 = require("react");
7
- function CopyToClipboard({ text, onCopy, children }) {
8
+ function CopyToClipboard({ text, onCopy, children, className }) {
8
9
  const [copied, setCopied] = (0, react_1.useState)(false);
9
10
  const handleCopy = async () => {
10
11
  if (!text)
@@ -17,5 +18,5 @@ function CopyToClipboard({ text, onCopy, children }) {
17
18
  if (children) {
18
19
  return ((0, jsx_runtime_1.jsx)("div", { onClick: handleCopy, className: "cursor-pointer", children: children }));
19
20
  }
20
- return ((0, jsx_runtime_1.jsx)("div", { onClick: handleCopy, className: "text-b3-react-muted-foreground hover:text-b3-react-foreground flex cursor-pointer items-center gap-1 text-xs transition-all duration-200", children: copied ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Check, { className: "h-4 w-4" }), (0, jsx_runtime_1.jsx)("span", { children: "Copied" })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "h-4 w-4" }), (0, jsx_runtime_1.jsx)("span", { children: "Copy" })] })) }));
21
+ return ((0, jsx_runtime_1.jsx)("div", { onClick: handleCopy, className: (0, utils_1.cn)("text-b3-foreground-muted hover:text-b3-foreground-muted/80 flex cursor-pointer items-center gap-1 text-xs transition-all duration-200", className), children: copied ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(lucide_react_1.Check, { className: "h-4 w-4" }) })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "h-4 w-4" }) })) }));
21
22
  }
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ export interface BankIconProps {
3
+ className?: string;
4
+ size?: number;
5
+ color?: string;
6
+ style?: React.CSSProperties;
7
+ }
8
+ export declare function BankIcon({ className, size, color, style }: BankIconProps): import("react/jsx-runtime").JSX.Element;
9
+ export default BankIcon;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BankIcon = BankIcon;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ function BankIcon({ className, size = 24, color = "#3268EF", style }) {
6
+ return ((0, jsx_runtime_1.jsxs)("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, style: style, children: [(0, jsx_runtime_1.jsx)("path", { d: "M2.25 9H21.75L12 3L2.25 9Z", stroke: color, strokeWidth: "2.25", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M5.25 9V15.75", stroke: color, strokeWidth: "2.25", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M9.75 9V15.75", stroke: color, strokeWidth: "2.25", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M14.25 9V15.75", stroke: color, strokeWidth: "2.25", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M18.75 9V15.75", stroke: color, strokeWidth: "2.25", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M3 15.75H21", stroke: color, strokeWidth: "2.25", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M1.5 19.5H22.5", stroke: color, strokeWidth: "2.25", strokeLinecap: "round", strokeLinejoin: "round" })] }));
7
+ }
8
+ exports.default = BankIcon;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ export interface EditIconProps {
3
+ className?: string;
4
+ size?: number;
5
+ color?: string;
6
+ style?: React.CSSProperties;
7
+ }
8
+ export declare function EditIcon({ className, size, color, style }: EditIconProps): import("react/jsx-runtime").JSX.Element;
9
+ export default EditIcon;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EditIcon = EditIcon;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ function EditIcon({ className, size = 16, color = "white", style }) {
6
+ return ((0, jsx_runtime_1.jsxs)("svg", { width: size, height: size, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, style: style, children: [(0, jsx_runtime_1.jsx)("path", { d: "M5.79313 13.5001H3C2.86739 13.5001 2.74021 13.4474 2.64645 13.3536C2.55268 13.2599 2.5 13.1327 2.5 13.0001V10.207C2.50006 10.0745 2.55266 9.94753 2.64625 9.85383L10.3538 2.14633C10.4475 2.05263 10.5746 2 10.7072 2C10.8397 2 10.9669 2.05263 11.0606 2.14633L13.8538 4.93758C13.9474 5.03134 14.0001 5.15847 14.0001 5.29102C14.0001 5.42357 13.9474 5.5507 13.8538 5.64446L6.14625 13.3538C6.05255 13.4474 5.92556 13.5 5.79313 13.5001Z", stroke: color, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M8.5 4L12 7.5", stroke: color, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }));
7
+ }
8
+ exports.default = EditIcon;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ export interface SignOutIconProps {
3
+ className?: string;
4
+ size?: number;
5
+ color?: string;
6
+ style?: React.CSSProperties;
7
+ }
8
+ export declare function SignOutIcon({ className, size, color, style }: SignOutIconProps): import("react/jsx-runtime").JSX.Element;
9
+ export default SignOutIcon;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SignOutIcon = SignOutIcon;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ function SignOutIcon({ className, size = 16, color = "#676767", style }) {
6
+ return ((0, jsx_runtime_1.jsxs)("svg", { width: size, height: size, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, style: style, children: [(0, jsx_runtime_1.jsx)("path", { d: "M7 2.5H3V13.5H7", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M7 8H14", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M11.5 5.5L14 8L11.5 10.5", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })] }));
7
+ }
8
+ exports.default = SignOutIcon;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ export interface SwapIconProps {
3
+ className?: string;
4
+ size?: number;
5
+ color?: string;
6
+ style?: React.CSSProperties;
7
+ }
8
+ export declare function SwapIcon({ className, size, color, style }: SwapIconProps): import("react/jsx-runtime").JSX.Element;
9
+ export default SwapIcon;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SwapIcon = SwapIcon;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ function SwapIcon({ className, size = 24, color = "#3268EF", style }) {
6
+ return ((0, jsx_runtime_1.jsxs)("svg", { width: size, height: size, viewBox: "0 0 25 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, style: style, children: [(0, jsx_runtime_1.jsx)("path", { d: "M8.75 9H4.25V4.5", stroke: color, strokeWidth: "2.25", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M4.25 9.00013L6.90125 6.34888C8.43666 4.81353 10.5154 3.94539 12.6868 3.93276C14.8581 3.92012 16.9468 4.764 18.5 6.28138", stroke: color, strokeWidth: "2.25", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M16.25 15H20.75V19.5", stroke: color, strokeWidth: "2.25", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M20.75 15L18.0988 17.6512C16.5633 19.1866 14.4846 20.0547 12.3132 20.0674C10.1419 20.08 8.05317 19.2361 6.5 17.7188", stroke: color, strokeWidth: "2.25", strokeLinecap: "round", strokeLinejoin: "round" })] }));
7
+ }
8
+ exports.default = SwapIcon;
@@ -10,6 +10,12 @@ export declare function useB3BalanceFromAddresses(addresses?: string[] | string
10
10
  address: string;
11
11
  balance: bigint;
12
12
  formatted: string;
13
+ balanceUsd: number;
14
+ balanceUsdFormatted: string;
15
+ priceChange24h: number | null;
13
16
  }[];
17
+ balanceUsd: number;
18
+ balanceUsdFormatted: string;
19
+ priceChange24h: number | null;
14
20
  }, Error>;
15
21
  export default useB3BalanceFromAddresses;
@@ -6,6 +6,7 @@ const formatNumber_1 = require("../../../shared/utils/formatNumber");
6
6
  const react_query_1 = require("@tanstack/react-query");
7
7
  const viem_1 = require("viem");
8
8
  const chains_1 = require("viem/chains");
9
+ const useTokenPrice_1 = require("./useTokenPrice");
9
10
  // ABI for just balanceOf
10
11
  const abi = [
11
12
  {
@@ -23,6 +24,8 @@ const client = (0, viem_1.createPublicClient)({
23
24
  });
24
25
  async function fetchB3Balances(addresses) {
25
26
  try {
27
+ // Fetch price with change data once (same for all addresses since it's the same token)
28
+ const priceData = await (0, useTokenPrice_1.fetchTokenPriceWithChange)(anyspend_1.B3_TOKEN.address, anyspend_1.B3_TOKEN.chainId, "usd");
26
29
  // Fetch all balances in parallel
27
30
  const balances = await Promise.all(addresses.map(async (address) => {
28
31
  const balance = await client.readContract({
@@ -31,18 +34,26 @@ async function fetchB3Balances(addresses) {
31
34
  functionName: "balanceOf",
32
35
  args: [address],
33
36
  });
37
+ const balanceUsd = Number((0, viem_1.formatUnits)(balance, anyspend_1.B3_TOKEN.decimals)) * priceData.price;
34
38
  return {
35
39
  address,
36
40
  balance,
37
41
  formatted: (0, viem_1.formatUnits)(balance, anyspend_1.B3_TOKEN.decimals),
42
+ balanceUsd,
43
+ balanceUsdFormatted: (0, formatNumber_1.formatNumber)(balanceUsd),
44
+ priceChange24h: priceData.priceChange24h,
38
45
  };
39
46
  }));
40
47
  // Calculate total
41
48
  const totalBalance = balances.reduce((sum, { balance }) => sum + balance, BigInt(0));
49
+ const totalBalanceUsd = balances.reduce((sum, { balanceUsd }) => sum + balanceUsd, 0);
42
50
  return {
43
51
  totalBalance,
44
52
  formattedTotal: (0, formatNumber_1.formatNumber)(Number((0, viem_1.formatUnits)(totalBalance, anyspend_1.B3_TOKEN.decimals))),
45
53
  breakdown: balances,
54
+ balanceUsd: totalBalanceUsd,
55
+ balanceUsdFormatted: (0, formatNumber_1.formatNumber)(totalBalanceUsd),
56
+ priceChange24h: priceData.priceChange24h,
46
57
  };
47
58
  }
48
59
  catch (error) {
@@ -1,10 +1,16 @@
1
1
  export declare function useNativeBalance(address?: string, chainIds?: string): import("@tanstack/react-query").UseQueryResult<{
2
2
  total: number;
3
3
  formattedTotal: string;
4
+ totalUsd: number;
5
+ formattedTotalUsd: string;
6
+ priceChange24h: number | null;
4
7
  breakdown: {
5
8
  chainId: number;
6
9
  balance: bigint;
7
10
  formatted: string;
11
+ balanceUsd: number;
12
+ balanceUsdFormatted: string;
13
+ priceChange24h: number | null;
8
14
  }[];
9
15
  }, Error>;
10
16
  /**
@@ -7,6 +7,7 @@ const formatNumber_1 = require("../../../shared/utils/formatNumber");
7
7
  const react_query_1 = require("@tanstack/react-query");
8
8
  const sonner_1 = require("sonner");
9
9
  const viem_1 = require("viem");
10
+ const useTokenPrice_1 = require("./useTokenPrice");
10
11
  async function fetchNativeBalance(address, chainIds) {
11
12
  if (!address)
12
13
  throw new Error("Address is required");
@@ -20,20 +21,52 @@ async function fetchNativeBalance(address, chainIds) {
20
21
  const balance = (0, viem_1.formatUnits)(BigInt(curr.balance), curr.tokenDecimals);
21
22
  return acc + Number(balance);
22
23
  }, 0);
24
+ // TODO: Revive me once CoinGecko supports B3
25
+ let usdBalances = {};
26
+ let globalPriceChange24h = null;
27
+ try {
28
+ for (const item of data.data) {
29
+ // Use chain ID once since native token ETH is the same across all chains
30
+ const priceData = await (0, useTokenPrice_1.fetchNativeTokenPriceWithChange)("eth");
31
+ // Store the price change globally (same for all chains since it's ETH)
32
+ if (globalPriceChange24h === null) {
33
+ globalPriceChange24h = priceData.priceChange24h;
34
+ }
35
+ usdBalances[item.chainId] = {
36
+ balance: total * priceData.price,
37
+ formatted: (0, formatNumber_1.formatNumber)(total * priceData.price),
38
+ priceChange24h: priceData.priceChange24h,
39
+ };
40
+ }
41
+ }
42
+ catch (error) {
43
+ console.error("@@useNativeBalance:error in price calculation", error);
44
+ }
45
+ const totalUsd = Object.values(usdBalances).reduce((acc, curr) => acc + curr.balance, 0);
23
46
  return {
24
47
  total,
25
48
  formattedTotal: (0, formatNumber_1.formatNumber)(total),
26
- breakdown: data.data.map(item => ({
27
- chainId: item.chainId,
28
- balance: BigInt(item.balance),
29
- formatted: (0, formatNumber_1.formatNumber)(Number((0, viem_1.formatUnits)(BigInt(item.balance), item.tokenDecimals))),
30
- })),
49
+ totalUsd,
50
+ formattedTotalUsd: (0, formatNumber_1.formatNumber)(totalUsd),
51
+ priceChange24h: globalPriceChange24h,
52
+ breakdown: data.data.map(item => {
53
+ const usdBalance = usdBalances[item.chainId]?.balance || 0;
54
+ const priceChange = usdBalances[item.chainId]?.priceChange24h || null;
55
+ return {
56
+ chainId: item.chainId,
57
+ balance: BigInt(item.balance),
58
+ formatted: (0, formatNumber_1.formatNumber)(Number((0, viem_1.formatUnits)(BigInt(item.balance), item.tokenDecimals))),
59
+ balanceUsd: usdBalance,
60
+ balanceUsdFormatted: (0, formatNumber_1.formatNumber)(usdBalance),
61
+ priceChange24h: priceChange,
62
+ };
63
+ }),
31
64
  };
32
65
  }
33
66
  function useNativeBalance(address, chainIds = "8333") {
34
67
  return (0, react_query_1.useQuery)({
35
68
  queryKey: ["nativeBalance", address, chainIds],
36
- queryFn: () => fetchNativeBalance(address, chainIds),
69
+ queryFn: () => fetchNativeBalance(address || "", chainIds),
37
70
  enabled: Boolean(address),
38
71
  staleTime: 30 * 1000, // Consider data fresh for 30 seconds
39
72
  gcTime: 5 * 60 * 1000, // Keep unused data in cache for 5 minutes
@@ -7,6 +7,16 @@ interface UseTokenPriceProps {
7
7
  refreshInterval?: number;
8
8
  queryOptions?: Omit<UseQueryOptions<number, Error>, "queryKey" | "queryFn" | "refetchInterval" | "staleTime" | "retry" | "retryDelay">;
9
9
  }
10
+ export declare function fetchNativeTokenPriceUsd(contractAddress: string, network: string): Promise<number>;
11
+ export declare function fetchNativeTokenPriceWithChange(network: string): Promise<{
12
+ price: number;
13
+ priceChange24h: number | null;
14
+ }>;
15
+ export declare function fetchTokenPrice(contractAddress: string, chainId: number, vsCurrency?: string): Promise<number>;
16
+ export declare function fetchTokenPriceWithChange(contractAddress: string, chainId: number, vsCurrency?: string): Promise<{
17
+ price: number;
18
+ priceChange24h: number | null;
19
+ }>;
10
20
  export declare function useTokenPrice({ contractAddress, chainId, // Default to Base
11
21
  vsCurrency, refreshInterval, queryOptions, }: UseTokenPriceProps): {
12
22
  price: number;