@privy-io/react-auth 1.92.7 → 1.92.8
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-BCSe3UD8.js} +1 -1
- package/dist/cjs/index.js +67 -67
- package/dist/cjs/{privy-context-6Fn5d7Hw.js → privy-context-B43g6JiF.js} +1 -1
- package/dist/cjs/{smart-wallets-Di4AUVjR.js → smart-wallets-DlagnlvE.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-DFftFMBJ.js} +5 -5
- package/dist/cjs/{useSolanaWallets-CQuWnY1r.js → useSolanaWallets-DfiHdSOv.js} +1 -1
- package/dist/cjs/{useWallets-Br4RRclA.js → useWallets-CWzH6bag.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-D4LbpEn7.d.mts} +1 -1
- package/dist/dts/{solana-BRQvrG8A.d.mts → solana-D4LbpEn7.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-CAHNKx-q.d.mts} +293 -81
- package/dist/dts/{types-fS_ewT7E.d.ts → types-CAHNKx-q.d.ts} +293 -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-Qi_uxCqa.mjs} +1 -1
- package/dist/esm/index.mjs +314 -314
- package/dist/esm/privy-context-CW9-rtNf.mjs +1 -0
- package/dist/esm/{smart-wallets-C0eP6Grh.mjs → smart-wallets-Bk-33Glw.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-BVBVr3Un.mjs} +18 -18
- package/dist/esm/{useSolanaWallets-Cn7Eb8fU.mjs → useSolanaWallets-bZtAvFN_.mjs} +1 -1
- package/dist/esm/{useWallets-0pQT6tND.mjs → useWallets-CPLpVZRq.mjs} +1 -1
- package/package.json +5 -5
- package/dist/esm/privy-context-BXjG69vB.mjs +0 -1
|
@@ -249,6 +249,192 @@ declare class ProviderRpcError extends PrivyError {
|
|
|
249
249
|
constructor(message: string, code: number, data?: unknown);
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
+
type BaseProxyRequest = {
|
|
253
|
+
accessToken: string;
|
|
254
|
+
} & Partial<MfaSubmitArgs>;
|
|
255
|
+
type EntropyIdVerifier = 'ethereum-address-verifier' | 'solana-address-verifier';
|
|
256
|
+
type BaseWalletsRequestData = BaseProxyRequest & {
|
|
257
|
+
chainType: 'ethereum' | 'solana' | 'bitcoin-taproot' | 'bitcoin-segwit';
|
|
258
|
+
};
|
|
259
|
+
type WalletsCreateRequestDataType = BaseWalletsRequestData & {
|
|
260
|
+
/** Optional: the user-specified recovery password, replaces recoveryPin */
|
|
261
|
+
recoveryPassword?: string;
|
|
262
|
+
/** Optional: the recovery method to be used for the created wallet */
|
|
263
|
+
recoveryMethod?: UserRecoveryMethod;
|
|
264
|
+
/** Optional: in the case of cloud recovery, the access token to be used to communicated with the cloud provider (eg Google) */
|
|
265
|
+
recoveryAccessToken?: string;
|
|
266
|
+
/** Optional: override the recoverySecret, only for use when we need to store recovery secrets in cloud storage outside of the iframe (eg native) */
|
|
267
|
+
recoverySecretOverride?: string;
|
|
268
|
+
/** Optional: override the iCloudRecordName, only for use when we need to store recovery secrets in cloud storage outside of the iframe (eg native) */
|
|
269
|
+
iCloudRecordNameOverride?: string;
|
|
270
|
+
};
|
|
271
|
+
type WalletsCreateResponseDataType = {
|
|
272
|
+
address: string;
|
|
273
|
+
};
|
|
274
|
+
type WalletsAddRequestDataType = BaseWalletsRequestData & {
|
|
275
|
+
/**
|
|
276
|
+
* Key with which to look up the existing entropy
|
|
277
|
+
*/
|
|
278
|
+
entropyId: string;
|
|
279
|
+
/**
|
|
280
|
+
* Source of the `entropyId` property. This field determines how the entropyId will
|
|
281
|
+
* be used. Possible values include:
|
|
282
|
+
* - ethereum-address-verifier: the entropyId is the address of the Ethereum wallet derived
|
|
283
|
+
* at index 0 for this entropy
|
|
284
|
+
* - solana-address-verifier: the entropyId is a the address of the Solana wallet derived
|
|
285
|
+
* at index 0 for this entropy
|
|
286
|
+
*
|
|
287
|
+
* When this field is a wallet address, we can verify reconstitution was successful by
|
|
288
|
+
* deriving the specified wallet and comparing the address to the `entropyId`
|
|
289
|
+
*/
|
|
290
|
+
entropyIdVerifier: EntropyIdVerifier;
|
|
291
|
+
/**
|
|
292
|
+
* The HD node index at which to create a wallet. Must be >= 1 AND equal to the next
|
|
293
|
+
* index in the sequence, since the primary wallet is created at index 0.
|
|
294
|
+
*/
|
|
295
|
+
hdWalletIndex: number;
|
|
296
|
+
};
|
|
297
|
+
type WalletsAddResponseDataType = {
|
|
298
|
+
address: string;
|
|
299
|
+
};
|
|
300
|
+
type WalletsSetRecoveryBaseRequestDataType = BaseWalletsRequestData & {
|
|
301
|
+
/**
|
|
302
|
+
* Key with which to look up the existing entropy
|
|
303
|
+
*/
|
|
304
|
+
entropyId: string;
|
|
305
|
+
/**
|
|
306
|
+
* Source of the `entropyId` property. This field determines how the entropyId will
|
|
307
|
+
* be used. Possible values include:
|
|
308
|
+
* - ethereum-address-verifier: the entropyId is the address of the Ethereum wallet derived
|
|
309
|
+
* at index 0 for this entropy
|
|
310
|
+
* - solana-address-verifier: the entropyId is a the address of the Solana wallet derived
|
|
311
|
+
* at index 0 for this entropy
|
|
312
|
+
*
|
|
313
|
+
* When this field is a wallet address, we can verify reconstitution was successful by
|
|
314
|
+
* deriving the specified wallet and comparing the address to the `entropyId`
|
|
315
|
+
*/
|
|
316
|
+
entropyIdVerifier: EntropyIdVerifier;
|
|
317
|
+
existingRecoveryMethod?: UserRecoveryMethod;
|
|
318
|
+
};
|
|
319
|
+
type WalletsSetRecoveryPasswordDataType = WalletsSetRecoveryBaseRequestDataType & {
|
|
320
|
+
recoveryMethod: 'user-passcode';
|
|
321
|
+
recoveryPassword: string;
|
|
322
|
+
};
|
|
323
|
+
type WalletsSetRecoveryGoogleDriveDataType = WalletsSetRecoveryBaseRequestDataType & {
|
|
324
|
+
recoveryMethod: 'google-drive';
|
|
325
|
+
recoveryAccessToken: string;
|
|
326
|
+
};
|
|
327
|
+
type WalletsSetRecoveryICloudDataType = WalletsSetRecoveryBaseRequestDataType & {
|
|
328
|
+
recoveryMethod: 'icloud';
|
|
329
|
+
recoveryAccessToken: string;
|
|
330
|
+
};
|
|
331
|
+
type WalletsSetRecoveryICloudNativeDataType = WalletsSetRecoveryBaseRequestDataType & {
|
|
332
|
+
recoveryMethod: 'icloud-native';
|
|
333
|
+
recoverySecretOverride: string;
|
|
334
|
+
iCloudRecordNameOverride: string;
|
|
335
|
+
};
|
|
336
|
+
type WalletsSetRecoveryRequestDataType = Omit<WalletsSetRecoveryPasswordDataType, 'chainType'> | Omit<WalletsSetRecoveryGoogleDriveDataType, 'chainType'> | Omit<WalletsSetRecoveryICloudDataType, 'chainType'> | Omit<WalletsSetRecoveryICloudNativeDataType, 'chainType'>;
|
|
337
|
+
type WalletsSetRecoveryResponseDataType = {
|
|
338
|
+
entropyId: string;
|
|
339
|
+
/**
|
|
340
|
+
* Source of the `entropyId` property. This field determines how the entropyId will
|
|
341
|
+
* be used. Possible values include:
|
|
342
|
+
* - ethereum-address-verifier: the entropyId is the address of the Ethereum wallet derived
|
|
343
|
+
* at index 0 for this entropy
|
|
344
|
+
* - solana-address-verifier: the entropyId is a the address of the Solana wallet derived
|
|
345
|
+
* at index 0 for this entropy
|
|
346
|
+
*
|
|
347
|
+
* When this field is a wallet address, we can verify reconstitution was successful by
|
|
348
|
+
* deriving the specified wallet and comparing the address to the `entropyId`
|
|
349
|
+
*/
|
|
350
|
+
entropyIdVerifier: EntropyIdVerifier;
|
|
351
|
+
recoveryMethod: WalletsSetRecoveryRequestDataType['recoveryMethod'];
|
|
352
|
+
};
|
|
353
|
+
type WalletsConnectRequestDataType = BaseProxyRequest & {
|
|
354
|
+
/**
|
|
355
|
+
* Key with which to look up the existing entropy
|
|
356
|
+
*/
|
|
357
|
+
entropyId: string;
|
|
358
|
+
/**
|
|
359
|
+
* Source of the key with which to look up the existing entropy
|
|
360
|
+
*/
|
|
361
|
+
entropyIdVerifier: EntropyIdVerifier;
|
|
362
|
+
};
|
|
363
|
+
type WalletsConnectResponseDataType = {
|
|
364
|
+
address: string;
|
|
365
|
+
};
|
|
366
|
+
type WalletsRecoverRequestDataType = BaseProxyRequest & {
|
|
367
|
+
/**
|
|
368
|
+
* Key with which to look up the existing entropy
|
|
369
|
+
*/
|
|
370
|
+
entropyId: string;
|
|
371
|
+
/**
|
|
372
|
+
* Source of the `entropyId` property. This field determines how the entropyId will
|
|
373
|
+
* be used. Possible values include:
|
|
374
|
+
* - ethereum-address-verifier: the entropyId is the address of the Ethereum wallet derived
|
|
375
|
+
* at index 0 for this entropy
|
|
376
|
+
* - solana-address-verifier: the entropyId is a the address of the Solana wallet derived
|
|
377
|
+
* at index 0 for this entropy
|
|
378
|
+
*
|
|
379
|
+
* When this field is a wallet address, we can verify reconstitution was successful by
|
|
380
|
+
* deriving the specified wallet and comparing the address to the `entropyId`
|
|
381
|
+
*/
|
|
382
|
+
entropyIdVerifier: EntropyIdVerifier;
|
|
383
|
+
/** Optional: the user-specified recovery password, replaces recoveryPin */
|
|
384
|
+
recoveryPassword?: string;
|
|
385
|
+
/** Optional: in the case of cloud recovery, the access token to be used to communicated with the cloud provider (eg Google) */
|
|
386
|
+
recoveryAccessToken?: string;
|
|
387
|
+
/** Optional: override the recoverySecret, only for use when we need to retrieve recovery secrets in cloud storage outside of the iframe (eg native) */
|
|
388
|
+
recoverySecretOverride?: string;
|
|
389
|
+
};
|
|
390
|
+
type WalletsRecoverResponseDataType = {
|
|
391
|
+
entropyId: string;
|
|
392
|
+
};
|
|
393
|
+
type WalletsRpcEthereumRequestDataType = {
|
|
394
|
+
chainType: 'ethereum';
|
|
395
|
+
request: EthereumRpcRequestType;
|
|
396
|
+
};
|
|
397
|
+
type WalletsRpcSolanaRequestDataType = {
|
|
398
|
+
chainType: 'solana';
|
|
399
|
+
request: SolanaRpcRequestType;
|
|
400
|
+
};
|
|
401
|
+
type WalletsRpcBitcoinRequestDataType = {
|
|
402
|
+
chainType: 'bitcoin-taproot' | 'bitcoin-segwit';
|
|
403
|
+
request: unknown;
|
|
404
|
+
};
|
|
405
|
+
type WalletsRpcRequestDataType = BaseWalletsRequestData & {
|
|
406
|
+
/**
|
|
407
|
+
* Key with which to look up the existing entropy
|
|
408
|
+
*/
|
|
409
|
+
entropyId: string;
|
|
410
|
+
/**
|
|
411
|
+
* Source of the `entropyId` property. This field determines how the entropyId will
|
|
412
|
+
* be used. Possible values include:
|
|
413
|
+
* - ethereum-address-verifier: the entropyId is the address of the Ethereum wallet derived
|
|
414
|
+
* at index 0 for this entropy
|
|
415
|
+
* - solana-address-verifier: the entropyId is a the address of the Solana wallet derived
|
|
416
|
+
* at index 0 for this entropy
|
|
417
|
+
*
|
|
418
|
+
* When this field is a wallet address, we can verify reconstitution was successful by
|
|
419
|
+
* deriving the specified wallet and comparing the address to the `entropyId`
|
|
420
|
+
*/
|
|
421
|
+
entropyIdVerifier: EntropyIdVerifier;
|
|
422
|
+
} & (WalletsRpcEthereumRequestDataType | WalletsRpcSolanaRequestDataType | WalletsRpcBitcoinRequestDataType);
|
|
423
|
+
type WalletsRpcEthereumResponseDataType = {
|
|
424
|
+
chainType: 'ethereum';
|
|
425
|
+
response: EthereumRpcResponseType;
|
|
426
|
+
};
|
|
427
|
+
type WalletsRpcSolanaResponseDataType = {
|
|
428
|
+
chainType: 'solana';
|
|
429
|
+
response: SolanaRpcResponseType;
|
|
430
|
+
};
|
|
431
|
+
type WalletsRpcBitcoinResponseDataType = {
|
|
432
|
+
chainType: 'bitcoin-taproot' | 'bitcoin-segwit';
|
|
433
|
+
response: unknown;
|
|
434
|
+
};
|
|
435
|
+
type WalletsRpcResponseDataType = {
|
|
436
|
+
address: string;
|
|
437
|
+
} & (WalletsRpcEthereumResponseDataType | WalletsRpcSolanaResponseDataType | WalletsRpcBitcoinResponseDataType);
|
|
252
438
|
type BaseWalletCreateRequestDataType = {
|
|
253
439
|
accessToken: string;
|
|
254
440
|
};
|
|
@@ -273,32 +459,34 @@ type EthereumWalletCreateRequestDataType = BaseWalletCreateRequestDataType & Bas
|
|
|
273
459
|
*/
|
|
274
460
|
solanaAddress?: string;
|
|
275
461
|
};
|
|
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;
|
|
462
|
+
type WalletCreateResponseDataType = {
|
|
463
|
+
address: string;
|
|
286
464
|
};
|
|
287
465
|
type WalletCreateAdditionalRequestDataType = {
|
|
288
466
|
accessToken: string;
|
|
289
467
|
primaryWalletAddress: string;
|
|
468
|
+
/**
|
|
469
|
+
* The HD node index at which to create a wallet. Must be >= 1 for ethereum
|
|
470
|
+
* and solana, must be >= 0 otherwise.
|
|
471
|
+
*/
|
|
290
472
|
hdWalletIndex: number;
|
|
291
473
|
};
|
|
474
|
+
type WalletCreateAdditionalResponseDataType = {
|
|
475
|
+
address: string;
|
|
476
|
+
};
|
|
292
477
|
type WalletImportRequestDataType = {
|
|
293
478
|
accessToken: string;
|
|
294
479
|
privateKey: string;
|
|
295
480
|
};
|
|
296
|
-
type
|
|
481
|
+
type WalletImportResponseDataType = {
|
|
482
|
+
address: string;
|
|
483
|
+
};
|
|
484
|
+
type WalletConnectRequestDataType = {
|
|
297
485
|
accessToken: string;
|
|
298
486
|
address: string;
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
487
|
+
};
|
|
488
|
+
type WalletConnectResponseDataType = {
|
|
489
|
+
address: string;
|
|
302
490
|
};
|
|
303
491
|
type WalletRecoverRequestDataType = {
|
|
304
492
|
address: string;
|
|
@@ -316,9 +504,18 @@ type WalletRecoverRequestDataType = {
|
|
|
316
504
|
*/
|
|
317
505
|
recoveryPin?: string;
|
|
318
506
|
};
|
|
319
|
-
type
|
|
507
|
+
type WalletRecoverResponseDataType = {
|
|
508
|
+
address: string;
|
|
509
|
+
};
|
|
510
|
+
type WalletSetRecoveryRequestDataType = {
|
|
320
511
|
accessToken: string;
|
|
321
512
|
address: string;
|
|
513
|
+
recoveryMethod: UserRecoveryMethod;
|
|
514
|
+
recoveryPassword?: string;
|
|
515
|
+
recoveryAccessToken?: string;
|
|
516
|
+
};
|
|
517
|
+
type WalletSetRecoveryResponseDataType = {
|
|
518
|
+
address: string;
|
|
322
519
|
};
|
|
323
520
|
type WalletRpcRequestDataType = {
|
|
324
521
|
accessToken: string;
|
|
@@ -330,46 +527,51 @@ type WalletRpcRequestDataType = {
|
|
|
330
527
|
address: string;
|
|
331
528
|
request: EthereumRpcRequestType;
|
|
332
529
|
};
|
|
530
|
+
type WalletRpcResponseDataType = {
|
|
531
|
+
address: string;
|
|
532
|
+
response: EthereumRpcResponseType;
|
|
533
|
+
};
|
|
534
|
+
type SolanaWalletCreateRequestDataType = BaseWalletCreateRequestDataType & {
|
|
535
|
+
/**
|
|
536
|
+
* If a user has an existing Ethereum embedded wallet when creating the Solana embedded wallet, that address
|
|
537
|
+
* MUST be passed in this field. Our iframe will use this address to derive the Solana embedded wallet from the
|
|
538
|
+
* same entropy as the Ethereum wallet.
|
|
539
|
+
*
|
|
540
|
+
* If no address is passed here, our iframe assumes that the user has no existing Ethereum wallet and will create
|
|
541
|
+
* a new set of entropy for Solana.
|
|
542
|
+
*/
|
|
543
|
+
ethereumAddress?: string;
|
|
544
|
+
};
|
|
545
|
+
type SolanaWalletCreateResponseDataType = {
|
|
546
|
+
publicKey: string;
|
|
547
|
+
};
|
|
333
548
|
type SolanaWalletConnectRequestDataType = {
|
|
334
549
|
publicKey: string;
|
|
335
550
|
accessToken: string;
|
|
336
551
|
};
|
|
552
|
+
type SolanaWalletConnectResponseDataType = {
|
|
553
|
+
publicKey: string;
|
|
554
|
+
};
|
|
337
555
|
type SolanaWalletRecoverRequestDataType = {
|
|
338
556
|
publicKey: string;
|
|
339
557
|
accessToken: string;
|
|
340
558
|
};
|
|
559
|
+
type SolanaWalletRecoverResponseDataType = {
|
|
560
|
+
publicKey: string;
|
|
561
|
+
};
|
|
341
562
|
type SolanaWalletRpcRequestDataType = {
|
|
342
563
|
accessToken: string;
|
|
343
564
|
publicKey: string;
|
|
344
565
|
request: SolanaRpcRequestType;
|
|
345
566
|
};
|
|
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[];
|
|
567
|
+
type SolanaWalletRpcResponseDataType = {
|
|
568
|
+
publicKey: string;
|
|
569
|
+
response: SolanaRpcResponseType;
|
|
369
570
|
};
|
|
370
571
|
type MfaVerifyRequestDataType = {
|
|
371
572
|
accessToken: string;
|
|
372
573
|
};
|
|
574
|
+
type MfaVerifyResponseDataType = Record<string, never>;
|
|
373
575
|
type MfaInitEnrollmentRequestDataType = {
|
|
374
576
|
accessToken: string;
|
|
375
577
|
method: 'sms';
|
|
@@ -378,6 +580,11 @@ type MfaInitEnrollmentRequestDataType = {
|
|
|
378
580
|
accessToken: string;
|
|
379
581
|
method: 'totp';
|
|
380
582
|
};
|
|
583
|
+
type MfaInitEnrollmentResponseDataType = {
|
|
584
|
+
method: string;
|
|
585
|
+
secret?: string;
|
|
586
|
+
authUrl?: string;
|
|
587
|
+
};
|
|
381
588
|
type MfaSubmitEnrollmentRequestDataType = {
|
|
382
589
|
accessToken: string;
|
|
383
590
|
method: 'sms';
|
|
@@ -392,13 +599,16 @@ type MfaSubmitEnrollmentRequestDataType = {
|
|
|
392
599
|
method: 'passkey';
|
|
393
600
|
credentialIds: string[];
|
|
394
601
|
};
|
|
602
|
+
type MfaSubmitEnrollmentResponseDataType = Record<string, never>;
|
|
395
603
|
type MfaUnenrollRequestDataType = {
|
|
396
604
|
accessToken: string;
|
|
397
605
|
method: 'sms' | 'totp';
|
|
398
606
|
};
|
|
607
|
+
type MfaUnenrollResponseDataType = Record<string, never>;
|
|
399
608
|
type MfaClearRequestDataType = {
|
|
400
609
|
userId: string;
|
|
401
610
|
};
|
|
611
|
+
type MfaClearResponseDataType = Record<string, never>;
|
|
402
612
|
type FarcasterSignerInitRequestDataType = {
|
|
403
613
|
address: string;
|
|
404
614
|
hdWalletIndex: number | null;
|
|
@@ -407,6 +617,7 @@ type FarcasterSignerInitRequestDataType = {
|
|
|
407
617
|
mfaMethod: string | null;
|
|
408
618
|
relyingParty: string;
|
|
409
619
|
};
|
|
620
|
+
type FarcasterSignerInitResponseDataType = PrivyFarcasterSignerInitResponse;
|
|
410
621
|
type FarcasterSignRequestDataType = {
|
|
411
622
|
address: string;
|
|
412
623
|
hdWalletIndex: number | null;
|
|
@@ -419,72 +630,68 @@ type FarcasterSignRequestDataType = {
|
|
|
419
630
|
};
|
|
420
631
|
fid: bigint;
|
|
421
632
|
};
|
|
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;
|
|
633
|
+
type FarcasterSignResponseDataType = {
|
|
634
|
+
hash: string;
|
|
635
|
+
signature: string;
|
|
436
636
|
};
|
|
437
|
-
type
|
|
637
|
+
type RootWalletForDelegation = {
|
|
638
|
+
/** Address of the root wallet for the entropy being delegated. */
|
|
438
639
|
address: string;
|
|
640
|
+
/** Chain type of the root wallet for the entropy being delegated. */
|
|
641
|
+
chainType: 'ethereum' | 'solana';
|
|
642
|
+
/** Whether or not the root wallet for the entropy being delegated is imported. */
|
|
643
|
+
imported: boolean;
|
|
439
644
|
};
|
|
440
|
-
type
|
|
645
|
+
type DelegatedWallet = {
|
|
646
|
+
/** Address for a wallet to delegate. */
|
|
441
647
|
address: string;
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
};
|
|
447
|
-
type SolanaWalletConnectResponseDataType = {
|
|
448
|
-
publicKey: string;
|
|
449
|
-
};
|
|
450
|
-
type SolanaWalletRecoverResponseDataType = {
|
|
451
|
-
publicKey: string;
|
|
648
|
+
/** Chain type for a wallet to delegate. */
|
|
649
|
+
chainType: 'ethereum' | 'solana';
|
|
650
|
+
/** HD index for the wallet to delegate. */
|
|
651
|
+
walletIndex: number;
|
|
452
652
|
};
|
|
453
|
-
type
|
|
454
|
-
|
|
455
|
-
|
|
653
|
+
type DelegatedActionsConsentRequestDataType = {
|
|
654
|
+
/** Access token for the user */
|
|
655
|
+
accessToken: string;
|
|
656
|
+
/** Root wallet to delegate, which is the wallet at HD index 0 for the entropy. */
|
|
657
|
+
rootWallet: RootWalletForDelegation;
|
|
658
|
+
/** Wallets to delegate, whose entropy is the same as `rootWallet`'s. */
|
|
659
|
+
delegatedWallets: DelegatedWallet[];
|
|
456
660
|
};
|
|
457
661
|
type DelegatedActionsConsentResponseDataType = {
|
|
458
662
|
success: boolean;
|
|
459
663
|
};
|
|
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
664
|
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
665
|
type PrivyIframeErrorTypesType = (typeof PrivyIframeErrorTypes)[number];
|
|
476
666
|
interface EmbeddedWalletProxy {
|
|
667
|
+
createWallet: (data: WalletsCreateRequestDataType) => Promise<WalletsCreateResponseDataType>;
|
|
668
|
+
addWallet: (data: WalletsAddRequestDataType) => Promise<WalletsAddResponseDataType>;
|
|
669
|
+
setRecoveryWallet: (data: WalletsSetRecoveryRequestDataType) => Promise<WalletsSetRecoveryResponseDataType>;
|
|
670
|
+
connectWallet: (data: WalletsConnectRequestDataType) => Promise<WalletsConnectResponseDataType>;
|
|
671
|
+
recoverWallet: (data: WalletsRecoverRequestDataType) => Promise<WalletsRecoverResponseDataType>;
|
|
672
|
+
rpcWallet(data: WalletsRpcRequestDataType): Promise<WalletsRpcResponseDataType>;
|
|
673
|
+
/** @deprecated */
|
|
477
674
|
create: (data: EthereumWalletCreateRequestDataType) => Promise<WalletCreateResponseDataType>;
|
|
675
|
+
/** @deprecated */
|
|
478
676
|
createAdditional: (data: WalletCreateAdditionalRequestDataType) => Promise<WalletCreateAdditionalResponseDataType>;
|
|
479
677
|
import: (data: WalletImportRequestDataType) => Promise<WalletImportResponseDataType>;
|
|
678
|
+
/** @deprecated */
|
|
480
679
|
connect: (data: WalletConnectRequestDataType) => Promise<WalletConnectResponseDataType>;
|
|
680
|
+
/** @deprecated */
|
|
481
681
|
recover: (data: WalletRecoverRequestDataType) => Promise<WalletRecoverResponseDataType>;
|
|
682
|
+
/** @deprecated */
|
|
482
683
|
setRecovery: (data: WalletSetRecoveryRequestDataType) => Promise<WalletSetRecoveryResponseDataType>;
|
|
684
|
+
/** @deprecated */
|
|
483
685
|
rpc: (data: WalletRpcRequestDataType) => Promise<WalletRpcResponseDataType>;
|
|
686
|
+
/** @deprecated */
|
|
484
687
|
createSolana: (data: SolanaWalletCreateRequestDataType) => Promise<SolanaWalletCreateResponseDataType>;
|
|
688
|
+
/** @deprecated */
|
|
485
689
|
connectSolana: (data: SolanaWalletConnectRequestDataType) => Promise<SolanaWalletConnectResponseDataType>;
|
|
690
|
+
/** @deprecated */
|
|
486
691
|
recoverSolana: (data: SolanaWalletRecoverRequestDataType) => Promise<SolanaWalletRecoverResponseDataType>;
|
|
692
|
+
/** @deprecated */
|
|
487
693
|
rpcSolana: (data: SolanaWalletRpcRequestDataType) => Promise<SolanaWalletRpcResponseDataType>;
|
|
694
|
+
/** @deprecated */
|
|
488
695
|
createDelegatedAction: (data: DelegatedActionsConsentRequestDataType) => Promise<DelegatedActionsConsentResponseDataType>;
|
|
489
696
|
verifyMfa: (data: MfaVerifyRequestDataType) => Promise<MfaVerifyResponseDataType>;
|
|
490
697
|
initEnrollMfa: (data: MfaInitEnrollmentRequestDataType) => Promise<MfaInitEnrollmentResponseDataType>;
|
|
@@ -797,6 +1004,11 @@ declare const SUPPORTED_OAUTH_PROVIDERS: readonly ["google", "discord", "twitter
|
|
|
797
1004
|
declare const SUPPORTED_RECOVERY_PROVIDERS: readonly ["google-drive", "icloud"];
|
|
798
1005
|
declare const SUPPORTED_MFA_METHODS: readonly ["sms", "totp", "passkey"];
|
|
799
1006
|
type MfaMethod = (typeof SUPPORTED_MFA_METHODS)[number];
|
|
1007
|
+
type MfaSubmitArgs = {
|
|
1008
|
+
mfaMethod: MfaMethod;
|
|
1009
|
+
mfaCode: string | PasskeyAuthenticateInputType['authenticator_response'];
|
|
1010
|
+
relyingParty: string;
|
|
1011
|
+
};
|
|
800
1012
|
/**
|
|
801
1013
|
* Supported OAuth providers. Can be `'google'`, `'discord'`, `'twitter'`, `'github'`, `'spotify'`,
|
|
802
1014
|
* `'instagram'`, `'tiktok'`, `'linkedin'`, or `'apple'`
|
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-CAHNKx-q.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-CAHNKx-q.js';
|
|
3
3
|
import '@metamask/eth-sig-util';
|
|
4
4
|
import '@ethersproject/providers';
|
|
5
5
|
import 'eventemitter3';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createAbstractClient as t}from"@abstract-foundation/agw-client";import{createWalletClient as a,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-
|
|
1
|
+
import{createAbstractClient as t}from"@abstract-foundation/agw-client";import{createWalletClient as a,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-CW9-rtNf.mjs";import{u as o,M as i,g as c}from"./getEmbeddedConnectedWallet-Qi_uxCqa.mjs";import{a3 as l,Q as m}from"./useWallets-CPLpVZRq.mjs";import{c as d}from"./smart-wallets-Bk-33Glw.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((t=>t.id===s.id));if(!o)throw Error("Chain not configured");await n.switchChain(o.id);let i=await n.getEthereumProvider(),l=a({account:n.address,transport:e(i)}),d=r({address:n.address,signMessage:l.signMessage,signTransaction:l.signTransaction,signTypedData:l.signTypedData});return await t({chain:{...o,rpcUrls:{default:{http:[m(o,h,f)]}}},signer:d,transport:e(i)})})(),l=[];return l="calls"in n&&void 0!==n.calls?[...n.calls]:[n],new Promise((async(t,a)=>{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:a=>t(a.hash),onFailure:a,uiOptions:{}}}),u(i.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{p.current=!1}))}}}export{p as useAbstractSmartWallets};
|
package/dist/esm/{getEmbeddedConnectedWallet-2FJQV-TA.mjs → getEmbeddedConnectedWallet-Qi_uxCqa.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-CPLpVZRq.mjs";import{n as L}from"./privy-context-CW9-rtNf.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};
|