@b3dotfun/sdk 0.1.70-alpha.1 → 0.1.70-alpha.11

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 (292) hide show
  1. package/constants/chains/b3Chain.js +3 -1
  2. package/dist/cjs/anyspend/constants/rpc.d.ts +2 -1
  3. package/dist/cjs/anyspend/constants/rpc.js +4 -2
  4. package/dist/cjs/anyspend/react/components/AnySpendBondKit.d.ts +1 -1
  5. package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +2 -2
  6. package/dist/cjs/anyspend/react/components/AnySpendBuySpin.d.ts +2 -1
  7. package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +2 -2
  8. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +2 -0
  9. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +21 -14
  10. package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +9 -3
  11. package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.d.ts +2 -1
  12. package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.js +2 -2
  13. package/dist/cjs/anyspend/react/components/AnySpendStakeB3.d.ts +2 -1
  14. package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +2 -2
  15. package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +2 -1
  16. package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
  17. package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
  18. package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
  19. package/dist/cjs/anyspend/react/components/AnySpendWorkflowTrigger.d.ts +3 -1
  20. package/dist/cjs/anyspend/react/components/AnySpendWorkflowTrigger.js +2 -2
  21. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
  22. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +2 -2
  23. package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.d.ts +2 -1
  24. package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.js +2 -2
  25. package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckout.d.ts +3 -1
  26. package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckout.js +2 -2
  27. package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +3 -1
  28. package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckoutTrigger.js +2 -2
  29. package/dist/cjs/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +3 -1
  30. package/dist/cjs/anyspend/react/components/checkout/CheckoutPaymentPanel.js +13 -3
  31. package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +3 -3
  32. package/dist/cjs/anyspend/utils/chain.d.ts +39 -1
  33. package/dist/cjs/anyspend/utils/chain.js +23 -2
  34. package/dist/cjs/anyspend/utils/token.d.ts +2 -0
  35. package/dist/cjs/anyspend/utils/token.js +15 -1
  36. package/dist/cjs/app.shared.d.ts +9 -1
  37. package/dist/cjs/app.shared.js +19 -0
  38. package/dist/cjs/global-account/app.native.d.ts +1 -1
  39. package/dist/cjs/global-account/better-auth-client.d.ts +3314 -36
  40. package/dist/cjs/global-account/better-auth-client.js +28 -3
  41. package/dist/cjs/global-account/bsmnt.d.ts +2 -2
  42. package/dist/cjs/global-account/bsmnt.native.d.ts +1 -1
  43. package/dist/cjs/global-account/client-manager.d.ts +7 -5
  44. package/dist/cjs/global-account/client-manager.js +19 -4
  45. package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +6 -11
  46. package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +1 -5
  47. package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.js +1 -2
  48. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +8 -13
  49. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +24 -3
  50. package/dist/cjs/global-account/react/components/B3Provider/BetterAuthProvider.js +48 -8
  51. package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +1 -1
  52. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -5
  53. package/dist/cjs/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +3 -2
  54. package/dist/cjs/global-account/react/components/SignInWithB3/utils/signInUtils.js +1 -3
  55. package/dist/cjs/global-account/react/components/index.d.ts +0 -2
  56. package/dist/cjs/global-account/react/components/index.js +3 -7
  57. package/dist/cjs/global-account/react/hooks/index.d.ts +0 -1
  58. package/dist/cjs/global-account/react/hooks/index.js +2 -4
  59. package/dist/cjs/global-account/react/hooks/useAuth.d.ts +3 -3
  60. package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +1 -1
  61. package/dist/cjs/global-account/react/hooks/useAuthentication.js +1 -1
  62. package/dist/cjs/global-account/react/hooks/useBetterAuth.d.ts +1656 -21
  63. package/dist/cjs/global-account/react/hooks/useBetterAuth.js +13 -14
  64. package/dist/cjs/global-account/react/hooks/useClient.d.ts +3 -3
  65. package/dist/cjs/global-account/react/hooks/useNativeBalance.js +2 -2
  66. package/dist/cjs/global-account/react/hooks/useSiwe.d.ts +1 -1
  67. package/dist/cjs/global-account/react/hooks/useSiwe.native.d.ts +1 -1
  68. package/dist/cjs/global-account/react/hooks/useTWAuth.d.ts +1 -1
  69. package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +20 -17
  70. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +28 -0
  71. package/dist/cjs/global-account/types/b3-api.types.d.ts +5 -0
  72. package/dist/cjs/global-account/types/feature-flags.d.ts +5 -5
  73. package/dist/cjs/notifications/services/api.js +1 -0
  74. package/dist/cjs/shared/constants/chains/b3Chain.d.ts +6 -54
  75. package/dist/cjs/shared/constants/chains/b3Chain.js +5 -41
  76. package/dist/cjs/shared/constants/chains/supported.d.ts +1 -49
  77. package/dist/cjs/shared/constants/chains/supported.js +8 -36
  78. package/dist/cjs/shared/utils/chain-transformers.d.ts +4 -4
  79. package/dist/cjs/shared/utils/chain-transformers.js +38 -37
  80. package/dist/cjs/shared/utils/thirdweb-insights.js +2 -2
  81. package/dist/cjs/shared/utils/upload.d.ts +9 -0
  82. package/dist/cjs/shared/utils/upload.js +34 -0
  83. package/dist/esm/anyspend/constants/rpc.d.ts +2 -1
  84. package/dist/esm/anyspend/constants/rpc.js +3 -1
  85. package/dist/esm/anyspend/react/components/AnySpendBondKit.d.ts +1 -1
  86. package/dist/esm/anyspend/react/components/AnySpendBondKit.js +2 -2
  87. package/dist/esm/anyspend/react/components/AnySpendBuySpin.d.ts +2 -1
  88. package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +2 -2
  89. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +2 -0
  90. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +21 -14
  91. package/dist/esm/anyspend/react/components/AnySpendDeposit.js +10 -4
  92. package/dist/esm/anyspend/react/components/AnySpendDepositUpside.d.ts +2 -1
  93. package/dist/esm/anyspend/react/components/AnySpendDepositUpside.js +2 -2
  94. package/dist/esm/anyspend/react/components/AnySpendStakeB3.d.ts +2 -1
  95. package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +2 -2
  96. package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +2 -1
  97. package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
  98. package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
  99. package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
  100. package/dist/esm/anyspend/react/components/AnySpendWorkflowTrigger.d.ts +3 -1
  101. package/dist/esm/anyspend/react/components/AnySpendWorkflowTrigger.js +2 -2
  102. package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
  103. package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +2 -2
  104. package/dist/esm/anyspend/react/components/AnyspendSignatureMint.d.ts +2 -1
  105. package/dist/esm/anyspend/react/components/AnyspendSignatureMint.js +2 -2
  106. package/dist/esm/anyspend/react/components/checkout/AnySpendCheckout.d.ts +3 -1
  107. package/dist/esm/anyspend/react/components/checkout/AnySpendCheckout.js +2 -2
  108. package/dist/esm/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +3 -1
  109. package/dist/esm/anyspend/react/components/checkout/AnySpendCheckoutTrigger.js +2 -2
  110. package/dist/esm/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +3 -1
  111. package/dist/esm/anyspend/react/components/checkout/CheckoutPaymentPanel.js +14 -4
  112. package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +3 -3
  113. package/dist/esm/anyspend/utils/chain.d.ts +39 -1
  114. package/dist/esm/anyspend/utils/chain.js +24 -3
  115. package/dist/esm/anyspend/utils/token.d.ts +2 -0
  116. package/dist/esm/anyspend/utils/token.js +13 -0
  117. package/dist/esm/app.shared.d.ts +9 -1
  118. package/dist/esm/app.shared.js +17 -0
  119. package/dist/esm/global-account/app.native.d.ts +1 -1
  120. package/dist/esm/global-account/better-auth-client.d.ts +3314 -36
  121. package/dist/esm/global-account/better-auth-client.js +27 -4
  122. package/dist/esm/global-account/bsmnt.d.ts +2 -2
  123. package/dist/esm/global-account/bsmnt.native.d.ts +1 -1
  124. package/dist/esm/global-account/client-manager.d.ts +7 -5
  125. package/dist/esm/global-account/client-manager.js +19 -5
  126. package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +6 -11
  127. package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +1 -5
  128. package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.js +1 -2
  129. package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +8 -13
  130. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +25 -4
  131. package/dist/esm/global-account/react/components/B3Provider/BetterAuthProvider.js +48 -8
  132. package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +1 -1
  133. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -5
  134. package/dist/esm/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +3 -2
  135. package/dist/esm/global-account/react/components/SignInWithB3/utils/signInUtils.js +1 -3
  136. package/dist/esm/global-account/react/components/index.d.ts +0 -2
  137. package/dist/esm/global-account/react/components/index.js +0 -2
  138. package/dist/esm/global-account/react/hooks/index.d.ts +0 -1
  139. package/dist/esm/global-account/react/hooks/index.js +0 -1
  140. package/dist/esm/global-account/react/hooks/useAuth.d.ts +3 -3
  141. package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +1 -1
  142. package/dist/esm/global-account/react/hooks/useAuthentication.js +1 -1
  143. package/dist/esm/global-account/react/hooks/useBetterAuth.d.ts +1656 -21
  144. package/dist/esm/global-account/react/hooks/useBetterAuth.js +13 -14
  145. package/dist/esm/global-account/react/hooks/useClient.d.ts +3 -3
  146. package/dist/esm/global-account/react/hooks/useNativeBalance.js +1 -1
  147. package/dist/esm/global-account/react/hooks/useSiwe.d.ts +1 -1
  148. package/dist/esm/global-account/react/hooks/useSiwe.native.d.ts +1 -1
  149. package/dist/esm/global-account/react/hooks/useTWAuth.d.ts +1 -1
  150. package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +20 -17
  151. package/dist/esm/global-account/react/stores/useModalStore.d.ts +28 -0
  152. package/dist/esm/global-account/types/b3-api.types.d.ts +5 -0
  153. package/dist/esm/global-account/types/feature-flags.d.ts +5 -5
  154. package/dist/esm/notifications/services/api.js +1 -0
  155. package/dist/esm/shared/constants/chains/b3Chain.d.ts +6 -54
  156. package/dist/esm/shared/constants/chains/b3Chain.js +4 -38
  157. package/dist/esm/shared/constants/chains/supported.d.ts +1 -49
  158. package/dist/esm/shared/constants/chains/supported.js +7 -35
  159. package/dist/esm/shared/utils/chain-transformers.d.ts +4 -4
  160. package/dist/esm/shared/utils/chain-transformers.js +38 -37
  161. package/dist/esm/shared/utils/thirdweb-insights.js +2 -2
  162. package/dist/esm/shared/utils/upload.d.ts +9 -0
  163. package/dist/esm/shared/utils/upload.js +31 -0
  164. package/dist/styles/index.css +1 -1
  165. package/dist/types/anyspend/constants/rpc.d.ts +2 -1
  166. package/dist/types/anyspend/react/components/AnySpendBondKit.d.ts +1 -1
  167. package/dist/types/anyspend/react/components/AnySpendBuySpin.d.ts +2 -1
  168. package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +2 -0
  169. package/dist/types/anyspend/react/components/AnySpendDepositUpside.d.ts +2 -1
  170. package/dist/types/anyspend/react/components/AnySpendStakeB3.d.ts +2 -1
  171. package/dist/types/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +2 -1
  172. package/dist/types/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
  173. package/dist/types/anyspend/react/components/AnySpendWorkflowTrigger.d.ts +3 -1
  174. package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
  175. package/dist/types/anyspend/react/components/AnyspendSignatureMint.d.ts +2 -1
  176. package/dist/types/anyspend/react/components/checkout/AnySpendCheckout.d.ts +3 -1
  177. package/dist/types/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +3 -1
  178. package/dist/types/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +3 -1
  179. package/dist/types/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +3 -3
  180. package/dist/types/anyspend/utils/chain.d.ts +39 -1
  181. package/dist/types/anyspend/utils/token.d.ts +2 -0
  182. package/dist/types/app.shared.d.ts +9 -1
  183. package/dist/types/global-account/app.native.d.ts +1 -1
  184. package/dist/types/global-account/better-auth-client.d.ts +3314 -36
  185. package/dist/types/global-account/bsmnt.d.ts +2 -2
  186. package/dist/types/global-account/bsmnt.native.d.ts +1 -1
  187. package/dist/types/global-account/client-manager.d.ts +7 -5
  188. package/dist/types/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +1 -5
  189. package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +8 -13
  190. package/dist/types/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +3 -2
  191. package/dist/types/global-account/react/components/index.d.ts +0 -2
  192. package/dist/types/global-account/react/hooks/index.d.ts +0 -1
  193. package/dist/types/global-account/react/hooks/useAuth.d.ts +3 -3
  194. package/dist/types/global-account/react/hooks/useAuthentication.d.ts +1 -1
  195. package/dist/types/global-account/react/hooks/useBetterAuth.d.ts +1656 -21
  196. package/dist/types/global-account/react/hooks/useClient.d.ts +3 -3
  197. package/dist/types/global-account/react/hooks/useSiwe.d.ts +1 -1
  198. package/dist/types/global-account/react/hooks/useSiwe.native.d.ts +1 -1
  199. package/dist/types/global-account/react/hooks/useTWAuth.d.ts +1 -1
  200. package/dist/types/global-account/react/stores/useModalStore.d.ts +28 -0
  201. package/dist/types/global-account/types/b3-api.types.d.ts +5 -0
  202. package/dist/types/global-account/types/feature-flags.d.ts +5 -5
  203. package/dist/types/shared/constants/chains/b3Chain.d.ts +6 -54
  204. package/dist/types/shared/constants/chains/supported.d.ts +1 -49
  205. package/dist/types/shared/utils/chain-transformers.d.ts +4 -4
  206. package/dist/types/shared/utils/upload.d.ts +9 -0
  207. package/node_modules/@b3/chain-registry/chains.json +1160 -0
  208. package/node_modules/@b3/chain-registry/package.json +14 -0
  209. package/node_modules/@b3/chain-registry/src/index.ts +169 -0
  210. package/node_modules/@b3/chain-registry/tsconfig.json +16 -0
  211. package/package.json +76 -28
  212. package/src/anyspend/constants/rpc.ts +3 -2
  213. package/src/anyspend/react/components/AnySpendBondKit.tsx +2 -0
  214. package/src/anyspend/react/components/AnySpendBuySpin.tsx +3 -0
  215. package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +29 -14
  216. package/src/anyspend/react/components/AnySpendDeposit.tsx +13 -3
  217. package/src/anyspend/react/components/AnySpendDepositUpside.tsx +3 -0
  218. package/src/anyspend/react/components/AnySpendStakeB3.tsx +3 -0
  219. package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +3 -0
  220. package/src/anyspend/react/components/AnySpendStakeUpsideExactIn.tsx +3 -0
  221. package/src/anyspend/react/components/AnySpendWorkflowTrigger.tsx +4 -0
  222. package/src/anyspend/react/components/AnyspendDepositHype.tsx +3 -0
  223. package/src/anyspend/react/components/AnyspendSignatureMint.tsx +3 -0
  224. package/src/anyspend/react/components/checkout/AnySpendCheckout.tsx +4 -0
  225. package/src/anyspend/react/components/checkout/AnySpendCheckoutTrigger.tsx +4 -0
  226. package/src/anyspend/react/components/checkout/CheckoutPaymentPanel.tsx +97 -79
  227. package/src/anyspend/react/hooks/useAnyspendQuote.ts +13 -13
  228. package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +4 -4
  229. package/src/anyspend/types/api_req_res.ts +10 -5
  230. package/src/anyspend/utils/chain.ts +26 -1
  231. package/src/anyspend/utils/token.ts +14 -0
  232. package/src/app.shared.ts +21 -1
  233. package/src/global-account/app.native.ts +5 -1
  234. package/src/global-account/better-auth-client.ts +30 -4
  235. package/src/global-account/bsmnt.native.ts +5 -1
  236. package/src/global-account/bsmnt.ts +9 -2
  237. package/src/global-account/client-manager.ts +41 -9
  238. package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +6 -11
  239. package/src/global-account/react/components/B3Provider/B3ConfigProvider.tsx +0 -6
  240. package/src/global-account/react/components/B3Provider/B3Provider.tsx +49 -32
  241. package/src/global-account/react/components/B3Provider/BetterAuthProvider.tsx +53 -8
  242. package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +1 -1
  243. package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +1 -4
  244. package/src/global-account/react/components/SignInWithB3/utils/signInUtils.ts +2 -4
  245. package/src/global-account/react/components/index.ts +0 -2
  246. package/src/global-account/react/components/ui/button.tsx +1 -2
  247. package/src/global-account/react/hooks/index.ts +0 -1
  248. package/src/global-account/react/hooks/useAuth.ts +2 -2
  249. package/src/global-account/react/hooks/useAuthentication.ts +2 -2
  250. package/src/global-account/react/hooks/useBetterAuth.ts +14 -15
  251. package/src/global-account/react/hooks/useClient.ts +11 -2
  252. package/src/global-account/react/hooks/useNativeBalance.tsx +1 -1
  253. package/src/global-account/react/hooks/useSiwe.native.tsx +1 -1
  254. package/src/global-account/react/hooks/useSiwe.tsx +1 -1
  255. package/src/global-account/react/hooks/useTWAuth.tsx +1 -1
  256. package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +22 -20
  257. package/src/global-account/react/stores/useModalStore.ts +28 -0
  258. package/src/global-account/types/b3-api.types.ts +5 -1
  259. package/src/notifications/services/api.ts +1 -0
  260. package/src/shared/constants/chains/b3Chain.ts +4 -43
  261. package/src/shared/constants/chains/supported.ts +9 -48
  262. package/src/shared/utils/chain-transformers.ts +41 -39
  263. package/src/shared/utils/thirdweb-insights.ts +2 -2
  264. package/src/shared/utils/upload.ts +48 -0
  265. package/src/styles/index.css +27 -0
  266. package/dist/cjs/global-account/react/components/B3Provider/BetterAuthClientProvider.d.ts +0 -17
  267. package/dist/cjs/global-account/react/components/B3Provider/BetterAuthClientProvider.js +0 -31
  268. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.d.ts +0 -10
  269. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +0 -46
  270. package/dist/cjs/global-account/react/hooks/useHandleConnectWithPrivy.d.ts +0 -11
  271. package/dist/cjs/global-account/react/hooks/useHandleConnectWithPrivy.js +0 -70
  272. package/dist/cjs/global-account/types/chain-networks.d.ts +0 -44
  273. package/dist/cjs/global-account/types/chain-networks.js +0 -48
  274. package/dist/cjs/shared/generated/chain-networks.json +0 -684
  275. package/dist/esm/global-account/react/components/B3Provider/BetterAuthClientProvider.d.ts +0 -17
  276. package/dist/esm/global-account/react/components/B3Provider/BetterAuthClientProvider.js +0 -27
  277. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.d.ts +0 -10
  278. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +0 -43
  279. package/dist/esm/global-account/react/hooks/useHandleConnectWithPrivy.d.ts +0 -11
  280. package/dist/esm/global-account/react/hooks/useHandleConnectWithPrivy.js +0 -67
  281. package/dist/esm/global-account/types/chain-networks.d.ts +0 -44
  282. package/dist/esm/global-account/types/chain-networks.js +0 -45
  283. package/dist/esm/shared/generated/chain-networks.json +0 -684
  284. package/dist/types/global-account/react/components/B3Provider/BetterAuthClientProvider.d.ts +0 -17
  285. package/dist/types/global-account/react/components/SignInWithB3/SignInWithB3Privy.d.ts +0 -10
  286. package/dist/types/global-account/react/hooks/useHandleConnectWithPrivy.d.ts +0 -11
  287. package/dist/types/global-account/types/chain-networks.d.ts +0 -44
  288. package/src/global-account/react/components/B3Provider/BetterAuthClientProvider.tsx +0 -40
  289. package/src/global-account/react/components/SignInWithB3/SignInWithB3Privy.tsx +0 -63
  290. package/src/global-account/react/hooks/useHandleConnectWithPrivy.tsx +0 -79
  291. package/src/global-account/types/chain-networks.ts +0 -54
  292. package/src/shared/generated/chain-networks.json +0 -684
@@ -12,8 +12,8 @@ export declare class EmailVerificationRequiredError extends Error {
12
12
  * 3. BetterAuthStrategy verifies the token and issues a Feathers JWT
13
13
  */
14
14
  export declare function useBetterAuth(): {
15
- signInWithEmail: (email: string, password: string) => Promise<import("@feathersjs/authentication").AuthenticationResult>;
16
- signUpWithEmail: (email: string, password: string, name: string, verifyCallbackURL?: string) => Promise<import("@feathersjs/authentication").AuthenticationResult>;
15
+ signInWithEmail: (email: string, password: string) => Promise<Record<string, any>>;
16
+ signUpWithEmail: (email: string, password: string, name: string, verifyCallbackURL?: string) => Promise<Record<string, any>>;
17
17
  signInWithSocial: (provider: BetterAuthSocialProvider) => Promise<void>;
18
18
  requestPasswordReset: (email: string, redirectTo?: string) => Promise<{
19
19
  data: {
@@ -28,8 +28,250 @@ export declare function useBetterAuth(): {
28
28
  };
29
29
  error: null;
30
30
  }>;
31
- exchangeForFeathersJWT: (sessionToken: string) => Promise<import("@feathersjs/authentication").AuthenticationResult>;
31
+ exchangeForFeathersJWT: (sessionToken: string) => Promise<Record<string, any>>;
32
32
  betterAuthClient: {
33
+ twoFactor: {
34
+ enable: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
35
+ password?: string | undefined;
36
+ issuer?: string | undefined;
37
+ } | {
38
+ password: string;
39
+ issuer?: string | undefined;
40
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client").Prettify<({
41
+ password?: string | undefined;
42
+ issuer?: string | undefined;
43
+ } | {
44
+ password: string;
45
+ issuer?: string | undefined;
46
+ }) & {
47
+ fetchOptions?: FetchOptions | undefined;
48
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
49
+ totpURI: string;
50
+ backupCodes: string[];
51
+ }, {
52
+ code?: string | undefined;
53
+ message?: string | undefined;
54
+ }, FetchOptions["throw"] extends true ? true : false>>;
55
+ };
56
+ } & {
57
+ twoFactor: {
58
+ disable: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
59
+ password?: string | undefined;
60
+ } | {
61
+ password: string;
62
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client").Prettify<({
63
+ password?: string | undefined;
64
+ } | {
65
+ password: string;
66
+ }) & {
67
+ fetchOptions?: FetchOptions | undefined;
68
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
69
+ status: boolean;
70
+ }, {
71
+ code?: string | undefined;
72
+ message?: string | undefined;
73
+ }, FetchOptions["throw"] extends true ? true : false>>;
74
+ };
75
+ } & {
76
+ twoFactor: {
77
+ verifyBackupCode: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
78
+ code: string;
79
+ disableSession?: boolean | undefined;
80
+ trustDevice?: boolean | undefined;
81
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client").Prettify<{
82
+ code: string;
83
+ disableSession?: boolean | undefined;
84
+ trustDevice?: boolean | undefined;
85
+ } & {
86
+ fetchOptions?: FetchOptions | undefined;
87
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<Omit<{
88
+ token: string | undefined;
89
+ user: (Record<string, any> & {
90
+ id: string;
91
+ createdAt: Date;
92
+ updatedAt: Date;
93
+ email: string;
94
+ emailVerified: boolean;
95
+ name: string;
96
+ image?: string | null | undefined;
97
+ }) | import("better-auth/plugins/two-factor").UserWithTwoFactor;
98
+ }, "user"> & {
99
+ user: import("better-auth/client").StripEmptyObjects<{
100
+ id: string;
101
+ createdAt: Date;
102
+ updatedAt: Date;
103
+ email: string;
104
+ emailVerified: boolean;
105
+ name: string;
106
+ image?: string | null | undefined;
107
+ } & {
108
+ twoFactorEnabled: boolean | null | undefined;
109
+ } & {}>;
110
+ }, {
111
+ code?: string | undefined;
112
+ message?: string | undefined;
113
+ }, FetchOptions["throw"] extends true ? true : false>>;
114
+ };
115
+ } & {
116
+ twoFactor: {
117
+ generateBackupCodes: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
118
+ password?: string | undefined;
119
+ } | {
120
+ password: string;
121
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client").Prettify<({
122
+ password?: string | undefined;
123
+ } | {
124
+ password: string;
125
+ }) & {
126
+ fetchOptions?: FetchOptions | undefined;
127
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
128
+ status: boolean;
129
+ backupCodes: string[];
130
+ }, {
131
+ code?: string | undefined;
132
+ message?: string | undefined;
133
+ }, FetchOptions["throw"] extends true ? true : false>>;
134
+ };
135
+ } & {
136
+ twoFactor: {
137
+ sendOtp: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
138
+ trustDevice?: boolean | undefined;
139
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/client").Prettify<{
140
+ query?: Record<string, any> | undefined;
141
+ fetchOptions?: FetchOptions | undefined;
142
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
143
+ status: boolean;
144
+ }, {
145
+ code?: string | undefined;
146
+ message?: string | undefined;
147
+ }, FetchOptions["throw"] extends true ? true : false>>;
148
+ };
149
+ } & {
150
+ twoFactor: {
151
+ verifyOtp: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
152
+ code: string;
153
+ trustDevice?: boolean | undefined;
154
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client").Prettify<{
155
+ code: string;
156
+ trustDevice?: boolean | undefined;
157
+ } & {
158
+ fetchOptions?: FetchOptions | undefined;
159
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<(Omit<{
160
+ token: string;
161
+ user: import("better-auth/plugins/two-factor").UserWithTwoFactor;
162
+ }, "user"> & {
163
+ user: import("better-auth/client").StripEmptyObjects<{
164
+ id: string;
165
+ createdAt: Date;
166
+ updatedAt: Date;
167
+ email: string;
168
+ emailVerified: boolean;
169
+ name: string;
170
+ image?: string | null | undefined;
171
+ } & {
172
+ twoFactorEnabled: boolean | null | undefined;
173
+ } & {}>;
174
+ }) | (Omit<{
175
+ token: string;
176
+ user: Record<string, any> & {
177
+ id: string;
178
+ createdAt: Date;
179
+ updatedAt: Date;
180
+ email: string;
181
+ emailVerified: boolean;
182
+ name: string;
183
+ image?: string | null | undefined;
184
+ };
185
+ }, "user"> & {
186
+ user: import("better-auth/client").StripEmptyObjects<{
187
+ id: string;
188
+ createdAt: Date;
189
+ updatedAt: Date;
190
+ email: string;
191
+ emailVerified: boolean;
192
+ name: string;
193
+ image?: string | null | undefined;
194
+ } & {
195
+ twoFactorEnabled: boolean | null | undefined;
196
+ } & {}>;
197
+ }), {
198
+ code?: string | undefined;
199
+ message?: string | undefined;
200
+ }, FetchOptions["throw"] extends true ? true : false>>;
201
+ };
202
+ } & {
203
+ twoFactor: {
204
+ getTotpUri: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
205
+ password?: string | undefined;
206
+ } | {
207
+ password: string;
208
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client").Prettify<({
209
+ password?: string | undefined;
210
+ } | {
211
+ password: string;
212
+ }) & {
213
+ fetchOptions?: FetchOptions | undefined;
214
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
215
+ totpURI: string;
216
+ }, {
217
+ code?: string | undefined;
218
+ message?: string | undefined;
219
+ }, FetchOptions["throw"] extends true ? true : false>>;
220
+ };
221
+ } & {
222
+ twoFactor: {
223
+ verifyTotp: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
224
+ code: string;
225
+ trustDevice?: boolean | undefined;
226
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client").Prettify<{
227
+ code: string;
228
+ trustDevice?: boolean | undefined;
229
+ } & {
230
+ fetchOptions?: FetchOptions | undefined;
231
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<(Omit<{
232
+ token: string;
233
+ user: import("better-auth/plugins/two-factor").UserWithTwoFactor;
234
+ }, "user"> & {
235
+ user: import("better-auth/client").StripEmptyObjects<{
236
+ id: string;
237
+ createdAt: Date;
238
+ updatedAt: Date;
239
+ email: string;
240
+ emailVerified: boolean;
241
+ name: string;
242
+ image?: string | null | undefined;
243
+ } & {
244
+ twoFactorEnabled: boolean | null | undefined;
245
+ } & {}>;
246
+ }) | (Omit<{
247
+ token: string;
248
+ user: Record<string, any> & {
249
+ id: string;
250
+ createdAt: Date;
251
+ updatedAt: Date;
252
+ email: string;
253
+ emailVerified: boolean;
254
+ name: string;
255
+ image?: string | null | undefined;
256
+ };
257
+ }, "user"> & {
258
+ user: import("better-auth/client").StripEmptyObjects<{
259
+ id: string;
260
+ createdAt: Date;
261
+ updatedAt: Date;
262
+ email: string;
263
+ emailVerified: boolean;
264
+ name: string;
265
+ image?: string | null | undefined;
266
+ } & {
267
+ twoFactorEnabled: boolean | null | undefined;
268
+ } & {}>;
269
+ }), {
270
+ code?: string | undefined;
271
+ message?: string | undefined;
272
+ }, FetchOptions["throw"] extends true ? true : false>>;
273
+ };
274
+ } & {
33
275
  signIn: {
34
276
  social: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
35
277
  provider: (string & {}) | "apple" | "google" | "github" | "discord" | "line" | "facebook" | "twitch" | "tiktok" | "zoom" | "linear" | "huggingface" | "atlassian" | "cognito" | "figma" | "microsoft" | "slack" | "spotify" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "reddit" | "roblox" | "salesforce" | "vk" | "notion" | "kakao" | "naver" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
@@ -106,7 +348,9 @@ export declare function useBetterAuth(): {
106
348
  emailVerified: boolean;
107
349
  name: string;
108
350
  image?: string | null | undefined;
109
- }>;
351
+ } & {
352
+ twoFactorEnabled: boolean | null | undefined;
353
+ } & {}>;
110
354
  }), {
111
355
  code?: string | undefined;
112
356
  message?: string | undefined;
@@ -131,14 +375,684 @@ export declare function useBetterAuth(): {
131
375
  image?: string | undefined;
132
376
  callbackURL?: string | undefined;
133
377
  rememberMe?: boolean | undefined;
134
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client").Prettify<{
135
- email: string;
136
- name: string;
137
- password: string;
138
- image?: string | undefined;
139
- callbackURL?: string | undefined;
140
- fetchOptions?: FetchOptions | undefined;
141
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<(Omit<{
378
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client").Prettify<import("better-auth/client").InferSignUpEmailCtx<{
379
+ baseURL: string;
380
+ basePath: string;
381
+ fetchOptions: {
382
+ credentials: "include";
383
+ };
384
+ plugins: {
385
+ id: "two-factor";
386
+ version: string;
387
+ $InferServerPlugin: ReturnType<(<O extends import("better-auth/plugins/two-factor").TwoFactorOptions>(options?: O) => {
388
+ id: "two-factor";
389
+ version: string;
390
+ endpoints: {
391
+ enableTwoFactor: import("better-call").StrictEndpoint<"/two-factor/enable", {
392
+ method: "POST";
393
+ body: import("zod").ZodObject<{
394
+ password: import("zod").ZodOptional<import("zod").ZodString>;
395
+ issuer: import("zod").ZodOptional<import("zod").ZodString>;
396
+ }, import("zod/v4/core").$strip> | import("zod").ZodObject<{
397
+ password: import("zod").ZodString;
398
+ issuer: import("zod").ZodOptional<import("zod").ZodString>;
399
+ }, import("zod/v4/core").$strip>;
400
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
401
+ session: {
402
+ session: Record<string, any> & {
403
+ id: string;
404
+ createdAt: Date;
405
+ updatedAt: Date;
406
+ userId: string;
407
+ expiresAt: Date;
408
+ token: string;
409
+ ipAddress?: string | null | undefined;
410
+ userAgent?: string | null | undefined;
411
+ };
412
+ user: Record<string, any> & {
413
+ id: string;
414
+ createdAt: Date;
415
+ updatedAt: Date;
416
+ email: string;
417
+ emailVerified: boolean;
418
+ name: string;
419
+ image?: string | null | undefined;
420
+ };
421
+ };
422
+ }>)[];
423
+ metadata: {
424
+ openapi: {
425
+ summary: string;
426
+ description: string;
427
+ responses: {
428
+ 200: {
429
+ description: string;
430
+ content: {
431
+ "application/json": {
432
+ schema: {
433
+ type: "object";
434
+ properties: {
435
+ totpURI: {
436
+ type: string;
437
+ description: string;
438
+ };
439
+ backupCodes: {
440
+ type: string;
441
+ items: {
442
+ type: string;
443
+ };
444
+ description: string;
445
+ };
446
+ };
447
+ };
448
+ };
449
+ };
450
+ };
451
+ };
452
+ };
453
+ };
454
+ }, {
455
+ totpURI: string;
456
+ backupCodes: string[];
457
+ }>;
458
+ disableTwoFactor: import("better-call").StrictEndpoint<"/two-factor/disable", {
459
+ method: "POST";
460
+ body: import("zod").ZodObject<{
461
+ password: import("zod").ZodOptional<import("zod").ZodString>;
462
+ }, import("zod/v4/core").$strip> | import("zod").ZodObject<{
463
+ password: import("zod").ZodString;
464
+ }, import("zod/v4/core").$strip>;
465
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
466
+ session: {
467
+ session: Record<string, any> & {
468
+ id: string;
469
+ createdAt: Date;
470
+ updatedAt: Date;
471
+ userId: string;
472
+ expiresAt: Date;
473
+ token: string;
474
+ ipAddress?: string | null | undefined;
475
+ userAgent?: string | null | undefined;
476
+ };
477
+ user: Record<string, any> & {
478
+ id: string;
479
+ createdAt: Date;
480
+ updatedAt: Date;
481
+ email: string;
482
+ emailVerified: boolean;
483
+ name: string;
484
+ image?: string | null | undefined;
485
+ };
486
+ };
487
+ }>)[];
488
+ metadata: {
489
+ openapi: {
490
+ summary: string;
491
+ description: string;
492
+ responses: {
493
+ 200: {
494
+ description: string;
495
+ content: {
496
+ "application/json": {
497
+ schema: {
498
+ type: "object";
499
+ properties: {
500
+ status: {
501
+ type: string;
502
+ };
503
+ };
504
+ };
505
+ };
506
+ };
507
+ };
508
+ };
509
+ };
510
+ };
511
+ }, {
512
+ status: boolean;
513
+ }>;
514
+ verifyBackupCode: import("better-call").StrictEndpoint<"/two-factor/verify-backup-code", {
515
+ method: "POST";
516
+ body: import("zod").ZodObject<{
517
+ code: import("zod").ZodString;
518
+ disableSession: import("zod").ZodOptional<import("zod").ZodBoolean>;
519
+ trustDevice: import("zod").ZodOptional<import("zod").ZodBoolean>;
520
+ }, import("zod/v4/core").$strip>;
521
+ metadata: {
522
+ openapi: {
523
+ description: string;
524
+ responses: {
525
+ "200": {
526
+ description: string;
527
+ content: {
528
+ "application/json": {
529
+ schema: {
530
+ type: "object";
531
+ properties: {
532
+ user: {
533
+ type: string;
534
+ properties: {
535
+ id: {
536
+ type: string;
537
+ description: string;
538
+ };
539
+ email: {
540
+ type: string;
541
+ format: string;
542
+ nullable: boolean;
543
+ description: string;
544
+ };
545
+ emailVerified: {
546
+ type: string;
547
+ nullable: boolean;
548
+ description: string;
549
+ };
550
+ name: {
551
+ type: string;
552
+ nullable: boolean;
553
+ description: string;
554
+ };
555
+ image: {
556
+ type: string;
557
+ format: string;
558
+ nullable: boolean;
559
+ description: string;
560
+ };
561
+ twoFactorEnabled: {
562
+ type: string;
563
+ description: string;
564
+ };
565
+ createdAt: {
566
+ type: string;
567
+ format: string;
568
+ description: string;
569
+ };
570
+ updatedAt: {
571
+ type: string;
572
+ format: string;
573
+ description: string;
574
+ };
575
+ };
576
+ required: string[];
577
+ description: string;
578
+ };
579
+ session: {
580
+ type: string;
581
+ properties: {
582
+ token: {
583
+ type: string;
584
+ description: string;
585
+ };
586
+ userId: {
587
+ type: string;
588
+ description: string;
589
+ };
590
+ createdAt: {
591
+ type: string;
592
+ format: string;
593
+ description: string;
594
+ };
595
+ expiresAt: {
596
+ type: string;
597
+ format: string;
598
+ description: string;
599
+ };
600
+ };
601
+ required: string[];
602
+ description: string;
603
+ };
604
+ };
605
+ required: string[];
606
+ };
607
+ };
608
+ };
609
+ };
610
+ };
611
+ };
612
+ };
613
+ }, {
614
+ token: string | undefined;
615
+ user: (Record<string, any> & {
616
+ id: string;
617
+ createdAt: Date;
618
+ updatedAt: Date;
619
+ email: string;
620
+ emailVerified: boolean;
621
+ name: string;
622
+ image?: string | null | undefined;
623
+ }) | import("better-auth/plugins/two-factor").UserWithTwoFactor;
624
+ }>;
625
+ generateBackupCodes: import("better-call").StrictEndpoint<"/two-factor/generate-backup-codes", {
626
+ method: "POST";
627
+ body: import("zod").ZodObject<{
628
+ password: import("zod").ZodOptional<import("zod").ZodString>;
629
+ }, import("zod/v4/core").$strip> | import("zod").ZodObject<{
630
+ password: import("zod").ZodString;
631
+ }, import("zod/v4/core").$strip>;
632
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
633
+ session: {
634
+ session: Record<string, any> & {
635
+ id: string;
636
+ createdAt: Date;
637
+ updatedAt: Date;
638
+ userId: string;
639
+ expiresAt: Date;
640
+ token: string;
641
+ ipAddress?: string | null | undefined;
642
+ userAgent?: string | null | undefined;
643
+ };
644
+ user: Record<string, any> & {
645
+ id: string;
646
+ createdAt: Date;
647
+ updatedAt: Date;
648
+ email: string;
649
+ emailVerified: boolean;
650
+ name: string;
651
+ image?: string | null | undefined;
652
+ };
653
+ };
654
+ }>)[];
655
+ metadata: {
656
+ openapi: {
657
+ description: string;
658
+ responses: {
659
+ "200": {
660
+ description: string;
661
+ content: {
662
+ "application/json": {
663
+ schema: {
664
+ type: "object";
665
+ properties: {
666
+ status: {
667
+ type: string;
668
+ description: string;
669
+ enum: boolean[];
670
+ };
671
+ backupCodes: {
672
+ type: string;
673
+ items: {
674
+ type: string;
675
+ };
676
+ description: string;
677
+ };
678
+ };
679
+ required: string[];
680
+ };
681
+ };
682
+ };
683
+ };
684
+ };
685
+ };
686
+ };
687
+ }, {
688
+ status: boolean;
689
+ backupCodes: string[];
690
+ }>;
691
+ viewBackupCodes: import("better-call").StrictEndpoint<string, {
692
+ method: "POST";
693
+ body: import("zod").ZodObject<{
694
+ userId: import("zod").ZodCoercedString<unknown>;
695
+ }, import("zod/v4/core").$strip>;
696
+ }, {
697
+ status: boolean;
698
+ backupCodes: string[];
699
+ }>;
700
+ sendTwoFactorOTP: import("better-call").StrictEndpoint<"/two-factor/send-otp", {
701
+ method: "POST";
702
+ body: import("zod").ZodOptional<import("zod").ZodObject<{
703
+ trustDevice: import("zod").ZodOptional<import("zod").ZodBoolean>;
704
+ }, import("zod/v4/core").$strip>>;
705
+ metadata: {
706
+ openapi: {
707
+ summary: string;
708
+ description: string;
709
+ responses: {
710
+ 200: {
711
+ description: string;
712
+ content: {
713
+ "application/json": {
714
+ schema: {
715
+ type: "object";
716
+ properties: {
717
+ status: {
718
+ type: string;
719
+ };
720
+ };
721
+ };
722
+ };
723
+ };
724
+ };
725
+ };
726
+ };
727
+ };
728
+ }, {
729
+ status: boolean;
730
+ }>;
731
+ verifyTwoFactorOTP: import("better-call").StrictEndpoint<"/two-factor/verify-otp", {
732
+ method: "POST";
733
+ body: import("zod").ZodObject<{
734
+ code: import("zod").ZodString;
735
+ trustDevice: import("zod").ZodOptional<import("zod").ZodBoolean>;
736
+ }, import("zod/v4/core").$strip>;
737
+ metadata: {
738
+ openapi: {
739
+ summary: string;
740
+ description: string;
741
+ responses: {
742
+ "200": {
743
+ description: string;
744
+ content: {
745
+ "application/json": {
746
+ schema: {
747
+ type: "object";
748
+ properties: {
749
+ token: {
750
+ type: string;
751
+ description: string;
752
+ };
753
+ user: {
754
+ type: string;
755
+ properties: {
756
+ id: {
757
+ type: string;
758
+ description: string;
759
+ };
760
+ email: {
761
+ type: string;
762
+ format: string;
763
+ nullable: boolean;
764
+ description: string;
765
+ };
766
+ emailVerified: {
767
+ type: string;
768
+ nullable: boolean;
769
+ description: string;
770
+ };
771
+ name: {
772
+ type: string;
773
+ nullable: boolean;
774
+ description: string;
775
+ };
776
+ image: {
777
+ type: string;
778
+ format: string;
779
+ nullable: boolean;
780
+ description: string;
781
+ };
782
+ createdAt: {
783
+ type: string;
784
+ format: string;
785
+ description: string;
786
+ };
787
+ updatedAt: {
788
+ type: string;
789
+ format: string;
790
+ description: string;
791
+ };
792
+ };
793
+ required: string[];
794
+ description: string;
795
+ };
796
+ };
797
+ required: string[];
798
+ };
799
+ };
800
+ };
801
+ };
802
+ };
803
+ };
804
+ };
805
+ }, {
806
+ token: string;
807
+ user: import("better-auth/plugins/two-factor").UserWithTwoFactor;
808
+ } | {
809
+ token: string;
810
+ user: Record<string, any> & {
811
+ id: string;
812
+ createdAt: Date;
813
+ updatedAt: Date;
814
+ email: string;
815
+ emailVerified: boolean;
816
+ name: string;
817
+ image?: string | null | undefined;
818
+ };
819
+ }>;
820
+ generateTOTP: import("better-call").StrictEndpoint<string, {
821
+ method: "POST";
822
+ body: import("zod").ZodObject<{
823
+ secret: import("zod").ZodString;
824
+ }, import("zod/v4/core").$strip>;
825
+ metadata: {
826
+ openapi: {
827
+ summary: string;
828
+ description: string;
829
+ responses: {
830
+ 200: {
831
+ description: string;
832
+ content: {
833
+ "application/json": {
834
+ schema: {
835
+ type: "object";
836
+ properties: {
837
+ code: {
838
+ type: string;
839
+ };
840
+ };
841
+ };
842
+ };
843
+ };
844
+ };
845
+ };
846
+ };
847
+ };
848
+ }, {
849
+ code: string;
850
+ }>;
851
+ getTOTPURI: import("better-call").StrictEndpoint<"/two-factor/get-totp-uri", {
852
+ method: "POST";
853
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
854
+ session: {
855
+ session: Record<string, any> & {
856
+ id: string;
857
+ createdAt: Date;
858
+ updatedAt: Date;
859
+ userId: string;
860
+ expiresAt: Date;
861
+ token: string;
862
+ ipAddress?: string | null | undefined;
863
+ userAgent?: string | null | undefined;
864
+ };
865
+ user: Record<string, any> & {
866
+ id: string;
867
+ createdAt: Date;
868
+ updatedAt: Date;
869
+ email: string;
870
+ emailVerified: boolean;
871
+ name: string;
872
+ image?: string | null | undefined;
873
+ };
874
+ };
875
+ }>)[];
876
+ body: import("zod").ZodObject<{
877
+ password: import("zod").ZodOptional<import("zod").ZodString>;
878
+ }, import("zod/v4/core").$strip> | import("zod").ZodObject<{
879
+ password: import("zod").ZodString;
880
+ }, import("zod/v4/core").$strip>;
881
+ metadata: {
882
+ openapi: {
883
+ summary: string;
884
+ description: string;
885
+ responses: {
886
+ 200: {
887
+ description: string;
888
+ content: {
889
+ "application/json": {
890
+ schema: {
891
+ type: "object";
892
+ properties: {
893
+ totpURI: {
894
+ type: string;
895
+ };
896
+ };
897
+ };
898
+ };
899
+ };
900
+ };
901
+ };
902
+ };
903
+ };
904
+ }, {
905
+ totpURI: string;
906
+ }>;
907
+ verifyTOTP: import("better-call").StrictEndpoint<"/two-factor/verify-totp", {
908
+ method: "POST";
909
+ body: import("zod").ZodObject<{
910
+ code: import("zod").ZodString;
911
+ trustDevice: import("zod").ZodOptional<import("zod").ZodBoolean>;
912
+ }, import("zod/v4/core").$strip>;
913
+ metadata: {
914
+ openapi: {
915
+ summary: string;
916
+ description: string;
917
+ responses: {
918
+ 200: {
919
+ description: string;
920
+ content: {
921
+ "application/json": {
922
+ schema: {
923
+ type: "object";
924
+ properties: {
925
+ status: {
926
+ type: string;
927
+ };
928
+ };
929
+ };
930
+ };
931
+ };
932
+ };
933
+ };
934
+ };
935
+ };
936
+ }, {
937
+ token: string;
938
+ user: import("better-auth/plugins/two-factor").UserWithTwoFactor;
939
+ } | {
940
+ token: string;
941
+ user: Record<string, any> & {
942
+ id: string;
943
+ createdAt: Date;
944
+ updatedAt: Date;
945
+ email: string;
946
+ emailVerified: boolean;
947
+ name: string;
948
+ image?: string | null | undefined;
949
+ };
950
+ }>;
951
+ };
952
+ options: NoInfer<O>;
953
+ hooks: {
954
+ after: {
955
+ matcher(context: import("@better-auth/core").HookEndpointContext): boolean;
956
+ handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
957
+ twoFactorRedirect: boolean;
958
+ twoFactorMethods: string[];
959
+ } | undefined>;
960
+ }[];
961
+ };
962
+ schema: {
963
+ user: {
964
+ fields: {
965
+ twoFactorEnabled: {
966
+ type: "boolean";
967
+ required: false;
968
+ defaultValue: false;
969
+ input: false;
970
+ };
971
+ };
972
+ };
973
+ twoFactor: {
974
+ fields: {
975
+ secret: {
976
+ type: "string";
977
+ required: true;
978
+ returned: false;
979
+ index: true;
980
+ };
981
+ backupCodes: {
982
+ type: "string";
983
+ required: true;
984
+ returned: false;
985
+ };
986
+ userId: {
987
+ type: "string";
988
+ required: true;
989
+ returned: false;
990
+ references: {
991
+ model: string;
992
+ field: string;
993
+ };
994
+ index: true;
995
+ };
996
+ verified: {
997
+ type: "boolean";
998
+ required: false;
999
+ defaultValue: true;
1000
+ input: false;
1001
+ };
1002
+ };
1003
+ };
1004
+ };
1005
+ rateLimit: {
1006
+ pathMatcher(path: string): boolean;
1007
+ window: number;
1008
+ max: number;
1009
+ }[];
1010
+ $ERROR_CODES: {
1011
+ OTP_NOT_ENABLED: import("better-auth/*").RawError<"OTP_NOT_ENABLED">;
1012
+ OTP_HAS_EXPIRED: import("better-auth/*").RawError<"OTP_HAS_EXPIRED">;
1013
+ TOTP_NOT_ENABLED: import("better-auth/*").RawError<"TOTP_NOT_ENABLED">;
1014
+ TWO_FACTOR_NOT_ENABLED: import("better-auth/*").RawError<"TWO_FACTOR_NOT_ENABLED">;
1015
+ BACKUP_CODES_NOT_ENABLED: import("better-auth/*").RawError<"BACKUP_CODES_NOT_ENABLED">;
1016
+ INVALID_BACKUP_CODE: import("better-auth/*").RawError<"INVALID_BACKUP_CODE">;
1017
+ INVALID_CODE: import("better-auth/*").RawError<"INVALID_CODE">;
1018
+ TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: import("better-auth/*").RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
1019
+ INVALID_TWO_FACTOR_COOKIE: import("better-auth/*").RawError<"INVALID_TWO_FACTOR_COOKIE">;
1020
+ };
1021
+ })>;
1022
+ atomListeners: {
1023
+ matcher: (path: string) => boolean;
1024
+ signal: "$sessionSignal";
1025
+ }[];
1026
+ pathMethods: {
1027
+ "/two-factor/disable": "POST";
1028
+ "/two-factor/enable": "POST";
1029
+ "/two-factor/send-otp": "POST";
1030
+ "/two-factor/generate-backup-codes": "POST";
1031
+ "/two-factor/get-totp-uri": "POST";
1032
+ "/two-factor/verify-totp": "POST";
1033
+ "/two-factor/verify-otp": "POST";
1034
+ "/two-factor/verify-backup-code": "POST";
1035
+ };
1036
+ fetchPlugins: {
1037
+ id: string;
1038
+ name: string;
1039
+ hooks: {
1040
+ onSuccess(context: import("@better-fetch/fetch").SuccessContext<any>): Promise<void>;
1041
+ };
1042
+ }[];
1043
+ $ERROR_CODES: {
1044
+ OTP_NOT_ENABLED: import("better-auth/*").RawError<"OTP_NOT_ENABLED">;
1045
+ OTP_HAS_EXPIRED: import("better-auth/*").RawError<"OTP_HAS_EXPIRED">;
1046
+ TOTP_NOT_ENABLED: import("better-auth/*").RawError<"TOTP_NOT_ENABLED">;
1047
+ TWO_FACTOR_NOT_ENABLED: import("better-auth/*").RawError<"TWO_FACTOR_NOT_ENABLED">;
1048
+ BACKUP_CODES_NOT_ENABLED: import("better-auth/*").RawError<"BACKUP_CODES_NOT_ENABLED">;
1049
+ INVALID_BACKUP_CODE: import("better-auth/*").RawError<"INVALID_BACKUP_CODE">;
1050
+ INVALID_CODE: import("better-auth/*").RawError<"INVALID_CODE">;
1051
+ TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: import("better-auth/*").RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
1052
+ INVALID_TWO_FACTOR_COOKIE: import("better-auth/*").RawError<"INVALID_TWO_FACTOR_COOKIE">;
1053
+ };
1054
+ }[];
1055
+ }, FetchOptions>>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<(Omit<{
142
1056
  token: null;
143
1057
  user: {
144
1058
  id: string;
@@ -158,7 +1072,9 @@ export declare function useBetterAuth(): {
158
1072
  emailVerified: boolean;
159
1073
  name: string;
160
1074
  image?: string | null | undefined;
161
- }>;
1075
+ } & {
1076
+ twoFactorEnabled: boolean | null | undefined;
1077
+ } & {}>;
162
1078
  }) | (Omit<{
163
1079
  token: string;
164
1080
  user: {
@@ -179,7 +1095,9 @@ export declare function useBetterAuth(): {
179
1095
  emailVerified: boolean;
180
1096
  name: string;
181
1097
  image?: string | null | undefined;
182
- }>;
1098
+ } & {
1099
+ twoFactorEnabled: boolean | null | undefined;
1100
+ } & {}>;
183
1101
  }), {
184
1102
  code?: string | undefined;
185
1103
  message?: string | undefined;
@@ -221,7 +1139,9 @@ export declare function useBetterAuth(): {
221
1139
  emailVerified: boolean;
222
1140
  name: string;
223
1141
  image?: string | null | undefined;
224
- }>;
1142
+ } & {
1143
+ twoFactorEnabled: boolean | null | undefined;
1144
+ } & {}>;
225
1145
  }, {
226
1146
  code?: string | undefined;
227
1147
  message?: string | undefined;
@@ -329,7 +1249,9 @@ export declare function useBetterAuth(): {
329
1249
  emailVerified: boolean;
330
1250
  name: string;
331
1251
  image?: string | null | undefined;
332
- }>;
1252
+ } & {
1253
+ twoFactorEnabled: boolean | null | undefined;
1254
+ } & {}>;
333
1255
  }, {
334
1256
  code?: string | undefined;
335
1257
  message?: string | undefined;
@@ -362,6 +1284,677 @@ export declare function useBetterAuth(): {
362
1284
  fetchOptions: {
363
1285
  credentials: "include";
364
1286
  };
1287
+ plugins: {
1288
+ id: "two-factor";
1289
+ version: string;
1290
+ $InferServerPlugin: ReturnType<(<O extends import("better-auth/plugins/two-factor").TwoFactorOptions>(options?: O) => {
1291
+ id: "two-factor";
1292
+ version: string;
1293
+ endpoints: {
1294
+ enableTwoFactor: import("better-call").StrictEndpoint<"/two-factor/enable", {
1295
+ method: "POST";
1296
+ body: import("zod").ZodObject<{
1297
+ password: import("zod").ZodOptional<import("zod").ZodString>;
1298
+ issuer: import("zod").ZodOptional<import("zod").ZodString>;
1299
+ }, import("zod/v4/core").$strip> | import("zod").ZodObject<{
1300
+ password: import("zod").ZodString;
1301
+ issuer: import("zod").ZodOptional<import("zod").ZodString>;
1302
+ }, import("zod/v4/core").$strip>;
1303
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
1304
+ session: {
1305
+ session: Record<string, any> & {
1306
+ id: string;
1307
+ createdAt: Date;
1308
+ updatedAt: Date;
1309
+ userId: string;
1310
+ expiresAt: Date;
1311
+ token: string;
1312
+ ipAddress?: string | null | undefined;
1313
+ userAgent?: string | null | undefined;
1314
+ };
1315
+ user: Record<string, any> & {
1316
+ id: string;
1317
+ createdAt: Date;
1318
+ updatedAt: Date;
1319
+ email: string;
1320
+ emailVerified: boolean;
1321
+ name: string;
1322
+ image?: string | null | undefined;
1323
+ };
1324
+ };
1325
+ }>)[];
1326
+ metadata: {
1327
+ openapi: {
1328
+ summary: string;
1329
+ description: string;
1330
+ responses: {
1331
+ 200: {
1332
+ description: string;
1333
+ content: {
1334
+ "application/json": {
1335
+ schema: {
1336
+ type: "object";
1337
+ properties: {
1338
+ totpURI: {
1339
+ type: string;
1340
+ description: string;
1341
+ };
1342
+ backupCodes: {
1343
+ type: string;
1344
+ items: {
1345
+ type: string;
1346
+ };
1347
+ description: string;
1348
+ };
1349
+ };
1350
+ };
1351
+ };
1352
+ };
1353
+ };
1354
+ };
1355
+ };
1356
+ };
1357
+ }, {
1358
+ totpURI: string;
1359
+ backupCodes: string[];
1360
+ }>;
1361
+ disableTwoFactor: import("better-call").StrictEndpoint<"/two-factor/disable", {
1362
+ method: "POST";
1363
+ body: import("zod").ZodObject<{
1364
+ password: import("zod").ZodOptional<import("zod").ZodString>;
1365
+ }, import("zod/v4/core").$strip> | import("zod").ZodObject<{
1366
+ password: import("zod").ZodString;
1367
+ }, import("zod/v4/core").$strip>;
1368
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
1369
+ session: {
1370
+ session: Record<string, any> & {
1371
+ id: string;
1372
+ createdAt: Date;
1373
+ updatedAt: Date;
1374
+ userId: string;
1375
+ expiresAt: Date;
1376
+ token: string;
1377
+ ipAddress?: string | null | undefined;
1378
+ userAgent?: string | null | undefined;
1379
+ };
1380
+ user: Record<string, any> & {
1381
+ id: string;
1382
+ createdAt: Date;
1383
+ updatedAt: Date;
1384
+ email: string;
1385
+ emailVerified: boolean;
1386
+ name: string;
1387
+ image?: string | null | undefined;
1388
+ };
1389
+ };
1390
+ }>)[];
1391
+ metadata: {
1392
+ openapi: {
1393
+ summary: string;
1394
+ description: string;
1395
+ responses: {
1396
+ 200: {
1397
+ description: string;
1398
+ content: {
1399
+ "application/json": {
1400
+ schema: {
1401
+ type: "object";
1402
+ properties: {
1403
+ status: {
1404
+ type: string;
1405
+ };
1406
+ };
1407
+ };
1408
+ };
1409
+ };
1410
+ };
1411
+ };
1412
+ };
1413
+ };
1414
+ }, {
1415
+ status: boolean;
1416
+ }>;
1417
+ verifyBackupCode: import("better-call").StrictEndpoint<"/two-factor/verify-backup-code", {
1418
+ method: "POST";
1419
+ body: import("zod").ZodObject<{
1420
+ code: import("zod").ZodString;
1421
+ disableSession: import("zod").ZodOptional<import("zod").ZodBoolean>;
1422
+ trustDevice: import("zod").ZodOptional<import("zod").ZodBoolean>;
1423
+ }, import("zod/v4/core").$strip>;
1424
+ metadata: {
1425
+ openapi: {
1426
+ description: string;
1427
+ responses: {
1428
+ "200": {
1429
+ description: string;
1430
+ content: {
1431
+ "application/json": {
1432
+ schema: {
1433
+ type: "object";
1434
+ properties: {
1435
+ user: {
1436
+ type: string;
1437
+ properties: {
1438
+ id: {
1439
+ type: string;
1440
+ description: string;
1441
+ };
1442
+ email: {
1443
+ type: string;
1444
+ format: string;
1445
+ nullable: boolean;
1446
+ description: string;
1447
+ };
1448
+ emailVerified: {
1449
+ type: string;
1450
+ nullable: boolean;
1451
+ description: string;
1452
+ };
1453
+ name: {
1454
+ type: string;
1455
+ nullable: boolean;
1456
+ description: string;
1457
+ };
1458
+ image: {
1459
+ type: string;
1460
+ format: string;
1461
+ nullable: boolean;
1462
+ description: string;
1463
+ };
1464
+ twoFactorEnabled: {
1465
+ type: string;
1466
+ description: string;
1467
+ };
1468
+ createdAt: {
1469
+ type: string;
1470
+ format: string;
1471
+ description: string;
1472
+ };
1473
+ updatedAt: {
1474
+ type: string;
1475
+ format: string;
1476
+ description: string;
1477
+ };
1478
+ };
1479
+ required: string[];
1480
+ description: string;
1481
+ };
1482
+ session: {
1483
+ type: string;
1484
+ properties: {
1485
+ token: {
1486
+ type: string;
1487
+ description: string;
1488
+ };
1489
+ userId: {
1490
+ type: string;
1491
+ description: string;
1492
+ };
1493
+ createdAt: {
1494
+ type: string;
1495
+ format: string;
1496
+ description: string;
1497
+ };
1498
+ expiresAt: {
1499
+ type: string;
1500
+ format: string;
1501
+ description: string;
1502
+ };
1503
+ };
1504
+ required: string[];
1505
+ description: string;
1506
+ };
1507
+ };
1508
+ required: string[];
1509
+ };
1510
+ };
1511
+ };
1512
+ };
1513
+ };
1514
+ };
1515
+ };
1516
+ }, {
1517
+ token: string | undefined;
1518
+ user: (Record<string, any> & {
1519
+ id: string;
1520
+ createdAt: Date;
1521
+ updatedAt: Date;
1522
+ email: string;
1523
+ emailVerified: boolean;
1524
+ name: string;
1525
+ image?: string | null | undefined;
1526
+ }) | import("better-auth/plugins/two-factor").UserWithTwoFactor;
1527
+ }>;
1528
+ generateBackupCodes: import("better-call").StrictEndpoint<"/two-factor/generate-backup-codes", {
1529
+ method: "POST";
1530
+ body: import("zod").ZodObject<{
1531
+ password: import("zod").ZodOptional<import("zod").ZodString>;
1532
+ }, import("zod/v4/core").$strip> | import("zod").ZodObject<{
1533
+ password: import("zod").ZodString;
1534
+ }, import("zod/v4/core").$strip>;
1535
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
1536
+ session: {
1537
+ session: Record<string, any> & {
1538
+ id: string;
1539
+ createdAt: Date;
1540
+ updatedAt: Date;
1541
+ userId: string;
1542
+ expiresAt: Date;
1543
+ token: string;
1544
+ ipAddress?: string | null | undefined;
1545
+ userAgent?: string | null | undefined;
1546
+ };
1547
+ user: Record<string, any> & {
1548
+ id: string;
1549
+ createdAt: Date;
1550
+ updatedAt: Date;
1551
+ email: string;
1552
+ emailVerified: boolean;
1553
+ name: string;
1554
+ image?: string | null | undefined;
1555
+ };
1556
+ };
1557
+ }>)[];
1558
+ metadata: {
1559
+ openapi: {
1560
+ description: string;
1561
+ responses: {
1562
+ "200": {
1563
+ description: string;
1564
+ content: {
1565
+ "application/json": {
1566
+ schema: {
1567
+ type: "object";
1568
+ properties: {
1569
+ status: {
1570
+ type: string;
1571
+ description: string;
1572
+ enum: boolean[];
1573
+ };
1574
+ backupCodes: {
1575
+ type: string;
1576
+ items: {
1577
+ type: string;
1578
+ };
1579
+ description: string;
1580
+ };
1581
+ };
1582
+ required: string[];
1583
+ };
1584
+ };
1585
+ };
1586
+ };
1587
+ };
1588
+ };
1589
+ };
1590
+ }, {
1591
+ status: boolean;
1592
+ backupCodes: string[];
1593
+ }>;
1594
+ viewBackupCodes: import("better-call").StrictEndpoint<string, {
1595
+ method: "POST";
1596
+ body: import("zod").ZodObject<{
1597
+ userId: import("zod").ZodCoercedString<unknown>;
1598
+ }, import("zod/v4/core").$strip>;
1599
+ }, {
1600
+ status: boolean;
1601
+ backupCodes: string[];
1602
+ }>;
1603
+ sendTwoFactorOTP: import("better-call").StrictEndpoint<"/two-factor/send-otp", {
1604
+ method: "POST";
1605
+ body: import("zod").ZodOptional<import("zod").ZodObject<{
1606
+ trustDevice: import("zod").ZodOptional<import("zod").ZodBoolean>;
1607
+ }, import("zod/v4/core").$strip>>;
1608
+ metadata: {
1609
+ openapi: {
1610
+ summary: string;
1611
+ description: string;
1612
+ responses: {
1613
+ 200: {
1614
+ description: string;
1615
+ content: {
1616
+ "application/json": {
1617
+ schema: {
1618
+ type: "object";
1619
+ properties: {
1620
+ status: {
1621
+ type: string;
1622
+ };
1623
+ };
1624
+ };
1625
+ };
1626
+ };
1627
+ };
1628
+ };
1629
+ };
1630
+ };
1631
+ }, {
1632
+ status: boolean;
1633
+ }>;
1634
+ verifyTwoFactorOTP: import("better-call").StrictEndpoint<"/two-factor/verify-otp", {
1635
+ method: "POST";
1636
+ body: import("zod").ZodObject<{
1637
+ code: import("zod").ZodString;
1638
+ trustDevice: import("zod").ZodOptional<import("zod").ZodBoolean>;
1639
+ }, import("zod/v4/core").$strip>;
1640
+ metadata: {
1641
+ openapi: {
1642
+ summary: string;
1643
+ description: string;
1644
+ responses: {
1645
+ "200": {
1646
+ description: string;
1647
+ content: {
1648
+ "application/json": {
1649
+ schema: {
1650
+ type: "object";
1651
+ properties: {
1652
+ token: {
1653
+ type: string;
1654
+ description: string;
1655
+ };
1656
+ user: {
1657
+ type: string;
1658
+ properties: {
1659
+ id: {
1660
+ type: string;
1661
+ description: string;
1662
+ };
1663
+ email: {
1664
+ type: string;
1665
+ format: string;
1666
+ nullable: boolean;
1667
+ description: string;
1668
+ };
1669
+ emailVerified: {
1670
+ type: string;
1671
+ nullable: boolean;
1672
+ description: string;
1673
+ };
1674
+ name: {
1675
+ type: string;
1676
+ nullable: boolean;
1677
+ description: string;
1678
+ };
1679
+ image: {
1680
+ type: string;
1681
+ format: string;
1682
+ nullable: boolean;
1683
+ description: string;
1684
+ };
1685
+ createdAt: {
1686
+ type: string;
1687
+ format: string;
1688
+ description: string;
1689
+ };
1690
+ updatedAt: {
1691
+ type: string;
1692
+ format: string;
1693
+ description: string;
1694
+ };
1695
+ };
1696
+ required: string[];
1697
+ description: string;
1698
+ };
1699
+ };
1700
+ required: string[];
1701
+ };
1702
+ };
1703
+ };
1704
+ };
1705
+ };
1706
+ };
1707
+ };
1708
+ }, {
1709
+ token: string;
1710
+ user: import("better-auth/plugins/two-factor").UserWithTwoFactor;
1711
+ } | {
1712
+ token: string;
1713
+ user: Record<string, any> & {
1714
+ id: string;
1715
+ createdAt: Date;
1716
+ updatedAt: Date;
1717
+ email: string;
1718
+ emailVerified: boolean;
1719
+ name: string;
1720
+ image?: string | null | undefined;
1721
+ };
1722
+ }>;
1723
+ generateTOTP: import("better-call").StrictEndpoint<string, {
1724
+ method: "POST";
1725
+ body: import("zod").ZodObject<{
1726
+ secret: import("zod").ZodString;
1727
+ }, import("zod/v4/core").$strip>;
1728
+ metadata: {
1729
+ openapi: {
1730
+ summary: string;
1731
+ description: string;
1732
+ responses: {
1733
+ 200: {
1734
+ description: string;
1735
+ content: {
1736
+ "application/json": {
1737
+ schema: {
1738
+ type: "object";
1739
+ properties: {
1740
+ code: {
1741
+ type: string;
1742
+ };
1743
+ };
1744
+ };
1745
+ };
1746
+ };
1747
+ };
1748
+ };
1749
+ };
1750
+ };
1751
+ }, {
1752
+ code: string;
1753
+ }>;
1754
+ getTOTPURI: import("better-call").StrictEndpoint<"/two-factor/get-totp-uri", {
1755
+ method: "POST";
1756
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
1757
+ session: {
1758
+ session: Record<string, any> & {
1759
+ id: string;
1760
+ createdAt: Date;
1761
+ updatedAt: Date;
1762
+ userId: string;
1763
+ expiresAt: Date;
1764
+ token: string;
1765
+ ipAddress?: string | null | undefined;
1766
+ userAgent?: string | null | undefined;
1767
+ };
1768
+ user: Record<string, any> & {
1769
+ id: string;
1770
+ createdAt: Date;
1771
+ updatedAt: Date;
1772
+ email: string;
1773
+ emailVerified: boolean;
1774
+ name: string;
1775
+ image?: string | null | undefined;
1776
+ };
1777
+ };
1778
+ }>)[];
1779
+ body: import("zod").ZodObject<{
1780
+ password: import("zod").ZodOptional<import("zod").ZodString>;
1781
+ }, import("zod/v4/core").$strip> | import("zod").ZodObject<{
1782
+ password: import("zod").ZodString;
1783
+ }, import("zod/v4/core").$strip>;
1784
+ metadata: {
1785
+ openapi: {
1786
+ summary: string;
1787
+ description: string;
1788
+ responses: {
1789
+ 200: {
1790
+ description: string;
1791
+ content: {
1792
+ "application/json": {
1793
+ schema: {
1794
+ type: "object";
1795
+ properties: {
1796
+ totpURI: {
1797
+ type: string;
1798
+ };
1799
+ };
1800
+ };
1801
+ };
1802
+ };
1803
+ };
1804
+ };
1805
+ };
1806
+ };
1807
+ }, {
1808
+ totpURI: string;
1809
+ }>;
1810
+ verifyTOTP: import("better-call").StrictEndpoint<"/two-factor/verify-totp", {
1811
+ method: "POST";
1812
+ body: import("zod").ZodObject<{
1813
+ code: import("zod").ZodString;
1814
+ trustDevice: import("zod").ZodOptional<import("zod").ZodBoolean>;
1815
+ }, import("zod/v4/core").$strip>;
1816
+ metadata: {
1817
+ openapi: {
1818
+ summary: string;
1819
+ description: string;
1820
+ responses: {
1821
+ 200: {
1822
+ description: string;
1823
+ content: {
1824
+ "application/json": {
1825
+ schema: {
1826
+ type: "object";
1827
+ properties: {
1828
+ status: {
1829
+ type: string;
1830
+ };
1831
+ };
1832
+ };
1833
+ };
1834
+ };
1835
+ };
1836
+ };
1837
+ };
1838
+ };
1839
+ }, {
1840
+ token: string;
1841
+ user: import("better-auth/plugins/two-factor").UserWithTwoFactor;
1842
+ } | {
1843
+ token: string;
1844
+ user: Record<string, any> & {
1845
+ id: string;
1846
+ createdAt: Date;
1847
+ updatedAt: Date;
1848
+ email: string;
1849
+ emailVerified: boolean;
1850
+ name: string;
1851
+ image?: string | null | undefined;
1852
+ };
1853
+ }>;
1854
+ };
1855
+ options: NoInfer<O>;
1856
+ hooks: {
1857
+ after: {
1858
+ matcher(context: import("@better-auth/core").HookEndpointContext): boolean;
1859
+ handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
1860
+ twoFactorRedirect: boolean;
1861
+ twoFactorMethods: string[];
1862
+ } | undefined>;
1863
+ }[];
1864
+ };
1865
+ schema: {
1866
+ user: {
1867
+ fields: {
1868
+ twoFactorEnabled: {
1869
+ type: "boolean";
1870
+ required: false;
1871
+ defaultValue: false;
1872
+ input: false;
1873
+ };
1874
+ };
1875
+ };
1876
+ twoFactor: {
1877
+ fields: {
1878
+ secret: {
1879
+ type: "string";
1880
+ required: true;
1881
+ returned: false;
1882
+ index: true;
1883
+ };
1884
+ backupCodes: {
1885
+ type: "string";
1886
+ required: true;
1887
+ returned: false;
1888
+ };
1889
+ userId: {
1890
+ type: "string";
1891
+ required: true;
1892
+ returned: false;
1893
+ references: {
1894
+ model: string;
1895
+ field: string;
1896
+ };
1897
+ index: true;
1898
+ };
1899
+ verified: {
1900
+ type: "boolean";
1901
+ required: false;
1902
+ defaultValue: true;
1903
+ input: false;
1904
+ };
1905
+ };
1906
+ };
1907
+ };
1908
+ rateLimit: {
1909
+ pathMatcher(path: string): boolean;
1910
+ window: number;
1911
+ max: number;
1912
+ }[];
1913
+ $ERROR_CODES: {
1914
+ OTP_NOT_ENABLED: import("better-auth/*").RawError<"OTP_NOT_ENABLED">;
1915
+ OTP_HAS_EXPIRED: import("better-auth/*").RawError<"OTP_HAS_EXPIRED">;
1916
+ TOTP_NOT_ENABLED: import("better-auth/*").RawError<"TOTP_NOT_ENABLED">;
1917
+ TWO_FACTOR_NOT_ENABLED: import("better-auth/*").RawError<"TWO_FACTOR_NOT_ENABLED">;
1918
+ BACKUP_CODES_NOT_ENABLED: import("better-auth/*").RawError<"BACKUP_CODES_NOT_ENABLED">;
1919
+ INVALID_BACKUP_CODE: import("better-auth/*").RawError<"INVALID_BACKUP_CODE">;
1920
+ INVALID_CODE: import("better-auth/*").RawError<"INVALID_CODE">;
1921
+ TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: import("better-auth/*").RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
1922
+ INVALID_TWO_FACTOR_COOKIE: import("better-auth/*").RawError<"INVALID_TWO_FACTOR_COOKIE">;
1923
+ };
1924
+ })>;
1925
+ atomListeners: {
1926
+ matcher: (path: string) => boolean;
1927
+ signal: "$sessionSignal";
1928
+ }[];
1929
+ pathMethods: {
1930
+ "/two-factor/disable": "POST";
1931
+ "/two-factor/enable": "POST";
1932
+ "/two-factor/send-otp": "POST";
1933
+ "/two-factor/generate-backup-codes": "POST";
1934
+ "/two-factor/get-totp-uri": "POST";
1935
+ "/two-factor/verify-totp": "POST";
1936
+ "/two-factor/verify-otp": "POST";
1937
+ "/two-factor/verify-backup-code": "POST";
1938
+ };
1939
+ fetchPlugins: {
1940
+ id: string;
1941
+ name: string;
1942
+ hooks: {
1943
+ onSuccess(context: import("@better-fetch/fetch").SuccessContext<any>): Promise<void>;
1944
+ };
1945
+ }[];
1946
+ $ERROR_CODES: {
1947
+ OTP_NOT_ENABLED: import("better-auth/*").RawError<"OTP_NOT_ENABLED">;
1948
+ OTP_HAS_EXPIRED: import("better-auth/*").RawError<"OTP_HAS_EXPIRED">;
1949
+ TOTP_NOT_ENABLED: import("better-auth/*").RawError<"TOTP_NOT_ENABLED">;
1950
+ TWO_FACTOR_NOT_ENABLED: import("better-auth/*").RawError<"TWO_FACTOR_NOT_ENABLED">;
1951
+ BACKUP_CODES_NOT_ENABLED: import("better-auth/*").RawError<"BACKUP_CODES_NOT_ENABLED">;
1952
+ INVALID_BACKUP_CODE: import("better-auth/*").RawError<"INVALID_BACKUP_CODE">;
1953
+ INVALID_CODE: import("better-auth/*").RawError<"INVALID_CODE">;
1954
+ TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: import("better-auth/*").RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
1955
+ INVALID_TWO_FACTOR_COOKIE: import("better-auth/*").RawError<"INVALID_TWO_FACTOR_COOKIE">;
1956
+ };
1957
+ }[];
365
1958
  }, FetchOptions>> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
366
1959
  status: boolean;
367
1960
  }, {
@@ -611,7 +2204,7 @@ export declare function useBetterAuth(): {
611
2204
  } | undefined;
612
2205
  fetchOptions?: FetchOptions | undefined;
613
2206
  }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
614
- user: import("@better-auth/core/oauth2").OAuth2UserInfo;
2207
+ user: import("better-auth/*").OAuth2UserInfo;
615
2208
  data: Record<string, any>;
616
2209
  }, {
617
2210
  code?: string | undefined;
@@ -636,7 +2229,9 @@ export declare function useBetterAuth(): {
636
2229
  emailVerified: boolean;
637
2230
  name: string;
638
2231
  image?: string | null | undefined;
639
- }>;
2232
+ } & {
2233
+ twoFactorEnabled: boolean | null | undefined;
2234
+ } & {}>;
640
2235
  session: import("better-auth/client").StripEmptyObjects<{
641
2236
  id: string;
642
2237
  createdAt: Date;
@@ -662,7 +2257,9 @@ export declare function useBetterAuth(): {
662
2257
  emailVerified: boolean;
663
2258
  name: string;
664
2259
  image?: string | null | undefined;
665
- }>;
2260
+ } & {
2261
+ twoFactorEnabled: boolean | null | undefined;
2262
+ } & {}>;
666
2263
  session: import("better-auth/client").StripEmptyObjects<{
667
2264
  id: string;
668
2265
  createdAt: Date;
@@ -698,8 +2295,8 @@ export declare function useBetterAuth(): {
698
2295
  onResponse: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
699
2296
  };
700
2297
  })[];
701
- cache?: RequestCache | undefined;
702
2298
  priority?: RequestPriority | undefined;
2299
+ cache?: RequestCache | undefined;
703
2300
  credentials?: RequestCredentials;
704
2301
  headers?: (HeadersInit & (HeadersInit | {
705
2302
  accept: "application/json" | "text/plain" | "application/octet-stream";
@@ -762,7 +2359,9 @@ export declare function useBetterAuth(): {
762
2359
  emailVerified: boolean;
763
2360
  name: string;
764
2361
  image?: string | null | undefined;
765
- }>;
2362
+ } & {
2363
+ twoFactorEnabled: boolean | null | undefined;
2364
+ } & {}>;
766
2365
  session: import("better-auth/client").StripEmptyObjects<{
767
2366
  id: string;
768
2367
  createdAt: Date;
@@ -776,6 +2375,42 @@ export declare function useBetterAuth(): {
776
2375
  };
777
2376
  };
778
2377
  $ERROR_CODES: {
2378
+ OTP_NOT_ENABLED: {
2379
+ readonly code: "OTP_NOT_ENABLED";
2380
+ message: string;
2381
+ };
2382
+ OTP_HAS_EXPIRED: {
2383
+ readonly code: "OTP_HAS_EXPIRED";
2384
+ message: string;
2385
+ };
2386
+ TOTP_NOT_ENABLED: {
2387
+ readonly code: "TOTP_NOT_ENABLED";
2388
+ message: string;
2389
+ };
2390
+ TWO_FACTOR_NOT_ENABLED: {
2391
+ readonly code: "TWO_FACTOR_NOT_ENABLED";
2392
+ message: string;
2393
+ };
2394
+ BACKUP_CODES_NOT_ENABLED: {
2395
+ readonly code: "BACKUP_CODES_NOT_ENABLED";
2396
+ message: string;
2397
+ };
2398
+ INVALID_BACKUP_CODE: {
2399
+ readonly code: "INVALID_BACKUP_CODE";
2400
+ message: string;
2401
+ };
2402
+ INVALID_CODE: {
2403
+ readonly code: "INVALID_CODE";
2404
+ message: string;
2405
+ };
2406
+ TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: {
2407
+ readonly code: "TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE";
2408
+ message: string;
2409
+ };
2410
+ INVALID_TWO_FACTOR_COOKIE: {
2411
+ readonly code: "INVALID_TWO_FACTOR_COOKIE";
2412
+ message: string;
2413
+ };
779
2414
  USER_NOT_FOUND: {
780
2415
  readonly code: "USER_NOT_FOUND";
781
2416
  message: string;