@getpara/core-sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/cjs/ParaCore.js +2600 -0
  2. package/dist/cjs/PlatformUtils.js +2 -0
  3. package/dist/cjs/StorageUtils.js +2 -0
  4. package/dist/cjs/cryptography/utils.js +251 -0
  5. package/dist/cjs/definitions.js +155 -0
  6. package/dist/cjs/errors.js +27 -0
  7. package/dist/cjs/external/mpcComputationClient.js +33 -0
  8. package/dist/cjs/external/userManagementClient.js +51 -0
  9. package/dist/cjs/index.js +81 -0
  10. package/dist/cjs/package.json +1 -0
  11. package/dist/cjs/shares/KeyContainer.js +84 -0
  12. package/dist/cjs/shares/recovery.js +62 -0
  13. package/dist/cjs/shares/shareDistribution.js +67 -0
  14. package/dist/cjs/transmission/transmissionUtils.js +73 -0
  15. package/dist/cjs/types/index.js +20 -0
  16. package/dist/cjs/types/params.js +2 -0
  17. package/dist/cjs/types/popupTypes.js +12 -0
  18. package/dist/cjs/types/theme.js +2 -0
  19. package/dist/cjs/types/walletTypes.js +2 -0
  20. package/dist/cjs/utils/formattingUtils.js +71 -0
  21. package/dist/cjs/utils/pollingUtils.js +25 -0
  22. package/dist/esm/ParaCore.js +2563 -0
  23. package/dist/esm/PlatformUtils.js +1 -0
  24. package/dist/esm/StorageUtils.js +1 -0
  25. package/dist/esm/cryptography/utils.js +226 -0
  26. package/dist/esm/definitions.js +142 -0
  27. package/dist/esm/errors.js +21 -0
  28. package/dist/esm/external/mpcComputationClient.js +26 -0
  29. package/dist/esm/external/userManagementClient.js +42 -0
  30. package/dist/esm/index.js +19 -0
  31. package/dist/esm/package.json +1 -0
  32. package/dist/esm/shares/KeyContainer.js +57 -0
  33. package/dist/esm/shares/recovery.js +58 -0
  34. package/dist/esm/shares/shareDistribution.js +63 -0
  35. package/dist/esm/transmission/transmissionUtils.js +45 -0
  36. package/dist/esm/types/index.js +4 -0
  37. package/dist/esm/types/params.js +1 -0
  38. package/dist/esm/types/popupTypes.js +9 -0
  39. package/dist/esm/types/theme.js +1 -0
  40. package/dist/esm/types/walletTypes.js +1 -0
  41. package/dist/esm/utils/formattingUtils.js +58 -0
  42. package/dist/esm/utils/pollingUtils.js +21 -0
  43. package/dist/types/ParaCore.d.ts +1021 -0
  44. package/dist/types/PlatformUtils.d.ts +48 -0
  45. package/dist/types/StorageUtils.d.ts +20 -0
  46. package/dist/types/cryptography/utils.d.ts +51 -0
  47. package/dist/types/definitions.d.ts +88 -0
  48. package/dist/types/errors.d.ts +12 -0
  49. package/dist/types/external/mpcComputationClient.d.ts +2 -0
  50. package/dist/types/external/userManagementClient.d.ts +13 -0
  51. package/dist/types/index.d.ts +22 -0
  52. package/dist/types/shares/KeyContainer.d.ts +14 -0
  53. package/dist/types/shares/recovery.d.ts +12 -0
  54. package/dist/types/shares/shareDistribution.d.ts +12 -0
  55. package/dist/types/transmission/transmissionUtils.d.ts +3 -0
  56. package/dist/types/types/index.d.ts +4 -0
  57. package/dist/types/types/params.d.ts +24 -0
  58. package/dist/types/types/popupTypes.d.ts +8 -0
  59. package/dist/types/types/theme.d.ts +12 -0
  60. package/dist/types/types/walletTypes.d.ts +11 -0
  61. package/dist/types/utils/formattingUtils.d.ts +16 -0
  62. package/dist/types/utils/pollingUtils.d.ts +1 -0
  63. package/package.json +44 -0
@@ -0,0 +1,1021 @@
1
+ import Client, { AuthMethod, AuthType, BackupKitEmailProps, CurrentWalletIds, EmailTheme, PartnerEntity, WalletEntity, WalletType, WalletScheme, WalletParams, OAuthMethod, OnRampPurchaseCreateParams, OnRampPurchase, TPregenIdentifierType, PregenIds, BiometricLocationHint, TelegramAuthResponse, VerifyTelegramRes, Auth } from '@getpara/user-management-client';
2
+ import type { pki as pkiType } from 'node-forge';
3
+ import { Ctx, Environment, WalletFilters, WalletTypeProp } from './definitions.js';
4
+ import { Theme, FullSignatureRes, EmbeddedWalletType, ExternalWalletType, ExternalWalletInfo } from './types/index.js';
5
+ import { PlatformUtils } from './PlatformUtils.js';
6
+ import { CountryCallingCode } from 'libphonenumber-js';
7
+ export declare function entityToWallet(w: WalletEntity): Omit<Wallet, 'signer'>;
8
+ export type SupportedWalletTypeConfig = {
9
+ optional?: boolean;
10
+ };
11
+ export type deprecated__SupportedWalletTypesOpt = {
12
+ [WalletType.EVM]?: boolean | SupportedWalletTypeConfig;
13
+ [WalletType.SOLANA]?: boolean | SupportedWalletTypeConfig;
14
+ [WalletType.COSMOS]?: boolean | (SupportedWalletTypeConfig & {
15
+ prefix?: string;
16
+ });
17
+ };
18
+ export type SupportedWalletTypes = {
19
+ type: WalletType;
20
+ optional?: boolean;
21
+ }[];
22
+ export declare enum RecoveryStatus {
23
+ INITIATED = "INITIATED",
24
+ READY = "READY",
25
+ EXPIRED = "EXPIRED",
26
+ FINISHED = "FINISHED",
27
+ CANCELLED = "CANCELLED"
28
+ }
29
+ /** @deprecated */
30
+ export declare enum PregenIdentifierType {
31
+ EMAIL = "EMAIL",
32
+ PHONE = "PHONE"
33
+ }
34
+ export interface Wallet {
35
+ createdAt?: string;
36
+ id: string;
37
+ name?: string;
38
+ signer: string;
39
+ address?: string;
40
+ addressSecondary?: string;
41
+ publicKey?: string;
42
+ scheme?: WalletScheme;
43
+ type?: EmbeddedWalletType | ExternalWalletType;
44
+ isPregen?: boolean;
45
+ pregenIdentifier?: string;
46
+ pregenIdentifierType?: TPregenIdentifierType;
47
+ userId?: string;
48
+ partnerId?: string;
49
+ partner?: PartnerEntity;
50
+ lastUsedAt?: string;
51
+ lastUsedPartner?: PartnerEntity;
52
+ lastUsedPartnerId?: string;
53
+ isExternal?: boolean;
54
+ }
55
+ export interface ConstructorOpts {
56
+ useStorageOverrides?: boolean;
57
+ disableWorkers?: boolean;
58
+ offloadMPCComputationURL?: string;
59
+ useLocalFiles?: boolean;
60
+ localStorageGetItemOverride?: (key: string) => Promise<string | null>;
61
+ localStorageSetItemOverride?: (key: string, value: string) => Promise<void>;
62
+ sessionStorageGetItemOverride?: (key: string) => Promise<string | null>;
63
+ sessionStorageSetItemOverride?: (key: string, value: string) => Promise<void>;
64
+ sessionStorageRemoveItemOverride?: (key: string) => Promise<void>;
65
+ clearStorageOverride?: () => Promise<void>;
66
+ /**
67
+ * Hex color to use in the portal for the background color.
68
+ * @deprecated use portalTheme instead
69
+ */
70
+ portalBackgroundColor?: string;
71
+ /**
72
+ * Hex color to use in the portal for the primary button.
73
+ * @deprecated use portalTheme instead
74
+ */
75
+ portalPrimaryButtonColor?: string;
76
+ /**
77
+ * Hex text color to use in the portal.
78
+ * @deprecated use portalTheme instead
79
+ */
80
+ portalTextColor?: string;
81
+ /**
82
+ * Hex color to use in the portal for the primary button text.
83
+ * @deprecated use portalTheme instead
84
+ */
85
+ portalPrimaryButtonTextColor?: string;
86
+ /**
87
+ * Theme to use for the portal
88
+ * @deprecated configure theming through the developer portal
89
+ */
90
+ portalTheme?: Theme;
91
+ useDKLSForCreation?: boolean;
92
+ disableWebSockets?: boolean;
93
+ wasmOverride?: ArrayBuffer;
94
+ /**
95
+ * Base theme for the emails sent from this Para instance.
96
+ * @default - dark
97
+ * @deprecated configure theming through the developer portal
98
+ */
99
+ emailTheme?: EmailTheme;
100
+ /**
101
+ * Hex color to use as the primary color in the emails.
102
+ * @default - #FE452B
103
+ * @deprecated configure theming through the developer portal
104
+ */
105
+ emailPrimaryColor?: string;
106
+ /**
107
+ * Linkedin URL to link to in the emails. Should be a secure URL string starting with https://www.linkedin.com/company/.
108
+ * @deprecated configure this through the developer portal
109
+ */
110
+ linkedinUrl?: string;
111
+ /**
112
+ * Github URL to link to in the emails. Should be a secure URL string starting with https://github.com/.
113
+ * @deprecated configure this through the developer portal
114
+ */
115
+ githubUrl?: string;
116
+ /**
117
+ * X (Twitter) URL to link to in the emails. Should be a secure URL string starting with https://twitter.com/.
118
+ * @deprecated configure this through the developer portal
119
+ */
120
+ xUrl?: string;
121
+ /**
122
+ * Support URL to link to in the emails. This can be a secure https URL or a mailto: string. Will default to using the stored application URL is nothing is provided here.
123
+ * @deprecated homepageUrl will be used for this, configure it through the developer portal
124
+ */
125
+ supportUrl?: string;
126
+ /**
127
+ * URL for your home landing page. Should be a secure URL string starting with https://.
128
+ * @deprecated configure this through the developer portal
129
+ */
130
+ homepageUrl?: string;
131
+ /**
132
+ * Which type of wallet your application supports, in the form `{ [WalletType]: true }`. Currently allowed values for `WalletType` are `'EVM'`, `'SOLANA'`, or `'COSMOS'`.
133
+ *
134
+ * To specify which prefix to use for new Cosmos wallets, pass `{ COSMOS: { prefix: 'your-prefix' } }`. Defaults to `'cosmos'`.
135
+ * @deprecated Configure your app's supported wallet types in the Para Developer Portal.
136
+ */
137
+ supportedWalletTypes?: deprecated__SupportedWalletTypesOpt;
138
+ /**
139
+ * If `true`, the SDK will use the device's temporary session storage instead of saving user and wallet data to local storage.
140
+ */
141
+ useSessionStorage?: boolean;
142
+ /**
143
+ * Partner ID set in the Para Portal to track analytics for legacy SDK versions. This variable is unused outside of the Para Portal.
144
+ */
145
+ portalPartnerId?: string;
146
+ }
147
+ type PortalUrlOptions = {
148
+ params?: Record<string, string | undefined | null>;
149
+ authType?: AuthType;
150
+ isForNewDevice?: boolean;
151
+ loginEncryptionPublicKey?: string;
152
+ newDeviceSessionId?: string;
153
+ newDeviceEncryptionKey?: string;
154
+ partnerId?: string;
155
+ sessionId?: string;
156
+ theme?: Theme;
157
+ pathId?: string;
158
+ displayName?: string;
159
+ pfpUrl?: string;
160
+ };
161
+ export declare const PREFIX = "@CAPSULE/";
162
+ export declare function stringToPhoneNumber(str: string): string;
163
+ export declare function normalizePhoneNumber(countryCode: string, number: string): string | undefined;
164
+ export declare function isWalletSupported(types: WalletType[], wallet: Omit<Wallet, 'signer'>): boolean;
165
+ export declare function getWalletTypes(schemes: WalletScheme[]): WalletType[];
166
+ export declare function getEquivalentTypes(types: WalletTypeProp[] | WalletTypeProp): WalletType[];
167
+ export declare function isCosmosRequired(supportedWalletTypes: SupportedWalletTypes): boolean;
168
+ export declare abstract class ParaCore {
169
+ #private;
170
+ static version?: string;
171
+ ctx: Ctx;
172
+ protected email?: string;
173
+ protected phone?: string;
174
+ protected countryCode?: CountryCallingCode;
175
+ private farcasterUsername?;
176
+ telegramUserId?: string;
177
+ private userId?;
178
+ private sessionCookie?;
179
+ private isAwaitingAccountCreation;
180
+ private isAwaitingLogin;
181
+ private isAwaitingFarcaster;
182
+ private isAwaitingOAuth;
183
+ get isEmail(): boolean;
184
+ get isPhone(): boolean;
185
+ get isFarcaster(): boolean;
186
+ get isTelegram(): boolean;
187
+ /**
188
+ * 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.
189
+ */
190
+ currentWalletIds: CurrentWalletIds;
191
+ get currentWalletIdsArray(): [string, WalletType][];
192
+ get currentWalletIdsUnique(): string[];
193
+ /**
194
+ * Wallets associated with the `ParaCore` instance. Retrieve a particular wallet using `para.wallets[walletId]`.
195
+ */
196
+ wallets: Record<string, Wallet>;
197
+ /**
198
+ * The addresses of the currently active external wallets.
199
+ */
200
+ currentExternalWalletAddresses?: string[];
201
+ /**
202
+ * Wallets associated with the `ParaCore` instance.
203
+ */
204
+ externalWallets: Record<string, Wallet>;
205
+ /**
206
+ * A map of pre-generated wallet identifiers that can be claimed in the current instance.
207
+ */
208
+ get pregenIds(): PregenIds;
209
+ /**
210
+ * Whether the instance has multiple wallets connected.
211
+ */
212
+ get isMultiWallet(): boolean;
213
+ /**
214
+ * Base theme for the emails sent from this Para instance.
215
+ * @default - dark
216
+ * @deprecated configure theming through the developer portal
217
+ */
218
+ emailTheme?: EmailTheme;
219
+ /**
220
+ * Hex color to use as the primary color in the emails.
221
+ * @default - #FE452B
222
+ * @deprecated configure theming through the developer portal
223
+ */
224
+ emailPrimaryColor?: string;
225
+ /**
226
+ * Linkedin URL to link to in the emails. Should be a secure URL string starting with https://www.linkedin.com/company/.
227
+ * @deprecated configure this through the developer portal
228
+ */
229
+ linkedinUrl?: string;
230
+ /**
231
+ * Github URL to link to in the emails. Should be a secure URL string starting with https://github.com/.
232
+ * @deprecated configure this through the developer portal
233
+ */
234
+ githubUrl?: string;
235
+ /**
236
+ * X (Twitter) URL to link to in the emails. Should be a secure URL string starting with https://twitter.com/.
237
+ * @deprecated configure this through the developer portal
238
+ */
239
+ xUrl?: string;
240
+ /**
241
+ * Support URL to link to in the emails. This can be a secure https URL or a mailto: string. Will default to using the stored application URL is nothing is provided here.
242
+ * @deprecated homepageUrl will be used for this, configure it through the developer portal
243
+ */
244
+ supportUrl?: string;
245
+ /**
246
+ * URL for your home landing page. Should be a secure URL string starting with https://.
247
+ * @deprecated configure this through the developer portal
248
+ */
249
+ homepageUrl?: string;
250
+ /**
251
+ * Encryption key pair generated from loginEncryptionKey.
252
+ */
253
+ loginEncryptionKeyPair?: pkiType.rsa.KeyPair;
254
+ /**
255
+ * Hex color to use in the portal for the background color.
256
+ * @deprecated use portalTheme instead
257
+ */
258
+ portalBackgroundColor?: string;
259
+ /**
260
+ * Hex color to use in the portal for the primary button.
261
+ * @deprecated use portalTheme instead
262
+ */
263
+ portalPrimaryButtonColor?: string;
264
+ /**
265
+ * Hex text color to use in the portal.
266
+ * @deprecated use portalTheme instead
267
+ */
268
+ portalTextColor?: string;
269
+ /**
270
+ * Hex color to use in the portal for the primary button text.
271
+ * @deprecated use portalTheme instead
272
+ */
273
+ portalPrimaryButtonTextColor?: string;
274
+ /**
275
+ * Theme to use for the portal
276
+ * @deprecated configure theming through the developer portal
277
+ */
278
+ portalTheme?: Theme;
279
+ private disableProviderModal?;
280
+ get supportedWalletTypes(): SupportedWalletTypes;
281
+ get isWalletTypeEnabled(): Partial<Record<WalletType, boolean>>;
282
+ private platformUtils;
283
+ private localStorageGetItem;
284
+ private localStorageSetItem;
285
+ private sessionStorageGetItem;
286
+ private sessionStorageSetItem;
287
+ private sessionStorageRemoveItem;
288
+ retrieveSessionCookie: () => string | undefined;
289
+ persistSessionCookie: (cookie: string) => void;
290
+ /**
291
+ * Remove all local storage and prefixed session storage.
292
+ * @param {'local' | 'session' | 'secure' | 'all'} type - Type of storage to clear. Defaults to 'all'.
293
+ */
294
+ clearStorage: (type?: 'local' | 'session' | 'secure' | 'all') => Promise<void>;
295
+ private convertBigInt;
296
+ private convertEncryptionKeyPair;
297
+ private isPortal;
298
+ private isParaConnect;
299
+ private requireApiKey;
300
+ private isWalletSupported;
301
+ private isWalletOwned;
302
+ private isPregenWalletUnclaimed;
303
+ private isPregenWalletClaimable;
304
+ private isWalletUsable;
305
+ /**
306
+ * Returns the formatted address for the desired wallet ID, depending on your app settings.
307
+ * @param {string} walletId the ID of the wallet address to display.
308
+ * @param {object} options additional options for formatting the address.
309
+ * @param {boolean} options.truncate whether to truncate the address.
310
+ * @param {WalletType} options.addressType the type of address to display.
311
+ * @returns the formatted address
312
+ */
313
+ getDisplayAddress(walletId: string, options?: {
314
+ truncate?: boolean;
315
+ addressType?: WalletTypeProp | undefined;
316
+ } | undefined): string;
317
+ /**
318
+ * Returns a unique hash for a wallet suitable for use as an identicon seed.
319
+ * @param {string} walletId the ID of the wallet.
320
+ * @param {boolean} options.addressType used to format the hash for another wallet type.
321
+ * @returns the identicon hash string
322
+ */
323
+ getIdenticonHash(walletId: string, overrideType?: WalletType): string | undefined;
324
+ getWallets(): Record<string, Wallet>;
325
+ getAddress(walletId?: string): string | undefined;
326
+ protected abstract getPlatformUtils(): PlatformUtils;
327
+ private constructPortalUrl;
328
+ /**
329
+ * Constructs a new `ParaCore` instance.
330
+ * @param env - `Environment` to use.
331
+ * @param apiKey - API key to use.
332
+ * @param opts - Additional constructor options; see `ConstructorOpts`.
333
+ * @returns - A new ParaCore instance.
334
+ */
335
+ constructor(env: Environment, apiKey?: string, opts?: ConstructorOpts);
336
+ touchSession(regenerate?: boolean): Promise<Awaited<ReturnType<Client['touchSession']>>>;
337
+ private setSupportedWalletTypes;
338
+ private getVerificationEmailProps;
339
+ private getBackupKitEmailProps;
340
+ /**
341
+ * Initialize storage relating to a `ParaCore` instance.
342
+ *
343
+ * Init only needs to be called for storage that is async.
344
+ */
345
+ init(): Promise<void>;
346
+ /**
347
+ * Sets the email associated with the `ParaCore` instance.
348
+ * @param email - Email to set.
349
+ */
350
+ setEmail(email: string): Promise<void>;
351
+ /**
352
+ * Sets the Telegram user ID associated with the `ParaCore` instance.
353
+ * @param telegramUserId - Telegram user ID to set.
354
+ */
355
+ setTelegramUserId(telegramUserId: string): Promise<void>;
356
+ /**
357
+ * Sets the phone number associated with the `ParaCore` instance.
358
+ * @param phone - Phone number to set.
359
+ * @param countryCode - Country Code to set.
360
+ */
361
+ setPhoneNumber(phone: string, countryCode: CountryCallingCode): Promise<void>;
362
+ /**
363
+ * Sets the farcaster username associated with the `ParaCore` instance.
364
+ * @param farcasterUsername - Farcaster Username to set.
365
+ */
366
+ setFarcasterUsername(farcasterUsername: string): Promise<void>;
367
+ /**
368
+ * Sets the external wallet address and type associated with the `ParaCore` instance.
369
+ * @param externalAddress - External wallet address to set.
370
+ * @param externalType - Type of external wallet to set.
371
+ */
372
+ setExternalWallet({ address, type, provider, addressBech32 }: ExternalWalletInfo): Promise<void>;
373
+ /**
374
+ * Sets the user id associated with the `ParaCore` instance.
375
+ * @param userId - User id to set.
376
+ */
377
+ setUserId(userId: string): Promise<void>;
378
+ /**
379
+ * Sets the wallets associated with the `ParaCore` instance.
380
+ * @param wallets - Wallets to set.
381
+ */
382
+ setWallets(wallets: Record<string, Wallet>): Promise<void>;
383
+ /**
384
+ * Sets the external wallets associated with the `ParaCore` instance.
385
+ * @param externalWallets - External wallets to set.
386
+ */
387
+ setExternalWallets(externalWallets: Record<string, Wallet>): Promise<void>;
388
+ setCurrentExternalWalletAddresses(currentExternalWalletAddresses: string[]): Promise<void>;
389
+ /**
390
+ * Sets the login encryption key pair associated with the `ParaCore` instance.
391
+ * @param keyPair - Encryption key pair generated from loginEncryptionKey.
392
+ */
393
+ protected setLoginEncryptionKeyPair(keyPair?: pkiType.rsa.KeyPair): Promise<void>;
394
+ private deleteLoginEncryptionKeyPair;
395
+ /**
396
+ * Gets the userId associated with the `ParaCore` instance.
397
+ * @returns - userId associated with the `ParaCore` instance.
398
+ */
399
+ getUserId(): string | undefined;
400
+ /**
401
+ * Gets the email associated with the `ParaCore` instance.
402
+ * @returns - email associated with the `ParaCore` instance.
403
+ */
404
+ getEmail(): string | undefined;
405
+ /**
406
+ * Gets the phone object associated with the `ParaCore` instance.
407
+ * @returns - phone object with phone number and country code associated with the `ParaCore` instance.
408
+ */
409
+ getPhone(): {
410
+ phone?: string;
411
+ countryCode?: string;
412
+ };
413
+ /**
414
+ * Gets the formatted phone number associated with the `ParaCore` instance.
415
+ * @returns - formatted phone number associated with the `ParaCore` instance.
416
+ */
417
+ getPhoneNumber(): string | undefined;
418
+ /**
419
+ * Gets the farcaster username associated with the `ParaCore` instance.
420
+ * @returns - farcaster username associated with the `ParaCore` instance.
421
+ */
422
+ getFarcasterUsername(): string | undefined;
423
+ setCurrentWalletIds(currentWalletIds: CurrentWalletIds, { needsWallet, sessionLookupId, newDeviceSessionLookupId, }?: {
424
+ needsWallet?: boolean;
425
+ sessionLookupId?: string;
426
+ newDeviceSessionLookupId?: string;
427
+ }): Promise<void>;
428
+ /**
429
+ * The prefix for the instance's managed Cosmos wallets. Defaults to `'cosmos'`.
430
+ */
431
+ cosmosPrefix?: string;
432
+ /**
433
+ * Validates that a wallet ID is present on the instance, usable, and matches the desired filters.
434
+ * If no ID is passed, this will instead return the first valid, usable wallet ID that matches the filters.
435
+ * @param {string} [walletId] the wallet ID to validate.
436
+ * @param {WalletFilters} [filter={}] a `WalletFilters` object specifying allowed types, schemes, and whether to forbid unclaimed pregen wallets.
437
+ * @returns {string} the wallet ID originally passed, or the one found.
438
+ */
439
+ findWalletId(walletId?: string, filter?: WalletFilters): string;
440
+ /**
441
+ * Retrieves a wallet with the given address, if present.
442
+ * If no ID is passed, this will instead return the first valid, usable wallet ID that matches the filters.
443
+ * @param {string} [walletId] the wallet ID to validate.
444
+ * @param {WalletFilters} [filter={}] a `WalletFilters` object specifying allowed types, schemes, and whether to forbid unclaimed pregen wallets.
445
+ * @returns {string} the wallet ID originally passed, or the one found.
446
+ */
447
+ findWalletByAddress(address: string, filter?: WalletFilters | undefined): any;
448
+ findWallet(idOrAddress?: string, overrideType?: WalletTypeProp, filter?: WalletFilters): Omit<Wallet, 'signer'> | undefined;
449
+ get availableWallets(): Pick<Wallet, 'id' | 'type' | 'name' | 'address' | 'isExternal'>[];
450
+ /**
451
+ * Retrieves all usable wallets with the provided type (`'EVM' | 'COSMOS' | 'SOLANA'`)
452
+ * @param {string} type the wallet type to filter by.
453
+ * @returns {Wallet[]} an array of matching wallets.
454
+ */
455
+ getWalletsByType(type: WalletTypeProp): Wallet[];
456
+ private assertIsValidWalletId;
457
+ private assertIsValidWalletType;
458
+ private getMissingTypes;
459
+ private getTypesToCreate;
460
+ private getPartnerURL;
461
+ /**
462
+ * URL of the portal, which can be associated with a partner id
463
+ * @param partnerId: string - id of the partner to get the portal URL for
464
+ * @returns - portal URL
465
+ */
466
+ protected getPortalURL(partnerId?: string): Promise<string>;
467
+ private getWebAuthURLForCreate;
468
+ private getPasswordURLForCreate;
469
+ private getShortUrl;
470
+ shortenLoginLink(link: string): Promise<string>;
471
+ /**
472
+ * Generates a URL that can be used to perform web auth
473
+ * for creating a new credential.
474
+ * @param sessionId - id of the session to use for web auth
475
+ * @param loginEncryptionPublicKey - public key to use for encrypting the login encryption key
476
+ * @param partnerId - id of the partner to get the portal URL for
477
+ * @param newDeviceSessionId - id of the session to use for web auth for a new device
478
+ * @param newDeviceEncryptionKey - public key to use for encrypting the login encryption key for a new device
479
+ * @returns - web auth url
480
+ */
481
+ getWebAuthURLForLogin(options: Pick<PortalUrlOptions, 'authType' | 'partnerId' | 'newDeviceSessionId' | 'newDeviceEncryptionKey' | 'displayName' | 'pfpUrl'> & {
482
+ sessionId: string;
483
+ loginEncryptionPublicKey: string;
484
+ }): Promise<string>;
485
+ getPasswordURLForLogin(options: Pick<PortalUrlOptions, 'authType' | 'partnerId' | 'newDeviceSessionId' | 'newDeviceEncryptionKey' | 'displayName' | 'pfpUrl'> & {
486
+ sessionId: string;
487
+ loginEncryptionPublicKey: string;
488
+ }): Promise<string>;
489
+ /**
490
+ * Generates a URL that can be used to perform web auth for phone number
491
+ * for creating a new credential.
492
+ * @param sessionId - id of the session to use for web auth
493
+ * @param loginEncryptionPublicKey - public key to use for encrypting the login encryption key
494
+ * @param partnerId - id of the partner to get the portal URL for
495
+ * @param newDeviceSessionId - id of the session to use for web auth for a new device
496
+ * @param newDeviceEncryptionKey - public key to use for encrypting the login encryption key for a new device
497
+ * @returns - web auth url
498
+ */
499
+ getWebAuthURLForLoginForPhone(options: Pick<PortalUrlOptions, 'partnerId' | 'newDeviceSessionId' | 'newDeviceEncryptionKey'> & {
500
+ sessionId: string;
501
+ loginEncryptionPublicKey: string;
502
+ }): Promise<string>;
503
+ /**
504
+ * Gets the private key for the given wallet.
505
+ * @param walletId - (optional) id of the wallet to get the private key for. Will default to the first wallet if not provided.
506
+ * @returns - private key string.
507
+ */
508
+ protected getPrivateKey(walletId?: string): Promise<string>;
509
+ /**
510
+ * Fetches the wallets associated with the user.
511
+ * @returns - wallets that were fetched.
512
+ */
513
+ fetchWallets(): Promise<WalletEntity[]>;
514
+ private populateWalletAddresses;
515
+ private populatePregenWalletAddresses;
516
+ /**
517
+ * Checks if a user exists.
518
+ * @returns - true if user exists, false otherwise.
519
+ */
520
+ checkIfUserExists(email: string): Promise<boolean>;
521
+ /**
522
+ * Checks if a user exists by their phone number.
523
+ * @returns - true if user exists, false otherwise.
524
+ */
525
+ checkIfUserExistsByPhone(phone: string, countryCode: CountryCallingCode): Promise<boolean>;
526
+ createUser({ email }: Auth<'email'>): Promise<void>;
527
+ /**
528
+ * Creates a new user with a phone number.
529
+ * @param phone - phone number to use for creating the user.
530
+ * @param countryCode - country code to use for creating the user.
531
+ */
532
+ createUserByPhone({ phone, countryCode }: Auth<'phone'>): Promise<void>;
533
+ /**
534
+ * Logs in or creates a new user using an external wallet address.
535
+ * @param externalAddress - external wallet address to use for identification.
536
+ * @param type - type of external wallet to use for identification.
537
+ * @param externalWalletProvider - name of provider for the external wallet.
538
+ */
539
+ externalWalletLogin(wallet: ExternalWalletInfo): Promise<void>;
540
+ /**
541
+ * Returns whether or not the user is connected with an external wallet.
542
+ */
543
+ protected isUsingExternalWallet(): boolean;
544
+ /**
545
+ * Passes the email code obtained from the user for verification.
546
+ * @param verificationCode
547
+ * @returns - web auth url for creating a new credential
548
+ */
549
+ verifyEmail(verificationCode: string): Promise<string>;
550
+ /**
551
+ * Passes the phone code obtained from the user for verification.
552
+ * @param verificationCode
553
+ * @returns - web auth url for creating a new credential
554
+ */
555
+ verifyPhone(verificationCode: string): Promise<string>;
556
+ /**
557
+ * Validates the response received from an attempted Telegram login for authenticity, then
558
+ * creates or retrieves the corresponding Para user and prepares the Para instance to sign in with that user.
559
+ * @param authResponse - the response JSON object received from the Telegram widget.
560
+ * @returns `{ isValid: boolean; telegramUserId?: string; userId?: string; isNewUser?: boolean; supportedAuthMethods?: AuthMethod[]; biometricHints?: BiometricLocationHint[] }`
561
+ */
562
+ verifyTelegram(authObject: TelegramAuthResponse): Promise<VerifyTelegramRes>;
563
+ /**
564
+ * Performs 2FA verification.
565
+ * @param email - email to use for performing a 2FA verification.
566
+ * @param verificationCode - verification code to received via 2FA.
567
+ * @returns { address, initiatedAt, status, userId, walletId }
568
+ */
569
+ verify2FA(email: string, verificationCode: string): Promise<{
570
+ initiatedAt?: Date;
571
+ status?: RecoveryStatus;
572
+ userId: string;
573
+ wallets: Pick<Wallet, 'address' | 'id'>[];
574
+ }>;
575
+ /**
576
+ * Performs 2FA verification.
577
+ * @param phone - phone to use for performing a 2FA verification.
578
+ * @param verificationCode - verification code to received via 2FA.
579
+ * @returns { address, initiatedAt, status, userId, walletId }
580
+ */
581
+ verify2FAForPhone(phone: string, countryCode: CountryCallingCode, verificationCode: string): Promise<{
582
+ initiatedAt?: Date;
583
+ status?: RecoveryStatus;
584
+ userId: string;
585
+ wallets: Pick<Wallet, 'address' | 'id'>[];
586
+ }>;
587
+ /**
588
+ * Sets up 2FA.
589
+ * @returns uri - uri to use for setting up 2FA
590
+ * */
591
+ setup2FA(): Promise<{
592
+ uri?: string;
593
+ }>;
594
+ /**
595
+ * Enables 2FA.
596
+ * @param verificationCode - verification code received via 2FA.
597
+ */
598
+ enable2FA(verificationCode: string): Promise<void>;
599
+ /**
600
+ * Determines if 2FA has been set up.
601
+ * @returns { isSetup } - true if 2FA is setup, false otherwise
602
+ */
603
+ check2FAStatus(): Promise<{
604
+ isSetup: boolean;
605
+ }>;
606
+ resendVerificationCode(): Promise<void>;
607
+ resendVerificationCodeByPhone(): Promise<void>;
608
+ getSetUpBiometricsURL({ authType, isForNewDevice, }?: Pick<PortalUrlOptions, 'authType' | 'isForNewDevice'>): Promise<string>;
609
+ getSetUpBiometricsURLForPhone({ isForNewDevice, }?: Pick<PortalUrlOptions, 'isForNewDevice'>): Promise<string>;
610
+ getSetupPasswordURL({ authType, isForNewDevice, theme, }?: Pick<PortalUrlOptions, 'authType' | 'isForNewDevice' | 'theme'>): Promise<string>;
611
+ isSessionActive(): Promise<boolean>;
612
+ /**
613
+ * Checks if a session is active and a wallet exists.
614
+ *
615
+ * @returns true if session is active and a wallet exists.
616
+ **/
617
+ isFullyLoggedIn(): Promise<boolean>;
618
+ protected supportedAuthMethods(auth: Auth): Promise<Set<AuthMethod>>;
619
+ /**
620
+ * Get hints associated with the users stored biometrics.
621
+ * @returns Array containing useragents and AAGuids for stored biometrics
622
+ */
623
+ protected getUserBiometricLocationHints(): Promise<BiometricLocationHint[]>;
624
+ private setAuth;
625
+ /**
626
+ * Initiates a login.
627
+ * @param email - the email to login with
628
+ * @param useShortURL - whether to shorten the link
629
+ * @returns - web auth url for logging in
630
+ **/
631
+ initiateUserLogin({ useShortUrl, ...auth }: Auth & {
632
+ useShortUrl?: boolean;
633
+ }): Promise<string>;
634
+ /**
635
+ * Initiates a login.
636
+ * @param email - the email to login with
637
+ * @returns - a set of supported auth methods for the user
638
+ **/
639
+ initiateUserLoginV2(auth: Auth): Promise<Set<AuthMethod>>;
640
+ /**
641
+ * Initiates a login.
642
+ * @param phone - the phone number to login with
643
+ * @param countryCode
644
+ * @param useShortURL - whether to shorten the link
645
+ * @returns - web auth url for logging in
646
+ **/
647
+ initiateUserLoginForPhone({ useShortUrl, ...auth }: Auth<'phone'> & {
648
+ useShortUrl?: boolean;
649
+ }): Promise<string>;
650
+ /**
651
+ * Waits for the session to be active.
652
+ **/
653
+ waitForAccountCreation(): Promise<boolean>;
654
+ waitForPasskeyAndCreateWallet(): Promise<{
655
+ walletIds: CurrentWalletIds;
656
+ recoverySecret?: string;
657
+ }>;
658
+ /**
659
+ * Initiates a Farcaster login attempt and return the URI for the user to connect.
660
+ * You can create a QR code with this URI that works with Farcaster's mobile app.
661
+ *
662
+ * @return {string}
663
+ */
664
+ getFarcasterConnectURL(): Promise<string>;
665
+ /**
666
+ * Awaits the response from a user's attempt to log in with Farcaster.
667
+ * If successful, this returns the user's Farcaster username and profile picture and indicates whether the user already exists.
668
+ *
669
+ * @param {Object} opts the options object.
670
+ * @return {Object} the user's information and whether the user already exists.
671
+ */
672
+ waitForFarcasterStatus(): Promise<{
673
+ userExists: boolean;
674
+ username: string;
675
+ pfpUrl?: string | null;
676
+ }>;
677
+ /**
678
+ * Generates a URL for the user to log in with OAuth using a desire method.
679
+ *
680
+ * @param {OAuthMethod} oAuthMethod the third-party service to use for OAuth.
681
+ * @returns {string} the URL for the user to log in with OAuth.
682
+ */
683
+ getOAuthURL(oAuthMethod: OAuthMethod): Promise<string>;
684
+ /**
685
+ * Awaits the response from a user's attempt to log in with OAuth.
686
+ * If successful, this returns the user's email address and indicates whether the user already exists.
687
+ *
688
+ * @param {Object} opts the options object.
689
+ * @param {Window} [opts.popupWindow] the popup window being used for login.
690
+ * @return {Object} the user's email address and whether the user already exists.
691
+ */
692
+ waitForOAuth({ popupWindow }?: {
693
+ popupWindow?: Window;
694
+ }): Promise<{
695
+ email?: string;
696
+ isError?: boolean;
697
+ userExists: boolean;
698
+ }>;
699
+ /**
700
+ * Waits for the session to be active and sets up the user.
701
+ *
702
+ * @param {Object} opts the options object
703
+ * @param {Window} [opts.popupWindow] the popup window being used for login.
704
+ * @param {boolean} [opts.skipSessionRefresh] whether to skip refreshing the session.
705
+ * @returns { needsWallet } - whether a wallet needs to be created
706
+ **/
707
+ waitForLoginAndSetup({ popupWindow, skipSessionRefresh, }?: {
708
+ popupWindow?: Window;
709
+ skipSessionRefresh?: boolean;
710
+ }): Promise<{
711
+ isComplete: boolean;
712
+ isError?: boolean;
713
+ needsWallet?: boolean;
714
+ partnerId?: string;
715
+ }>;
716
+ /**
717
+ * Updates the session with the user management server, possibly
718
+ * opening a popup to refresh the session.
719
+ *
720
+ * @param {Object} opts the options object.
721
+ * @param {boolean} [shouldOpenPopup] - if `true`, the running device will open a popup to reauthenticate the user.
722
+ * @returns - a URL for the user to reauthenticate.
723
+ **/
724
+ refreshSession({ shouldOpenPopup }?: {
725
+ shouldOpenPopup?: boolean;
726
+ }): Promise<string>;
727
+ /**
728
+ * Call this method after login to ensure that the user ID is set
729
+ * internally.
730
+ **/
731
+ protected userSetupAfterLogin(): Promise<{
732
+ data: {
733
+ partnerId?: string;
734
+ needsWallet?: boolean;
735
+ sessionLookupId: string;
736
+ };
737
+ }>;
738
+ /**
739
+ * Get transmission shares associated with session.
740
+ *
741
+ * @param isForNewDevice - true if this device is registering.
742
+ * @returns - transmission keyshares.
743
+ **/
744
+ protected getTransmissionKeyShares({ isForNewDevice }?: {
745
+ isForNewDevice?: boolean;
746
+ }): Promise<any>;
747
+ /**
748
+ * Call this method after login to perform setup.
749
+ *
750
+ * @param temporaryShares - optional temporary shares to use for decryption.
751
+ **/
752
+ setupAfterLogin({ temporaryShares, skipSessionRefresh, }?: {
753
+ temporaryShares?: any[];
754
+ skipSessionRefresh?: boolean;
755
+ }): Promise<void>;
756
+ /**
757
+ * Distributes a new wallet recovery share.
758
+ *
759
+ * @param walletId - the wallet to distribute the recovery share for.
760
+ * @param userShare - optional user share generate the recovery share from. Defaults to the signer from the passed in walletId
761
+ * @param skipBiometricShareCreation - whether or not to skip biometric share creation. Used when regenerating recovery shares.
762
+ * @param forceRefreshRecovery - whether or not to force recovery secret regeneration. Used when regenerating recovery shares.
763
+ * @returns - recovery share.
764
+ **/
765
+ distributeNewWalletShare({ walletId, userShare, skipBiometricShareCreation, forceRefresh, }: {
766
+ walletId: string;
767
+ userShare?: string;
768
+ skipBiometricShareCreation?: boolean;
769
+ forceRefresh?: boolean;
770
+ }): Promise<string>;
771
+ private waitForWalletAddress;
772
+ /**
773
+ * Waits for a pregen wallet address to be created.
774
+ *
775
+ * @param pregenIdentifier - the identifier of the user the pregen wallet is associated with.
776
+ * @param walletId - the wallet id
777
+ * @param pregenIdentifierType - the identifier type of the user the pregen wallet is associated with.
778
+ * @returns - recovery share.
779
+ **/
780
+ private waitForPregenWalletAddress;
781
+ /**
782
+ * Creates several new wallets with the desired types. If no types are provided, this method
783
+ * will create one for each of the non-optional types specified in the instance's `supportedWalletTypes`
784
+ * object that are not already present. This is automatically called upon account creation to ensure that
785
+ * the user has a wallet of each required type.
786
+ *
787
+ * @deprecated alias for `createWalletPerType`
788
+ **/
789
+ createWalletPerMissingType: ({ skipDistribute, types, }?: {
790
+ skipDistribute?: boolean;
791
+ types?: WalletType[];
792
+ }) => Promise<{
793
+ wallets: Wallet[];
794
+ walletIds: CurrentWalletIds;
795
+ recoverySecret?: string;
796
+ }>;
797
+ /**
798
+ * Creates several new wallets with the desired types. If no types are provided, this method
799
+ * will create one for each of the non-optional types specified in the instance's `supportedWalletTypes`
800
+ * object that are not already present. This is automatically called upon account creation to ensure that
801
+ * the user has a wallet of each required type.
802
+ *
803
+ * @param {Object} [opts] the options object.
804
+ * @param {boolean} [opts.skipDistribute] if `true`, the wallets' recovery share will not be distributed.
805
+ * @param {WalletType[]} [opts.types] the types of wallets to create.
806
+ * @returns {Object} the wallets created, their ids, and the recovery secret.
807
+ **/
808
+ createWalletPerType({ skipDistribute, types, }?: {
809
+ skipDistribute?: boolean;
810
+ types?: WalletType[];
811
+ }): Promise<{
812
+ wallets: Wallet[];
813
+ walletIds: CurrentWalletIds;
814
+ recoverySecret?: string;
815
+ }>;
816
+ /**
817
+ * Refresh the current user share for a wallet.
818
+ *
819
+ * @param {Object} opts the options object.
820
+ * @param {string} opts.walletId the wallet id to refresh.
821
+ * @param {string} opts.share the current user share.
822
+ * @param {string} [opts.oldPartnerId] the current partner id.
823
+ * @param {string} [opts.newPartnerId] the new partner id to set, if any.
824
+ * @param {string} [opts.keyShareProtocolId]
825
+ * @param {boolean} [opts.redistributeBackupEncryptedShares] whether or not to redistribute backup encrypted shares.
826
+ * @returns {Object} the new user share and recovery secret.
827
+ **/
828
+ refreshShare({ walletId, share, oldPartnerId, newPartnerId, keyShareProtocolId, redistributeBackupEncryptedShares, }: {
829
+ walletId: string;
830
+ share: string;
831
+ oldPartnerId?: string;
832
+ newPartnerId?: string;
833
+ keyShareProtocolId?: string;
834
+ redistributeBackupEncryptedShares?: boolean;
835
+ emailProps?: BackupKitEmailProps;
836
+ }): Promise<{
837
+ signer: string;
838
+ recoverySecret?: string;
839
+ protocolId: string;
840
+ }>;
841
+ /**
842
+ * Creates a new wallet.
843
+ *
844
+ * @param skipDistribute - if true, recovery share will not be distributed.
845
+ * @param [customFunction] - {deprecated} method called when createWallet is done.
846
+ * @returns [wallet, recoveryShare]
847
+ **/
848
+ createWallet({ type: _type, skipDistribute, }?: {
849
+ type?: WalletType;
850
+ skipDistribute?: boolean;
851
+ }): Promise<[Wallet, string | null]>;
852
+ /**
853
+ * Creates a new pregenerated wallet.
854
+ *
855
+ * @param {Object} opts the options object.
856
+ * @param {string} opts.pregenIdentifier the identifier associated with the new wallet.
857
+ * @param {TPregenIdentifierType} [opts.pregenIdentifierType] the identifier type. Defaults to `EMAIL`.
858
+ * @param {WalletType} [opts.type] the type of wallet to create. Defaults to the first non-optional type in the instance's `supportedWalletTypes` array.
859
+ * @returns {Wallet} the created wallet.
860
+ **/
861
+ createWalletPreGen(opts: {
862
+ type: WalletType;
863
+ pregenIdentifier: string;
864
+ pregenIdentifierType: TPregenIdentifierType;
865
+ }): Promise<Wallet>;
866
+ /**
867
+ * Creates new pregenerated wallets for each desired type.
868
+ * If no types are provided, this method will create one for each of the non-optional types
869
+ * specified in the instance's `supportedWalletTypes` array that are not already present.
870
+ *
871
+ * @param {string} pregenIdentifier the identifier to associate each wallet with.
872
+ * @param {TPregenIdentifierType} pregenIdentifierType - either `'EMAIL'` or `'PHONE'`.
873
+ * @param {WalletType[]} [types] the wallet types to create. Defaults to any types the instance supports that are not already present.
874
+ * @returns an array containing the created wallets.
875
+ **/
876
+ createPregenWalletPerType({ types, pregenIdentifier, pregenIdentifierType, }: {
877
+ pregenIdentifier: string;
878
+ pregenIdentifierType: TPregenIdentifierType;
879
+ types?: WalletType[];
880
+ }): Promise<Wallet[]>;
881
+ /**
882
+ * Claims a pregenerated wallet.
883
+ *
884
+ * @param pregenIdentifier string the identifier of the user claiming the wallet
885
+ * @param pregenIdentifierType type of the identifier of the user claiming the wallet
886
+ * @returns [wallet, recoveryShare]
887
+ **/
888
+ claimPregenWallets(pregenIdentifier?: string, pregenIdentifierType?: TPregenIdentifierType): Promise<string | undefined>;
889
+ /**
890
+ * Updates a pregenerated wallet identifier.
891
+ *
892
+ * @param newIdentifier - string
893
+ * @param walletId - string
894
+ * @returns Promise<void>
895
+ **/
896
+ updatePregenWalletIdentifier({ walletId, newPregenIdentifier, newPregenIdentifierType, }: {
897
+ walletId: string;
898
+ newPregenIdentifier: string;
899
+ newPregenIdentifierType: TPregenIdentifierType;
900
+ }): Promise<void>;
901
+ /**
902
+ * Checks if Pregen Wallet exists for the identifier and partnerId
903
+ *
904
+ * @param pregenIdentifier string the identifier of the user claiming the wallet
905
+ * @param pregenIdentifierType type of the string of the identifier of the user claiming the wallet
906
+ * @returns Promise<boolean>
907
+ **/
908
+ hasPregenWallet({ pregenIdentifier, pregenIdentifierType, }: {
909
+ pregenIdentifier: string;
910
+ pregenIdentifierType: TPregenIdentifierType;
911
+ }): Promise<boolean>;
912
+ /**
913
+ * Get pregen wallets for the identifier
914
+ *
915
+ * @param {string} pregenIdentifier - the identifier of the user claiming the wallet
916
+ * @param {TPregenIdentifierType} pregenIdentifierType - type of the identifier of the user claiming the wallet
917
+ * @returns {Promise<WalletEntity[]>} Promise of pregen wallets
918
+ **/
919
+ getPregenWallets({ pregenIdentifier, pregenIdentifierType, }?: {
920
+ pregenIdentifier?: string;
921
+ pregenIdentifierType?: TPregenIdentifierType;
922
+ }): Promise<WalletEntity[]>;
923
+ private encodeWalletBase64;
924
+ /**
925
+ * Returns a base64 encoded wallet
926
+ *
927
+ * @returns string base64 encoded wallet
928
+ **/
929
+ getUserShare(): string | null;
930
+ /**
931
+ * Sets a wallet from a base 64 encoded wallet
932
+ *
933
+ * @param base64Wallet
934
+ * @returns Promise<void>
935
+ **/
936
+ setUserShare(base64Wallets: string | null): Promise<void>;
937
+ private getTransactionReviewUrl;
938
+ private getOnRampTransactionUrl;
939
+ /**
940
+ * Signs a message.
941
+ *
942
+ * If you want to sign the keccak256 hash of a message, hash the
943
+ * message first and then pass in the base64 encoded hash.
944
+ * @param walletId - id of the wallet to sign with.
945
+ * @param messageBase64 - base64 encoding of exact message that should be signed
946
+ * @param timeout - optional timeout in milliseconds. If not present, defaults to 30 seconds.
947
+ **/
948
+ signMessage({ walletId, messageBase64, timeoutMs, cosmosSignDocBase64, }: {
949
+ walletId: string;
950
+ messageBase64: string;
951
+ timeoutMs?: number;
952
+ cosmosSignDocBase64?: string;
953
+ }): Promise<FullSignatureRes>;
954
+ private signMessageInner;
955
+ /**
956
+ * Signs a transaction.
957
+ * @param walletId - id of the wallet to sign the transaction from.
958
+ * @param rlpEncodedTxBase64 - rlp encoded tx as base64 string
959
+ * @param chainId - chain id of the chain the transaction is being sent on.
960
+ **/
961
+ signTransaction({ walletId, rlpEncodedTxBase64, chainId, timeoutMs, }: {
962
+ walletId: string;
963
+ rlpEncodedTxBase64: string;
964
+ chainId: string;
965
+ timeoutMs?: number;
966
+ }): Promise<FullSignatureRes>;
967
+ /**
968
+ * Sends a transaction.
969
+ * @param walletId - id of the wallet to send the transaction from.
970
+ * @param rlpEncodedTxBase64 - rlp encoded tx as base64 string
971
+ * @param chainId - chain id of the chain the transaction is being sent on.
972
+ **/
973
+ sendTransaction({ walletId, rlpEncodedTxBase64, chainId, }: {
974
+ walletId: string;
975
+ rlpEncodedTxBase64: string;
976
+ chainId: string;
977
+ }): Promise<FullSignatureRes>;
978
+ protected isProviderModalDisabled(): boolean;
979
+ /**
980
+ * Starts a on-ramp or off-ramp transaction and returns the Para Portal link for the user to finalize and complete it.
981
+ * @param {Object} options - the options for the transaction.
982
+ * @param {OnRampPurchaseCreateParams} options.params - the transaction settings.
983
+ * @param {boolean} options.shouldOpenPopup - if `true`, a popup window with the link will be opened.
984
+ * @param {string} options.walletId - the wallet ID to use for the transaction, where funds will be sent or withdrawn.
985
+ * @param {string} options.externalWalletAddress - the external wallet address to send funds to or withdraw funds from, if using an external wallet.
986
+ **/
987
+ initiateOnRampTransaction(options: WalletParams & {
988
+ params: OnRampPurchaseCreateParams;
989
+ shouldOpenPopup?: boolean;
990
+ }): Promise<{
991
+ onRampPurchase: OnRampPurchase;
992
+ portalUrl: string;
993
+ }>;
994
+ /**
995
+ * Returns true if session was successfully kept alive, false otherwise.
996
+ **/
997
+ keepSessionAlive(): Promise<boolean>;
998
+ exportSession(): string;
999
+ importSession(serializedInstanceBase64: string): Promise<void>;
1000
+ protected exitAccountCreation(): void;
1001
+ protected exitLogin(): void;
1002
+ protected exitFarcaster(): void;
1003
+ protected exitOAuth(): void;
1004
+ protected exitLoops(): void;
1005
+ /**
1006
+ * Logs the user out.
1007
+ *
1008
+ * @param preservePregenWallets - preserves the stored pregen wallets in memory after the logout.
1009
+ **/
1010
+ logout({ clearPregenWallets }?: {
1011
+ clearPregenWallets?: boolean;
1012
+ }): Promise<void>;
1013
+ protected getSupportedCreateAuthMethods(): Promise<Set<AuthMethod>>;
1014
+ /**
1015
+ * Converts to a string, removing sensitive data when logging this class.
1016
+ *
1017
+ * Doesn't work for all types of logging.
1018
+ **/
1019
+ toString(): string;
1020
+ }
1021
+ export {};