@b3dotfun/sdk 0.0.65-test.5 → 0.0.66-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. package/dist/cjs/anyspend/react/components/AnySpend.js +69 -97
  2. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +23 -10
  3. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +3 -1
  4. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +45 -14
  5. package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.d.ts +11 -0
  6. package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.js +41 -0
  7. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +1 -1
  8. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +14 -251
  9. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.d.ts +6 -0
  10. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +3 -5
  11. package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.js +1 -1
  12. package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.js +2 -2
  13. package/dist/cjs/anyspend/react/components/common/OrderHistory.d.ts +1 -1
  14. package/dist/cjs/anyspend/react/components/common/OrderHistory.js +3 -7
  15. package/dist/cjs/anyspend/react/components/common/OrderTokenAmount.js +2 -10
  16. package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +1 -1
  17. package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.js +1 -1
  18. package/dist/cjs/anyspend/react/components/common/RecipientSelection.js +1 -1
  19. package/dist/cjs/anyspend/react/components/index.d.ts +1 -0
  20. package/dist/cjs/anyspend/react/components/index.js +4 -1
  21. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +5 -1
  22. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +16 -10
  23. package/dist/cjs/anyspend/react/hooks/useAutoSelectCryptoPaymentMethod.d.ts +7 -5
  24. package/dist/cjs/anyspend/react/hooks/useAutoSelectCryptoPaymentMethod.js +13 -9
  25. package/dist/cjs/anyspend/react/hooks/useCryptoPaymentMethodState.d.ts +42 -0
  26. package/dist/cjs/anyspend/react/hooks/useCryptoPaymentMethodState.js +51 -0
  27. package/dist/cjs/anyspend/react/hooks/useSigMint.d.ts +1 -1
  28. package/dist/cjs/global-account/react/components/AccountAssets/AccountAssets.js +2 -38
  29. package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.d.ts +0 -1
  30. package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +35 -251
  31. package/dist/cjs/global-account/react/components/B3DynamicModal.js +15 -23
  32. package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.d.ts +4 -6
  33. package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +279 -113
  34. package/dist/cjs/global-account/react/components/ManageAccount/BalanceContent.js +5 -6
  35. package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +193 -24
  36. package/dist/cjs/global-account/react/components/ProfileEditor/ProfileEditor.d.ts +6 -0
  37. package/dist/cjs/global-account/react/components/ProfileEditor/ProfileEditor.js +141 -0
  38. package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +1 -3
  39. package/dist/cjs/global-account/react/components/index.d.ts +4 -5
  40. package/dist/cjs/global-account/react/components/index.js +9 -14
  41. package/dist/cjs/global-account/react/components/ui/Tabs.js +2 -2
  42. package/dist/cjs/global-account/react/components/ui/dialog.js +2 -2
  43. package/dist/cjs/global-account/react/components/ui/drawer.js +1 -1
  44. package/dist/cjs/global-account/react/hooks/index.d.ts +1 -1
  45. package/dist/cjs/global-account/react/hooks/index.js +1 -3
  46. package/dist/cjs/global-account/react/hooks/useAccountWallet.d.ts +0 -1
  47. package/dist/cjs/global-account/react/hooks/useAccountWallet.js +0 -18
  48. package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +2 -2
  49. package/dist/cjs/global-account/react/hooks/useB3BalanceFromAddresses.js +0 -1
  50. package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +6 -14
  51. package/dist/cjs/global-account/react/hooks/useUserQuery.d.ts +2 -2
  52. package/dist/cjs/global-account/react/stores/index.d.ts +0 -1
  53. package/dist/cjs/global-account/react/stores/index.js +1 -3
  54. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +26 -31
  55. package/dist/cjs/global-account/react/utils/profileDisplay.d.ts +0 -2
  56. package/dist/cjs/global-account/react/utils/profileDisplay.js +2 -2
  57. package/dist/cjs/shared/constants/chains/supported.d.ts +3 -3
  58. package/dist/cjs/shared/utils/ipfs.js +3 -10
  59. package/dist/esm/anyspend/react/components/AnySpend.js +70 -98
  60. package/dist/esm/anyspend/react/components/AnySpendCustom.js +23 -10
  61. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +3 -1
  62. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +45 -14
  63. package/dist/esm/anyspend/react/components/AnySpendDepositUpside.d.ts +11 -0
  64. package/dist/esm/anyspend/react/components/AnySpendDepositUpside.js +38 -0
  65. package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +1 -1
  66. package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +15 -249
  67. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.d.ts +6 -0
  68. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +3 -5
  69. package/dist/esm/anyspend/react/components/common/FeeDetailPanel.js +1 -1
  70. package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.js +2 -2
  71. package/dist/esm/anyspend/react/components/common/OrderHistory.d.ts +1 -1
  72. package/dist/esm/anyspend/react/components/common/OrderHistory.js +5 -6
  73. package/dist/esm/anyspend/react/components/common/OrderTokenAmount.js +2 -10
  74. package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +1 -1
  75. package/dist/esm/anyspend/react/components/common/PointsDetailPanel.js +1 -1
  76. package/dist/esm/anyspend/react/components/common/RecipientSelection.js +1 -1
  77. package/dist/esm/anyspend/react/components/index.d.ts +1 -0
  78. package/dist/esm/anyspend/react/components/index.js +1 -0
  79. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +5 -1
  80. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +16 -10
  81. package/dist/esm/anyspend/react/hooks/useAutoSelectCryptoPaymentMethod.d.ts +7 -5
  82. package/dist/esm/anyspend/react/hooks/useAutoSelectCryptoPaymentMethod.js +13 -9
  83. package/dist/esm/anyspend/react/hooks/useCryptoPaymentMethodState.d.ts +42 -0
  84. package/dist/esm/anyspend/react/hooks/useCryptoPaymentMethodState.js +48 -0
  85. package/dist/esm/anyspend/react/hooks/useSigMint.d.ts +1 -1
  86. package/dist/esm/global-account/react/components/AccountAssets/AccountAssets.js +2 -38
  87. package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.d.ts +0 -1
  88. package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +38 -254
  89. package/dist/esm/global-account/react/components/B3DynamicModal.js +15 -23
  90. package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.d.ts +4 -6
  91. package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +280 -113
  92. package/dist/esm/global-account/react/components/ManageAccount/BalanceContent.js +5 -6
  93. package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +195 -26
  94. package/dist/esm/global-account/react/components/ProfileEditor/ProfileEditor.d.ts +6 -0
  95. package/dist/esm/global-account/react/components/ProfileEditor/ProfileEditor.js +135 -0
  96. package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +2 -4
  97. package/dist/esm/global-account/react/components/index.d.ts +4 -5
  98. package/dist/esm/global-account/react/components/index.js +5 -9
  99. package/dist/esm/global-account/react/components/ui/Tabs.js +2 -2
  100. package/dist/esm/global-account/react/components/ui/dialog.js +2 -2
  101. package/dist/esm/global-account/react/components/ui/drawer.js +1 -1
  102. package/dist/esm/global-account/react/hooks/index.d.ts +1 -1
  103. package/dist/esm/global-account/react/hooks/index.js +1 -1
  104. package/dist/esm/global-account/react/hooks/useAccountWallet.d.ts +0 -1
  105. package/dist/esm/global-account/react/hooks/useAccountWallet.js +0 -17
  106. package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +2 -2
  107. package/dist/esm/global-account/react/hooks/useB3BalanceFromAddresses.js +0 -1
  108. package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +6 -14
  109. package/dist/esm/global-account/react/hooks/useUserQuery.d.ts +2 -2
  110. package/dist/esm/global-account/react/stores/index.d.ts +0 -1
  111. package/dist/esm/global-account/react/stores/index.js +0 -1
  112. package/dist/esm/global-account/react/stores/useModalStore.d.ts +26 -31
  113. package/dist/esm/global-account/react/utils/profileDisplay.d.ts +0 -2
  114. package/dist/esm/global-account/react/utils/profileDisplay.js +2 -2
  115. package/dist/esm/shared/constants/chains/supported.d.ts +3 -3
  116. package/dist/esm/shared/utils/ipfs.js +3 -10
  117. package/dist/styles/index.css +1 -1
  118. package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +3 -1
  119. package/dist/types/anyspend/react/components/AnySpendDepositUpside.d.ts +11 -0
  120. package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +1 -1
  121. package/dist/types/anyspend/react/components/common/CryptoPaymentMethod.d.ts +6 -0
  122. package/dist/types/anyspend/react/components/common/OrderHistory.d.ts +1 -1
  123. package/dist/types/anyspend/react/components/index.d.ts +1 -0
  124. package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +5 -1
  125. package/dist/types/anyspend/react/hooks/useAutoSelectCryptoPaymentMethod.d.ts +7 -5
  126. package/dist/types/anyspend/react/hooks/useCryptoPaymentMethodState.d.ts +42 -0
  127. package/dist/types/anyspend/react/hooks/useSigMint.d.ts +1 -1
  128. package/dist/types/global-account/react/components/AvatarEditor/AvatarEditor.d.ts +0 -1
  129. package/dist/types/global-account/react/components/LinkAccount/LinkAccount.d.ts +4 -6
  130. package/dist/types/global-account/react/components/ProfileEditor/ProfileEditor.d.ts +6 -0
  131. package/dist/types/global-account/react/components/index.d.ts +4 -5
  132. package/dist/types/global-account/react/hooks/index.d.ts +1 -1
  133. package/dist/types/global-account/react/hooks/useAccountWallet.d.ts +0 -1
  134. package/dist/types/global-account/react/hooks/useAuthentication.d.ts +2 -2
  135. package/dist/types/global-account/react/hooks/useUserQuery.d.ts +2 -2
  136. package/dist/types/global-account/react/stores/index.d.ts +0 -1
  137. package/dist/types/global-account/react/stores/useModalStore.d.ts +26 -31
  138. package/dist/types/global-account/react/utils/profileDisplay.d.ts +0 -2
  139. package/dist/types/shared/constants/chains/supported.d.ts +3 -3
  140. package/package.json +1 -2
  141. package/src/anyspend/react/components/AnySpend.tsx +218 -256
  142. package/src/anyspend/react/components/AnySpendCustom.tsx +31 -16
  143. package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +56 -13
  144. package/src/anyspend/react/components/AnySpendDepositUpside.tsx +81 -0
  145. package/src/anyspend/react/components/AnyspendDepositHype.tsx +36 -524
  146. package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +14 -7
  147. package/src/anyspend/react/components/common/FeeDetailPanel.tsx +1 -1
  148. package/src/anyspend/react/components/common/FiatPaymentMethod.tsx +2 -2
  149. package/src/anyspend/react/components/common/OrderHistory.tsx +13 -8
  150. package/src/anyspend/react/components/common/OrderTokenAmount.tsx +2 -13
  151. package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +1 -1
  152. package/src/anyspend/react/components/common/PointsDetailPanel.tsx +1 -1
  153. package/src/anyspend/react/components/common/RecipientSelection.tsx +1 -1
  154. package/src/anyspend/react/components/index.ts +1 -0
  155. package/src/anyspend/react/hooks/useAnyspendFlow.ts +24 -12
  156. package/src/anyspend/react/hooks/useAutoSelectCryptoPaymentMethod.ts +20 -12
  157. package/src/anyspend/react/hooks/useCryptoPaymentMethodState.ts +71 -0
  158. package/src/global-account/react/components/AccountAssets/AccountAssets.tsx +25 -115
  159. package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +128 -477
  160. package/src/global-account/react/components/B3DynamicModal.tsx +17 -28
  161. package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +433 -332
  162. package/src/global-account/react/components/ManageAccount/BalanceContent.tsx +10 -6
  163. package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +589 -73
  164. package/src/global-account/react/components/ProfileEditor/ProfileEditor.tsx +265 -0
  165. package/src/global-account/react/components/SignInWithB3/SignIn.tsx +7 -11
  166. package/src/global-account/react/components/index.ts +5 -11
  167. package/src/global-account/react/components/ui/Tabs.tsx +13 -5
  168. package/src/global-account/react/components/ui/dialog.tsx +14 -32
  169. package/src/global-account/react/components/ui/drawer.tsx +1 -1
  170. package/src/global-account/react/hooks/index.ts +0 -3
  171. package/src/global-account/react/hooks/useAccountWallet.tsx +0 -26
  172. package/src/global-account/react/hooks/useB3BalanceFromAddresses.ts +0 -1
  173. package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +6 -12
  174. package/src/global-account/react/stores/index.ts +0 -1
  175. package/src/global-account/react/stores/useModalStore.ts +28 -35
  176. package/src/global-account/react/utils/profileDisplay.ts +2 -4
  177. package/src/shared/utils/ipfs.ts +3 -10
  178. package/src/styles/index.css +9 -6
  179. package/dist/cjs/global-account/react/components/Deposit/Deposit.d.ts +0 -1
  180. package/dist/cjs/global-account/react/components/Deposit/Deposit.js +0 -65
  181. package/dist/cjs/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +0 -39
  182. package/dist/cjs/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +0 -37
  183. package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +0 -4
  184. package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.js +0 -331
  185. package/dist/cjs/global-account/react/components/ManageAccount/AppsContent.d.ts +0 -6
  186. package/dist/cjs/global-account/react/components/ManageAccount/AppsContent.js +0 -34
  187. package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.d.ts +0 -2
  188. package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.js +0 -23
  189. package/dist/cjs/global-account/react/components/ManageAccount/Header.d.ts +0 -3
  190. package/dist/cjs/global-account/react/components/ManageAccount/Header.js +0 -120
  191. package/dist/cjs/global-account/react/components/ManageAccount/HomeActions.d.ts +0 -5
  192. package/dist/cjs/global-account/react/components/ManageAccount/HomeActions.js +0 -43
  193. package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.d.ts +0 -6
  194. package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.js +0 -16
  195. package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.d.ts +0 -2
  196. package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.js +0 -15
  197. package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.d.ts +0 -2
  198. package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +0 -47
  199. package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.d.ts +0 -7
  200. package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.js +0 -50
  201. package/dist/cjs/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +0 -9
  202. package/dist/cjs/global-account/react/components/ManageAccount/SettingsMenuItem.js +0 -8
  203. package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +0 -2
  204. package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +0 -106
  205. package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.d.ts +0 -2
  206. package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.js +0 -22
  207. package/dist/cjs/global-account/react/components/ModalHeader/ModalHeader.d.ts +0 -11
  208. package/dist/cjs/global-account/react/components/ModalHeader/ModalHeader.js +0 -12
  209. package/dist/cjs/global-account/react/components/Send/Send.d.ts +0 -5
  210. package/dist/cjs/global-account/react/components/Send/Send.js +0 -187
  211. package/dist/cjs/global-account/react/components/icons/BellIcon.d.ts +0 -3
  212. package/dist/cjs/global-account/react/components/icons/BellIcon.js +0 -5
  213. package/dist/cjs/global-account/react/components/icons/ChevronDownIcon.d.ts +0 -2
  214. package/dist/cjs/global-account/react/components/icons/ChevronDownIcon.js +0 -7
  215. package/dist/cjs/global-account/react/components/icons/CopyIcon.d.ts +0 -2
  216. package/dist/cjs/global-account/react/components/icons/CopyIcon.js +0 -7
  217. package/dist/cjs/global-account/react/components/icons/LinkIcon.d.ts +0 -3
  218. package/dist/cjs/global-account/react/components/icons/LinkIcon.js +0 -5
  219. package/dist/cjs/global-account/react/components/icons/LockIcon.d.ts +0 -3
  220. package/dist/cjs/global-account/react/components/icons/LockIcon.js +0 -5
  221. package/dist/cjs/global-account/react/components/icons/WalletIcon.d.ts +0 -2
  222. package/dist/cjs/global-account/react/components/icons/WalletIcon.js +0 -7
  223. package/dist/cjs/global-account/react/stores/useRecentAddressesStore.d.ts +0 -25
  224. package/dist/cjs/global-account/react/stores/useRecentAddressesStore.js +0 -36
  225. package/dist/esm/global-account/react/components/Deposit/Deposit.d.ts +0 -1
  226. package/dist/esm/global-account/react/components/Deposit/Deposit.js +0 -59
  227. package/dist/esm/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +0 -39
  228. package/dist/esm/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +0 -34
  229. package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +0 -4
  230. package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.js +0 -325
  231. package/dist/esm/global-account/react/components/ManageAccount/AppsContent.d.ts +0 -6
  232. package/dist/esm/global-account/react/components/ManageAccount/AppsContent.js +0 -32
  233. package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.d.ts +0 -2
  234. package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.js +0 -21
  235. package/dist/esm/global-account/react/components/ManageAccount/Header.d.ts +0 -3
  236. package/dist/esm/global-account/react/components/ManageAccount/Header.js +0 -81
  237. package/dist/esm/global-account/react/components/ManageAccount/HomeActions.d.ts +0 -5
  238. package/dist/esm/global-account/react/components/ManageAccount/HomeActions.js +0 -41
  239. package/dist/esm/global-account/react/components/ManageAccount/HomeContent.d.ts +0 -6
  240. package/dist/esm/global-account/react/components/ManageAccount/HomeContent.js +0 -10
  241. package/dist/esm/global-account/react/components/ManageAccount/NFTContent.d.ts +0 -2
  242. package/dist/esm/global-account/react/components/ManageAccount/NFTContent.js +0 -13
  243. package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.d.ts +0 -2
  244. package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +0 -45
  245. package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.d.ts +0 -7
  246. package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.js +0 -45
  247. package/dist/esm/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +0 -9
  248. package/dist/esm/global-account/react/components/ManageAccount/SettingsMenuItem.js +0 -6
  249. package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +0 -2
  250. package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +0 -101
  251. package/dist/esm/global-account/react/components/ManageAccount/TokenContent.d.ts +0 -2
  252. package/dist/esm/global-account/react/components/ManageAccount/TokenContent.js +0 -20
  253. package/dist/esm/global-account/react/components/ModalHeader/ModalHeader.d.ts +0 -11
  254. package/dist/esm/global-account/react/components/ModalHeader/ModalHeader.js +0 -10
  255. package/dist/esm/global-account/react/components/Send/Send.d.ts +0 -5
  256. package/dist/esm/global-account/react/components/Send/Send.js +0 -181
  257. package/dist/esm/global-account/react/components/icons/BellIcon.d.ts +0 -3
  258. package/dist/esm/global-account/react/components/icons/BellIcon.js +0 -3
  259. package/dist/esm/global-account/react/components/icons/ChevronDownIcon.d.ts +0 -2
  260. package/dist/esm/global-account/react/components/icons/ChevronDownIcon.js +0 -4
  261. package/dist/esm/global-account/react/components/icons/CopyIcon.d.ts +0 -2
  262. package/dist/esm/global-account/react/components/icons/CopyIcon.js +0 -4
  263. package/dist/esm/global-account/react/components/icons/LinkIcon.d.ts +0 -3
  264. package/dist/esm/global-account/react/components/icons/LinkIcon.js +0 -3
  265. package/dist/esm/global-account/react/components/icons/LockIcon.d.ts +0 -3
  266. package/dist/esm/global-account/react/components/icons/LockIcon.js +0 -3
  267. package/dist/esm/global-account/react/components/icons/WalletIcon.d.ts +0 -2
  268. package/dist/esm/global-account/react/components/icons/WalletIcon.js +0 -4
  269. package/dist/esm/global-account/react/stores/useRecentAddressesStore.d.ts +0 -25
  270. package/dist/esm/global-account/react/stores/useRecentAddressesStore.js +0 -33
  271. package/dist/types/global-account/react/components/Deposit/Deposit.d.ts +0 -1
  272. package/dist/types/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +0 -39
  273. package/dist/types/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +0 -4
  274. package/dist/types/global-account/react/components/ManageAccount/AppsContent.d.ts +0 -6
  275. package/dist/types/global-account/react/components/ManageAccount/BottomNavigation.d.ts +0 -2
  276. package/dist/types/global-account/react/components/ManageAccount/Header.d.ts +0 -3
  277. package/dist/types/global-account/react/components/ManageAccount/HomeActions.d.ts +0 -5
  278. package/dist/types/global-account/react/components/ManageAccount/HomeContent.d.ts +0 -6
  279. package/dist/types/global-account/react/components/ManageAccount/NFTContent.d.ts +0 -2
  280. package/dist/types/global-account/react/components/ManageAccount/ProfileSection.d.ts +0 -2
  281. package/dist/types/global-account/react/components/ManageAccount/SettingsContent.d.ts +0 -7
  282. package/dist/types/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +0 -9
  283. package/dist/types/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +0 -2
  284. package/dist/types/global-account/react/components/ManageAccount/TokenContent.d.ts +0 -2
  285. package/dist/types/global-account/react/components/ModalHeader/ModalHeader.d.ts +0 -11
  286. package/dist/types/global-account/react/components/Send/Send.d.ts +0 -5
  287. package/dist/types/global-account/react/components/icons/BellIcon.d.ts +0 -3
  288. package/dist/types/global-account/react/components/icons/ChevronDownIcon.d.ts +0 -2
  289. package/dist/types/global-account/react/components/icons/CopyIcon.d.ts +0 -2
  290. package/dist/types/global-account/react/components/icons/LinkIcon.d.ts +0 -3
  291. package/dist/types/global-account/react/components/icons/LockIcon.d.ts +0 -3
  292. package/dist/types/global-account/react/components/icons/WalletIcon.d.ts +0 -2
  293. package/dist/types/global-account/react/stores/useRecentAddressesStore.d.ts +0 -25
  294. package/src/global-account/react/components/Deposit/Deposit.tsx +0 -211
  295. package/src/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.tsx +0 -84
  296. package/src/global-account/react/components/LinkAccount/LinkNewAccount.tsx +0 -490
  297. package/src/global-account/react/components/ManageAccount/AppsContent.tsx +0 -79
  298. package/src/global-account/react/components/ManageAccount/BottomNavigation.tsx +0 -83
  299. package/src/global-account/react/components/ManageAccount/Header.tsx +0 -230
  300. package/src/global-account/react/components/ManageAccount/HomeActions.tsx +0 -118
  301. package/src/global-account/react/components/ManageAccount/HomeContent.tsx +0 -42
  302. package/src/global-account/react/components/ManageAccount/NFTContent.tsx +0 -24
  303. package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +0 -79
  304. package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +0 -87
  305. package/src/global-account/react/components/ManageAccount/SettingsMenuItem.tsx +0 -31
  306. package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +0 -182
  307. package/src/global-account/react/components/ManageAccount/TokenContent.tsx +0 -41
  308. package/src/global-account/react/components/ModalHeader/ModalHeader.tsx +0 -61
  309. package/src/global-account/react/components/Send/Send.tsx +0 -585
  310. package/src/global-account/react/components/icons/BellIcon.tsx +0 -15
  311. package/src/global-account/react/components/icons/ChevronDownIcon.tsx +0 -17
  312. package/src/global-account/react/components/icons/CopyIcon.tsx +0 -22
  313. package/src/global-account/react/components/icons/LinkIcon.tsx +0 -15
  314. package/src/global-account/react/components/icons/LockIcon.tsx +0 -15
  315. package/src/global-account/react/components/icons/WalletIcon.tsx +0 -21
  316. package/src/global-account/react/stores/useRecentAddressesStore.ts +0 -55
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const LinkIcon = (props) => ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M10.8333 9.16667L15.8333 4.16667M17.5 2.5L15.8333 4.16667L17.5 2.5ZM11.6667 4.16667H15.8333V8.33333L11.6667 4.16667ZM9.16667 10.8333L4.16667 15.8333L9.16667 10.8333ZM8.33333 15.8333H4.16667V11.6667L8.33333 15.8333ZM15.8333 10V15.8333H10L15.8333 10ZM4.16667 4.16667V10L10 4.16667H4.16667Z", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }));
5
- exports.default = LinkIcon;
@@ -1,3 +0,0 @@
1
- import { SVGProps } from "react";
2
- declare const LockIcon: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
- export default LockIcon;
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const LockIcon = (props) => ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M14.1667 9.16667V6.66667C14.1667 4.36548 12.3012 2.5 10 2.5C7.69881 2.5 5.83333 4.36548 5.83333 6.66667V9.16667M7.5 14.1667C7.5 15.0871 8.24619 15.8333 9.16667 15.8333H10.8333C11.7538 15.8333 12.5 15.0871 12.5 14.1667C12.5 13.2462 11.7538 12.5 10.8333 12.5H9.16667C8.24619 12.5 7.5 11.7538 7.5 10.8333C7.5 9.91286 8.24619 9.16667 9.16667 9.16667H10.8333C11.7538 9.16667 12.5 9.91286 12.5 10.8333", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }));
5
- exports.default = LockIcon;
@@ -1,2 +0,0 @@
1
- import { SVGProps } from "react";
2
- export declare function WalletIcon({ className, ...props }: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WalletIcon = WalletIcon;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- function WalletIcon({ className, ...props }) {
6
- return ((0, jsx_runtime_1.jsxs)("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, ...props, children: [(0, jsx_runtime_1.jsx)("rect", { width: "40", height: "40", rx: "20", fill: "#F4F4F5" }), (0, jsx_runtime_1.jsx)("path", { d: "M28 16H27V14C27 13.4696 26.7893 12.9609 26.4142 12.5858C26.0391 12.2107 25.5304 12 25 12H15C14.4696 12 13.9609 12.2107 13.5858 12.5858C13.2107 12.9609 13 13.4696 13 14V26C13 26.5304 13.2107 27.0391 13.5858 27.4142C13.9609 27.7893 14.4696 28 15 28H27C27.5304 28 28.0391 27.7893 28.4142 27.4142C28.7893 27.0391 29 26.5304 29 26V18C29 17.4696 28.7893 16.9609 28.4142 16.5858C28.0391 16.2107 27.5304 16 27 16ZM15 14H25V16H15V14ZM27 22H25C24.7348 22 24.4804 21.8946 24.2929 21.7071C24.1054 21.5196 24 21.2652 24 21C24 20.7348 24.1054 20.4804 24.2929 20.2929C24.4804 20.1054 24.7348 20 25 20H27V22Z", fill: "#71717A" })] }));
7
- }
@@ -1,25 +0,0 @@
1
- interface RecentAddress {
2
- address: string;
3
- timestamp: number;
4
- }
5
- interface RecentAddressesStore {
6
- recentAddresses: RecentAddress[];
7
- addRecentAddress: (address: string) => void;
8
- clearRecentAddresses: () => void;
9
- }
10
- /**
11
- * Store for managing recently used addresses in the Send flow
12
- * Persists to localStorage and keeps the last 6 unique addresses
13
- */
14
- export declare const useRecentAddressesStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<RecentAddressesStore>, "persist"> & {
15
- persist: {
16
- setOptions: (options: Partial<import("zustand/middleware").PersistOptions<RecentAddressesStore, RecentAddressesStore>>) => void;
17
- clearStorage: () => void;
18
- rehydrate: () => Promise<void> | void;
19
- hasHydrated: () => boolean;
20
- onHydrate: (fn: (state: RecentAddressesStore) => void) => () => void;
21
- onFinishHydration: (fn: (state: RecentAddressesStore) => void) => () => void;
22
- getOptions: () => Partial<import("zustand/middleware").PersistOptions<RecentAddressesStore, RecentAddressesStore>>;
23
- };
24
- }>;
25
- export {};
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useRecentAddressesStore = void 0;
4
- const zustand_1 = require("zustand");
5
- const middleware_1 = require("zustand/middleware");
6
- /**
7
- * Store for managing recently used addresses in the Send flow
8
- * Persists to localStorage and keeps the last 6 unique addresses
9
- */
10
- exports.useRecentAddressesStore = (0, zustand_1.create)()((0, middleware_1.persist)(set => ({
11
- recentAddresses: [],
12
- /**
13
- * Add a new address to the recent addresses list
14
- * Deduplicates and maintains a maximum of 6 addresses
15
- */
16
- addRecentAddress: (address) => {
17
- set(state => {
18
- // Remove any existing entry with the same address
19
- const filtered = state.recentAddresses.filter(item => item.address.toLowerCase() !== address.toLowerCase());
20
- // Add the new address at the beginning
21
- const updated = [{ address, timestamp: Date.now() }, ...filtered];
22
- // Keep only the last 6 addresses
23
- return {
24
- recentAddresses: updated.slice(0, 6),
25
- };
26
- });
27
- },
28
- /**
29
- * Clear all recent addresses
30
- */
31
- clearRecentAddresses: () => {
32
- set({ recentAddresses: [] });
33
- },
34
- }), {
35
- name: "b3-recent-addresses-storage",
36
- }));
@@ -1 +0,0 @@
1
- export declare function Deposit(): import("react/jsx-runtime").JSX.Element;
@@ -1,59 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { RELAY_SOLANA_MAINNET_CHAIN_ID } from "../../../../anyspend/constants/index.js";
3
- import { ALL_CHAINS } from "../../../../anyspend/utils/chain.js";
4
- import { useAccountWallet, useModalStore } from "../../../../global-account/react/index.js";
5
- import { TokenSelector } from "@relayprotocol/relay-kit-ui";
6
- import { ChevronDown, Copy } from "lucide-react";
7
- import { QRCodeSVG } from "qrcode.react";
8
- import { useMemo, useState } from "react";
9
- import { toast } from "sonner";
10
- import { base } from "thirdweb/chains";
11
- import ModalHeader from "../ModalHeader/ModalHeader.js";
12
- import { Button } from "../ui/button.js";
13
- import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../ui/dropdown-menu.js";
14
- // Coinbase logo SVG
15
- const CoinbaseLogo = () => (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z", fill: "#0052FF" }), _jsx("path", { d: "M8.00065 11.3337C6.16065 11.3337 4.66732 9.84033 4.66732 8.00033C4.66732 6.16033 6.16065 4.66699 8.00065 4.66699C9.47399 4.66699 10.734 5.64699 11.1607 7.00033H13.2273C12.774 4.54699 10.6273 2.66699 8.00065 2.66699C5.05399 2.66699 2.66732 5.05366 2.66732 8.00033C2.66732 10.947 5.05399 13.3337 8.00065 13.3337C10.6273 13.3337 12.774 11.4537 13.2273 9.00033H11.1607C10.734 10.3537 9.47399 11.3337 8.00065 11.3337Z", fill: "white" })] }));
16
- export function Deposit() {
17
- const { address } = useAccountWallet();
18
- const navigateBack = useModalStore(state => state.navigateBack);
19
- const setB3ModalOpen = useModalStore(state => state.setB3ModalOpen);
20
- const history = useModalStore(state => state.history);
21
- const [selectedChainId, setSelectedChainId] = useState(base.id);
22
- const [selectedToken, setSelectedToken] = useState({
23
- address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
24
- chainId: base.id,
25
- decimals: 6,
26
- symbol: "USDC",
27
- name: "USD Coin",
28
- metadata: {
29
- logoURI: "https://assets.relay.link/icons/1/light/usdc.png",
30
- },
31
- });
32
- // Get the selected chain object
33
- const selectedChain = useMemo(() => ALL_CHAINS[selectedChainId], [selectedChainId]);
34
- // Get all supported chains for the dropdown
35
- const supportedChains = useMemo(() => Object.values(ALL_CHAINS), []);
36
- // The deposit address is the user's active wallet address
37
- const depositAddress = address || "0x0000000000000000000000000000000000000000";
38
- const handleTokenSelect = (token) => {
39
- setSelectedChainId(token.chainId);
40
- setSelectedToken({
41
- address: token.address,
42
- chainId: token.chainId,
43
- decimals: token.decimals,
44
- metadata: { logoURI: token.logoURI },
45
- name: token.name,
46
- symbol: token.symbol,
47
- });
48
- };
49
- const handleCopyAddress = async () => {
50
- try {
51
- await navigator.clipboard.writeText(depositAddress);
52
- toast.success("Address copied to clipboard");
53
- }
54
- catch (error) {
55
- toast.error("Failed to copy address");
56
- }
57
- };
58
- return (_jsxs("div", { className: "flex w-full flex-col", children: [_jsx(ModalHeader, { title: "Deposit", showCloseButton: false }), _jsxs("div", { className: "flex flex-col pb-5 pt-5", children: [_jsx("div", { className: "mb-4 px-5", children: _jsx("p", { className: "font-neue-montreal-medium text-base leading-snug text-[#3f3f46]", children: "Send any accepted token and we'll convert it to B3 on Base for you to use." }) }), _jsxs("div", { className: "space-y-3 px-5", children: [_jsxs("div", { children: [_jsx("label", { className: "mb-1.5 block text-sm font-medium text-[#3f3f46]", children: "Chain" }), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs("button", { className: "flex h-10 w-full items-center justify-between rounded-lg border border-[#d1d1d6] bg-white px-2.5 py-2 transition-colors hover:bg-[#fafafa]", children: [_jsxs("div", { className: "flex items-center gap-2", children: [selectedChain?.logoUrl && (_jsx("img", { src: selectedChain.logoUrl, alt: selectedChain.name, className: "h-6 w-6 rounded-full" })), _jsx("span", { className: "text-base text-[#18181b]", children: selectedChain?.name || "Select Chain" })] }), _jsx(ChevronDown, { className: "h-4 w-4 text-[#51525c]" })] }) }), _jsx(DropdownMenuContent, { className: "max-h-[300px] w-full overflow-y-auto", children: supportedChains.map(chain => (_jsx(DropdownMenuItem, { onClick: () => setSelectedChainId(chain.id), children: _jsxs("div", { className: "flex items-center gap-2", children: [chain.logoUrl && _jsx("img", { src: chain.logoUrl, alt: chain.name, className: "h-6 w-6 rounded-full" }), _jsx("span", { className: "text-[#18181b]", children: chain.name })] }) }, chain.id))) })] })] }), _jsxs("div", { children: [_jsx("label", { className: "mb-1.5 block text-sm font-medium text-[#3f3f46]", children: "Accepted tokens" }), _jsx(TokenSelector, { address: address, chainIdsFilter: [selectedChainId], context: "from", fromChainWalletVMSupported: true, isValidAddress: true, lockedChainIds: [selectedChainId], multiWalletSupportEnabled: true, onAnalyticEvent: undefined, popularChainIds: [1, 8453, RELAY_SOLANA_MAINNET_CHAIN_ID], setToken: handleTokenSelect, supportedWalletVMs: ["evm", "svm"], token: undefined, trigger: _jsxs("button", { className: "flex h-10 w-full items-center justify-between rounded-lg border border-[#d1d1d6] bg-white px-2.5 py-2 transition-colors hover:bg-[#fafafa]", children: [_jsxs("div", { className: "flex items-center gap-2", children: [selectedToken?.metadata?.logoURI && (_jsx("img", { src: selectedToken.metadata.logoURI, alt: selectedToken.symbol, className: "h-6 w-6 rounded-full" })), _jsx("span", { className: "text-base text-[#18181b]", children: selectedToken.symbol })] }), _jsx(ChevronDown, { className: "h-4 w-4 text-[#51525c]" })] }) })] })] }), _jsxs("div", { className: "mx-5 mt-4 flex items-start rounded-xl border border-[#e4e4e7] bg-[#fafafa]", children: [_jsxs("div", { className: "flex flex-1 flex-col items-center gap-2 px-5 pb-3 pt-5", children: [_jsx("div", { className: "flex w-full items-center justify-center", children: _jsx("div", { className: "w-full", children: _jsx("div", { className: "flex aspect-[144/146] w-full flex-col items-center justify-center overflow-hidden", children: _jsx(QRCodeSVG, { value: depositAddress, size: 144, level: "M" }) }) }) }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-xs font-semibold leading-[18px] text-[#0b57c2]", children: "SCAN WITH" }), _jsx(CoinbaseLogo, {})] })] }), _jsxs("div", { className: "relative flex flex-1 flex-col gap-2 self-stretch border-l border-[#e4e4e7] p-6", children: [_jsx("label", { className: "text-sm font-medium leading-5 text-[#3f3f46]", children: "Deposit address:" }), _jsxs("div", { className: "relative flex w-full flex-wrap items-center gap-2", children: [_jsx("p", { className: "h-[74px] flex-1 overflow-hidden text-ellipsis whitespace-pre-wrap break-all pr-6 text-base font-semibold leading-6 text-[#18181b]", children: depositAddress }), _jsx("button", { onClick: handleCopyAddress, className: "absolute bottom-0 right-0 h-4 w-4 transition-opacity hover:opacity-70", "aria-label": "Copy address", children: _jsx(Copy, { className: "h-full w-full text-[#51525c]" }) })] })] })] }), _jsx("div", { className: "mx-5 mt-4", children: _jsxs("p", { className: "font-neue-montreal-italic text-center text-sm leading-[1.3] text-[#3f3f46]", children: ["Do not send any tokens other than the ones specified.", _jsx("br", {}), "Tokens not accepted will not be converted."] }) }), _jsx("div", { className: "mt-4 px-5", children: _jsx(Button, { onClick: handleCopyAddress, className: "h-12 w-full rounded-xl bg-[#0c68e9] text-base font-semibold text-white shadow-[inset_0px_0px_0px_1px_rgba(10,13,18,0.18),inset_0px_-2px_0px_0px_rgba(10,13,18,0.05)] hover:bg-[#0b5fd4]", children: "Copy deposit address" }) })] })] }));
59
- }
@@ -1,39 +0,0 @@
1
- import type { ThirdwebClient } from "thirdweb";
2
- interface IPFSMediaRendererProps {
3
- /** The source URL - can be IPFS URL (ipfs://...) or HTTP URL */
4
- src: string | null | undefined;
5
- /** Alt text for the media */
6
- alt?: string;
7
- /** CSS class name */
8
- className?: string;
9
- /** Thirdweb client instance (optional, uses default if not provided) */
10
- client?: ThirdwebClient;
11
- /** Width of the media */
12
- width?: string | number;
13
- /** Height of the media */
14
- height?: string | number;
15
- /** Controls property for video/audio */
16
- controls?: boolean;
17
- /** Style object */
18
- style?: React.CSSProperties;
19
- }
20
- /**
21
- * IPFSMediaRenderer - A wrapper around Thirdweb's MediaRenderer that configures
22
- * the IPFS gateway URL to use our validated gateway.
23
- *
24
- * Features:
25
- * - Configures MediaRenderer to use cloudflare-ipfs.com gateway
26
- * - Gateway matches our allowed list in profileDisplay.ts
27
- * - Provides fallback for missing sources
28
- *
29
- * @example
30
- * ```tsx
31
- * <IPFSMediaRenderer
32
- * src="ipfs://QmX..."
33
- * alt="Profile Avatar"
34
- * className="size-14 rounded-full"
35
- * />
36
- * ```
37
- */
38
- export declare function IPFSMediaRenderer({ src, alt, className, client, width, height, controls, style, }: IPFSMediaRendererProps): import("react/jsx-runtime").JSX.Element;
39
- export {};
@@ -1,34 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { client as defaultClient } from "../../../../shared/utils/thirdweb.js";
4
- import { MediaRenderer } from "thirdweb/react";
5
- // Primary IPFS gateway URL - matches our allowed list in profileDisplay.ts
6
- // Note: MediaRenderer expects the base gateway URL without /ipfs path
7
- const IPFS_GATEWAY_URL = "https://cloudflare-ipfs.com";
8
- /**
9
- * IPFSMediaRenderer - A wrapper around Thirdweb's MediaRenderer that configures
10
- * the IPFS gateway URL to use our validated gateway.
11
- *
12
- * Features:
13
- * - Configures MediaRenderer to use cloudflare-ipfs.com gateway
14
- * - Gateway matches our allowed list in profileDisplay.ts
15
- * - Provides fallback for missing sources
16
- *
17
- * @example
18
- * ```tsx
19
- * <IPFSMediaRenderer
20
- * src="ipfs://QmX..."
21
- * alt="Profile Avatar"
22
- * className="size-14 rounded-full"
23
- * />
24
- * ```
25
- */
26
- export function IPFSMediaRenderer({ src, alt = "Media", className, client = defaultClient, width, height, controls, style, }) {
27
- // If no source, render fallback
28
- if (!src) {
29
- return (_jsx("div", { className: className, style: style, "aria-label": alt, children: _jsx("div", { className: "bg-b3-primary-wash flex h-full w-full items-center justify-center", children: _jsx("span", { className: "text-b3-grey font-neue-montreal-semibold text-xs", children: alt.charAt(0).toUpperCase() }) }) }));
30
- }
31
- // Convert IPFS URLs to HTTP gateway URLs if needed
32
- // This handles both ipfs:// URLs and existing HTTP gateway URLs
33
- return (_jsx(MediaRenderer, { src: src, client: client, alt: alt, className: className, width: width ? width.toString() : undefined, height: height ? height.toString() : undefined, controls: controls, style: style }));
34
- }
@@ -1,4 +0,0 @@
1
- import { LinkNewAccountModalProps } from "../../stores/useModalStore";
2
- export declare function LinkNewAccount({ onSuccess: onSuccessCallback, onError, onClose, chain, partnerId, className, }: LinkNewAccountModalProps & {
3
- className?: string;
4
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,325 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import app from "../../../../global-account/app.js";
3
- import { ecosystemWalletId } from "../../../../shared/constants/index.js";
4
- import { thirdwebB3Mainnet } from "../../../../shared/constants/chains/b3Chain.js";
5
- import { client } from "../../../../shared/utils/thirdweb.js";
6
- import { Loader2, Mail, Phone, WalletIcon } from "lucide-react";
7
- import { useCallback, useEffect, useState } from "react";
8
- import { toast } from "sonner";
9
- import { useLinkProfile, useProfiles } from "thirdweb/react";
10
- import { createWallet, preAuthenticate } from "thirdweb/wallets";
11
- import { WalletRow } from "../../index.js";
12
- import { useModalStore } from "../../stores/useModalStore.js";
13
- import { getProfileDisplayInfo } from "../../utils/profileDisplay.js";
14
- import { useB3 } from "../B3Provider/useB3.js";
15
- import { AppleIcon } from "../icons/AppleIcon.js";
16
- import { DiscordIcon } from "../icons/DiscordIcon.js";
17
- import { FarcasterIcon } from "../icons/FarcasterIcon.js";
18
- import { GoogleIcon } from "../icons/GoogleIcon.js";
19
- import { XIcon } from "../icons/XIcon.js";
20
- import ModalHeader from "../ModalHeader/ModalHeader.js";
21
- import { Button } from "../ui/button.js";
22
- const AUTH_METHODS = [
23
- { id: "email", label: "Email", enabled: true, icon: _jsx(Mail, { className: "text-b3-primary-blue size-6" }) },
24
- { id: "phone", label: "Phone", enabled: true, icon: _jsx(Phone, { className: "text-b3-primary-blue size-6" }) },
25
- { id: "google", label: "Google", enabled: true, icon: _jsx(GoogleIcon, { className: "size-6" }) },
26
- { id: "x", label: "X (Twitter)", enabled: true, icon: _jsx(XIcon, { className: "size-6" }) },
27
- { id: "discord", label: "Discord", enabled: true, icon: _jsx(DiscordIcon, { className: "size-6" }) },
28
- { id: "apple", label: "Apple", enabled: true, icon: _jsx(AppleIcon, { className: "size-6" }) },
29
- {
30
- id: "farcaster",
31
- label: "Farcaster",
32
- enabled: true,
33
- icon: _jsx(FarcasterIcon, { className: "size-6" }),
34
- },
35
- ];
36
- const WALLET_METHODS = [
37
- {
38
- id: "wallet",
39
- label: "Wallet",
40
- enabled: true,
41
- icon: _jsx(WalletIcon, { className: "size-6" }),
42
- walletType: "com.coinbase.wallet",
43
- },
44
- { id: "wallet", label: "Wallet", enabled: true, icon: _jsx(WalletIcon, { className: "size-6" }), walletType: "io.metamask" },
45
- {
46
- id: "wallet",
47
- label: "Wallet",
48
- enabled: true,
49
- icon: _jsx(WalletIcon, { className: "size-6" }),
50
- walletType: "me.rainbow",
51
- },
52
- {
53
- id: "wallet",
54
- label: "Wallet",
55
- enabled: true,
56
- icon: _jsx(WalletIcon, { className: "size-6" }),
57
- walletType: "app.phantom",
58
- },
59
- { id: "wallet", label: "Wallet", enabled: true, icon: _jsx(WalletIcon, { className: "size-6" }), walletType: "io.rabby" },
60
- {
61
- id: "wallet",
62
- label: "Wallet",
63
- enabled: true,
64
- icon: _jsx(WalletIcon, { className: "size-6" }),
65
- walletType: "walletConnect",
66
- },
67
- ];
68
- export function LinkNewAccount({ onSuccess: onSuccessCallback, onError, onClose, chain, partnerId, className, }) {
69
- const isLinking = useModalStore(state => state.isLinking);
70
- const linkingMethod = useModalStore(state => state.linkingMethod);
71
- const setLinkingState = useModalStore(state => state.setLinkingState);
72
- const navigateBack = useModalStore(state => state.navigateBack);
73
- const setB3ModalContentType = useModalStore(state => state.setB3ModalContentType);
74
- const [selectedMethod, setSelectedMethod] = useState(null);
75
- const [email, setEmail] = useState("");
76
- const [phone, setPhone] = useState("");
77
- const [otp, setOtp] = useState("");
78
- const [otpSent, setOtpSent] = useState(false);
79
- const [error, setError] = useState(null);
80
- const { data: profilesRaw = [] } = useProfiles({ client });
81
- // Get connected auth methods
82
- const connectedAuthMethods = profilesRaw
83
- .filter((profile) => !["custom_auth_endpoint"].includes(profile.type))
84
- .map((profile) => profile.type);
85
- // Filter available auth methods
86
- const availableAuthMethods = AUTH_METHODS.filter(method => !connectedAuthMethods.includes(method.id) && method.enabled);
87
- const profiles = profilesRaw
88
- .filter((profile) => !["custom_auth_endpoint"].includes(profile.type))
89
- .map((profile) => ({
90
- ...getProfileDisplayInfo(profile),
91
- originalProfile: profile,
92
- }));
93
- const { account } = useB3();
94
- const { mutate: linkProfile } = useLinkProfile();
95
- const onSuccess = useCallback(async () => {
96
- await onSuccessCallback?.();
97
- }, [onSuccessCallback]);
98
- // Reset linking state when component unmounts
99
- useEffect(() => {
100
- return () => {
101
- if (isLinking) {
102
- setLinkingState(false);
103
- }
104
- };
105
- }, [isLinking, setLinkingState]);
106
- const mutationOptions = {
107
- onError: (error) => {
108
- console.error("Error linking account:", error);
109
- toast.error(error.message);
110
- setLinkingState(false);
111
- onError?.(error);
112
- },
113
- onSuccess: async (data) => {
114
- console.log("Raw Link Account Data:", data);
115
- try {
116
- console.log("Sync user data...");
117
- await app.service("users").syncTwProfiles({});
118
- }
119
- catch (refreshError) {
120
- console.warn("⚠️ Could not sync user data:", refreshError);
121
- }
122
- },
123
- };
124
- const validateInput = () => {
125
- if (selectedMethod === "email") {
126
- if (!email) {
127
- setError("Please enter your email address");
128
- return false;
129
- }
130
- if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
131
- setError("Please enter a valid email address");
132
- return false;
133
- }
134
- }
135
- else if (selectedMethod === "phone") {
136
- if (!phone) {
137
- setError("Please enter your phone number");
138
- return false;
139
- }
140
- if (!/^\+?[\d\s-]{10,}$/.test(phone)) {
141
- setError("Please enter a valid phone number");
142
- return false;
143
- }
144
- }
145
- setError(null);
146
- return true;
147
- };
148
- const handleSendOTP = async () => {
149
- if (!validateInput())
150
- return;
151
- try {
152
- setLinkingState(true, selectedMethod);
153
- setError(null);
154
- if (selectedMethod === "email") {
155
- await preAuthenticate({
156
- client,
157
- strategy: "email",
158
- email,
159
- ecosystem: {
160
- id: ecosystemWalletId,
161
- partnerId: partnerId,
162
- },
163
- });
164
- }
165
- else if (selectedMethod === "phone") {
166
- await preAuthenticate({
167
- client,
168
- strategy: "phone",
169
- phoneNumber: phone,
170
- ecosystem: {
171
- id: ecosystemWalletId,
172
- partnerId: partnerId,
173
- },
174
- });
175
- }
176
- setOtpSent(true);
177
- }
178
- catch (error) {
179
- console.error("Error sending OTP:", error);
180
- setError(error instanceof Error ? error.message : "Failed to send OTP");
181
- onError?.(error);
182
- setLinkingState(false);
183
- }
184
- };
185
- const handleLinkAccount = async () => {
186
- if (!otp) {
187
- console.error("No OTP entered");
188
- setError("Please enter the verification code");
189
- return;
190
- }
191
- try {
192
- setOtpSent(false);
193
- setLinkingState(true, selectedMethod);
194
- setError(null);
195
- if (selectedMethod === "email") {
196
- await linkProfile({
197
- client,
198
- strategy: "email",
199
- email,
200
- verificationCode: otp,
201
- }, mutationOptions);
202
- }
203
- else if (selectedMethod === "phone") {
204
- await linkProfile({
205
- client,
206
- strategy: "phone",
207
- phoneNumber: phone,
208
- verificationCode: otp,
209
- }, mutationOptions);
210
- }
211
- }
212
- catch (error) {
213
- console.error("Error linking account:", error);
214
- setError(error instanceof Error ? error.message : "Failed to link account");
215
- onError?.(error);
216
- }
217
- };
218
- const handleLinkWallet = async (walletType) => {
219
- setLinkingState(true, "wallet");
220
- console.log("selectedMethod", walletType);
221
- try {
222
- if (!walletType) {
223
- throw new Error("Wallet type not found");
224
- }
225
- await linkProfile({
226
- client,
227
- strategy: "wallet",
228
- wallet: createWallet(walletType),
229
- chain: thirdwebB3Mainnet,
230
- }, mutationOptions);
231
- }
232
- catch (error) {
233
- console.error("Error linking account:", error);
234
- setError(error instanceof Error ? error.message : "Failed to link account");
235
- onError?.(error);
236
- }
237
- };
238
- const handleSocialLink = async (strategy) => {
239
- try {
240
- console.log("handleSocialLink", strategy);
241
- setLinkingState(true, strategy);
242
- setError(null);
243
- const result = await linkProfile({
244
- client,
245
- strategy,
246
- }, mutationOptions);
247
- console.log("result", result);
248
- // Don't close the modal yet, wait for auth to complete
249
- onSuccess?.();
250
- }
251
- catch (error) {
252
- console.error("Error linking with social:", error);
253
- setError(error instanceof Error ? error.message : "Failed to link social account");
254
- onError?.(error);
255
- setLinkingState(false);
256
- }
257
- };
258
- // Add effect to handle social auth completion
259
- useEffect(() => {
260
- if (isLinking && linkingMethod && !selectedMethod) {
261
- // This means we're in a social auth flow
262
- const checkAuthStatus = async () => {
263
- try {
264
- // Wait a bit to ensure auth is complete
265
- await new Promise(resolve => setTimeout(resolve, 1000));
266
- onClose?.();
267
- }
268
- catch (error) {
269
- console.error("Error checking auth status:", error);
270
- setLinkingState(false);
271
- }
272
- };
273
- checkAuthStatus();
274
- }
275
- }, [isLinking, linkingMethod, selectedMethod, onClose, setLinkingState]);
276
- const handleBack = useCallback(() => {
277
- if (isLinking)
278
- return;
279
- setSelectedMethod(null);
280
- setEmail("");
281
- setPhone("");
282
- setOtp("");
283
- setOtpSent(false);
284
- setError(null);
285
- setLinkingState(false);
286
- }, [isLinking, setSelectedMethod, setEmail, setPhone, setOtp, setOtpSent, setError, setLinkingState]);
287
- const handleFinishedLinking = useCallback((success) => {
288
- if (success) {
289
- onSuccess?.();
290
- onClose?.();
291
- }
292
- setLinkingState(false);
293
- navigateBack();
294
- setB3ModalContentType({
295
- type: "manageAccount",
296
- activeTab: "settings",
297
- setActiveTab: () => { },
298
- chain,
299
- partnerId,
300
- });
301
- }, [chain, navigateBack, partnerId, setB3ModalContentType, setLinkingState, onSuccess, onClose]);
302
- useEffect(() => {
303
- if (isLinking) {
304
- handleFinishedLinking(true);
305
- }
306
- // eslint-disable-next-line react-hooks/exhaustive-deps
307
- }, [profiles.length]);
308
- if (!account) {
309
- return _jsx("div", { className: "text-b3-foreground-muted py-8 text-center", children: "Please connect your account first" });
310
- }
311
- return (_jsxs("div", { className: `b3-link-account space-y-6 ${className || ""}`, "data-testid": "link-account", children: [_jsx(ModalHeader, { title: "Link New Account" }), !selectedMethod ? (_jsxs("div", { className: "b3-link-account-methods grid gap-3 px-5", children: [availableAuthMethods.map(method => (_jsx(Button, { variant: "outline", className: "b3-link-account-method-button border-b3-line hover:border-b3-primary-blue/30 hover:bg-b3-primary-blue/5 text-b3-grey font-neue-montreal-medium h-14 justify-start bg-transparent px-6 text-base transition-all duration-200", "data-method": method.id, onClick: () => {
312
- if (method.id === "email" || method.id === "phone") {
313
- setSelectedMethod(method.id);
314
- }
315
- else {
316
- handleSocialLink(method.id);
317
- }
318
- }, disabled: linkingMethod === method.id, children: isLinking && linkingMethod === method.id ? (_jsx(Loader2, { className: "h-5 w-5 animate-spin" })) : (_jsxs("div", { className: "b3-link-account-method-content flex items-center gap-4", children: [_jsx("div", { className: "b3-link-account-method-icon flex items-center justify-center rounded-full", children: method.icon }), _jsx("span", { className: "b3-link-account-method-label font-medium", children: method.label })] })) }, method.id))), WALLET_METHODS.map(method => {
319
- if (!method.walletType) {
320
- return null;
321
- }
322
- return (_jsx(WalletRow, { walletId: method.walletType, onClick: () => handleLinkWallet(method.walletType), isLoading: isLinking }, method.walletType));
323
- }), availableAuthMethods.length === 0 && (_jsx("div", { className: "text-b3-foreground-muted py-8 text-center", children: "All available authentication methods have been connected" }))] })) : (_jsxs("div", { className: "b3-link-account-form space-y-4 px-5", children: [selectedMethod === "email" && (_jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-b3-grey font-neue-montreal-medium text-sm", children: "Email Address" }), _jsx("input", { type: "email", placeholder: "Enter your email", className: "bg-b3-line text-b3-grey font-neue-montreal-medium focus:ring-b3-primary-blue/20 w-full rounded-xl p-4 focus:outline-none focus:ring-2", value: email, onChange: e => setEmail(e.target.value), disabled: otpSent || (isLinking && linkingMethod === "email") })] })), selectedMethod === "phone" && (_jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-b3-grey font-neue-montreal-medium text-sm", children: "Phone Number" }), _jsx("input", { type: "tel", placeholder: "Enter your phone number", className: "bg-b3-line text-b3-grey font-neue-montreal-medium focus:ring-b3-primary-blue/20 w-full rounded-xl p-4 focus:outline-none focus:ring-2", value: phone, onChange: e => setPhone(e.target.value), disabled: otpSent || (isLinking && linkingMethod === "phone") }), _jsx("p", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: "Include country code (e.g., +1 for US)" })] })), error && _jsx("div", { className: "text-b3-negative font-neue-montreal-medium py-2 text-sm", children: error }), (selectedMethod === "email" || selectedMethod === "phone") &&
324
- (otpSent ? (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-b3-grey font-neue-montreal-medium text-sm", children: "Verification Code" }), _jsx("input", { type: "text", placeholder: "Enter verification code", className: "bg-b3-line text-b3-grey font-neue-montreal-medium focus:ring-b3-primary-blue/20 w-full rounded-xl p-4 focus:outline-none focus:ring-2", value: otp, onChange: e => setOtp(e.target.value) })] }), _jsx(Button, { className: "bg-b3-primary-blue hover:bg-b3-primary-blue/90 font-neue-montreal-semibold h-12 w-full text-white", onClick: handleLinkAccount, children: "Link Account" })] })) : (_jsx(Button, { className: "bg-b3-primary-blue hover:bg-b3-primary-blue/90 font-neue-montreal-semibold h-12 w-full text-white", onClick: handleSendOTP, disabled: (!email && !phone) || (isLinking && linkingMethod === selectedMethod), children: isLinking && linkingMethod === selectedMethod ? (_jsx(Loader2, { className: "animate-spin" })) : ("Send Verification Code") })))] }))] }));
325
- }
@@ -1,6 +0,0 @@
1
- import { Chain } from "thirdweb";
2
- declare const AppsContent: ({ chain, partnerId }: {
3
- chain: Chain;
4
- partnerId: string;
5
- }) => import("react/jsx-runtime").JSX.Element;
6
- export default AppsContent;
@@ -1,32 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button, useGetAllTWSigners, useRemoveSessionKey, } from "../../../../global-account/react/index.js";
3
- import { formatNumber } from "../../../../shared/utils/formatNumber.js";
4
- import { useState } from "react";
5
- import { useActiveAccount } from "thirdweb/react";
6
- import { formatUnits } from "viem";
7
- const AppsContent = ({ chain, partnerId }) => {
8
- const [revokingSignerId, setRevokingSignerId] = useState(null);
9
- const account = useActiveAccount();
10
- const { data: signers, refetch: refetchSigners } = useGetAllTWSigners({
11
- chain,
12
- accountAddress: account?.address,
13
- });
14
- const { removeSessionKey } = useRemoveSessionKey({
15
- chain,
16
- onSuccess: tx => {
17
- console.log("@@removeSessionKey:tx", tx);
18
- setRevokingSignerId(null);
19
- },
20
- onError: error => {
21
- console.error("Error revoking access:", error);
22
- setRevokingSignerId(null);
23
- },
24
- refetchSigners: () => refetchSigners(),
25
- });
26
- const handleRevoke = async (signer) => {
27
- setRevokingSignerId(signer.id);
28
- await removeSessionKey(signer);
29
- };
30
- return (_jsxs("div", { className: "space-y-4", children: [signers?.map((signer) => (_jsx("div", { className: "rounded-xl border border-gray-200 p-4 dark:border-gray-800", children: _jsxs("div", { className: "flex items-start justify-between", children: [_jsxs("div", { className: "flex items-start gap-4", children: [_jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-gray-100 dark:bg-gray-800", children: _jsx("span", { className: "text-xs font-medium text-gray-600 dark:text-gray-400", children: "App" }) }), _jsxs("div", { children: [_jsx("h3", { className: "font-medium text-gray-900 dark:text-white", children: signer.partner.name }), _jsxs("div", { className: "mt-2 space-y-1", children: [_jsxs("p", { className: "text-xs text-gray-500", children: ["Added ", new Date(signer.createdAt).toLocaleDateString()] }), _jsxs("p", { className: "text-xs text-gray-500", children: ["Expires ", new Date(Number(signer.endTimestamp) * 1000).toLocaleDateString()] }), _jsxs("p", { className: "text-xs text-gray-500", children: ["Max spend: ", formatNumber(Number(formatUnits(signer.nativeTokenLimitPerTransaction, 18))), " ETH"] })] })] })] }), _jsx(Button, { variant: "outline", size: "sm", className: "border-red-200 text-red-500 hover:border-red-300 hover:text-red-600", onClick: () => handleRevoke(signer), disabled: revokingSignerId === signer.id, children: revokingSignerId === signer.id ? "Revoking..." : "Revoke" })] }) }, signer.id))), !signers?.length && _jsx("div", { className: "py-12 text-center text-gray-500", children: "No connected apps" })] }));
31
- };
32
- export default AppsContent;
@@ -1,2 +0,0 @@
1
- declare const BottomNavigation: () => import("react/jsx-runtime").JSX.Element;
2
- export default BottomNavigation;