eip-1193 0.2.1 → 0.2.3

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 +56 -8
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -37,7 +37,7 @@ export type EIP1193Block = {
37
37
  miner: EIP1193Account;
38
38
  difficulty: EIP1193QUANTITY;
39
39
  totalDifficulty: EIP1193QUANTITY;
40
- extraEIP1193DATA: EIP1193DATA;
40
+ extraData: EIP1193DATA;
41
41
  size: EIP1193QUANTITY;
42
42
  gasLimit: EIP1193QUANTITY;
43
43
  gasUsed: EIP1193QUANTITY;
@@ -203,19 +203,19 @@ export type EIP1193BlockNumberRequest = {
203
203
 
204
204
  export type EIP1193GetBalanceRequest = {
205
205
  readonly method: "eth_getBalance";
206
- readonly params: [EIP1193Account] | [EIP1193Account, EIP1193BlockTag];
206
+ readonly params: [EIP1193Account] | [EIP1193Account, EIP1898BlockTag];
207
207
  };
208
208
 
209
209
  export type EIP1193GetStorageAtRequest = {
210
210
  readonly method: "eth_getStorageAt";
211
211
  readonly params:
212
212
  | [EIP1193Account, EIP1193QUANTITY]
213
- | [EIP1193Account, EIP1193QUANTITY, EIP1193BlockTag];
213
+ | [EIP1193Account, EIP1193QUANTITY, EIP1898BlockTag];
214
214
  };
215
215
 
216
216
  export type EIP1193GetTransactionCountRequest = {
217
217
  readonly method: "eth_getTransactionCount";
218
- readonly params: [EIP1193Account] | [EIP1193Account, EIP1193BlockTag];
218
+ readonly params: [EIP1193Account] | [EIP1193Account, EIP1898BlockTag];
219
219
  };
220
220
 
221
221
  export type EIP1193GetTransactionCountByHashRequest = {
@@ -240,7 +240,7 @@ export type EIP1193GetUncleCountByBlockNumberRequest = {
240
240
 
241
241
  export type EIP1193GetCodeRequest = {
242
242
  readonly method: "eth_getCode";
243
- readonly params: [EIP1193Account] | [EIP1193Account, EIP1193BlockTag];
243
+ readonly params: [EIP1193Account] | [EIP1193Account, EIP1898BlockTag];
244
244
  };
245
245
 
246
246
  export type EIP1193LegacySignRequest = {
@@ -265,12 +265,12 @@ export type EIP1193SendRawTransactionRequest = {
265
265
 
266
266
  export type EIP119CallRequest = {
267
267
  readonly method: "eth_call";
268
- readonly params: [EIP1193CallParam] | [EIP1193CallParam, EIP1193BlockTag];
268
+ readonly params: [EIP1193CallParam] | [EIP1193CallParam, EIP1898BlockTag];
269
269
  };
270
270
 
271
271
  export type EIP119EstimateGasRequest = {
272
272
  readonly method: "eth_estimateGas";
273
- readonly params: [EIP1193CallParam] | [EIP1193CallParam, EIP1193BlockTag];
273
+ readonly params: [EIP1193CallParam] | [EIP1193CallParam, EIP1193BlockTag]; // EIP1898BlockTag ?
274
274
  };
275
275
 
276
276
  export type EIP119GetBlockByHashRequest<T extends boolean = false> = {
@@ -383,6 +383,13 @@ export type EIP1193UnsubscribeRequest = {
383
383
  readonly params: [EIP1193DATA];
384
384
  };
385
385
 
386
+ export type EIP1193GetProofRequest = {
387
+ readonly method: "eth_getProof";
388
+ readonly params:
389
+ | [EIP1193DATA, EIP1193DATA[]]
390
+ | [EIP1193DATA, EIP1193DATA[], EIP1898BlockTag];
391
+ };
392
+
386
393
  // ------------------------------------------------------------------------------------------------
387
394
 
388
395
  export type EIP1193Request =
@@ -583,6 +590,34 @@ export type EIP1193ProviderWithoutEvents<T = EIP1193Request> = {
583
590
  // request(args: EIP1193GenericRequest): Promise<unknown>;
584
591
  };
585
592
 
593
+ // export interface EIP1193ProviderWithBasicEvents<T = EIP1193Request>
594
+ // extends BareEIP1193Provider<T> {
595
+ // on(
596
+ // eventName: "disconnect",
597
+ // listener: Listener<EIP1193ProviderRpcError>
598
+ // ): this;
599
+ // on(eventName: "accountsChanged", listener: Listener<EIP1193Account[]>): this;
600
+ // on(eventName: "chainChanged", listener: Listener<EIP1193ChainId>): this;
601
+ // on(eventName: "connect", listener: Listener<EIP1193ConnectInfoMessage>): this;
602
+
603
+ // removeListener(
604
+ // eventName: "disconnect",
605
+ // listener: Listener<EIP1193ProviderRpcError>
606
+ // ): this;
607
+ // removeListener(
608
+ // eventName: "accountsChanged",
609
+ // listener: Listener<EIP1193Account[]>
610
+ // ): this;
611
+ // removeListener(
612
+ // eventName: "chainChanged",
613
+ // listener: Listener<EIP1193ChainId>
614
+ // ): this;
615
+ // removeListener(
616
+ // eventName: "connect",
617
+ // listener: Listener<EIP1193ConnectInfoMessage>
618
+ // ): this;
619
+ // }
620
+
586
621
  export interface EIP1193Provider<T = EIP1193Request>
587
622
  extends EIP1193ProviderWithoutEvents<T> {
588
623
  on(eventName: "message", listener: Listener<EIP1193Message>): this;
@@ -624,7 +659,20 @@ export type EIP1193BlockTag =
624
659
  | EIP1193QUANTITY
625
660
  | "latest"
626
661
  | "earliest"
627
- | "pending";
662
+ | "pending"
663
+ | "safe"
664
+ | "finalized";
665
+
666
+ export type EIP1898BlockTag =
667
+ | EIP1193QUANTITY
668
+ | "latest"
669
+ | "earliest"
670
+ | "pending"
671
+ | "safe"
672
+ | "finalized"
673
+ | { blockHash: EIP1193QUANTITY; requireCanonical?: boolean } // EIP-1898
674
+ | { blockNumber: EIP1193QUANTITY }; // EIP-1898
675
+
628
676
  export type EIP1193QUANTITY = `0x${string}`;
629
677
  export type EIP1193ChainId = `0x${string}`;
630
678
  export type EIP1193Account = `0x${string}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eip-1193",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Types for EIP-1193",
5
5
  "keywords": [],
6
6
  "author": "",