eip-1193 0.5.0 → 0.6.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/LICENSE +21 -0
- package/index.d.ts +196 -595
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023-present Ronan Sandford
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
// ------------------------------------------------------------------------------------------------
|
|
2
2
|
// TYPES
|
|
3
3
|
// ------------------------------------------------------------------------------------------------
|
|
4
|
+
export type EIP1193DATA = `0x${string}`;
|
|
5
|
+
export type EIP1193BlockTag = EIP1193QUANTITY | 'latest' | 'earliest' | 'pending' | 'safe' | 'finalized';
|
|
6
|
+
|
|
7
|
+
export type EIP1898BlockTag =
|
|
8
|
+
| EIP1193QUANTITY
|
|
9
|
+
| 'latest'
|
|
10
|
+
| 'earliest'
|
|
11
|
+
| 'pending'
|
|
12
|
+
| 'safe'
|
|
13
|
+
| 'finalized'
|
|
14
|
+
| {blockHash: EIP1193QUANTITY; requireCanonical?: boolean} // EIP-1898
|
|
15
|
+
| {blockNumber: EIP1193QUANTITY}; // EIP-1898
|
|
16
|
+
|
|
17
|
+
export type EIP1193QUANTITY = `0x${string}`;
|
|
18
|
+
export type EIP1193ChainId = `0x${string}`;
|
|
19
|
+
export type EIP1193Account = `0x${string}`;
|
|
20
|
+
export type EIP1193Accounts = EIP1193Account[];
|
|
21
|
+
|
|
4
22
|
type BaseEIP1193Transaction = {
|
|
5
23
|
blockHash: EIP1193DATA;
|
|
6
24
|
blockNumber: EIP1193QUANTITY | null;
|
|
@@ -199,318 +217,147 @@ export type EIP1193LogsParam = {
|
|
|
199
217
|
blockhash?: EIP1193DATA;
|
|
200
218
|
};
|
|
201
219
|
|
|
202
|
-
export type
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
readonly method: 'web3_clientVersion';
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
export type EIP1193Web3SHARequest = {
|
|
212
|
-
readonly method: 'web3_sha';
|
|
213
|
-
readonly params: [EIP1193DATA];
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
export type EIP1193NetVersionRequest = {
|
|
217
|
-
readonly method: 'net_version';
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
export type EIP1193NetListeningRequest = {
|
|
221
|
-
readonly method: 'net_listening';
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
export type EIP1193NetPeerCountRequest = {
|
|
225
|
-
readonly method: 'net_peerCount';
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
export type EIP1193ProtocolVersionRequest = {
|
|
229
|
-
readonly method: 'eth_protocolVersion';
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
export type EIP1193SyncingRequest = {
|
|
233
|
-
readonly method: 'eth_syncing';
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
export type EIP1193CoinbaseRequest = {
|
|
237
|
-
readonly method: 'eth_coinbase';
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
export type EIP1193MiningRequest = {
|
|
241
|
-
readonly method: 'eth_mining';
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
export type EIP1193HashrateRequest = {
|
|
245
|
-
readonly method: 'eth_hashrate';
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
export type EIP1193GasPriceRequest = {
|
|
249
|
-
readonly method: 'eth_gasPrice';
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
export type EIP1193AccountsRequest = {
|
|
253
|
-
readonly method: 'eth_accounts';
|
|
254
|
-
};
|
|
255
|
-
|
|
256
|
-
export type EIP1193BlockNumberRequest = {
|
|
257
|
-
readonly method: 'eth_blockNumber';
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
export type EIP1193GetBalanceRequest = {
|
|
261
|
-
readonly method: 'eth_getBalance';
|
|
262
|
-
readonly params: [EIP1193Account] | [EIP1193Account, EIP1898BlockTag];
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
export type EIP1193GetStorageAtRequest = {
|
|
266
|
-
readonly method: 'eth_getStorageAt';
|
|
267
|
-
readonly params: [EIP1193Account, EIP1193QUANTITY] | [EIP1193Account, EIP1193QUANTITY, EIP1898BlockTag];
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
export type EIP1193GetTransactionCountRequest = {
|
|
271
|
-
readonly method: 'eth_getTransactionCount';
|
|
272
|
-
readonly params: [EIP1193Account] | [EIP1193Account, EIP1898BlockTag];
|
|
273
|
-
};
|
|
274
|
-
|
|
275
|
-
export type EIP1193GetTransactionCountByHashRequest = {
|
|
276
|
-
readonly method: 'eth_getBlockTransactionCountByHash';
|
|
277
|
-
readonly params: [EIP1193DATA];
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
export type EIP1193GetTransactionCountByNumberRequest = {
|
|
281
|
-
readonly method: 'eth_getBlockTransactionCountByNumber';
|
|
282
|
-
readonly params: [EIP1193BlockTag];
|
|
283
|
-
};
|
|
284
|
-
|
|
285
|
-
export type EIP1193GetUncleCountByBlockHashRequest = {
|
|
286
|
-
readonly method: 'eth_getUncleCountByBlockHash';
|
|
287
|
-
readonly params: [EIP1193DATA];
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
export type EIP1193GetUncleCountByBlockNumberRequest = {
|
|
291
|
-
readonly method: 'eth_getUncleCountByBlockNumber';
|
|
292
|
-
readonly params: [EIP1193BlockTag];
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
export type EIP1193GetCodeRequest = {
|
|
296
|
-
readonly method: 'eth_getCode';
|
|
297
|
-
readonly params: [EIP1193Account] | [EIP1193Account, EIP1898BlockTag]; // TODO EIP1898BlockTag mandatory (base network gateway seems to think so)?
|
|
298
|
-
};
|
|
299
|
-
|
|
300
|
-
export type EIP1193LegacySignRequest = {
|
|
301
|
-
readonly method: 'eth_sign';
|
|
302
|
-
readonly params: [EIP1193Account, EIP1193DATA];
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
export type EIP1193SignTransactionRequest = {
|
|
306
|
-
readonly method: 'eth_signTransaction';
|
|
307
|
-
readonly params: [EIP1193TransactionData];
|
|
308
|
-
};
|
|
309
|
-
|
|
310
|
-
export type EIP1193SendTransactionRequest = {
|
|
311
|
-
readonly method: 'eth_sendTransaction';
|
|
312
|
-
readonly params: [EIP1193TransactionData];
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
export type EIP1193SendRawTransactionRequest = {
|
|
316
|
-
readonly method: 'eth_sendRawTransaction';
|
|
317
|
-
readonly params: [EIP1193DATA];
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
export type EIP1193CallRequest = {
|
|
321
|
-
readonly method: 'eth_call';
|
|
322
|
-
readonly params: [EIP1193CallParam] | [EIP1193CallParam, EIP1898BlockTag];
|
|
323
|
-
};
|
|
324
|
-
|
|
325
|
-
export type EIP1193EstimateGasRequest = {
|
|
326
|
-
readonly method: 'eth_estimateGas';
|
|
327
|
-
readonly params: [EIP1193CallParam] | [EIP1193CallParam, EIP1193BlockTag]; // EIP1898BlockTag ?
|
|
328
|
-
};
|
|
329
|
-
|
|
330
|
-
export type EIP1193GetBlockByHashRequest<T extends boolean = false> = {
|
|
331
|
-
readonly method: 'eth_getBlockByHash';
|
|
332
|
-
readonly params: [EIP1193DATA, T];
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
export type EIP1193GetBlockByNumberRequest<T = false> = {
|
|
336
|
-
readonly method: 'eth_getBlockByNumber';
|
|
337
|
-
readonly params: [EIP1193BlockTag, T];
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
export type EIP1193GetTransactionByHashRequest = {
|
|
341
|
-
readonly method: 'eth_getTransactionByHash';
|
|
342
|
-
readonly params: [EIP1193DATA];
|
|
220
|
+
export type EIP1193TracedTransaction = {
|
|
221
|
+
failed: boolean;
|
|
222
|
+
gas: EIP1193QUANTITY;
|
|
223
|
+
returnValue: EIP1193DATA;
|
|
224
|
+
structLogs: any[]; // TODO
|
|
225
|
+
// TODO more
|
|
343
226
|
};
|
|
344
227
|
|
|
345
|
-
export type
|
|
346
|
-
readonly method: 'eth_getTransactionByBlockHashAndIndex';
|
|
347
|
-
readonly params: [EIP1193DATA, EIP1193QUANTITY];
|
|
348
|
-
};
|
|
228
|
+
export type EIP1193SubscriptionMessage = EIP1193KnownSubscriptionMessage | EIP1193UnknownSubscriptionMessage;
|
|
349
229
|
|
|
350
|
-
export type
|
|
351
|
-
readonly method: 'eth_getTransactionByBlockNumberAndIndex';
|
|
352
|
-
readonly params: [EIP1193BlockTag, EIP1193QUANTITY];
|
|
353
|
-
};
|
|
230
|
+
export type EIP1193Message = EIP1193SubscriptionMessage | EIP1193UnknownMessage;
|
|
354
231
|
|
|
355
|
-
export type
|
|
356
|
-
|
|
357
|
-
readonly params: [EIP1193DATA];
|
|
232
|
+
export type EIP1193AddChainError = {
|
|
233
|
+
// TODO
|
|
358
234
|
};
|
|
359
235
|
|
|
360
|
-
export type
|
|
361
|
-
|
|
362
|
-
readonly params: [EIP1193DATA, EIP1193QUANTITY];
|
|
236
|
+
export type EIP1193SwitchChainError = {
|
|
237
|
+
// TODO
|
|
363
238
|
};
|
|
364
239
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
240
|
+
/*
|
|
241
|
+
// TODO
|
|
242
|
+
4001 User Rejected Request The user rejected the request.
|
|
243
|
+
4100 Unauthorized The requested method and/or account has not been authorized by the user.
|
|
244
|
+
4200 Unsupported Method The Provider does not support the requested method.
|
|
245
|
+
4900 Disconnected The Provider is disconnected from all chains.
|
|
246
|
+
4901 Chain Disconnected The Provider is not connected to the requested chain.
|
|
247
|
+
*/
|
|
369
248
|
|
|
370
|
-
|
|
371
|
-
readonly method: 'eth_getLogs';
|
|
372
|
-
readonly params: [EIP1193LogsParam];
|
|
373
|
-
};
|
|
249
|
+
type Listener<Message> = (message: Message) => unknown | Promise<unknown>;
|
|
374
250
|
|
|
375
251
|
// ------------------------------------------------------------------------------------------------
|
|
376
|
-
//
|
|
252
|
+
// REQUEST TYPES
|
|
377
253
|
// ------------------------------------------------------------------------------------------------
|
|
378
254
|
|
|
379
|
-
export type
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
};
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
};
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
};
|
|
393
|
-
|
|
394
|
-
export type
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
];
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
};
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
{
|
|
425
|
-
address: EIP1193Account | EIP1193Account[];
|
|
426
|
-
topics: (EIP1193DATA[] | EIP1193DATA)[];
|
|
427
|
-
}
|
|
428
|
-
];
|
|
429
|
-
};
|
|
430
|
-
|
|
431
|
-
export type EIP1193SubscribeRequest = EIP1193LogsSubscribeRequest | EIP1193OtherSubscribeRequest;
|
|
255
|
+
export type Methods = ReadMethods & NodeOnlyReadMethods & WriteMethods & SignerMethods & WalletOnlyMethods;
|
|
256
|
+
|
|
257
|
+
export type NodeOnlyReadMethods = {
|
|
258
|
+
web3_clientVersion: {result: string};
|
|
259
|
+
web3_sha: {params: [EIP1193DATA]; result: EIP1193DATA};
|
|
260
|
+
net_version: {result: EIP1193ChainId};
|
|
261
|
+
net_listening: {result: boolean};
|
|
262
|
+
net_peerCount: {result: EIP1193QUANTITY};
|
|
263
|
+
eth_protocolVersion: {result: string};
|
|
264
|
+
eth_syncing: {result: EIP1193SyncingStatus | false};
|
|
265
|
+
eth_coinbase: {result: EIP1193Account};
|
|
266
|
+
eth_mining: {result: boolean}; // TODO check
|
|
267
|
+
eth_hashrate: {result: unknown}; // TODO
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
export type ReadMethods = {
|
|
271
|
+
eth_gasPrice: {result: EIP1193QUANTITY};
|
|
272
|
+
|
|
273
|
+
eth_blockNumber: {result: EIP1193QUANTITY};
|
|
274
|
+
eth_getBalance: {params: [EIP1193Account] | [EIP1193Account, EIP1898BlockTag]; result: EIP1193QUANTITY};
|
|
275
|
+
eth_getStorageAt: {
|
|
276
|
+
params: [EIP1193Account, EIP1193QUANTITY] | [EIP1193Account, EIP1193QUANTITY, EIP1898BlockTag];
|
|
277
|
+
result: EIP1193DATA;
|
|
278
|
+
};
|
|
279
|
+
eth_getTransactionCount: {params: [EIP1193Account] | [EIP1193Account, EIP1898BlockTag]; result: EIP1193QUANTITY};
|
|
280
|
+
eth_getBlockTransactionCountByHash: {params: [EIP1193DATA]; result: EIP1193QUANTITY};
|
|
281
|
+
eth_getBlockTransactionCountByNumber: {params: [EIP1193BlockTag]; result: EIP1193QUANTITY};
|
|
282
|
+
eth_getUncleCountByBlockHash: {params: [EIP1193DATA]; result: EIP1193QUANTITY};
|
|
283
|
+
eth_getUncleCountByBlockNumber: {params: [EIP1193BlockTag]; resu; t: EIP1193QUANTITY};
|
|
284
|
+
eth_getCode: {params: [EIP1193Account] | [EIP1193Account, EIP1898BlockTag]; result: EIP1193DATA};
|
|
285
|
+
|
|
286
|
+
eth_call: {params: [EIP1193CallParam] | [EIP1193CallParam, EIP1898BlockTag]; result: EIP1193DATA};
|
|
287
|
+
eth_estimateGas: {params: [EIP1193CallParam] | [EIP1193CallParam, EIP1193BlockTag]; result: EIP1193QUANTITY}; // EIP1898BlockTag ?
|
|
288
|
+
eth_getBlockByHash:
|
|
289
|
+
| {params: [EIP1193DATA, true]; result: EIP1193BlockWithTransactions | null}
|
|
290
|
+
| {params: [EIP1193DATA, false]; result: EIP1193Block | null};
|
|
291
|
+
eth_getBlockByNumber:
|
|
292
|
+
| {params: [EIP1193BlockTag, true]; result: EIP1193BlockWithTransactions | null}
|
|
293
|
+
| {params: [EIP1193BlockTag, false]; result: EIP1193Block | null};
|
|
294
|
+
eth_getTransactionByHash: {params: [EIP1193DATA]; result: EIP1193Transaction | null};
|
|
295
|
+
eth_getTransactionByBlockHashAndIndex: {params: [EIP1193DATA, EIP1193QUANTITY]; result: EIP1193Transaction | null};
|
|
296
|
+
eth_getTransactionByBlockNumberAndIndex: {
|
|
297
|
+
params: [EIP1193BlockTag, EIP1193QUANTITY];
|
|
298
|
+
result: EIP1193Transaction | null;
|
|
299
|
+
};
|
|
432
300
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
301
|
+
eth_getTransactionReceipt: {params: [EIP1193DATA]; result: EIP1193TransactionReceipt | null};
|
|
302
|
+
eth_getUncleByBlockHashAndIndex: {params: [EIP1193DATA, EIP1193QUANTITY]; result: EIP1193Block | null};
|
|
303
|
+
eth_getUncleByBlockNumberAndIndex: {params: [EIP1193BlockTag, EIP1193QUANTITY]; result: EIP1193Block | null};
|
|
304
|
+
eth_getLogs: {params: [EIP1193LogsParam]; result: EIP1193Log[]};
|
|
305
|
+
eth_chainId: {result: EIP1193ChainId};
|
|
306
|
+
|
|
307
|
+
eth_subscribe:
|
|
308
|
+
| {params: ['newHeads' | 'newPendingTransactions' | 'syncing']; result: string}
|
|
309
|
+
| {
|
|
310
|
+
params: [
|
|
311
|
+
'logs',
|
|
312
|
+
{
|
|
313
|
+
address: EIP1193Account | EIP1193Account[];
|
|
314
|
+
topics: (EIP1193DATA[] | EIP1193DATA)[];
|
|
315
|
+
}
|
|
316
|
+
];
|
|
317
|
+
result: string;
|
|
318
|
+
};
|
|
319
|
+
eth_unsubscribe: {params: [EIP1193DATA]; result: boolean};
|
|
320
|
+
eth_getProof: {params: [EIP1193DATA, EIP1193DATA[]] | [EIP1193DATA, EIP1193DATA[], EIP1898BlockTag]; result: unknown}; // TODO
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
export type WriteMethods = {
|
|
324
|
+
eth_sendRawTransaction: {params: [EIP1193DATA]; result: EIP1193DATA};
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
export type SignerMethods = {
|
|
328
|
+
eth_accounts: {result: EIP1193Accounts};
|
|
329
|
+
eth_sign: {params: [EIP1193Account, EIP1193DATA]; result: EIP1193DATA};
|
|
330
|
+
eth_signTransaction: {params: [EIP1193TransactionData]; result: EIP1193DATA};
|
|
331
|
+
|
|
332
|
+
personal_sign: {params: [EIP1193DATA, EIP1193Account]; result: EIP1193DATA};
|
|
333
|
+
eth_signTypedData_v4: {params: [EIP1193Account, EIP1193TypedSignatureParam]; result: EIP1193DATA};
|
|
334
|
+
eth_signTypedData: {params: [EIP1193Account, EIP1193TypedSignatureParam]; result: EIP1193DATA};
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
export type ConnectedAccountMethods = {
|
|
338
|
+
eth_sendTransaction: {params: [EIP1193TransactionData]; result: EIP1193DATA};
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
export type WalletOnlyMethods = {
|
|
342
|
+
eth_requestAccounts: {result: EIP1193Accounts};
|
|
343
|
+
wallet_switchEthereumChain: {
|
|
344
|
+
params: [
|
|
345
|
+
{
|
|
346
|
+
chainId: EIP1193ChainId;
|
|
347
|
+
}
|
|
348
|
+
];
|
|
349
|
+
result: EIP1193SwitchChainError | null;
|
|
350
|
+
};
|
|
351
|
+
wallet_addEthereumChain: {params: [EIP1193AddChainParam]; result: EIP1193AddChainError | null};
|
|
436
352
|
};
|
|
437
353
|
|
|
438
|
-
export type
|
|
439
|
-
|
|
440
|
-
readonly params: [EIP1193DATA, EIP1193DATA[]] | [EIP1193DATA, EIP1193DATA[], EIP1898BlockTag];
|
|
354
|
+
export type DebugOnlyMethods = {
|
|
355
|
+
debug_traceTransaction: {params: [EIP1193DATA]; result: EIP1193TracedTransaction};
|
|
441
356
|
};
|
|
442
357
|
|
|
443
|
-
|
|
358
|
+
export type WalletMethods = ReadMethods & SignerMethods & ConnectedAccountMethods & WalletOnlyMethods;
|
|
444
359
|
|
|
445
|
-
export type
|
|
446
|
-
| EIP1193Web3ClientVersionRequest
|
|
447
|
-
| EIP1193Web3SHARequest
|
|
448
|
-
| EIP1193NetVersionRequest
|
|
449
|
-
| EIP1193NetListeningRequest
|
|
450
|
-
| EIP1193NetPeerCountRequest
|
|
451
|
-
| EIP1193ProtocolVersionRequest
|
|
452
|
-
| EIP1193SyncingRequest
|
|
453
|
-
| EIP1193CoinbaseRequest
|
|
454
|
-
| EIP1193MiningRequest
|
|
455
|
-
| EIP1193HashrateRequest
|
|
456
|
-
| EIP1193AccountsRequest
|
|
457
|
-
| EIP1193BlockNumberRequest
|
|
458
|
-
| EIP1193GetBalanceRequest
|
|
459
|
-
| EIP1193GetStorageAtRequest
|
|
460
|
-
| EIP1193GetTransactionCountRequest
|
|
461
|
-
| EIP1193GetTransactionCountByHashRequest
|
|
462
|
-
| EIP1193GetTransactionCountByNumberRequest
|
|
463
|
-
| EIP1193GetUncleCountByBlockHashRequest
|
|
464
|
-
| EIP1193GetUncleCountByBlockNumberRequest
|
|
465
|
-
| EIP1193GetCodeRequest
|
|
466
|
-
| EIP1193LegacySignRequest
|
|
467
|
-
| EIP1193SignTransactionRequest
|
|
468
|
-
| EIP1193SendTransactionRequest
|
|
469
|
-
| EIP1193SendRawTransactionRequest
|
|
470
|
-
| EIP1193CallRequest
|
|
471
|
-
| EIP1193EstimateGasRequest
|
|
472
|
-
| EIP1193GetBlockByHashRequest<false>
|
|
473
|
-
| EIP1193GetBlockByNumberRequest<false>
|
|
474
|
-
| EIP1193GetBlockByHashRequest<true>
|
|
475
|
-
| EIP1193GetBlockByNumberRequest<true>
|
|
476
|
-
| EIP1193GetTransactionByHashRequest
|
|
477
|
-
| EIP1193GetTransactionByBlockHashAndIndexRequest
|
|
478
|
-
| EIP1193GetTransactionByBlockNumberAndIndexRequest
|
|
479
|
-
| EIP1193GetTransactionReceiptRequest
|
|
480
|
-
| EIP1193GetUncleByBlockHashAndIndexRequest
|
|
481
|
-
| EIP1193GetUncleByBlockNumberAndIndexRequest
|
|
482
|
-
| EIP1193GetLogsRequest
|
|
483
|
-
| EIP1193PersonalSignRequest
|
|
484
|
-
| EIP1193PTypedSignv4Request
|
|
485
|
-
| EIP1193PTypedSignRequest
|
|
486
|
-
| EIP1193ChainIdRequest
|
|
487
|
-
| EIP1193RequestAccountsRequest
|
|
488
|
-
| ERIP1193SwitchChainRequest
|
|
489
|
-
| ERIP1193AddChainRequest
|
|
490
|
-
| EIP1193SubscribeRequest
|
|
491
|
-
| EIP1193UnsubscribeRequest
|
|
492
|
-
| EIP1193GasPriceRequest;
|
|
493
|
-
|
|
494
|
-
export type EIP1193Response =
|
|
495
|
-
| EIP1193ChainId
|
|
496
|
-
| EIP1193SyncingStatus
|
|
497
|
-
| false
|
|
498
|
-
| EIP1193QUANTITY
|
|
499
|
-
| EIP1193BlockWithTransactions
|
|
500
|
-
| EIP1193Transaction
|
|
501
|
-
| null
|
|
502
|
-
| EIP1193TransactionReceipt
|
|
503
|
-
| null
|
|
504
|
-
| EIP1193Block
|
|
505
|
-
| null
|
|
506
|
-
| EIP1193Log[]
|
|
507
|
-
| EIP1193DATA
|
|
508
|
-
| EIP1193ChainId
|
|
509
|
-
| EIP1193Accounts
|
|
510
|
-
| EIP1193SwitchChainError
|
|
511
|
-
| EIP1193AddChainError
|
|
512
|
-
| string
|
|
513
|
-
| boolean;
|
|
360
|
+
export type EIP1193TypedSignatureParam = {[field: string]: any}; // TODO
|
|
514
361
|
|
|
515
362
|
export type EIP1193GenericRequest = {
|
|
516
363
|
method: string;
|
|
@@ -561,304 +408,76 @@ export type EIP1193KnownSubscriptionMessage = EIP1193UnknownMessage & {
|
|
|
561
408
|
};
|
|
562
409
|
};
|
|
563
410
|
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
export type EIP1193AddChainError = {
|
|
569
|
-
// TODO
|
|
570
|
-
};
|
|
571
|
-
|
|
572
|
-
export type EIP1193SwitchChainError = {
|
|
573
|
-
// TODO
|
|
574
|
-
};
|
|
575
|
-
|
|
576
|
-
/*
|
|
577
|
-
// TODO
|
|
578
|
-
4001 User Rejected Request The user rejected the request.
|
|
579
|
-
4100 Unauthorized The requested method and/or account has not been authorized by the user.
|
|
580
|
-
4200 Unsupported Method The Provider does not support the requested method.
|
|
581
|
-
4900 Disconnected The Provider is disconnected from all chains.
|
|
582
|
-
4901 Chain Disconnected The Provider is not connected to the requested chain.
|
|
583
|
-
*/
|
|
584
|
-
|
|
585
|
-
type Listener<Message> = (message: Message) => unknown | Promise<unknown>;
|
|
586
|
-
|
|
587
|
-
export type EIP1193Web3ClientVersionProvider = {
|
|
588
|
-
request(args: EIP1193Web3ClientVersionRequest): Promise<string>;
|
|
589
|
-
};
|
|
590
|
-
|
|
591
|
-
export type EIP1193Web3SHAProvider = {
|
|
592
|
-
request(args: EIP1193Web3SHARequest): Promise<EIP1193DATA>;
|
|
593
|
-
};
|
|
594
|
-
|
|
595
|
-
export type EIP1193NetVersionProvider = {
|
|
596
|
-
request(args: EIP1193NetVersionRequest): Promise<EIP1193ChainId>;
|
|
597
|
-
};
|
|
598
|
-
|
|
599
|
-
export type EIP1193NetListeningProvider = {
|
|
600
|
-
request(args: EIP1193NetListeningRequest): Promise<boolean>;
|
|
601
|
-
};
|
|
602
|
-
|
|
603
|
-
export type EIP1193NetPeerCountProvider = {
|
|
604
|
-
request(args: EIP1193NetPeerCountRequest): Promise<EIP1193QUANTITY>;
|
|
605
|
-
};
|
|
606
|
-
|
|
607
|
-
export type EIP1193ProtocolVersionProvider = {
|
|
608
|
-
request(args: EIP1193ProtocolVersionRequest): Promise<string>;
|
|
609
|
-
};
|
|
610
|
-
|
|
611
|
-
export type EIP1193SyncingProvider = {
|
|
612
|
-
request(args: EIP1193SyncingRequest): Promise<EIP1193SyncingStatus | false>;
|
|
613
|
-
};
|
|
614
|
-
export type EIP1193CoinbaseProvider = {
|
|
615
|
-
request(args: EIP1193CoinbaseRequest): Promise<EIP1193Account>;
|
|
616
|
-
};
|
|
617
|
-
export type EIP1193GasPriceProvider = {
|
|
618
|
-
request(args: EIP1193GasPriceRequest): Promise<EIP1193QUANTITY>;
|
|
619
|
-
};
|
|
620
|
-
export type EIP1193AccountsProvider = {
|
|
621
|
-
request(args: EIP1193AccountsRequest): Promise<EIP1193Accounts>;
|
|
622
|
-
};
|
|
623
|
-
export type EIP1193BlockNumberProvider = {
|
|
624
|
-
request(args: EIP1193BlockNumberRequest): Promise<EIP1193QUANTITY>;
|
|
625
|
-
};
|
|
626
|
-
export type EIP1193GetBalanceProvider = {
|
|
627
|
-
request(args: EIP1193GetBalanceRequest): Promise<EIP1193QUANTITY>;
|
|
628
|
-
};
|
|
629
|
-
export type EIP1193GetStorageAtProvider = {
|
|
630
|
-
request(args: EIP1193GetStorageAtRequest): Promise<EIP1193DATA>;
|
|
631
|
-
};
|
|
632
|
-
export type EIP1193GetTransactionCountProvider = {
|
|
633
|
-
request(args: EIP1193GetTransactionCountRequest): Promise<EIP1193QUANTITY>;
|
|
634
|
-
};
|
|
635
|
-
export type EIP1193GetTransactionCountByHashProvider = {
|
|
636
|
-
request(args: EIP1193GetTransactionCountByHashRequest): Promise<EIP1193QUANTITY>;
|
|
637
|
-
};
|
|
638
|
-
export type EIP1193GetTransactionCountByNumberProvider = {
|
|
639
|
-
request(args: EIP1193GetTransactionCountByNumberRequest): Promise<EIP1193QUANTITY>;
|
|
640
|
-
};
|
|
641
|
-
|
|
642
|
-
export type EIP1193GetUncleCountByBlockHashProvider = {
|
|
643
|
-
request(args: EIP1193GetUncleCountByBlockHashRequest): Promise<EIP1193QUANTITY>;
|
|
644
|
-
};
|
|
645
|
-
|
|
646
|
-
export type EIP1193GetUncleCountByBlockNumberProvider = {
|
|
647
|
-
request(args: EIP1193GetUncleCountByBlockNumberRequest): Promise<EIP1193QUANTITY>;
|
|
648
|
-
};
|
|
649
|
-
|
|
650
|
-
export type EIP1193GetCodeProvider = {
|
|
651
|
-
request(args: EIP1193GetCodeRequest): Promise<EIP1193DATA>;
|
|
652
|
-
};
|
|
653
|
-
|
|
654
|
-
export type EIP1193LegacySignProvider = {
|
|
655
|
-
request(args: EIP1193LegacySignRequest): Promise<EIP1193DATA>;
|
|
656
|
-
};
|
|
657
|
-
|
|
658
|
-
export type EIP1193SignTransactionProvider = {
|
|
659
|
-
request(args: EIP1193SignTransactionRequest): Promise<EIP1193DATA>;
|
|
660
|
-
};
|
|
661
|
-
|
|
662
|
-
export type EIP1193SendTransactionProvider = {
|
|
663
|
-
request(args: EIP1193SendTransactionRequest): Promise<EIP1193DATA>;
|
|
664
|
-
};
|
|
665
|
-
|
|
666
|
-
export type EIP1193SendRawTransactionProvider = {
|
|
667
|
-
request(args: EIP1193SendRawTransactionRequest): Promise<EIP1193DATA>;
|
|
668
|
-
};
|
|
669
|
-
|
|
670
|
-
export type EIP1193CallProvider = {
|
|
671
|
-
request(args: EIP1193CallRequest): Promise<EIP1193DATA>;
|
|
672
|
-
};
|
|
673
|
-
|
|
674
|
-
export type EIP1193EstimateGasProvider = {
|
|
675
|
-
request(args: EIP1193EstimateGasRequest): Promise<EIP1193QUANTITY>;
|
|
676
|
-
};
|
|
677
|
-
|
|
678
|
-
export type EIP1193GetBlockByHashProvider = {
|
|
679
|
-
request(args: EIP1193GetBlockByHashRequest): Promise<EIP1193Block | null>;
|
|
680
|
-
request(args: EIP1193GetBlockByHashRequest<true>): Promise<EIP1193BlockWithTransactions | null>;
|
|
681
|
-
};
|
|
411
|
+
// ------------------------------------------------------------------------------------------------
|
|
412
|
+
// TOOLS
|
|
413
|
+
// ------------------------------------------------------------------------------------------------
|
|
682
414
|
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
415
|
+
// taken from https://dev.to/bwca/deep-readonly-generic-in-typescript-4b04
|
|
416
|
+
type DeepReadonly<T> = Readonly<{
|
|
417
|
+
[K in keyof T]: T[K] extends number | string | symbol // Is it a primitive? Then make it readonly
|
|
418
|
+
? Readonly<T[K]>
|
|
419
|
+
: // Is it an array of items? Then make the array readonly and the item as well
|
|
420
|
+
T[K] extends Array<infer A>
|
|
421
|
+
? Readonly<Array<DeepReadonly<A>>>
|
|
422
|
+
: // It is some other object, make it readonly as well
|
|
423
|
+
DeepReadonly<T[K]>;
|
|
424
|
+
}>;
|
|
425
|
+
|
|
426
|
+
export type RPCRequestData = {params?: any; result?: any; errors?: any};
|
|
427
|
+
|
|
428
|
+
export type RPCMethods = Record<string, RPCRequestData>;
|
|
429
|
+
|
|
430
|
+
export type RemoteRequestCallType<
|
|
431
|
+
Method extends string,
|
|
432
|
+
Value,
|
|
433
|
+
Params extends any[] | Record<string, any> | undefined = undefined
|
|
434
|
+
> = Params extends undefined
|
|
435
|
+
? {
|
|
436
|
+
request: (req: {method: Method}) => Promise<Value>;
|
|
437
|
+
}
|
|
438
|
+
: Params extends []
|
|
439
|
+
? {
|
|
440
|
+
request: (req: {method: Method}) => Promise<Value>;
|
|
441
|
+
}
|
|
442
|
+
: {
|
|
443
|
+
request: (req: {method: Method; params: DeepReadonly<Params>}) => Promise<Value>;
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
447
|
+
|
|
448
|
+
export type RequestUnion<T extends RPCMethods> = {
|
|
449
|
+
[Property in keyof T]: RemoteRequestCallType<
|
|
450
|
+
Property extends string ? Property : never,
|
|
451
|
+
T[Property] extends {result: any} ? T[Property]['result'] : undefined,
|
|
452
|
+
T[Property] extends {params: any} ? T[Property]['params'] : undefined
|
|
453
|
+
>;
|
|
454
|
+
}[keyof T];
|
|
687
455
|
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
export type EIP1193GetTransactionByBlockHashAndIndexProvider = {
|
|
692
|
-
request(args: EIP1193GetTransactionByBlockHashAndIndexRequest): Promise<EIP1193Transaction | null>;
|
|
693
|
-
};
|
|
694
|
-
export type EIP1193GetTransactionByBlockNumberAndIndexProvider = {
|
|
695
|
-
request(args: EIP1193GetTransactionByBlockNumberAndIndexRequest): Promise<EIP1193Transaction | null>;
|
|
696
|
-
};
|
|
697
|
-
export type EIP1193GetTransactionReceiptProvider = {
|
|
698
|
-
request(args: EIP1193GetTransactionReceiptRequest): Promise<EIP1193TransactionReceipt | null>;
|
|
699
|
-
};
|
|
700
|
-
export type EIP1193GetUncleByBlockHashAndIndexProvider = {
|
|
701
|
-
request(args: EIP1193GetUncleByBlockHashAndIndexRequest): Promise<EIP1193Block | null>;
|
|
702
|
-
};
|
|
703
|
-
export type EIP1193GetUncleByBlockNumberAndIndexProvider = {
|
|
704
|
-
request(args: EIP1193GetUncleByBlockNumberAndIndexRequest): Promise<EIP1193Block | null>;
|
|
705
|
-
};
|
|
706
|
-
export type EIP1193GetLogsProvider = {
|
|
707
|
-
request(args: EIP1193GetLogsRequest): Promise<EIP1193Log[]>;
|
|
708
|
-
};
|
|
709
|
-
export type EIP1193PersonalSignProvider = {
|
|
710
|
-
request(args: EIP1193PersonalSignRequest): Promise<EIP1193DATA>;
|
|
711
|
-
};
|
|
712
|
-
export type EIP1193PTypedSignv4Provider = {
|
|
713
|
-
request(args: EIP1193PTypedSignv4Request): Promise<EIP1193DATA>;
|
|
714
|
-
};
|
|
456
|
+
// ------------------------------------------------------------------------------------------------
|
|
457
|
+
// PROVIDERS
|
|
458
|
+
// ------------------------------------------------------------------------------------------------
|
|
715
459
|
|
|
716
|
-
export type
|
|
717
|
-
request(args: EIP1193PTypedSignRequest): Promise<EIP1193DATA>;
|
|
718
|
-
};
|
|
460
|
+
export type RequestRPC<T extends RPCMethods> = UnionToIntersection<RequestUnion<T>>;
|
|
719
461
|
|
|
720
|
-
export type
|
|
721
|
-
request(args: EIP1193ChainIdRequest): Promise<EIP1193ChainId>;
|
|
722
|
-
};
|
|
462
|
+
export type EIP1193ProviderWithoutEvents = RequestRPC<Methods>;
|
|
723
463
|
|
|
724
|
-
export type
|
|
725
|
-
request(args: EIP1193RequestAccountsRequest): Promise<EIP1193Accounts>;
|
|
726
|
-
};
|
|
464
|
+
// export type EIP1193WindowWalletProvider = EIP1193Provider;
|
|
727
465
|
|
|
728
|
-
export type
|
|
729
|
-
request(args: ERIP1193SwitchChainRequest): Promise<EIP1193SwitchChainError | null>;
|
|
730
|
-
};
|
|
466
|
+
export type EIP1193WalletProvider = RequestRPC<WalletMethods>;
|
|
731
467
|
|
|
732
|
-
export type
|
|
733
|
-
request(args: ERIP1193AddChainRequest): Promise<EIP1193AddChainError | null>;
|
|
734
|
-
};
|
|
468
|
+
export type EIP1193WindowWalletProvider = EIP1193WalletProvider & EIP1193EventsProvider;
|
|
735
469
|
|
|
736
|
-
export type
|
|
737
|
-
request(args: EIP1193SubscribeRequest): Promise<string>;
|
|
738
|
-
request(args: EIP1193UnsubscribeRequest): Promise<boolean>;
|
|
739
|
-
};
|
|
470
|
+
export type EIP1193SignerProvider = RequestRPC<SignerMethods>;
|
|
740
471
|
|
|
741
|
-
|
|
742
|
-
// request<T = unknown>(args: V): Promise<T>;
|
|
743
|
-
// };
|
|
472
|
+
export type EIP1193DebugProvider = EIP1193ProviderWithoutEvents & RequestRPC<DebugOnlyMethods>;
|
|
744
473
|
|
|
745
474
|
export type EIP1193GenericRequestProvider = {
|
|
746
475
|
request<T = unknown, V extends EIP1193GenericRequest = EIP1193GenericRequest>(args: V): Promise<T>;
|
|
747
476
|
};
|
|
748
477
|
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
EIP1193NetListeningProvider &
|
|
753
|
-
EIP1193NetPeerCountProvider &
|
|
754
|
-
EIP1193ProtocolVersionProvider &
|
|
755
|
-
EIP1193SyncingProvider &
|
|
756
|
-
EIP1193CoinbaseProvider &
|
|
757
|
-
EIP1193GasPriceProvider &
|
|
758
|
-
EIP1193AccountsProvider &
|
|
759
|
-
EIP1193BlockNumberProvider &
|
|
760
|
-
EIP1193GetBalanceProvider &
|
|
761
|
-
EIP1193GetStorageAtProvider &
|
|
762
|
-
EIP1193GetTransactionCountProvider &
|
|
763
|
-
EIP1193GetTransactionCountByHashProvider &
|
|
764
|
-
EIP1193GetTransactionCountByNumberProvider &
|
|
765
|
-
EIP1193GetUncleCountByBlockHashProvider &
|
|
766
|
-
EIP1193GetUncleCountByBlockNumberProvider &
|
|
767
|
-
EIP1193GetCodeProvider &
|
|
768
|
-
EIP1193LegacySignProvider &
|
|
769
|
-
EIP1193SignTransactionProvider &
|
|
770
|
-
EIP1193SendTransactionProvider &
|
|
771
|
-
EIP1193SendRawTransactionProvider &
|
|
772
|
-
EIP1193CallProvider &
|
|
773
|
-
EIP1193EstimateGasProvider &
|
|
774
|
-
EIP1193GetBlockByHashProvider &
|
|
775
|
-
EIP1193GetBlockByNumberProvider &
|
|
776
|
-
EIP1193GetTransactionByHashProvider &
|
|
777
|
-
EIP1193GetTransactionByBlockHashAndIndexProvider &
|
|
778
|
-
EIP1193GetTransactionByBlockNumberAndIndexProvider &
|
|
779
|
-
EIP1193GetTransactionReceiptProvider &
|
|
780
|
-
EIP1193GetUncleByBlockHashAndIndexProvider &
|
|
781
|
-
EIP1193GetUncleByBlockNumberAndIndexProvider &
|
|
782
|
-
EIP1193GetLogsProvider &
|
|
783
|
-
EIP1193PersonalSignProvider &
|
|
784
|
-
EIP1193PTypedSignv4Provider &
|
|
785
|
-
EIP1193PTypedSignProvider &
|
|
786
|
-
EIP1193ChainIdProvider &
|
|
787
|
-
EIP1193RequestAccountsProvider &
|
|
788
|
-
ERIP1193SwitchChainProvider &
|
|
789
|
-
ERIP1193AddChainProvider &
|
|
790
|
-
EIP1193SubscribtionProvider &
|
|
791
|
-
EIP1193GenericRequestProvider;
|
|
792
|
-
|
|
793
|
-
export type EIP1193DebugTraceTransactionRequest = {
|
|
794
|
-
readonly method: 'debug_traceTransaction';
|
|
795
|
-
readonly params: [EIP1193DATA];
|
|
796
|
-
};
|
|
797
|
-
|
|
798
|
-
export type EIP1193TracedTransaction = {
|
|
799
|
-
failed: boolean;
|
|
800
|
-
gas: EIP1193QUANTITY;
|
|
801
|
-
returnValue: EIP1193DATA;
|
|
802
|
-
structLogs: any[]; // TODO
|
|
803
|
-
// TODO more
|
|
804
|
-
};
|
|
805
|
-
|
|
806
|
-
export type EIP1193DebugTraceTransactionProvider = {
|
|
807
|
-
request(args: EIP1193DebugTraceTransactionRequest): Promise<EIP1193TracedTransaction>;
|
|
808
|
-
};
|
|
809
|
-
|
|
810
|
-
// export type EIP1193WindowWalletProvider = EIP1193Provider;
|
|
811
|
-
|
|
812
|
-
export type EIP1193WalletProvider = EIP1193GasPriceProvider &
|
|
813
|
-
EIP1193AccountsProvider &
|
|
814
|
-
EIP1193BlockNumberProvider &
|
|
815
|
-
EIP1193GetBalanceProvider &
|
|
816
|
-
EIP1193GetStorageAtProvider &
|
|
817
|
-
EIP1193GetTransactionCountProvider &
|
|
818
|
-
EIP1193GetTransactionCountByHashProvider &
|
|
819
|
-
EIP1193GetTransactionCountByNumberProvider &
|
|
820
|
-
EIP1193GetUncleCountByBlockHashProvider &
|
|
821
|
-
EIP1193GetUncleCountByBlockNumberProvider &
|
|
822
|
-
EIP1193GetCodeProvider &
|
|
823
|
-
EIP1193LegacySignProvider &
|
|
824
|
-
// EIP1193SignTransactionProvider &
|
|
825
|
-
EIP1193SendTransactionProvider &
|
|
826
|
-
EIP1193SendRawTransactionProvider &
|
|
827
|
-
EIP1193CallProvider &
|
|
828
|
-
EIP1193EstimateGasProvider &
|
|
829
|
-
EIP1193GetBlockByHashProvider &
|
|
830
|
-
EIP1193GetBlockByNumberProvider &
|
|
831
|
-
EIP1193GetTransactionByHashProvider &
|
|
832
|
-
EIP1193GetTransactionByBlockHashAndIndexProvider &
|
|
833
|
-
EIP1193GetTransactionByBlockNumberAndIndexProvider &
|
|
834
|
-
EIP1193GetTransactionReceiptProvider &
|
|
835
|
-
EIP1193GetUncleByBlockHashAndIndexProvider &
|
|
836
|
-
EIP1193GetUncleByBlockNumberAndIndexProvider &
|
|
837
|
-
EIP1193GetLogsProvider &
|
|
838
|
-
EIP1193PersonalSignProvider &
|
|
839
|
-
EIP1193PTypedSignv4Provider &
|
|
840
|
-
EIP1193PTypedSignProvider &
|
|
841
|
-
EIP1193ChainIdProvider &
|
|
842
|
-
EIP1193RequestAccountsProvider &
|
|
843
|
-
ERIP1193SwitchChainProvider &
|
|
844
|
-
ERIP1193AddChainProvider &
|
|
845
|
-
EIP1193SubscribtionProvider &
|
|
846
|
-
EIP1193GenericRequestProvider;
|
|
847
|
-
|
|
848
|
-
export type EIP1193WindowWalletProvider = EIP1193WalletProvider & EIP1193EventsProvider;
|
|
849
|
-
|
|
850
|
-
export type EIP1193SignerProvider = EIP1193AccountsProvider &
|
|
851
|
-
EIP1193LegacySignProvider &
|
|
852
|
-
EIP1193SignTransactionProvider &
|
|
853
|
-
EIP1193PersonalSignProvider &
|
|
854
|
-
EIP1193PTypedSignv4Provider &
|
|
855
|
-
EIP1193PTypedSignProvider &
|
|
856
|
-
EIP1193GenericRequestProvider;
|
|
857
|
-
|
|
858
|
-
export type EIP1193DebugProvider = EIP1193ProviderWithoutEvents &
|
|
859
|
-
EIP1193GenericRequestProvider &
|
|
860
|
-
EIP1193DebugTraceTransactionProvider;
|
|
861
|
-
|
|
478
|
+
// ------------------------------------------------------------------------------------------------
|
|
479
|
+
// EVENTS PROVIDERS
|
|
480
|
+
// ------------------------------------------------------------------------------------------------
|
|
862
481
|
export interface EIP1193OnMessageProvider {
|
|
863
482
|
on(eventName: 'message', listener: Listener<EIP1193Message>): this;
|
|
864
483
|
removeListener(eventName: 'message', listener: Listener<EIP1193Message>): this;
|
|
@@ -898,21 +517,3 @@ export interface EIP1193EventsProvider {
|
|
|
898
517
|
}
|
|
899
518
|
|
|
900
519
|
export interface EIP1193Provider extends EIP1193ProviderWithoutEvents, EIP1193EventsProvider {}
|
|
901
|
-
|
|
902
|
-
export type EIP1193DATA = `0x${string}`;
|
|
903
|
-
export type EIP1193BlockTag = EIP1193QUANTITY | 'latest' | 'earliest' | 'pending' | 'safe' | 'finalized';
|
|
904
|
-
|
|
905
|
-
export type EIP1898BlockTag =
|
|
906
|
-
| EIP1193QUANTITY
|
|
907
|
-
| 'latest'
|
|
908
|
-
| 'earliest'
|
|
909
|
-
| 'pending'
|
|
910
|
-
| 'safe'
|
|
911
|
-
| 'finalized'
|
|
912
|
-
| {blockHash: EIP1193QUANTITY; requireCanonical?: boolean} // EIP-1898
|
|
913
|
-
| {blockNumber: EIP1193QUANTITY}; // EIP-1898
|
|
914
|
-
|
|
915
|
-
export type EIP1193QUANTITY = `0x${string}`;
|
|
916
|
-
export type EIP1193ChainId = `0x${string}`;
|
|
917
|
-
export type EIP1193Account = `0x${string}`;
|
|
918
|
-
export type EIP1193Accounts = EIP1193Account[];
|