@privy-io/react-auth 1.38.0-beta.1 → 1.38.0-beta.2

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/index.d.ts CHANGED
@@ -245,6 +245,7 @@ declare abstract class PrivyError extends Error {
245
245
  declare enum PrivyErrorCode {
246
246
  MISSING_OR_INVALID_PRIVY_APP_ID = "missing_or_invalid_privy_app_id",
247
247
  MISSING_OR_INVALID_PRIVY_ACCOUNT_ID = "missing_or_invalid_privy_account_id",
248
+ MISSING_OR_INVALID_TOKEN = "missing_or_invalid_token",
248
249
  INVALID_DATA = "invalid_data",
249
250
  LINKED_TO_ANOTHER_USER = "linked_to_another_user",
250
251
  ALLOWLIST_REJECTED = "allowlist_rejected",
@@ -297,8 +298,9 @@ interface EIP1193Provider {
297
298
  removeListener: (eventName: string | symbol, listener: (...args: any[]) => void) => any;
298
299
  }
299
300
  /**
300
- * The PrivyProxyProvider adds a middleware layer on top of the underlying wallet provider.
301
301
  * @hidden
302
+ *
303
+ * The PrivyProxyProvider adds a middleware layer on top of the underlying wallet provider.
302
304
  * */
303
305
  declare class PrivyProxyProvider implements EIP1193Provider {
304
306
  walletProvider?: EIP1193Provider;
@@ -332,8 +334,9 @@ declare class Embedded1193Provider extends EventEmitter implements EIP1193Provid
332
334
  connect(): Promise<string | null>;
333
335
  }
334
336
  /**
335
- * Shim to convert to ethers-compatible ExternalProvider class.
336
337
  * @hidden
338
+ *
339
+ * Shim to convert to ethers-compatible ExternalProvider class.
337
340
  */
338
341
  declare class AsExternalProvider extends PrivyProxyProvider implements ExternalProvider {
339
342
  constructor(provider: EIP1193Provider);
@@ -576,7 +579,6 @@ interface AuthFlow {
576
579
  interface ConnectorManagerEvents {
577
580
  walletsUpdated(): void;
578
581
  }
579
- /** @hidden */
580
582
  declare class ConnectorManager extends EventEmitter<ConnectorManagerEvents> {
581
583
  walletConnectors: WalletConnector[];
582
584
  initialized: boolean;
@@ -595,46 +597,15 @@ declare class ConnectorManager extends EventEmitter<ConnectorManagerEvents> {
595
597
  * 3. Active wallet is moved to front of array (if it exists)
596
598
  */
597
599
  get wallets(): BaseConnectedWallet[];
598
- /**
599
- * Detect and add all valid wallet connectors.
600
- */
601
- initialize(): void;
602
600
  /**
603
601
  * Helper function to find a wallet connector by connector type and wallet client type.
604
602
  */
605
603
  findWalletConnector(connectorType: ConnectorType, walletClientType: WalletClientType): WalletConnector | null;
606
- /**
607
- * Add any connectedAt overrides for newly initialized wallets and pass-through change events.
608
- */
609
- private onInitialized;
610
- /**
611
- * Save connection history and pass-through change events.
612
- */
613
- private onWalletsUpdated;
614
- addEmbeddedWalletConnector(walletProxy: EmbeddedWalletProxy, address: string): void;
615
- /**
616
- * Normally, we do not remove connectors after creation. Privy embedded wallets are an exception
617
- * because they are closely tied with an authenticated state.
618
- */
619
- removeEmbeddedWalletConnector(): void;
620
604
  /**
621
605
  * Creates a new wallet connector for the given connector type and wallet client type.
622
606
  * If a connector already exists, it will be returned instead.
623
607
  */
624
608
  createWalletConnector(connectorType: ConnectorType, walletClientType: WalletClientType): Promise<WalletConnector | null>;
625
- private addWalletConnector;
626
- /**
627
- * Upon initialization, loads previous connections from local storage. If local storage
628
- * is misformatted (e.g. due to previous privy:connectors usage), it returns an empty array that
629
- * will be overwritten later.
630
- *
631
- * @returns StoredConnection[] list of stored connections from previous session
632
- */
633
- private loadConnectionHistory;
634
- /**
635
- * Saves all current connections to local storage overridding any previous connections.
636
- */
637
- private saveConnectionHistory;
638
609
  /**
639
610
  * @deprecated **Deprecated**: This feature will be removed and should be replaced by
640
611
  * interfacing with wallets directly (wallets[0].getEthereumProvider()).
@@ -795,35 +766,9 @@ type MoonpaySignResponse = {
795
766
 
796
767
  declare const SUPPORTED_OAUTH_PROVIDERS: readonly ["google", "discord", "twitter", "github", "apple"];
797
768
  type OAuthProviderType = (typeof SUPPORTED_OAUTH_PROVIDERS)[number];
798
- /** @hidden */
799
769
  type EmbeddedWalletClientType = 'privy';
800
- /** @hidden */
801
770
  type InjectedWalletClientType = 'metamask' | 'phantom';
802
- /** @hidden */
803
771
  type CoinbaseWalletClientType = 'coinbase_wallet';
804
- /** @hidden
805
- *
806
- * How this works:
807
- *
808
- * The raw data is pulled from https://registry.walletconnect.com/api/v3/wallets
809
- * Some post-processing is done using the following script.
810
- *
811
- * const axios = require('axios');
812
- * const walletTypes = [];
813
- * axios.get("https://explorer-api.walletconnect.com/v3/wallets?projectId=2f05ae7f1116030fde2d36508f472bfb&entries=400&page=1&version=2&chains=eip155%3A1").then((apiResult) => {
814
- * Object.values(apiResult.data.listings).forEach((walletEntry) => {
815
- * if (!walletEntry.mobile.native || !walletEntry.mobile.universal) return;
816
- * if (!walletEntry.chains.includes('eip155:1')) return;
817
- * if (!walletEntry.metadata.shortName) return;
818
- * // Manually removed for cleanliness
819
- * if (walletEntry.id === 'b2ce31fb31735fa886270806340de999f72342a7c29484badd8d4d013d77c8b8') return;
820
- * if (walletEntry.id) walletTypes.push(`'${walletEntry.id}'`);
821
- * });
822
- * console.log(walletTypes.join("\n | "));
823
- * });
824
- */
825
- type WalletConnectWalletClientType = 'metamask' | 'trust' | 'safe' | 'rainbow' | 'uniswap' | 'zerion' | 'argent' | 'spot' | 'omni' | 'cryptocom' | 'blockchain' | 'safepal' | 'bitkeep' | 'zengo' | '1inch' | 'binance' | 'exodus' | 'mew_wallet' | 'alphawallet' | 'keyring_pro' | 'mathwallet' | 'unstoppable' | 'obvious' | 'ambire' | 'internet_money_wallet' | 'coin98' | 'abc_wallet' | 'arculus_wallet' | 'haha' | 'cling_wallet' | 'broearn' | 'copiosa' | 'burrito_wallet' | 'enjin_wallet' | 'plasma_wallet' | 'avacus' | 'bee' | 'pitaka' | 'pltwallet' | 'minerva' | 'kryptogo' | 'prema' | 'slingshot' | 'kriptonio' | 'timeless' | 'secux' | 'bitizen' | 'blocto' | 'safemoon';
826
- /** @hidden */
827
772
  type UnknownWalletClientType = 'unknown';
828
773
  type WalletClientType = InjectedWalletClientType | CoinbaseWalletClientType | WalletConnectWalletClientType | EmbeddedWalletClientType | UnknownWalletClientType;
829
774
  declare const SUPPORTED_CONNECTOR_TYPES: string[];
@@ -1287,28 +1232,6 @@ type PrivyClientConfig = {
1287
1232
  */
1288
1233
  useSandbox?: boolean;
1289
1234
  };
1290
- /**
1291
- * Override the default rendering settings, used for displaying in a non-modal setting.
1292
- * For internal use only.
1293
- * @hidden
1294
- */
1295
- _render?: {
1296
- /**
1297
- * If true, the modal renders with a dialog, which centers the modal, blocks scrolling on the body, adds a backdrop,
1298
- * and adds a close button in the top right corner.
1299
- * If false, the modal renders wherever the portal is set to (defaults to the bottom of document.body), without the above features.
1300
- *
1301
- * Defaults to true.
1302
- */
1303
- inDialog?: boolean;
1304
- /**
1305
- * The id of the node to render the modal in, using a React portal.
1306
- * If the element with id specified does not exist, or is set to null, renders to document.body.
1307
- *
1308
- * Defaults to null.
1309
- */
1310
- inParentNodeId?: string | null;
1311
- };
1312
1235
  };
1313
1236
  interface AllowlistConfig {
1314
1237
  errorTitle: string | null;
@@ -1465,12 +1388,6 @@ interface PrivyProviderProps {
1465
1388
  * Values here will override their server-configuration counterparts.
1466
1389
  */
1467
1390
  config?: PrivyClientConfig;
1468
- /**
1469
- * Override the URL of the Privy API, which is 'https://auth.privy.io' by default.
1470
- * For development and testing use only.
1471
- * @hidden
1472
- */
1473
- apiUrl?: string;
1474
1391
  /**
1475
1392
  * @ignore
1476
1393
  * @class