@b3dotfun/sdk 0.0.64 → 0.0.65-test.1

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 (256) hide show
  1. package/dist/cjs/anyspend/react/components/AnySpend.js +73 -33
  2. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +1 -1
  3. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +1 -5
  4. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +1 -5
  5. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +1 -5
  6. package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.js +1 -1
  7. package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.js +2 -2
  8. package/dist/cjs/anyspend/react/components/common/OrderHistory.d.ts +1 -1
  9. package/dist/cjs/anyspend/react/components/common/OrderHistory.js +7 -3
  10. package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +1 -1
  11. package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.js +1 -1
  12. package/dist/cjs/anyspend/react/components/common/RecipientSelection.js +1 -1
  13. package/dist/cjs/anyspend/utils/index.d.ts +0 -1
  14. package/dist/cjs/anyspend/utils/index.js +0 -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 +139 -33
  17. package/dist/cjs/global-account/react/components/B3DynamicModal.js +29 -13
  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/LinkAccount/LinkAccount.d.ts +6 -4
  21. package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +113 -279
  22. package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +4 -0
  23. package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.js +331 -0
  24. package/dist/cjs/global-account/react/components/ManageAccount/AppsContent.d.ts +6 -0
  25. package/dist/cjs/global-account/react/components/ManageAccount/AppsContent.js +34 -0
  26. package/dist/cjs/global-account/react/components/ManageAccount/BalanceContent.js +2 -2
  27. package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.d.ts +2 -0
  28. package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.js +23 -0
  29. package/dist/cjs/global-account/react/components/ManageAccount/Header.d.ts +3 -0
  30. package/dist/cjs/global-account/react/components/ManageAccount/Header.js +120 -0
  31. package/dist/cjs/global-account/react/components/ManageAccount/HomeActions.d.ts +5 -0
  32. package/dist/cjs/global-account/react/components/ManageAccount/HomeActions.js +43 -0
  33. package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.d.ts +6 -0
  34. package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.js +16 -0
  35. package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +24 -193
  36. package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.d.ts +2 -0
  37. package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.js +15 -0
  38. package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.d.ts +2 -0
  39. package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +44 -0
  40. package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.d.ts +7 -0
  41. package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.js +50 -0
  42. package/dist/cjs/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +9 -0
  43. package/dist/cjs/global-account/react/components/ManageAccount/SettingsMenuItem.js +8 -0
  44. package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +2 -0
  45. package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +38 -0
  46. package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.d.ts +2 -0
  47. package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.js +22 -0
  48. package/dist/cjs/global-account/react/components/ModalHeader/ModalHeader.d.ts +10 -0
  49. package/dist/cjs/global-account/react/components/ModalHeader/ModalHeader.js +12 -0
  50. package/dist/cjs/global-account/react/components/Send/Send.d.ts +5 -0
  51. package/dist/cjs/global-account/react/components/Send/Send.js +187 -0
  52. package/dist/cjs/global-account/react/components/icons/BellIcon.d.ts +3 -0
  53. package/dist/cjs/global-account/react/components/icons/BellIcon.js +5 -0
  54. package/dist/cjs/global-account/react/components/icons/ChevronDownIcon.d.ts +2 -0
  55. package/dist/cjs/global-account/react/components/icons/ChevronDownIcon.js +7 -0
  56. package/dist/cjs/global-account/react/components/icons/CopyIcon.d.ts +2 -0
  57. package/dist/cjs/global-account/react/components/icons/CopyIcon.js +7 -0
  58. package/dist/cjs/global-account/react/components/icons/LinkIcon.d.ts +3 -0
  59. package/dist/cjs/global-account/react/components/icons/LinkIcon.js +5 -0
  60. package/dist/cjs/global-account/react/components/icons/LockIcon.d.ts +3 -0
  61. package/dist/cjs/global-account/react/components/icons/LockIcon.js +5 -0
  62. package/dist/cjs/global-account/react/components/icons/WalletIcon.d.ts +2 -0
  63. package/dist/cjs/global-account/react/components/icons/WalletIcon.js +7 -0
  64. package/dist/cjs/global-account/react/components/index.d.ts +4 -2
  65. package/dist/cjs/global-account/react/components/index.js +11 -4
  66. package/dist/cjs/global-account/react/components/ui/Tabs.js +2 -2
  67. package/dist/cjs/global-account/react/components/ui/dialog.js +2 -2
  68. package/dist/cjs/global-account/react/hooks/index.d.ts +1 -1
  69. package/dist/cjs/global-account/react/hooks/index.js +3 -1
  70. package/dist/cjs/global-account/react/hooks/useAuthentication.js +0 -11
  71. package/dist/cjs/global-account/react/hooks/useB3BalanceFromAddresses.js +1 -0
  72. package/dist/cjs/global-account/react/hooks/useGlobalAccount.d.ts +1 -0
  73. package/dist/cjs/global-account/react/hooks/useGlobalAccount.js +3 -0
  74. package/dist/cjs/global-account/react/stores/index.d.ts +1 -0
  75. package/dist/cjs/global-account/react/stores/index.js +3 -1
  76. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +34 -3
  77. package/dist/cjs/global-account/react/stores/useRecentAddressesStore.d.ts +25 -0
  78. package/dist/cjs/global-account/react/stores/useRecentAddressesStore.js +36 -0
  79. package/dist/cjs/global-account/react/utils/profileDisplay.d.ts +2 -0
  80. package/dist/cjs/global-account/react/utils/profileDisplay.js +2 -2
  81. package/dist/cjs/shared/constants/chains/supported.d.ts +2 -2
  82. package/dist/cjs/shared/utils/ipfs.js +1 -1
  83. package/dist/esm/anyspend/react/components/AnySpend.js +74 -34
  84. package/dist/esm/anyspend/react/components/AnySpendCustom.js +1 -1
  85. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +2 -6
  86. package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +2 -6
  87. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +2 -6
  88. package/dist/esm/anyspend/react/components/common/FeeDetailPanel.js +1 -1
  89. package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.js +2 -2
  90. package/dist/esm/anyspend/react/components/common/OrderHistory.d.ts +1 -1
  91. package/dist/esm/anyspend/react/components/common/OrderHistory.js +6 -5
  92. package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +1 -1
  93. package/dist/esm/anyspend/react/components/common/PointsDetailPanel.js +1 -1
  94. package/dist/esm/anyspend/react/components/common/RecipientSelection.js +1 -1
  95. package/dist/esm/anyspend/utils/index.d.ts +0 -1
  96. package/dist/esm/anyspend/utils/index.js +0 -1
  97. package/dist/esm/global-account/react/components/AccountAssets/AccountAssets.js +38 -2
  98. package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +140 -34
  99. package/dist/esm/global-account/react/components/B3DynamicModal.js +30 -14
  100. package/dist/esm/global-account/react/components/Deposit/Deposit.d.ts +1 -0
  101. package/dist/esm/global-account/react/components/Deposit/Deposit.js +59 -0
  102. package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.d.ts +6 -4
  103. package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +113 -280
  104. package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +4 -0
  105. package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.js +325 -0
  106. package/dist/esm/global-account/react/components/ManageAccount/AppsContent.d.ts +6 -0
  107. package/dist/esm/global-account/react/components/ManageAccount/AppsContent.js +32 -0
  108. package/dist/esm/global-account/react/components/ManageAccount/BalanceContent.js +2 -2
  109. package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.d.ts +2 -0
  110. package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.js +21 -0
  111. package/dist/esm/global-account/react/components/ManageAccount/Header.d.ts +3 -0
  112. package/dist/esm/global-account/react/components/ManageAccount/Header.js +81 -0
  113. package/dist/esm/global-account/react/components/ManageAccount/HomeActions.d.ts +5 -0
  114. package/dist/esm/global-account/react/components/ManageAccount/HomeActions.js +41 -0
  115. package/dist/esm/global-account/react/components/ManageAccount/HomeContent.d.ts +6 -0
  116. package/dist/esm/global-account/react/components/ManageAccount/HomeContent.js +10 -0
  117. package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +26 -195
  118. package/dist/esm/global-account/react/components/ManageAccount/NFTContent.d.ts +2 -0
  119. package/dist/esm/global-account/react/components/ManageAccount/NFTContent.js +13 -0
  120. package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.d.ts +2 -0
  121. package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +42 -0
  122. package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.d.ts +7 -0
  123. package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.js +45 -0
  124. package/dist/esm/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +9 -0
  125. package/dist/esm/global-account/react/components/ManageAccount/SettingsMenuItem.js +6 -0
  126. package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +2 -0
  127. package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +36 -0
  128. package/dist/esm/global-account/react/components/ManageAccount/TokenContent.d.ts +2 -0
  129. package/dist/esm/global-account/react/components/ManageAccount/TokenContent.js +20 -0
  130. package/dist/esm/global-account/react/components/ModalHeader/ModalHeader.d.ts +10 -0
  131. package/dist/esm/global-account/react/components/ModalHeader/ModalHeader.js +10 -0
  132. package/dist/esm/global-account/react/components/Send/Send.d.ts +5 -0
  133. package/dist/esm/global-account/react/components/Send/Send.js +181 -0
  134. package/dist/esm/global-account/react/components/icons/BellIcon.d.ts +3 -0
  135. package/dist/esm/global-account/react/components/icons/BellIcon.js +3 -0
  136. package/dist/esm/global-account/react/components/icons/ChevronDownIcon.d.ts +2 -0
  137. package/dist/esm/global-account/react/components/icons/ChevronDownIcon.js +4 -0
  138. package/dist/esm/global-account/react/components/icons/CopyIcon.d.ts +2 -0
  139. package/dist/esm/global-account/react/components/icons/CopyIcon.js +4 -0
  140. package/dist/esm/global-account/react/components/icons/LinkIcon.d.ts +3 -0
  141. package/dist/esm/global-account/react/components/icons/LinkIcon.js +3 -0
  142. package/dist/esm/global-account/react/components/icons/LockIcon.d.ts +3 -0
  143. package/dist/esm/global-account/react/components/icons/LockIcon.js +3 -0
  144. package/dist/esm/global-account/react/components/icons/WalletIcon.d.ts +2 -0
  145. package/dist/esm/global-account/react/components/icons/WalletIcon.js +4 -0
  146. package/dist/esm/global-account/react/components/index.d.ts +4 -2
  147. package/dist/esm/global-account/react/components/index.js +7 -2
  148. package/dist/esm/global-account/react/components/ui/Tabs.js +2 -2
  149. package/dist/esm/global-account/react/components/ui/dialog.js +2 -2
  150. package/dist/esm/global-account/react/hooks/index.d.ts +1 -1
  151. package/dist/esm/global-account/react/hooks/index.js +1 -1
  152. package/dist/esm/global-account/react/hooks/useAuthentication.js +0 -11
  153. package/dist/esm/global-account/react/hooks/useB3BalanceFromAddresses.js +1 -0
  154. package/dist/esm/global-account/react/hooks/useGlobalAccount.d.ts +1 -0
  155. package/dist/esm/global-account/react/hooks/useGlobalAccount.js +3 -0
  156. package/dist/esm/global-account/react/stores/index.d.ts +1 -0
  157. package/dist/esm/global-account/react/stores/index.js +1 -0
  158. package/dist/esm/global-account/react/stores/useModalStore.d.ts +34 -3
  159. package/dist/esm/global-account/react/stores/useRecentAddressesStore.d.ts +25 -0
  160. package/dist/esm/global-account/react/stores/useRecentAddressesStore.js +33 -0
  161. package/dist/esm/global-account/react/utils/profileDisplay.d.ts +2 -0
  162. package/dist/esm/global-account/react/utils/profileDisplay.js +2 -2
  163. package/dist/esm/shared/constants/chains/supported.d.ts +2 -2
  164. package/dist/esm/shared/utils/ipfs.js +1 -1
  165. package/dist/styles/index.css +1 -1
  166. package/dist/types/anyspend/react/components/common/OrderHistory.d.ts +1 -1
  167. package/dist/types/anyspend/utils/index.d.ts +0 -1
  168. package/dist/types/global-account/react/components/Deposit/Deposit.d.ts +1 -0
  169. package/dist/types/global-account/react/components/LinkAccount/LinkAccount.d.ts +6 -4
  170. package/dist/types/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +4 -0
  171. package/dist/types/global-account/react/components/ManageAccount/AppsContent.d.ts +6 -0
  172. package/dist/types/global-account/react/components/ManageAccount/BottomNavigation.d.ts +2 -0
  173. package/dist/types/global-account/react/components/ManageAccount/Header.d.ts +3 -0
  174. package/dist/types/global-account/react/components/ManageAccount/HomeActions.d.ts +5 -0
  175. package/dist/types/global-account/react/components/ManageAccount/HomeContent.d.ts +6 -0
  176. package/dist/types/global-account/react/components/ManageAccount/NFTContent.d.ts +2 -0
  177. package/dist/types/global-account/react/components/ManageAccount/ProfileSection.d.ts +2 -0
  178. package/dist/types/global-account/react/components/ManageAccount/SettingsContent.d.ts +7 -0
  179. package/dist/types/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +9 -0
  180. package/dist/types/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +2 -0
  181. package/dist/types/global-account/react/components/ManageAccount/TokenContent.d.ts +2 -0
  182. package/dist/types/global-account/react/components/ModalHeader/ModalHeader.d.ts +10 -0
  183. package/dist/types/global-account/react/components/Send/Send.d.ts +5 -0
  184. package/dist/types/global-account/react/components/icons/BellIcon.d.ts +3 -0
  185. package/dist/types/global-account/react/components/icons/ChevronDownIcon.d.ts +2 -0
  186. package/dist/types/global-account/react/components/icons/CopyIcon.d.ts +2 -0
  187. package/dist/types/global-account/react/components/icons/LinkIcon.d.ts +3 -0
  188. package/dist/types/global-account/react/components/icons/LockIcon.d.ts +3 -0
  189. package/dist/types/global-account/react/components/icons/WalletIcon.d.ts +2 -0
  190. package/dist/types/global-account/react/components/index.d.ts +4 -2
  191. package/dist/types/global-account/react/hooks/index.d.ts +1 -1
  192. package/dist/types/global-account/react/hooks/useGlobalAccount.d.ts +1 -0
  193. package/dist/types/global-account/react/stores/index.d.ts +1 -0
  194. package/dist/types/global-account/react/stores/useModalStore.d.ts +34 -3
  195. package/dist/types/global-account/react/stores/useRecentAddressesStore.d.ts +25 -0
  196. package/dist/types/global-account/react/utils/profileDisplay.d.ts +2 -0
  197. package/dist/types/shared/constants/chains/supported.d.ts +2 -2
  198. package/package.json +1 -1
  199. package/src/anyspend/react/components/AnySpend.tsx +225 -167
  200. package/src/anyspend/react/components/AnySpendCustom.tsx +1 -1
  201. package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +2 -6
  202. package/src/anyspend/react/components/AnyspendDepositHype.tsx +2 -6
  203. package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +2 -7
  204. package/src/anyspend/react/components/common/FeeDetailPanel.tsx +1 -1
  205. package/src/anyspend/react/components/common/FiatPaymentMethod.tsx +2 -2
  206. package/src/anyspend/react/components/common/OrderHistory.tsx +8 -13
  207. package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +1 -1
  208. package/src/anyspend/react/components/common/PointsDetailPanel.tsx +1 -1
  209. package/src/anyspend/react/components/common/RecipientSelection.tsx +1 -1
  210. package/src/anyspend/utils/index.ts +0 -1
  211. package/src/global-account/react/components/AccountAssets/AccountAssets.tsx +115 -25
  212. package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +303 -126
  213. package/src/global-account/react/components/B3DynamicModal.tsx +33 -15
  214. package/src/global-account/react/components/Deposit/Deposit.tsx +211 -0
  215. package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +332 -433
  216. package/src/global-account/react/components/LinkAccount/LinkNewAccount.tsx +490 -0
  217. package/src/global-account/react/components/ManageAccount/AppsContent.tsx +79 -0
  218. package/src/global-account/react/components/ManageAccount/BalanceContent.tsx +2 -3
  219. package/src/global-account/react/components/ManageAccount/BottomNavigation.tsx +83 -0
  220. package/src/global-account/react/components/ManageAccount/Header.tsx +230 -0
  221. package/src/global-account/react/components/ManageAccount/HomeActions.tsx +118 -0
  222. package/src/global-account/react/components/ManageAccount/HomeContent.tsx +42 -0
  223. package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +73 -589
  224. package/src/global-account/react/components/ManageAccount/NFTContent.tsx +24 -0
  225. package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +74 -0
  226. package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +87 -0
  227. package/src/global-account/react/components/ManageAccount/SettingsMenuItem.tsx +31 -0
  228. package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +74 -0
  229. package/src/global-account/react/components/ManageAccount/TokenContent.tsx +41 -0
  230. package/src/global-account/react/components/ModalHeader/ModalHeader.tsx +50 -0
  231. package/src/global-account/react/components/Send/Send.tsx +585 -0
  232. package/src/global-account/react/components/icons/BellIcon.tsx +15 -0
  233. package/src/global-account/react/components/icons/ChevronDownIcon.tsx +17 -0
  234. package/src/global-account/react/components/icons/CopyIcon.tsx +22 -0
  235. package/src/global-account/react/components/icons/LinkIcon.tsx +15 -0
  236. package/src/global-account/react/components/icons/LockIcon.tsx +15 -0
  237. package/src/global-account/react/components/icons/WalletIcon.tsx +21 -0
  238. package/src/global-account/react/components/index.ts +9 -2
  239. package/src/global-account/react/components/ui/Tabs.tsx +5 -13
  240. package/src/global-account/react/components/ui/dialog.tsx +32 -14
  241. package/src/global-account/react/hooks/index.ts +3 -0
  242. package/src/global-account/react/hooks/useAuthentication.ts +0 -12
  243. package/src/global-account/react/hooks/useB3BalanceFromAddresses.ts +1 -0
  244. package/src/global-account/react/hooks/useGlobalAccount.tsx +3 -1
  245. package/src/global-account/react/stores/index.ts +1 -0
  246. package/src/global-account/react/stores/useModalStore.ts +39 -2
  247. package/src/global-account/react/stores/useRecentAddressesStore.ts +55 -0
  248. package/src/global-account/react/utils/profileDisplay.ts +4 -2
  249. package/src/shared/utils/ipfs.ts +1 -1
  250. package/src/styles/index.css +6 -1
  251. package/dist/cjs/anyspend/utils/accountStore.d.ts +0 -7
  252. package/dist/cjs/anyspend/utils/accountStore.js +0 -8
  253. package/dist/esm/anyspend/utils/accountStore.d.ts +0 -7
  254. package/dist/esm/anyspend/utils/accountStore.js +0 -5
  255. package/dist/types/anyspend/utils/accountStore.d.ts +0 -7
  256. package/src/anyspend/utils/accountStore.ts +0 -12
@@ -10,6 +10,7 @@ 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"));
13
14
  const cn_1 = require("../../../shared/utils/cn");
14
15
  const number_1 = require("../../../shared/utils/number");
15
16
  const invariant_1 = __importDefault(require("invariant"));
@@ -17,6 +18,7 @@ const lucide_react_1 = require("lucide-react");
17
18
  const react_3 = require("motion/react");
18
19
  const react_4 = require("react");
19
20
  const sonner_1 = require("sonner");
21
+ const thirdweb_1 = require("thirdweb");
20
22
  const viem_1 = require("viem");
21
23
  const chains_1 = require("viem/chains");
22
24
  const useAutoSelectCryptoPaymentMethod_1 = require("../hooks/useAutoSelectCryptoPaymentMethod");
@@ -55,6 +57,25 @@ function AnySpend(props) {
55
57
  function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, onTokenSelect, onSuccess, customUsdInputValues, }) {
56
58
  const searchParams = (0, react_2.useSearchParamsSSR)();
57
59
  const router = (0, react_2.useRouter)();
60
+ const { partnerId } = (0, react_2.useB3)();
61
+ const setB3ModalContentType = (0, react_2.useModalStore)(state => state.setB3ModalContentType);
62
+ // Define base chain with RPC for modal props
63
+ const baseChain = (0, react_4.useMemo)(() => (0, thirdweb_1.defineChain)({
64
+ id: 8453,
65
+ name: "Base",
66
+ nativeCurrency: {
67
+ name: "Ether",
68
+ symbol: "ETH",
69
+ decimals: 18,
70
+ },
71
+ rpc: "https://mainnet.base.org",
72
+ blockExplorers: [
73
+ {
74
+ name: "Basescan",
75
+ url: "https://basescan.org",
76
+ },
77
+ ],
78
+ }), []);
58
79
  // Determine if we're in "buy mode" based on whether destination token props are provided
59
80
  const isBuyMode = !!(destinationTokenAddress && destinationTokenChainId);
60
81
  // Add refs to track URL state
@@ -606,6 +627,10 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
606
627
  const onClickHistory = () => {
607
628
  setOrderId(undefined);
608
629
  navigateToPanel(PanelView.HISTORY, "forward");
630
+ setB3ModalContentType({
631
+ type: "anySpendOrderHistory",
632
+ showBackButton: false,
633
+ });
609
634
  // Remove orderId and paymentMethod from URL when going back to history
610
635
  const params = new URLSearchParams(searchParams.toString());
611
636
  params.delete("orderId");
@@ -767,43 +792,58 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
767
792
  };
768
793
  }, [activePanel, navigateBack]);
769
794
  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: () => {
795
+ 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
796
  setOrderId(undefined);
772
797
  navigateBack();
773
798
  setSelectedCryptoPaymentMethod(CryptoPaymentMethod_1.CryptoPaymentMethodType.NONE); // Reset payment method when going back
774
799
  } })) }) }));
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] })] }));
800
+ 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) => {
801
+ // Map panel index to navigation with direction
802
+ const panelsWithForwardNav = [PanelView.FIAT_PAYMENT_METHOD, PanelView.RECIPIENT_SELECTION];
803
+ if (panelsWithForwardNav.includes(panelIndex)) {
804
+ navigateToPanel(panelIndex, "forward");
805
+ }
806
+ else {
807
+ setActivePanel(panelIndex);
808
+ }
809
+ }, _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: () => {
810
+ if (activeTab === "fiat" || isBuyMode) {
811
+ return;
812
+ }
813
+ // Swap chain selections
814
+ const tempSrcChainId = selectedSrcChainId;
815
+ const tempDstChainId = selectedDstChainId;
816
+ setSelectedSrcChainId(tempDstChainId);
817
+ setSelectedDstChainId(tempSrcChainId);
818
+ // Swap token selections
819
+ const tempSrcToken = selectedSrcToken;
820
+ const tempDstToken = selectedDstToken;
821
+ setSelectedSrcToken(tempDstToken);
822
+ setSelectedDstToken(tempSrcToken);
823
+ // Swap amounts
824
+ const tempSrcAmount = srcAmount;
825
+ const tempDstAmount = dstAmount;
826
+ setSrcAmount(tempDstAmount);
827
+ setDstAmount(tempSrcAmount);
828
+ }, 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 => {
829
+ setIsSrcInputDirty(false);
830
+ setDstAmount(value);
831
+ }, 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 => {
832
+ if (value === "settings" || value === "home") {
833
+ setB3ModalContentType({
834
+ type: "manageAccount",
835
+ activeTab: value,
836
+ setActiveTab: () => { },
837
+ chain: baseChain,
838
+ partnerId,
839
+ });
840
+ }
841
+ else if (value === "swap") {
842
+ setB3ModalContentType({
843
+ type: "anySpend",
844
+ });
845
+ }
846
+ }, children: (0, jsx_runtime_1.jsx)(BottomNavigation_1.default, {}) }) })] }));
807
847
  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
848
  setOrderId(orderId);
809
849
  navigateToPanel(PanelView.ORDER_DETAILS, "forward");
@@ -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: () => {
@@ -14,7 +14,6 @@ const react_2 = require("motion/react");
14
14
  const react_3 = require("react");
15
15
  const sonner_1 = require("sonner");
16
16
  const react_4 = require("thirdweb/react");
17
- const utils_2 = require("../../utils");
18
17
  const useAnyspendFlow_1 = require("../hooks/useAnyspendFlow");
19
18
  const AnySpendFingerprintWrapper_1 = require("./AnySpendFingerprintWrapper");
20
19
  const CryptoPaySection_1 = require("./common/CryptoPaySection");
@@ -53,18 +52,15 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
53
52
  });
54
53
  const { connectedEOAWallet } = (0, react_1.useAccountWallet)();
55
54
  const setActiveWallet = (0, react_4.useSetActiveWallet)();
56
- const activeWallet = (0, react_4.useActiveWallet)();
57
- const setGlobalAccountWallet = (0, utils_2.useGlobalWalletState)(state => state.setGlobalAccountWallet);
58
55
  const appliedPreferEoa = (0, react_3.useRef)(false);
59
56
  (0, react_3.useEffect)(() => {
60
57
  if (preferEoa && !appliedPreferEoa.current) {
61
58
  if (connectedEOAWallet) {
62
59
  appliedPreferEoa.current = true;
63
- setGlobalAccountWallet(activeWallet);
64
60
  setActiveWallet(connectedEOAWallet);
65
61
  }
66
62
  }
67
- }, [preferEoa, connectedEOAWallet, setActiveWallet, activeWallet, setGlobalAccountWallet]);
63
+ }, [preferEoa, connectedEOAWallet, setActiveWallet]);
68
64
  const selectedRecipientOrDefault = selectedRecipientAddress ?? recipientAddress;
69
65
  const expectedDstAmountRaw = anyspendQuote?.data?.currencyOut?.amount ?? "0";
70
66
  const buildCustomPayload = (_recipient) => {
@@ -26,7 +26,6 @@ const OrderDetails_1 = require("./common/OrderDetails");
26
26
  const PointsDetailPanel_1 = require("./common/PointsDetailPanel");
27
27
  const RecipientSelection_1 = require("./common/RecipientSelection");
28
28
  const lucide_react_1 = require("lucide-react");
29
- const utils_1 = require("../../utils");
30
29
  const PanelOnramp_1 = require("./common/PanelOnramp");
31
30
  const SLIPPAGE_PERCENT = 3;
32
31
  exports.HYPE_TOKEN_DETAILS = {
@@ -52,18 +51,15 @@ function AnySpendDepositHypeInner({ loadOrder, mode = "modal", recipientAddress,
52
51
  });
53
52
  const { connectedEOAWallet: connectedEOAWallet } = (0, react_1.useAccountWallet)();
54
53
  const setActiveWallet = (0, react_4.useSetActiveWallet)();
55
- const activeWallet = (0, react_4.useActiveWallet)();
56
- const setGlobalAccountWallet = (0, utils_1.useGlobalWalletState)(state => state.setGlobalAccountWallet);
57
54
  const appliedPreferEoa = (0, react_3.useRef)(false);
58
55
  (0, react_3.useEffect)(() => {
59
56
  if (preferEoa && !appliedPreferEoa.current) {
60
57
  if (connectedEOAWallet) {
61
58
  appliedPreferEoa.current = true;
62
- setGlobalAccountWallet(activeWallet);
63
59
  setActiveWallet(connectedEOAWallet);
64
60
  }
65
61
  }
66
- }, [preferEoa, connectedEOAWallet, setActiveWallet, activeWallet, setGlobalAccountWallet]);
62
+ }, [preferEoa, connectedEOAWallet, setActiveWallet]);
67
63
  // Button state logic
68
64
  const btnInfo = (0, react_3.useMemo)(() => {
69
65
  if (activeInputAmountInWei === "0")
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.CryptoPaymentMethodType = void 0;
5
5
  exports.CryptoPaymentMethod = CryptoPaymentMethod;
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
- const utils_1 = require("../../../../anyspend/utils");
8
7
  const react_1 = require("../../../../global-account/react");
9
8
  const cn_1 = require("../../../../shared/utils/cn");
10
9
  const formatAddress_1 = require("../../../../shared/utils/formatAddress");
@@ -34,8 +33,6 @@ function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentMethod,
34
33
  const [showWalletModal, setShowWalletModal] = (0, react_3.useState)(false);
35
34
  const setActiveWallet = (0, react_4.useSetActiveWallet)();
36
35
  const { data: eoaWalletInfo } = (0, react_4.useWalletInfo)(connectedEOAWallet?.id);
37
- const activeWallet = (0, react_4.useActiveWallet)();
38
- const setGlobalAccountWallet = (0, utils_1.useGlobalWalletState)(state => state.setGlobalAccountWallet);
39
36
  const isConnected = !!connectedEOAWallet;
40
37
  const globalAddress = connectedSmartWallet?.getAccount()?.address;
41
38
  // Use custom hook to determine wallet display logic
@@ -163,10 +160,9 @@ function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentMethod,
163
160
  }
164
161
  }
165
162
  };
166
- 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: () => {
163
+ 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: () => {
167
164
  setSelectedPaymentMethod(CryptoPaymentMethodType.CONNECT_WALLET);
168
165
  onSelectPaymentMethod(CryptoPaymentMethodType.CONNECT_WALLET);
169
- setGlobalAccountWallet(activeWallet);
170
166
  if (connectedEOAWallet) {
171
167
  setActiveWallet(connectedEOAWallet);
172
168
  }
@@ -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
  }
@@ -1,4 +1,3 @@
1
- export * from "./accountStore";
2
1
  export * from "./address";
3
2
  export * from "./chain";
4
3
  export * from "./format";
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./accountStore"), exports);
18
17
  __exportStar(require("./address"), exports);
19
18
  __exportStar(require("./chain"), exports);
20
19
  __exportStar(require("./format"), exports);
@@ -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
  }