@getpara/react-sdk-lite 2.11.0 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (311) hide show
  1. package/dist/css/modal.css +0 -3
  2. package/dist/index.d.ts +1 -0
  3. package/dist/modal/ParaModal.js +57 -98
  4. package/dist/modal/components/Body/Body.d.ts +1 -2
  5. package/dist/modal/components/Body/Body.js +119 -231
  6. package/dist/modal/components/Controls/ChainSelect.js +3 -4
  7. package/dist/modal/components/Controls/Controls.js +2 -4
  8. package/dist/modal/components/Footer/Footer.js +3 -12
  9. package/dist/modal/components/Header/Header.js +13 -14
  10. package/dist/modal/components/Header/hooks/useStepTitle.d.ts +1 -1
  11. package/dist/modal/components/Header/hooks/useStepTitle.js +88 -71
  12. package/dist/modal/components/ModalContent/ModalContent.d.ts +1 -1
  13. package/dist/modal/components/ModalContent/ModalContent.js +6 -14
  14. package/dist/modal/components/OnRampComponents/AddingFunds.js +2 -2
  15. package/dist/modal/components/WalletCard/WalletCard.js +9 -9
  16. package/dist/modal/components/WalletSelectOld/WalletSelectOld.js +13 -18
  17. package/dist/modal/components/common.d.ts +5 -0
  18. package/dist/modal/components/common.js +17 -10
  19. package/dist/modal/components/{Account → flows/account/Account}/Account.js +30 -27
  20. package/dist/modal/components/{Account/AccountHeader.d.ts → flows/account/Account/Header.d.ts} +1 -1
  21. package/dist/modal/components/{Account/AccountHeader.js → flows/account/Account/Header.js} +8 -8
  22. package/dist/modal/components/{Account/AccountWalletSelect.d.ts → flows/account/Account/WalletSelect.d.ts} +1 -1
  23. package/dist/modal/components/{Account/AccountWalletSelect.js → flows/account/Account/WalletSelect.js} +17 -22
  24. package/dist/modal/components/flows/account/AccountFlow/AccountFlow.d.ts +12 -0
  25. package/dist/modal/components/flows/account/AccountFlow/AccountFlow.js +126 -0
  26. package/dist/modal/components/flows/account/AccountProvider/AccountContext.d.ts +11 -0
  27. package/dist/modal/components/flows/account/AccountProvider/AccountContext.js +42 -0
  28. package/dist/modal/components/flows/account/AccountProvider/AccountProvider.d.ts +4 -0
  29. package/dist/modal/components/flows/account/AccountProvider/AccountProvider.js +110 -0
  30. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFunds.js +12 -12
  31. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAsset.js +3 -3
  32. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAwaiting.js +7 -8
  33. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsContext.d.ts +1 -1
  34. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsContext.js +11 -11
  35. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsDone.js +8 -9
  36. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsNetwork.js +2 -2
  37. package/dist/modal/components/flows/account/AddFunds/AddFundsProvider.d.ts +1 -0
  38. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsProvider.js +13 -12
  39. package/dist/modal/components/flows/account/AddFunds/AddFundsReceive.d.ts +1 -0
  40. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsReceive.js +10 -10
  41. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsSettings.js +10 -10
  42. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/MoonPayEmbed.js +1 -1
  43. package/dist/modal/components/flows/account/AddFunds/utils.d.ts +3 -0
  44. package/dist/modal/components/flows/account/AddFunds/utils.js +16 -0
  45. package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/ChainSwitch.js +7 -10
  46. package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/config.js +1 -1
  47. package/dist/modal/components/{Account → flows/account/Profile}/AccountMonitorTx.js +13 -13
  48. package/dist/modal/components/flows/account/Profile/FarcasterLink.d.ts +2 -0
  49. package/dist/modal/components/{OAuth → flows/account/Profile}/FarcasterLink.js +6 -6
  50. package/dist/modal/components/{Account/AccountProfile.d.ts → flows/account/Profile/Profile.d.ts} +1 -1
  51. package/dist/modal/components/{Account/AccountProfile.js → flows/account/Profile/Profile.js} +20 -24
  52. package/dist/modal/components/{Account/AccountProfileEntry.js → flows/account/Profile/ProfileEntry.js} +13 -15
  53. package/dist/modal/components/flows/account/Profile/ProfileLink.d.ts +1 -0
  54. package/dist/modal/components/{Account/AccountProfileLink.js → flows/account/Profile/ProfileLink.js} +19 -34
  55. package/dist/modal/components/flows/account/Profile/ProfileLinkOptions.d.ts +1 -0
  56. package/dist/modal/components/{Account/AccountProfileLinkOptions.js → flows/account/Profile/ProfileLinkOptions.js} +11 -11
  57. package/dist/modal/components/flows/account/Profile/ProfileUnlink.d.ts +1 -0
  58. package/dist/modal/components/{Account/AccountProfileUnlink.js → flows/account/Profile/ProfileUnlink.js} +6 -6
  59. package/dist/modal/{hooks/useTelegramLogin.d.ts → components/flows/account/Profile/useTelegramLink.d.ts} +1 -5
  60. package/dist/modal/{hooks/useTelegramLogin.js → components/flows/account/Profile/useTelegramLink.js} +16 -23
  61. package/dist/modal/components/{Account/AccountSend → flows/account/Send}/AssetNetwork.js +1 -1
  62. package/dist/modal/components/flows/account/Send/SendAsset.d.ts +1 -0
  63. package/dist/modal/components/{Account/AccountSend/AccountSendAsset.js → flows/account/Send/SendAsset.js} +11 -12
  64. package/dist/modal/components/flows/account/Send/SendForm.d.ts +1 -0
  65. package/dist/modal/components/{Account/AccountSend/AccountSendForm.js → flows/account/Send/SendForm.js} +15 -16
  66. package/dist/modal/components/flows/account/Send/SendNetwork.d.ts +1 -0
  67. package/dist/modal/components/{Account/AccountSend/AccountSendNetwork.js → flows/account/Send/SendNetwork.js} +9 -10
  68. package/dist/modal/components/flows/account/Send/SendNoAssets.d.ts +1 -0
  69. package/dist/modal/components/{Account/AccountSend/AccountSendNoAssets.js → flows/account/Send/SendNoAssets.js} +8 -9
  70. package/dist/modal/components/{Account/AccountSend → flows/account/Send}/context.js +19 -6
  71. package/dist/modal/components/{Account/AccountSend → flows/account/Send}/index.js +11 -11
  72. package/dist/modal/components/flows/account/SwitchWallets/SwitchWallets.d.ts +1 -0
  73. package/dist/modal/components/{SwitchWalletsStep/SwitchWalletsStep.js → flows/account/SwitchWallets/SwitchWallets.js} +4 -4
  74. package/dist/modal/components/flows/account/Wallet/Wallet.d.ts +1 -0
  75. package/dist/modal/components/{Account/AccountWallet.js → flows/account/Wallet/Wallet.js} +12 -18
  76. package/dist/modal/components/flows/auth/AuthFlow/AuthFlow.d.ts +10 -0
  77. package/dist/modal/components/flows/auth/AuthFlow/AuthFlow.js +94 -0
  78. package/dist/modal/components/flows/auth/AuthMain/AuthMain.d.ts +9 -0
  79. package/dist/modal/components/{AuthMainStep/AuthMainStep.js → flows/auth/AuthMain/AuthMain.js} +10 -21
  80. package/dist/modal/components/flows/auth/AuthMain/AuthMainContent.d.ts +9 -0
  81. package/dist/modal/components/{AuthMainStep/AuthMainStepContent.js → flows/auth/AuthMain/AuthMainContent.js} +49 -24
  82. package/dist/modal/components/flows/auth/AwaitingAccountSetup/AwaitingAccountSetup.d.ts +1 -0
  83. package/dist/modal/components/flows/auth/AwaitingAccountSetup/AwaitingAccountSetup.js +31 -0
  84. package/dist/modal/components/flows/auth/AwaitingBiometrics/AwaitingBiometrics.d.ts +1 -0
  85. package/dist/modal/components/flows/auth/AwaitingBiometrics/AwaitingBiometrics.js +21 -0
  86. package/dist/modal/components/flows/auth/AwaitingOAuth/AwaitingOAuth.d.ts +1 -0
  87. package/dist/modal/components/{AwaitingOAuthStep/AwaitingOAuthStep.js → flows/auth/AwaitingOAuth/AwaitingOAuth.js} +4 -4
  88. package/dist/modal/components/flows/auth/AwaitingPassword/AwaitingPassword.d.ts +1 -0
  89. package/dist/modal/components/flows/auth/AwaitingPassword/AwaitingPassword.js +22 -0
  90. package/dist/modal/components/flows/auth/BiometricCreation/BiometricCreation.d.ts +1 -0
  91. package/dist/modal/components/{BiometricCreationStep/BiometricCreationStep.js → flows/auth/BiometricCreation/BiometricCreation.js} +25 -22
  92. package/dist/modal/components/flows/auth/BiometricLogin/BiometricLogin.d.ts +1 -0
  93. package/dist/modal/components/flows/auth/BiometricLogin/BiometricLogin.js +72 -0
  94. package/dist/modal/components/flows/auth/LoginDone/LoginDone.d.ts +5 -0
  95. package/dist/modal/components/{LoginDoneStep/LoginDoneStep.js → flows/auth/LoginDone/LoginDone.js} +9 -13
  96. package/dist/modal/components/{OAuth → flows/auth/OAuth}/OAuth.js +15 -23
  97. package/dist/modal/components/{RecoverySecretStep → flows/auth/RecoverySecretStep}/RecoverySecretStep.js +9 -11
  98. package/dist/modal/components/flows/auth/Setup2FA/Setup2FA.d.ts +5 -0
  99. package/dist/modal/components/{Setup2FAStep/Setup2FAStep.js → flows/auth/Setup2FA/Setup2FA.js} +42 -19
  100. package/dist/modal/components/flows/auth/Verification/Verification.d.ts +1 -0
  101. package/dist/modal/components/flows/auth/Verification/Verification.js +36 -0
  102. package/dist/modal/components/flows/auth/WalletCreationDone/WalletCreationDone.d.ts +6 -0
  103. package/dist/modal/components/{WalletCreationDoneStep/WalletCreationDoneStep.js → flows/auth/WalletCreationDone/WalletCreationDone.js} +19 -46
  104. package/dist/modal/components/{AuthOptions → shared}/AuthOptions.d.ts +2 -2
  105. package/dist/modal/components/{AuthOptions → shared}/AuthOptions.js +18 -15
  106. package/dist/modal/components/{ExternalWalletStep/ExternalWalletStep.d.ts → shared/ConnectExternalWallet/ConnectExternalWallet.d.ts} +1 -1
  107. package/dist/modal/components/{ExternalWalletStep/ExternalWalletStep.js → shared/ConnectExternalWallet/ConnectExternalWallet.js} +17 -37
  108. package/dist/modal/components/{ExternalWalletStep → shared/ConnectExternalWallet}/config.js +1 -1
  109. package/dist/modal/components/{AuthInput/AuthInput.d.ts → shared/EmailOrPhone/EmailOrPhoneInput.d.ts} +4 -4
  110. package/dist/modal/components/{AuthInput/AuthInput.js → shared/EmailOrPhone/EmailOrPhoneInput.js} +14 -10
  111. package/dist/modal/components/{AuthInput → shared/EmailOrPhone}/phoneMasks.js +1 -1
  112. package/dist/modal/components/{ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.d.ts → shared/ExternalWalletNetworkSelect.d.ts} +1 -1
  113. package/dist/modal/components/{ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.js → shared/ExternalWalletNetworkSelect.js} +9 -9
  114. package/dist/modal/components/{ExternalWallets → shared}/ExternalWallets.js +17 -12
  115. package/dist/modal/components/shared/IFrame.d.ts +1 -0
  116. package/dist/modal/components/shared/IFrame.js +87 -0
  117. package/dist/modal/components/{VerificationCodeStep/VerificationCodeStep.d.ts → shared/VerificationCode.d.ts} +3 -4
  118. package/dist/modal/components/{VerificationCodeStep/VerificationCodeStep.js → shared/VerificationCode.js} +4 -28
  119. package/dist/modal/components/shared/VerifyExternalWallet.d.ts +1 -0
  120. package/dist/modal/components/{ExternalWalletVerificationStep/ExternalWalletVerificationStep.js → shared/VerifyExternalWallet.js} +10 -17
  121. package/dist/modal/hooks/index.d.ts +1 -2
  122. package/dist/modal/hooks/index.js +1 -2
  123. package/dist/modal/hooks/useAuthView.d.ts +4 -0
  124. package/dist/modal/hooks/useAuthView.js +115 -0
  125. package/dist/modal/hooks/useCanbGoBack.d.ts +3 -0
  126. package/dist/modal/hooks/useCanbGoBack.js +47 -0
  127. package/dist/modal/{components/AuthInput/hooks → hooks}/useDropdownPosition.d.ts +1 -1
  128. package/dist/modal/hooks/useDropdownPosition.js +41 -0
  129. package/dist/modal/hooks/useGoBack.d.ts +4 -1
  130. package/dist/modal/hooks/useGoBack.js +60 -36
  131. package/dist/modal/hooks/useSendMutations.js +4 -5
  132. package/dist/modal/hooks/useTransactionMonitoring.js +8 -8
  133. package/dist/modal/index.d.ts +1 -2
  134. package/dist/modal/index.js +1 -3
  135. package/dist/modal/stores/index.d.ts +0 -1
  136. package/dist/modal/stores/index.js +0 -1
  137. package/dist/modal/types/modalProps.d.ts +18 -8
  138. package/dist/provider/ParaProviderMin.js +34 -38
  139. package/dist/provider/actions/getWallet.d.ts +1 -1
  140. package/dist/provider/actions/index.d.ts +43 -49
  141. package/dist/provider/actions/index.js +4 -0
  142. package/dist/provider/components/CosmosWalletWrapper.js +0 -3
  143. package/dist/provider/components/EvmWalletWrapper.js +0 -3
  144. package/dist/provider/components/ExternalWalletWrapper.js +8 -2
  145. package/dist/provider/hooks/mutations/index.d.ts +2 -0
  146. package/dist/provider/hooks/mutations/index.js +4 -0
  147. package/dist/provider/hooks/mutations/useAddAuthMethod.d.ts +7 -12
  148. package/dist/provider/hooks/mutations/useAuthenticateWithEmailOrPhone.d.ts +34 -0
  149. package/dist/provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js +28 -0
  150. package/dist/provider/hooks/mutations/useAuthenticateWithOAuth.d.ts +34 -0
  151. package/dist/provider/hooks/mutations/useAuthenticateWithOAuth.js +28 -0
  152. package/dist/provider/hooks/mutations/useClaimPregenWallets.d.ts +7 -13
  153. package/dist/provider/hooks/mutations/useClaimPregenWallets.js +4 -1
  154. package/dist/provider/hooks/mutations/useCreateGuestWallets.d.ts +7 -6
  155. package/dist/provider/hooks/mutations/useCreateGuestWallets.js +6 -3
  156. package/dist/provider/hooks/mutations/useCreatePregenWallet.d.ts +7 -93
  157. package/dist/provider/hooks/mutations/useCreatePregenWallet.js +4 -1
  158. package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.d.ts +7 -15
  159. package/dist/provider/hooks/mutations/useCreateWallet.d.ts +7 -15
  160. package/dist/provider/hooks/mutations/useCreateWallet.js +4 -1
  161. package/dist/provider/hooks/mutations/useCreateWalletPerType.d.ts +7 -27
  162. package/dist/provider/hooks/mutations/useEnable2fa.d.ts +7 -12
  163. package/dist/provider/hooks/mutations/useExportPrivateKey.d.ts +2 -7
  164. package/dist/provider/hooks/mutations/useHasPregenWallet.d.ts +7 -13
  165. package/dist/provider/hooks/mutations/useIssueJwt.d.ts +7 -21
  166. package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +6 -7
  167. package/dist/provider/hooks/mutations/useKeepSessionAlive.js +2 -2
  168. package/dist/provider/hooks/mutations/useLoginExternalWallet.d.ts +7 -25
  169. package/dist/provider/hooks/mutations/useLoginExternalWallet.js +4 -1
  170. package/dist/provider/hooks/mutations/useLogout.d.ts +7 -12
  171. package/dist/provider/hooks/mutations/useResendVerificationCode.d.ts +7 -13
  172. package/dist/provider/hooks/mutations/useResendVerificationCode.js +4 -1
  173. package/dist/provider/hooks/mutations/useSetup2fa.d.ts +7 -7
  174. package/dist/provider/hooks/mutations/useSetup2fa.js +2 -2
  175. package/dist/provider/hooks/mutations/useSignMessage.d.ts +7 -31
  176. package/dist/provider/hooks/mutations/useSignTransaction.d.ts +7 -31
  177. package/dist/provider/hooks/mutations/useSignTransaction.js +4 -1
  178. package/dist/provider/hooks/mutations/useSignUpOrLogIn.d.ts +7 -19
  179. package/dist/provider/hooks/mutations/useSignUpOrLogIn.js +4 -1
  180. package/dist/provider/hooks/mutations/useSwitchWallets.d.ts +7 -30
  181. package/dist/provider/hooks/mutations/useSwitchWallets.js +4 -1
  182. package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.d.ts +7 -15
  183. package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.js +4 -1
  184. package/dist/provider/hooks/mutations/useVerify2fa.d.ts +7 -30
  185. package/dist/provider/hooks/mutations/useVerifyExternalWallet.d.ts +7 -19
  186. package/dist/provider/hooks/mutations/useVerifyExternalWallet.js +4 -1
  187. package/dist/provider/hooks/mutations/useVerifyFarcaster.d.ts +7 -31
  188. package/dist/provider/hooks/mutations/useVerifyFarcaster.js +4 -1
  189. package/dist/provider/hooks/mutations/useVerifyNewAccount.d.ts +7 -66
  190. package/dist/provider/hooks/mutations/useVerifyNewAccount.js +4 -1
  191. package/dist/provider/hooks/mutations/useVerifyOAuth.d.ts +7 -37
  192. package/dist/provider/hooks/mutations/useVerifyTelegram.d.ts +7 -22
  193. package/dist/provider/hooks/mutations/useWaitForLogin.d.ts +7 -30
  194. package/dist/provider/hooks/mutations/useWaitForLogin.js +4 -1
  195. package/dist/provider/hooks/mutations/useWaitForSignup.d.ts +7 -18
  196. package/dist/provider/hooks/mutations/useWaitForWalletCreation.d.ts +7 -27
  197. package/dist/provider/hooks/mutations/utils.js +1 -1
  198. package/dist/provider/hooks/queries/useIsFullyLoggedIn.d.ts +4 -1
  199. package/dist/provider/hooks/queries/useIsFullyLoggedIn.js +6 -1
  200. package/dist/provider/hooks/queries/useLinkedAccounts.d.ts +2 -4
  201. package/dist/provider/hooks/queries/useParaStatus.d.ts +0 -1
  202. package/dist/provider/hooks/queries/useParaStatus.js +0 -2
  203. package/dist/provider/hooks/queries/useWallet.d.ts +1 -1
  204. package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +1 -1
  205. package/dist/provider/hooks/utils/useEventListeners.js +0 -7
  206. package/dist/provider/hooks/utils/useFormattedBiometricHints.d.ts +1 -0
  207. package/dist/provider/hooks/utils/useFormattedBiometricHints.js +9 -5
  208. package/dist/provider/hooks/utils/useModal.d.ts +4 -3
  209. package/dist/provider/hooks/utils/useModal.js +17 -9
  210. package/dist/provider/hooks/utils/useWalletState.d.ts +3 -3
  211. package/dist/provider/hooks/utils/useWalletState.js +14 -6
  212. package/dist/provider/providers/AccountLinkProvider.js +21 -19
  213. package/dist/provider/providers/AuthProvider/AuthContext.d.ts +19 -0
  214. package/dist/provider/providers/AuthProvider/AuthContext.js +35 -0
  215. package/dist/provider/providers/AuthProvider/AuthProvider.d.ts +9 -0
  216. package/dist/provider/providers/AuthProvider/AuthProvider.js +261 -0
  217. package/dist/provider/providers/ExternalWalletProvider.d.ts +12 -4
  218. package/dist/provider/providers/ExternalWalletProvider.js +285 -283
  219. package/dist/provider/stores/getters.d.ts +1 -1
  220. package/dist/provider/stores/getters.js +5 -5
  221. package/dist/provider/stores/setters.js +2 -2
  222. package/dist/provider/stores/slices/accountFlow.d.ts +3 -0
  223. package/dist/provider/stores/slices/accountFlow.js +30 -0
  224. package/dist/provider/stores/slices/authFlow.d.ts +3 -0
  225. package/dist/provider/stores/slices/authFlow.js +63 -0
  226. package/dist/provider/stores/slices/externalWallets.js +10 -0
  227. package/dist/provider/stores/slices/index.d.ts +4 -0
  228. package/dist/provider/stores/slices/index.js +4 -0
  229. package/dist/provider/stores/slices/modal.js +8 -2
  230. package/dist/provider/stores/slices/onRamp.d.ts +3 -0
  231. package/dist/provider/stores/slices/onRamp.js +20 -0
  232. package/dist/provider/stores/slices/paraState.d.ts +3 -0
  233. package/dist/provider/stores/slices/paraState.js +9 -0
  234. package/dist/provider/stores/types.d.ts +117 -5
  235. package/dist/provider/stores/types.js +9 -0
  236. package/dist/provider/stores/useStore.d.ts +5 -3
  237. package/dist/provider/stores/useStore.js +15 -8
  238. package/package.json +8 -8
  239. package/dist/modal/components/Account/AccountProfileLink.d.ts +0 -1
  240. package/dist/modal/components/Account/AccountProfileLinkOptions.d.ts +0 -1
  241. package/dist/modal/components/Account/AccountProfileUnlink.d.ts +0 -1
  242. package/dist/modal/components/Account/AccountSend/AccountSendAsset.d.ts +0 -1
  243. package/dist/modal/components/Account/AccountSend/AccountSendForm.d.ts +0 -1
  244. package/dist/modal/components/Account/AccountSend/AccountSendNetwork.d.ts +0 -1
  245. package/dist/modal/components/Account/AccountSend/AccountSendNoAssets.d.ts +0 -1
  246. package/dist/modal/components/Account/AccountWallet.d.ts +0 -1
  247. package/dist/modal/components/AddFunds/AddFundsProvider.d.ts +0 -1
  248. package/dist/modal/components/AddFunds/AddFundsReceive.d.ts +0 -1
  249. package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +0 -33
  250. package/dist/modal/components/AuthMainStep/AuthMainStep.d.ts +0 -9
  251. package/dist/modal/components/AuthMainStep/AuthMainStepContent.d.ts +0 -9
  252. package/dist/modal/components/AwaitingAccountStep/AwaitingAccountStep.d.ts +0 -1
  253. package/dist/modal/components/AwaitingAccountStep/AwaitingAccountStep.js +0 -21
  254. package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.d.ts +0 -1
  255. package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +0 -18
  256. package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.d.ts +0 -1
  257. package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.d.ts +0 -1
  258. package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +0 -21
  259. package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.d.ts +0 -5
  260. package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +0 -24
  261. package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +0 -1
  262. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +0 -1
  263. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +0 -67
  264. package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.d.ts +0 -1
  265. package/dist/modal/components/Hero/Hero.d.ts +0 -1
  266. package/dist/modal/components/Hero/Hero.js +0 -118
  267. package/dist/modal/components/IFrameStep/IFrameStep.d.ts +0 -1
  268. package/dist/modal/components/IFrameStep/IFrameStep.js +0 -83
  269. package/dist/modal/components/LoginDoneStep/LoginDoneStep.d.ts +0 -5
  270. package/dist/modal/components/OAuth/FarcasterLink.d.ts +0 -2
  271. package/dist/modal/components/OAuth/FarcasterOAuthStep.d.ts +0 -1
  272. package/dist/modal/components/OAuth/FarcasterOAuthStep.js +0 -53
  273. package/dist/modal/components/OAuth/TelegramOAuthStep.d.ts +0 -8
  274. package/dist/modal/components/OAuth/TelegramOAuthStep.js +0 -91
  275. package/dist/modal/components/Setup2FAStep/Setup2FAStep.d.ts +0 -5
  276. package/dist/modal/components/SwitchWalletsStep/SwitchWalletsStep.d.ts +0 -1
  277. package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.d.ts +0 -5
  278. package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +0 -27
  279. package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.d.ts +0 -6
  280. package/dist/modal/hooks/useFarcasterLogin.d.ts +0 -9
  281. package/dist/modal/hooks/useFarcasterLogin.js +0 -77
  282. package/dist/modal/stores/modal/actions.d.ts +0 -3
  283. package/dist/modal/stores/modal/actions.js +0 -146
  284. package/dist/modal/stores/modal/useModalStore.d.ts +0 -119
  285. package/dist/modal/stores/modal/useModalStore.js +0 -80
  286. package/dist/modal/utils/steps.d.ts +0 -162
  287. package/dist/modal/utils/steps.js +0 -335
  288. package/dist/provider/providers/AuthProvider.d.ts +0 -43
  289. package/dist/provider/providers/AuthProvider.js +0 -777
  290. /package/dist/modal/components/{Account → flows/account/Account}/Account.d.ts +0 -0
  291. /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFunds.d.ts +0 -0
  292. /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAsset.d.ts +0 -0
  293. /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAwaiting.d.ts +0 -0
  294. /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsDone.d.ts +0 -0
  295. /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsNetwork.d.ts +0 -0
  296. /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsSettings.d.ts +0 -0
  297. /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/MoonPayEmbed.d.ts +0 -0
  298. /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/index.d.ts +0 -0
  299. /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/index.js +0 -0
  300. /package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/ChainSwitch.d.ts +0 -0
  301. /package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/config.d.ts +0 -0
  302. /package/dist/modal/components/{Account → flows/account/Profile}/AccountMonitorTx.d.ts +0 -0
  303. /package/dist/modal/components/{Account/AccountProfileEntry.d.ts → flows/account/Profile/ProfileEntry.d.ts} +0 -0
  304. /package/dist/modal/components/{Account/AccountSend → flows/account/Send}/AssetNetwork.d.ts +0 -0
  305. /package/dist/modal/components/{Account/AccountSend → flows/account/Send}/context.d.ts +0 -0
  306. /package/dist/modal/components/{Account/AccountSend → flows/account/Send}/index.d.ts +0 -0
  307. /package/dist/modal/components/{OAuth → flows/auth/OAuth}/OAuth.d.ts +0 -0
  308. /package/dist/modal/components/{RecoverySecretStep → flows/auth/RecoverySecretStep}/RecoverySecretStep.d.ts +0 -0
  309. /package/dist/modal/components/{ExternalWalletStep → shared/ConnectExternalWallet}/config.d.ts +0 -0
  310. /package/dist/modal/components/{AuthInput → shared/EmailOrPhone}/phoneMasks.d.ts +0 -0
  311. /package/dist/modal/components/{ExternalWallets → shared}/ExternalWallets.d.ts +0 -0
@@ -0,0 +1,41 @@
1
+ "use client";
2
+ import "../../chunk-MMUBH76A.js";
3
+ import { useCallback, useEffect, useState } from "react";
4
+ import { useStore } from "../../provider/stores/useStore.js";
5
+ const useDropdownPosition = (inputRef) => {
6
+ const [dropdownMaxHeight, setDropdownMaxHeight] = useState();
7
+ const [dropdownWidth, setDropdownWidth] = useState();
8
+ const [mobileAnchor, setMobileAnchor] = useState(null);
9
+ const modalContainerRef = useStore((state) => state.refs.modalContainer);
10
+ const resize = useCallback(() => {
11
+ if (typeof window !== "undefined" && inputRef.current) {
12
+ const rect = inputRef.current.getBoundingClientRect();
13
+ const newMaxHeight = Math.max(window.innerHeight - rect.bottom - 20, window.innerHeight * 0.25);
14
+ setDropdownMaxHeight((prev) => prev !== newMaxHeight ? newMaxHeight : prev);
15
+ setDropdownWidth((prev) => prev !== rect.width ? rect.width : prev);
16
+ const isMobile = window.innerWidth <= 480;
17
+ if (isMobile) {
18
+ const modalContainer = modalContainerRef.current;
19
+ if (modalContainer) {
20
+ const modalRect = modalContainer.getBoundingClientRect();
21
+ const topFromModal = rect.top - modalRect.top;
22
+ const bottomFromModal = topFromModal + rect.height;
23
+ setMobileAnchor((prev) => prev !== bottomFromModal ? bottomFromModal : prev);
24
+ }
25
+ } else {
26
+ setMobileAnchor(null);
27
+ }
28
+ }
29
+ }, [inputRef, modalContainerRef]);
30
+ useEffect(() => {
31
+ resize();
32
+ typeof window !== "undefined" && window.addEventListener("resize", resize);
33
+ return () => {
34
+ typeof window !== "undefined" && window.removeEventListener("resize", resize);
35
+ };
36
+ }, [resize]);
37
+ return { dropdownMaxHeight, dropdownWidth, mobileAnchor, resize };
38
+ };
39
+ export {
40
+ useDropdownPosition
41
+ };
@@ -1 +1,4 @@
1
- export declare const useGoBack: () => () => void;
1
+ export declare const useGoBack: () => {
2
+ goBack: () => void;
3
+ canGoBack: boolean;
4
+ };
@@ -1,51 +1,75 @@
1
1
  "use client";
2
2
  import "../../chunk-MMUBH76A.js";
3
- import { useInternalClient } from "../../provider/hooks/utils/useInternalClient.js";
3
+ import { useLogout } from "../../provider/index.js";
4
4
  import { useExternalWallets } from "../../provider/providers/ExternalWalletProvider.js";
5
- import { useModalStore } from "../stores/index.js";
6
- import { getAddFundsStep, ModalStep } from "../utils/steps.js";
5
+ import { useStore } from "../../provider/stores/useStore.js";
6
+ import { AccountPreviousView } from "../components/flows/account/AccountProvider/AccountContext.js";
7
+ import { getAddFundsStep } from "../components/flows/account/AddFunds/utils.js";
8
+ import { useCanGoBack } from "./useCanbGoBack.js";
7
9
  const useGoBack = () => {
8
- const currentStep = useModalStore((state) => state.step);
9
- const refs = useModalStore((state) => state.refs);
10
- const setStep = useModalStore((state) => state.setStep);
11
- const accountAddFundTab = useModalStore((state) => state.accountAddFundTab);
12
- const decrementStep = useModalStore((state) => state.decrementStep);
13
- const resetState = useModalStore((state) => state.resetState);
14
- const { setChainIdSwitchingTo, disconnectExternalWallet } = useExternalWallets();
15
- const para = useInternalClient();
16
- const iFrameUrl = useModalStore((state) => state.iFrameUrl);
17
- const setIFrameUrl = useModalStore((state) => state.setIFrameUrl);
18
- const setIsIFrameReady = useModalStore((state) => state.setIsIFrameReady);
10
+ const accountAddFundTab = useStore((state) => state.accountAddFundTab);
11
+ const setIFrameUrl = useStore((state) => state.setIFrameUrl);
12
+ const setAuthMethod = useStore((state) => state.setAuthMethod);
13
+ const authMethod = useStore((state) => state.authMethod);
14
+ const paraState = useStore((state) => state.paraState);
15
+ const setSelectedAuthView = useStore((state) => state.setSelectedAuthView);
16
+ const selectedAuthView = useStore((state) => state.selectedAuthView);
17
+ const accountView = useStore((state) => state.accountView);
18
+ const setAccountView = useStore((state) => state.setAccountView);
19
+ const setSelectedExternalWallet = useStore((state) => state.setSelectedExternalWallet);
20
+ const setIsExternalWalletConnecting = useStore((state) => state.setIsExternalWalletConnecting);
21
+ const setIsNavigatingBack = useStore((state) => state.setIsNavigatingBack);
22
+ const { logout } = useLogout();
23
+ const { canGoBack } = useCanGoBack();
24
+ const { setChainIdSwitchingTo } = useExternalWallets();
19
25
  const goBack = () => {
20
- if (accountAddFundTab && currentStep === ModalStep.ADD_FUNDS_AWAITING) {
21
- setStep(getAddFundsStep(accountAddFundTab));
22
- } else {
23
- decrementStep();
26
+ if (!canGoBack) {
27
+ return;
24
28
  }
25
- switch (refs.currentStep.current) {
26
- case ModalStep.AUTH_MAIN:
27
- case ModalStep.AUTH_MORE:
28
- case ModalStep.EX_WALLET_SELECTED:
29
- case ModalStep.EXTERNAL_WALLET_VERIFICATION: {
30
- resetState();
31
- if (para.isExternalWalletAuth) {
32
- disconnectExternalWallet();
29
+ if ((paraState == null ? void 0 : paraState.corePhase) === "wallet_flow") {
30
+ logout();
31
+ setIsNavigatingBack(true);
32
+ setIFrameUrl(null);
33
+ setSelectedExternalWallet(void 0);
34
+ setIsExternalWalletConnecting(false);
35
+ setSelectedAuthView("AUTH_MAIN");
36
+ }
37
+ if ((paraState == null ? void 0 : paraState.corePhase) === "auth_flow") {
38
+ if ((paraState == null ? void 0 : paraState.authPhase) === "waiting_for_session" && authMethod !== null) {
39
+ const info = paraState.authStateInfo;
40
+ const optionCount = [info == null ? void 0 : info.hasPasskey, info == null ? void 0 : info.hasPassword, info == null ? void 0 : info.hasPin].filter(Boolean).length;
41
+ if (optionCount > 1) {
42
+ setIFrameUrl(null);
43
+ setAuthMethod(null);
44
+ return;
33
45
  }
34
- break;
35
46
  }
36
- case ModalStep.PASSWORD_CREATION: {
37
- const urlWithTimestamp = iFrameUrl ? `${iFrameUrl}${iFrameUrl.includes("?") ? "&" : "?"}_t=${Date.now()}` : "";
38
- setIFrameUrl(urlWithTimestamp);
39
- setIsIFrameReady(false);
40
- break;
47
+ if ((paraState == null ? void 0 : paraState.authPhase) !== "unauthenticated") {
48
+ logout();
49
+ }
50
+ setIsNavigatingBack(true);
51
+ setIFrameUrl(null);
52
+ setSelectedExternalWallet(void 0);
53
+ setIsExternalWalletConnecting(false);
54
+ if (selectedAuthView !== "AUTH_MAIN") {
55
+ setSelectedAuthView("AUTH_MAIN");
56
+ return;
41
57
  }
42
- case ModalStep.CHAIN_SWITCH: {
43
- setChainIdSwitchingTo();
44
- break;
58
+ return;
59
+ }
60
+ if ((paraState == null ? void 0 : paraState.corePhase) === "authenticated" || (paraState == null ? void 0 : paraState.corePhase) === "guest_mode") {
61
+ if (accountAddFundTab && accountView === "ACCOUNT_ADD_FUNDS_AWAITING") {
62
+ setAccountView(getAddFundsStep(accountAddFundTab));
63
+ } else {
64
+ const previousView = AccountPreviousView[accountView];
65
+ if (previousView) {
66
+ setAccountView(previousView);
67
+ }
45
68
  }
69
+ setChainIdSwitchingTo();
46
70
  }
47
71
  };
48
- return goBack;
72
+ return { goBack, canGoBack };
49
73
  };
50
74
  export {
51
75
  useGoBack
@@ -6,13 +6,12 @@ import {
6
6
  } from "../../chunk-MMUBH76A.js";
7
7
  import { useMutation, useQueryClient } from "@tanstack/react-query";
8
8
  import { useInternalClient } from "../../provider/hooks/utils/useInternalClient.js";
9
- import { useModalStore, useModalSessionStore } from "../stores/index.js";
9
+ import { useModalSessionStore } from "../stores/index.js";
10
10
  import { useSignMessage, useSignTransaction, useWalletState } from "../../provider/index.js";
11
11
  import {
12
12
  hexStringToBase64
13
13
  } from "@getpara/web-sdk";
14
14
  import { useMemo, useCallback } from "react";
15
- import { ModalStep } from "../utils/steps.js";
16
15
  import { useStore } from "../../provider/stores/useStore.js";
17
16
  function useSendMutations({
18
17
  estimateOnSuccess,
@@ -21,7 +20,7 @@ function useSendMutations({
21
20
  broadcastOnError
22
21
  }) {
23
22
  const para = useInternalClient();
24
- const setStep = useModalStore((state) => state.setStep);
23
+ const setAccountView = useStore((state) => state.setAccountView);
25
24
  const setSendTx = useModalSessionStore((state) => state.setSendTx);
26
25
  const { signTransactionAsync } = useSignTransaction();
27
26
  const { signMessageAsync } = useSignMessage();
@@ -37,7 +36,7 @@ function useSendMutations({
37
36
  if (currentSendTx) {
38
37
  setSendTx(__spreadProps(__spreadValues({}, currentSendTx), { result: data }));
39
38
  }
40
- setStep(ModalStep.ACCOUNT_MAIN);
39
+ setAccountView("ACCOUNT_MAIN");
41
40
  refs.balancesInvalidationTime.current = Date.now();
42
41
  queryClient.invalidateQueries({
43
42
  queryKey: ["useProfileBalance"],
@@ -45,7 +44,7 @@ function useSendMutations({
45
44
  });
46
45
  }
47
46
  },
48
- [setSendTx, setStep, queryClient, refs]
47
+ [setSendTx, setAccountView, queryClient, refs]
49
48
  );
50
49
  const handleBroadcastSuccess = useCallback(
51
50
  (data) => {
@@ -6,17 +6,17 @@ import {
6
6
  } from "../../chunk-MMUBH76A.js";
7
7
  import { useEffect, useMemo, useRef, useState } from "react";
8
8
  import { useInternalClient } from "../../provider/hooks/utils/useInternalClient.js";
9
- import { useModalStore, useModalSessionStore } from "../stores/index.js";
9
+ import { useModalSessionStore } from "../stores/index.js";
10
10
  import { getBaseUrl } from "@getpara/web-sdk";
11
11
  import { useAccount } from "../../provider/index.js";
12
- import { ModalStep } from "../utils/steps.js";
13
12
  import { SESSION_COOKIE_HEADER_NAME } from "@getpara/user-management-client";
13
+ import { store, useStore } from "../../provider/stores/useStore.js";
14
14
  const TRANSACTION_CLEANUP_DELAY_MS = 3e4;
15
15
  function useTransactionMonitoring() {
16
16
  var _a, _b, _c, _d, _e, _f;
17
17
  const sendTx = useModalSessionStore((state) => state.sendTx);
18
18
  const setSendTx = useModalSessionStore((state) => state.setSendTx);
19
- const currentStep = useModalStore((state) => state.step);
19
+ const accountView = useStore((state) => state.accountView);
20
20
  const para = useInternalClient();
21
21
  const socketRef = useRef(null);
22
22
  const subscribedDataRef = useRef(null);
@@ -151,24 +151,24 @@ function useTransactionMonitoring() {
151
151
  if (typeof window === "undefined") return;
152
152
  const status = (_b2 = (_a2 = sendTx == null ? void 0 : sendTx.result) == null ? void 0 : _a2.status) == null ? void 0 : _b2.status;
153
153
  const isCompleted = status === "CONFIRMED" || status === "FAILED";
154
- const isOnAccountOrMonitor = currentStep === ModalStep.ACCOUNT_MAIN || currentStep === ModalStep.ACCOUNT_MONITOR_TX;
154
+ const isOnAccountOrMonitor = accountView === "ACCOUNT_MAIN" || accountView === "ACCOUNT_MONITOR_TX";
155
155
  if (isCompleted && sendTx && !isOnAccountOrMonitor) {
156
156
  setSendTx(null);
157
157
  return;
158
158
  }
159
- if (isCompleted && currentStep === ModalStep.ACCOUNT_MAIN && ((_c2 = sendTx == null ? void 0 : sendTx.result) == null ? void 0 : _c2.txHash)) {
159
+ if (isCompleted && accountView === "ACCOUNT_MAIN" && ((_c2 = sendTx == null ? void 0 : sendTx.result) == null ? void 0 : _c2.txHash)) {
160
160
  const txHash = sendTx.result.txHash;
161
161
  const timeoutId = setTimeout(() => {
162
162
  var _a3, _b3;
163
163
  const sessionState = useModalSessionStore.getState();
164
- const modalState = useModalStore.getState();
165
- if (((_b3 = (_a3 = sessionState.sendTx) == null ? void 0 : _a3.result) == null ? void 0 : _b3.txHash) === txHash && modalState.step === ModalStep.ACCOUNT_MAIN) {
164
+ const currentAccountView = store.getState().accountView;
165
+ if (((_b3 = (_a3 = sessionState.sendTx) == null ? void 0 : _a3.result) == null ? void 0 : _b3.txHash) === txHash && currentAccountView === "ACCOUNT_MAIN") {
166
166
  setSendTx(null);
167
167
  }
168
168
  }, TRANSACTION_CLEANUP_DELAY_MS);
169
169
  return () => clearTimeout(timeoutId);
170
170
  }
171
- }, [(_e = (_d = sendTx == null ? void 0 : sendTx.result) == null ? void 0 : _d.status) == null ? void 0 : _e.status, (_f = sendTx == null ? void 0 : sendTx.result) == null ? void 0 : _f.txHash, currentStep, setSendTx]);
171
+ }, [(_e = (_d = sendTx == null ? void 0 : sendTx.result) == null ? void 0 : _d.status) == null ? void 0 : _e.status, (_f = sendTx == null ? void 0 : sendTx.result) == null ? void 0 : _f.txHash, accountView, setSendTx]);
172
172
  }
173
173
  export {
174
174
  useTransactionMonitoring
@@ -1,8 +1,7 @@
1
1
  export * from './ParaModal.js';
2
2
  export type { ParaModalProps, ParaModalHandle, ParaModalTheme } from './types/modalProps.js';
3
- export { ModalStep, type ModalStepProp } from './utils/steps.js';
4
3
  export { AuthLayout } from './types/modalProps.js';
5
4
  export * from './utils/openPopup.js';
6
5
  export { ON_RAMP_PROVIDERS, ON_RAMP_ASSETS, NETWORKS, getAssetIcon, getAssetCode, getNetworkIcon, getNetworkName, } from '@getpara/react-common';
7
- export { SaveRecoverySecret } from './components/RecoverySecretStep/RecoverySecretStep.js';
6
+ export { SaveRecoverySecret } from './components/flows/auth/RecoverySecretStep/RecoverySecretStep.js';
8
7
  export * from './utils/onramps.js';
@@ -1,7 +1,6 @@
1
1
  "use client";
2
2
  import "../chunk-MMUBH76A.js";
3
3
  export * from "./ParaModal.js";
4
- import { ModalStep } from "./utils/steps.js";
5
4
  import { AuthLayout } from "./types/modalProps.js";
6
5
  export * from "./utils/openPopup.js";
7
6
  import {
@@ -13,11 +12,10 @@ import {
13
12
  getNetworkIcon,
14
13
  getNetworkName
15
14
  } from "@getpara/react-common";
16
- import { SaveRecoverySecret } from "./components/RecoverySecretStep/RecoverySecretStep.js";
15
+ import { SaveRecoverySecret } from "./components/flows/auth/RecoverySecretStep/RecoverySecretStep.js";
17
16
  export * from "./utils/onramps.js";
18
17
  export {
19
18
  AuthLayout,
20
- ModalStep,
21
19
  NETWORKS,
22
20
  ON_RAMP_ASSETS,
23
21
  ON_RAMP_PROVIDERS,
@@ -1,2 +1 @@
1
- export * from './modal/useModalStore.js';
2
1
  export * from './modal/useModalSessionStore.js';
@@ -1,3 +1,2 @@
1
1
  "use client";
2
- export * from "./modal/useModalStore.js";
3
2
  export * from "./modal/useModalSessionStore.js";
@@ -1,7 +1,7 @@
1
1
  import ParaWeb, { BalancesConfig, CurrentWalletIds, SupportedAccountLinks, TOAuthMethod } from '@getpara/web-sdk';
2
2
  import { Theme } from '@getpara/react-components';
3
- import { OnModalStepChangeValue } from '../stores/index.js';
4
- import { ModalStep, ModalStepProp } from '../utils/steps.js';
3
+ import { AccountView } from '../components/flows/account/AccountProvider/AccountContext.js';
4
+ import { AuthView } from '../../provider/providers/AuthProvider/AuthContext.js';
5
5
  export type ParaModalHandle = {
6
6
  /**
7
7
  * Move the modal backward
@@ -14,7 +14,7 @@ export type ParaModalHandle = {
14
14
  /**
15
15
  * Returns if the modal is expanded
16
16
  */
17
- currentStep: () => ModalStep;
17
+ currentStep: () => AccountView | AuthView;
18
18
  /**
19
19
  * Trigger the modal close handler
20
20
  */
@@ -31,6 +31,7 @@ export declare enum AuthLayout {
31
31
  EXTERNAL_CONDENSED = "EXTERNAL:CONDENSED"
32
32
  }
33
33
  export type TAuthLayout = `${AuthLayout}`;
34
+ export type StepOverride = AccountView | Extract<AuthView, 'AUTH_MAIN' | 'AUTH_ALL_OPTIONS' | 'AUTH_ALL_EXTERNAL_WALLETS'>;
34
35
  export interface ParaModalProps {
35
36
  /**
36
37
  * Your ParaWeb instance.
@@ -83,7 +84,7 @@ export interface ParaModalProps {
83
84
  * Whether to display information about on-chain wallets and use related terminology in the Para Modal.
84
85
  */
85
86
  hideWallets?: boolean;
86
- currentStepOverride?: ModalStepProp | undefined;
87
+ currentStepOverride?: StepOverride;
87
88
  /**
88
89
  * Whether or not to display just the modal without the overlay component.
89
90
  * Useful for rendering the modal inside a custom component
@@ -106,10 +107,6 @@ export interface ParaModalProps {
106
107
  * Default email or phone number (formatted like: +15555555555) to pre-populate the input field.
107
108
  */
108
109
  defaultAuthIdentifier?: string;
109
- /**
110
- * Called when the modal step changes
111
- */
112
- onModalStepChange?: (value: OnModalStepChangeValue) => void;
113
110
  /**
114
111
  * Called when the modal is closed
115
112
  */
@@ -118,11 +115,24 @@ export interface ParaModalProps {
118
115
  * Whether to enable guest login. A guest user will be provisioned embedded wallets that they will then claim upon signing up through your app.
119
116
  */
120
117
  isGuestModeEnabled?: boolean;
118
+ /**
119
+ * @deprecated
120
+ */
121
121
  loginTransitionOverride?: (para: ParaWeb) => Promise<void>;
122
+ /**
123
+ * @deprecated use onWalletCreation instead
124
+ */
122
125
  createWalletOverride?: (para: ParaWeb) => Promise<{
123
126
  recoverySecret?: string;
124
127
  walletIds: CurrentWalletIds;
125
128
  }>;
129
+ /**
130
+ * Callback called when new wallets are created during the authentication process
131
+ * This is useful for storing the recovery secret for newly created wallets
132
+ */
133
+ onWalletCreated?: (_: {
134
+ recoverySecret?: string;
135
+ }) => void;
126
136
  /**
127
137
  * Which external accounts or wallets to allow your users to link to their accounts. The accounts will be displayed in this order in the modal account screen.
128
138
  * If not provided, will default to your Developer Portal configuration or to all available account types.
@@ -3,10 +3,9 @@ import {
3
3
  __spreadProps,
4
4
  __spreadValues
5
5
  } from "../chunk-MMUBH76A.js";
6
- import { jsx, jsxs } from "react/jsx-runtime";
7
- import { forwardRef, useEffect, useState } from "react";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import { forwardRef, useEffect, useMemo } from "react";
8
8
  import { useStore } from "./stores/useStore.js";
9
- import { useModalStore } from "../modal/stores/index.js";
10
9
  import { useAutoSessionKeepAlive } from "./hooks/utils/useAutoSessionKeepAlive.js";
11
10
  import { useEventListeners } from "./hooks/utils/useEventListeners.js";
12
11
  import { ExternalWalletWrapper } from "./components/ExternalWalletWrapper.js";
@@ -14,10 +13,11 @@ import { ParaModal } from "../modal/ParaModal.js";
14
13
  import { isConfigType, isParaWeb } from "./utils/paraConfigTypeGuards.js";
15
14
  import ParaWeb from "@getpara/web-sdk";
16
15
  import { EXTERNAL_WALLET_TYPES } from "@getpara/web-sdk";
17
- import { AuthProvider } from "./providers/AuthProvider.js";
18
16
  import { AccountLinkProvider } from "./providers/AccountLinkProvider.js";
19
17
  import { AssetsProvider } from "./providers/AssetsProvider.js";
18
+ import { AuthProvider } from "./providers/AuthProvider/AuthProvider.js";
20
19
  const ParaProviderMin = forwardRef(({ children, paraClientConfig, callbacks, config, externalWalletConfig, paraModalConfig }, ref) => {
20
+ var _a;
21
21
  useEventListeners(callbacks);
22
22
  useAutoSessionKeepAlive({ disabled: config.disableAutoSessionKeepAlive });
23
23
  const setClient = useStore((state) => state.setClient);
@@ -39,8 +39,9 @@ const ParaProviderMin = forwardRef(({ children, paraClientConfig, callbacks, con
39
39
  const rpcUrl = useStore((state) => state.rpcUrl);
40
40
  const setRpcUrl = useStore((state) => state.setRpcUrl);
41
41
  const setProviderProps = useStore((state) => state.setProviderProps);
42
- const setModalError = useModalStore((state) => state.setModalError);
43
- const [isClientReady, setIsClientReady] = useState(client == null ? void 0 : client.isReady);
42
+ const setModalError = useStore((state) => state.setModalError);
43
+ const setParaState = useStore((state) => state.setParaState);
44
+ const paraState = useStore((state) => state.paraState);
44
45
  useEffect(() => {
45
46
  setProviderProps(__spreadProps(__spreadValues(__spreadValues(__spreadValues({}, config), externalWalletConfig), paraModalConfig), {
46
47
  // Redacting walletConnect to avoid exposing project id
@@ -62,15 +63,15 @@ const ParaProviderMin = forwardRef(({ children, paraClientConfig, callbacks, con
62
63
  if (modalConfig !== paraModalConfig) setModalConfig(paraModalConfig);
63
64
  }, [paraModalConfig]);
64
65
  useEffect(() => {
65
- var _a;
66
+ var _a2;
66
67
  if (connectionOnly !== (externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly)) {
67
- setConnectionOnly((_a = externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly) != null ? _a : false);
68
+ setConnectionOnly((_a2 = externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly) != null ? _a2 : false);
68
69
  }
69
70
  }, [externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly]);
70
71
  useEffect(() => {
71
- var _a, _b;
72
+ var _a2, _b;
72
73
  if (includeWalletVerification !== (externalWalletConfig == null ? void 0 : externalWalletConfig.includeWalletVerification)) {
73
- if ((externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly) || (isParaWeb(paraClientConfig) ? paraClientConfig.externalWalletConnectionOnly : (_a = paraClientConfig.opts) == null ? void 0 : _a.externalWalletConnectionOnly)) {
74
+ if ((externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly) || (isParaWeb(paraClientConfig) ? paraClientConfig.externalWalletConnectionOnly : (_a2 = paraClientConfig.opts) == null ? void 0 : _a2.externalWalletConnectionOnly)) {
74
75
  console.warn("includeWalletVerification has no effect when using connection only external wallets");
75
76
  setIncludeWalletVerification(false);
76
77
  } else {
@@ -79,15 +80,15 @@ const ParaProviderMin = forwardRef(({ children, paraClientConfig, callbacks, con
79
80
  }
80
81
  }, [externalWalletConfig == null ? void 0 : externalWalletConfig.includeWalletVerification]);
81
82
  useEffect(() => {
82
- var _a;
83
+ var _a2;
83
84
  if (externalWallets !== (externalWalletConfig == null ? void 0 : externalWalletConfig.wallets)) {
84
- setExternalWallets((_a = externalWalletConfig == null ? void 0 : externalWalletConfig.wallets) != null ? _a : [...EXTERNAL_WALLET_TYPES]);
85
+ setExternalWallets((_a2 = externalWalletConfig == null ? void 0 : externalWalletConfig.wallets) != null ? _a2 : [...EXTERNAL_WALLET_TYPES]);
85
86
  }
86
87
  }, [externalWalletConfig == null ? void 0 : externalWalletConfig.wallets]);
87
88
  useEffect(() => {
88
- var _a, _b;
89
+ var _a2, _b;
89
90
  if (externalWalletsWithFullAuth !== (externalWalletConfig == null ? void 0 : externalWalletConfig.createLinkedEmbeddedForExternalWallets)) {
90
- if ((externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly) || (isParaWeb(paraClientConfig) ? paraClientConfig.externalWalletConnectionOnly : (_a = paraClientConfig.opts) == null ? void 0 : _a.externalWalletConnectionOnly)) {
91
+ if ((externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly) || (isParaWeb(paraClientConfig) ? paraClientConfig.externalWalletConnectionOnly : (_a2 = paraClientConfig.opts) == null ? void 0 : _a2.externalWalletConnectionOnly)) {
91
92
  console.warn("createLinkedEmbeddedForExternalWallets has no effect when using connection only external wallets");
92
93
  setExternalWalletsWithFullAuth([]);
93
94
  } else {
@@ -105,11 +106,6 @@ const ParaProviderMin = forwardRef(({ children, paraClientConfig, callbacks, con
105
106
  newClient.ctx.portalUrlOverride = globalThis.__PARA_PORTAL_URL_OVERRIDE__;
106
107
  }
107
108
  newClient.portalTheme = paraModalConfig == null ? void 0 : paraModalConfig.theme;
108
- if (newClient.isReady) {
109
- setIsClientReady(true);
110
- } else {
111
- setIsClientReady(false);
112
- }
113
109
  setClient(newClient);
114
110
  }, [paraClientConfig]);
115
111
  useEffect(() => {
@@ -118,31 +114,31 @@ const ParaProviderMin = forwardRef(({ children, paraClientConfig, callbacks, con
118
114
  }
119
115
  }, [paraModalConfig == null ? void 0 : paraModalConfig.theme, client]);
120
116
  useEffect(() => {
121
- if (client && !client.isReady) {
122
- client.ready().then(() => {
123
- setIsClientReady(true);
124
- }).catch((err) => {
125
- setIsClientReady(false);
126
- console.error("Error initializing Para client:", err);
127
- });
128
- }
117
+ if (!client) return;
118
+ const unsubscribe = client.onStatePhaseChange((snapshot) => {
119
+ setParaState(snapshot);
120
+ });
121
+ return unsubscribe;
129
122
  }, [client]);
130
- if (!client || !isClientReady) {
123
+ const isReady = (_a = paraState == null ? void 0 : paraState.isReady) != null ? _a : false;
124
+ const ChildrenComponents = useMemo(() => {
125
+ if (!isReady) {
126
+ return null;
127
+ }
128
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
129
+ children,
130
+ !config.disableEmbeddedModal && /* @__PURE__ */ jsx(ParaModal, { ref })
131
+ ] });
132
+ }, [isReady, children, config.disableEmbeddedModal, ref]);
133
+ if (!client) {
131
134
  return null;
132
135
  }
133
136
  return /* @__PURE__ */ jsx(
134
137
  AuthProvider,
135
138
  {
136
- is2faEnabled: paraModalConfig == null ? void 0 : paraModalConfig.twoFactorAuthEnabled,
137
- isRecoverySecretStepEnabled: paraModalConfig == null ? void 0 : paraModalConfig.recoverySecretStepEnabled,
138
- overrides: {
139
- login: paraModalConfig == null ? void 0 : paraModalConfig.loginTransitionOverride,
140
- createWallets: paraModalConfig == null ? void 0 : paraModalConfig.createWalletOverride
141
- },
142
- children: /* @__PURE__ */ jsx(AssetsProvider, { children: /* @__PURE__ */ jsx(ExternalWalletWrapper, { config: externalWalletConfig, children: /* @__PURE__ */ jsxs(AccountLinkProvider, { children: [
143
- children,
144
- !config.disableEmbeddedModal && client.isReady && /* @__PURE__ */ jsx(ParaModal, { ref })
145
- ] }) }) })
139
+ isTwoFactorAuthEnabled: paraModalConfig == null ? void 0 : paraModalConfig.twoFactorAuthEnabled,
140
+ defaultAuthIdentifier: paraModalConfig == null ? void 0 : paraModalConfig.defaultAuthIdentifier,
141
+ children: /* @__PURE__ */ jsx(AssetsProvider, { children: /* @__PURE__ */ jsx(ExternalWalletWrapper, { config: externalWalletConfig, children: /* @__PURE__ */ jsx(AccountLinkProvider, { children: ChildrenComponents }) }) })
146
142
  }
147
143
  );
148
144
  });
@@ -2,4 +2,4 @@ import ParaWeb, { TWalletType } from '@getpara/web-sdk';
2
2
  export declare const getWallet: (para?: ParaWeb, selectedWallet?: {
3
3
  id?: string;
4
4
  type?: TWalletType;
5
- }, isConnected?: boolean) => Promise<Omit<import("@getpara/web-sdk").Wallet, "signer"> | null>;
5
+ }, isConnected?: boolean) => Promise<import("@getpara/core-sdk/dist/types/types").WalletNoSigner | null>;
@@ -1,49 +1,43 @@
1
- export declare const signUpOrLogIn: import("./utils.js").CoreAction<"signUpOrLogIn">;
2
- export declare const verifyNewAccount: import("./utils.js").CoreAction<"verifyNewAccount">;
3
- export declare const waitForLogin: import("./utils.js").CoreAction<"waitForLogin">;
4
- export declare const waitForSignup: import("./utils.js").CoreAction<"waitForSignup">;
5
- export declare const waitForWalletCreation: import("./utils.js").CoreAction<"waitForWalletCreation">;
6
- export declare const verifyOAuth: import("./utils.js").CoreAction<"verifyOAuth">;
7
- export declare const verifyFarcaster: import("./utils.js").CoreAction<"verifyFarcaster">;
8
- export declare const verifyTelegram: import("./utils.js").CoreAction<"verifyTelegram">;
9
- export declare const loginExternalWallet: import("./utils.js").CoreAction<"loginExternalWallet">;
10
- export declare const verifyExternalWallet: import("./utils.js").CoreAction<"verifyExternalWallet">;
11
- export declare const setup2fa: import("./utils.js").CoreAction<"setup2fa">;
12
- export declare const enable2fa: import("./utils.js").CoreAction<"enable2fa">;
13
- export declare const verify2fa: import("./utils.js").CoreAction<"verify2fa">;
14
- export declare const keepSessionAlive: import("./utils.js").CoreAction<"keepSessionAlive">;
15
- export declare const logout: import("./utils.js").CoreAction<"logout">;
16
- export declare const resendVerificationCode: import("./utils.js").CoreAction<"resendVerificationCode">;
17
- export declare const createWallet: import("./utils.js").CoreAction<"createWallet">;
18
- export declare const createWalletPerType: import("./utils.js").CoreAction<"createWalletPerType">;
19
- export declare const createPregenWallet: import("./utils.js").CoreAction<"createPregenWallet">;
20
- export declare const createPregenWalletPerType: import("./utils.js").CoreAction<"createPregenWalletPerType">;
21
- export declare const claimPregenWallets: import("./utils.js").CoreAction<"claimPregenWallets">;
22
- export declare const hasPregenWallet: import("./utils.js").CoreAction<"hasPregenWallet">;
23
- export declare const updatePregenWalletIdentifier: import("./utils.js").CoreAction<"updatePregenWalletIdentifier">;
24
- export declare const createGuestWallets: import("./utils.js").CoreAction<"createGuestWallets">;
25
- export declare const signMessage: import("./utils.js").CoreAction<"signMessage">;
26
- export declare const signTransaction: import("./utils.js").CoreAction<"signTransaction">;
27
- export declare const getWalletBalance: import("./utils.js").CoreAction<"getWalletBalance">;
28
- export declare const issueJwt: import("./utils.js").CoreAction<"issueJwt">;
29
- export declare const getLinkedAccounts: import("./utils.js").CoreAction<"getLinkedAccounts">;
30
- export declare const accountLinkInProgress: import("./utils.js").CoreAction<"accountLinkInProgress">;
31
- export declare const addCredential: import("./utils.js").CoreAction<"addCredential">;
32
- export declare const linkAccount: (_?: import("@getpara/core-sdk").default, __?: {
33
- auth: import("@getpara/shared").VerifiedAuth;
34
- } | {
35
- externalWallet: import("@getpara/shared").ExternalWalletInfo;
36
- } | {
37
- type: import("@getpara/shared").TLinkedAccountType | "X";
38
- } | undefined) => Promise<import("@getpara/core-sdk").AccountLinkInProgress>;
39
- export declare const unlinkAccount: (_?: import("@getpara/core-sdk").default, __?: {
40
- linkedAccountId: string;
41
- } | undefined) => Promise<import("@getpara/shared").LinkedAccounts>;
42
- export declare const verifyEmailOrPhoneLink: (_?: import("@getpara/core-sdk").default, __?: {
43
- verificationCode?: string;
44
- } | undefined) => Promise<import("@getpara/shared").LinkedAccounts>;
45
- export declare const verifyFarcasterLink: (_?: import("@getpara/core-sdk").default, __?: import("@getpara/core-sdk/dist/types/types/methods.js").FarcasterParams | undefined) => Promise<import("@getpara/shared").LinkedAccounts>;
46
- export declare const verifyTelegramLink: (_?: import("@getpara/core-sdk").default, __?: import("@getpara/core-sdk/dist/types/types/methods.js").TelegramParams | undefined) => Promise<import("@getpara/shared").LinkedAccounts>;
47
- export declare const verifyOAuthLink: (_?: import("@getpara/core-sdk").default, __?: import("@getpara/core-sdk/dist/types/types/methods.js").OAuthParams | undefined) => Promise<import("@getpara/shared").LinkedAccounts>;
48
- export declare const verifyExternalWalletLink: (_?: import("@getpara/core-sdk").default, __?: Omit<import("@getpara/shared").VerifyExternalWalletParams, "externalWallet"> | undefined) => Promise<import("@getpara/shared").LinkedAccounts>;
49
- export declare const exportPrivateKey: import("./utils.js").CoreAction<"exportPrivateKey">;
1
+ import type ParaWeb from '@getpara/web-sdk';
2
+ import type { SignUpOrLogInParams, SignUpOrLogInResponse, WaitForLoginParams, WaitForLoginResponse, WaitForSignupParams, WaitForWalletCreationParams, WaitForWalletCreationResponse, VerifyOAuthProcessParams, OAuthResponse, VerifyFarcasterParams, VerifyTelegramParams, LoginExternalWalletParams, LoginExternalWalletResponse, VerifyExternalWalletParams, VerifyExternalWalletResponse, Setup2faResponse, Enable2faParams, Verify2faParams, Verify2faResponse, LogoutParams, ResendVerificationCodeParams, CreateWalletParams, CreateWalletResponse, CreateWalletPerTypeParams, CreateWalletPerTypeResponse, CreatePregenWalletParams, CreatePregenWalletResponse, CreatePregenWalletPerTypeParams, CreatePregenWalletPerTypeResponse, ClaimPregenWalletsParams, ClaimPregenWalletsResponse, HasPregenWalletParams, UpdatePregenWalletIdentifierParams, CreateGuestWalletsResponse, SignMessageParams, SignTransactionParams, FullSignatureRes, GetWalletBalanceParams, IssueJwtParams, IssueJwtResponse, GetLinkedAccountsParams, GetLinkedAccountsResponse, AddCredentialParams, ExportPrivateKeyParams, ExportPrivateKeyResponse, LinkAccountParams, UnlinkAccountParams, VerifyEmailOrPhoneLinkParams, TelegramParams, BaseVerifyExternalWalletParams, VerifyNewAccountParams, VerifyNewAccountResponse, AccountLinkInProgress, LinkedAccounts, AuthenticateWithEmailOrPhoneParams, AuthenticateWithEmailOrPhoneResponse, AuthenticateWithOAuthParams, AuthenticateWithOAuthResponse } from '@getpara/web-sdk';
3
+ export declare const signUpOrLogIn: (para?: ParaWeb, args?: SignUpOrLogInParams) => Promise<SignUpOrLogInResponse>;
4
+ export declare const verifyNewAccount: (para?: ParaWeb, args?: VerifyNewAccountParams) => Promise<VerifyNewAccountResponse>;
5
+ export declare const waitForLogin: (para?: ParaWeb, args?: WaitForLoginParams) => Promise<WaitForLoginResponse>;
6
+ export declare const waitForSignup: (para?: ParaWeb, args?: WaitForSignupParams) => Promise<true>;
7
+ export declare const waitForWalletCreation: (para?: ParaWeb, args?: WaitForWalletCreationParams) => Promise<WaitForWalletCreationResponse>;
8
+ export declare const verifyOAuth: (para?: ParaWeb, args?: VerifyOAuthProcessParams) => Promise<OAuthResponse>;
9
+ export declare const verifyFarcaster: (para?: ParaWeb, args?: VerifyFarcasterParams) => Promise<OAuthResponse>;
10
+ export declare const verifyTelegram: (para?: ParaWeb, args?: VerifyTelegramParams) => Promise<OAuthResponse>;
11
+ export declare const loginExternalWallet: (para?: ParaWeb, args?: LoginExternalWalletParams) => Promise<LoginExternalWalletResponse>;
12
+ export declare const verifyExternalWallet: (para?: ParaWeb, args?: VerifyExternalWalletParams) => Promise<VerifyExternalWalletResponse>;
13
+ export declare const setup2fa: (para?: ParaWeb) => Promise<Setup2faResponse>;
14
+ export declare const enable2fa: (para?: ParaWeb, args?: Enable2faParams) => Promise<void>;
15
+ export declare const verify2fa: (para?: ParaWeb, args?: Verify2faParams) => Promise<Verify2faResponse>;
16
+ export declare const keepSessionAlive: (para?: ParaWeb) => Promise<boolean>;
17
+ export declare const logout: (para?: ParaWeb, args?: LogoutParams) => Promise<void>;
18
+ export declare const resendVerificationCode: (para?: ParaWeb, args?: ResendVerificationCodeParams) => Promise<void>;
19
+ export declare const createWallet: (para?: ParaWeb, args?: CreateWalletParams) => Promise<CreateWalletResponse>;
20
+ export declare const createWalletPerType: (para?: ParaWeb, args?: CreateWalletPerTypeParams) => Promise<CreateWalletPerTypeResponse>;
21
+ export declare const createPregenWallet: (para?: ParaWeb, args?: CreatePregenWalletParams) => Promise<CreatePregenWalletResponse>;
22
+ export declare const createPregenWalletPerType: (para?: ParaWeb, args?: CreatePregenWalletPerTypeParams) => Promise<CreatePregenWalletPerTypeResponse>;
23
+ export declare const claimPregenWallets: (para?: ParaWeb, args?: ClaimPregenWalletsParams) => Promise<ClaimPregenWalletsResponse>;
24
+ export declare const hasPregenWallet: (para?: ParaWeb, args?: HasPregenWalletParams) => Promise<boolean>;
25
+ export declare const updatePregenWalletIdentifier: (para?: ParaWeb, args?: UpdatePregenWalletIdentifierParams) => Promise<void>;
26
+ export declare const createGuestWallets: (para?: ParaWeb) => Promise<CreateGuestWalletsResponse>;
27
+ export declare const signMessage: (para?: ParaWeb, args?: SignMessageParams) => Promise<FullSignatureRes>;
28
+ export declare const signTransaction: (para?: ParaWeb, args?: SignTransactionParams) => Promise<FullSignatureRes>;
29
+ export declare const getWalletBalance: (para?: ParaWeb, args?: GetWalletBalanceParams) => Promise<string>;
30
+ export declare const issueJwt: (para?: ParaWeb, args?: IssueJwtParams) => Promise<IssueJwtResponse>;
31
+ export declare const getLinkedAccounts: (para?: ParaWeb, args?: GetLinkedAccountsParams) => Promise<GetLinkedAccountsResponse>;
32
+ export declare const accountLinkInProgress: (para?: ParaWeb) => Promise<AccountLinkInProgress>;
33
+ export declare const addCredential: (para?: ParaWeb, args?: AddCredentialParams) => Promise<string>;
34
+ export declare const linkAccount: (para?: ParaWeb, args?: LinkAccountParams) => Promise<AccountLinkInProgress>;
35
+ export declare const unlinkAccount: (para?: ParaWeb, args?: UnlinkAccountParams) => Promise<LinkedAccounts>;
36
+ export declare const verifyEmailOrPhoneLink: (para?: ParaWeb, args?: VerifyEmailOrPhoneLinkParams) => Promise<LinkedAccounts>;
37
+ export declare const verifyFarcasterLink: (para?: ParaWeb, args?: VerifyFarcasterParams) => Promise<LinkedAccounts>;
38
+ export declare const verifyTelegramLink: (para?: ParaWeb, args?: TelegramParams) => Promise<LinkedAccounts>;
39
+ export declare const verifyOAuthLink: (para?: ParaWeb, args?: VerifyOAuthProcessParams) => Promise<LinkedAccounts>;
40
+ export declare const verifyExternalWalletLink: (para?: ParaWeb, args?: Omit<BaseVerifyExternalWalletParams, 'externalWallet'>) => Promise<LinkedAccounts>;
41
+ export declare const exportPrivateKey: (para?: ParaWeb, args?: ExportPrivateKeyParams) => Promise<ExportPrivateKeyResponse>;
42
+ export declare const authenticateWithEmailOrPhone: (para?: ParaWeb, args?: AuthenticateWithEmailOrPhoneParams) => Promise<AuthenticateWithEmailOrPhoneResponse>;
43
+ export declare const authenticateWithOAuth: (para?: ParaWeb, args?: AuthenticateWithOAuthParams) => Promise<AuthenticateWithOAuthResponse>;