@b3dotfun/sdk 0.0.88-alpha.10 → 0.0.88-alpha.3

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 (263) hide show
  1. package/dist/cjs/anyspend/constants/index.d.ts +0 -2
  2. package/dist/cjs/anyspend/constants/index.js +1 -3
  3. package/dist/cjs/anyspend/index.d.ts +0 -2
  4. package/dist/cjs/anyspend/index.js +0 -3
  5. package/dist/cjs/anyspend/react/components/AnySpend.d.ts +0 -6
  6. package/dist/cjs/anyspend/react/components/AnySpend.js +6 -9
  7. package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +1 -5
  8. package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
  9. package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +0 -1
  10. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +3 -3
  11. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +0 -6
  12. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +20 -24
  13. package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +1 -7
  14. package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +3 -3
  15. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +0 -4
  16. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +1 -14
  17. package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.d.ts +1 -3
  18. package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +2 -3
  19. package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +0 -4
  20. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +6 -34
  21. package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +1 -3
  22. package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +2 -3
  23. package/dist/cjs/anyspend/react/components/common/PaymentStripeWeb2.js +4 -3
  24. package/dist/cjs/anyspend/react/hooks/index.d.ts +0 -1
  25. package/dist/cjs/anyspend/react/hooks/index.js +0 -1
  26. package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +1 -1
  27. package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.js +1 -1
  28. package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.js +1 -1
  29. package/dist/cjs/anyspend/react/hooks/useValidatedClientReferenceId.js +1 -1
  30. package/dist/cjs/global-account/react/components/B3DynamicModal.js +3 -2
  31. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +18 -2
  32. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +57 -35
  33. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
  34. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +35 -38
  35. package/dist/cjs/global-account/react/components/B3Provider/types.d.ts +27 -0
  36. package/dist/cjs/global-account/react/components/B3Provider/types.js +24 -0
  37. package/dist/cjs/global-account/react/components/B3Provider/useB3.d.ts +4 -14
  38. package/dist/cjs/global-account/react/components/B3Provider/useB3.js +11 -4
  39. package/dist/cjs/global-account/react/components/B3Provider/useB3Account.js +2 -5
  40. package/dist/cjs/global-account/react/components/B3Provider/useB3Config.d.ts +2 -10
  41. package/dist/cjs/global-account/react/components/B3Provider/useB3Config.js +17 -18
  42. package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +2 -1
  43. package/dist/cjs/global-account/react/components/ManageAccount/channels/DiscordChannel.js +6 -6
  44. package/dist/cjs/global-account/react/components/ManageAccount/channels/EmailChannel.js +7 -7
  45. package/dist/cjs/global-account/react/components/ManageAccount/channels/PhoneChannel.js +7 -7
  46. package/dist/cjs/global-account/react/components/ManageAccount/channels/TelegramChannel.js +5 -5
  47. package/dist/cjs/global-account/react/components/RequestPermissions/RequestPermissions.js +9 -8
  48. package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +1 -1
  49. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +15 -11
  50. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +1 -1
  51. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStep.js +1 -1
  52. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +1 -1
  53. package/dist/cjs/global-account/react/components/StyleRoot.js +3 -3
  54. package/dist/cjs/global-account/react/components/custom/ManageAccountButton.js +2 -1
  55. package/dist/cjs/global-account/react/components/index.d.ts +2 -1
  56. package/dist/cjs/global-account/react/components/index.js +6 -3
  57. package/dist/cjs/global-account/react/hooks/index.d.ts +0 -1
  58. package/dist/cjs/global-account/react/hooks/index.js +1 -3
  59. package/dist/cjs/global-account/react/hooks/useAuth.js +2 -1
  60. package/dist/cjs/global-account/react/hooks/useClient.js +1 -1
  61. package/dist/cjs/global-account/react/hooks/useHandleConnectWithPrivy.js +1 -1
  62. package/dist/cjs/global-account/react/hooks/useNotifications.js +14 -14
  63. package/dist/cjs/global-account/react/hooks/useTokenBalance.js +5 -5
  64. package/dist/cjs/global-account/react/hooks/useTokenBalancesByChain.js +2 -4
  65. package/dist/cjs/global-account/react/hooks/useUserQuery.js +35 -9
  66. package/dist/cjs/global-account/react/index.native.d.ts +2 -0
  67. package/dist/cjs/global-account/react/index.native.js +5 -1
  68. package/dist/cjs/global-account/react/stores/index.d.ts +0 -1
  69. package/dist/cjs/global-account/react/stores/index.js +1 -3
  70. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +0 -10
  71. package/dist/esm/anyspend/constants/index.d.ts +0 -2
  72. package/dist/esm/anyspend/constants/index.js +0 -2
  73. package/dist/esm/anyspend/index.d.ts +0 -2
  74. package/dist/esm/anyspend/index.js +0 -3
  75. package/dist/esm/anyspend/react/components/AnySpend.d.ts +0 -6
  76. package/dist/esm/anyspend/react/components/AnySpend.js +8 -11
  77. package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +1 -5
  78. package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
  79. package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +0 -1
  80. package/dist/esm/anyspend/react/components/AnySpendCustom.js +3 -3
  81. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +0 -6
  82. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +4 -8
  83. package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +1 -7
  84. package/dist/esm/anyspend/react/components/AnySpendDeposit.js +3 -3
  85. package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +0 -4
  86. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +1 -14
  87. package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +1 -3
  88. package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +2 -3
  89. package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +0 -4
  90. package/dist/esm/anyspend/react/components/common/OrderDetails.js +8 -36
  91. package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +1 -3
  92. package/dist/esm/anyspend/react/components/common/PanelOnramp.js +2 -3
  93. package/dist/esm/anyspend/react/components/common/PaymentStripeWeb2.js +4 -3
  94. package/dist/esm/anyspend/react/hooks/index.d.ts +0 -1
  95. package/dist/esm/anyspend/react/hooks/index.js +0 -1
  96. package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +2 -2
  97. package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.js +2 -2
  98. package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.js +2 -2
  99. package/dist/esm/anyspend/react/hooks/useValidatedClientReferenceId.js +2 -2
  100. package/dist/esm/global-account/react/components/B3DynamicModal.js +4 -3
  101. package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +18 -2
  102. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +58 -34
  103. package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
  104. package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +36 -36
  105. package/dist/esm/global-account/react/components/B3Provider/types.d.ts +27 -0
  106. package/dist/esm/global-account/react/components/B3Provider/types.js +21 -0
  107. package/dist/esm/global-account/react/components/B3Provider/useB3.d.ts +4 -14
  108. package/dist/esm/global-account/react/components/B3Provider/useB3.js +11 -4
  109. package/dist/esm/global-account/react/components/B3Provider/useB3Account.js +2 -5
  110. package/dist/esm/global-account/react/components/B3Provider/useB3Config.d.ts +2 -10
  111. package/dist/esm/global-account/react/components/B3Provider/useB3Config.js +17 -18
  112. package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +3 -2
  113. package/dist/esm/global-account/react/components/ManageAccount/channels/DiscordChannel.js +2 -2
  114. package/dist/esm/global-account/react/components/ManageAccount/channels/EmailChannel.js +2 -2
  115. package/dist/esm/global-account/react/components/ManageAccount/channels/PhoneChannel.js +2 -2
  116. package/dist/esm/global-account/react/components/ManageAccount/channels/TelegramChannel.js +2 -2
  117. package/dist/esm/global-account/react/components/RequestPermissions/RequestPermissions.js +3 -2
  118. package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +2 -2
  119. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +16 -12
  120. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +2 -2
  121. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStep.js +2 -2
  122. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +2 -2
  123. package/dist/esm/global-account/react/components/StyleRoot.js +3 -3
  124. package/dist/esm/global-account/react/components/custom/ManageAccountButton.js +3 -2
  125. package/dist/esm/global-account/react/components/index.d.ts +2 -1
  126. package/dist/esm/global-account/react/components/index.js +2 -1
  127. package/dist/esm/global-account/react/hooks/index.d.ts +0 -1
  128. package/dist/esm/global-account/react/hooks/index.js +0 -1
  129. package/dist/esm/global-account/react/hooks/useAuth.js +3 -2
  130. package/dist/esm/global-account/react/hooks/useClient.js +2 -2
  131. package/dist/esm/global-account/react/hooks/useHandleConnectWithPrivy.js +2 -2
  132. package/dist/esm/global-account/react/hooks/useNotifications.js +2 -2
  133. package/dist/esm/global-account/react/hooks/useTokenBalance.js +6 -6
  134. package/dist/esm/global-account/react/hooks/useTokenBalancesByChain.js +2 -4
  135. package/dist/esm/global-account/react/hooks/useUserQuery.js +27 -1
  136. package/dist/esm/global-account/react/index.native.d.ts +2 -0
  137. package/dist/esm/global-account/react/index.native.js +2 -0
  138. package/dist/esm/global-account/react/stores/index.d.ts +0 -1
  139. package/dist/esm/global-account/react/stores/index.js +0 -1
  140. package/dist/esm/global-account/react/stores/useModalStore.d.ts +0 -10
  141. package/dist/styles/index.css +1 -1
  142. package/dist/types/anyspend/constants/index.d.ts +0 -2
  143. package/dist/types/anyspend/index.d.ts +0 -2
  144. package/dist/types/anyspend/react/components/AnySpend.d.ts +0 -6
  145. package/dist/types/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +1 -5
  146. package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +0 -1
  147. package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +0 -6
  148. package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +1 -7
  149. package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +0 -4
  150. package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +1 -3
  151. package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +0 -4
  152. package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +1 -3
  153. package/dist/types/anyspend/react/hooks/index.d.ts +0 -1
  154. package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +18 -2
  155. package/dist/types/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
  156. package/dist/types/global-account/react/components/B3Provider/types.d.ts +27 -0
  157. package/dist/types/global-account/react/components/B3Provider/useB3.d.ts +4 -14
  158. package/dist/types/global-account/react/components/B3Provider/useB3Config.d.ts +2 -10
  159. package/dist/types/global-account/react/components/index.d.ts +2 -1
  160. package/dist/types/global-account/react/hooks/index.d.ts +0 -1
  161. package/dist/types/global-account/react/index.native.d.ts +2 -0
  162. package/dist/types/global-account/react/stores/index.d.ts +0 -1
  163. package/dist/types/global-account/react/stores/useModalStore.d.ts +0 -10
  164. package/package.json +1 -1
  165. package/src/anyspend/constants/index.ts +0 -3
  166. package/src/anyspend/index.ts +0 -4
  167. package/src/anyspend/react/components/AnySpend.tsx +2 -28
  168. package/src/anyspend/react/components/AnySpendCollectorClubPurchase.tsx +0 -6
  169. package/src/anyspend/react/components/AnySpendCustom.tsx +47 -52
  170. package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +0 -23
  171. package/src/anyspend/react/components/AnySpendDeposit.tsx +1 -18
  172. package/src/anyspend/react/components/AnyspendDepositHype.tsx +0 -4
  173. package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +1 -15
  174. package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +1 -5
  175. package/src/anyspend/react/components/common/OrderDetails.tsx +42 -60
  176. package/src/anyspend/react/components/common/PanelOnramp.tsx +1 -5
  177. package/src/anyspend/react/components/common/PaymentStripeWeb2.tsx +4 -3
  178. package/src/anyspend/react/hooks/index.ts +0 -1
  179. package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +2 -2
  180. package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +2 -2
  181. package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +2 -2
  182. package/src/anyspend/react/hooks/useValidatedClientReferenceId.ts +2 -2
  183. package/src/global-account/react/components/B3DynamicModal.tsx +4 -3
  184. package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +54 -43
  185. package/src/global-account/react/components/B3Provider/B3Provider.tsx +117 -44
  186. package/src/global-account/react/components/B3Provider/types.ts +50 -0
  187. package/src/global-account/react/components/B3Provider/useB3.ts +13 -4
  188. package/src/global-account/react/components/B3Provider/useB3Account.ts +2 -6
  189. package/src/global-account/react/components/B3Provider/useB3Config.ts +31 -18
  190. package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +4 -2
  191. package/src/global-account/react/components/ManageAccount/channels/DiscordChannel.tsx +2 -2
  192. package/src/global-account/react/components/ManageAccount/channels/EmailChannel.tsx +2 -2
  193. package/src/global-account/react/components/ManageAccount/channels/PhoneChannel.tsx +2 -2
  194. package/src/global-account/react/components/ManageAccount/channels/TelegramChannel.tsx +2 -2
  195. package/src/global-account/react/components/RequestPermissions/RequestPermissions.tsx +4 -4
  196. package/src/global-account/react/components/SignInWithB3/SignIn.tsx +2 -2
  197. package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +14 -11
  198. package/src/global-account/react/components/SignInWithB3/SignInWithB3Privy.tsx +2 -2
  199. package/src/global-account/react/components/SignInWithB3/steps/LoginStep.tsx +2 -2
  200. package/src/global-account/react/components/SignInWithB3/steps/LoginStepCustom.tsx +2 -2
  201. package/src/global-account/react/components/StyleRoot.tsx +3 -3
  202. package/src/global-account/react/components/custom/ManageAccountButton.tsx +3 -2
  203. package/src/global-account/react/components/index.ts +2 -1
  204. package/src/global-account/react/hooks/index.ts +0 -1
  205. package/src/global-account/react/hooks/useAuth.ts +3 -2
  206. package/src/global-account/react/hooks/useClient.ts +2 -2
  207. package/src/global-account/react/hooks/useHandleConnectWithPrivy.tsx +2 -2
  208. package/src/global-account/react/hooks/useNotifications.ts +2 -2
  209. package/src/global-account/react/hooks/useTokenBalance.tsx +7 -8
  210. package/src/global-account/react/hooks/useTokenBalancesByChain.tsx +2 -4
  211. package/src/global-account/react/hooks/useUserQuery.ts +40 -1
  212. package/src/global-account/react/index.native.ts +2 -0
  213. package/src/global-account/react/stores/index.ts +0 -1
  214. package/src/global-account/react/stores/useModalStore.ts +0 -10
  215. package/dist/cjs/anyspend/react/components/common/GasIndicator.d.ts +0 -6
  216. package/dist/cjs/anyspend/react/components/common/GasIndicator.js +0 -34
  217. package/dist/cjs/anyspend/react/hooks/useGasPrice.d.ts +0 -37
  218. package/dist/cjs/anyspend/react/hooks/useGasPrice.js +0 -43
  219. package/dist/cjs/anyspend/services/gas.d.ts +0 -21
  220. package/dist/cjs/anyspend/services/gas.js +0 -65
  221. package/dist/cjs/anyspend/types/gas.d.ts +0 -61
  222. package/dist/cjs/anyspend/types/gas.js +0 -2
  223. package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +0 -5
  224. package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.js +0 -12
  225. package/dist/cjs/global-account/react/hooks/useUser.d.ts +0 -60
  226. package/dist/cjs/global-account/react/hooks/useUser.js +0 -20
  227. package/dist/cjs/global-account/react/stores/configStore.d.ts +0 -24
  228. package/dist/cjs/global-account/react/stores/configStore.js +0 -30
  229. package/dist/cjs/global-account/react/stores/userStore.d.ts +0 -22
  230. package/dist/cjs/global-account/react/stores/userStore.js +0 -30
  231. package/dist/esm/anyspend/react/components/common/GasIndicator.d.ts +0 -6
  232. package/dist/esm/anyspend/react/components/common/GasIndicator.js +0 -31
  233. package/dist/esm/anyspend/react/hooks/useGasPrice.d.ts +0 -37
  234. package/dist/esm/anyspend/react/hooks/useGasPrice.js +0 -40
  235. package/dist/esm/anyspend/services/gas.d.ts +0 -21
  236. package/dist/esm/anyspend/services/gas.js +0 -59
  237. package/dist/esm/anyspend/types/gas.d.ts +0 -61
  238. package/dist/esm/anyspend/types/gas.js +0 -1
  239. package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +0 -5
  240. package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.js +0 -10
  241. package/dist/esm/global-account/react/hooks/useUser.d.ts +0 -60
  242. package/dist/esm/global-account/react/hooks/useUser.js +0 -17
  243. package/dist/esm/global-account/react/stores/configStore.d.ts +0 -24
  244. package/dist/esm/global-account/react/stores/configStore.js +0 -27
  245. package/dist/esm/global-account/react/stores/userStore.d.ts +0 -22
  246. package/dist/esm/global-account/react/stores/userStore.js +0 -27
  247. package/dist/types/anyspend/react/components/common/GasIndicator.d.ts +0 -6
  248. package/dist/types/anyspend/react/hooks/useGasPrice.d.ts +0 -37
  249. package/dist/types/anyspend/services/gas.d.ts +0 -21
  250. package/dist/types/anyspend/types/gas.d.ts +0 -61
  251. package/dist/types/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +0 -5
  252. package/dist/types/global-account/react/hooks/useUser.d.ts +0 -60
  253. package/dist/types/global-account/react/stores/configStore.d.ts +0 -24
  254. package/dist/types/global-account/react/stores/userStore.d.ts +0 -22
  255. package/src/anyspend/react/components/common/GasIndicator.tsx +0 -59
  256. package/src/anyspend/react/hooks/useGasPrice.ts +0 -70
  257. package/src/anyspend/services/gas.test.ts +0 -31
  258. package/src/anyspend/services/gas.ts +0 -73
  259. package/src/anyspend/types/gas.ts +0 -66
  260. package/src/global-account/react/components/B3Provider/AuthenticationProvider.tsx +0 -19
  261. package/src/global-account/react/hooks/useUser.ts +0 -20
  262. package/src/global-account/react/stores/configStore.ts +0 -51
  263. package/src/global-account/react/stores/userStore.ts +0 -41
@@ -1,61 +0,0 @@
1
- /** Gas level classification based on historical percentiles */
2
- export type GasLevel = "low" | "normal" | "elevated" | "high" | "spike";
3
- /** Gas prices in Gwei for different speed tiers */
4
- export interface GasPrices {
5
- low: string;
6
- standard: string;
7
- fast: string;
8
- instant?: string;
9
- }
10
- /** EIP-1559 specific gas data */
11
- export interface Eip1559Data {
12
- baseFee: string;
13
- maxPriorityFee: GasPrices;
14
- maxFee: GasPrices;
15
- }
16
- /** Spike analysis comparing current gas to historical data */
17
- export interface GasSpikeAnalysis {
18
- level: GasLevel;
19
- percentile: number;
20
- /** Ratio to 1h median (primary spike detection) */
21
- vs1h: number;
22
- /** Ratio to 4h median (short-term context) */
23
- vs4h: number;
24
- /** Ratio to 24h median (daily context) */
25
- vs24h: number;
26
- recommendation: string;
27
- }
28
- /** Full gas response from the gas oracle */
29
- export interface GasOracleResponse {
30
- chainId: number;
31
- chainName: string;
32
- timestamp: string;
33
- blockNumber?: number;
34
- source: "blocknative" | "rpc";
35
- gasPrice: GasPrices;
36
- eip1559?: Eip1559Data;
37
- analysis: GasSpikeAnalysis;
38
- cached: boolean;
39
- cacheAge?: number;
40
- }
41
- /** Simplified gas data for UI display */
42
- export interface GasPriceData {
43
- chainId: number;
44
- chainName: string;
45
- /** Standard gas price in Gwei */
46
- gasPriceGwei: string;
47
- /** Base fee in Gwei (EIP-1559 chains) */
48
- baseFeeGwei?: string;
49
- /** Gas level classification */
50
- level: GasLevel;
51
- /** Whether gas is currently spiking (elevated, high, or spike) */
52
- isSpike: boolean;
53
- /** Human-readable recommendation */
54
- recommendation: string;
55
- /** Ratio to recent median (1 = normal, >1.5 = elevated) */
56
- vsMedian: number;
57
- /** Data source */
58
- source: "blocknative" | "rpc";
59
- /** Timestamp of the data */
60
- timestamp: string;
61
- }
@@ -1,5 +0,0 @@
1
- declare const AuthenticationProvider: ({ partnerId, automaticallySetFirstEoa, }: {
2
- partnerId: string;
3
- automaticallySetFirstEoa: boolean;
4
- }) => null;
5
- export default AuthenticationProvider;
@@ -1,60 +0,0 @@
1
- /**
2
- * Preferred Hook to get the user data
3
- */
4
- export declare function useUser(): {
5
- user: {
6
- email?: string | undefined;
7
- username?: string | undefined;
8
- telNumber?: string | undefined;
9
- ens?: string | undefined;
10
- avatar?: string | undefined;
11
- preferences?: {} | undefined;
12
- referredBy?: string | {} | undefined;
13
- sourceApp?: string | undefined;
14
- referralCode?: string | undefined;
15
- userGroups?: number[] | undefined;
16
- isMigratedFromBSMNT?: boolean | undefined;
17
- privyLinkedAccounts?: {
18
- name?: string | undefined;
19
- address?: string | undefined;
20
- email?: string | undefined;
21
- chain_type?: string | undefined;
22
- lv?: number | undefined;
23
- wallet_client_type?: string | undefined;
24
- smart_wallet_type?: string | undefined;
25
- subject?: string | undefined;
26
- type: string;
27
- }[] | undefined;
28
- twProfiles?: {
29
- type: string;
30
- details: {
31
- id?: string | undefined;
32
- name?: string | undefined;
33
- address?: string | undefined;
34
- email?: string | undefined;
35
- username?: string | undefined;
36
- phone?: string | undefined;
37
- fid?: string | undefined;
38
- };
39
- }[] | undefined;
40
- turnkeySubOrgs?: {
41
- hasDelegatedUser?: boolean | undefined;
42
- subOrgId: string;
43
- accounts: Record<string, any>[];
44
- }[] | undefined;
45
- _id: string | {};
46
- userId: string;
47
- smartAccountAddress: string;
48
- createdAt: number;
49
- updatedAt: number;
50
- partnerIds: {
51
- privyId?: string | undefined;
52
- thirdwebId?: string | undefined;
53
- turnkeyId?: string | undefined;
54
- turnkeyOtpId?: string | undefined;
55
- };
56
- } | null;
57
- isConnecting: boolean;
58
- isConnected: boolean;
59
- isAuthenticating: boolean;
60
- };
@@ -1,24 +0,0 @@
1
- import { CreateOnrampOrderParams } from "@b3dotfun/sdk/anyspend/react/hooks/useAnyspendCreateOnrampOrder";
2
- import { CreateOrderParams } from "@b3dotfun/sdk/anyspend/react/hooks/useAnyspendCreateOrder";
3
- import { PermissionsConfig } from "@b3dotfun/sdk/global-account/types/permissions";
4
- import { Account } from "thirdweb/wallets";
5
- import { ClientType } from "../../client-manager";
6
- interface ConfigStore {
7
- accountOverride?: Account;
8
- automaticallySetFirstEoa: boolean;
9
- environment: "development" | "production";
10
- defaultPermissions: PermissionsConfig;
11
- theme: "light" | "dark";
12
- clientType: ClientType;
13
- partnerId: string;
14
- stripePublishableKey?: string;
15
- createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
16
- enableTurnkey: boolean;
17
- setConfig: (config: Partial<Omit<ConfigStore, "setConfig">>) => void;
18
- }
19
- /**
20
- * Zustand store for B3 configuration
21
- * NOT persisted - these are developer-set configuration values
22
- */
23
- export declare const useB3ConfigStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ConfigStore>>;
24
- export {};
@@ -1,22 +0,0 @@
1
- import { Users } from "@b3dotfun/b3-api";
2
- interface UserStore {
3
- user: Users | null;
4
- setUser: (user: Users | undefined) => void;
5
- clearUser: () => void;
6
- }
7
- /**
8
- * Zustand store for managing user state
9
- * Persists user data to localStorage
10
- */
11
- export declare const useUserStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<UserStore>, "persist"> & {
12
- persist: {
13
- setOptions: (options: Partial<import("zustand/middleware").PersistOptions<UserStore, UserStore>>) => void;
14
- clearStorage: () => void;
15
- rehydrate: () => Promise<void> | void;
16
- hasHydrated: () => boolean;
17
- onHydrate: (fn: (state: UserStore) => void) => () => void;
18
- onFinishHydration: (fn: (state: UserStore) => void) => () => void;
19
- getOptions: () => Partial<import("zustand/middleware").PersistOptions<UserStore, UserStore>>;
20
- };
21
- }>;
22
- export {};
@@ -1,59 +0,0 @@
1
- "use client";
2
-
3
- import { cn } from "@b3dotfun/sdk/shared/utils/cn";
4
- import { motion } from "motion/react";
5
- import type { GasPriceData } from "../../../types/gas";
6
-
7
- export interface GasIndicatorProps {
8
- gasPrice: GasPriceData;
9
- className?: string;
10
- }
11
-
12
- const LEVEL_LABELS: Record<GasPriceData["level"], string> = {
13
- low: "Low",
14
- normal: "Normal",
15
- elevated: "Elevated",
16
- high: "High",
17
- spike: "Spike",
18
- };
19
-
20
- const LEVEL_STYLES: Record<GasPriceData["level"], string> = {
21
- low: "bg-green-500/20 text-green-500",
22
- normal: "bg-as-surface-tertiary text-as-secondary",
23
- elevated: "bg-yellow-500/20 text-yellow-600",
24
- high: "bg-orange-500/20 text-orange-500",
25
- spike: "bg-red-500/20 text-red-500",
26
- };
27
-
28
- function formatGasPrice(gweiString: string): string {
29
- const gwei = parseFloat(gweiString);
30
- if (gwei < 0.001) return "<0.001";
31
- if (gwei < 1) return gwei.toFixed(3);
32
- if (gwei < 10) return gwei.toFixed(2);
33
- return gwei.toFixed(1);
34
- }
35
-
36
- export function GasIndicator({ gasPrice, className }: GasIndicatorProps) {
37
- return (
38
- <motion.div
39
- initial={{ opacity: 0, y: 10 }}
40
- animate={{ opacity: 1, y: 0 }}
41
- transition={{ duration: 0.2 }}
42
- className={cn(
43
- "flex items-center justify-between rounded-lg px-3 py-2",
44
- gasPrice.isSpike ? "bg-yellow-500/10" : "bg-as-surface-secondary",
45
- className,
46
- )}
47
- >
48
- <div className="flex items-center gap-2">
49
- <span className="text-as-secondary text-xs">Gas on {gasPrice.chainName}</span>
50
- </div>
51
- <div className="flex items-center gap-2">
52
- <span className={cn("rounded px-1.5 py-0.5 text-xs font-medium", LEVEL_STYLES[gasPrice.level])}>
53
- {LEVEL_LABELS[gasPrice.level]}
54
- </span>
55
- <span className="text-as-primary text-xs font-medium">{formatGasPrice(gasPrice.gasPriceGwei)} Gwei</span>
56
- </div>
57
- </motion.div>
58
- );
59
- }
@@ -1,70 +0,0 @@
1
- import { useQuery } from "@tanstack/react-query";
2
- import { useMemo } from "react";
3
- import { gasService, isGasOracleSupported } from "../../services/gas";
4
- import type { GasPriceData } from "../../types/gas";
5
-
6
- export interface UseGasPriceOptions {
7
- /** Refetch interval in ms (default: 10000 = 10s) */
8
- refetchInterval?: number;
9
- /** Whether to enable the query (default: true if chainId is supported) */
10
- enabled?: boolean;
11
- }
12
-
13
- export interface UseGasPriceResult {
14
- /** Gas price data */
15
- gasPrice: GasPriceData | undefined;
16
- /** Whether the query is loading */
17
- isLoading: boolean;
18
- /** Whether there's an error */
19
- isError: boolean;
20
- /** Error object if any */
21
- error: Error | null;
22
- /** Whether gas is currently spiking */
23
- isSpike: boolean;
24
- /** Refetch function */
25
- refetch: () => void;
26
- }
27
-
28
- /**
29
- * React hook to fetch current gas price for a chain.
30
- *
31
- * @param chainId - The chain ID to fetch gas price for
32
- * @param options - Optional configuration
33
- *
34
- * @example
35
- * ```tsx
36
- * const { gasPrice, isSpike, isLoading } = useGasPrice(8453); // Base
37
- *
38
- * if (isSpike) {
39
- * return <Warning>Gas prices are high: {gasPrice?.recommendation}</Warning>;
40
- * }
41
- * ```
42
- */
43
- export function useGasPrice(chainId: number | undefined, options: UseGasPriceOptions = {}): UseGasPriceResult {
44
- const { refetchInterval = 10000, enabled } = options;
45
-
46
- const isSupported = chainId !== undefined && isGasOracleSupported(chainId);
47
- const queryEnabled = enabled ?? isSupported;
48
-
49
- const { data, isLoading, isError, error, refetch } = useQuery({
50
- queryKey: ["gasPrice", chainId],
51
- queryFn: () => gasService.fetch(chainId as number),
52
- enabled: queryEnabled && chainId !== undefined,
53
- refetchInterval,
54
- staleTime: 5000, // Consider data fresh for 5s
55
- retry: 2,
56
- refetchOnWindowFocus: true,
57
- });
58
-
59
- return useMemo(
60
- () => ({
61
- gasPrice: data,
62
- isLoading,
63
- isError,
64
- error: error as Error | null,
65
- isSpike: data?.isSpike ?? false,
66
- refetch,
67
- }),
68
- [data, isLoading, isError, error, refetch],
69
- );
70
- }
@@ -1,31 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import { gasService, isGasOracleSupported } from "./gas";
3
-
4
- describe("gasService", () => {
5
- it("should check supported chains", () => {
6
- expect(isGasOracleSupported(8453)).toBe(true); // Base
7
- expect(isGasOracleSupported(1)).toBe(true); // Ethereum
8
- expect(isGasOracleSupported(999999)).toBe(false); // Unknown
9
- });
10
-
11
- it("should fetch gas price for Base", async () => {
12
- const gas = await gasService.fetch(8453);
13
-
14
- console.log("Gas data:", gas);
15
-
16
- expect(gas.chainId).toBe(8453);
17
- expect(gas.chainName).toBe("Base");
18
- expect(gas.level).toMatch(/low|normal|elevated|high|spike/);
19
- expect(typeof gas.gasPriceGwei).toBe("string");
20
- expect(typeof gas.isSpike).toBe("boolean");
21
- });
22
-
23
- it("should fetch gas price for Ethereum", async () => {
24
- const gas = await gasService.fetch(1);
25
-
26
- console.log("ETH Gas:", gas);
27
-
28
- expect(gas.chainId).toBe(1);
29
- expect(gas.source).toBe("blocknative"); // ETH uses Blocknative
30
- });
31
- });
@@ -1,73 +0,0 @@
1
- import { GAS_ORACLE_BASE_URL } from "../constants";
2
- import type { GasOracleResponse, GasPriceData } from "../types/gas";
3
-
4
- /** Supported chain IDs for gas oracle */
5
- export const GAS_ORACLE_SUPPORTED_CHAINS = [
6
- 1, // Ethereum
7
- 137, // Polygon
8
- 42161, // Arbitrum
9
- 8453, // Base
10
- 56, // BSC
11
- 10, // Optimism
12
- 43114, // Avalanche
13
- 8333, // B3
14
- 2741, // Abstract
15
- 4689, // IoTeX
16
- 3338, // Peaq
17
- 1329, // Sei
18
- ] as const;
19
-
20
- export type GasOracleSupportedChainId = (typeof GAS_ORACLE_SUPPORTED_CHAINS)[number];
21
-
22
- /** Check if a chain is supported by the gas oracle */
23
- export function isGasOracleSupported(chainId: number): chainId is GasOracleSupportedChainId {
24
- return GAS_ORACLE_SUPPORTED_CHAINS.includes(chainId as GasOracleSupportedChainId);
25
- }
26
-
27
- /** Fetch gas price data from the gas oracle */
28
- export async function fetchGasPrice(chainId: number): Promise<GasOracleResponse> {
29
- const response = await fetch(`${GAS_ORACLE_BASE_URL}/gas/${chainId}`);
30
-
31
- if (!response.ok) {
32
- throw new Error(`Failed to fetch gas price for chain ${chainId}: ${response.status}`);
33
- }
34
-
35
- return response.json();
36
- }
37
-
38
- /** Transform raw oracle response to simplified UI data */
39
- export function toGasPriceData(response: GasOracleResponse): GasPriceData {
40
- const { analysis } = response;
41
- const isSpike = analysis.level === "elevated" || analysis.level === "high" || analysis.level === "spike";
42
-
43
- return {
44
- chainId: response.chainId,
45
- chainName: response.chainName,
46
- gasPriceGwei: response.gasPrice.standard,
47
- baseFeeGwei: response.eip1559?.baseFee,
48
- level: analysis.level,
49
- isSpike,
50
- recommendation: analysis.recommendation,
51
- vsMedian: analysis.vs1h, // Use 1h as primary comparison
52
- source: response.source,
53
- timestamp: response.timestamp,
54
- };
55
- }
56
-
57
- /** Gas service for fetching and transforming gas data */
58
- export const gasService = {
59
- /** Fetch raw gas oracle response */
60
- fetchRaw: fetchGasPrice,
61
-
62
- /** Fetch and transform to UI-friendly format */
63
- fetch: async (chainId: number): Promise<GasPriceData> => {
64
- const response = await fetchGasPrice(chainId);
65
- return toGasPriceData(response);
66
- },
67
-
68
- /** Check if chain is supported */
69
- isSupported: isGasOracleSupported,
70
-
71
- /** List of supported chain IDs */
72
- supportedChains: GAS_ORACLE_SUPPORTED_CHAINS,
73
- };
@@ -1,66 +0,0 @@
1
- /** Gas level classification based on historical percentiles */
2
- export type GasLevel = "low" | "normal" | "elevated" | "high" | "spike";
3
-
4
- /** Gas prices in Gwei for different speed tiers */
5
- export interface GasPrices {
6
- low: string;
7
- standard: string;
8
- fast: string;
9
- instant?: string;
10
- }
11
-
12
- /** EIP-1559 specific gas data */
13
- export interface Eip1559Data {
14
- baseFee: string;
15
- maxPriorityFee: GasPrices;
16
- maxFee: GasPrices;
17
- }
18
-
19
- /** Spike analysis comparing current gas to historical data */
20
- export interface GasSpikeAnalysis {
21
- level: GasLevel;
22
- percentile: number;
23
- /** Ratio to 1h median (primary spike detection) */
24
- vs1h: number;
25
- /** Ratio to 4h median (short-term context) */
26
- vs4h: number;
27
- /** Ratio to 24h median (daily context) */
28
- vs24h: number;
29
- recommendation: string;
30
- }
31
-
32
- /** Full gas response from the gas oracle */
33
- export interface GasOracleResponse {
34
- chainId: number;
35
- chainName: string;
36
- timestamp: string;
37
- blockNumber?: number;
38
- source: "blocknative" | "rpc";
39
- gasPrice: GasPrices;
40
- eip1559?: Eip1559Data;
41
- analysis: GasSpikeAnalysis;
42
- cached: boolean;
43
- cacheAge?: number;
44
- }
45
-
46
- /** Simplified gas data for UI display */
47
- export interface GasPriceData {
48
- chainId: number;
49
- chainName: string;
50
- /** Standard gas price in Gwei */
51
- gasPriceGwei: string;
52
- /** Base fee in Gwei (EIP-1559 chains) */
53
- baseFeeGwei?: string;
54
- /** Gas level classification */
55
- level: GasLevel;
56
- /** Whether gas is currently spiking (elevated, high, or spike) */
57
- isSpike: boolean;
58
- /** Human-readable recommendation */
59
- recommendation: string;
60
- /** Ratio to recent median (1 = normal, >1.5 = elevated) */
61
- vsMedian: number;
62
- /** Data source */
63
- source: "blocknative" | "rpc";
64
- /** Timestamp of the data */
65
- timestamp: string;
66
- }
@@ -1,19 +0,0 @@
1
- import { useAuthentication } from "../../hooks";
2
- import { useAutoSelectWallet } from "../../hooks/useAutoSelectWallet";
3
-
4
- const AuthenticationProvider = ({
5
- partnerId,
6
- automaticallySetFirstEoa,
7
- }: {
8
- partnerId: string;
9
- automaticallySetFirstEoa: boolean;
10
- }) => {
11
- useAuthentication(partnerId);
12
- useAutoSelectWallet({
13
- enabled: automaticallySetFirstEoa,
14
- });
15
-
16
- return null;
17
- };
18
-
19
- export default AuthenticationProvider;
@@ -1,20 +0,0 @@
1
- import { useAuthStore } from "@b3dotfun/sdk/global-account/react";
2
- import { useUserStore } from "../stores/userStore";
3
-
4
- /**
5
- * Preferred Hook to get the user data
6
- */
7
- export function useUser() {
8
- const user = useUserStore(state => state.user);
9
-
10
- const isConnecting = useAuthStore(state => state.isConnecting);
11
- const isConnected = useAuthStore(state => state.isConnected);
12
- const isAuthenticating = useAuthStore(state => state.isAuthenticating);
13
-
14
- return {
15
- user,
16
- isConnecting,
17
- isConnected,
18
- isAuthenticating,
19
- };
20
- }
@@ -1,51 +0,0 @@
1
- import { CreateOnrampOrderParams } from "@b3dotfun/sdk/anyspend/react/hooks/useAnyspendCreateOnrampOrder";
2
- import { CreateOrderParams } from "@b3dotfun/sdk/anyspend/react/hooks/useAnyspendCreateOrder";
3
- import { PermissionsConfig } from "@b3dotfun/sdk/global-account/types/permissions";
4
- import { Account } from "thirdweb/wallets";
5
- import { create } from "zustand";
6
- import { ClientType } from "../../client-manager";
7
-
8
- /**
9
- * Default permissions configuration for B3 provider
10
- */
11
- const DEFAULT_PERMISSIONS: PermissionsConfig = {
12
- approvedTargets: ["0xa8e42121e318e3D3BeD7f5969AF6D360045317DD"],
13
- nativeTokenLimitPerTransaction: 0.1,
14
- startDate: new Date(),
15
- endDate: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365), // 1 year from now
16
- };
17
-
18
- interface ConfigStore {
19
- accountOverride?: Account;
20
- automaticallySetFirstEoa: boolean;
21
- environment: "development" | "production";
22
- defaultPermissions: PermissionsConfig;
23
- theme: "light" | "dark";
24
- clientType: ClientType;
25
- partnerId: string;
26
- stripePublishableKey?: string;
27
- createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
28
- enableTurnkey: boolean;
29
-
30
- // Actions
31
- setConfig: (config: Partial<Omit<ConfigStore, "setConfig">>) => void;
32
- }
33
-
34
- /**
35
- * Zustand store for B3 configuration
36
- * NOT persisted - these are developer-set configuration values
37
- */
38
- export const useB3ConfigStore = create<ConfigStore>(set => ({
39
- accountOverride: undefined,
40
- automaticallySetFirstEoa: false,
41
- environment: "development",
42
- defaultPermissions: DEFAULT_PERMISSIONS,
43
- theme: "light",
44
- clientType: "rest",
45
- partnerId: "",
46
- stripePublishableKey: undefined,
47
- createClientReferenceId: undefined,
48
- enableTurnkey: false,
49
-
50
- setConfig: config => set(state => ({ ...state, ...config })),
51
- }));
@@ -1,41 +0,0 @@
1
- import { Users } from "@b3dotfun/b3-api";
2
- import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
3
- import { create } from "zustand";
4
- import { persist } from "zustand/middleware";
5
-
6
- const debug = debugB3React("useUserQuery");
7
-
8
- interface UserStore {
9
- user: Users | null;
10
- setUser: (user: Users | undefined) => void;
11
- clearUser: () => void;
12
- }
13
-
14
- /**
15
- * Zustand store for managing user state
16
- * Persists user data to localStorage
17
- */
18
- export const useUserStore = create<UserStore>()(
19
- persist(
20
- set => ({
21
- user: null,
22
- setUser: (newUser: Users | undefined) => {
23
- const userToSave = newUser ?? null;
24
- set({ user: userToSave });
25
- debug("User updated", userToSave);
26
- },
27
- clearUser: () => {
28
- set({ user: null });
29
- debug("User cleared");
30
- },
31
- }),
32
- {
33
- name: "b3-user",
34
- onRehydrateStorage: () => (_, error) => {
35
- if (error) {
36
- console.warn("Failed to rehydrate user store:", error);
37
- }
38
- },
39
- },
40
- ),
41
- );