@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,917 @@
1
- export * from '../src/walletConnect'
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 WalletConnectProvider from '@walletconnect/ethereum-provider';
7
+ import { EthereumProviderOptions } from '@walletconnect/ethereum-provider/dist/types/EthereumProvider';
8
+ import { C as Connector } from './base-a11da01a.js';
9
+ import 'abitype';
10
+ import 'eventemitter3';
11
+
12
+ type WalletConnectOptions = {
13
+ /**
14
+ * WalletConnect Cloud Project ID.
15
+ * @link https://cloud.walletconnect.com/sign-in.
16
+ */
17
+ projectId: EthereumProviderOptions['projectId'];
18
+ /**
19
+ * If a new chain is added to a previously existing configured connector `chains`, this flag
20
+ * will determine if that chain should be considered as stale. A stale chain is a chain that
21
+ * WalletConnect has yet to establish a relationship with (ie. the user has not approved or
22
+ * rejected the chain).
23
+ *
24
+ * Preface: Whereas WalletConnect v1 supported dynamic chain switching, WalletConnect v2 requires
25
+ * the user to pre-approve a set of chains up-front. This comes with consequent UX nuances (see below) when
26
+ * a user tries to switch to a chain that they have not approved.
27
+ *
28
+ * This flag mainly affects the behavior when a wallet does not support dynamic chain authorization
29
+ * with WalletConnect v2.
30
+ *
31
+ * If `true` (default), the new chain will be treated as a stale chain. If the user
32
+ * has yet to establish a relationship (approved/rejected) with this chain in their WalletConnect
33
+ * session, the connector will disconnect upon the dapp auto-connecting, and the user will have to
34
+ * reconnect to the dapp (revalidate the chain) in order to approve the newly added chain.
35
+ * This is the default behavior to avoid an unexpected error upon switching chains which may
36
+ * be a confusing user experience (ie. the user will not know they have to reconnect
37
+ * unless the dapp handles these types of errors).
38
+ *
39
+ * If `false`, the new chain will be treated as a validated chain. This means that if the user
40
+ * has yet to establish a relationship with the chain in their WalletConnect session, wagmi will successfully
41
+ * auto-connect the user. This comes with the trade-off that the connector will throw an error
42
+ * when attempting to switch to the unapproved chain. This may be useful in cases where a dapp constantly
43
+ * modifies their configured chains, and they do not want to disconnect the user upon
44
+ * auto-connecting. If the user decides to switch to the unapproved chain, it is important that the
45
+ * dapp handles this error and prompts the user to reconnect to the dapp in order to approve
46
+ * the newly added chain.
47
+ *
48
+ * @default true
49
+ */
50
+ isNewChainsStale?: boolean;
51
+ /**
52
+ * Metadata for your app.
53
+ * @link https://docs.walletconnect.com/2.0/javascript/providers/ethereum#initialization
54
+ */
55
+ metadata?: EthereumProviderOptions['metadata'];
56
+ /**
57
+ * Whether or not to show the QR code modal.
58
+ * @default true
59
+ * @link https://docs.walletconnect.com/2.0/javascript/providers/ethereum#initialization
60
+ */
61
+ showQrModal?: EthereumProviderOptions['showQrModal'];
62
+ /**
63
+ * Options of QR code modal.
64
+ * @link https://docs.walletconnect.com/2.0/web3modal/options
65
+ */
66
+ qrModalOptions?: EthereumProviderOptions['qrModalOptions'];
67
+ };
68
+ type ConnectConfig = {
69
+ /** Target chain to connect to. */
70
+ chainId?: number;
71
+ /** If provided, will attempt to connect to an existing pairing. */
72
+ pairingTopic?: string;
73
+ };
74
+ declare class WalletConnectConnector extends Connector<WalletConnectProvider, WalletConnectOptions> {
75
+ #private;
76
+ readonly id = "walletConnect";
77
+ readonly name = "WalletConnect";
78
+ readonly ready = true;
79
+ constructor(config: {
80
+ chains?: Chain[];
81
+ options: WalletConnectOptions;
82
+ });
83
+ connect({ chainId, pairingTopic }?: ConnectConfig): Promise<{
84
+ account: `0x${string}`;
85
+ chain: {
86
+ id: number;
87
+ unsupported: boolean;
88
+ };
89
+ }>;
90
+ disconnect(): Promise<void>;
91
+ getAccount(): Promise<`0x${string}`>;
92
+ getChainId(): Promise<number>;
93
+ getProvider({ chainId }?: {
94
+ chainId?: number;
95
+ }): Promise<WalletConnectProvider>;
96
+ getWalletClient({ chainId }?: {
97
+ chainId?: number;
98
+ }): Promise<{
99
+ chain: Chain;
100
+ key: string;
101
+ name: string;
102
+ pollingInterval: number;
103
+ request: {
104
+ (args: {
105
+ method: "web3_clientVersion";
106
+ params?: undefined;
107
+ }): Promise<string>;
108
+ (args: {
109
+ method: "web3_sha3";
110
+ params: [data: `0x${string}`];
111
+ }): Promise<string>;
112
+ (args: {
113
+ method: "net_listening";
114
+ params?: undefined;
115
+ }): Promise<boolean>;
116
+ (args: {
117
+ method: "net_peerCount";
118
+ params?: undefined;
119
+ }): Promise<`0x${string}`>;
120
+ (args: {
121
+ method: "net_version";
122
+ params?: undefined;
123
+ }): Promise<`0x${string}`>;
124
+ (args: {
125
+ method: "eth_blockNumber";
126
+ params?: undefined;
127
+ }): Promise<`0x${string}`>;
128
+ (args: {
129
+ method: "eth_call";
130
+ params: [request: Partial<viem.RpcTransactionRequest>, block?: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier | undefined];
131
+ }): Promise<`0x${string}`>;
132
+ (args: {
133
+ method: "eth_chainId";
134
+ params?: undefined;
135
+ }): Promise<`0x${string}`>;
136
+ (args: {
137
+ method: "eth_coinbase";
138
+ params?: undefined;
139
+ }): Promise<`0x${string}`>;
140
+ (args: {
141
+ method: "eth_estimateGas";
142
+ params: [parameters: viem.RpcTransactionRequest, block?: `0x${string}` | viem.BlockTag | undefined];
143
+ }): Promise<`0x${string}`>;
144
+ (args: {
145
+ method: "eth_feeHistory";
146
+ params: [blockCount: `0x${string}`, newestBlock: `0x${string}` | viem.BlockTag, rewardPercentiles: number[] | undefined];
147
+ }): Promise<viem.RpcFeeHistory>;
148
+ (args: {
149
+ method: "eth_gasPrice";
150
+ params?: undefined;
151
+ }): Promise<`0x${string}`>;
152
+ (args: {
153
+ method: "eth_getBalance";
154
+ params: [address: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
155
+ }): Promise<`0x${string}`>;
156
+ (args: {
157
+ method: "eth_getBlockByHash";
158
+ params: [hash: `0x${string}`, includeTransactionObjects: boolean];
159
+ }): Promise<viem.RpcBlock | null>;
160
+ (args: {
161
+ method: "eth_getBlockByNumber";
162
+ params: [block: `0x${string}` | viem.BlockTag, includeTransactionObjects: boolean];
163
+ }): Promise<viem.RpcBlock | null>;
164
+ (args: {
165
+ /**
166
+ * Checks if the target chains match the chains that were
167
+ * initially requested by the connector for the WalletConnect session.
168
+ * If there is a mismatch, this means that the chains on the connector
169
+ * are considered stale, and need to be revalidated at a later point (via
170
+ * connection).
171
+ *
172
+ * There may be a scenario where a dapp adds a chain to the
173
+ * connector later on, however, this chain will not have been approved or rejected
174
+ * by the wallet. In this case, the chain is considered stale.
175
+ *
176
+ * There are exceptions however:
177
+ * - If the wallet supports dynamic chain addition via `eth_addEthereumChain`,
178
+ * then the chain is not considered stale.
179
+ * - If the `isNewChainsStale` flag is falsy on the connector, then the chain is
180
+ * not considered stale.
181
+ *
182
+ * For the above cases, chain validation occurs dynamically when the user
183
+ * attempts to switch chain.
184
+ *
185
+ * Also check that dapp supports at least 1 chain from previously approved session.
186
+ */
187
+ method: "eth_getBlockTransactionCountByHash";
188
+ params: [hash: `0x${string}`];
189
+ }): Promise<`0x${string}`>;
190
+ (args: {
191
+ method: "eth_getBlockTransactionCountByNumber";
192
+ params: [block: `0x${string}` | viem.BlockTag];
193
+ }): Promise<`0x${string}`>;
194
+ (args: {
195
+ method: "eth_getCode";
196
+ params: [address: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
197
+ }): Promise<`0x${string}`>;
198
+ (args: {
199
+ method: "eth_getFilterChanges";
200
+ params: [filterId: `0x${string}`];
201
+ }): Promise<{
202
+ address: `0x${string}`;
203
+ blockHash: `0x${string}` | null;
204
+ blockNumber: `0x${string}` | null;
205
+ data: `0x${string}`;
206
+ logIndex: `0x${string}` | null;
207
+ transactionHash: `0x${string}` | null;
208
+ transactionIndex: `0x${string}` | null;
209
+ topics: [] | [`0x${string}`, ...`0x${string}`[]];
210
+ removed: boolean;
211
+ }[] | `0x${string}`[]>;
212
+ (args: {
213
+ method: "eth_getFilterLogs";
214
+ params: [filterId: `0x${string}`];
215
+ }): Promise<{
216
+ address: `0x${string}`;
217
+ blockHash: `0x${string}` | null;
218
+ blockNumber: `0x${string}` | null;
219
+ data: `0x${string}`;
220
+ logIndex: `0x${string}` | null;
221
+ transactionHash: `0x${string}` | null;
222
+ transactionIndex: `0x${string}` | null;
223
+ topics: [] | [`0x${string}`, ...`0x${string}`[]];
224
+ removed: boolean;
225
+ }[]>;
226
+ (args: {
227
+ method: "eth_getLogs";
228
+ params: [parameters: {
229
+ address?: `0x${string}` | `0x${string}`[] | undefined;
230
+ topics?: viem_dist_types_types.LogTopic[] | undefined;
231
+ } & ({
232
+ fromBlock?: `0x${string}` | viem.BlockTag | undefined;
233
+ toBlock?: `0x${string}` | viem.BlockTag | undefined;
234
+ blockHash?: undefined;
235
+ } | {
236
+ fromBlock?: undefined;
237
+ toBlock?: undefined;
238
+ blockHash?: `0x${string}` | undefined;
239
+ })];
240
+ }): Promise<{
241
+ address: `0x${string}`;
242
+ blockHash: `0x${string}` | null;
243
+ blockNumber: `0x${string}` | null;
244
+ data: `0x${string}`;
245
+ logIndex: `0x${string}` | null;
246
+ transactionHash: `0x${string}` | null;
247
+ transactionIndex: `0x${string}` | null;
248
+ topics: [] | [`0x${string}`, ...`0x${string}`[]];
249
+ removed: boolean;
250
+ }[]>;
251
+ (args: {
252
+ method: "eth_getStorageAt";
253
+ params: [address: `0x${string}`, index: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
254
+ }): Promise<`0x${string}`>;
255
+ (args: {
256
+ method: "eth_getTransactionByBlockHashAndIndex";
257
+ params: [hash: `0x${string}`, index: `0x${string}`];
258
+ }): Promise<viem.RpcTransaction | null>;
259
+ (args: {
260
+ method: "eth_getTransactionByBlockNumberAndIndex";
261
+ params: [block: `0x${string}` | viem.BlockTag, index: `0x${string}`];
262
+ }): Promise<viem.RpcTransaction | null>;
263
+ (args: {
264
+ method: "eth_getTransactionByHash";
265
+ params: [hash: `0x${string}`];
266
+ }): Promise<viem.RpcTransaction | null>;
267
+ (args: {
268
+ method: "eth_getTransactionCount";
269
+ params: [address: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
270
+ }): Promise<`0x${string}`>;
271
+ (args: {
272
+ method: "eth_getTransactionReceipt";
273
+ params: [hash: `0x${string}`];
274
+ }): Promise<viem.RpcTransactionReceipt | null>;
275
+ (args: {
276
+ method: "eth_getUncleByBlockHashAndIndex";
277
+ params: [hash: `0x${string}`, index: `0x${string}`];
278
+ }): Promise<viem.RpcUncle | null>;
279
+ (args: {
280
+ method: "eth_getUncleByBlockNumberAndIndex";
281
+ params: [block: `0x${string}` | viem.BlockTag, index: `0x${string}`];
282
+ }): Promise<viem.RpcUncle | null>;
283
+ (args: {
284
+ method: "eth_getUncleCountByBlockHash";
285
+ params: [hash: `0x${string}`];
286
+ }): Promise<`0x${string}`>;
287
+ (args: {
288
+ method: "eth_getUncleCountByBlockNumber";
289
+ params: [block: `0x${string}` | viem.BlockTag];
290
+ }): Promise<`0x${string}`>;
291
+ (args: {
292
+ method: "eth_newBlockFilter";
293
+ params?: undefined;
294
+ }): Promise<`0x${string}`>;
295
+ (args: {
296
+ method: "eth_newFilter";
297
+ params: [filter: {
298
+ fromBlock?: `0x${string}` | viem.BlockTag | undefined;
299
+ toBlock?: `0x${string}` | viem.BlockTag | undefined;
300
+ address?: `0x${string}` | `0x${string}`[] | undefined;
301
+ topics?: viem_dist_types_types.LogTopic[] | undefined;
302
+ }];
303
+ }): Promise<`0x${string}`>;
304
+ (args: {
305
+ method: "eth_newPendingTransactionFilter";
306
+ params?: undefined;
307
+ }): Promise<`0x${string}`>;
308
+ (args: {
309
+ method: "eth_protocolVersion";
310
+ params?: undefined;
311
+ }): Promise<string>;
312
+ (args: {
313
+ method: "eth_sendRawTransaction";
314
+ params: [signedTransaction: `0x${string}`];
315
+ }): Promise<`0x${string}`>;
316
+ (args: {
317
+ method: "eth_uninstallFilter";
318
+ params: [filterId: `0x${string}`];
319
+ }): Promise<boolean>;
320
+ } & {
321
+ (args: {
322
+ method: "eth_sendTransaction";
323
+ params: [request: viem.RpcTransactionRequest];
324
+ }): Promise<`0x${string}`>;
325
+ (args: {
326
+ method: "eth_sign";
327
+ params: [address: `0x${string}`, data: `0x${string}`];
328
+ }): Promise<`0x${string}`>;
329
+ (args: {
330
+ method: "eth_signTransaction";
331
+ params: [request: viem.RpcTransactionRequest];
332
+ }): Promise<`0x${string}`>;
333
+ (args: {
334
+ method: "eth_signTypedData_v4";
335
+ params: [address: `0x${string}`, message: string];
336
+ }): Promise<`0x${string}`>;
337
+ (args: {
338
+ method: "eth_syncing";
339
+ params?: undefined;
340
+ }): Promise<false | viem_dist_types_types_eip1193.NetworkSync>;
341
+ (args: {
342
+ method: "personal_sign";
343
+ params: [data: `0x${string}`, address: `0x${string}`];
344
+ }): Promise<`0x${string}`>;
345
+ } & {
346
+ (args: {
347
+ method: "eth_accounts";
348
+ params?: undefined;
349
+ }): Promise<`0x${string}`[]>;
350
+ (args: {
351
+ method: "eth_chainId";
352
+ params?: undefined;
353
+ }): Promise<`0x${string}`>;
354
+ (args: {
355
+ method: "eth_requestAccounts";
356
+ params?: undefined;
357
+ }): Promise<`0x${string}`[]>;
358
+ (args: {
359
+ method: "wallet_requestPermissions";
360
+ params: [permissions: {
361
+ eth_accounts: Record<string, any>;
362
+ }];
363
+ }): Promise<viem_dist_types_types_eip1193.WalletPermission[]>;
364
+ (args: {
365
+ method: "wallet_getPermissions";
366
+ params?: undefined;
367
+ }): Promise<viem_dist_types_types_eip1193.WalletPermission[]>;
368
+ (args: {
369
+ method: "wallet_addEthereumChain";
370
+ params: [chain: viem_dist_types_types_eip1193.Chain];
371
+ }): Promise<null>;
372
+ (args: {
373
+ method: "wallet_switchEthereumChain";
374
+ params: [chain: {
375
+ chainId: string;
376
+ }];
377
+ }): Promise<null>;
378
+ (args: {
379
+ method: "wallet_watchAsset";
380
+ params: viem_dist_types_types_eip1193.WatchAssetParams;
381
+ }): Promise<boolean>;
382
+ };
383
+ transport: viem.TransportConfig<"custom", {
384
+ (args: {
385
+ method: "web3_clientVersion";
386
+ params?: undefined;
387
+ }): Promise<string>;
388
+ (args: {
389
+ method: "web3_sha3";
390
+ params: [data: `0x${string}`];
391
+ }): Promise<string>;
392
+ (args: {
393
+ method: "net_listening";
394
+ params?: undefined;
395
+ }): Promise<boolean>;
396
+ (args: {
397
+ method: "net_peerCount";
398
+ params?: undefined;
399
+ }): Promise<`0x${string}`>;
400
+ (args: {
401
+ method: "net_version";
402
+ params?: undefined;
403
+ }): Promise<`0x${string}`>;
404
+ (args: {
405
+ method: "eth_blockNumber";
406
+ params?: undefined;
407
+ }): Promise<`0x${string}`>;
408
+ (args: {
409
+ method: "eth_call";
410
+ params: [request: Partial<viem.RpcTransactionRequest>, block?: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier | undefined];
411
+ }): Promise<`0x${string}`>;
412
+ (args: {
413
+ method: "eth_chainId";
414
+ params?: undefined;
415
+ }): Promise<`0x${string}`>;
416
+ (args: {
417
+ method: "eth_coinbase";
418
+ params?: undefined;
419
+ }): Promise<`0x${string}`>;
420
+ (args: {
421
+ method: "eth_estimateGas";
422
+ params: [parameters: viem.RpcTransactionRequest, block?: `0x${string}` | viem.BlockTag | undefined];
423
+ }): Promise<`0x${string}`>;
424
+ (args: {
425
+ method: "eth_feeHistory";
426
+ params: [blockCount: `0x${string}`, newestBlock: `0x${string}` | viem.BlockTag, rewardPercentiles: number[] | undefined];
427
+ }): Promise<viem.RpcFeeHistory>;
428
+ (args: {
429
+ method: "eth_gasPrice";
430
+ params?: undefined;
431
+ }): Promise<`0x${string}`>;
432
+ (args: {
433
+ method: "eth_getBalance";
434
+ params: [address: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
435
+ }): Promise<`0x${string}`>;
436
+ (args: {
437
+ method: "eth_getBlockByHash";
438
+ params: [hash: `0x${string}`, includeTransactionObjects: boolean];
439
+ }): Promise<viem.RpcBlock | null>;
440
+ (args: {
441
+ method: "eth_getBlockByNumber";
442
+ params: [block: `0x${string}` | viem.BlockTag, includeTransactionObjects: boolean];
443
+ }): Promise<viem.RpcBlock | null>;
444
+ (args: {
445
+ /**
446
+ * Checks if the target chains match the chains that were
447
+ * initially requested by the connector for the WalletConnect session.
448
+ * If there is a mismatch, this means that the chains on the connector
449
+ * are considered stale, and need to be revalidated at a later point (via
450
+ * connection).
451
+ *
452
+ * There may be a scenario where a dapp adds a chain to the
453
+ * connector later on, however, this chain will not have been approved or rejected
454
+ * by the wallet. In this case, the chain is considered stale.
455
+ *
456
+ * There are exceptions however:
457
+ * - If the wallet supports dynamic chain addition via `eth_addEthereumChain`,
458
+ * then the chain is not considered stale.
459
+ * - If the `isNewChainsStale` flag is falsy on the connector, then the chain is
460
+ * not considered stale.
461
+ *
462
+ * For the above cases, chain validation occurs dynamically when the user
463
+ * attempts to switch chain.
464
+ *
465
+ * Also check that dapp supports at least 1 chain from previously approved session.
466
+ */
467
+ method: "eth_getBlockTransactionCountByHash";
468
+ params: [hash: `0x${string}`];
469
+ }): Promise<`0x${string}`>;
470
+ (args: {
471
+ method: "eth_getBlockTransactionCountByNumber";
472
+ params: [block: `0x${string}` | viem.BlockTag];
473
+ }): Promise<`0x${string}`>;
474
+ (args: {
475
+ method: "eth_getCode";
476
+ params: [address: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
477
+ }): Promise<`0x${string}`>;
478
+ (args: {
479
+ method: "eth_getFilterChanges";
480
+ params: [filterId: `0x${string}`];
481
+ }): Promise<{
482
+ address: `0x${string}`;
483
+ blockHash: `0x${string}` | null;
484
+ blockNumber: `0x${string}` | null;
485
+ data: `0x${string}`;
486
+ logIndex: `0x${string}` | null;
487
+ transactionHash: `0x${string}` | null;
488
+ transactionIndex: `0x${string}` | null;
489
+ topics: [] | [`0x${string}`, ...`0x${string}`[]];
490
+ removed: boolean;
491
+ }[] | `0x${string}`[]>;
492
+ (args: {
493
+ method: "eth_getFilterLogs";
494
+ params: [filterId: `0x${string}`];
495
+ }): Promise<{
496
+ address: `0x${string}`;
497
+ blockHash: `0x${string}` | null;
498
+ blockNumber: `0x${string}` | null;
499
+ data: `0x${string}`;
500
+ logIndex: `0x${string}` | null;
501
+ transactionHash: `0x${string}` | null;
502
+ transactionIndex: `0x${string}` | null;
503
+ topics: [] | [`0x${string}`, ...`0x${string}`[]];
504
+ removed: boolean;
505
+ }[]>;
506
+ (args: {
507
+ method: "eth_getLogs";
508
+ params: [parameters: {
509
+ address?: `0x${string}` | `0x${string}`[] | undefined;
510
+ topics?: viem_dist_types_types.LogTopic[] | undefined;
511
+ } & ({
512
+ fromBlock?: `0x${string}` | viem.BlockTag | undefined;
513
+ toBlock?: `0x${string}` | viem.BlockTag | undefined;
514
+ blockHash?: undefined;
515
+ } | {
516
+ fromBlock?: undefined;
517
+ toBlock?: undefined;
518
+ blockHash?: `0x${string}` | undefined;
519
+ })];
520
+ }): Promise<{
521
+ address: `0x${string}`;
522
+ blockHash: `0x${string}` | null;
523
+ blockNumber: `0x${string}` | null;
524
+ data: `0x${string}`;
525
+ logIndex: `0x${string}` | null;
526
+ transactionHash: `0x${string}` | null;
527
+ transactionIndex: `0x${string}` | null;
528
+ topics: [] | [`0x${string}`, ...`0x${string}`[]];
529
+ removed: boolean;
530
+ }[]>;
531
+ (args: {
532
+ method: "eth_getStorageAt";
533
+ params: [address: `0x${string}`, index: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
534
+ }): Promise<`0x${string}`>;
535
+ (args: {
536
+ method: "eth_getTransactionByBlockHashAndIndex";
537
+ params: [hash: `0x${string}`, index: `0x${string}`];
538
+ }): Promise<viem.RpcTransaction | null>;
539
+ (args: {
540
+ method: "eth_getTransactionByBlockNumberAndIndex";
541
+ params: [block: `0x${string}` | viem.BlockTag, index: `0x${string}`];
542
+ }): Promise<viem.RpcTransaction | null>;
543
+ (args: {
544
+ method: "eth_getTransactionByHash";
545
+ params: [hash: `0x${string}`];
546
+ }): Promise<viem.RpcTransaction | null>;
547
+ (args: {
548
+ method: "eth_getTransactionCount";
549
+ params: [address: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
550
+ }): Promise<`0x${string}`>;
551
+ (args: {
552
+ method: "eth_getTransactionReceipt";
553
+ params: [hash: `0x${string}`];
554
+ }): Promise<viem.RpcTransactionReceipt | null>;
555
+ (args: {
556
+ method: "eth_getUncleByBlockHashAndIndex";
557
+ params: [hash: `0x${string}`, index: `0x${string}`];
558
+ }): Promise<viem.RpcUncle | null>;
559
+ (args: {
560
+ method: "eth_getUncleByBlockNumberAndIndex";
561
+ params: [block: `0x${string}` | viem.BlockTag, index: `0x${string}`];
562
+ }): Promise<viem.RpcUncle | null>;
563
+ (args: {
564
+ method: "eth_getUncleCountByBlockHash";
565
+ params: [hash: `0x${string}`];
566
+ }): Promise<`0x${string}`>;
567
+ (args: {
568
+ method: "eth_getUncleCountByBlockNumber";
569
+ params: [block: `0x${string}` | viem.BlockTag];
570
+ }): Promise<`0x${string}`>;
571
+ (args: {
572
+ method: "eth_newBlockFilter";
573
+ params?: undefined;
574
+ }): Promise<`0x${string}`>;
575
+ (args: {
576
+ method: "eth_newFilter";
577
+ params: [filter: {
578
+ fromBlock?: `0x${string}` | viem.BlockTag | undefined;
579
+ toBlock?: `0x${string}` | viem.BlockTag | undefined;
580
+ address?: `0x${string}` | `0x${string}`[] | undefined;
581
+ topics?: viem_dist_types_types.LogTopic[] | undefined;
582
+ }];
583
+ }): Promise<`0x${string}`>;
584
+ (args: {
585
+ method: "eth_newPendingTransactionFilter";
586
+ params?: undefined;
587
+ }): Promise<`0x${string}`>;
588
+ (args: {
589
+ method: "eth_protocolVersion";
590
+ params?: undefined;
591
+ }): Promise<string>;
592
+ (args: {
593
+ method: "eth_sendRawTransaction";
594
+ params: [signedTransaction: `0x${string}`];
595
+ }): Promise<`0x${string}`>;
596
+ (args: {
597
+ method: "eth_uninstallFilter";
598
+ params: [filterId: `0x${string}`];
599
+ }): Promise<boolean>;
600
+ } & {
601
+ (args: {
602
+ method: "eth_sendTransaction";
603
+ params: [request: viem.RpcTransactionRequest];
604
+ }): Promise<`0x${string}`>;
605
+ (args: {
606
+ method: "eth_sign";
607
+ params: [address: `0x${string}`, data: `0x${string}`];
608
+ }): Promise<`0x${string}`>;
609
+ (args: {
610
+ method: "eth_signTransaction";
611
+ params: [request: viem.RpcTransactionRequest];
612
+ }): Promise<`0x${string}`>;
613
+ (args: {
614
+ method: "eth_signTypedData_v4";
615
+ params: [address: `0x${string}`, message: string];
616
+ }): Promise<`0x${string}`>;
617
+ (args: {
618
+ method: "eth_syncing";
619
+ params?: undefined;
620
+ }): Promise<false | viem_dist_types_types_eip1193.NetworkSync>;
621
+ (args: {
622
+ method: "personal_sign";
623
+ params: [data: `0x${string}`, address: `0x${string}`];
624
+ }): Promise<`0x${string}`>;
625
+ } & {
626
+ (args: {
627
+ method: "eth_accounts";
628
+ params?: undefined;
629
+ }): Promise<`0x${string}`[]>;
630
+ (args: {
631
+ method: "eth_chainId";
632
+ params?: undefined;
633
+ }): Promise<`0x${string}`>;
634
+ (args: {
635
+ method: "eth_requestAccounts";
636
+ params?: undefined;
637
+ }): Promise<`0x${string}`[]>;
638
+ (args: {
639
+ method: "wallet_requestPermissions";
640
+ params: [permissions: {
641
+ eth_accounts: Record<string, any>;
642
+ }];
643
+ }): Promise<viem_dist_types_types_eip1193.WalletPermission[]>;
644
+ (args: {
645
+ method: "wallet_getPermissions";
646
+ params?: undefined;
647
+ }): Promise<viem_dist_types_types_eip1193.WalletPermission[]>;
648
+ (args: {
649
+ method: "wallet_addEthereumChain";
650
+ params: [chain: viem_dist_types_types_eip1193.Chain];
651
+ }): Promise<null>;
652
+ (args: {
653
+ method: "wallet_switchEthereumChain";
654
+ params: [chain: {
655
+ chainId: string;
656
+ }];
657
+ }): Promise<null>;
658
+ (args: {
659
+ method: "wallet_watchAsset";
660
+ params: viem_dist_types_types_eip1193.WatchAssetParams;
661
+ }): Promise<boolean>;
662
+ }> & ((...args: any) => Promise<any>);
663
+ type: string;
664
+ uid: string;
665
+ addChain: (args: viem.AddChainParameters) => Promise<void>;
666
+ 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, {
667
+ address: `0x${string}`;
668
+ type: "json-rpc";
669
+ }, TChainOverride>) => Promise<`0x${string}`>;
670
+ getAddresses: () => Promise<viem.GetAddressesReturnType>;
671
+ getChainId: () => Promise<number>;
672
+ getPermissions: () => Promise<viem.GetPermissionsReturnType>;
673
+ requestAddresses: () => Promise<viem.RequestAddressesReturnType>;
674
+ requestPermissions: (args: {
675
+ [x: string]: Record<string, any>;
676
+ eth_accounts: Record<string, any>;
677
+ }) => Promise<viem.RequestPermissionsReturnType>;
678
+ sendTransaction: <TChainOverride_1 extends viem.Chain<viem_dist_types_types.Formatters> | undefined>(args: viem.SendTransactionParameters<Chain, {
679
+ address: `0x${string}`;
680
+ type: "json-rpc";
681
+ }, TChainOverride_1>) => Promise<`0x${string}`>;
682
+ signMessage: (args: viem.SignMessageParameters<{
683
+ address: `0x${string}`;
684
+ type: "json-rpc";
685
+ }>) => Promise<`0x${string}`>;
686
+ signTypedData: <TTypedData extends {
687
+ [x: string]: readonly abitype_dist_abi_7aa1f183.o[];
688
+ [x: `string[${string}]`]: undefined;
689
+ [x: `function[${string}]`]: undefined;
690
+ [x: `address[${string}]`]: undefined;
691
+ [x: `bool[${string}]`]: undefined;
692
+ [x: `bytes[${string}]`]: undefined;
693
+ [x: `bytes2[${string}]`]: undefined;
694
+ [x: `bytes1[${string}]`]: undefined;
695
+ [x: `bytes3[${string}]`]: undefined;
696
+ [x: `bytes4[${string}]`]: undefined;
697
+ [x: `bytes5[${string}]`]: undefined;
698
+ [x: `bytes6[${string}]`]: undefined;
699
+ [x: `bytes7[${string}]`]: undefined;
700
+ [x: `bytes8[${string}]`]: undefined;
701
+ [x: `bytes9[${string}]`]: undefined;
702
+ [x: `bytes10[${string}]`]: undefined;
703
+ [x: `bytes11[${string}]`]: undefined;
704
+ [x: `bytes12[${string}]`]: undefined;
705
+ [x: `bytes13[${string}]`]: undefined;
706
+ [x: `bytes14[${string}]`]: undefined;
707
+ [x: `bytes15[${string}]`]: undefined;
708
+ [x: `bytes16[${string}]`]: undefined;
709
+ [x: `bytes17[${string}]`]: undefined;
710
+ [x: `bytes18[${string}]`]: undefined;
711
+ [x: `bytes19[${string}]`]: undefined;
712
+ [x: `bytes20[${string}]`]: undefined;
713
+ [x: `bytes21[${string}]`]: undefined;
714
+ [x: `bytes22[${string}]`]: undefined;
715
+ [x: `bytes23[${string}]`]: undefined;
716
+ [x: `bytes24[${string}]`]: undefined;
717
+ [x: `bytes25[${string}]`]: undefined;
718
+ [x: `bytes26[${string}]`]: undefined;
719
+ [x: `bytes27[${string}]`]: undefined;
720
+ [x: `bytes28[${string}]`]: undefined;
721
+ [x: `bytes29[${string}]`]: undefined;
722
+ [x: `bytes30[${string}]`]: undefined;
723
+ [x: `bytes31[${string}]`]: undefined;
724
+ [x: `bytes32[${string}]`]: undefined;
725
+ [x: `int[${string}]`]: undefined;
726
+ [x: `int8[${string}]`]: undefined;
727
+ [x: `int16[${string}]`]: undefined;
728
+ [x: `int24[${string}]`]: undefined;
729
+ [x: `int32[${string}]`]: undefined;
730
+ [x: `int40[${string}]`]: undefined;
731
+ [x: `int48[${string}]`]: undefined;
732
+ [x: `int56[${string}]`]: undefined;
733
+ [x: `int64[${string}]`]: undefined;
734
+ [x: `int72[${string}]`]: undefined;
735
+ [x: `int80[${string}]`]: undefined;
736
+ [x: `int88[${string}]`]: undefined;
737
+ [x: `int96[${string}]`]: undefined;
738
+ [x: `int104[${string}]`]: undefined;
739
+ [x: `int112[${string}]`]: undefined;
740
+ [x: `int120[${string}]`]: undefined;
741
+ [x: `int128[${string}]`]: undefined;
742
+ [x: `int136[${string}]`]: undefined;
743
+ [x: `int144[${string}]`]: undefined;
744
+ [x: `int152[${string}]`]: undefined;
745
+ [x: `int160[${string}]`]: undefined;
746
+ [x: `int168[${string}]`]: undefined;
747
+ [x: `int176[${string}]`]: undefined;
748
+ [x: `int184[${string}]`]: undefined;
749
+ [x: `int192[${string}]`]: undefined;
750
+ [x: `int200[${string}]`]: undefined;
751
+ [x: `int208[${string}]`]: undefined;
752
+ [x: `int216[${string}]`]: undefined;
753
+ [x: `int224[${string}]`]: undefined;
754
+ [x: `int232[${string}]`]: undefined;
755
+ [x: `int240[${string}]`]: undefined;
756
+ [x: `int248[${string}]`]: undefined;
757
+ [x: `int256[${string}]`]: undefined;
758
+ [x: `uint[${string}]`]: undefined;
759
+ [x: `uint8[${string}]`]: undefined;
760
+ [x: `uint16[${string}]`]: undefined;
761
+ [x: `uint24[${string}]`]: undefined;
762
+ [x: `uint32[${string}]`]: undefined;
763
+ [x: `uint40[${string}]`]: undefined;
764
+ [x: `uint48[${string}]`]: undefined;
765
+ [x: `uint56[${string}]`]: undefined;
766
+ [x: `uint64[${string}]`]: undefined;
767
+ [x: `uint72[${string}]`]: undefined;
768
+ [x: `uint80[${string}]`]: undefined;
769
+ [x: `uint88[${string}]`]: undefined;
770
+ [x: `uint96[${string}]`]: undefined;
771
+ [x: `uint104[${string}]`]: undefined;
772
+ [x: `uint112[${string}]`]: undefined;
773
+ [x: `uint120[${string}]`]: undefined;
774
+ [x: `uint128[${string}]`]: undefined;
775
+ [x: `uint136[${string}]`]: undefined;
776
+ [x: `uint144[${string}]`]: undefined;
777
+ [x: `uint152[${string}]`]: undefined;
778
+ [x: `uint160[${string}]`]: undefined;
779
+ [x: `uint168[${string}]`]: undefined;
780
+ [x: `uint176[${string}]`]: undefined;
781
+ [x: `uint184[${string}]`]: undefined;
782
+ [x: `uint192[${string}]`]: undefined;
783
+ [x: `uint200[${string}]`]: undefined;
784
+ [x: `uint208[${string}]`]: undefined;
785
+ [x: `uint216[${string}]`]: undefined;
786
+ [x: `uint224[${string}]`]: undefined;
787
+ [x: `uint232[${string}]`]: undefined;
788
+ [x: `uint240[${string}]`]: undefined;
789
+ [x: `uint248[${string}]`]: undefined;
790
+ [x: `uint256[${string}]`]: undefined;
791
+ string?: undefined;
792
+ address?: undefined;
793
+ bool?: undefined;
794
+ bytes?: undefined;
795
+ bytes2?: undefined;
796
+ bytes1?: undefined;
797
+ bytes3?: undefined;
798
+ bytes4?: undefined;
799
+ bytes5?: undefined;
800
+ bytes6?: undefined;
801
+ bytes7?: undefined;
802
+ bytes8?: undefined;
803
+ bytes9?: undefined;
804
+ bytes10?: undefined;
805
+ bytes11?: undefined;
806
+ bytes12?: undefined;
807
+ bytes13?: undefined;
808
+ bytes14?: undefined;
809
+ bytes15?: undefined;
810
+ bytes16?: undefined;
811
+ bytes17?: undefined;
812
+ bytes18?: undefined;
813
+ bytes19?: undefined;
814
+ bytes20?: undefined;
815
+ bytes21?: undefined;
816
+ bytes22?: undefined;
817
+ bytes23?: undefined;
818
+ bytes24?: undefined;
819
+ bytes25?: undefined;
820
+ bytes26?: undefined;
821
+ bytes27?: undefined;
822
+ bytes28?: undefined;
823
+ bytes29?: undefined;
824
+ bytes30?: undefined;
825
+ bytes31?: undefined;
826
+ bytes32?: undefined;
827
+ int8?: undefined;
828
+ int16?: undefined;
829
+ int24?: undefined;
830
+ int32?: undefined;
831
+ int40?: undefined;
832
+ int48?: undefined;
833
+ int56?: undefined;
834
+ int64?: undefined;
835
+ int72?: undefined;
836
+ int80?: undefined;
837
+ int88?: undefined;
838
+ int96?: undefined;
839
+ int104?: undefined;
840
+ int112?: undefined;
841
+ int120?: undefined;
842
+ int128?: undefined;
843
+ int136?: undefined;
844
+ int144?: undefined;
845
+ int152?: undefined;
846
+ int160?: undefined;
847
+ int168?: undefined;
848
+ int176?: undefined;
849
+ int184?: undefined;
850
+ int192?: undefined;
851
+ int200?: undefined;
852
+ int208?: undefined;
853
+ int216?: undefined;
854
+ int224?: undefined;
855
+ int232?: undefined;
856
+ int240?: undefined;
857
+ int248?: undefined;
858
+ int256?: undefined;
859
+ uint8?: undefined;
860
+ uint16?: undefined;
861
+ uint24?: undefined;
862
+ uint32?: undefined;
863
+ uint40?: undefined;
864
+ uint48?: undefined;
865
+ uint56?: undefined;
866
+ uint64?: undefined;
867
+ uint72?: undefined;
868
+ uint80?: undefined;
869
+ uint88?: undefined;
870
+ uint96?: undefined;
871
+ uint104?: undefined;
872
+ uint112?: undefined;
873
+ uint120?: undefined;
874
+ uint128?: undefined;
875
+ uint136?: undefined;
876
+ uint144?: undefined;
877
+ uint152?: undefined;
878
+ uint160?: undefined;
879
+ uint168?: undefined;
880
+ uint176?: undefined;
881
+ uint184?: undefined;
882
+ uint192?: undefined;
883
+ uint200?: undefined;
884
+ uint208?: undefined;
885
+ uint216?: undefined;
886
+ uint224?: undefined;
887
+ uint232?: undefined;
888
+ uint240?: undefined;
889
+ uint248?: undefined;
890
+ uint256?: undefined;
891
+ } | {
892
+ [key: string]: unknown;
893
+ }, TPrimaryType extends string>(args: viem.SignTypedDataParameters<TTypedData, TPrimaryType, {
894
+ address: `0x${string}`;
895
+ type: "json-rpc";
896
+ }>) => Promise<`0x${string}`>;
897
+ switchChain: (args: viem.SwitchChainParameters) => Promise<void>;
898
+ watchAsset: (args: viem_dist_types_types_eip1193.WatchAssetParams) => Promise<boolean>;
899
+ 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, {
900
+ address: `0x${string}`;
901
+ type: "json-rpc";
902
+ }, TChainOverride_2>) => Promise<`0x${string}`>;
903
+ account: {
904
+ address: `0x${string}`;
905
+ type: "json-rpc";
906
+ };
907
+ }>;
908
+ isAuthorized(): Promise<boolean>;
909
+ switchChain(chainId: number): Promise<Chain>;
910
+ protected onAccountsChanged: (accounts: string[]) => void;
911
+ protected onChainChanged: (chainId: number | string) => void;
912
+ protected onDisconnect: () => void;
913
+ protected onDisplayUri: (uri: string) => void;
914
+ protected onConnect: () => void;
915
+ }
916
+
917
+ export { WalletConnectConnector };