@wagmi/connectors 4.0.0-alpha.3 → 4.0.0-alpha.4

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,348 +0,0 @@
1
- import type { Evaluate } from '@wagmi/core/internal';
2
- import { type EIP1193Provider, type ProviderConnectInfo } from 'viem';
3
- export type InjectedParameters = {
4
- /**
5
- * MetaMask and other injected providers do not support programmatic disconnect.
6
- * 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.
7
- * @default true
8
- */
9
- shimDisconnect?: boolean | undefined;
10
- unstable_shimAsyncInject?: boolean | number | undefined;
11
- /**
12
- * [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193) Ethereum Provider to target
13
- */
14
- target?: TargetId | (TargetMap[TargetId] & {
15
- id: string;
16
- }) | (() => (TargetMap[TargetId] & {
17
- id: string;
18
- }) | undefined) | undefined;
19
- };
20
- export declare function injected(parameters?: InjectedParameters): import("@wagmi/core").CreateConnectorFn<{
21
- on: <TEvent extends keyof import("viem").EIP1193EventMap>(event: TEvent, listener: import("viem").EIP1193EventMap[TEvent]) => void;
22
- removeListener: <TEvent_1 extends keyof import("viem").EIP1193EventMap>(event: TEvent_1, listener: import("viem").EIP1193EventMap[TEvent_1]) => void;
23
- request: import("viem").EIP1193RequestFn<[{
24
- Method: "web3_clientVersion";
25
- Parameters?: undefined;
26
- ReturnType: string;
27
- }, {
28
- Method: "web3_sha3";
29
- Parameters: [data: `0x${string}`];
30
- ReturnType: string;
31
- }, {
32
- Method: "net_listening";
33
- Parameters?: undefined;
34
- ReturnType: boolean;
35
- }, {
36
- Method: "net_peerCount";
37
- Parameters?: undefined;
38
- ReturnType: `0x${string}`;
39
- }, {
40
- Method: "net_version";
41
- Parameters?: undefined;
42
- ReturnType: `0x${string}`;
43
- }, {
44
- Method: "eth_blockNumber";
45
- Parameters?: undefined;
46
- ReturnType: `0x${string}`;
47
- }, {
48
- Method: "eth_call";
49
- Parameters: [transaction: Partial<import("viem").RpcTransactionRequest>] | [transaction: Partial<import("viem").RpcTransactionRequest>, block: `0x${string}` | import("viem").BlockTag | import("viem").RpcBlockIdentifier];
50
- ReturnType: `0x${string}`;
51
- }, {
52
- Method: "eth_chainId";
53
- Parameters?: undefined;
54
- ReturnType: `0x${string}`;
55
- }, {
56
- Method: "eth_coinbase";
57
- Parameters?: undefined;
58
- ReturnType: `0x${string}`;
59
- }, {
60
- Method: "eth_estimateGas";
61
- Parameters: [transaction: import("viem").RpcTransactionRequest] | [transaction: import("viem").RpcTransactionRequest, block: `0x${string}` | import("viem").BlockTag];
62
- ReturnType: `0x${string}`;
63
- }, {
64
- Method: "eth_feeHistory";
65
- Parameters: [blockCount: `0x${string}`, newestBlock: `0x${string}` | import("viem").BlockTag, rewardPercentiles: number[] | undefined];
66
- ReturnType: import("viem").RpcFeeHistory;
67
- }, {
68
- Method: "eth_gasPrice";
69
- Parameters?: undefined;
70
- ReturnType: `0x${string}`;
71
- }, {
72
- Method: "eth_getBalance";
73
- Parameters: [address: `0x${string}`, block: `0x${string}` | import("viem").BlockTag | import("viem").RpcBlockIdentifier];
74
- ReturnType: `0x${string}`;
75
- }, {
76
- Method: "eth_getBlockByHash";
77
- Parameters: [hash: `0x${string}`, includeTransactionObjects: boolean];
78
- ReturnType: import("viem").RpcBlock | null;
79
- }, {
80
- Method: "eth_getBlockByNumber";
81
- Parameters: [block: `0x${string}` | import("viem").BlockTag, includeTransactionObjects: boolean];
82
- ReturnType: import("viem").RpcBlock | null;
83
- }, {
84
- Method: "eth_getBlockTransactionCountByHash";
85
- Parameters: [hash: `0x${string}`];
86
- ReturnType: `0x${string}`;
87
- }, {
88
- Method: "eth_getBlockTransactionCountByNumber";
89
- Parameters: [block: `0x${string}` | import("viem").BlockTag];
90
- ReturnType: `0x${string}`;
91
- }, {
92
- Method: "eth_getCode";
93
- Parameters: [address: `0x${string}`, block: `0x${string}` | import("viem").BlockTag | import("viem").RpcBlockIdentifier];
94
- ReturnType: `0x${string}`;
95
- }, {
96
- Method: "eth_getFilterChanges";
97
- Parameters: [filterId: `0x${string}`];
98
- ReturnType: `0x${string}`[] | import("viem").RpcLog[];
99
- }, {
100
- Method: "eth_getFilterLogs";
101
- Parameters: [filterId: `0x${string}`];
102
- ReturnType: import("viem").RpcLog[];
103
- }, {
104
- Method: "eth_getLogs";
105
- Parameters: [{
106
- address?: `0x${string}` | `0x${string}`[] | undefined;
107
- topics?: import("viem").LogTopic[] | undefined;
108
- } & ({
109
- fromBlock?: `0x${string}` | import("viem").BlockTag | undefined;
110
- toBlock?: `0x${string}` | import("viem").BlockTag | undefined;
111
- blockHash?: undefined;
112
- } | {
113
- fromBlock?: undefined;
114
- toBlock?: undefined;
115
- blockHash?: `0x${string}` | undefined;
116
- })];
117
- ReturnType: import("viem").RpcLog[];
118
- }, {
119
- Method: "eth_getStorageAt";
120
- Parameters: [address: `0x${string}`, index: `0x${string}`, block: `0x${string}` | import("viem").BlockTag | import("viem").RpcBlockIdentifier];
121
- ReturnType: `0x${string}`;
122
- }, {
123
- Method: "eth_getTransactionByBlockHashAndIndex";
124
- Parameters: [hash: `0x${string}`, index: `0x${string}`];
125
- ReturnType: import("viem").RpcTransaction | null;
126
- }, {
127
- Method: "eth_getTransactionByBlockNumberAndIndex";
128
- Parameters: [block: `0x${string}` | import("viem").BlockTag, index: `0x${string}`];
129
- ReturnType: import("viem").RpcTransaction | null;
130
- }, {
131
- Method: "eth_getTransactionByHash";
132
- Parameters: [hash: `0x${string}`];
133
- ReturnType: import("viem").RpcTransaction | null;
134
- }, {
135
- Method: "eth_getTransactionCount";
136
- Parameters: [address: `0x${string}`, block: `0x${string}` | import("viem").BlockTag | import("viem").RpcBlockIdentifier];
137
- ReturnType: `0x${string}`;
138
- }, {
139
- Method: "eth_getTransactionReceipt";
140
- Parameters: [hash: `0x${string}`];
141
- ReturnType: import("viem").RpcTransactionReceipt | null;
142
- }, {
143
- Method: "eth_getUncleByBlockHashAndIndex";
144
- Parameters: [hash: `0x${string}`, index: `0x${string}`];
145
- ReturnType: import("viem").RpcUncle | null;
146
- }, {
147
- Method: "eth_getUncleByBlockNumberAndIndex";
148
- Parameters: [block: `0x${string}` | import("viem").BlockTag, index: `0x${string}`];
149
- ReturnType: import("viem").RpcUncle | null;
150
- }, {
151
- Method: "eth_getUncleCountByBlockHash";
152
- Parameters: [hash: `0x${string}`];
153
- /** Only exists in MetaMask as of 2022/04/03 */
154
- ReturnType: `0x${string}`;
155
- }, {
156
- Method: "eth_getUncleCountByBlockNumber";
157
- Parameters: [block: `0x${string}` | import("viem").BlockTag];
158
- ReturnType: `0x${string}`;
159
- }, {
160
- Method: "eth_maxPriorityFeePerGas";
161
- Parameters?: undefined;
162
- ReturnType: `0x${string}`;
163
- }, {
164
- Method: "eth_newBlockFilter";
165
- Parameters?: undefined;
166
- ReturnType: `0x${string}`;
167
- }, {
168
- Method: "eth_newFilter";
169
- Parameters: [filter: {
170
- fromBlock?: `0x${string}` | import("viem").BlockTag | undefined;
171
- toBlock?: `0x${string}` | import("viem").BlockTag | undefined;
172
- address?: `0x${string}` | `0x${string}`[] | undefined;
173
- topics?: import("viem").LogTopic[] | undefined;
174
- }];
175
- ReturnType: `0x${string}`;
176
- }, {
177
- Method: "eth_newPendingTransactionFilter";
178
- Parameters?: undefined;
179
- ReturnType: `0x${string}`;
180
- }, {
181
- Method: "eth_protocolVersion";
182
- Parameters?: undefined;
183
- ReturnType: string;
184
- }, {
185
- Method: "eth_sendRawTransaction";
186
- Parameters: [signedTransaction: `0x${string}`];
187
- ReturnType: `0x${string}`;
188
- }, {
189
- Method: "eth_uninstallFilter";
190
- Parameters: [filterId: `0x${string}`];
191
- ReturnType: boolean;
192
- }, {
193
- Method: "eth_accounts";
194
- Parameters?: undefined;
195
- ReturnType: `0x${string}`[];
196
- }, {
197
- Method: "eth_chainId";
198
- Parameters?: undefined;
199
- ReturnType: `0x${string}`;
200
- }, {
201
- Method: "eth_estimateGas";
202
- Parameters: [transaction: import("viem").RpcTransactionRequest] | [transaction: import("viem").RpcTransactionRequest, block: `0x${string}` | import("viem").BlockTag];
203
- ReturnType: `0x${string}`;
204
- }, {
205
- Method: "eth_requestAccounts";
206
- Parameters?: undefined;
207
- ReturnType: `0x${string}`[];
208
- }, {
209
- Method: "eth_sendTransaction";
210
- Parameters: [transaction: import("viem").RpcTransactionRequest];
211
- ReturnType: `0x${string}`;
212
- }, {
213
- Method: "eth_sendRawTransaction";
214
- Parameters: [signedTransaction: `0x${string}`];
215
- ReturnType: `0x${string}`;
216
- }, {
217
- Method: "eth_sign";
218
- Parameters: [address: `0x${string}`, data: `0x${string}`];
219
- ReturnType: `0x${string}`;
220
- }, {
221
- Method: "eth_signTransaction";
222
- Parameters: [request: import("viem").RpcTransactionRequest];
223
- ReturnType: `0x${string}`;
224
- }, {
225
- Method: "eth_signTypedData_v4";
226
- Parameters: [address: `0x${string}`, message: string];
227
- ReturnType: `0x${string}`;
228
- }, {
229
- Method: "eth_syncing";
230
- Parameters?: undefined;
231
- ReturnType: false | import("viem").NetworkSync;
232
- }, {
233
- Method: "personal_sign";
234
- Parameters: [data: `0x${string}`, address: `0x${string}`];
235
- ReturnType: `0x${string}`;
236
- }, {
237
- Method: "wallet_addEthereumChain";
238
- Parameters: [chain: import("viem").AddEthereumChainParameter];
239
- ReturnType: null;
240
- }, {
241
- Method: "wallet_getPermissions";
242
- Parameters?: undefined;
243
- ReturnType: import("viem").WalletPermission[];
244
- }, {
245
- Method: "wallet_requestPermissions";
246
- Parameters: [permissions: {
247
- eth_accounts: Record<string, any>;
248
- }];
249
- ReturnType: import("viem").WalletPermission[];
250
- }, {
251
- Method: "wallet_switchEthereumChain";
252
- Parameters: [chain: {
253
- chainId: string;
254
- }];
255
- ReturnType: null;
256
- }, {
257
- Method: "wallet_watchAsset";
258
- Parameters: import("viem").WatchAssetParams;
259
- ReturnType: boolean;
260
- }]>;
261
- isApexWallet?: true | undefined;
262
- isAvalanche?: true | undefined;
263
- isBackpack?: true | undefined;
264
- isBifrost?: true | undefined;
265
- isBitKeep?: true | undefined;
266
- isBitski?: true | undefined;
267
- isBlockWallet?: true | undefined;
268
- isBraveWallet?: true | undefined;
269
- isCoinbaseWallet?: true | undefined;
270
- isDawn?: true | undefined;
271
- isEnkrypt?: true | undefined;
272
- isExodus?: true | undefined;
273
- isFrame?: true | undefined;
274
- isFrontier?: true | undefined;
275
- isGamestop?: true | undefined;
276
- isHyperPay?: true | undefined;
277
- isImToken?: true | undefined;
278
- isKuCoinWallet?: true | undefined;
279
- isMathWallet?: true | undefined;
280
- isMetaMask?: true | undefined;
281
- isOkxWallet?: true | undefined;
282
- isOKExWallet?: true | undefined;
283
- isOneInchAndroidWallet?: true | undefined;
284
- isOneInchIOSWallet?: true | undefined;
285
- isOpera?: true | undefined;
286
- isPhantom?: true | undefined;
287
- isPortal?: true | undefined;
288
- isRabby?: true | undefined;
289
- isRainbow?: true | undefined;
290
- isStatus?: true | undefined;
291
- isTally?: true | undefined;
292
- isTokenPocket?: true | undefined;
293
- isTokenary?: true | undefined;
294
- isTrust?: true | undefined;
295
- isTrustWallet?: true | undefined;
296
- isXDEFI?: true | undefined;
297
- isZerion?: true | undefined;
298
- providers?: any[] | undefined;
299
- _events?: {
300
- connect?: (() => void) | undefined;
301
- } | undefined;
302
- _state?: {
303
- accounts?: string[] | undefined;
304
- initialized?: boolean | undefined;
305
- isConnected?: boolean | undefined;
306
- isPermanentlyDisconnected?: boolean | undefined;
307
- isUnlocked?: boolean | undefined;
308
- } | undefined;
309
- } | undefined, {
310
- onConnect(connectInfo: ProviderConnectInfo): void;
311
- }, {
312
- [x: `${string}.connected`]: true;
313
- }>;
314
- type Target = {
315
- name: string;
316
- provider: WalletProviderFlags | ((window?: Window | undefined) => WalletProvider | undefined);
317
- };
318
- export type TargetId = Evaluate<WalletProviderFlags> extends `is${infer name}` ? name extends `${infer char}${infer rest}` ? `${Lowercase<char>}${rest}` : never : never;
319
- type TargetMap = {
320
- [_ in TargetId]?: Target | undefined;
321
- };
322
- type WalletProviderFlags = 'isApexWallet' | 'isAvalanche' | 'isBackpack' | 'isBifrost' | 'isBitKeep' | 'isBitski' | 'isBlockWallet' | 'isBraveWallet' | 'isCoinbaseWallet' | 'isDawn' | 'isEnkrypt' | 'isExodus' | 'isFrame' | 'isFrontier' | 'isGamestop' | 'isHyperPay' | 'isImToken' | 'isKuCoinWallet' | 'isMathWallet' | 'isMetaMask' | 'isOkxWallet' | 'isOKExWallet' | 'isOneInchAndroidWallet' | 'isOneInchIOSWallet' | 'isOpera' | 'isPhantom' | 'isPortal' | 'isRabby' | 'isRainbow' | 'isStatus' | 'isTally' | 'isTokenPocket' | 'isTokenary' | 'isTrust' | 'isTrustWallet' | 'isXDEFI' | 'isZerion';
323
- type WalletProvider = Evaluate<EIP1193Provider & {
324
- [key in WalletProviderFlags]?: true | undefined;
325
- } & {
326
- providers?: WalletProvider[] | undefined;
327
- /** Only exists in MetaMask as of 2022/04/03 */
328
- _events?: {
329
- connect?: (() => void) | undefined;
330
- } | undefined;
331
- /** Only exists in MetaMask as of 2022/04/03 */
332
- _state?: {
333
- accounts?: string[];
334
- initialized?: boolean;
335
- isConnected?: boolean;
336
- isPermanentlyDisconnected?: boolean;
337
- isUnlocked?: boolean;
338
- } | undefined;
339
- }>;
340
- type Window = {
341
- coinbaseWalletExtension?: WalletProvider | undefined;
342
- ethereum?: WalletProvider | undefined;
343
- phantom?: {
344
- ethereum: WalletProvider;
345
- } | undefined;
346
- };
347
- export {};
348
- //# sourceMappingURL=injected.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injected.d.ts","sourceRoot":"","sources":["../../src/injected.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,mBAAmB,EAQzB,MAAM,MAAM,CAAA;AAEb,MAAM,MAAM,kBAAkB,GAAG;IAC/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