@b3dotfun/sdk 0.0.73 → 0.0.74-alpha.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 (461) hide show
  1. package/dist/cjs/anyspend/react/components/AnySpend.js +75 -50
  2. package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +9 -10
  3. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +41 -41
  4. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -0
  5. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +17 -9
  6. package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +7 -8
  7. package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.js +7 -8
  8. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
  9. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +2 -2
  10. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.d.ts +0 -6
  11. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +18 -14
  12. package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.js +1 -1
  13. package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.js +2 -2
  14. package/dist/cjs/anyspend/react/components/common/InsufficientDepositPayment.js +6 -6
  15. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +35 -35
  16. package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +1 -2
  17. package/dist/cjs/anyspend/react/components/common/OrderHistory.d.ts +1 -1
  18. package/dist/cjs/anyspend/react/components/common/OrderHistory.js +7 -3
  19. package/dist/cjs/anyspend/react/components/common/OrderHistoryItem.js +1 -1
  20. package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +4 -4
  21. package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +8 -9
  22. package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.js +1 -1
  23. package/dist/cjs/anyspend/react/components/common/RecipientSelection.js +1 -1
  24. package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.js +2 -3
  25. package/dist/cjs/anyspend/react/components/webview/WebviewOnrampOrderStatus.js +1 -2
  26. package/dist/cjs/anyspend/react/components/webview/WebviewOnrampPayment.js +12 -12
  27. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +4 -5
  28. package/dist/cjs/anyspend/react/hooks/useConnectedWalletDisplay.js +3 -2
  29. package/dist/cjs/anyspend/react/hooks/usePhantomTransfer.js +17 -17
  30. package/dist/cjs/anyspend/react/utils/toast.d.ts +6 -0
  31. package/dist/cjs/anyspend/react/utils/toast.js +9 -0
  32. package/dist/cjs/global-account/react/components/AccountAssets/AccountAssets.js +38 -2
  33. package/dist/cjs/global-account/react/components/AvatarCreator/AvatarCreator.js +2 -3
  34. package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.d.ts +1 -0
  35. package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +275 -39
  36. package/dist/cjs/global-account/react/components/B3DynamicModal.js +40 -13
  37. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +1 -1
  38. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +19 -3
  39. package/dist/cjs/global-account/react/components/Deposit/Deposit.d.ts +1 -0
  40. package/dist/cjs/global-account/react/components/Deposit/Deposit.js +61 -0
  41. package/dist/cjs/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +39 -0
  42. package/dist/cjs/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +34 -0
  43. package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.d.ts +6 -4
  44. package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +104 -283
  45. package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +4 -0
  46. package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.js +320 -0
  47. package/dist/cjs/global-account/react/components/LinkAccount/LinkedAccountItem.d.ts +16 -0
  48. package/dist/cjs/global-account/react/components/LinkAccount/LinkedAccountItem.js +44 -0
  49. package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.d.ts +2 -0
  50. package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.js +23 -0
  51. package/dist/cjs/global-account/react/components/ManageAccount/ContentTokens.js +1 -2
  52. package/dist/cjs/global-account/react/components/ManageAccount/Header.d.ts +3 -0
  53. package/dist/cjs/global-account/react/components/ManageAccount/Header.js +120 -0
  54. package/dist/cjs/global-account/react/components/ManageAccount/HomeActions.d.ts +5 -0
  55. package/dist/cjs/global-account/react/components/ManageAccount/HomeActions.js +43 -0
  56. package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.d.ts +6 -0
  57. package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.js +16 -0
  58. package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +16 -194
  59. package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.d.ts +2 -0
  60. package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.js +15 -0
  61. package/dist/cjs/global-account/react/components/ManageAccount/NotificationChannel.d.ts +16 -0
  62. package/dist/cjs/global-account/react/components/ManageAccount/NotificationChannel.js +13 -0
  63. package/dist/cjs/global-account/react/components/ManageAccount/NotificationsContent.d.ts +8 -0
  64. package/dist/cjs/global-account/react/components/ManageAccount/NotificationsContent.js +152 -0
  65. package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.d.ts +2 -0
  66. package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +47 -0
  67. package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.d.ts +7 -0
  68. package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.js +60 -0
  69. package/dist/cjs/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +9 -0
  70. package/dist/cjs/global-account/react/components/ManageAccount/SettingsMenuItem.js +8 -0
  71. package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +2 -0
  72. package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +116 -0
  73. package/dist/cjs/global-account/react/components/ManageAccount/TokenBalanceRow.d.ts +3 -3
  74. package/dist/cjs/global-account/react/components/ManageAccount/TokenBalanceRow.js +2 -2
  75. package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.d.ts +2 -0
  76. package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.js +44 -0
  77. package/dist/cjs/global-account/react/components/ManageAccount/channels/DiscordChannel.d.ts +11 -0
  78. package/dist/cjs/global-account/react/components/ManageAccount/channels/DiscordChannel.js +48 -0
  79. package/dist/cjs/global-account/react/components/ManageAccount/channels/EmailChannel.d.ts +11 -0
  80. package/dist/cjs/global-account/react/components/ManageAccount/channels/EmailChannel.js +68 -0
  81. package/dist/cjs/global-account/react/components/ManageAccount/channels/PhoneChannel.d.ts +14 -0
  82. package/dist/cjs/global-account/react/components/ManageAccount/channels/PhoneChannel.js +79 -0
  83. package/dist/cjs/global-account/react/components/ManageAccount/channels/TelegramChannel.d.ts +11 -0
  84. package/dist/cjs/global-account/react/components/ManageAccount/channels/TelegramChannel.js +79 -0
  85. package/dist/cjs/global-account/react/components/ManageAccount/channels/index.d.ts +4 -0
  86. package/dist/cjs/global-account/react/components/ManageAccount/channels/index.js +11 -0
  87. package/dist/cjs/global-account/react/components/ModalHeader/ModalHeader.d.ts +11 -0
  88. package/dist/cjs/global-account/react/components/ModalHeader/ModalHeader.js +12 -0
  89. package/dist/cjs/global-account/react/components/Send/Send.d.ts +5 -0
  90. package/dist/cjs/global-account/react/components/Send/Send.js +195 -0
  91. package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +5 -4
  92. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -1
  93. package/dist/cjs/global-account/react/components/Toast/ToastComponents.d.ts +15 -0
  94. package/dist/cjs/global-account/react/components/Toast/ToastComponents.js +54 -0
  95. package/dist/cjs/global-account/react/components/Toast/ToastContext.d.ts +19 -0
  96. package/dist/cjs/global-account/react/components/Toast/ToastContext.js +59 -0
  97. package/dist/cjs/global-account/react/components/Toast/index.d.ts +4 -0
  98. package/dist/cjs/global-account/react/components/Toast/index.js +12 -0
  99. package/dist/cjs/global-account/react/components/Toast/toastApi.d.ts +21 -0
  100. package/dist/cjs/global-account/react/components/Toast/toastApi.js +93 -0
  101. package/dist/cjs/global-account/react/components/WalletImage/WalletImage.d.ts +4 -0
  102. package/dist/cjs/global-account/react/components/WalletImage/WalletImage.js +13 -0
  103. package/dist/cjs/global-account/react/components/icons/BellIcon.d.ts +3 -0
  104. package/dist/cjs/global-account/react/components/icons/BellIcon.js +5 -0
  105. package/dist/cjs/global-account/react/components/icons/ChevronDownIcon.d.ts +2 -0
  106. package/dist/cjs/global-account/react/components/icons/ChevronDownIcon.js +7 -0
  107. package/dist/cjs/global-account/react/components/icons/CopyIcon.d.ts +2 -0
  108. package/dist/cjs/global-account/react/components/icons/CopyIcon.js +7 -0
  109. package/dist/cjs/global-account/react/components/icons/LinkIcon.d.ts +3 -0
  110. package/dist/cjs/global-account/react/components/icons/LinkIcon.js +5 -0
  111. package/dist/cjs/global-account/react/components/icons/LockIcon.d.ts +3 -0
  112. package/dist/cjs/global-account/react/components/icons/LockIcon.js +5 -0
  113. package/dist/cjs/global-account/react/components/icons/WalletIcon.d.ts +2 -0
  114. package/dist/cjs/global-account/react/components/icons/WalletIcon.js +7 -0
  115. package/dist/cjs/global-account/react/components/index.d.ts +10 -4
  116. package/dist/cjs/global-account/react/components/index.js +29 -9
  117. package/dist/cjs/global-account/react/components/ui/Tabs.js +2 -2
  118. package/dist/cjs/global-account/react/components/ui/dialog.js +2 -2
  119. package/dist/cjs/global-account/react/components/ui/drawer.js +1 -1
  120. package/dist/cjs/global-account/react/hooks/index.d.ts +3 -2
  121. package/dist/cjs/global-account/react/hooks/index.js +7 -3
  122. package/dist/cjs/global-account/react/hooks/useAccountWallet.d.ts +1 -0
  123. package/dist/cjs/global-account/react/hooks/useAccountWallet.js +18 -0
  124. package/dist/cjs/global-account/react/hooks/useB3BalanceFromAddresses.js +1 -0
  125. package/dist/cjs/global-account/react/hooks/useChainSwitchWithAction.js +11 -11
  126. package/dist/cjs/global-account/react/hooks/useNativeBalance.js +2 -2
  127. package/dist/cjs/global-account/react/hooks/useNotifications.d.ts +48 -0
  128. package/dist/cjs/global-account/react/hooks/useNotifications.js +189 -0
  129. package/dist/cjs/global-account/react/hooks/useSimBalance.js +3 -3
  130. package/dist/cjs/global-account/react/hooks/useTokenBalanceDirect.d.ts +1 -0
  131. package/dist/cjs/global-account/react/hooks/useTokenBalanceDirect.js +1 -0
  132. package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +17 -17
  133. package/dist/cjs/global-account/react/stores/index.d.ts +1 -0
  134. package/dist/cjs/global-account/react/stores/index.js +3 -1
  135. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +47 -6
  136. package/dist/cjs/global-account/react/stores/useRecentAddressesStore.d.ts +25 -0
  137. package/dist/cjs/global-account/react/stores/useRecentAddressesStore.js +36 -0
  138. package/dist/cjs/global-account/react/utils/index.d.ts +4 -0
  139. package/dist/cjs/global-account/react/utils/index.js +20 -0
  140. package/dist/cjs/global-account/react/utils/notificationsAPI.d.ts +80 -0
  141. package/dist/cjs/global-account/react/utils/notificationsAPI.js +257 -0
  142. package/dist/cjs/global-account/react/utils/profileDisplay.d.ts +3 -0
  143. package/dist/cjs/global-account/react/utils/profileDisplay.js +8 -4
  144. package/dist/cjs/global-account/react/utils/toast.d.ts +6 -0
  145. package/dist/cjs/global-account/react/utils/toast.js +9 -0
  146. package/dist/cjs/shared/constants/chains/supported.d.ts +3 -2
  147. package/dist/cjs/shared/constants/chains/supported.js +4 -0
  148. package/dist/cjs/shared/utils/ipfs.js +10 -3
  149. package/dist/esm/anyspend/react/components/AnySpend.js +67 -42
  150. package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +1 -2
  151. package/dist/esm/anyspend/react/components/AnySpendCustom.js +10 -10
  152. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -0
  153. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +12 -4
  154. package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +1 -2
  155. package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.js +1 -2
  156. package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
  157. package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +2 -2
  158. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.d.ts +0 -6
  159. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +9 -5
  160. package/dist/esm/anyspend/react/components/common/FeeDetailPanel.js +1 -1
  161. package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.js +2 -2
  162. package/dist/esm/anyspend/react/components/common/InsufficientDepositPayment.js +1 -1
  163. package/dist/esm/anyspend/react/components/common/OrderDetails.js +2 -2
  164. package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +1 -2
  165. package/dist/esm/anyspend/react/components/common/OrderHistory.d.ts +1 -1
  166. package/dist/esm/anyspend/react/components/common/OrderHistory.js +6 -5
  167. package/dist/esm/anyspend/react/components/common/OrderHistoryItem.js +2 -2
  168. package/dist/esm/anyspend/react/components/common/PanelOnramp.js +4 -4
  169. package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +2 -3
  170. package/dist/esm/anyspend/react/components/common/PointsDetailPanel.js +1 -1
  171. package/dist/esm/anyspend/react/components/common/RecipientSelection.js +1 -1
  172. package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.js +1 -2
  173. package/dist/esm/anyspend/react/components/webview/WebviewOnrampOrderStatus.js +1 -2
  174. package/dist/esm/anyspend/react/components/webview/WebviewOnrampPayment.js +1 -1
  175. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +1 -2
  176. package/dist/esm/anyspend/react/hooks/useConnectedWalletDisplay.js +3 -2
  177. package/dist/esm/anyspend/react/hooks/usePhantomTransfer.js +1 -1
  178. package/dist/esm/anyspend/react/utils/toast.d.ts +6 -0
  179. package/dist/esm/anyspend/react/utils/toast.js +5 -0
  180. package/dist/esm/global-account/react/components/AccountAssets/AccountAssets.js +38 -2
  181. package/dist/esm/global-account/react/components/AvatarCreator/AvatarCreator.js +1 -2
  182. package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.d.ts +1 -0
  183. package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +276 -40
  184. package/dist/esm/global-account/react/components/B3DynamicModal.js +37 -13
  185. package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +1 -1
  186. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +19 -3
  187. package/dist/esm/global-account/react/components/Deposit/Deposit.d.ts +1 -0
  188. package/dist/esm/global-account/react/components/Deposit/Deposit.js +55 -0
  189. package/dist/esm/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +39 -0
  190. package/dist/esm/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +31 -0
  191. package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.d.ts +6 -4
  192. package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +103 -283
  193. package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +4 -0
  194. package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.js +314 -0
  195. package/dist/esm/global-account/react/components/LinkAccount/LinkedAccountItem.d.ts +16 -0
  196. package/dist/esm/global-account/react/components/LinkAccount/LinkedAccountItem.js +42 -0
  197. package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.d.ts +2 -0
  198. package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.js +21 -0
  199. package/dist/esm/global-account/react/components/ManageAccount/ContentTokens.js +1 -2
  200. package/dist/esm/global-account/react/components/ManageAccount/Header.d.ts +3 -0
  201. package/dist/esm/global-account/react/components/ManageAccount/Header.js +81 -0
  202. package/dist/esm/global-account/react/components/ManageAccount/HomeActions.d.ts +5 -0
  203. package/dist/esm/global-account/react/components/ManageAccount/HomeActions.js +41 -0
  204. package/dist/esm/global-account/react/components/ManageAccount/HomeContent.d.ts +6 -0
  205. package/dist/esm/global-account/react/components/ManageAccount/HomeContent.js +10 -0
  206. package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +18 -196
  207. package/dist/esm/global-account/react/components/ManageAccount/NFTContent.d.ts +2 -0
  208. package/dist/esm/global-account/react/components/ManageAccount/NFTContent.js +13 -0
  209. package/dist/esm/global-account/react/components/ManageAccount/NotificationChannel.d.ts +16 -0
  210. package/dist/esm/global-account/react/components/ManageAccount/NotificationChannel.js +9 -0
  211. package/dist/esm/global-account/react/components/ManageAccount/NotificationsContent.d.ts +8 -0
  212. package/dist/esm/global-account/react/components/ManageAccount/NotificationsContent.js +147 -0
  213. package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.d.ts +2 -0
  214. package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +45 -0
  215. package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.d.ts +7 -0
  216. package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.js +55 -0
  217. package/dist/esm/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +9 -0
  218. package/dist/esm/global-account/react/components/ManageAccount/SettingsMenuItem.js +6 -0
  219. package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +2 -0
  220. package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +111 -0
  221. package/dist/esm/global-account/react/components/ManageAccount/TokenBalanceRow.d.ts +3 -3
  222. package/dist/esm/global-account/react/components/ManageAccount/TokenBalanceRow.js +3 -3
  223. package/dist/esm/global-account/react/components/ManageAccount/TokenContent.d.ts +2 -0
  224. package/dist/esm/global-account/react/components/ManageAccount/TokenContent.js +42 -0
  225. package/dist/esm/global-account/react/components/ManageAccount/channels/DiscordChannel.d.ts +11 -0
  226. package/dist/esm/global-account/react/components/ManageAccount/channels/DiscordChannel.js +44 -0
  227. package/dist/esm/global-account/react/components/ManageAccount/channels/EmailChannel.d.ts +11 -0
  228. package/dist/esm/global-account/react/components/ManageAccount/channels/EmailChannel.js +64 -0
  229. package/dist/esm/global-account/react/components/ManageAccount/channels/PhoneChannel.d.ts +14 -0
  230. package/dist/esm/global-account/react/components/ManageAccount/channels/PhoneChannel.js +75 -0
  231. package/dist/esm/global-account/react/components/ManageAccount/channels/TelegramChannel.d.ts +11 -0
  232. package/dist/esm/global-account/react/components/ManageAccount/channels/TelegramChannel.js +75 -0
  233. package/dist/esm/global-account/react/components/ManageAccount/channels/index.d.ts +4 -0
  234. package/dist/esm/global-account/react/components/ManageAccount/channels/index.js +4 -0
  235. package/dist/esm/global-account/react/components/ModalHeader/ModalHeader.d.ts +11 -0
  236. package/dist/esm/global-account/react/components/ModalHeader/ModalHeader.js +10 -0
  237. package/dist/esm/global-account/react/components/Send/Send.d.ts +5 -0
  238. package/dist/esm/global-account/react/components/Send/Send.js +189 -0
  239. package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +7 -6
  240. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -1
  241. package/dist/esm/global-account/react/components/Toast/ToastComponents.d.ts +15 -0
  242. package/dist/esm/global-account/react/components/Toast/ToastComponents.js +50 -0
  243. package/dist/esm/global-account/react/components/Toast/ToastContext.d.ts +19 -0
  244. package/dist/esm/global-account/react/components/Toast/ToastContext.js +55 -0
  245. package/dist/esm/global-account/react/components/Toast/index.d.ts +4 -0
  246. package/dist/esm/global-account/react/components/Toast/index.js +3 -0
  247. package/dist/esm/global-account/react/components/Toast/toastApi.d.ts +21 -0
  248. package/dist/esm/global-account/react/components/Toast/toastApi.js +89 -0
  249. package/dist/esm/global-account/react/components/WalletImage/WalletImage.d.ts +4 -0
  250. package/dist/esm/global-account/react/components/WalletImage/WalletImage.js +11 -0
  251. package/dist/esm/global-account/react/components/icons/BellIcon.d.ts +3 -0
  252. package/dist/esm/global-account/react/components/icons/BellIcon.js +3 -0
  253. package/dist/esm/global-account/react/components/icons/ChevronDownIcon.d.ts +2 -0
  254. package/dist/esm/global-account/react/components/icons/ChevronDownIcon.js +4 -0
  255. package/dist/esm/global-account/react/components/icons/CopyIcon.d.ts +2 -0
  256. package/dist/esm/global-account/react/components/icons/CopyIcon.js +4 -0
  257. package/dist/esm/global-account/react/components/icons/LinkIcon.d.ts +3 -0
  258. package/dist/esm/global-account/react/components/icons/LinkIcon.js +3 -0
  259. package/dist/esm/global-account/react/components/icons/LockIcon.d.ts +3 -0
  260. package/dist/esm/global-account/react/components/icons/LockIcon.js +3 -0
  261. package/dist/esm/global-account/react/components/icons/WalletIcon.d.ts +2 -0
  262. package/dist/esm/global-account/react/components/icons/WalletIcon.js +4 -0
  263. package/dist/esm/global-account/react/components/index.d.ts +10 -4
  264. package/dist/esm/global-account/react/components/index.js +14 -5
  265. package/dist/esm/global-account/react/components/ui/Tabs.js +2 -2
  266. package/dist/esm/global-account/react/components/ui/dialog.js +2 -2
  267. package/dist/esm/global-account/react/components/ui/drawer.js +1 -1
  268. package/dist/esm/global-account/react/hooks/index.d.ts +3 -2
  269. package/dist/esm/global-account/react/hooks/index.js +3 -2
  270. package/dist/esm/global-account/react/hooks/useAccountWallet.d.ts +1 -0
  271. package/dist/esm/global-account/react/hooks/useAccountWallet.js +17 -0
  272. package/dist/esm/global-account/react/hooks/useB3BalanceFromAddresses.js +1 -0
  273. package/dist/esm/global-account/react/hooks/useChainSwitchWithAction.js +2 -2
  274. package/dist/esm/global-account/react/hooks/useNativeBalance.js +1 -1
  275. package/dist/esm/global-account/react/hooks/useNotifications.d.ts +48 -0
  276. package/dist/esm/global-account/react/hooks/useNotifications.js +186 -0
  277. package/dist/esm/global-account/react/hooks/useSimBalance.js +3 -3
  278. package/dist/esm/global-account/react/hooks/useTokenBalanceDirect.d.ts +1 -0
  279. package/dist/esm/global-account/react/hooks/useTokenBalanceDirect.js +1 -0
  280. package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +2 -2
  281. package/dist/esm/global-account/react/stores/index.d.ts +1 -0
  282. package/dist/esm/global-account/react/stores/index.js +1 -0
  283. package/dist/esm/global-account/react/stores/useModalStore.d.ts +47 -6
  284. package/dist/esm/global-account/react/stores/useRecentAddressesStore.d.ts +25 -0
  285. package/dist/esm/global-account/react/stores/useRecentAddressesStore.js +33 -0
  286. package/dist/esm/global-account/react/utils/index.d.ts +4 -0
  287. package/dist/esm/global-account/react/utils/index.js +4 -0
  288. package/dist/esm/global-account/react/utils/notificationsAPI.d.ts +80 -0
  289. package/dist/esm/global-account/react/utils/notificationsAPI.js +254 -0
  290. package/dist/esm/global-account/react/utils/profileDisplay.d.ts +3 -0
  291. package/dist/esm/global-account/react/utils/profileDisplay.js +8 -4
  292. package/dist/esm/global-account/react/utils/toast.d.ts +6 -0
  293. package/dist/esm/global-account/react/utils/toast.js +5 -0
  294. package/dist/esm/shared/constants/chains/supported.d.ts +3 -2
  295. package/dist/esm/shared/constants/chains/supported.js +3 -0
  296. package/dist/esm/shared/utils/ipfs.js +10 -3
  297. package/dist/styles/index.css +1 -1
  298. package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -0
  299. package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
  300. package/dist/types/anyspend/react/components/common/CryptoPaymentMethod.d.ts +0 -6
  301. package/dist/types/anyspend/react/components/common/OrderHistory.d.ts +1 -1
  302. package/dist/types/anyspend/react/utils/toast.d.ts +6 -0
  303. package/dist/types/global-account/react/components/AvatarEditor/AvatarEditor.d.ts +1 -0
  304. package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +1 -1
  305. package/dist/types/global-account/react/components/Deposit/Deposit.d.ts +1 -0
  306. package/dist/types/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +39 -0
  307. package/dist/types/global-account/react/components/LinkAccount/LinkAccount.d.ts +6 -4
  308. package/dist/types/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +4 -0
  309. package/dist/types/global-account/react/components/LinkAccount/LinkedAccountItem.d.ts +16 -0
  310. package/dist/types/global-account/react/components/ManageAccount/BottomNavigation.d.ts +2 -0
  311. package/dist/types/global-account/react/components/ManageAccount/Header.d.ts +3 -0
  312. package/dist/types/global-account/react/components/ManageAccount/HomeActions.d.ts +5 -0
  313. package/dist/types/global-account/react/components/ManageAccount/HomeContent.d.ts +6 -0
  314. package/dist/types/global-account/react/components/ManageAccount/NFTContent.d.ts +2 -0
  315. package/dist/types/global-account/react/components/ManageAccount/NotificationChannel.d.ts +16 -0
  316. package/dist/types/global-account/react/components/ManageAccount/NotificationsContent.d.ts +8 -0
  317. package/dist/types/global-account/react/components/ManageAccount/ProfileSection.d.ts +2 -0
  318. package/dist/types/global-account/react/components/ManageAccount/SettingsContent.d.ts +7 -0
  319. package/dist/types/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +9 -0
  320. package/dist/types/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +2 -0
  321. package/dist/types/global-account/react/components/ManageAccount/TokenBalanceRow.d.ts +3 -3
  322. package/dist/types/global-account/react/components/ManageAccount/TokenContent.d.ts +2 -0
  323. package/dist/types/global-account/react/components/ManageAccount/channels/DiscordChannel.d.ts +11 -0
  324. package/dist/types/global-account/react/components/ManageAccount/channels/EmailChannel.d.ts +11 -0
  325. package/dist/types/global-account/react/components/ManageAccount/channels/PhoneChannel.d.ts +14 -0
  326. package/dist/types/global-account/react/components/ManageAccount/channels/TelegramChannel.d.ts +11 -0
  327. package/dist/types/global-account/react/components/ManageAccount/channels/index.d.ts +4 -0
  328. package/dist/types/global-account/react/components/ModalHeader/ModalHeader.d.ts +11 -0
  329. package/dist/types/global-account/react/components/Send/Send.d.ts +5 -0
  330. package/dist/types/global-account/react/components/Toast/ToastComponents.d.ts +15 -0
  331. package/dist/types/global-account/react/components/Toast/ToastContext.d.ts +19 -0
  332. package/dist/types/global-account/react/components/Toast/index.d.ts +4 -0
  333. package/dist/types/global-account/react/components/Toast/toastApi.d.ts +21 -0
  334. package/dist/types/global-account/react/components/WalletImage/WalletImage.d.ts +4 -0
  335. package/dist/types/global-account/react/components/icons/BellIcon.d.ts +3 -0
  336. package/dist/types/global-account/react/components/icons/ChevronDownIcon.d.ts +2 -0
  337. package/dist/types/global-account/react/components/icons/CopyIcon.d.ts +2 -0
  338. package/dist/types/global-account/react/components/icons/LinkIcon.d.ts +3 -0
  339. package/dist/types/global-account/react/components/icons/LockIcon.d.ts +3 -0
  340. package/dist/types/global-account/react/components/icons/WalletIcon.d.ts +2 -0
  341. package/dist/types/global-account/react/components/index.d.ts +10 -4
  342. package/dist/types/global-account/react/hooks/index.d.ts +3 -2
  343. package/dist/types/global-account/react/hooks/useAccountWallet.d.ts +1 -0
  344. package/dist/types/global-account/react/hooks/useNotifications.d.ts +48 -0
  345. package/dist/types/global-account/react/hooks/useTokenBalanceDirect.d.ts +1 -0
  346. package/dist/types/global-account/react/stores/index.d.ts +1 -0
  347. package/dist/types/global-account/react/stores/useModalStore.d.ts +47 -6
  348. package/dist/types/global-account/react/stores/useRecentAddressesStore.d.ts +25 -0
  349. package/dist/types/global-account/react/utils/index.d.ts +4 -0
  350. package/dist/types/global-account/react/utils/notificationsAPI.d.ts +80 -0
  351. package/dist/types/global-account/react/utils/profileDisplay.d.ts +3 -0
  352. package/dist/types/global-account/react/utils/toast.d.ts +6 -0
  353. package/dist/types/shared/constants/chains/supported.d.ts +3 -2
  354. package/package.json +2 -1
  355. package/src/anyspend/react/components/AnySpend.tsx +213 -173
  356. package/src/anyspend/react/components/AnySpendBuySpin.tsx +2 -1
  357. package/src/anyspend/react/components/AnySpendCustom.tsx +80 -77
  358. package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +20 -4
  359. package/src/anyspend/react/components/AnySpendStakeB3.tsx +2 -1
  360. package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +2 -1
  361. package/src/anyspend/react/components/AnyspendDepositHype.tsx +3 -0
  362. package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +56 -22
  363. package/src/anyspend/react/components/common/FeeDetailPanel.tsx +1 -1
  364. package/src/anyspend/react/components/common/FiatPaymentMethod.tsx +2 -2
  365. package/src/anyspend/react/components/common/InsufficientDepositPayment.tsx +1 -1
  366. package/src/anyspend/react/components/common/OrderDetails.tsx +6 -2
  367. package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +2 -2
  368. package/src/anyspend/react/components/common/OrderHistory.tsx +8 -13
  369. package/src/anyspend/react/components/common/OrderHistoryItem.tsx +69 -25
  370. package/src/anyspend/react/components/common/PanelOnramp.tsx +6 -4
  371. package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +3 -3
  372. package/src/anyspend/react/components/common/PointsDetailPanel.tsx +1 -1
  373. package/src/anyspend/react/components/common/RecipientSelection.tsx +1 -1
  374. package/src/anyspend/react/components/common/TransferCryptoDetails.tsx +2 -2
  375. package/src/anyspend/react/components/webview/WebviewOnrampOrderStatus.tsx +3 -3
  376. package/src/anyspend/react/components/webview/WebviewOnrampPayment.tsx +2 -1
  377. package/src/anyspend/react/hooks/useAnyspendFlow.ts +2 -1
  378. package/src/anyspend/react/hooks/useConnectedWalletDisplay.ts +3 -2
  379. package/src/anyspend/react/hooks/usePhantomTransfer.ts +1 -1
  380. package/src/anyspend/react/utils/toast.ts +6 -0
  381. package/src/global-account/react/components/AccountAssets/AccountAssets.tsx +115 -25
  382. package/src/global-account/react/components/AvatarCreator/AvatarCreator.tsx +2 -2
  383. package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +491 -130
  384. package/src/global-account/react/components/B3DynamicModal.tsx +76 -17
  385. package/src/global-account/react/components/B3Provider/B3Provider.tsx +40 -20
  386. package/src/global-account/react/components/Deposit/Deposit.tsx +208 -0
  387. package/src/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.tsx +84 -0
  388. package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +269 -434
  389. package/src/global-account/react/components/LinkAccount/LinkNewAccount.tsx +480 -0
  390. package/src/global-account/react/components/LinkAccount/LinkedAccountItem.tsx +135 -0
  391. package/src/global-account/react/components/ManageAccount/BottomNavigation.tsx +83 -0
  392. package/src/global-account/react/components/ManageAccount/ContentTokens.tsx +2 -1
  393. package/src/global-account/react/components/ManageAccount/Header.tsx +230 -0
  394. package/src/global-account/react/components/ManageAccount/HomeActions.tsx +118 -0
  395. package/src/global-account/react/components/ManageAccount/HomeContent.tsx +42 -0
  396. package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +74 -597
  397. package/src/global-account/react/components/ManageAccount/NFTContent.tsx +24 -0
  398. package/src/global-account/react/components/ManageAccount/NotificationChannel.tsx +94 -0
  399. package/src/global-account/react/components/ManageAccount/NotificationsContent.tsx +268 -0
  400. package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +79 -0
  401. package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +106 -0
  402. package/src/global-account/react/components/ManageAccount/SettingsMenuItem.tsx +31 -0
  403. package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +197 -0
  404. package/src/global-account/react/components/ManageAccount/TokenBalanceRow.tsx +20 -5
  405. package/src/global-account/react/components/ManageAccount/TokenContent.tsx +66 -0
  406. package/src/global-account/react/components/ManageAccount/channels/DiscordChannel.tsx +119 -0
  407. package/src/global-account/react/components/ManageAccount/channels/EmailChannel.tsx +168 -0
  408. package/src/global-account/react/components/ManageAccount/channels/PhoneChannel.tsx +227 -0
  409. package/src/global-account/react/components/ManageAccount/channels/TelegramChannel.tsx +150 -0
  410. package/src/global-account/react/components/ManageAccount/channels/index.ts +4 -0
  411. package/src/global-account/react/components/ModalHeader/ModalHeader.tsx +61 -0
  412. package/src/global-account/react/components/Send/Send.tsx +621 -0
  413. package/src/global-account/react/components/SignInWithB3/SignIn.tsx +13 -12
  414. package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +1 -1
  415. package/src/global-account/react/components/Toast/README.md +350 -0
  416. package/src/global-account/react/components/Toast/ToastComponents.tsx +159 -0
  417. package/src/global-account/react/components/Toast/ToastContext.tsx +86 -0
  418. package/src/global-account/react/components/Toast/index.ts +4 -0
  419. package/src/global-account/react/components/Toast/toastApi.ts +98 -0
  420. package/src/global-account/react/components/WalletImage/WalletImage.tsx +12 -0
  421. package/src/global-account/react/components/icons/BellIcon.tsx +15 -0
  422. package/src/global-account/react/components/icons/ChevronDownIcon.tsx +17 -0
  423. package/src/global-account/react/components/icons/CopyIcon.tsx +22 -0
  424. package/src/global-account/react/components/icons/LinkIcon.tsx +15 -0
  425. package/src/global-account/react/components/icons/LockIcon.tsx +15 -0
  426. package/src/global-account/react/components/icons/WalletIcon.tsx +21 -0
  427. package/src/global-account/react/components/index.ts +19 -5
  428. package/src/global-account/react/components/ui/Tabs.tsx +5 -13
  429. package/src/global-account/react/components/ui/dialog.tsx +23 -14
  430. package/src/global-account/react/components/ui/drawer.tsx +1 -1
  431. package/src/global-account/react/hooks/index.ts +5 -1
  432. package/src/global-account/react/hooks/useAccountWallet.tsx +26 -0
  433. package/src/global-account/react/hooks/useB3BalanceFromAddresses.ts +1 -0
  434. package/src/global-account/react/hooks/useChainSwitchWithAction.ts +3 -2
  435. package/src/global-account/react/hooks/useNativeBalance.tsx +2 -1
  436. package/src/global-account/react/hooks/useNotifications.ts +229 -0
  437. package/src/global-account/react/hooks/useSimBalance.ts +3 -3
  438. package/src/global-account/react/hooks/useTokenBalanceDirect.tsx +2 -0
  439. package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +3 -2
  440. package/src/global-account/react/stores/index.ts +1 -0
  441. package/src/global-account/react/stores/useModalStore.ts +53 -6
  442. package/src/global-account/react/stores/useRecentAddressesStore.ts +54 -0
  443. package/src/global-account/react/utils/index.ts +4 -0
  444. package/src/global-account/react/utils/notificationsAPI.ts +305 -0
  445. package/src/global-account/react/utils/profileDisplay.ts +12 -4
  446. package/src/global-account/react/utils/toast.ts +6 -0
  447. package/src/shared/constants/chains/supported.ts +4 -0
  448. package/src/shared/utils/ipfs.ts +10 -3
  449. package/src/styles/index.css +12 -1
  450. package/dist/cjs/global-account/react/components/ManageAccount/BalanceContent.d.ts +0 -7
  451. package/dist/cjs/global-account/react/components/ManageAccount/BalanceContent.js +0 -107
  452. package/dist/cjs/global-account/react/components/ProfileEditor/ProfileEditor.d.ts +0 -6
  453. package/dist/cjs/global-account/react/components/ProfileEditor/ProfileEditor.js +0 -151
  454. package/dist/esm/global-account/react/components/ManageAccount/BalanceContent.d.ts +0 -7
  455. package/dist/esm/global-account/react/components/ManageAccount/BalanceContent.js +0 -104
  456. package/dist/esm/global-account/react/components/ProfileEditor/ProfileEditor.d.ts +0 -6
  457. package/dist/esm/global-account/react/components/ProfileEditor/ProfileEditor.js +0 -145
  458. package/dist/types/global-account/react/components/ManageAccount/BalanceContent.d.ts +0 -7
  459. package/dist/types/global-account/react/components/ProfileEditor/ProfileEditor.d.ts +0 -6
  460. package/src/global-account/react/components/ManageAccount/BalanceContent.tsx +0 -258
  461. package/src/global-account/react/components/ProfileEditor/ProfileEditor.tsx +0 -279
@@ -0,0 +1,305 @@
1
+ import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
2
+
3
+ const debug = debugB3React("notificationsAPI");
4
+
5
+ const API_URL = "https://notifications.b3.fun";
6
+
7
+ export interface NotificationChannel {
8
+ id: number;
9
+ channel_type: "email" | "telegram" | "discord" | "sms" | "whatsapp" | "in_app";
10
+ enabled: number;
11
+ channel_identifier: string;
12
+ }
13
+
14
+ export interface UserData {
15
+ user: {
16
+ id: number;
17
+ user_id: string;
18
+ };
19
+ channels: NotificationChannel[];
20
+ appSettings: Array<{
21
+ app_id: string;
22
+ notification_type: string;
23
+ enabled: number;
24
+ channels: string;
25
+ }>;
26
+ }
27
+
28
+ export interface NotificationSettings {
29
+ notificationType: string;
30
+ channels: string[];
31
+ }
32
+
33
+ export const notificationsAPI = {
34
+ /**
35
+ * Register user (requires JWT)
36
+ */
37
+ async registerUser(jwtToken: string): Promise<UserData> {
38
+ const res = await fetch(`${API_URL}/users`, {
39
+ method: "POST",
40
+ headers: {
41
+ "Content-Type": "application/json",
42
+ Authorization: `Bearer ${jwtToken}`,
43
+ },
44
+ });
45
+ if (!res.ok) {
46
+ throw new Error(`Failed to register user: ${res.statusText}`);
47
+ }
48
+ return res.json();
49
+ },
50
+
51
+ /**
52
+ * Get user data (requires JWT)
53
+ */
54
+ async getUser(userId: string, jwtToken: string): Promise<UserData> {
55
+ const res = await fetch(`${API_URL}/users/${userId}`, {
56
+ headers: {
57
+ Authorization: `Bearer ${jwtToken}`,
58
+ },
59
+ });
60
+ if (!res.ok) {
61
+ throw new Error(`Failed to get user: ${res.statusText}`);
62
+ }
63
+ return res.json();
64
+ },
65
+
66
+ /**
67
+ * Connect email (requires JWT)
68
+ */
69
+ async connectEmail(userId: string, email: string, jwtToken: string): Promise<any> {
70
+ const res = await fetch(`${API_URL}/users/${userId}/channels`, {
71
+ method: "POST",
72
+ headers: {
73
+ "Content-Type": "application/json",
74
+ Authorization: `Bearer ${jwtToken}`,
75
+ },
76
+ body: JSON.stringify({
77
+ channelType: "email",
78
+ channelIdentifier: email,
79
+ enabled: true,
80
+ }),
81
+ });
82
+ if (!res.ok) {
83
+ throw new Error(`Failed to connect email: ${res.statusText}`);
84
+ }
85
+ return res.json();
86
+ },
87
+
88
+ /**
89
+ * Connect SMS (requires JWT)
90
+ */
91
+ async connectSMS(userId: string, phoneNumber: string, jwtToken: string): Promise<any> {
92
+ const res = await fetch(`${API_URL}/users/${userId}/channels`, {
93
+ method: "POST",
94
+ headers: {
95
+ "Content-Type": "application/json",
96
+ Authorization: `Bearer ${jwtToken}`,
97
+ },
98
+ body: JSON.stringify({
99
+ channelType: "sms",
100
+ channelIdentifier: phoneNumber,
101
+ enabled: true,
102
+ }),
103
+ });
104
+ if (!res.ok) {
105
+ throw new Error(`Failed to connect SMS: ${res.statusText}`);
106
+ }
107
+ return res.json();
108
+ },
109
+
110
+ /**
111
+ * Connect WhatsApp (requires JWT)
112
+ */
113
+ async connectWhatsApp(userId: string, phoneNumber: string, jwtToken: string): Promise<any> {
114
+ const res = await fetch(`${API_URL}/users/${userId}/channels`, {
115
+ method: "POST",
116
+ headers: {
117
+ "Content-Type": "application/json",
118
+ Authorization: `Bearer ${jwtToken}`,
119
+ },
120
+ body: JSON.stringify({
121
+ channelType: "whatsapp",
122
+ channelIdentifier: phoneNumber,
123
+ enabled: true,
124
+ }),
125
+ });
126
+ if (!res.ok) {
127
+ throw new Error(`Failed to connect WhatsApp: ${res.statusText}`);
128
+ }
129
+ return res.json();
130
+ },
131
+
132
+ /**
133
+ * Connect Discord (requires JWT)
134
+ */
135
+ async connectDiscord(userId: string, discordUserId: string, jwtToken: string): Promise<any> {
136
+ const res = await fetch(`${API_URL}/users/${userId}/channels`, {
137
+ method: "POST",
138
+ headers: {
139
+ "Content-Type": "application/json",
140
+ Authorization: `Bearer ${jwtToken}`,
141
+ },
142
+ body: JSON.stringify({
143
+ channelType: "discord",
144
+ channelIdentifier: discordUserId,
145
+ enabled: true,
146
+ }),
147
+ });
148
+ if (!res.ok) {
149
+ throw new Error(`Failed to connect Discord: ${res.statusText}`);
150
+ }
151
+ return res.json();
152
+ },
153
+
154
+ /**
155
+ * Disconnect a channel (requires JWT)
156
+ * Looks up the channel ID by type and deletes it
157
+ */
158
+ async disconnectChannel(userId: string, channelType: string, jwtToken: string): Promise<any> {
159
+ // First, get user data to find the channel ID
160
+ const userData = await this.getUser(userId, jwtToken);
161
+ const channel = userData.channels.find((c: NotificationChannel) => c.channel_type === channelType);
162
+
163
+ if (!channel) {
164
+ throw new Error(`Channel ${channelType} not found`);
165
+ }
166
+
167
+ // Delete using the channel ID
168
+ const res = await fetch(`${API_URL}/users/${userId}/channels/${channel.id}`, {
169
+ method: "DELETE",
170
+ headers: {
171
+ Authorization: `Bearer ${jwtToken}`,
172
+ },
173
+ });
174
+ if (!res.ok) {
175
+ throw new Error(`Failed to disconnect channel: ${res.statusText}`);
176
+ }
177
+ return res.json();
178
+ },
179
+
180
+ /**
181
+ * Get Telegram deep link (requires JWT)
182
+ */
183
+ async getTelegramLink(jwtToken: string): Promise<{ deepLink: string }> {
184
+ const res = await fetch(`${API_URL}/telegram/request-link`, {
185
+ method: "POST",
186
+ headers: {
187
+ "Content-Type": "application/json",
188
+ Authorization: `Bearer ${jwtToken}`,
189
+ },
190
+ });
191
+ if (!res.ok) {
192
+ throw new Error(`Failed to get Telegram link: ${res.statusText}`);
193
+ }
194
+ return res.json();
195
+ },
196
+
197
+ /**
198
+ * Check Telegram status (requires JWT)
199
+ */
200
+ async checkTelegramStatus(userId: string, jwtToken: string): Promise<{ connected: boolean }> {
201
+ const res = await fetch(`${API_URL}/telegram/status/${userId}`, {
202
+ headers: {
203
+ Authorization: `Bearer ${jwtToken}`,
204
+ },
205
+ });
206
+ if (!res.ok) {
207
+ throw new Error(`Failed to check Telegram status: ${res.statusText}`);
208
+ }
209
+ return res.json();
210
+ },
211
+
212
+ /**
213
+ * Save notification preferences (requires JWT)
214
+ */
215
+ async savePreferences(userId: string, appId: string, settings: NotificationSettings, jwtToken: string): Promise<any> {
216
+ const res = await fetch(`${API_URL}/users/${userId}/apps/${appId}/settings`, {
217
+ method: "POST",
218
+ headers: {
219
+ "Content-Type": "application/json",
220
+ Authorization: `Bearer ${jwtToken}`,
221
+ },
222
+ body: JSON.stringify({
223
+ ...settings,
224
+ enabled: true,
225
+ }),
226
+ });
227
+ if (!res.ok) {
228
+ throw new Error(`Failed to save preferences: ${res.statusText}`);
229
+ }
230
+ return res.json();
231
+ },
232
+
233
+ /**
234
+ * Ensure notification settings exist for a user/app/type combination
235
+ * Creates default settings if they don't exist
236
+ */
237
+ async ensureNotificationSettings(
238
+ userId: string,
239
+ appId: string,
240
+ notificationType: string,
241
+ jwtToken: string,
242
+ ): Promise<any> {
243
+ // Get user's connected channels
244
+ const userData = await this.getUser(userId, jwtToken);
245
+ const enabledChannels = userData.channels
246
+ .filter((c: NotificationChannel) => c.enabled === 1)
247
+ .map((c: NotificationChannel) => c.channel_type);
248
+
249
+ if (enabledChannels.length === 0) {
250
+ throw new Error("No channels connected");
251
+ }
252
+
253
+ // Create settings with all enabled channels
254
+ const res = await fetch(`${API_URL}/users/${userId}/apps/${appId}/settings`, {
255
+ method: "POST",
256
+ headers: {
257
+ "Content-Type": "application/json",
258
+ Authorization: `Bearer ${jwtToken}`,
259
+ },
260
+ body: JSON.stringify({
261
+ notificationType,
262
+ channels: enabledChannels,
263
+ enabled: true,
264
+ }),
265
+ });
266
+
267
+ if (!res.ok) {
268
+ throw new Error(`Failed to create notification settings: ${res.statusText}`);
269
+ }
270
+ return res.json();
271
+ },
272
+
273
+ /**
274
+ * Send a test notification (requires JWT)
275
+ * Automatically creates settings if they don't exist
276
+ */
277
+ async sendTestNotification(userId: string, appId: string, jwtToken: string): Promise<any> {
278
+ // Ensure settings exist for test notifications
279
+ try {
280
+ await this.ensureNotificationSettings(userId, appId, "general", jwtToken);
281
+ } catch (err: any) {
282
+ debug("Failed to ensure settings, trying to send anyway:", err);
283
+ }
284
+
285
+ const res = await fetch(`${API_URL}/send`, {
286
+ method: "POST",
287
+ headers: {
288
+ "Content-Type": "application/json",
289
+ Authorization: `Bearer ${jwtToken}`,
290
+ },
291
+ body: JSON.stringify({
292
+ userId,
293
+ appId,
294
+ notificationType: "general",
295
+ title: "Test Notification",
296
+ message:
297
+ "This is a test notification from B3. If you received this, your notifications are working correctly! 🎉",
298
+ }),
299
+ });
300
+ if (!res.ok) {
301
+ throw new Error(`Failed to send test notification: ${res.statusText}`);
302
+ }
303
+ return res.json();
304
+ },
305
+ };
@@ -64,6 +64,7 @@ export function validateImageUrl(url: string | null | undefined): string | null
64
64
  }
65
65
 
66
66
  export interface ExtendedProfileDetails {
67
+ fid?: string;
67
68
  id?: string;
68
69
  email?: string;
69
70
  phone?: string;
@@ -71,6 +72,8 @@ export interface ExtendedProfileDetails {
71
72
  name?: string;
72
73
  username?: string;
73
74
  profileImageUrl?: string;
75
+ picture?: string; // Google OAuth uses 'picture' field
76
+ pfpUrl?: string; // Farcaster uses 'pfpUrl' field
74
77
  }
75
78
 
76
79
  export interface ExtendedProfile extends Omit<Profile, "details"> {
@@ -86,7 +89,12 @@ export interface ProfileDisplayInfo {
86
89
  }
87
90
 
88
91
  export function getProfileDisplayInfo(profile: ExtendedProfile): ProfileDisplayInfo {
89
- const { type, details } = profile;
92
+ const { type: originalType, details } = profile;
93
+
94
+ let type = originalType as Profile["type"];
95
+ if (originalType === ("siwe" as any)) {
96
+ type = "EOA" as Profile["type"];
97
+ }
90
98
 
91
99
  // Default display info
92
100
  let displayInfo: ProfileDisplayInfo = {
@@ -110,9 +118,9 @@ export function getProfileDisplayInfo(profile: ExtendedProfile): ProfileDisplayI
110
118
  break;
111
119
  case "farcaster":
112
120
  displayInfo = {
113
- title: details.name || details.username || "Unknown",
121
+ title: details.name || details.username || "FID:" + details?.fid || "Unknown",
114
122
  subtitle: details.username ? `@${details.username}` : "Farcaster Account",
115
- imageUrl: validateImageUrl(details.profileImageUrl),
123
+ imageUrl: validateImageUrl(details.pfpUrl || details.profileImageUrl),
116
124
  initial: "F",
117
125
  type,
118
126
  };
@@ -121,7 +129,7 @@ export function getProfileDisplayInfo(profile: ExtendedProfile): ProfileDisplayI
121
129
  displayInfo = {
122
130
  title: details.name || details.email || "Unknown",
123
131
  subtitle: details.email || "Google Account",
124
- imageUrl: validateImageUrl(details.profileImageUrl),
132
+ imageUrl: validateImageUrl(details.picture || details.profileImageUrl),
125
133
  initial: "G",
126
134
  type,
127
135
  };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Re-export toast utilities for easy import
3
+ * This allows components to import toast from a central location
4
+ */
5
+ export { toast } from "../components/Toast/toastApi";
6
+ export type { ToastItem, ToastType } from "../components/Toast/ToastContext";
@@ -77,3 +77,7 @@ export function getThirdwebChain(chainId: number): ThirdwebChain {
77
77
  }
78
78
  return chain;
79
79
  }
80
+
81
+ export function getChainLogo(chainId: number): string {
82
+ return getThirdwebChain(chainId)?.icon?.url || "";
83
+ }
@@ -1,7 +1,14 @@
1
+ /**
2
+ * List of IPFS gateways to use for converting ipfs:// URLs to HTTP URLs
3
+ * These gateways must match the allowed list in profileDisplay.ts validateImageUrl()
4
+ */
1
5
  const IPFS_GATEWAYS = [
2
- "https://ipfs.io/ipfs",
3
- "https://cloudflare-ipfs.com/ipfs",
4
- // Can add more gateways as needed
6
+ "https://cloudflare-ipfs.com/ipfs", // Primary gateway - fast and reliable
7
+ "https://ipfs.io/ipfs", // Fallback gateway
8
+ "https://gateway.pinata.cloud/ipfs", // Additional option
9
+ "https://dweb.link/ipfs", // Additional option
10
+ "https://nftstorage.link/ipfs", // Additional option
11
+ "https://w3s.link/ipfs", // Additional option
5
12
  ] as const;
6
13
 
7
14
  /**
@@ -278,10 +278,15 @@ html[data-theme="dark"] .b3-root,
278
278
 
279
279
  /* Custom component styles */
280
280
  .b3-modal {
281
- @apply bg-b3-react-background text-b3-react-foreground rounded-2xl border;
281
+ @apply text-b3-react-foreground rounded-2xl border;
282
282
  border: 1px solid var(--border);
283
283
  overflow: hidden;
284
284
  outline: none;
285
+ padding: 10px;
286
+
287
+ @media (min-width: 768px) {
288
+ background: #e4e4e7;
289
+ }
285
290
  }
286
291
 
287
292
  .b3-modal-freestyle {
@@ -385,6 +390,8 @@ Dark version
385
390
  }
386
391
 
387
392
  .b3-login-step {
393
+ padding-bottom: 10px;
394
+
388
395
  & > div > div > div > div > div > div > div > img {
389
396
  display: none;
390
397
  }
@@ -665,3 +672,7 @@ Dark version
665
672
  .animate-accordion-up {
666
673
  animation: accordion-up 0.2s ease-out;
667
674
  }
675
+
676
+ .tw-header {
677
+ display: none !important; /* Hide the TW "BSMNT" header */
678
+ }
@@ -1,7 +0,0 @@
1
- interface BalanceContentProps {
2
- onLogout?: () => void;
3
- showDeposit?: boolean;
4
- showSwap?: boolean;
5
- }
6
- export declare function BalanceContent({ onLogout, showDeposit, showSwap }: BalanceContentProps): import("react/jsx-runtime").JSX.Element;
7
- export {};
@@ -1,107 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BalanceContent = BalanceContent;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("../../../../global-account/react");
6
- const BankIcon_1 = require("../../../../global-account/react/components/icons/BankIcon");
7
- const SignOutIcon_1 = require("../../../../global-account/react/components/icons/SignOutIcon");
8
- const SwapIcon_1 = require("../../../../global-account/react/components/icons/SwapIcon");
9
- const utils_1 = require("../../../../shared/utils");
10
- const ipfs_1 = require("../../../../shared/utils/ipfs");
11
- const lucide_react_1 = require("lucide-react");
12
- const react_2 = require("react");
13
- const react_3 = require("thirdweb/react");
14
- const useFirstEOA_1 = require("../../hooks/useFirstEOA");
15
- const TokenIcon_1 = require("../TokenIcon");
16
- const accordion_1 = require("../ui/accordion");
17
- const TokenBalanceRow_1 = require("./TokenBalanceRow");
18
- function centerTruncate(str, length = 4) {
19
- if (str.length <= length * 2)
20
- return str;
21
- return `${str.slice(0, length)}...${str.slice(-length)}`;
22
- }
23
- function BalanceContent({ onLogout, showDeposit = true, showSwap = true }) {
24
- const account = (0, react_3.useActiveAccount)();
25
- const globalAccount = (0, react_1.useGlobalAccount)();
26
- const { address: eoaAddress, info: eoaInfo } = (0, useFirstEOA_1.useFirstEOA)();
27
- const { data: profile } = (0, react_1.useProfile)({
28
- address: eoaAddress || account?.address,
29
- fresh: true,
30
- });
31
- const { user, partnerId } = (0, react_1.useB3)();
32
- const { setB3ModalOpen, setB3ModalContentType, navigateBack } = (0, react_1.useModalStore)();
33
- const { logout } = (0, react_1.useAuthentication)(partnerId);
34
- const [logoutLoading, setLogoutLoading] = (0, react_2.useState)(false);
35
- const [openAccordions, setOpenAccordions] = (0, react_2.useState)([]);
36
- const hasExpandedRef = (0, react_2.useRef)(false);
37
- const avatarUrl = user?.avatar ? (0, ipfs_1.getIpfsUrl)(user?.avatar) : profile?.avatar;
38
- const handleEditProfile = () => {
39
- setB3ModalOpen(true);
40
- setB3ModalContentType({
41
- type: "profileEditor",
42
- showBackButton: true,
43
- onSuccess: () => {
44
- // navigate back on success
45
- navigateBack();
46
- },
47
- });
48
- };
49
- console.log("eoaAddress", eoaAddress);
50
- console.log("account?.address", account?.address);
51
- console.log("globalAccount", globalAccount);
52
- // Balance data fetching
53
- const { data: eoaNativeBalance, isLoading: eoaNativeLoading } = (0, react_1.useNativeBalance)(eoaAddress);
54
- const { data: eoaB3Balance, isLoading: eoaB3Loading } = (0, react_1.useB3BalanceFromAddresses)(eoaAddress);
55
- const { data: b3Balance, isLoading: b3Loading } = (0, react_1.useB3BalanceFromAddresses)(globalAccount?.address);
56
- const { data: nativeBalance, isLoading: nativeLoading } = (0, react_1.useNativeBalance)(globalAccount?.address);
57
- // Calculate total USD values for comparison
58
- const globalAccountTotalUsd = (b3Balance?.balanceUsd || 0) + (nativeBalance?.totalUsd || 0);
59
- const eoaTotalUsd = (eoaB3Balance?.balanceUsd || 0) + (eoaNativeBalance?.totalUsd || 0);
60
- // Check if both data sets are ready (not loading and have data)
61
- const isGlobalDataReady = !b3Loading && !nativeLoading && b3Balance !== undefined && nativeBalance !== undefined;
62
- const isEoaDataReady = !eoaAddress || (!eoaB3Loading && !eoaNativeLoading && eoaB3Balance !== undefined && eoaNativeBalance !== undefined);
63
- const isBothDataReady = isGlobalDataReady && isEoaDataReady;
64
- // Reset expansion flag when component mounts
65
- (0, react_2.useEffect)(() => {
66
- hasExpandedRef.current = false;
67
- setOpenAccordions([]);
68
- }, []);
69
- // Auto-expand the appropriate section when data becomes ready
70
- (0, react_2.useEffect)(() => {
71
- if (isBothDataReady && !hasExpandedRef.current && eoaAddress && account?.address) {
72
- hasExpandedRef.current = true;
73
- // Determine which section to expand based on higher balance
74
- if (globalAccountTotalUsd === 0 && eoaTotalUsd === 0) {
75
- // If both have 0 balance, expand global account by default
76
- setOpenAccordions(["global-account"]);
77
- }
78
- else if (globalAccountTotalUsd >= eoaTotalUsd) {
79
- setOpenAccordions(["global-account"]);
80
- }
81
- else {
82
- setOpenAccordions(["eoa-account"]);
83
- }
84
- }
85
- }, [isBothDataReady, globalAccountTotalUsd, eoaTotalUsd, eoaAddress, account?.address]);
86
- const onLogoutEnhanced = async () => {
87
- setLogoutLoading(true);
88
- await logout();
89
- onLogout?.();
90
- setB3ModalOpen(false);
91
- setLogoutLoading(false);
92
- };
93
- return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-between", children: (0, jsx_runtime_1.jsxs)("div", { className: "global-account-profile flex items-center gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "global-account-profile-avatar relative", children: [avatarUrl ? ((0, jsx_runtime_1.jsx)("img", { src: avatarUrl, alt: "Profile", className: "size-24 rounded-full" })) : ((0, jsx_runtime_1.jsx)("div", { className: "bg-b3-primary-wash size-24 rounded-full" })), (0, jsx_runtime_1.jsx)("button", { onClick: handleEditProfile, className: "bg-b3-grey border-b3-background hover:bg-b3-grey/80 absolute -bottom-1 -right-1 flex size-8 items-center justify-center rounded-full border-4 transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Pencil, { size: 16, className: "text-b3-background" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "global-account-profile-info", children: [(0, jsx_runtime_1.jsx)("h2", { className: "text-b3-grey text-xl font-semibold", children: user?.username || profile?.displayName || (0, utils_1.formatUsername)(profile?.name || "") }), (0, jsx_runtime_1.jsxs)("div", { className: "address-button border-b3-line bg-b3-line/20 hover:bg-b3-line/40 flex w-fit items-center gap-2 rounded-full border px-3 py-1 transition-colors", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-b3-foreground-muted font-mono text-xs", children: centerTruncate(account?.address || "", 6) }), (0, jsx_runtime_1.jsx)(react_1.CopyToClipboard, { text: account?.address || "" })] })] })] }) }), (showDeposit || showSwap) && ((0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [showDeposit && ((0, jsx_runtime_1.jsxs)(react_1.Button, { className: "manage-account-deposit bg-b3-primary-wash hover:bg-b3-primary-wash/70 h-[84px] w-full flex-col items-start gap-2 rounded-2xl", onClick: () => {
94
- setB3ModalOpen(true);
95
- setB3ModalContentType({
96
- type: "anySpend",
97
- defaultActiveTab: "fiat",
98
- showBackButton: true,
99
- });
100
- }, children: [(0, jsx_runtime_1.jsx)(BankIcon_1.BankIcon, { size: 24, className: "text-b3-primary-blue shrink-0" }), (0, jsx_runtime_1.jsx)("div", { className: "text-b3-grey font-neue-montreal-semibold", children: "Deposit" })] })), showSwap && ((0, jsx_runtime_1.jsxs)(react_1.Button, { className: "manage-account-swap bg-b3-primary-wash hover:bg-b3-primary-wash/70 flex h-[84px] w-full flex-col items-start gap-2 rounded-2xl", onClick: () => {
101
- setB3ModalOpen(true);
102
- setB3ModalContentType({
103
- type: "anySpend",
104
- showBackButton: true,
105
- });
106
- }, children: [(0, jsx_runtime_1.jsx)(SwapIcon_1.SwapIcon, { size: 24, className: "text-b3-primary-blue" }), (0, jsx_runtime_1.jsx)("div", { className: "text-b3-grey font-neue-montreal-semibold", children: "Swap" })] }))] })), (0, jsx_runtime_1.jsxs)(accordion_1.Accordion, { type: "multiple", value: openAccordions, onValueChange: setOpenAccordions, className: "space-y-2", children: [(0, jsx_runtime_1.jsxs)(accordion_1.AccordionItem, { value: "global-account", className: "border-none", children: [(0, jsx_runtime_1.jsx)(accordion_1.AccordionTrigger, { className: "text-b3-grey font-neue-montreal-semibold py-2 hover:no-underline", children: (0, jsx_runtime_1.jsx)("span", { children: "Smart Account Balance" }) }), (0, jsx_runtime_1.jsxs)(accordion_1.AccordionContent, { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)(TokenBalanceRow_1.TokenBalanceRow, { icon: (0, jsx_runtime_1.jsx)(TokenIcon_1.B3TokenIcon, { className: "size-10" }), name: "B3", balance: `${b3Balance?.formattedTotal || "0.00"} B3`, usdValue: b3Balance?.balanceUsdFormatted || "0.00", priceChange: b3Balance?.priceChange24h }), (0, jsx_runtime_1.jsx)(TokenBalanceRow_1.TokenBalanceRow, { icon: (0, jsx_runtime_1.jsx)(TokenIcon_1.EthereumTokenIcon, { className: "size-10" }), name: "Ethereum", balance: `${nativeBalance?.formattedTotal || "0.00"} ETH`, usdValue: nativeBalance?.formattedTotalUsd || "0.00", priceChange: nativeBalance?.priceChange24h })] })] }), eoaAddress && ((0, jsx_runtime_1.jsxs)(accordion_1.AccordionItem, { value: "eoa-account", className: "border-none", children: [(0, jsx_runtime_1.jsx)(accordion_1.AccordionTrigger, { className: "text-b3-grey font-neue-montreal-semibold py-2 hover:no-underline", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("span", { children: eoaInfo?.data?.name || "Wallet" }), (0, jsx_runtime_1.jsxs)("div", { className: "address-button border-b3-line bg-b3-line/20 hover:bg-b3-line/40 flex w-fit items-center gap-2 rounded-full border px-3 py-1 transition-colors", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-b3-foreground-muted font-mono text-xs", children: centerTruncate(eoaAddress, 6) }), (0, jsx_runtime_1.jsx)(react_1.CopyToClipboard, { text: eoaAddress })] })] }) }), (0, jsx_runtime_1.jsxs)(accordion_1.AccordionContent, { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)(TokenBalanceRow_1.TokenBalanceRow, { icon: (0, jsx_runtime_1.jsx)(TokenIcon_1.B3TokenIcon, { className: "size-10" }), name: "B3", balance: `${eoaB3Balance?.formattedTotal || "0.00"} B3`, usdValue: eoaB3Balance?.balanceUsdFormatted || "0.00", priceChange: eoaB3Balance?.priceChange24h }), (0, jsx_runtime_1.jsx)(TokenBalanceRow_1.TokenBalanceRow, { icon: (0, jsx_runtime_1.jsx)(TokenIcon_1.EthereumTokenIcon, { className: "size-10" }), name: "Ethereum", balance: `${eoaNativeBalance?.formattedTotal || "0.00"} ETH`, usdValue: eoaNativeBalance?.formattedTotalUsd || "0.00", priceChange: eoaNativeBalance?.priceChange24h })] })] }))] }), (0, jsx_runtime_1.jsxs)("button", { className: "logout-button border-b3-line hover:bg-b3-line relative flex w-full items-center justify-center rounded-2xl border p-4 transition-colors", onClick: onLogoutEnhanced, children: [(0, jsx_runtime_1.jsx)("span", { className: "font-neue-montreal-semibold text-b3-grey", children: "Sign out" }), (0, jsx_runtime_1.jsx)("div", { className: "absolute right-4", children: logoutLoading ? ((0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "animate-spin", size: 16 })) : ((0, jsx_runtime_1.jsx)(SignOutIcon_1.SignOutIcon, { size: 16, className: "text-b3-grey" })) })] })] }));
107
- }
@@ -1,6 +0,0 @@
1
- interface ProfileEditorProps {
2
- onSuccess?: () => void;
3
- className?: string;
4
- }
5
- export declare function ProfileEditor({ onSuccess, className }: ProfileEditorProps): import("react/jsx-runtime").JSX.Element;
6
- export {};