@privy-io/react-auth 1.56.0 → 1.56.1
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/esm/index.js +495 -488
- package/dist/index.d.ts +30 -3
- package/dist/index.js +495 -488
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -532,7 +532,7 @@ declare abstract class WalletConnector extends EventEmitter<ConnectorEvents> {
|
|
|
532
532
|
* A wallet is considered connected if it is present in the wallets array and is
|
|
533
533
|
* in a connected state.
|
|
534
534
|
*/
|
|
535
|
-
buildConnectedWallet(address: string, chainId: string): BaseConnectedWallet;
|
|
535
|
+
buildConnectedWallet(address: string, chainId: string, meta: ConnectedWalletMetadata): BaseConnectedWallet;
|
|
536
536
|
/**
|
|
537
537
|
* Sync all accounts available via the provider if the wallet is connected.
|
|
538
538
|
*
|
|
@@ -675,6 +675,7 @@ interface GetCurrentUserResponse {
|
|
|
675
675
|
created_at: number;
|
|
676
676
|
linked_accounts: LinkedAccountsResponseType;
|
|
677
677
|
mfa_methods: LinkedMfaMethodsResponseType;
|
|
678
|
+
has_accepted_terms: boolean;
|
|
678
679
|
}
|
|
679
680
|
|
|
680
681
|
interface DefaultsType {
|
|
@@ -760,7 +761,8 @@ declare class ConnectorManager extends EventEmitter<ConnectorManagerEvents> {
|
|
|
760
761
|
private defaultChain;
|
|
761
762
|
private store;
|
|
762
763
|
private walletList;
|
|
763
|
-
|
|
764
|
+
private shouldEnforceDefaultChainOnConnect;
|
|
765
|
+
constructor(walletConnectCloudProjectId: string, rpcConfig: RpcConfig, chains: Chain[], defaultChain: Chain, store: Store, walletList: WalletListEntry[], shouldEnforceDefaultChainOnConnect: boolean);
|
|
764
766
|
/**
|
|
765
767
|
* The core wallets array that is exposed to developers. It builds
|
|
766
768
|
* the wallets away with the following logic:
|
|
@@ -858,7 +860,7 @@ declare class PrivyClient {
|
|
|
858
860
|
* config. We can set this once and only once. If it is set twice, event listeners will be created
|
|
859
861
|
* on the first ConnectorManager and are not re-created.
|
|
860
862
|
*/
|
|
861
|
-
initializeConnectorManager(walletConnectCloudProjectId: string, rpcConfig: RpcConfig, chains: Chain[], defaultChain: Chain, store: Store, walletList: WalletListEntry[]): void;
|
|
863
|
+
initializeConnectorManager(walletConnectCloudProjectId: string, rpcConfig: RpcConfig, chains: Chain[], defaultChain: Chain, store: Store, walletList: WalletListEntry[], shouldEnforceDefaultChainOnConnect: boolean): void;
|
|
862
864
|
generateApi(): Http;
|
|
863
865
|
/**
|
|
864
866
|
* In the case of cookie-based auth, re-initialize the http client with the custom api url.
|
|
@@ -874,6 +876,7 @@ declare class PrivyClient {
|
|
|
874
876
|
startAuthFlow(authFlow: AuthFlow): void;
|
|
875
877
|
startMfaFlow(mfaFlow: MfaFlow): void;
|
|
876
878
|
unlinkEmail(address: string): Promise<User>;
|
|
879
|
+
acceptTerms(): Promise<User>;
|
|
877
880
|
unlinkPhone(phoneNumber: string): Promise<User>;
|
|
878
881
|
unlinkWallet(address: string): Promise<User>;
|
|
879
882
|
unlinkOAuth(provider: OAuthProviderType, subject: string): Promise<User>;
|
|
@@ -981,6 +984,7 @@ type ConnectorType = (typeof SUPPORTED_CONNECTOR_TYPES)[number];
|
|
|
981
984
|
*/
|
|
982
985
|
type WalletBranding = {
|
|
983
986
|
name: string;
|
|
987
|
+
id: string;
|
|
984
988
|
icon?: string | EmbeddedSVG;
|
|
985
989
|
};
|
|
986
990
|
type LinkedAccountType = 'wallet' | 'email' | 'phone' | 'google_oauth' | 'twitter_oauth' | 'discord_oauth' | 'github_oauth' | 'tiktok_oauth' | 'linkedin_oauth' | 'apple_oauth' | 'custom_auth' | 'farcaster';
|
|
@@ -1059,6 +1063,17 @@ interface Wallet {
|
|
|
1059
1063
|
*/
|
|
1060
1064
|
recoveryMethod?: 'privy' | 'user-passcode';
|
|
1061
1065
|
}
|
|
1066
|
+
/**
|
|
1067
|
+
* Object representation of metadata reported by a connected wallet from a wallet connector
|
|
1068
|
+
*/
|
|
1069
|
+
interface ConnectedWalletMetadata {
|
|
1070
|
+
/** The wallet name (e.g. Metamask). */
|
|
1071
|
+
name: string;
|
|
1072
|
+
/** The wallet RDNS, falls back to the wallet name if none is available. */
|
|
1073
|
+
id: string;
|
|
1074
|
+
/** The wallet logo */
|
|
1075
|
+
icon?: string;
|
|
1076
|
+
}
|
|
1062
1077
|
/**
|
|
1063
1078
|
* Object representation of a base connected wallet from a wallet connector.
|
|
1064
1079
|
*/
|
|
@@ -1079,6 +1094,10 @@ interface BaseConnectedWallet {
|
|
|
1079
1094
|
* e.g. injected, wallet_connect, coinbase_wallet, etc.
|
|
1080
1095
|
*/
|
|
1081
1096
|
connectorType: ConnectorType;
|
|
1097
|
+
/**
|
|
1098
|
+
* Metadata for the wallet.
|
|
1099
|
+
*/
|
|
1100
|
+
meta: ConnectedWalletMetadata;
|
|
1082
1101
|
/** Returns true if the wallet is connected, false otherwise */
|
|
1083
1102
|
isConnected: () => Promise<boolean>;
|
|
1084
1103
|
/**
|
|
@@ -1334,6 +1353,11 @@ interface User {
|
|
|
1334
1353
|
linkedAccounts: Array<LinkedAccountWithMetadata>;
|
|
1335
1354
|
/** The list of MFA Methods associated with this user. */
|
|
1336
1355
|
mfaMethods: Array<MfaMethod>;
|
|
1356
|
+
/**
|
|
1357
|
+
* Whether or not the user has explicitly accepted the Terms and Conditions
|
|
1358
|
+
* and/or Privacy Policy
|
|
1359
|
+
*/
|
|
1360
|
+
hasAcceptedTerms: boolean;
|
|
1337
1361
|
}
|
|
1338
1362
|
type PrivyServerConfig = {
|
|
1339
1363
|
id?: string;
|
|
@@ -1354,6 +1378,7 @@ type PrivyServerConfig = {
|
|
|
1354
1378
|
farcasterAuth?: boolean;
|
|
1355
1379
|
termsAndConditionsUrl: string | null;
|
|
1356
1380
|
privacyPolicyUrl: string | null;
|
|
1381
|
+
requireUsersAcceptTerms?: boolean;
|
|
1357
1382
|
createdAt?: Date;
|
|
1358
1383
|
updatedAt?: Date;
|
|
1359
1384
|
customApiUrl?: string | null;
|
|
@@ -1363,6 +1388,8 @@ type PrivyServerConfig = {
|
|
|
1363
1388
|
captchaEnabled?: boolean;
|
|
1364
1389
|
captchaSiteKey: string;
|
|
1365
1390
|
twitterOAuthOnMobileEnabled?: boolean;
|
|
1391
|
+
enforceWalletUis?: boolean;
|
|
1392
|
+
legacyWalletUiConfig?: boolean;
|
|
1366
1393
|
/** May be deprecated from the server config in a future release */
|
|
1367
1394
|
logoUrl?: string;
|
|
1368
1395
|
/** May be deprecated from the server config in a future release */
|