@privy-io/react-auth 1.92.8 → 1.93.1-beta-20241108152142
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/events-context-D4csIP2K.js +1 -0
- package/dist/cjs/{getEmbeddedConnectedWallet-BCSe3UD8.js → getEmbeddedConnectedWallet-PYb9HOQv.js} +1 -1
- package/dist/cjs/index.js +314 -314
- package/dist/cjs/privy-context-ymK4c6qn.js +1 -0
- package/dist/cjs/smart-wallets-29Ejo00S.js +1 -0
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/ui.js +22 -22
- package/dist/cjs/{useFundWallet-DFftFMBJ.js → useFundWallet-BUyUdFOr.js} +2 -2
- package/dist/cjs/useSolanaWallets-DowXcwiH.js +1 -0
- package/dist/cjs/{useWallets-CWzH6bag.js → useWallets-6sVDaCrv.js} +1 -1
- package/dist/dts/index.d.mts +4 -4
- package/dist/dts/index.d.ts +4 -4
- package/dist/dts/smart-wallets.d.mts +1 -1
- package/dist/dts/smart-wallets.d.ts +1 -1
- package/dist/dts/{solana-D4LbpEn7.d.ts → solana-zVpz_NAz.d.mts} +2 -2
- package/dist/dts/{solana-D4LbpEn7.d.mts → solana-zVpz_NAz.d.ts} +2 -2
- package/dist/dts/solana.d.mts +2 -2
- package/dist/dts/solana.d.ts +2 -2
- package/dist/dts/{types-CAHNKx-q.d.mts → types-BokrcPu3.d.mts} +70 -120
- package/dist/dts/{types-CAHNKx-q.d.ts → types-BokrcPu3.d.ts} +70 -120
- 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/events-context-2ZF4RQWB.mjs +1 -0
- package/dist/esm/{getEmbeddedConnectedWallet-Qi_uxCqa.mjs → getEmbeddedConnectedWallet-DzwfpWGG.mjs} +1 -1
- package/dist/esm/index.mjs +328 -328
- package/dist/esm/privy-context-1qVRD8ny.mjs +1 -0
- package/dist/esm/smart-wallets-M6RW4Qv6.mjs +1 -0
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/ui.mjs +20 -20
- package/dist/esm/{useFundWallet-BVBVr3Un.mjs → useFundWallet-D9qd3vBM.mjs} +1 -1
- package/dist/esm/useSolanaWallets-BSuTkje9.mjs +1 -0
- package/dist/esm/useWallets-C3i7mTy3.mjs +1 -0
- package/package.json +6 -7
- package/dist/cjs/events-context-DykapYG4.js +0 -1
- package/dist/cjs/privy-context-B43g6JiF.js +0 -1
- package/dist/cjs/smart-wallets-DlagnlvE.js +0 -1
- package/dist/cjs/useSolanaWallets-DfiHdSOv.js +0 -1
- package/dist/esm/events-context-D3j6WwDa.mjs +0 -1
- package/dist/esm/privy-context-CW9-rtNf.mjs +0 -1
- package/dist/esm/smart-wallets-Bk-33Glw.mjs +0 -1
- package/dist/esm/useSolanaWallets-bZtAvFN_.mjs +0 -1
- package/dist/esm/useWallets-CPLpVZRq.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",
|
|
@@ -252,7 +253,7 @@ declare class ProviderRpcError extends PrivyError {
|
|
|
252
253
|
type BaseProxyRequest = {
|
|
253
254
|
accessToken: string;
|
|
254
255
|
} & Partial<MfaSubmitArgs>;
|
|
255
|
-
type EntropyIdVerifier = 'ethereum-address-verifier' | 'solana-address-verifier';
|
|
256
|
+
type EntropyIdVerifier$1 = 'ethereum-address-verifier' | 'solana-address-verifier';
|
|
256
257
|
type BaseWalletsRequestData = BaseProxyRequest & {
|
|
257
258
|
chainType: 'ethereum' | 'solana' | 'bitcoin-taproot' | 'bitcoin-segwit';
|
|
258
259
|
};
|
|
@@ -287,7 +288,7 @@ type WalletsAddRequestDataType = BaseWalletsRequestData & {
|
|
|
287
288
|
* When this field is a wallet address, we can verify reconstitution was successful by
|
|
288
289
|
* deriving the specified wallet and comparing the address to the `entropyId`
|
|
289
290
|
*/
|
|
290
|
-
entropyIdVerifier: EntropyIdVerifier;
|
|
291
|
+
entropyIdVerifier: EntropyIdVerifier$1;
|
|
291
292
|
/**
|
|
292
293
|
* The HD node index at which to create a wallet. Must be >= 1 AND equal to the next
|
|
293
294
|
* index in the sequence, since the primary wallet is created at index 0.
|
|
@@ -313,7 +314,7 @@ type WalletsSetRecoveryBaseRequestDataType = BaseWalletsRequestData & {
|
|
|
313
314
|
* When this field is a wallet address, we can verify reconstitution was successful by
|
|
314
315
|
* deriving the specified wallet and comparing the address to the `entropyId`
|
|
315
316
|
*/
|
|
316
|
-
entropyIdVerifier: EntropyIdVerifier;
|
|
317
|
+
entropyIdVerifier: EntropyIdVerifier$1;
|
|
317
318
|
existingRecoveryMethod?: UserRecoveryMethod;
|
|
318
319
|
};
|
|
319
320
|
type WalletsSetRecoveryPasswordDataType = WalletsSetRecoveryBaseRequestDataType & {
|
|
@@ -347,7 +348,7 @@ type WalletsSetRecoveryResponseDataType = {
|
|
|
347
348
|
* When this field is a wallet address, we can verify reconstitution was successful by
|
|
348
349
|
* deriving the specified wallet and comparing the address to the `entropyId`
|
|
349
350
|
*/
|
|
350
|
-
entropyIdVerifier: EntropyIdVerifier;
|
|
351
|
+
entropyIdVerifier: EntropyIdVerifier$1;
|
|
351
352
|
recoveryMethod: WalletsSetRecoveryRequestDataType['recoveryMethod'];
|
|
352
353
|
};
|
|
353
354
|
type WalletsConnectRequestDataType = BaseProxyRequest & {
|
|
@@ -358,7 +359,7 @@ type WalletsConnectRequestDataType = BaseProxyRequest & {
|
|
|
358
359
|
/**
|
|
359
360
|
* Source of the key with which to look up the existing entropy
|
|
360
361
|
*/
|
|
361
|
-
entropyIdVerifier: EntropyIdVerifier;
|
|
362
|
+
entropyIdVerifier: EntropyIdVerifier$1;
|
|
362
363
|
};
|
|
363
364
|
type WalletsConnectResponseDataType = {
|
|
364
365
|
address: string;
|
|
@@ -379,7 +380,7 @@ type WalletsRecoverRequestDataType = BaseProxyRequest & {
|
|
|
379
380
|
* When this field is a wallet address, we can verify reconstitution was successful by
|
|
380
381
|
* deriving the specified wallet and comparing the address to the `entropyId`
|
|
381
382
|
*/
|
|
382
|
-
entropyIdVerifier: EntropyIdVerifier;
|
|
383
|
+
entropyIdVerifier: EntropyIdVerifier$1;
|
|
383
384
|
/** Optional: the user-specified recovery password, replaces recoveryPin */
|
|
384
385
|
recoveryPassword?: string;
|
|
385
386
|
/** Optional: in the case of cloud recovery, the access token to be used to communicated with the cloud provider (eg Google) */
|
|
@@ -418,7 +419,13 @@ type WalletsRpcRequestDataType = BaseWalletsRequestData & {
|
|
|
418
419
|
* When this field is a wallet address, we can verify reconstitution was successful by
|
|
419
420
|
* deriving the specified wallet and comparing the address to the `entropyId`
|
|
420
421
|
*/
|
|
421
|
-
entropyIdVerifier: EntropyIdVerifier;
|
|
422
|
+
entropyIdVerifier: EntropyIdVerifier$1;
|
|
423
|
+
/**
|
|
424
|
+
* The HD node index of the wallet to use for this request.
|
|
425
|
+
*/
|
|
426
|
+
hdWalletIndex: number;
|
|
427
|
+
/** For cross-app requests, the app ID of the requester app */
|
|
428
|
+
requesterAppId?: string | null;
|
|
422
429
|
} & (WalletsRpcEthereumRequestDataType | WalletsRpcSolanaRequestDataType | WalletsRpcBitcoinRequestDataType);
|
|
423
430
|
type WalletsRpcEthereumResponseDataType = {
|
|
424
431
|
chainType: 'ethereum';
|
|
@@ -462,75 +469,6 @@ type EthereumWalletCreateRequestDataType = BaseWalletCreateRequestDataType & Bas
|
|
|
462
469
|
type WalletCreateResponseDataType = {
|
|
463
470
|
address: string;
|
|
464
471
|
};
|
|
465
|
-
type WalletCreateAdditionalRequestDataType = {
|
|
466
|
-
accessToken: string;
|
|
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
|
-
*/
|
|
472
|
-
hdWalletIndex: number;
|
|
473
|
-
};
|
|
474
|
-
type WalletCreateAdditionalResponseDataType = {
|
|
475
|
-
address: string;
|
|
476
|
-
};
|
|
477
|
-
type WalletImportRequestDataType = {
|
|
478
|
-
accessToken: string;
|
|
479
|
-
privateKey: string;
|
|
480
|
-
};
|
|
481
|
-
type WalletImportResponseDataType = {
|
|
482
|
-
address: string;
|
|
483
|
-
};
|
|
484
|
-
type WalletConnectRequestDataType = {
|
|
485
|
-
accessToken: string;
|
|
486
|
-
address: string;
|
|
487
|
-
};
|
|
488
|
-
type WalletConnectResponseDataType = {
|
|
489
|
-
address: string;
|
|
490
|
-
};
|
|
491
|
-
type WalletRecoverRequestDataType = {
|
|
492
|
-
address: string;
|
|
493
|
-
imported?: boolean;
|
|
494
|
-
accessToken: string;
|
|
495
|
-
mfaCode?: string | PasskeyAuthenticateInputType['authenticator_response'];
|
|
496
|
-
mfaMethod?: MfaMethod;
|
|
497
|
-
relyingParty?: string;
|
|
498
|
-
recoveryPassword?: string;
|
|
499
|
-
recoveryMethod?: UserRecoveryMethod | 'privy';
|
|
500
|
-
recoveryAccessToken?: string;
|
|
501
|
-
/**
|
|
502
|
-
* Will be deprecated in a future release, use `recoveryPassword` instead
|
|
503
|
-
* @deprecated
|
|
504
|
-
*/
|
|
505
|
-
recoveryPin?: string;
|
|
506
|
-
};
|
|
507
|
-
type WalletRecoverResponseDataType = {
|
|
508
|
-
address: string;
|
|
509
|
-
};
|
|
510
|
-
type WalletSetRecoveryRequestDataType = {
|
|
511
|
-
accessToken: string;
|
|
512
|
-
address: string;
|
|
513
|
-
recoveryMethod: UserRecoveryMethod;
|
|
514
|
-
recoveryPassword?: string;
|
|
515
|
-
recoveryAccessToken?: string;
|
|
516
|
-
};
|
|
517
|
-
type WalletSetRecoveryResponseDataType = {
|
|
518
|
-
address: string;
|
|
519
|
-
};
|
|
520
|
-
type WalletRpcRequestDataType = {
|
|
521
|
-
accessToken: string;
|
|
522
|
-
hdWalletIndex?: number;
|
|
523
|
-
mfaCode?: string | PasskeyAuthenticateInputType['authenticator_response'];
|
|
524
|
-
mfaMethod?: MfaMethod;
|
|
525
|
-
relyingParty?: string;
|
|
526
|
-
requesterAppId?: string;
|
|
527
|
-
address: string;
|
|
528
|
-
request: EthereumRpcRequestType;
|
|
529
|
-
};
|
|
530
|
-
type WalletRpcResponseDataType = {
|
|
531
|
-
address: string;
|
|
532
|
-
response: EthereumRpcResponseType;
|
|
533
|
-
};
|
|
534
472
|
type SolanaWalletCreateRequestDataType = BaseWalletCreateRequestDataType & {
|
|
535
473
|
/**
|
|
536
474
|
* If a user has an existing Ethereum embedded wallet when creating the Solana embedded wallet, that address
|
|
@@ -545,28 +483,12 @@ type SolanaWalletCreateRequestDataType = BaseWalletCreateRequestDataType & {
|
|
|
545
483
|
type SolanaWalletCreateResponseDataType = {
|
|
546
484
|
publicKey: string;
|
|
547
485
|
};
|
|
548
|
-
type
|
|
549
|
-
publicKey: string;
|
|
550
|
-
accessToken: string;
|
|
551
|
-
};
|
|
552
|
-
type SolanaWalletConnectResponseDataType = {
|
|
553
|
-
publicKey: string;
|
|
554
|
-
};
|
|
555
|
-
type SolanaWalletRecoverRequestDataType = {
|
|
556
|
-
publicKey: string;
|
|
557
|
-
accessToken: string;
|
|
558
|
-
};
|
|
559
|
-
type SolanaWalletRecoverResponseDataType = {
|
|
560
|
-
publicKey: string;
|
|
561
|
-
};
|
|
562
|
-
type SolanaWalletRpcRequestDataType = {
|
|
486
|
+
type WalletImportRequestDataType = {
|
|
563
487
|
accessToken: string;
|
|
564
|
-
|
|
565
|
-
request: SolanaRpcRequestType;
|
|
488
|
+
privateKey: string;
|
|
566
489
|
};
|
|
567
|
-
type
|
|
568
|
-
|
|
569
|
-
response: SolanaRpcResponseType;
|
|
490
|
+
type WalletImportResponseDataType = {
|
|
491
|
+
address: string;
|
|
570
492
|
};
|
|
571
493
|
type MfaVerifyRequestDataType = {
|
|
572
494
|
accessToken: string;
|
|
@@ -666,32 +588,34 @@ type PrivyIframeErrorTypesType = (typeof PrivyIframeErrorTypes)[number];
|
|
|
666
588
|
interface EmbeddedWalletProxy {
|
|
667
589
|
createWallet: (data: WalletsCreateRequestDataType) => Promise<WalletsCreateResponseDataType>;
|
|
668
590
|
addWallet: (data: WalletsAddRequestDataType) => Promise<WalletsAddResponseDataType>;
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
591
|
+
setRecovery: (data: WalletsSetRecoveryRequestDataType) => Promise<WalletsSetRecoveryResponseDataType>;
|
|
592
|
+
connect: (data: WalletsConnectRequestDataType) => Promise<WalletsConnectResponseDataType>;
|
|
593
|
+
recover: (data: WalletsRecoverRequestDataType) => Promise<WalletsRecoverResponseDataType>;
|
|
594
|
+
rpc(data: WalletsRpcRequestDataType & {
|
|
595
|
+
chainType: 'ethereum';
|
|
596
|
+
}): Promise<WalletsRpcResponseDataType & {
|
|
597
|
+
chainType: 'ethereum';
|
|
598
|
+
}>;
|
|
599
|
+
rpc(data: WalletsRpcRequestDataType & {
|
|
600
|
+
chainType: 'solana';
|
|
601
|
+
}): Promise<WalletsRpcResponseDataType & {
|
|
602
|
+
chainType: 'solana';
|
|
603
|
+
}>;
|
|
604
|
+
rpc(data: WalletsRpcRequestDataType & {
|
|
605
|
+
chainType: 'bitcoin-taproot';
|
|
606
|
+
}): Promise<WalletsRpcResponseDataType & {
|
|
607
|
+
chainType: 'bitcoin-taproot';
|
|
608
|
+
}>;
|
|
609
|
+
rpc(data: WalletsRpcRequestDataType & {
|
|
610
|
+
chainType: 'bitcoin-segwit';
|
|
611
|
+
}): Promise<WalletsRpcResponseDataType & {
|
|
612
|
+
chainType: 'bitcoin-segwit';
|
|
613
|
+
}>;
|
|
673
614
|
/** @deprecated */
|
|
674
615
|
create: (data: EthereumWalletCreateRequestDataType) => Promise<WalletCreateResponseDataType>;
|
|
675
|
-
/** @deprecated */
|
|
676
|
-
createAdditional: (data: WalletCreateAdditionalRequestDataType) => Promise<WalletCreateAdditionalResponseDataType>;
|
|
677
616
|
import: (data: WalletImportRequestDataType) => Promise<WalletImportResponseDataType>;
|
|
678
617
|
/** @deprecated */
|
|
679
|
-
connect: (data: WalletConnectRequestDataType) => Promise<WalletConnectResponseDataType>;
|
|
680
|
-
/** @deprecated */
|
|
681
|
-
recover: (data: WalletRecoverRequestDataType) => Promise<WalletRecoverResponseDataType>;
|
|
682
|
-
/** @deprecated */
|
|
683
|
-
setRecovery: (data: WalletSetRecoveryRequestDataType) => Promise<WalletSetRecoveryResponseDataType>;
|
|
684
|
-
/** @deprecated */
|
|
685
|
-
rpc: (data: WalletRpcRequestDataType) => Promise<WalletRpcResponseDataType>;
|
|
686
|
-
/** @deprecated */
|
|
687
618
|
createSolana: (data: SolanaWalletCreateRequestDataType) => Promise<SolanaWalletCreateResponseDataType>;
|
|
688
|
-
/** @deprecated */
|
|
689
|
-
connectSolana: (data: SolanaWalletConnectRequestDataType) => Promise<SolanaWalletConnectResponseDataType>;
|
|
690
|
-
/** @deprecated */
|
|
691
|
-
recoverSolana: (data: SolanaWalletRecoverRequestDataType) => Promise<SolanaWalletRecoverResponseDataType>;
|
|
692
|
-
/** @deprecated */
|
|
693
|
-
rpcSolana: (data: SolanaWalletRpcRequestDataType) => Promise<SolanaWalletRpcResponseDataType>;
|
|
694
|
-
/** @deprecated */
|
|
695
619
|
createDelegatedAction: (data: DelegatedActionsConsentRequestDataType) => Promise<DelegatedActionsConsentResponseDataType>;
|
|
696
620
|
verifyMfa: (data: MfaVerifyRequestDataType) => Promise<MfaVerifyResponseDataType>;
|
|
697
621
|
initEnrollMfa: (data: MfaInitEnrollmentRequestDataType) => Promise<MfaInitEnrollmentResponseDataType>;
|
|
@@ -763,16 +687,29 @@ declare class Embedded1193Provider extends EventEmitter implements EIP1193Provid
|
|
|
763
687
|
rpcTimeoutDuration: number;
|
|
764
688
|
appId: string;
|
|
765
689
|
/** Address of the user's embedded wallet at HD index 0. This is required to make RPC requests to the iframe. */
|
|
766
|
-
|
|
690
|
+
entropyId: string;
|
|
691
|
+
/**
|
|
692
|
+
* Source of the `entropyId` property. This field determines how the entropyId will
|
|
693
|
+
* be used. Possible values include:
|
|
694
|
+
* - ethereum-address-verifier: the entropyId is the address of the Ethereum wallet derived
|
|
695
|
+
* at index 0 for this entropy
|
|
696
|
+
* - solana-address-verifier: the entropyId is a the address of the Solana wallet derived
|
|
697
|
+
* at index 0 for this entropy
|
|
698
|
+
*
|
|
699
|
+
* When this field is a wallet address, we can verify reconstitution was successful by
|
|
700
|
+
* deriving the specified wallet and comparing the address to the `entropyId`
|
|
701
|
+
*/
|
|
702
|
+
entropyIdVerifier: EntropyIdVerifier;
|
|
767
703
|
/**
|
|
768
704
|
* HD index of the embedded wallet that this provider corresponds to, if this is an HD wallet. This is required to make RPC
|
|
769
705
|
* requests to the iframe. If this is an imported wallet, the `walletIndex` is defined as 0 (and is handled as such by the iframe).
|
|
770
706
|
*/
|
|
771
707
|
walletIndex: number;
|
|
772
|
-
constructor({ walletProxy, address,
|
|
708
|
+
constructor({ walletProxy, address, entropyId, entropyIdVerifier, rpcConfig, chains, appId, chainId, walletIndex, }: {
|
|
773
709
|
walletProxy: EmbeddedWalletProxy;
|
|
774
710
|
address: string;
|
|
775
|
-
|
|
711
|
+
entropyId: string;
|
|
712
|
+
entropyIdVerifier: EntropyIdVerifier;
|
|
776
713
|
rpcConfig: RpcConfig;
|
|
777
714
|
chains: Chain[];
|
|
778
715
|
appId: string;
|
|
@@ -1009,6 +946,7 @@ type MfaSubmitArgs = {
|
|
|
1009
946
|
mfaCode: string | PasskeyAuthenticateInputType['authenticator_response'];
|
|
1010
947
|
relyingParty: string;
|
|
1011
948
|
};
|
|
949
|
+
type EntropyIdVerifier = 'ethereum-address-verifier' | 'solana-address-verifier';
|
|
1012
950
|
/**
|
|
1013
951
|
* Supported OAuth providers. Can be `'google'`, `'discord'`, `'twitter'`, `'github'`, `'spotify'`,
|
|
1014
952
|
* `'instagram'`, `'tiktok'`, `'linkedin'`, or `'apple'`
|
|
@@ -1265,6 +1203,8 @@ interface PrivyConnectedWallet {
|
|
|
1265
1203
|
/** Unlink this wallet to the authenticated user. Throws a PrivyClientError if the user is not
|
|
1266
1204
|
* authenticated. */
|
|
1267
1205
|
unlink: () => Promise<void>;
|
|
1206
|
+
/** The HD wallet index */
|
|
1207
|
+
walletIndex?: number;
|
|
1268
1208
|
}
|
|
1269
1209
|
/**
|
|
1270
1210
|
* Object representation of a connected wallet.
|
|
@@ -2458,6 +2398,16 @@ type CreateWalletOptions = {
|
|
|
2458
2398
|
* Defaults to `false`.
|
|
2459
2399
|
*/
|
|
2460
2400
|
createAdditional?: boolean;
|
|
2401
|
+
} | {
|
|
2402
|
+
/**
|
|
2403
|
+
* Specify the hierarchical deterministic (HD) index of the embedded wallet to create.
|
|
2404
|
+
* **A wallet with HD index 0 must be created before creating a wallet at greater HD indices.**
|
|
2405
|
+
* If a value < 0 is passed in, `createWallet` will throw an error.
|
|
2406
|
+
* If a value > 1 is passed in, and the user does not have a primary wallet (HD index == 0),
|
|
2407
|
+
* `createWallet` will throw an error.
|
|
2408
|
+
*
|
|
2409
|
+
*/
|
|
2410
|
+
walletIndex: number;
|
|
2461
2411
|
};
|
|
2462
2412
|
type SetWalletRecoveryOptions = {};
|
|
2463
2413
|
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-BokrcPu3.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-BokrcPu3.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 e}from"@abstract-foundation/agw-client";import{createWalletClient as r,custom as t}from"viem";import{toAccount as a}from"viem/accounts";import{abstractTestnet as n}from"viem/chains";import{j as s,u as i,w as o}from"./privy-context-1qVRD8ny.mjs";import{u as c,M as m,g as l}from"./getEmbeddedConnectedWallet-DzwfpWGG.mjs";import{a3 as d,Q as p}from"./useWallets-C3i7mTy3.mjs";import{c as u}from"./smart-wallets-M6RW4Qv6.mjs";import"ofetch";import"@ethersproject/address";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 f(){let{user:f}=s(),{noPromptOnSignature:g,openPrivyModal:h,chains:y,appId:E,rpcConfig:w}=i(),{wallets:T}=d(),{setModalData:I}=c();return{sendTransaction:async s=>{let i=await(async()=>{let s=l(T);if(!s)throw Error("No connected wallet found");let i=y.find((e=>e.id===n.id));if(!i)throw Error("Chain not configured");await s.switchChain(i.id);let o=await s.getEthereumProvider(),c=r({account:s.address,transport:t(o)}),m=a({address:s.address,signMessage:c.signMessage,signTransaction:c.signTransaction,signTypedData:c.signTypedData});return await e({chain:{...i,rpcUrls:{default:{http:[p(i,w,E)]}}},signer:m})})(),c=[];return c="calls"in s&&void 0!==s.calls?[...s.calls]:[s],new Promise((async(e,r)=>{g.current=!0;let{entropyId:t,entropyIdVerifier:a}=o(f);I({connectWallet:{entropyId:t,entropyIdVerifier:a,onCompleteNavigateTo:m.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:u({calls:c,chain:i.chain,maxPriorityFeePerGas:s.maxPriorityFeePerGas,maxFeePerGas:s.maxFeePerGas,nonce:s.nonce?BigInt(s.nonce):void 0}),entropyId:t,entropyIdVerifier:a,transactingWallet:{address:i.account.address,walletIndex:null},getIsSponsored:async()=>!0,onConfirm:()=>c.length>1?i.sendTransactionBatch(s):i.sendTransaction(s),onSuccess:r=>e(r.hash),onFailure:r,uiOptions:{}}}),h(m.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{g.current=!1}))}}}export{f as useAbstractSmartWallets};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as o,useEffect as n,useContext as e}from"react";const r={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},update:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},sendSolanaTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},fundSolanaWallet:{onUserExited:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},t=o(void 0);let s=()=>e(t);function c(o,e){if(!e)return;let r=s().current[o];return n((()=>{for(let[n,t]of Object.entries(e))r.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${o}"`),r[n]?.push(t);return()=>{for(let[n,t]of Object.entries(e))r.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${o}"`),r[n]=r[n]?.filter((o=>o!==t))}}),[e])}function a(o,n,e,...r){for(let t of o.current[n][e])t(...r)}function u(){let o=s();return(n,e,...r)=>a(o,n,e,...r)}export{t as P,u as a,a as e,r as p,c as u};
|
package/dist/esm/{getEmbeddedConnectedWallet-Qi_uxCqa.mjs → getEmbeddedConnectedWallet-DzwfpWGG.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-C3i7mTy3.mjs";import{n as L}from"./privy-context-1qVRD8ny.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};
|