@rosen-bridge/evm-scanner 0.1.0-52fc0239
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/.eslintignore +1 -0
- package/CHANGELOG.md +8 -0
- package/README.md +24 -0
- package/dist/EvmRpcNetwork.d.ts +24 -0
- package/dist/EvmRpcNetwork.d.ts.map +1 -0
- package/dist/EvmRpcNetwork.js +57 -0
- package/dist/EvmRpcScanner.d.ts +7 -0
- package/dist/EvmRpcScanner.d.ts.map +1 -0
- package/dist/EvmRpcScanner.js +8 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/lib/EvmRpcNetwork.ts +67 -0
- package/lib/EvmRpcScanner.ts +18 -0
- package/lib/index.ts +2 -0
- package/lib/types.ts +5 -0
- package/package.json +35 -0
- package/tests/EvmRpcNetwork.spec.ts +141 -0
- package/tests/TestRpcNetwork.ts +5 -0
- package/tests/mocked/JsonRpcProvider.mock.ts +47 -0
- package/tests/testData.ts +226 -0
- package/tsconfig.build.json +11 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +11 -0
- package/vitest.config.ts +18 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { Block, JsonRpcProvider, Signature } from 'ethers';
|
|
2
|
+
export const blockHeight = 9511863;
|
|
3
|
+
export const wrongBlockHeight = 2000000000;
|
|
4
|
+
export const blockHash =
|
|
5
|
+
'0x3fe54add83a1b7122039ddfc4a5e6b2a4116791b2db5d4f6e3a5cd2a36737acc';
|
|
6
|
+
|
|
7
|
+
export const convertedTxList = [
|
|
8
|
+
{
|
|
9
|
+
type: 2,
|
|
10
|
+
to: '0xC12dC39e799706B3E9bAF3064Ce5011f491A480B',
|
|
11
|
+
data: '0x',
|
|
12
|
+
nonce: 10,
|
|
13
|
+
gasLimit: '21000',
|
|
14
|
+
gasPrice: '32276327370',
|
|
15
|
+
maxPriorityFeePerGas: '500000000',
|
|
16
|
+
maxFeePerGas: '48978500000',
|
|
17
|
+
value: '92850988521632054',
|
|
18
|
+
chainId: '1',
|
|
19
|
+
sig: {
|
|
20
|
+
_type: 'signature',
|
|
21
|
+
networkV: null,
|
|
22
|
+
r: '0xb54273293ae8a1d911657f04f406027897925f2f3ecefe2fbb95e22cc13d1414',
|
|
23
|
+
s: '0x782d760a089d965d0a3c71c29e6099479801c2de90883ca1c77c6a964a7a88ef',
|
|
24
|
+
v: 28,
|
|
25
|
+
},
|
|
26
|
+
accessList: [],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
type: 2,
|
|
30
|
+
to: '0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD',
|
|
31
|
+
data: '0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000065c719bb00000000000000000000000000000000000000000000000000000000000000030b090c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000001f7f3817dac93d900000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000013da329b633647180000000000000000000000000000000000000000000000000000001f7f3817dac93d900000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000007acc3f723419fa0c1f789618f798e75c5189c24f000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000',
|
|
32
|
+
nonce: 43,
|
|
33
|
+
gasLimit: '188628',
|
|
34
|
+
gasPrice: '32276327370',
|
|
35
|
+
maxPriorityFeePerGas: '500000000',
|
|
36
|
+
maxFeePerGas: '43692000000',
|
|
37
|
+
value: '141849650770252761',
|
|
38
|
+
chainId: '1',
|
|
39
|
+
sig: {
|
|
40
|
+
_type: 'signature',
|
|
41
|
+
networkV: null,
|
|
42
|
+
r: '0x7ea8d127786960cf7b29166b4ec78b06fcb9b756df3f74ba0c9f1780e23787b7',
|
|
43
|
+
s: '0x16f70d2bde16a97f3bbb76b37de94e88f45be017db41f05ff0cbc76e2f48cb9e',
|
|
44
|
+
v: 28,
|
|
45
|
+
},
|
|
46
|
+
accessList: [],
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: 2,
|
|
50
|
+
to: '0xE4eDb277e41dc89aB076a1F049f4a3EfA700bCE8',
|
|
51
|
+
data: '0x',
|
|
52
|
+
nonce: 640,
|
|
53
|
+
gasLimit: '31500',
|
|
54
|
+
gasPrice: '32076327370',
|
|
55
|
+
maxPriorityFeePerGas: '300000000',
|
|
56
|
+
maxFeePerGas: '44000000000',
|
|
57
|
+
value: '601200000000009002',
|
|
58
|
+
chainId: '1',
|
|
59
|
+
sig: {
|
|
60
|
+
_type: 'signature',
|
|
61
|
+
networkV: null,
|
|
62
|
+
r: '0xc2d7577beda0ebfa1f460d63c4f7c17ff4b05fa616f1bf213a4d1f813700467b',
|
|
63
|
+
s: '0x461cc03ff2692d93d7bf14b53a924cb895b695f1260e44013c5b18a567e7a808',
|
|
64
|
+
v: 28,
|
|
65
|
+
},
|
|
66
|
+
accessList: [],
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
type: 2,
|
|
70
|
+
to: '0x823556202e86763853b40e9cDE725f412e294689',
|
|
71
|
+
data: '0x095ea7b30000000000000000000000001111111254eeb25477b68fb85ed929f73a9605820000000000000000000000000000000000000000000014765735f219af6a4b97',
|
|
72
|
+
nonce: 125,
|
|
73
|
+
gasLimit: '71024',
|
|
74
|
+
gasPrice: '32076327370',
|
|
75
|
+
maxPriorityFeePerGas: '300000000',
|
|
76
|
+
maxFeePerGas: '44000000000',
|
|
77
|
+
value: '0',
|
|
78
|
+
chainId: '1',
|
|
79
|
+
sig: {
|
|
80
|
+
_type: 'signature',
|
|
81
|
+
networkV: null,
|
|
82
|
+
r: '0xef57677ba4f282022ad579aabe1ef8f28e0e2ba5d8695bab87e85e0258261e2b',
|
|
83
|
+
s: '0x108174f3a65d72997fa4d947bb9b53e439bbfa806b5000dde8d9ae3a6e83f3dd',
|
|
84
|
+
v: 27,
|
|
85
|
+
},
|
|
86
|
+
accessList: [],
|
|
87
|
+
},
|
|
88
|
+
];
|
|
89
|
+
|
|
90
|
+
export const transactionsList = [
|
|
91
|
+
{
|
|
92
|
+
provider: new JsonRpcProvider(),
|
|
93
|
+
blockNumber: 19195927,
|
|
94
|
+
blockHash:
|
|
95
|
+
'0x3fe54add83a1b7122039ddfc4a5e6b2a4116791b2db5d4f6e3a5cd2a36737acc',
|
|
96
|
+
index: 4,
|
|
97
|
+
maxFeePerBlobGas: null,
|
|
98
|
+
hash: '0x0a661586235004d977583ee5715ae87679d2815381ff62f08e006bbc7e3a9afc',
|
|
99
|
+
type: 2,
|
|
100
|
+
to: '0xC12dC39e799706B3E9bAF3064Ce5011f491A480B',
|
|
101
|
+
from: '0xF8455E6623BEA8D8E4B8a51a827E6f1B527977e1',
|
|
102
|
+
nonce: 10,
|
|
103
|
+
gasLimit: 21000n,
|
|
104
|
+
gasPrice: 32276327370n,
|
|
105
|
+
maxPriorityFeePerGas: 500000000n,
|
|
106
|
+
maxFeePerGas: 48978500000n,
|
|
107
|
+
data: '0x',
|
|
108
|
+
value: 92850988521632054n,
|
|
109
|
+
chainId: 1n,
|
|
110
|
+
signature: Signature.from({
|
|
111
|
+
r: '0xb54273293ae8a1d911657f04f406027897925f2f3ecefe2fbb95e22cc13d1414',
|
|
112
|
+
s: '0x782d760a089d965d0a3c71c29e6099479801c2de90883ca1c77c6a964a7a88ef',
|
|
113
|
+
yParity: 1,
|
|
114
|
+
networkV: null,
|
|
115
|
+
}),
|
|
116
|
+
accessList: [],
|
|
117
|
+
blobVersionedHashes: null,
|
|
118
|
+
authorizationList: null,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
provider: new JsonRpcProvider(),
|
|
122
|
+
blockNumber: 19195927,
|
|
123
|
+
blockHash:
|
|
124
|
+
'0x3fe54add83a1b7122039ddfc4a5e6b2a4116791b2db5d4f6e3a5cd2a36737acc',
|
|
125
|
+
maxFeePerBlobGas: null,
|
|
126
|
+
blobVersionedHashes: null,
|
|
127
|
+
index: 3,
|
|
128
|
+
hash: '0x457077e99e7a8bd4a5403a08ab2aa793a6c9c7ceb6df0fa4704471431390bc4e',
|
|
129
|
+
type: 2,
|
|
130
|
+
to: '0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD',
|
|
131
|
+
from: '0x97493A13901934ee3C29955137F68f9E2933903C',
|
|
132
|
+
nonce: 43,
|
|
133
|
+
gasLimit: 188628n,
|
|
134
|
+
gasPrice: 32276327370n,
|
|
135
|
+
maxPriorityFeePerGas: 500000000n,
|
|
136
|
+
maxFeePerGas: 43692000000n,
|
|
137
|
+
data: '0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000065c719bb00000000000000000000000000000000000000000000000000000000000000030b090c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000001f7f3817dac93d900000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000013da329b633647180000000000000000000000000000000000000000000000000000001f7f3817dac93d900000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000007acc3f723419fa0c1f789618f798e75c5189c24f000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000',
|
|
138
|
+
value: 141849650770252761n,
|
|
139
|
+
chainId: 1n,
|
|
140
|
+
signature: Signature.from({
|
|
141
|
+
r: '0x7ea8d127786960cf7b29166b4ec78b06fcb9b756df3f74ba0c9f1780e23787b7',
|
|
142
|
+
s: '0x16f70d2bde16a97f3bbb76b37de94e88f45be017db41f05ff0cbc76e2f48cb9e',
|
|
143
|
+
yParity: 1,
|
|
144
|
+
networkV: null,
|
|
145
|
+
}),
|
|
146
|
+
accessList: [],
|
|
147
|
+
authorizationList: null,
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
provider: new JsonRpcProvider(),
|
|
151
|
+
blockNumber: 19195927,
|
|
152
|
+
maxFeePerBlobGas: null,
|
|
153
|
+
blobVersionedHashes: null,
|
|
154
|
+
blockHash:
|
|
155
|
+
'0x3fe54add83a1b7122039ddfc4a5e6b2a4116791b2db5d4f6e3a5cd2a36737acc',
|
|
156
|
+
hash: '0x3cdcaaba56740b0bcb5e1be7c4eb9a89b9f9444289fcfd766db74b541a158d5e',
|
|
157
|
+
type: 2,
|
|
158
|
+
index: 1,
|
|
159
|
+
to: '0xE4eDb277e41dc89aB076a1F049f4a3EfA700bCE8',
|
|
160
|
+
from: '0xB27Bab5009F7707339c1a9e4eD8A51003dbfA723',
|
|
161
|
+
nonce: 640,
|
|
162
|
+
gasLimit: 31500n,
|
|
163
|
+
gasPrice: 32076327370n,
|
|
164
|
+
maxPriorityFeePerGas: 300000000n,
|
|
165
|
+
maxFeePerGas: 44000000000n,
|
|
166
|
+
data: '0x',
|
|
167
|
+
value: 601200000000009002n,
|
|
168
|
+
chainId: 1n,
|
|
169
|
+
signature: Signature.from({
|
|
170
|
+
r: '0xc2d7577beda0ebfa1f460d63c4f7c17ff4b05fa616f1bf213a4d1f813700467b',
|
|
171
|
+
s: '0x461cc03ff2692d93d7bf14b53a924cb895b695f1260e44013c5b18a567e7a808',
|
|
172
|
+
yParity: 1,
|
|
173
|
+
networkV: null,
|
|
174
|
+
}),
|
|
175
|
+
accessList: [],
|
|
176
|
+
authorizationList: null,
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
provider: new JsonRpcProvider(),
|
|
180
|
+
blockNumber: 19195927,
|
|
181
|
+
blockHash:
|
|
182
|
+
'0x3fe54add83a1b7122039ddfc4a5e6b2a4116791b2db5d4f6e3a5cd2a36737acc',
|
|
183
|
+
maxFeePerBlobGas: null,
|
|
184
|
+
blobVersionedHashes: null,
|
|
185
|
+
index: 0,
|
|
186
|
+
hash: '0xd5c1486c432bdbde219639b50ccd1c6258690413a1c229014761aac7e74b1e0c',
|
|
187
|
+
type: 2,
|
|
188
|
+
to: '0x823556202e86763853b40e9cDE725f412e294689',
|
|
189
|
+
from: '0x4bb5655B942D56ccd346106037650bB62d961A2e',
|
|
190
|
+
nonce: 125,
|
|
191
|
+
gasLimit: 71024n,
|
|
192
|
+
gasPrice: 32076327370n,
|
|
193
|
+
maxPriorityFeePerGas: 300000000n,
|
|
194
|
+
maxFeePerGas: 44000000000n,
|
|
195
|
+
data: '0x095ea7b30000000000000000000000001111111254eeb25477b68fb85ed929f73a9605820000000000000000000000000000000000000000000014765735f219af6a4b97',
|
|
196
|
+
value: 0n,
|
|
197
|
+
chainId: 1n,
|
|
198
|
+
signature: Signature.from({
|
|
199
|
+
r: '0xef57677ba4f282022ad579aabe1ef8f28e0e2ba5d8695bab87e85e0258261e2b',
|
|
200
|
+
s: '0x108174f3a65d72997fa4d947bb9b53e439bbfa806b5000dde8d9ae3a6e83f3dd',
|
|
201
|
+
yParity: 0,
|
|
202
|
+
networkV: null,
|
|
203
|
+
}),
|
|
204
|
+
accessList: [],
|
|
205
|
+
authorizationList: null,
|
|
206
|
+
},
|
|
207
|
+
];
|
|
208
|
+
|
|
209
|
+
export const blockInfo = new Block(
|
|
210
|
+
{
|
|
211
|
+
number: blockHeight,
|
|
212
|
+
hash: blockHash,
|
|
213
|
+
timestamp: 1707546479,
|
|
214
|
+
parentHash:
|
|
215
|
+
'0x9fcb1964ac8fde533a72955b7a2162b0b088b81da3976ab4770f897542df90d4',
|
|
216
|
+
nonce: '0x0000000000000000',
|
|
217
|
+
difficulty: 0n,
|
|
218
|
+
gasLimit: 30000000n,
|
|
219
|
+
gasUsed: 13365113n,
|
|
220
|
+
miner: '0x95222290DD7278Aa3Ddd389Cc1E1d165CC4BAfe5',
|
|
221
|
+
extraData: '0x6265617665726275696c642e6f7267',
|
|
222
|
+
baseFeePerGas: 31776327370n,
|
|
223
|
+
transactions: transactionsList,
|
|
224
|
+
},
|
|
225
|
+
new JsonRpcProvider()
|
|
226
|
+
);
|