@getpara/core-sdk 2.0.0-dev.1 → 2.0.0-dev.2
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 +3378 -0
- package/dist/cjs/PlatformUtils.js +15 -0
- package/dist/cjs/StorageUtils.js +15 -0
- package/dist/cjs/constants.js +87 -0
- package/dist/cjs/cryptography/utils.js +350 -0
- package/dist/cjs/errors.js +51 -0
- package/dist/cjs/external/mpcComputationClient.js +62 -0
- package/dist/cjs/external/userManagementClient.js +106 -0
- package/dist/cjs/index.js +100 -5043
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/shares/KeyContainer.js +89 -0
- package/dist/cjs/shares/recovery.js +127 -0
- package/dist/cjs/shares/shareDistribution.js +104 -0
- package/dist/cjs/transmission/transmissionUtils.js +93 -0
- package/dist/cjs/types/auth.js +33 -0
- package/dist/cjs/types/config.js +43 -0
- package/dist/cjs/types/coreApi.js +89 -0
- package/dist/cjs/types/events.js +41 -0
- package/dist/cjs/types/index.js +54 -0
- package/dist/cjs/types/methods.js +15 -0
- package/dist/cjs/types/onRamps.js +33 -0
- package/dist/cjs/types/popup.js +35 -0
- package/dist/cjs/types/recovery.js +34 -0
- package/dist/cjs/types/theme.js +15 -0
- package/dist/cjs/types/wallet.js +31 -0
- package/dist/cjs/utils/autobind.js +41 -0
- package/dist/cjs/utils/events.js +45 -0
- package/dist/cjs/utils/formatting.js +116 -0
- package/dist/cjs/utils/index.js +41 -0
- package/dist/cjs/utils/json.js +37 -0
- package/dist/cjs/utils/listeners.js +71 -0
- package/dist/cjs/utils/onRamps.js +92 -0
- package/dist/cjs/utils/phone.js +73 -0
- package/dist/cjs/utils/polling.js +58 -0
- package/dist/cjs/utils/types.js +29 -0
- package/dist/cjs/utils/url.js +135 -0
- package/dist/cjs/utils/wallet.js +159 -0
- package/dist/esm/ParaCore.js +3343 -0
- package/dist/esm/PlatformUtils.js +0 -0
- package/dist/esm/StorageUtils.js +0 -0
- package/dist/esm/chunk-7B52C2XE.js +70 -0
- package/dist/esm/constants.js +45 -0
- package/dist/esm/cryptography/utils.js +282 -0
- package/dist/esm/errors.js +27 -0
- package/dist/esm/external/mpcComputationClient.js +30 -0
- package/dist/esm/external/userManagementClient.js +71 -0
- package/dist/esm/index.js +76 -5011
- package/dist/esm/package.json +4 -0
- package/dist/esm/shares/KeyContainer.js +57 -0
- package/dist/esm/shares/recovery.js +74 -0
- package/dist/esm/shares/shareDistribution.js +64 -0
- package/dist/esm/transmission/transmissionUtils.js +42 -0
- package/dist/esm/types/auth.js +11 -0
- package/dist/esm/types/config.js +20 -0
- package/dist/esm/types/coreApi.js +66 -0
- package/dist/esm/types/events.js +19 -0
- package/dist/esm/types/index.js +23 -0
- package/dist/esm/types/methods.js +0 -0
- package/dist/esm/types/onRamps.js +11 -0
- package/dist/esm/types/popup.js +13 -0
- package/dist/esm/types/recovery.js +12 -0
- package/dist/esm/types/theme.js +0 -0
- package/dist/esm/types/wallet.js +9 -0
- package/dist/esm/utils/autobind.js +19 -0
- package/dist/esm/utils/events.js +11 -0
- package/dist/esm/utils/formatting.js +76 -0
- package/dist/esm/utils/index.js +11 -0
- package/dist/esm/utils/json.js +15 -0
- package/dist/esm/utils/listeners.js +38 -0
- package/dist/esm/utils/onRamps.js +66 -0
- package/dist/esm/utils/phone.js +39 -0
- package/dist/esm/utils/polling.js +18 -0
- package/dist/esm/utils/types.js +7 -0
- package/dist/esm/utils/url.js +90 -0
- package/dist/esm/utils/wallet.js +103 -0
- package/dist/types/ParaCore.d.ts +115 -449
- package/dist/types/PlatformUtils.d.ts +4 -5
- package/dist/types/constants.d.ts +16 -13
- package/dist/types/index.d.ts +3 -3
- package/dist/types/shares/KeyContainer.d.ts +0 -2
- package/dist/types/types/auth.d.ts +16 -0
- package/dist/types/types/config.d.ts +12 -5
- package/dist/types/types/coreApi.d.ts +152 -58
- package/dist/types/types/events.d.ts +4 -1
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/methods.d.ts +49 -57
- package/dist/types/types/onRamps.d.ts +3 -3
- package/dist/types/types/wallet.d.ts +8 -3
- package/dist/types/utils/formatting.d.ts +5 -2
- package/dist/types/utils/onRamps.d.ts +12 -5
- package/dist/types/utils/phone.d.ts +4 -0
- package/dist/types/utils/wallet.d.ts +8 -7
- package/package.json +27 -26
- package/dist/cjs/index.js.br +0 -0
- package/dist/cjs/index.js.gz +0 -0
- package/dist/esm/index.js.br +0 -0
- package/dist/esm/index.js.gz +0 -0
package/dist/types/ParaCore.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { AuthMethod, AuthExtras, CurrentWalletIds, EmailTheme,
|
|
1
|
+
import { AuthMethod, AuthExtras, CurrentWalletIds, EmailTheme, TWalletType, PregenIds, BiometricLocationHint, Auth, SupportedWalletTypes, AuthIdentifier, AuthType, ExternalWalletInfo, PrimaryAuthInfo, SessionInfo, PrimaryAuth, PrimaryAuthType, AccountMetadata, LinkedAccounts, VerifyLinkParams, VerifyExternalWalletParams, SupportedAccountLinks } from '@getpara/user-management-client';
|
|
2
2
|
import type { pki as pkiType } from 'node-forge';
|
|
3
|
-
import { Ctx, Environment, Theme,
|
|
3
|
+
import { Ctx, Environment, Theme, WalletFilters, Wallet, PortalUrlOptions, ConstructorOpts, CoreAuthInfo, PortalUrlType, CoreMethodParams, CoreMethodResponse, NewCredentialUrlParams, LoginUrlParams, CoreInterface, ExternalWalletConnectionType, AccountLinkInProgress, InternalMethodParams, InternalMethodResponse } from './types/index.js';
|
|
4
4
|
import { PlatformUtils } from './PlatformUtils.js';
|
|
5
5
|
export declare abstract class ParaCore implements CoreInterface {
|
|
6
6
|
#private;
|
|
7
7
|
static version?: string;
|
|
8
8
|
ctx: Ctx;
|
|
9
9
|
protected isNativePasskey: boolean;
|
|
10
|
+
protected isPartnerOptional?: boolean;
|
|
11
|
+
isReady: boolean;
|
|
10
12
|
get authInfo(): CoreAuthInfo | undefined;
|
|
11
13
|
get email(): AuthIdentifier<'email'> | undefined;
|
|
12
14
|
get phone(): AuthIdentifier<'phone'> | undefined;
|
|
@@ -15,6 +17,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
15
17
|
get externalWalletWithParaAuth(): Wallet | undefined;
|
|
16
18
|
get externalWalletConnectionType(): ExternalWalletConnectionType;
|
|
17
19
|
userId?: string;
|
|
20
|
+
accountLinkInProgress: AccountLinkInProgress | undefined;
|
|
18
21
|
private sessionCookie?;
|
|
19
22
|
private isAwaitingAccountCreation;
|
|
20
23
|
private isAwaitingLogin;
|
|
@@ -25,12 +28,13 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
25
28
|
get isFarcaster(): boolean;
|
|
26
29
|
get isTelegram(): boolean;
|
|
27
30
|
get isExternalWalletAuth(): boolean;
|
|
31
|
+
get isExternalWalletWithVerification(): boolean;
|
|
28
32
|
get partnerId(): string | undefined;
|
|
29
33
|
/**
|
|
30
34
|
* 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.
|
|
31
35
|
*/
|
|
32
36
|
currentWalletIds: CurrentWalletIds;
|
|
33
|
-
get currentWalletIdsArray(): [string,
|
|
37
|
+
get currentWalletIdsArray(): [string, TWalletType][];
|
|
34
38
|
get currentWalletIdsUnique(): string[];
|
|
35
39
|
/**
|
|
36
40
|
* Wallets associated with the `ParaCore` instance. Retrieve a particular wallet using `para.wallets[walletId]`.
|
|
@@ -114,10 +118,17 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
114
118
|
* @deprecated configure theming through the developer portal
|
|
115
119
|
*/
|
|
116
120
|
portalTheme?: Theme;
|
|
121
|
+
/**
|
|
122
|
+
* Whether or not to treat external wallets as connections only, skipping all Para functionality.
|
|
123
|
+
*/
|
|
124
|
+
externalWalletConnectionOnly?: boolean;
|
|
117
125
|
private disableProviderModal?;
|
|
126
|
+
private fetchPregenWalletsOverride?;
|
|
127
|
+
get isNoWalletConfig(): boolean;
|
|
118
128
|
get supportedWalletTypes(): SupportedWalletTypes;
|
|
119
129
|
get cosmosPrefix(): string | undefined;
|
|
120
|
-
get
|
|
130
|
+
get supportedAccountLinks(): SupportedAccountLinks;
|
|
131
|
+
get isWalletTypeEnabled(): Partial<Record<TWalletType, boolean>>;
|
|
121
132
|
private platformUtils;
|
|
122
133
|
private localStorageGetItem;
|
|
123
134
|
private localStorageSetItem;
|
|
@@ -131,7 +142,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
131
142
|
* Remove all local storage and prefixed session storage.
|
|
132
143
|
* @param {'local' | 'session' | 'secure' | 'all'} type - Type of storage to clear. Defaults to 'all'.
|
|
133
144
|
*/
|
|
134
|
-
clearStorage: (type?: CoreMethodParams<
|
|
145
|
+
clearStorage: (type?: CoreMethodParams<"clearStorage">) => CoreMethodResponse<"clearStorage">;
|
|
135
146
|
private convertBigInt;
|
|
136
147
|
private convertEncryptionKeyPair;
|
|
137
148
|
private isPortal;
|
|
@@ -147,12 +158,14 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
147
158
|
* @param {string} walletId the ID of the wallet address to display.
|
|
148
159
|
* @param {object} options additional options for formatting the address.
|
|
149
160
|
* @param {boolean} options.truncate whether to truncate the address.
|
|
150
|
-
* @param {
|
|
161
|
+
* @param {TWalletType} options.addressType the type of address to display.
|
|
151
162
|
* @returns the formatted address
|
|
152
163
|
*/
|
|
153
164
|
getDisplayAddress(walletId: string, options?: {
|
|
154
165
|
truncate?: boolean;
|
|
155
|
-
addressType?:
|
|
166
|
+
addressType?: TWalletType | undefined;
|
|
167
|
+
cosmosPrefix?: string;
|
|
168
|
+
targetLength?: number;
|
|
156
169
|
} | undefined): string;
|
|
157
170
|
/**
|
|
158
171
|
* Returns a unique hash for a wallet suitable for use as an identicon seed.
|
|
@@ -160,12 +173,12 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
160
173
|
* @param {boolean} options.addressType used to format the hash for another wallet type.
|
|
161
174
|
* @returns the identicon hash string
|
|
162
175
|
*/
|
|
163
|
-
getIdenticonHash(walletId: string, overrideType?:
|
|
176
|
+
getIdenticonHash(walletId: string, overrideType?: TWalletType): string | undefined;
|
|
164
177
|
getWallets(): Record<string, Wallet>;
|
|
165
178
|
getAddress(walletId?: string): string | undefined;
|
|
166
179
|
protected abstract getPlatformUtils(): PlatformUtils;
|
|
167
|
-
|
|
168
|
-
|
|
180
|
+
abstract isPasskeySupported(): Promise<boolean>;
|
|
181
|
+
protected constructPortalUrl(type: PortalUrlType, opts?: PortalUrlOptions): Promise<string>;
|
|
169
182
|
/**
|
|
170
183
|
* Constructs a new `ParaCore` instance.
|
|
171
184
|
* @param env - `Environment` to use.
|
|
@@ -174,6 +187,8 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
174
187
|
* @returns - A new ParaCore instance.
|
|
175
188
|
*/
|
|
176
189
|
constructor(env: Environment, apiKey: string, opts?: ConstructorOpts);
|
|
190
|
+
private trackError;
|
|
191
|
+
private wrapMethodsWithErrorTracking;
|
|
177
192
|
private initializeFromStorage;
|
|
178
193
|
private updateAuthInfoFromStorage;
|
|
179
194
|
private updateUserIdFromStorage;
|
|
@@ -191,6 +206,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
191
206
|
* Init only needs to be called for storage that is async.
|
|
192
207
|
*/
|
|
193
208
|
init(): Promise<void>;
|
|
209
|
+
protected abstract ready(): Promise<void>;
|
|
194
210
|
protected setAuth(auth: PrimaryAuth, { extras, userId }?: {
|
|
195
211
|
extras?: AuthExtras;
|
|
196
212
|
userId?: string;
|
|
@@ -223,7 +239,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
223
239
|
* @param externalAddress - External wallet address to set.
|
|
224
240
|
* @param externalType - Type of external wallet to set.
|
|
225
241
|
*/
|
|
226
|
-
setExternalWallet(
|
|
242
|
+
setExternalWallet(externalWallet: ExternalWalletInfo[] | ExternalWalletInfo): Promise<void>;
|
|
227
243
|
/**
|
|
228
244
|
* Sets the user id associated with the `ParaCore` instance.
|
|
229
245
|
* @param userId - User id to set.
|
|
@@ -250,6 +266,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
250
266
|
* @returns - userId associated with the `ParaCore` instance.
|
|
251
267
|
*/
|
|
252
268
|
getUserId(): string | undefined;
|
|
269
|
+
getAuthInfo(): CoreAuthInfo | undefined;
|
|
253
270
|
/**
|
|
254
271
|
* Gets the email associated with the `ParaCore` instance.
|
|
255
272
|
* @returns - email associated with the `ParaCore` instance.
|
|
@@ -270,6 +287,13 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
270
287
|
sessionLookupId?: string;
|
|
271
288
|
newDeviceSessionLookupId?: string;
|
|
272
289
|
}): Promise<void>;
|
|
290
|
+
/**
|
|
291
|
+
* Fetches the most recent OAuth account metadata for the signed-in user.
|
|
292
|
+
* 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.
|
|
293
|
+
* @deprecated use `para.getLinkedAccounts({ withMetadata: true })` instead.
|
|
294
|
+
* @returns {Promise<AccountMetadata>} the user's account metadata.
|
|
295
|
+
*/
|
|
296
|
+
getAccountMetadata(): Promise<AccountMetadata>;
|
|
273
297
|
/**
|
|
274
298
|
* Validates that a wallet ID is present on the instance, usable, and matches the desired filters.
|
|
275
299
|
* If no ID is passed, this will instead return the first valid, usable wallet ID that matches the filters.
|
|
@@ -286,14 +310,14 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
286
310
|
* @returns {string} the wallet ID originally passed, or the one found.
|
|
287
311
|
*/
|
|
288
312
|
findWalletByAddress(address: string, filter?: WalletFilters | undefined): any;
|
|
289
|
-
findWallet(idOrAddress?: string, overrideType?:
|
|
290
|
-
get availableWallets(): Pick<Wallet, 'id' | 'type' | 'name' | 'address' | 'isExternal'>[];
|
|
313
|
+
findWallet(idOrAddress?: string, overrideType?: TWalletType, filter?: WalletFilters): Omit<Wallet, 'signer'> | undefined;
|
|
314
|
+
get availableWallets(): Pick<Wallet, 'id' | 'type' | 'name' | 'address' | 'isExternal' | 'externalProviderId' | 'isExternalConnectionOnly'>[];
|
|
291
315
|
/**
|
|
292
316
|
* Retrieves all usable wallets with the provided type (`'EVM' | 'COSMOS' | 'SOLANA'`)
|
|
293
317
|
* @param {string} type the wallet type to filter by.
|
|
294
318
|
* @returns {Wallet[]} an array of matching wallets.
|
|
295
319
|
*/
|
|
296
|
-
getWalletsByType(type:
|
|
320
|
+
getWalletsByType(type: CoreMethodParams<'getWalletsByType'>): CoreMethodResponse<'getWalletsByType'>;
|
|
297
321
|
private assertIsValidWalletId;
|
|
298
322
|
private assertIsValidWalletType;
|
|
299
323
|
private getMissingTypes;
|
|
@@ -305,31 +329,6 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
305
329
|
* @returns - portal URL
|
|
306
330
|
*/
|
|
307
331
|
protected getPortalURL(): Promise<string>;
|
|
308
|
-
private getWebAuthURLForCreate;
|
|
309
|
-
private getPasswordURLForCreate;
|
|
310
|
-
private getShortUrl;
|
|
311
|
-
shortenLoginLink(link: string): Promise<string>;
|
|
312
|
-
/**
|
|
313
|
-
* Generates a URL for registering a new WebAuth passkey.
|
|
314
|
-
* @deprecated
|
|
315
|
-
* @param {GetWebAuthUrlForLoginParams} opts the options object
|
|
316
|
-
* @returns - the URL for creating a new passkey
|
|
317
|
-
*/
|
|
318
|
-
getWebAuthURLForLogin(opts: GetWebAuthUrlForLoginParams): Promise<string>;
|
|
319
|
-
/**
|
|
320
|
-
* Generates a URL for registering a new user password.
|
|
321
|
-
* @deprecated
|
|
322
|
-
* @param {GetWebAuthUrlForLoginParams} opts the options object
|
|
323
|
-
* @returns - the URL for creating a new password
|
|
324
|
-
*/
|
|
325
|
-
getPasswordURLForLogin(opts: GetWebAuthUrlForLoginParams): Promise<string>;
|
|
326
|
-
/**
|
|
327
|
-
* Generates a URL for registering a new WebAuth passkey for a phone number.
|
|
328
|
-
* @deprecated
|
|
329
|
-
* @param {Omit<GetWebAuthUrlForLoginParams, 'authType'>} opts the options object
|
|
330
|
-
* @returns - web auth url
|
|
331
|
-
*/
|
|
332
|
-
getWebAuthURLForLoginForPhone(opts: Omit<GetWebAuthUrlForLoginParams, 'authType'>): Promise<string>;
|
|
333
332
|
/**
|
|
334
333
|
* Gets the private key for the given wallet.
|
|
335
334
|
* @param {string } [walletId] id of the wallet to get the private key for. Will default to the first wallet if not provided.
|
|
@@ -343,174 +342,47 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
343
342
|
fetchWallets(): CoreMethodResponse<'fetchWallets'>;
|
|
344
343
|
private populateWalletAddresses;
|
|
345
344
|
private populatePregenWalletAddresses;
|
|
346
|
-
/**
|
|
347
|
-
* Checks if a user exists for an email address.
|
|
348
|
-
* @deprecated
|
|
349
|
-
* @param {Object} opts the options object
|
|
350
|
-
* @param {string} opts.email the email to check.
|
|
351
|
-
* @returns true if user exists, false otherwise.
|
|
352
|
-
*/
|
|
353
|
-
checkIfUserExists({ email }: {
|
|
354
|
-
email: string;
|
|
355
|
-
}): Promise<boolean>;
|
|
356
|
-
/**
|
|
357
|
-
* Checks if a user exists for a phone number.
|
|
358
|
-
* @deprecated
|
|
359
|
-
* @param {Object} opts the options object
|
|
360
|
-
* @param {string} opts.phone - phone number to check.
|
|
361
|
-
* @param {string} opts.countryCode - the country code.
|
|
362
|
-
* @returns true if user exists, false otherwise.
|
|
363
|
-
*/
|
|
364
|
-
checkIfUserExistsByPhone(auth: Auth<'phone'>): Promise<boolean>;
|
|
365
|
-
/**
|
|
366
|
-
* Creates a new user.
|
|
367
|
-
* @deprecated
|
|
368
|
-
* @param {Object} opts the options object
|
|
369
|
-
* @param {string} opts.email the email to use.
|
|
370
|
-
*/
|
|
371
|
-
createUser({ email }: Auth<'email'>): Promise<void>;
|
|
372
|
-
/**
|
|
373
|
-
* Creates a new user with a phone number.
|
|
374
|
-
* @deprecated
|
|
375
|
-
* @param {Object} opts the options object
|
|
376
|
-
* @param {string} opts.phone - the phone number to use for creating the user.
|
|
377
|
-
* @param {string} opts.countryCode - the country code to use for creating the user.
|
|
378
|
-
*/
|
|
379
|
-
createUserByPhone(auth: Auth<'phone'>): Promise<void>;
|
|
380
345
|
/**
|
|
381
346
|
* Logs in or creates a new user using an external wallet address.
|
|
382
|
-
* @deprecated
|
|
383
347
|
* @param {Object} opts the options object
|
|
384
348
|
* @param {string} opts.address the external wallet address to use for identification.
|
|
385
|
-
* @param {
|
|
349
|
+
* @param {TWalletType} opts.type type of external wallet to use for identification.
|
|
386
350
|
* @param {string} opts.provider the name of the provider for the external wallet.
|
|
387
351
|
*/
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
/** @deprecated */
|
|
400
|
-
verifyExternalWallet({ address, signedMessage, cosmosPublicKeyHex, cosmosSigner, }: VerifyExternalWalletV1): Promise<string>;
|
|
401
|
-
/**
|
|
402
|
-
* Passes the phone code obtained from the user for verification.
|
|
403
|
-
* @deprecated
|
|
404
|
-
* @param {Object} opts the options object
|
|
405
|
-
* @param {string} verificationCode the six-digit code to check
|
|
406
|
-
* @returns {string} the web auth url for creating a new credential
|
|
407
|
-
*/
|
|
408
|
-
verifyPhone({ verificationCode }: {
|
|
409
|
-
verificationCode: string;
|
|
410
|
-
}): Promise<string>;
|
|
411
|
-
/**
|
|
412
|
-
* Validates the response received from an attempted Telegram login for authenticity, then
|
|
413
|
-
* creates or retrieves the corresponding Para user and prepares the Para instance to sign in with that user.
|
|
414
|
-
* @deprecated
|
|
415
|
-
* @param authResponse - the response JSON object received from the Telegram widget.
|
|
416
|
-
* @returns `{ isValid: boolean; telegramUserId?: string; userId?: string; isNewUser?: boolean; supportedAuthMethods?: AuthMethod[]; biometricHints?: BiometricLocationHint[] }`
|
|
417
|
-
*/
|
|
418
|
-
verifyTelegram(authObject: TelegramAuthResponse): Promise<VerifyTelegramRes>;
|
|
352
|
+
loginExternalWallet({ externalWallet, ...urlOptions }: CoreMethodParams<'loginExternalWallet'>): CoreMethodResponse<'loginExternalWallet'>;
|
|
353
|
+
verifyExternalWallet({ externalWallet, signedMessage, cosmosPublicKeyHex, cosmosSigner, ...urlOptions }: CoreMethodParams<'verifyExternalWallet'>): CoreMethodResponse<'verifyExternalWallet'>;
|
|
354
|
+
protected verifyExternalWalletLink(opts: InternalMethodParams<'verifyExternalWalletLink'>): InternalMethodResponse<'verifyExternalWalletLink'>;
|
|
355
|
+
protected verifyTelegramProcess(opts: CoreMethodParams<'verifyTelegram'> & {
|
|
356
|
+
isLinkAccount: false;
|
|
357
|
+
}): CoreMethodResponse<'verifyTelegram'>;
|
|
358
|
+
protected verifyTelegramProcess(opts: InternalMethodParams<'verifyTelegramLink'> & {
|
|
359
|
+
isLinkAccount: true;
|
|
360
|
+
}): InternalMethodResponse<'verifyTelegramLink'>;
|
|
361
|
+
verifyTelegram(opts: CoreMethodParams<'verifyTelegram'>): CoreMethodResponse<'verifyTelegram'>;
|
|
362
|
+
protected verifyTelegramLink(opts: InternalMethodParams<'verifyTelegramLink'>): InternalMethodResponse<'verifyTelegramLink'>;
|
|
419
363
|
/**
|
|
420
364
|
* Performs 2FA verification.
|
|
421
|
-
* @deprecated
|
|
422
365
|
* @param {Object} opts the options object
|
|
423
366
|
* @param {string} opts.email the email to use for performing a 2FA verification.
|
|
424
367
|
* @param {string} opts.verificationCode the verification code to received via 2FA.
|
|
425
368
|
* @returns {Object} `{ address, initiatedAt, status, userId, walletId }`
|
|
426
369
|
*/
|
|
427
|
-
|
|
428
|
-
email: string;
|
|
429
|
-
verificationCode: string;
|
|
430
|
-
}): Promise<{
|
|
431
|
-
initiatedAt?: Date;
|
|
432
|
-
status?: RecoveryStatus;
|
|
433
|
-
userId: string;
|
|
434
|
-
wallets: Pick<Wallet, 'address' | 'id'>[];
|
|
435
|
-
}>;
|
|
436
|
-
/**
|
|
437
|
-
* Performs 2FA verification.
|
|
438
|
-
* @deprecated
|
|
439
|
-
* @param {Object} opts the options object
|
|
440
|
-
* @param {string} opts.phone the phone number
|
|
441
|
-
* @param {string} opts.countryCode - the country code
|
|
442
|
-
* @param {string} opts.verificationCode - verification code to received via 2FA.
|
|
443
|
-
* @returns {Object} `{ address, initiatedAt, status, userId, walletId }`
|
|
444
|
-
*/
|
|
445
|
-
verify2FAForPhone({ phone, verificationCode, }: Auth<'phone'> & {
|
|
446
|
-
verificationCode: string;
|
|
447
|
-
}): Promise<{
|
|
448
|
-
initiatedAt?: Date;
|
|
449
|
-
status?: RecoveryStatus;
|
|
450
|
-
userId: string;
|
|
451
|
-
wallets: Pick<Wallet, 'address' | 'id'>[];
|
|
452
|
-
}>;
|
|
370
|
+
verify2fa({ auth, verificationCode }: CoreMethodParams<'verify2fa'>): CoreMethodResponse<'verify2fa'>;
|
|
453
371
|
/**
|
|
454
372
|
* Sets up two-factor authentication for the current user.
|
|
455
|
-
* @deprecated
|
|
456
373
|
* @returns {string} uri - uri to use for setting up 2FA
|
|
457
374
|
* */
|
|
458
|
-
|
|
459
|
-
uri?: string;
|
|
460
|
-
}>;
|
|
375
|
+
setup2fa(): CoreMethodResponse<'setup2fa'>;
|
|
461
376
|
/**
|
|
462
377
|
* Enables 2FA.
|
|
463
|
-
* @deprecated
|
|
464
378
|
* @param {Object} opts the options object
|
|
465
379
|
* @param {string} opts.verificationCode - the verification code received via 2FA.
|
|
466
380
|
*/
|
|
467
|
-
|
|
468
|
-
verificationCode: string;
|
|
469
|
-
}): Promise<void>;
|
|
470
|
-
/**
|
|
471
|
-
* Determines if 2FA has been set up.
|
|
472
|
-
* @deprecated
|
|
473
|
-
* @returns {Object} `{ isSetup: boolean }` - true if 2FA is setup, false otherwise
|
|
474
|
-
*/
|
|
475
|
-
check2FAStatus(): Promise<{
|
|
476
|
-
isSetup: boolean;
|
|
477
|
-
}>;
|
|
381
|
+
enable2fa({ verificationCode }: CoreMethodParams<'enable2fa'>): CoreMethodResponse<'enable2fa'>;
|
|
478
382
|
/**
|
|
479
383
|
* Resend a verification email for the current user.
|
|
480
384
|
*/
|
|
481
|
-
resendVerificationCode(): CoreMethodResponse<'resendVerificationCode'>;
|
|
482
|
-
/**
|
|
483
|
-
* Resend a verification SMS for the current user.
|
|
484
|
-
* @deprecated
|
|
485
|
-
*/
|
|
486
|
-
resendVerificationCodeByPhone(): Promise<void>;
|
|
487
|
-
/**
|
|
488
|
-
* Returns a URL for setting up a new WebAuth passkey.
|
|
489
|
-
* @deprecated
|
|
490
|
-
* @param {Object} opts the options object
|
|
491
|
-
* @param {string} opts.authType - the auth type to use
|
|
492
|
-
* @param {boolean} opts.isForNewDevice whether the passkey is for a new device of an existing user
|
|
493
|
-
* @returns {string} the URL
|
|
494
|
-
*/
|
|
495
|
-
getSetUpBiometricsURL({ authType, isForNewDevice, }?: Pick<PortalUrlOptions, 'authType' | 'isForNewDevice'>): Promise<string>;
|
|
496
|
-
/**
|
|
497
|
-
* Returns a URL for setting up a new WebAuth passkey for a phone number.
|
|
498
|
-
* @deprecated
|
|
499
|
-
* @param {Object} opts the options object
|
|
500
|
-
* @param {boolean} opts.isForNewDevice whether the passkey is for a new device of an existing user
|
|
501
|
-
* @returns {string} the URL
|
|
502
|
-
*/
|
|
503
|
-
getSetUpBiometricsURLForPhone({ isForNewDevice, }?: Pick<PortalUrlOptions, 'isForNewDevice'>): Promise<string>;
|
|
504
|
-
/**
|
|
505
|
-
* Returns a URL for setting up a new password.
|
|
506
|
-
* @deprecated
|
|
507
|
-
* @param {Object} opts the options object
|
|
508
|
-
* @param {string} opts.authType - the auth type to use
|
|
509
|
-
* @param {boolean} opts.isForNewDevice whether the passkey is for a new device of an existing user
|
|
510
|
-
* @param {Theme} [opts.theme] the portal theme to use in place of the partner's default
|
|
511
|
-
* @returns {string} the URL
|
|
512
|
-
*/
|
|
513
|
-
getSetupPasswordURL({ authType, isForNewDevice, theme, }?: Pick<PortalUrlOptions, 'authType' | 'isForNewDevice' | 'theme'>): Promise<string>;
|
|
385
|
+
resendVerificationCode({ type: reason, }: CoreMethodParams<'resendVerificationCode'>): CoreMethodResponse<'resendVerificationCode'>;
|
|
514
386
|
/**
|
|
515
387
|
* Checks if the current session is active.
|
|
516
388
|
* @returns `true` if active, `false` otherwise
|
|
@@ -521,7 +393,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
521
393
|
* @returns `true` if active, `false` otherwise
|
|
522
394
|
**/
|
|
523
395
|
isFullyLoggedIn(): CoreMethodResponse<'isFullyLoggedIn'>;
|
|
524
|
-
|
|
396
|
+
get isGuestMode(): boolean;
|
|
525
397
|
protected supportedAuthMethods(auth: Auth<PrimaryAuthType | 'userId'>): Promise<Set<AuthMethod>>;
|
|
526
398
|
/**
|
|
527
399
|
* Get hints associated with the users stored biometrics.
|
|
@@ -530,106 +402,44 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
530
402
|
*/
|
|
531
403
|
protected getUserBiometricLocationHints(): Promise<BiometricLocationHint[]>;
|
|
532
404
|
/**
|
|
533
|
-
* Initiates a login.
|
|
534
|
-
* @deprecated
|
|
535
|
-
* @param {Object} opts the options object
|
|
536
|
-
* @param {String} opts.email - the email to login with
|
|
537
|
-
* @param {boolean} opts.useShortURL - whether to shorten the link
|
|
538
|
-
* @returns - the WebAuth URL for logging in
|
|
539
|
-
**/
|
|
540
|
-
initiateUserLogin({ useShortUrl, ...auth }: PrimaryAuth & {
|
|
541
|
-
useShortUrl?: boolean;
|
|
542
|
-
}): Promise<string>;
|
|
543
|
-
/**
|
|
544
|
-
* Initiates a login.
|
|
545
|
-
* @deprecated
|
|
546
|
-
* @param email - the email to login with
|
|
547
|
-
* @returns - a set of supported auth methods for the user
|
|
548
|
-
**/
|
|
549
|
-
initiateUserLoginV2(auth: PrimaryAuth): Promise<Set<AuthMethod>>;
|
|
550
|
-
/**
|
|
551
|
-
* Initiates a login.
|
|
552
|
-
* @deprecated
|
|
553
|
-
* @param opts the options object
|
|
554
|
-
* @param opts.phone the phone number
|
|
555
|
-
* @param opts.countryCode the country code
|
|
556
|
-
* @param opts.useShortURL - whether to shorten the link
|
|
557
|
-
* @returns - the WebAuth URL for logging in
|
|
558
|
-
**/
|
|
559
|
-
initiateUserLoginForPhone({ useShortUrl, ...auth }: Auth<'phone'> & {
|
|
560
|
-
useShortUrl?: boolean;
|
|
561
|
-
}): Promise<string>;
|
|
562
|
-
/**
|
|
563
|
-
* @deprecated
|
|
564
405
|
* Waits for the session to be active.
|
|
565
406
|
**/
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
}): Promise<boolean>;
|
|
569
|
-
/**
|
|
570
|
-
* @deprecated
|
|
571
|
-
*/
|
|
572
|
-
waitForPasskeyAndCreateWallet({ popupWindow, }?: {
|
|
573
|
-
popupWindow?: Window;
|
|
574
|
-
}): Promise<AccountSetupResponse>;
|
|
407
|
+
waitForSignup({ isCanceled, onCancel, onPoll, }: CoreMethodParams<'waitForSignup'>): CoreMethodResponse<'waitForSignup'>;
|
|
408
|
+
waitForWalletCreation({ isCanceled, onCancel, }?: CoreMethodParams<'waitForWalletCreation'>): CoreMethodResponse<'waitForWalletCreation'>;
|
|
575
409
|
/**
|
|
576
|
-
* Initiates a Farcaster login attempt and
|
|
410
|
+
* Initiates a Farcaster login attempt and returns the URL for the user to connect.
|
|
577
411
|
* You can create a QR code with this URI that works with Farcaster's mobile app.
|
|
578
|
-
* @deprecated
|
|
579
412
|
* @return {string} the Farcaster connect URI
|
|
580
413
|
*/
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
*/
|
|
602
|
-
getOAuthURL({ method, deeplinkUrl }: {
|
|
603
|
-
method: OAuthMethod;
|
|
604
|
-
deeplinkUrl?: string;
|
|
605
|
-
}): Promise<string>;
|
|
606
|
-
/**
|
|
607
|
-
* Awaits the response from a user's attempt to log in with OAuth.
|
|
608
|
-
* If successful, this returns the user's email address and indicates whether the user already exists.
|
|
609
|
-
* @deprecated
|
|
610
|
-
* @param {Object} opts the options object.
|
|
611
|
-
* @param {Window} [opts.popupWindow] the popup window being used for login.
|
|
612
|
-
* @return {Object} `{ email?: string; isError?: boolean; userExists: boolean; }` the result data
|
|
613
|
-
*/
|
|
614
|
-
waitForOAuth({ popupWindow }?: {
|
|
615
|
-
popupWindow?: Window | null;
|
|
616
|
-
}): Promise<{
|
|
617
|
-
email?: string;
|
|
618
|
-
isError?: boolean;
|
|
619
|
-
userExists: boolean;
|
|
620
|
-
}>;
|
|
414
|
+
getFarcasterConnectUri({ appScheme }?: {
|
|
415
|
+
appScheme?: string;
|
|
416
|
+
}): CoreMethodResponse<'getFarcasterConnectUri'>;
|
|
417
|
+
protected verifyFarcasterProcess(opts: CoreMethodParams<'verifyFarcaster'> & {
|
|
418
|
+
isLinkAccount: false;
|
|
419
|
+
}): CoreMethodResponse<'verifyFarcaster'>;
|
|
420
|
+
protected verifyFarcasterProcess(opts: InternalMethodParams<'verifyFarcasterLink'> & {
|
|
421
|
+
isLinkAccount: true;
|
|
422
|
+
}): InternalMethodResponse<'verifyFarcasterLink'>;
|
|
423
|
+
verifyFarcaster(opts: CoreMethodParams<'verifyFarcaster'>): CoreMethodResponse<'verifyFarcaster'>;
|
|
424
|
+
protected verifyFarcasterLink(opts: InternalMethodParams<'verifyFarcasterLink'>): InternalMethodResponse<'verifyFarcasterLink'>;
|
|
425
|
+
getOAuthUrl(opts: CoreMethodParams<'getOAuthUrl'>): CoreMethodResponse<'getOAuthUrl'>;
|
|
426
|
+
protected verifyOAuthProcess(_: InternalMethodParams<'verifyOAuthLink'> & {
|
|
427
|
+
isLinkAccount: true;
|
|
428
|
+
}): InternalMethodResponse<'verifyOAuthLink'>;
|
|
429
|
+
protected verifyOAuthProcess(_: CoreMethodParams<'verifyOAuth'> & {
|
|
430
|
+
isLinkAccount: false;
|
|
431
|
+
}): CoreMethodResponse<'verifyOAuth'>;
|
|
432
|
+
verifyOAuth(opts: CoreMethodParams<'verifyOAuth'>): CoreMethodResponse<'verifyOAuth'>;
|
|
433
|
+
protected verifyOAuthLink(opts: InternalMethodParams<'verifyOAuthLink'>): InternalMethodResponse<'verifyOAuthLink'>;
|
|
621
434
|
/**
|
|
622
435
|
* Waits for the session to be active and sets up the user.
|
|
623
|
-
*
|
|
436
|
+
*
|
|
624
437
|
* @param {Object} opts the options object
|
|
625
438
|
* @param {Window} [opts.popupWindow] the popup window being used for login.
|
|
626
439
|
* @param {boolean} [opts.skipSessionRefresh] whether to skip refreshing the session.
|
|
627
440
|
* @returns {Object} `{ isComplete: boolean; isError: boolean; needsWallet: boolean; partnerId: string; }` the result data
|
|
628
441
|
**/
|
|
629
|
-
|
|
630
|
-
popupWindow?: Window | null;
|
|
631
|
-
skipSessionRefresh?: boolean;
|
|
632
|
-
}): Promise<LoginResponse>;
|
|
442
|
+
waitForLogin({ isCanceled, onCancel, onPoll, skipSessionRefresh, }?: CoreMethodParams<'waitForLogin'>): CoreMethodResponse<'waitForLogin'>;
|
|
633
443
|
/**
|
|
634
444
|
* Updates the session with the user management server, possibly
|
|
635
445
|
* opening a popup to refresh the session.
|
|
@@ -691,7 +501,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
691
501
|
*
|
|
692
502
|
* @deprecated alias for `createWalletPerType`
|
|
693
503
|
**/
|
|
694
|
-
createWalletPerMissingType: ({ skipDistribute, types, }?: CoreMethodParams<
|
|
504
|
+
createWalletPerMissingType: ({ skipDistribute, types, }?: CoreMethodParams<"createWalletPerType">) => CoreMethodResponse<"createWalletPerType">;
|
|
695
505
|
/**
|
|
696
506
|
* Creates several new wallets with the desired types. If no types are provided, this method
|
|
697
507
|
* will create one for each of the non-optional types specified in the instance's `supportedWalletTypes`
|
|
@@ -700,7 +510,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
700
510
|
*
|
|
701
511
|
* @param {Object} [opts] the options object.
|
|
702
512
|
* @param {boolean} [opts.skipDistribute] if `true`, the wallets' recovery share will not be distributed.
|
|
703
|
-
* @param {
|
|
513
|
+
* @param {TWalletType[]} [opts.types] the types of wallets to create.
|
|
704
514
|
* @returns {Object} the wallets created, their ids, and the recovery secret.
|
|
705
515
|
**/
|
|
706
516
|
createWalletPerType({ skipDistribute, types, }?: CoreMethodParams<'createWalletPerType'>): CoreMethodResponse<'createWalletPerType'>;
|
|
@@ -720,90 +530,56 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
720
530
|
/**
|
|
721
531
|
* Creates a new wallet.
|
|
722
532
|
* @param {Object} opts the options object.
|
|
723
|
-
* @param {
|
|
533
|
+
* @param {TWalletType} opts.type the type of wallet to create.
|
|
724
534
|
* @param {boolean} opts.skipDistribute - if true, recovery share will not be distributed.
|
|
725
535
|
* @returns {[Wallet, string | null]} `[wallet, recoveryShare]` - the wallet object and the new recovery share.
|
|
726
536
|
**/
|
|
727
537
|
createWallet({ type: _type, skipDistribute, }?: CoreMethodParams<'createWallet'>): CoreMethodResponse<'createWallet'>;
|
|
728
|
-
|
|
729
|
-
* Creates a new pregenerated wallet.
|
|
730
|
-
* @deprecated
|
|
731
|
-
* @param {Object} opts the options object.
|
|
732
|
-
* @param {string} opts.pregenIdentifier the identifier associated with the new wallet.
|
|
733
|
-
* @param {TPregenIdentifierType} [opts.pregenIdentifierType] the identifier type. Defaults to `EMAIL`.
|
|
734
|
-
* @param {WalletType} [opts.type] the type of wallet to create. Defaults to the first non-optional type in the instance's `supportedWalletTypes` array.
|
|
735
|
-
* @returns {Wallet} the created wallet.
|
|
736
|
-
**/
|
|
737
|
-
createPregenWallet(opts: {
|
|
738
|
-
type: WalletType;
|
|
739
|
-
pregenIdentifier: string;
|
|
740
|
-
pregenIdentifierType: TPregenIdentifierType;
|
|
741
|
-
}): Promise<Wallet>;
|
|
538
|
+
createPregenWallet(opts: CoreMethodParams<'createPregenWallet'>): CoreMethodResponse<'createPregenWallet'>;
|
|
742
539
|
/**
|
|
743
540
|
* Creates new pregenerated wallets for each desired type.
|
|
744
541
|
* If no types are provided, this method will create one for each of the non-optional types
|
|
745
542
|
* specified in the instance's `supportedWalletTypes` array that are not already present.
|
|
746
|
-
* @deprecated
|
|
747
543
|
* @param {Object} opts the options object.
|
|
748
544
|
* @param {string} opts.pregenIdentifier the identifier to associate each wallet with.
|
|
749
545
|
* @param {TPregenIdentifierType} opts.pregenIdentifierType - either `'EMAIL'` or `'PHONE'`.
|
|
750
|
-
* @param {
|
|
546
|
+
* @param {TWalletType[]} [opts.types] the wallet types to create. Defaults to any types the instance supports that are not already present.
|
|
751
547
|
* @returns {Wallet[]} an array containing the created wallets.
|
|
752
548
|
**/
|
|
753
|
-
createPregenWalletPerType({ types,
|
|
754
|
-
pregenIdentifier: string;
|
|
755
|
-
pregenIdentifierType: TPregenIdentifierType;
|
|
756
|
-
types?: WalletType[];
|
|
757
|
-
}): Promise<Wallet[]>;
|
|
549
|
+
createPregenWalletPerType({ types, pregenId, }: CoreMethodParams<'createPregenWalletPerType'>): CoreMethodResponse<'createPregenWalletPerType'>;
|
|
758
550
|
/**
|
|
759
551
|
* Claims a pregenerated wallet.
|
|
760
|
-
* @deprecated
|
|
761
552
|
* @param {Object} opts the options object.
|
|
762
553
|
* @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
|
|
763
554
|
* @param {TPregenIdentifierType} opts.pregenIdentifierType type of the identifier of the user claiming the wallet
|
|
764
555
|
* @returns {[Wallet, string | null]} `[wallet, recoveryShare]` - the wallet object and the new recovery share.
|
|
765
556
|
**/
|
|
766
|
-
claimPregenWallets({
|
|
767
|
-
pregenIdentifier?: string;
|
|
768
|
-
pregenIdentifierType?: TPregenIdentifierType;
|
|
769
|
-
}): Promise<string | undefined>;
|
|
557
|
+
claimPregenWallets({ pregenId, }?: CoreMethodParams<'claimPregenWallets'>): CoreMethodResponse<'claimPregenWallets'>;
|
|
770
558
|
/**
|
|
771
559
|
* Updates the identifier for a pregen wallet.
|
|
772
|
-
* @deprecated
|
|
773
560
|
* @param {Object} opts the options object.
|
|
774
561
|
* @param {string} opts.walletId the pregen wallet ID
|
|
775
562
|
* @param {string} opts.newPregenIdentifier the new identtifier
|
|
776
563
|
* @param {TPregenIdentifierType} opts.newPregenIdentifierType: the new identifier type
|
|
777
564
|
**/
|
|
778
|
-
updatePregenWalletIdentifier({ walletId,
|
|
779
|
-
walletId: string;
|
|
780
|
-
newPregenIdentifier: string;
|
|
781
|
-
newPregenIdentifierType: TPregenIdentifierType;
|
|
782
|
-
}): Promise<void>;
|
|
565
|
+
updatePregenWalletIdentifier({ walletId, newPregenId, }: CoreMethodParams<'updatePregenWalletIdentifier'>): CoreMethodResponse<'updatePregenWalletIdentifier'>;
|
|
783
566
|
/**
|
|
784
567
|
* Checks if a pregen Wallet exists for the given identifier with the current partner.
|
|
785
|
-
* @deprecated
|
|
786
568
|
* @param {Object} opts the options object.
|
|
787
569
|
* @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
|
|
788
570
|
* @param {TPregenIdentifierType} opts.pregenIdentifierType type of the string of the identifier of the user claiming the wallet
|
|
789
571
|
* @returns {boolean} whether the pregen wallet exists
|
|
790
572
|
**/
|
|
791
|
-
hasPregenWallet({
|
|
792
|
-
pregenIdentifier: string;
|
|
793
|
-
pregenIdentifierType: TPregenIdentifierType;
|
|
794
|
-
}): Promise<boolean>;
|
|
573
|
+
hasPregenWallet({ pregenId }: CoreMethodParams<'hasPregenWallet'>): CoreMethodResponse<'hasPregenWallet'>;
|
|
795
574
|
/**
|
|
796
575
|
* Get pregen wallets for the given identifier.
|
|
797
|
-
* @deprecated
|
|
798
576
|
* @param {Object} opts the options object.
|
|
799
577
|
* @param {string} opts.pregenIdentifier - the identifier of the user claiming the wallet
|
|
800
578
|
* @param {TPregenIdentifierType} opts.pregenIdentifierType - type of the identifier of the user claiming the wallet
|
|
801
579
|
* @returns {Promise<WalletEntity[]>} the array of found wallets
|
|
802
580
|
**/
|
|
803
|
-
getPregenWallets({
|
|
804
|
-
|
|
805
|
-
pregenIdentifierType?: TPregenIdentifierType;
|
|
806
|
-
}): Promise<WalletEntity[]>;
|
|
581
|
+
getPregenWallets({ pregenId }?: CoreMethodParams<'getPregenWallets'>): CoreMethodResponse<'getPregenWallets'>;
|
|
582
|
+
createGuestWallets(): CoreMethodResponse<'createGuestWallets'>;
|
|
807
583
|
private encodeWalletBase64;
|
|
808
584
|
/**
|
|
809
585
|
* Encodes the current wallets encoded in Base 64.
|
|
@@ -817,6 +593,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
817
593
|
setUserShare(base64Wallets: CoreMethodParams<'setUserShare'>): CoreMethodResponse<'setUserShare'>;
|
|
818
594
|
private getTransactionReviewUrl;
|
|
819
595
|
private getOnRampTransactionUrl;
|
|
596
|
+
getWalletBalance: ({ walletId, rpcUrl, }: CoreMethodParams<"getWalletBalance">) => CoreMethodResponse<"getWalletBalance">;
|
|
820
597
|
/**
|
|
821
598
|
* Signs a message using one of the current wallets.
|
|
822
599
|
*
|
|
@@ -839,18 +616,6 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
839
616
|
* @param {number} [opts.timeoutMs] the amount of time to wait for the user to sign the transaction, in milliseconds
|
|
840
617
|
**/
|
|
841
618
|
signTransaction({ walletId, rlpEncodedTxBase64, chainId, timeoutMs, isCanceled, onCancel, onPoll, }: CoreMethodParams<'signTransaction'>): CoreMethodResponse<'signTransaction'>;
|
|
842
|
-
/**
|
|
843
|
-
* @deprecated
|
|
844
|
-
* Sends a transaction.
|
|
845
|
-
* @param walletId - id of the wallet to send the transaction from.
|
|
846
|
-
* @param rlpEncodedTxBase64 - rlp encoded tx as base64 string
|
|
847
|
-
* @param chainId - chain id of the chain the transaction is being sent on.
|
|
848
|
-
**/
|
|
849
|
-
sendTransaction({ walletId, rlpEncodedTxBase64, chainId, }: {
|
|
850
|
-
walletId: string;
|
|
851
|
-
rlpEncodedTxBase64: string;
|
|
852
|
-
chainId: string;
|
|
853
|
-
}): Promise<FullSignatureRes>;
|
|
854
619
|
protected isProviderModalDisabled(): boolean;
|
|
855
620
|
/**
|
|
856
621
|
* Starts a on-ramp or off-ramp transaction and returns the Para Portal link for the user to finalize and complete it.
|
|
@@ -867,39 +632,21 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
867
632
|
keepSessionAlive(): Promise<boolean>;
|
|
868
633
|
/**
|
|
869
634
|
* Serialize the current session for import by another Para instance.
|
|
635
|
+
* @param {boolean} excludeSigners - whether or not to exclude the signer from the exported wallets.
|
|
870
636
|
* @returns {string} the serialized session
|
|
871
637
|
*/
|
|
872
|
-
exportSession(): CoreMethodResponse<'exportSession'>;
|
|
638
|
+
exportSession({ excludeSigners }?: CoreMethodParams<'exportSession'>): CoreMethodResponse<'exportSession'>;
|
|
873
639
|
/**
|
|
874
640
|
* Imports a session serialized by another Para instance.
|
|
875
641
|
* @param {string} serializedInstanceBase64 the serialized session
|
|
876
642
|
*/
|
|
877
643
|
importSession(serializedInstanceBase64: CoreMethodParams<'importSession'>): CoreMethodResponse<'importSession'>;
|
|
878
|
-
/**
|
|
879
|
-
* @deprecated
|
|
880
|
-
*/
|
|
881
|
-
protected exitAccountCreation(): void;
|
|
882
|
-
/**
|
|
883
|
-
* @deprecated
|
|
884
|
-
*/
|
|
885
|
-
protected exitLogin(): void;
|
|
886
|
-
/**
|
|
887
|
-
* @deprecated
|
|
888
|
-
*/
|
|
889
|
-
protected exitFarcaster(): void;
|
|
890
|
-
/**
|
|
891
|
-
* @deprecated
|
|
892
|
-
*/
|
|
893
|
-
protected exitOAuth(): void;
|
|
894
|
-
/**
|
|
895
|
-
* @deprecated
|
|
896
|
-
*/
|
|
897
|
-
protected exitLoops(): void;
|
|
898
644
|
/**
|
|
899
645
|
* Retrieves a token to verify the current session.
|
|
900
646
|
* @returns {Promise<string>} the ID
|
|
901
647
|
**/
|
|
902
648
|
getVerificationToken(): CoreMethodResponse<'getVerificationToken'>;
|
|
649
|
+
issueJwt({ keyIndex }?: CoreMethodParams<'issueJwt'>): CoreMethodResponse<'issueJwt'>;
|
|
903
650
|
/**
|
|
904
651
|
* Logs the user out.
|
|
905
652
|
* @param {Object} opts the options object.
|
|
@@ -908,115 +655,34 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
908
655
|
logout({ clearPregenWallets }?: {
|
|
909
656
|
clearPregenWallets?: boolean;
|
|
910
657
|
}): Promise<void>;
|
|
911
|
-
|
|
912
|
-
protected getSupportedCreateAuthMethods(): Promise<Set<AuthMethod>>;
|
|
658
|
+
protected get toStringAdditions(): Record<string, unknown>;
|
|
913
659
|
/**
|
|
914
660
|
* Converts to a string, removing sensitive data when logging this class.
|
|
915
661
|
*
|
|
916
662
|
* Doesn't work for all types of logging.
|
|
917
663
|
**/
|
|
918
664
|
toString(): string;
|
|
919
|
-
|
|
920
|
-
protected getNewCredentialAndUrl({ authMethod, isForNewDevice, portalTheme, shorten, }
|
|
665
|
+
protected devLog(...s: string[]): void;
|
|
666
|
+
protected getNewCredentialAndUrl({ authMethod, isForNewDevice, portalTheme, shorten, }?: NewCredentialUrlParams): Promise<{
|
|
921
667
|
credentialId: string;
|
|
922
|
-
url
|
|
668
|
+
url?: string;
|
|
923
669
|
}>;
|
|
924
|
-
protected getLoginUrlV2({ authMethod, shorten, portalTheme, sessionId, }: LoginUrlParams): Promise<string>;
|
|
925
|
-
protected getOAuthUrlV2({ method, deeplinkUrl }: OAuthUrlParams): Promise<string>;
|
|
926
|
-
signUpOrLogInV2({ auth, ...urlOptions }: CoreMethodParams<'signUpOrLogInV2'>): CoreMethodResponse<'signUpOrLogInV2'>;
|
|
927
|
-
verifyNewAccountV2({ verificationCode, ...urlOptions }: CoreMethodParams<'verifyNewAccountV2'>): CoreMethodResponse<'verifyNewAccountV2'>;
|
|
928
|
-
verifyOAuthV2({ method, deeplinkUrl, isCanceled, onCancel, onPoll, onOAuthUrl, ...urlOptions }: CoreMethodParams<'verifyOAuthV2'>): CoreMethodResponse<'verifyOAuthV2'>;
|
|
929
|
-
verifyFarcasterV2({ isCanceled, onConnectUri, onCancel, onPoll, ...urlOptions }: CoreMethodParams<'verifyFarcasterV2'>): CoreMethodResponse<'verifyFarcasterV2'>;
|
|
930
|
-
/**
|
|
931
|
-
* Validates the response received from an attempted Telegram login for authenticity, then
|
|
932
|
-
* creates or retrieves the corresponding Para user and prepares the Para instance to sign in with that user.
|
|
933
|
-
* @param authResponse - the response JSON object received from the Telegram widget.
|
|
934
|
-
* @returns `{ isValid: boolean; telegramUserId?: string; userId?: string; isNewUser?: boolean; supportedAuthMethods?: AuthMethod[]; biometricHints?: BiometricLocationHint[] }`
|
|
935
|
-
*/
|
|
936
|
-
verifyTelegramV2({ telegramAuthResponse, ...urlOptions }: CoreMethodParams<'verifyTelegramV2'>): CoreMethodResponse<'verifyTelegramV2'>;
|
|
937
|
-
/**
|
|
938
|
-
* Waits for the session to be active and sets up the user.
|
|
939
|
-
*
|
|
940
|
-
* @param {Object} opts the options object
|
|
941
|
-
* @param {Window} [opts.popupWindow] the popup window being used for login.
|
|
942
|
-
* @param {boolean} [opts.skipSessionRefresh] whether to skip refreshing the session.
|
|
943
|
-
* @returns {Object} `{ isComplete: boolean; isError: boolean; needsWallet: boolean; partnerId: string; }` the result data
|
|
944
|
-
**/
|
|
945
|
-
waitForLoginV2({ isCanceled, onCancel, onPoll, skipSessionRefresh, }?: CoreMethodParams<'waitForLoginV2'>): CoreMethodResponse<'waitForLoginV2'>;
|
|
946
|
-
waitForSignupV2({ isCanceled, onCancel, onPoll, }: CoreMethodParams<'waitForSignupV2'>): CoreMethodResponse<'waitForSignupV2'>;
|
|
947
|
-
waitForWalletCreationV2({ isCanceled, onCancel, }?: CoreMethodParams<'waitForWalletCreationV2'>): CoreMethodResponse<'waitForWalletCreationV2'>;
|
|
948
|
-
loginExternalWalletV2({ externalWallet, ...urlOptions }: CoreMethodParams<'loginExternalWalletV2'>): CoreMethodResponse<'loginExternalWalletV2'>;
|
|
949
|
-
verifyExternalWalletV2({ externalWallet, signedMessage, cosmosPublicKeyHex, cosmosSigner, ...urlOptions }: CoreMethodParams<'verifyExternalWalletV2'>): CoreMethodResponse<'verifyExternalWalletV2'>;
|
|
950
|
-
/**
|
|
951
|
-
* Performs 2FA verification.
|
|
952
|
-
* @param {Object} opts the options object
|
|
953
|
-
* @param {string} opts.email the email to use for performing a 2FA verification.
|
|
954
|
-
* @param {string} opts.verificationCode the verification code to received via 2FA.
|
|
955
|
-
* @returns {Object} `{ address, initiatedAt, status, userId, walletId }`
|
|
956
|
-
*/
|
|
957
|
-
verify2faV2({ auth, verificationCode }: CoreMethodParams<'verify2faV2'>): CoreMethodResponse<'verify2faV2'>;
|
|
958
670
|
/**
|
|
959
|
-
*
|
|
960
|
-
* @returns {string} uri - uri to use for setting up 2FA
|
|
961
|
-
* */
|
|
962
|
-
setup2faV2(): CoreMethodResponse<'setup2faV2'>;
|
|
963
|
-
/**
|
|
964
|
-
* Enables 2FA.
|
|
671
|
+
* Returns a Para Portal URL for logging in with a WebAuth passkey or a password.
|
|
965
672
|
* @param {Object} opts the options object
|
|
966
|
-
* @param {
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
* If no types are provided, this method will create one for each of the non-optional types
|
|
982
|
-
* specified in the instance's `supportedWalletTypes` array that are not already present.
|
|
983
|
-
* @param {Object} opts the options object.
|
|
984
|
-
* @param {string} opts.pregenIdentifier the identifier to associate each wallet with.
|
|
985
|
-
* @param {TPregenIdentifierType} opts.pregenIdentifierType - either `'EMAIL'` or `'PHONE'`.
|
|
986
|
-
* @param {WalletType[]} [opts.types] the wallet types to create. Defaults to any types the instance supports that are not already present.
|
|
987
|
-
* @returns {Wallet[]} an array containing the created wallets.
|
|
988
|
-
**/
|
|
989
|
-
createPregenWalletPerTypeV2({ types, pregenId, }: CoreMethodParams<'createPregenWalletPerTypeV2'>): CoreMethodResponse<'createPregenWalletPerTypeV2'>;
|
|
990
|
-
/**
|
|
991
|
-
* Claims a pregenerated wallet.
|
|
992
|
-
* @param {Object} opts the options object.
|
|
993
|
-
* @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
|
|
994
|
-
* @param {TPregenIdentifierType} opts.pregenIdentifierType type of the identifier of the user claiming the wallet
|
|
995
|
-
* @returns {[Wallet, string | null]} `[wallet, recoveryShare]` - the wallet object and the new recovery share.
|
|
996
|
-
**/
|
|
997
|
-
claimPregenWalletsV2({ pregenId, }?: CoreMethodParams<'claimPregenWalletsV2'>): CoreMethodResponse<'claimPregenWalletsV2'>;
|
|
998
|
-
/**
|
|
999
|
-
* Updates the identifier for a pregen wallet.
|
|
1000
|
-
* @param {Object} opts the options object.
|
|
1001
|
-
* @param {string} opts.walletId the pregen wallet ID
|
|
1002
|
-
* @param {string} opts.newPregenIdentifier the new identtifier
|
|
1003
|
-
* @param {TPregenIdentifierType} opts.newPregenIdentifierType: the new identifier type
|
|
1004
|
-
**/
|
|
1005
|
-
updatePregenWalletIdentifierV2({ walletId, newPregenId, }: CoreMethodParams<'updatePregenWalletIdentifierV2'>): CoreMethodResponse<'updatePregenWalletIdentifierV2'>;
|
|
1006
|
-
/**
|
|
1007
|
-
* Checks if a pregen Wallet exists for the given identifier with the current partner.
|
|
1008
|
-
* @param {Object} opts the options object.
|
|
1009
|
-
* @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
|
|
1010
|
-
* @param {TPregenIdentifierType} opts.pregenIdentifierType type of the string of the identifier of the user claiming the wallet
|
|
1011
|
-
* @returns {boolean} whether the pregen wallet exists
|
|
1012
|
-
**/
|
|
1013
|
-
hasPregenWalletV2({ pregenId }: CoreMethodParams<'hasPregenWalletV2'>): CoreMethodResponse<'hasPregenWalletV2'>;
|
|
1014
|
-
/**
|
|
1015
|
-
* Get pregen wallets for the given identifier.
|
|
1016
|
-
* @param {Object} opts the options object.
|
|
1017
|
-
* @param {string} opts.pregenIdentifier - the identifier of the user claiming the wallet
|
|
1018
|
-
* @param {TPregenIdentifierType} opts.pregenIdentifierType - type of the identifier of the user claiming the wallet
|
|
1019
|
-
* @returns {Promise<WalletEntity[]>} the array of found wallets
|
|
1020
|
-
**/
|
|
1021
|
-
getPregenWalletsV2({ pregenId, }?: CoreMethodParams<'getPregenWalletsV2'>): CoreMethodResponse<'getPregenWalletsV2'>;
|
|
673
|
+
* @param {String} opts.auth - the user auth to sign up or log in with, in the form ` { email: string } | { phone: `+${number}` } `
|
|
674
|
+
* @param {boolean} opts.useShortUrls - whether to shorten the generated portal URLs
|
|
675
|
+
* @param {Theme} opts.portalTheme the Para Portal theme to apply to the password creation URL, if other than the default theme
|
|
676
|
+
* @returns {SignUpOrLogInResponse} an object in the form of either: `{ stage: 'verify' }` or `{ stage: 'login'; passkeyUrl?: string; passwordUrl?: string; biometricHints?: BiometricLocationHint[] }`
|
|
677
|
+
*/
|
|
678
|
+
protected getLoginUrl({ authMethod, shorten, portalTheme, sessionId, }: LoginUrlParams): Promise<string>;
|
|
679
|
+
signUpOrLogIn({ auth, ...urlOptions }: CoreMethodParams<'signUpOrLogIn'>): CoreMethodResponse<'signUpOrLogIn'>;
|
|
680
|
+
verifyNewAccount({ verificationCode, ...urlOptions }: CoreMethodParams<'verifyNewAccount'>): CoreMethodResponse<'verifyNewAccount'>;
|
|
681
|
+
getLinkedAccounts({ withMetadata, }?: CoreMethodParams<'getLinkedAccounts'>): CoreMethodResponse<'getLinkedAccounts'>;
|
|
682
|
+
protected linkAccount(opts: InternalMethodParams<'linkAccount'>): InternalMethodResponse<'linkAccount'>;
|
|
683
|
+
protected unlinkAccount({ linkedAccountId, }: InternalMethodParams<'unlinkAccount'>): InternalMethodResponse<'unlinkAccount'>;
|
|
684
|
+
protected verifyLink({ accountLinkInProgress, ...opts }?: {
|
|
685
|
+
accountLinkInProgress?: AccountLinkInProgress;
|
|
686
|
+
} & Partial<Pick<VerifyLinkParams, 'verificationCode' | 'telegramAuthResponse'> & VerifyExternalWalletParams>): Promise<LinkedAccounts>;
|
|
687
|
+
protected verifyEmailOrPhoneLink({ verificationCode, }: InternalMethodParams<'verifyEmailOrPhoneLink'>): InternalMethodResponse<'verifyEmailOrPhoneLink'>;
|
|
1022
688
|
}
|