@msaki/eth-rpc 0.1.1 → 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.
Files changed (58) hide show
  1. package/README.md +14 -0
  2. package/dist/beacon-api.d.ts +2 -0
  3. package/dist/beacon-api.d.ts.map +1 -0
  4. package/dist/beacon-api.js +1 -0
  5. package/dist/beacon-api.js.map +1 -0
  6. package/dist/debug-api.d.ts +10 -0
  7. package/dist/debug-api.d.ts.map +1 -0
  8. package/dist/debug-api.js +28 -0
  9. package/dist/debug-api.js.map +1 -0
  10. package/dist/engine-api.d.ts +61 -0
  11. package/dist/engine-api.d.ts.map +1 -0
  12. package/dist/engine-api.js +163 -0
  13. package/dist/engine-api.js.map +1 -0
  14. package/dist/eth-api.d.ts +45 -0
  15. package/dist/eth-api.d.ts.map +1 -0
  16. package/dist/eth-api.js +183 -0
  17. package/dist/eth-api.js.map +1 -0
  18. package/dist/index.d.ts +3 -3
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +3 -3
  21. package/dist/index.js.map +1 -1
  22. package/package.json +1 -1
  23. package/src/debug-api.ts +30 -0
  24. package/src/engine-api.ts +254 -0
  25. package/src/eth-api.ts +254 -0
  26. package/src/index.ts +3 -3
  27. package/src/types/base.d.ts +23 -0
  28. package/src/types/block.d.ts +46 -0
  29. package/src/types/client.d.ts +11 -0
  30. package/src/types/debug/methods.d.ts +11 -0
  31. package/src/types/engine/blob.d.ts +12 -0
  32. package/src/types/engine/forkchoice.d.ts +32 -0
  33. package/src/types/engine/methods.d.ts +42 -0
  34. package/src/types/engine/payload.d.ts +121 -0
  35. package/src/types/engine/transition-configuration.d.ts +10 -0
  36. package/src/types/eth/methods.d.ts +55 -0
  37. package/src/types/execute.d.ts +85 -0
  38. package/src/types/feeHistory.d.ts +18 -0
  39. package/src/types/filter.d.ts +20 -0
  40. package/src/types/receit.d.ts +36 -0
  41. package/src/types/state.d.ts +19 -0
  42. package/src/types/transaction.d.ts +149 -0
  43. package/src/types/withdraw.d.ts +11 -0
  44. package/dist/beacon-methods.d.ts +0 -2
  45. package/dist/beacon-methods.d.ts.map +0 -1
  46. package/dist/beacon-methods.js +0 -1
  47. package/dist/beacon-methods.js.map +0 -1
  48. package/dist/eth-methods.d.ts +0 -47
  49. package/dist/eth-methods.d.ts.map +0 -1
  50. package/dist/eth-methods.js +0 -116
  51. package/dist/eth-methods.js.map +0 -1
  52. package/dist/types.d.ts +0 -338
  53. package/dist/types.d.ts.map +0 -1
  54. package/dist/types.js +0 -1
  55. package/dist/types.js.map +0 -1
  56. package/src/eth-methods.ts +0 -161
  57. package/src/types.ts +0 -368
  58. /package/src/{beacon-methods.ts → beacon-api.ts} +0 -0
@@ -1,116 +0,0 @@
1
- import { JsonRpcClient, initializeRpcClient } 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
- })(Methods || (Methods = {}));
29
- export class EthExecutionClient {
30
- client;
31
- constructor(url) {
32
- this.client = initializeRpcClient(url);
33
- }
34
- // eth/transaction
35
- async eth_getTransactionByHash(transactioHash) {
36
- return await this.client.call(Methods.eth_getTransactionByHash, [
37
- transactioHash,
38
- ]);
39
- }
40
- async eth_getTransactionByBlockHashAndIndex(blockHash, transactionIndex) {
41
- return await this.client.call(Methods.eth_getTransactionByBlockHashAndIndex, [blockHash, transactionIndex]);
42
- }
43
- async eth_getTransactionReceipt(transactionHash) {
44
- return await this.client.call(Methods.eth_getTransactionReceipt, [
45
- transactionHash,
46
- ]);
47
- }
48
- // eth/submit
49
- async eth_sendTransaction(transaction) {
50
- return await this.client.call(Methods.eth_sendTransaction, [transaction]);
51
- }
52
- async eth_sendRawTransaction(transaction) {
53
- return await this.client.call(Methods.eth_sendRawTransaction, [
54
- transaction,
55
- ]);
56
- }
57
- // eth/state
58
- async eth_getBalance(address, block) {
59
- return await this.client.call(Methods.eth_getBalance, [address, block]);
60
- }
61
- async eth_getStorageAt(address, storageSlot, block) {
62
- return await this.client.call(Methods.eth_getStorageAt, [
63
- address,
64
- storageSlot,
65
- block,
66
- ]);
67
- }
68
- async eth_getTransactionCount(address, block) {
69
- return await this.client.call(Methods.eth_getTransactionCount, [
70
- address,
71
- block,
72
- ]);
73
- }
74
- async eth_getCode(address, block) {
75
- return await this.client.call(Methods.eth_getCode, [address, block]);
76
- }
77
- async eth_getProof(address, storageKeys, block) {
78
- return await this.client.call(Methods.eth_getProof, [
79
- address,
80
- storageKeys,
81
- block,
82
- ]);
83
- }
84
- // eth/sign
85
- async eth_sign(address, message) {
86
- return await this.client.call(Methods.eth_sign, [address, message]);
87
- }
88
- async eth_signTransaction(transaction) {
89
- return await this.client.call(Methods.eth_signTransaction, [transaction]);
90
- }
91
- // eth/filter
92
- async eth_newFilter(filter) {
93
- return await this.client.call(Methods.eth_newFilter, [filter]);
94
- }
95
- async eth_newBlockFilter() {
96
- return await this.client.call(Methods.eth_newBlockFilter, []);
97
- }
98
- async eth_newPendingTransactionFilter() {
99
- return await this.client.call(Methods.eth_newPendingTransactionFilter, []);
100
- }
101
- async eth_uninstallFilter() {
102
- return await this.client.call(Methods.eth_uninstallFilter, []);
103
- }
104
- async eth_getFilterChanges() {
105
- return await this.client.call(Methods.eth_getFilterChanges, []);
106
- }
107
- async eth_getFilterLogs(filterIdentifier) {
108
- return await this.client.call(Methods.eth_getFilterLogs, [
109
- filterIdentifier,
110
- ]);
111
- }
112
- async eth_getLogs(filter) {
113
- return await this.client.call(Methods.eth_getLogs, [filter]);
114
- }
115
- }
116
- //# sourceMappingURL=eth-methods.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eth-methods.js","sourceRoot":"","sources":["../src/eth-methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIpE,MAAM,CAAN,IAAY,OAyBX;AAzBD,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;AAC5B,CAAC,EAzBW,OAAO,KAAP,OAAO,QAyBlB;AAED,MAAM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AAa,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAChE,CAAC;IACD,KAAK,CAAC,kBAAkB;QACvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;IAC/D,CAAC;IACD,KAAK,CAAC,+BAA+B;QACpC,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,+BAA+B,EAAE,EAAE,CAAC,CAAC;IAC5E,CAAC;IACD,KAAK,CAAC,mBAAmB;QACxB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;IAChE,CAAC;IACD,KAAK,CAAC,oBAAoB;QACzB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;IACjE,CAAC;IACD,KAAK,CAAC,iBAAiB,CACtB,gBAAgC;QAEhC,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE;YACxD,gBAAgB;SAChB,CAAC,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,WAAW,CAChB,MAAwB;QAExB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9D,CAAC;CACD"}
package/dist/types.d.ts DELETED
@@ -1,338 +0,0 @@
1
- export type Hex = `0x${string}`;
2
- export type Address = `0x${string}`;
3
- export type Addresses = Address[];
4
- export type Byte = Hex;
5
- export type Bytes = Hex;
6
- export type Bytes32 = Hex;
7
- export type Bytes8 = Hex;
8
- export type Bytes48 = Hex;
9
- export type Bytes96 = Hex;
10
- export type Bytes256 = Hex;
11
- export type Bytes65 = Hex;
12
- export type Ratio = 0 | 1;
13
- export type Uint = Hex;
14
- export type Uint64 = Hex;
15
- export type Uint256 = Hex;
16
- export type UintDecimal = number;
17
- export type Hash32 = Hex;
18
- export type NotFound = null;
19
- export type BlockTag = "earliest" | "finalized" | "safe" | "latest" | "pending";
20
- export type BlockNumberOrTag = Hex | BlockTag;
21
- export type BlockNumberOrTagOrHash = BlockNumberOrTag | Hex;
22
- export interface Block {
23
- hash: Hash32;
24
- parentHash: Hash32;
25
- sha3Uncles: Hash32;
26
- miner: Address;
27
- stateRoot: Hash32;
28
- transactionsRoot: Hash32;
29
- receiptsRoot: Hash32;
30
- logsBloom: Bytes256;
31
- number: Uint;
32
- gasLimit: Uint;
33
- gasUsed: Uint;
34
- timestamp: Uint;
35
- extraData: Bytes;
36
- mixHash: Hash32;
37
- nonce: Bytes8;
38
- size: Uint;
39
- transactions: Hash32[] | TransactionInfo[];
40
- uncles: Hash32[];
41
- requestedHash?: Hash32;
42
- baseFeePerGas?: Uint;
43
- withdrawalsRoot?: Hash32;
44
- blobGasUsed?: Uint;
45
- excessBlobGas?: Uint;
46
- parentBeaconBlockRoot?: Hash32;
47
- withdrawals?: Withdrawal[];
48
- difficulty?: Uint;
49
- }
50
- export interface BadBlock {
51
- block: Block;
52
- hash: Hash32;
53
- rlp: Bytes;
54
- }
55
- export interface AccessListEntry {
56
- address: Address;
57
- storageKeys: Hash32[];
58
- }
59
- export type TransactionUnsigned = TransactionLegacyUnsigned | Transaction2930Unsigned | Transaction1559Unsigned | Transaction4844Unsigned | Transaction7702Unsigned;
60
- export interface TransactionLegacyUnsigned {
61
- type: "0x0";
62
- nonce: Uint;
63
- to?: Address | null;
64
- gas: Uint;
65
- value: Uint;
66
- input: Bytes;
67
- gasPrice: Uint;
68
- chainId?: Uint;
69
- }
70
- export interface Transaction2930Unsigned {
71
- type: "0x1";
72
- nonce: Uint;
73
- to?: Address | null;
74
- gas: Uint;
75
- value: Uint;
76
- input: Bytes;
77
- gasPrice: Uint;
78
- chainId: Uint;
79
- accessList: AccessListEntry[];
80
- }
81
- export interface Transaction1559Unsigned {
82
- type: "0x2";
83
- nonce: Uint;
84
- to?: Address | null;
85
- gas: Uint;
86
- value: Uint;
87
- input: Bytes;
88
- gasPrice: Uint;
89
- maxFeePerGas: Uint;
90
- maxPriorityFeePerGas: Uint;
91
- accessList: AccessListEntry[];
92
- chainId: Uint;
93
- }
94
- export interface Transaction4844Unsigned {
95
- type: "0x3";
96
- nonce: Uint;
97
- to: Address;
98
- gas: Uint;
99
- value: Uint;
100
- input: Bytes;
101
- gasPrice?: Uint;
102
- maxFeePerGas: Uint;
103
- maxPriorityFeePerGas: Uint;
104
- maxFeePerBlobGas: Uint;
105
- accessList: AccessListEntry[];
106
- blobVersionedHashes: Hash32[];
107
- chainId: Uint;
108
- }
109
- export interface Transaction7702Unsigned {
110
- type: "0x4";
111
- nonce: Uint;
112
- to: Address;
113
- gas: Uint;
114
- value: Uint;
115
- input: Bytes;
116
- maxPriorityFeePerGas: Uint;
117
- maxFeePerGas: Uint;
118
- gasPrice?: Uint;
119
- accessList: AccessListEntry[];
120
- chainId: Uint;
121
- authorizationList: AuthorizationList;
122
- }
123
- export interface AuthorizationListEntry {
124
- chainId: Uint;
125
- nonce: Uint;
126
- address: Address;
127
- yParity: Byte;
128
- r: Uint256;
129
- s: Uint256;
130
- }
131
- export type AuthorizationList = AuthorizationListEntry[];
132
- export type TransactionLegacySigned = {
133
- v: Byte;
134
- r: Uint;
135
- s: Uint;
136
- } & TransactionLegacyUnsigned;
137
- export type Transaction2930Signed = {
138
- yParity: Bytes;
139
- r: Uint;
140
- s: Uint;
141
- v?: Byte;
142
- } & Transaction2930Unsigned;
143
- export type Transaction1559Signed = {
144
- yParity: Bytes;
145
- r: Uint;
146
- s: Uint;
147
- v?: Byte;
148
- } & Transaction1559Unsigned;
149
- export type Transaction4844Signed = {
150
- yParity: Byte;
151
- r: Uint;
152
- s: Uint;
153
- v?: Byte;
154
- } & Transaction4844Unsigned;
155
- export type Transaction7702Signed = {
156
- yParity: Byte;
157
- r: Uint;
158
- s: Uint;
159
- v?: Byte;
160
- } & Transaction7702Unsigned;
161
- export type TransactionSigned = TransactionLegacySigned | Transaction2930Signed | Transaction1559Signed | Transaction4844Signed | Transaction7702Signed;
162
- export type TransactionInfo = {
163
- blockHash: Hash32;
164
- blockNumber: Uint;
165
- from: Address;
166
- hash: Hash32;
167
- transactionIndex: Uint;
168
- } & TransactionSigned;
169
- export interface GenericTransaction {
170
- type?: "0x0" | "0x1" | "0x2" | "0x3";
171
- to?: Address | null;
172
- from?: Address;
173
- value?: Uint;
174
- nonce?: Uint;
175
- gas?: Uint;
176
- input?: Bytes;
177
- gasPrice?: Uint;
178
- maxPriorityFeePerGas?: Uint;
179
- maxFeePerGas?: Uint;
180
- maxFeePerBlobGas?: Uint;
181
- accessList?: AccessListEntry[];
182
- blobVersionedHashes?: Hash32[];
183
- blobs?: Bytes[];
184
- chainId?: Uint;
185
- authorizationList?: AuthorizationList;
186
- }
187
- export interface Withdrawal {
188
- index: Uint64;
189
- validatorIndex: Uint64;
190
- address: Address;
191
- amount: Uint256;
192
- }
193
- export interface AccountProof {
194
- address: Address;
195
- accountProof: Bytes;
196
- balance: Uint256;
197
- codeHash: Hash32;
198
- nonce: Uint64;
199
- storageHash: Hash32;
200
- storageProof: StorageProof;
201
- }
202
- export interface StorageProof {
203
- key: Bytes32;
204
- value: Uint256;
205
- proof: Bytes;
206
- }
207
- export interface Log {
208
- transactionHash: Hash32;
209
- removed?: boolean;
210
- logIndex?: Uint;
211
- transactionIndex?: Uint;
212
- blockHash?: Hash32;
213
- blockNumber?: Uint;
214
- blockTimestamp?: Uint;
215
- address?: Address;
216
- data?: Bytes;
217
- topics?: Bytes32[];
218
- }
219
- export interface ReceiptInfo {
220
- type?: Byte;
221
- transactionHash: Hash32;
222
- transactionIndex: Uint;
223
- blockHash: Byte;
224
- blockNumber: Uint;
225
- from: Address;
226
- to?: Address | null;
227
- cumulativeGasUsed: Uint;
228
- gasUsed: Uint;
229
- blobGasUsed?: Uint;
230
- contractAddress?: Address | null;
231
- logs: Log[];
232
- logsBloom: Bytes256;
233
- root?: Hash32;
234
- status?: Uint;
235
- effectiveGasPrice: Uint;
236
- blobGasPrice?: Uint;
237
- }
238
- export type FilterResults = Hash32[] | Log[];
239
- export type FilterTopic = Bytes32 | Bytes32[];
240
- export type FilterTopics = FilterTopic | null;
241
- export type Filter = FilterByBlockRange | FilterByBlockHash;
242
- export interface FilterByBlockRange {
243
- fromBlock?: Uint;
244
- toBlock?: Uint;
245
- address?: null | Address | Addresses;
246
- topics?: FilterTopics;
247
- }
248
- export interface FilterByBlockHash {
249
- blockHash: Hash32;
250
- address?: Address | Addresses | null;
251
- topics?: FilterTopics;
252
- }
253
- export interface EthSimulatePayload {
254
- blockStateCalls: BlockStateCall[];
255
- traceTransfers?: boolean;
256
- validation?: boolean;
257
- returnFullTransactions?: boolean;
258
- }
259
- export interface BlockStateCall {
260
- blockOverrides?: BlockOverrides;
261
- stateOverrides?: StateOverrides;
262
- calls?: GenericCallTransaction[];
263
- }
264
- export interface BlockOverrides {
265
- number?: Uint64;
266
- prevRandao?: Uint256;
267
- time?: Uint64;
268
- gasLimit?: Uint64;
269
- feeRecipient?: Address;
270
- baseFeePerGas?: Uint256;
271
- withdrawals?: Withdrawal[];
272
- blobBaseFee?: Uint64;
273
- }
274
- export type StateOverrides = Record<Address, AccountOverride>;
275
- export interface GenericCallTransaction {
276
- type?: "0x0" | "0x1" | "0x2" | "0x3";
277
- to?: Address | null;
278
- from?: Address;
279
- value?: Uint;
280
- nonce?: Uint;
281
- gas?: Uint;
282
- input?: Bytes;
283
- gasPrice?: Uint;
284
- maxPriorityFeePerGas?: Uint;
285
- maxFeePerGas?: Uint;
286
- maxFeePerBlobGas?: Uint;
287
- accessList?: AccessListEntry[];
288
- blobVersionedHashes?: Hash32[];
289
- authorizationList?: AuthorizationList;
290
- }
291
- export type AccountOverride = AccountOverrideState | AccountOverrideStateDiff;
292
- export interface AccountOverrideState {
293
- state: AccountStorage;
294
- nonce?: Uint64;
295
- balance?: Uint256;
296
- code?: Bytes;
297
- movePrecompileToAddress?: Address;
298
- }
299
- export interface AccountOverrideStateDiff {
300
- stateDiff: AccountStorage;
301
- nonce?: Uint64;
302
- balance?: Uint256;
303
- code?: Bytes;
304
- movePrecompileToAddress?: Address;
305
- }
306
- export type AccountStorage = Record<Bytes32, Hash32>;
307
- export type EthSimulateResult = EthSimulateBlockResultSingleSuccess[];
308
- export type EthSimulateBlockResultSingleSuccess = {
309
- calls: CallResults;
310
- } & Block;
311
- export type CallResults = CallResultFailure | CallResultSuccess;
312
- export interface CallResultFailure {
313
- status: "0x0";
314
- returnData: Bytes;
315
- gasUsed: Uint64;
316
- error: EXECUTION_REVERTED_ERROR | VM_EXECUTION_ERROR;
317
- }
318
- export type EXECUTION_REVERTED_ERROR = {
319
- code: -32000;
320
- message: "execution reverted.";
321
- };
322
- export type VM_EXECUTION_ERROR = {
323
- code: -32015;
324
- message: "vm execution error.";
325
- };
326
- export interface CallResultSuccess {
327
- status: "0x1";
328
- returnData: Bytes;
329
- gasUsed: Uint64;
330
- logs: Log[];
331
- }
332
- export type SyncingStatus = Syncing | false;
333
- export interface Syncing {
334
- startingBlock?: Uint;
335
- currentBlock?: Uint;
336
- highestBlock?: Uint;
337
- }
338
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,GAAG,GAAG,KAAK,MAAM,EAAE,CAAC;AAChC,MAAM,MAAM,OAAO,GAAG,KAAK,MAAM,EAAE,CAAC;AACpC,MAAM,MAAM,SAAS,GAAG,OAAO,EAAE,CAAC;AAClC,MAAM,MAAM,IAAI,GAAG,GAAG,CAAC;AACvB,MAAM,MAAM,KAAK,GAAG,GAAG,CAAC;AACxB,MAAM,MAAM,OAAO,GAAG,GAAG,CAAC;AAC1B,MAAM,MAAM,MAAM,GAAG,GAAG,CAAC;AACzB,MAAM,MAAM,OA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,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AACrD,MAAM,MAAM,iBAAiB,GAAG,mCAAmC,EAAE,CAAC;AAEtE,MAAM,MAAM,mCAAmC,GAAG;IACjD,KAAK,EAAE,WAAW,CAAC;CACnB,GAAG,KAAK,CAAC;AACV,MAAM,MAAM,WAAW,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAChE,MAAM,WAAW,iBAAiB;IACjC,MAAM,EAAE,KAAK,CAAC;IACd,UAAU,EAAE,KAAK,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,wBAAwB,GAAG,kBAAkB,CAAC;CACrD;AACD,MAAM,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,CAAC,KAAK,CAAC;IACb,OAAO,EAAE,qBAAqB,CAAC;CAC/B,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,CAAC,KAAK,CAAC;IACb,OAAO,EAAE,qBAAqB,CAAC;CAC/B,CAAC;AACF,MAAM,WAAW,iBAAiB;IACjC,MAAM,EAAE,KAAK,CAAC;IACd,UAAU,EAAE,KAAK,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,GAAG,EAAE,CAAC;CACZ;AAGD,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,KAAK,CAAC;AAC5C,MAAM,WAAW,OAAO;IACvB,aAAa,CAAC,EAAE,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,IAAI,CAAC;CACpB"}
package/dist/types.js DELETED
@@ -1 +0,0 @@
1
- //# sourceMappingURL=types.js.map
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -1,161 +0,0 @@
1
- import { JsonRpcClient, initializeRpcClient } from "@msaki/jsonrpc";
2
- export type * as EthSchema from "./types";
3
- import type { EthSchema } from ".";
4
-
5
- export enum Methods {
6
- // eth/transaction
7
- eth_getTransactionByHash = "eth_getTransactionByHash",
8
- eth_getTransactionByBlockHashAndIndex = "eth_getTransactionByBlockHashAndIndex",
9
- eth_getTransactionReceipt = "eth_getTransactionReceipt",
10
- // eth/submit
11
- eth_sendTransaction = "eth_sendTransaction",
12
- eth_sendRawTransaction = "eth_sendRawTransaction",
13
- // eth/state
14
- eth_getBalance = "eth_getBalance",
15
- eth_getStorageAt = "eth_getStorageAt",
16
- eth_getTransactionCount = "eth_getTransactionCount",
17
- eth_getCode = "eth_getCode",
18
- eth_getProof = "eth_getProof",
19
- // eth/sign
20
- eth_sign = "eth_sign",
21
- eth_signTransaction = "eth_signTransaction",
22
- // eth/filter
23
- eth_newFilter = "eth_newFilter",
24
- eth_newBlockFilter = "eth_newBlockFilter",
25
- eth_newPendingTransactionFilter = "eth_newPendingTransactionFilter",
26
- eth_uninstallFilter = "eth_uninstallFilter",
27
- eth_getFilterChanges = "eth_getFilterChanges",
28
- eth_getFilterLogs = "eth_getFilterLogs",
29
- eth_getLogs = "eth_getLogs",
30
- }
31
-
32
- export class EthExecutionClient {
33
- private client: JsonRpcClient;
34
-
35
- constructor(url: string) {
36
- this.client = initializeRpcClient(url);
37
- }
38
-
39
- // eth/transaction
40
- async eth_getTransactionByHash(
41
- transactioHash: EthSchema.Hash32,
42
- ): Promise<EthSchema.NotFound | EthSchema.TransactionInfo> {
43
- return await this.client.call(Methods.eth_getTransactionByHash, [
44
- transactioHash,
45
- ]);
46
- }
47
- async eth_getTransactionByBlockHashAndIndex(
48
- blockHash: EthSchema.Hash32,
49
- transactionIndex: EthSchema.Uint,
50
- ): Promise<EthSchema.NotFound | EthSchema.TransactionInfo> {
51
- return await this.client.call(
52
- Methods.eth_getTransactionByBlockHashAndIndex,
53
- [blockHash, transactionIndex],
54
- );
55
- }
56
- async eth_getTransactionReceipt(
57
- transactionHash: EthSchema.Hash32,
58
- ): Promise<EthSchema.NotFound | EthSchema.ReceiptInfo> {
59
- return await this.client.call(Methods.eth_getTransactionReceipt, [
60
- transactionHash,
61
- ]);
62
- }
63
-
64
- // eth/submit
65
- async eth_sendTransaction(
66
- transaction: EthSchema.GenericTransaction,
67
- ): Promise<EthSchema.Hash32> {
68
- return await this.client.call(Methods.eth_sendTransaction, [transaction]);
69
- }
70
- async eth_sendRawTransaction(
71
- transaction: EthSchema.Bytes,
72
- ): Promise<EthSchema.Hash32> {
73
- return await this.client.call(Methods.eth_sendRawTransaction, [
74
- transaction,
75
- ]);
76
- }
77
- // eth/state
78
- async eth_getBalance(
79
- address: EthSchema.Address,
80
- block: EthSchema.BlockNumberOrTagOrHash,
81
- ): Promise<EthSchema.Uint> {
82
- return await this.client.call(Methods.eth_getBalance, [address, block]);
83
- }
84
- async eth_getStorageAt(
85
- address: EthSchema.Address,
86
- storageSlot: EthSchema.Bytes32,
87
- block: EthSchema.BlockNumberOrTagOrHash,
88
- ): Promise<EthSchema.Bytes> {
89
- return await this.client.call(Methods.eth_getStorageAt, [
90
- address,
91
- storageSlot,
92
- block,
93
- ]);
94
- }
95
- async eth_getTransactionCount(
96
- address: EthSchema.Address,
97
- block: EthSchema.BlockNumberOrTagOrHash,
98
- ): Promise<EthSchema.Uint> {
99
- return await this.client.call(Methods.eth_getTransactionCount, [
100
- address,
101
- block,
102
- ]);
103
- }
104
- async eth_getCode(
105
- address: EthSchema.Address,
106
- block: EthSchema.BlockNumberOrTagOrHash,
107
- ): Promise<EthSchema.Bytes> {
108
- return await this.client.call(Methods.eth_getCode, [address, block]);
109
- }
110
- async eth_getProof(
111
- address: EthSchema.Address,
112
- storageKeys: EthSchema.Bytes32[],
113
- block: EthSchema.BlockNumberOrTagOrHash,
114
- ): Promise<EthSchema.AccountProof> {
115
- return await this.client.call(Methods.eth_getProof, [
116
- address,
117
- storageKeys,
118
- block,
119
- ]);
120
- }
121
- // eth/sign
122
- async eth_sign(
123
- address: EthSchema.Address,
124
- message: EthSchema.Bytes,
125
- ): Promise<EthSchema.Bytes65> {
126
- return await this.client.call(Methods.eth_sign, [address, message]);
127
- }
128
- async eth_signTransaction(
129
- transaction: EthSchema.GenericTransaction,
130
- ): Promise<EthSchema.Bytes> {
131
- return await this.client.call(Methods.eth_signTransaction, [transaction]);
132
- }
133
- // eth/filter
134
- async eth_newFilter(filter: EthSchema.Filter): Promise<EthSchema.Uint> {
135
- return await this.client.call(Methods.eth_newFilter, [filter]);
136
- }
137
- async eth_newBlockFilter(): Promise<EthSchema.Uint> {
138
- return await this.client.call(Methods.eth_newBlockFilter, []);
139
- }
140
- async eth_newPendingTransactionFilter(): Promise<EthSchema.Uint> {
141
- return await this.client.call(Methods.eth_newPendingTransactionFilter, []);
142
- }
143
- async eth_uninstallFilter(): Promise<EthSchema.Uint> {
144
- return await this.client.call(Methods.eth_uninstallFilter, []);
145
- }
146
- async eth_getFilterChanges(): Promise<EthSchema.FilterResults> {
147
- return await this.client.call(Methods.eth_getFilterChanges, []);
148
- }
149
- async eth_getFilterLogs(
150
- filterIdentifier: EthSchema.Uint,
151
- ): Promise<EthSchema.FilterResults> {
152
- return await this.client.call(Methods.eth_getFilterLogs, [
153
- filterIdentifier,
154
- ]);
155
- }
156
- async eth_getLogs(
157
- filter: EthSchema.Filter,
158
- ): Promise<EthSchema.FilterResults> {
159
- return await this.client.call(Methods.eth_getLogs, [filter]);
160
- }
161
- }