@aztec/aztec-node 0.1.0-alpha13
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/.dockerignore +4 -0
- package/.eslintrc.cjs +1 -0
- package/.tsbuildinfo +1 -0
- package/README.md +15 -0
- package/dest/aztec-node/aztec-node.d.ts +132 -0
- package/dest/aztec-node/aztec-node.d.ts.map +1 -0
- package/dest/aztec-node/aztec-node.js +2 -0
- package/dest/aztec-node/config.d.ts +13 -0
- package/dest/aztec-node/config.d.ts.map +1 -0
- package/dest/aztec-node/config.js +16 -0
- package/dest/aztec-node/http-node.d.ts +152 -0
- package/dest/aztec-node/http-node.d.ts.map +1 -0
- package/dest/aztec-node/http-node.js +306 -0
- package/dest/aztec-node/server.d.ts +161 -0
- package/dest/aztec-node/server.d.ts.map +1 -0
- package/dest/aztec-node/server.js +239 -0
- package/dest/index.d.ts +5 -0
- package/dest/index.d.ts.map +1 -0
- package/dest/index.js +5 -0
- package/package.json +19 -0
- package/src/aztec-node/aztec-node.ts +159 -0
- package/src/aztec-node/config.ts +22 -0
- package/src/aztec-node/http-node.ts +361 -0
- package/src/aztec-node/server.ts +321 -0
- package/src/index.ts +4 -0
- package/tsconfig.json +38 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
import { CONTRACT_TREE_HEIGHT, L1_TO_L2_MESSAGES_TREE_HEIGHT, PRIVATE_DATA_TREE_HEIGHT } from '@aztec/circuits.js';
|
|
3
|
+
import { AztecAddress } from '@aztec/foundation/aztec-address';
|
|
4
|
+
import { ContractPublicData, ContractData, L2Block, MerkleTreeId, L1ToL2MessageAndIndex, L2BlockL2Logs, TxHash, Tx } from '@aztec/types';
|
|
5
|
+
import { SiblingPath } from '@aztec/merkle-tree';
|
|
6
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
7
|
+
/**
|
|
8
|
+
* The aztec node.
|
|
9
|
+
*/
|
|
10
|
+
export interface AztecNode {
|
|
11
|
+
/**
|
|
12
|
+
* Method to determine if the node is ready to accept transactions.
|
|
13
|
+
* @returns - Flag indicating the readiness for tx submission.
|
|
14
|
+
*/
|
|
15
|
+
isReady(): Promise<boolean>;
|
|
16
|
+
/**
|
|
17
|
+
* Method to request blocks. Will attempt to return all requested blocks but will return only those available.
|
|
18
|
+
* @param from - The start of the range of blocks to return.
|
|
19
|
+
* @param take - The number of blocks desired.
|
|
20
|
+
* @returns The blocks requested.
|
|
21
|
+
*/
|
|
22
|
+
getBlocks(from: number, take: number): Promise<L2Block[]>;
|
|
23
|
+
/**
|
|
24
|
+
* Method to fetch the current block height.
|
|
25
|
+
* @returns The block height as a number.
|
|
26
|
+
*/
|
|
27
|
+
getBlockHeight(): Promise<number>;
|
|
28
|
+
/**
|
|
29
|
+
* Method to fetch the version of the rollup the node is connected to.
|
|
30
|
+
* @returns The rollup version.
|
|
31
|
+
*/
|
|
32
|
+
getVersion(): Promise<Fr>;
|
|
33
|
+
/**
|
|
34
|
+
* Method to fetch the chain id of the base-layer for the rollup.
|
|
35
|
+
* @returns The chain id.
|
|
36
|
+
*/
|
|
37
|
+
getChainId(): Promise<Fr>;
|
|
38
|
+
/**
|
|
39
|
+
* Lookup the L2 contract data for this contract.
|
|
40
|
+
* Contains the ethereum portal address and bytecode.
|
|
41
|
+
* @param contractAddress - The contract data address.
|
|
42
|
+
* @returns The complete contract data including portal address & bytecode (if we didn't throw an error).
|
|
43
|
+
*/
|
|
44
|
+
getContractData(contractAddress: AztecAddress): Promise<ContractPublicData | undefined>;
|
|
45
|
+
/**
|
|
46
|
+
* Lookup the L2 contract info for this contract.
|
|
47
|
+
* Contains the ethereum portal address .
|
|
48
|
+
* @param contractAddress - The contract data address.
|
|
49
|
+
* @returns The contract's address & portal address.
|
|
50
|
+
*/
|
|
51
|
+
getContractInfo(contractAddress: AztecAddress): Promise<ContractData | undefined>;
|
|
52
|
+
/**
|
|
53
|
+
* Gets the `take` amount of encrypted logs starting from `from`.
|
|
54
|
+
* @param from - Number of the L2 block to which corresponds the first encrypted logs to be returned.
|
|
55
|
+
* @param take - The number of encrypted logs to return.
|
|
56
|
+
* @returns The requested encrypted logs.
|
|
57
|
+
*/
|
|
58
|
+
getEncryptedLogs(from: number, take: number): Promise<L2BlockL2Logs[]>;
|
|
59
|
+
/**
|
|
60
|
+
* Gets the `take` amount of unencrypted logs starting from `from`.
|
|
61
|
+
* @param from - Number of the L2 block to which corresponds the first unencrypted logs to be returned.
|
|
62
|
+
* @param take - The number of unencrypted logs to return.
|
|
63
|
+
* @returns The requested unencrypted logs.
|
|
64
|
+
*/
|
|
65
|
+
getUnencryptedLogs(from: number, take: number): Promise<L2BlockL2Logs[]>;
|
|
66
|
+
/**
|
|
67
|
+
* Method to submit a transaction to the p2p pool.
|
|
68
|
+
* @param tx - The transaction to be submitted.
|
|
69
|
+
*/
|
|
70
|
+
sendTx(tx: Tx): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Method to retrieve pending txs.
|
|
73
|
+
* @returns The pending txs.
|
|
74
|
+
*/
|
|
75
|
+
getPendingTxs(): Promise<Tx[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Method to retrieve a single pending tx.
|
|
78
|
+
* @param txHash - The transaction hash to return.
|
|
79
|
+
* @returns The pending tx if it exists.
|
|
80
|
+
*/
|
|
81
|
+
getPendingTxByHash(txHash: TxHash): Promise<Tx | undefined>;
|
|
82
|
+
/**
|
|
83
|
+
* Find the index of the given contract.
|
|
84
|
+
* @param leafValue - The value to search for.
|
|
85
|
+
* @returns The index of the given leaf in the contracts tree or undefined if not found.
|
|
86
|
+
*/
|
|
87
|
+
findContractIndex(leafValue: Buffer): Promise<bigint | undefined>;
|
|
88
|
+
/**
|
|
89
|
+
* Returns the sibling path for the given index in the contract tree.
|
|
90
|
+
* @param leafIndex - The index of the leaf for which the sibling path is required.
|
|
91
|
+
* @returns The sibling path for the leaf index.
|
|
92
|
+
*/
|
|
93
|
+
getContractPath(leafIndex: bigint): Promise<SiblingPath<typeof CONTRACT_TREE_HEIGHT>>;
|
|
94
|
+
/**
|
|
95
|
+
* Find the index of the given commitment.
|
|
96
|
+
* @param leafValue - The value to search for.
|
|
97
|
+
* @returns The index of the given leaf of undefined if not found.
|
|
98
|
+
*/
|
|
99
|
+
findCommitmentIndex(leafValue: Buffer): Promise<bigint | undefined>;
|
|
100
|
+
/**
|
|
101
|
+
* Returns the sibling path for the given index in the data tree.
|
|
102
|
+
* @param leafIndex - The index of the leaf for which the sibling path is required.
|
|
103
|
+
* @returns The sibling path for the leaf index.
|
|
104
|
+
*/
|
|
105
|
+
getDataTreePath(leafIndex: bigint): Promise<SiblingPath<typeof PRIVATE_DATA_TREE_HEIGHT>>;
|
|
106
|
+
/**
|
|
107
|
+
* Gets a confirmed/consumed L1 to L2 message for the given message key (throws if not found).
|
|
108
|
+
* and its index in the merkle tree
|
|
109
|
+
* @param messageKey - The message key.
|
|
110
|
+
* @returns The map containing the message and index.
|
|
111
|
+
*/
|
|
112
|
+
getL1ToL2MessageAndIndex(messageKey: Fr): Promise<L1ToL2MessageAndIndex>;
|
|
113
|
+
/**
|
|
114
|
+
* Returns the sibling path for a leaf in the committed l1 to l2 data tree.
|
|
115
|
+
* @param leafIndex - Index of the leaf in the tree.
|
|
116
|
+
* @returns The sibling path.
|
|
117
|
+
*/
|
|
118
|
+
getL1ToL2MessagesTreePath(leafIndex: bigint): Promise<SiblingPath<typeof L1_TO_L2_MESSAGES_TREE_HEIGHT>>;
|
|
119
|
+
/**
|
|
120
|
+
* Gets the storage value at the given contract slot. Our version of eth_getStorageAt.
|
|
121
|
+
* @param contract - Address of the contract to query.
|
|
122
|
+
* @param slot - Slot to query.
|
|
123
|
+
* @returns Storage value at the given contract slot (or undefined if not found).
|
|
124
|
+
*/
|
|
125
|
+
getStorageAt(contract: AztecAddress, slot: bigint): Promise<Buffer | undefined>;
|
|
126
|
+
/**
|
|
127
|
+
* Returns the current committed roots for the data trees.
|
|
128
|
+
* @returns The current committed roots for the data trees.
|
|
129
|
+
*/
|
|
130
|
+
getTreeRoots(): Promise<Record<MerkleTreeId, Fr>>;
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=aztec-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aztec-node.d.ts","sourceRoot":"","sources":["../../src/aztec-node/aztec-node.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,6BAA6B,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACnH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,MAAM,EACN,EAAE,EACH,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAE5B;;;;;OAKG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAE1D;;;OAGG;IACH,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAElC;;;OAGG;IACH,UAAU,IAAI,OAAO,CAAC,EAAE,CAAC,CAAC;IAE1B;;;OAGG;IACH,UAAU,IAAI,OAAO,CAAC,EAAE,CAAC,CAAC;IAE1B;;;;;OAKG;IACH,eAAe,CAAC,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAAC;IAExF;;;;;OAKG;IACH,eAAe,CAAC,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;IAEl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C,MAAM,GAAG,SAAS,CAAC,CAAC;IAEhF;;;OAGG;IACH,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC;CACnD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ArchiverConfig } from '@aztec/archiver';
|
|
2
|
+
import { SequencerClientConfig } from '@aztec/sequencer-client';
|
|
3
|
+
import { P2PConfig } from '@aztec/p2p';
|
|
4
|
+
/**
|
|
5
|
+
* The configuration the aztec node.
|
|
6
|
+
*/
|
|
7
|
+
export type AztecNodeConfig = ArchiverConfig & SequencerClientConfig & P2PConfig;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the config of the aztec node from environment variables with reasonable defaults.
|
|
10
|
+
* @returns A valid aztec node config.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getConfigEnvVars(): AztecNodeConfig;
|
|
13
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/aztec-node/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAuC,MAAM,iBAAiB,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAwC,MAAM,yBAAyB,CAAC;AACtG,OAAO,EAAE,SAAS,EAAuB,MAAM,YAAY,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,qBAAqB,GAAG,SAAS,CAAC;AAEjF;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,eAAe,CAQlD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getConfigEnvVars as getArchiverVars } from '@aztec/archiver';
|
|
2
|
+
import { getConfigEnvVars as getSequencerVars } from '@aztec/sequencer-client';
|
|
3
|
+
import { getP2PConfigEnvVars } from '@aztec/p2p';
|
|
4
|
+
/**
|
|
5
|
+
* Returns the config of the aztec node from environment variables with reasonable defaults.
|
|
6
|
+
* @returns A valid aztec node config.
|
|
7
|
+
*/
|
|
8
|
+
export function getConfigEnvVars() {
|
|
9
|
+
const allEnvVars = {
|
|
10
|
+
...getSequencerVars(),
|
|
11
|
+
...getArchiverVars(),
|
|
12
|
+
...getP2PConfigEnvVars(),
|
|
13
|
+
};
|
|
14
|
+
return allEnvVars;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2F6dGVjLW5vZGUvY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBa0IsZ0JBQWdCLElBQUksZUFBZSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDdEYsT0FBTyxFQUF5QixnQkFBZ0IsSUFBSSxnQkFBZ0IsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQ3RHLE9BQU8sRUFBYSxtQkFBbUIsRUFBRSxNQUFNLFlBQVksQ0FBQztBQU81RDs7O0dBR0c7QUFDSCxNQUFNLFVBQVUsZ0JBQWdCO0lBQzlCLE1BQU0sVUFBVSxHQUFvQjtRQUNsQyxHQUFHLGdCQUFnQixFQUFFO1FBQ3JCLEdBQUcsZUFBZSxFQUFFO1FBQ3BCLEdBQUcsbUJBQW1CLEVBQUU7S0FDekIsQ0FBQztJQUVGLE9BQU8sVUFBVSxDQUFDO0FBQ3BCLENBQUMifQ==
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
import { AztecNode } from '@aztec/aztec-node';
|
|
3
|
+
import { AztecAddress, CONTRACT_TREE_HEIGHT, Fr, L1_TO_L2_MESSAGES_TREE_HEIGHT, PRIVATE_DATA_TREE_HEIGHT } from '@aztec/circuits.js';
|
|
4
|
+
import { SiblingPath } from '@aztec/merkle-tree';
|
|
5
|
+
import { ContractData, ContractPublicData, L1ToL2MessageAndIndex, L2Block, L2BlockL2Logs, MerkleTreeId, Tx, TxHash } from '@aztec/types';
|
|
6
|
+
/**
|
|
7
|
+
* Serialises a transaction to JSON representation.
|
|
8
|
+
* @param tx - The transaction to serialise.
|
|
9
|
+
* @returns The serialsied transaction.
|
|
10
|
+
*/
|
|
11
|
+
export declare function txToJson(tx: Tx): {
|
|
12
|
+
data: string;
|
|
13
|
+
encryptedLogs: string;
|
|
14
|
+
unencryptedLogs: string;
|
|
15
|
+
proof: string;
|
|
16
|
+
newContractPublicFunctions: string[];
|
|
17
|
+
enqueuedPublicFunctions: string[];
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Deserialises a transaction from JSON.
|
|
21
|
+
* @param json - The JSON representation of the transaction.
|
|
22
|
+
* @returns The deserialised transaction.
|
|
23
|
+
*/
|
|
24
|
+
export declare function txFromJson(json: any): Tx;
|
|
25
|
+
/**
|
|
26
|
+
* A Http client based implementation of Aztec Node.
|
|
27
|
+
*/
|
|
28
|
+
export declare class HttpNode implements AztecNode {
|
|
29
|
+
private baseUrl;
|
|
30
|
+
constructor(baseUrl: string);
|
|
31
|
+
/**
|
|
32
|
+
* Method to determine if the node is ready to accept transactions.
|
|
33
|
+
* @returns - Flag indicating the readiness for tx submission.
|
|
34
|
+
*/
|
|
35
|
+
isReady(): Promise<boolean>;
|
|
36
|
+
/**
|
|
37
|
+
* Method to request blocks. Will attempt to return all requested blocks but will return only those available.
|
|
38
|
+
* @param from - The start of the range of blocks to return.
|
|
39
|
+
* @param take - The number of blocks desired.
|
|
40
|
+
* @returns The blocks requested.
|
|
41
|
+
*/
|
|
42
|
+
getBlocks(from: number, take: number): Promise<L2Block[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Method to fetch the current block height.
|
|
45
|
+
* @returns The block height as a number.
|
|
46
|
+
*/
|
|
47
|
+
getBlockHeight(): Promise<number>;
|
|
48
|
+
/**
|
|
49
|
+
* Method to fetch the version of the rollup the node is connected to.
|
|
50
|
+
* @returns The rollup version.
|
|
51
|
+
*/
|
|
52
|
+
getVersion(): Promise<Fr>;
|
|
53
|
+
/**
|
|
54
|
+
* Method to fetch the chain id of the base-layer for the rollup.
|
|
55
|
+
* @returns The chain id.
|
|
56
|
+
*/
|
|
57
|
+
getChainId(): Promise<Fr>;
|
|
58
|
+
/**
|
|
59
|
+
* Lookup the L2 contract data for this contract.
|
|
60
|
+
* Contains the ethereum portal address and bytecode.
|
|
61
|
+
* @param contractAddress - The contract data address.
|
|
62
|
+
* @returns The complete contract data including portal address & bytecode (if we didn't throw an error).
|
|
63
|
+
*/
|
|
64
|
+
getContractData(contractAddress: AztecAddress): Promise<ContractPublicData | undefined>;
|
|
65
|
+
/**
|
|
66
|
+
* Gets the `take` amount of encrypted logs starting from `from`.
|
|
67
|
+
* @param from - Number of the L2 block to which corresponds the first encrypted logs to be returned.
|
|
68
|
+
* @param take - The number of encrypted logs to return.
|
|
69
|
+
* @returns The requested encrypted logs.
|
|
70
|
+
*/
|
|
71
|
+
getEncryptedLogs(from: number, take: number): Promise<L2BlockL2Logs[]>;
|
|
72
|
+
/**
|
|
73
|
+
* Gets the `take` amount of unencrypted logs starting from `from`.
|
|
74
|
+
* @param from - Number of the L2 block to which corresponds the first unencrypted logs to be returned.
|
|
75
|
+
* @param take - The number of unencrypted logs to return.
|
|
76
|
+
* @returns The requested unencrypted logs.
|
|
77
|
+
*/
|
|
78
|
+
getUnencryptedLogs(from: number, take: number): Promise<L2BlockL2Logs[]>;
|
|
79
|
+
/**
|
|
80
|
+
* Lookup the L2 contract info for this contract.
|
|
81
|
+
* Contains the ethereum portal address .
|
|
82
|
+
* @param contractAddress - The contract data address.
|
|
83
|
+
* @returns The contract's address & portal address.
|
|
84
|
+
*/
|
|
85
|
+
getContractInfo(contractAddress: AztecAddress): Promise<ContractData | undefined>;
|
|
86
|
+
/**
|
|
87
|
+
* Method to submit a transaction to the p2p pool.
|
|
88
|
+
* @param tx - The transaction to be submitted.
|
|
89
|
+
*/
|
|
90
|
+
sendTx(tx: Tx): Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* Method to retrieve pending txs.
|
|
93
|
+
* @returns - The pending txs.
|
|
94
|
+
*/
|
|
95
|
+
getPendingTxs(): Promise<Tx[]>;
|
|
96
|
+
/**
|
|
97
|
+
* Method to retrieve a single pending tx.
|
|
98
|
+
* @param txHash - The transaction hash to return.
|
|
99
|
+
* @returns - The pending tx if it exists.
|
|
100
|
+
*/
|
|
101
|
+
getPendingTxByHash(txHash: TxHash): Promise<Tx | undefined>;
|
|
102
|
+
/**
|
|
103
|
+
* Find the index of the given contract.
|
|
104
|
+
* @param leafValue - The value to search for.
|
|
105
|
+
* @returns The index of the given leaf in the contracts tree or undefined if not found.
|
|
106
|
+
*/
|
|
107
|
+
findContractIndex(leafValue: Buffer): Promise<bigint | undefined>;
|
|
108
|
+
/**
|
|
109
|
+
* Returns the sibling path for the given index in the contract tree.
|
|
110
|
+
* @param leafIndex - The index of the leaf for which the sibling path is required.
|
|
111
|
+
* @returns The sibling path for the leaf index.
|
|
112
|
+
*/
|
|
113
|
+
getContractPath(leafIndex: bigint): Promise<SiblingPath<typeof CONTRACT_TREE_HEIGHT>>;
|
|
114
|
+
/**
|
|
115
|
+
* Find the index of the given piece of data.
|
|
116
|
+
* @param leafValue - The value to search for.
|
|
117
|
+
* @returns The index of the given leaf in the data tree or undefined if not found.
|
|
118
|
+
*/
|
|
119
|
+
findCommitmentIndex(leafValue: Buffer): Promise<bigint | undefined>;
|
|
120
|
+
/**
|
|
121
|
+
* Returns the sibling path for the given index in the data tree.
|
|
122
|
+
* @param leafIndex - The index of the leaf for which the sibling path is required.
|
|
123
|
+
* @returns The sibling path for the leaf index.
|
|
124
|
+
*/
|
|
125
|
+
getDataTreePath(leafIndex: bigint): Promise<SiblingPath<typeof PRIVATE_DATA_TREE_HEIGHT>>;
|
|
126
|
+
/**
|
|
127
|
+
* Gets a consumed/confirmed L1 to L2 message for the given message key and its index in the merkle tree.
|
|
128
|
+
* @param messageKey - The message key.
|
|
129
|
+
* @returns the message (or throws if not found)
|
|
130
|
+
*/
|
|
131
|
+
getL1ToL2MessageAndIndex(messageKey: Fr): Promise<L1ToL2MessageAndIndex>;
|
|
132
|
+
/**
|
|
133
|
+
* Returns the sibling path for a leaf in the committed l1 to l2 data tree.
|
|
134
|
+
* @param leafIndex - Index of the leaf in the tree.
|
|
135
|
+
* @returns The sibling path.
|
|
136
|
+
*/
|
|
137
|
+
getL1ToL2MessagesTreePath(leafIndex: bigint): Promise<SiblingPath<typeof L1_TO_L2_MESSAGES_TREE_HEIGHT>>;
|
|
138
|
+
/**
|
|
139
|
+
* Gets the storage value at the given contract slot.
|
|
140
|
+
* @param contract - Address of the contract to query.
|
|
141
|
+
* @param slot - Slot to query.
|
|
142
|
+
* @returns Storage value at the given contract slot (or undefined if not found).
|
|
143
|
+
* Note: Aztec's version of `eth_getStorageAt`.
|
|
144
|
+
*/
|
|
145
|
+
getStorageAt(contract: AztecAddress, slot: bigint): Promise<Buffer | undefined>;
|
|
146
|
+
/**
|
|
147
|
+
* Returns the current committed roots for the data trees.
|
|
148
|
+
* @returns The current committed roots for the data trees.
|
|
149
|
+
*/
|
|
150
|
+
getTreeRoots(): Promise<Record<MerkleTreeId, Fr>>;
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=http-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-node.d.ts","sourceRoot":"","sources":["../../src/aztec-node/http-node.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,EAAE,EAEF,6BAA6B,EAC7B,wBAAwB,EAGzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EACL,YAAY,EACZ,kBAAkB,EAGlB,qBAAqB,EACr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