@getpara/core-sdk 2.12.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 (197) hide show
  1. package/dist/cjs/ParaCore.js +793 -2003
  2. package/dist/cjs/constants.js +4 -1
  3. package/dist/cjs/services/AuthService.js +787 -0
  4. package/dist/cjs/services/BaseAuthFlowService.js +78 -0
  5. package/dist/cjs/services/ExternalWalletService.js +386 -0
  6. package/dist/cjs/services/LoginFlowService.js +163 -0
  7. package/dist/cjs/services/PollingService.js +448 -0
  8. package/dist/cjs/services/PortalUrlService.js +379 -0
  9. package/dist/cjs/services/PregenWalletService.js +442 -0
  10. package/dist/cjs/services/SessionManagementService.js +280 -0
  11. package/dist/cjs/services/SignupFlowService.js +185 -0
  12. package/dist/cjs/services/VerificationFlowService.js +242 -0
  13. package/dist/cjs/services/WalletService.js +577 -0
  14. package/dist/cjs/services/types/AuthServiceTypes.js +15 -0
  15. package/dist/cjs/services/types/BaseAuthFlowServiceTypes.js +15 -0
  16. package/dist/cjs/services/types/ExternalWalletServiceTypes.js +15 -0
  17. package/dist/cjs/services/types/LoginFlowServiceTypes.js +15 -0
  18. package/dist/cjs/services/types/PollingServiceTypes.js +15 -0
  19. package/dist/cjs/services/types/PortalUrlServiceTypes.js +15 -0
  20. package/dist/cjs/services/types/PregenWalletServiceTypes.js +15 -0
  21. package/dist/cjs/services/types/SessionManagementServiceTypes.js +15 -0
  22. package/dist/cjs/services/types/SignupFlowServiceTypes.js +15 -0
  23. package/dist/cjs/services/types/VerificationFlowServiceTypes.js +15 -0
  24. package/dist/cjs/services/types/WalletServiceTypes.js +15 -0
  25. package/dist/cjs/services/types/index.js +15 -0
  26. package/dist/cjs/state/CoreStateManager.js +297 -0
  27. package/dist/cjs/state/actors/authenticateWithEmailOrPhone.js +50 -0
  28. package/dist/cjs/state/actors/authenticateWithExternalWallet.js +50 -0
  29. package/dist/cjs/state/actors/authenticateWithFarcaster.js +50 -0
  30. package/dist/cjs/state/actors/authenticateWithFarcasterLegacy.js +50 -0
  31. package/dist/cjs/state/actors/authenticateWithTelegram.js +50 -0
  32. package/dist/cjs/state/actors/authenticateWithTelegramLegacy.js +50 -0
  33. package/dist/cjs/state/actors/checkUserState.js +53 -0
  34. package/dist/cjs/state/actors/claimWallets.js +56 -0
  35. package/dist/cjs/state/actors/connectExternalConnectors.js +54 -0
  36. package/dist/cjs/state/actors/connectExternalWallet.js +50 -0
  37. package/dist/cjs/state/actors/createGuestWallets.js +50 -0
  38. package/dist/cjs/state/actors/createWallets.js +73 -0
  39. package/dist/cjs/state/actors/polling.js +91 -0
  40. package/dist/cjs/state/actors/processAuthentication.js +50 -0
  41. package/dist/cjs/state/actors/setupAfterLogin.js +52 -0
  42. package/dist/cjs/state/actors/setupPara.js +50 -0
  43. package/dist/cjs/state/actors/signExternalWalletVerification.js +79 -0
  44. package/dist/cjs/state/actors/switchExternalWallet.js +50 -0
  45. package/dist/cjs/state/actors/verifyExternalWallet.js +50 -0
  46. package/dist/cjs/state/actors/verifyNewAccount.js +50 -0
  47. package/dist/cjs/state/actors/waitForExternalWalletProviders.js +54 -0
  48. package/dist/cjs/state/machines/authStateMachine.helpers.js +137 -0
  49. package/dist/cjs/state/machines/authStateMachine.js +1084 -0
  50. package/dist/cjs/state/machines/coreStateMachine.js +383 -0
  51. package/dist/cjs/state/machines/walletStateMachine.js +437 -0
  52. package/dist/cjs/state/types/auth.js +15 -0
  53. package/dist/cjs/state/types/core.js +15 -0
  54. package/dist/cjs/state/types/wallet.js +15 -0
  55. package/dist/cjs/types/{auth.js → accountLinking.js} +3 -3
  56. package/dist/cjs/types/authState.js +15 -0
  57. package/dist/cjs/types/coreApi.js +3 -1
  58. package/dist/cjs/types/index.js +2 -2
  59. package/dist/cjs/types/serviceInterfaces.js +15 -0
  60. package/dist/cjs/types/util.js +15 -0
  61. package/dist/cjs/utils/formatting.js +6 -0
  62. package/dist/cjs/utils/retryBackoff.js +30 -0
  63. package/dist/cjs/utils/stateErrorHelpers.js +60 -0
  64. package/dist/cjs/utils/stateListener.js +129 -0
  65. package/dist/esm/ParaCore.js +796 -2031
  66. package/dist/esm/constants.js +3 -1
  67. package/dist/esm/services/AuthService.js +717 -0
  68. package/dist/esm/services/BaseAuthFlowService.js +25 -0
  69. package/dist/esm/services/ExternalWalletService.js +327 -0
  70. package/dist/esm/services/LoginFlowService.js +97 -0
  71. package/dist/esm/services/PollingService.js +389 -0
  72. package/dist/esm/services/PortalUrlService.js +320 -0
  73. package/dist/esm/services/PregenWalletService.js +393 -0
  74. package/dist/esm/services/SessionManagementService.js +236 -0
  75. package/dist/esm/services/SignupFlowService.js +119 -0
  76. package/dist/esm/services/VerificationFlowService.js +178 -0
  77. package/dist/esm/services/WalletService.js +514 -0
  78. package/dist/esm/services/types/AuthServiceTypes.js +0 -0
  79. package/dist/esm/services/types/BaseAuthFlowServiceTypes.js +0 -0
  80. package/dist/esm/services/types/ExternalWalletServiceTypes.js +0 -0
  81. package/dist/esm/services/types/LoginFlowServiceTypes.js +0 -0
  82. package/dist/esm/services/types/PollingServiceTypes.js +0 -0
  83. package/dist/esm/services/types/PortalUrlServiceTypes.js +0 -0
  84. package/dist/esm/services/types/PregenWalletServiceTypes.js +0 -0
  85. package/dist/esm/services/types/SessionManagementServiceTypes.js +0 -0
  86. package/dist/esm/services/types/SignupFlowServiceTypes.js +0 -0
  87. package/dist/esm/services/types/VerificationFlowServiceTypes.js +0 -0
  88. package/dist/esm/services/types/WalletServiceTypes.js +0 -0
  89. package/dist/esm/services/types/index.js +0 -0
  90. package/dist/esm/state/CoreStateManager.js +261 -0
  91. package/dist/esm/state/actors/authenticateWithEmailOrPhone.js +10 -0
  92. package/dist/esm/state/actors/authenticateWithExternalWallet.js +10 -0
  93. package/dist/esm/state/actors/authenticateWithFarcaster.js +10 -0
  94. package/dist/esm/state/actors/authenticateWithFarcasterLegacy.js +10 -0
  95. package/dist/esm/state/actors/authenticateWithTelegram.js +10 -0
  96. package/dist/esm/state/actors/authenticateWithTelegramLegacy.js +10 -0
  97. package/dist/esm/state/actors/checkUserState.js +13 -0
  98. package/dist/esm/state/actors/claimWallets.js +16 -0
  99. package/dist/esm/state/actors/connectExternalConnectors.js +14 -0
  100. package/dist/esm/state/actors/connectExternalWallet.js +10 -0
  101. package/dist/esm/state/actors/createGuestWallets.js +10 -0
  102. package/dist/esm/state/actors/createWallets.js +20 -0
  103. package/dist/esm/state/actors/polling.js +55 -0
  104. package/dist/esm/state/actors/processAuthentication.js +10 -0
  105. package/dist/esm/state/actors/setupAfterLogin.js +12 -0
  106. package/dist/esm/state/actors/setupPara.js +10 -0
  107. package/dist/esm/state/actors/signExternalWalletVerification.js +15 -0
  108. package/dist/esm/state/actors/switchExternalWallet.js +10 -0
  109. package/dist/esm/state/actors/verifyExternalWallet.js +10 -0
  110. package/dist/esm/state/actors/verifyNewAccount.js +10 -0
  111. package/dist/esm/state/actors/waitForExternalWalletProviders.js +14 -0
  112. package/dist/esm/state/machines/authStateMachine.helpers.js +92 -0
  113. package/dist/esm/state/machines/authStateMachine.js +1039 -0
  114. package/dist/esm/state/machines/coreStateMachine.js +343 -0
  115. package/dist/esm/state/machines/walletStateMachine.js +382 -0
  116. package/dist/esm/state/types/auth.js +0 -0
  117. package/dist/esm/state/types/core.js +0 -0
  118. package/dist/esm/state/types/wallet.js +0 -0
  119. package/dist/esm/types/authState.js +0 -0
  120. package/dist/esm/types/coreApi.js +3 -1
  121. package/dist/esm/types/index.js +1 -1
  122. package/dist/esm/types/serviceInterfaces.js +0 -0
  123. package/dist/esm/types/util.js +0 -0
  124. package/dist/esm/utils/formatting.js +6 -0
  125. package/dist/esm/utils/retryBackoff.js +7 -0
  126. package/dist/esm/utils/stateErrorHelpers.js +37 -0
  127. package/dist/esm/utils/stateListener.js +106 -0
  128. package/dist/types/ParaCore.d.ts +190 -119
  129. package/dist/types/PlatformUtils.d.ts +23 -0
  130. package/dist/types/constants.d.ts +1 -0
  131. package/dist/types/index.d.ts +4 -2
  132. package/dist/types/services/AuthService.d.ts +72 -0
  133. package/dist/types/services/BaseAuthFlowService.d.ts +28 -0
  134. package/dist/types/services/ExternalWalletService.d.ts +44 -0
  135. package/dist/types/services/LoginFlowService.d.ts +9 -0
  136. package/dist/types/services/PollingService.d.ts +35 -0
  137. package/dist/types/services/PortalUrlService.d.ts +26 -0
  138. package/dist/types/services/PregenWalletService.d.ts +38 -0
  139. package/dist/types/services/SessionManagementService.d.ts +28 -0
  140. package/dist/types/services/SignupFlowService.d.ts +10 -0
  141. package/dist/types/services/VerificationFlowService.d.ts +17 -0
  142. package/dist/types/services/WalletService.d.ts +54 -0
  143. package/dist/types/services/types/AuthServiceTypes.d.ts +147 -0
  144. package/dist/types/services/types/BaseAuthFlowServiceTypes.d.ts +4 -0
  145. package/dist/types/services/types/ExternalWalletServiceTypes.d.ts +67 -0
  146. package/dist/types/services/types/LoginFlowServiceTypes.d.ts +19 -0
  147. package/dist/types/services/types/PollingServiceTypes.d.ts +82 -0
  148. package/dist/types/services/types/PortalUrlServiceTypes.d.ts +46 -0
  149. package/dist/types/services/types/PregenWalletServiceTypes.d.ts +73 -0
  150. package/dist/types/services/types/SessionManagementServiceTypes.d.ts +27 -0
  151. package/dist/types/services/types/SignupFlowServiceTypes.d.ts +18 -0
  152. package/dist/types/services/types/VerificationFlowServiceTypes.d.ts +90 -0
  153. package/dist/types/services/types/WalletServiceTypes.d.ts +109 -0
  154. package/dist/types/services/types/index.d.ts +11 -0
  155. package/dist/types/state/CoreStateManager.d.ts +36 -0
  156. package/dist/types/state/actors/authenticateWithEmailOrPhone.d.ts +8 -0
  157. package/dist/types/state/actors/authenticateWithExternalWallet.d.ts +8 -0
  158. package/dist/types/state/actors/authenticateWithFarcaster.d.ts +3 -0
  159. package/dist/types/state/actors/authenticateWithFarcasterLegacy.d.ts +3 -0
  160. package/dist/types/state/actors/authenticateWithTelegram.d.ts +3 -0
  161. package/dist/types/state/actors/authenticateWithTelegramLegacy.d.ts +8 -0
  162. package/dist/types/state/actors/checkUserState.d.ts +6 -0
  163. package/dist/types/state/actors/claimWallets.d.ts +8 -0
  164. package/dist/types/state/actors/connectExternalConnectors.d.ts +4 -0
  165. package/dist/types/state/actors/connectExternalWallet.d.ts +3 -0
  166. package/dist/types/state/actors/createGuestWallets.d.ts +3 -0
  167. package/dist/types/state/actors/createWallets.d.ts +10 -0
  168. package/dist/types/state/actors/polling.d.ts +3 -0
  169. package/dist/types/state/actors/processAuthentication.d.ts +10 -0
  170. package/dist/types/state/actors/setupAfterLogin.d.ts +5 -0
  171. package/dist/types/state/actors/setupPara.d.ts +2 -0
  172. package/dist/types/state/actors/signExternalWalletVerification.d.ts +7 -0
  173. package/dist/types/state/actors/switchExternalWallet.d.ts +3 -0
  174. package/dist/types/state/actors/verifyExternalWallet.d.ts +8 -0
  175. package/dist/types/state/actors/verifyNewAccount.d.ts +8 -0
  176. package/dist/types/state/actors/waitForExternalWalletProviders.d.ts +2 -0
  177. package/dist/types/state/machines/authStateMachine.d.ts +2570 -0
  178. package/dist/types/state/machines/authStateMachine.helpers.d.ts +57 -0
  179. package/dist/types/state/machines/coreStateMachine.d.ts +22033 -0
  180. package/dist/types/state/machines/walletStateMachine.d.ts +1049 -0
  181. package/dist/types/state/types/auth.d.ts +113 -0
  182. package/dist/types/state/types/core.d.ts +114 -0
  183. package/dist/types/state/types/wallet.d.ts +76 -0
  184. package/dist/types/types/authState.d.ts +66 -0
  185. package/dist/types/types/config.d.ts +5 -0
  186. package/dist/types/types/coreApi.d.ts +148 -298
  187. package/dist/types/types/index.d.ts +3 -1
  188. package/dist/types/types/methods.d.ts +1 -191
  189. package/dist/types/types/serviceInterfaces.d.ts +125 -0
  190. package/dist/types/types/util.d.ts +43 -0
  191. package/dist/types/types/wallet.d.ts +3 -1
  192. package/dist/types/utils/retryBackoff.d.ts +2 -0
  193. package/dist/types/utils/stateErrorHelpers.d.ts +2 -0
  194. package/dist/types/utils/stateListener.d.ts +47 -0
  195. package/package.json +5 -4
  196. /package/dist/esm/types/{auth.js → accountLinking.js} +0 -0
  197. /package/dist/types/types/{auth.d.ts → accountLinking.d.ts} +0 -0
@@ -1,7 +1,12 @@
1
- import { AuthMethod, AuthExtras, CurrentWalletIds, EmailTheme, PartnerEntity, TWalletType, PregenIds, BiometricLocationHint, Auth, SupportedWalletTypes, AuthIdentifier, AuthType, ExternalWalletInfo, ServerAuthStateLogin, ServerAuthStateSignup, PrimaryAuthInfo, SessionInfo, PrimaryAuth, PrimaryAuthType, AccountMetadata, LinkedAccounts, VerifyLinkParams, VerifyExternalWalletParams, SupportedAccountLinks, OnRampPurchase, BalancesConfig, Theme, ServerAuthStateDone } from '@getpara/user-management-client';
1
+ import { AuthMethod, AuthExtras, CurrentWalletIds, EmailTheme, PartnerEntity, TWalletType, PregenIds, BiometricLocationHint, Auth, SupportedWalletTypes, AuthIdentifier, AuthType, ExternalWalletInfo, PrimaryAuthInfo, SessionInfo, PrimaryAuth, PrimaryAuthType, AccountMetadata, LinkedAccounts, VerifyLinkParams, VerifyExternalWalletParams as VerifyExternalWalletParamsServer, SupportedAccountLinks, OnRampPurchase, BalancesConfig, Theme, IssueJwtParams } from '@getpara/user-management-client';
2
2
  import type { pki as pkiType } from 'node-forge';
3
- import { Ctx, Environment, WalletFilters, Wallet, PortalUrlOptions, ConstructorOpts, CoreAuthInfo, PortalUrlType, CoreMethodParams, CoreMethodResponse, NewCredentialUrlParams, LoginUrlParams, CoreInterface, ExternalWalletConnectionType, AccountLinkInProgress, InternalMethodParams, InternalMethodResponse, AvailableWallet } from './types/index.js';
3
+ import { Ctx, Environment, Wallet, ConstructorOpts, CoreAuthInfo, CoreMethodParams, CoreMethodResponse, CoreInterface, AccountLinkInProgress, InternalMethodParams, InternalMethodResponse, OAuthResponse, AvailableWallet } from './types/index.js';
4
4
  import { PlatformUtils } from './PlatformUtils.js';
5
+ import { AuthServiceInterface, ExternalWalletServiceInterface, PollingServiceInterface, PortalUrlServiceInterface, PregenWalletServiceInterface, SessionManagementServiceInterface, StateMachineInterface, WalletServiceInterface } from './types/serviceInterfaces.js';
6
+ import type { WaitForLoginParams, WaitForLoginResponse, WaitForSignupParams, WaitForWalletCreationParams, VerifyFarcasterParams, VerifyFarcasterResponse, VerifyNewAccountParams, VerifyTelegramParams, AddCredentialParams, GetNewCredentialAndUrlParams, GetNewCredentialAndUrlResponse, LoginExternalWalletParams, ResendVerificationCodeParams, SignUpOrLogInParams, VerifyOAuthProcessParams, VerifyOAuthProcessResponse, GetLoginUrlParams, GetOAuthUrlParams, PortalUrlOptions, PortalUrlType, ClaimPregenWalletsParams, CreatePregenWalletParams, CreatePregenWalletPerTypeParams, GetPregenWalletsParams, HasPregenWalletParams, UpdatePregenWalletIdentifierParams, CreateWalletParams, CreateWalletPerTypeParams, DistributeNewWalletShareParams, FindWalletByAddressParams, FindWalletIdParams, FindWalletParams, GetDisplayAddressParams, GetIdenticonHashParams, GetWalletBalanceParams, GetWalletsByTypeParams, RefreshShareParams, SetCurrentWalletIdsParams, SetWalletsParams, RefreshSessionParams, VerifyExternalWalletParams, InitExternalWalletProviderParams, ConnectExternalWalletParams, ExternalSignMessageParams, AuthenticateWithEmailOrPhoneParams, AuthenticateWithOAuthParams } from './services/types';
7
+ import { CorePhase, StateSnapshot } from './state/types/core.js';
8
+ import { AuthPhase } from './state/types/auth.js';
9
+ import { WalletPhase } from './state/types/wallet.js';
5
10
  export declare abstract class ParaCore implements CoreInterface {
6
11
  #private;
7
12
  popupWindow: Window | null;
@@ -11,25 +16,94 @@ export declare abstract class ParaCore implements CoreInterface {
11
16
  protected isNativePasskey: boolean;
12
17
  protected isPartnerOptional?: boolean;
13
18
  protected setModalError(_error?: string): void;
14
- isReady: boolean;
19
+ isSetup: boolean;
20
+ /**
21
+ * The current readiness state.
22
+ */
23
+ get isReady(): boolean;
24
+ /**
25
+ * The current phase of the core flow.
26
+ */
27
+ get corePhase(): CorePhase;
28
+ /**
29
+ * The current phase of the authentication flow.
30
+ */
31
+ get authPhase(): AuthPhase;
32
+ /**
33
+ * The current phase of the wallet flow.
34
+ */
35
+ get walletPhase(): WalletPhase;
36
+ /**
37
+ * Any error that has occurred in the core flow.
38
+ */
39
+ get error(): Error | null;
40
+ /**
41
+ * Get the current state of the core, auth, and wallet phases.
42
+ * @returns An object containing the current core, auth, and wallet state phases, along with any error.
43
+ */
44
+ getCurrentState(): StateSnapshot;
45
+ /**
46
+ * Subscribe to changes in the core, auth, and wallet state phases.
47
+ *
48
+ * This method immediately calls the callback with the current state, then continues
49
+ * to call it whenever any phase changes. This ensures you never miss the initial state
50
+ * and can react to all subsequent changes.
51
+ *
52
+ * @param callback A function that will be called with the current state phases whenever they change.
53
+ * The callback receives an object containing `corePhase`, `authPhase`, `walletPhase`, and `error`.
54
+ *
55
+ * @returns A function that can be called to unsubscribe from the state changes.
56
+ * Always call this function when your component unmounts or when you no longer need updates
57
+ * to prevent memory leaks.
58
+ *
59
+ * @example
60
+ * ```typescript
61
+ * // React example
62
+ * useEffect(() => {
63
+ * const unsubscribe = paraClient.onStatePhaseChange((snapshot) => {
64
+ * console.log('Core phase:', snapshot.corePhase);
65
+ * console.log('Auth phase:', snapshot.authPhase);
66
+ * console.log('Wallet phase:', snapshot.walletPhase);
67
+ *
68
+ * if (snapshot.error) {
69
+ * console.error('Para error:', snapshot.error.message);
70
+ * }
71
+ * });
72
+ *
73
+ * return unsubscribe; // Cleanup on unmount
74
+ * }, [paraClient]);
75
+ *
76
+ * // Vue example
77
+ * onMounted(() => {
78
+ * const unsubscribe = paraClient.onStatePhaseChange((state) => {
79
+ * phases.value = state;
80
+ * });
81
+ *
82
+ * onUnmounted(unsubscribe);
83
+ * });
84
+ * ```
85
+ */
86
+ onStatePhaseChange(callback: (_: StateSnapshot) => void): () => void;
87
+ /**
88
+ * Subscribe to changes in the readiness state of the ParaCore instance.
89
+ * @param callback A function that will be called with the new readiness state.
90
+ * @returns A function that can be called to unsubscribe from the readiness state changes.
91
+ */
92
+ onReadyStateChange(callback: (isReady: boolean) => void): () => void;
15
93
  get authInfo(): CoreAuthInfo | undefined;
16
94
  get email(): AuthIdentifier<'email'> | undefined;
17
95
  get phone(): AuthIdentifier<'phone'> | undefined;
18
96
  get farcasterUsername(): AuthIdentifier<'farcaster'> | undefined;
19
97
  get telegramUserId(): AuthIdentifier<'telegram'> | undefined;
20
98
  get externalWalletWithParaAuth(): Wallet | undefined;
21
- get externalWalletConnectionType(): ExternalWalletConnectionType;
99
+ get externalWalletConnectionType(): import("./services/types").ExternalWalletConnectionType;
22
100
  protected partner?: PartnerEntity;
23
- userId?: string;
101
+ get userId(): string | undefined;
24
102
  accountLinkInProgress: AccountLinkInProgress | undefined;
25
- private sessionCookie?;
26
- isEnclaveUser: boolean;
103
+ get isEnclaveUser(): boolean;
104
+ set isEnclaveUser(value: boolean);
27
105
  private enclaveJwt?;
28
106
  private enclaveRefreshJwt?;
29
- private isAwaitingAccountCreation;
30
- private isAwaitingLogin;
31
- private isAwaitingFarcaster;
32
- private isAwaitingOAuth;
33
107
  private isWorkerInitialized;
34
108
  get isEmail(): boolean;
35
109
  get isPhone(): boolean;
@@ -40,20 +114,17 @@ export declare abstract class ParaCore implements CoreInterface {
40
114
  get partnerId(): string | undefined;
41
115
  protected get partnerName(): string | undefined;
42
116
  protected get partnerLogo(): string | undefined;
43
- /**
44
- * The IDs of the currently active wallets, for each supported wallet type. Any signer integrations will default to the first viable wallet ID in this dictionary.
45
- */
46
- currentWalletIds: CurrentWalletIds;
117
+ get currentWalletIds(): CurrentWalletIds;
47
118
  get currentWalletIdsArray(): [string, TWalletType][];
48
119
  get currentWalletIdsUnique(): string[];
49
120
  /**
50
121
  * Wallets associated with the `ParaCore` instance. Retrieve a particular wallet using `para.wallets[walletId]`.
51
122
  */
52
- wallets: Record<string, Wallet>;
123
+ get wallets(): Record<string, Wallet>;
53
124
  /**
54
125
  * Wallets associated with the `ParaCore` instance.
55
126
  */
56
- externalWallets: Record<string, Wallet>;
127
+ get externalWallets(): Record<string, Wallet>;
57
128
  /**
58
129
  * A map of pre-generated wallet identifiers that can be claimed in the current instance.
59
130
  */
@@ -167,12 +238,6 @@ export declare abstract class ParaCore implements CoreInterface {
167
238
  protected isPortal(envOverride?: Environment): boolean;
168
239
  private isParaConnect;
169
240
  private requireApiKey;
170
- private isWalletSupported;
171
- private isWalletOwned;
172
- private isPregenWalletUnclaimed;
173
- private isPregenWalletClaimable;
174
- private isWalletUsable;
175
- private truncateAddress;
176
241
  /**
177
242
  * Returns the formatted address for the desired wallet ID, depending on your app settings.
178
243
  * @param {string} walletId the ID of the wallet address to display.
@@ -181,19 +246,14 @@ export declare abstract class ParaCore implements CoreInterface {
181
246
  * @param {TWalletType} options.addressType the type of address to display.
182
247
  * @returns the formatted address
183
248
  */
184
- getDisplayAddress(walletId: string, options?: {
185
- truncate?: boolean;
186
- addressType?: TWalletType | undefined;
187
- cosmosPrefix?: string;
188
- targetLength?: number;
189
- } | undefined): string;
249
+ getDisplayAddress(...params: GetDisplayAddressParams): string;
190
250
  /**
191
251
  * Returns a unique hash for a wallet suitable for use as an identicon seed.
192
252
  * @param {string} walletId the ID of the wallet.
193
253
  * @param {boolean} options.addressType used to format the hash for another wallet type.
194
254
  * @returns the identicon hash string
195
255
  */
196
- getIdenticonHash(walletId: string, overrideType?: TWalletType): string | undefined;
256
+ getIdenticonHash(...params: GetIdenticonHashParams): string;
197
257
  getWallets(): Record<string, Wallet>;
198
258
  getAddress(walletId?: string): string | undefined;
199
259
  protected abstract getPlatformUtils(): PlatformUtils;
@@ -209,6 +269,15 @@ export declare abstract class ParaCore implements CoreInterface {
209
269
  */
210
270
  constructor(env: Environment | undefined, apiKey: string, opts?: ConstructorOpts);
211
271
  constructor(apiKey: string, opts?: ConstructorOpts);
272
+ initExternalWalletProvider: (params: InitExternalWalletProviderParams) => Promise<void>;
273
+ getAuthServiceInterface(): AuthServiceInterface;
274
+ getWalletServiceInterface(): WalletServiceInterface;
275
+ getPregenWalletServiceInterface(): PregenWalletServiceInterface;
276
+ getPortalUrlServiceInterface(): PortalUrlServiceInterface;
277
+ getSessionManagementServiceInterface(): SessionManagementServiceInterface;
278
+ getStateMachineInterface(): StateMachineInterface;
279
+ getExternalWalletServiceInterface(): ExternalWalletServiceInterface;
280
+ getPollingServiceInterface(): PollingServiceInterface;
212
281
  private trackError;
213
282
  private wrapMethodsWithErrorTracking;
214
283
  private initializeFromStorage;
@@ -236,7 +305,7 @@ export declare abstract class ParaCore implements CoreInterface {
236
305
  *
237
306
  * This method will be called automatically if you use the React `ParaProvider` or when you call any methods that request an updated session.
238
307
  */
239
- abstract ready(): Promise<void>;
308
+ abstract setup(): Promise<void>;
240
309
  protected setAuth(auth: PrimaryAuth, { extras, userId }?: {
241
310
  extras?: AuthExtras;
242
311
  userId?: string;
@@ -246,11 +315,6 @@ export declare abstract class ParaCore implements CoreInterface {
246
315
  * @internal
247
316
  */
248
317
  protected displayModalError(error?: string): void;
249
- /**
250
- * Handle specific touchSession errors with user-friendly messages
251
- * @private
252
- */
253
- private handleTouchSessionError;
254
318
  protected assertUserId({ allowGuestMode }?: {
255
319
  allowGuestMode?: boolean;
256
320
  }): string;
@@ -292,7 +356,7 @@ export declare abstract class ParaCore implements CoreInterface {
292
356
  * Sets the wallets associated with the `ParaCore` instance.
293
357
  * @param wallets - Wallets to set.
294
358
  */
295
- setWallets(wallets: Record<string, Wallet>): Promise<void>;
359
+ setWallets(wallets: SetWalletsParams): Promise<void>;
296
360
  /**
297
361
  * Sets the external wallets associated with the `ParaCore` instance.
298
362
  * @param externalWallets - External wallets to set, or a function that modifies the current wallets.
@@ -325,11 +389,7 @@ export declare abstract class ParaCore implements CoreInterface {
325
389
  * @returns - farcaster username associated with the `ParaCore` instance.
326
390
  */
327
391
  getFarcasterUsername(): string | undefined;
328
- setCurrentWalletIds(currentWalletIds: CurrentWalletIds, { needsWallet, sessionLookupId, newDeviceSessionLookupId, }?: {
329
- needsWallet?: boolean;
330
- sessionLookupId?: string;
331
- newDeviceSessionLookupId?: string;
332
- }): Promise<void>;
392
+ setCurrentWalletIds: (...params: SetCurrentWalletIdsParams) => Promise<void>;
333
393
  /**
334
394
  * Fetches the most recent OAuth account metadata for the signed-in user.
335
395
  * If applicable, this will include the user's most recent metadata from their Google, Apple, Facebook, X, Discord, Farcaster, or Telegram account, the last time they signed in to your app.
@@ -344,7 +404,7 @@ export declare abstract class ParaCore implements CoreInterface {
344
404
  * @param {WalletFilters} [filter={}] a `WalletFilters` object specifying allowed types, schemes, and whether to forbid unclaimed pregen wallets.
345
405
  * @returns {string} the wallet ID originally passed, or the one found.
346
406
  */
347
- findWalletId(walletId?: string, filter?: WalletFilters): string;
407
+ findWalletId: (...params: FindWalletIdParams) => string;
348
408
  /**
349
409
  * Retrieves a wallet with the given address, if present.
350
410
  * If no ID is passed, this will instead return the first valid, usable wallet ID that matches the filters.
@@ -352,20 +412,16 @@ export declare abstract class ParaCore implements CoreInterface {
352
412
  * @param {WalletFilters} [filter={}] a `WalletFilters` object specifying allowed types, schemes, and whether to forbid unclaimed pregen wallets.
353
413
  * @returns {string} the wallet ID originally passed, or the one found.
354
414
  */
355
- findWalletByAddress(address: string, filter?: WalletFilters | undefined): any;
356
- findWallet(idOrAddress?: string, overrideType?: TWalletType, filter?: WalletFilters): Omit<Wallet, 'signer'> | undefined;
415
+ findWalletByAddress(...params: FindWalletByAddressParams): Wallet;
416
+ findWallet(...params: FindWalletParams): import("./types/wallet.js").WalletNoSigner;
357
417
  get availableWallets(): AvailableWallet[];
358
418
  /**
359
419
  * Retrieves all usable wallets with the provided type (`'EVM' | 'COSMOS' | 'SOLANA'`)
360
420
  * @param {string} type the wallet type to filter by.
361
421
  * @returns {Wallet[]} an array of matching wallets.
362
422
  */
363
- getWalletsByType(type: CoreMethodParams<'getWalletsByType'>): CoreMethodResponse<'getWalletsByType'>;
364
- private assertIsValidWalletId;
365
- private assertIsValidWalletType;
366
- private getMissingTypes;
367
- private getTypesToCreate;
368
- private getPartnerURL;
423
+ getWalletsByType(type: GetWalletsByTypeParams): Wallet[];
424
+ getPartner(partnerId: string): Promise<PartnerEntity>;
369
425
  /**
370
426
  * URL of the portal, which can be associated with a partner id
371
427
  * @param partnerId: string - id of the partner to get the portal URL for
@@ -382,9 +438,8 @@ export declare abstract class ParaCore implements CoreInterface {
382
438
  * Fetches the wallets associated with the user.
383
439
  * @returns {WalletEntity[]} wallets that were fetched.
384
440
  */
385
- fetchWallets(): CoreMethodResponse<'fetchWallets'>;
441
+ fetchWallets(): Promise<import("@getpara/user-management-client").IWalletEntity[]>;
386
442
  protected populateWalletAddresses(): Promise<void>;
387
- private populatePregenWalletAddresses;
388
443
  /**
389
444
  * Logs in or creates a new user using an external wallet address.
390
445
  * @param {Object} opts the options object
@@ -392,21 +447,24 @@ export declare abstract class ParaCore implements CoreInterface {
392
447
  * @param {TWalletType} opts.type type of external wallet to use for identification.
393
448
  * @param {string} opts.provider the name of the provider for the external wallet.
394
449
  */
395
- loginExternalWallet({ externalWallet, chainId, uri, ...urlOptions }: CoreMethodParams<'loginExternalWallet'>): CoreMethodResponse<'loginExternalWallet'>;
396
- verifyExternalWallet(params: {
397
- serverAuthState: ServerAuthStateSignup | ServerAuthStateLogin | ServerAuthStateDone;
398
- } & Omit<CoreMethodParams<'verifyExternalWallet'>, keyof VerifyExternalWalletParams>): CoreMethodResponse<'verifyExternalWallet'>;
399
- verifyExternalWallet(params: VerifyExternalWalletParams & {
400
- serverAuthState?: undefined;
401
- } & Omit<CoreMethodParams<'verifyExternalWallet'>, 'serverAuthState'>): CoreMethodResponse<'verifyExternalWallet'>;
450
+ loginExternalWallet(params: LoginExternalWalletParams): Promise<import("./services/types").LoginExternalWalletResponse>;
451
+ /**
452
+ * Connects to an external wallet & logs in to Para (if applicable).
453
+ * @param {Object} params the params object
454
+ * @param {Function} params.connect the function called to connect to the external wallet.
455
+ */
456
+ connectExternalWallet(params: ConnectExternalWalletParams): Promise<import("./services/types").ConnectExternalWalletResponse>;
457
+ verifyExternalWallet(params: VerifyExternalWalletParams): Promise<import("./services/types").VerifyExternalWalletResponse>;
458
+ retryVerifyExternalWallet(): Promise<import("./services/types").VerifyExternalWalletResponse>;
459
+ signExternalWalletVerification(params: ExternalSignMessageParams): Promise<import("./services/types").BaseVerifyExternalWalletParams>;
402
460
  protected verifyExternalWalletLink(opts: InternalMethodParams<'verifyExternalWalletLink'>): InternalMethodResponse<'verifyExternalWalletLink'>;
403
- protected verifyTelegramProcess(opts: CoreMethodParams<'verifyTelegram'> & {
461
+ protected verifyTelegramProcess(opts: VerifyTelegramParams & {
404
462
  isLinkAccount: false;
405
- }): CoreMethodResponse<'verifyTelegram'>;
463
+ }): Promise<OAuthResponse>;
406
464
  protected verifyTelegramProcess(opts: InternalMethodParams<'verifyTelegramLink'> & {
407
465
  isLinkAccount: true;
408
466
  }): InternalMethodResponse<'verifyTelegramLink'>;
409
- verifyTelegram(opts: CoreMethodParams<'verifyTelegram'>): CoreMethodResponse<'verifyTelegram'>;
467
+ verifyTelegram(params: VerifyTelegramParams): Promise<import("./types/authState.js").AuthStateSignupOrLoginOrDone>;
410
468
  protected verifyTelegramLink(opts: InternalMethodParams<'verifyTelegramLink'>): InternalMethodResponse<'verifyTelegramLink'>;
411
469
  /**
412
470
  * Performs 2FA verification.
@@ -430,17 +488,17 @@ export declare abstract class ParaCore implements CoreInterface {
430
488
  /**
431
489
  * Resend a verification email for the current user.
432
490
  */
433
- resendVerificationCode({ type: reason, }: CoreMethodParams<'resendVerificationCode'>): CoreMethodResponse<'resendVerificationCode'>;
491
+ resendVerificationCode({ type: reason }: ResendVerificationCodeParams): Promise<void>;
434
492
  /**
435
493
  * Checks if the current session is active.
436
494
  * @returns `true` if active, `false` otherwise
437
495
  */
438
- isSessionActive(): CoreMethodResponse<'isSessionActive'>;
496
+ isSessionActive(): Promise<boolean>;
439
497
  /**
440
498
  * Checks if a session is active and a wallet exists.
441
499
  * @returns `true` if active, `false` otherwise
442
500
  **/
443
- isFullyLoggedIn(): CoreMethodResponse<'isFullyLoggedIn'>;
501
+ isFullyLoggedIn(): Promise<boolean>;
444
502
  get isGuestMode(): boolean;
445
503
  /**
446
504
  * Get the auth methods available to an existing user
@@ -460,8 +518,8 @@ export declare abstract class ParaCore implements CoreInterface {
460
518
  /**
461
519
  * Waits for the session to be active.
462
520
  **/
463
- waitForSignup({ isCanceled, onCancel, onPoll, }: CoreMethodParams<'waitForSignup'>): CoreMethodResponse<'waitForSignup'>;
464
- waitForWalletCreation({ isCanceled, onCancel, }?: CoreMethodParams<'waitForWalletCreation'>): CoreMethodResponse<'waitForWalletCreation'>;
521
+ waitForSignup(params: WaitForSignupParams): Promise<true>;
522
+ waitForWalletCreation(params: WaitForWalletCreationParams): Promise<import("./services/types").WaitForWalletCreationResponse>;
465
523
  /**
466
524
  * Initiates a Farcaster login attempt and returns the URL for the user to connect.
467
525
  * You can create a QR code with this URI that works with Farcaster's mobile app.
@@ -469,23 +527,31 @@ export declare abstract class ParaCore implements CoreInterface {
469
527
  */
470
528
  getFarcasterConnectUri({ appScheme }?: {
471
529
  appScheme?: string;
472
- }): CoreMethodResponse<'getFarcasterConnectUri'>;
473
- protected verifyFarcasterProcess(opts: CoreMethodParams<'verifyFarcaster'> & {
530
+ }): Promise<string>;
531
+ protected verifyFarcasterProcess(_: VerifyFarcasterParams & {
474
532
  isLinkAccount: false;
475
- }): CoreMethodResponse<'verifyFarcaster'>;
533
+ }): Promise<VerifyFarcasterResponse>;
476
534
  protected verifyFarcasterProcess(opts: InternalMethodParams<'verifyFarcasterLink'> & {
477
535
  isLinkAccount: true;
478
536
  }): InternalMethodResponse<'verifyFarcasterLink'>;
479
- verifyFarcaster(opts: CoreMethodParams<'verifyFarcaster'>): CoreMethodResponse<'verifyFarcaster'>;
537
+ verifyFarcaster(params: VerifyFarcasterParams): Promise<import("./types/authState.js").AuthStateSignupOrLoginOrDone>;
480
538
  protected verifyFarcasterLink(opts: InternalMethodParams<'verifyFarcasterLink'>): InternalMethodResponse<'verifyFarcasterLink'>;
481
- getOAuthUrl(opts: CoreMethodParams<'getOAuthUrl'>): CoreMethodResponse<'getOAuthUrl'>;
539
+ /**
540
+ * Generates a URL for the user to log in with OAuth using a desire method.
541
+ *
542
+ * @param {Object} opts the options object
543
+ * @param {TOAuthMethod} opts.method the third-party service to use for OAuth.
544
+ * @param {string} [opts.appScheme] the app scheme to redirect to after the OAuth flow. This is for mobile only.
545
+ * @returns {string} the URL for the user to log in with OAuth.
546
+ */
547
+ getOAuthUrl(params: GetOAuthUrlParams): Promise<string>;
482
548
  protected verifyOAuthProcess(_: InternalMethodParams<'verifyOAuthLink'> & {
483
549
  isLinkAccount: true;
484
550
  }): InternalMethodResponse<'verifyOAuthLink'>;
485
- protected verifyOAuthProcess(_: CoreMethodParams<'verifyOAuth'> & {
551
+ protected verifyOAuthProcess(_: VerifyOAuthProcessParams & {
486
552
  isLinkAccount: false;
487
- }): CoreMethodResponse<'verifyOAuth'>;
488
- verifyOAuth(opts: CoreMethodParams<'verifyOAuth'>): CoreMethodResponse<'verifyOAuth'>;
553
+ }): Promise<VerifyOAuthProcessResponse>;
554
+ verifyOAuth(params: VerifyOAuthProcessParams): Promise<VerifyOAuthProcessResponse>;
489
555
  protected verifyOAuthLink(opts: InternalMethodParams<'verifyOAuthLink'>): InternalMethodResponse<'verifyOAuthLink'>;
490
556
  /**
491
557
  * Waits for the session to be active and sets up the user.
@@ -495,8 +561,8 @@ export declare abstract class ParaCore implements CoreInterface {
495
561
  * @param {boolean} [opts.skipSessionRefresh] whether to skip refreshing the session.
496
562
  * @returns {Object} `{ isComplete: boolean; isError: boolean; needsWallet: boolean; partnerId: string; }` the result data
497
563
  **/
498
- waitForLogin(args: CoreMethodParams<'waitForLogin'>): CoreMethodResponse<'waitForLogin'>;
499
- protected waitForWalletSwitching(args: CoreMethodParams<'waitForLogin'>): CoreMethodResponse<'waitForLogin'>;
564
+ waitForLogin(params: WaitForLoginParams): Promise<WaitForLoginResponse>;
565
+ protected waitForWalletSwitching(args: WaitForLoginParams): Promise<WaitForLoginResponse>;
500
566
  /**
501
567
  * Gets the switch wallets URL for wallet selection.
502
568
  * The authMethod is automatically included in the URL if available.
@@ -512,20 +578,21 @@ export declare abstract class ParaCore implements CoreInterface {
512
578
  * @param {boolean} [shouldOpenPopup] - if `true`, the running device will open a popup to reauthenticate the user.
513
579
  * @returns a URL for the user to reauthenticate.
514
580
  **/
515
- refreshSession({ shouldOpenPopup, }?: CoreMethodParams<'refreshSession'>): CoreMethodResponse<'refreshSession'>;
581
+ refreshSession(params?: RefreshSessionParams): Promise<string>;
516
582
  /**
517
583
  * Call this method after login to ensure that the user ID is set
518
584
  * internally.
519
585
  **/
520
- protected userSetupAfterLogin(): Promise<SessionInfo>;
586
+ protected userSetupAfterLogin(existingSession?: SessionInfo): Promise<SessionInfo>;
521
587
  /**
522
588
  * Get transmission shares associated with session.
523
589
  * @param {Object} opts the options object.
524
590
  * @param {boolean} opts.isForNewDevice - true if this device is registering.
525
591
  * @returns - transmission keyshares.
526
592
  **/
527
- protected getTransmissionKeyShares({ isForNewDevice }?: {
593
+ protected getTransmissionKeyShares({ isForNewDevice, sessionLookupId: existingSessionLookupId, }?: {
528
594
  isForNewDevice?: boolean;
595
+ sessionLookupId?: string;
529
596
  }): Promise<any>;
530
597
  /**
531
598
  * Call this method after login to perform setup.
@@ -546,17 +613,7 @@ export declare abstract class ParaCore implements CoreInterface {
546
613
  * @param {boolean} opts.forceRefreshRecovery whether or not to force recovery secret regeneration. Used when regenerating recovery shares.
547
614
  * @returns {string} the recovery share.
548
615
  **/
549
- distributeNewWalletShare({ walletId, userShare, skipBiometricShareCreation, forceRefresh, }: CoreMethodParams<'distributeNewWalletShare'>): CoreMethodResponse<'distributeNewWalletShare'>;
550
- private waitForWalletAddress;
551
- /**
552
- * Waits for a pregen wallet address to be created.
553
- *
554
- * @param pregenIdentifier - the identifier of the user the pregen wallet is associated with.
555
- * @param walletId - the wallet id
556
- * @param pregenIdentifierType - the identifier type of the user the pregen wallet is associated with.
557
- * @returns - recovery share.
558
- **/
559
- private waitForPregenWalletAddress;
616
+ distributeNewWalletShare(params: DistributeNewWalletShareParams): Promise<string>;
560
617
  /**
561
618
  * Creates several new wallets with the desired types. If no types are provided, this method
562
619
  * will create one for each of the non-optional types specified in the instance's `supportedWalletTypes`
@@ -565,7 +622,7 @@ export declare abstract class ParaCore implements CoreInterface {
565
622
  *
566
623
  * @deprecated alias for `createWalletPerType`
567
624
  **/
568
- createWalletPerMissingType: ({ skipDistribute, types, }?: CoreMethodParams<"createWalletPerType">) => CoreMethodResponse<"createWalletPerType">;
625
+ createWalletPerMissingType: (params?: CreateWalletPerTypeParams) => Promise<import("./services/types").CreateWalletPerTypeResponse>;
569
626
  /**
570
627
  * Creates several new wallets with the desired types. If no types are provided, this method
571
628
  * will create one for each of the non-optional types specified in the instance's `supportedWalletTypes`
@@ -577,7 +634,7 @@ export declare abstract class ParaCore implements CoreInterface {
577
634
  * @param {TWalletType[]} [opts.types] the types of wallets to create.
578
635
  * @returns {Object} the wallets created, their ids, and the recovery secret.
579
636
  **/
580
- createWalletPerType({ skipDistribute, types, }?: CoreMethodParams<'createWalletPerType'>): CoreMethodResponse<'createWalletPerType'>;
637
+ createWalletPerType(params?: CreateWalletPerTypeParams): Promise<import("./services/types").CreateWalletPerTypeResponse>;
581
638
  /**
582
639
  * Refresh the current user share for a wallet.
583
640
  *
@@ -590,7 +647,7 @@ export declare abstract class ParaCore implements CoreInterface {
590
647
  * @param {boolean} [opts.redistributeBackupEncryptedShares] whether or not to redistribute backup encrypted shares.
591
648
  * @returns {Object} the new user share and recovery secret.
592
649
  **/
593
- refreshShare({ walletId, share, oldPartnerId, newPartnerId, keyShareProtocolId, redistributeBackupEncryptedShares, }: CoreMethodParams<'refreshShare'>): CoreMethodResponse<'refreshShare'>;
650
+ refreshShare(params: RefreshShareParams): Promise<import("./services/types").RefreshShareResponse>;
594
651
  /**
595
652
  * Creates a new wallet.
596
653
  * @param {Object} opts the options object.
@@ -598,8 +655,17 @@ export declare abstract class ParaCore implements CoreInterface {
598
655
  * @param {boolean} opts.skipDistribute - if true, recovery share will not be distributed.
599
656
  * @returns {[Wallet, string | null]} `[wallet, recoveryShare]` - the wallet object and the new recovery share.
600
657
  **/
601
- createWallet({ type: _type, skipDistribute, }?: CoreMethodParams<'createWallet'>): CoreMethodResponse<'createWallet'>;
602
- createPregenWallet(opts: CoreMethodParams<'createPregenWallet'>): CoreMethodResponse<'createPregenWallet'>;
658
+ createWallet(params?: CreateWalletParams): Promise<import("./services/types").CreateWalletResponse>;
659
+ /**
660
+ * Creates a new pregenerated wallet.
661
+ *
662
+ * @param {Object} opts the options object.
663
+ * @param {string} opts.pregenIdentifier the identifier associated with the new wallet.
664
+ * @param {TPregenIdentifierType} [opts.pregenIdentifierType] the identifier type. Defaults to `EMAIL`.
665
+ * @param {TWalletType} [opts.type] the type of wallet to create. Defaults to the first non-optional type in the instance's `supportedWalletTypes` array.
666
+ * @returns {Wallet} the created wallet.
667
+ **/
668
+ createPregenWallet(params: CreatePregenWalletParams): Promise<Wallet>;
603
669
  /**
604
670
  * Creates new pregenerated wallets for each desired type.
605
671
  * If no types are provided, this method will create one for each of the non-optional types
@@ -610,7 +676,7 @@ export declare abstract class ParaCore implements CoreInterface {
610
676
  * @param {TWalletType[]} [opts.types] the wallet types to create. Defaults to any types the instance supports that are not already present.
611
677
  * @returns {Wallet[]} an array containing the created wallets.
612
678
  **/
613
- createPregenWalletPerType({ types, pregenId, }: CoreMethodParams<'createPregenWalletPerType'>): CoreMethodResponse<'createPregenWalletPerType'>;
679
+ createPregenWalletPerType(params: CreatePregenWalletPerTypeParams): Promise<import("./services/types").CreatePregenWalletPerTypeResponse>;
614
680
  /**
615
681
  * Claims a pregenerated wallet.
616
682
  * @param {Object} opts the options object.
@@ -618,7 +684,7 @@ export declare abstract class ParaCore implements CoreInterface {
618
684
  * @param {TPregenIdentifierType} opts.pregenIdentifierType type of the identifier of the user claiming the wallet
619
685
  * @returns {[Wallet, string | null]} `[wallet, recoveryShare]` - the wallet object and the new recovery share.
620
686
  **/
621
- claimPregenWallets({ pregenId, }?: CoreMethodParams<'claimPregenWallets'>): CoreMethodResponse<'claimPregenWallets'>;
687
+ claimPregenWallets(params?: ClaimPregenWalletsParams): Promise<string>;
622
688
  /**
623
689
  * Updates the identifier for a pregen wallet.
624
690
  * @param {Object} opts the options object.
@@ -626,7 +692,7 @@ export declare abstract class ParaCore implements CoreInterface {
626
692
  * @param {string} opts.newPregenIdentifier the new identtifier
627
693
  * @param {TPregenIdentifierType} opts.newPregenIdentifierType: the new identifier type
628
694
  **/
629
- updatePregenWalletIdentifier({ walletId, newPregenId, }: CoreMethodParams<'updatePregenWalletIdentifier'>): CoreMethodResponse<'updatePregenWalletIdentifier'>;
695
+ updatePregenWalletIdentifier(params: UpdatePregenWalletIdentifierParams): Promise<void>;
630
696
  /**
631
697
  * Checks if a pregen Wallet exists for the given identifier with the current partner.
632
698
  * @param {Object} opts the options object.
@@ -634,7 +700,7 @@ export declare abstract class ParaCore implements CoreInterface {
634
700
  * @param {TPregenIdentifierType} opts.pregenIdentifierType type of the string of the identifier of the user claiming the wallet
635
701
  * @returns {boolean} whether the pregen wallet exists
636
702
  **/
637
- hasPregenWallet({ pregenId }: CoreMethodParams<'hasPregenWallet'>): CoreMethodResponse<'hasPregenWallet'>;
703
+ hasPregenWallet(params: HasPregenWalletParams): Promise<boolean>;
638
704
  /**
639
705
  * Get pregen wallets for the given identifier.
640
706
  * @param {Object} opts the options object.
@@ -642,22 +708,21 @@ export declare abstract class ParaCore implements CoreInterface {
642
708
  * @param {TPregenIdentifierType} opts.pregenIdentifierType - type of the identifier of the user claiming the wallet
643
709
  * @returns {Promise<WalletEntity[]>} the array of found wallets
644
710
  **/
645
- getPregenWallets({ pregenId }?: CoreMethodParams<'getPregenWallets'>): CoreMethodResponse<'getPregenWallets'>;
646
- createGuestWallets(): CoreMethodResponse<'createGuestWallets'>;
647
- private encodeWalletBase64;
711
+ getPregenWallets(params?: GetPregenWalletsParams): Promise<import("./services/types").GetPregenWalletsResponse>;
712
+ createGuestWallets(): Promise<import("./services/types").CreateGuestWalletsResponse>;
648
713
  /**
649
714
  * Encodes the current wallets encoded in Base 64.
650
715
  * @returns {string} the encoded wallet string
651
716
  **/
652
- getUserShare(): CoreMethodResponse<'getUserShare'>;
717
+ getUserShare(): string;
653
718
  /**
654
719
  * Sets the current wallets from a Base 64 string.
655
720
  * @param {string} base64Wallet the encoded wallet string
656
721
  **/
657
- setUserShare(base64Wallets: CoreMethodParams<'setUserShare'>): CoreMethodResponse<'setUserShare'>;
722
+ setUserShare(base64Wallets: string): Promise<void>;
658
723
  private getTransactionReviewUrl;
659
724
  private getOnRampTransactionUrl;
660
- getWalletBalance: ({ walletId, rpcUrl, }: CoreMethodParams<"getWalletBalance">) => CoreMethodResponse<"getWalletBalance">;
725
+ getWalletBalance(params: GetWalletBalanceParams): Promise<string>;
661
726
  /**
662
727
  * Signs a message using one of the current wallets.
663
728
  *
@@ -709,8 +774,8 @@ export declare abstract class ParaCore implements CoreInterface {
709
774
  * Retrieves a token to verify the current session.
710
775
  * @returns {Promise<string>} the ID
711
776
  **/
712
- getVerificationToken(): CoreMethodResponse<'getVerificationToken'>;
713
- issueJwt({ keyIndex }?: CoreMethodParams<'issueJwt'>): CoreMethodResponse<'issueJwt'>;
777
+ getVerificationToken(): Promise<string>;
778
+ issueJwt(params?: IssueJwtParams): Promise<import("./services/types").IssueJwtResponse>;
714
779
  /**
715
780
  * Logs the user out.
716
781
  * @param {Object} opts the options object.
@@ -719,6 +784,13 @@ export declare abstract class ParaCore implements CoreInterface {
719
784
  logout({ clearPregenWallets }?: {
720
785
  clearPregenWallets?: boolean;
721
786
  }): Promise<void>;
787
+ /**
788
+ * Cancels any in-progress authentication flow, returning the auth state machine
789
+ * to its initial unauthenticated state. Does not affect existing sessions or stored data.
790
+ *
791
+ * Resolves once the auth state machine has settled back to `unauthenticated`.
792
+ */
793
+ cancelAuthFlow(): Promise<void>;
722
794
  protected get toStringAdditions(): Record<string, unknown>;
723
795
  /**
724
796
  * Converts to a string, removing sensitive data when logging this class.
@@ -727,11 +799,8 @@ export declare abstract class ParaCore implements CoreInterface {
727
799
  **/
728
800
  toString(): string;
729
801
  protected devLog(...s: any[]): void;
730
- protected getNewCredentialAndUrl({ authMethod: optsAuthMethod, isForNewDevice, portalTheme, shorten, }?: NewCredentialUrlParams): Promise<{
731
- credentialId: string;
732
- url?: string;
733
- }>;
734
- addCredential({ authMethod }: Pick<NewCredentialUrlParams, 'authMethod'>): Promise<string>;
802
+ protected getNewCredentialAndUrl(params?: GetNewCredentialAndUrlParams): Promise<GetNewCredentialAndUrlResponse>;
803
+ addCredential: (params: AddCredentialParams) => Promise<string>;
735
804
  /**
736
805
  * Returns a Para Portal URL for logging in with a WebAuth passkey, password, PIN or OTP.
737
806
  * @param {Object} opts the options object
@@ -740,16 +809,18 @@ export declare abstract class ParaCore implements CoreInterface {
740
809
  * @param {Theme} opts.portalTheme the Para Portal theme to apply to the password creation URL, if other than the default theme
741
810
  * @returns {SignUpOrLogInResponse} an object in the form of either: `{ stage: 'verify' }` or `{ stage: 'login'; passkeyUrl?: string; passwordUrl?: string; biometricHints?: BiometricLocationHint[] }`
742
811
  */
743
- protected getLoginUrl({ authMethod, shorten, portalTheme, sessionId, }: LoginUrlParams): Promise<string>;
744
- protected prepareLogin(): InternalMethodResponse<'prepareLogin'>;
745
- signUpOrLogIn({ auth, ...urlOptions }: CoreMethodParams<'signUpOrLogIn'>): CoreMethodResponse<'signUpOrLogIn'>;
746
- verifyNewAccount({ verificationCode, ...urlOptions }: CoreMethodParams<'verifyNewAccount'>): CoreMethodResponse<'verifyNewAccount'>;
812
+ protected getLoginUrl(params: GetLoginUrlParams): Promise<string>;
813
+ protected prepareLogin(): Promise<string>;
814
+ signUpOrLogIn(params: SignUpOrLogInParams): Promise<import("./services/types").SignUpOrLogInResponse>;
815
+ authenticateWithEmailOrPhone(params: AuthenticateWithEmailOrPhoneParams): Promise<import("./services/types").AuthenticateResponse>;
816
+ authenticateWithOAuth(params: AuthenticateWithOAuthParams): Promise<import("./services/types").AuthenticateResponse>;
817
+ verifyNewAccount(params: VerifyNewAccountParams): Promise<import("./types/authState.js").AuthStateSignup>;
747
818
  getLinkedAccounts({ withMetadata, }?: CoreMethodParams<'getLinkedAccounts'>): CoreMethodResponse<'getLinkedAccounts'>;
748
819
  protected linkAccount(opts: InternalMethodParams<'linkAccount'>): InternalMethodResponse<'linkAccount'>;
749
820
  protected unlinkAccount({ linkedAccountId, }: InternalMethodParams<'unlinkAccount'>): InternalMethodResponse<'unlinkAccount'>;
750
821
  protected verifyLink({ accountLinkInProgress, ...opts }?: {
751
822
  accountLinkInProgress?: AccountLinkInProgress;
752
- } & Partial<Pick<VerifyLinkParams, 'verificationCode' | 'telegramAuthResponse'> & VerifyExternalWalletParams>): Promise<LinkedAccounts>;
823
+ } & Partial<Pick<VerifyLinkParams, 'verificationCode' | 'telegramAuthResponse'> & VerifyExternalWalletParamsServer>): Promise<LinkedAccounts>;
753
824
  protected verifyEmailOrPhoneLink({ verificationCode, }: InternalMethodParams<'verifyEmailOrPhoneLink'>): InternalMethodResponse<'verifyEmailOrPhoneLink'>;
754
825
  protected getProfileBalance({ config, refetch }?: {
755
826
  config?: BalancesConfig;