@b3dotfun/sdk 0.0.65-alpha.0 → 0.0.65-test.3

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 (268) hide show
  1. package/dist/cjs/anyspend/react/components/AnySpend.js +77 -35
  2. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +2 -2
  3. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +1 -1
  4. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +1 -1
  5. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.d.ts +0 -6
  6. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +5 -3
  7. package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.js +1 -1
  8. package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.js +2 -2
  9. package/dist/cjs/anyspend/react/components/common/OrderHistory.d.ts +1 -1
  10. package/dist/cjs/anyspend/react/components/common/OrderHistory.js +7 -3
  11. package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +1 -1
  12. package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.js +1 -1
  13. package/dist/cjs/anyspend/react/components/common/RecipientSelection.js +1 -1
  14. package/dist/cjs/anyspend/react/hooks/useSigMint.d.ts +1 -1
  15. package/dist/cjs/global-account/react/components/AccountAssets/AccountAssets.js +38 -2
  16. package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +184 -35
  17. package/dist/cjs/global-account/react/components/B3DynamicModal.js +23 -12
  18. package/dist/cjs/global-account/react/components/Deposit/Deposit.d.ts +1 -0
  19. package/dist/cjs/global-account/react/components/Deposit/Deposit.js +65 -0
  20. package/dist/cjs/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +39 -0
  21. package/dist/cjs/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +37 -0
  22. package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.d.ts +6 -4
  23. package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +113 -279
  24. package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +4 -0
  25. package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.js +331 -0
  26. package/dist/cjs/global-account/react/components/ManageAccount/AppsContent.d.ts +6 -0
  27. package/dist/cjs/global-account/react/components/ManageAccount/AppsContent.js +34 -0
  28. package/dist/cjs/global-account/react/components/ManageAccount/BalanceContent.js +6 -5
  29. package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.d.ts +2 -0
  30. package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.js +23 -0
  31. package/dist/cjs/global-account/react/components/ManageAccount/Header.d.ts +3 -0
  32. package/dist/cjs/global-account/react/components/ManageAccount/Header.js +120 -0
  33. package/dist/cjs/global-account/react/components/ManageAccount/HomeActions.d.ts +5 -0
  34. package/dist/cjs/global-account/react/components/ManageAccount/HomeActions.js +43 -0
  35. package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.d.ts +6 -0
  36. package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.js +16 -0
  37. package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +24 -193
  38. package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.d.ts +2 -0
  39. package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.js +15 -0
  40. package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.d.ts +2 -0
  41. package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +47 -0
  42. package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.d.ts +7 -0
  43. package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.js +50 -0
  44. package/dist/cjs/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +9 -0
  45. package/dist/cjs/global-account/react/components/ManageAccount/SettingsMenuItem.js +8 -0
  46. package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +2 -0
  47. package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +106 -0
  48. package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.d.ts +2 -0
  49. package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.js +22 -0
  50. package/dist/cjs/global-account/react/components/ModalHeader/ModalHeader.d.ts +10 -0
  51. package/dist/cjs/global-account/react/components/ModalHeader/ModalHeader.js +12 -0
  52. package/dist/cjs/global-account/react/components/Send/Send.d.ts +5 -0
  53. package/dist/cjs/global-account/react/components/Send/Send.js +187 -0
  54. package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +3 -1
  55. package/dist/cjs/global-account/react/components/icons/BellIcon.d.ts +3 -0
  56. package/dist/cjs/global-account/react/components/icons/BellIcon.js +5 -0
  57. package/dist/cjs/global-account/react/components/icons/ChevronDownIcon.d.ts +2 -0
  58. package/dist/cjs/global-account/react/components/icons/ChevronDownIcon.js +7 -0
  59. package/dist/cjs/global-account/react/components/icons/CopyIcon.d.ts +2 -0
  60. package/dist/cjs/global-account/react/components/icons/CopyIcon.js +7 -0
  61. package/dist/cjs/global-account/react/components/icons/LinkIcon.d.ts +3 -0
  62. package/dist/cjs/global-account/react/components/icons/LinkIcon.js +5 -0
  63. package/dist/cjs/global-account/react/components/icons/LockIcon.d.ts +3 -0
  64. package/dist/cjs/global-account/react/components/icons/LockIcon.js +5 -0
  65. package/dist/cjs/global-account/react/components/icons/WalletIcon.d.ts +2 -0
  66. package/dist/cjs/global-account/react/components/icons/WalletIcon.js +7 -0
  67. package/dist/cjs/global-account/react/components/index.d.ts +5 -4
  68. package/dist/cjs/global-account/react/components/index.js +14 -9
  69. package/dist/cjs/global-account/react/components/ui/Tabs.js +2 -2
  70. package/dist/cjs/global-account/react/components/ui/dialog.js +2 -2
  71. package/dist/cjs/global-account/react/hooks/index.d.ts +1 -1
  72. package/dist/cjs/global-account/react/hooks/index.js +3 -1
  73. package/dist/cjs/global-account/react/hooks/useAccountWallet.d.ts +1 -0
  74. package/dist/cjs/global-account/react/hooks/useAccountWallet.js +18 -0
  75. package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +2 -2
  76. package/dist/cjs/global-account/react/hooks/useB3BalanceFromAddresses.js +1 -0
  77. package/dist/cjs/global-account/react/hooks/useUserQuery.d.ts +2 -2
  78. package/dist/cjs/global-account/react/stores/index.d.ts +1 -0
  79. package/dist/cjs/global-account/react/stores/index.js +3 -1
  80. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +31 -6
  81. package/dist/cjs/global-account/react/stores/useRecentAddressesStore.d.ts +25 -0
  82. package/dist/cjs/global-account/react/stores/useRecentAddressesStore.js +36 -0
  83. package/dist/cjs/global-account/react/utils/profileDisplay.d.ts +2 -0
  84. package/dist/cjs/global-account/react/utils/profileDisplay.js +2 -2
  85. package/dist/cjs/shared/constants/chains/supported.d.ts +3 -3
  86. package/dist/cjs/shared/utils/ipfs.js +10 -3
  87. package/dist/esm/anyspend/react/components/AnySpend.js +78 -36
  88. package/dist/esm/anyspend/react/components/AnySpendCustom.js +2 -2
  89. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +1 -1
  90. package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +1 -1
  91. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.d.ts +0 -6
  92. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +5 -3
  93. package/dist/esm/anyspend/react/components/common/FeeDetailPanel.js +1 -1
  94. package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.js +2 -2
  95. package/dist/esm/anyspend/react/components/common/OrderHistory.d.ts +1 -1
  96. package/dist/esm/anyspend/react/components/common/OrderHistory.js +6 -5
  97. package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +1 -1
  98. package/dist/esm/anyspend/react/components/common/PointsDetailPanel.js +1 -1
  99. package/dist/esm/anyspend/react/components/common/RecipientSelection.js +1 -1
  100. package/dist/esm/anyspend/react/hooks/useSigMint.d.ts +1 -1
  101. package/dist/esm/global-account/react/components/AccountAssets/AccountAssets.js +38 -2
  102. package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +186 -37
  103. package/dist/esm/global-account/react/components/B3DynamicModal.js +23 -12
  104. package/dist/esm/global-account/react/components/Deposit/Deposit.d.ts +1 -0
  105. package/dist/esm/global-account/react/components/Deposit/Deposit.js +59 -0
  106. package/dist/esm/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +39 -0
  107. package/dist/esm/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +34 -0
  108. package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.d.ts +6 -4
  109. package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +113 -280
  110. package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +4 -0
  111. package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.js +325 -0
  112. package/dist/esm/global-account/react/components/ManageAccount/AppsContent.d.ts +6 -0
  113. package/dist/esm/global-account/react/components/ManageAccount/AppsContent.js +32 -0
  114. package/dist/esm/global-account/react/components/ManageAccount/BalanceContent.js +6 -5
  115. package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.d.ts +2 -0
  116. package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.js +21 -0
  117. package/dist/esm/global-account/react/components/ManageAccount/Header.d.ts +3 -0
  118. package/dist/esm/global-account/react/components/ManageAccount/Header.js +81 -0
  119. package/dist/esm/global-account/react/components/ManageAccount/HomeActions.d.ts +5 -0
  120. package/dist/esm/global-account/react/components/ManageAccount/HomeActions.js +41 -0
  121. package/dist/esm/global-account/react/components/ManageAccount/HomeContent.d.ts +6 -0
  122. package/dist/esm/global-account/react/components/ManageAccount/HomeContent.js +10 -0
  123. package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +26 -195
  124. package/dist/esm/global-account/react/components/ManageAccount/NFTContent.d.ts +2 -0
  125. package/dist/esm/global-account/react/components/ManageAccount/NFTContent.js +13 -0
  126. package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.d.ts +2 -0
  127. package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +45 -0
  128. package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.d.ts +7 -0
  129. package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.js +45 -0
  130. package/dist/esm/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +9 -0
  131. package/dist/esm/global-account/react/components/ManageAccount/SettingsMenuItem.js +6 -0
  132. package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +2 -0
  133. package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +101 -0
  134. package/dist/esm/global-account/react/components/ManageAccount/TokenContent.d.ts +2 -0
  135. package/dist/esm/global-account/react/components/ManageAccount/TokenContent.js +20 -0
  136. package/dist/esm/global-account/react/components/ModalHeader/ModalHeader.d.ts +10 -0
  137. package/dist/esm/global-account/react/components/ModalHeader/ModalHeader.js +10 -0
  138. package/dist/esm/global-account/react/components/Send/Send.d.ts +5 -0
  139. package/dist/esm/global-account/react/components/Send/Send.js +181 -0
  140. package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +4 -2
  141. package/dist/esm/global-account/react/components/icons/BellIcon.d.ts +3 -0
  142. package/dist/esm/global-account/react/components/icons/BellIcon.js +3 -0
  143. package/dist/esm/global-account/react/components/icons/ChevronDownIcon.d.ts +2 -0
  144. package/dist/esm/global-account/react/components/icons/ChevronDownIcon.js +4 -0
  145. package/dist/esm/global-account/react/components/icons/CopyIcon.d.ts +2 -0
  146. package/dist/esm/global-account/react/components/icons/CopyIcon.js +4 -0
  147. package/dist/esm/global-account/react/components/icons/LinkIcon.d.ts +3 -0
  148. package/dist/esm/global-account/react/components/icons/LinkIcon.js +3 -0
  149. package/dist/esm/global-account/react/components/icons/LockIcon.d.ts +3 -0
  150. package/dist/esm/global-account/react/components/icons/LockIcon.js +3 -0
  151. package/dist/esm/global-account/react/components/icons/WalletIcon.d.ts +2 -0
  152. package/dist/esm/global-account/react/components/icons/WalletIcon.js +4 -0
  153. package/dist/esm/global-account/react/components/index.d.ts +5 -4
  154. package/dist/esm/global-account/react/components/index.js +9 -5
  155. package/dist/esm/global-account/react/components/ui/Tabs.js +2 -2
  156. package/dist/esm/global-account/react/components/ui/dialog.js +2 -2
  157. package/dist/esm/global-account/react/hooks/index.d.ts +1 -1
  158. package/dist/esm/global-account/react/hooks/index.js +1 -1
  159. package/dist/esm/global-account/react/hooks/useAccountWallet.d.ts +1 -0
  160. package/dist/esm/global-account/react/hooks/useAccountWallet.js +17 -0
  161. package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +2 -2
  162. package/dist/esm/global-account/react/hooks/useB3BalanceFromAddresses.js +1 -0
  163. package/dist/esm/global-account/react/hooks/useUserQuery.d.ts +2 -2
  164. package/dist/esm/global-account/react/stores/index.d.ts +1 -0
  165. package/dist/esm/global-account/react/stores/index.js +1 -0
  166. package/dist/esm/global-account/react/stores/useModalStore.d.ts +31 -6
  167. package/dist/esm/global-account/react/stores/useRecentAddressesStore.d.ts +25 -0
  168. package/dist/esm/global-account/react/stores/useRecentAddressesStore.js +33 -0
  169. package/dist/esm/global-account/react/utils/profileDisplay.d.ts +2 -0
  170. package/dist/esm/global-account/react/utils/profileDisplay.js +2 -2
  171. package/dist/esm/shared/constants/chains/supported.d.ts +3 -3
  172. package/dist/esm/shared/utils/ipfs.js +10 -3
  173. package/dist/styles/index.css +1 -1
  174. package/dist/types/anyspend/react/components/common/CryptoPaymentMethod.d.ts +0 -6
  175. package/dist/types/anyspend/react/components/common/OrderHistory.d.ts +1 -1
  176. package/dist/types/anyspend/react/hooks/useSigMint.d.ts +1 -1
  177. package/dist/types/global-account/react/components/Deposit/Deposit.d.ts +1 -0
  178. package/dist/types/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +39 -0
  179. package/dist/types/global-account/react/components/LinkAccount/LinkAccount.d.ts +6 -4
  180. package/dist/types/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +4 -0
  181. package/dist/types/global-account/react/components/ManageAccount/AppsContent.d.ts +6 -0
  182. package/dist/types/global-account/react/components/ManageAccount/BottomNavigation.d.ts +2 -0
  183. package/dist/types/global-account/react/components/ManageAccount/Header.d.ts +3 -0
  184. package/dist/types/global-account/react/components/ManageAccount/HomeActions.d.ts +5 -0
  185. package/dist/types/global-account/react/components/ManageAccount/HomeContent.d.ts +6 -0
  186. package/dist/types/global-account/react/components/ManageAccount/NFTContent.d.ts +2 -0
  187. package/dist/types/global-account/react/components/ManageAccount/ProfileSection.d.ts +2 -0
  188. package/dist/types/global-account/react/components/ManageAccount/SettingsContent.d.ts +7 -0
  189. package/dist/types/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +9 -0
  190. package/dist/types/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +2 -0
  191. package/dist/types/global-account/react/components/ManageAccount/TokenContent.d.ts +2 -0
  192. package/dist/types/global-account/react/components/ModalHeader/ModalHeader.d.ts +10 -0
  193. package/dist/types/global-account/react/components/Send/Send.d.ts +5 -0
  194. package/dist/types/global-account/react/components/icons/BellIcon.d.ts +3 -0
  195. package/dist/types/global-account/react/components/icons/ChevronDownIcon.d.ts +2 -0
  196. package/dist/types/global-account/react/components/icons/CopyIcon.d.ts +2 -0
  197. package/dist/types/global-account/react/components/icons/LinkIcon.d.ts +3 -0
  198. package/dist/types/global-account/react/components/icons/LockIcon.d.ts +3 -0
  199. package/dist/types/global-account/react/components/icons/WalletIcon.d.ts +2 -0
  200. package/dist/types/global-account/react/components/index.d.ts +5 -4
  201. package/dist/types/global-account/react/hooks/index.d.ts +1 -1
  202. package/dist/types/global-account/react/hooks/useAccountWallet.d.ts +1 -0
  203. package/dist/types/global-account/react/hooks/useAuthentication.d.ts +2 -2
  204. package/dist/types/global-account/react/hooks/useUserQuery.d.ts +2 -2
  205. package/dist/types/global-account/react/stores/index.d.ts +1 -0
  206. package/dist/types/global-account/react/stores/useModalStore.d.ts +31 -6
  207. package/dist/types/global-account/react/stores/useRecentAddressesStore.d.ts +25 -0
  208. package/dist/types/global-account/react/utils/profileDisplay.d.ts +2 -0
  209. package/dist/types/shared/constants/chains/supported.d.ts +3 -3
  210. package/package.json +1 -1
  211. package/src/anyspend/react/components/AnySpend.tsx +229 -170
  212. package/src/anyspend/react/components/AnySpendCustom.tsx +1 -3
  213. package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +0 -2
  214. package/src/anyspend/react/components/AnyspendDepositHype.tsx +0 -2
  215. package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +7 -14
  216. package/src/anyspend/react/components/common/FeeDetailPanel.tsx +1 -1
  217. package/src/anyspend/react/components/common/FiatPaymentMethod.tsx +2 -2
  218. package/src/anyspend/react/components/common/OrderHistory.tsx +8 -13
  219. package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +1 -1
  220. package/src/anyspend/react/components/common/PointsDetailPanel.tsx +1 -1
  221. package/src/anyspend/react/components/common/RecipientSelection.tsx +1 -1
  222. package/src/global-account/react/components/AccountAssets/AccountAssets.tsx +115 -25
  223. package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +360 -128
  224. package/src/global-account/react/components/B3DynamicModal.tsx +28 -14
  225. package/src/global-account/react/components/Deposit/Deposit.tsx +211 -0
  226. package/src/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.tsx +84 -0
  227. package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +332 -433
  228. package/src/global-account/react/components/LinkAccount/LinkNewAccount.tsx +490 -0
  229. package/src/global-account/react/components/ManageAccount/AppsContent.tsx +79 -0
  230. package/src/global-account/react/components/ManageAccount/BalanceContent.tsx +6 -10
  231. package/src/global-account/react/components/ManageAccount/BottomNavigation.tsx +83 -0
  232. package/src/global-account/react/components/ManageAccount/Header.tsx +230 -0
  233. package/src/global-account/react/components/ManageAccount/HomeActions.tsx +118 -0
  234. package/src/global-account/react/components/ManageAccount/HomeContent.tsx +42 -0
  235. package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +73 -589
  236. package/src/global-account/react/components/ManageAccount/NFTContent.tsx +24 -0
  237. package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +72 -0
  238. package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +87 -0
  239. package/src/global-account/react/components/ManageAccount/SettingsMenuItem.tsx +31 -0
  240. package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +180 -0
  241. package/src/global-account/react/components/ManageAccount/TokenContent.tsx +41 -0
  242. package/src/global-account/react/components/ModalHeader/ModalHeader.tsx +50 -0
  243. package/src/global-account/react/components/Send/Send.tsx +585 -0
  244. package/src/global-account/react/components/SignInWithB3/SignIn.tsx +11 -7
  245. package/src/global-account/react/components/icons/BellIcon.tsx +15 -0
  246. package/src/global-account/react/components/icons/ChevronDownIcon.tsx +17 -0
  247. package/src/global-account/react/components/icons/CopyIcon.tsx +22 -0
  248. package/src/global-account/react/components/icons/LinkIcon.tsx +15 -0
  249. package/src/global-account/react/components/icons/LockIcon.tsx +15 -0
  250. package/src/global-account/react/components/icons/WalletIcon.tsx +21 -0
  251. package/src/global-account/react/components/index.ts +11 -5
  252. package/src/global-account/react/components/ui/Tabs.tsx +5 -13
  253. package/src/global-account/react/components/ui/dialog.tsx +32 -14
  254. package/src/global-account/react/hooks/index.ts +3 -0
  255. package/src/global-account/react/hooks/useAccountWallet.tsx +26 -0
  256. package/src/global-account/react/hooks/useB3BalanceFromAddresses.ts +1 -0
  257. package/src/global-account/react/stores/index.ts +1 -0
  258. package/src/global-account/react/stores/useModalStore.ts +35 -6
  259. package/src/global-account/react/stores/useRecentAddressesStore.ts +55 -0
  260. package/src/global-account/react/utils/profileDisplay.ts +4 -2
  261. package/src/shared/utils/ipfs.ts +10 -3
  262. package/src/styles/index.css +6 -1
  263. package/dist/cjs/global-account/react/components/ProfileEditor/ProfileEditor.d.ts +0 -6
  264. package/dist/cjs/global-account/react/components/ProfileEditor/ProfileEditor.js +0 -141
  265. package/dist/esm/global-account/react/components/ProfileEditor/ProfileEditor.d.ts +0 -6
  266. package/dist/esm/global-account/react/components/ProfileEditor/ProfileEditor.js +0 -135
  267. package/dist/types/global-account/react/components/ProfileEditor/ProfileEditor.d.ts +0 -6
  268. package/src/global-account/react/components/ProfileEditor/ProfileEditor.tsx +0 -265
@@ -10,6 +10,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
10
10
  const anyspend_1 = require("../../../anyspend");
11
11
  const react_1 = require("../../../anyspend/react");
12
12
  const react_2 = require("../../../global-account/react");
13
+ const BottomNavigation_1 = __importDefault(require("../../../global-account/react/components/ManageAccount/BottomNavigation"));
14
+ const useAccountWallet_1 = require("../../../global-account/react/hooks/useAccountWallet");
13
15
  const cn_1 = require("../../../shared/utils/cn");
14
16
  const number_1 = require("../../../shared/utils/number");
15
17
  const invariant_1 = __importDefault(require("invariant"));
@@ -17,6 +19,7 @@ const lucide_react_1 = require("lucide-react");
17
19
  const react_3 = require("motion/react");
18
20
  const react_4 = require("react");
19
21
  const sonner_1 = require("sonner");
22
+ const thirdweb_1 = require("thirdweb");
20
23
  const viem_1 = require("viem");
21
24
  const chains_1 = require("viem/chains");
22
25
  const useAutoSelectCryptoPaymentMethod_1 = require("../hooks/useAutoSelectCryptoPaymentMethod");
@@ -55,6 +58,25 @@ function AnySpend(props) {
55
58
  function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, onTokenSelect, onSuccess, customUsdInputValues, }) {
56
59
  const searchParams = (0, react_2.useSearchParamsSSR)();
57
60
  const router = (0, react_2.useRouter)();
61
+ const { partnerId } = (0, react_2.useB3)();
62
+ const setB3ModalContentType = (0, react_2.useModalStore)(state => state.setB3ModalContentType);
63
+ // Define base chain with RPC for modal props
64
+ const baseChain = (0, react_4.useMemo)(() => (0, thirdweb_1.defineChain)({
65
+ id: 8453,
66
+ name: "Base",
67
+ nativeCurrency: {
68
+ name: "Ether",
69
+ symbol: "ETH",
70
+ decimals: 18,
71
+ },
72
+ rpc: "https://mainnet.base.org",
73
+ blockExplorers: [
74
+ {
75
+ name: "Basescan",
76
+ url: "https://basescan.org",
77
+ },
78
+ ],
79
+ }), []);
58
80
  // Determine if we're in "buy mode" based on whether destination token props are provided
59
81
  const isBuyMode = !!(destinationTokenAddress && destinationTokenChainId);
60
82
  // Add refs to track URL state
@@ -316,6 +338,7 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
316
338
  const { address: globalAddress, wallet: globalWallet, connectedEOAWallet } = (0, react_2.useAccountWallet)();
317
339
  const recipientProfile = (0, react_2.useProfile)({ address: recipientAddress, fresh: true });
318
340
  const recipientName = recipientProfile.data?.name;
341
+ const globalWalletImage = (0, useAccountWallet_1.useAccountWalletImage)();
319
342
  // Auto-set active wallet from wagmi
320
343
  (0, useAutoSetActiveWalletFromWagmi_1.useAutoSetActiveWalletFromWagmi)();
321
344
  // Check token balance for crypto payments
@@ -606,6 +629,10 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
606
629
  const onClickHistory = () => {
607
630
  setOrderId(undefined);
608
631
  navigateToPanel(PanelView.HISTORY, "forward");
632
+ setB3ModalContentType({
633
+ type: "anySpendOrderHistory",
634
+ showBackButton: false,
635
+ });
609
636
  // Remove orderId and paymentMethod from URL when going back to history
610
637
  const params = new URLSearchParams(searchParams.toString());
611
638
  params.delete("orderId");
@@ -767,43 +794,58 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
767
794
  };
768
795
  }, [activePanel, navigateBack]);
769
796
  const historyView = ((0, jsx_runtime_1.jsx)("div", { className: "mx-auto flex w-[560px] max-w-full flex-col items-center", children: (0, jsx_runtime_1.jsx)(OrderHistory_1.OrderHistory, { mode: mode, onBack: navigateBack, onSelectOrder: onSelectOrder }) }));
770
- const orderDetailsView = ((0, jsx_runtime_1.jsx)("div", { className: "mx-auto w-[460px] max-w-full", children: (0, jsx_runtime_1.jsx)("div", { className: "relative flex flex-col gap-4", children: oat && ((0, jsx_runtime_1.jsx)(OrderDetails_1.OrderDetails, { mode: mode, order: oat.data.order, depositTxs: oat.data.depositTxs, relayTxs: oat.data.relayTxs, executeTx: oat.data.executeTx, refundTxs: oat.data.refundTxs, selectedCryptoPaymentMethod: selectedCryptoPaymentMethod, onPaymentMethodChange: setSelectedCryptoPaymentMethod, points: oat.data.points || undefined, onBack: () => {
797
+ const orderDetailsView = ((0, jsx_runtime_1.jsx)("div", { className: "mx-auto w-[460px] max-w-full px-5", children: (0, jsx_runtime_1.jsx)("div", { className: "relative flex flex-col gap-4", children: oat && ((0, jsx_runtime_1.jsx)(OrderDetails_1.OrderDetails, { mode: mode, order: oat.data.order, depositTxs: oat.data.depositTxs, relayTxs: oat.data.relayTxs, executeTx: oat.data.executeTx, refundTxs: oat.data.refundTxs, selectedCryptoPaymentMethod: selectedCryptoPaymentMethod, onPaymentMethodChange: setSelectedCryptoPaymentMethod, points: oat.data.points || undefined, onBack: () => {
771
798
  setOrderId(undefined);
772
799
  navigateBack();
773
800
  setSelectedCryptoPaymentMethod(CryptoPaymentMethod_1.CryptoPaymentMethodType.NONE); // Reset payment method when going back
774
801
  } })) }) }));
775
- const mainView = ((0, jsx_runtime_1.jsxs)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2", children: [isBuyMode && ((0, jsx_runtime_1.jsxs)("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: [selectedDstToken.metadata?.logoURI && ((0, jsx_runtime_1.jsx)("div", { className: "relative", children: (0, jsx_runtime_1.jsx)("img", { src: selectedDstToken.metadata.logoURI, alt: selectedDstToken.symbol, className: "border-as-stroke h-12 w-12 rounded-full border-2 shadow-md" }) })), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("h1", { className: "text-as-primary text-xl font-bold", children: ["Buy ", selectedDstToken.symbol] }) })] })), (0, jsx_runtime_1.jsx)(TabSection_1.TabSection, { activeTab: activeTab, setActiveTab: setActiveTab, setSelectedCryptoPaymentMethod: setSelectedCryptoPaymentMethod, setSelectedFiatPaymentMethod: setSelectedFiatPaymentMethod }), (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: [activeTab === "crypto" ? ((0, jsx_runtime_1.jsx)(CryptoPaySection_1.CryptoPaySection, { selectedSrcChainId: selectedSrcChainId, setSelectedSrcChainId: setSelectedSrcChainId, selectedSrcToken: selectedSrcToken, setSelectedSrcToken: setSelectedSrcToken, srcAmount: srcAmount, setSrcAmount: setSrcAmount, isSrcInputDirty: isSrcInputDirty, setIsSrcInputDirty: setIsSrcInputDirty, selectedCryptoPaymentMethod: selectedCryptoPaymentMethod, onSelectCryptoPaymentMethod: () => navigateToPanel(PanelView.CRYPTO_PAYMENT_METHOD, "forward"), anyspendQuote: anyspendQuote, onTokenSelect: onTokenSelect, onShowFeeDetail: () => navigateToPanel(PanelView.FEE_DETAIL, "forward") })) : ((0, jsx_runtime_1.jsx)(react_3.motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, children: (0, jsx_runtime_1.jsx)(PanelOnramp_1.PanelOnramp, { srcAmountOnRamp: srcAmountOnRamp, setSrcAmountOnRamp: setSrcAmountOnRamp, selectedPaymentMethod: selectedFiatPaymentMethod, setActivePanel: (panelIndex) => {
776
- // Map panel index to navigation with direction
777
- const panelsWithForwardNav = [PanelView.FIAT_PAYMENT_METHOD, PanelView.RECIPIENT_SELECTION];
778
- if (panelsWithForwardNav.includes(panelIndex)) {
779
- navigateToPanel(panelIndex, "forward");
780
- }
781
- else {
782
- setActivePanel(panelIndex);
783
- }
784
- }, _recipientAddress: recipientAddress, destinationToken: selectedDstToken, destinationChainId: selectedDstChainId, destinationAmount: dstAmount, onDestinationTokenChange: setSelectedDstToken, onDestinationChainChange: setSelectedDstChainId, fiatPaymentMethodIndex: PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: PanelView.RECIPIENT_SELECTION, hideDstToken: isBuyMode, anyspendQuote: anyspendQuote, onShowPointsDetail: () => navigateToPanel(PanelView.POINTS_DETAIL, "forward"), onShowFeeDetail: () => navigateToPanel(PanelView.FEE_DETAIL, "forward"), customUsdInputValues: customUsdInputValues }) })), (0, jsx_runtime_1.jsx)(react_2.Button, { variant: "ghost", className: (0, cn_1.cn)("border-as-stroke bg-as-surface-primary absolute left-1/2 top-1/2 z-10 h-10 w-10 -translate-x-1/2 -translate-y-1/2 rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl", isBuyMode && "top-[calc(50%+56px)] cursor-default", activeTab === "fiat" && "hidden"), onClick: () => {
785
- if (activeTab === "fiat" || isBuyMode) {
786
- return;
787
- }
788
- // Swap chain selections
789
- const tempSrcChainId = selectedSrcChainId;
790
- const tempDstChainId = selectedDstChainId;
791
- setSelectedSrcChainId(tempDstChainId);
792
- setSelectedDstChainId(tempSrcChainId);
793
- // Swap token selections
794
- const tempSrcToken = selectedSrcToken;
795
- const tempDstToken = selectedDstToken;
796
- setSelectedSrcToken(tempDstToken);
797
- setSelectedDstToken(tempSrcToken);
798
- // Swap amounts
799
- const tempSrcAmount = srcAmount;
800
- const tempDstAmount = dstAmount;
801
- setSrcAmount(tempDstAmount);
802
- setDstAmount(tempSrcAmount);
803
- }, children: (0, jsx_runtime_1.jsx)("div", { className: "relative flex items-center justify-center transition-opacity", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ArrowDown, { className: "text-as-primary/50 h-5 w-5" }) }) }), activeTab === "crypto" && ((0, jsx_runtime_1.jsx)(CryptoReceiveSection_1.CryptoReceiveSection, { isDepositMode: false, isBuyMode: isBuyMode, selectedRecipientAddress: recipientAddress, recipientName: recipientName || undefined, onSelectRecipient: () => navigateToPanel(PanelView.RECIPIENT_SELECTION, "forward"), setRecipientAddress: setRecipientAddress, recipientAddressFromProps: recipientAddressFromProps, globalAddress: globalAddress, dstAmount: dstAmount, dstToken: selectedDstToken, selectedDstChainId: selectedDstChainId, setSelectedDstChainId: setSelectedDstChainId, setSelectedDstToken: setSelectedDstToken, isSrcInputDirty: isSrcInputDirty, onChangeDstAmount: value => {
804
- setIsSrcInputDirty(false);
805
- setDstAmount(value);
806
- }, anyspendQuote: anyspendQuote, onShowPointsDetail: () => navigateToPanel(PanelView.POINTS_DETAIL, "forward"), onShowFeeDetail: () => navigateToPanel(PanelView.FEE_DETAIL, "forward"), selectedCryptoPaymentMethod: selectedCryptoPaymentMethod }))] }), (0, jsx_runtime_1.jsxs)(react_3.motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: (0, cn_1.cn)("mt-4 flex w-full max-w-[460px] flex-col gap-2"), children: [(0, jsx_runtime_1.jsx)(react_2.ShinyButton, { accentColor: "hsl(var(--as-brand))", disabled: btnInfo.disable, onClick: onMainButtonClick, className: (0, cn_1.cn)("as-main-button relative w-full", btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand"), textClassName: (0, cn_1.cn)(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white"), children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center gap-2", children: [btnInfo.loading && (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-4 w-4 animate-spin" }), btnInfo.text] }) }), !hideTransactionHistoryButton && (globalAddress || recipientAddress) ? ((0, jsx_runtime_1.jsxs)(react_2.Button, { variant: "link", onClick: onClickHistory, className: "text-as-primary/50 hover:text-as-primary flex items-center gap-1 transition-colors", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.HistoryIcon, { className: "h-4 w-4" }), " ", (0, jsx_runtime_1.jsx)("span", { className: "pr-4", children: "Transaction History" })] })) : null] })] }));
802
+ const mainView = ((0, jsx_runtime_1.jsxs)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex w-full max-w-full flex-col items-center gap-2 px-5", children: [isBuyMode && ((0, jsx_runtime_1.jsxs)("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: [selectedDstToken.metadata?.logoURI && ((0, jsx_runtime_1.jsx)("div", { className: "relative", children: (0, jsx_runtime_1.jsx)("img", { src: selectedDstToken.metadata.logoURI, alt: selectedDstToken.symbol, className: "border-as-stroke h-12 w-12 rounded-full border-2 shadow-md" }) })), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("h1", { className: "text-as-primary text-xl font-bold", children: ["Buy ", selectedDstToken.symbol] }) })] })), (0, jsx_runtime_1.jsx)(TabSection_1.TabSection, { activeTab: activeTab, setActiveTab: setActiveTab, setSelectedCryptoPaymentMethod: setSelectedCryptoPaymentMethod, setSelectedFiatPaymentMethod: setSelectedFiatPaymentMethod }), (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: [activeTab === "crypto" ? ((0, jsx_runtime_1.jsx)(CryptoPaySection_1.CryptoPaySection, { selectedSrcChainId: selectedSrcChainId, setSelectedSrcChainId: setSelectedSrcChainId, selectedSrcToken: selectedSrcToken, setSelectedSrcToken: setSelectedSrcToken, srcAmount: srcAmount, setSrcAmount: setSrcAmount, isSrcInputDirty: isSrcInputDirty, setIsSrcInputDirty: setIsSrcInputDirty, selectedCryptoPaymentMethod: selectedCryptoPaymentMethod, onSelectCryptoPaymentMethod: () => navigateToPanel(PanelView.CRYPTO_PAYMENT_METHOD, "forward"), anyspendQuote: anyspendQuote, onTokenSelect: onTokenSelect, onShowFeeDetail: () => navigateToPanel(PanelView.FEE_DETAIL, "forward") })) : ((0, jsx_runtime_1.jsx)(react_3.motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, children: (0, jsx_runtime_1.jsx)(PanelOnramp_1.PanelOnramp, { srcAmountOnRamp: srcAmountOnRamp, setSrcAmountOnRamp: setSrcAmountOnRamp, selectedPaymentMethod: selectedFiatPaymentMethod, setActivePanel: (panelIndex) => {
803
+ // Map panel index to navigation with direction
804
+ const panelsWithForwardNav = [PanelView.FIAT_PAYMENT_METHOD, PanelView.RECIPIENT_SELECTION];
805
+ if (panelsWithForwardNav.includes(panelIndex)) {
806
+ navigateToPanel(panelIndex, "forward");
807
+ }
808
+ else {
809
+ setActivePanel(panelIndex);
810
+ }
811
+ }, _recipientAddress: recipientAddress, destinationToken: selectedDstToken, destinationChainId: selectedDstChainId, destinationAmount: dstAmount, onDestinationTokenChange: setSelectedDstToken, onDestinationChainChange: setSelectedDstChainId, fiatPaymentMethodIndex: PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: PanelView.RECIPIENT_SELECTION, hideDstToken: isBuyMode, anyspendQuote: anyspendQuote, onShowPointsDetail: () => navigateToPanel(PanelView.POINTS_DETAIL, "forward"), onShowFeeDetail: () => navigateToPanel(PanelView.FEE_DETAIL, "forward"), customUsdInputValues: customUsdInputValues }) })), (0, jsx_runtime_1.jsx)(react_2.Button, { variant: "ghost", className: (0, cn_1.cn)("border-as-stroke bg-as-surface-primary absolute left-1/2 top-1/2 z-10 h-10 w-10 -translate-x-1/2 -translate-y-1/2 rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl", isBuyMode && "top-[calc(50%+56px)] cursor-default", activeTab === "fiat" && "hidden"), onClick: () => {
812
+ if (activeTab === "fiat" || isBuyMode) {
813
+ return;
814
+ }
815
+ // Swap chain selections
816
+ const tempSrcChainId = selectedSrcChainId;
817
+ const tempDstChainId = selectedDstChainId;
818
+ setSelectedSrcChainId(tempDstChainId);
819
+ setSelectedDstChainId(tempSrcChainId);
820
+ // Swap token selections
821
+ const tempSrcToken = selectedSrcToken;
822
+ const tempDstToken = selectedDstToken;
823
+ setSelectedSrcToken(tempDstToken);
824
+ setSelectedDstToken(tempSrcToken);
825
+ // Swap amounts
826
+ const tempSrcAmount = srcAmount;
827
+ const tempDstAmount = dstAmount;
828
+ setSrcAmount(tempDstAmount);
829
+ setDstAmount(tempSrcAmount);
830
+ }, children: (0, jsx_runtime_1.jsx)("div", { className: "relative flex items-center justify-center transition-opacity", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ArrowDown, { className: "text-as-primary/50 h-5 w-5" }) }) }), activeTab === "crypto" && ((0, jsx_runtime_1.jsx)(CryptoReceiveSection_1.CryptoReceiveSection, { isDepositMode: false, isBuyMode: isBuyMode, selectedRecipientAddress: recipientAddress, recipientName: recipientName || undefined, onSelectRecipient: () => navigateToPanel(PanelView.RECIPIENT_SELECTION, "forward"), setRecipientAddress: setRecipientAddress, recipientAddressFromProps: recipientAddressFromProps, globalAddress: globalAddress, dstAmount: dstAmount, dstToken: selectedDstToken, selectedDstChainId: selectedDstChainId, setSelectedDstChainId: setSelectedDstChainId, setSelectedDstToken: setSelectedDstToken, isSrcInputDirty: isSrcInputDirty, onChangeDstAmount: value => {
831
+ setIsSrcInputDirty(false);
832
+ setDstAmount(value);
833
+ }, anyspendQuote: anyspendQuote, onShowPointsDetail: () => navigateToPanel(PanelView.POINTS_DETAIL, "forward"), onShowFeeDetail: () => navigateToPanel(PanelView.FEE_DETAIL, "forward"), selectedCryptoPaymentMethod: selectedCryptoPaymentMethod }))] }), (0, jsx_runtime_1.jsxs)(react_3.motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: (0, cn_1.cn)("mt-4 flex w-full max-w-[460px] flex-col gap-2"), children: [(0, jsx_runtime_1.jsx)(react_2.ShinyButton, { accentColor: "hsl(var(--as-brand))", disabled: btnInfo.disable, onClick: onMainButtonClick, className: (0, cn_1.cn)("as-main-button relative w-full", btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand"), textClassName: (0, cn_1.cn)(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white"), children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center gap-2", children: [btnInfo.loading && (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-4 w-4 animate-spin" }), btnInfo.text] }) }), !hideTransactionHistoryButton && (globalAddress || recipientAddress) ? ((0, jsx_runtime_1.jsxs)(react_2.Button, { variant: "link", onClick: onClickHistory, className: "text-as-primary/50 hover:text-as-primary flex items-center gap-1 transition-colors", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.HistoryIcon, { className: "h-4 w-4" }), " ", (0, jsx_runtime_1.jsx)("span", { className: "pr-4", children: "Transaction History" })] })) : null] })] }), (0, jsx_runtime_1.jsx)("div", { className: "w-full", children: (0, jsx_runtime_1.jsx)(react_2.TabsPrimitive, { defaultValue: "swap", onValueChange: value => {
834
+ if (value === "settings" || value === "home") {
835
+ setB3ModalContentType({
836
+ type: "manageAccount",
837
+ activeTab: value,
838
+ setActiveTab: () => { },
839
+ chain: baseChain,
840
+ partnerId,
841
+ });
842
+ }
843
+ else if (value === "swap") {
844
+ setB3ModalContentType({
845
+ type: "anySpend",
846
+ });
847
+ }
848
+ }, children: (0, jsx_runtime_1.jsx)(BottomNavigation_1.default, {}) }) })] }));
807
849
  const onrampPaymentView = ((0, jsx_runtime_1.jsx)(PanelOnrampPayment_1.PanelOnrampPayment, { srcAmountOnRamp: srcAmountOnRamp, recipientName: recipientName || undefined, recipientAddress: recipientAddress, isBuyMode: isBuyMode, destinationTokenChainId: destinationTokenChainId, destinationTokenAddress: destinationTokenAddress, selectedDstChainId: selectedDstChainId, selectedDstToken: selectedDstToken, orderType: "swap", anyspendQuote: anyspendQuote, globalAddress: globalAddress, onOrderCreated: orderId => {
808
850
  setOrderId(orderId);
809
851
  navigateToPanel(PanelView.ORDER_DETAILS, "forward");
@@ -818,12 +860,12 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
818
860
  params.set("paymentMethod", selectedCryptoPaymentMethod);
819
861
  }
820
862
  router.push(`${window.location.pathname}?${params.toString()}`);
821
- }, onBack: navigateBack, recipientEnsName: globalWallet?.ensName, recipientImageUrl: globalWallet?.meta?.icon }));
863
+ }, onBack: navigateBack, recipientEnsName: globalWallet?.ensName, recipientImageUrl: globalWalletImage }));
822
864
  const recipientSelectionView = ((0, jsx_runtime_1.jsx)(RecipientSelection_1.RecipientSelection, { initialValue: recipientAddress || "", onBack: navigateBack, onConfirm: address => {
823
865
  setRecipientAddress(address);
824
866
  navigateBack();
825
867
  } }));
826
- const cryptoPaymentMethodView = ((0, jsx_runtime_1.jsx)(CryptoPaymentMethod_1.CryptoPaymentMethod, { globalAddress: globalAddress, globalWallet: globalWallet, selectedPaymentMethod: selectedCryptoPaymentMethod, setSelectedPaymentMethod: setSelectedCryptoPaymentMethod, isCreatingOrder: isCreatingOrder, onBack: navigateBack, onSelectPaymentMethod: (method) => {
868
+ const cryptoPaymentMethodView = ((0, jsx_runtime_1.jsx)(CryptoPaymentMethod_1.CryptoPaymentMethod, { selectedPaymentMethod: selectedCryptoPaymentMethod, setSelectedPaymentMethod: setSelectedCryptoPaymentMethod, isCreatingOrder: isCreatingOrder, onBack: navigateBack, onSelectPaymentMethod: (method) => {
827
869
  setSelectedCryptoPaymentMethod(method);
828
870
  navigateBack();
829
871
  } }));
@@ -476,7 +476,7 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
476
476
  : orderType === "join_tournament"
477
477
  ? "Join for"
478
478
  : "Recipient" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [recipientAddress ? ((0, jsx_runtime_1.jsx)("button", { className: (0, utils_1.cn)("text-as-tertiarry flex h-7 items-center gap-2 rounded-lg"), onClick: () => setActivePanel(PanelView.RECIPIENT_SELECTION), children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", { className: "text-as-tertiarry flex items-center gap-1 text-sm", children: (0, jsx_runtime_1.jsx)("span", { children: recipientName ? (0, utils_1.formatUsername)(recipientName) : (0, formatAddress_1.shortenAddress)(recipientAddress) }) }) }) })) : ((0, jsx_runtime_1.jsx)("button", { className: "text-as-primary/70 flex items-center gap-1 rounded-lg", onClick: () => setActivePanel(PanelView.RECIPIENT_SELECTION), children: (0, jsx_runtime_1.jsx)("div", { className: "text-sm font-medium", children: "Select recipient" }) })), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })] }, recipientAddress)) : null;
479
- const historyView = ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("mx-auto flex w-full max-w-2xl flex-col items-center p-5", mode === "modal" && "bg-b3-react-background"), children: (0, jsx_runtime_1.jsx)(OrderHistory_1.OrderHistory, { mode: mode, onBack: () => {
479
+ const historyView = ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("mx-auto flex w-full max-w-2xl flex-col items-center", mode === "modal" && "bg-b3-react-background"), children: (0, jsx_runtime_1.jsx)(OrderHistory_1.OrderHistory, { mode: mode, onBack: () => {
480
480
  setActivePanel(PanelView.HISTORY);
481
481
  }, onSelectOrder: onSelectOrder }) }));
482
482
  const orderDetailsView = ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)("mx-auto flex w-full flex-col items-center gap-4 p-5", mode === "modal" && "bg-b3-react-background rounded-xl"), children: [oat && ((0, jsx_runtime_1.jsx)(OrderDetails_1.OrderDetails, { mode: mode, order: oat.data.order, depositTxs: oat.data.depositTxs, relayTxs: oat.data.relayTxs, executeTx: oat.data.executeTx, refundTxs: oat.data.refundTxs, cryptoPaymentMethod: activeTab === "fiat" ? CryptoPaymentMethod_1.CryptoPaymentMethodType.NONE : selectedCryptoPaymentMethod, selectedCryptoPaymentMethod: selectedCryptoPaymentMethod, onPaymentMethodChange: setSelectedCryptoPaymentMethod, onBack: () => {
@@ -554,7 +554,7 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
554
554
  setActivePanel(PanelView.CONFIRM_ORDER);
555
555
  } }) }));
556
556
  // Crypto payment method view
557
- const cryptoPaymentMethodView = ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("bg-as-surface-primary mx-auto w-[460px] max-w-full rounded-xl p-4"), children: (0, jsx_runtime_1.jsx)(CryptoPaymentMethod_1.CryptoPaymentMethod, { globalAddress: currentWallet?.wallet?.address, globalWallet: currentWallet?.wallet, selectedPaymentMethod: selectedCryptoPaymentMethod, setSelectedPaymentMethod: setSelectedCryptoPaymentMethod, isCreatingOrder: isCreatingOrder, onBack: () => setActivePanel(PanelView.CONFIRM_ORDER), onSelectPaymentMethod: (method) => {
557
+ const cryptoPaymentMethodView = ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("bg-as-surface-primary mx-auto w-[460px] max-w-full rounded-xl p-4"), children: (0, jsx_runtime_1.jsx)(CryptoPaymentMethod_1.CryptoPaymentMethod, { selectedPaymentMethod: selectedCryptoPaymentMethod, setSelectedPaymentMethod: setSelectedCryptoPaymentMethod, isCreatingOrder: isCreatingOrder, onBack: () => setActivePanel(PanelView.CONFIRM_ORDER), onSelectPaymentMethod: (method) => {
558
558
  setSelectedCryptoPaymentMethod(method);
559
559
  setActivePanel(PanelView.CONFIRM_ORDER);
560
560
  } }) }));
@@ -232,7 +232,7 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
232
232
  setSelectedRecipientAddress(address);
233
233
  setActivePanel(useAnyspendFlow_1.PanelView.MAIN);
234
234
  } }));
235
- const cryptoPaymentMethodView = ((0, jsx_runtime_1.jsx)(CryptoPaymentMethod_1.CryptoPaymentMethod, { globalAddress: globalAddress, globalWallet: undefined, selectedPaymentMethod: selectedCryptoPaymentMethod, setSelectedPaymentMethod: setSelectedCryptoPaymentMethod, isCreatingOrder: isCreatingOrder, onBack: () => setActivePanel(useAnyspendFlow_1.PanelView.MAIN), onSelectPaymentMethod: (method) => {
235
+ const cryptoPaymentMethodView = ((0, jsx_runtime_1.jsx)(CryptoPaymentMethod_1.CryptoPaymentMethod, { selectedPaymentMethod: selectedCryptoPaymentMethod, setSelectedPaymentMethod: setSelectedCryptoPaymentMethod, isCreatingOrder: isCreatingOrder, onBack: () => setActivePanel(useAnyspendFlow_1.PanelView.MAIN), onSelectPaymentMethod: (method) => {
236
236
  setSelectedCryptoPaymentMethod(method);
237
237
  setActivePanel(useAnyspendFlow_1.PanelView.MAIN);
238
238
  } }));
@@ -223,7 +223,7 @@ function AnySpendDepositHypeInner({ loadOrder, mode = "modal", recipientAddress,
223
223
  setSelectedRecipientAddress(address);
224
224
  setActivePanel(useAnyspendFlow_1.PanelView.MAIN);
225
225
  } }));
226
- const cryptoPaymentMethodView = ((0, jsx_runtime_1.jsx)(CryptoPaymentMethod_1.CryptoPaymentMethod, { globalAddress: globalAddress, globalWallet: undefined, selectedPaymentMethod: selectedCryptoPaymentMethod, setSelectedPaymentMethod: setSelectedCryptoPaymentMethod, isCreatingOrder: isCreatingOrder, onBack: () => setActivePanel(useAnyspendFlow_1.PanelView.MAIN), onSelectPaymentMethod: (method) => {
226
+ const cryptoPaymentMethodView = ((0, jsx_runtime_1.jsx)(CryptoPaymentMethod_1.CryptoPaymentMethod, { selectedPaymentMethod: selectedCryptoPaymentMethod, setSelectedPaymentMethod: setSelectedCryptoPaymentMethod, isCreatingOrder: isCreatingOrder, onBack: () => setActivePanel(useAnyspendFlow_1.PanelView.MAIN), onSelectPaymentMethod: (method) => {
227
227
  setSelectedCryptoPaymentMethod(method);
228
228
  setActivePanel(useAnyspendFlow_1.PanelView.MAIN);
229
229
  } }));
@@ -5,12 +5,6 @@ export declare enum CryptoPaymentMethodType {
5
5
  TRANSFER_CRYPTO = "transfer_crypto"
6
6
  }
7
7
  interface CryptoPaymentMethodProps {
8
- globalAddress?: string;
9
- globalWallet?: {
10
- meta?: {
11
- icon?: string;
12
- };
13
- };
14
8
  selectedPaymentMethod: CryptoPaymentMethodType;
15
9
  setSelectedPaymentMethod: (method: CryptoPaymentMethodType) => void;
16
10
  isCreatingOrder: boolean;
@@ -5,6 +5,7 @@ exports.CryptoPaymentMethodType = void 0;
5
5
  exports.CryptoPaymentMethod = CryptoPaymentMethod;
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
7
  const react_1 = require("../../../../global-account/react");
8
+ const useAccountWallet_1 = require("../../../../global-account/react/hooks/useAccountWallet");
8
9
  const cn_1 = require("../../../../shared/utils/cn");
9
10
  const formatAddress_1 = require("../../../../shared/utils/formatAddress");
10
11
  const thirdweb_1 = require("../../../../shared/utils/thirdweb");
@@ -25,7 +26,7 @@ var CryptoPaymentMethodType;
25
26
  CryptoPaymentMethodType["TRANSFER_CRYPTO"] = "transfer_crypto";
26
27
  })(CryptoPaymentMethodType || (exports.CryptoPaymentMethodType = CryptoPaymentMethodType = {}));
27
28
  function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentMethod, isCreatingOrder, onBack, onSelectPaymentMethod, }) {
28
- const { wallet: globalWallet, connectedEOAWallet: connectedEOAWallet, connectedSmartWallet: connectedSmartWallet, } = (0, react_1.useAccountWallet)();
29
+ const { connectedEOAWallet: connectedEOAWallet, connectedSmartWallet: connectedSmartWallet } = (0, react_1.useAccountWallet)();
29
30
  const { connector, address } = (0, wagmi_1.useAccount)();
30
31
  const { connect, connectors, isPending } = (0, wagmi_1.useConnect)();
31
32
  const { disconnect } = (0, wagmi_1.useDisconnect)();
@@ -35,6 +36,7 @@ function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentMethod,
35
36
  const { data: eoaWalletInfo } = (0, react_4.useWalletInfo)(connectedEOAWallet?.id);
36
37
  const isConnected = !!connectedEOAWallet;
37
38
  const globalAddress = connectedSmartWallet?.getAccount()?.address;
39
+ const walletImage = (0, useAccountWallet_1.useAccountWalletImage)();
38
40
  // Use custom hook to determine wallet display logic
39
41
  const { shouldShowConnectedEOA, shouldShowWagmiWallet } = (0, useConnectedWalletDisplay_1.useConnectedWalletDisplay)(selectedPaymentMethod);
40
42
  // Map wagmi connector names to thirdweb wallet IDs
@@ -160,7 +162,7 @@ function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentMethod,
160
162
  }
161
163
  }
162
164
  };
163
- return ((0, jsx_runtime_1.jsxs)("div", { className: "crypto-payment-method mx-auto h-fit w-[460px] max-w-full", children: [(0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("relative flex flex-col gap-10"), children: [(0, jsx_runtime_1.jsx)("button", { onClick: onBack, className: "text-as-quaternary hover:text-as-primary absolute flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { className: "h-6 w-6" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-around gap-4", children: (0, jsx_runtime_1.jsx)("div", { className: "flex-1 text-center", children: (0, jsx_runtime_1.jsx)("h2", { className: "text-as-primary text-lg font-semibold", children: "Select a payment method" }) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "crypto-payment-methods flex flex-col gap-4", children: [(shouldShowConnectedEOA || shouldShowWagmiWallet || globalAddress) && ((0, jsx_runtime_1.jsxs)("div", { className: "installed-wallets", children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-as-primary/80 mb-3 text-sm font-medium", children: "Connected wallets" }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-2", children: [shouldShowConnectedEOA && ((0, jsx_runtime_1.jsx)("button", { onClick: () => {
165
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "crypto-payment-method mx-auto h-fit w-[460px] max-w-full px-5 pb-5", children: [(0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("relative flex flex-col gap-10"), children: [(0, jsx_runtime_1.jsx)("button", { onClick: onBack, className: "text-as-quaternary hover:text-as-primary absolute flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { className: "h-6 w-6" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-around gap-4", children: (0, jsx_runtime_1.jsx)("div", { className: "flex-1 text-center", children: (0, jsx_runtime_1.jsx)("h2", { className: "text-as-primary text-lg font-semibold", children: "Select a payment method" }) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "crypto-payment-methods flex flex-col gap-4", children: [(shouldShowConnectedEOA || shouldShowWagmiWallet || globalAddress) && ((0, jsx_runtime_1.jsxs)("div", { className: "installed-wallets", children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-as-primary/80 mb-3 text-sm font-medium", children: "Connected wallets" }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-2", children: [shouldShowConnectedEOA && ((0, jsx_runtime_1.jsx)("button", { onClick: () => {
164
166
  setSelectedPaymentMethod(CryptoPaymentMethodType.CONNECT_WALLET);
165
167
  onSelectPaymentMethod(CryptoPaymentMethodType.CONNECT_WALLET);
166
168
  if (connectedEOAWallet) {
@@ -202,7 +204,7 @@ function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentMethod,
202
204
  sonner_1.toast.success("Selected B3 Account");
203
205
  }, className: (0, cn_1.cn)("crypto-payment-method-global-wallet w-full rounded-xl border p-4 text-left transition-all hover:shadow-md", selectedPaymentMethod === CryptoPaymentMethodType.GLOBAL_WALLET
204
206
  ? "connected-wallet border-as-brand bg-as-brand/5"
205
- : "border-as-border-secondary bg-as-surface-primary hover:border-as-secondary/80"), 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: [globalWallet?.meta?.icon ? ((0, jsx_runtime_1.jsx)("img", { src: globalWallet.meta.icon, alt: "Global Account", className: "h-10 w-10 rounded-full" })) : ((0, jsx_runtime_1.jsx)("div", { className: "wallet-icon flex h-10 w-10 items-center justify-center rounded-full bg-purple-100", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "h-5 w-5 text-purple-600" }) })), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-primary font-semibold", children: "Global Account" }), (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary/60 text-sm", children: (0, formatAddress_1.shortenAddress)(globalAddress || "") })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: selectedPaymentMethod === CryptoPaymentMethodType.GLOBAL_WALLET && ((0, jsx_runtime_1.jsx)("div", { className: "h-2 w-2 rounded-full bg-green-500" })) })] }) }))] })] })), (0, jsx_runtime_1.jsxs)("div", { className: "other-payment-methods", children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-as-primary/80 mb-3 text-sm font-medium", children: "Payment methods" }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => {
207
+ : "border-as-border-secondary bg-as-surface-primary hover:border-as-secondary/80"), 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: [walletImage ? ((0, jsx_runtime_1.jsx)("img", { src: walletImage, alt: "Global Account", className: "h-10 w-10 rounded-full" })) : ((0, jsx_runtime_1.jsx)("div", { className: "wallet-icon flex h-10 w-10 items-center justify-center rounded-full bg-purple-100", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "h-5 w-5 text-purple-600" }) })), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-primary font-semibold", children: "Global Account" }), (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary/60 text-sm", children: (0, formatAddress_1.shortenAddress)(globalAddress || "") })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: selectedPaymentMethod === CryptoPaymentMethodType.GLOBAL_WALLET && ((0, jsx_runtime_1.jsx)("div", { className: "h-2 w-2 rounded-full bg-green-500" })) })] }) }))] })] })), (0, jsx_runtime_1.jsxs)("div", { className: "other-payment-methods", children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-as-primary/80 mb-3 text-sm font-medium", children: "Payment methods" }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => {
206
208
  // Always show wallet selection modal first
207
209
  setShowWalletModal(true);
208
210
  }, className: "crypto-payment-method-connect-wallet bg-as-surface-primary border-as-border-secondary hover:border-as-secondary/80 group flex w-full items-center justify-between gap-4 rounded-xl border px-4 py-3.5 transition-all duration-200 hover:shadow-md", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "wallet-icon flex h-8 w-8 items-center justify-center rounded-full bg-blue-100", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "h-4 w-4 text-blue-600" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col items-start text-left", children: (0, jsx_runtime_1.jsx)("h4", { className: "text-as-primary font-semibold", children: "Connect wallet" }) })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRightCircle, { className: "text-as-primary/40 group-hover:text-as-primary/60 h-5 w-5 transition-colors" })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => {
@@ -62,7 +62,7 @@ function FeeDetailPanel({ fee, transactionAmountUsd, onBack }) {
62
62
  // State for expanding tier lists
63
63
  const [showAllFeeTiers, setShowAllFeeTiers] = (0, react_2.useState)(false);
64
64
  const [showAllDiscountTiers, setShowAllDiscountTiers] = (0, react_2.useState)(false);
65
- return ((0, jsx_runtime_1.jsx)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-3", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex w-full flex-col gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-center", children: (0, jsx_runtime_1.jsx)("h3", { className: "text-as-primary text-lg font-bold", children: "Fee Breakdown" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-as-surface-secondary border-as-border-secondary rounded-2xl border p-4", children: [(0, jsx_runtime_1.jsx)("h4", { className: "text-as-primary mb-3 text-sm font-semibold", children: isStripeFee ? "Fiat Fee Schedule" : "Base Fee Schedule" }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-1.5", children: isStripeFee
65
+ return ((0, jsx_runtime_1.jsx)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-3 px-5", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex w-full flex-col gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-center", children: (0, jsx_runtime_1.jsx)("h3", { className: "text-as-primary text-lg font-bold", children: "Fee Breakdown" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-as-surface-secondary border-as-border-secondary rounded-2xl border p-4", children: [(0, jsx_runtime_1.jsx)("h4", { className: "text-as-primary mb-3 text-sm font-semibold", children: isStripeFee ? "Fiat Fee Schedule" : "Base Fee Schedule" }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-1.5", children: isStripeFee
66
66
  ? FIAT_FEE_TIERS.map((tier, idx) => {
67
67
  const isCurrentTier = currentFiatTier?.label === tier.label;
68
68
  const currentTierIndex = FIAT_FEE_TIERS.findIndex(t => t.label === currentFiatTier?.label);
@@ -60,9 +60,9 @@ function FiatPaymentMethodComponent({ selectedPaymentMethod, setSelectedPaymentM
60
60
  }
61
61
  // Show loading state while checking geo availability
62
62
  if (isLoadingGeoOnramp) {
63
- return ((0, jsx_runtime_1.jsx)("div", { className: "fiat-payment-method mx-auto w-[460px] max-w-full", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("button", { onClick: onBack, className: "text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { className: "h-6 w-6" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1", children: (0, jsx_runtime_1.jsx)("h2", { className: "text-as-primary text-lg font-semibold", children: "Choose payment method" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center py-8", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-6 w-6 animate-spin" }), (0, jsx_runtime_1.jsx)("span", { className: "text-as-secondary ml-2 text-sm", children: "Loading payment methods..." })] })] }) }));
63
+ return ((0, jsx_runtime_1.jsx)("div", { className: "fiat-payment-method mx-auto w-[460px] max-w-full px-5", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("button", { onClick: onBack, className: "text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { className: "h-6 w-6" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1", children: (0, jsx_runtime_1.jsx)("h2", { className: "text-as-primary text-lg font-semibold", children: "Choose payment method" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center py-8", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-6 w-6 animate-spin" }), (0, jsx_runtime_1.jsx)("span", { className: "text-as-secondary ml-2 text-sm", children: "Loading payment methods..." })] })] }) }));
64
64
  }
65
- return ((0, jsx_runtime_1.jsx)("div", { className: "fiat-payment-method mx-auto w-[460px] max-w-full", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("button", { onClick: onBack, className: "text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { className: "h-6 w-6" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1", children: (0, jsx_runtime_1.jsx)("h2", { className: "text-as-primary text-lg font-semibold", children: "Choose payment method" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col gap-3", children: availablePaymentMethods.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "fiat-payment-method-no-methods bg-as-surface-secondary border-as-border-secondary rounded-2xl border p-6 text-center", children: (0, jsx_runtime_1.jsx)("p", { className: "text-as-secondary text-sm", children: "No payment methods available in your region for the selected amount." }) })) : (availablePaymentMethods.map(method => ((0, jsx_runtime_1.jsxs)("button", { onClick: () => {
65
+ return ((0, jsx_runtime_1.jsx)("div", { className: "fiat-payment-method mx-auto w-[460px] max-w-full px-5", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("button", { onClick: onBack, className: "text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { className: "h-6 w-6" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1", children: (0, jsx_runtime_1.jsx)("h2", { className: "text-as-primary text-lg font-semibold", children: "Choose payment method" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col gap-3", children: availablePaymentMethods.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "fiat-payment-method-no-methods bg-as-surface-secondary border-as-border-secondary rounded-2xl border p-6 text-center", children: (0, jsx_runtime_1.jsx)("p", { className: "text-as-secondary text-sm", children: "No payment methods available in your region for the selected amount." }) })) : (availablePaymentMethods.map(method => ((0, jsx_runtime_1.jsxs)("button", { onClick: () => {
66
66
  setSelectedPaymentMethod(method.id);
67
67
  onSelectPaymentMethod(method.id);
68
68
  }, className: (0, cn_1.cn)("fiat-payment-method-item bg-as-surface-secondary border-as-border-secondary flex w-full items-center gap-4 rounded-2xl border p-4 transition-all duration-200", selectedPaymentMethod === method.id
@@ -1,6 +1,6 @@
1
1
  interface OrderHistoryProps {
2
2
  mode: "modal" | "page";
3
- onBack: () => void;
3
+ onBack?: () => void;
4
4
  onSelectOrder?: (orderId: string) => void;
5
5
  }
6
6
  export declare function OrderHistory({ mode, onBack, onSelectOrder }: OrderHistoryProps): import("react/jsx-runtime").JSX.Element;
@@ -1,18 +1,22 @@
1
1
  "use strict";
2
2
  "use client";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
3
6
  Object.defineProperty(exports, "__esModule", { value: true });
4
7
  exports.OrderHistory = OrderHistory;
5
8
  const jsx_runtime_1 = require("react/jsx-runtime");
6
9
  const react_1 = require("../../../../anyspend/react");
7
10
  const react_2 = require("../../../../global-account/react");
11
+ const ModalHeader_1 = __importDefault(require("../../../../global-account/react/components/ModalHeader/ModalHeader"));
8
12
  const lucide_react_1 = require("lucide-react");
9
13
  const OrderHistoryItem_1 = require("./OrderHistoryItem");
10
14
  function OrderHistory({ mode, onBack, onSelectOrder }) {
11
15
  const { address } = (0, react_2.useAccountWallet)();
12
16
  const { orderHistory, isLoadingOrderHistory, refetchOrderHistory } = (0, react_1.useAnyspendOrderHistory)(address);
13
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "mb-8 flex w-full items-center gap-3", children: [(0, jsx_runtime_1.jsx)(react_2.Button, { onClick: onBack, variant: "ghost", size: "icon", className: "hover:bg-as-surface-secondary", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ArrowLeft, { className: "h-5 w-5" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1", children: (0, jsx_runtime_1.jsx)("h3", { className: "text-as-primary text-2xl font-bold", children: "Order History" }) }), (0, jsx_runtime_1.jsx)(react_2.Button, { variant: "ghost", size: "icon", className: "hover:bg-as-surface-secondary", onClick: () => {
14
- refetchOrderHistory();
15
- }, children: (0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCcw, { className: "text-as-secondary hover:text-as-primary h-5 w-5 cursor-pointer transition-all hover:rotate-180" }) })] }), isLoadingOrderHistory ? ((0, jsx_runtime_1.jsx)("div", { className: "w-full space-y-3", children: [1, 2, 3].map(i => ((0, jsx_runtime_1.jsx)(react_2.Skeleton, { className: "h-[180px] w-full rounded-2xl" }, i))) })) : !orderHistory?.length ? ((0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary w-full rounded-2xl p-12 text-center", children: (0, jsx_runtime_1.jsx)("p", { className: "text-as-secondary text-sm", children: "No order history found" }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "mb-12 w-full space-y-3", children: [...orderHistory]
17
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.default, { title: "Order History", showCloseButton: false, handleBack: onBack, className: "w-full", children: (0, jsx_runtime_1.jsx)(react_2.Button, { variant: "ghost", size: "icon", className: "hover:bg-as-surface-secondary", onClick: () => {
18
+ refetchOrderHistory();
19
+ }, children: (0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCcw, { className: "text-as-secondary hover:text-as-primary h-5 w-5 cursor-pointer transition-all hover:rotate-180" }) }) }), isLoadingOrderHistory ? ((0, jsx_runtime_1.jsx)("div", { className: "w-full space-y-3 px-5", children: [1, 2, 3].map(i => ((0, jsx_runtime_1.jsx)(react_2.Skeleton, { className: "h-[180px] w-full rounded-2xl" }, i))) })) : !orderHistory?.length ? ((0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary w-full rounded-2xl p-12 px-5 text-center", children: (0, jsx_runtime_1.jsx)("p", { className: "text-as-secondary text-sm", children: "No order history found" }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "mb-12 w-full space-y-3 px-5 pt-5", children: [...orderHistory]
16
20
  .sort((a, b) => b.createdAt - a.createdAt)
17
21
  .map(order => ((0, jsx_runtime_1.jsx)(OrderHistoryItem_1.OrderHistoryItem, { order: order, onSelectOrder: onSelectOrder, mode: mode }, order.id))) }))] }));
18
22
  }
@@ -88,7 +88,7 @@ function PanelOnrampPaymentInner(props) {
88
88
  sonner_1.toast.error("Failed to create order: " + err.message);
89
89
  }
90
90
  };
91
- return ((0, jsx_runtime_1.jsxs)("div", { className: "mx-auto flex w-full max-w-[460px] flex-col gap-6", children: [(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("h2", { className: "-mb-3 text-lg font-semibold", children: "Order summary" }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-b3-react-background border-b3-react-border flex flex-col gap-3 rounded-lg border p-4", children: [recipientAddress && ((0, jsx_runtime_1.jsxs)(react_3.motion.div, { initial: false, animate: {
91
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "mx-auto flex w-full max-w-[460px] flex-col gap-6 px-5", children: [(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("h2", { className: "-mb-3 text-lg font-semibold", children: "Order summary" }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-b3-react-background border-b3-react-border flex flex-col gap-3 rounded-lg border p-4", children: [recipientAddress && ((0, jsx_runtime_1.jsxs)(react_3.motion.div, { initial: false, animate: {
92
92
  opacity: 1,
93
93
  y: 0,
94
94
  filter: "blur(0px)",
@@ -9,5 +9,5 @@ const react_1 = require("../../../../global-account/react");
9
9
  const cn_1 = require("../../../../shared/utils/cn");
10
10
  const link_1 = __importDefault(require("next/link"));
11
11
  function PointsDetailPanel({ pointsAmount = 0, onBack }) {
12
- return ((0, jsx_runtime_1.jsx)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center gap-4 text-center", children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-as-primary text-xl font-bold", children: "Earn Points with Every Swap" }), (0, jsx_runtime_1.jsxs)("p", { className: "text-as-primary/70 text-balance text-sm leading-relaxed", children: ["You'll earn ", (0, jsx_runtime_1.jsxs)("span", { className: "text-as-brand font-semibold", children: ["+", pointsAmount.toLocaleString(), " points"] }), " ", "towards the", " ", (0, jsx_runtime_1.jsx)(link_1.default, { href: "https://anyspend.com/points", target: "_blank", className: "text-as-brand underline", children: "next AnySpend airdrop" }), " ", "when you complete this transaction."] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-as-surface-primary border-as-border-secondary mt-2 w-full rounded-lg border p-4 text-left", children: [(0, jsx_runtime_1.jsx)("h4", { className: "text-as-primary mb-2 font-semibold", children: "How it works:" }), (0, jsx_runtime_1.jsxs)("ul", { className: "text-as-primary/70 space-y-1 text-sm", children: [(0, jsx_runtime_1.jsx)("li", { children: "\u2022 Points are earned based on transaction volume" }), (0, jsx_runtime_1.jsx)("li", { children: "\u2022 Higher volume = more points" }), (0, jsx_runtime_1.jsx)("li", { children: "\u2022 Points contribute to future airdrops" }), (0, jsx_runtime_1.jsx)("li", { children: "\u2022 Keep swapping to maximize your rewards" })] })] }), (0, jsx_runtime_1.jsx)(react_1.ShinyButton, { accentColor: "hsl(var(--as-brand))", onClick: onBack, className: (0, cn_1.cn)("as-main-button !bg-as-brand relative w-full"), textClassName: (0, cn_1.cn)("text-white"), children: "Back to Swap" })] }) }));
12
+ return ((0, jsx_runtime_1.jsx)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-4 px-5", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center gap-4 text-center", children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-as-primary text-xl font-bold", children: "Earn Points with Every Swap" }), (0, jsx_runtime_1.jsxs)("p", { className: "text-as-primary/70 text-balance text-sm leading-relaxed", children: ["You'll earn ", (0, jsx_runtime_1.jsxs)("span", { className: "text-as-brand font-semibold", children: ["+", pointsAmount.toLocaleString(), " points"] }), " ", "towards the", " ", (0, jsx_runtime_1.jsx)(link_1.default, { href: "https://anyspend.com/points", target: "_blank", className: "text-as-brand underline", children: "next AnySpend airdrop" }), " ", "when you complete this transaction."] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-as-surface-primary border-as-border-secondary mt-2 w-full rounded-lg border p-4 text-left", children: [(0, jsx_runtime_1.jsx)("h4", { className: "text-as-primary mb-2 font-semibold", children: "How it works:" }), (0, jsx_runtime_1.jsxs)("ul", { className: "text-as-primary/70 space-y-1 text-sm", children: [(0, jsx_runtime_1.jsx)("li", { children: "\u2022 Points are earned based on transaction volume" }), (0, jsx_runtime_1.jsx)("li", { children: "\u2022 Higher volume = more points" }), (0, jsx_runtime_1.jsx)("li", { children: "\u2022 Points contribute to future airdrops" }), (0, jsx_runtime_1.jsx)("li", { children: "\u2022 Keep swapping to maximize your rewards" })] })] }), (0, jsx_runtime_1.jsx)(react_1.ShinyButton, { accentColor: "hsl(var(--as-brand))", onClick: onBack, className: (0, cn_1.cn)("as-main-button !bg-as-brand relative w-full"), textClassName: (0, cn_1.cn)("text-white"), children: "Back to Swap" })] }) }));
13
13
  }
@@ -32,5 +32,5 @@ function RecipientSelection({ initialValue = "", placeholder = "Enter recipient
32
32
  };
33
33
  const isAddressValid = !validateAddress || !recipientAddress || validateAddress(recipientAddress);
34
34
  const canConfirm = recipientAddress && isAddressValid;
35
- return ((0, jsx_runtime_1.jsx)("div", { className: "recipient-selection mx-auto w-[460px] max-w-full", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-around", children: [(0, jsx_runtime_1.jsx)("button", { onClick: onBack, className: "text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { className: "h-6 w-6" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1 text-center", children: [(0, jsx_runtime_1.jsx)("h2", { className: "text-as-primary text-lg font-semibold", children: title }), (0, jsx_runtime_1.jsx)("p", { className: "text-as-primary/60 text-sm", children: description })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-as-surface-secondary border-as-border-secondary flex h-12 w-full overflow-hidden rounded-xl border", children: [(0, jsx_runtime_1.jsx)("input", { type: "text", placeholder: placeholder, value: recipientAddress, onChange: e => setRecipientAddress(e.target.value), onKeyDown: handleKeyDown, className: "text-as-primary placeholder:text-as-primary/50 flex-1 bg-transparent px-4 text-base focus:outline-none", autoFocus: autoFocus }), (0, jsx_runtime_1.jsx)("div", { className: "border-as-border-secondary border-l", children: (0, jsx_runtime_1.jsx)("button", { onClick: handlePaste, className: "text-as-primary/70 hover:text-as-primary hover:bg-as-surface-primary h-full px-4 font-semibold transition-colors", children: "Paste" }) })] }), recipientAddress && !isAddressValid && ((0, jsx_runtime_1.jsx)("div", { className: "text-as-red text-sm", children: "Please enter a valid address" })), (0, jsx_runtime_1.jsx)("button", { onClick: handleConfirm, disabled: !canConfirm, className: "bg-as-brand hover:bg-as-brand/90 disabled:bg-as-on-surface-2 disabled:text-as-secondary h-12 w-full rounded-xl font-medium text-white transition-colors disabled:cursor-not-allowed", children: confirmText })] })] }) }));
35
+ return ((0, jsx_runtime_1.jsx)("div", { className: "recipient-selection mx-auto w-[460px] max-w-full px-5", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-around", children: [(0, jsx_runtime_1.jsx)("button", { onClick: onBack, className: "text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { className: "h-6 w-6" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1 text-center", children: [(0, jsx_runtime_1.jsx)("h2", { className: "text-as-primary text-lg font-semibold", children: title }), (0, jsx_runtime_1.jsx)("p", { className: "text-as-primary/60 text-sm", children: description })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-as-surface-secondary border-as-border-secondary flex h-12 w-full overflow-hidden rounded-xl border", children: [(0, jsx_runtime_1.jsx)("input", { type: "text", placeholder: placeholder, value: recipientAddress, onChange: e => setRecipientAddress(e.target.value), onKeyDown: handleKeyDown, className: "text-as-primary placeholder:text-as-primary/50 flex-1 bg-transparent px-4 text-base focus:outline-none", autoFocus: autoFocus }), (0, jsx_runtime_1.jsx)("div", { className: "border-as-border-secondary border-l", children: (0, jsx_runtime_1.jsx)("button", { onClick: handlePaste, className: "text-as-primary/70 hover:text-as-primary hover:bg-as-surface-primary h-full px-4 font-semibold transition-colors", children: "Paste" }) })] }), recipientAddress && !isAddressValid && ((0, jsx_runtime_1.jsx)("div", { className: "text-as-red text-sm", children: "Please enter a valid address" })), (0, jsx_runtime_1.jsx)("button", { onClick: handleConfirm, disabled: !canConfirm, className: "bg-as-brand hover:bg-as-brand/90 disabled:bg-as-on-surface-2 disabled:text-as-secondary h-12 w-full rounded-xl font-medium text-white transition-colors disabled:cursor-not-allowed", children: confirmText })] })] }) }));
36
36
  }
@@ -48,8 +48,8 @@ export declare const useGenerateSigMintData: ({ recipientAddress, contractAddres
48
48
  creatorMap?: {} | undefined;
49
49
  chainId: number;
50
50
  address: string;
51
- title: string;
52
51
  _id: string | {};
52
+ title: string;
53
53
  };
54
54
  } | null;
55
55
  error: Error | null;
@@ -2,12 +2,48 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AccountAssets = AccountAssets;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
5
6
  function AccountAssets({ nfts, isLoading }) {
7
+ // Initialize with all collections expanded
8
+ const [expandedCollections, setExpandedCollections] = (0, react_1.useState)(() => new Set(collections.map(c => c.collection_id)));
6
9
  if (isLoading) {
7
- return ((0, jsx_runtime_1.jsx)("div", { className: "grid animate-pulse grid-cols-2 gap-4", children: [...Array(4)].map((_, i) => ((0, jsx_runtime_1.jsx)("div", { className: "bg-b3-react-muted aspect-square rounded-lg" }, i))) }));
10
+ return ((0, jsx_runtime_1.jsx)("div", { className: "flex flex-col gap-3", children: [...Array(2)].map((_, i) => ((0, jsx_runtime_1.jsxs)("div", { className: "animate-pulse", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-react-muted mb-3 h-6 w-48 rounded" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-react-muted h-[98px] w-[98px] shrink-0 rounded-lg" }), (0, jsx_runtime_1.jsx)("div", { className: "bg-b3-react-muted h-[98px] w-[98px] shrink-0 rounded-lg" })] })] }, i))) }));
8
11
  }
9
12
  if (!nfts?.nfts?.length) {
10
13
  return (0, jsx_runtime_1.jsx)("div", { className: "text-b3-react-muted-foreground py-8 text-center", children: "No NFTs found" });
11
14
  }
12
- return ((0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 gap-4", children: nfts.nfts.map(nft => ((0, jsx_runtime_1.jsx)("div", { className: "group relative aspect-square overflow-hidden", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative h-full w-full overflow-hidden rounded-xl", children: [(0, jsx_runtime_1.jsx)("img", { src: nft.previews?.image_medium_url || nft.extra_metadata?.image_original_url || nft.collection?.image_url, alt: nft.name || "NFT", className: "h-full w-full rounded-xl object-cover" }), (0, jsx_runtime_1.jsxs)("div", { className: "absolute inset-0 flex flex-col justify-end bg-gradient-to-t from-black from-35% via-black/70 to-transparent p-3 opacity-0 transition-all duration-200 ease-in-out group-hover:opacity-100", children: [(0, jsx_runtime_1.jsx)("p", { className: "font-neue-montreal-bold text-[16px] text-white drop-shadow-[0_1px_2px_rgba(0,0,0,1)]", children: nft.name || `#${nft.token_id}` }), (0, jsx_runtime_1.jsx)("p", { className: "font-neue-montreal-bold text-sm text-white/95 drop-shadow-[0_1px_2px_rgba(0,0,0,1)]", children: nft.collection?.name })] })] }) }, nft.nft_id))) }));
15
+ // Group NFTs by collection
16
+ const groupedNFTs = nfts.nfts.reduce((acc, nft) => {
17
+ const collectionId = nft.collection?.collection_id || "unknown";
18
+ if (!acc[collectionId]) {
19
+ acc[collectionId] = {
20
+ collection_id: collectionId,
21
+ collection_name: nft.collection?.name || "Unknown Collection",
22
+ collection_image: nft.collection?.image_url || nft.previews?.image_small_url || "",
23
+ nfts: [],
24
+ };
25
+ }
26
+ acc[collectionId].nfts.push(nft);
27
+ return acc;
28
+ }, {});
29
+ const collections = Object.values(groupedNFTs);
30
+ const toggleCollection = (collectionId) => {
31
+ setExpandedCollections(prev => {
32
+ const next = new Set(prev);
33
+ if (next.has(collectionId)) {
34
+ next.delete(collectionId);
35
+ }
36
+ else {
37
+ next.add(collectionId);
38
+ }
39
+ return next;
40
+ });
41
+ };
42
+ return ((0, jsx_runtime_1.jsx)("div", { className: "flex flex-col gap-3 px-4", children: collections.map(collection => {
43
+ const isExpanded = expandedCollections.has(collection.collection_id);
44
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-3", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => toggleCollection(collection.collection_id), className: "flex w-full items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1", children: [collection.collection_image && ((0, jsx_runtime_1.jsx)("img", { src: collection.collection_image, alt: collection.collection_name, className: "h-5 w-5 shrink-0 rounded object-cover" })), (0, jsx_runtime_1.jsxs)("p", { className: "font-neue-montreal-medium text-[14px] text-[#3f3f46]", children: [collection.collection_name, " (", collection.nfts.length, ")"] })] }), (0, jsx_runtime_1.jsx)("svg", { className: `h-[18px] w-[18px] shrink-0 transition-transform ${isExpanded ? "rotate-180" : ""}`, viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M4.5 6.75L9 11.25L13.5 6.75", stroke: "#51525C", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })] }), isExpanded && ((0, jsx_runtime_1.jsx)("div", { className: "flex gap-3 overflow-x-auto", children: collection.nfts.map(nft => ((0, jsx_runtime_1.jsx)("div", { className: "relative h-[98px] w-[98px] shrink-0 overflow-hidden rounded-lg", children: (0, jsx_runtime_1.jsx)("img", { src: nft.previews?.image_medium_url ||
45
+ nft.extra_metadata?.image_original_url ||
46
+ nft.collection?.image_url ||
47
+ "", alt: nft.name || "NFT", className: "h-full w-full object-cover" }) }, nft.nft_id))) }))] }, collection.collection_id));
48
+ }) }));
13
49
  }