@wagmi/connectors 1.0.0-next.4 → 1.0.0-next.6

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.
@@ -1 +1,833 @@
1
- export * from '../src/injected'
1
+ import * as abitype_dist_abi_7aa1f183 from 'abitype/dist/abi-7aa1f183';
2
+ import * as viem_dist_types_types_eip1193 from 'viem/dist/types/types/eip1193';
3
+ import * as viem_dist_types_types from 'viem/dist/types/types';
4
+ import * as viem from 'viem';
5
+ import { Chain } from '@wagmi/chains';
6
+ import { Address } from 'abitype';
7
+ import { W as WindowProvider, C as Connector } from './base-a11da01a.js';
8
+ import 'eventemitter3';
9
+
10
+ type InjectedConnectorOptions = {
11
+ /** Name of connector */
12
+ name?: string | ((detectedName: string | string[]) => string);
13
+ /**
14
+ * [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193) Ethereum Provider to target
15
+ *
16
+ * @default
17
+ * () => typeof window !== 'undefined' ? window.ethereum : undefined
18
+ */
19
+ getProvider?: () => WindowProvider | undefined;
20
+ /**
21
+ * MetaMask and other injected providers do not support programmatic disconnect.
22
+ * This flag simulates the disconnect behavior by keeping track of connection status in storage. See [GitHub issue](https://github.com/MetaMask/metamask-extension/issues/10353) for more info.
23
+ * @default true
24
+ */
25
+ shimDisconnect?: boolean;
26
+ };
27
+ type ConnectorOptions = InjectedConnectorOptions & Required<Pick<InjectedConnectorOptions, 'getProvider'>>;
28
+ declare class InjectedConnector extends Connector<WindowProvider | undefined, ConnectorOptions> {
29
+ #private;
30
+ readonly id: string;
31
+ readonly name: string;
32
+ readonly ready: boolean;
33
+ protected shimDisconnectKey: string;
34
+ constructor({ chains, options: options_, }?: {
35
+ chains?: Chain[];
36
+ options?: InjectedConnectorOptions;
37
+ });
38
+ connect({ chainId }?: {
39
+ chainId?: number;
40
+ }): Promise<{
41
+ account: `0x${string}`;
42
+ chain: {
43
+ id: number;
44
+ unsupported: boolean;
45
+ };
46
+ }>;
47
+ disconnect(): Promise<void>;
48
+ getAccount(): Promise<`0x${string}`>;
49
+ getChainId(): Promise<number>;
50
+ getProvider(): Promise<WindowProvider | undefined>;
51
+ getWalletClient({ chainId }?: {
52
+ chainId?: number;
53
+ }): Promise<{
54
+ chain: Chain;
55
+ key: string;
56
+ name: string;
57
+ pollingInterval: number;
58
+ request: {
59
+ (args: {
60
+ method: "web3_clientVersion";
61
+ params?: undefined;
62
+ }): Promise<string>;
63
+ (args: {
64
+ method: "web3_sha3";
65
+ params: [data: `0x${string}`];
66
+ }): Promise<string>;
67
+ (args: {
68
+ method: "net_listening";
69
+ params?: undefined;
70
+ }): Promise<boolean>;
71
+ (args: {
72
+ method: "net_peerCount";
73
+ params?: undefined;
74
+ }): Promise<`0x${string}`>;
75
+ (args: {
76
+ method: "net_version";
77
+ params?: undefined;
78
+ }): Promise<`0x${string}`>;
79
+ (args: {
80
+ method: "eth_blockNumber";
81
+ params?: undefined;
82
+ }): Promise<`0x${string}`>;
83
+ (args: {
84
+ method: "eth_call";
85
+ params: [request: Partial<viem.RpcTransactionRequest>, block?: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier | undefined];
86
+ }): Promise<`0x${string}`>;
87
+ (args: {
88
+ method: "eth_chainId";
89
+ params?: undefined;
90
+ }): Promise<`0x${string}`>;
91
+ (args: {
92
+ method: "eth_coinbase";
93
+ params?: undefined;
94
+ }): Promise<`0x${string}`>;
95
+ (args: {
96
+ method: "eth_estimateGas";
97
+ params: [parameters: viem.RpcTransactionRequest, block?: `0x${string}` | viem.BlockTag | undefined];
98
+ }): Promise<`0x${string}`>;
99
+ (args: {
100
+ method: "eth_feeHistory";
101
+ params: [blockCount: `0x${string}`, newestBlock: `0x${string}` | viem.BlockTag, rewardPercentiles: number[] | undefined];
102
+ }): Promise<viem.RpcFeeHistory>;
103
+ (args: {
104
+ method: "eth_gasPrice";
105
+ params?: undefined;
106
+ }): Promise<`0x${string}`>;
107
+ (args: {
108
+ method: "eth_getBalance";
109
+ params: [address: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
110
+ }): Promise<`0x${string}`>;
111
+ (args: {
112
+ method: "eth_getBlockByHash";
113
+ params: [hash: `0x${string}`, includeTransactionObjects: boolean];
114
+ }): Promise<viem.RpcBlock | null>;
115
+ (args: {
116
+ method: "eth_getBlockByNumber";
117
+ params: [block: `0x${string}` | viem.BlockTag, includeTransactionObjects: boolean];
118
+ }): Promise<viem.RpcBlock | null>;
119
+ (args: {
120
+ method: "eth_getBlockTransactionCountByHash";
121
+ params: [hash: `0x${string}`];
122
+ }): Promise<`0x${string}`>;
123
+ (args: {
124
+ method: "eth_getBlockTransactionCountByNumber";
125
+ params: [block: `0x${string}` | viem.BlockTag];
126
+ }): Promise<`0x${string}`>;
127
+ (args: {
128
+ method: "eth_getCode";
129
+ params: [address: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
130
+ }): Promise<`0x${string}`>;
131
+ (args: {
132
+ method: "eth_getFilterChanges";
133
+ params: [filterId: `0x${string}`];
134
+ }): Promise<`0x${string}`[] | {
135
+ address: `0x${string}`;
136
+ blockHash: `0x${string}` | null;
137
+ blockNumber: `0x${string}` | null;
138
+ data: `0x${string}`;
139
+ logIndex: `0x${string}` | null;
140
+ transactionHash: `0x${string}` | null;
141
+ transactionIndex: `0x${string}` | null;
142
+ topics: [] | [`0x${string}`, ...`0x${string}`[]];
143
+ removed: boolean;
144
+ }[]>;
145
+ (args: {
146
+ method: "eth_getFilterLogs";
147
+ params: [filterId: `0x${string}`];
148
+ }): Promise<{
149
+ address: `0x${string}`;
150
+ blockHash: `0x${string}` | null;
151
+ blockNumber: `0x${string}` | null;
152
+ data: `0x${string}`;
153
+ logIndex: `0x${string}` | null;
154
+ transactionHash: `0x${string}` | null;
155
+ transactionIndex: `0x${string}` | null;
156
+ topics: [] | [`0x${string}`, ...`0x${string}`[]];
157
+ removed: boolean;
158
+ }[]>;
159
+ (args: {
160
+ method: "eth_getLogs";
161
+ params: [parameters: {
162
+ address?: `0x${string}` | `0x${string}`[] | undefined;
163
+ topics?: viem_dist_types_types.LogTopic[] | undefined;
164
+ } & ({
165
+ fromBlock?: `0x${string}` | viem.BlockTag | undefined;
166
+ toBlock?: `0x${string}` | viem.BlockTag | undefined;
167
+ blockHash?: undefined;
168
+ } | {
169
+ fromBlock?: undefined;
170
+ toBlock?: undefined;
171
+ blockHash?: `0x${string}` | undefined;
172
+ })];
173
+ }): Promise<{
174
+ address: `0x${string}`;
175
+ blockHash: `0x${string}` | null;
176
+ blockNumber: `0x${string}` | null;
177
+ data: `0x${string}`;
178
+ logIndex: `0x${string}` | null;
179
+ transactionHash: `0x${string}` | null;
180
+ transactionIndex: `0x${string}` | null;
181
+ topics: [] | [`0x${string}`, ...`0x${string}`[]];
182
+ removed: boolean;
183
+ }[]>;
184
+ (args: {
185
+ method: "eth_getStorageAt";
186
+ params: [address: `0x${string}`, index: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
187
+ }): Promise<`0x${string}`>;
188
+ (args: {
189
+ method: "eth_getTransactionByBlockHashAndIndex";
190
+ params: [hash: `0x${string}`, index: `0x${string}`];
191
+ }): Promise<viem.RpcTransaction | null>;
192
+ (args: {
193
+ method: "eth_getTransactionByBlockNumberAndIndex";
194
+ params: [block: `0x${string}` | viem.BlockTag, index: `0x${string}`];
195
+ }): Promise<viem.RpcTransaction | null>;
196
+ (args: {
197
+ method: "eth_getTransactionByHash";
198
+ params: [hash: `0x${string}`];
199
+ }): Promise<viem.RpcTransaction | null>;
200
+ (args: {
201
+ method: "eth_getTransactionCount";
202
+ params: [address: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
203
+ }): Promise<`0x${string}`>;
204
+ (args: {
205
+ method: "eth_getTransactionReceipt";
206
+ params: [hash: `0x${string}`];
207
+ }): Promise<viem.RpcTransactionReceipt | null>;
208
+ (args: {
209
+ method: "eth_getUncleByBlockHashAndIndex";
210
+ params: [hash: `0x${string}`, index: `0x${string}`];
211
+ }): Promise<viem.RpcUncle | null>;
212
+ (args: {
213
+ method: "eth_getUncleByBlockNumberAndIndex";
214
+ params: [block: `0x${string}` | viem.BlockTag, index: `0x${string}`];
215
+ }): Promise<viem.RpcUncle | null>;
216
+ (args: {
217
+ method: "eth_getUncleCountByBlockHash";
218
+ params: [hash: `0x${string}`];
219
+ }): Promise<`0x${string}`>;
220
+ (args: {
221
+ method: "eth_getUncleCountByBlockNumber";
222
+ params: [block: `0x${string}` | viem.BlockTag];
223
+ }): Promise<`0x${string}`>;
224
+ (args: {
225
+ method: "eth_newBlockFilter";
226
+ params?: undefined;
227
+ }): Promise<`0x${string}`>;
228
+ (args: {
229
+ method: "eth_newFilter";
230
+ params: [filter: {
231
+ fromBlock?: `0x${string}` | viem.BlockTag | undefined;
232
+ toBlock?: `0x${string}` | viem.BlockTag | undefined;
233
+ address?: `0x${string}` | `0x${string}`[] | undefined;
234
+ topics?: viem_dist_types_types.LogTopic[] | undefined;
235
+ }];
236
+ }): Promise<`0x${string}`>;
237
+ (args: {
238
+ method: "eth_newPendingTransactionFilter";
239
+ params?: undefined;
240
+ }): Promise<`0x${string}`>;
241
+ (args: {
242
+ method: "eth_protocolVersion";
243
+ params?: undefined;
244
+ }): Promise<string>;
245
+ (args: {
246
+ method: "eth_sendRawTransaction";
247
+ params: [signedTransaction: `0x${string}`];
248
+ }): Promise<`0x${string}`>;
249
+ (args: {
250
+ method: "eth_uninstallFilter";
251
+ params: [filterId: `0x${string}`];
252
+ }): Promise<boolean>;
253
+ } & {
254
+ (args: {
255
+ method: "eth_sendTransaction";
256
+ params: [request: viem.RpcTransactionRequest];
257
+ }): Promise<`0x${string}`>;
258
+ (args: {
259
+ method: "eth_sign";
260
+ params: [address: `0x${string}`, data: `0x${string}`];
261
+ }): Promise<`0x${string}`>;
262
+ (args: {
263
+ method: "eth_signTransaction";
264
+ params: [request: viem.RpcTransactionRequest];
265
+ }): Promise<`0x${string}`>;
266
+ (args: {
267
+ method: "eth_signTypedData_v4";
268
+ params: [address: `0x${string}`, message: string];
269
+ }): Promise<`0x${string}`>;
270
+ (args: {
271
+ method: "eth_syncing";
272
+ params?: undefined;
273
+ }): Promise<false | viem_dist_types_types_eip1193.NetworkSync>;
274
+ (args: {
275
+ method: "personal_sign";
276
+ params: [data: `0x${string}`, address: `0x${string}`];
277
+ }): Promise<`0x${string}`>;
278
+ } & {
279
+ (args: {
280
+ method: "eth_accounts";
281
+ params?: undefined;
282
+ }): Promise<`0x${string}`[]>;
283
+ (args: {
284
+ method: "eth_chainId";
285
+ params?: undefined;
286
+ }): Promise<`0x${string}`>;
287
+ (args: {
288
+ method: "eth_requestAccounts";
289
+ params?: undefined;
290
+ }): Promise<`0x${string}`[]>;
291
+ (args: {
292
+ method: "wallet_requestPermissions";
293
+ params: [permissions: {
294
+ eth_accounts: Record<string, any>;
295
+ }];
296
+ }): Promise<viem_dist_types_types_eip1193.WalletPermission[]>;
297
+ (args: {
298
+ method: "wallet_getPermissions";
299
+ params?: undefined;
300
+ }): Promise<viem_dist_types_types_eip1193.WalletPermission[]>;
301
+ (args: {
302
+ method: "wallet_addEthereumChain";
303
+ params: [chain: viem_dist_types_types_eip1193.Chain];
304
+ }): Promise<null>;
305
+ (args: {
306
+ method: "wallet_switchEthereumChain";
307
+ params: [chain: {
308
+ chainId: string;
309
+ }];
310
+ }): Promise<null>;
311
+ (args: {
312
+ method: "wallet_watchAsset";
313
+ params: viem_dist_types_types_eip1193.WatchAssetParams;
314
+ }): Promise<boolean>;
315
+ };
316
+ transport: viem.TransportConfig<"custom", {
317
+ (args: {
318
+ method: "web3_clientVersion";
319
+ params?: undefined;
320
+ }): Promise<string>;
321
+ (args: {
322
+ method: "web3_sha3";
323
+ params: [data: `0x${string}`];
324
+ }): Promise<string>;
325
+ (args: {
326
+ method: "net_listening";
327
+ params?: undefined;
328
+ }): Promise<boolean>;
329
+ (args: {
330
+ method: "net_peerCount";
331
+ params?: undefined;
332
+ }): Promise<`0x${string}`>;
333
+ (args: {
334
+ method: "net_version";
335
+ params?: undefined;
336
+ }): Promise<`0x${string}`>;
337
+ (args: {
338
+ method: "eth_blockNumber";
339
+ params?: undefined;
340
+ }): Promise<`0x${string}`>;
341
+ (args: {
342
+ method: "eth_call";
343
+ params: [request: Partial<viem.RpcTransactionRequest>, block?: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier | undefined];
344
+ }): Promise<`0x${string}`>;
345
+ (args: {
346
+ method: "eth_chainId";
347
+ params?: undefined;
348
+ }): Promise<`0x${string}`>;
349
+ (args: {
350
+ method: "eth_coinbase";
351
+ params?: undefined;
352
+ }): Promise<`0x${string}`>;
353
+ (args: {
354
+ method: "eth_estimateGas";
355
+ params: [parameters: viem.RpcTransactionRequest, block?: `0x${string}` | viem.BlockTag | undefined];
356
+ }): Promise<`0x${string}`>;
357
+ (args: {
358
+ method: "eth_feeHistory";
359
+ params: [blockCount: `0x${string}`, newestBlock: `0x${string}` | viem.BlockTag, rewardPercentiles: number[] | undefined];
360
+ }): Promise<viem.RpcFeeHistory>;
361
+ (args: {
362
+ method: "eth_gasPrice";
363
+ params?: undefined;
364
+ }): Promise<`0x${string}`>;
365
+ (args: {
366
+ method: "eth_getBalance";
367
+ params: [address: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
368
+ }): Promise<`0x${string}`>;
369
+ (args: {
370
+ method: "eth_getBlockByHash";
371
+ params: [hash: `0x${string}`, includeTransactionObjects: boolean];
372
+ }): Promise<viem.RpcBlock | null>;
373
+ (args: {
374
+ method: "eth_getBlockByNumber";
375
+ params: [block: `0x${string}` | viem.BlockTag, includeTransactionObjects: boolean];
376
+ }): Promise<viem.RpcBlock | null>;
377
+ (args: {
378
+ method: "eth_getBlockTransactionCountByHash";
379
+ params: [hash: `0x${string}`];
380
+ }): Promise<`0x${string}`>;
381
+ (args: {
382
+ method: "eth_getBlockTransactionCountByNumber";
383
+ params: [block: `0x${string}` | viem.BlockTag];
384
+ }): Promise<`0x${string}`>;
385
+ (args: {
386
+ method: "eth_getCode";
387
+ params: [address: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
388
+ }): Promise<`0x${string}`>;
389
+ (args: {
390
+ method: "eth_getFilterChanges";
391
+ params: [filterId: `0x${string}`];
392
+ }): Promise<`0x${string}`[] | {
393
+ address: `0x${string}`;
394
+ blockHash: `0x${string}` | null;
395
+ blockNumber: `0x${string}` | null;
396
+ data: `0x${string}`;
397
+ logIndex: `0x${string}` | null;
398
+ transactionHash: `0x${string}` | null;
399
+ transactionIndex: `0x${string}` | null;
400
+ topics: [] | [`0x${string}`, ...`0x${string}`[]];
401
+ removed: boolean;
402
+ }[]>;
403
+ (args: {
404
+ method: "eth_getFilterLogs";
405
+ params: [filterId: `0x${string}`];
406
+ }): Promise<{
407
+ address: `0x${string}`;
408
+ blockHash: `0x${string}` | null;
409
+ blockNumber: `0x${string}` | null;
410
+ data: `0x${string}`;
411
+ logIndex: `0x${string}` | null;
412
+ transactionHash: `0x${string}` | null;
413
+ transactionIndex: `0x${string}` | null;
414
+ topics: [] | [`0x${string}`, ...`0x${string}`[]];
415
+ removed: boolean;
416
+ }[]>;
417
+ (args: {
418
+ method: "eth_getLogs";
419
+ params: [parameters: {
420
+ address?: `0x${string}` | `0x${string}`[] | undefined;
421
+ topics?: viem_dist_types_types.LogTopic[] | undefined;
422
+ } & ({
423
+ fromBlock?: `0x${string}` | viem.BlockTag | undefined;
424
+ toBlock?: `0x${string}` | viem.BlockTag | undefined;
425
+ blockHash?: undefined;
426
+ } | {
427
+ fromBlock?: undefined;
428
+ toBlock?: undefined;
429
+ blockHash?: `0x${string}` | undefined;
430
+ })];
431
+ }): Promise<{
432
+ address: `0x${string}`;
433
+ blockHash: `0x${string}` | null;
434
+ blockNumber: `0x${string}` | null;
435
+ data: `0x${string}`;
436
+ logIndex: `0x${string}` | null;
437
+ transactionHash: `0x${string}` | null;
438
+ transactionIndex: `0x${string}` | null;
439
+ topics: [] | [`0x${string}`, ...`0x${string}`[]];
440
+ removed: boolean;
441
+ }[]>;
442
+ (args: {
443
+ method: "eth_getStorageAt";
444
+ params: [address: `0x${string}`, index: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
445
+ }): Promise<`0x${string}`>;
446
+ (args: {
447
+ method: "eth_getTransactionByBlockHashAndIndex";
448
+ params: [hash: `0x${string}`, index: `0x${string}`];
449
+ }): Promise<viem.RpcTransaction | null>;
450
+ (args: {
451
+ method: "eth_getTransactionByBlockNumberAndIndex";
452
+ params: [block: `0x${string}` | viem.BlockTag, index: `0x${string}`];
453
+ }): Promise<viem.RpcTransaction | null>;
454
+ (args: {
455
+ method: "eth_getTransactionByHash";
456
+ params: [hash: `0x${string}`];
457
+ }): Promise<viem.RpcTransaction | null>;
458
+ (args: {
459
+ method: "eth_getTransactionCount";
460
+ params: [address: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
461
+ }): Promise<`0x${string}`>;
462
+ (args: {
463
+ method: "eth_getTransactionReceipt";
464
+ params: [hash: `0x${string}`];
465
+ }): Promise<viem.RpcTransactionReceipt | null>;
466
+ (args: {
467
+ method: "eth_getUncleByBlockHashAndIndex";
468
+ params: [hash: `0x${string}`, index: `0x${string}`];
469
+ }): Promise<viem.RpcUncle | null>;
470
+ (args: {
471
+ method: "eth_getUncleByBlockNumberAndIndex";
472
+ params: [block: `0x${string}` | viem.BlockTag, index: `0x${string}`];
473
+ }): Promise<viem.RpcUncle | null>;
474
+ (args: {
475
+ method: "eth_getUncleCountByBlockHash";
476
+ params: [hash: `0x${string}`];
477
+ }): Promise<`0x${string}`>;
478
+ (args: {
479
+ method: "eth_getUncleCountByBlockNumber";
480
+ params: [block: `0x${string}` | viem.BlockTag];
481
+ }): Promise<`0x${string}`>;
482
+ (args: {
483
+ method: "eth_newBlockFilter";
484
+ params?: undefined;
485
+ }): Promise<`0x${string}`>;
486
+ (args: {
487
+ method: "eth_newFilter";
488
+ params: [filter: {
489
+ fromBlock?: `0x${string}` | viem.BlockTag | undefined;
490
+ toBlock?: `0x${string}` | viem.BlockTag | undefined;
491
+ address?: `0x${string}` | `0x${string}`[] | undefined;
492
+ topics?: viem_dist_types_types.LogTopic[] | undefined;
493
+ }];
494
+ }): Promise<`0x${string}`>;
495
+ (args: {
496
+ method: "eth_newPendingTransactionFilter";
497
+ params?: undefined;
498
+ }): Promise<`0x${string}`>;
499
+ (args: {
500
+ method: "eth_protocolVersion";
501
+ params?: undefined;
502
+ }): Promise<string>;
503
+ (args: {
504
+ method: "eth_sendRawTransaction";
505
+ params: [signedTransaction: `0x${string}`];
506
+ }): Promise<`0x${string}`>;
507
+ (args: {
508
+ method: "eth_uninstallFilter";
509
+ params: [filterId: `0x${string}`];
510
+ }): Promise<boolean>;
511
+ } & {
512
+ (args: {
513
+ method: "eth_sendTransaction";
514
+ params: [request: viem.RpcTransactionRequest];
515
+ }): Promise<`0x${string}`>;
516
+ (args: {
517
+ method: "eth_sign";
518
+ params: [address: `0x${string}`, data: `0x${string}`];
519
+ }): Promise<`0x${string}`>;
520
+ (args: {
521
+ method: "eth_signTransaction";
522
+ params: [request: viem.RpcTransactionRequest];
523
+ }): Promise<`0x${string}`>;
524
+ (args: {
525
+ method: "eth_signTypedData_v4";
526
+ params: [address: `0x${string}`, message: string];
527
+ }): Promise<`0x${string}`>;
528
+ (args: {
529
+ method: "eth_syncing";
530
+ params?: undefined;
531
+ }): Promise<false | viem_dist_types_types_eip1193.NetworkSync>;
532
+ (args: {
533
+ method: "personal_sign";
534
+ params: [data: `0x${string}`, address: `0x${string}`];
535
+ }): Promise<`0x${string}`>;
536
+ } & {
537
+ (args: {
538
+ method: "eth_accounts";
539
+ params?: undefined;
540
+ }): Promise<`0x${string}`[]>;
541
+ (args: {
542
+ method: "eth_chainId";
543
+ params?: undefined;
544
+ }): Promise<`0x${string}`>;
545
+ (args: {
546
+ method: "eth_requestAccounts";
547
+ params?: undefined;
548
+ }): Promise<`0x${string}`[]>;
549
+ (args: {
550
+ method: "wallet_requestPermissions";
551
+ params: [permissions: {
552
+ eth_accounts: Record<string, any>;
553
+ }];
554
+ }): Promise<viem_dist_types_types_eip1193.WalletPermission[]>;
555
+ (args: {
556
+ method: "wallet_getPermissions";
557
+ params?: undefined;
558
+ }): Promise<viem_dist_types_types_eip1193.WalletPermission[]>;
559
+ (args: {
560
+ method: "wallet_addEthereumChain";
561
+ params: [chain: viem_dist_types_types_eip1193.Chain];
562
+ }): Promise<null>;
563
+ (args: {
564
+ method: "wallet_switchEthereumChain";
565
+ params: [chain: {
566
+ chainId: string;
567
+ }];
568
+ }): Promise<null>;
569
+ (args: {
570
+ method: "wallet_watchAsset";
571
+ params: viem_dist_types_types_eip1193.WatchAssetParams;
572
+ }): Promise<boolean>;
573
+ }> & ((...args: any) => Promise<any>);
574
+ type: string;
575
+ uid: string;
576
+ addChain: (args: viem.AddChainParameters) => Promise<void>;
577
+ deployContract: <TAbi extends readonly unknown[] | abitype_dist_abi_7aa1f183.l, TChainOverride extends viem.Chain<viem_dist_types_types.Formatters> | undefined>(args: viem.DeployContractParameters<TAbi, Chain, {
578
+ address: `0x${string}`;
579
+ type: "json-rpc";
580
+ }, TChainOverride>) => Promise<`0x${string}`>;
581
+ getAddresses: () => Promise<viem.GetAddressesReturnType>;
582
+ getChainId: () => Promise<number>;
583
+ getPermissions: () => Promise<viem.GetPermissionsReturnType>;
584
+ requestAddresses: () => Promise<viem.RequestAddressesReturnType>;
585
+ requestPermissions: (args: {
586
+ [x: string]: Record<string, any>;
587
+ eth_accounts: Record<string, any>;
588
+ }) => Promise<viem.RequestPermissionsReturnType>;
589
+ sendTransaction: <TChainOverride_1 extends viem.Chain<viem_dist_types_types.Formatters> | undefined>(args: viem.SendTransactionParameters<Chain, {
590
+ address: `0x${string}`;
591
+ type: "json-rpc";
592
+ }, TChainOverride_1>) => Promise<`0x${string}`>;
593
+ signMessage: (args: viem.SignMessageParameters<{
594
+ address: `0x${string}`;
595
+ type: "json-rpc";
596
+ }>) => Promise<`0x${string}`>;
597
+ signTypedData: <TTypedData extends {
598
+ [x: string]: readonly abitype_dist_abi_7aa1f183.o[];
599
+ [x: `string[${string}]`]: undefined;
600
+ [x: `function[${string}]`]: undefined;
601
+ [x: `address[${string}]`]: undefined;
602
+ [x: `bool[${string}]`]: undefined;
603
+ [x: `bytes[${string}]`]: undefined;
604
+ [x: `bytes2[${string}]`]: undefined;
605
+ [x: `bytes16[${string}]`]: undefined;
606
+ [x: `bytes10[${string}]`]: undefined;
607
+ [x: `bytes1[${string}]`]: undefined;
608
+ [x: `bytes3[${string}]`]: undefined;
609
+ [x: `bytes4[${string}]`]: undefined;
610
+ [x: `bytes5[${string}]`]: undefined;
611
+ [x: `bytes6[${string}]`]: undefined;
612
+ [x: `bytes7[${string}]`]: undefined;
613
+ [x: `bytes8[${string}]`]: undefined;
614
+ [x: `bytes9[${string}]`]: undefined;
615
+ [x: `bytes11[${string}]`]: undefined;
616
+ [x: `bytes12[${string}]`]: undefined;
617
+ [x: `bytes13[${string}]`]: undefined;
618
+ [x: `bytes14[${string}]`]: undefined;
619
+ [x: `bytes15[${string}]`]: undefined;
620
+ [x: `bytes17[${string}]`]: undefined;
621
+ [x: `bytes18[${string}]`]: undefined;
622
+ [x: `bytes19[${string}]`]: undefined;
623
+ [x: `bytes20[${string}]`]: undefined;
624
+ [x: `bytes21[${string}]`]: undefined;
625
+ [x: `bytes22[${string}]`]: undefined;
626
+ [x: `bytes23[${string}]`]: undefined;
627
+ [x: `bytes24[${string}]`]: undefined;
628
+ [x: `bytes25[${string}]`]: undefined;
629
+ [x: `bytes26[${string}]`]: undefined;
630
+ [x: `bytes27[${string}]`]: undefined;
631
+ [x: `bytes28[${string}]`]: undefined;
632
+ [x: `bytes29[${string}]`]: undefined;
633
+ [x: `bytes30[${string}]`]: undefined;
634
+ [x: `bytes31[${string}]`]: undefined;
635
+ [x: `bytes32[${string}]`]: undefined;
636
+ [x: `int[${string}]`]: undefined;
637
+ [x: `int16[${string}]`]: undefined;
638
+ [x: `int8[${string}]`]: undefined;
639
+ [x: `int24[${string}]`]: undefined;
640
+ [x: `int32[${string}]`]: undefined;
641
+ [x: `int40[${string}]`]: undefined;
642
+ [x: `int48[${string}]`]: undefined;
643
+ [x: `int56[${string}]`]: undefined;
644
+ [x: `int64[${string}]`]: undefined;
645
+ [x: `int72[${string}]`]: undefined;
646
+ [x: `int80[${string}]`]: undefined;
647
+ [x: `int88[${string}]`]: undefined;
648
+ [x: `int96[${string}]`]: undefined;
649
+ [x: `int104[${string}]`]: undefined;
650
+ [x: `int112[${string}]`]: undefined;
651
+ [x: `int120[${string}]`]: undefined;
652
+ [x: `int128[${string}]`]: undefined;
653
+ [x: `int136[${string}]`]: undefined;
654
+ [x: `int144[${string}]`]: undefined;
655
+ [x: `int152[${string}]`]: undefined;
656
+ [x: `int160[${string}]`]: undefined;
657
+ [x: `int168[${string}]`]: undefined;
658
+ [x: `int176[${string}]`]: undefined;
659
+ [x: `int184[${string}]`]: undefined;
660
+ [x: `int192[${string}]`]: undefined;
661
+ [x: `int200[${string}]`]: undefined;
662
+ [x: `int208[${string}]`]: undefined;
663
+ [x: `int216[${string}]`]: undefined;
664
+ [x: `int224[${string}]`]: undefined;
665
+ [x: `int232[${string}]`]: undefined;
666
+ [x: `int240[${string}]`]: undefined;
667
+ [x: `int248[${string}]`]: undefined;
668
+ [x: `int256[${string}]`]: undefined;
669
+ [x: `uint[${string}]`]: undefined;
670
+ [x: `uint16[${string}]`]: undefined;
671
+ [x: `uint8[${string}]`]: undefined;
672
+ [x: `uint24[${string}]`]: undefined;
673
+ [x: `uint32[${string}]`]: undefined;
674
+ [x: `uint40[${string}]`]: undefined;
675
+ [x: `uint48[${string}]`]: undefined;
676
+ [x: `uint56[${string}]`]: undefined;
677
+ [x: `uint64[${string}]`]: undefined;
678
+ [x: `uint72[${string}]`]: undefined;
679
+ [x: `uint80[${string}]`]: undefined;
680
+ [x: `uint88[${string}]`]: undefined;
681
+ [x: `uint96[${string}]`]: undefined;
682
+ [x: `uint104[${string}]`]: undefined;
683
+ [x: `uint112[${string}]`]: undefined;
684
+ [x: `uint120[${string}]`]: undefined;
685
+ [x: `uint128[${string}]`]: undefined;
686
+ [x: `uint136[${string}]`]: undefined;
687
+ [x: `uint144[${string}]`]: undefined;
688
+ [x: `uint152[${string}]`]: undefined;
689
+ [x: `uint160[${string}]`]: undefined;
690
+ [x: `uint168[${string}]`]: undefined;
691
+ [x: `uint176[${string}]`]: undefined;
692
+ [x: `uint184[${string}]`]: undefined;
693
+ [x: `uint192[${string}]`]: undefined;
694
+ [x: `uint200[${string}]`]: undefined;
695
+ [x: `uint208[${string}]`]: undefined;
696
+ [x: `uint216[${string}]`]: undefined;
697
+ [x: `uint224[${string}]`]: undefined;
698
+ [x: `uint232[${string}]`]: undefined;
699
+ [x: `uint240[${string}]`]: undefined;
700
+ [x: `uint248[${string}]`]: undefined;
701
+ [x: `uint256[${string}]`]: undefined;
702
+ string?: undefined;
703
+ address?: undefined;
704
+ bool?: undefined;
705
+ bytes?: undefined;
706
+ bytes2?: undefined;
707
+ bytes16?: undefined;
708
+ bytes10?: undefined;
709
+ bytes1?: undefined;
710
+ bytes3?: undefined;
711
+ bytes4?: undefined;
712
+ bytes5?: undefined;
713
+ bytes6?: undefined;
714
+ bytes7?: undefined;
715
+ bytes8?: undefined;
716
+ bytes9?: undefined;
717
+ bytes11?: undefined;
718
+ bytes12?: undefined;
719
+ bytes13?: undefined;
720
+ bytes14?: undefined;
721
+ bytes15?: undefined;
722
+ bytes17?: undefined;
723
+ bytes18?: undefined;
724
+ bytes19?: undefined;
725
+ bytes20?: undefined;
726
+ bytes21?: undefined;
727
+ bytes22?: undefined;
728
+ bytes23?: undefined;
729
+ bytes24?: undefined;
730
+ bytes25?: undefined;
731
+ bytes26?: undefined;
732
+ bytes27?: undefined;
733
+ bytes28?: undefined;
734
+ bytes29?: undefined;
735
+ bytes30?: undefined;
736
+ bytes31?: undefined;
737
+ bytes32?: undefined;
738
+ int16?: undefined;
739
+ int8?: undefined;
740
+ int24?: undefined;
741
+ int32?: undefined;
742
+ int40?: undefined;
743
+ int48?: undefined;
744
+ int56?: undefined;
745
+ int64?: undefined;
746
+ int72?: undefined;
747
+ int80?: undefined;
748
+ int88?: undefined;
749
+ int96?: undefined;
750
+ int104?: undefined;
751
+ int112?: undefined;
752
+ int120?: undefined;
753
+ int128?: undefined;
754
+ int136?: undefined;
755
+ int144?: undefined;
756
+ int152?: undefined;
757
+ int160?: undefined;
758
+ int168?: undefined;
759
+ int176?: undefined;
760
+ int184?: undefined;
761
+ int192?: undefined;
762
+ int200?: undefined;
763
+ int208?: undefined;
764
+ int216?: undefined;
765
+ int224?: undefined;
766
+ int232?: undefined;
767
+ int240?: undefined;
768
+ int248?: undefined;
769
+ int256?: undefined;
770
+ uint16?: undefined;
771
+ uint8?: undefined;
772
+ uint24?: undefined;
773
+ uint32?: undefined;
774
+ uint40?: undefined;
775
+ uint48?: undefined;
776
+ uint56?: undefined;
777
+ uint64?: undefined;
778
+ uint72?: undefined;
779
+ uint80?: undefined;
780
+ uint88?: undefined;
781
+ uint96?: undefined;
782
+ uint104?: undefined;
783
+ uint112?: undefined;
784
+ uint120?: undefined;
785
+ uint128?: undefined;
786
+ uint136?: undefined;
787
+ uint144?: undefined;
788
+ uint152?: undefined;
789
+ uint160?: undefined;
790
+ uint168?: undefined;
791
+ uint176?: undefined;
792
+ uint184?: undefined;
793
+ uint192?: undefined;
794
+ uint200?: undefined;
795
+ uint208?: undefined;
796
+ uint216?: undefined;
797
+ uint224?: undefined;
798
+ uint232?: undefined;
799
+ uint240?: undefined;
800
+ uint248?: undefined;
801
+ uint256?: undefined;
802
+ } | {
803
+ [key: string]: unknown;
804
+ }, TPrimaryType extends string>(args: viem.SignTypedDataParameters<TTypedData, TPrimaryType, {
805
+ address: `0x${string}`;
806
+ type: "json-rpc";
807
+ }>) => Promise<`0x${string}`>;
808
+ switchChain: (args: viem.SwitchChainParameters) => Promise<void>;
809
+ watchAsset: (args: viem_dist_types_types_eip1193.WatchAssetParams) => Promise<boolean>;
810
+ writeContract: <TAbi_1 extends readonly unknown[] | abitype_dist_abi_7aa1f183.l, TFunctionName extends string, TChainOverride_2 extends viem.Chain<viem_dist_types_types.Formatters> | undefined>(args: viem.WriteContractParameters<TAbi_1, TFunctionName, Chain, {
811
+ address: `0x${string}`;
812
+ type: "json-rpc";
813
+ }, TChainOverride_2>) => Promise<`0x${string}`>;
814
+ account: {
815
+ address: `0x${string}`;
816
+ type: "json-rpc";
817
+ };
818
+ }>;
819
+ isAuthorized(): Promise<boolean>;
820
+ switchChain(chainId: number): Promise<Chain>;
821
+ watchAsset({ address, decimals, image, symbol, }: {
822
+ address: Address;
823
+ decimals?: number;
824
+ image?: string;
825
+ symbol: string;
826
+ }): Promise<boolean>;
827
+ protected onAccountsChanged: (accounts: string[]) => void;
828
+ protected onChainChanged: (chainId: number | string) => void;
829
+ protected onDisconnect: (error: Error) => Promise<void>;
830
+ protected isUserRejectedRequestError(error: unknown): boolean;
831
+ }
832
+
833
+ export { InjectedConnector, InjectedConnectorOptions };