@msaki/eth-rpc 0.2.0 → 0.2.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.
- package/README.md +14 -0
- package/dist/beacon-api.d.ts +2 -0
- package/dist/beacon-api.d.ts.map +1 -0
- package/dist/beacon-api.js +1 -0
- package/dist/beacon-api.js.map +1 -0
- package/dist/debug-api.d.ts +10 -0
- package/dist/debug-api.d.ts.map +1 -0
- package/dist/debug-api.js +28 -0
- package/dist/debug-api.js.map +1 -0
- package/dist/engine-api.d.ts +61 -0
- package/dist/engine-api.d.ts.map +1 -0
- package/dist/engine-api.js +163 -0
- package/dist/engine-api.js.map +1 -0
- package/dist/{eth-methods.d.ts → eth-api.d.ts} +1 -43
- package/dist/eth-api.d.ts.map +1 -0
- package/dist/eth-api.js +183 -0
- package/dist/eth-api.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/debug-api.ts +30 -0
- package/src/engine-api.ts +254 -0
- package/src/eth-api.ts +254 -0
- package/src/index.ts +3 -2
- package/src/types/debug/methods.d.ts +11 -0
- package/src/types/engine/blob.d.ts +12 -0
- package/src/types/{forkchoice.d.ts → engine/forkchoice.d.ts} +0 -8
- package/src/types/engine/methods.d.ts +42 -0
- package/src/types/{engine.d.ts → engine/payload.d.ts} +0 -6
- package/src/types/engine/transition-configuration.d.ts +10 -0
- package/src/types/eth/methods.d.ts +55 -0
- package/dist/beacon-methods.d.ts +0 -2
- package/dist/beacon-methods.d.ts.map +0 -1
- package/dist/beacon-methods.js +0 -1
- package/dist/beacon-methods.js.map +0 -1
- package/dist/engine/index.d.ts +0 -2
- package/dist/engine/index.d.ts.map +0 -1
- package/dist/engine/index.js +0 -1
- package/dist/engine/index.js.map +0 -1
- package/dist/eth-methods.d.ts.map +0 -1
- package/dist/eth-methods.js +0 -230
- package/dist/eth-methods.js.map +0 -1
- package/src/engine/index.ts +0 -0
- package/src/eth-methods.ts +0 -295
- /package/src/{beacon-methods.ts → beacon-api.ts} +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
export enum EthMethods {
|
|
3
|
+
// eth/transaction
|
|
4
|
+
eth_getTransactionByHash = "eth_getTransactionByHash",
|
|
5
|
+
eth_getTransactionByBlockHashAndIndex = "eth_getTransactionByBlockHashAndIndex",
|
|
6
|
+
eth_getTransactionReceipt = "eth_getTransactionReceipt",
|
|
7
|
+
// eth/submit
|
|
8
|
+
eth_sendTransaction = "eth_sendTransaction",
|
|
9
|
+
eth_sendRawTransaction = "eth_sendRawTransaction",
|
|
10
|
+
// eth/state
|
|
11
|
+
eth_getBalance = "eth_getBalance",
|
|
12
|
+
eth_getStorageAt = "eth_getStorageAt",
|
|
13
|
+
eth_getTransactionCount = "eth_getTransactionCount",
|
|
14
|
+
eth_getCode = "eth_getCode",
|
|
15
|
+
eth_getProof = "eth_getProof",
|
|
16
|
+
// eth/sign
|
|
17
|
+
eth_sign = "eth_sign",
|
|
18
|
+
eth_signTransaction = "eth_signTransaction",
|
|
19
|
+
// eth/filter
|
|
20
|
+
eth_newFilter = "eth_newFilter",
|
|
21
|
+
eth_newBlockFilter = "eth_newBlockFilter",
|
|
22
|
+
eth_newPendingTransactionFilter = "eth_newPendingTransactionFilter",
|
|
23
|
+
eth_uninstallFilter = "eth_uninstallFilter",
|
|
24
|
+
eth_getFilterChanges = "eth_getFilterChanges",
|
|
25
|
+
eth_getFilterLogs = "eth_getFilterLogs",
|
|
26
|
+
eth_getLogs = "eth_getLogs",
|
|
27
|
+
// eth/feeMarket
|
|
28
|
+
eth_gasPrice = "eth_gasPrice",
|
|
29
|
+
eth_blobBaseFee = "eth_blobBaseFee",
|
|
30
|
+
eth_maxPriorityFeePerGas = "eth_maxPriorityFeePerGas",
|
|
31
|
+
eth_feeHistory = "eth_feeHistory",
|
|
32
|
+
// eth/execute
|
|
33
|
+
eth_call = "eth_call",
|
|
34
|
+
eth_estimateGas = "eth_estimateGas",
|
|
35
|
+
eth_createAccessList = "eth_createAccessList",
|
|
36
|
+
eth_simulateV1 = "eth_simulateV1",
|
|
37
|
+
// eth/client
|
|
38
|
+
eth_chainId = "eth_chainId",
|
|
39
|
+
eth_syncing = "eth_syncing",
|
|
40
|
+
eth_coinbase = "eth_coinbase",
|
|
41
|
+
eth_accounts = "eth_accounts",
|
|
42
|
+
eth_blockNumber = "eth_blockNumber",
|
|
43
|
+
net_version = "net_version",
|
|
44
|
+
// eth/block
|
|
45
|
+
eth_getBlockByHash = "eth_getBlockByHash",
|
|
46
|
+
eth_getBlockByNumber = "eth_getBlockByNumber",
|
|
47
|
+
eth_getBlockTransactionCountByHash = "eth_getBlockTransactionCountByHash",
|
|
48
|
+
eth_getBlockTransactionCountByNumber = "eth_getBlockTransactionCountByNumber",
|
|
49
|
+
eth_getUncleCountByBlockHash = "eth_getUncleCountByBlockHash",
|
|
50
|
+
eth_getUncleCountByBlockNumber = "eth_getUncleCountByBlockNumber",
|
|
51
|
+
eth_getBlockReceipts = "eth_getBlockReceipts",
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { };
|
package/dist/beacon-methods.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"beacon-methods.d.ts","sourceRoot":"","sources":["../src/beacon-methods.ts"],"names":[],"mappings":""}
|
package/dist/beacon-methods.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=beacon-methods.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"beacon-methods.js","sourceRoot":"","sources":["../src/beacon-methods.ts"],"names":[],"mappings":""}
|
package/dist/engine/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/engine/index.ts"],"names":[],"mappings":""}
|
package/dist/engine/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=index.js.map
|
package/dist/engine/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/engine/index.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eth-methods.d.ts","sourceRoot":"","sources":["../src/eth-methods.ts"],"names":[],"mappings":"AAEA,oBAAY,OAAO;IAElB,wBAAwB,6BAA6B;IACrD,qCAAqC,0CAA0C;IAC/E,yBAAyB,8BAA8B;IAEvD,mBAAmB,wBAAwB;IAC3C,sBAAsB,2BAA2B;IAEjD,cAAc,mBAAmB;IACjC,gBAAgB,qBAAqB;IACrC,uBAAuB,4BAA4B;IACnD,WAAW,gBAAgB;IAC3B,YAAY,iBAAiB;IAE7B,QAAQ,aAAa;IACrB,mBAAmB,wBAAwB;IAE3C,aAAa,kBAAkB;IAC/B,kBAAkB,uBAAuB;IACzC,+BAA+B,oCAAoC;IACnE,mBAAmB,wBAAwB;IAC3C,oBAAoB,yBAAyB;IAC7C,iBAAiB,sBAAsB;IACvC,WAAW,gBAAgB;IAE3B,YAAY,iBAAiB;IAC7B,eAAe,oBAAoB;IACnC,wBAAwB,6BAA6B;IACrD,cAAc,mBAAmB;IAEjC,QAAQ,aAAa;IACrB,eAAe,oBAAoB;IACnC,oBAAoB,yBAAyB;IAC7C,cAAc,mBAAmB;IAEjC,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,YAAY,iBAAiB;IAC7B,eAAe,oBAAoB;IACnC,WAAW,gBAAgB;IAE3B,kBAAkB,uBAAuB;IACzC,oBAAoB,yBAAyB;IAC7C,kCAAkC,uCAAuC;IACzE,oCAAoC,yCAAyC;IAC7E,4BAA4B,iCAAiC;IAC7D,8BAA8B,mCAAmC;IACjE,oBAAoB,yBAAyB;CAC7C;AAED,qBAAa,kBAA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AAO,CAAC,WAAW,CAAC;IAInC,kBAAkB,CACvB,SAAS,EAAE,MAAM,EACjB,oBAAoB,EAAE,OAAO,GAC3B,OAAO,CAAC,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"}
|
package/dist/eth-methods.js
DELETED
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
import { initializeRpcClient, JsonRpcClient } from "@msaki/jsonrpc";
|
|
2
|
-
export var Methods;
|
|
3
|
-
(function (Methods) {
|
|
4
|
-
// eth/transaction
|
|
5
|
-
Methods["eth_getTransactionByHash"] = "eth_getTransactionByHash";
|
|
6
|
-
Methods["eth_getTransactionByBlockHashAndIndex"] = "eth_getTransactionByBlockHashAndIndex";
|
|
7
|
-
Methods["eth_getTransactionReceipt"] = "eth_getTransactionReceipt";
|
|
8
|
-
// eth/submit
|
|
9
|
-
Methods["eth_sendTransaction"] = "eth_sendTransaction";
|
|
10
|
-
Methods["eth_sendRawTransaction"] = "eth_sendRawTransaction";
|
|
11
|
-
// eth/state
|
|
12
|
-
Methods["eth_getBalance"] = "eth_getBalance";
|
|
13
|
-
Methods["eth_getStorageAt"] = "eth_getStorageAt";
|
|
14
|
-
Methods["eth_getTransactionCount"] = "eth_getTransactionCount";
|
|
15
|
-
Methods["eth_getCode"] = "eth_getCode";
|
|
16
|
-
Methods["eth_getProof"] = "eth_getProof";
|
|
17
|
-
// eth/sign
|
|
18
|
-
Methods["eth_sign"] = "eth_sign";
|
|
19
|
-
Methods["eth_signTransaction"] = "eth_signTransaction";
|
|
20
|
-
// eth/filter
|
|
21
|
-
Methods["eth_newFilter"] = "eth_newFilter";
|
|
22
|
-
Methods["eth_newBlockFilter"] = "eth_newBlockFilter";
|
|
23
|
-
Methods["eth_newPendingTransactionFilter"] = "eth_newPendingTransactionFilter";
|
|
24
|
-
Methods["eth_uninstallFilter"] = "eth_uninstallFilter";
|
|
25
|
-
Methods["eth_getFilterChanges"] = "eth_getFilterChanges";
|
|
26
|
-
Methods["eth_getFilterLogs"] = "eth_getFilterLogs";
|
|
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";
|
|
53
|
-
})(Methods || (Methods = {}));
|
|
54
|
-
export class EthExecutionClient {
|
|
55
|
-
client;
|
|
56
|
-
constructor(url) {
|
|
57
|
-
this.client = initializeRpcClient(url);
|
|
58
|
-
}
|
|
59
|
-
// eth/transaction
|
|
60
|
-
async eth_getTransactionByHash(transactioHash) {
|
|
61
|
-
return await this.client.call(Methods.eth_getTransactionByHash, [
|
|
62
|
-
transactioHash,
|
|
63
|
-
]);
|
|
64
|
-
}
|
|
65
|
-
async eth_getTransactionByBlockHashAndIndex(blockHash, transactionIndex) {
|
|
66
|
-
return await this.client.call(Methods.eth_getTransactionByBlockHashAndIndex, [blockHash, transactionIndex]);
|
|
67
|
-
}
|
|
68
|
-
async eth_getTransactionReceipt(transactionHash) {
|
|
69
|
-
return await this.client.call(Methods.eth_getTransactionReceipt, [
|
|
70
|
-
transactionHash,
|
|
71
|
-
]);
|
|
72
|
-
}
|
|
73
|
-
// eth/submit
|
|
74
|
-
async eth_sendTransaction(transaction) {
|
|
75
|
-
return await this.client.call(Methods.eth_sendTransaction, [transaction]);
|
|
76
|
-
}
|
|
77
|
-
async eth_sendRawTransaction(transaction) {
|
|
78
|
-
return await this.client.call(Methods.eth_sendRawTransaction, [
|
|
79
|
-
transaction,
|
|
80
|
-
]);
|
|
81
|
-
}
|
|
82
|
-
// eth/state
|
|
83
|
-
async eth_getBalance(address, block) {
|
|
84
|
-
return await this.client.call(Methods.eth_getBalance, [address, block]);
|
|
85
|
-
}
|
|
86
|
-
async eth_getStorageAt(address, storageSlot, block) {
|
|
87
|
-
return await this.client.call(Methods.eth_getStorageAt, [
|
|
88
|
-
address,
|
|
89
|
-
storageSlot,
|
|
90
|
-
block,
|
|
91
|
-
]);
|
|
92
|
-
}
|
|
93
|
-
async eth_getTransactionCount(address, block) {
|
|
94
|
-
return await this.client.call(Methods.eth_getTransactionCount, [
|
|
95
|
-
address,
|
|
96
|
-
block,
|
|
97
|
-
]);
|
|
98
|
-
}
|
|
99
|
-
async eth_getCode(address, block) {
|
|
100
|
-
return await this.client.call(Methods.eth_getCode, [address, block]);
|
|
101
|
-
}
|
|
102
|
-
async eth_getProof(address, storageKeys, block) {
|
|
103
|
-
return await this.client.call(Methods.eth_getProof, [
|
|
104
|
-
address,
|
|
105
|
-
storageKeys,
|
|
106
|
-
block,
|
|
107
|
-
]);
|
|
108
|
-
}
|
|
109
|
-
// eth/sign
|
|
110
|
-
async eth_sign(address, message) {
|
|
111
|
-
return await this.client.call(Methods.eth_sign, [address, message]);
|
|
112
|
-
}
|
|
113
|
-
async eth_signTransaction(transaction) {
|
|
114
|
-
return await this.client.call(Methods.eth_signTransaction, [transaction]);
|
|
115
|
-
}
|
|
116
|
-
// eth/filter
|
|
117
|
-
async eth_newFilter(filter) {
|
|
118
|
-
return await this.client.call(Methods.eth_newFilter, [filter]);
|
|
119
|
-
}
|
|
120
|
-
async eth_newBlockFilter() {
|
|
121
|
-
return await this.client.call(Methods.eth_newBlockFilter, []);
|
|
122
|
-
}
|
|
123
|
-
async eth_newPendingTransactionFilter() {
|
|
124
|
-
return await this.client.call(Methods.eth_newPendingTransactionFilter, []);
|
|
125
|
-
}
|
|
126
|
-
async eth_uninstallFilter() {
|
|
127
|
-
return await this.client.call(Methods.eth_uninstallFilter, []);
|
|
128
|
-
}
|
|
129
|
-
async eth_getFilterChanges() {
|
|
130
|
-
return await this.client.call(Methods.eth_getFilterChanges, []);
|
|
131
|
-
}
|
|
132
|
-
async eth_getFilterLogs(filterIdentifier) {
|
|
133
|
-
return await this.client.call(Methods.eth_getFilterLogs, [
|
|
134
|
-
filterIdentifier,
|
|
135
|
-
]);
|
|
136
|
-
}
|
|
137
|
-
async eth_getLogs(filter) {
|
|
138
|
-
return await this.client.call(Methods.eth_getLogs, [filter]);
|
|
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
|
-
}
|
|
229
|
-
}
|
|
230
|
-
//# sourceMappingURL=eth-methods.js.map
|
package/dist/eth-methods.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eth-methods.js","sourceRoot":"","sources":["../src/eth-methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpE,MAAM,CAAN,IAAY,OAkDX;AAlDD,WAAY,OAAO;IAClB,kBAAkB;IAClB,gEAAqD,CAAA;IACrD,0FAA+E,CAAA;IAC/E,kEAAuD,CAAA;IACvD,aAAa;IACb,sDAA2C,CAAA;IAC3C,4DAAiD,CAAA;IACjD,YAAY;IACZ,4CAAiC,CAAA;IACjC,gDAAqC,CAAA;IACrC,8DAAmD,CAAA;IACnD,sCAA2B,CAAA;IAC3B,wCAA6B,CAAA;IAC7B,WAAW;IACX,gCAAqB,CAAA;IACrB,sDAA2C,CAAA;IAC3C,aAAa;IACb,0CAA+B,CAAA;IAC/B,oDAAyC,CAAA;IACzC,8EAAmE,CAAA;IACnE,sDAA2C,CAAA;IAC3C,wDAA6C,CAAA;IAC7C,kDAAuC,CAAA;IACvC,sCAA2B,CAAA;IAC3B,gBAAgB;IAChB,wCAA6B,CAAA;IAC7B,8CAAmC,CAAA;IACnC,gEAAqD,CAAA;IACrD,4CAAiC,CAAA;IACjC,cAAc;IACd,gCAAqB,CAAA;IACrB,8CAAmC,CAAA;IACnC,wDAA6C,CAAA;IAC7C,4CAAiC,CAAA;IACjC,aAAa;IACb,sCAA2B,CAAA;IAC3B,sCAA2B,CAAA;IAC3B,wCAA6B,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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/src/engine/index.ts
DELETED
|
File without changes
|
package/src/eth-methods.ts
DELETED
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
import { initializeRpcClient, JsonRpcClient } from "@msaki/jsonrpc";
|
|
2
|
-
|
|
3
|
-
export enum Methods {
|
|
4
|
-
// eth/transaction
|
|
5
|
-
eth_getTransactionByHash = "eth_getTransactionByHash",
|
|
6
|
-
eth_getTransactionByBlockHashAndIndex = "eth_getTransactionByBlockHashAndIndex",
|
|
7
|
-
eth_getTransactionReceipt = "eth_getTransactionReceipt",
|
|
8
|
-
// eth/submit
|
|
9
|
-
eth_sendTransaction = "eth_sendTransaction",
|
|
10
|
-
eth_sendRawTransaction = "eth_sendRawTransaction",
|
|
11
|
-
// eth/state
|
|
12
|
-
eth_getBalance = "eth_getBalance",
|
|
13
|
-
eth_getStorageAt = "eth_getStorageAt",
|
|
14
|
-
eth_getTransactionCount = "eth_getTransactionCount",
|
|
15
|
-
eth_getCode = "eth_getCode",
|
|
16
|
-
eth_getProof = "eth_getProof",
|
|
17
|
-
// eth/sign
|
|
18
|
-
eth_sign = "eth_sign",
|
|
19
|
-
eth_signTransaction = "eth_signTransaction",
|
|
20
|
-
// eth/filter
|
|
21
|
-
eth_newFilter = "eth_newFilter",
|
|
22
|
-
eth_newBlockFilter = "eth_newBlockFilter",
|
|
23
|
-
eth_newPendingTransactionFilter = "eth_newPendingTransactionFilter",
|
|
24
|
-
eth_uninstallFilter = "eth_uninstallFilter",
|
|
25
|
-
eth_getFilterChanges = "eth_getFilterChanges",
|
|
26
|
-
eth_getFilterLogs = "eth_getFilterLogs",
|
|
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",
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export class EthExecutionClient {
|
|
56
|
-
private client: JsonRpcClient;
|
|
57
|
-
|
|
58
|
-
constructor(url: string) {
|
|
59
|
-
this.client = initializeRpcClient(url);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// eth/transaction
|
|
63
|
-
async eth_getTransactionByHash(
|
|
64
|
-
transactioHash: Hash32,
|
|
65
|
-
): Promise<NotFound | TransactionInfo> {
|
|
66
|
-
return await this.client.call(Methods.eth_getTransactionByHash, [
|
|
67
|
-
transactioHash,
|
|
68
|
-
]);
|
|
69
|
-
}
|
|
70
|
-
async eth_getTransactionByBlockHashAndIndex(
|
|
71
|
-
blockHash: Hash32,
|
|
72
|
-
transactionIndex: Uint,
|
|
73
|
-
): Promise<NotFound | TransactionInfo> {
|
|
74
|
-
return await this.client.call(
|
|
75
|
-
Methods.eth_getTransactionByBlockHashAndIndex,
|
|
76
|
-
[blockHash, transactionIndex],
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
async eth_getTransactionReceipt(
|
|
80
|
-
transactionHash: Hash32,
|
|
81
|
-
): Promise<NotFound | ReceiptInfo> {
|
|
82
|
-
return await this.client.call(Methods.eth_getTransactionReceipt, [
|
|
83
|
-
transactionHash,
|
|
84
|
-
]);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// eth/submit
|
|
88
|
-
async eth_sendTransaction(transaction: GenericTransaction): Promise<Hash32> {
|
|
89
|
-
return await this.client.call(Methods.eth_sendTransaction, [transaction]);
|
|
90
|
-
}
|
|
91
|
-
async eth_sendRawTransaction(transaction: Bytes): Promise<Hash32> {
|
|
92
|
-
return await this.client.call(Methods.eth_sendRawTransaction, [
|
|
93
|
-
transaction,
|
|
94
|
-
]);
|
|
95
|
-
}
|
|
96
|
-
// eth/state
|
|
97
|
-
async eth_getBalance(
|
|
98
|
-
address: Address,
|
|
99
|
-
block: BlockNumberOrTagOrHash,
|
|
100
|
-
): Promise<Uint> {
|
|
101
|
-
return await this.client.call(Methods.eth_getBalance, [address, block]);
|
|
102
|
-
}
|
|
103
|
-
async eth_getStorageAt(
|
|
104
|
-
address: Address,
|
|
105
|
-
storageSlot: Bytes32,
|
|
106
|
-
block: BlockNumberOrTagOrHash,
|
|
107
|
-
): Promise<Bytes> {
|
|
108
|
-
return await this.client.call(Methods.eth_getStorageAt, [
|
|
109
|
-
address,
|
|
110
|
-
storageSlot,
|
|
111
|
-
block,
|
|
112
|
-
]);
|
|
113
|
-
}
|
|
114
|
-
async eth_getTransactionCount(
|
|
115
|
-
address: Address,
|
|
116
|
-
block: BlockNumberOrTagOrHash,
|
|
117
|
-
): Promise<Uint> {
|
|
118
|
-
return await this.client.call(Methods.eth_getTransactionCount, [
|
|
119
|
-
address,
|
|
120
|
-
block,
|
|
121
|
-
]);
|
|
122
|
-
}
|
|
123
|
-
async eth_getCode(
|
|
124
|
-
address: Address,
|
|
125
|
-
block: BlockNumberOrTagOrHash,
|
|
126
|
-
): Promise<Bytes> {
|
|
127
|
-
return await this.client.call(Methods.eth_getCode, [address, block]);
|
|
128
|
-
}
|
|
129
|
-
async eth_getProof(
|
|
130
|
-
address: Address,
|
|
131
|
-
storageKeys: Bytes32[],
|
|
132
|
-
block: BlockNumberOrTagOrHash,
|
|
133
|
-
): Promise<AccountProof> {
|
|
134
|
-
return await this.client.call(Methods.eth_getProof, [
|
|
135
|
-
address,
|
|
136
|
-
storageKeys,
|
|
137
|
-
block,
|
|
138
|
-
]);
|
|
139
|
-
}
|
|
140
|
-
// eth/sign
|
|
141
|
-
async eth_sign(address: Address, message: Bytes): Promise<Bytes65> {
|
|
142
|
-
return await this.client.call(Methods.eth_sign, [address, message]);
|
|
143
|
-
}
|
|
144
|
-
async eth_signTransaction(transaction: GenericTransaction): Promise<Bytes> {
|
|
145
|
-
return await this.client.call(Methods.eth_signTransaction, [transaction]);
|
|
146
|
-
}
|
|
147
|
-
// eth/filter
|
|
148
|
-
async eth_newFilter(filter: Filter): Promise<Uint> {
|
|
149
|
-
return await this.client.call(Methods.eth_newFilter, [filter]);
|
|
150
|
-
}
|
|
151
|
-
async eth_newBlockFilter(): Promise<Uint> {
|
|
152
|
-
return await this.client.call(Methods.eth_newBlockFilter, []);
|
|
153
|
-
}
|
|
154
|
-
async eth_newPendingTransactionFilter(): Promise<Uint> {
|
|
155
|
-
return await this.client.call(Methods.eth_newPendingTransactionFilter, []);
|
|
156
|
-
}
|
|
157
|
-
async eth_uninstallFilter(): Promise<Uint> {
|
|
158
|
-
return await this.client.call(Methods.eth_uninstallFilter, []);
|
|
159
|
-
}
|
|
160
|
-
async eth_getFilterChanges(): Promise<FilterResults> {
|
|
161
|
-
return await this.client.call(Methods.eth_getFilterChanges, []);
|
|
162
|
-
}
|
|
163
|
-
async eth_getFilterLogs(filterIdentifier: Uint): Promise<FilterResults> {
|
|
164
|
-
return await this.client.call(Methods.eth_getFilterLogs, [
|
|
165
|
-
filterIdentifier,
|
|
166
|
-
]);
|
|
167
|
-
}
|
|
168
|
-
async eth_getLogs(filter: Filter): Promise<FilterResults> {
|
|
169
|
-
return await this.client.call(Methods.eth_getLogs, [filter]);
|
|
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
|
-
}
|
|
295
|
-
}
|
|
File without changes
|