@b3dotfun/sdk 0.1.69-alpha.8 → 0.1.69-test.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 (286) hide show
  1. package/dist/cjs/anyspend/constants/rpc.d.ts +1 -1
  2. package/dist/cjs/anyspend/constants/rpc.js +1 -1
  3. package/dist/cjs/anyspend/react/components/AnySpendNFT.js +2 -2
  4. package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckout.d.ts +3 -1
  5. package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckout.js +10 -2
  6. package/dist/cjs/anyspend/react/components/checkout/CheckoutSuccess.js +3 -3
  7. package/dist/cjs/anyspend/react/components/checkout/CryptoPayPanel.js +43 -23
  8. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.d.ts +8 -0
  9. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +10 -9
  10. package/dist/cjs/anyspend/react/components/common/InsufficientDepositPayment.js +2 -2
  11. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +2 -2
  12. package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +2 -2
  13. package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.js +2 -2
  14. package/dist/cjs/anyspend/utils/chain.js +8 -7
  15. package/dist/cjs/app.shared.js +9 -7
  16. package/dist/cjs/global-account/better-auth-client.d.ts +1883 -0
  17. package/dist/cjs/global-account/better-auth-client.js +17 -0
  18. package/dist/cjs/global-account/bsmnt.d.ts +0 -1
  19. package/dist/cjs/global-account/bsmnt.js +0 -6
  20. package/dist/cjs/global-account/react/components/B3DynamicModal.js +3 -0
  21. package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +4 -1
  22. package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.js +2 -1
  23. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +8 -1
  24. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +9 -12
  25. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +6 -9
  26. package/dist/cjs/global-account/react/components/B3Provider/BetterAuthProvider.d.ts +16 -0
  27. package/dist/cjs/global-account/react/components/B3Provider/BetterAuthProvider.js +120 -0
  28. package/dist/cjs/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +3 -1
  29. package/dist/cjs/global-account/react/components/B3Provider/LocalSDKProvider.js +3 -1
  30. package/dist/cjs/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +3 -1
  31. package/dist/cjs/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +4 -2
  32. package/dist/cjs/global-account/react/components/LinkAccount/LinkedAccountItem.js +2 -1
  33. package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +15 -6
  34. package/dist/cjs/global-account/react/components/ManageAccount/SessionDurationContent.d.ts +5 -0
  35. package/dist/cjs/global-account/react/components/ManageAccount/SessionDurationContent.js +57 -0
  36. package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.js +12 -29
  37. package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +2 -2
  38. package/dist/cjs/global-account/react/components/Send/Send.js +5 -2
  39. package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthResetPassword.d.ts +21 -0
  40. package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthResetPassword.js +67 -0
  41. package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthSignIn.d.ts +34 -0
  42. package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +163 -0
  43. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +13 -4
  44. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.d.ts +6 -0
  45. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +138 -0
  46. package/dist/cjs/global-account/react/components/SignInWithB3/utils/signInUtils.js +5 -1
  47. package/dist/cjs/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.js +2 -1
  48. package/dist/cjs/global-account/react/components/custom/Button.d.ts +1 -1
  49. package/dist/cjs/global-account/react/components/index.d.ts +3 -0
  50. package/dist/cjs/global-account/react/components/index.js +7 -3
  51. package/dist/cjs/global-account/react/components/ui/button.d.ts +1 -1
  52. package/dist/cjs/global-account/react/hooks/index.d.ts +1 -0
  53. package/dist/cjs/global-account/react/hooks/index.js +5 -2
  54. package/dist/cjs/global-account/react/hooks/useAuth.js +24 -11
  55. package/dist/cjs/global-account/react/hooks/useAuthentication.js +21 -8
  56. package/dist/cjs/global-account/react/hooks/useBetterAuth.d.ts +973 -0
  57. package/dist/cjs/global-account/react/hooks/useBetterAuth.js +157 -0
  58. package/dist/cjs/global-account/react/hooks/useFirstEOA.d.ts +8 -8
  59. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +10 -1
  60. package/dist/cjs/global-account/react/utils/createWagmiConfig.d.ts +4 -13
  61. package/dist/cjs/global-account/react/utils/createWagmiConfig.js +5 -7
  62. package/dist/cjs/global-account/react/utils/index.d.ts +0 -1
  63. package/dist/cjs/global-account/react/utils/index.js +0 -1
  64. package/dist/cjs/global-account/react/utils/profileDisplay.js +17 -18
  65. package/dist/cjs/shared/constants/chains/b3Chain.d.ts +7 -7
  66. package/dist/cjs/shared/constants/chains/b3Chain.js +4 -4
  67. package/dist/cjs/shared/constants/chains/b3Viem.d.ts +6 -0
  68. package/dist/cjs/shared/constants/chains/b3Viem.js +19 -0
  69. package/dist/cjs/shared/constants/chains/supported.d.ts +1 -1
  70. package/dist/cjs/shared/generated/chain-networks.json +2 -2
  71. package/dist/cjs/shared/utils/chains.d.ts +1 -1
  72. package/dist/cjs/shared/utils/chains.js +2 -2
  73. package/dist/cjs/shared/utils/session-duration.d.ts +15 -0
  74. package/dist/cjs/shared/utils/session-duration.js +69 -0
  75. package/dist/cjs/wallet/react/components/ConnectWallet.d.ts +11 -0
  76. package/dist/cjs/wallet/react/components/ConnectWallet.js +467 -0
  77. package/dist/cjs/wallet/react/components/WalletProvider.d.ts +35 -0
  78. package/dist/cjs/wallet/react/components/WalletProvider.js +20 -0
  79. package/dist/cjs/wallet/react/hooks/useWalletDisconnect.d.ts +13 -0
  80. package/dist/cjs/wallet/react/hooks/useWalletDisconnect.js +22 -0
  81. package/dist/cjs/wallet/react/hooks/useWalletState.d.ts +31 -0
  82. package/dist/cjs/wallet/react/hooks/useWalletState.js +63 -0
  83. package/dist/cjs/wallet/react/index.d.ts +5 -0
  84. package/dist/cjs/wallet/react/index.js +16 -0
  85. package/dist/cjs/wallet/utils/createWalletConfig.d.ts +21 -0
  86. package/dist/cjs/wallet/utils/createWalletConfig.js +24 -0
  87. package/dist/esm/anyspend/constants/rpc.d.ts +1 -1
  88. package/dist/esm/anyspend/constants/rpc.js +1 -1
  89. package/dist/esm/anyspend/react/components/AnySpendNFT.js +2 -2
  90. package/dist/esm/anyspend/react/components/checkout/AnySpendCheckout.d.ts +3 -1
  91. package/dist/esm/anyspend/react/components/checkout/AnySpendCheckout.js +10 -2
  92. package/dist/esm/anyspend/react/components/checkout/CheckoutSuccess.js +3 -3
  93. package/dist/esm/anyspend/react/components/checkout/CryptoPayPanel.js +44 -24
  94. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.d.ts +8 -0
  95. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +9 -8
  96. package/dist/esm/anyspend/react/components/common/InsufficientDepositPayment.js +2 -2
  97. package/dist/esm/anyspend/react/components/common/OrderDetails.js +2 -2
  98. package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +2 -2
  99. package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.js +2 -2
  100. package/dist/esm/anyspend/utils/chain.js +10 -9
  101. package/dist/esm/app.shared.js +9 -7
  102. package/dist/esm/global-account/better-auth-client.d.ts +1883 -0
  103. package/dist/esm/global-account/better-auth-client.js +13 -0
  104. package/dist/esm/global-account/bsmnt.d.ts +0 -1
  105. package/dist/esm/global-account/bsmnt.js +0 -5
  106. package/dist/esm/global-account/react/components/B3DynamicModal.js +3 -0
  107. package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +4 -1
  108. package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.js +2 -1
  109. package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +8 -1
  110. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +4 -7
  111. package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +2 -5
  112. package/dist/esm/global-account/react/components/B3Provider/BetterAuthProvider.d.ts +16 -0
  113. package/dist/esm/global-account/react/components/B3Provider/BetterAuthProvider.js +115 -0
  114. package/dist/esm/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +3 -1
  115. package/dist/esm/global-account/react/components/B3Provider/LocalSDKProvider.js +3 -1
  116. package/dist/esm/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +3 -1
  117. package/dist/esm/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +4 -2
  118. package/dist/esm/global-account/react/components/LinkAccount/LinkedAccountItem.js +2 -1
  119. package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +13 -7
  120. package/dist/esm/global-account/react/components/ManageAccount/SessionDurationContent.d.ts +5 -0
  121. package/dist/esm/global-account/react/components/ManageAccount/SessionDurationContent.js +52 -0
  122. package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.js +12 -29
  123. package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +2 -2
  124. package/dist/esm/global-account/react/components/Send/Send.js +5 -2
  125. package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthResetPassword.d.ts +21 -0
  126. package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthResetPassword.js +64 -0
  127. package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthSignIn.d.ts +34 -0
  128. package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +160 -0
  129. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +13 -4
  130. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.d.ts +6 -0
  131. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +135 -0
  132. package/dist/esm/global-account/react/components/SignInWithB3/utils/signInUtils.js +5 -1
  133. package/dist/esm/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.js +2 -1
  134. package/dist/esm/global-account/react/components/custom/Button.d.ts +1 -1
  135. package/dist/esm/global-account/react/components/index.d.ts +3 -0
  136. package/dist/esm/global-account/react/components/index.js +2 -0
  137. package/dist/esm/global-account/react/components/ui/button.d.ts +1 -1
  138. package/dist/esm/global-account/react/hooks/index.d.ts +1 -0
  139. package/dist/esm/global-account/react/hooks/index.js +1 -0
  140. package/dist/esm/global-account/react/hooks/useAuth.js +24 -11
  141. package/dist/esm/global-account/react/hooks/useAuthentication.js +21 -8
  142. package/dist/esm/global-account/react/hooks/useBetterAuth.d.ts +973 -0
  143. package/dist/esm/global-account/react/hooks/useBetterAuth.js +149 -0
  144. package/dist/esm/global-account/react/hooks/useFirstEOA.d.ts +8 -8
  145. package/dist/esm/global-account/react/stores/useModalStore.d.ts +10 -1
  146. package/dist/esm/global-account/react/utils/createWagmiConfig.d.ts +4 -13
  147. package/dist/esm/global-account/react/utils/createWagmiConfig.js +5 -7
  148. package/dist/esm/global-account/react/utils/index.d.ts +0 -1
  149. package/dist/esm/global-account/react/utils/index.js +0 -1
  150. package/dist/esm/global-account/react/utils/profileDisplay.js +17 -18
  151. package/dist/esm/shared/constants/chains/b3Chain.d.ts +7 -7
  152. package/dist/esm/shared/constants/chains/b3Chain.js +4 -4
  153. package/dist/esm/shared/constants/chains/b3Viem.d.ts +6 -0
  154. package/dist/esm/shared/constants/chains/b3Viem.js +16 -0
  155. package/dist/esm/shared/constants/chains/supported.d.ts +1 -1
  156. package/dist/esm/shared/generated/chain-networks.json +2 -2
  157. package/dist/esm/shared/utils/chains.d.ts +1 -1
  158. package/dist/esm/shared/utils/chains.js +2 -2
  159. package/dist/esm/shared/utils/session-duration.d.ts +15 -0
  160. package/dist/esm/shared/utils/session-duration.js +64 -0
  161. package/dist/esm/wallet/react/components/ConnectWallet.d.ts +11 -0
  162. package/dist/esm/wallet/react/components/ConnectWallet.js +431 -0
  163. package/dist/esm/wallet/react/components/WalletProvider.d.ts +35 -0
  164. package/dist/esm/wallet/react/components/WalletProvider.js +17 -0
  165. package/dist/esm/wallet/react/hooks/useWalletDisconnect.d.ts +13 -0
  166. package/dist/esm/wallet/react/hooks/useWalletDisconnect.js +19 -0
  167. package/dist/esm/wallet/react/hooks/useWalletState.d.ts +31 -0
  168. package/dist/esm/wallet/react/hooks/useWalletState.js +60 -0
  169. package/dist/esm/wallet/react/index.d.ts +5 -0
  170. package/dist/esm/wallet/react/index.js +8 -0
  171. package/dist/esm/wallet/utils/createWalletConfig.d.ts +21 -0
  172. package/dist/esm/wallet/utils/createWalletConfig.js +21 -0
  173. package/dist/styles/index.css +1 -1
  174. package/dist/types/anyspend/constants/rpc.d.ts +1 -1
  175. package/dist/types/anyspend/react/components/checkout/AnySpendCheckout.d.ts +3 -1
  176. package/dist/types/anyspend/react/components/common/CryptoPaymentMethod.d.ts +8 -0
  177. package/dist/types/global-account/better-auth-client.d.ts +1883 -0
  178. package/dist/types/global-account/bsmnt.d.ts +0 -1
  179. package/dist/types/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +4 -1
  180. package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +8 -1
  181. package/dist/types/global-account/react/components/B3Provider/BetterAuthProvider.d.ts +16 -0
  182. package/dist/types/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +3 -1
  183. package/dist/types/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +3 -1
  184. package/dist/types/global-account/react/components/ManageAccount/SessionDurationContent.d.ts +5 -0
  185. package/dist/types/global-account/react/components/SignInWithB3/BetterAuthResetPassword.d.ts +21 -0
  186. package/dist/types/global-account/react/components/SignInWithB3/BetterAuthSignIn.d.ts +34 -0
  187. package/dist/types/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.d.ts +6 -0
  188. package/dist/types/global-account/react/components/custom/Button.d.ts +1 -1
  189. package/dist/types/global-account/react/components/index.d.ts +3 -0
  190. package/dist/types/global-account/react/components/ui/button.d.ts +1 -1
  191. package/dist/types/global-account/react/hooks/index.d.ts +1 -0
  192. package/dist/types/global-account/react/hooks/useBetterAuth.d.ts +973 -0
  193. package/dist/types/global-account/react/hooks/useFirstEOA.d.ts +8 -8
  194. package/dist/types/global-account/react/stores/useModalStore.d.ts +10 -1
  195. package/dist/types/global-account/react/utils/createWagmiConfig.d.ts +4 -13
  196. package/dist/types/global-account/react/utils/index.d.ts +0 -1
  197. package/dist/types/shared/constants/chains/b3Chain.d.ts +7 -7
  198. package/dist/types/shared/constants/chains/b3Viem.d.ts +6 -0
  199. package/dist/types/shared/constants/chains/supported.d.ts +1 -1
  200. package/dist/types/shared/utils/chains.d.ts +1 -1
  201. package/dist/types/shared/utils/session-duration.d.ts +15 -0
  202. package/dist/types/wallet/react/components/ConnectWallet.d.ts +11 -0
  203. package/dist/types/wallet/react/components/WalletProvider.d.ts +35 -0
  204. package/dist/types/wallet/react/hooks/useWalletDisconnect.d.ts +13 -0
  205. package/dist/types/wallet/react/hooks/useWalletState.d.ts +31 -0
  206. package/dist/types/wallet/react/index.d.ts +5 -0
  207. package/dist/types/wallet/utils/createWalletConfig.d.ts +21 -0
  208. package/package.json +14 -6
  209. package/src/anyspend/constants/rpc.ts +2 -1
  210. package/src/anyspend/react/components/AnySpendNFT.tsx +2 -2
  211. package/src/anyspend/react/components/checkout/AnySpendCheckout.tsx +15 -1
  212. package/src/anyspend/react/components/checkout/CheckoutSuccess.tsx +3 -3
  213. package/src/anyspend/react/components/checkout/CryptoPayPanel.tsx +45 -27
  214. package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +10 -8
  215. package/src/anyspend/react/components/common/InsufficientDepositPayment.tsx +2 -2
  216. package/src/anyspend/react/components/common/OrderDetails.tsx +2 -2
  217. package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +4 -4
  218. package/src/anyspend/react/components/common/TransferCryptoDetails.tsx +2 -2
  219. package/src/anyspend/utils/chain.ts +9 -9
  220. package/src/app.shared.ts +9 -8
  221. package/src/global-account/better-auth-client.ts +17 -0
  222. package/src/global-account/bsmnt.ts +0 -6
  223. package/src/global-account/react/components/B3DynamicModal.tsx +3 -0
  224. package/src/global-account/react/components/B3Provider/B3ConfigProvider.tsx +6 -0
  225. package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +14 -20
  226. package/src/global-account/react/components/B3Provider/B3Provider.tsx +52 -40
  227. package/src/global-account/react/components/B3Provider/BetterAuthProvider.tsx +127 -0
  228. package/src/global-account/react/components/B3Provider/LocalSDKProvider.tsx +5 -0
  229. package/src/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.tsx +17 -10
  230. package/src/global-account/react/components/LinkAccount/LinkedAccountItem.tsx +2 -1
  231. package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +29 -11
  232. package/src/global-account/react/components/ManageAccount/SessionDurationContent.tsx +107 -0
  233. package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +28 -30
  234. package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +2 -2
  235. package/src/global-account/react/components/Send/Send.tsx +8 -5
  236. package/src/global-account/react/components/SignInWithB3/BetterAuthResetPassword.tsx +146 -0
  237. package/src/global-account/react/components/SignInWithB3/BetterAuthSignIn.tsx +426 -0
  238. package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +13 -4
  239. package/src/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.tsx +308 -0
  240. package/src/global-account/react/components/SignInWithB3/utils/signInUtils.ts +5 -1
  241. package/src/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.tsx +2 -1
  242. package/src/global-account/react/components/index.ts +3 -0
  243. package/src/global-account/react/hooks/index.ts +1 -0
  244. package/src/global-account/react/hooks/useAuth.ts +24 -11
  245. package/src/global-account/react/hooks/useAuthentication.ts +21 -8
  246. package/src/global-account/react/hooks/useBetterAuth.ts +191 -0
  247. package/src/global-account/react/stores/useModalStore.ts +11 -0
  248. package/src/global-account/react/utils/createWagmiConfig.tsx +6 -7
  249. package/src/global-account/react/utils/index.ts +0 -1
  250. package/src/global-account/react/utils/profileDisplay.ts +21 -19
  251. package/src/shared/constants/chains/b3Chain.ts +5 -5
  252. package/src/shared/constants/chains/b3Viem.ts +18 -0
  253. package/src/shared/generated/chain-networks.json +2 -2
  254. package/src/shared/utils/chains.ts +3 -2
  255. package/src/shared/utils/session-duration.ts +64 -0
  256. package/src/wallet/__tests__/createWalletConfig.test.ts +39 -0
  257. package/src/wallet/react/components/ConnectWallet.tsx +665 -0
  258. package/src/wallet/react/components/WalletProvider.tsx +64 -0
  259. package/src/wallet/react/hooks/useWalletDisconnect.ts +22 -0
  260. package/src/wallet/react/hooks/useWalletState.ts +93 -0
  261. package/src/wallet/react/index.ts +10 -0
  262. package/src/wallet/utils/createWalletConfig.ts +39 -0
  263. package/dist/cjs/global-account/react/components/AvatarCreator/AvatarCreator.d.ts +0 -6
  264. package/dist/cjs/global-account/react/components/AvatarCreator/AvatarCreator.js +0 -54
  265. package/dist/cjs/global-account/react/components/ProfileAvatar.d.ts +0 -0
  266. package/dist/cjs/global-account/react/components/ProfileAvatar.js +0 -127
  267. package/dist/cjs/global-account/react/hooks/useRPMToken.d.ts +0 -7
  268. package/dist/cjs/global-account/react/hooks/useRPMToken.js +0 -11
  269. package/dist/cjs/global-account/react/utils/updateAvatar.d.ts +0 -4
  270. package/dist/cjs/global-account/react/utils/updateAvatar.js +0 -54
  271. package/dist/esm/global-account/react/components/AvatarCreator/AvatarCreator.d.ts +0 -6
  272. package/dist/esm/global-account/react/components/AvatarCreator/AvatarCreator.js +0 -51
  273. package/dist/esm/global-account/react/components/ProfileAvatar.d.ts +0 -0
  274. package/dist/esm/global-account/react/components/ProfileAvatar.js +0 -127
  275. package/dist/esm/global-account/react/hooks/useRPMToken.d.ts +0 -7
  276. package/dist/esm/global-account/react/hooks/useRPMToken.js +0 -8
  277. package/dist/esm/global-account/react/utils/updateAvatar.d.ts +0 -4
  278. package/dist/esm/global-account/react/utils/updateAvatar.js +0 -18
  279. package/dist/types/global-account/react/components/AvatarCreator/AvatarCreator.d.ts +0 -6
  280. package/dist/types/global-account/react/components/ProfileAvatar.d.ts +0 -0
  281. package/dist/types/global-account/react/hooks/useRPMToken.d.ts +0 -7
  282. package/dist/types/global-account/react/utils/updateAvatar.d.ts +0 -4
  283. package/src/global-account/react/components/AvatarCreator/AvatarCreator.tsx +0 -90
  284. package/src/global-account/react/components/ProfileAvatar.tsx +0 -138
  285. package/src/global-account/react/hooks/useRPMToken.ts +0 -17
  286. package/src/global-account/react/utils/updateAvatar.ts +0 -21
@@ -0,0 +1,157 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.EmailVerificationRequiredError = void 0;
7
+ exports.useBetterAuth = useBetterAuth;
8
+ const app_1 = __importDefault(require("../../../global-account/app"));
9
+ const react_1 = require("../../../global-account/react");
10
+ const debug_1 = require("../../../shared/utils/debug");
11
+ const react_2 = require("react");
12
+ const better_auth_client_1 = require("../../better-auth-client");
13
+ const useUserQuery_1 = require("./useUserQuery");
14
+ const debug = (0, debug_1.debugB3React)("useBetterAuth");
15
+ /** Thrown when email verification is required before the user can sign in. */
16
+ class EmailVerificationRequiredError extends Error {
17
+ constructor(message = "Check your email to verify your account before signing in.") {
18
+ super(message);
19
+ this.name = "EmailVerificationRequiredError";
20
+ }
21
+ }
22
+ exports.EmailVerificationRequiredError = EmailVerificationRequiredError;
23
+ /**
24
+ * Hook for authentication via Better Auth (email/password + social providers).
25
+ *
26
+ * Follows the same pattern as Thirdweb auth:
27
+ * 1. Better Auth sign-in returns a session token
28
+ * 2. Token is passed as accessToken to app.authenticate({ strategy: "better-auth" })
29
+ * 3. BetterAuthStrategy verifies the token and issues a Feathers JWT
30
+ */
31
+ function useBetterAuth() {
32
+ const { partnerId } = (0, react_1.useB3Config)();
33
+ const { setUser } = (0, useUserQuery_1.useUserQuery)();
34
+ const setIsAuthenticated = (0, react_1.useAuthStore)(state => state.setIsAuthenticated);
35
+ const setIsAuthenticating = (0, react_1.useAuthStore)(state => state.setIsAuthenticating);
36
+ const setIsConnected = (0, react_1.useAuthStore)(state => state.setIsConnected);
37
+ const setHasStartedConnecting = (0, react_1.useAuthStore)(state => state.setHasStartedConnecting);
38
+ const exchangeForFeathersJWT = (0, react_2.useCallback)(async (sessionToken) => {
39
+ debug("Exchanging Better Auth token for Feathers JWT");
40
+ const response = await app_1.default.authenticate({
41
+ strategy: "better-auth",
42
+ accessToken: sessionToken,
43
+ partnerId,
44
+ });
45
+ if (!response.user) {
46
+ throw new Error("No user returned from authentication");
47
+ }
48
+ setUser(response.user);
49
+ setIsAuthenticated(true);
50
+ setIsConnected(true);
51
+ setIsAuthenticating(false);
52
+ debug("Feathers JWT exchange successful", { userId: response.user?.userId });
53
+ return response;
54
+ }, [partnerId, setUser, setIsAuthenticated, setIsConnected, setIsAuthenticating]);
55
+ const signInWithEmail = (0, react_2.useCallback)(async (email, password) => {
56
+ debug("Signing in with email", { email });
57
+ setHasStartedConnecting(true);
58
+ setIsAuthenticating(true);
59
+ try {
60
+ const result = await better_auth_client_1.betterAuthClient.signIn.email({ email, password });
61
+ if (result.error) {
62
+ throw new Error(result.error.message || "Sign in failed");
63
+ }
64
+ const token = result.data?.token;
65
+ if (!token) {
66
+ throw new Error("No session token returned from sign in");
67
+ }
68
+ return await exchangeForFeathersJWT(token);
69
+ }
70
+ catch (error) {
71
+ setIsAuthenticating(false);
72
+ debug("Sign in failed", error);
73
+ throw error;
74
+ }
75
+ }, [exchangeForFeathersJWT, setIsAuthenticating, setHasStartedConnecting]);
76
+ const signUpWithEmail = (0, react_2.useCallback)(async (email, password, name) => {
77
+ debug("Signing up with email", { email, name });
78
+ setHasStartedConnecting(true);
79
+ setIsAuthenticating(true);
80
+ try {
81
+ const result = await better_auth_client_1.betterAuthClient.signUp.email({ email, password, name });
82
+ if (result.error) {
83
+ throw new Error(result.error.message || "Sign up failed");
84
+ }
85
+ const token = result.data?.token;
86
+ if (!token) {
87
+ // requireEmailVerification is enabled — send verification email
88
+ // with the client's origin as callbackURL so the user returns here
89
+ await better_auth_client_1.betterAuthClient.sendVerificationEmail({
90
+ email,
91
+ callbackURL: `${window.location.origin}?authStrategy=better-auth`,
92
+ });
93
+ throw new EmailVerificationRequiredError();
94
+ }
95
+ return await exchangeForFeathersJWT(token);
96
+ }
97
+ catch (error) {
98
+ setIsAuthenticating(false);
99
+ debug("Sign up failed", error);
100
+ throw error;
101
+ }
102
+ }, [exchangeForFeathersJWT, setIsAuthenticating, setHasStartedConnecting]);
103
+ const signInWithSocial = (0, react_2.useCallback)(async (provider) => {
104
+ debug("Signing in with social provider", { provider });
105
+ setHasStartedConnecting(true);
106
+ setIsAuthenticating(true);
107
+ try {
108
+ const result = await better_auth_client_1.betterAuthClient.signIn.social({
109
+ provider,
110
+ callbackURL: window.location.href,
111
+ });
112
+ if (result.error) {
113
+ throw new Error(result.error.message || `${provider} sign in failed`);
114
+ }
115
+ // Social auth redirects to provider — JWT exchange happens on callback
116
+ // via BetterAuthProvider session restore
117
+ }
118
+ catch (error) {
119
+ setIsAuthenticating(false);
120
+ debug("Social sign in failed", error);
121
+ throw error;
122
+ }
123
+ }, [setIsAuthenticating, setHasStartedConnecting]);
124
+ const requestPasswordReset = (0, react_2.useCallback)(async (email, redirectTo) => {
125
+ debug("Requesting password reset", { email });
126
+ const result = await better_auth_client_1.betterAuthClient.requestPasswordReset({
127
+ email,
128
+ redirectTo,
129
+ });
130
+ if (result.error) {
131
+ throw new Error(result.error.message || "Password reset request failed");
132
+ }
133
+ debug("Password reset email sent");
134
+ return result;
135
+ }, []);
136
+ const resetPassword = (0, react_2.useCallback)(async (newPassword, token) => {
137
+ debug("Resetting password");
138
+ const result = await better_auth_client_1.betterAuthClient.resetPassword({
139
+ newPassword,
140
+ token,
141
+ });
142
+ if (result.error) {
143
+ throw new Error(result.error.message || "Password reset failed");
144
+ }
145
+ debug("Password reset successful");
146
+ return result;
147
+ }, []);
148
+ return {
149
+ signInWithEmail,
150
+ signUpWithEmail,
151
+ signInWithSocial,
152
+ requestPasswordReset,
153
+ resetPassword,
154
+ exchangeForFeathersJWT,
155
+ betterAuthClient: better_auth_client_1.betterAuthClient,
156
+ };
157
+ }
@@ -7451,8 +7451,10 @@ export declare function useFirstEOA(chain?: {
7451
7451
  [x: `bool[${string}]`]: undefined;
7452
7452
  [x: `bytes[${string}]`]: undefined;
7453
7453
  [x: `bytes1[${string}]`]: undefined;
7454
- [x: `bytes4[${string}]`]: undefined;
7454
+ [x: `bytes7[${string}]`]: undefined;
7455
+ [x: `bytes14[${string}]`]: undefined;
7455
7456
  [x: `bytes30[${string}]`]: undefined;
7457
+ [x: `bytes5[${string}]`]: undefined;
7456
7458
  [x: `bytes18[${string}]`]: undefined;
7457
7459
  [x: `bytes6[${string}]`]: undefined;
7458
7460
  [x: `bytes9[${string}]`]: undefined;
@@ -7460,12 +7462,10 @@ export declare function useFirstEOA(chain?: {
7460
7462
  [x: `bytes10[${string}]`]: undefined;
7461
7463
  [x: `bytes2[${string}]`]: undefined;
7462
7464
  [x: `bytes3[${string}]`]: undefined;
7463
- [x: `bytes5[${string}]`]: undefined;
7464
- [x: `bytes7[${string}]`]: undefined;
7465
+ [x: `bytes4[${string}]`]: undefined;
7465
7466
  [x: `bytes11[${string}]`]: undefined;
7466
7467
  [x: `bytes12[${string}]`]: undefined;
7467
7468
  [x: `bytes13[${string}]`]: undefined;
7468
- [x: `bytes14[${string}]`]: undefined;
7469
7469
  [x: `bytes15[${string}]`]: undefined;
7470
7470
  [x: `bytes16[${string}]`]: undefined;
7471
7471
  [x: `bytes17[${string}]`]: undefined;
@@ -7553,8 +7553,10 @@ export declare function useFirstEOA(chain?: {
7553
7553
  bool?: undefined;
7554
7554
  bytes?: undefined;
7555
7555
  bytes1?: undefined;
7556
- bytes4?: undefined;
7556
+ bytes7?: undefined;
7557
+ bytes14?: undefined;
7557
7558
  bytes30?: undefined;
7559
+ bytes5?: undefined;
7558
7560
  bytes18?: undefined;
7559
7561
  bytes6?: undefined;
7560
7562
  bytes9?: undefined;
@@ -7562,12 +7564,10 @@ export declare function useFirstEOA(chain?: {
7562
7564
  bytes10?: undefined;
7563
7565
  bytes2?: undefined;
7564
7566
  bytes3?: undefined;
7565
- bytes5?: undefined;
7566
- bytes7?: undefined;
7567
+ bytes4?: undefined;
7567
7568
  bytes11?: undefined;
7568
7569
  bytes12?: undefined;
7569
7570
  bytes13?: undefined;
7570
- bytes14?: undefined;
7571
7571
  bytes15?: undefined;
7572
7572
  bytes16?: undefined;
7573
7573
  bytes17?: undefined;
@@ -425,6 +425,15 @@ export interface SendModalProps extends BaseModalProps {
425
425
  /** Callback function called when send is successful */
426
426
  onSuccess?: (txHash?: string) => void;
427
427
  }
428
+ /**
429
+ * Props for the Session Duration modal
430
+ * Allows users to configure how long they stay signed in
431
+ */
432
+ export interface SessionDurationModalProps extends BaseModalProps {
433
+ type: "sessionDuration";
434
+ partnerId: string;
435
+ chain: Chain;
436
+ }
428
437
  /**
429
438
  * Props for the Notifications modal
430
439
  * Allows users to manage notification settings and channels
@@ -626,7 +635,7 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
626
635
  /**
627
636
  * Union type of all possible modal content types
628
637
  */
629
- export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | AnySpendCollectorClubPurchaseProps | AnySpendDepositModalProps | AnySpendWorkflowTriggerModalProps | AnySpendCheckoutTriggerModalProps;
638
+ export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | SessionDurationModalProps | AnySpendCollectorClubPurchaseProps | AnySpendDepositModalProps | AnySpendWorkflowTriggerModalProps | AnySpendCheckoutTriggerModalProps;
630
639
  /**
631
640
  * State interface for the modal store
632
641
  */
@@ -1,4 +1,4 @@
1
- import { type CreateConnectorFn } from "wagmi";
1
+ import type { CreateConnectorFn } from "wagmi";
2
2
  export interface CreateWagmiConfigOptions {
3
3
  partnerId: string;
4
4
  rpcUrls?: Record<number, string>;
@@ -6,7 +6,8 @@ export interface CreateWagmiConfigOptions {
6
6
  overrideDefaultConnectors?: boolean;
7
7
  }
8
8
  /**
9
- * Creates a wagmi config with optional custom RPC URLs and connectors
9
+ * Creates a wagmi config with the B3 ecosystem wallet connector.
10
+ * Delegates to createWalletConfig and adds the ecosystem connector on top.
10
11
  * @param options.partnerId - Partner ID for the ecosystem wallet
11
12
  * @param options.rpcUrls - Optional mapping of chain IDs to RPC URLs
12
13
  * @param options.connectors - Additional connectors to include
@@ -14,14 +15,4 @@ export interface CreateWagmiConfigOptions {
14
15
  */
15
16
  export declare function createWagmiConfig(options: CreateWagmiConfigOptions): import("wagmi").Config<readonly [import("viem").Chain, ...import("viem").Chain[]], {
16
17
  [k: string]: import("viem").HttpTransport<undefined, false>;
17
- }, (CreateConnectorFn | CreateConnectorFn<import("thirdweb/dist/types/adapters/eip1193").EIP1193Provider | undefined, {
18
- connect<withCapabilities extends boolean = false>(parameters?: import("@thirdweb-dev/wagmi-adapter").ConnectionOptions<withCapabilities> | undefined): Promise<{
19
- accounts: withCapabilities extends true ? readonly {
20
- address: `0x${string}`;
21
- capabilities: Record<string, unknown>;
22
- }[] : readonly `0x${string}`[];
23
- chainId: number;
24
- }>;
25
- }, {
26
- "thirdweb:lastChainId": number;
27
- }>)[]>;
18
+ }, CreateConnectorFn[]>;
@@ -1,14 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createWagmiConfig = createWagmiConfig;
4
+ const createWalletConfig_1 = require("../../../wallet/utils/createWalletConfig");
4
5
  const constants_1 = require("../../../shared/constants");
5
- const supported_1 = require("../../../shared/constants/chains/supported");
6
6
  const thirdweb_1 = require("../../../shared/utils/thirdweb");
7
7
  const wagmi_adapter_1 = require("@thirdweb-dev/wagmi-adapter");
8
- const viem_1 = require("viem");
9
- const wagmi_1 = require("wagmi");
10
8
  /**
11
- * Creates a wagmi config with optional custom RPC URLs and connectors
9
+ * Creates a wagmi config with the B3 ecosystem wallet connector.
10
+ * Delegates to createWalletConfig and adds the ecosystem connector on top.
12
11
  * @param options.partnerId - Partner ID for the ecosystem wallet
13
12
  * @param options.rpcUrls - Optional mapping of chain IDs to RPC URLs
14
13
  * @param options.connectors - Additional connectors to include
@@ -24,9 +23,8 @@ function createWagmiConfig(options) {
24
23
  }),
25
24
  ];
26
25
  const finalConnectors = overrideDefaultConnectors ? connectors : [...defaultConnectors, ...connectors];
27
- return (0, wagmi_1.createConfig)({
28
- chains: [supported_1.supportedChains[0], ...supported_1.supportedChains.slice(1)],
29
- transports: Object.fromEntries(supported_1.supportedChains.map(chain => [chain.id, (0, viem_1.http)(rpcUrls?.[chain.id])])),
26
+ return (0, createWalletConfig_1.createWalletConfig)({
30
27
  connectors: finalConnectors,
28
+ rpcUrls,
31
29
  });
32
30
  }
@@ -1,4 +1,3 @@
1
1
  export * from "./notificationsAPI";
2
2
  export * from "./profileDisplay";
3
3
  export * from "./toast";
4
- export * from "./updateAvatar";
@@ -17,4 +17,3 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./notificationsAPI"), exports);
18
18
  __exportStar(require("./profileDisplay"), exports);
19
19
  __exportStar(require("./toast"), exports);
20
- __exportStar(require("./updateAvatar"), exports);
@@ -4,6 +4,18 @@ exports.validateImageUrl = validateImageUrl;
4
4
  exports.getProfileDisplayInfo = getProfileDisplayInfo;
5
5
  const debug_1 = require("../../../shared/utils/debug");
6
6
  const debug = (0, debug_1.debugB3React)("profileDisplay");
7
+ const ALLOWED_IPFS_GATEWAYS = [
8
+ "ipfs.io",
9
+ "gateway.pinata.cloud",
10
+ "cloudflare-ipfs.com",
11
+ "dweb.link",
12
+ "nftstorage.link",
13
+ "w3s.link",
14
+ ];
15
+ const BLOCKED_HOSTNAMES = ["models.readyplayer.me", "readyplayer.me"];
16
+ function isHostnameInList(hostname, list) {
17
+ return list.some(entry => hostname === entry || hostname.endsWith(`.${entry}`));
18
+ }
7
19
  /**
8
20
  * Validates that an image URL uses an allowed schema
9
21
  * @param url - The URL to validate
@@ -28,27 +40,14 @@ function validateImageUrl(url) {
28
40
  debug("Rejected unsafe protocol:", parsedUrl.protocol, url);
29
41
  return null;
30
42
  }
31
- // Whitelist of allowed IPFS gateway hostnames
32
- const allowedIpfsGateways = [
33
- "ipfs.io",
34
- "gateway.pinata.cloud",
35
- "cloudflare-ipfs.com",
36
- "dweb.link",
37
- "nftstorage.link",
38
- "w3s.link",
39
- ];
40
- // Check if hostname matches allowed IPFS gateways
41
43
  const hostname = parsedUrl.hostname.toLowerCase();
42
- const isAllowedIpfsGateway = allowedIpfsGateways.some(gateway => {
43
- // Exact match or subdomain of the gateway
44
- return hostname === gateway || hostname.endsWith(`.${gateway}`);
45
- });
46
- if (isAllowedIpfsGateway) {
44
+ if (isHostnameInList(hostname, ALLOWED_IPFS_GATEWAYS)) {
47
45
  return url;
48
46
  }
49
- // For standard HTTP(S) URLs from trusted sources
50
- // Add additional hostname validation here if needed
51
- // For now, allow all HTTP(S) URLs (can be restricted further if needed)
47
+ if (isHostnameInList(hostname, BLOCKED_HOSTNAMES)) {
48
+ debug("Rejected deprecated avatar service:", hostname, url);
49
+ return null;
50
+ }
52
51
  return url;
53
52
  }
54
53
  catch (error) {
@@ -1,6 +1,6 @@
1
+ import { ChainNetworks } from "../../../global-account/types/chain-networks";
1
2
  import { Chain as ThirdwebChain } from "thirdweb";
2
3
  import { Chain } from "viem";
3
- import { ChainNetworks } from "../../../global-account/types/chain-networks";
4
4
  export declare const nullAddress = "0x0000000000000000000000000000000000000000";
5
5
  export declare const avatarsNFTCollectionAddress = "0x658E2F67D3121A0eA81e5854be0b7539be27Aeb0";
6
6
  export declare const viemToThirdwebChain: (chain: Chain) => ThirdwebChain;
@@ -33,8 +33,8 @@ export declare const b3Mainnet: {
33
33
  experimental_preconfirmationTime?: number | undefined | undefined;
34
34
  rpcUrls: {
35
35
  readonly default: {
36
- readonly http: readonly ["https://mainnet-rpc.b3.fun"];
37
- readonly ws: readonly ["wss://mainnet-rpc.b3.fun/ws"];
36
+ readonly http: readonly ["https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"];
37
+ readonly ws: readonly ["wss://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"];
38
38
  };
39
39
  };
40
40
  sourceId?: number | undefined | undefined;
@@ -43,7 +43,7 @@ export declare const b3Mainnet: {
43
43
  fees?: import("viem").ChainFees<undefined> | undefined;
44
44
  formatters?: undefined;
45
45
  serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
46
- readonly rpc: "https://mainnet-rpc.b3.fun";
46
+ readonly rpc: "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2";
47
47
  readonly icon: {
48
48
  readonly url: "https://cdn.b3.fun/b3_logo.svg";
49
49
  readonly width: 32;
@@ -128,8 +128,8 @@ export declare const b3Chain: Chain | {
128
128
  experimental_preconfirmationTime?: number | undefined | undefined;
129
129
  rpcUrls: {
130
130
  readonly default: {
131
- readonly http: readonly ["https://mainnet-rpc.b3.fun"];
132
- readonly ws: readonly ["wss://mainnet-rpc.b3.fun/ws"];
131
+ readonly http: readonly ["https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"];
132
+ readonly ws: readonly ["wss://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"];
133
133
  };
134
134
  };
135
135
  sourceId?: number | undefined | undefined;
@@ -138,7 +138,7 @@ export declare const b3Chain: Chain | {
138
138
  fees?: import("viem").ChainFees<undefined> | undefined;
139
139
  formatters?: undefined;
140
140
  serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
141
- readonly rpc: "https://mainnet-rpc.b3.fun";
141
+ readonly rpc: "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2";
142
142
  readonly icon: {
143
143
  readonly url: "https://cdn.b3.fun/b3_logo.svg";
144
144
  readonly width: 32;
@@ -56,11 +56,11 @@ exports.b3Testnet = (0, viem_1.defineChain)({
56
56
  exports.b3Mainnet = (0, viem_1.defineChain)({
57
57
  id: 8333,
58
58
  name: "B3",
59
- rpc: "https://mainnet-rpc.b3.fun",
59
+ rpc: "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2",
60
60
  rpcUrls: {
61
61
  default: {
62
- http: ["https://mainnet-rpc.b3.fun"],
63
- ws: ["wss://mainnet-rpc.b3.fun/ws"],
62
+ http: ["https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"],
63
+ ws: ["wss://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"],
64
64
  },
65
65
  },
66
66
  icon: {
@@ -128,7 +128,7 @@ exports.thirdwebB3Testnet = (0, thirdweb_1.defineChain)({
128
128
  exports.thirdwebB3Mainnet = (0, thirdweb_1.defineChain)({
129
129
  id: 8333,
130
130
  name: "B3",
131
- rpc: "https://mainnet-rpc.b3.fun/http",
131
+ rpc: "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2/",
132
132
  icon: {
133
133
  url: "https://cdn.b3.fun/b3_logo.svg",
134
134
  width: 32,
@@ -0,0 +1,6 @@
1
+ import type { Chain } from "viem";
2
+ /**
3
+ * Viem's built-in `b3` chain points at mainnet-rpc.b3.fun; we spread it and override
4
+ * RPC URLs so all SDK call sites stay aligned with {@link B3_PUBLIC_RPC}.
5
+ */
6
+ export declare const b3Viem: Chain;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.b3Viem = void 0;
4
+ const rpc_1 = require("../../../anyspend/constants/rpc");
5
+ const chains_1 = require("viem/chains");
6
+ /**
7
+ * Viem's built-in `b3` chain points at mainnet-rpc.b3.fun; we spread it and override
8
+ * RPC URLs so all SDK call sites stay aligned with {@link B3_PUBLIC_RPC}.
9
+ */
10
+ exports.b3Viem = {
11
+ ...chains_1.b3,
12
+ rpcUrls: {
13
+ ...chains_1.b3.rpcUrls,
14
+ default: {
15
+ ...chains_1.b3.rpcUrls.default,
16
+ http: [rpc_1.B3_PUBLIC_RPC],
17
+ },
18
+ },
19
+ };
@@ -2,6 +2,7 @@ import type { Chain as ThirdwebChain } from "thirdweb";
2
2
  export declare const supportedChains: import("viem").Chain[];
3
3
  export declare const supportedChainsTW: ThirdwebChain[];
4
4
  export declare const supportedChainNetworks: {
5
+ formatters?: Record<string, any> | undefined;
5
6
  contracts?: Record<string, {
6
7
  blockCreated?: number | undefined;
7
8
  address: string;
@@ -9,7 +10,6 @@ export declare const supportedChainNetworks: {
9
10
  sourceId?: number | undefined;
10
11
  testnet?: boolean | undefined;
11
12
  fees?: Record<string, any> | undefined;
12
- formatters?: Record<string, any> | undefined;
13
13
  color?: string | undefined;
14
14
  testnetConfigID?: number | undefined;
15
15
  badge?: string | undefined;
@@ -5,8 +5,8 @@
5
5
  "name": "B3",
6
6
  "rpcUrls": {
7
7
  "default": {
8
- "http": "https://mainnet-rpc.b3.fun",
9
- "ws": "wss://mainnet-rpc.b3.fun/ws"
8
+ "http": "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2/",
9
+ "ws": "wss://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2/"
10
10
  },
11
11
  "backups": []
12
12
  },
@@ -1,4 +1,4 @@
1
- import { Chain } from "viem/chains";
1
+ import type { Chain } from "viem";
2
2
  export declare function getChainById(id: number): Chain | undefined;
3
3
  export declare function chainIdToName(id: number): string | undefined;
4
4
  export declare function getExplorerUrl(chain: Chain, txHash: string): string;
@@ -5,8 +5,8 @@ exports.chainIdToName = chainIdToName;
5
5
  exports.getExplorerUrl = getExplorerUrl;
6
6
  exports.getAddressExplorerUrl = getAddressExplorerUrl;
7
7
  exports.getTokenExplorerUrl = getTokenExplorerUrl;
8
+ const b3Viem_1 = require("../../shared/constants/chains/b3Viem");
8
9
  const supported_1 = require("../../shared/constants/chains/supported");
9
- const chains_1 = require("viem/chains");
10
10
  const baseChainBaseUrl = "https://basescan.org";
11
11
  function getChainById(id) {
12
12
  return Object.values(supported_1.supportedChains).find(chain => chain.id === id);
@@ -16,7 +16,7 @@ function chainIdToName(id) {
16
16
  return name === "Base Mainnet" ? "Base" : name === "The Open Network" ? "Open Network" : name;
17
17
  }
18
18
  function getExplorerUrl(chain, txHash) {
19
- if (chain.id === chains_1.b3.id) {
19
+ if (chain.id === b3Viem_1.b3Viem.id) {
20
20
  return "https://explorer.b3.fun/b3/tx/" + txHash;
21
21
  }
22
22
  let baseUrl = chain.blockExplorers?.default.url;
@@ -0,0 +1,15 @@
1
+ export declare const SESSION_DURATION_OPTIONS: readonly [0, 1, 7, 14, 30];
2
+ export type SessionDurationDays = (typeof SESSION_DURATION_OPTIONS)[number];
3
+ /**
4
+ * Read session duration for a specific partner.
5
+ *
6
+ * preferences shape: { [partnerId]: { sessionDuration: number }, sessionDuration?: number }
7
+ *
8
+ * Priority: user.preferences[partnerId].sessionDuration
9
+ * → user.preferences.sessionDuration (global fallback)
10
+ * → localStorage (per-partner) → localStorage (global) → default 7d
11
+ */
12
+ export declare function getSessionDurationDays(userPreferences?: Record<string, any>, partnerId?: string): SessionDurationDays;
13
+ export declare const SESSION_DURATION_LABELS: Record<SessionDurationDays, string>;
14
+ /** Cache the preference locally so it's available immediately on next login */
15
+ export declare function setSessionDurationDays(days: SessionDurationDays, partnerId?: string): void;
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SESSION_DURATION_LABELS = exports.SESSION_DURATION_OPTIONS = void 0;
4
+ exports.getSessionDurationDays = getSessionDurationDays;
5
+ exports.setSessionDurationDays = setSessionDurationDays;
6
+ const STORAGE_KEY_PREFIX = "b3-session-duration";
7
+ const DEFAULT_DAYS = 7;
8
+ // 0 = session cookie (expires when browser closes)
9
+ exports.SESSION_DURATION_OPTIONS = [0, 1, 7, 14, 30];
10
+ function storageKey(partnerId) {
11
+ return partnerId ? `${STORAGE_KEY_PREFIX}_${partnerId}` : STORAGE_KEY_PREFIX;
12
+ }
13
+ /**
14
+ * Read session duration for a specific partner.
15
+ *
16
+ * preferences shape: { [partnerId]: { sessionDuration: number }, sessionDuration?: number }
17
+ *
18
+ * Priority: user.preferences[partnerId].sessionDuration
19
+ * → user.preferences.sessionDuration (global fallback)
20
+ * → localStorage (per-partner) → localStorage (global) → default 7d
21
+ */
22
+ function getSessionDurationDays(userPreferences, partnerId) {
23
+ if (userPreferences) {
24
+ if (partnerId) {
25
+ const v = userPreferences[partnerId]?.sessionDuration;
26
+ if (exports.SESSION_DURATION_OPTIONS.includes(v))
27
+ return v;
28
+ }
29
+ const v = userPreferences["sessionDuration"];
30
+ if (exports.SESSION_DURATION_OPTIONS.includes(v))
31
+ return v;
32
+ }
33
+ try {
34
+ if (partnerId) {
35
+ const stored = localStorage.getItem(storageKey(partnerId));
36
+ if (stored !== null) {
37
+ const parsed = Number(stored);
38
+ if (exports.SESSION_DURATION_OPTIONS.includes(parsed))
39
+ return parsed;
40
+ }
41
+ }
42
+ const stored = localStorage.getItem(STORAGE_KEY_PREFIX);
43
+ if (stored !== null) {
44
+ const parsed = Number(stored);
45
+ if (exports.SESSION_DURATION_OPTIONS.includes(parsed))
46
+ return parsed;
47
+ }
48
+ }
49
+ catch {
50
+ // localStorage unavailable (e.g. SSR)
51
+ }
52
+ return DEFAULT_DAYS;
53
+ }
54
+ exports.SESSION_DURATION_LABELS = {
55
+ 0: "Session only",
56
+ 1: "1 day",
57
+ 7: "7 days",
58
+ 14: "14 days",
59
+ 30: "30 days",
60
+ };
61
+ /** Cache the preference locally so it's available immediately on next login */
62
+ function setSessionDurationDays(days, partnerId) {
63
+ try {
64
+ localStorage.setItem(storageKey(partnerId), String(days));
65
+ }
66
+ catch {
67
+ // ignore
68
+ }
69
+ }
@@ -0,0 +1,11 @@
1
+ export interface ConnectWalletProps {
2
+ /** Theme for the modal and button. Defaults to "light". */
3
+ theme?: "light" | "dark";
4
+ /** Label for the connect button. Defaults to "Connect Wallet". */
5
+ buttonLabel?: string;
6
+ }
7
+ /**
8
+ * Drop-in wallet connection component styled to match the B3 design system.
9
+ * Uses inline styles — works in any app without tailwind configuration.
10
+ */
11
+ export declare function ConnectWallet({ theme: themeProp, buttonLabel }: ConnectWalletProps): import("react/jsx-runtime").JSX.Element;