@msaki/eth-rpc 0.1.0 → 0.1.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/dist/eth-methods.d.ts.map +1 -1
- package/dist/eth-methods.js +26 -7
- package/dist/eth-methods.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +36 -35
- package/src/eth-methods.ts +149 -190
- package/src/types.ts +288 -280
|
@@ -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;
|
|
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;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;CAC3B;AAED,qBAAa,kBAAkB;IAC9B,OAAO,CAAC,MAAM,CAAgB;gBAElB,GAAG,EAAE,MAAM;IAKjB,wBAAwB,CAC7B,cAAc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ChC,KAAK,EAAE,SAAS,CAAC,sBAAsB,GACrC,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC;IAQ5B,QAAQ,CACb,OAAO,EAAE,SAAS,CAAC,OAAO,EAC1B,OAAO,EAAE,SAAS,CAAC,KAAK,GACtB,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC;IAGvB,mBAAmB,CACxB,WAAW,EAAE,SAAS,CAAC,kBAAkB,GACvC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC;IAIrB,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;IAGhE,kBAAkB,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;IAG7C,+BAA+B,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;IAG1D,mBAAmB,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;IAG9C,oBAAoB,IAAI,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC;IAGxD,iBAAiB,CACtB,gBAAgB,EAAE,SAAS,CAAC,IAAI,GAC9B,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC;IAK7B,WAAW,CAChB,MAAM,EAAE,SAAS,CAAC,MAAM,GACtB,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC;CAGnC"}
|
package/dist/eth-methods.js
CHANGED
|
@@ -33,36 +33,53 @@ export class EthExecutionClient {
|
|
|
33
33
|
}
|
|
34
34
|
// eth/transaction
|
|
35
35
|
async eth_getTransactionByHash(transactioHash) {
|
|
36
|
-
return await this.client.call(Methods.eth_getTransactionByHash, [
|
|
36
|
+
return await this.client.call(Methods.eth_getTransactionByHash, [
|
|
37
|
+
transactioHash,
|
|
38
|
+
]);
|
|
37
39
|
}
|
|
38
40
|
async eth_getTransactionByBlockHashAndIndex(blockHash, transactionIndex) {
|
|
39
41
|
return await this.client.call(Methods.eth_getTransactionByBlockHashAndIndex, [blockHash, transactionIndex]);
|
|
40
42
|
}
|
|
41
43
|
async eth_getTransactionReceipt(transactionHash) {
|
|
42
|
-
return await this.client.call(Methods.eth_getTransactionReceipt, [
|
|
44
|
+
return await this.client.call(Methods.eth_getTransactionReceipt, [
|
|
45
|
+
transactionHash,
|
|
46
|
+
]);
|
|
43
47
|
}
|
|
44
48
|
// eth/submit
|
|
45
49
|
async eth_sendTransaction(transaction) {
|
|
46
50
|
return await this.client.call(Methods.eth_sendTransaction, [transaction]);
|
|
47
51
|
}
|
|
48
52
|
async eth_sendRawTransaction(transaction) {
|
|
49
|
-
return await this.client.call(Methods.eth_sendRawTransaction, [
|
|
53
|
+
return await this.client.call(Methods.eth_sendRawTransaction, [
|
|
54
|
+
transaction,
|
|
55
|
+
]);
|
|
50
56
|
}
|
|
51
57
|
// eth/state
|
|
52
58
|
async eth_getBalance(address, block) {
|
|
53
59
|
return await this.client.call(Methods.eth_getBalance, [address, block]);
|
|
54
60
|
}
|
|
55
61
|
async eth_getStorageAt(address, storageSlot, block) {
|
|
56
|
-
return await this.client.call(Methods.eth_getStorageAt, [
|
|
62
|
+
return await this.client.call(Methods.eth_getStorageAt, [
|
|
63
|
+
address,
|
|
64
|
+
storageSlot,
|
|
65
|
+
block,
|
|
66
|
+
]);
|
|
57
67
|
}
|
|
58
68
|
async eth_getTransactionCount(address, block) {
|
|
59
|
-
return await this.client.call(Methods.eth_getTransactionCount, [
|
|
69
|
+
return await this.client.call(Methods.eth_getTransactionCount, [
|
|
70
|
+
address,
|
|
71
|
+
block,
|
|
72
|
+
]);
|
|
60
73
|
}
|
|
61
74
|
async eth_getCode(address, block) {
|
|
62
75
|
return await this.client.call(Methods.eth_getCode, [address, block]);
|
|
63
76
|
}
|
|
64
77
|
async eth_getProof(address, storageKeys, block) {
|
|
65
|
-
return await this.client.call(Methods.eth_getProof, [
|
|
78
|
+
return await this.client.call(Methods.eth_getProof, [
|
|
79
|
+
address,
|
|
80
|
+
storageKeys,
|
|
81
|
+
block,
|
|
82
|
+
]);
|
|
66
83
|
}
|
|
67
84
|
// eth/sign
|
|
68
85
|
async eth_sign(address, message) {
|
|
@@ -88,7 +105,9 @@ export class EthExecutionClient {
|
|
|
88
105
|
return await this.client.call(Methods.eth_getFilterChanges, []);
|
|
89
106
|
}
|
|
90
107
|
async eth_getFilterLogs(filterIdentifier) {
|
|
91
|
-
return await this.client.call(Methods.eth_getFilterLogs, [
|
|
108
|
+
return await this.client.call(Methods.eth_getFilterLogs, [
|
|
109
|
+
filterIdentifier,
|
|
110
|
+
]);
|
|
92
111
|
}
|
|
93
112
|
async eth_getLogs(filter) {
|
|
94
113
|
return await this.client.call(Methods.eth_getLogs, [filter]);
|
package/dist/eth-methods.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;I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,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/package.json
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
2
|
+
"name": "@msaki/eth-rpc",
|
|
3
|
+
"author": "Meek Msaki",
|
|
4
|
+
"version": "0.1.1",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"module": "dist/index.mjs",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"src"
|
|
13
|
+
],
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/mmsaki/libs.git",
|
|
17
|
+
"directory": "packages/eth-rpc"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public",
|
|
21
|
+
"directory": "dist"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsc -p tsconfig.json",
|
|
25
|
+
"publish": "bun run build && bun publish --access public",
|
|
26
|
+
"format": "bun biome format --write"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@biomejs/biome": "2.3.11",
|
|
30
|
+
"@types/bun": "latest"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"typescript": "^5"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@msaki/jsonrpc": "jsonrpc"
|
|
37
|
+
}
|
|
37
38
|
}
|
package/src/eth-methods.ts
CHANGED
|
@@ -3,200 +3,159 @@ export type * as EthSchema from "./types";
|
|
|
3
3
|
import type { EthSchema } from ".";
|
|
4
4
|
|
|
5
5
|
export enum Methods {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
30
|
}
|
|
31
31
|
|
|
32
32
|
export class EthExecutionClient {
|
|
33
|
-
|
|
33
|
+
private client: JsonRpcClient;
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
constructor(url: string) {
|
|
36
|
+
this.client = initializeRpcClient(url);
|
|
37
|
+
}
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
);
|
|
64
|
-
}
|
|
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
|
+
}
|
|
65
63
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
)
|
|
164
|
-
}
|
|
165
|
-
async eth_newPendingTransactionFilter(
|
|
166
|
-
): Promise<EthSchema.Uint> {
|
|
167
|
-
return await this.client.call(
|
|
168
|
-
Methods.eth_newPendingTransactionFilter,
|
|
169
|
-
[]
|
|
170
|
-
)
|
|
171
|
-
}
|
|
172
|
-
async eth_uninstallFilter(
|
|
173
|
-
): Promise<EthSchema.Uint> {
|
|
174
|
-
return await this.client.call(
|
|
175
|
-
Methods.eth_uninstallFilter,
|
|
176
|
-
[]
|
|
177
|
-
)
|
|
178
|
-
}
|
|
179
|
-
async eth_getFilterChanges(
|
|
180
|
-
): Promise<EthSchema.FilterResults> {
|
|
181
|
-
return await this.client.call(
|
|
182
|
-
Methods.eth_getFilterChanges,
|
|
183
|
-
[]
|
|
184
|
-
)
|
|
185
|
-
}
|
|
186
|
-
async eth_getFilterLogs(
|
|
187
|
-
filterIdentifier: EthSchema.Uint
|
|
188
|
-
): Promise<EthSchema.FilterResults> {
|
|
189
|
-
return await this.client.call(
|
|
190
|
-
Methods.eth_getFilterLogs,
|
|
191
|
-
[filterIdentifier]
|
|
192
|
-
)
|
|
193
|
-
}
|
|
194
|
-
async eth_getLogs(
|
|
195
|
-
filter: EthSchema.Filter
|
|
196
|
-
): Promise<EthSchema.FilterResults> {
|
|
197
|
-
return await this.client.call(
|
|
198
|
-
Methods.eth_getLogs,
|
|
199
|
-
[filter]
|
|
200
|
-
)
|
|
201
|
-
}
|
|
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
|
+
}
|
|
202
161
|
}
|
package/src/types.ts
CHANGED
|
@@ -1,360 +1,368 @@
|
|
|
1
1
|
// base.yaml
|
|
2
|
-
export type Hex = `0x${string}
|
|
3
|
-
export type Address = `0x${string}
|
|
4
|
-
export type Addresses = Address[]
|
|
5
|
-
export type Byte = Hex
|
|
6
|
-
export type Bytes = Hex
|
|
7
|
-
export type Bytes32 = Hex
|
|
8
|
-
export type Bytes8 = Hex
|
|
9
|
-
export type Bytes48 = Hex
|
|
10
|
-
export type Bytes96 = Hex
|
|
11
|
-
export type Bytes256 = Hex
|
|
12
|
-
export type Bytes65 = Hex
|
|
13
|
-
export type Ratio = 0 | 1
|
|
14
|
-
export type Uint = Hex
|
|
15
|
-
export type Uint64 = Hex
|
|
16
|
-
export type Uint256 = Hex
|
|
17
|
-
export type UintDecimal = number
|
|
18
|
-
export type Hash32 = Hex
|
|
19
|
-
export type NotFound = null
|
|
2
|
+
export type Hex = `0x${string}`;
|
|
3
|
+
export type Address = `0x${string}`;
|
|
4
|
+
export type Addresses = Address[];
|
|
5
|
+
export type Byte = Hex;
|
|
6
|
+
export type Bytes = Hex;
|
|
7
|
+
export type Bytes32 = Hex;
|
|
8
|
+
export type Bytes8 = Hex;
|
|
9
|
+
export type Bytes48 = Hex;
|
|
10
|
+
export type Bytes96 = Hex;
|
|
11
|
+
export type Bytes256 = Hex;
|
|
12
|
+
export type Bytes65 = Hex;
|
|
13
|
+
export type Ratio = 0 | 1;
|
|
14
|
+
export type Uint = Hex;
|
|
15
|
+
export type Uint64 = Hex;
|
|
16
|
+
export type Uint256 = Hex;
|
|
17
|
+
export type UintDecimal = number;
|
|
18
|
+
export type Hash32 = Hex;
|
|
19
|
+
export type NotFound = null;
|
|
20
20
|
|
|
21
21
|
// block.yaml
|
|
22
|
-
export type BlockTag = "earliest" | "finalized" | "safe" | "latest" | "pending"
|
|
23
|
-
export type BlockNumberOrTag = Hex | BlockTag
|
|
24
|
-
export type BlockNumberOrTagOrHash = BlockNumberOrTag | Hex
|
|
22
|
+
export type BlockTag = "earliest" | "finalized" | "safe" | "latest" | "pending";
|
|
23
|
+
export type BlockNumberOrTag = Hex | BlockTag;
|
|
24
|
+
export type BlockNumberOrTagOrHash = BlockNumberOrTag | Hex;
|
|
25
25
|
|
|
26
26
|
export interface Block {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
27
|
+
hash: Hash32;
|
|
28
|
+
parentHash: Hash32;
|
|
29
|
+
sha3Uncles: Hash32;
|
|
30
|
+
miner: Address;
|
|
31
|
+
stateRoot: Hash32;
|
|
32
|
+
transactionsRoot: Hash32;
|
|
33
|
+
receiptsRoot: Hash32;
|
|
34
|
+
logsBloom: Bytes256;
|
|
35
|
+
number: Uint;
|
|
36
|
+
gasLimit: Uint;
|
|
37
|
+
gasUsed: Uint;
|
|
38
|
+
timestamp: Uint;
|
|
39
|
+
extraData: Bytes;
|
|
40
|
+
mixHash: Hash32;
|
|
41
|
+
nonce: Bytes8;
|
|
42
|
+
size: Uint;
|
|
43
|
+
transactions: Hash32[] | TransactionInfo[];
|
|
44
|
+
uncles: Hash32[];
|
|
45
|
+
requestedHash?: Hash32;
|
|
46
|
+
baseFeePerGas?: Uint;
|
|
47
|
+
withdrawalsRoot?: Hash32;
|
|
48
|
+
blobGasUsed?: Uint;
|
|
49
|
+
excessBlobGas?: Uint;
|
|
50
|
+
parentBeaconBlockRoot?: Hash32;
|
|
51
|
+
withdrawals?: Withdrawal[];
|
|
52
|
+
difficulty?: Uint;
|
|
53
53
|
}
|
|
54
54
|
export interface BadBlock {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
block: Block;
|
|
56
|
+
hash: Hash32;
|
|
57
|
+
rlp: Bytes;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
// transaction.yaml
|
|
61
61
|
export interface AccessListEntry {
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
address: Address;
|
|
63
|
+
storageKeys: Hash32[];
|
|
64
64
|
}
|
|
65
|
-
export type TransactionUnsigned =
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
export type TransactionUnsigned =
|
|
66
|
+
| TransactionLegacyUnsigned
|
|
67
|
+
| Transaction2930Unsigned
|
|
68
|
+
| Transaction1559Unsigned
|
|
69
|
+
| Transaction4844Unsigned
|
|
70
|
+
| Transaction7702Unsigned;
|
|
70
71
|
|
|
71
72
|
export interface TransactionLegacyUnsigned {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
type: "0x0";
|
|
74
|
+
nonce: Uint;
|
|
75
|
+
to?: Address | null;
|
|
76
|
+
gas: Uint;
|
|
77
|
+
value: Uint;
|
|
78
|
+
input: Bytes;
|
|
79
|
+
gasPrice: Uint;
|
|
80
|
+
chainId?: Uint;
|
|
80
81
|
}
|
|
81
82
|
export interface Transaction2930Unsigned {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
83
|
+
type: "0x1";
|
|
84
|
+
nonce: Uint;
|
|
85
|
+
to?: Address | null;
|
|
86
|
+
gas: Uint;
|
|
87
|
+
value: Uint;
|
|
88
|
+
input: Bytes;
|
|
89
|
+
gasPrice: Uint;
|
|
90
|
+
chainId: Uint;
|
|
91
|
+
accessList: AccessListEntry[];
|
|
91
92
|
}
|
|
92
93
|
export interface Transaction1559Unsigned {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
94
|
+
type: "0x2";
|
|
95
|
+
nonce: Uint;
|
|
96
|
+
to?: Address | null;
|
|
97
|
+
gas: Uint;
|
|
98
|
+
value: Uint;
|
|
99
|
+
input: Bytes;
|
|
100
|
+
gasPrice: Uint;
|
|
101
|
+
maxFeePerGas: Uint;
|
|
102
|
+
maxPriorityFeePerGas: Uint;
|
|
103
|
+
accessList: AccessListEntry[];
|
|
104
|
+
chainId: Uint;
|
|
104
105
|
}
|
|
105
106
|
export interface Transaction4844Unsigned {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
107
|
+
type: "0x3";
|
|
108
|
+
nonce: Uint;
|
|
109
|
+
to: Address;
|
|
110
|
+
gas: Uint;
|
|
111
|
+
value: Uint;
|
|
112
|
+
input: Bytes;
|
|
113
|
+
gasPrice?: Uint;
|
|
114
|
+
maxFeePerGas: Uint;
|
|
115
|
+
maxPriorityFeePerGas: Uint;
|
|
116
|
+
maxFeePerBlobGas: Uint;
|
|
117
|
+
accessList: AccessListEntry[];
|
|
118
|
+
blobVersionedHashes: Hash32[];
|
|
119
|
+
chainId: Uint;
|
|
119
120
|
}
|
|
120
121
|
export interface Transaction7702Unsigned {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
122
|
+
type: "0x4";
|
|
123
|
+
nonce: Uint;
|
|
124
|
+
to: Address;
|
|
125
|
+
gas: Uint;
|
|
126
|
+
value: Uint;
|
|
127
|
+
input: Bytes;
|
|
128
|
+
maxPriorityFeePerGas: Uint;
|
|
129
|
+
maxFeePerGas: Uint;
|
|
130
|
+
gasPrice?: Uint;
|
|
131
|
+
accessList: AccessListEntry[];
|
|
132
|
+
chainId: Uint;
|
|
133
|
+
authorizationList: AuthorizationList;
|
|
133
134
|
}
|
|
134
135
|
export interface AuthorizationListEntry {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
136
|
+
chainId: Uint;
|
|
137
|
+
nonce: Uint;
|
|
138
|
+
address: Address;
|
|
139
|
+
yParity: Byte;
|
|
140
|
+
r: Uint256;
|
|
141
|
+
s: Uint256;
|
|
141
142
|
}
|
|
142
|
-
export type AuthorizationList = AuthorizationListEntry[]
|
|
143
|
+
export type AuthorizationList = AuthorizationListEntry[];
|
|
143
144
|
|
|
144
145
|
export type TransactionLegacySigned = {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
} & TransactionLegacyUnsigned
|
|
146
|
+
v: Byte;
|
|
147
|
+
r: Uint;
|
|
148
|
+
s: Uint;
|
|
149
|
+
} & TransactionLegacyUnsigned;
|
|
149
150
|
export type Transaction2930Signed = {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
} & Transaction2930Unsigned
|
|
151
|
+
yParity: Bytes;
|
|
152
|
+
r: Uint;
|
|
153
|
+
s: Uint;
|
|
154
|
+
v?: Byte;
|
|
155
|
+
} & Transaction2930Unsigned;
|
|
155
156
|
export type Transaction1559Signed = {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
} & Transaction1559Unsigned
|
|
157
|
+
yParity: Bytes;
|
|
158
|
+
r: Uint;
|
|
159
|
+
s: Uint;
|
|
160
|
+
v?: Byte;
|
|
161
|
+
} & Transaction1559Unsigned;
|
|
161
162
|
export type Transaction4844Signed = {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
} & Transaction4844Unsigned
|
|
163
|
+
yParity: Byte;
|
|
164
|
+
r: Uint;
|
|
165
|
+
s: Uint;
|
|
166
|
+
v?: Byte;
|
|
167
|
+
} & Transaction4844Unsigned;
|
|
167
168
|
export type Transaction7702Signed = {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
} & Transaction7702Unsigned
|
|
173
|
-
export type TransactionSigned =
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
169
|
+
yParity: Byte;
|
|
170
|
+
r: Uint;
|
|
171
|
+
s: Uint;
|
|
172
|
+
v?: Byte;
|
|
173
|
+
} & Transaction7702Unsigned;
|
|
174
|
+
export type TransactionSigned =
|
|
175
|
+
| TransactionLegacySigned
|
|
176
|
+
| Transaction2930Signed
|
|
177
|
+
| Transaction1559Signed
|
|
178
|
+
| Transaction4844Signed
|
|
179
|
+
| Transaction7702Signed;
|
|
178
180
|
export type TransactionInfo = {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
} & TransactionSigned
|
|
181
|
+
blockHash: Hash32;
|
|
182
|
+
blockNumber: Uint;
|
|
183
|
+
from: Address;
|
|
184
|
+
hash: Hash32;
|
|
185
|
+
transactionIndex: Uint;
|
|
186
|
+
} & TransactionSigned;
|
|
185
187
|
export interface GenericTransaction {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
188
|
+
type?: "0x0" | "0x1" | "0x2" | "0x3";
|
|
189
|
+
to?: Address | null;
|
|
190
|
+
from?: Address;
|
|
191
|
+
value?: Uint;
|
|
192
|
+
nonce?: Uint;
|
|
193
|
+
gas?: Uint;
|
|
194
|
+
input?: Bytes;
|
|
195
|
+
gasPrice?: Uint;
|
|
196
|
+
maxPriorityFeePerGas?: Uint;
|
|
197
|
+
maxFeePerGas?: Uint;
|
|
198
|
+
maxFeePerBlobGas?: Uint;
|
|
199
|
+
accessList?: AccessListEntry[];
|
|
200
|
+
blobVersionedHashes?: Hash32[];
|
|
201
|
+
blobs?: Bytes[];
|
|
202
|
+
chainId?: Uint;
|
|
203
|
+
authorizationList?: AuthorizationList;
|
|
202
204
|
}
|
|
203
205
|
|
|
204
206
|
// withdrawal.yaml
|
|
205
207
|
export interface Withdrawal {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
208
|
+
index: Uint64;
|
|
209
|
+
validatorIndex: Uint64;
|
|
210
|
+
address: Address;
|
|
211
|
+
amount: Uint256;
|
|
210
212
|
}
|
|
211
213
|
|
|
212
214
|
// state.yaml
|
|
213
215
|
export interface AccountProof {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
216
|
+
address: Address;
|
|
217
|
+
accountProof: Bytes;
|
|
218
|
+
balance: Uint256;
|
|
219
|
+
codeHash: Hash32;
|
|
220
|
+
nonce: Uint64;
|
|
221
|
+
storageHash: Hash32;
|
|
222
|
+
storageProof: StorageProof;
|
|
221
223
|
}
|
|
222
224
|
export interface StorageProof {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
225
|
+
key: Bytes32;
|
|
226
|
+
value: Uint256;
|
|
227
|
+
proof: Bytes;
|
|
226
228
|
}
|
|
227
229
|
|
|
228
230
|
// receipt.yaml
|
|
229
231
|
export interface Log {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
232
|
+
transactionHash: Hash32;
|
|
233
|
+
removed?: boolean;
|
|
234
|
+
logIndex?: Uint;
|
|
235
|
+
transactionIndex?: Uint;
|
|
236
|
+
blockHash?: Hash32;
|
|
237
|
+
blockNumber?: Uint;
|
|
238
|
+
blockTimestamp?: Uint;
|
|
239
|
+
address?: Address;
|
|
240
|
+
data?: Bytes;
|
|
241
|
+
topics?: Bytes32[];
|
|
240
242
|
}
|
|
241
243
|
export interface ReceiptInfo {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
244
|
+
type?: Byte;
|
|
245
|
+
transactionHash: Hash32;
|
|
246
|
+
transactionIndex: Uint;
|
|
247
|
+
blockHash: Byte;
|
|
248
|
+
blockNumber: Uint;
|
|
249
|
+
from: Address;
|
|
250
|
+
to?: Address | null;
|
|
251
|
+
cumulativeGasUsed: Uint;
|
|
252
|
+
gasUsed: Uint;
|
|
253
|
+
blobGasUsed?: Uint;
|
|
254
|
+
contractAddress?: Address | null;
|
|
255
|
+
logs: Log[];
|
|
256
|
+
logsBloom: Bytes256;
|
|
257
|
+
root?: Hash32;
|
|
258
|
+
status?: Uint;
|
|
259
|
+
effectiveGasPrice: Uint;
|
|
260
|
+
blobGasPrice?: Uint;
|
|
259
261
|
}
|
|
260
262
|
|
|
261
263
|
// filter.yaml
|
|
262
|
-
export type FilterResults = Hash32[] | Log[]
|
|
263
|
-
export type FilterTopic = Bytes32 | Bytes32[]
|
|
264
|
-
export type FilterTopics = FilterTopic | null
|
|
265
|
-
export type Filter = FilterByBlockRange | FilterByBlockHash
|
|
264
|
+
export type FilterResults = Hash32[] | Log[];
|
|
265
|
+
export type FilterTopic = Bytes32 | Bytes32[];
|
|
266
|
+
export type FilterTopics = FilterTopic | null;
|
|
267
|
+
export type Filter = FilterByBlockRange | FilterByBlockHash;
|
|
266
268
|
export interface FilterByBlockRange {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
fromBlock?: Uint;
|
|
270
|
+
toBlock?: Uint;
|
|
271
|
+
address?: null | Address | Addresses;
|
|
272
|
+
topics?: FilterTopics;
|
|
271
273
|
}
|
|
272
274
|
export interface FilterByBlockHash {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
275
|
+
blockHash: Hash32;
|
|
276
|
+
address?: Address | Addresses | null;
|
|
277
|
+
topics?: FilterTopics;
|
|
276
278
|
}
|
|
277
279
|
|
|
278
280
|
// execute.yaml
|
|
279
281
|
export interface EthSimulatePayload {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
282
|
+
blockStateCalls: BlockStateCall[];
|
|
283
|
+
traceTransfers?: boolean;
|
|
284
|
+
validation?: boolean;
|
|
285
|
+
returnFullTransactions?: boolean;
|
|
284
286
|
}
|
|
285
287
|
export interface BlockStateCall {
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
288
|
+
blockOverrides?: BlockOverrides;
|
|
289
|
+
stateOverrides?: StateOverrides;
|
|
290
|
+
calls?: GenericCallTransaction[];
|
|
289
291
|
}
|
|
290
292
|
export interface BlockOverrides {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
293
|
+
number?: Uint64;
|
|
294
|
+
prevRandao?: Uint256;
|
|
295
|
+
time?: Uint64;
|
|
296
|
+
gasLimit?: Uint64;
|
|
297
|
+
feeRecipient?: Address;
|
|
298
|
+
baseFeePerGas?: Uint256;
|
|
299
|
+
withdrawals?: Withdrawal[];
|
|
300
|
+
blobBaseFee?: Uint64;
|
|
299
301
|
}
|
|
300
|
-
export type StateOverrides = Record<Address, AccountOverride
|
|
302
|
+
export type StateOverrides = Record<Address, AccountOverride>;
|
|
301
303
|
export interface GenericCallTransaction {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
304
|
+
type?: "0x0" | "0x1" | "0x2" | "0x3";
|
|
305
|
+
to?: Address | null;
|
|
306
|
+
from?: Address;
|
|
307
|
+
value?: Uint;
|
|
308
|
+
nonce?: Uint;
|
|
309
|
+
gas?: Uint;
|
|
310
|
+
input?: Bytes;
|
|
311
|
+
gasPrice?: Uint;
|
|
312
|
+
maxPriorityFeePerGas?: Uint;
|
|
313
|
+
maxFeePerGas?: Uint;
|
|
314
|
+
maxFeePerBlobGas?: Uint;
|
|
315
|
+
accessList?: AccessListEntry[];
|
|
316
|
+
blobVersionedHashes?: Hash32[];
|
|
317
|
+
authorizationList?: AuthorizationList;
|
|
316
318
|
}
|
|
317
|
-
export type AccountOverride = AccountOverrideState | AccountOverrideStateDiff
|
|
319
|
+
export type AccountOverride = AccountOverrideState | AccountOverrideStateDiff;
|
|
318
320
|
export interface AccountOverrideState {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
321
|
+
state: AccountStorage;
|
|
322
|
+
nonce?: Uint64;
|
|
323
|
+
balance?: Uint256;
|
|
324
|
+
code?: Bytes;
|
|
325
|
+
movePrecompileToAddress?: Address;
|
|
324
326
|
}
|
|
325
327
|
export interface AccountOverrideStateDiff {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
328
|
+
stateDiff: AccountStorage;
|
|
329
|
+
nonce?: Uint64;
|
|
330
|
+
balance?: Uint256;
|
|
331
|
+
code?: Bytes;
|
|
332
|
+
movePrecompileToAddress?: Address;
|
|
331
333
|
}
|
|
332
|
-
export type AccountStorage = Record<Bytes32, Hash32
|
|
333
|
-
export type EthSimulateResult = EthSimulateBlockResultSingleSuccess[]
|
|
334
|
+
export type AccountStorage = Record<Bytes32, Hash32>;
|
|
335
|
+
export type EthSimulateResult = EthSimulateBlockResultSingleSuccess[];
|
|
334
336
|
|
|
335
337
|
export type EthSimulateBlockResultSingleSuccess = {
|
|
336
|
-
|
|
337
|
-
} & Block
|
|
338
|
-
export type CallResults = CallResultFailure | CallResultSuccess
|
|
338
|
+
calls: CallResults;
|
|
339
|
+
} & Block;
|
|
340
|
+
export type CallResults = CallResultFailure | CallResultSuccess;
|
|
339
341
|
export interface CallResultFailure {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
342
|
+
status: "0x0";
|
|
343
|
+
returnData: Bytes;
|
|
344
|
+
gasUsed: Uint64;
|
|
345
|
+
error: EXECUTION_REVERTED_ERROR | VM_EXECUTION_ERROR;
|
|
344
346
|
}
|
|
345
|
-
export type EXECUTION_REVERTED_ERROR = {
|
|
346
|
-
|
|
347
|
+
export type EXECUTION_REVERTED_ERROR = {
|
|
348
|
+
code: -32000;
|
|
349
|
+
message: "execution reverted.";
|
|
350
|
+
};
|
|
351
|
+
export type VM_EXECUTION_ERROR = {
|
|
352
|
+
code: -32015;
|
|
353
|
+
message: "vm execution error.";
|
|
354
|
+
};
|
|
347
355
|
export interface CallResultSuccess {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
356
|
+
status: "0x1";
|
|
357
|
+
returnData: Bytes;
|
|
358
|
+
gasUsed: Uint64;
|
|
359
|
+
logs: Log[];
|
|
352
360
|
}
|
|
353
361
|
|
|
354
362
|
// client.yaml
|
|
355
|
-
export type SyncingStatus = Syncing | false
|
|
363
|
+
export type SyncingStatus = Syncing | false;
|
|
356
364
|
export interface Syncing {
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
365
|
+
startingBlock?: Uint;
|
|
366
|
+
currentBlock?: Uint;
|
|
367
|
+
highestBlock?: Uint;
|
|
360
368
|
}
|