@privy-io/react-auth 1.92.7 → 1.93.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/{getEmbeddedConnectedWallet-DS-w3DHv.js → getEmbeddedConnectedWallet-DGCba9eL.js} +1 -1
- package/dist/cjs/index.js +124 -124
- package/dist/cjs/privy-context-Ds_CALAJ.js +1 -0
- package/dist/cjs/{smart-wallets-Di4AUVjR.js → smart-wallets-C-wtePWG.js} +1 -1
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/ui.js +1 -1
- package/dist/cjs/{useFundWallet-CmI_P32R.js → useFundWallet-CW-_1LDw.js} +5 -5
- package/dist/cjs/{useSolanaWallets-CQuWnY1r.js → useSolanaWallets-DYHtxLmi.js} +1 -1
- package/dist/cjs/{useWallets-Br4RRclA.js → useWallets-CZUj7ALT.js} +1 -1
- package/dist/dts/index.d.mts +10 -30
- package/dist/dts/index.d.ts +10 -30
- package/dist/dts/smart-wallets.d.mts +1 -1
- package/dist/dts/smart-wallets.d.ts +1 -1
- package/dist/dts/{solana-BRQvrG8A.d.ts → solana-CWtzrK1j.d.mts} +1 -1
- package/dist/dts/{solana-BRQvrG8A.d.mts → solana-CWtzrK1j.d.ts} +1 -1
- package/dist/dts/solana.d.mts +2 -2
- package/dist/dts/solana.d.ts +2 -2
- package/dist/dts/{types-fS_ewT7E.d.mts → types-fObwliWo.d.mts} +304 -81
- package/dist/dts/{types-fS_ewT7E.d.ts → types-fObwliWo.d.ts} +304 -81
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/{getEmbeddedConnectedWallet-2FJQV-TA.mjs → getEmbeddedConnectedWallet-CeIDxPC5.mjs} +1 -1
- package/dist/esm/index.mjs +318 -318
- package/dist/esm/privy-context-BeqkgOHo.mjs +1 -0
- package/dist/esm/{smart-wallets-C0eP6Grh.mjs → smart-wallets-vjWIsaaC.mjs} +1 -1
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/ui.mjs +1 -1
- package/dist/esm/{useFundWallet-DfRcsTFv.mjs → useFundWallet-BLErEIDU.mjs} +18 -18
- package/dist/esm/{useSolanaWallets-Cn7Eb8fU.mjs → useSolanaWallets-DiqA_tT8.mjs} +1 -1
- package/dist/esm/{useWallets-0pQT6tND.mjs → useWallets-C0_t04LR.mjs} +1 -1
- package/package.json +6 -7
- package/dist/cjs/privy-context-6Fn5d7Hw.js +0 -1
- package/dist/esm/privy-context-BXjG69vB.mjs +0 -1
|
@@ -210,6 +210,7 @@ declare enum PrivyErrorCode {
|
|
|
210
210
|
UNKNOWN_MFA_ERROR = "unknown_mfa_error",
|
|
211
211
|
EMBEDDED_WALLET_ALREADY_EXISTS = "embedded_wallet_already_exists",
|
|
212
212
|
EMBEDDED_WALLET_NOT_FOUND = "embedded_wallet_not_found",
|
|
213
|
+
EMBEDDED_WALLET_CREATE_ERROR = "embedded_wallet_create_error",
|
|
213
214
|
UNKNOWN_EMBEDDED_WALLET_ERROR = "unknown_embedded_wallet_error",
|
|
214
215
|
EMBEDDED_WALLET_PASSWORD_UNCONFIRMED = "embedded_wallet_password_unconfirmed",
|
|
215
216
|
EMBEDDED_WALLET_PASSWORD_ALREADY_EXISTS = "embedded_wallet_password_already_exists",
|
|
@@ -249,6 +250,192 @@ declare class ProviderRpcError extends PrivyError {
|
|
|
249
250
|
constructor(message: string, code: number, data?: unknown);
|
|
250
251
|
}
|
|
251
252
|
|
|
253
|
+
type BaseProxyRequest = {
|
|
254
|
+
accessToken: string;
|
|
255
|
+
} & Partial<MfaSubmitArgs>;
|
|
256
|
+
type EntropyIdVerifier = 'ethereum-address-verifier' | 'solana-address-verifier';
|
|
257
|
+
type BaseWalletsRequestData = BaseProxyRequest & {
|
|
258
|
+
chainType: 'ethereum' | 'solana' | 'bitcoin-taproot' | 'bitcoin-segwit';
|
|
259
|
+
};
|
|
260
|
+
type WalletsCreateRequestDataType = BaseWalletsRequestData & {
|
|
261
|
+
/** Optional: the user-specified recovery password, replaces recoveryPin */
|
|
262
|
+
recoveryPassword?: string;
|
|
263
|
+
/** Optional: the recovery method to be used for the created wallet */
|
|
264
|
+
recoveryMethod?: UserRecoveryMethod;
|
|
265
|
+
/** Optional: in the case of cloud recovery, the access token to be used to communicated with the cloud provider (eg Google) */
|
|
266
|
+
recoveryAccessToken?: string;
|
|
267
|
+
/** Optional: override the recoverySecret, only for use when we need to store recovery secrets in cloud storage outside of the iframe (eg native) */
|
|
268
|
+
recoverySecretOverride?: string;
|
|
269
|
+
/** Optional: override the iCloudRecordName, only for use when we need to store recovery secrets in cloud storage outside of the iframe (eg native) */
|
|
270
|
+
iCloudRecordNameOverride?: string;
|
|
271
|
+
};
|
|
272
|
+
type WalletsCreateResponseDataType = {
|
|
273
|
+
address: string;
|
|
274
|
+
};
|
|
275
|
+
type WalletsAddRequestDataType = BaseWalletsRequestData & {
|
|
276
|
+
/**
|
|
277
|
+
* Key with which to look up the existing entropy
|
|
278
|
+
*/
|
|
279
|
+
entropyId: string;
|
|
280
|
+
/**
|
|
281
|
+
* Source of the `entropyId` property. This field determines how the entropyId will
|
|
282
|
+
* be used. Possible values include:
|
|
283
|
+
* - ethereum-address-verifier: the entropyId is the address of the Ethereum wallet derived
|
|
284
|
+
* at index 0 for this entropy
|
|
285
|
+
* - solana-address-verifier: the entropyId is a the address of the Solana wallet derived
|
|
286
|
+
* at index 0 for this entropy
|
|
287
|
+
*
|
|
288
|
+
* When this field is a wallet address, we can verify reconstitution was successful by
|
|
289
|
+
* deriving the specified wallet and comparing the address to the `entropyId`
|
|
290
|
+
*/
|
|
291
|
+
entropyIdVerifier: EntropyIdVerifier;
|
|
292
|
+
/**
|
|
293
|
+
* The HD node index at which to create a wallet. Must be >= 1 AND equal to the next
|
|
294
|
+
* index in the sequence, since the primary wallet is created at index 0.
|
|
295
|
+
*/
|
|
296
|
+
hdWalletIndex: number;
|
|
297
|
+
};
|
|
298
|
+
type WalletsAddResponseDataType = {
|
|
299
|
+
address: string;
|
|
300
|
+
};
|
|
301
|
+
type WalletsSetRecoveryBaseRequestDataType = BaseWalletsRequestData & {
|
|
302
|
+
/**
|
|
303
|
+
* Key with which to look up the existing entropy
|
|
304
|
+
*/
|
|
305
|
+
entropyId: string;
|
|
306
|
+
/**
|
|
307
|
+
* Source of the `entropyId` property. This field determines how the entropyId will
|
|
308
|
+
* be used. Possible values include:
|
|
309
|
+
* - ethereum-address-verifier: the entropyId is the address of the Ethereum wallet derived
|
|
310
|
+
* at index 0 for this entropy
|
|
311
|
+
* - solana-address-verifier: the entropyId is a the address of the Solana wallet derived
|
|
312
|
+
* at index 0 for this entropy
|
|
313
|
+
*
|
|
314
|
+
* When this field is a wallet address, we can verify reconstitution was successful by
|
|
315
|
+
* deriving the specified wallet and comparing the address to the `entropyId`
|
|
316
|
+
*/
|
|
317
|
+
entropyIdVerifier: EntropyIdVerifier;
|
|
318
|
+
existingRecoveryMethod?: UserRecoveryMethod;
|
|
319
|
+
};
|
|
320
|
+
type WalletsSetRecoveryPasswordDataType = WalletsSetRecoveryBaseRequestDataType & {
|
|
321
|
+
recoveryMethod: 'user-passcode';
|
|
322
|
+
recoveryPassword: string;
|
|
323
|
+
};
|
|
324
|
+
type WalletsSetRecoveryGoogleDriveDataType = WalletsSetRecoveryBaseRequestDataType & {
|
|
325
|
+
recoveryMethod: 'google-drive';
|
|
326
|
+
recoveryAccessToken: string;
|
|
327
|
+
};
|
|
328
|
+
type WalletsSetRecoveryICloudDataType = WalletsSetRecoveryBaseRequestDataType & {
|
|
329
|
+
recoveryMethod: 'icloud';
|
|
330
|
+
recoveryAccessToken: string;
|
|
331
|
+
};
|
|
332
|
+
type WalletsSetRecoveryICloudNativeDataType = WalletsSetRecoveryBaseRequestDataType & {
|
|
333
|
+
recoveryMethod: 'icloud-native';
|
|
334
|
+
recoverySecretOverride: string;
|
|
335
|
+
iCloudRecordNameOverride: string;
|
|
336
|
+
};
|
|
337
|
+
type WalletsSetRecoveryRequestDataType = Omit<WalletsSetRecoveryPasswordDataType, 'chainType'> | Omit<WalletsSetRecoveryGoogleDriveDataType, 'chainType'> | Omit<WalletsSetRecoveryICloudDataType, 'chainType'> | Omit<WalletsSetRecoveryICloudNativeDataType, 'chainType'>;
|
|
338
|
+
type WalletsSetRecoveryResponseDataType = {
|
|
339
|
+
entropyId: string;
|
|
340
|
+
/**
|
|
341
|
+
* Source of the `entropyId` property. This field determines how the entropyId will
|
|
342
|
+
* be used. Possible values include:
|
|
343
|
+
* - ethereum-address-verifier: the entropyId is the address of the Ethereum wallet derived
|
|
344
|
+
* at index 0 for this entropy
|
|
345
|
+
* - solana-address-verifier: the entropyId is a the address of the Solana wallet derived
|
|
346
|
+
* at index 0 for this entropy
|
|
347
|
+
*
|
|
348
|
+
* When this field is a wallet address, we can verify reconstitution was successful by
|
|
349
|
+
* deriving the specified wallet and comparing the address to the `entropyId`
|
|
350
|
+
*/
|
|
351
|
+
entropyIdVerifier: EntropyIdVerifier;
|
|
352
|
+
recoveryMethod: WalletsSetRecoveryRequestDataType['recoveryMethod'];
|
|
353
|
+
};
|
|
354
|
+
type WalletsConnectRequestDataType = BaseProxyRequest & {
|
|
355
|
+
/**
|
|
356
|
+
* Key with which to look up the existing entropy
|
|
357
|
+
*/
|
|
358
|
+
entropyId: string;
|
|
359
|
+
/**
|
|
360
|
+
* Source of the key with which to look up the existing entropy
|
|
361
|
+
*/
|
|
362
|
+
entropyIdVerifier: EntropyIdVerifier;
|
|
363
|
+
};
|
|
364
|
+
type WalletsConnectResponseDataType = {
|
|
365
|
+
address: string;
|
|
366
|
+
};
|
|
367
|
+
type WalletsRecoverRequestDataType = BaseProxyRequest & {
|
|
368
|
+
/**
|
|
369
|
+
* Key with which to look up the existing entropy
|
|
370
|
+
*/
|
|
371
|
+
entropyId: string;
|
|
372
|
+
/**
|
|
373
|
+
* Source of the `entropyId` property. This field determines how the entropyId will
|
|
374
|
+
* be used. Possible values include:
|
|
375
|
+
* - ethereum-address-verifier: the entropyId is the address of the Ethereum wallet derived
|
|
376
|
+
* at index 0 for this entropy
|
|
377
|
+
* - solana-address-verifier: the entropyId is a the address of the Solana wallet derived
|
|
378
|
+
* at index 0 for this entropy
|
|
379
|
+
*
|
|
380
|
+
* When this field is a wallet address, we can verify reconstitution was successful by
|
|
381
|
+
* deriving the specified wallet and comparing the address to the `entropyId`
|
|
382
|
+
*/
|
|
383
|
+
entropyIdVerifier: EntropyIdVerifier;
|
|
384
|
+
/** Optional: the user-specified recovery password, replaces recoveryPin */
|
|
385
|
+
recoveryPassword?: string;
|
|
386
|
+
/** Optional: in the case of cloud recovery, the access token to be used to communicated with the cloud provider (eg Google) */
|
|
387
|
+
recoveryAccessToken?: string;
|
|
388
|
+
/** Optional: override the recoverySecret, only for use when we need to retrieve recovery secrets in cloud storage outside of the iframe (eg native) */
|
|
389
|
+
recoverySecretOverride?: string;
|
|
390
|
+
};
|
|
391
|
+
type WalletsRecoverResponseDataType = {
|
|
392
|
+
entropyId: string;
|
|
393
|
+
};
|
|
394
|
+
type WalletsRpcEthereumRequestDataType = {
|
|
395
|
+
chainType: 'ethereum';
|
|
396
|
+
request: EthereumRpcRequestType;
|
|
397
|
+
};
|
|
398
|
+
type WalletsRpcSolanaRequestDataType = {
|
|
399
|
+
chainType: 'solana';
|
|
400
|
+
request: SolanaRpcRequestType;
|
|
401
|
+
};
|
|
402
|
+
type WalletsRpcBitcoinRequestDataType = {
|
|
403
|
+
chainType: 'bitcoin-taproot' | 'bitcoin-segwit';
|
|
404
|
+
request: unknown;
|
|
405
|
+
};
|
|
406
|
+
type WalletsRpcRequestDataType = BaseWalletsRequestData & {
|
|
407
|
+
/**
|
|
408
|
+
* Key with which to look up the existing entropy
|
|
409
|
+
*/
|
|
410
|
+
entropyId: string;
|
|
411
|
+
/**
|
|
412
|
+
* Source of the `entropyId` property. This field determines how the entropyId will
|
|
413
|
+
* be used. Possible values include:
|
|
414
|
+
* - ethereum-address-verifier: the entropyId is the address of the Ethereum wallet derived
|
|
415
|
+
* at index 0 for this entropy
|
|
416
|
+
* - solana-address-verifier: the entropyId is a the address of the Solana wallet derived
|
|
417
|
+
* at index 0 for this entropy
|
|
418
|
+
*
|
|
419
|
+
* When this field is a wallet address, we can verify reconstitution was successful by
|
|
420
|
+
* deriving the specified wallet and comparing the address to the `entropyId`
|
|
421
|
+
*/
|
|
422
|
+
entropyIdVerifier: EntropyIdVerifier;
|
|
423
|
+
} & (WalletsRpcEthereumRequestDataType | WalletsRpcSolanaRequestDataType | WalletsRpcBitcoinRequestDataType);
|
|
424
|
+
type WalletsRpcEthereumResponseDataType = {
|
|
425
|
+
chainType: 'ethereum';
|
|
426
|
+
response: EthereumRpcResponseType;
|
|
427
|
+
};
|
|
428
|
+
type WalletsRpcSolanaResponseDataType = {
|
|
429
|
+
chainType: 'solana';
|
|
430
|
+
response: SolanaRpcResponseType;
|
|
431
|
+
};
|
|
432
|
+
type WalletsRpcBitcoinResponseDataType = {
|
|
433
|
+
chainType: 'bitcoin-taproot' | 'bitcoin-segwit';
|
|
434
|
+
response: unknown;
|
|
435
|
+
};
|
|
436
|
+
type WalletsRpcResponseDataType = {
|
|
437
|
+
address: string;
|
|
438
|
+
} & (WalletsRpcEthereumResponseDataType | WalletsRpcSolanaResponseDataType | WalletsRpcBitcoinResponseDataType);
|
|
252
439
|
type BaseWalletCreateRequestDataType = {
|
|
253
440
|
accessToken: string;
|
|
254
441
|
};
|
|
@@ -273,32 +460,34 @@ type EthereumWalletCreateRequestDataType = BaseWalletCreateRequestDataType & Bas
|
|
|
273
460
|
*/
|
|
274
461
|
solanaAddress?: string;
|
|
275
462
|
};
|
|
276
|
-
type
|
|
277
|
-
|
|
278
|
-
* If a user has an existing Ethereum embedded wallet when creating the Solana embedded wallet, that address
|
|
279
|
-
* MUST be passed in this field. Our iframe will use this address to derive the Solana embedded wallet from the
|
|
280
|
-
* same entropy as the Ethereum wallet.
|
|
281
|
-
*
|
|
282
|
-
* If no address is passed here, our iframe assumes that the user has no existing Ethereum wallet and will create
|
|
283
|
-
* a new set of entropy for Solana.
|
|
284
|
-
*/
|
|
285
|
-
ethereumAddress?: string;
|
|
463
|
+
type WalletCreateResponseDataType = {
|
|
464
|
+
address: string;
|
|
286
465
|
};
|
|
287
466
|
type WalletCreateAdditionalRequestDataType = {
|
|
288
467
|
accessToken: string;
|
|
289
468
|
primaryWalletAddress: string;
|
|
469
|
+
/**
|
|
470
|
+
* The HD node index at which to create a wallet. Must be >= 1 for ethereum
|
|
471
|
+
* and solana, must be >= 0 otherwise.
|
|
472
|
+
*/
|
|
290
473
|
hdWalletIndex: number;
|
|
291
474
|
};
|
|
475
|
+
type WalletCreateAdditionalResponseDataType = {
|
|
476
|
+
address: string;
|
|
477
|
+
};
|
|
292
478
|
type WalletImportRequestDataType = {
|
|
293
479
|
accessToken: string;
|
|
294
480
|
privateKey: string;
|
|
295
481
|
};
|
|
296
|
-
type
|
|
482
|
+
type WalletImportResponseDataType = {
|
|
483
|
+
address: string;
|
|
484
|
+
};
|
|
485
|
+
type WalletConnectRequestDataType = {
|
|
297
486
|
accessToken: string;
|
|
298
487
|
address: string;
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
488
|
+
};
|
|
489
|
+
type WalletConnectResponseDataType = {
|
|
490
|
+
address: string;
|
|
302
491
|
};
|
|
303
492
|
type WalletRecoverRequestDataType = {
|
|
304
493
|
address: string;
|
|
@@ -316,9 +505,18 @@ type WalletRecoverRequestDataType = {
|
|
|
316
505
|
*/
|
|
317
506
|
recoveryPin?: string;
|
|
318
507
|
};
|
|
319
|
-
type
|
|
508
|
+
type WalletRecoverResponseDataType = {
|
|
509
|
+
address: string;
|
|
510
|
+
};
|
|
511
|
+
type WalletSetRecoveryRequestDataType = {
|
|
320
512
|
accessToken: string;
|
|
321
513
|
address: string;
|
|
514
|
+
recoveryMethod: UserRecoveryMethod;
|
|
515
|
+
recoveryPassword?: string;
|
|
516
|
+
recoveryAccessToken?: string;
|
|
517
|
+
};
|
|
518
|
+
type WalletSetRecoveryResponseDataType = {
|
|
519
|
+
address: string;
|
|
322
520
|
};
|
|
323
521
|
type WalletRpcRequestDataType = {
|
|
324
522
|
accessToken: string;
|
|
@@ -330,46 +528,51 @@ type WalletRpcRequestDataType = {
|
|
|
330
528
|
address: string;
|
|
331
529
|
request: EthereumRpcRequestType;
|
|
332
530
|
};
|
|
531
|
+
type WalletRpcResponseDataType = {
|
|
532
|
+
address: string;
|
|
533
|
+
response: EthereumRpcResponseType;
|
|
534
|
+
};
|
|
535
|
+
type SolanaWalletCreateRequestDataType = BaseWalletCreateRequestDataType & {
|
|
536
|
+
/**
|
|
537
|
+
* If a user has an existing Ethereum embedded wallet when creating the Solana embedded wallet, that address
|
|
538
|
+
* MUST be passed in this field. Our iframe will use this address to derive the Solana embedded wallet from the
|
|
539
|
+
* same entropy as the Ethereum wallet.
|
|
540
|
+
*
|
|
541
|
+
* If no address is passed here, our iframe assumes that the user has no existing Ethereum wallet and will create
|
|
542
|
+
* a new set of entropy for Solana.
|
|
543
|
+
*/
|
|
544
|
+
ethereumAddress?: string;
|
|
545
|
+
};
|
|
546
|
+
type SolanaWalletCreateResponseDataType = {
|
|
547
|
+
publicKey: string;
|
|
548
|
+
};
|
|
333
549
|
type SolanaWalletConnectRequestDataType = {
|
|
334
550
|
publicKey: string;
|
|
335
551
|
accessToken: string;
|
|
336
552
|
};
|
|
553
|
+
type SolanaWalletConnectResponseDataType = {
|
|
554
|
+
publicKey: string;
|
|
555
|
+
};
|
|
337
556
|
type SolanaWalletRecoverRequestDataType = {
|
|
338
557
|
publicKey: string;
|
|
339
558
|
accessToken: string;
|
|
340
559
|
};
|
|
560
|
+
type SolanaWalletRecoverResponseDataType = {
|
|
561
|
+
publicKey: string;
|
|
562
|
+
};
|
|
341
563
|
type SolanaWalletRpcRequestDataType = {
|
|
342
564
|
accessToken: string;
|
|
343
565
|
publicKey: string;
|
|
344
566
|
request: SolanaRpcRequestType;
|
|
345
567
|
};
|
|
346
|
-
type
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
/** Chain type of the root wallet for the entropy being delegated. */
|
|
350
|
-
chainType: 'ethereum' | 'solana';
|
|
351
|
-
/** Whether or not the root wallet for the entropy being delegated is imported. */
|
|
352
|
-
imported: boolean;
|
|
353
|
-
};
|
|
354
|
-
type DelegatedWallet = {
|
|
355
|
-
/** Address for a wallet to delegate. */
|
|
356
|
-
address: string;
|
|
357
|
-
/** Chain type for a wallet to delegate. */
|
|
358
|
-
chainType: 'ethereum' | 'solana';
|
|
359
|
-
/** HD index for the wallet to delegate. */
|
|
360
|
-
walletIndex: number;
|
|
361
|
-
};
|
|
362
|
-
type DelegatedActionsConsentRequestDataType = {
|
|
363
|
-
/** Access token for the user */
|
|
364
|
-
accessToken: string;
|
|
365
|
-
/** Root wallet to delegate, which is the wallet at HD index 0 for the entropy. */
|
|
366
|
-
rootWallet: RootWalletForDelegation;
|
|
367
|
-
/** Wallets to delegate, whose entropy is the same as `rootWallet`'s. */
|
|
368
|
-
delegatedWallets: DelegatedWallet[];
|
|
568
|
+
type SolanaWalletRpcResponseDataType = {
|
|
569
|
+
publicKey: string;
|
|
570
|
+
response: SolanaRpcResponseType;
|
|
369
571
|
};
|
|
370
572
|
type MfaVerifyRequestDataType = {
|
|
371
573
|
accessToken: string;
|
|
372
574
|
};
|
|
575
|
+
type MfaVerifyResponseDataType = Record<string, never>;
|
|
373
576
|
type MfaInitEnrollmentRequestDataType = {
|
|
374
577
|
accessToken: string;
|
|
375
578
|
method: 'sms';
|
|
@@ -378,6 +581,11 @@ type MfaInitEnrollmentRequestDataType = {
|
|
|
378
581
|
accessToken: string;
|
|
379
582
|
method: 'totp';
|
|
380
583
|
};
|
|
584
|
+
type MfaInitEnrollmentResponseDataType = {
|
|
585
|
+
method: string;
|
|
586
|
+
secret?: string;
|
|
587
|
+
authUrl?: string;
|
|
588
|
+
};
|
|
381
589
|
type MfaSubmitEnrollmentRequestDataType = {
|
|
382
590
|
accessToken: string;
|
|
383
591
|
method: 'sms';
|
|
@@ -392,13 +600,16 @@ type MfaSubmitEnrollmentRequestDataType = {
|
|
|
392
600
|
method: 'passkey';
|
|
393
601
|
credentialIds: string[];
|
|
394
602
|
};
|
|
603
|
+
type MfaSubmitEnrollmentResponseDataType = Record<string, never>;
|
|
395
604
|
type MfaUnenrollRequestDataType = {
|
|
396
605
|
accessToken: string;
|
|
397
606
|
method: 'sms' | 'totp';
|
|
398
607
|
};
|
|
608
|
+
type MfaUnenrollResponseDataType = Record<string, never>;
|
|
399
609
|
type MfaClearRequestDataType = {
|
|
400
610
|
userId: string;
|
|
401
611
|
};
|
|
612
|
+
type MfaClearResponseDataType = Record<string, never>;
|
|
402
613
|
type FarcasterSignerInitRequestDataType = {
|
|
403
614
|
address: string;
|
|
404
615
|
hdWalletIndex: number | null;
|
|
@@ -407,6 +618,7 @@ type FarcasterSignerInitRequestDataType = {
|
|
|
407
618
|
mfaMethod: string | null;
|
|
408
619
|
relyingParty: string;
|
|
409
620
|
};
|
|
621
|
+
type FarcasterSignerInitResponseDataType = PrivyFarcasterSignerInitResponse;
|
|
410
622
|
type FarcasterSignRequestDataType = {
|
|
411
623
|
address: string;
|
|
412
624
|
hdWalletIndex: number | null;
|
|
@@ -419,72 +631,68 @@ type FarcasterSignRequestDataType = {
|
|
|
419
631
|
};
|
|
420
632
|
fid: bigint;
|
|
421
633
|
};
|
|
422
|
-
type
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
type WalletCreateAdditionalResponseDataType = {
|
|
426
|
-
address: string;
|
|
427
|
-
};
|
|
428
|
-
type WalletImportResponseDataType = {
|
|
429
|
-
address: string;
|
|
430
|
-
};
|
|
431
|
-
type WalletConnectResponseDataType = {
|
|
432
|
-
address: string;
|
|
433
|
-
};
|
|
434
|
-
type WalletRecoverResponseDataType = {
|
|
435
|
-
address: string;
|
|
634
|
+
type FarcasterSignResponseDataType = {
|
|
635
|
+
hash: string;
|
|
636
|
+
signature: string;
|
|
436
637
|
};
|
|
437
|
-
type
|
|
638
|
+
type RootWalletForDelegation = {
|
|
639
|
+
/** Address of the root wallet for the entropy being delegated. */
|
|
438
640
|
address: string;
|
|
641
|
+
/** Chain type of the root wallet for the entropy being delegated. */
|
|
642
|
+
chainType: 'ethereum' | 'solana';
|
|
643
|
+
/** Whether or not the root wallet for the entropy being delegated is imported. */
|
|
644
|
+
imported: boolean;
|
|
439
645
|
};
|
|
440
|
-
type
|
|
646
|
+
type DelegatedWallet = {
|
|
647
|
+
/** Address for a wallet to delegate. */
|
|
441
648
|
address: string;
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
};
|
|
447
|
-
type SolanaWalletConnectResponseDataType = {
|
|
448
|
-
publicKey: string;
|
|
449
|
-
};
|
|
450
|
-
type SolanaWalletRecoverResponseDataType = {
|
|
451
|
-
publicKey: string;
|
|
649
|
+
/** Chain type for a wallet to delegate. */
|
|
650
|
+
chainType: 'ethereum' | 'solana';
|
|
651
|
+
/** HD index for the wallet to delegate. */
|
|
652
|
+
walletIndex: number;
|
|
452
653
|
};
|
|
453
|
-
type
|
|
454
|
-
|
|
455
|
-
|
|
654
|
+
type DelegatedActionsConsentRequestDataType = {
|
|
655
|
+
/** Access token for the user */
|
|
656
|
+
accessToken: string;
|
|
657
|
+
/** Root wallet to delegate, which is the wallet at HD index 0 for the entropy. */
|
|
658
|
+
rootWallet: RootWalletForDelegation;
|
|
659
|
+
/** Wallets to delegate, whose entropy is the same as `rootWallet`'s. */
|
|
660
|
+
delegatedWallets: DelegatedWallet[];
|
|
456
661
|
};
|
|
457
662
|
type DelegatedActionsConsentResponseDataType = {
|
|
458
663
|
success: boolean;
|
|
459
664
|
};
|
|
460
|
-
type MfaVerifyResponseDataType = Record<string, never>;
|
|
461
|
-
type MfaInitEnrollmentResponseDataType = {
|
|
462
|
-
method: string;
|
|
463
|
-
secret?: string;
|
|
464
|
-
authUrl?: string;
|
|
465
|
-
};
|
|
466
|
-
type MfaSubmitEnrollmentResponseDataType = Record<string, never>;
|
|
467
|
-
type MfaUnenrollResponseDataType = Record<string, never>;
|
|
468
|
-
type MfaClearResponseDataType = Record<string, never>;
|
|
469
|
-
type FarcasterSignerInitResponseDataType = PrivyFarcasterSignerInitResponse;
|
|
470
|
-
type FarcasterSignResponseDataType = {
|
|
471
|
-
hash: string;
|
|
472
|
-
signature: string;
|
|
473
|
-
};
|
|
474
665
|
declare const PrivyIframeErrorTypes: readonly ["error", "invalid_request_arguments", "wallet_not_on_device", "invalid_recovery_pin", "insufficient_funds", "missing_or_invalid_mfa", "mfa_verification_max_attempts_reached", "mfa_timeout", "twilio_verification_failed"];
|
|
475
666
|
type PrivyIframeErrorTypesType = (typeof PrivyIframeErrorTypes)[number];
|
|
476
667
|
interface EmbeddedWalletProxy {
|
|
668
|
+
createWallet: (data: WalletsCreateRequestDataType) => Promise<WalletsCreateResponseDataType>;
|
|
669
|
+
addWallet: (data: WalletsAddRequestDataType) => Promise<WalletsAddResponseDataType>;
|
|
670
|
+
setRecoveryWallet: (data: WalletsSetRecoveryRequestDataType) => Promise<WalletsSetRecoveryResponseDataType>;
|
|
671
|
+
connectWallet: (data: WalletsConnectRequestDataType) => Promise<WalletsConnectResponseDataType>;
|
|
672
|
+
recoverWallet: (data: WalletsRecoverRequestDataType) => Promise<WalletsRecoverResponseDataType>;
|
|
673
|
+
rpcWallet(data: WalletsRpcRequestDataType): Promise<WalletsRpcResponseDataType>;
|
|
674
|
+
/** @deprecated */
|
|
477
675
|
create: (data: EthereumWalletCreateRequestDataType) => Promise<WalletCreateResponseDataType>;
|
|
676
|
+
/** @deprecated */
|
|
478
677
|
createAdditional: (data: WalletCreateAdditionalRequestDataType) => Promise<WalletCreateAdditionalResponseDataType>;
|
|
479
678
|
import: (data: WalletImportRequestDataType) => Promise<WalletImportResponseDataType>;
|
|
679
|
+
/** @deprecated */
|
|
480
680
|
connect: (data: WalletConnectRequestDataType) => Promise<WalletConnectResponseDataType>;
|
|
681
|
+
/** @deprecated */
|
|
481
682
|
recover: (data: WalletRecoverRequestDataType) => Promise<WalletRecoverResponseDataType>;
|
|
683
|
+
/** @deprecated */
|
|
482
684
|
setRecovery: (data: WalletSetRecoveryRequestDataType) => Promise<WalletSetRecoveryResponseDataType>;
|
|
685
|
+
/** @deprecated */
|
|
483
686
|
rpc: (data: WalletRpcRequestDataType) => Promise<WalletRpcResponseDataType>;
|
|
687
|
+
/** @deprecated */
|
|
484
688
|
createSolana: (data: SolanaWalletCreateRequestDataType) => Promise<SolanaWalletCreateResponseDataType>;
|
|
689
|
+
/** @deprecated */
|
|
485
690
|
connectSolana: (data: SolanaWalletConnectRequestDataType) => Promise<SolanaWalletConnectResponseDataType>;
|
|
691
|
+
/** @deprecated */
|
|
486
692
|
recoverSolana: (data: SolanaWalletRecoverRequestDataType) => Promise<SolanaWalletRecoverResponseDataType>;
|
|
693
|
+
/** @deprecated */
|
|
487
694
|
rpcSolana: (data: SolanaWalletRpcRequestDataType) => Promise<SolanaWalletRpcResponseDataType>;
|
|
695
|
+
/** @deprecated */
|
|
488
696
|
createDelegatedAction: (data: DelegatedActionsConsentRequestDataType) => Promise<DelegatedActionsConsentResponseDataType>;
|
|
489
697
|
verifyMfa: (data: MfaVerifyRequestDataType) => Promise<MfaVerifyResponseDataType>;
|
|
490
698
|
initEnrollMfa: (data: MfaInitEnrollmentRequestDataType) => Promise<MfaInitEnrollmentResponseDataType>;
|
|
@@ -797,6 +1005,11 @@ declare const SUPPORTED_OAUTH_PROVIDERS: readonly ["google", "discord", "twitter
|
|
|
797
1005
|
declare const SUPPORTED_RECOVERY_PROVIDERS: readonly ["google-drive", "icloud"];
|
|
798
1006
|
declare const SUPPORTED_MFA_METHODS: readonly ["sms", "totp", "passkey"];
|
|
799
1007
|
type MfaMethod = (typeof SUPPORTED_MFA_METHODS)[number];
|
|
1008
|
+
type MfaSubmitArgs = {
|
|
1009
|
+
mfaMethod: MfaMethod;
|
|
1010
|
+
mfaCode: string | PasskeyAuthenticateInputType['authenticator_response'];
|
|
1011
|
+
relyingParty: string;
|
|
1012
|
+
};
|
|
800
1013
|
/**
|
|
801
1014
|
* Supported OAuth providers. Can be `'google'`, `'discord'`, `'twitter'`, `'github'`, `'spotify'`,
|
|
802
1015
|
* `'instagram'`, `'tiktok'`, `'linkedin'`, or `'apple'`
|
|
@@ -2246,6 +2459,16 @@ type CreateWalletOptions = {
|
|
|
2246
2459
|
* Defaults to `false`.
|
|
2247
2460
|
*/
|
|
2248
2461
|
createAdditional?: boolean;
|
|
2462
|
+
} | {
|
|
2463
|
+
/**
|
|
2464
|
+
* Specify the hierarchical deterministic (HD) index of the embedded wallet to create.
|
|
2465
|
+
* **A wallet with HD index 0 must be created before creating a wallet at greater HD indices.**
|
|
2466
|
+
* If a value < 0 is passed in, `createWallet` will throw an error.
|
|
2467
|
+
* If a value > 1 is passed in, and the user does not have a primary wallet (HD index == 0),
|
|
2468
|
+
* `createWallet` will throw an error.
|
|
2469
|
+
*
|
|
2470
|
+
*/
|
|
2471
|
+
walletIndex: number;
|
|
2249
2472
|
};
|
|
2250
2473
|
type SetWalletRecoveryOptions = {};
|
|
2251
2474
|
type CustomAuthFlowState = {
|
package/dist/dts/ui.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { R as RuntimeLoginOverridableOptions } from './types-
|
|
2
|
+
import { R as RuntimeLoginOverridableOptions } from './types-fObwliWo.js';
|
|
3
3
|
import '@metamask/eth-sig-util';
|
|
4
4
|
import '@ethersproject/providers';
|
|
5
5
|
import 'eventemitter3';
|
package/dist/dts/ui.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { R as RuntimeLoginOverridableOptions } from './types-
|
|
2
|
+
import { R as RuntimeLoginOverridableOptions } from './types-fObwliWo.js';
|
|
3
3
|
import '@metamask/eth-sig-util';
|
|
4
4
|
import '@ethersproject/providers';
|
|
5
5
|
import 'eventemitter3';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createAbstractClient as
|
|
1
|
+
import{createAbstractClient as a}from"@abstract-foundation/agw-client";import{createWalletClient as t,custom as e}from"viem";import{toAccount as r}from"viem/accounts";import{abstractTestnet as s}from"viem/chains";import{u as n}from"./privy-context-BeqkgOHo.mjs";import{u as o,M as i,g as c}from"./getEmbeddedConnectedWallet-CeIDxPC5.mjs";import{a3 as l,Q as m}from"./useWallets-C0_t04LR.mjs";import{c as d}from"./smart-wallets-vjWIsaaC.mjs";import"ofetch";import"react";import"react/jsx-runtime";import"@ethersproject/providers";import"tinycolor2";import"permissionless";import"permissionless/accounts";import"permissionless/clients/pimlico";import"viem/account-abstraction";function p(){let{noPromptOnSignature:p,openPrivyModal:u,chains:g,appId:f,rpcConfig:h}=n(),{wallets:E}=l(),{setModalData:T}=o();return{sendTransaction:async n=>{let o=await(async()=>{let n=c(E);if(!n)throw Error("No connected wallet found");let o=g.find((a=>a.id===s.id));if(!o)throw Error("Chain not configured");await n.switchChain(o.id);let i=await n.getEthereumProvider(),l=t({account:n.address,transport:e(i)}),d=r({address:n.address,signMessage:l.signMessage,signTransaction:l.signTransaction,signTypedData:l.signTypedData});return await a({chain:{...o,rpcUrls:{default:{http:[m(o,h,f)]}}},signer:d})})(),l=[];return l="calls"in n&&void 0!==n.calls?[...n.calls]:[n],new Promise((async(a,t)=>{p.current=!0,T({connectWallet:{onCompleteNavigateTo:i.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:d({calls:l,chain:o.chain,maxPriorityFeePerGas:n.maxPriorityFeePerGas,maxFeePerGas:n.maxFeePerGas,nonce:n.nonce?BigInt(n.nonce):void 0}),rootWallet:{address:o.account.address},transactingWallet:{address:o.account.address,walletIndex:null},getIsSponsored:async()=>!0,onConfirm:()=>l.length>1?o.sendTransactionBatch(n):o.sendTransaction(n),onSuccess:t=>a(t.hash),onFailure:t,uiOptions:{}}}),u(i.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{p.current=!1}))}}}export{p as useAbstractSmartWallets};
|
package/dist/esm/{getEmbeddedConnectedWallet-2FJQV-TA.mjs → getEmbeddedConnectedWallet-CeIDxPC5.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as E,jsxs as _}from"react/jsx-runtime";import{useState as N,useEffect as A,useRef as S,useContext as R,createContext as T}from"react";import{z as C,ap as D}from"./useWallets-
|
|
1
|
+
import{jsx as E,jsxs as _}from"react/jsx-runtime";import{useState as N,useEffect as A,useRef as S,useContext as R,createContext as T}from"react";import{z as C,ap as D}from"./useWallets-C0_t04LR.mjs";import{n as L}from"./privy-context-BeqkgOHo.mjs";function O({src:_,...N}){return E("img",{src:_,...N,style:{display:"none"}})}var I,e;(I=e||(e={})).LANDING="LANDING",I.CONNECT_OR_CREATE="CONNECT_OR_CREATE",I.AWAITING_CONNECTION="AWAITING_CONNECTION",I.AWAITING_FARCASTER_CONNECTION="AWAITING_FARCASTER_CONNECTION",I.AWAITING_FARCASTER_SIGNER="AWAITING_FARCASTER_SIGNER",I.AWAITING_OAUTH_SCREEN="AWAITING_OAUTH_SCREEN",I.CROSS_APP_AUTH_SCREEN="CROSS_APP_AUTH_SCREEN",I.AWAITING_PASSWORDLESS_CODE="AWAITING_PASSWORDLESS_CODE",I.AWAITING_PASSKEY_SYSTEM_DIALOGUE="AWAITING_PASSKEY_SYSTEM_DIALOGUE",I.LINK_EMAIL_SCREEN="LINK_EMAIL_SCREEN",I.LINK_PHONE_SCREEN="LINK_PHONE_SCREEN",I.LINK_WALLET_SCREEN="LINK_WALLET_SCREEN",I.LINK_PASSKEY_SCREEN="LINK_PASSKEY_SCREEN",I.UPDATE_EMAIL_SCREEN="UPDATE_EMAIL_SCREEN",I.UPDATE_PHONE_SCREEN="UPDATE_PHONE_SCREEN",I.AWAITING_CONNECT_ONLY_CONNECTION="AWAITING_CONNECT_ONLY_CONNECTION",I.CONNECT_ONLY_LANDING_SCREEN="CONNECT_ONLY_LANDING_SCREEN",I.CONNECT_ONLY_AUTHENTICATED_SCREEN="CONNECT_ONLY_AUTHENTICATED_SCREEN",I.LOGIN_FAILED_SCREEN="LOGIN_FAILED_SCREEN",I.ALLOWLIST_REJECTION_SCREEN="ALLOWLIST_REJECTION_SCREEN",I.ACCOUNT_NOT_FOUND_SCREEN="ACCOUNT_NOT_FOUND_SCREEN",I.USER_LIMIT_REACHED_SCREEN="USER_LIMIT_REACHED_SCREEN",I.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN="EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN",I.EMBEDDED_WALLET_CREATED_SCREEN="EMBEDDED_WALLET_CREATED_SCREEN",I.EMBEDDED_WALLET_CONNECTING_SCREEN="EMBEDDED_WALLET_CONNECTING_SCREEN",I.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN="EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN",I.EMBEDDED_WALLET_KEY_EXPORT_SCREEN="EMBEDDED_WALLET_KEY_EXPORT_SCREEN",I.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",I.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN",I.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",I.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",I.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN="EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN",I.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN",I.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN",I.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN="EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN",I.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN="EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN",I.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN",I.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN",I.INSTALL_PHANTOM_SCREEN="INSTALL_PHANTOM_SCREEN",I.PHANTOM_INTERSTITIAL_SCREEN="PHANTOM_INTERSTITIAL_SCREEN",I.AFFIRMATIVE_CONSENT_SCREEN="AFFIRMATIVE_CONSENT_SCREEN",I.FUNDING_METHOD_SELECTION_SCREEN="FUNDING_METHOD_SELECTION_SCREEN",I.FUNDING_TRANSFER_FROM_WALLET_SCREEN="FUNDING_TRANSFER_FROM_WALLET_SCREEN",I.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN",I.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN",I.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN="FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN",I.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN="FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN",I.FUNDING_MANUAL_TRANSFER_SCREEN="FUNDING_MANUAL_TRANSFER_SCREEN",I.MOONPAY_PROMPT_SCREEN="MOONPAY_PROMPT_SCREEN",I.MOONPAY_STATUS_SCREEN="MOONPAY_STATUS_SCREEN",I.COINBASE_ONRAMP_STATUS_SCREEN="COINBASE_ONRAMP_STATUS_SCREEN",I.MFA_ENROLLMENT_FLOW_SCREEN="MFA_ENROLLMENT_FLOW_SCREEN",I.CAPTCHA_SCREEN="CAPTCHA_SCREEN",I.ERROR_SCREEN="ERROR_SCREEN",I.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE="IN_APP_BROWSER_LOGIN_NOT_POSSIBLE",I.TELEGRAM_AUTH_SCREEN="TELEGRAM_AUTH_SCREEN",I.LINK_CONFLICT_SCREEN="LINK_CONFLICT_SCREEN";const M=T({ready:!1,app:D,currentScreen:null,lastScreen:null,navigate:L,navigateBack:L,resetNavigation:L,setModalData:L,onUserCloseViaDialogOrKeybindRef:void 0});let a=[e.LANDING,e.CONNECT_ONLY_LANDING_SCREEN,null];const W=R=>{let T=C(),D=R.authenticated,[L,I]=N(R.initialScreen);A((()=>{D||a.includes(R.initialScreen)||R.setInitialScreen(null)}),[D]);let e=S(null);A((()=>{R.open||(e.current=null)}),[R.open]),A((()=>{e.current=null}),[R.initialScreen]);let W={ready:!!T.id,app:T,data:R.data,setModalData:R.setModalData,currentScreen:R.initialScreen,lastScreen:L,navigate:(E,_=!0)=>{R.setInitialScreen(E),_&&I(R.initialScreen)},navigateBack:()=>{R.setInitialScreen(L)},resetNavigation:()=>{R.setInitialScreen(null),I(null)},onUserCloseViaDialogOrKeybindRef:e};return _(M.Provider,{value:W,children:[("string"==typeof T.appearance.logo||"img"===T.appearance.logo?.type)&&E(O,{src:"string"==typeof T.appearance.logo?T.appearance.logo:T.appearance.logo.props.src}),R.children]})},n=()=>R(M);function t(E){return E.find((E=>"privy"===E.walletClientType&&"embedded"===E.connectorType&&!E.imported))??null}export{e as M,W as a,t as g,n as u};
|