@privy-io/react-auth 1.34.1-beta.9 → 1.34.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/index.d.ts CHANGED
@@ -150,6 +150,65 @@ interface EmbeddedWalletProxy {
150
150
  rpc: (data: WalletRpcRequestDataType) => Promise<WalletRpcResponseDataType>;
151
151
  }
152
152
 
153
+ /**
154
+ * These types are fully compatible with WAGMI chain types, in case
155
+ * we need interop in the future.
156
+ */
157
+ type RpcUrls = {
158
+ http: readonly string[];
159
+ webSocket?: readonly string[];
160
+ };
161
+ type NativeCurrency = {
162
+ name: string;
163
+ /** 2-6 characters long */
164
+ symbol: string;
165
+ decimals: number;
166
+ };
167
+ type BlockExplorer = {
168
+ name: string;
169
+ url: string;
170
+ };
171
+ /** A subset of WAGMI's chain type
172
+ * https://github.com/wagmi-dev/references/blob/6aea7ee9c65cfac24f33173ab3c98176b8366f05/packages/chains/src/types.ts#L8
173
+ */
174
+ type Chain = {
175
+ /** Id in number form */
176
+ id: number;
177
+ /** Human readable name */
178
+ name: string;
179
+ /** Internal network name */
180
+ network: string;
181
+ /** Currency used by chain */
182
+ nativeCurrency: NativeCurrency;
183
+ /** Collection of block explorers */
184
+ blockExplorers?: {
185
+ [key: string]: BlockExplorer;
186
+ default: BlockExplorer;
187
+ };
188
+ /** Collection of RPC endpoints */
189
+ rpcUrls: {
190
+ [key: string]: RpcUrls;
191
+ default: RpcUrls;
192
+ public: RpcUrls;
193
+ };
194
+ /** Flag for test networks */
195
+ testnet?: boolean;
196
+ };
197
+ /**
198
+ * RPC overrides to support custom RPC URLs.
199
+ */
200
+ type RpcConfig = {
201
+ /**
202
+ * Mapping of chainId to RPC URL. Overrides Privy default RPC URLs that are shared across projects. Set your own RPC URLs
203
+ * to avoid rate limits or other throughput bottlenecks.
204
+ */
205
+ rpcUrls: {
206
+ [key: number]: string;
207
+ };
208
+ };
209
+
210
+ declare const SUPPORTED_CHAINS: readonly [Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain];
211
+
153
212
  declare abstract class PrivyError extends Error {
154
213
  /**
155
214
  * Privy error type.
@@ -250,7 +309,8 @@ declare class Embedded1193Provider extends EventEmitter implements EIP1193Provid
250
309
  address: string;
251
310
  provider: JsonRpcProvider;
252
311
  chainId: number;
253
- constructor(walletProxy: EmbeddedWalletProxy, address: string, chainId?: number);
312
+ rpcConfig: RpcConfig;
313
+ constructor(walletProxy: EmbeddedWalletProxy, address: string, rpcConfig: RpcConfig, chainId?: number);
254
314
  handleSendTransaction(args: RequestArguments): Promise<string>;
255
315
  private handleSwitchEthereumChain;
256
316
  private handlePersonalSign;
@@ -719,6 +779,12 @@ type PrivyClientConfig = {
719
779
  privacyPolicyUrl?: string | null;
720
780
  };
721
781
  walletConnectCloudProjectId?: string;
782
+ /**
783
+ * RPC overrides to support custom RPC URLs.
784
+ *
785
+ * @experimental
786
+ */
787
+ rpcConfig?: RpcConfig;
722
788
  captchaEnabled?: boolean;
723
789
  /** All embedded wallets configuration */
724
790
  embeddedWallets?: {
@@ -972,7 +1038,8 @@ declare class ConnectorManager extends EventEmitter<ConnectorManagerEvents> {
972
1038
  private storedConnections;
973
1039
  private activeWallet?;
974
1040
  private walletConnectCloudProjectId;
975
- constructor(walletConnectCloudProjectId: string);
1041
+ private rpcConfig;
1042
+ constructor(walletConnectCloudProjectId: string, rpcConfig: RpcConfig);
976
1043
  /**
977
1044
  * The core wallets array that is exposed to developers. It builds
978
1045
  * the wallets away with the following logic:
@@ -1489,7 +1556,7 @@ declare class PrivyClient {
1489
1556
  * config. We can set this once and only once. If it is set twice, event listeners will be created
1490
1557
  * on the first ConnectorManager and are not re-created.
1491
1558
  */
1492
- initializeConnectorManager(walletConnectCloudProjectId: string): void;
1559
+ initializeConnectorManager(walletConnectCloudProjectId: string, rpcConfig: RpcConfig): void;
1493
1560
  generateApi(): Http;
1494
1561
  /**
1495
1562
  * In the case of cookie-based auth, re-initialize the http client with the custom api url.
@@ -1645,51 +1712,4 @@ declare function useConnectWallet(callbacks?: PrivyEvents['connectWallet']): {
1645
1712
  connectWallet: () => void;
1646
1713
  };
1647
1714
 
1648
- /**
1649
- * These types are fully compatible with WAGMI chain types, in case
1650
- * we need interop in the future.
1651
- */
1652
- type RpcUrls = {
1653
- http: readonly string[];
1654
- webSocket?: readonly string[];
1655
- };
1656
- type NativeCurrency = {
1657
- name: string;
1658
- /** 2-6 characters long */
1659
- symbol: string;
1660
- decimals: number;
1661
- };
1662
- type BlockExplorer = {
1663
- name: string;
1664
- url: string;
1665
- };
1666
- /** A subset of WAGMI's chain type
1667
- * https://github.com/wagmi-dev/references/blob/6aea7ee9c65cfac24f33173ab3c98176b8366f05/packages/chains/src/types.ts#L8
1668
- */
1669
- type Chain = {
1670
- /** Id in number form */
1671
- id: number;
1672
- /** Human readable name */
1673
- name: string;
1674
- /** Internal network name */
1675
- network: string;
1676
- /** Currency used by chain */
1677
- nativeCurrency: NativeCurrency;
1678
- /** Collection of block explorers */
1679
- blockExplorers?: {
1680
- [key: string]: BlockExplorer;
1681
- default: BlockExplorer;
1682
- };
1683
- /** Collection of RPC endpoints */
1684
- rpcUrls: {
1685
- [key: string]: RpcUrls;
1686
- default: RpcUrls;
1687
- public: RpcUrls;
1688
- };
1689
- /** Flag for test networks */
1690
- testnet?: boolean;
1691
- };
1692
-
1693
- declare const SUPPORTED_CHAINS: readonly [Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain, Chain];
1694
-
1695
1715
  export { Apple, AppleOAuthWithMetadata, AsExternalProvider, CallbackError, ConnectedWallet, ConnectorManager, ContractUIOptions, Discord, DiscordOAuthWithMetadata, EIP1193Provider, Email, EmailWithMetadata, Github, GithubOAuthWithMetadata, Google, GoogleOAuthWithMetadata, Phone, PhoneWithMetadata, PrivyClient, PrivyClientConfig, PrivyEvents, 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 };