@privy-io/react-auth 1.32.1 → 1.32.2-beta.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 +112 -112
- package/dist/index.d.ts +57 -1
- package/dist/index.js +111 -111
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -478,6 +478,16 @@ interface BaseConnectedWallet {
|
|
|
478
478
|
connectorType: ConnectorType;
|
|
479
479
|
/** Returns true if the wallet is connected, false otherwise */
|
|
480
480
|
isConnected: () => Promise<boolean>;
|
|
481
|
+
/**
|
|
482
|
+
* Switch the network chain to a specified ID.
|
|
483
|
+
* Note: The chainId must be a supported network: https://docs.privy.io/guide/frontend/embedded/networks
|
|
484
|
+
* Note: This will not update any existing provider instances, re-request `wallet.getEthersProvider` (e.g.)
|
|
485
|
+
* to get a provider with the updated chainId.
|
|
486
|
+
*
|
|
487
|
+
* @param targetChainId The specified chain ID to switch to, as a number or 0x prefixed string.
|
|
488
|
+
* @returns void
|
|
489
|
+
*/
|
|
490
|
+
switchChain: (targetChainId: `0x${string}` | number) => Promise<void>;
|
|
481
491
|
/** Helper methods to build providers for interfacing with this wallet. */
|
|
482
492
|
getEthereumProvider: () => Promise<EIP1193Provider>;
|
|
483
493
|
getEthersProvider: () => Promise<Web3Provider>;
|
|
@@ -1557,4 +1567,50 @@ declare function useConnectWallet(callbacks?: PrivyEvents['connectWallet']): {
|
|
|
1557
1567
|
connectWallet: () => void;
|
|
1558
1568
|
};
|
|
1559
1569
|
|
|
1560
|
-
|
|
1570
|
+
/**
|
|
1571
|
+
* These types are fully compatible with WAGMI chain types, in case
|
|
1572
|
+
* we need interop in the future.
|
|
1573
|
+
*/
|
|
1574
|
+
type RpcUrls = {
|
|
1575
|
+
http: readonly string[];
|
|
1576
|
+
webSocket?: readonly string[];
|
|
1577
|
+
};
|
|
1578
|
+
type NativeCurrency = {
|
|
1579
|
+
name: string;
|
|
1580
|
+
/** 2-6 characters long */
|
|
1581
|
+
symbol: string;
|
|
1582
|
+
decimals: number;
|
|
1583
|
+
};
|
|
1584
|
+
type BlockExplorer = {
|
|
1585
|
+
name: string;
|
|
1586
|
+
url: string;
|
|
1587
|
+
};
|
|
1588
|
+
/** A subset of WAGMI's chain type
|
|
1589
|
+
* https://github.com/wagmi-dev/references/blob/6aea7ee9c65cfac24f33173ab3c98176b8366f05/packages/chains/src/types.ts#L8
|
|
1590
|
+
*/
|
|
1591
|
+
type Chain = {
|
|
1592
|
+
/** Id in number form */
|
|
1593
|
+
id: number;
|
|
1594
|
+
/** Human readable name */
|
|
1595
|
+
name: string;
|
|
1596
|
+
/** Internal network name */
|
|
1597
|
+
network: string;
|
|
1598
|
+
/** Currency used by chain */
|
|
1599
|
+
nativeCurrency: NativeCurrency;
|
|
1600
|
+
/** Collection of block explorers */
|
|
1601
|
+
blockExplorers?: {
|
|
1602
|
+
[key: string]: BlockExplorer;
|
|
1603
|
+
default: BlockExplorer;
|
|
1604
|
+
};
|
|
1605
|
+
/** Collection of RPC endpoints */
|
|
1606
|
+
rpcUrls: {
|
|
1607
|
+
[key: string]: RpcUrls;
|
|
1608
|
+
default: RpcUrls;
|
|
1609
|
+
public: RpcUrls;
|
|
1610
|
+
};
|
|
1611
|
+
/** Flag for test networks */
|
|
1612
|
+
testnet?: boolean;
|
|
1613
|
+
};
|
|
1614
|
+
declare const SUPPORTED_CHAINS: readonly [Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain];
|
|
1615
|
+
|
|
1616
|
+
export { Apple, AppleOAuthWithMetadata, AsExternalProvider, ConnectedWallet, ConnectorManager, ContractUIOptions, Discord, DiscordOAuthWithMetadata, EIP1193Provider, Email, EmailWithMetadata, Github, GithubOAuthWithMetadata, Google, GoogleOAuthWithMetadata, Phone, PhoneWithMetadata, PrivyClient, PrivyClientConfig, PrivyInterface, PrivyProvider, PrivyProviderProps, PrivyProxyProvider, Quantity, SUPPORTED_CHAINS, SendTransactionModalUIOptions, SignMessageModalUIOptions, TransactionLog, TransactionReceipt, TransactionUIOptions, Twitter, TwitterOAuthWithMetadata, UnsignedTransactionRequest, UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletWithMetadata, getAccessToken, useConnectWallet, useLogin, useLogout, usePrivy, useWallets };
|