@getpara/core-sdk 2.12.0 → 2.14.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.
- package/dist/cjs/ParaCore.js +805 -1999
- package/dist/cjs/constants.js +4 -1
- package/dist/cjs/services/AuthService.js +787 -0
- package/dist/cjs/services/BaseAuthFlowService.js +78 -0
- package/dist/cjs/services/ExternalWalletService.js +386 -0
- package/dist/cjs/services/LoginFlowService.js +163 -0
- package/dist/cjs/services/PollingService.js +448 -0
- package/dist/cjs/services/PortalUrlService.js +379 -0
- package/dist/cjs/services/PregenWalletService.js +442 -0
- package/dist/cjs/services/SessionManagementService.js +280 -0
- package/dist/cjs/services/SignupFlowService.js +185 -0
- package/dist/cjs/services/VerificationFlowService.js +242 -0
- package/dist/cjs/services/WalletService.js +577 -0
- package/dist/cjs/services/types/AuthServiceTypes.js +15 -0
- package/dist/cjs/services/types/BaseAuthFlowServiceTypes.js +15 -0
- package/dist/cjs/services/types/ExternalWalletServiceTypes.js +15 -0
- package/dist/cjs/services/types/LoginFlowServiceTypes.js +15 -0
- package/dist/cjs/services/types/PollingServiceTypes.js +15 -0
- package/dist/cjs/services/types/PortalUrlServiceTypes.js +15 -0
- package/dist/cjs/services/types/PregenWalletServiceTypes.js +15 -0
- package/dist/cjs/services/types/SessionManagementServiceTypes.js +15 -0
- package/dist/cjs/services/types/SignupFlowServiceTypes.js +15 -0
- package/dist/cjs/services/types/VerificationFlowServiceTypes.js +15 -0
- package/dist/cjs/services/types/WalletServiceTypes.js +15 -0
- package/dist/cjs/services/types/index.js +15 -0
- package/dist/cjs/state/CoreStateManager.js +301 -0
- package/dist/cjs/state/actors/authenticateWithEmailOrPhone.js +50 -0
- package/dist/cjs/state/actors/authenticateWithExternalWallet.js +50 -0
- package/dist/cjs/state/actors/authenticateWithFarcaster.js +50 -0
- package/dist/cjs/state/actors/authenticateWithFarcasterLegacy.js +50 -0
- package/dist/cjs/state/actors/authenticateWithTelegram.js +50 -0
- package/dist/cjs/state/actors/authenticateWithTelegramLegacy.js +50 -0
- package/dist/cjs/state/actors/checkUserState.js +53 -0
- package/dist/cjs/state/actors/claimWallets.js +56 -0
- package/dist/cjs/state/actors/connectExternalConnectors.js +54 -0
- package/dist/cjs/state/actors/connectExternalWallet.js +50 -0
- package/dist/cjs/state/actors/createGuestWallets.js +50 -0
- package/dist/cjs/state/actors/createWallets.js +73 -0
- package/dist/cjs/state/actors/polling.js +91 -0
- package/dist/cjs/state/actors/processAuthentication.js +50 -0
- package/dist/cjs/state/actors/setupAfterLogin.js +52 -0
- package/dist/cjs/state/actors/setupPara.js +50 -0
- package/dist/cjs/state/actors/signExternalWalletVerification.js +79 -0
- package/dist/cjs/state/actors/switchExternalWallet.js +50 -0
- package/dist/cjs/state/actors/verifyExternalWallet.js +50 -0
- package/dist/cjs/state/actors/verifyNewAccount.js +50 -0
- package/dist/cjs/state/actors/waitForExternalWalletProviders.js +54 -0
- package/dist/cjs/state/machines/authStateMachine.helpers.js +137 -0
- package/dist/cjs/state/machines/authStateMachine.js +1084 -0
- package/dist/cjs/state/machines/coreStateMachine.js +383 -0
- package/dist/cjs/state/machines/walletStateMachine.js +456 -0
- package/dist/cjs/state/types/auth.js +15 -0
- package/dist/cjs/state/types/core.js +15 -0
- package/dist/cjs/state/types/wallet.js +15 -0
- package/dist/cjs/types/{auth.js → accountLinking.js} +3 -3
- package/dist/cjs/types/authState.js +15 -0
- package/dist/cjs/types/coreApi.js +3 -1
- package/dist/cjs/types/index.js +2 -2
- package/dist/cjs/types/serviceInterfaces.js +15 -0
- package/dist/cjs/types/util.js +15 -0
- package/dist/cjs/utils/formatting.js +6 -0
- package/dist/cjs/utils/retryBackoff.js +30 -0
- package/dist/cjs/utils/stateErrorHelpers.js +60 -0
- package/dist/cjs/utils/stateListener.js +129 -0
- package/dist/esm/ParaCore.js +808 -2026
- package/dist/esm/constants.js +3 -1
- package/dist/esm/services/AuthService.js +717 -0
- package/dist/esm/services/BaseAuthFlowService.js +25 -0
- package/dist/esm/services/ExternalWalletService.js +327 -0
- package/dist/esm/services/LoginFlowService.js +97 -0
- package/dist/esm/services/PollingService.js +389 -0
- package/dist/esm/services/PortalUrlService.js +320 -0
- package/dist/esm/services/PregenWalletService.js +393 -0
- package/dist/esm/services/SessionManagementService.js +236 -0
- package/dist/esm/services/SignupFlowService.js +119 -0
- package/dist/esm/services/VerificationFlowService.js +178 -0
- package/dist/esm/services/WalletService.js +514 -0
- package/dist/esm/services/types/AuthServiceTypes.js +0 -0
- package/dist/esm/services/types/BaseAuthFlowServiceTypes.js +0 -0
- package/dist/esm/services/types/ExternalWalletServiceTypes.js +0 -0
- package/dist/esm/services/types/LoginFlowServiceTypes.js +0 -0
- package/dist/esm/services/types/PollingServiceTypes.js +0 -0
- package/dist/esm/services/types/PortalUrlServiceTypes.js +0 -0
- package/dist/esm/services/types/PregenWalletServiceTypes.js +0 -0
- package/dist/esm/services/types/SessionManagementServiceTypes.js +0 -0
- package/dist/esm/services/types/SignupFlowServiceTypes.js +0 -0
- package/dist/esm/services/types/VerificationFlowServiceTypes.js +0 -0
- package/dist/esm/services/types/WalletServiceTypes.js +0 -0
- package/dist/esm/services/types/index.js +0 -0
- package/dist/esm/state/CoreStateManager.js +265 -0
- package/dist/esm/state/actors/authenticateWithEmailOrPhone.js +10 -0
- package/dist/esm/state/actors/authenticateWithExternalWallet.js +10 -0
- package/dist/esm/state/actors/authenticateWithFarcaster.js +10 -0
- package/dist/esm/state/actors/authenticateWithFarcasterLegacy.js +10 -0
- package/dist/esm/state/actors/authenticateWithTelegram.js +10 -0
- package/dist/esm/state/actors/authenticateWithTelegramLegacy.js +10 -0
- package/dist/esm/state/actors/checkUserState.js +13 -0
- package/dist/esm/state/actors/claimWallets.js +16 -0
- package/dist/esm/state/actors/connectExternalConnectors.js +14 -0
- package/dist/esm/state/actors/connectExternalWallet.js +10 -0
- package/dist/esm/state/actors/createGuestWallets.js +10 -0
- package/dist/esm/state/actors/createWallets.js +20 -0
- package/dist/esm/state/actors/polling.js +55 -0
- package/dist/esm/state/actors/processAuthentication.js +10 -0
- package/dist/esm/state/actors/setupAfterLogin.js +12 -0
- package/dist/esm/state/actors/setupPara.js +10 -0
- package/dist/esm/state/actors/signExternalWalletVerification.js +15 -0
- package/dist/esm/state/actors/switchExternalWallet.js +10 -0
- package/dist/esm/state/actors/verifyExternalWallet.js +10 -0
- package/dist/esm/state/actors/verifyNewAccount.js +10 -0
- package/dist/esm/state/actors/waitForExternalWalletProviders.js +14 -0
- package/dist/esm/state/machines/authStateMachine.helpers.js +92 -0
- package/dist/esm/state/machines/authStateMachine.js +1039 -0
- package/dist/esm/state/machines/coreStateMachine.js +343 -0
- package/dist/esm/state/machines/walletStateMachine.js +401 -0
- package/dist/esm/state/types/auth.js +0 -0
- package/dist/esm/state/types/core.js +0 -0
- package/dist/esm/state/types/wallet.js +0 -0
- package/dist/esm/types/authState.js +0 -0
- package/dist/esm/types/coreApi.js +3 -1
- package/dist/esm/types/index.js +1 -1
- package/dist/esm/types/serviceInterfaces.js +0 -0
- package/dist/esm/types/util.js +0 -0
- package/dist/esm/utils/formatting.js +6 -0
- package/dist/esm/utils/retryBackoff.js +7 -0
- package/dist/esm/utils/stateErrorHelpers.js +37 -0
- package/dist/esm/utils/stateListener.js +106 -0
- package/dist/types/ParaCore.d.ts +191 -119
- package/dist/types/PlatformUtils.d.ts +23 -0
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/index.d.ts +4 -2
- package/dist/types/services/AuthService.d.ts +72 -0
- package/dist/types/services/BaseAuthFlowService.d.ts +28 -0
- package/dist/types/services/ExternalWalletService.d.ts +44 -0
- package/dist/types/services/LoginFlowService.d.ts +9 -0
- package/dist/types/services/PollingService.d.ts +35 -0
- package/dist/types/services/PortalUrlService.d.ts +26 -0
- package/dist/types/services/PregenWalletService.d.ts +38 -0
- package/dist/types/services/SessionManagementService.d.ts +28 -0
- package/dist/types/services/SignupFlowService.d.ts +10 -0
- package/dist/types/services/VerificationFlowService.d.ts +17 -0
- package/dist/types/services/WalletService.d.ts +54 -0
- package/dist/types/services/types/AuthServiceTypes.d.ts +147 -0
- package/dist/types/services/types/BaseAuthFlowServiceTypes.d.ts +4 -0
- package/dist/types/services/types/ExternalWalletServiceTypes.d.ts +67 -0
- package/dist/types/services/types/LoginFlowServiceTypes.d.ts +19 -0
- package/dist/types/services/types/PollingServiceTypes.d.ts +82 -0
- package/dist/types/services/types/PortalUrlServiceTypes.d.ts +46 -0
- package/dist/types/services/types/PregenWalletServiceTypes.d.ts +73 -0
- package/dist/types/services/types/SessionManagementServiceTypes.d.ts +27 -0
- package/dist/types/services/types/SignupFlowServiceTypes.d.ts +18 -0
- package/dist/types/services/types/VerificationFlowServiceTypes.d.ts +90 -0
- package/dist/types/services/types/WalletServiceTypes.d.ts +109 -0
- package/dist/types/services/types/index.d.ts +11 -0
- package/dist/types/state/CoreStateManager.d.ts +36 -0
- package/dist/types/state/actors/authenticateWithEmailOrPhone.d.ts +8 -0
- package/dist/types/state/actors/authenticateWithExternalWallet.d.ts +8 -0
- package/dist/types/state/actors/authenticateWithFarcaster.d.ts +3 -0
- package/dist/types/state/actors/authenticateWithFarcasterLegacy.d.ts +3 -0
- package/dist/types/state/actors/authenticateWithTelegram.d.ts +3 -0
- package/dist/types/state/actors/authenticateWithTelegramLegacy.d.ts +8 -0
- package/dist/types/state/actors/checkUserState.d.ts +6 -0
- package/dist/types/state/actors/claimWallets.d.ts +8 -0
- package/dist/types/state/actors/connectExternalConnectors.d.ts +4 -0
- package/dist/types/state/actors/connectExternalWallet.d.ts +3 -0
- package/dist/types/state/actors/createGuestWallets.d.ts +3 -0
- package/dist/types/state/actors/createWallets.d.ts +10 -0
- package/dist/types/state/actors/polling.d.ts +3 -0
- package/dist/types/state/actors/processAuthentication.d.ts +10 -0
- package/dist/types/state/actors/setupAfterLogin.d.ts +5 -0
- package/dist/types/state/actors/setupPara.d.ts +2 -0
- package/dist/types/state/actors/signExternalWalletVerification.d.ts +7 -0
- package/dist/types/state/actors/switchExternalWallet.d.ts +3 -0
- package/dist/types/state/actors/verifyExternalWallet.d.ts +8 -0
- package/dist/types/state/actors/verifyNewAccount.d.ts +8 -0
- package/dist/types/state/actors/waitForExternalWalletProviders.d.ts +2 -0
- package/dist/types/state/machines/authStateMachine.d.ts +2570 -0
- package/dist/types/state/machines/authStateMachine.helpers.d.ts +57 -0
- package/dist/types/state/machines/coreStateMachine.d.ts +22075 -0
- package/dist/types/state/machines/walletStateMachine.d.ts +1056 -0
- package/dist/types/state/types/auth.d.ts +113 -0
- package/dist/types/state/types/core.d.ts +116 -0
- package/dist/types/state/types/wallet.d.ts +76 -0
- package/dist/types/types/authState.d.ts +66 -0
- package/dist/types/types/config.d.ts +5 -0
- package/dist/types/types/coreApi.d.ts +148 -298
- package/dist/types/types/index.d.ts +3 -1
- package/dist/types/types/methods.d.ts +1 -191
- package/dist/types/types/serviceInterfaces.d.ts +125 -0
- package/dist/types/types/util.d.ts +43 -0
- package/dist/types/types/wallet.d.ts +3 -1
- package/dist/types/utils/retryBackoff.d.ts +2 -0
- package/dist/types/utils/stateErrorHelpers.d.ts +2 -0
- package/dist/types/utils/stateListener.d.ts +47 -0
- package/package.json +5 -4
- /package/dist/esm/types/{auth.js → accountLinking.js} +0 -0
- /package/dist/types/types/{auth.d.ts → accountLinking.d.ts} +0 -0
package/dist/types/ParaCore.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { AuthMethod, AuthExtras, CurrentWalletIds, EmailTheme, PartnerEntity, TWalletType, PregenIds, BiometricLocationHint, Auth, SupportedWalletTypes, AuthIdentifier, AuthType, ExternalWalletInfo,
|
|
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,
|
|
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
|
-
|
|
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
|
|
101
|
+
get userId(): string | undefined;
|
|
24
102
|
accountLinkInProgress: AccountLinkInProgress | undefined;
|
|
25
|
-
|
|
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(
|
|
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(
|
|
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,16 @@ 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
|
+
private initializeServices;
|
|
273
|
+
initExternalWalletProvider: (params: InitExternalWalletProviderParams) => Promise<void>;
|
|
274
|
+
getAuthServiceInterface(): AuthServiceInterface;
|
|
275
|
+
getWalletServiceInterface(): WalletServiceInterface;
|
|
276
|
+
getPregenWalletServiceInterface(): PregenWalletServiceInterface;
|
|
277
|
+
getPortalUrlServiceInterface(): PortalUrlServiceInterface;
|
|
278
|
+
getSessionManagementServiceInterface(): SessionManagementServiceInterface;
|
|
279
|
+
getStateMachineInterface(): StateMachineInterface;
|
|
280
|
+
getExternalWalletServiceInterface(): ExternalWalletServiceInterface;
|
|
281
|
+
getPollingServiceInterface(): PollingServiceInterface;
|
|
212
282
|
private trackError;
|
|
213
283
|
private wrapMethodsWithErrorTracking;
|
|
214
284
|
private initializeFromStorage;
|
|
@@ -236,7 +306,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
236
306
|
*
|
|
237
307
|
* This method will be called automatically if you use the React `ParaProvider` or when you call any methods that request an updated session.
|
|
238
308
|
*/
|
|
239
|
-
abstract
|
|
309
|
+
abstract setup(): Promise<void>;
|
|
240
310
|
protected setAuth(auth: PrimaryAuth, { extras, userId }?: {
|
|
241
311
|
extras?: AuthExtras;
|
|
242
312
|
userId?: string;
|
|
@@ -246,11 +316,6 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
246
316
|
* @internal
|
|
247
317
|
*/
|
|
248
318
|
protected displayModalError(error?: string): void;
|
|
249
|
-
/**
|
|
250
|
-
* Handle specific touchSession errors with user-friendly messages
|
|
251
|
-
* @private
|
|
252
|
-
*/
|
|
253
|
-
private handleTouchSessionError;
|
|
254
319
|
protected assertUserId({ allowGuestMode }?: {
|
|
255
320
|
allowGuestMode?: boolean;
|
|
256
321
|
}): string;
|
|
@@ -292,7 +357,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
292
357
|
* Sets the wallets associated with the `ParaCore` instance.
|
|
293
358
|
* @param wallets - Wallets to set.
|
|
294
359
|
*/
|
|
295
|
-
setWallets(wallets:
|
|
360
|
+
setWallets(wallets: SetWalletsParams): Promise<void>;
|
|
296
361
|
/**
|
|
297
362
|
* Sets the external wallets associated with the `ParaCore` instance.
|
|
298
363
|
* @param externalWallets - External wallets to set, or a function that modifies the current wallets.
|
|
@@ -325,11 +390,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
325
390
|
* @returns - farcaster username associated with the `ParaCore` instance.
|
|
326
391
|
*/
|
|
327
392
|
getFarcasterUsername(): string | undefined;
|
|
328
|
-
setCurrentWalletIds(
|
|
329
|
-
needsWallet?: boolean;
|
|
330
|
-
sessionLookupId?: string;
|
|
331
|
-
newDeviceSessionLookupId?: string;
|
|
332
|
-
}): Promise<void>;
|
|
393
|
+
setCurrentWalletIds: (...params: SetCurrentWalletIdsParams) => Promise<void>;
|
|
333
394
|
/**
|
|
334
395
|
* Fetches the most recent OAuth account metadata for the signed-in user.
|
|
335
396
|
* 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 +405,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
344
405
|
* @param {WalletFilters} [filter={}] a `WalletFilters` object specifying allowed types, schemes, and whether to forbid unclaimed pregen wallets.
|
|
345
406
|
* @returns {string} the wallet ID originally passed, or the one found.
|
|
346
407
|
*/
|
|
347
|
-
findWalletId(
|
|
408
|
+
findWalletId: (...params: FindWalletIdParams) => string;
|
|
348
409
|
/**
|
|
349
410
|
* Retrieves a wallet with the given address, if present.
|
|
350
411
|
* If no ID is passed, this will instead return the first valid, usable wallet ID that matches the filters.
|
|
@@ -352,20 +413,16 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
352
413
|
* @param {WalletFilters} [filter={}] a `WalletFilters` object specifying allowed types, schemes, and whether to forbid unclaimed pregen wallets.
|
|
353
414
|
* @returns {string} the wallet ID originally passed, or the one found.
|
|
354
415
|
*/
|
|
355
|
-
findWalletByAddress(
|
|
356
|
-
findWallet(
|
|
416
|
+
findWalletByAddress(...params: FindWalletByAddressParams): Wallet;
|
|
417
|
+
findWallet(...params: FindWalletParams): import("./types/wallet.js").WalletNoSigner;
|
|
357
418
|
get availableWallets(): AvailableWallet[];
|
|
358
419
|
/**
|
|
359
420
|
* Retrieves all usable wallets with the provided type (`'EVM' | 'COSMOS' | 'SOLANA'`)
|
|
360
421
|
* @param {string} type the wallet type to filter by.
|
|
361
422
|
* @returns {Wallet[]} an array of matching wallets.
|
|
362
423
|
*/
|
|
363
|
-
getWalletsByType(type:
|
|
364
|
-
|
|
365
|
-
private assertIsValidWalletType;
|
|
366
|
-
private getMissingTypes;
|
|
367
|
-
private getTypesToCreate;
|
|
368
|
-
private getPartnerURL;
|
|
424
|
+
getWalletsByType(type: GetWalletsByTypeParams): Wallet[];
|
|
425
|
+
getPartner(partnerId: string): Promise<PartnerEntity>;
|
|
369
426
|
/**
|
|
370
427
|
* URL of the portal, which can be associated with a partner id
|
|
371
428
|
* @param partnerId: string - id of the partner to get the portal URL for
|
|
@@ -382,9 +439,8 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
382
439
|
* Fetches the wallets associated with the user.
|
|
383
440
|
* @returns {WalletEntity[]} wallets that were fetched.
|
|
384
441
|
*/
|
|
385
|
-
fetchWallets():
|
|
442
|
+
fetchWallets(): Promise<import("@getpara/user-management-client").IWalletEntity[]>;
|
|
386
443
|
protected populateWalletAddresses(): Promise<void>;
|
|
387
|
-
private populatePregenWalletAddresses;
|
|
388
444
|
/**
|
|
389
445
|
* Logs in or creates a new user using an external wallet address.
|
|
390
446
|
* @param {Object} opts the options object
|
|
@@ -392,21 +448,24 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
392
448
|
* @param {TWalletType} opts.type type of external wallet to use for identification.
|
|
393
449
|
* @param {string} opts.provider the name of the provider for the external wallet.
|
|
394
450
|
*/
|
|
395
|
-
loginExternalWallet(
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
451
|
+
loginExternalWallet(params: LoginExternalWalletParams): Promise<import("./services/types").LoginExternalWalletResponse>;
|
|
452
|
+
/**
|
|
453
|
+
* Connects to an external wallet & logs in to Para (if applicable).
|
|
454
|
+
* @param {Object} params the params object
|
|
455
|
+
* @param {Function} params.connect the function called to connect to the external wallet.
|
|
456
|
+
*/
|
|
457
|
+
connectExternalWallet(params: ConnectExternalWalletParams): Promise<import("./services/types").ConnectExternalWalletResponse>;
|
|
458
|
+
verifyExternalWallet(params: VerifyExternalWalletParams): Promise<import("./services/types").VerifyExternalWalletResponse>;
|
|
459
|
+
retryVerifyExternalWallet(): Promise<import("./services/types").VerifyExternalWalletResponse>;
|
|
460
|
+
signExternalWalletVerification(params: ExternalSignMessageParams): Promise<import("./services/types").BaseVerifyExternalWalletParams>;
|
|
402
461
|
protected verifyExternalWalletLink(opts: InternalMethodParams<'verifyExternalWalletLink'>): InternalMethodResponse<'verifyExternalWalletLink'>;
|
|
403
|
-
protected verifyTelegramProcess(opts:
|
|
462
|
+
protected verifyTelegramProcess(opts: VerifyTelegramParams & {
|
|
404
463
|
isLinkAccount: false;
|
|
405
|
-
}):
|
|
464
|
+
}): Promise<OAuthResponse>;
|
|
406
465
|
protected verifyTelegramProcess(opts: InternalMethodParams<'verifyTelegramLink'> & {
|
|
407
466
|
isLinkAccount: true;
|
|
408
467
|
}): InternalMethodResponse<'verifyTelegramLink'>;
|
|
409
|
-
verifyTelegram(
|
|
468
|
+
verifyTelegram(params: VerifyTelegramParams): Promise<import("./types/authState.js").AuthStateSignupOrLoginOrDone>;
|
|
410
469
|
protected verifyTelegramLink(opts: InternalMethodParams<'verifyTelegramLink'>): InternalMethodResponse<'verifyTelegramLink'>;
|
|
411
470
|
/**
|
|
412
471
|
* Performs 2FA verification.
|
|
@@ -430,17 +489,17 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
430
489
|
/**
|
|
431
490
|
* Resend a verification email for the current user.
|
|
432
491
|
*/
|
|
433
|
-
resendVerificationCode({ type: reason
|
|
492
|
+
resendVerificationCode({ type: reason }: ResendVerificationCodeParams): Promise<void>;
|
|
434
493
|
/**
|
|
435
494
|
* Checks if the current session is active.
|
|
436
495
|
* @returns `true` if active, `false` otherwise
|
|
437
496
|
*/
|
|
438
|
-
isSessionActive():
|
|
497
|
+
isSessionActive(): Promise<boolean>;
|
|
439
498
|
/**
|
|
440
499
|
* Checks if a session is active and a wallet exists.
|
|
441
500
|
* @returns `true` if active, `false` otherwise
|
|
442
501
|
**/
|
|
443
|
-
isFullyLoggedIn():
|
|
502
|
+
isFullyLoggedIn(): Promise<boolean>;
|
|
444
503
|
get isGuestMode(): boolean;
|
|
445
504
|
/**
|
|
446
505
|
* Get the auth methods available to an existing user
|
|
@@ -460,8 +519,8 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
460
519
|
/**
|
|
461
520
|
* Waits for the session to be active.
|
|
462
521
|
**/
|
|
463
|
-
waitForSignup(
|
|
464
|
-
waitForWalletCreation(
|
|
522
|
+
waitForSignup(params: WaitForSignupParams): Promise<true>;
|
|
523
|
+
waitForWalletCreation(params: WaitForWalletCreationParams): Promise<import("./services/types").WaitForWalletCreationResponse>;
|
|
465
524
|
/**
|
|
466
525
|
* Initiates a Farcaster login attempt and returns the URL for the user to connect.
|
|
467
526
|
* You can create a QR code with this URI that works with Farcaster's mobile app.
|
|
@@ -469,23 +528,31 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
469
528
|
*/
|
|
470
529
|
getFarcasterConnectUri({ appScheme }?: {
|
|
471
530
|
appScheme?: string;
|
|
472
|
-
}):
|
|
473
|
-
protected verifyFarcasterProcess(
|
|
531
|
+
}): Promise<string>;
|
|
532
|
+
protected verifyFarcasterProcess(_: VerifyFarcasterParams & {
|
|
474
533
|
isLinkAccount: false;
|
|
475
|
-
}):
|
|
534
|
+
}): Promise<VerifyFarcasterResponse>;
|
|
476
535
|
protected verifyFarcasterProcess(opts: InternalMethodParams<'verifyFarcasterLink'> & {
|
|
477
536
|
isLinkAccount: true;
|
|
478
537
|
}): InternalMethodResponse<'verifyFarcasterLink'>;
|
|
479
|
-
verifyFarcaster(
|
|
538
|
+
verifyFarcaster(params: VerifyFarcasterParams): Promise<import("./types/authState.js").AuthStateSignupOrLoginOrDone>;
|
|
480
539
|
protected verifyFarcasterLink(opts: InternalMethodParams<'verifyFarcasterLink'>): InternalMethodResponse<'verifyFarcasterLink'>;
|
|
481
|
-
|
|
540
|
+
/**
|
|
541
|
+
* Generates a URL for the user to log in with OAuth using a desire method.
|
|
542
|
+
*
|
|
543
|
+
* @param {Object} opts the options object
|
|
544
|
+
* @param {TOAuthMethod} opts.method the third-party service to use for OAuth.
|
|
545
|
+
* @param {string} [opts.appScheme] the app scheme to redirect to after the OAuth flow. This is for mobile only.
|
|
546
|
+
* @returns {string} the URL for the user to log in with OAuth.
|
|
547
|
+
*/
|
|
548
|
+
getOAuthUrl(params: GetOAuthUrlParams): Promise<string>;
|
|
482
549
|
protected verifyOAuthProcess(_: InternalMethodParams<'verifyOAuthLink'> & {
|
|
483
550
|
isLinkAccount: true;
|
|
484
551
|
}): InternalMethodResponse<'verifyOAuthLink'>;
|
|
485
|
-
protected verifyOAuthProcess(_:
|
|
552
|
+
protected verifyOAuthProcess(_: VerifyOAuthProcessParams & {
|
|
486
553
|
isLinkAccount: false;
|
|
487
|
-
}):
|
|
488
|
-
verifyOAuth(
|
|
554
|
+
}): Promise<VerifyOAuthProcessResponse>;
|
|
555
|
+
verifyOAuth(params: VerifyOAuthProcessParams): Promise<VerifyOAuthProcessResponse>;
|
|
489
556
|
protected verifyOAuthLink(opts: InternalMethodParams<'verifyOAuthLink'>): InternalMethodResponse<'verifyOAuthLink'>;
|
|
490
557
|
/**
|
|
491
558
|
* Waits for the session to be active and sets up the user.
|
|
@@ -495,8 +562,8 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
495
562
|
* @param {boolean} [opts.skipSessionRefresh] whether to skip refreshing the session.
|
|
496
563
|
* @returns {Object} `{ isComplete: boolean; isError: boolean; needsWallet: boolean; partnerId: string; }` the result data
|
|
497
564
|
**/
|
|
498
|
-
waitForLogin(
|
|
499
|
-
protected waitForWalletSwitching(args:
|
|
565
|
+
waitForLogin(params: WaitForLoginParams): Promise<WaitForLoginResponse>;
|
|
566
|
+
protected waitForWalletSwitching(args: WaitForLoginParams): Promise<WaitForLoginResponse>;
|
|
500
567
|
/**
|
|
501
568
|
* Gets the switch wallets URL for wallet selection.
|
|
502
569
|
* The authMethod is automatically included in the URL if available.
|
|
@@ -512,20 +579,21 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
512
579
|
* @param {boolean} [shouldOpenPopup] - if `true`, the running device will open a popup to reauthenticate the user.
|
|
513
580
|
* @returns a URL for the user to reauthenticate.
|
|
514
581
|
**/
|
|
515
|
-
refreshSession(
|
|
582
|
+
refreshSession(params?: RefreshSessionParams): Promise<string>;
|
|
516
583
|
/**
|
|
517
584
|
* Call this method after login to ensure that the user ID is set
|
|
518
585
|
* internally.
|
|
519
586
|
**/
|
|
520
|
-
protected userSetupAfterLogin(): Promise<SessionInfo>;
|
|
587
|
+
protected userSetupAfterLogin(existingSession?: SessionInfo): Promise<SessionInfo>;
|
|
521
588
|
/**
|
|
522
589
|
* Get transmission shares associated with session.
|
|
523
590
|
* @param {Object} opts the options object.
|
|
524
591
|
* @param {boolean} opts.isForNewDevice - true if this device is registering.
|
|
525
592
|
* @returns - transmission keyshares.
|
|
526
593
|
**/
|
|
527
|
-
protected getTransmissionKeyShares({ isForNewDevice }?: {
|
|
594
|
+
protected getTransmissionKeyShares({ isForNewDevice, sessionLookupId: existingSessionLookupId, }?: {
|
|
528
595
|
isForNewDevice?: boolean;
|
|
596
|
+
sessionLookupId?: string;
|
|
529
597
|
}): Promise<any>;
|
|
530
598
|
/**
|
|
531
599
|
* Call this method after login to perform setup.
|
|
@@ -546,17 +614,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
546
614
|
* @param {boolean} opts.forceRefreshRecovery whether or not to force recovery secret regeneration. Used when regenerating recovery shares.
|
|
547
615
|
* @returns {string} the recovery share.
|
|
548
616
|
**/
|
|
549
|
-
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;
|
|
617
|
+
distributeNewWalletShare(params: DistributeNewWalletShareParams): Promise<string>;
|
|
560
618
|
/**
|
|
561
619
|
* Creates several new wallets with the desired types. If no types are provided, this method
|
|
562
620
|
* will create one for each of the non-optional types specified in the instance's `supportedWalletTypes`
|
|
@@ -565,7 +623,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
565
623
|
*
|
|
566
624
|
* @deprecated alias for `createWalletPerType`
|
|
567
625
|
**/
|
|
568
|
-
createWalletPerMissingType: (
|
|
626
|
+
createWalletPerMissingType: (params?: CreateWalletPerTypeParams) => Promise<import("./services/types").CreateWalletPerTypeResponse>;
|
|
569
627
|
/**
|
|
570
628
|
* Creates several new wallets with the desired types. If no types are provided, this method
|
|
571
629
|
* will create one for each of the non-optional types specified in the instance's `supportedWalletTypes`
|
|
@@ -577,7 +635,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
577
635
|
* @param {TWalletType[]} [opts.types] the types of wallets to create.
|
|
578
636
|
* @returns {Object} the wallets created, their ids, and the recovery secret.
|
|
579
637
|
**/
|
|
580
|
-
createWalletPerType(
|
|
638
|
+
createWalletPerType(params?: CreateWalletPerTypeParams): Promise<import("./services/types").CreateWalletPerTypeResponse>;
|
|
581
639
|
/**
|
|
582
640
|
* Refresh the current user share for a wallet.
|
|
583
641
|
*
|
|
@@ -590,7 +648,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
590
648
|
* @param {boolean} [opts.redistributeBackupEncryptedShares] whether or not to redistribute backup encrypted shares.
|
|
591
649
|
* @returns {Object} the new user share and recovery secret.
|
|
592
650
|
**/
|
|
593
|
-
refreshShare(
|
|
651
|
+
refreshShare(params: RefreshShareParams): Promise<import("./services/types").RefreshShareResponse>;
|
|
594
652
|
/**
|
|
595
653
|
* Creates a new wallet.
|
|
596
654
|
* @param {Object} opts the options object.
|
|
@@ -598,8 +656,17 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
598
656
|
* @param {boolean} opts.skipDistribute - if true, recovery share will not be distributed.
|
|
599
657
|
* @returns {[Wallet, string | null]} `[wallet, recoveryShare]` - the wallet object and the new recovery share.
|
|
600
658
|
**/
|
|
601
|
-
createWallet(
|
|
602
|
-
|
|
659
|
+
createWallet(params?: CreateWalletParams): Promise<import("./services/types").CreateWalletResponse>;
|
|
660
|
+
/**
|
|
661
|
+
* Creates a new pregenerated wallet.
|
|
662
|
+
*
|
|
663
|
+
* @param {Object} opts the options object.
|
|
664
|
+
* @param {string} opts.pregenIdentifier the identifier associated with the new wallet.
|
|
665
|
+
* @param {TPregenIdentifierType} [opts.pregenIdentifierType] the identifier type. Defaults to `EMAIL`.
|
|
666
|
+
* @param {TWalletType} [opts.type] the type of wallet to create. Defaults to the first non-optional type in the instance's `supportedWalletTypes` array.
|
|
667
|
+
* @returns {Wallet} the created wallet.
|
|
668
|
+
**/
|
|
669
|
+
createPregenWallet(params: CreatePregenWalletParams): Promise<Wallet>;
|
|
603
670
|
/**
|
|
604
671
|
* Creates new pregenerated wallets for each desired type.
|
|
605
672
|
* If no types are provided, this method will create one for each of the non-optional types
|
|
@@ -610,7 +677,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
610
677
|
* @param {TWalletType[]} [opts.types] the wallet types to create. Defaults to any types the instance supports that are not already present.
|
|
611
678
|
* @returns {Wallet[]} an array containing the created wallets.
|
|
612
679
|
**/
|
|
613
|
-
createPregenWalletPerType(
|
|
680
|
+
createPregenWalletPerType(params: CreatePregenWalletPerTypeParams): Promise<import("./services/types").CreatePregenWalletPerTypeResponse>;
|
|
614
681
|
/**
|
|
615
682
|
* Claims a pregenerated wallet.
|
|
616
683
|
* @param {Object} opts the options object.
|
|
@@ -618,7 +685,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
618
685
|
* @param {TPregenIdentifierType} opts.pregenIdentifierType type of the identifier of the user claiming the wallet
|
|
619
686
|
* @returns {[Wallet, string | null]} `[wallet, recoveryShare]` - the wallet object and the new recovery share.
|
|
620
687
|
**/
|
|
621
|
-
claimPregenWallets(
|
|
688
|
+
claimPregenWallets(params?: ClaimPregenWalletsParams): Promise<string>;
|
|
622
689
|
/**
|
|
623
690
|
* Updates the identifier for a pregen wallet.
|
|
624
691
|
* @param {Object} opts the options object.
|
|
@@ -626,7 +693,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
626
693
|
* @param {string} opts.newPregenIdentifier the new identtifier
|
|
627
694
|
* @param {TPregenIdentifierType} opts.newPregenIdentifierType: the new identifier type
|
|
628
695
|
**/
|
|
629
|
-
updatePregenWalletIdentifier(
|
|
696
|
+
updatePregenWalletIdentifier(params: UpdatePregenWalletIdentifierParams): Promise<void>;
|
|
630
697
|
/**
|
|
631
698
|
* Checks if a pregen Wallet exists for the given identifier with the current partner.
|
|
632
699
|
* @param {Object} opts the options object.
|
|
@@ -634,7 +701,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
634
701
|
* @param {TPregenIdentifierType} opts.pregenIdentifierType type of the string of the identifier of the user claiming the wallet
|
|
635
702
|
* @returns {boolean} whether the pregen wallet exists
|
|
636
703
|
**/
|
|
637
|
-
hasPregenWallet(
|
|
704
|
+
hasPregenWallet(params: HasPregenWalletParams): Promise<boolean>;
|
|
638
705
|
/**
|
|
639
706
|
* Get pregen wallets for the given identifier.
|
|
640
707
|
* @param {Object} opts the options object.
|
|
@@ -642,22 +709,21 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
642
709
|
* @param {TPregenIdentifierType} opts.pregenIdentifierType - type of the identifier of the user claiming the wallet
|
|
643
710
|
* @returns {Promise<WalletEntity[]>} the array of found wallets
|
|
644
711
|
**/
|
|
645
|
-
getPregenWallets(
|
|
646
|
-
createGuestWallets():
|
|
647
|
-
private encodeWalletBase64;
|
|
712
|
+
getPregenWallets(params?: GetPregenWalletsParams): Promise<import("./services/types").GetPregenWalletsResponse>;
|
|
713
|
+
createGuestWallets(): Promise<import("./services/types").CreateGuestWalletsResponse>;
|
|
648
714
|
/**
|
|
649
715
|
* Encodes the current wallets encoded in Base 64.
|
|
650
716
|
* @returns {string} the encoded wallet string
|
|
651
717
|
**/
|
|
652
|
-
getUserShare():
|
|
718
|
+
getUserShare(): string;
|
|
653
719
|
/**
|
|
654
720
|
* Sets the current wallets from a Base 64 string.
|
|
655
721
|
* @param {string} base64Wallet the encoded wallet string
|
|
656
722
|
**/
|
|
657
|
-
setUserShare(base64Wallets:
|
|
723
|
+
setUserShare(base64Wallets: string): Promise<void>;
|
|
658
724
|
private getTransactionReviewUrl;
|
|
659
725
|
private getOnRampTransactionUrl;
|
|
660
|
-
getWalletBalance
|
|
726
|
+
getWalletBalance(params: GetWalletBalanceParams): Promise<string>;
|
|
661
727
|
/**
|
|
662
728
|
* Signs a message using one of the current wallets.
|
|
663
729
|
*
|
|
@@ -709,8 +775,8 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
709
775
|
* Retrieves a token to verify the current session.
|
|
710
776
|
* @returns {Promise<string>} the ID
|
|
711
777
|
**/
|
|
712
|
-
getVerificationToken():
|
|
713
|
-
issueJwt(
|
|
778
|
+
getVerificationToken(): Promise<string>;
|
|
779
|
+
issueJwt(params?: IssueJwtParams): Promise<import("./services/types").IssueJwtResponse>;
|
|
714
780
|
/**
|
|
715
781
|
* Logs the user out.
|
|
716
782
|
* @param {Object} opts the options object.
|
|
@@ -719,6 +785,13 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
719
785
|
logout({ clearPregenWallets }?: {
|
|
720
786
|
clearPregenWallets?: boolean;
|
|
721
787
|
}): Promise<void>;
|
|
788
|
+
/**
|
|
789
|
+
* Cancels any in-progress authentication flow, returning the auth state machine
|
|
790
|
+
* to its initial unauthenticated state. Does not affect existing sessions or stored data.
|
|
791
|
+
*
|
|
792
|
+
* Resolves once the auth state machine has settled back to `unauthenticated`.
|
|
793
|
+
*/
|
|
794
|
+
cancelAuthFlow(): Promise<void>;
|
|
722
795
|
protected get toStringAdditions(): Record<string, unknown>;
|
|
723
796
|
/**
|
|
724
797
|
* Converts to a string, removing sensitive data when logging this class.
|
|
@@ -727,11 +800,8 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
727
800
|
**/
|
|
728
801
|
toString(): string;
|
|
729
802
|
protected devLog(...s: any[]): void;
|
|
730
|
-
protected getNewCredentialAndUrl(
|
|
731
|
-
|
|
732
|
-
url?: string;
|
|
733
|
-
}>;
|
|
734
|
-
addCredential({ authMethod }: Pick<NewCredentialUrlParams, 'authMethod'>): Promise<string>;
|
|
803
|
+
protected getNewCredentialAndUrl(params?: GetNewCredentialAndUrlParams): Promise<GetNewCredentialAndUrlResponse>;
|
|
804
|
+
addCredential: (params: AddCredentialParams) => Promise<string>;
|
|
735
805
|
/**
|
|
736
806
|
* Returns a Para Portal URL for logging in with a WebAuth passkey, password, PIN or OTP.
|
|
737
807
|
* @param {Object} opts the options object
|
|
@@ -740,16 +810,18 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
740
810
|
* @param {Theme} opts.portalTheme the Para Portal theme to apply to the password creation URL, if other than the default theme
|
|
741
811
|
* @returns {SignUpOrLogInResponse} an object in the form of either: `{ stage: 'verify' }` or `{ stage: 'login'; passkeyUrl?: string; passwordUrl?: string; biometricHints?: BiometricLocationHint[] }`
|
|
742
812
|
*/
|
|
743
|
-
protected getLoginUrl(
|
|
744
|
-
protected prepareLogin():
|
|
745
|
-
signUpOrLogIn(
|
|
746
|
-
|
|
813
|
+
protected getLoginUrl(params: GetLoginUrlParams): Promise<string>;
|
|
814
|
+
protected prepareLogin(): Promise<string>;
|
|
815
|
+
signUpOrLogIn(params: SignUpOrLogInParams): Promise<import("./services/types").SignUpOrLogInResponse>;
|
|
816
|
+
authenticateWithEmailOrPhone(params: AuthenticateWithEmailOrPhoneParams): Promise<import("./services/types").AuthenticateResponse>;
|
|
817
|
+
authenticateWithOAuth(params: AuthenticateWithOAuthParams): Promise<import("./services/types").AuthenticateResponse>;
|
|
818
|
+
verifyNewAccount(params: VerifyNewAccountParams): Promise<import("./types/authState.js").AuthStateSignup>;
|
|
747
819
|
getLinkedAccounts({ withMetadata, }?: CoreMethodParams<'getLinkedAccounts'>): CoreMethodResponse<'getLinkedAccounts'>;
|
|
748
820
|
protected linkAccount(opts: InternalMethodParams<'linkAccount'>): InternalMethodResponse<'linkAccount'>;
|
|
749
821
|
protected unlinkAccount({ linkedAccountId, }: InternalMethodParams<'unlinkAccount'>): InternalMethodResponse<'unlinkAccount'>;
|
|
750
822
|
protected verifyLink({ accountLinkInProgress, ...opts }?: {
|
|
751
823
|
accountLinkInProgress?: AccountLinkInProgress;
|
|
752
|
-
} & Partial<Pick<VerifyLinkParams, 'verificationCode' | 'telegramAuthResponse'> &
|
|
824
|
+
} & Partial<Pick<VerifyLinkParams, 'verificationCode' | 'telegramAuthResponse'> & VerifyExternalWalletParamsServer>): Promise<LinkedAccounts>;
|
|
753
825
|
protected verifyEmailOrPhoneLink({ verificationCode, }: InternalMethodParams<'verifyEmailOrPhoneLink'>): InternalMethodResponse<'verifyEmailOrPhoneLink'>;
|
|
754
826
|
protected getProfileBalance({ config, refetch }?: {
|
|
755
827
|
config?: BalancesConfig;
|