@b3dotfun/sdk 0.0.88 → 0.0.89-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/dist/cjs/anyspend/constants/index.d.ts +2 -0
  2. package/dist/cjs/anyspend/constants/index.js +3 -1
  3. package/dist/cjs/anyspend/index.d.ts +2 -0
  4. package/dist/cjs/anyspend/index.js +3 -0
  5. package/dist/cjs/anyspend/react/components/AnySpend.d.ts +6 -0
  6. package/dist/cjs/anyspend/react/components/AnySpend.js +9 -6
  7. package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
  8. package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
  9. package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +1 -0
  10. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +3 -3
  11. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +6 -0
  12. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +24 -20
  13. package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +7 -1
  14. package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +3 -3
  15. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +4 -0
  16. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +14 -1
  17. package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
  18. package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +3 -2
  19. package/dist/cjs/anyspend/react/components/common/GasIndicator.d.ts +6 -0
  20. package/dist/cjs/anyspend/react/components/common/GasIndicator.js +34 -0
  21. package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +4 -0
  22. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +34 -6
  23. package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
  24. package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +3 -2
  25. package/dist/cjs/anyspend/react/components/common/PaymentStripeWeb2.js +3 -4
  26. package/dist/cjs/anyspend/react/hooks/index.d.ts +1 -0
  27. package/dist/cjs/anyspend/react/hooks/index.js +1 -0
  28. package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +1 -1
  29. package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.js +1 -1
  30. package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.js +1 -1
  31. package/dist/cjs/anyspend/react/hooks/useGasPrice.d.ts +37 -0
  32. package/dist/cjs/anyspend/react/hooks/useGasPrice.js +43 -0
  33. package/dist/cjs/anyspend/react/hooks/useValidatedClientReferenceId.js +1 -1
  34. package/dist/cjs/anyspend/services/gas.d.ts +21 -0
  35. package/dist/cjs/anyspend/services/gas.js +65 -0
  36. package/dist/cjs/anyspend/types/gas.d.ts +61 -0
  37. package/dist/cjs/anyspend/types/gas.js +2 -0
  38. package/dist/cjs/global-account/react/components/B3DynamicModal.js +2 -3
  39. package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +5 -0
  40. package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.js +12 -0
  41. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +2 -18
  42. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +35 -52
  43. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
  44. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +38 -35
  45. package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +3 -1
  46. package/dist/cjs/global-account/react/components/B3Provider/useB3.d.ts +14 -4
  47. package/dist/cjs/global-account/react/components/B3Provider/useB3.js +4 -11
  48. package/dist/cjs/global-account/react/components/B3Provider/useB3Account.js +5 -2
  49. package/dist/cjs/global-account/react/components/B3Provider/useB3Config.d.ts +10 -2
  50. package/dist/cjs/global-account/react/components/B3Provider/useB3Config.js +18 -17
  51. package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +1 -2
  52. package/dist/cjs/global-account/react/components/ManageAccount/channels/DiscordChannel.js +6 -6
  53. package/dist/cjs/global-account/react/components/ManageAccount/channels/EmailChannel.js +7 -7
  54. package/dist/cjs/global-account/react/components/ManageAccount/channels/PhoneChannel.js +7 -7
  55. package/dist/cjs/global-account/react/components/ManageAccount/channels/TelegramChannel.js +5 -5
  56. package/dist/cjs/global-account/react/components/RequestPermissions/RequestPermissions.js +8 -9
  57. package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +1 -1
  58. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +76 -20
  59. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +1 -1
  60. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStep.js +1 -1
  61. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +1 -1
  62. package/dist/cjs/global-account/react/components/StyleRoot.js +3 -3
  63. package/dist/cjs/global-account/react/components/TurnkeyAuthModal.js +3 -1
  64. package/dist/cjs/global-account/react/components/custom/ManageAccountButton.js +1 -2
  65. package/dist/cjs/global-account/react/components/index.d.ts +1 -2
  66. package/dist/cjs/global-account/react/components/index.js +3 -6
  67. package/dist/cjs/global-account/react/hooks/index.d.ts +2 -0
  68. package/dist/cjs/global-account/react/hooks/index.js +5 -1
  69. package/dist/cjs/global-account/react/hooks/useAuth.d.ts +76 -0
  70. package/dist/cjs/global-account/react/hooks/useAuth.js +337 -0
  71. package/dist/cjs/global-account/react/hooks/useClient.js +1 -1
  72. package/dist/cjs/global-account/react/hooks/useHandleConnectWithPrivy.js +1 -1
  73. package/dist/cjs/global-account/react/hooks/useNotifications.js +14 -14
  74. package/dist/cjs/global-account/react/hooks/useTWAuth.d.ts +3 -0
  75. package/dist/cjs/global-account/react/hooks/useTWAuth.js +8 -0
  76. package/dist/cjs/global-account/react/hooks/useTokenBalance.js +5 -5
  77. package/dist/cjs/global-account/react/hooks/useTokenBalancesByChain.js +4 -2
  78. package/dist/cjs/global-account/react/hooks/useTurnkeyAuth.js +50 -22
  79. package/dist/cjs/global-account/react/hooks/useUser.d.ts +60 -0
  80. package/dist/cjs/global-account/react/hooks/useUser.js +20 -0
  81. package/dist/cjs/global-account/react/hooks/useUserQuery.js +9 -35
  82. package/dist/cjs/global-account/react/index.native.d.ts +0 -2
  83. package/dist/cjs/global-account/react/index.native.js +1 -5
  84. package/dist/cjs/global-account/react/stores/configStore.d.ts +24 -0
  85. package/dist/cjs/global-account/react/stores/configStore.js +30 -0
  86. package/dist/cjs/global-account/react/stores/index.d.ts +1 -0
  87. package/dist/cjs/global-account/react/stores/index.js +3 -1
  88. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +10 -0
  89. package/dist/cjs/global-account/react/stores/userStore.d.ts +22 -0
  90. package/dist/cjs/global-account/react/stores/userStore.js +30 -0
  91. package/dist/esm/anyspend/constants/index.d.ts +2 -0
  92. package/dist/esm/anyspend/constants/index.js +2 -0
  93. package/dist/esm/anyspend/index.d.ts +2 -0
  94. package/dist/esm/anyspend/index.js +3 -0
  95. package/dist/esm/anyspend/react/components/AnySpend.d.ts +6 -0
  96. package/dist/esm/anyspend/react/components/AnySpend.js +11 -8
  97. package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
  98. package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
  99. package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +1 -0
  100. package/dist/esm/anyspend/react/components/AnySpendCustom.js +3 -3
  101. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +6 -0
  102. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +8 -4
  103. package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +7 -1
  104. package/dist/esm/anyspend/react/components/AnySpendDeposit.js +3 -3
  105. package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +4 -0
  106. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +14 -1
  107. package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
  108. package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +3 -2
  109. package/dist/esm/anyspend/react/components/common/GasIndicator.d.ts +6 -0
  110. package/dist/esm/anyspend/react/components/common/GasIndicator.js +31 -0
  111. package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +4 -0
  112. package/dist/esm/anyspend/react/components/common/OrderDetails.js +36 -8
  113. package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
  114. package/dist/esm/anyspend/react/components/common/PanelOnramp.js +3 -2
  115. package/dist/esm/anyspend/react/components/common/PaymentStripeWeb2.js +3 -4
  116. package/dist/esm/anyspend/react/hooks/index.d.ts +1 -0
  117. package/dist/esm/anyspend/react/hooks/index.js +1 -0
  118. package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +2 -2
  119. package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.js +2 -2
  120. package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.js +2 -2
  121. package/dist/esm/anyspend/react/hooks/useGasPrice.d.ts +37 -0
  122. package/dist/esm/anyspend/react/hooks/useGasPrice.js +40 -0
  123. package/dist/esm/anyspend/react/hooks/useValidatedClientReferenceId.js +2 -2
  124. package/dist/esm/anyspend/services/gas.d.ts +21 -0
  125. package/dist/esm/anyspend/services/gas.js +59 -0
  126. package/dist/esm/anyspend/types/gas.d.ts +61 -0
  127. package/dist/esm/anyspend/types/gas.js +1 -0
  128. package/dist/esm/global-account/react/components/B3DynamicModal.js +3 -4
  129. package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +5 -0
  130. package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.js +10 -0
  131. package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +2 -18
  132. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +34 -53
  133. package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
  134. package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +36 -36
  135. package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +3 -1
  136. package/dist/esm/global-account/react/components/B3Provider/useB3.d.ts +14 -4
  137. package/dist/esm/global-account/react/components/B3Provider/useB3.js +4 -11
  138. package/dist/esm/global-account/react/components/B3Provider/useB3Account.js +5 -2
  139. package/dist/esm/global-account/react/components/B3Provider/useB3Config.d.ts +10 -2
  140. package/dist/esm/global-account/react/components/B3Provider/useB3Config.js +18 -17
  141. package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +2 -3
  142. package/dist/esm/global-account/react/components/ManageAccount/channels/DiscordChannel.js +2 -2
  143. package/dist/esm/global-account/react/components/ManageAccount/channels/EmailChannel.js +2 -2
  144. package/dist/esm/global-account/react/components/ManageAccount/channels/PhoneChannel.js +2 -2
  145. package/dist/esm/global-account/react/components/ManageAccount/channels/TelegramChannel.js +2 -2
  146. package/dist/esm/global-account/react/components/RequestPermissions/RequestPermissions.js +2 -3
  147. package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +2 -2
  148. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +76 -20
  149. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +2 -2
  150. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStep.js +2 -2
  151. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +2 -2
  152. package/dist/esm/global-account/react/components/StyleRoot.js +3 -3
  153. package/dist/esm/global-account/react/components/TurnkeyAuthModal.js +5 -3
  154. package/dist/esm/global-account/react/components/custom/ManageAccountButton.js +2 -3
  155. package/dist/esm/global-account/react/components/index.d.ts +1 -2
  156. package/dist/esm/global-account/react/components/index.js +1 -2
  157. package/dist/esm/global-account/react/hooks/index.d.ts +2 -0
  158. package/dist/esm/global-account/react/hooks/index.js +2 -0
  159. package/dist/esm/global-account/react/hooks/useAuth.d.ts +76 -0
  160. package/dist/esm/global-account/react/hooks/useAuth.js +331 -0
  161. package/dist/esm/global-account/react/hooks/useClient.js +2 -2
  162. package/dist/esm/global-account/react/hooks/useHandleConnectWithPrivy.js +2 -2
  163. package/dist/esm/global-account/react/hooks/useNotifications.js +2 -2
  164. package/dist/esm/global-account/react/hooks/useTWAuth.d.ts +3 -0
  165. package/dist/esm/global-account/react/hooks/useTWAuth.js +8 -0
  166. package/dist/esm/global-account/react/hooks/useTokenBalance.js +6 -6
  167. package/dist/esm/global-account/react/hooks/useTokenBalancesByChain.js +4 -2
  168. package/dist/esm/global-account/react/hooks/useTurnkeyAuth.js +50 -22
  169. package/dist/esm/global-account/react/hooks/useUser.d.ts +60 -0
  170. package/dist/esm/global-account/react/hooks/useUser.js +17 -0
  171. package/dist/esm/global-account/react/hooks/useUserQuery.js +1 -27
  172. package/dist/esm/global-account/react/index.native.d.ts +0 -2
  173. package/dist/esm/global-account/react/index.native.js +0 -2
  174. package/dist/esm/global-account/react/stores/configStore.d.ts +24 -0
  175. package/dist/esm/global-account/react/stores/configStore.js +27 -0
  176. package/dist/esm/global-account/react/stores/index.d.ts +1 -0
  177. package/dist/esm/global-account/react/stores/index.js +1 -0
  178. package/dist/esm/global-account/react/stores/useModalStore.d.ts +10 -0
  179. package/dist/esm/global-account/react/stores/userStore.d.ts +22 -0
  180. package/dist/esm/global-account/react/stores/userStore.js +27 -0
  181. package/dist/styles/index.css +1 -1
  182. package/dist/types/anyspend/constants/index.d.ts +2 -0
  183. package/dist/types/anyspend/index.d.ts +2 -0
  184. package/dist/types/anyspend/react/components/AnySpend.d.ts +6 -0
  185. package/dist/types/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
  186. package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +1 -0
  187. package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +6 -0
  188. package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +7 -1
  189. package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +4 -0
  190. package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
  191. package/dist/types/anyspend/react/components/common/GasIndicator.d.ts +6 -0
  192. package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +4 -0
  193. package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
  194. package/dist/types/anyspend/react/hooks/index.d.ts +1 -0
  195. package/dist/types/anyspend/react/hooks/useGasPrice.d.ts +37 -0
  196. package/dist/types/anyspend/services/gas.d.ts +21 -0
  197. package/dist/types/anyspend/types/gas.d.ts +61 -0
  198. package/dist/types/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +5 -0
  199. package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +2 -18
  200. package/dist/types/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
  201. package/dist/types/global-account/react/components/B3Provider/useB3.d.ts +14 -4
  202. package/dist/types/global-account/react/components/B3Provider/useB3Config.d.ts +10 -2
  203. package/dist/types/global-account/react/components/index.d.ts +1 -2
  204. package/dist/types/global-account/react/hooks/index.d.ts +2 -0
  205. package/dist/types/global-account/react/hooks/useAuth.d.ts +76 -0
  206. package/dist/types/global-account/react/hooks/useTWAuth.d.ts +3 -0
  207. package/dist/types/global-account/react/hooks/useUser.d.ts +60 -0
  208. package/dist/types/global-account/react/index.native.d.ts +0 -2
  209. package/dist/types/global-account/react/stores/configStore.d.ts +24 -0
  210. package/dist/types/global-account/react/stores/index.d.ts +1 -0
  211. package/dist/types/global-account/react/stores/useModalStore.d.ts +10 -0
  212. package/dist/types/global-account/react/stores/userStore.d.ts +22 -0
  213. package/package.json +1 -1
  214. package/src/anyspend/constants/index.ts +3 -0
  215. package/src/anyspend/index.ts +4 -0
  216. package/src/anyspend/react/components/AnySpend.tsx +28 -2
  217. package/src/anyspend/react/components/AnySpendCollectorClubPurchase.tsx +6 -0
  218. package/src/anyspend/react/components/AnySpendCustom.tsx +52 -47
  219. package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +23 -0
  220. package/src/anyspend/react/components/AnySpendDeposit.tsx +27 -18
  221. package/src/anyspend/react/components/AnyspendDepositHype.tsx +4 -0
  222. package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +15 -1
  223. package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +5 -1
  224. package/src/anyspend/react/components/common/GasIndicator.tsx +59 -0
  225. package/src/anyspend/react/components/common/OrderDetails.tsx +60 -42
  226. package/src/anyspend/react/components/common/PanelOnramp.tsx +5 -1
  227. package/src/anyspend/react/components/common/PaymentStripeWeb2.tsx +3 -4
  228. package/src/anyspend/react/hooks/index.ts +1 -0
  229. package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +2 -2
  230. package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +2 -2
  231. package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +2 -2
  232. package/src/anyspend/react/hooks/useGasPrice.ts +70 -0
  233. package/src/anyspend/react/hooks/useValidatedClientReferenceId.ts +2 -2
  234. package/src/anyspend/services/gas.test.ts +31 -0
  235. package/src/anyspend/services/gas.ts +73 -0
  236. package/src/anyspend/types/gas.ts +66 -0
  237. package/src/global-account/react/components/B3DynamicModal.tsx +3 -4
  238. package/src/global-account/react/components/B3Provider/AuthenticationProvider.tsx +19 -0
  239. package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +43 -54
  240. package/src/global-account/react/components/B3Provider/B3Provider.tsx +44 -106
  241. package/src/global-account/react/components/B3Provider/RelayKitProviderWrapper.tsx +4 -1
  242. package/src/global-account/react/components/B3Provider/useB3.ts +4 -13
  243. package/src/global-account/react/components/B3Provider/useB3Account.ts +6 -2
  244. package/src/global-account/react/components/B3Provider/useB3Config.ts +18 -31
  245. package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +2 -4
  246. package/src/global-account/react/components/ManageAccount/channels/DiscordChannel.tsx +2 -2
  247. package/src/global-account/react/components/ManageAccount/channels/EmailChannel.tsx +2 -2
  248. package/src/global-account/react/components/ManageAccount/channels/PhoneChannel.tsx +2 -2
  249. package/src/global-account/react/components/ManageAccount/channels/TelegramChannel.tsx +2 -2
  250. package/src/global-account/react/components/RequestPermissions/RequestPermissions.tsx +4 -4
  251. package/src/global-account/react/components/SignInWithB3/SignIn.tsx +2 -2
  252. package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +168 -100
  253. package/src/global-account/react/components/SignInWithB3/SignInWithB3Privy.tsx +2 -2
  254. package/src/global-account/react/components/SignInWithB3/steps/LoginStep.tsx +2 -2
  255. package/src/global-account/react/components/SignInWithB3/steps/LoginStepCustom.tsx +2 -2
  256. package/src/global-account/react/components/StyleRoot.tsx +3 -3
  257. package/src/global-account/react/components/TurnkeyAuthModal.tsx +7 -4
  258. package/src/global-account/react/components/custom/ManageAccountButton.tsx +2 -3
  259. package/src/global-account/react/components/index.ts +1 -2
  260. package/src/global-account/react/hooks/index.ts +2 -0
  261. package/src/global-account/react/hooks/useAuth.ts +379 -0
  262. package/src/global-account/react/hooks/useClient.ts +2 -2
  263. package/src/global-account/react/hooks/useHandleConnectWithPrivy.tsx +2 -2
  264. package/src/global-account/react/hooks/useNotifications.ts +2 -2
  265. package/src/global-account/react/hooks/useTWAuth.tsx +10 -0
  266. package/src/global-account/react/hooks/useTokenBalance.tsx +8 -7
  267. package/src/global-account/react/hooks/useTokenBalancesByChain.tsx +4 -2
  268. package/src/global-account/react/hooks/useTurnkeyAuth.ts +54 -23
  269. package/src/global-account/react/hooks/useUser.ts +20 -0
  270. package/src/global-account/react/hooks/useUserQuery.ts +1 -40
  271. package/src/global-account/react/index.native.ts +0 -2
  272. package/src/global-account/react/stores/configStore.ts +51 -0
  273. package/src/global-account/react/stores/index.ts +1 -0
  274. package/src/global-account/react/stores/useModalStore.ts +10 -0
  275. package/src/global-account/react/stores/userStore.ts +41 -0
  276. package/dist/cjs/global-account/react/components/B3Provider/types.d.ts +0 -27
  277. package/dist/cjs/global-account/react/components/B3Provider/types.js +0 -24
  278. package/dist/esm/global-account/react/components/B3Provider/types.d.ts +0 -27
  279. package/dist/esm/global-account/react/components/B3Provider/types.js +0 -21
  280. package/dist/types/global-account/react/components/B3Provider/types.d.ts +0 -27
  281. package/src/global-account/react/components/B3Provider/types.ts +0 -50
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.B3Provider = B3Provider;
4
- exports.InnerProvider = InnerProvider;
5
7
  const jsx_runtime_1 = require("react/jsx-runtime");
6
8
  const react_1 = require("../../../../global-account/react");
7
- const useAutoSelectWallet_1 = require("../../../../global-account/react/hooks/useAutoSelectWallet");
8
9
  const createWagmiConfig_1 = require("../../../../global-account/react/utils/createWagmiConfig");
9
10
  const analytics_1 = require("../../../../global-account/utils/analytics");
10
11
  require("@relayprotocol/relay-kit-ui/styles.css");
@@ -13,19 +14,11 @@ const react_2 = require("react");
13
14
  const react_3 = require("thirdweb/react");
14
15
  const wagmi_1 = require("wagmi");
15
16
  const client_manager_1 = require("../../../client-manager");
17
+ const configStore_1 = require("../../stores/configStore");
16
18
  const StyleRoot_1 = require("../StyleRoot");
17
19
  const index_1 = require("../Toast/index");
20
+ const AuthenticationProvider_1 = __importDefault(require("./AuthenticationProvider"));
18
21
  const LocalSDKProvider_1 = require("./LocalSDKProvider");
19
- const types_1 = require("./types");
20
- /**
21
- * Default permissions configuration for B3 provider
22
- */
23
- const DEFAULT_PERMISSIONS = {
24
- approvedTargets: ["0xa8e42121e318e3D3BeD7f5969AF6D360045317DD"], // Example contract
25
- nativeTokenLimitPerTransaction: 0.1, // in ETH
26
- startDate: new Date(),
27
- endDate: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365), // 1 year from now
28
- };
29
22
  // Create queryClient instance
30
23
  const queryClient = new react_query_1.QueryClient();
31
24
  /**
@@ -33,7 +26,35 @@ const queryClient = new react_query_1.QueryClient();
33
26
  */
34
27
  function B3Provider({ theme = "light", children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey,
35
28
  // deprecated since v0.0.87
36
- toaster: _toaster, clientType = "rest", rpcUrls, partnerId, stripePublishableKey, onConnect, connectors, overrideDefaultConnectors = false, createClientReferenceId, enableTurnkey = false, }) {
29
+ toaster: _toaster, clientType = "rest", rpcUrls, partnerId, stripePublishableKey, onConnect, connectors, overrideDefaultConnectors = false, createClientReferenceId, enableTurnkey = false, defaultPermissions, }) {
30
+ const setConfig = (0, configStore_1.useB3ConfigStore)(state => state.setConfig);
31
+ // Initialize config store on mount
32
+ (0, react_2.useEffect)(() => {
33
+ setConfig({
34
+ accountOverride,
35
+ environment: environment ?? "development",
36
+ automaticallySetFirstEoa: !!automaticallySetFirstEoa,
37
+ theme,
38
+ clientType,
39
+ partnerId,
40
+ stripePublishableKey,
41
+ createClientReferenceId,
42
+ enableTurnkey,
43
+ defaultPermissions,
44
+ });
45
+ }, [
46
+ accountOverride,
47
+ environment,
48
+ automaticallySetFirstEoa,
49
+ theme,
50
+ clientType,
51
+ partnerId,
52
+ stripePublishableKey,
53
+ createClientReferenceId,
54
+ enableTurnkey,
55
+ defaultPermissions,
56
+ setConfig,
57
+ ]); // eslint-disable-line react-hooks/exhaustive-deps
37
58
  // Initialize Google Analytics on mount
38
59
  (0, react_2.useEffect)(() => {
39
60
  (0, analytics_1.loadGA4Script)();
@@ -43,45 +64,7 @@ toaster: _toaster, clientType = "rest", rpcUrls, partnerId, stripePublishableKey
43
64
  (0, client_manager_1.setClientType)(clientType);
44
65
  }, [clientType]);
45
66
  const wagmiConfig = (0, react_2.useMemo)(() => (0, createWagmiConfig_1.createWagmiConfig)({ partnerId, rpcUrls, connectors, overrideDefaultConnectors }), [partnerId, rpcUrls, connectors, overrideDefaultConnectors]);
46
- return ((0, jsx_runtime_1.jsx)(react_3.ThirdwebProvider, { children: (0, jsx_runtime_1.jsx)(wagmi_1.WagmiProvider, { config: wagmiConfig, reconnectOnMount: false, children: (0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: queryClient, children: (0, jsx_runtime_1.jsx)(react_1.TooltipProvider, { children: (0, jsx_runtime_1.jsx)(index_1.ToastProvider, { children: (0, jsx_runtime_1.jsx)(LocalSDKProvider_1.LocalSDKProvider, { onConnectCallback: onConnect, children: (0, jsx_runtime_1.jsxs)(InnerProvider, { accountOverride: accountOverride, environment: environment, theme: theme, automaticallySetFirstEoa: !!automaticallySetFirstEoa, clientType: clientType, partnerId: partnerId, stripePublishableKey: stripePublishableKey, createClientReferenceId: createClientReferenceId, enableTurnkey: enableTurnkey, children: [(0, jsx_runtime_1.jsx)(ToastContextConnector, {}), (0, jsx_runtime_1.jsxs)(react_1.RelayKitProviderWrapper, { simDuneApiKey: simDuneApiKey, children: [children, (0, jsx_runtime_1.jsx)(StyleRoot_1.StyleRoot, { id: "b3-root" })] })] }) }) }) }) }) }) }));
47
- }
48
- /**
49
- * Inner provider component that provides the actual B3Context
50
- */
51
- function InnerProvider({ children, accountOverride, environment, defaultPermissions = DEFAULT_PERMISSIONS, automaticallySetFirstEoa, theme = "light", clientType = "socket", partnerId, stripePublishableKey, createClientReferenceId, enableTurnkey, }) {
52
- const activeAccount = (0, react_3.useActiveAccount)();
53
- const isAuthenticated = (0, react_1.useAuthStore)(state => state.isAuthenticated);
54
- //const isConnected = useAuthStore(state => state.isConnected);
55
- //const justCompletedLogin = useAuthStore(state => state.justCompletedLogin);
56
- // Use given accountOverride or activeAccount from thirdweb
57
- // WOJ: why if isAuthenticated is false, we don't use activeAccount, which should be undefined?
58
- // skip isAuthenticated check ?
59
- const effectiveAccount = isAuthenticated ? accountOverride || activeAccount : undefined;
60
- // Wrapper to set active wallet via thirdweb
61
- // Note: `wallet` in context is deprecated - use useActiveWallet() from thirdweb/react instead
62
- // Auto-select first EOA wallet when enabled
63
- (0, useAutoSelectWallet_1.useAutoSelectWallet)({
64
- enabled: automaticallySetFirstEoa,
65
- });
66
- return ((0, jsx_runtime_1.jsx)(types_1.B3Context.Provider, { value: {
67
- account: effectiveAccount,
68
- // setWallet,
69
- //wallet: undefined, // Deprecated: use useActiveWallet() from thirdweb/react instead
70
- //user,
71
- //setUser,
72
- //refetchUser,
73
- initialized: true,
74
- ready: !!effectiveAccount,
75
- automaticallySetFirstEoa,
76
- environment,
77
- defaultPermissions,
78
- theme,
79
- clientType,
80
- partnerId: partnerId,
81
- stripePublishableKey,
82
- createClientReferenceId,
83
- enableTurnkey,
84
- }, children: children }));
67
+ return ((0, jsx_runtime_1.jsx)(react_3.ThirdwebProvider, { children: (0, jsx_runtime_1.jsx)(wagmi_1.WagmiProvider, { config: wagmiConfig, reconnectOnMount: false, children: (0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: queryClient, children: (0, jsx_runtime_1.jsx)(react_1.TooltipProvider, { children: (0, jsx_runtime_1.jsx)(index_1.ToastProvider, { children: (0, jsx_runtime_1.jsxs)(LocalSDKProvider_1.LocalSDKProvider, { onConnectCallback: onConnect, children: [(0, jsx_runtime_1.jsx)(ToastContextConnector, {}), (0, jsx_runtime_1.jsxs)(react_1.RelayKitProviderWrapper, { simDuneApiKey: simDuneApiKey, children: [children, (0, jsx_runtime_1.jsx)(StyleRoot_1.StyleRoot, { id: "b3-root" })] }), (0, jsx_runtime_1.jsx)(AuthenticationProvider_1.default, { partnerId: partnerId, automaticallySetFirstEoa: !!automaticallySetFirstEoa })] }) }) }) }) }) }));
85
68
  }
86
69
  /**
87
70
  * Component to connect the toast context to the global toast API
@@ -1,27 +1,27 @@
1
1
  import { PermissionsConfig } from "../../../../global-account/types/permissions";
2
2
  import { Account, Wallet } from "thirdweb/wallets";
3
3
  import { ClientType } from "../../../client-manager";
4
- import { B3ContextType } from "./types";
5
4
  /**
6
5
  * Main B3Provider component
7
6
  */
8
- export declare function B3Provider({ theme, children, accountOverride, environment, clientType, partnerId, rpcUrls, onConnect, }: {
7
+ export declare function B3Provider({ theme, children, accountOverride, environment, clientType, partnerId, rpcUrls, onConnect, defaultPermissions, }: {
9
8
  theme: "light" | "dark";
10
9
  children: React.ReactNode;
11
10
  accountOverride?: Account;
12
- environment: B3ContextType["environment"];
11
+ environment?: "development" | "production";
13
12
  clientType?: ClientType;
14
13
  partnerId: string;
15
14
  rpcUrls?: Record<number, string>;
16
15
  onConnect?: (wallet: Wallet, b3Jwt: string) => void | Promise<void>;
16
+ defaultPermissions?: PermissionsConfig;
17
17
  }): import("react/jsx-runtime").JSX.Element;
18
18
  /**
19
- * Inner provider component that provides the actual B3Context
19
+ * Inner provider component for native
20
20
  */
21
21
  export declare function InnerProvider({ children, accountOverride, environment, defaultPermissions, theme, clientType, partnerId, rpcUrls, }: {
22
22
  children: React.ReactNode;
23
23
  accountOverride?: Account;
24
- environment: B3ContextType["environment"];
24
+ environment?: "development" | "production";
25
25
  defaultPermissions?: PermissionsConfig;
26
26
  theme: "light" | "dark";
27
27
  clientType?: ClientType;
@@ -1,54 +1,57 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.B3Provider = B3Provider;
4
7
  exports.InnerProvider = InnerProvider;
5
8
  const jsx_runtime_1 = require("react/jsx-runtime");
6
9
  const react_query_1 = require("@tanstack/react-query");
7
- const react_1 = require("thirdweb/react");
10
+ const react_1 = require("react");
11
+ const react_2 = require("thirdweb/react");
8
12
  const wagmi_1 = require("wagmi");
13
+ const configStore_1 = require("../../stores/configStore");
9
14
  const createWagmiConfig_1 = require("../../utils/createWagmiConfig");
15
+ const AuthenticationProvider_1 = __importDefault(require("./AuthenticationProvider"));
10
16
  const LocalSDKProvider_1 = require("./LocalSDKProvider");
11
- const types_1 = require("./types");
12
- /**
13
- * Default permissions configuration for B3 provider
14
- */
15
- const DEFAULT_PERMISSIONS = {
16
- approvedTargets: ["0xa8e42121e318e3D3BeD7f5969AF6D360045317DD"], // Example contract
17
- nativeTokenLimitPerTransaction: 0.1, // in ETH
18
- startDate: new Date(),
19
- endDate: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365), // 1 year from now
20
- };
21
17
  // Create queryClient instance
22
18
  const queryClient = new react_query_1.QueryClient();
23
19
  /**
24
20
  * Main B3Provider component
25
21
  */
26
- function B3Provider({ theme = "light", children, accountOverride, environment, clientType = "socket", partnerId, rpcUrls, onConnect, }) {
27
- return ((0, jsx_runtime_1.jsx)(react_1.ThirdwebProvider, { children: (0, jsx_runtime_1.jsx)(LocalSDKProvider_1.LocalSDKProvider, { onConnectCallback: onConnect, children: (0, jsx_runtime_1.jsx)(InnerProvider, { accountOverride: accountOverride, environment: environment, theme: theme, clientType: clientType, partnerId: partnerId, rpcUrls: rpcUrls, children: children }) }) }));
22
+ function B3Provider({ theme = "light", children, accountOverride, environment, clientType = "socket", partnerId, rpcUrls, onConnect, defaultPermissions, }) {
23
+ const setConfig = (0, configStore_1.useB3ConfigStore)(state => state.setConfig);
24
+ // Initialize config store on mount - props are static and never change
25
+ (0, react_1.useEffect)(() => {
26
+ setConfig({
27
+ accountOverride,
28
+ environment: environment ?? "development",
29
+ automaticallySetFirstEoa: false,
30
+ theme,
31
+ clientType,
32
+ partnerId,
33
+ defaultPermissions,
34
+ });
35
+ }, []); // eslint-disable-line react-hooks/exhaustive-deps
36
+ return ((0, jsx_runtime_1.jsx)(react_2.ThirdwebProvider, { children: (0, jsx_runtime_1.jsxs)(LocalSDKProvider_1.LocalSDKProvider, { onConnectCallback: onConnect, children: [children, (0, jsx_runtime_1.jsx)(AuthenticationProvider_1.default, { partnerId: partnerId, automaticallySetFirstEoa: false })] }) }));
28
37
  }
29
38
  /**
30
- * Inner provider component that provides the actual B3Context
39
+ * Inner provider component for native
31
40
  */
32
- function InnerProvider({ children, accountOverride, environment, defaultPermissions = DEFAULT_PERMISSIONS, theme = "light", clientType = "socket", partnerId, rpcUrls, }) {
33
- const activeAccount = (0, react_1.useActiveAccount)();
34
- //const { user, setUser, refetchUser } = useAuthentication(partnerId);
41
+ function InnerProvider({ children, accountOverride, environment, defaultPermissions, theme = "light", clientType = "socket", partnerId, rpcUrls, }) {
42
+ const setConfig = (0, configStore_1.useB3ConfigStore)(state => state.setConfig);
35
43
  const wagmiConfig = (0, createWagmiConfig_1.createWagmiConfig)({ partnerId, rpcUrls });
36
- // Use given accountOverride or activeAccount from thirdweb
37
- const effectiveAccount = accountOverride || activeAccount;
38
- return ((0, jsx_runtime_1.jsx)(wagmi_1.WagmiProvider, { config: wagmiConfig, children: (0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: queryClient, children: (0, jsx_runtime_1.jsx)(types_1.B3Context.Provider, { value: {
39
- //account: effectiveAccount,
40
- automaticallySetFirstEoa: false,
41
- //setWallet: () => {},
42
- wallet: undefined,
43
- //user,
44
- //setUser,
45
- initialized: true,
46
- ready: !!effectiveAccount,
47
- environment,
48
- defaultPermissions,
49
- theme,
50
- clientType,
51
- partnerId,
52
- //refetchUser,
53
- }, children: children }) }) }));
44
+ // Initialize config store on mount - props are static and never change
45
+ (0, react_1.useEffect)(() => {
46
+ setConfig({
47
+ accountOverride,
48
+ environment: environment ?? "development",
49
+ automaticallySetFirstEoa: false,
50
+ theme,
51
+ clientType,
52
+ partnerId,
53
+ defaultPermissions,
54
+ });
55
+ }, []); // eslint-disable-line react-hooks/exhaustive-deps
56
+ return ((0, jsx_runtime_1.jsx)(wagmi_1.WagmiProvider, { config: wagmiConfig, children: (0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: queryClient, children: children }) }));
54
57
  }
@@ -14,6 +14,8 @@ function RelayKitProviderWrapper({ children, simDuneApiKey, }) {
14
14
  };
15
15
  fetchChains();
16
16
  }, []);
17
+ const isTurnkeyPrimary = process.env.NEXT_PUBLIC_TURNKEY_PRIMARY === "true";
18
+ const appName = isTurnkeyPrimary ? "Smart Wallet" : "AnySpend";
17
19
  return ((0, jsx_runtime_1.jsx)(relay_kit_ui_1.RelayKitProvider, { options: {
18
20
  baseApiUrl: relay_sdk_1.MAINNET_RELAY_API,
19
21
  source: "anyspend",
@@ -23,7 +25,7 @@ function RelayKitProviderWrapper({ children, simDuneApiKey, }) {
23
25
  },
24
26
  chains: relayChains,
25
27
  privateChainIds: undefined,
26
- appName: "AnySpend",
28
+ appName,
27
29
  useGasFeeEstimations: true,
28
30
  }, children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }) }));
29
31
  }
@@ -1,6 +1,16 @@
1
1
  /**
2
- * Hook to access the B3 context
3
- * @throws Error if used outside a B3Provider
4
- * @deprecated Use useB3Config or useB3Account instead
2
+ * Hook to access the B3 configuration
3
+ * @deprecated This is just an alias for useB3Config. Use useB3Config directly instead.
5
4
  */
6
- export declare function useB3(): import("./types").B3ContextType;
5
+ export declare function useB3(): {
6
+ automaticallySetFirstEoa: boolean;
7
+ environment: "development" | "production";
8
+ theme: "light" | "dark";
9
+ clientType: import("../../../client-manager").ClientType;
10
+ partnerId: string;
11
+ createClientReferenceId: ((params: import("../../../../anyspend/react").CreateOrderParams | import("../../../../anyspend/react").CreateOnrampOrderParams) => Promise<string>) | undefined;
12
+ enableTurnkey: boolean;
13
+ stripePublishableKey: string | undefined;
14
+ defaultPermissions: import("../../../types/permissions").PermissionsConfig;
15
+ accountOverride: import("thirdweb/wallets").Account | undefined;
16
+ };
@@ -1,18 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useB3 = useB3;
4
- const react_1 = require("react");
5
- const types_1 = require("./types");
4
+ const useB3Config_1 = require("./useB3Config");
6
5
  /**
7
- * Hook to access the B3 context
8
- * @throws Error if used outside a B3Provider
9
- * @deprecated Use useB3Config or useB3Account instead
6
+ * Hook to access the B3 configuration
7
+ * @deprecated This is just an alias for useB3Config. Use useB3Config directly instead.
10
8
  */
11
9
  function useB3() {
12
- const context = (0, react_1.useContext)(types_1.B3Context);
13
- if (!context.initialized) {
14
- throw new Error("useB3 must be used within a B3Provider");
15
- }
16
- // Return a stable reference
17
- return (0, react_1.useMemo)(() => context, [context]);
10
+ return (0, useB3Config_1.useB3Config)();
18
11
  }
@@ -2,9 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useB3Account = void 0;
4
4
  const react_1 = require("thirdweb/react");
5
+ const useAuthStore_1 = require("../../stores/useAuthStore");
5
6
  // Wrapper around useActiveAccount
6
7
  const useB3Account = () => {
7
- const account = (0, react_1.useActiveAccount)();
8
- return account;
8
+ const isAuthenticated = (0, useAuthStore_1.useAuthStore)(state => state.isAuthenticated);
9
+ const activeAccount = (0, react_1.useActiveAccount)();
10
+ const effectiveAccount = isAuthenticated ? activeAccount : undefined;
11
+ return effectiveAccount;
9
12
  };
10
13
  exports.useB3Account = useB3Account;
@@ -1,9 +1,17 @@
1
+ /**
2
+ * Hook to access B3 configuration
3
+ * Returns all config values from the Zustand store
4
+ * Since config is static (set once at initialization), destructuring is fine here
5
+ */
1
6
  export declare const useB3Config: () => {
2
7
  automaticallySetFirstEoa: boolean;
3
- environment: "development" | "production" | undefined;
8
+ environment: "development" | "production";
4
9
  theme: "light" | "dark";
5
10
  clientType: import("../../../client-manager").ClientType;
6
11
  partnerId: string;
7
12
  createClientReferenceId: ((params: import("../../../../anyspend/react").CreateOrderParams | import("../../../../anyspend/react").CreateOnrampOrderParams) => Promise<string>) | undefined;
8
- enableTurnkey: boolean | undefined;
13
+ enableTurnkey: boolean;
14
+ stripePublishableKey: string | undefined;
15
+ defaultPermissions: import("../../../types/permissions").PermissionsConfig;
16
+ accountOverride: import("thirdweb/wallets").Account | undefined;
9
17
  };
@@ -1,23 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useB3Config = void 0;
4
- const react_1 = require("react");
5
- const types_1 = require("./types");
4
+ const configStore_1 = require("../../stores/configStore");
5
+ /**
6
+ * Hook to access B3 configuration
7
+ * Returns all config values from the Zustand store
8
+ * Since config is static (set once at initialization), destructuring is fine here
9
+ */
6
10
  const useB3Config = () => {
7
- const context = (0, react_1.useContext)(types_1.B3Context);
8
- if (!context) {
9
- throw new Error("useB3 must be used within a B3Provider");
10
- }
11
- const { automaticallySetFirstEoa, environment, theme, clientType, partnerId, createClientReferenceId, enableTurnkey, } = context;
12
- // Return a stable reference
13
- return (0, react_1.useMemo)(() => ({
14
- automaticallySetFirstEoa,
15
- environment,
16
- theme,
17
- clientType,
18
- partnerId,
19
- createClientReferenceId,
20
- enableTurnkey,
21
- }), [automaticallySetFirstEoa, environment, theme, clientType, partnerId, createClientReferenceId, enableTurnkey]);
11
+ return (0, configStore_1.useB3ConfigStore)(state => ({
12
+ automaticallySetFirstEoa: state.automaticallySetFirstEoa,
13
+ environment: state.environment,
14
+ theme: state.theme,
15
+ clientType: state.clientType,
16
+ partnerId: state.partnerId,
17
+ createClientReferenceId: state.createClientReferenceId,
18
+ enableTurnkey: state.enableTurnkey,
19
+ stripePublishableKey: state.stripePublishableKey,
20
+ defaultPermissions: state.defaultPermissions,
21
+ accountOverride: state.accountOverride,
22
+ }));
22
23
  };
23
24
  exports.useB3Config = useB3Config;
@@ -17,8 +17,7 @@ const ProfileSection = () => {
17
17
  address: eoaAddress || account?.address,
18
18
  fresh: true,
19
19
  });
20
- const { partnerId } = (0, react_1.useB3Config)();
21
- const { user } = (0, react_1.useAuthentication)(partnerId);
20
+ const { user } = (0, react_1.useUser)();
22
21
  const setB3ModalOpen = (0, react_1.useModalStore)(state => state.setB3ModalOpen);
23
22
  const setB3ModalContentType = (0, react_1.useModalStore)(state => state.setB3ModalContentType);
24
23
  const navigateBack = (0, react_1.useModalStore)(state => state.navigateBack);
@@ -2,18 +2,18 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DiscordChannel = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("../../../../../global-account/react");
5
6
  const debug_1 = require("../../../../../shared/utils/debug");
6
- const react_1 = require("react");
7
+ const react_2 = require("react");
7
8
  const notificationsAPI_1 = require("../../../utils/notificationsAPI");
8
- const useB3_1 = require("../../B3Provider/useB3");
9
9
  const toastApi_1 = require("../../Toast/toastApi");
10
10
  const NotificationChannel_1 = require("../NotificationChannel");
11
11
  const debug = (0, debug_1.debugB3React)("DiscordChannel");
12
12
  const DiscordChannel = ({ userId, jwtToken, discordChannel, isConnected, isOptimisticallyConnected, onConnectionChange, onToggle, }) => {
13
- const { partnerId } = (0, useB3_1.useB3)();
14
- const [discordId, setDiscordId] = (0, react_1.useState)("");
15
- const [isConnecting, setIsConnecting] = (0, react_1.useState)(false);
16
- const [showInput, setShowInput] = (0, react_1.useState)(false);
13
+ const { partnerId } = (0, react_1.useB3Config)();
14
+ const [discordId, setDiscordId] = (0, react_2.useState)("");
15
+ const [isConnecting, setIsConnecting] = (0, react_2.useState)(false);
16
+ const [showInput, setShowInput] = (0, react_2.useState)(false);
17
17
  // Detect if we're disconnecting
18
18
  const isDisconnecting = isConnected && !isOptimisticallyConnected;
19
19
  const handleConnect = async () => {
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EmailChannel = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("../../../../../global-account/react");
5
6
  const debug_1 = require("../../../../../shared/utils/debug");
6
- const react_1 = require("react");
7
+ const react_2 = require("react");
7
8
  const notificationsAPI_1 = require("../../../utils/notificationsAPI");
8
- const useB3_1 = require("../../B3Provider/useB3");
9
9
  const toastApi_1 = require("../../Toast/toastApi");
10
10
  const NotificationChannel_1 = require("../NotificationChannel");
11
11
  const debug = (0, debug_1.debugB3React)("EmailChannel");
@@ -14,11 +14,11 @@ const validateEmail = (email) => {
14
14
  return emailRegex.test(email);
15
15
  };
16
16
  const EmailChannel = ({ userId, jwtToken, emailChannel, isConnected, isOptimisticallyConnected, onConnectionChange, onToggle, }) => {
17
- const { partnerId } = (0, useB3_1.useB3)();
18
- const [email, setEmail] = (0, react_1.useState)("");
19
- const [emailError, setEmailError] = (0, react_1.useState)(null);
20
- const [isConnecting, setIsConnecting] = (0, react_1.useState)(false);
21
- const [showInput, setShowInput] = (0, react_1.useState)(false);
17
+ const { partnerId } = (0, react_1.useB3Config)();
18
+ const [email, setEmail] = (0, react_2.useState)("");
19
+ const [emailError, setEmailError] = (0, react_2.useState)(null);
20
+ const [isConnecting, setIsConnecting] = (0, react_2.useState)(false);
21
+ const [showInput, setShowInput] = (0, react_2.useState)(false);
22
22
  // Detect if we're disconnecting by comparing real vs optimistic state
23
23
  const isDisconnecting = isConnected && !isOptimisticallyConnected;
24
24
  const handleConnect = async () => {
@@ -2,19 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PhoneChannel = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("../../../../../global-account/react");
5
6
  const debug_1 = require("../../../../../shared/utils/debug");
6
- const react_1 = require("react");
7
+ const react_2 = require("react");
7
8
  const notificationsAPI_1 = require("../../../utils/notificationsAPI");
8
- const useB3_1 = require("../../B3Provider/useB3");
9
9
  const toastApi_1 = require("../../Toast/toastApi");
10
10
  const NotificationChannel_1 = require("../NotificationChannel");
11
11
  const debug = (0, debug_1.debugB3React)("PhoneChannel");
12
12
  const PhoneChannel = ({ userId, jwtToken, smsChannel, whatsappChannel, isSMSConnected, isWhatsAppConnected, isOptimisticallySMSConnected, isOptimisticallyWhatsAppConnected, onConnectionChange, onToggle, }) => {
13
- const { partnerId } = (0, useB3_1.useB3)();
14
- const [phoneNumber, setPhoneNumber] = (0, react_1.useState)("");
15
- const [isConnectingSMS, setIsConnectingSMS] = (0, react_1.useState)(false);
16
- const [isConnectingWhatsApp, setIsConnectingWhatsApp] = (0, react_1.useState)(false);
17
- const [showInput, setShowInput] = (0, react_1.useState)(false);
13
+ const { partnerId } = (0, react_1.useB3Config)();
14
+ const [phoneNumber, setPhoneNumber] = (0, react_2.useState)("");
15
+ const [isConnectingSMS, setIsConnectingSMS] = (0, react_2.useState)(false);
16
+ const [isConnectingWhatsApp, setIsConnectingWhatsApp] = (0, react_2.useState)(false);
17
+ const [showInput, setShowInput] = (0, react_2.useState)(false);
18
18
  // Detect if we're disconnecting
19
19
  const isDisconnecting = (isSMSConnected && !isOptimisticallySMSConnected) || (isWhatsAppConnected && !isOptimisticallyWhatsAppConnected);
20
20
  const handleConnectSMS = async () => {
@@ -2,17 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TelegramChannel = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("../../../../../global-account/react");
5
6
  const debug_1 = require("../../../../../shared/utils/debug");
6
- const react_1 = require("react");
7
+ const react_2 = require("react");
7
8
  const notificationsAPI_1 = require("../../../utils/notificationsAPI");
8
- const useB3_1 = require("../../B3Provider/useB3");
9
9
  const toastApi_1 = require("../../Toast/toastApi");
10
10
  const NotificationChannel_1 = require("../NotificationChannel");
11
11
  const debug = (0, debug_1.debugB3React)("TelegramChannel");
12
12
  const TelegramChannel = ({ userId, jwtToken, telegramChannel, isConnected, isOptimisticallyConnected, onConnectionChange, onToggle, }) => {
13
- const { partnerId } = (0, useB3_1.useB3)();
14
- const [isConnecting, setIsConnecting] = (0, react_1.useState)(false);
15
- const [status, setStatus] = (0, react_1.useState)("idle");
13
+ const { partnerId } = (0, react_1.useB3Config)();
14
+ const [isConnecting, setIsConnecting] = (0, react_2.useState)(false);
15
+ const [status, setStatus] = (0, react_2.useState)("idle");
16
16
  // Detect if we're disconnecting
17
17
  const isDisconnecting = isConnected && !isOptimisticallyConnected;
18
18
  const handleConnect = async () => {
@@ -6,23 +6,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.RequestPermissions = RequestPermissions;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_1 = require("../../../../global-account/react");
9
- const react_2 = require("../../../../global-account/react");
10
9
  const debug_1 = require("../../../../shared/utils/debug");
11
10
  const formatAddress_1 = require("../../../../shared/utils/formatAddress");
12
11
  const lucide_react_1 = require("lucide-react");
13
- const react_3 = require("react");
12
+ const react_2 = require("react");
14
13
  const react_timeago_1 = __importDefault(require("react-timeago"));
15
- const react_4 = require("thirdweb/react");
14
+ const react_3 = require("thirdweb/react");
16
15
  const debug = (0, debug_1.debugB3React)("RequestPermissions");
17
16
  /**
18
17
  * Component for requesting permissions to access user accounts and contracts
19
18
  * Allows users to approve session keys with specific permission settings
20
19
  */
21
20
  function RequestPermissions({ onSuccess, onError, chain, sessionKeyAddress, permissions, }) {
22
- const [isApproving, setIsApproving] = (0, react_3.useState)(false);
23
- const account = (0, react_4.useActiveAccount)();
24
- const { defaultPermissions } = (0, react_1.useB3)();
25
- const DEFAULT_PERMISSIONS = (0, react_3.useMemo)(() => permissions ?? defaultPermissions, [defaultPermissions, permissions]);
21
+ const [isApproving, setIsApproving] = (0, react_2.useState)(false);
22
+ const account = (0, react_3.useActiveAccount)();
23
+ const { defaultPermissions } = (0, react_1.useB3Config)();
24
+ const DEFAULT_PERMISSIONS = (0, react_2.useMemo)(() => permissions ?? defaultPermissions, [defaultPermissions, permissions]);
26
25
  const { refetch: refetchSigners } = (0, react_1.useGetAllTWSigners)({
27
26
  chain,
28
27
  accountAddress: account?.address,
@@ -41,7 +40,7 @@ function RequestPermissions({ onSuccess, onError, chain, sessionKeyAddress, perm
41
40
  },
42
41
  chain,
43
42
  });
44
- const handleApprove = (0, react_3.useCallback)(async () => {
43
+ const handleApprove = (0, react_2.useCallback)(async () => {
45
44
  debug("@@handleApprove");
46
45
  try {
47
46
  setIsApproving(true);
@@ -71,7 +70,7 @@ function RequestPermissions({ onSuccess, onError, chain, sessionKeyAddress, perm
71
70
  timeStyle: "short",
72
71
  }).format(date);
73
72
  };
74
- return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("h2", { className: "mb-2 text-2xl font-bold", children: "Allow Access" }), (0, jsx_runtime_1.jsx)("p", { className: "text-b3-react-muted-foreground opacity-70", children: "This app would like permission to:" })] }), (0, jsx_runtime_1.jsx)(react_2.PermissionItem, { title: "Make transactions on your behalf", description: (0, jsx_runtime_1.jsxs)("span", { children: ["Up to", " ", (0, jsx_runtime_1.jsxs)("span", { className: "text-b3-react-primary font-medium", children: [DEFAULT_PERMISSIONS.nativeTokenLimitPerTransaction, " ETH"] }), " ", "per transaction"] }), icon: (0, jsx_runtime_1.jsx)(lucide_react_1.CreditCard, { className: "h-5 w-5" }) }), (0, jsx_runtime_1.jsx)(react_2.PermissionItem, { title: "View your account", description: "See your wallet address and balance", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Eye, { className: "h-5 w-5" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-b3-react-card rounded-lg border p-5 py-4", children: [(0, jsx_runtime_1.jsx)("h3", { className: "mb-2 text-base font-medium", children: "Approved Contracts" }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-2", children: DEFAULT_PERMISSIONS.approvedTargets.map((target) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-react-background text-b3-react-muted-foreground rounded-md border px-3 py-2 font-mono text-sm", children: (0, formatAddress_1.formatAddress)(target) }), (0, jsx_runtime_1.jsx)("span", { className: "text-b3-react-muted-foreground text-sm", children: "\u2022 Game Contract" })] }, target))) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-b3-react-card rounded-lg border p-5 py-4", children: [(0, jsx_runtime_1.jsx)("h3", { className: "mb-2 text-base font-medium", children: "Permission" }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-1 text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-b3-react-muted-foreground", children: [(0, jsx_runtime_1.jsx)("span", { children: `Valid for ` }), (0, jsx_runtime_1.jsx)("span", { children: (0, jsx_runtime_1.jsx)(react_timeago_1.default, { date: DEFAULT_PERMISSIONS.endDate, live: false, formatter: (value, unit) => {
73
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("h2", { className: "mb-2 text-2xl font-bold", children: "Allow Access" }), (0, jsx_runtime_1.jsx)("p", { className: "text-b3-react-muted-foreground opacity-70", children: "This app would like permission to:" })] }), (0, jsx_runtime_1.jsx)(react_1.PermissionItem, { title: "Make transactions on your behalf", description: (0, jsx_runtime_1.jsxs)("span", { children: ["Up to", " ", (0, jsx_runtime_1.jsxs)("span", { className: "text-b3-react-primary font-medium", children: [DEFAULT_PERMISSIONS.nativeTokenLimitPerTransaction, " ETH"] }), " ", "per transaction"] }), icon: (0, jsx_runtime_1.jsx)(lucide_react_1.CreditCard, { className: "h-5 w-5" }) }), (0, jsx_runtime_1.jsx)(react_1.PermissionItem, { title: "View your account", description: "See your wallet address and balance", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Eye, { className: "h-5 w-5" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-b3-react-card rounded-lg border p-5 py-4", children: [(0, jsx_runtime_1.jsx)("h3", { className: "mb-2 text-base font-medium", children: "Approved Contracts" }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-2", children: DEFAULT_PERMISSIONS.approvedTargets.map((target) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-react-background text-b3-react-muted-foreground rounded-md border px-3 py-2 font-mono text-sm", children: (0, formatAddress_1.formatAddress)(target) }), (0, jsx_runtime_1.jsx)("span", { className: "text-b3-react-muted-foreground text-sm", children: "\u2022 Game Contract" })] }, target))) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-b3-react-card rounded-lg border p-5 py-4", children: [(0, jsx_runtime_1.jsx)("h3", { className: "mb-2 text-base font-medium", children: "Permission" }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-1 text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-b3-react-muted-foreground", children: [(0, jsx_runtime_1.jsx)("span", { children: `Valid for ` }), (0, jsx_runtime_1.jsx)("span", { children: (0, jsx_runtime_1.jsx)(react_timeago_1.default, { date: DEFAULT_PERMISSIONS.endDate, live: false, formatter: (value, unit) => {
75
74
  if (unit === "year") {
76
75
  return "1 year";
77
76
  }
@@ -15,7 +15,7 @@ const react_4 = require("thirdweb/react");
15
15
  const ManageAccountButton_1 = require("../custom/ManageAccountButton");
16
16
  function SignIn(props) {
17
17
  const { className } = props;
18
- const { automaticallySetFirstEoa, partnerId } = (0, react_1.useB3)();
18
+ const { automaticallySetFirstEoa, partnerId } = (0, react_1.useB3Config)();
19
19
  const { address: globalAddress, ensName, connectedSmartWallet, connectedEOAWallet, isActiveSmartWallet, isActiveEOAWallet, smartWalletIcon, } = (0, react_1.useAccountWallet)();
20
20
  const { data: walletImage } = (0, react_4.useWalletImage)(connectedEOAWallet?.id);
21
21
  const isMobile = (0, react_1.useIsMobile)();