@wagmi/connectors 2.1.1 → 2.2.0

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/safe.d.ts CHANGED
@@ -1,11 +1,8 @@
1
- import * as abitype from 'abitype';
2
- import * as viem_dist_types_types_eip1193 from 'viem/dist/types/types/eip1193';
3
- import * as viem_dist_types_types_misc from 'viem/dist/types/types/misc';
4
1
  import * as viem from 'viem';
5
2
  import { SafeAppProvider } from '@safe-global/safe-apps-provider';
6
3
  import { Opts } from '@safe-global/safe-apps-sdk';
7
4
  import { Chain } from '@wagmi/chains';
8
- import { C as Connector } from './base-269cc543.js';
5
+ import { C as Connector } from './base-1553d802.js';
9
6
  import 'eventemitter3';
10
7
 
11
8
  type SafeConnectorProvider = SafeAppProvider;
@@ -51,466 +48,12 @@ declare class SafeConnector extends Connector<SafeConnectorProvider, SafeConnect
51
48
  key: string;
52
49
  name: string;
53
50
  pollingInterval: number;
54
- request: {
55
- (args: {
56
- method: "web3_clientVersion";
57
- params?: undefined;
58
- }): Promise<string>;
59
- (args: {
60
- method: "web3_sha3";
61
- params: [data: `0x${string}`];
62
- }): Promise<string>;
63
- (args: {
64
- method: "net_listening";
65
- params?: undefined;
66
- }): Promise<boolean>;
67
- (args: {
68
- method: "net_peerCount";
69
- params?: undefined;
70
- }): Promise<`0x${string}`>;
71
- (args: {
72
- method: "net_version";
73
- params?: undefined;
74
- }): Promise<`0x${string}`>;
75
- (args: {
76
- method: "eth_blockNumber";
77
- params?: undefined;
78
- }): Promise<`0x${string}`>;
79
- (args: {
80
- method: "eth_call";
81
- params: [request: Partial<viem.RpcTransactionRequest>, block?: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier | undefined];
82
- }): Promise<`0x${string}`>;
83
- (args: {
84
- method: "eth_chainId";
85
- params?: undefined;
86
- }): Promise<`0x${string}`>;
87
- (args: {
88
- method: "eth_coinbase";
89
- params?: undefined;
90
- }): Promise<`0x${string}`>;
91
- (args: {
92
- method: "eth_estimateGas";
93
- params: [parameters: viem.RpcTransactionRequest, block?: `0x${string}` | viem.BlockTag | undefined];
94
- }): Promise<`0x${string}`>;
95
- (args: {
96
- method: "eth_feeHistory";
97
- params: [blockCount: `0x${string}`, newestBlock: `0x${string}` | viem.BlockTag, rewardPercentiles: number[] | undefined];
98
- }): Promise<viem.RpcFeeHistory>;
99
- (args: {
100
- method: "eth_gasPrice";
101
- params?: undefined;
102
- }): Promise<`0x${string}`>;
103
- (args: {
104
- method: "eth_getBalance";
105
- params: [address: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
106
- }): Promise<`0x${string}`>;
107
- (args: {
108
- method: "eth_getBlockByHash";
109
- params: [hash: `0x${string}`, includeTransactionObjects: boolean];
110
- }): Promise<viem.RpcBlock | null>;
111
- (args: {
112
- method: "eth_getBlockByNumber";
113
- params: [block: `0x${string}` | viem.BlockTag, includeTransactionObjects: boolean];
114
- }): Promise<viem.RpcBlock | null>;
115
- (args: {
116
- method: "eth_getBlockTransactionCountByHash";
117
- params: [hash: `0x${string}`];
118
- }): Promise<`0x${string}`>;
119
- (args: {
120
- method: "eth_getBlockTransactionCountByNumber";
121
- params: [block: `0x${string}` | viem.BlockTag];
122
- }): Promise<`0x${string}`>;
123
- (args: {
124
- method: "eth_getCode";
125
- params: [address: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
126
- }): Promise<`0x${string}`>;
127
- (args: {
128
- method: "eth_getFilterChanges";
129
- params: [filterId: `0x${string}`];
130
- }): Promise<`0x${string}`[] | viem.RpcLog[]>;
131
- (args: {
132
- method: "eth_getFilterLogs";
133
- params: [filterId: `0x${string}`];
134
- }): Promise<viem.RpcLog[]>;
135
- (args: {
136
- method: "eth_getLogs";
137
- params: [parameters: {
138
- address?: `0x${string}` | `0x${string}`[] | undefined;
139
- topics?: viem_dist_types_types_misc.LogTopic[] | undefined;
140
- } & ({
141
- fromBlock?: `0x${string}` | viem.BlockTag | undefined;
142
- toBlock?: `0x${string}` | viem.BlockTag | undefined;
143
- blockHash?: undefined;
144
- } | {
145
- fromBlock?: undefined;
146
- toBlock?: undefined;
147
- blockHash?: `0x${string}` | undefined;
148
- })];
149
- }): Promise<viem.RpcLog[]>;
150
- (args: {
151
- method: "eth_getStorageAt";
152
- params: [address: `0x${string}`, index: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
153
- }): Promise<`0x${string}`>;
154
- (args: {
155
- method: "eth_getTransactionByBlockHashAndIndex";
156
- params: [hash: `0x${string}`, index: `0x${string}`];
157
- }): Promise<viem.RpcTransaction | null>;
158
- (args: {
159
- method: "eth_getTransactionByBlockNumberAndIndex";
160
- params: [block: `0x${string}` | viem.BlockTag, index: `0x${string}`];
161
- }): Promise<viem.RpcTransaction | null>;
162
- (args: {
163
- method: "eth_getTransactionByHash";
164
- params: [hash: `0x${string}`];
165
- }): Promise<viem.RpcTransaction | null>;
166
- (args: {
167
- method: "eth_getTransactionCount";
168
- params: [address: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
169
- }): Promise<`0x${string}`>;
170
- (args: {
171
- method: "eth_getTransactionReceipt";
172
- params: [hash: `0x${string}`];
173
- }): Promise<viem.RpcTransactionReceipt | null>;
174
- (args: {
175
- method: "eth_getUncleByBlockHashAndIndex";
176
- params: [hash: `0x${string}`, index: `0x${string}`];
177
- }): Promise<viem.RpcUncle | null>;
178
- (args: {
179
- method: "eth_getUncleByBlockNumberAndIndex";
180
- params: [block: `0x${string}` | viem.BlockTag, index: `0x${string}`];
181
- }): Promise<viem.RpcUncle | null>;
182
- (args: {
183
- method: "eth_getUncleCountByBlockHash";
184
- params: [hash: `0x${string}`];
185
- }): Promise<`0x${string}`>;
186
- (args: {
187
- method: "eth_getUncleCountByBlockNumber";
188
- params: [block: `0x${string}` | viem.BlockTag];
189
- }): Promise<`0x${string}`>;
190
- (args: {
191
- method: "eth_newBlockFilter";
192
- params?: undefined;
193
- }): Promise<`0x${string}`>;
194
- (args: {
195
- method: "eth_newFilter";
196
- params: [filter: {
197
- fromBlock?: `0x${string}` | viem.BlockTag | undefined;
198
- toBlock?: `0x${string}` | viem.BlockTag | undefined;
199
- address?: `0x${string}` | `0x${string}`[] | undefined;
200
- topics?: viem_dist_types_types_misc.LogTopic[] | undefined;
201
- }];
202
- }): Promise<`0x${string}`>;
203
- (args: {
204
- method: "eth_newPendingTransactionFilter";
205
- params?: undefined;
206
- }): Promise<`0x${string}`>;
207
- (args: {
208
- method: "eth_protocolVersion";
209
- params?: undefined;
210
- }): Promise<string>;
211
- (args: {
212
- method: "eth_sendRawTransaction";
213
- params: [signedTransaction: `0x${string}`];
214
- }): Promise<`0x${string}`>;
215
- (args: {
216
- method: "eth_uninstallFilter";
217
- params: [filterId: `0x${string}`];
218
- }): Promise<boolean>;
219
- } & {
220
- (args: {
221
- method: "eth_sendTransaction";
222
- params: [request: viem.RpcTransactionRequest];
223
- }): Promise<`0x${string}`>;
224
- (args: {
225
- method: "eth_sign";
226
- params: [address: `0x${string}`, data: `0x${string}`];
227
- }): Promise<`0x${string}`>;
228
- (args: {
229
- method: "eth_signTransaction";
230
- params: [request: viem.RpcTransactionRequest];
231
- }): Promise<`0x${string}`>;
232
- (args: {
233
- method: "eth_signTypedData_v4";
234
- params: [address: `0x${string}`, message: string];
235
- }): Promise<`0x${string}`>;
236
- (args: {
237
- method: "eth_syncing";
238
- params?: undefined;
239
- }): Promise<false | viem_dist_types_types_eip1193.NetworkSync>;
240
- (args: {
241
- method: "personal_sign";
242
- params: [data: `0x${string}`, address: `0x${string}`];
243
- }): Promise<`0x${string}`>;
244
- } & {
245
- (args: {
246
- method: "eth_accounts";
247
- params?: undefined;
248
- }): Promise<`0x${string}`[]>;
249
- (args: {
250
- method: "eth_chainId";
251
- params?: undefined;
252
- }): Promise<`0x${string}`>;
253
- (args: {
254
- method: "eth_requestAccounts";
255
- params?: undefined;
256
- }): Promise<`0x${string}`[]>;
257
- (args: {
258
- method: "wallet_requestPermissions";
259
- params: [permissions: {
260
- eth_accounts: Record<string, any>;
261
- }];
262
- }): Promise<viem_dist_types_types_eip1193.WalletPermission[]>;
263
- (args: {
264
- method: "wallet_getPermissions";
265
- params?: undefined;
266
- }): Promise<viem_dist_types_types_eip1193.WalletPermission[]>;
267
- (args: {
268
- method: "wallet_addEthereumChain";
269
- params: [chain: viem_dist_types_types_eip1193.Chain];
270
- }): Promise<null>;
271
- (args: {
272
- method: "wallet_switchEthereumChain";
273
- params: [chain: {
274
- chainId: string;
275
- }];
276
- }): Promise<null>;
277
- (args: {
278
- method: "wallet_watchAsset";
279
- params: viem_dist_types_types_eip1193.WatchAssetParams;
280
- }): Promise<boolean>;
281
- };
282
- transport: viem.TransportConfig<"custom", {
283
- (args: {
284
- method: "web3_clientVersion";
285
- params?: undefined;
286
- }): Promise<string>;
287
- (args: {
288
- method: "web3_sha3";
289
- params: [data: `0x${string}`];
290
- }): Promise<string>;
291
- (args: {
292
- method: "net_listening";
293
- params?: undefined;
294
- }): Promise<boolean>;
295
- (args: {
296
- method: "net_peerCount";
297
- params?: undefined;
298
- }): Promise<`0x${string}`>;
299
- (args: {
300
- method: "net_version";
301
- params?: undefined;
302
- }): Promise<`0x${string}`>;
303
- (args: {
304
- method: "eth_blockNumber";
305
- params?: undefined;
306
- }): Promise<`0x${string}`>;
307
- (args: {
308
- method: "eth_call";
309
- params: [request: Partial<viem.RpcTransactionRequest>, block?: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier | undefined];
310
- }): Promise<`0x${string}`>;
311
- (args: {
312
- method: "eth_chainId";
313
- params?: undefined;
314
- }): Promise<`0x${string}`>;
315
- (args: {
316
- method: "eth_coinbase";
317
- params?: undefined;
318
- }): Promise<`0x${string}`>;
319
- (args: {
320
- method: "eth_estimateGas";
321
- params: [parameters: viem.RpcTransactionRequest, block?: `0x${string}` | viem.BlockTag | undefined];
322
- }): Promise<`0x${string}`>;
323
- (args: {
324
- method: "eth_feeHistory";
325
- params: [blockCount: `0x${string}`, newestBlock: `0x${string}` | viem.BlockTag, rewardPercentiles: number[] | undefined];
326
- }): Promise<viem.RpcFeeHistory>;
327
- (args: {
328
- method: "eth_gasPrice";
329
- params?: undefined;
330
- }): Promise<`0x${string}`>;
331
- (args: {
332
- method: "eth_getBalance";
333
- params: [address: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
334
- }): Promise<`0x${string}`>;
335
- (args: {
336
- method: "eth_getBlockByHash";
337
- params: [hash: `0x${string}`, includeTransactionObjects: boolean];
338
- }): Promise<viem.RpcBlock | null>;
339
- (args: {
340
- method: "eth_getBlockByNumber";
341
- params: [block: `0x${string}` | viem.BlockTag, includeTransactionObjects: boolean];
342
- }): Promise<viem.RpcBlock | null>;
343
- (args: {
344
- method: "eth_getBlockTransactionCountByHash";
345
- params: [hash: `0x${string}`];
346
- }): Promise<`0x${string}`>;
347
- (args: {
348
- method: "eth_getBlockTransactionCountByNumber";
349
- params: [block: `0x${string}` | viem.BlockTag];
350
- }): Promise<`0x${string}`>;
351
- (args: {
352
- method: "eth_getCode";
353
- params: [address: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
354
- }): Promise<`0x${string}`>;
355
- (args: {
356
- method: "eth_getFilterChanges";
357
- params: [filterId: `0x${string}`];
358
- }): Promise<`0x${string}`[] | viem.RpcLog[]>;
359
- (args: {
360
- method: "eth_getFilterLogs";
361
- params: [filterId: `0x${string}`];
362
- }): Promise<viem.RpcLog[]>;
363
- (args: {
364
- method: "eth_getLogs";
365
- params: [parameters: {
366
- address?: `0x${string}` | `0x${string}`[] | undefined;
367
- topics?: viem_dist_types_types_misc.LogTopic[] | undefined;
368
- } & ({
369
- fromBlock?: `0x${string}` | viem.BlockTag | undefined;
370
- toBlock?: `0x${string}` | viem.BlockTag | undefined;
371
- blockHash?: undefined;
372
- } | {
373
- fromBlock?: undefined;
374
- toBlock?: undefined;
375
- blockHash?: `0x${string}` | undefined;
376
- })];
377
- }): Promise<viem.RpcLog[]>;
378
- (args: {
379
- method: "eth_getStorageAt";
380
- params: [address: `0x${string}`, index: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
381
- }): Promise<`0x${string}`>;
382
- (args: {
383
- method: "eth_getTransactionByBlockHashAndIndex";
384
- params: [hash: `0x${string}`, index: `0x${string}`];
385
- }): Promise<viem.RpcTransaction | null>;
386
- (args: {
387
- method: "eth_getTransactionByBlockNumberAndIndex";
388
- params: [block: `0x${string}` | viem.BlockTag, index: `0x${string}`];
389
- }): Promise<viem.RpcTransaction | null>;
390
- (args: {
391
- method: "eth_getTransactionByHash";
392
- params: [hash: `0x${string}`];
393
- }): Promise<viem.RpcTransaction | null>;
394
- (args: {
395
- method: "eth_getTransactionCount";
396
- params: [address: `0x${string}`, block: `0x${string}` | viem.BlockTag | viem.RpcBlockIdentifier];
397
- }): Promise<`0x${string}`>;
398
- (args: {
399
- method: "eth_getTransactionReceipt";
400
- params: [hash: `0x${string}`];
401
- }): Promise<viem.RpcTransactionReceipt | null>;
402
- (args: {
403
- method: "eth_getUncleByBlockHashAndIndex";
404
- params: [hash: `0x${string}`, index: `0x${string}`];
405
- }): Promise<viem.RpcUncle | null>;
406
- (args: {
407
- method: "eth_getUncleByBlockNumberAndIndex";
408
- params: [block: `0x${string}` | viem.BlockTag, index: `0x${string}`];
409
- }): Promise<viem.RpcUncle | null>;
410
- (args: {
411
- method: "eth_getUncleCountByBlockHash";
412
- params: [hash: `0x${string}`];
413
- }): Promise<`0x${string}`>;
414
- (args: {
415
- method: "eth_getUncleCountByBlockNumber";
416
- params: [block: `0x${string}` | viem.BlockTag];
417
- }): Promise<`0x${string}`>;
418
- (args: {
419
- method: "eth_newBlockFilter";
420
- params?: undefined;
421
- }): Promise<`0x${string}`>;
422
- (args: {
423
- method: "eth_newFilter";
424
- params: [filter: {
425
- fromBlock?: `0x${string}` | viem.BlockTag | undefined;
426
- toBlock?: `0x${string}` | viem.BlockTag | undefined;
427
- address?: `0x${string}` | `0x${string}`[] | undefined;
428
- topics?: viem_dist_types_types_misc.LogTopic[] | undefined;
429
- }];
430
- }): Promise<`0x${string}`>;
431
- (args: {
432
- method: "eth_newPendingTransactionFilter";
433
- params?: undefined;
434
- }): Promise<`0x${string}`>;
435
- (args: {
436
- method: "eth_protocolVersion";
437
- params?: undefined;
438
- }): Promise<string>;
439
- (args: {
440
- method: "eth_sendRawTransaction";
441
- params: [signedTransaction: `0x${string}`];
442
- }): Promise<`0x${string}`>;
443
- (args: {
444
- method: "eth_uninstallFilter";
445
- params: [filterId: `0x${string}`];
446
- }): Promise<boolean>;
447
- } & {
448
- (args: {
449
- method: "eth_sendTransaction";
450
- params: [request: viem.RpcTransactionRequest];
451
- }): Promise<`0x${string}`>;
452
- (args: {
453
- method: "eth_sign";
454
- params: [address: `0x${string}`, data: `0x${string}`];
455
- }): Promise<`0x${string}`>;
456
- (args: {
457
- method: "eth_signTransaction";
458
- params: [request: viem.RpcTransactionRequest];
459
- }): Promise<`0x${string}`>;
460
- (args: {
461
- method: "eth_signTypedData_v4";
462
- params: [address: `0x${string}`, message: string];
463
- }): Promise<`0x${string}`>;
464
- (args: {
465
- method: "eth_syncing";
466
- params?: undefined;
467
- }): Promise<false | viem_dist_types_types_eip1193.NetworkSync>;
468
- (args: {
469
- method: "personal_sign";
470
- params: [data: `0x${string}`, address: `0x${string}`];
471
- }): Promise<`0x${string}`>;
472
- } & {
473
- (args: {
474
- method: "eth_accounts";
475
- params?: undefined;
476
- }): Promise<`0x${string}`[]>;
477
- (args: {
478
- method: "eth_chainId";
479
- params?: undefined;
480
- }): Promise<`0x${string}`>;
481
- (args: {
482
- method: "eth_requestAccounts";
483
- params?: undefined;
484
- }): Promise<`0x${string}`[]>;
485
- (args: {
486
- method: "wallet_requestPermissions";
487
- params: [permissions: {
488
- eth_accounts: Record<string, any>;
489
- }];
490
- }): Promise<viem_dist_types_types_eip1193.WalletPermission[]>;
491
- (args: {
492
- method: "wallet_getPermissions";
493
- params?: undefined;
494
- }): Promise<viem_dist_types_types_eip1193.WalletPermission[]>;
495
- (args: {
496
- method: "wallet_addEthereumChain";
497
- params: [chain: viem_dist_types_types_eip1193.Chain];
498
- }): Promise<null>;
499
- (args: {
500
- method: "wallet_switchEthereumChain";
501
- params: [chain: {
502
- chainId: string;
503
- }];
504
- }): Promise<null>;
505
- (args: {
506
- method: "wallet_watchAsset";
507
- params: viem_dist_types_types_eip1193.WatchAssetParams;
508
- }): Promise<boolean>;
509
- }> & ((...args: any) => Promise<any>);
51
+ request: viem.EIP1193RequestFn<viem.WalletRpcSchema>;
52
+ transport: viem.TransportConfig<"custom", viem.EIP1193RequestFn> & ((...args: any) => Promise<any>);
510
53
  type: string;
511
54
  uid: string;
512
55
  addChain: (args: viem.AddChainParameters) => Promise<void>;
513
- deployContract: <TAbi extends readonly unknown[] | abitype.Abi, TChainOverride extends viem.Chain | undefined>(args: viem.DeployContractParameters<TAbi, Chain, {
56
+ deployContract: <TAbi extends readonly unknown[] | viem.Abi, TChainOverride extends viem.Chain | undefined>(args: viem.DeployContractParameters<TAbi, Chain, {
514
57
  address: `0x${string}`;
515
58
  type: "json-rpc";
516
59
  }, TChainOverride>) => Promise<`0x${string}`>;
@@ -531,17 +74,17 @@ declare class SafeConnector extends Connector<SafeConnectorProvider, SafeConnect
531
74
  type: "json-rpc";
532
75
  }>) => Promise<`0x${string}`>;
533
76
  signTypedData: <TTypedData extends {
534
- [x: string]: readonly abitype.TypedDataParameter[];
77
+ [x: string]: readonly viem.TypedDataParameter[];
535
78
  [x: `string[${string}]`]: undefined;
536
79
  [x: `function[${string}]`]: undefined;
537
80
  [x: `address[${string}]`]: undefined;
538
81
  [x: `bool[${string}]`]: undefined;
539
82
  [x: `bytes[${string}]`]: undefined;
83
+ [x: `bytes16[${string}]`]: undefined;
540
84
  [x: `bytes5[${string}]`]: undefined;
541
85
  [x: `bytes1[${string}]`]: undefined;
542
86
  [x: `bytes18[${string}]`]: undefined;
543
87
  [x: `bytes2[${string}]`]: undefined;
544
- [x: `bytes16[${string}]`]: undefined;
545
88
  [x: `bytes10[${string}]`]: undefined;
546
89
  [x: `bytes3[${string}]`]: undefined;
547
90
  [x: `bytes4[${string}]`]: undefined;
@@ -639,11 +182,11 @@ declare class SafeConnector extends Connector<SafeConnectorProvider, SafeConnect
639
182
  address?: undefined;
640
183
  bool?: undefined;
641
184
  bytes?: undefined;
185
+ bytes16?: undefined;
642
186
  bytes5?: undefined;
643
187
  bytes1?: undefined;
644
188
  bytes18?: undefined;
645
189
  bytes2?: undefined;
646
- bytes16?: undefined;
647
190
  bytes10?: undefined;
648
191
  bytes3?: undefined;
649
192
  bytes4?: undefined;
@@ -742,8 +285,8 @@ declare class SafeConnector extends Connector<SafeConnectorProvider, SafeConnect
742
285
  type: "json-rpc";
743
286
  }>) => Promise<`0x${string}`>;
744
287
  switchChain: (args: viem.SwitchChainParameters) => Promise<void>;
745
- watchAsset: (args: viem_dist_types_types_eip1193.WatchAssetParams) => Promise<boolean>;
746
- writeContract: <TAbi_1 extends readonly unknown[] | abitype.Abi, TFunctionName extends string, TChainOverride_2 extends viem.Chain | undefined>(args: viem.WriteContractParameters<TAbi_1, TFunctionName, Chain, {
288
+ watchAsset: (args: viem.WatchAssetParams) => Promise<boolean>;
289
+ writeContract: <TAbi_1 extends readonly unknown[] | viem.Abi, TFunctionName extends string, TChainOverride_2 extends viem.Chain | undefined>(args: viem.WriteContractParameters<TAbi_1, TFunctionName, Chain, {
747
290
  address: `0x${string}`;
748
291
  type: "json-rpc";
749
292
  }, TChainOverride_2>) => Promise<`0x${string}`>;