@msaki/eth-rpc 0.1.1 → 0.2.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.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/engine/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/engine/index.ts"],"names":[],"mappings":""}
@@ -1,5 +1,3 @@
1
- export type * as EthSchema from "./types";
2
- import type { EthSchema } from ".";
3
1
  export declare enum Methods {
4
2
  eth_getTransactionByHash = "eth_getTransactionByHash",
5
3
  eth_getTransactionByBlockHashAndIndex = "eth_getTransactionByBlockHashAndIndex",
@@ -19,29 +17,71 @@ export declare enum Methods {
19
17
  eth_uninstallFilter = "eth_uninstallFilter",
20
18
  eth_getFilterChanges = "eth_getFilterChanges",
21
19
  eth_getFilterLogs = "eth_getFilterLogs",
22
- eth_getLogs = "eth_getLogs"
20
+ eth_getLogs = "eth_getLogs",
21
+ eth_gasPrice = "eth_gasPrice",
22
+ eth_blobBaseFee = "eth_blobBaseFee",
23
+ eth_maxPriorityFeePerGas = "eth_maxPriorityFeePerGas",
24
+ eth_feeHistory = "eth_feeHistory",
25
+ eth_call = "eth_call",
26
+ eth_estimateGas = "eth_estimateGas",
27
+ eth_createAccessList = "eth_createAccessList",
28
+ eth_simulateV1 = "eth_simulateV1",
29
+ eth_chainId = "eth_chainId",
30
+ eth_syncing = "eth_syncing",
31
+ eth_coinbase = "eth_coinbase",
32
+ eth_accounts = "eth_accounts",
33
+ eth_blockNumber = "eth_blockNumber",
34
+ net_version = "net_version",
35
+ eth_getBlockByHash = "eth_getBlockByHash",
36
+ eth_getBlockByNumber = "eth_getBlockByNumber",
37
+ eth_getBlockTransactionCountByHash = "eth_getBlockTransactionCountByHash",
38
+ eth_getBlockTransactionCountByNumber = "eth_getBlockTransactionCountByNumber",
39
+ eth_getUncleCountByBlockHash = "eth_getUncleCountByBlockHash",
40
+ eth_getUncleCountByBlockNumber = "eth_getUncleCountByBlockNumber",
41
+ eth_getBlockReceipts = "eth_getBlockReceipts"
23
42
  }
24
43
  export declare class EthExecutionClient {
25
44
  private client;
26
45
  constructor(url: string);
27
- eth_getTransactionByHash(transactioHash: EthSchema.Hash32): Promise<EthSchema.NotFound | EthSchema.TransactionInfo>;
28
- eth_getTransactionByBlockHashAndIndex(blockHash: EthSchema.Hash32, transactionIndex: EthSchema.Uint): Promise<EthSchema.NotFound | EthSchema.TransactionInfo>;
29
- eth_getTransactionReceipt(transactionHash: EthSchema.Hash32): Promise<EthSchema.NotFound | EthSchema.ReceiptInfo>;
30
- eth_sendTransaction(transaction: EthSchema.GenericTransaction): Promise<EthSchema.Hash32>;
31
- eth_sendRawTransaction(transaction: EthSchema.Bytes): Promise<EthSchema.Hash32>;
32
- eth_getBalance(address: EthSchema.Address, block: EthSchema.BlockNumberOrTagOrHash): Promise<EthSchema.Uint>;
33
- eth_getStorageAt(address: EthSchema.Address, storageSlot: EthSchema.Bytes32, block: EthSchema.BlockNumberOrTagOrHash): Promise<EthSchema.Bytes>;
34
- eth_getTransactionCount(address: EthSchema.Address, block: EthSchema.BlockNumberOrTagOrHash): Promise<EthSchema.Uint>;
35
- eth_getCode(address: EthSchema.Address, block: EthSchema.BlockNumberOrTagOrHash): Promise<EthSchema.Bytes>;
36
- eth_getProof(address: EthSchema.Address, storageKeys: EthSchema.Bytes32[], block: EthSchema.BlockNumberOrTagOrHash): Promise<EthSchema.AccountProof>;
37
- eth_sign(address: EthSchema.Address, message: EthSchema.Bytes): Promise<EthSchema.Bytes65>;
38
- eth_signTransaction(transaction: EthSchema.GenericTransaction): Promise<EthSchema.Bytes>;
39
- eth_newFilter(filter: EthSchema.Filter): Promise<EthSchema.Uint>;
40
- eth_newBlockFilter(): Promise<EthSchema.Uint>;
41
- eth_newPendingTransactionFilter(): Promise<EthSchema.Uint>;
42
- eth_uninstallFilter(): Promise<EthSchema.Uint>;
43
- eth_getFilterChanges(): Promise<EthSchema.FilterResults>;
44
- eth_getFilterLogs(filterIdentifier: EthSchema.Uint): Promise<EthSchema.FilterResults>;
45
- eth_getLogs(filter: EthSchema.Filter): Promise<EthSchema.FilterResults>;
46
+ eth_getTransactionByHash(transactioHash: Hash32): Promise<NotFound | TransactionInfo>;
47
+ eth_getTransactionByBlockHashAndIndex(blockHash: Hash32, transactionIndex: Uint): Promise<NotFound | TransactionInfo>;
48
+ eth_getTransactionReceipt(transactionHash: Hash32): Promise<NotFound | ReceiptInfo>;
49
+ eth_sendTransaction(transaction: GenericTransaction): Promise<Hash32>;
50
+ eth_sendRawTransaction(transaction: Bytes): Promise<Hash32>;
51
+ eth_getBalance(address: Address, block: BlockNumberOrTagOrHash): Promise<Uint>;
52
+ eth_getStorageAt(address: Address, storageSlot: Bytes32, block: BlockNumberOrTagOrHash): Promise<Bytes>;
53
+ eth_getTransactionCount(address: Address, block: BlockNumberOrTagOrHash): Promise<Uint>;
54
+ eth_getCode(address: Address, block: BlockNumberOrTagOrHash): Promise<Bytes>;
55
+ eth_getProof(address: Address, storageKeys: Bytes32[], block: BlockNumberOrTagOrHash): Promise<AccountProof>;
56
+ eth_sign(address: Address, message: Bytes): Promise<Bytes65>;
57
+ eth_signTransaction(transaction: GenericTransaction): Promise<Bytes>;
58
+ eth_newFilter(filter: Filter): Promise<Uint>;
59
+ eth_newBlockFilter(): Promise<Uint>;
60
+ eth_newPendingTransactionFilter(): Promise<Uint>;
61
+ eth_uninstallFilter(): Promise<Uint>;
62
+ eth_getFilterChanges(): Promise<FilterResults>;
63
+ eth_getFilterLogs(filterIdentifier: Uint): Promise<FilterResults>;
64
+ eth_getLogs(filter: Filter): Promise<FilterResults>;
65
+ eth_gasPrice(): Promise<Uint>;
66
+ eth_blobBaseFee(): Promise<Uint>;
67
+ eth_maxPriorityFeePerGas(): Promise<Uint>;
68
+ eth_feeHistory(blockCount: Uint, newestBlock: BlockNumberOrTag, rewardPercentiles: number[]): Promise<FeeHistoryResults>;
69
+ eth_call(transaction: GenericTransaction, block: BlockNumberOrTagOrHash): Promise<Bytes>;
70
+ eth_estimateGas(transaction: GenericTransaction, block: BlockNumberOrTag): Promise<Uint>;
71
+ eth_createAccessList(transaction: GenericTransaction, block: BlockNumberOrTag): Promise<AccessListResult>;
72
+ eth_simulateV1(payload: EthSimulatePayload, blockTag: BlockNumberOrTagOrHash): Promise<EthSimulateResult>;
73
+ eth_chainId(): Promise<Uint>;
74
+ eth_syncing(): Promise<SyncingStatus>;
75
+ eth_coinbase(): Promise<Address>;
76
+ eth_accounts(): Promise<Addresses>;
77
+ eth_blockNumber(): Promise<Uint>;
78
+ net_version(): Promise<UintDecimal>;
79
+ eth_getBlockByHash(blockHash: Hash32, hydratedTransactions: boolean): Promise<NotFound | Block>;
80
+ eth_getBlockByNumber(block: BlockNumberOrTag, hydratedTransactions: boolean): Promise<NotFound | Block>;
81
+ eth_getBlockTransactionCountByHash(blockHash: Hash32): Promise<NotFound | Uint>;
82
+ eth_getBlockTransactionCountByNumber(block: BlockNumberOrTag): Promise<NotFound | Uint>;
83
+ eth_getUncleCountByBlockHash(blockHash: Hash32): Promise<NotFound | Uint>;
84
+ eth_getUncleCountByBlockNumber(block: BlockNumberOrTag): Promise<NotFound | Uint>;
85
+ eth_getBlockReceipts(block: BlockNumberOrTagOrHash): Promise<NotFound | ReceiptInfo>;
46
86
  }
47
87
  //# sourceMappingURL=eth-methods.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"eth-methods.d.ts","sourceRoot":"","sources":["../src/eth-methods.ts"],"names":[],"mappings":"AACA,YAAY,KAAK,SAAS,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAEnC,oBAAY,OAAO;IAElB,wBAAwB,6BAA6B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AAC,QAAQ,GAAG,KAAK,CAAC;IAMtB,oBAAoB,CACzB,KAAK,EAAE,gBAAgB,EACvB,oBAAoB,EAAE,OAAO,GAC3B,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC;IAMtB,kCAAkC,CACvC,SAAS,EAAE,MAAM,GACf,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAKrB,oCAAoC,CACzC,KAAK,EAAE,gBAAgB,GACrB,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAMrB,4BAA4B,CACjC,SAAS,EAAE,MAAM,GACf,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAKrB,8BAA8B,CACnC,KAAK,EAAE,gBAAgB,GACrB,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAKrB,oBAAoB,CACzB,KAAK,EAAE,sBAAsB,GAC3B,OAAO,CAAC,QAAQ,GAAG,WAAW,CAAC;CAGlC"}
@@ -1,4 +1,4 @@
1
- import { JsonRpcClient, initializeRpcClient } from "@msaki/jsonrpc";
1
+ import { initializeRpcClient, JsonRpcClient } from "@msaki/jsonrpc";
2
2
  export var Methods;
3
3
  (function (Methods) {
4
4
  // eth/transaction
@@ -25,6 +25,31 @@ export var Methods;
25
25
  Methods["eth_getFilterChanges"] = "eth_getFilterChanges";
26
26
  Methods["eth_getFilterLogs"] = "eth_getFilterLogs";
27
27
  Methods["eth_getLogs"] = "eth_getLogs";
28
+ // eth/feeMarket
29
+ Methods["eth_gasPrice"] = "eth_gasPrice";
30
+ Methods["eth_blobBaseFee"] = "eth_blobBaseFee";
31
+ Methods["eth_maxPriorityFeePerGas"] = "eth_maxPriorityFeePerGas";
32
+ Methods["eth_feeHistory"] = "eth_feeHistory";
33
+ // eth/execute
34
+ Methods["eth_call"] = "eth_call";
35
+ Methods["eth_estimateGas"] = "eth_estimateGas";
36
+ Methods["eth_createAccessList"] = "eth_createAccessList";
37
+ Methods["eth_simulateV1"] = "eth_simulateV1";
38
+ // eth/client
39
+ Methods["eth_chainId"] = "eth_chainId";
40
+ Methods["eth_syncing"] = "eth_syncing";
41
+ Methods["eth_coinbase"] = "eth_coinbase";
42
+ Methods["eth_accounts"] = "eth_accounts";
43
+ Methods["eth_blockNumber"] = "eth_blockNumber";
44
+ Methods["net_version"] = "net_version";
45
+ // eth/block
46
+ Methods["eth_getBlockByHash"] = "eth_getBlockByHash";
47
+ Methods["eth_getBlockByNumber"] = "eth_getBlockByNumber";
48
+ Methods["eth_getBlockTransactionCountByHash"] = "eth_getBlockTransactionCountByHash";
49
+ Methods["eth_getBlockTransactionCountByNumber"] = "eth_getBlockTransactionCountByNumber";
50
+ Methods["eth_getUncleCountByBlockHash"] = "eth_getUncleCountByBlockHash";
51
+ Methods["eth_getUncleCountByBlockNumber"] = "eth_getUncleCountByBlockNumber";
52
+ Methods["eth_getBlockReceipts"] = "eth_getBlockReceipts";
28
53
  })(Methods || (Methods = {}));
29
54
  export class EthExecutionClient {
30
55
  client;
@@ -112,5 +137,94 @@ export class EthExecutionClient {
112
137
  async eth_getLogs(filter) {
113
138
  return await this.client.call(Methods.eth_getLogs, [filter]);
114
139
  }
140
+ // eth/feeMarket
141
+ async eth_gasPrice() {
142
+ return await this.client.call(Methods.eth_gasPrice, []);
143
+ }
144
+ async eth_blobBaseFee() {
145
+ return await this.client.call(Methods.eth_blobBaseFee, []);
146
+ }
147
+ async eth_maxPriorityFeePerGas() {
148
+ return await this.client.call(Methods.eth_maxPriorityFeePerGas, []);
149
+ }
150
+ async eth_feeHistory(blockCount, newestBlock, rewardPercentiles) {
151
+ return await this.client.call(Methods.eth_feeHistory, [
152
+ blockCount,
153
+ newestBlock,
154
+ rewardPercentiles,
155
+ ]);
156
+ }
157
+ // eth/execute
158
+ async eth_call(transaction, block) {
159
+ return this.client.call(Methods.eth_call, [transaction, block]);
160
+ }
161
+ async eth_estimateGas(transaction, block) {
162
+ return await this.client.call(Methods.eth_estimateGas, [
163
+ transaction,
164
+ block,
165
+ ]);
166
+ }
167
+ async eth_createAccessList(transaction, block) {
168
+ return await this.client.call(Methods.eth_createAccessList, [
169
+ transaction,
170
+ block,
171
+ ]);
172
+ }
173
+ async eth_simulateV1(payload, blockTag) {
174
+ return await this.client.call(Methods.eth_simulateV1, [payload, blockTag]);
175
+ }
176
+ // eth/client
177
+ async eth_chainId() {
178
+ return await this.client.call(Methods.eth_chainId, []);
179
+ }
180
+ async eth_syncing() {
181
+ return await this.client.call(Methods.eth_syncing, []);
182
+ }
183
+ async eth_coinbase() {
184
+ return await this.client.call(Methods.eth_coinbase, []);
185
+ }
186
+ async eth_accounts() {
187
+ return await this.client.call(Methods.eth_accounts, []);
188
+ }
189
+ async eth_blockNumber() {
190
+ return await this.client.call(Methods.eth_blockNumber, []);
191
+ }
192
+ async net_version() {
193
+ return await this.client.call(Methods.net_version, []);
194
+ }
195
+ // eth/block
196
+ async eth_getBlockByHash(blockHash, hydratedTransactions) {
197
+ return await this.client.call(Methods.eth_getBlockByHash, [
198
+ blockHash,
199
+ hydratedTransactions,
200
+ ]);
201
+ }
202
+ async eth_getBlockByNumber(block, hydratedTransactions) {
203
+ return await this.client.call(Methods.eth_getBlockByNumber, [
204
+ block,
205
+ hydratedTransactions,
206
+ ]);
207
+ }
208
+ async eth_getBlockTransactionCountByHash(blockHash) {
209
+ return await this.client.call(Methods.eth_getBlockTransactionCountByHash, [
210
+ blockHash,
211
+ ]);
212
+ }
213
+ async eth_getBlockTransactionCountByNumber(block) {
214
+ return await this.client.call(Methods.eth_getBlockTransactionCountByNumber, [block]);
215
+ }
216
+ async eth_getUncleCountByBlockHash(blockHash) {
217
+ return await this.client.call(Methods.eth_getUncleCountByBlockHash, [
218
+ blockHash,
219
+ ]);
220
+ }
221
+ async eth_getUncleCountByBlockNumber(block) {
222
+ return await this.client.call(Methods.eth_getUncleCountByBlockNumber, [
223
+ block,
224
+ ]);
225
+ }
226
+ async eth_getBlockReceipts(block) {
227
+ return await this.client.call(Methods.eth_getBlockReceipts, [block]);
228
+ }
115
229
  }
116
230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C,oBAAoB,CACzB,KAAuB,EACvB,oBAA6B;QAE7B,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE;YAC3D,KAAK;YACL,oBAAoB;SACpB,CAAC,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,kCAAkC,CACvC,SAAiB;QAEjB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,kCAAkC,EAAE;YACzE,SAAS;SACT,CAAC,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,oCAAoC,CACzC,KAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAC5B,OAAO,CAAC,oCAAoC,EAC5C,CAAC,KAAK,CAAC,CACP,CAAC;IACH,CAAC;IACD,KAAK,CAAC,4BAA4B,CACjC,SAAiB;QAEjB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,4BAA4B,EAAE;YACnE,SAAS;SACT,CAAC,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,8BAA8B,CACnC,KAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,8BAA8B,EAAE;YACrE,KAAK;SACL,CAAC,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,oBAAoB,CACzB,KAA6B;QAE7B,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACtE,CAAC;CACD"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export * from "./types";
2
- export * from "./eth-methods";
3
1
  export * from "./beacon-methods";
2
+ export * from "./eth-methods";
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
- export * from "./types";
2
- export * from "./eth-methods";
3
1
  export * from "./beacon-methods";
2
+ export * from "./eth-methods";
4
3
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@msaki/eth-rpc",
3
3
  "author": "Meek Msaki",
4
- "version": "0.1.1",
4
+ "version": "0.2.0",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
File without changes
@@ -1,6 +1,4 @@
1
- import { JsonRpcClient, initializeRpcClient } from "@msaki/jsonrpc";
2
- export type * as EthSchema from "./types";
3
- import type { EthSchema } from ".";
1
+ import { initializeRpcClient, JsonRpcClient } from "@msaki/jsonrpc";
4
2
 
5
3
  export enum Methods {
6
4
  // eth/transaction
@@ -27,6 +25,31 @@ export enum Methods {
27
25
  eth_getFilterChanges = "eth_getFilterChanges",
28
26
  eth_getFilterLogs = "eth_getFilterLogs",
29
27
  eth_getLogs = "eth_getLogs",
28
+ // eth/feeMarket
29
+ eth_gasPrice = "eth_gasPrice",
30
+ eth_blobBaseFee = "eth_blobBaseFee",
31
+ eth_maxPriorityFeePerGas = "eth_maxPriorityFeePerGas",
32
+ eth_feeHistory = "eth_feeHistory",
33
+ // eth/execute
34
+ eth_call = "eth_call",
35
+ eth_estimateGas = "eth_estimateGas",
36
+ eth_createAccessList = "eth_createAccessList",
37
+ eth_simulateV1 = "eth_simulateV1",
38
+ // eth/client
39
+ eth_chainId = "eth_chainId",
40
+ eth_syncing = "eth_syncing",
41
+ eth_coinbase = "eth_coinbase",
42
+ eth_accounts = "eth_accounts",
43
+ eth_blockNumber = "eth_blockNumber",
44
+ net_version = "net_version",
45
+ // eth/block
46
+ eth_getBlockByHash = "eth_getBlockByHash",
47
+ eth_getBlockByNumber = "eth_getBlockByNumber",
48
+ eth_getBlockTransactionCountByHash = "eth_getBlockTransactionCountByHash",
49
+ eth_getBlockTransactionCountByNumber = "eth_getBlockTransactionCountByNumber",
50
+ eth_getUncleCountByBlockHash = "eth_getUncleCountByBlockHash",
51
+ eth_getUncleCountByBlockNumber = "eth_getUncleCountByBlockNumber",
52
+ eth_getBlockReceipts = "eth_getBlockReceipts",
30
53
  }
31
54
 
32
55
  export class EthExecutionClient {
@@ -38,54 +61,50 @@ export class EthExecutionClient {
38
61
 
39
62
  // eth/transaction
40
63
  async eth_getTransactionByHash(
41
- transactioHash: EthSchema.Hash32,
42
- ): Promise<EthSchema.NotFound | EthSchema.TransactionInfo> {
64
+ transactioHash: Hash32,
65
+ ): Promise<NotFound | TransactionInfo> {
43
66
  return await this.client.call(Methods.eth_getTransactionByHash, [
44
67
  transactioHash,
45
68
  ]);
46
69
  }
47
70
  async eth_getTransactionByBlockHashAndIndex(
48
- blockHash: EthSchema.Hash32,
49
- transactionIndex: EthSchema.Uint,
50
- ): Promise<EthSchema.NotFound | EthSchema.TransactionInfo> {
71
+ blockHash: Hash32,
72
+ transactionIndex: Uint,
73
+ ): Promise<NotFound | TransactionInfo> {
51
74
  return await this.client.call(
52
75
  Methods.eth_getTransactionByBlockHashAndIndex,
53
76
  [blockHash, transactionIndex],
54
77
  );
55
78
  }
56
79
  async eth_getTransactionReceipt(
57
- transactionHash: EthSchema.Hash32,
58
- ): Promise<EthSchema.NotFound | EthSchema.ReceiptInfo> {
80
+ transactionHash: Hash32,
81
+ ): Promise<NotFound | ReceiptInfo> {
59
82
  return await this.client.call(Methods.eth_getTransactionReceipt, [
60
83
  transactionHash,
61
84
  ]);
62
85
  }
63
86
 
64
87
  // eth/submit
65
- async eth_sendTransaction(
66
- transaction: EthSchema.GenericTransaction,
67
- ): Promise<EthSchema.Hash32> {
88
+ async eth_sendTransaction(transaction: GenericTransaction): Promise<Hash32> {
68
89
  return await this.client.call(Methods.eth_sendTransaction, [transaction]);
69
90
  }
70
- async eth_sendRawTransaction(
71
- transaction: EthSchema.Bytes,
72
- ): Promise<EthSchema.Hash32> {
91
+ async eth_sendRawTransaction(transaction: Bytes): Promise<Hash32> {
73
92
  return await this.client.call(Methods.eth_sendRawTransaction, [
74
93
  transaction,
75
94
  ]);
76
95
  }
77
96
  // eth/state
78
97
  async eth_getBalance(
79
- address: EthSchema.Address,
80
- block: EthSchema.BlockNumberOrTagOrHash,
81
- ): Promise<EthSchema.Uint> {
98
+ address: Address,
99
+ block: BlockNumberOrTagOrHash,
100
+ ): Promise<Uint> {
82
101
  return await this.client.call(Methods.eth_getBalance, [address, block]);
83
102
  }
84
103
  async eth_getStorageAt(
85
- address: EthSchema.Address,
86
- storageSlot: EthSchema.Bytes32,
87
- block: EthSchema.BlockNumberOrTagOrHash,
88
- ): Promise<EthSchema.Bytes> {
104
+ address: Address,
105
+ storageSlot: Bytes32,
106
+ block: BlockNumberOrTagOrHash,
107
+ ): Promise<Bytes> {
89
108
  return await this.client.call(Methods.eth_getStorageAt, [
90
109
  address,
91
110
  storageSlot,
@@ -93,25 +112,25 @@ export class EthExecutionClient {
93
112
  ]);
94
113
  }
95
114
  async eth_getTransactionCount(
96
- address: EthSchema.Address,
97
- block: EthSchema.BlockNumberOrTagOrHash,
98
- ): Promise<EthSchema.Uint> {
115
+ address: Address,
116
+ block: BlockNumberOrTagOrHash,
117
+ ): Promise<Uint> {
99
118
  return await this.client.call(Methods.eth_getTransactionCount, [
100
119
  address,
101
120
  block,
102
121
  ]);
103
122
  }
104
123
  async eth_getCode(
105
- address: EthSchema.Address,
106
- block: EthSchema.BlockNumberOrTagOrHash,
107
- ): Promise<EthSchema.Bytes> {
124
+ address: Address,
125
+ block: BlockNumberOrTagOrHash,
126
+ ): Promise<Bytes> {
108
127
  return await this.client.call(Methods.eth_getCode, [address, block]);
109
128
  }
110
129
  async eth_getProof(
111
- address: EthSchema.Address,
112
- storageKeys: EthSchema.Bytes32[],
113
- block: EthSchema.BlockNumberOrTagOrHash,
114
- ): Promise<EthSchema.AccountProof> {
130
+ address: Address,
131
+ storageKeys: Bytes32[],
132
+ block: BlockNumberOrTagOrHash,
133
+ ): Promise<AccountProof> {
115
134
  return await this.client.call(Methods.eth_getProof, [
116
135
  address,
117
136
  storageKeys,
@@ -119,43 +138,158 @@ export class EthExecutionClient {
119
138
  ]);
120
139
  }
121
140
  // eth/sign
122
- async eth_sign(
123
- address: EthSchema.Address,
124
- message: EthSchema.Bytes,
125
- ): Promise<EthSchema.Bytes65> {
141
+ async eth_sign(address: Address, message: Bytes): Promise<Bytes65> {
126
142
  return await this.client.call(Methods.eth_sign, [address, message]);
127
143
  }
128
- async eth_signTransaction(
129
- transaction: EthSchema.GenericTransaction,
130
- ): Promise<EthSchema.Bytes> {
144
+ async eth_signTransaction(transaction: GenericTransaction): Promise<Bytes> {
131
145
  return await this.client.call(Methods.eth_signTransaction, [transaction]);
132
146
  }
133
147
  // eth/filter
134
- async eth_newFilter(filter: EthSchema.Filter): Promise<EthSchema.Uint> {
148
+ async eth_newFilter(filter: Filter): Promise<Uint> {
135
149
  return await this.client.call(Methods.eth_newFilter, [filter]);
136
150
  }
137
- async eth_newBlockFilter(): Promise<EthSchema.Uint> {
151
+ async eth_newBlockFilter(): Promise<Uint> {
138
152
  return await this.client.call(Methods.eth_newBlockFilter, []);
139
153
  }
140
- async eth_newPendingTransactionFilter(): Promise<EthSchema.Uint> {
154
+ async eth_newPendingTransactionFilter(): Promise<Uint> {
141
155
  return await this.client.call(Methods.eth_newPendingTransactionFilter, []);
142
156
  }
143
- async eth_uninstallFilter(): Promise<EthSchema.Uint> {
157
+ async eth_uninstallFilter(): Promise<Uint> {
144
158
  return await this.client.call(Methods.eth_uninstallFilter, []);
145
159
  }
146
- async eth_getFilterChanges(): Promise<EthSchema.FilterResults> {
160
+ async eth_getFilterChanges(): Promise<FilterResults> {
147
161
  return await this.client.call(Methods.eth_getFilterChanges, []);
148
162
  }
149
- async eth_getFilterLogs(
150
- filterIdentifier: EthSchema.Uint,
151
- ): Promise<EthSchema.FilterResults> {
163
+ async eth_getFilterLogs(filterIdentifier: Uint): Promise<FilterResults> {
152
164
  return await this.client.call(Methods.eth_getFilterLogs, [
153
165
  filterIdentifier,
154
166
  ]);
155
167
  }
156
- async eth_getLogs(
157
- filter: EthSchema.Filter,
158
- ): Promise<EthSchema.FilterResults> {
168
+ async eth_getLogs(filter: Filter): Promise<FilterResults> {
159
169
  return await this.client.call(Methods.eth_getLogs, [filter]);
160
170
  }
171
+ // eth/feeMarket
172
+ async eth_gasPrice(): Promise<Uint> {
173
+ return await this.client.call(Methods.eth_gasPrice, []);
174
+ }
175
+ async eth_blobBaseFee(): Promise<Uint> {
176
+ return await this.client.call(Methods.eth_blobBaseFee, []);
177
+ }
178
+ async eth_maxPriorityFeePerGas(): Promise<Uint> {
179
+ return await this.client.call(Methods.eth_maxPriorityFeePerGas, []);
180
+ }
181
+ async eth_feeHistory(
182
+ blockCount: Uint,
183
+ newestBlock: BlockNumberOrTag,
184
+ rewardPercentiles: number[],
185
+ ): Promise<FeeHistoryResults> {
186
+ return await this.client.call(Methods.eth_feeHistory, [
187
+ blockCount,
188
+ newestBlock,
189
+ rewardPercentiles,
190
+ ]);
191
+ }
192
+ // eth/execute
193
+ async eth_call(
194
+ transaction: GenericTransaction,
195
+ block: BlockNumberOrTagOrHash,
196
+ ): Promise<Bytes> {
197
+ return this.client.call(Methods.eth_call, [transaction, block]);
198
+ }
199
+ async eth_estimateGas(
200
+ transaction: GenericTransaction,
201
+ block: BlockNumberOrTag,
202
+ ): Promise<Uint> {
203
+ return await this.client.call(Methods.eth_estimateGas, [
204
+ transaction,
205
+ block,
206
+ ]);
207
+ }
208
+ async eth_createAccessList(
209
+ transaction: GenericTransaction,
210
+ block: BlockNumberOrTag,
211
+ ): Promise<AccessListResult> {
212
+ return await this.client.call(Methods.eth_createAccessList, [
213
+ transaction,
214
+ block,
215
+ ]);
216
+ }
217
+ async eth_simulateV1(
218
+ payload: EthSimulatePayload,
219
+ blockTag: BlockNumberOrTagOrHash,
220
+ ): Promise<EthSimulateResult> {
221
+ return await this.client.call(Methods.eth_simulateV1, [payload, blockTag]);
222
+ }
223
+ // eth/client
224
+ async eth_chainId(): Promise<Uint> {
225
+ return await this.client.call(Methods.eth_chainId, []);
226
+ }
227
+ async eth_syncing(): Promise<SyncingStatus> {
228
+ return await this.client.call(Methods.eth_syncing, []);
229
+ }
230
+ async eth_coinbase(): Promise<Address> {
231
+ return await this.client.call(Methods.eth_coinbase, []);
232
+ }
233
+ async eth_accounts(): Promise<Addresses> {
234
+ return await this.client.call(Methods.eth_accounts, []);
235
+ }
236
+ async eth_blockNumber(): Promise<Uint> {
237
+ return await this.client.call(Methods.eth_blockNumber, []);
238
+ }
239
+ async net_version(): Promise<UintDecimal> {
240
+ return await this.client.call(Methods.net_version, []);
241
+ }
242
+ // eth/block
243
+ async eth_getBlockByHash(
244
+ blockHash: Hash32,
245
+ hydratedTransactions: boolean,
246
+ ): Promise<NotFound | Block> {
247
+ return await this.client.call(Methods.eth_getBlockByHash, [
248
+ blockHash,
249
+ hydratedTransactions,
250
+ ]);
251
+ }
252
+ async eth_getBlockByNumber(
253
+ block: BlockNumberOrTag,
254
+ hydratedTransactions: boolean,
255
+ ): Promise<NotFound | Block> {
256
+ return await this.client.call(Methods.eth_getBlockByNumber, [
257
+ block,
258
+ hydratedTransactions,
259
+ ]);
260
+ }
261
+ async eth_getBlockTransactionCountByHash(
262
+ blockHash: Hash32,
263
+ ): Promise<NotFound | Uint> {
264
+ return await this.client.call(Methods.eth_getBlockTransactionCountByHash, [
265
+ blockHash,
266
+ ]);
267
+ }
268
+ async eth_getBlockTransactionCountByNumber(
269
+ block: BlockNumberOrTag,
270
+ ): Promise<NotFound | Uint> {
271
+ return await this.client.call(
272
+ Methods.eth_getBlockTransactionCountByNumber,
273
+ [block],
274
+ );
275
+ }
276
+ async eth_getUncleCountByBlockHash(
277
+ blockHash: Hash32,
278
+ ): Promise<NotFound | Uint> {
279
+ return await this.client.call(Methods.eth_getUncleCountByBlockHash, [
280
+ blockHash,
281
+ ]);
282
+ }
283
+ async eth_getUncleCountByBlockNumber(
284
+ block: BlockNumberOrTag,
285
+ ): Promise<NotFound | Uint> {
286
+ return await this.client.call(Methods.eth_getUncleCountByBlockNumber, [
287
+ block,
288
+ ]);
289
+ }
290
+ async eth_getBlockReceipts(
291
+ block: BlockNumberOrTagOrHash,
292
+ ): Promise<NotFound | ReceiptInfo> {
293
+ return await this.client.call(Methods.eth_getBlockReceipts, [block]);
294
+ }
161
295
  }
package/src/index.ts CHANGED
@@ -1,3 +1,2 @@
1
- export * from "./types";
2
- export * from "./eth-methods";
3
1
  export * from "./beacon-methods";
2
+ export * from "./eth-methods";