1 | import type { GenericEthereumAccountId, GenericEthereumLookupSource } from '@polkadot/types';
|
2 | import type { Bytes, Enum, Option, Struct, U256, U64, U8aFixed, Vec, bool, f64, u32, u64 } from '@polkadot/types-codec';
|
3 | import type { BlockNumber, H160, H2048, H256, H512, H64 } from '@polkadot/types/interfaces/runtime';
|
4 |
|
5 | export interface BlockV0 extends Struct {
|
6 | readonly header: EthHeader;
|
7 | readonly transactions: Vec<TransactionV0>;
|
8 | readonly ommers: Vec<EthHeader>;
|
9 | }
|
10 |
|
11 | export interface BlockV1 extends Struct {
|
12 | readonly header: EthHeader;
|
13 | readonly transactions: Vec<TransactionV1>;
|
14 | readonly ommers: Vec<EthHeader>;
|
15 | }
|
16 |
|
17 | export interface BlockV2 extends Struct {
|
18 | readonly header: EthHeader;
|
19 | readonly transactions: Vec<TransactionV2>;
|
20 | readonly ommers: Vec<EthHeader>;
|
21 | }
|
22 |
|
23 | export interface EIP1559Transaction extends Struct {
|
24 | readonly chainId: u64;
|
25 | readonly nonce: U256;
|
26 | readonly maxPriorityFeePerGas: U256;
|
27 | readonly maxFeePerGas: U256;
|
28 | readonly gasLimit: U256;
|
29 | readonly action: EthTransactionAction;
|
30 | readonly value: U256;
|
31 | readonly input: Bytes;
|
32 | readonly accessList: EthAccessList;
|
33 | readonly oddYParity: bool;
|
34 | readonly r: H256;
|
35 | readonly s: H256;
|
36 | }
|
37 |
|
38 | export interface EIP2930Transaction extends Struct {
|
39 | readonly chainId: u64;
|
40 | readonly nonce: U256;
|
41 | readonly gasPrice: U256;
|
42 | readonly gasLimit: U256;
|
43 | readonly action: EthTransactionAction;
|
44 | readonly value: U256;
|
45 | readonly input: Bytes;
|
46 | readonly accessList: EthAccessList;
|
47 | readonly oddYParity: bool;
|
48 | readonly r: H256;
|
49 | readonly s: H256;
|
50 | }
|
51 |
|
52 | export interface EthAccessList extends Vec<EthAccessListItem> {
|
53 | }
|
54 |
|
55 | export interface EthAccessListItem extends Struct {
|
56 | readonly address: EthAddress;
|
57 | readonly slots: Vec<H256>;
|
58 | }
|
59 |
|
60 | export interface EthAccount extends Struct {
|
61 | readonly address: EthAddress;
|
62 | readonly balance: U256;
|
63 | readonly nonce: U256;
|
64 | readonly codeHash: H256;
|
65 | readonly storageHash: H256;
|
66 | readonly accountProof: Vec<Bytes>;
|
67 | readonly storageProof: Vec<EthStorageProof>;
|
68 | }
|
69 |
|
70 | export interface EthAddress extends H160 {
|
71 | }
|
72 |
|
73 | export interface EthBlock extends Struct {
|
74 | readonly header: EthHeader;
|
75 | readonly transactions: Vec<EthTransaction>;
|
76 | readonly ommers: Vec<EthHeader>;
|
77 | }
|
78 |
|
79 | export interface EthBloom extends H2048 {
|
80 | }
|
81 |
|
82 | export interface EthCallRequest extends Struct {
|
83 | readonly from: Option<EthAddress>;
|
84 | readonly to: Option<EthAddress>;
|
85 | readonly gasPrice: Option<U256>;
|
86 | readonly gas: Option<U256>;
|
87 | readonly value: Option<U256>;
|
88 | readonly data: Option<Bytes>;
|
89 | readonly nonce: Option<U256>;
|
90 | }
|
91 |
|
92 | export interface EthereumAccountId extends GenericEthereumAccountId {
|
93 | }
|
94 |
|
95 | export interface EthereumAddress extends GenericEthereumAccountId {
|
96 | }
|
97 |
|
98 | export interface EthereumLookupSource extends GenericEthereumLookupSource {
|
99 | }
|
100 |
|
101 | export interface EthereumSignature extends U8aFixed {
|
102 | }
|
103 |
|
104 | export interface EthFeeHistory extends Struct {
|
105 | readonly oldestBlock: U256;
|
106 | readonly baseFeePerGas: Vec<U256>;
|
107 | readonly gasUsedRatio: Vec<f64>;
|
108 | readonly reward: Option<Vec<Vec<U256>>>;
|
109 | }
|
110 |
|
111 | export interface EthFilter extends Struct {
|
112 | readonly fromBlock: Option<BlockNumber>;
|
113 | readonly toBlock: Option<BlockNumber>;
|
114 | readonly blockHash: Option<H256>;
|
115 | readonly address: Option<EthFilterAddress>;
|
116 | readonly topics: Option<EthFilterTopic>;
|
117 | }
|
118 |
|
119 | export interface EthFilterAddress extends Enum {
|
120 | readonly isSingle: boolean;
|
121 | readonly asSingle: EthAddress;
|
122 | readonly isMultiple: boolean;
|
123 | readonly asMultiple: Vec<EthAddress>;
|
124 | readonly isNull: boolean;
|
125 | readonly type: 'Single' | 'Multiple' | 'Null';
|
126 | }
|
127 |
|
128 | export interface EthFilterChanges extends Enum {
|
129 | readonly isLogs: boolean;
|
130 | readonly asLogs: Vec<EthLog>;
|
131 | readonly isHashes: boolean;
|
132 | readonly asHashes: Vec<H256>;
|
133 | readonly isEmpty: boolean;
|
134 | readonly type: 'Logs' | 'Hashes' | 'Empty';
|
135 | }
|
136 |
|
137 | export interface EthFilterTopic extends Enum {
|
138 | readonly isSingle: boolean;
|
139 | readonly asSingle: EthFilterTopicInner;
|
140 | readonly isMultiple: boolean;
|
141 | readonly asMultiple: Vec<EthFilterTopicInner>;
|
142 | readonly isNull: boolean;
|
143 | readonly type: 'Single' | 'Multiple' | 'Null';
|
144 | }
|
145 |
|
146 | export interface EthFilterTopicEntry extends Option<H256> {
|
147 | }
|
148 |
|
149 | export interface EthFilterTopicInner extends Enum {
|
150 | readonly isSingle: boolean;
|
151 | readonly asSingle: EthFilterTopicEntry;
|
152 | readonly isMultiple: boolean;
|
153 | readonly asMultiple: Vec<EthFilterTopicEntry>;
|
154 | readonly isNull: boolean;
|
155 | readonly type: 'Single' | 'Multiple' | 'Null';
|
156 | }
|
157 |
|
158 | export interface EthHeader extends Struct {
|
159 | readonly parentHash: H256;
|
160 | readonly ommersHash: H256;
|
161 | readonly beneficiary: EthAddress;
|
162 | readonly stateRoot: H256;
|
163 | readonly transactionsRoot: H256;
|
164 | readonly receiptsRoot: H256;
|
165 | readonly logsBloom: EthBloom;
|
166 | readonly difficulty: U256;
|
167 | readonly number: U256;
|
168 | readonly gasLimit: U256;
|
169 | readonly gasUsed: U256;
|
170 | readonly timestamp: u64;
|
171 | readonly extraData: Bytes;
|
172 | readonly mixMash: H256;
|
173 | readonly nonce: H64;
|
174 | }
|
175 |
|
176 | export interface EthLog extends Struct {
|
177 | readonly address: EthAddress;
|
178 | readonly topics: Vec<H256>;
|
179 | readonly data: Bytes;
|
180 | readonly blockHash: Option<H256>;
|
181 | readonly blockNumber: Option<U256>;
|
182 | readonly transactionHash: Option<H256>;
|
183 | readonly transactionIndex: Option<U256>;
|
184 | readonly logIndex: Option<U256>;
|
185 | readonly transactionLogIndex: Option<U256>;
|
186 | readonly removed: bool;
|
187 | }
|
188 |
|
189 | export interface EthReceipt extends Struct {
|
190 | readonly transactionHash: Option<H256>;
|
191 | readonly transactionIndex: Option<U256>;
|
192 | readonly blockHash: Option<H256>;
|
193 | readonly from: Option<EthAddress>;
|
194 | readonly to: Option<EthAddress>;
|
195 | readonly blockNumber: Option<U256>;
|
196 | readonly cumulativeGasUsed: U256;
|
197 | readonly gasUsed: Option<U256>;
|
198 | readonly contractAddress: Option<EthAddress>;
|
199 | readonly logs: Vec<EthLog>;
|
200 | readonly root: Option<H256>;
|
201 | readonly logsBloom: EthBloom;
|
202 | readonly statusCode: Option<U64>;
|
203 | }
|
204 |
|
205 | export interface EthReceiptV0 extends EthReceipt {
|
206 | }
|
207 |
|
208 | export interface EthReceiptV3 extends EthReceipt {
|
209 | }
|
210 |
|
211 | export interface EthRichBlock extends Struct {
|
212 | readonly blockHash: Option<H256>;
|
213 | readonly parentHash: H256;
|
214 | readonly sha3Uncles: H256;
|
215 | readonly author: EthAddress;
|
216 | readonly miner: EthAddress;
|
217 | readonly stateRoot: H256;
|
218 | readonly transactionsRoot: H256;
|
219 | readonly receiptsRoot: H256;
|
220 | readonly number: Option<U256>;
|
221 | readonly gasUsed: U256;
|
222 | readonly gasLimit: U256;
|
223 | readonly extraData: Bytes;
|
224 | readonly logsBloom: EthBloom;
|
225 | readonly timestamp: U256;
|
226 | readonly difficulty: U256;
|
227 | readonly totalDifficulty: Option<U256>;
|
228 | readonly sealFields: Vec<Bytes>;
|
229 | readonly uncles: Vec<H256>;
|
230 | readonly transactions: Vec<EthTransaction>;
|
231 | readonly blockSize: Option<U256>;
|
232 | }
|
233 |
|
234 | export interface EthRichHeader extends Struct {
|
235 | readonly blockHash: Option<H256>;
|
236 | readonly parentHash: H256;
|
237 | readonly sha3Uncles: H256;
|
238 | readonly author: EthAddress;
|
239 | readonly miner: EthAddress;
|
240 | readonly stateRoot: H256;
|
241 | readonly transactionsRoot: H256;
|
242 | readonly receiptsRoot: H256;
|
243 | readonly number: Option<U256>;
|
244 | readonly gasUsed: U256;
|
245 | readonly gasLimit: U256;
|
246 | readonly extraData: Bytes;
|
247 | readonly logsBloom: EthBloom;
|
248 | readonly timestamp: U256;
|
249 | readonly difficulty: U256;
|
250 | readonly sealFields: Vec<Bytes>;
|
251 | readonly blockSize: Option<U256>;
|
252 | }
|
253 |
|
254 | export interface EthStorageProof extends Struct {
|
255 | readonly key: U256;
|
256 | readonly value: U256;
|
257 | readonly proof: Vec<Bytes>;
|
258 | }
|
259 |
|
260 | export interface EthSubKind extends Enum {
|
261 | readonly isNewHeads: boolean;
|
262 | readonly isLogs: boolean;
|
263 | readonly isNewPendingTransactions: boolean;
|
264 | readonly isSyncing: boolean;
|
265 | readonly type: 'NewHeads' | 'Logs' | 'NewPendingTransactions' | 'Syncing';
|
266 | }
|
267 |
|
268 | export interface EthSubParams extends Enum {
|
269 | readonly isNone: boolean;
|
270 | readonly isLogs: boolean;
|
271 | readonly asLogs: EthFilter;
|
272 | readonly type: 'None' | 'Logs';
|
273 | }
|
274 |
|
275 | export interface EthSubResult extends Enum {
|
276 | readonly isHeader: boolean;
|
277 | readonly asHeader: EthRichHeader;
|
278 | readonly isLog: boolean;
|
279 | readonly asLog: EthLog;
|
280 | readonly isTransactionHash: boolean;
|
281 | readonly asTransactionHash: H256;
|
282 | readonly isSyncState: boolean;
|
283 | readonly asSyncState: EthSyncStatus;
|
284 | readonly type: 'Header' | 'Log' | 'TransactionHash' | 'SyncState';
|
285 | }
|
286 |
|
287 | export interface EthSyncInfo extends Struct {
|
288 | readonly startingBlock: U256;
|
289 | readonly currentBlock: U256;
|
290 | readonly highestBlock: U256;
|
291 | readonly warpChunksAmount: Option<U256>;
|
292 | readonly warpChunksProcessed: Option<U256>;
|
293 | }
|
294 |
|
295 | export interface EthSyncStatus extends Enum {
|
296 | readonly isInfo: boolean;
|
297 | readonly asInfo: EthSyncInfo;
|
298 | readonly isNone: boolean;
|
299 | readonly type: 'Info' | 'None';
|
300 | }
|
301 |
|
302 | export interface EthTransaction extends Struct {
|
303 | readonly hash: H256;
|
304 | readonly nonce: U256;
|
305 | readonly blockHash: Option<H256>;
|
306 | readonly blockNumber: Option<U256>;
|
307 | readonly transactionIndex: Option<U256>;
|
308 | readonly from: H160;
|
309 | readonly to: Option<H160>;
|
310 | readonly value: U256;
|
311 | readonly gasPrice: Option<U256>;
|
312 | readonly maxFeePerGas: Option<U256>;
|
313 | readonly maxPriorityFeePerGas: Option<U256>;
|
314 | readonly gas: U256;
|
315 | readonly input: Bytes;
|
316 | readonly creates: Option<H160>;
|
317 | readonly raw: Bytes;
|
318 | readonly publicKey: Option<H512>;
|
319 | readonly chainId: Option<U64>;
|
320 | readonly standardV: U256;
|
321 | readonly v: U256;
|
322 | readonly r: U256;
|
323 | readonly s: U256;
|
324 | readonly accessList: Option<Vec<EthAccessListItem>>;
|
325 | readonly transactionType: Option<U256>;
|
326 | }
|
327 |
|
328 | export interface EthTransactionAction extends Enum {
|
329 | readonly isCall: boolean;
|
330 | readonly asCall: H160;
|
331 | readonly isCreate: boolean;
|
332 | readonly type: 'Call' | 'Create';
|
333 | }
|
334 |
|
335 | export interface EthTransactionCondition extends Enum {
|
336 | readonly isBlock: boolean;
|
337 | readonly asBlock: u64;
|
338 | readonly isTime: boolean;
|
339 | readonly asTime: u64;
|
340 | readonly type: 'Block' | 'Time';
|
341 | }
|
342 |
|
343 | export interface EthTransactionRequest extends Struct {
|
344 | readonly from: Option<EthAddress>;
|
345 | readonly to: Option<EthAddress>;
|
346 | readonly gasPrice: Option<U256>;
|
347 | readonly gas: Option<U256>;
|
348 | readonly value: Option<U256>;
|
349 | readonly data: Option<Bytes>;
|
350 | readonly nonce: Option<U256>;
|
351 | }
|
352 |
|
353 | export interface EthTransactionSignature extends Struct {
|
354 | readonly v: u64;
|
355 | readonly r: H256;
|
356 | readonly s: H256;
|
357 | }
|
358 |
|
359 | export interface EthTransactionStatus extends Struct {
|
360 | readonly transactionHash: H256;
|
361 | readonly transactionIndex: u32;
|
362 | readonly from: EthAddress;
|
363 | readonly to: Option<EthAddress>;
|
364 | readonly contractAddress: Option<EthAddress>;
|
365 | readonly logs: Vec<EthLog>;
|
366 | readonly logsBloom: EthBloom;
|
367 | }
|
368 |
|
369 | export interface EthWork extends Struct {
|
370 | readonly powHash: H256;
|
371 | readonly seedHash: H256;
|
372 | readonly target: H256;
|
373 | readonly number: Option<u64>;
|
374 | }
|
375 |
|
376 | export interface LegacyTransaction extends Struct {
|
377 | readonly nonce: U256;
|
378 | readonly gasPrice: U256;
|
379 | readonly gasLimit: U256;
|
380 | readonly action: EthTransactionAction;
|
381 | readonly value: U256;
|
382 | readonly input: Bytes;
|
383 | readonly signature: EthTransactionSignature;
|
384 | }
|
385 |
|
386 | export interface TransactionV0 extends LegacyTransaction {
|
387 | }
|
388 |
|
389 | export interface TransactionV1 extends Enum {
|
390 | readonly isLegacy: boolean;
|
391 | readonly asLegacy: LegacyTransaction;
|
392 | readonly isEip2930: boolean;
|
393 | readonly asEip2930: EIP2930Transaction;
|
394 | readonly type: 'Legacy' | 'Eip2930';
|
395 | }
|
396 |
|
397 | export interface TransactionV2 extends Enum {
|
398 | readonly isLegacy: boolean;
|
399 | readonly asLegacy: LegacyTransaction;
|
400 | readonly isEip2930: boolean;
|
401 | readonly asEip2930: EIP2930Transaction;
|
402 | readonly isEip1559: boolean;
|
403 | readonly asEip1559: EIP1559Transaction;
|
404 | readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';
|
405 | }
|
406 | export type PHANTOM_ETH = 'eth';
|