@privy-io/react-auth 1.77.0 → 1.78.0-beta-20240808045322

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
@@ -13,132 +13,6 @@ import * as _simplewebauthn_types from '@simplewebauthn/types';
13
13
  import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types';
14
14
  import { FetchOptions } from 'ofetch';
15
15
 
16
- /**
17
- * We support a subset of the provider methods found here:
18
- *
19
- * https://ethereum.org/en/developers/docs/apis/json-rpc/#json-rpc-methods
20
- *
21
- * For now, we're focused on signing-related methods because the iframe (this code)
22
- * is the only place that has access to the private key and thus is the only one
23
- * who can create signatures. All other methods do not need the private key and
24
- * can therefore be implemented by clients of the iframe.
25
- */
26
-
27
- declare const SUPPORTED_ETHEREUM_RPC_METHODS: readonly ["eth_sign", "eth_populateTransactionRequest", "eth_signTransaction", "personal_sign", "eth_signTypedData_v4"];
28
- type EthereumRpcMethodType = (typeof SUPPORTED_ETHEREUM_RPC_METHODS)[number];
29
- declare const SUPPORTED_SOLANA_RPC_METHODS: string[];
30
- type SolanaRpcMethodType = (typeof SUPPORTED_SOLANA_RPC_METHODS)[number];
31
- type Quantity = string | number | bigint;
32
- type UnsignedTransactionRequest = {
33
- from?: string;
34
- to?: string;
35
- nonce?: Quantity;
36
- gasLimit?: Quantity;
37
- gasPrice?: Quantity;
38
- data?: ArrayLike<number> | string;
39
- value?: Quantity;
40
- chainId?: number;
41
- type?: number;
42
- accessList?: Array<{
43
- address: string;
44
- storageKeys: Array<string>;
45
- }> | Array<[string, Array<string>]> | Record<string, Array<string>>;
46
- maxPriorityFeePerGas?: Quantity;
47
- maxFeePerGas?: Quantity;
48
- };
49
- type TransactionLog = {
50
- blockNumber: number;
51
- blockHash: string;
52
- transactionIndex: number;
53
- removed: boolean;
54
- address: string;
55
- data: string;
56
- topics: Array<string>;
57
- transactionHash: string;
58
- logIndex: number;
59
- };
60
- type TransactionReceipt = {
61
- to: string;
62
- from: string;
63
- contractAddress: string;
64
- transactionIndex: number;
65
- root?: string;
66
- logs: Array<TransactionLog>;
67
- logsBloom: string;
68
- blockHash: string;
69
- transactionHash: string;
70
- blockNumber: number;
71
- confirmations: number;
72
- byzantium: boolean;
73
- type: number;
74
- status?: number;
75
- gasUsed: string;
76
- cumulativeGasUsed: string;
77
- effectiveGasPrice?: string;
78
- };
79
- interface BaseEthereumRpcRequestType {
80
- method: EthereumRpcMethodType;
81
- }
82
- interface BaseSolanaRpcRequestType {
83
- method: SolanaRpcMethodType;
84
- }
85
- interface eth_populateTransactionRequest extends BaseEthereumRpcRequestType {
86
- method: 'eth_populateTransactionRequest';
87
- params: [UnsignedTransactionRequest];
88
- }
89
- interface eth_populateTransactionRequestResponse {
90
- method: 'eth_populateTransactionRequest';
91
- data: UnsignedTransactionRequest;
92
- }
93
- interface eth_signTransaction extends BaseEthereumRpcRequestType {
94
- method: 'eth_signTransaction';
95
- params: [UnsignedTransactionRequest];
96
- }
97
- interface eth_sign extends BaseEthereumRpcRequestType {
98
- method: 'eth_sign';
99
- params: [address: string, message: string];
100
- }
101
- interface eth_signResponse {
102
- method: 'eth_sign';
103
- data: string;
104
- }
105
- interface personal_sign extends BaseEthereumRpcRequestType {
106
- method: 'personal_sign';
107
- params: [string, string];
108
- }
109
- interface personal_signResponse {
110
- method: 'personal_sign';
111
- data: string;
112
- }
113
- interface eth_signTransactionResponse {
114
- method: 'eth_signTransaction';
115
- data: string;
116
- }
117
- interface eth_signTypedData_v4 extends BaseEthereumRpcRequestType {
118
- method: 'eth_signTypedData_v4';
119
- params: [string, TypedMessage$1<MessageTypes$1> | string];
120
- }
121
- interface eth_signTypedData_v4Response {
122
- method: 'eth_signTypedData_v4';
123
- data: string;
124
- }
125
- interface solana_signMessage extends BaseSolanaRpcRequestType {
126
- method: 'signMessage';
127
- params: {
128
- message: string;
129
- };
130
- }
131
- interface solana_signMessageResponse {
132
- method: 'signMessage';
133
- data: {
134
- signature: string;
135
- };
136
- }
137
- type EthereumRpcRequestType = eth_signTransaction | eth_populateTransactionRequest | eth_sign | personal_sign | eth_signTypedData_v4;
138
- type EthereumRpcResponseType = eth_signTransactionResponse | eth_populateTransactionRequestResponse | eth_signResponse | personal_signResponse | eth_signTypedData_v4Response;
139
- type SolanaRpcRequestType = solana_signMessage;
140
- type SolanaRpcResponseType = solana_signMessageResponse;
141
-
142
16
  /**
143
17
  * These types are fully compatible with WAGMI chain types, in case
144
18
  * we need interop in the future.
@@ -1348,8 +1222,6 @@ interface Wallet {
1348
1222
  /** The wallet address. */
1349
1223
  address: string;
1350
1224
  /**
1351
- * @deprecated Use `chainId` instead.
1352
- *
1353
1225
  * Chain type of the wallet address.
1354
1226
  */
1355
1227
  chainType: 'ethereum' | 'solana';
@@ -1846,7 +1718,6 @@ type OAuthTokens = {
1846
1718
  type TelegramAuthConfiguration = {
1847
1719
  botId: string;
1848
1720
  botName: string;
1849
- linkEnabled: boolean;
1850
1721
  seamlessAuthEnabled: boolean;
1851
1722
  };
1852
1723
  type FundingMethod = 'moonpay' | 'coinbase-onramp' | 'external';
@@ -2495,6 +2366,132 @@ type RuntimeLoginOverridableOptions = {
2495
2366
  };
2496
2367
  type SetWalletRecoveryOptions = {};
2497
2368
 
2369
+ /**
2370
+ * We support a subset of the provider methods found here:
2371
+ *
2372
+ * https://ethereum.org/en/developers/docs/apis/json-rpc/#json-rpc-methods
2373
+ *
2374
+ * For now, we're focused on signing-related methods because the iframe (this code)
2375
+ * is the only place that has access to the private key and thus is the only one
2376
+ * who can create signatures. All other methods do not need the private key and
2377
+ * can therefore be implemented by clients of the iframe.
2378
+ */
2379
+
2380
+ declare const SUPPORTED_ETHEREUM_RPC_METHODS: readonly ["eth_sign", "eth_populateTransactionRequest", "eth_signTransaction", "personal_sign", "eth_signTypedData_v4"];
2381
+ type EthereumRpcMethodType = (typeof SUPPORTED_ETHEREUM_RPC_METHODS)[number];
2382
+ declare const SUPPORTED_SOLANA_RPC_METHODS: string[];
2383
+ type SolanaRpcMethodType = (typeof SUPPORTED_SOLANA_RPC_METHODS)[number];
2384
+ type Quantity = string | number | bigint;
2385
+ type UnsignedTransactionRequest = {
2386
+ from?: string;
2387
+ to?: string;
2388
+ nonce?: Quantity;
2389
+ gasLimit?: Quantity;
2390
+ gasPrice?: Quantity;
2391
+ data?: ArrayLike<number> | string;
2392
+ value?: Quantity;
2393
+ chainId?: number;
2394
+ type?: number;
2395
+ accessList?: Array<{
2396
+ address: string;
2397
+ storageKeys: Array<string>;
2398
+ }> | Array<[string, Array<string>]> | Record<string, Array<string>>;
2399
+ maxPriorityFeePerGas?: Quantity;
2400
+ maxFeePerGas?: Quantity;
2401
+ };
2402
+ type TransactionLog = {
2403
+ blockNumber: number;
2404
+ blockHash: string;
2405
+ transactionIndex: number;
2406
+ removed: boolean;
2407
+ address: string;
2408
+ data: string;
2409
+ topics: Array<string>;
2410
+ transactionHash: string;
2411
+ logIndex: number;
2412
+ };
2413
+ type TransactionReceipt = {
2414
+ to: string;
2415
+ from: string;
2416
+ contractAddress: string;
2417
+ transactionIndex: number;
2418
+ root?: string;
2419
+ logs: Array<TransactionLog>;
2420
+ logsBloom: string;
2421
+ blockHash: string;
2422
+ transactionHash: string;
2423
+ blockNumber: number;
2424
+ confirmations: number;
2425
+ byzantium: boolean;
2426
+ type: number;
2427
+ status?: number;
2428
+ gasUsed: string;
2429
+ cumulativeGasUsed: string;
2430
+ effectiveGasPrice?: string;
2431
+ };
2432
+ interface BaseEthereumRpcRequestType {
2433
+ method: EthereumRpcMethodType;
2434
+ }
2435
+ interface BaseSolanaRpcRequestType {
2436
+ method: SolanaRpcMethodType;
2437
+ }
2438
+ interface eth_populateTransactionRequest extends BaseEthereumRpcRequestType {
2439
+ method: 'eth_populateTransactionRequest';
2440
+ params: [UnsignedTransactionRequest];
2441
+ }
2442
+ interface eth_populateTransactionRequestResponse {
2443
+ method: 'eth_populateTransactionRequest';
2444
+ data: UnsignedTransactionRequest;
2445
+ }
2446
+ interface eth_signTransaction extends BaseEthereumRpcRequestType {
2447
+ method: 'eth_signTransaction';
2448
+ params: [UnsignedTransactionRequest];
2449
+ }
2450
+ interface eth_sign extends BaseEthereumRpcRequestType {
2451
+ method: 'eth_sign';
2452
+ params: [address: string, message: string];
2453
+ }
2454
+ interface eth_signResponse {
2455
+ method: 'eth_sign';
2456
+ data: string;
2457
+ }
2458
+ interface personal_sign extends BaseEthereumRpcRequestType {
2459
+ method: 'personal_sign';
2460
+ params: [string, string];
2461
+ }
2462
+ interface personal_signResponse {
2463
+ method: 'personal_sign';
2464
+ data: string;
2465
+ }
2466
+ interface eth_signTransactionResponse {
2467
+ method: 'eth_signTransaction';
2468
+ data: string;
2469
+ }
2470
+ interface eth_signTypedData_v4 extends BaseEthereumRpcRequestType {
2471
+ method: 'eth_signTypedData_v4';
2472
+ params: [string, TypedMessage$1<MessageTypes$1> | string];
2473
+ }
2474
+ interface eth_signTypedData_v4Response {
2475
+ method: 'eth_signTypedData_v4';
2476
+ data: string;
2477
+ }
2478
+ interface solana_signMessage extends BaseSolanaRpcRequestType {
2479
+ method: 'signMessage';
2480
+ params: {
2481
+ message: string;
2482
+ };
2483
+ }
2484
+ interface solana_signMessageResponse {
2485
+ method: 'signMessage';
2486
+ data: {
2487
+ signature: string;
2488
+ };
2489
+ }
2490
+ type EthereumRpcRequestType = eth_signTransaction | eth_populateTransactionRequest | eth_sign | personal_sign | eth_signTypedData_v4;
2491
+ type EthereumRpcResponseType = eth_signTransactionResponse | eth_populateTransactionRequestResponse | eth_signResponse | personal_signResponse | eth_signTypedData_v4Response;
2492
+ type SolanaRpcRequestType = solana_signMessage;
2493
+ type SolanaRpcResponseType = solana_signMessageResponse;
2494
+
2498
2495
  declare function getAccessToken(): Promise<string | null>;
2499
2496
  /**
2500
2497
  * Properties to initialize the {@link PrivyProvider}.