@getpara/react-sdk 2.0.0-dev.3 → 2.0.0-dev.5

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 (344) hide show
  1. package/dist/cosmos/actions/getCosmjsAminoSigner.d.ts +8 -0
  2. package/dist/cosmos/actions/getCosmjsAminoSigner.js +16 -0
  3. package/dist/cosmos/actions/getCosmjsProtoSigner.d.ts +8 -0
  4. package/dist/cosmos/actions/getCosmjsProtoSigner.js +16 -0
  5. package/dist/cosmos/actions/index.d.ts +2 -0
  6. package/dist/cosmos/actions/index.js +3 -0
  7. package/dist/cosmos/hooks/index.d.ts +2 -0
  8. package/dist/cosmos/hooks/index.js +3 -0
  9. package/dist/cosmos/hooks/useCosmjsAminoSigner.d.ts +11 -0
  10. package/dist/cosmos/hooks/useCosmjsAminoSigner.js +37 -0
  11. package/dist/cosmos/hooks/useCosmjsProtoSigner.d.ts +11 -0
  12. package/dist/cosmos/hooks/useCosmjsProtoSigner.js +37 -0
  13. package/dist/cosmos/index.d.ts +2 -0
  14. package/dist/cosmos/index.js +3 -0
  15. package/dist/css/modal.css +14 -1
  16. package/dist/evm/actions/getViemAccount.d.ts +22 -0
  17. package/dist/evm/actions/getViemAccount.js +20 -0
  18. package/dist/evm/actions/getViemClient.d.ts +7659 -0
  19. package/dist/evm/actions/getViemClient.js +25 -0
  20. package/dist/evm/actions/index.d.ts +2 -0
  21. package/dist/evm/actions/index.js +3 -0
  22. package/dist/evm/hooks/index.d.ts +2 -0
  23. package/dist/evm/hooks/index.js +3 -0
  24. package/dist/evm/hooks/useViemAccount.d.ts +26 -0
  25. package/dist/evm/hooks/useViemAccount.js +32 -0
  26. package/dist/evm/hooks/useViemClient.d.ts +7663 -0
  27. package/dist/evm/hooks/useViemClient.js +30 -0
  28. package/dist/evm/index.d.ts +2 -0
  29. package/dist/evm/index.js +3 -0
  30. package/dist/index.d.ts +3 -5
  31. package/dist/index.js +4 -4
  32. package/dist/provider/ParaProvider.d.ts +1 -2
  33. package/dist/provider/ParaProvider.js +13 -106
  34. package/dist/public/PPMori-Regular.woff2 +0 -0
  35. package/dist/public/PPMori-SemiBold.woff2 +0 -0
  36. package/dist/solana/actions/getSolanaSigner.d.ts +8 -0
  37. package/dist/solana/actions/getSolanaSigner.js +15 -0
  38. package/dist/solana/actions/index.d.ts +1 -0
  39. package/dist/solana/actions/index.js +2 -0
  40. package/dist/solana/hooks/index.d.ts +1 -0
  41. package/dist/solana/hooks/index.js +2 -0
  42. package/dist/solana/hooks/useSolanaSigner.d.ts +12 -0
  43. package/dist/solana/hooks/useSolanaSigner.js +32 -0
  44. package/dist/solana/index.d.ts +2 -0
  45. package/dist/solana/index.js +3 -0
  46. package/package.json +19 -29
  47. package/styles.css/package.json +1 -1
  48. package/dist/cli/cli.mjs +0 -50
  49. package/dist/modal/ParaModal.d.ts +0 -2
  50. package/dist/modal/ParaModal.js +0 -301
  51. package/dist/modal/components/Account/Account.d.ts +0 -5
  52. package/dist/modal/components/Account/Account.js +0 -148
  53. package/dist/modal/components/Account/AccountProfile.d.ts +0 -1
  54. package/dist/modal/components/Account/AccountProfile.js +0 -168
  55. package/dist/modal/components/Account/AccountProfileLink.d.ts +0 -1
  56. package/dist/modal/components/Account/AccountProfileLink.js +0 -206
  57. package/dist/modal/components/Account/AccountProfileLinkOptions.d.ts +0 -1
  58. package/dist/modal/components/Account/AccountProfileLinkOptions.js +0 -111
  59. package/dist/modal/components/Account/AccountProfileUnlink.d.ts +0 -1
  60. package/dist/modal/components/Account/AccountProfileUnlink.js +0 -47
  61. package/dist/modal/components/AddFunds/AddFunds.d.ts +0 -1
  62. package/dist/modal/components/AddFunds/AddFunds.js +0 -69
  63. package/dist/modal/components/AddFunds/AddFundsAsset.d.ts +0 -1
  64. package/dist/modal/components/AddFunds/AddFundsAsset.js +0 -125
  65. package/dist/modal/components/AddFunds/AddFundsAwaiting.d.ts +0 -1
  66. package/dist/modal/components/AddFunds/AddFundsAwaiting.js +0 -78
  67. package/dist/modal/components/AddFunds/AddFundsContext.d.ts +0 -31
  68. package/dist/modal/components/AddFunds/AddFundsContext.js +0 -160
  69. package/dist/modal/components/AddFunds/AddFundsDone.d.ts +0 -6
  70. package/dist/modal/components/AddFunds/AddFundsDone.js +0 -49
  71. package/dist/modal/components/AddFunds/AddFundsProvider.d.ts +0 -1
  72. package/dist/modal/components/AddFunds/AddFundsProvider.js +0 -109
  73. package/dist/modal/components/AddFunds/AddFundsReceive.d.ts +0 -1
  74. package/dist/modal/components/AddFunds/AddFundsReceive.js +0 -83
  75. package/dist/modal/components/AddFunds/AddFundsSettings.d.ts +0 -1
  76. package/dist/modal/components/AddFunds/AddFundsSettings.js +0 -237
  77. package/dist/modal/components/AddFunds/MoonPayEmbed.d.ts +0 -2
  78. package/dist/modal/components/AddFunds/MoonPayEmbed.js +0 -7
  79. package/dist/modal/components/AddFunds/common.d.ts +0 -19
  80. package/dist/modal/components/AddFunds/common.js +0 -24
  81. package/dist/modal/components/AddFunds/index.d.ts +0 -3
  82. package/dist/modal/components/AddFunds/index.js +0 -4
  83. package/dist/modal/components/AuthInput/AuthInput.d.ts +0 -20
  84. package/dist/modal/components/AuthInput/AuthInput.js +0 -277
  85. package/dist/modal/components/AuthInput/hooks/useDropdownPosition.d.ts +0 -7
  86. package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +0 -33
  87. package/dist/modal/components/AuthInput/phoneMasks.d.ts +0 -247
  88. package/dist/modal/components/AuthInput/phoneMasks.js +0 -253
  89. package/dist/modal/components/AuthMainStep/AuthMainStep.d.ts +0 -9
  90. package/dist/modal/components/AuthMainStep/AuthMainStep.js +0 -50
  91. package/dist/modal/components/AuthMainStep/AuthMainStepContent.d.ts +0 -9
  92. package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +0 -164
  93. package/dist/modal/components/AuthOptions/AuthOptions.d.ts +0 -9
  94. package/dist/modal/components/AuthOptions/AuthOptions.js +0 -85
  95. package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.d.ts +0 -1
  96. package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +0 -18
  97. package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.d.ts +0 -1
  98. package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.js +0 -10
  99. package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.d.ts +0 -1
  100. package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +0 -18
  101. package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.d.ts +0 -5
  102. package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +0 -49
  103. package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +0 -1
  104. package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +0 -62
  105. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +0 -1
  106. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +0 -48
  107. package/dist/modal/components/Body/AnimatedHeightWrapper.d.ts +0 -6
  108. package/dist/modal/components/Body/AnimatedHeightWrapper.js +0 -29
  109. package/dist/modal/components/Body/Body.d.ts +0 -11
  110. package/dist/modal/components/Body/Body.js +0 -350
  111. package/dist/modal/components/ChainSwitch/ChainSwitch.d.ts +0 -1
  112. package/dist/modal/components/ChainSwitch/ChainSwitch.js +0 -95
  113. package/dist/modal/components/ChainSwitch/config.d.ts +0 -7
  114. package/dist/modal/components/ChainSwitch/config.js +0 -17
  115. package/dist/modal/components/Controls/Controls.d.ts +0 -5
  116. package/dist/modal/components/Controls/Controls.js +0 -78
  117. package/dist/modal/components/Controls/Selects.d.ts +0 -2
  118. package/dist/modal/components/Controls/Selects.js +0 -173
  119. package/dist/modal/components/ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.d.ts +0 -1
  120. package/dist/modal/components/ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.js +0 -75
  121. package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.d.ts +0 -8
  122. package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +0 -175
  123. package/dist/modal/components/ExternalWalletStep/config.d.ts +0 -7
  124. package/dist/modal/components/ExternalWalletStep/config.js +0 -17
  125. package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.d.ts +0 -1
  126. package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.js +0 -39
  127. package/dist/modal/components/ExternalWallets/ExternalWallets.d.ts +0 -1
  128. package/dist/modal/components/ExternalWallets/ExternalWallets.js +0 -184
  129. package/dist/modal/components/Footer/Footer.d.ts +0 -1
  130. package/dist/modal/components/Footer/Footer.js +0 -95
  131. package/dist/modal/components/Header/Header.d.ts +0 -1
  132. package/dist/modal/components/Header/Header.js +0 -43
  133. package/dist/modal/components/Header/hooks/useStepTitle.d.ts +0 -3
  134. package/dist/modal/components/Header/hooks/useStepTitle.js +0 -61
  135. package/dist/modal/components/Hero/Hero.d.ts +0 -1
  136. package/dist/modal/components/Hero/Hero.js +0 -116
  137. package/dist/modal/components/IFrameStep/IFrameStep.d.ts +0 -1
  138. package/dist/modal/components/IFrameStep/IFrameStep.js +0 -59
  139. package/dist/modal/components/LoginDoneStep/LoginDoneStep.d.ts +0 -5
  140. package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +0 -44
  141. package/dist/modal/components/ModalContent/ModalContent.d.ts +0 -10
  142. package/dist/modal/components/ModalContent/ModalContent.js +0 -88
  143. package/dist/modal/components/OAuth/FarcasterOAuthStep.d.ts +0 -3
  144. package/dist/modal/components/OAuth/FarcasterOAuthStep.js +0 -31
  145. package/dist/modal/components/OAuth/OAuth.d.ts +0 -6
  146. package/dist/modal/components/OAuth/OAuth.js +0 -79
  147. package/dist/modal/components/OAuth/TelegramOAuthStep.d.ts +0 -8
  148. package/dist/modal/components/OAuth/TelegramOAuthStep.js +0 -74
  149. package/dist/modal/components/OnRampComponents/AddingFunds.d.ts +0 -1
  150. package/dist/modal/components/OnRampComponents/AddingFunds.js +0 -23
  151. package/dist/modal/components/OnRampComponents/OnRampProviderButton.d.ts +0 -9
  152. package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +0 -77
  153. package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.d.ts +0 -6
  154. package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +0 -107
  155. package/dist/modal/components/Setup2FAStep/Setup2FAStep.d.ts +0 -5
  156. package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +0 -132
  157. package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.d.ts +0 -5
  158. package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +0 -27
  159. package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.d.ts +0 -12
  160. package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +0 -160
  161. package/dist/modal/components/Waiting/Waiting.d.ts +0 -6
  162. package/dist/modal/components/Waiting/Waiting.js +0 -17
  163. package/dist/modal/components/WalletCard/PartnerIcon.d.ts +0 -6
  164. package/dist/modal/components/WalletCard/PartnerIcon.js +0 -34
  165. package/dist/modal/components/WalletCard/WalletCard.d.ts +0 -18
  166. package/dist/modal/components/WalletCard/WalletCard.js +0 -128
  167. package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.d.ts +0 -6
  168. package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +0 -83
  169. package/dist/modal/components/common.d.ts +0 -59
  170. package/dist/modal/components/common.js +0 -261
  171. package/dist/modal/components/index.d.ts +0 -1
  172. package/dist/modal/components/index.js +0 -2
  173. package/dist/modal/constants/constants.d.ts +0 -40
  174. package/dist/modal/constants/constants.js +0 -142
  175. package/dist/modal/constants/defaults.d.ts +0 -5
  176. package/dist/modal/constants/defaults.js +0 -10
  177. package/dist/modal/constants/oAuthLogos.d.ts +0 -17
  178. package/dist/modal/constants/oAuthLogos.js +0 -158
  179. package/dist/modal/constants/walletTypeConfig.d.ts +0 -6
  180. package/dist/modal/constants/walletTypeConfig.js +0 -13
  181. package/dist/modal/hooks/useGoBack.d.ts +0 -1
  182. package/dist/modal/hooks/useGoBack.js +0 -43
  183. package/dist/modal/hooks/useTelegramLogin.d.ts +0 -12
  184. package/dist/modal/hooks/useTelegramLogin.js +0 -65
  185. package/dist/modal/index.d.ts +0 -8
  186. package/dist/modal/index.js +0 -29
  187. package/dist/modal/stores/index.d.ts +0 -1
  188. package/dist/modal/stores/index.js +0 -2
  189. package/dist/modal/stores/modal/actions.d.ts +0 -3
  190. package/dist/modal/stores/modal/actions.js +0 -135
  191. package/dist/modal/stores/modal/useModalStore.d.ts +0 -103
  192. package/dist/modal/stores/modal/useModalStore.js +0 -73
  193. package/dist/modal/types/commonTypes.d.ts +0 -6
  194. package/dist/modal/types/commonTypes.js +0 -1
  195. package/dist/modal/types/modalProps.d.ts +0 -129
  196. package/dist/modal/types/modalProps.js +0 -12
  197. package/dist/modal/utils/authInputHelpers.d.ts +0 -5
  198. package/dist/modal/utils/authInputHelpers.js +0 -41
  199. package/dist/modal/utils/authLayoutHelpers.d.ts +0 -3
  200. package/dist/modal/utils/authLayoutHelpers.js +0 -8
  201. package/dist/modal/utils/countryCodes.d.ts +0 -8
  202. package/dist/modal/utils/countryCodes.js +0 -45
  203. package/dist/modal/utils/getMailtoLink.d.ts +0 -1
  204. package/dist/modal/utils/getMailtoLink.js +0 -10
  205. package/dist/modal/utils/getTileButtonFlex.d.ts +0 -1
  206. package/dist/modal/utils/getTileButtonFlex.js +0 -20
  207. package/dist/modal/utils/getWalletDisplayName.d.ts +0 -5
  208. package/dist/modal/utils/getWalletDisplayName.js +0 -22
  209. package/dist/modal/utils/isPasskeySupported.d.ts +0 -1
  210. package/dist/modal/utils/isPasskeySupported.js +0 -15
  211. package/dist/modal/utils/openPopup.d.ts +0 -6
  212. package/dist/modal/utils/openPopup.js +0 -60
  213. package/dist/modal/utils/routeMobileExternalWallet.d.ts +0 -1
  214. package/dist/modal/utils/routeMobileExternalWallet.js +0 -31
  215. package/dist/modal/utils/steps.d.ts +0 -133
  216. package/dist/modal/utils/steps.js +0 -273
  217. package/dist/modal/utils/stringFormatters.d.ts +0 -5
  218. package/dist/modal/utils/stringFormatters.js +0 -19
  219. package/dist/modal/utils/validateOnRampConfig.d.ts +0 -5
  220. package/dist/modal/utils/validateOnRampConfig.js +0 -32
  221. package/dist/provider/actions/getEmbeddedAccount.d.ts +0 -26
  222. package/dist/provider/actions/getEmbeddedAccount.js +0 -52
  223. package/dist/provider/actions/getWallet.d.ts +0 -5
  224. package/dist/provider/actions/getWallet.js +0 -18
  225. package/dist/provider/actions/index.d.ts +0 -47
  226. package/dist/provider/actions/index.js +0 -79
  227. package/dist/provider/actions/utils.d.ts +0 -4
  228. package/dist/provider/actions/utils.js +0 -34
  229. package/dist/provider/components/CosmosWalletWrapper.d.ts +0 -11
  230. package/dist/provider/components/CosmosWalletWrapper.js +0 -43
  231. package/dist/provider/components/EvmWalletWrapper.d.ts +0 -12
  232. package/dist/provider/components/EvmWalletWrapper.js +0 -43
  233. package/dist/provider/components/ExternalWalletWrapper.d.ts +0 -8
  234. package/dist/provider/components/ExternalWalletWrapper.js +0 -140
  235. package/dist/provider/components/SolanaWalletWrapper.d.ts +0 -9
  236. package/dist/provider/components/SolanaWalletWrapper.js +0 -44
  237. package/dist/provider/external/getParaCosmosConnector.d.ts +0 -7
  238. package/dist/provider/external/getParaCosmosConnector.js +0 -19
  239. package/dist/provider/external/getParaCosmosLib.d.ts +0 -4
  240. package/dist/provider/external/getParaCosmosLib.js +0 -16
  241. package/dist/provider/external/getParaEvmConnector.d.ts +0 -7
  242. package/dist/provider/external/getParaEvmConnector.js +0 -19
  243. package/dist/provider/external/getParaEvmLib.d.ts +0 -4
  244. package/dist/provider/external/getParaEvmLib.js +0 -16
  245. package/dist/provider/external/getParaSolanaConnector.d.ts +0 -7
  246. package/dist/provider/external/getParaSolanaConnector.js +0 -19
  247. package/dist/provider/external/getParaSolanaLib.d.ts +0 -4
  248. package/dist/provider/external/getParaSolanaLib.js +0 -16
  249. package/dist/provider/external/stubs/CosmosExternalWalletContextStub.d.ts +0 -2
  250. package/dist/provider/external/stubs/CosmosExternalWalletContextStub.js +0 -8
  251. package/dist/provider/external/stubs/EvmExternalWalletContextStub.d.ts +0 -2
  252. package/dist/provider/external/stubs/EvmExternalWalletContextStub.js +0 -8
  253. package/dist/provider/external/stubs/SolanaExternalWalletContextStub.d.ts +0 -2
  254. package/dist/provider/external/stubs/SolanaExternalWalletContextStub.js +0 -8
  255. package/dist/provider/hooks/index.d.ts +0 -3
  256. package/dist/provider/hooks/index.js +0 -4
  257. package/dist/provider/hooks/mutations/core.d.ts +0 -27
  258. package/dist/provider/hooks/mutations/core.js +0 -66
  259. package/dist/provider/hooks/mutations/index.d.ts +0 -3
  260. package/dist/provider/hooks/mutations/index.js +0 -9
  261. package/dist/provider/hooks/mutations/useLinkAccount.d.ts +0 -9
  262. package/dist/provider/hooks/mutations/useLinkAccount.js +0 -18
  263. package/dist/provider/hooks/mutations/utils.d.ts +0 -12
  264. package/dist/provider/hooks/mutations/utils.js +0 -90
  265. package/dist/provider/hooks/queries/core.d.ts +0 -4
  266. package/dist/provider/hooks/queries/core.js +0 -16
  267. package/dist/provider/hooks/queries/index.d.ts +0 -4
  268. package/dist/provider/hooks/queries/index.js +0 -11
  269. package/dist/provider/hooks/queries/useAccount.d.ts +0 -90
  270. package/dist/provider/hooks/queries/useAccount.js +0 -135
  271. package/dist/provider/hooks/queries/useIsFullyLoggedIn.d.ts +0 -5
  272. package/dist/provider/hooks/queries/useIsFullyLoggedIn.js +0 -24
  273. package/dist/provider/hooks/queries/useWallet.d.ts +0 -5
  274. package/dist/provider/hooks/queries/useWallet.js +0 -26
  275. package/dist/provider/hooks/queries/useWalletBalance.d.ts +0 -6
  276. package/dist/provider/hooks/queries/useWalletBalance.js +0 -55
  277. package/dist/provider/hooks/queries/utils.d.ts +0 -7
  278. package/dist/provider/hooks/queries/utils.js +0 -25
  279. package/dist/provider/hooks/utils/index.d.ts +0 -3
  280. package/dist/provider/hooks/utils/index.js +0 -10
  281. package/dist/provider/hooks/utils/useAutoSessionKeepAlive.d.ts +0 -3
  282. package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +0 -74
  283. package/dist/provider/hooks/utils/useClient.d.ts +0 -5
  284. package/dist/provider/hooks/utils/useClient.js +0 -10
  285. package/dist/provider/hooks/utils/useEventListeners.d.ts +0 -2
  286. package/dist/provider/hooks/utils/useEventListeners.js +0 -157
  287. package/dist/provider/hooks/utils/useFormattedBiometricHints.d.ts +0 -4
  288. package/dist/provider/hooks/utils/useFormattedBiometricHints.js +0 -27
  289. package/dist/provider/hooks/utils/useInternalClient.d.ts +0 -5
  290. package/dist/provider/hooks/utils/useInternalClient.js +0 -10
  291. package/dist/provider/hooks/utils/useModal.d.ts +0 -11
  292. package/dist/provider/hooks/utils/useModal.js +0 -27
  293. package/dist/provider/hooks/utils/useWalletState.d.ts +0 -15
  294. package/dist/provider/hooks/utils/useWalletState.js +0 -48
  295. package/dist/provider/index.d.ts +0 -6
  296. package/dist/provider/index.js +0 -11
  297. package/dist/provider/providers/AccountLinkProvider.d.ts +0 -47
  298. package/dist/provider/providers/AccountLinkProvider.js +0 -452
  299. package/dist/provider/providers/AuthProvider.d.ts +0 -37
  300. package/dist/provider/providers/AuthProvider.js +0 -523
  301. package/dist/provider/providers/CosmosExternalWalletProvider.d.ts +0 -7
  302. package/dist/provider/providers/CosmosExternalWalletProvider.js +0 -66
  303. package/dist/provider/providers/EvmExternalWalletProvider.d.ts +0 -7
  304. package/dist/provider/providers/EvmExternalWalletProvider.js +0 -74
  305. package/dist/provider/providers/ExternalWalletProvider.d.ts +0 -59
  306. package/dist/provider/providers/ExternalWalletProvider.js +0 -596
  307. package/dist/provider/providers/SolanaExternalWalletProvider.d.ts +0 -7
  308. package/dist/provider/providers/SolanaExternalWalletProvider.js +0 -66
  309. package/dist/provider/stores/getters.d.ts +0 -4
  310. package/dist/provider/stores/getters.js +0 -13
  311. package/dist/provider/stores/setters.d.ts +0 -1
  312. package/dist/provider/stores/setters.js +0 -7
  313. package/dist/provider/stores/slices/analytics.d.ts +0 -3
  314. package/dist/provider/stores/slices/analytics.js +0 -9
  315. package/dist/provider/stores/slices/client.d.ts +0 -3
  316. package/dist/provider/stores/slices/client.js +0 -9
  317. package/dist/provider/stores/slices/config.d.ts +0 -3
  318. package/dist/provider/stores/slices/config.js +0 -9
  319. package/dist/provider/stores/slices/externalWallets.d.ts +0 -3
  320. package/dist/provider/stores/slices/externalWallets.js +0 -46
  321. package/dist/provider/stores/slices/index.d.ts +0 -5
  322. package/dist/provider/stores/slices/index.js +0 -6
  323. package/dist/provider/stores/slices/modal.d.ts +0 -3
  324. package/dist/provider/stores/slices/modal.js +0 -18
  325. package/dist/provider/stores/slices/wallet.d.ts +0 -3
  326. package/dist/provider/stores/slices/wallet.js +0 -13
  327. package/dist/provider/stores/types.d.ts +0 -76
  328. package/dist/provider/stores/types.js +0 -1
  329. package/dist/provider/stores/useStore.d.ts +0 -17
  330. package/dist/provider/stores/useStore.js +0 -34
  331. package/dist/provider/types/externalWalletProviders.d.ts +0 -12
  332. package/dist/provider/types/externalWalletProviders.js +0 -1
  333. package/dist/provider/types/provider.d.ts +0 -161
  334. package/dist/provider/types/provider.js +0 -1
  335. package/dist/provider/types/query.d.ts +0 -3
  336. package/dist/provider/types/query.js +0 -1
  337. package/dist/provider/types/utils.d.ts +0 -45
  338. package/dist/provider/types/utils.js +0 -1
  339. package/dist/provider/utils/constants.d.ts +0 -5
  340. package/dist/provider/utils/constants.js +0 -10
  341. package/dist/provider/utils/paraConfigTypeGuards.d.ts +0 -7
  342. package/dist/provider/utils/paraConfigTypeGuards.js +0 -13
  343. package/dist/provider/utils/renameMutations.d.ts +0 -5
  344. package/dist/provider/utils/renameMutations.js +0 -18
@@ -1,88 +0,0 @@
1
- "use client";
2
- import {
3
- __spreadProps,
4
- __spreadValues
5
- } from "../../../chunk-MMUBH76A.js";
6
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
- import { forwardRef, useEffect, useImperativeHandle } from "react";
8
- import { EnabledFlow } from "@getpara/web-sdk";
9
- import { useModalStore } from "../../stores/index.js";
10
- import { ModalStep } from "../../utils/steps.js";
11
- import { Body } from "../Body/Body.js";
12
- import { Footer } from "../Footer/Footer.js";
13
- import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
14
- import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
15
- const ModalContent = forwardRef(
16
- ({
17
- twoFactorAuthEnabled = false,
18
- oAuthMethods,
19
- disableEmailLogin,
20
- disablePhoneLogin,
21
- isGuestModeEnabled = false,
22
- onClose,
23
- onRampTestMode
24
- }, ref) => {
25
- const para = useInternalClient();
26
- const refs = useModalStore((state) => state.refs);
27
- const onRampConfig = useModalStore((state) => state.onRampConfig);
28
- const setOnRampConfig = useModalStore((state) => state.setOnRampConfig);
29
- const accountAddFundTab = useModalStore((state) => state.accountAddFundTab);
30
- const setAccountAddFundTab = useModalStore((state) => state.setAccountAddFundTab);
31
- const { disconnectExternalWallet } = useExternalWallets();
32
- useImperativeHandle(ref, () => {
33
- return {
34
- handleModalClose() {
35
- handleClose();
36
- }
37
- };
38
- }, []);
39
- const handleClose = () => {
40
- onClose == null ? void 0 : onClose();
41
- if (refs.currentStep.current === ModalStep.EXTERNAL_WALLET_VERIFICATION && para.isExternalWalletAuth) {
42
- disconnectExternalWallet();
43
- }
44
- };
45
- useEffect(() => {
46
- if (!onRampConfig) {
47
- para.ctx.client.getOnRampConfig().then((res) => {
48
- let newOnRampConfig;
49
- newOnRampConfig = __spreadProps(__spreadValues({}, res), { testMode: onRampTestMode });
50
- setOnRampConfig(newOnRampConfig);
51
- if (!accountAddFundTab) {
52
- setAccountAddFundTab(
53
- newOnRampConfig.isBuyEnabled ? EnabledFlow.BUY : newOnRampConfig.isReceiveEnabled ? EnabledFlow.RECEIVE : newOnRampConfig.isWithdrawEnabled ? EnabledFlow.WITHDRAW : void 0
54
- );
55
- }
56
- }).catch();
57
- }
58
- }, []);
59
- useEffect(() => {
60
- if (!!onRampConfig) {
61
- setOnRampConfig(__spreadProps(__spreadValues({}, onRampConfig), { testMode: onRampTestMode }));
62
- }
63
- }, [onRampTestMode]);
64
- useEffect(() => {
65
- return () => {
66
- var _a;
67
- window.clearTimeout((_a = refs.poll.current) == null ? void 0 : _a.timeout);
68
- };
69
- }, []);
70
- return /* @__PURE__ */ jsxs(Fragment, { children: [
71
- /* @__PURE__ */ jsx(
72
- Body,
73
- {
74
- oAuthMethods,
75
- twoFactorAuthEnabled,
76
- disableEmailLogin: !!disableEmailLogin,
77
- disablePhoneLogin: !!disablePhoneLogin,
78
- isGuestModeEnabled,
79
- onClose: handleClose
80
- }
81
- ),
82
- /* @__PURE__ */ jsx(Footer, {})
83
- ] });
84
- }
85
- );
86
- export {
87
- ModalContent
88
- };
@@ -1,3 +0,0 @@
1
- export declare function FarcasterConnectQR(): import("react/jsx-runtime").JSX.Element;
2
- declare const FarcasterOAuthStep: () => import("react/jsx-runtime").JSX.Element;
3
- export default FarcasterOAuthStep;
@@ -1,31 +0,0 @@
1
- "use client";
2
- import "../../../chunk-MMUBH76A.js";
3
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
- import { CpslButton, CpslIcon, CpslQrCode, CpslSpinner, CpslText } from "@getpara/react-components";
5
- import { CenteredText, Heading, InnerStepContainer, QRContainer, StepContainer } from "../common.js";
6
- import { useModalStore } from "../../stores/index.js";
7
- import { isMobile } from "@getpara/web-sdk";
8
- function FarcasterConnectQR() {
9
- const farcasterConnectUri = useModalStore((state) => state.farcasterConnectUri);
10
- return /* @__PURE__ */ jsx(Fragment, { children: isMobile() ? /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
11
- /* @__PURE__ */ jsx(CpslText, { weight: "medium", color: "secondary", children: `Don\u2019t have Farcaster` }),
12
- /* @__PURE__ */ jsxs(CpslButton, { as: "a", href: "https://link.warpcast.com/download-qr", target: "_blank", variant: "secondary", children: [
13
- /* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "linkExternal" }),
14
- `Get Farcaster`
15
- ] })
16
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
17
- /* @__PURE__ */ jsx(Heading, { variant: "headingS", weight: "bold", children: "Sign in using Farcaster" }),
18
- /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
19
- /* @__PURE__ */ jsx(CenteredText, { variant: "bodyS", color: "secondary", weight: "medium", children: "Scan the QR code with your phone's camera to proceed." }),
20
- /* @__PURE__ */ jsx(QRContainer, { children: !farcasterConnectUri ? /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) : /* @__PURE__ */ jsx(CpslQrCode, { url: farcasterConnectUri }) })
21
- ] })
22
- ] }) });
23
- }
24
- const FarcasterOAuthStep = () => {
25
- return /* @__PURE__ */ jsx(StepContainer, { $wide: true, children: /* @__PURE__ */ jsx(FarcasterConnectQR, {}) });
26
- };
27
- var FarcasterOAuthStep_default = FarcasterOAuthStep;
28
- export {
29
- FarcasterConnectQR,
30
- FarcasterOAuthStep_default as default
31
- };
@@ -1,6 +0,0 @@
1
- import { TOAuthMethod } from '@getpara/web-sdk';
2
- interface OAuthProps {
3
- methods: TOAuthMethod[];
4
- }
5
- export declare const OAuth: ({ methods }: OAuthProps) => import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,79 +0,0 @@
1
- "use client";
2
- import {
3
- __async
4
- } from "../../../chunk-MMUBH76A.js";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
- import { safeStyled } from "@getpara/react-common";
7
- import { useModalStore } from "../../stores/index.js";
8
- import { ModalStep } from "../../utils/steps.js";
9
- import { getTileButtonFlex } from "../../utils/getTileButtonFlex.js";
10
- import { StyledCpslTileButton } from "../common.js";
11
- import { ACCOUNT_TYPES } from "../../constants/oAuthLogos.js";
12
- import { useStore } from "../../../provider/stores/useStore.js";
13
- import { useAuthActions } from "../../../provider/providers/AuthProvider.js";
14
- const HAS_MORE_LENGTH = 3;
15
- const OAuth = ({ methods }) => {
16
- const oAuthLogoVariant = useStore((state) => state.oAuthLogoVariant);
17
- const isDark = useStore((state) => state.isDarkTheme);
18
- const setStep = useModalStore((state) => state.setStep);
19
- const showAll = useModalStore((state) => state.step === ModalStep.AUTH_MORE || state.step === ModalStep.AUTH_GUEST_SIGNUP);
20
- const { verifyFarcaster, verifyOAuth } = useAuthActions();
21
- const hasMore = methods.length > HAS_MORE_LENGTH;
22
- const methodsToShow = showAll || !hasMore ? methods : methods.slice(0, HAS_MORE_LENGTH - 1);
23
- const handleShowAll = () => {
24
- setStep(ModalStep.AUTH_MORE);
25
- };
26
- const handleMethodClick = (method) => () => __async(void 0, null, function* () {
27
- switch (method) {
28
- case "FARCASTER":
29
- verifyFarcaster();
30
- break;
31
- case "TELEGRAM":
32
- setStep(ModalStep.TELEGRAM_OAUTH);
33
- break;
34
- default:
35
- verifyOAuth(method);
36
- break;
37
- }
38
- });
39
- const useBrandedLogos = oAuthLogoVariant === "default";
40
- const useDarkLogos = useBrandedLogos ? isDark : oAuthLogoVariant !== "dark";
41
- const showMoreButton = !showAll && hasMore;
42
- return /* @__PURE__ */ jsxs(OAuthContainer, { children: [
43
- methodsToShow.map((method, index) => /* @__PURE__ */ jsx(
44
- OAuthButton,
45
- {
46
- $isDark: useDarkLogos,
47
- icon: ACCOUNT_TYPES[method][useBrandedLogos ? "logoBranded" : "logo"],
48
- onClick: handleMethodClick(method),
49
- $index: index,
50
- $totalItems: showMoreButton ? HAS_MORE_LENGTH : methodsToShow.length
51
- },
52
- method
53
- )),
54
- showMoreButton && /* @__PURE__ */ jsx(
55
- OAuthButton,
56
- {
57
- $isDark: useDarkLogos,
58
- icon: "moreLoginOptions",
59
- onClick: handleShowAll,
60
- $index: HAS_MORE_LENGTH - 1,
61
- $totalItems: HAS_MORE_LENGTH
62
- }
63
- )
64
- ] });
65
- };
66
- const OAuthContainer = safeStyled.div`
67
- display: flex;
68
- justify-content: center;
69
- gap: 8px;
70
- flex-wrap: wrap;
71
- `;
72
- const OAuthButton = safeStyled(StyledCpslTileButton)`
73
- flex: ${({ $index, $totalItems }) => getTileButtonFlex($index, $totalItems)};
74
-
75
- --button-icon-color: ${({ $isDark }) => $isDark ? "white" : "black"};
76
- `;
77
- export {
78
- OAuth
79
- };
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- export declare function TelegramOAuthStep(): import("react/jsx-runtime").JSX.Element;
3
- export declare function TelegramIFrame({ url, isLoaded, setIsLoaded, isVisible, }: {
4
- url?: string;
5
- isLoaded: boolean;
6
- setIsLoaded: React.Dispatch<React.SetStateAction<boolean>>;
7
- isVisible?: boolean;
8
- }): import("react/jsx-runtime").JSX.Element | null;
@@ -1,74 +0,0 @@
1
- "use client";
2
- import "../../../chunk-MMUBH76A.js";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
- import { safeStyled } from "@getpara/react-common";
5
- import { HeroSpinner } from "@getpara/react-common";
6
- import { CpslSpinner } from "@getpara/react-components";
7
- import { useTelegramLogin } from "../../hooks/useTelegramLogin.js";
8
- import { useAuthActions } from "../../../provider/providers/AuthProvider.js";
9
- import { AccountTypeIcon } from "../common.js";
10
- import { useModalStore } from "../../stores/index.js";
11
- function TelegramOAuthStep() {
12
- const { verifyTelegramStatus, verifyTelegram } = useAuthActions();
13
- const { url, status, isLoaded, setIsLoaded } = useTelegramLogin({
14
- isActive: true,
15
- status: verifyTelegramStatus,
16
- onSubmit: verifyTelegram
17
- });
18
- const isError = status === "error", isPending = status === "pending";
19
- return /* @__PURE__ */ jsxs(Container, { children: [
20
- /* @__PURE__ */ jsx(HeroContainer, { children: /* @__PURE__ */ jsx(
21
- HeroSpinner,
22
- {
23
- icon: /* @__PURE__ */ jsx(AccountTypeIcon, { accountType: "TELEGRAM", size: "48px" }),
24
- status: isPending ? "pending" : isError ? "error" : "idle",
25
- text: isPending ? "Follow the on-screen prompts." : isError ? "Login Failed" : void 0
26
- }
27
- ) }),
28
- /* @__PURE__ */ jsx(TelegramIFrame, { url, isLoaded, setIsLoaded, isVisible: isLoaded })
29
- ] });
30
- }
31
- function TelegramIFrame({
32
- url,
33
- isLoaded,
34
- setIsLoaded,
35
- isVisible = false
36
- }) {
37
- const refs = useModalStore((state) => state.refs);
38
- if (!url) return null;
39
- return /* @__PURE__ */ jsxs(Container, { children: [
40
- url && /* @__PURE__ */ jsx(
41
- IFrame,
42
- {
43
- ref: refs.telegramIFrame,
44
- style: { display: isLoaded && isVisible ? "block" : "none" },
45
- src: url,
46
- onLoad: () => setIsLoaded(true)
47
- }
48
- ),
49
- (!url || !isLoaded) && /* @__PURE__ */ jsx(CpslSpinner, {})
50
- ] });
51
- }
52
- const Container = safeStyled.div`
53
- display: flex;
54
- flex-direction: column;
55
- align-items: center;
56
- justify-content: center;
57
- width: 100%;
58
- `;
59
- const HeroContainer = safeStyled.div`
60
- display: flex;
61
- flex-direction: column;
62
- align-items: center;
63
- gap: 16px;
64
- flex: 1;
65
- `;
66
- const IFrame = safeStyled.iframe`
67
- width: 100%;
68
- height: 52px;
69
- border: none;
70
- `;
71
- export {
72
- TelegramIFrame,
73
- TelegramOAuthStep
74
- };
@@ -1 +0,0 @@
1
- export declare const AddingFunds: () => import("react/jsx-runtime").JSX.Element;
@@ -1,23 +0,0 @@
1
- "use client";
2
- import "../../../chunk-MMUBH76A.js";
3
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
- import { OnRampPurchaseStatus } from "@getpara/web-sdk";
5
- import { SpinnerContainer } from "../common.js";
6
- import { ON_RAMP_PROVIDERS } from "../../constants/constants.js";
7
- import { useModalStore } from "../../stores/index.js";
8
- import { CpslSpinner, CpslText } from "@getpara/react-components";
9
- const AddingFunds = () => {
10
- const onRampPurchase = useModalStore((state) => state.onRampPurchase);
11
- return /* @__PURE__ */ jsxs(Fragment, { children: [
12
- /* @__PURE__ */ jsx(SpinnerContainer, { children: /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) }),
13
- /* @__PURE__ */ jsxs(CpslText, { children: [
14
- "Follow the prompts presented by",
15
- " ",
16
- OnRampPurchaseStatus && (onRampPurchase == null ? void 0 : onRampPurchase.provider) ? ON_RAMP_PROVIDERS[onRampPurchase.provider].name : "the provider",
17
- "."
18
- ] })
19
- ] });
20
- };
21
- export {
22
- AddingFunds
23
- };
@@ -1,9 +0,0 @@
1
- import { OnRampConfig } from '@getpara/web-sdk';
2
- interface OnRampButtonProps {
3
- config: OnRampConfig;
4
- index: number;
5
- isLoading?: boolean;
6
- onClick: () => Promise<void>;
7
- }
8
- export declare const OnRampProviderButton: ({ config, index, onClick: _onClick }: OnRampButtonProps) => import("react/jsx-runtime").JSX.Element;
9
- export {};
@@ -1,77 +0,0 @@
1
- "use client";
2
- import {
3
- __async
4
- } from "../../../chunk-MMUBH76A.js";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
- import { useState } from "react";
7
- import { ON_RAMP_PROVIDERS } from "../../constants/constants.js";
8
- import { safeStyled } from "@getpara/react-common";
9
- import { CpslButton, CpslIcon, CpslSpinner, CpslText } from "@getpara/react-components";
10
- import { motion } from "framer-motion";
11
- const OnRampProviderButton = ({ config, index, onClick: _onClick }) => {
12
- const [isLoading, setIsLoading] = useState(false);
13
- const provider = config.providers[index];
14
- const { feeLower, feeUpper, name, icon, backgroundColors } = ON_RAMP_PROVIDERS[provider];
15
- const feeString = `Fee ${feeLower}% - ${feeUpper}%`;
16
- const onClick = () => __async(void 0, null, function* () {
17
- setIsLoading(true);
18
- yield _onClick();
19
- setIsLoading(false);
20
- });
21
- return /* @__PURE__ */ jsx(StyledButton, { $gradientColors: backgroundColors, fullWidth: true, onClick, children: /* @__PURE__ */ jsxs(Container, { $backgroundColor: backgroundColors[1], children: [
22
- /* @__PURE__ */ jsx(IconContainer, { children: /* @__PURE__ */ jsx(CpslIcon, { icon }) }),
23
- /* @__PURE__ */ jsxs(ProviderInfoContainer, { children: [
24
- /* @__PURE__ */ jsx(Text, { variant: "bodyL", weight: "medium", children: name }),
25
- /* @__PURE__ */ jsx(ProviderInfoInnerContainer, { children: /* @__PURE__ */ jsx(Text, { variant: "bodyXS", weight: "medium", children: feeString }) })
26
- ] }),
27
- isLoading ? /* @__PURE__ */ jsx(CpslSpinner, { size: 16 }) : /* @__PURE__ */ jsx(Chevron, { icon: "chevronUp" })
28
- ] }) });
29
- };
30
- const StyledButton = safeStyled(CpslButton)`
31
- width: 100%;
32
- --button-primary-background-color: ${({ $gradientColors }) => `linear-gradient(90deg, ${$gradientColors[0]} 0%, ${$gradientColors[1]} 100%)`};
33
- --button-primary-hover-background-color: ${({ $gradientColors }) => `linear-gradient(90deg, ${$gradientColors[0]} 0%, ${$gradientColors[0]} 100%)`};
34
- --button-primary-active-background-color: ${({ $gradientColors }) => `linear-gradient(90deg, ${$gradientColors[0]} 0%, ${$gradientColors[0]} 100%)`};
35
- `;
36
- const Container = safeStyled(motion.div)`
37
- display: flex;
38
- gap: 8px;
39
- flex: 1;
40
- align-items: center;
41
-
42
- & cpsl-spinner {
43
- --background-color: ${({ $backgroundColor }) => `${$backgroundColor}`};
44
- }
45
- `;
46
- const ProviderInfoContainer = safeStyled.div`
47
- flex: 1;
48
- display: flex;
49
- flex-direction: column;
50
- align-items: start;
51
- gap: 2px;
52
- `;
53
- const ProviderInfoInnerContainer = safeStyled.div`
54
- display: flex;
55
- gap: 16px;
56
- `;
57
- const IconContainer = safeStyled.span`
58
- display: flex;
59
- align-items: center;
60
- justify-content: center;
61
- background-color: #fff;
62
- border-radius: 100%;
63
- height: 48px;
64
- width: 48px;
65
- `;
66
- const Text = safeStyled(CpslText)`
67
- &::part(text-element) {
68
- color: #fff;
69
- }
70
- `;
71
- const Chevron = safeStyled(CpslIcon)`
72
- transform: rotate(90deg);
73
- --icon-color: #fff;
74
- `;
75
- export {
76
- OnRampProviderButton
77
- };
@@ -1,6 +0,0 @@
1
- export declare const SaveRecoverySecret: ({ email, value, onComplete, }: {
2
- email?: string;
3
- value: string;
4
- onComplete: () => void;
5
- }) => import("react/jsx-runtime").JSX.Element;
6
- export declare const RecoverySecretStep: () => import("react/jsx-runtime").JSX.Element;
@@ -1,107 +0,0 @@
1
- "use client";
2
- import {
3
- __async
4
- } from "../../../chunk-MMUBH76A.js";
5
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
- import { CpslButton, CpslText } from "@getpara/react-components";
7
- import { useModalStore } from "../../stores/index.js";
8
- import { ModalStep } from "../../utils/steps.js";
9
- import { Heading, InnerStepContainer, StepContainer, StyledCpslTileButton } from "../common.js";
10
- import { safeStyled } from "@getpara/react-common";
11
- import { useCopyToClipboard } from "@getpara/react-common";
12
- import { getMailtoLink } from "../../utils/getMailtoLink.js";
13
- import { useState } from "react";
14
- import { useStore } from "../../../provider/stores/useStore.js";
15
- import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
16
- const SaveRecoverySecret = ({
17
- email,
18
- value,
19
- onComplete
20
- }) => {
21
- const [isSecretSaved, setIsSecretSaved] = useState(false);
22
- const [isCopied, copy] = useCopyToClipboard();
23
- const onCopy = () => {
24
- copy(value);
25
- setIsSecretSaved(true);
26
- };
27
- const onDownload = () => {
28
- const element = document.createElement("a");
29
- const file = new Blob([value], { type: "text/plain" });
30
- element.href = URL.createObjectURL(file);
31
- element.download = "recovery.txt";
32
- document.body.appendChild(element);
33
- element.click();
34
- setIsSecretSaved(true);
35
- };
36
- const onEmail = () => {
37
- typeof window !== "undefined" && window.open(getMailtoLink(email, value), "_self");
38
- setIsSecretSaved(true);
39
- };
40
- return /* @__PURE__ */ jsxs(Fragment, { children: [
41
- /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
42
- /* @__PURE__ */ jsx(Heading, { variant: "headingXS", weight: "semiBold", children: "Save your Recovery Secret" }),
43
- /* @__PURE__ */ jsxs(ButtonContainer, { children: [
44
- /* @__PURE__ */ jsx(ActionButton, { icon: "download", onClick: onDownload, children: /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "secondary", weight: "medium", children: "Download" }) }),
45
- /* @__PURE__ */ jsx(ActionButton, { icon: isCopied ? "check" : "copy", onClick: onCopy, children: /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "secondary", weight: "medium", children: isCopied ? "Copied!" : "Copy" }) }),
46
- /* @__PURE__ */ jsx(ActionButton, { icon: "send", onClick: onEmail, children: /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "secondary", weight: "medium", children: "Email" }) })
47
- ] })
48
- ] }),
49
- /* @__PURE__ */ jsx(InnerStepContainer, { children: /* @__PURE__ */ jsx(CpslButton, { fullWidth: true, onClick: onComplete, disabled: !isSecretSaved, children: !isSecretSaved ? "Choose an option above to continue" : "I\u2019ve saved my recovery secret" }) })
50
- ] });
51
- };
52
- const RecoverySecretStep = () => {
53
- const para = useInternalClient();
54
- const hideWallets = useStore((state) => {
55
- var _a;
56
- return (_a = state.modalConfig) == null ? void 0 : _a.hideWallets;
57
- });
58
- const setStep = useModalStore((state) => state.setStep);
59
- const authInfo = para.authInfo;
60
- const recoveryShare = useModalStore((state) => state.recoveryShare);
61
- const backupDecryptionKey = JSON.parse(recoveryShare || "{}").backupDecryptionKey;
62
- const onComplete = () => __async(void 0, null, function* () {
63
- setStep(ModalStep.WALLET_CREATION_DONE);
64
- });
65
- return /* @__PURE__ */ jsxs(StepContainer, { children: [
66
- /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
67
- /* @__PURE__ */ jsx(Heading, { variant: "headingS", weight: "bold", children: hideWallets ? "Don't lose access" : "Don't lose your wallet" }),
68
- /* @__PURE__ */ jsxs(InlineText, { variant: "bodyS", color: "secondary", weight: "medium", children: [
69
- "Your",
70
- " ",
71
- /* @__PURE__ */ jsx(InlineText, { variant: "bodyS", weight: "medium", children: "Recovery Secret" }),
72
- " ",
73
- "ensures you will be able to regain access to your ",
74
- hideWallets ? "account" : "wallet",
75
- " if you lose your Passkey or Password."
76
- ] })
77
- ] }),
78
- /* @__PURE__ */ jsx(
79
- SaveRecoverySecret,
80
- {
81
- email: (authInfo == null ? void 0 : authInfo.authType) === "email" ? authInfo.identifier : void 0,
82
- value: backupDecryptionKey,
83
- onComplete
84
- }
85
- )
86
- ] });
87
- };
88
- const ActionButton = safeStyled(StyledCpslTileButton)`
89
- flex: 1;
90
-
91
- --button-icon-color: var(--cpsl-color-text-primary);
92
- `;
93
- const ButtonContainer = safeStyled.div`
94
- display: flex;
95
- align-items: center;
96
- justify-content: center;
97
- gap: 8px;
98
- width: 100%;
99
- `;
100
- const InlineText = safeStyled(CpslText)`
101
- text-align: center;
102
- display: inline-block;
103
- `;
104
- export {
105
- RecoverySecretStep,
106
- SaveRecoverySecret
107
- };
@@ -1,5 +0,0 @@
1
- interface Setup2FAStepProps {
2
- onClose: () => void;
3
- }
4
- export declare const Setup2FAStep: ({ onClose }: Setup2FAStepProps) => import("react/jsx-runtime").JSX.Element;
5
- export {};
@@ -1,132 +0,0 @@
1
- "use client";
2
- import {
3
- __async
4
- } from "../../../chunk-MMUBH76A.js";
5
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
- import {
7
- CpslButton,
8
- CpslCodeInput,
9
- CpslDivider,
10
- CpslIcon,
11
- CpslQrCode,
12
- CpslSpinner,
13
- CpslText
14
- } from "@getpara/react-components";
15
- import { useEffect, useRef, useState } from "react";
16
- import { useModalStore } from "../../stores/index.js";
17
- import { Heading, QRContainer, FilledDisabledInput, StepContainer, InnerStepContainer } from "../common.js";
18
- import { ModalStep } from "../../utils/steps.js";
19
- import { safeStyled } from "@getpara/react-common";
20
- import { useCopyToClipboard } from "@getpara/react-common";
21
- import { useEnable2fa } from "../../../provider/index.js";
22
- const Setup2FAStep = ({ onClose }) => {
23
- const isLogin = useModalStore((state) => state.isLogin());
24
- const setStep = useModalStore((state) => state.setStep);
25
- const twoFactorStatus = useModalStore((state) => state.twoFactorStatus);
26
- const { enable2fa, isPending } = useEnable2fa();
27
- const isVerifying = useModalStore((state) => state.step === ModalStep.VERIFY_2FA);
28
- const [copied, copy] = useCopyToClipboard();
29
- const inputRef = useRef(null);
30
- const [code, setCode] = useState("");
31
- const [codeError, setCodeError] = useState("");
32
- const params = (twoFactorStatus == null ? void 0 : twoFactorStatus.uri) ? new URL(twoFactorStatus.uri).searchParams : void 0;
33
- const secret = params == null ? void 0 : params.get("secret");
34
- useEffect(() => {
35
- setTimeout(() => {
36
- var _a, _b, _c, _d;
37
- (_d = (_c = (_b = (_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.shadowRoot) == null ? void 0 : _b.querySelectorAll("input")) == null ? void 0 : _c[0]) == null ? void 0 : _d.focus();
38
- }, 10);
39
- }, [isVerifying]);
40
- useEffect(() => {
41
- if (code.length === 6) {
42
- handleSubmitCode();
43
- }
44
- }, [code]);
45
- const handleNext = () => {
46
- setStep(ModalStep.VERIFY_2FA);
47
- };
48
- const handleSkip = () => {
49
- if (isLogin) {
50
- setStep(ModalStep.LOGIN_DONE);
51
- } else {
52
- onClose();
53
- }
54
- };
55
- const handleCodeInput = (e) => {
56
- if (codeError) {
57
- setCodeError("");
58
- }
59
- setCode(e.detail.value.trim());
60
- };
61
- const handleSubmitCode = () => __async(void 0, null, function* () {
62
- if (code.length === 6 && /^\d+$/.test(code)) {
63
- enable2fa(
64
- { verificationCode: code },
65
- {
66
- onSuccess: () => {
67
- setStep(ModalStep.TWO_FACTOR_DONE);
68
- },
69
- onError: () => {
70
- setCodeError("Incorrect Code");
71
- }
72
- }
73
- );
74
- } else {
75
- setCodeError("Incorrect Code");
76
- }
77
- });
78
- const handleCopy = () => {
79
- if (secret) {
80
- copy(secret);
81
- }
82
- };
83
- return /* @__PURE__ */ jsxs(StepContainer, { children: [
84
- /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
85
- /* @__PURE__ */ jsx(Heading, { variant: "headingS", weight: "bold", children: "Turn on Two-Factor authentication" }),
86
- isVerifying && /* @__PURE__ */ jsx(CpslText, { variant: "bodyS", color: "secondary", weight: "medium", children: "Please enter the code from your authenticator app." })
87
- ] }),
88
- /* @__PURE__ */ jsx(InnerStepContainer, { children: isVerifying ? /* @__PURE__ */ jsx(Fragment, { children: isPending ? /* @__PURE__ */ jsx(CpslSpinner, {}) : /* @__PURE__ */ jsx(
89
- "form",
90
- {
91
- onSubmit: (e) => __async(void 0, null, function* () {
92
- e.preventDefault();
93
- yield handleSubmitCode();
94
- }),
95
- children: /* @__PURE__ */ jsx(
96
- StyledCodeInput,
97
- {
98
- ref: inputRef,
99
- code,
100
- onCpslInput: handleCodeInput,
101
- errorText: codeError,
102
- length: 6,
103
- onKeyDown: (e) => __async(void 0, null, function* () {
104
- return e.key === "Enter" && (yield handleSubmitCode());
105
- })
106
- }
107
- )
108
- }
109
- ) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
110
- /* @__PURE__ */ jsx(CpslText, { variant: "bodyS", color: "secondary", weight: "medium", children: "Scan with your preferred authenticator app." }),
111
- /* @__PURE__ */ jsx(QRContainer, { children: !(twoFactorStatus == null ? void 0 : twoFactorStatus.uri) ? /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) : /* @__PURE__ */ jsx(CpslQrCode, { url: twoFactorStatus.uri }) })
112
- ] }) }),
113
- !isVerifying && /* @__PURE__ */ jsxs(Fragment, { children: [
114
- /* @__PURE__ */ jsx(InnerStepContainer, { children: /* @__PURE__ */ jsx(CpslDivider, { children: "or enter the code manually" }) }),
115
- /* @__PURE__ */ jsx(InnerStepContainer, { children: /* @__PURE__ */ jsx(FilledDisabledInput, { disabled: true, value: secret != null ? secret : "", noAutoDisable: true, children: /* @__PURE__ */ jsx(CpslButton, { slot: "end", variant: "ghost", onClick: handleCopy, children: /* @__PURE__ */ jsx(CpslIcon, { icon: copied ? "check" : "copy" }) }) }) }),
116
- /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
117
- /* @__PURE__ */ jsx(CpslButton, { fullWidth: true, onClick: handleNext, children: "Continue" }),
118
- /* @__PURE__ */ jsx(SkipButton, { variant: "ghost", onClick: handleSkip, children: "Skip" })
119
- ] })
120
- ] })
121
- ] });
122
- };
123
- const StyledCodeInput = safeStyled(CpslCodeInput)`
124
- align-self: center;
125
- `;
126
- const SkipButton = safeStyled(CpslButton)`
127
- margin-top: 8px;
128
- text-decoration: underline;
129
- `;
130
- export {
131
- Setup2FAStep
132
- };