eip-1193 0.2.5 → 0.3.1

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 +39 -17
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -18,16 +18,38 @@ export type EIP1193Transaction = {
18
18
  s: EIP1193QUANTITY;
19
19
  };
20
20
 
21
- export type EIP1193TransactionData = {
21
+ type BaseEIP1193TransactionData = {
22
22
  from: EIP1193Account;
23
23
  to?: EIP1193Account;
24
24
  gas?: EIP1193QUANTITY;
25
- gasPrice?: EIP1193QUANTITY;
26
25
  value?: EIP1193QUANTITY;
27
26
  data?: EIP1193DATA;
28
27
  nonce?: EIP1193QUANTITY;
29
28
  };
30
29
 
30
+ export type EIP1193LegacyTransactionData = BaseEIP1193TransactionData & {
31
+ type?: '0x0';
32
+ gasPrice?: EIP1193QUANTITY;
33
+ };
34
+
35
+
36
+ export type EIP1193TransactionDataOfType1 = BaseEIP1193TransactionData & {
37
+ type: "0x1",
38
+ chainId?: EIP1193ChainId;
39
+ accessList?: EIP1193Account[];
40
+ gasPrice?: EIP1193QUANTITY;
41
+ }
42
+
43
+ export type EIP1193TransactionDataOfType2 = BaseEIP1193TransactionData & {
44
+ type: "0x2",
45
+ chainId?: EIP1193ChainId;
46
+ accessList?: EIP1193Account[];
47
+ maxFeePerGas?: EIP1193QUANTITY;
48
+ maxPriorityFeePerGas?: EIP1193QUANTITY
49
+ }
50
+
51
+ export type EIP1193TransactionData = EIP1193LegacyTransactionData | EIP1193TransactionDataOfType2;
52
+
31
53
  export type EIP1193SyncingStatus = {
32
54
  startingBlock: EIP1193QUANTITY;
33
55
  currentBlock: EIP1193QUANTITY;
@@ -452,21 +474,21 @@ export type EIP1193Request =
452
474
  | EIP1193GasPriceRequest;
453
475
 
454
476
  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>;
477
+ | EIP1193ChainId
478
+ | EIP1193SyncingStatus | false
479
+ | EIP1193QUANTITY
480
+ | EIP1193BlockWithTransactions
481
+ | EIP1193Transaction
482
+ | EIP1193TransactionReceipt
483
+ | EIP1193Block
484
+ | EIP1193Log[]
485
+ | EIP1193DATA
486
+ | EIP1193ChainId
487
+ | EIP1193Accounts
488
+ | EIP1193SwitchChainError
489
+ | EIP1193AddChainError
490
+ | string
491
+ | boolean;
470
492
 
471
493
  export type EIP1193GenericRequest = {
472
494
  method: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eip-1193",
3
- "version": "0.2.5",
3
+ "version": "0.3.1",
4
4
  "description": "Types for EIP-1193",
5
5
  "keywords": [],
6
6
  "author": "",