@aztec/aztec-node 0.7.9 → 0.8.6
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 +1 -1
- package/dest/aztec-node/config.d.ts +4 -1
- package/dest/aztec-node/config.d.ts.map +1 -1
- package/dest/aztec-node/config.js +3 -1
- package/dest/aztec-node/db.d.ts +13 -0
- package/dest/aztec-node/db.d.ts.map +1 -0
- package/dest/aztec-node/db.js +43 -0
- package/dest/aztec-node/http_rpc_server.d.ts +9 -0
- package/dest/aztec-node/http_rpc_server.d.ts.map +1 -0
- package/dest/aztec-node/http_rpc_server.js +30 -0
- package/dest/aztec-node/server.d.ts +35 -44
- package/dest/aztec-node/server.d.ts.map +1 -1
- package/dest/aztec-node/server.js +74 -70
- package/dest/bin/index.d.ts +9 -0
- package/dest/bin/index.d.ts.map +1 -0
- package/dest/bin/index.js +53 -0
- package/dest/index.d.ts +1 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +2 -2
- package/package.json +66 -11
- package/src/aztec-node/config.ts +8 -1
- package/src/aztec-node/db.ts +60 -0
- package/src/aztec-node/http_rpc_server.ts +46 -0
- package/src/aztec-node/server.ts +70 -75
- package/src/bin/index.ts +67 -0
- package/src/index.ts +1 -1
- package/.dockerignore +0 -4
- package/.eslintrc.cjs +0 -1
- package/.tsbuildinfo +0 -1
- package/dest/aztec-node/http-node.d.ts +0 -149
- package/dest/aztec-node/http-node.d.ts.map +0 -1
- package/dest/aztec-node/http-node.js +0 -334
- package/dest/aztec-node/http-node.test.d.ts +0 -2
- package/dest/aztec-node/http-node.test.d.ts.map +0 -1
- package/dest/aztec-node/http-node.test.js +0 -386
- package/src/aztec-node/http-node.test.ts +0 -519
- package/src/aztec-node/http-node.ts +0 -388
- package/tsconfig.json +0 -38
|
@@ -1,388 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AztecAddress,
|
|
3
|
-
CONTRACT_TREE_HEIGHT,
|
|
4
|
-
EthAddress,
|
|
5
|
-
Fr,
|
|
6
|
-
HistoricBlockData,
|
|
7
|
-
L1_TO_L2_MSG_TREE_HEIGHT,
|
|
8
|
-
PRIVATE_DATA_TREE_HEIGHT,
|
|
9
|
-
} from '@aztec/circuits.js';
|
|
10
|
-
import { DebugLogger, createDebugLogger } from '@aztec/foundation/log';
|
|
11
|
-
import {
|
|
12
|
-
AztecNode,
|
|
13
|
-
ContractData,
|
|
14
|
-
ExtendedContractData,
|
|
15
|
-
L1ToL2Message,
|
|
16
|
-
L1ToL2MessageAndIndex,
|
|
17
|
-
L2Block,
|
|
18
|
-
L2BlockL2Logs,
|
|
19
|
-
L2Tx,
|
|
20
|
-
LogType,
|
|
21
|
-
MerkleTreeId,
|
|
22
|
-
SiblingPath,
|
|
23
|
-
SimulationError,
|
|
24
|
-
Tx,
|
|
25
|
-
TxHash,
|
|
26
|
-
} from '@aztec/types';
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* A Http client based implementation of Aztec Node.
|
|
30
|
-
*/
|
|
31
|
-
export class HttpNode implements AztecNode {
|
|
32
|
-
private baseUrl: string;
|
|
33
|
-
private log: DebugLogger;
|
|
34
|
-
|
|
35
|
-
constructor(baseUrl: string, log = createDebugLogger('aztec:http-node')) {
|
|
36
|
-
this.baseUrl = baseUrl.toString().replace(/\/$/, '');
|
|
37
|
-
this.log = log;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Method to determine if the node is ready to accept transactions.
|
|
41
|
-
* @returns - Flag indicating the readiness for tx submission.
|
|
42
|
-
*/
|
|
43
|
-
public async isReady(): Promise<boolean> {
|
|
44
|
-
const url = new URL(this.baseUrl);
|
|
45
|
-
const response = await fetch(url.toString());
|
|
46
|
-
const respJson = await response.json();
|
|
47
|
-
return respJson.isReady;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Method to request a block at the provided block number.
|
|
52
|
-
* @param number - The block number to request.
|
|
53
|
-
* @returns The block requested. Or undefined if it does not exist.
|
|
54
|
-
*/
|
|
55
|
-
async getBlock(number: number): Promise<L2Block | undefined> {
|
|
56
|
-
const url = new URL(`${this.baseUrl}/get-block`);
|
|
57
|
-
url.searchParams.append('number', number.toString());
|
|
58
|
-
const response = await (await fetch(url.toString())).json();
|
|
59
|
-
const { block } = response;
|
|
60
|
-
return Promise.resolve(block ? L2Block.decode(Buffer.from(block, 'hex')) : block);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Method to request blocks. Will attempt to return all requested blocks but will return only those available.
|
|
65
|
-
* @param from - The start of the range of blocks to return.
|
|
66
|
-
* @param limit - Maximum number of blocks to obtain.
|
|
67
|
-
* @returns The blocks requested.
|
|
68
|
-
*/
|
|
69
|
-
async getBlocks(from: number, limit: number): Promise<L2Block[]> {
|
|
70
|
-
const url = new URL(`${this.baseUrl}/get-blocks`);
|
|
71
|
-
url.searchParams.append('from', from.toString());
|
|
72
|
-
if (limit !== undefined) {
|
|
73
|
-
url.searchParams.append('limit', limit.toString());
|
|
74
|
-
}
|
|
75
|
-
const response = await (await fetch(url.toString())).json();
|
|
76
|
-
const blocks = response.blocks as string[];
|
|
77
|
-
if (!blocks) {
|
|
78
|
-
return Promise.resolve([]);
|
|
79
|
-
}
|
|
80
|
-
return Promise.resolve(blocks.map(x => L2Block.decode(Buffer.from(x, 'hex'))));
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Method to fetch the current block number.
|
|
85
|
-
* @returns The current block number.
|
|
86
|
-
*/
|
|
87
|
-
async getBlockNumber(): Promise<number> {
|
|
88
|
-
const url = new URL(`${this.baseUrl}/get-block-number`);
|
|
89
|
-
const response = await fetch(url.toString());
|
|
90
|
-
const respJson = await response.json();
|
|
91
|
-
return respJson.blockNumber;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Method to fetch the version of the rollup the node is connected to.
|
|
96
|
-
* @returns The rollup version.
|
|
97
|
-
*/
|
|
98
|
-
public async getVersion(): Promise<number> {
|
|
99
|
-
const url = new URL(`${this.baseUrl}/get-version`);
|
|
100
|
-
const response = await fetch(url.toString());
|
|
101
|
-
const respJson = await response.json();
|
|
102
|
-
return respJson.version;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
public async getRollupAddress(): Promise<EthAddress> {
|
|
106
|
-
const url = new URL(`${this.baseUrl}/get-rollup-address`);
|
|
107
|
-
const response = await fetch(url.toString());
|
|
108
|
-
const respJson = await response.json();
|
|
109
|
-
return EthAddress.fromString(respJson.rollupAddress);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Method to fetch the chain id of the base-layer for the rollup.
|
|
114
|
-
* @returns The chain id.
|
|
115
|
-
*/
|
|
116
|
-
public async getChainId(): Promise<number> {
|
|
117
|
-
const url = new URL(`${this.baseUrl}/get-chain-id`);
|
|
118
|
-
const response = await fetch(url.toString());
|
|
119
|
-
const respJson = await response.json();
|
|
120
|
-
return respJson.chainId;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Get the extended contract data for this contract.
|
|
125
|
-
* @param contractAddress - The contract data address.
|
|
126
|
-
* @returns The extended contract data or undefined if not found.
|
|
127
|
-
*/
|
|
128
|
-
async getExtendedContractData(contractAddress: AztecAddress): Promise<ExtendedContractData | undefined> {
|
|
129
|
-
const url = new URL(`${this.baseUrl}/contract-data-and-bytecode`);
|
|
130
|
-
url.searchParams.append('address', contractAddress.toString());
|
|
131
|
-
const response = await (await fetch(url.toString())).json();
|
|
132
|
-
if (!response || !response.contractData) {
|
|
133
|
-
return undefined;
|
|
134
|
-
}
|
|
135
|
-
const contract = response.contractData as string;
|
|
136
|
-
return Promise.resolve(ExtendedContractData.fromBuffer(Buffer.from(contract, 'hex')));
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Gets up to `limit` amount of logs starting from `from`.
|
|
141
|
-
* @param from - Number of the L2 block to which corresponds the first logs to be returned.
|
|
142
|
-
* @param limit - The maximum number of logs to return.
|
|
143
|
-
* @param logType - Specifies whether to return encrypted or unencrypted logs.
|
|
144
|
-
* @returns The requested logs.
|
|
145
|
-
*/
|
|
146
|
-
public async getLogs(from: number, limit: number, logType: LogType): Promise<L2BlockL2Logs[]> {
|
|
147
|
-
const url = new URL(`${this.baseUrl}/get-logs`);
|
|
148
|
-
|
|
149
|
-
url.searchParams.append('from', from.toString());
|
|
150
|
-
url.searchParams.append('limit', limit.toString());
|
|
151
|
-
url.searchParams.append('logType', logType.toString());
|
|
152
|
-
|
|
153
|
-
const response = await (await fetch(url.toString())).json();
|
|
154
|
-
const logs = response.logs as string[];
|
|
155
|
-
|
|
156
|
-
if (!logs) {
|
|
157
|
-
return Promise.resolve([]);
|
|
158
|
-
}
|
|
159
|
-
return Promise.resolve(logs.map(x => L2BlockL2Logs.fromBuffer(Buffer.from(x, 'hex'))));
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Lookup the contract data for this contract.
|
|
164
|
-
* Contains the ethereum portal address.
|
|
165
|
-
* @param contractAddress - The contract data address.
|
|
166
|
-
* @returns The contract's address & portal address.
|
|
167
|
-
*/
|
|
168
|
-
async getContractData(contractAddress: AztecAddress): Promise<ContractData | undefined> {
|
|
169
|
-
const url = new URL(`${this.baseUrl}/contract-data`);
|
|
170
|
-
url.searchParams.append('address', contractAddress.toString());
|
|
171
|
-
const response = await (await fetch(url.toString())).json();
|
|
172
|
-
if (!response || !response.contractData) {
|
|
173
|
-
return undefined;
|
|
174
|
-
}
|
|
175
|
-
const contract = response.contractData as string;
|
|
176
|
-
return Promise.resolve(ContractData.fromBuffer(Buffer.from(contract, 'hex')));
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* Method to submit a transaction to the p2p pool.
|
|
181
|
-
* @param tx - The transaction to be submitted.
|
|
182
|
-
*/
|
|
183
|
-
async sendTx(tx: Tx): Promise<void> {
|
|
184
|
-
const url = new URL(`${this.baseUrl}/tx`);
|
|
185
|
-
const init: RequestInit = {};
|
|
186
|
-
init['method'] = 'POST';
|
|
187
|
-
init['body'] = tx.toBuffer();
|
|
188
|
-
await fetch(url, init);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Gets an l2 tx.
|
|
193
|
-
* @param txHash - The txHash of the l2 tx.
|
|
194
|
-
* @returns The requested L2 tx.
|
|
195
|
-
*/
|
|
196
|
-
async getTx(txHash: TxHash): Promise<L2Tx | undefined> {
|
|
197
|
-
const url = new URL(`${this.baseUrl}/get-tx`);
|
|
198
|
-
url.searchParams.append('hash', txHash.toString());
|
|
199
|
-
const response = await fetch(url.toString());
|
|
200
|
-
if (response.status === 404) {
|
|
201
|
-
this.log.info(`Tx ${txHash.toString()} not found`);
|
|
202
|
-
return undefined;
|
|
203
|
-
}
|
|
204
|
-
const txBuffer = Buffer.from(await response.arrayBuffer());
|
|
205
|
-
const tx = L2Tx.fromBuffer(txBuffer);
|
|
206
|
-
return Promise.resolve(tx);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Method to retrieve pending txs.
|
|
211
|
-
* @returns - The pending txs.
|
|
212
|
-
*/
|
|
213
|
-
getPendingTxs(): Promise<Tx[]> {
|
|
214
|
-
return Promise.resolve([]);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Method to retrieve a single pending tx.
|
|
219
|
-
* @param txHash - The transaction hash to return.
|
|
220
|
-
* @returns - The pending tx if it exists.
|
|
221
|
-
*/
|
|
222
|
-
async getPendingTxByHash(txHash: TxHash): Promise<Tx | undefined> {
|
|
223
|
-
const url = new URL(`${this.baseUrl}/get-pending-tx`);
|
|
224
|
-
url.searchParams.append('hash', txHash.toString());
|
|
225
|
-
const response = await fetch(url.toString());
|
|
226
|
-
if (response.status === 404) {
|
|
227
|
-
this.log.info(`Tx ${txHash.toString()} not found`);
|
|
228
|
-
return undefined;
|
|
229
|
-
}
|
|
230
|
-
const txBuffer = Buffer.from(await response.arrayBuffer());
|
|
231
|
-
const tx = Tx.fromBuffer(txBuffer);
|
|
232
|
-
return Promise.resolve(tx);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* Find the index of the given contract.
|
|
237
|
-
* @param leafValue - The value to search for.
|
|
238
|
-
* @returns The index of the given leaf in the contracts tree or undefined if not found.
|
|
239
|
-
*/
|
|
240
|
-
async findContractIndex(leafValue: Buffer): Promise<bigint | undefined> {
|
|
241
|
-
const url = new URL(`${this.baseUrl}/contract-index`);
|
|
242
|
-
url.searchParams.append('leaf', leafValue.toString('hex'));
|
|
243
|
-
const response = await (await fetch(url.toString())).json();
|
|
244
|
-
if (!response || !response.index) {
|
|
245
|
-
return undefined;
|
|
246
|
-
}
|
|
247
|
-
const index = response.index as string;
|
|
248
|
-
return Promise.resolve(BigInt(index));
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* Returns the sibling path for the given index in the contract tree.
|
|
253
|
-
* @param leafIndex - The index of the leaf for which the sibling path is required.
|
|
254
|
-
* @returns The sibling path for the leaf index.
|
|
255
|
-
*/
|
|
256
|
-
async getContractPath(leafIndex: bigint): Promise<SiblingPath<typeof CONTRACT_TREE_HEIGHT>> {
|
|
257
|
-
const url = new URL(`${this.baseUrl}/contract-path`);
|
|
258
|
-
url.searchParams.append('leaf', leafIndex.toString());
|
|
259
|
-
const response = await (await fetch(url.toString())).json();
|
|
260
|
-
const path = response.path as string;
|
|
261
|
-
return Promise.resolve(SiblingPath.fromString(path));
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* Find the index of the given piece of data.
|
|
266
|
-
* @param leafValue - The value to search for.
|
|
267
|
-
* @returns The index of the given leaf in the data tree or undefined if not found.
|
|
268
|
-
*/
|
|
269
|
-
async findCommitmentIndex(leafValue: Buffer): Promise<bigint | undefined> {
|
|
270
|
-
const url = new URL(`${this.baseUrl}/commitment-index`);
|
|
271
|
-
url.searchParams.append('leaf', leafValue.toString('hex'));
|
|
272
|
-
const response = await (await fetch(url.toString())).json();
|
|
273
|
-
if (!response || !response.index) {
|
|
274
|
-
return undefined;
|
|
275
|
-
}
|
|
276
|
-
const index = response.index as string;
|
|
277
|
-
return Promise.resolve(BigInt(index));
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* Returns the sibling path for the given index in the data tree.
|
|
282
|
-
* @param leafIndex - The index of the leaf for which the sibling path is required.
|
|
283
|
-
* @returns The sibling path for the leaf index.
|
|
284
|
-
*/
|
|
285
|
-
async getDataTreePath(leafIndex: bigint): Promise<SiblingPath<typeof PRIVATE_DATA_TREE_HEIGHT>> {
|
|
286
|
-
const url = new URL(`${this.baseUrl}/data-path`);
|
|
287
|
-
url.searchParams.append('leaf', leafIndex.toString());
|
|
288
|
-
const response = await (await fetch(url.toString())).json();
|
|
289
|
-
const path = response.path as string;
|
|
290
|
-
return Promise.resolve(SiblingPath.fromString(path));
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Gets a consumed/confirmed L1 to L2 message for the given message key and its index in the merkle tree.
|
|
295
|
-
* @param messageKey - The message key.
|
|
296
|
-
* @returns the message (or throws if not found)
|
|
297
|
-
*/
|
|
298
|
-
async getL1ToL2MessageAndIndex(messageKey: Fr): Promise<L1ToL2MessageAndIndex> {
|
|
299
|
-
const url = new URL(`${this.baseUrl}/l1-l2-message`);
|
|
300
|
-
url.searchParams.append('messageKey', messageKey.toString());
|
|
301
|
-
const response = await (await fetch(url.toString())).json();
|
|
302
|
-
return Promise.resolve({
|
|
303
|
-
message: L1ToL2Message.fromBuffer(Buffer.from(response.message as string, 'hex')),
|
|
304
|
-
index: BigInt(response.index as string),
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* Returns the sibling path for a leaf in the committed l1 to l2 data tree.
|
|
310
|
-
* @param leafIndex - Index of the leaf in the tree.
|
|
311
|
-
* @returns The sibling path.
|
|
312
|
-
*/
|
|
313
|
-
async getL1ToL2MessagesTreePath(leafIndex: bigint): Promise<SiblingPath<typeof L1_TO_L2_MSG_TREE_HEIGHT>> {
|
|
314
|
-
const url = new URL(`${this.baseUrl}/l1-l2-path`);
|
|
315
|
-
url.searchParams.append('leaf', leafIndex.toString());
|
|
316
|
-
const response = await (await fetch(url.toString())).json();
|
|
317
|
-
const path = response.path as string;
|
|
318
|
-
return Promise.resolve(SiblingPath.fromString(path));
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
* Gets the storage value at the given contract slot.
|
|
323
|
-
* @param contract - Address of the contract to query.
|
|
324
|
-
* @param slot - Slot to query.
|
|
325
|
-
* @returns Storage value at the given contract slot (or undefined if not found).
|
|
326
|
-
* Note: Aztec's version of `eth_getStorageAt`.
|
|
327
|
-
*/
|
|
328
|
-
async getPublicStorageAt(contract: AztecAddress, slot: bigint): Promise<Buffer | undefined> {
|
|
329
|
-
const url = new URL(`${this.baseUrl}/public-storage-at`);
|
|
330
|
-
url.searchParams.append('address', contract.toString());
|
|
331
|
-
url.searchParams.append('slot', slot.toString());
|
|
332
|
-
const response = await (await fetch(url.toString())).json();
|
|
333
|
-
if (!response || !response.value) {
|
|
334
|
-
return undefined;
|
|
335
|
-
}
|
|
336
|
-
const value = response.value as string;
|
|
337
|
-
return Promise.resolve(Buffer.from(value, 'hex'));
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* Returns the current committed roots for the data trees.
|
|
342
|
-
* @returns The current committed roots for the data trees.
|
|
343
|
-
*/
|
|
344
|
-
async getTreeRoots(): Promise<Record<MerkleTreeId, Fr>> {
|
|
345
|
-
const url = new URL(`${this.baseUrl}/tree-roots`);
|
|
346
|
-
const response = await (await fetch(url.toString())).json();
|
|
347
|
-
|
|
348
|
-
const extractRoot = (treeId: MerkleTreeId) => {
|
|
349
|
-
// Buffer.from(...) returns an empty buffer when a hex string is prefixed with "0x"
|
|
350
|
-
const rootHexString = response.roots[treeId].replace(/^0x/, '');
|
|
351
|
-
return Fr.fromBuffer(Buffer.from(rootHexString, 'hex'));
|
|
352
|
-
};
|
|
353
|
-
|
|
354
|
-
return {
|
|
355
|
-
[MerkleTreeId.CONTRACT_TREE]: extractRoot(MerkleTreeId.CONTRACT_TREE),
|
|
356
|
-
[MerkleTreeId.PRIVATE_DATA_TREE]: extractRoot(MerkleTreeId.PRIVATE_DATA_TREE),
|
|
357
|
-
[MerkleTreeId.NULLIFIER_TREE]: extractRoot(MerkleTreeId.NULLIFIER_TREE),
|
|
358
|
-
[MerkleTreeId.PUBLIC_DATA_TREE]: extractRoot(MerkleTreeId.PUBLIC_DATA_TREE),
|
|
359
|
-
[MerkleTreeId.L1_TO_L2_MESSAGES_TREE]: extractRoot(MerkleTreeId.L1_TO_L2_MESSAGES_TREE),
|
|
360
|
-
[MerkleTreeId.BLOCKS_TREE]: extractRoot(MerkleTreeId.BLOCKS_TREE),
|
|
361
|
-
};
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
/**
|
|
365
|
-
* Returns the currently committed historic block data.
|
|
366
|
-
* @returns The current committed block data.
|
|
367
|
-
*/
|
|
368
|
-
public async getHistoricBlockData(): Promise<HistoricBlockData> {
|
|
369
|
-
const url = new URL(`${this.baseUrl}/historic-block-data`);
|
|
370
|
-
const response = await (await fetch(url.toString())).json();
|
|
371
|
-
return response.blockData;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
/**
|
|
375
|
-
* Simulates the public part of a transaction with the current state.
|
|
376
|
-
* @param tx - The transaction to simulate.
|
|
377
|
-
**/
|
|
378
|
-
public async simulatePublicCalls(tx: Tx) {
|
|
379
|
-
const url = new URL(`${this.baseUrl}/simulate-tx`);
|
|
380
|
-
const init: RequestInit = {};
|
|
381
|
-
init['method'] = 'POST';
|
|
382
|
-
init['body'] = tx.toBuffer();
|
|
383
|
-
const response = await (await fetch(url, init)).json();
|
|
384
|
-
if (response.simulationError) {
|
|
385
|
-
throw SimulationError.fromJSON(response.simulationError);
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "..",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "dest",
|
|
5
|
-
"rootDir": "src",
|
|
6
|
-
"tsBuildInfoFile": ".tsbuildinfo"
|
|
7
|
-
},
|
|
8
|
-
"references": [
|
|
9
|
-
{
|
|
10
|
-
"path": "../archiver"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"path": "../circuits.js"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"path": "../foundation"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"path": "../l1-artifacts"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"path": "../merkle-tree"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"path": "../p2p"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"path": "../sequencer-client"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"path": "../types"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"path": "../world-state"
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
|
-
"include": ["src"]
|
|
38
|
-
}
|