eip-1193 0.2.2 → 0.2.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.
Files changed (2) hide show
  1. package/index.d.ts +58 -10
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -18,6 +18,16 @@ export type EIP1193Transaction = {
18
18
  s: EIP1193QUANTITY;
19
19
  };
20
20
 
21
+ export type EIP1193TransactionData = {
22
+ from: EIP1193Account;
23
+ to: EIP1193Account;
24
+ gas: EIP1193QUANTITY;
25
+ gasPrice: EIP1193QUANTITY;
26
+ value: EIP1193QUANTITY;
27
+ data: EIP1193DATA;
28
+ nonce: EIP1193QUANTITY;
29
+ };
30
+
21
31
  export type EIP1193SyncingStatus = {
22
32
  startingBlock: EIP1193QUANTITY;
23
33
  currentBlock: EIP1193QUANTITY;
@@ -203,19 +213,19 @@ export type EIP1193BlockNumberRequest = {
203
213
 
204
214
  export type EIP1193GetBalanceRequest = {
205
215
  readonly method: "eth_getBalance";
206
- readonly params: [EIP1193Account] | [EIP1193Account, EIP1193BlockTag];
216
+ readonly params: [EIP1193Account] | [EIP1193Account, EIP1898BlockTag];
207
217
  };
208
218
 
209
219
  export type EIP1193GetStorageAtRequest = {
210
220
  readonly method: "eth_getStorageAt";
211
221
  readonly params:
212
222
  | [EIP1193Account, EIP1193QUANTITY]
213
- | [EIP1193Account, EIP1193QUANTITY, EIP1193BlockTag];
223
+ | [EIP1193Account, EIP1193QUANTITY, EIP1898BlockTag];
214
224
  };
215
225
 
216
226
  export type EIP1193GetTransactionCountRequest = {
217
227
  readonly method: "eth_getTransactionCount";
218
- readonly params: [EIP1193Account] | [EIP1193Account, EIP1193BlockTag];
228
+ readonly params: [EIP1193Account] | [EIP1193Account, EIP1898BlockTag];
219
229
  };
220
230
 
221
231
  export type EIP1193GetTransactionCountByHashRequest = {
@@ -240,7 +250,7 @@ export type EIP1193GetUncleCountByBlockNumberRequest = {
240
250
 
241
251
  export type EIP1193GetCodeRequest = {
242
252
  readonly method: "eth_getCode";
243
- readonly params: [EIP1193Account] | [EIP1193Account, EIP1193BlockTag];
253
+ readonly params: [EIP1193Account] | [EIP1193Account, EIP1898BlockTag];
244
254
  };
245
255
 
246
256
  export type EIP1193LegacySignRequest = {
@@ -250,12 +260,12 @@ export type EIP1193LegacySignRequest = {
250
260
 
251
261
  export type EIP1193SignTransactionRequest = {
252
262
  readonly method: "eth_signTransaction";
253
- readonly params: [EIP1193Transaction];
263
+ readonly params: [EIP1193TransactionData];
254
264
  };
255
265
 
256
266
  export type EIP1193SendTransactionRequest = {
257
267
  readonly method: "eth_sendTransaction";
258
- readonly params: [EIP1193Transaction];
268
+ readonly params: [EIP1193TransactionData];
259
269
  };
260
270
 
261
271
  export type EIP1193SendRawTransactionRequest = {
@@ -265,12 +275,12 @@ export type EIP1193SendRawTransactionRequest = {
265
275
 
266
276
  export type EIP119CallRequest = {
267
277
  readonly method: "eth_call";
268
- readonly params: [EIP1193CallParam] | [EIP1193CallParam, EIP1193BlockTag];
278
+ readonly params: [EIP1193CallParam] | [EIP1193CallParam, EIP1898BlockTag];
269
279
  };
270
280
 
271
281
  export type EIP119EstimateGasRequest = {
272
282
  readonly method: "eth_estimateGas";
273
- readonly params: [EIP1193CallParam] | [EIP1193CallParam, EIP1193BlockTag];
283
+ readonly params: [EIP1193CallParam] | [EIP1193CallParam, EIP1193BlockTag]; // EIP1898BlockTag ?
274
284
  };
275
285
 
276
286
  export type EIP119GetBlockByHashRequest<T extends boolean = false> = {
@@ -383,6 +393,13 @@ export type EIP1193UnsubscribeRequest = {
383
393
  readonly params: [EIP1193DATA];
384
394
  };
385
395
 
396
+ export type EIP1193GetProofRequest = {
397
+ readonly method: "eth_getProof";
398
+ readonly params:
399
+ | [EIP1193DATA, EIP1193DATA[]]
400
+ | [EIP1193DATA, EIP1193DATA[], EIP1898BlockTag];
401
+ };
402
+
386
403
  // ------------------------------------------------------------------------------------------------
387
404
 
388
405
  export type EIP1193Request =
@@ -431,7 +448,25 @@ export type EIP1193Request =
431
448
  | ERIP1193SwitchChainRequest
432
449
  | ERIP1193AddChainRequest
433
450
  | EIP1193SubscribeRequest
434
- | EIP1193UnsubscribeRequest;
451
+ | EIP1193UnsubscribeRequest
452
+ | EIP1193GasPriceRequest;
453
+
454
+ export type EIP1193Response =
455
+ | Promise<EIP1193ChainId>
456
+ | Promise<EIP1193SyncingStatus | false>
457
+ | Promise<EIP1193QUANTITY>
458
+ | Promise<EIP1193BlockWithTransactions>
459
+ | Promise<EIP1193Transaction>
460
+ | Promise<EIP1193TransactionReceipt>
461
+ | Promise<EIP1193Block>
462
+ | Promise<EIP1193Log[]>
463
+ | Promise<EIP1193DATA>
464
+ | Promise<EIP1193ChainId>
465
+ | Promise<EIP1193Accounts>
466
+ | Promise<EIP1193SwitchChainError>
467
+ | Promise<EIP1193AddChainError>
468
+ | Promise<string>
469
+ | Promise<boolean>;
435
470
 
436
471
  export type EIP1193GenericRequest = {
437
472
  method: string;
@@ -652,7 +687,20 @@ export type EIP1193BlockTag =
652
687
  | EIP1193QUANTITY
653
688
  | "latest"
654
689
  | "earliest"
655
- | "pending";
690
+ | "pending"
691
+ | "safe"
692
+ | "finalized";
693
+
694
+ export type EIP1898BlockTag =
695
+ | EIP1193QUANTITY
696
+ | "latest"
697
+ | "earliest"
698
+ | "pending"
699
+ | "safe"
700
+ | "finalized"
701
+ | { blockHash: EIP1193QUANTITY; requireCanonical?: boolean } // EIP-1898
702
+ | { blockNumber: EIP1193QUANTITY }; // EIP-1898
703
+
656
704
  export type EIP1193QUANTITY = `0x${string}`;
657
705
  export type EIP1193ChainId = `0x${string}`;
658
706
  export type EIP1193Account = `0x${string}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eip-1193",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Types for EIP-1193",
5
5
  "keywords": [],
6
6
  "author": "",