@aztec/cli 2.1.0-rc.9 → 3.0.0-devnet.2
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 -427
- package/dest/cmds/aztec_node/block_number.d.ts +3 -0
- package/dest/cmds/aztec_node/block_number.d.ts.map +1 -0
- package/dest/cmds/aztec_node/block_number.js +10 -0
- package/dest/cmds/aztec_node/get_block.d.ts +3 -0
- package/dest/cmds/aztec_node/get_block.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_block.js +9 -0
- package/dest/cmds/aztec_node/get_current_base_fee.d.ts +3 -0
- package/dest/cmds/aztec_node/get_current_base_fee.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_current_base_fee.js +7 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts +5 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.js +12 -0
- package/dest/cmds/aztec_node/get_logs.d.ts +6 -0
- package/dest/cmds/aztec_node/get_logs.d.ts.map +1 -0
- package/dest/cmds/{pxe → aztec_node}/get_logs.js +4 -4
- package/dest/cmds/aztec_node/get_node_info.d.ts +3 -0
- package/dest/cmds/aztec_node/get_node_info.d.ts.map +1 -0
- package/dest/cmds/{pxe → aztec_node}/get_node_info.js +3 -8
- package/dest/cmds/aztec_node/index.d.ts.map +1 -0
- package/dest/cmds/aztec_node/index.js +28 -0
- package/dest/cmds/infrastructure/index.d.ts +2 -2
- package/dest/cmds/infrastructure/index.d.ts.map +1 -1
- package/dest/cmds/infrastructure/index.js +7 -8
- package/dest/cmds/infrastructure/sequencers.d.ts +2 -3
- package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
- package/dest/cmds/infrastructure/sequencers.js +4 -3
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts +1 -1
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts.map +1 -1
- package/dest/cmds/infrastructure/setup_l2_contract.js +10 -25
- package/dest/cmds/l1/advance_epoch.d.ts +1 -1
- package/dest/cmds/l1/advance_epoch.d.ts.map +1 -1
- package/dest/cmds/l1/advance_epoch.js +6 -5
- package/dest/cmds/l1/assume_proven_through.d.ts +1 -1
- package/dest/cmds/l1/assume_proven_through.d.ts.map +1 -1
- package/dest/cmds/l1/assume_proven_through.js +7 -6
- package/dest/cmds/l1/bridge_erc20.d.ts +1 -1
- package/dest/cmds/l1/bridge_erc20.d.ts.map +1 -1
- package/dest/cmds/l1/bridge_erc20.js +1 -1
- package/dest/cmds/l1/deploy_l1_contracts.d.ts +1 -1
- package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +1 -1
- package/dest/cmds/l1/deploy_l1_contracts.js +3 -3
- package/dest/cmds/l1/deploy_new_rollup.d.ts +1 -1
- package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -1
- package/dest/cmds/l1/deploy_new_rollup.js +4 -4
- package/dest/cmds/l1/get_l1_addresses.d.ts +1 -1
- package/dest/cmds/l1/get_l1_addresses.d.ts.map +1 -1
- package/dest/cmds/l1/index.d.ts.map +1 -1
- package/dest/cmds/l1/index.js +7 -7
- package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
- package/dest/cmds/l1/update_l1_validators.js +4 -3
- package/dest/cmds/misc/generate_secret_and_hash.js +1 -1
- package/dest/cmds/misc/generate_secret_key.d.ts +1 -1
- package/dest/cmds/misc/generate_secret_key.d.ts.map +1 -1
- package/dest/cmds/misc/generate_secret_key.js +1 -1
- package/dest/config/cached_fetch.d.ts +1 -1
- package/dest/config/cached_fetch.d.ts.map +1 -1
- package/dest/config/cached_fetch.js +1 -1
- package/dest/config/chain_l2_config.d.ts +7 -6
- package/dest/config/chain_l2_config.d.ts.map +1 -1
- package/dest/config/chain_l2_config.js +103 -40
- package/dest/config/enrich_env.js +1 -1
- package/dest/utils/aztec.d.ts +2 -8
- package/dest/utils/aztec.d.ts.map +1 -1
- package/dest/utils/aztec.js +6 -31
- package/dest/utils/commands.d.ts +6 -7
- package/dest/utils/commands.d.ts.map +1 -1
- package/dest/utils/commands.js +5 -6
- package/dest/utils/inspect.d.ts +3 -10
- package/dest/utils/inspect.d.ts.map +1 -1
- package/dest/utils/inspect.js +13 -95
- package/dest/utils/setup_contracts.d.ts +1 -3
- package/dest/utils/setup_contracts.d.ts.map +1 -1
- package/dest/utils/setup_contracts.js +2 -22
- package/package.json +26 -25
- package/src/cmds/aztec_node/block_number.ts +9 -0
- package/src/cmds/aztec_node/get_block.ts +10 -0
- package/src/cmds/aztec_node/get_current_base_fee.ts +9 -0
- package/src/cmds/aztec_node/get_l1_to_l2_message_witness.ts +27 -0
- package/src/cmds/{pxe → aztec_node}/get_logs.ts +8 -7
- package/src/cmds/{pxe → aztec_node}/get_node_info.ts +5 -16
- package/src/cmds/aztec_node/index.ts +87 -0
- package/src/cmds/infrastructure/index.ts +7 -17
- package/src/cmds/infrastructure/sequencers.ts +6 -6
- package/src/cmds/infrastructure/setup_l2_contract.ts +13 -30
- package/src/cmds/l1/advance_epoch.ts +6 -5
- package/src/cmds/l1/assume_proven_through.ts +7 -6
- package/src/cmds/l1/bridge_erc20.ts +3 -1
- package/src/cmds/l1/deploy_l1_contracts.ts +4 -3
- package/src/cmds/l1/deploy_new_rollup.ts +4 -2
- package/src/cmds/l1/get_l1_addresses.ts +1 -1
- package/src/cmds/l1/index.ts +7 -5
- package/src/cmds/l1/update_l1_validators.ts +4 -3
- package/src/cmds/misc/generate_secret_and_hash.ts +1 -1
- package/src/cmds/misc/generate_secret_key.ts +1 -1
- package/src/config/cached_fetch.ts +1 -1
- package/src/config/chain_l2_config.ts +133 -47
- package/src/config/enrich_env.ts +1 -1
- package/src/utils/aztec.ts +6 -40
- package/src/utils/commands.ts +8 -10
- package/src/utils/inspect.ts +18 -111
- package/src/utils/setup_contracts.ts +4 -43
- package/dest/cmds/pxe/add_contract.d.ts +0 -5
- package/dest/cmds/pxe/add_contract.d.ts.map +0 -1
- package/dest/cmds/pxe/add_contract.js +0 -29
- package/dest/cmds/pxe/block_number.d.ts +0 -3
- package/dest/cmds/pxe/block_number.d.ts.map +0 -1
- package/dest/cmds/pxe/block_number.js +0 -10
- package/dest/cmds/pxe/get_account.d.ts +0 -4
- package/dest/cmds/pxe/get_account.d.ts.map +0 -1
- package/dest/cmds/pxe/get_account.js +0 -10
- package/dest/cmds/pxe/get_accounts.d.ts +0 -3
- package/dest/cmds/pxe/get_accounts.d.ts.map +0 -1
- package/dest/cmds/pxe/get_accounts.js +0 -25
- package/dest/cmds/pxe/get_block.d.ts +0 -3
- package/dest/cmds/pxe/get_block.d.ts.map +0 -1
- package/dest/cmds/pxe/get_block.js +0 -9
- package/dest/cmds/pxe/get_contract_data.d.ts +0 -4
- package/dest/cmds/pxe/get_contract_data.d.ts.map +0 -1
- package/dest/cmds/pxe/get_contract_data.js +0 -31
- package/dest/cmds/pxe/get_current_base_fee.d.ts +0 -3
- package/dest/cmds/pxe/get_current_base_fee.d.ts.map +0 -1
- package/dest/cmds/pxe/get_current_base_fee.js +0 -7
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts +0 -4
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts.map +0 -1
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.js +0 -11
- package/dest/cmds/pxe/get_logs.d.ts +0 -4
- package/dest/cmds/pxe/get_logs.d.ts.map +0 -1
- package/dest/cmds/pxe/get_node_info.d.ts +0 -3
- package/dest/cmds/pxe/get_node_info.d.ts.map +0 -1
- package/dest/cmds/pxe/get_pxe_info.d.ts +0 -3
- package/dest/cmds/pxe/get_pxe_info.d.ts.map +0 -1
- package/dest/cmds/pxe/get_pxe_info.js +0 -11
- package/dest/cmds/pxe/index.d.ts.map +0 -1
- package/dest/cmds/pxe/index.js +0 -55
- package/src/cmds/pxe/add_contract.ts +0 -41
- package/src/cmds/pxe/block_number.ts +0 -9
- package/src/cmds/pxe/get_account.ts +0 -16
- package/src/cmds/pxe/get_accounts.ts +0 -35
- package/src/cmds/pxe/get_block.ts +0 -10
- package/src/cmds/pxe/get_contract_data.ts +0 -51
- package/src/cmds/pxe/get_current_base_fee.ts +0 -9
- package/src/cmds/pxe/get_l1_to_l2_message_witness.ts +0 -25
- package/src/cmds/pxe/get_pxe_info.ts +0 -13
- package/src/cmds/pxe/index.ts +0 -170
- /package/dest/cmds/{pxe → aztec_node}/index.d.ts +0 -0
package/src/utils/aztec.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { EthAddress, type PXE } from '@aztec/aztec.js';
|
|
2
1
|
import {
|
|
3
2
|
type ContractArtifact,
|
|
4
3
|
type FunctionAbi,
|
|
@@ -6,6 +5,7 @@ import {
|
|
|
6
5
|
getAllFunctionAbis,
|
|
7
6
|
loadContractArtifact,
|
|
8
7
|
} from '@aztec/aztec.js/abi';
|
|
8
|
+
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
9
9
|
import {
|
|
10
10
|
type DeployL1ContractsReturnType,
|
|
11
11
|
type L1ContractsConfig,
|
|
@@ -16,11 +16,10 @@ import { SecretValue } from '@aztec/foundation/config';
|
|
|
16
16
|
import { Fr } from '@aztec/foundation/fields';
|
|
17
17
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
18
18
|
import type { NoirPackageConfig } from '@aztec/foundation/noir';
|
|
19
|
-
import {
|
|
19
|
+
import { protocolContractsHash } from '@aztec/protocol-contracts';
|
|
20
20
|
|
|
21
21
|
import TOML from '@iarna/toml';
|
|
22
22
|
import { readFile } from 'fs/promises';
|
|
23
|
-
import { gtr, ltr, satisfies, valid } from 'semver';
|
|
24
23
|
|
|
25
24
|
import { encodeArgs } from './encoding.js';
|
|
26
25
|
|
|
@@ -79,7 +78,7 @@ export async function deployAztecContracts(
|
|
|
79
78
|
debugLogger,
|
|
80
79
|
{
|
|
81
80
|
vkTreeRoot: getVKTreeRoot(),
|
|
82
|
-
|
|
81
|
+
protocolContractsHash,
|
|
83
82
|
genesisArchiveRoot,
|
|
84
83
|
salt,
|
|
85
84
|
initialValidators,
|
|
@@ -109,6 +108,7 @@ export async function deployNewRollupContracts(
|
|
|
109
108
|
feeJuicePortalInitialBalance: bigint,
|
|
110
109
|
config: L1ContractsConfig,
|
|
111
110
|
realVerifier: boolean,
|
|
111
|
+
createVerificationJson: string | false,
|
|
112
112
|
logger: Logger,
|
|
113
113
|
): Promise<{ rollup: RollupContract; slashFactoryAddress: EthAddress }> {
|
|
114
114
|
const { createEthereumChain, deployRollupForUpgrade, createExtendedL1Client } = await import('@aztec/ethereum');
|
|
@@ -142,7 +142,7 @@ export async function deployNewRollupContracts(
|
|
|
142
142
|
{
|
|
143
143
|
salt,
|
|
144
144
|
vkTreeRoot: getVKTreeRoot(),
|
|
145
|
-
|
|
145
|
+
protocolContractsHash,
|
|
146
146
|
genesisArchiveRoot,
|
|
147
147
|
initialValidators,
|
|
148
148
|
feeJuicePortalInitialBalance,
|
|
@@ -152,6 +152,7 @@ export async function deployNewRollupContracts(
|
|
|
152
152
|
registryAddress,
|
|
153
153
|
logger,
|
|
154
154
|
config,
|
|
155
|
+
createVerificationJson,
|
|
155
156
|
);
|
|
156
157
|
|
|
157
158
|
return { rollup, slashFactoryAddress };
|
|
@@ -260,38 +261,3 @@ export function prettyPrintNargoToml(config: NoirPackageConfig): string {
|
|
|
260
261
|
|
|
261
262
|
return partialToml + '\n[dependencies]\n' + dependenciesToml.join('\n') + '\n';
|
|
262
263
|
}
|
|
263
|
-
|
|
264
|
-
/** Mismatch between server and client versions. */
|
|
265
|
-
class VersionMismatchError extends Error {}
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Checks that Private eXecution Environment (PXE) version matches the expected one by this CLI. Throws if not.
|
|
269
|
-
* @param pxe - PXE client.
|
|
270
|
-
* @param expectedVersionRange - Expected version by CLI.
|
|
271
|
-
*/
|
|
272
|
-
export async function checkServerVersion(pxe: PXE, expectedVersionRange: string) {
|
|
273
|
-
const serverName = 'Aztec Node';
|
|
274
|
-
const { nodeVersion } = await pxe.getNodeInfo();
|
|
275
|
-
if (!nodeVersion) {
|
|
276
|
-
throw new VersionMismatchError(`Couldn't determine ${serverName} version. You may run into issues.`);
|
|
277
|
-
}
|
|
278
|
-
if (!nodeVersion || !valid(nodeVersion)) {
|
|
279
|
-
throw new VersionMismatchError(
|
|
280
|
-
`Missing or invalid version identifier for ${serverName} (${nodeVersion ?? 'empty'}).`,
|
|
281
|
-
);
|
|
282
|
-
} else if (!satisfies(nodeVersion, expectedVersionRange)) {
|
|
283
|
-
if (gtr(nodeVersion, expectedVersionRange)) {
|
|
284
|
-
throw new VersionMismatchError(
|
|
285
|
-
`${serverName} is running version ${nodeVersion} which is newer than the expected by this CLI (${expectedVersionRange}). Consider upgrading your CLI to a newer version.`,
|
|
286
|
-
);
|
|
287
|
-
} else if (ltr(nodeVersion, expectedVersionRange)) {
|
|
288
|
-
throw new VersionMismatchError(
|
|
289
|
-
`${serverName} is running version ${nodeVersion} which is older than the expected by this CLI (${expectedVersionRange}). Consider upgrading your ${serverName} to a newer version.`,
|
|
290
|
-
);
|
|
291
|
-
} else {
|
|
292
|
-
throw new VersionMismatchError(
|
|
293
|
-
`${serverName} is running version ${nodeVersion} which does not match the expected by this CLI (${expectedVersionRange}).`,
|
|
294
|
-
);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
}
|
package/src/utils/commands.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { FunctionSelector } from '@aztec/aztec.js/abi';
|
|
2
|
-
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
3
|
-
import { EthAddress } from '@aztec/aztec.js/eth_address';
|
|
2
|
+
import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
|
|
4
3
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
5
|
-
import { LogId } from '@aztec/aztec.js/
|
|
6
|
-
import { TxHash } from '@aztec/aztec.js/
|
|
4
|
+
import { LogId } from '@aztec/aztec.js/log';
|
|
5
|
+
import { TxHash } from '@aztec/aztec.js/tx';
|
|
7
6
|
import type { LogFn } from '@aztec/foundation/log';
|
|
8
|
-
import type { PXE } from '@aztec/
|
|
7
|
+
import type { PXE } from '@aztec/pxe/server';
|
|
9
8
|
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
10
9
|
|
|
11
10
|
import { type Command, CommanderError, InvalidArgumentError, Option } from 'commander';
|
|
@@ -29,14 +28,13 @@ export function addOptions(program: Command, options: Option[]) {
|
|
|
29
28
|
return program;
|
|
30
29
|
}
|
|
31
30
|
|
|
32
|
-
export const
|
|
33
|
-
new Option('-
|
|
34
|
-
.env('
|
|
31
|
+
export const makeNodeOption = (mandatory: boolean) =>
|
|
32
|
+
new Option('-n, --node-url <string>', 'URL of the Aztec node')
|
|
33
|
+
.env('AZTEC_NODE_URL')
|
|
35
34
|
.default(`http://${LOCALHOST}:8080`)
|
|
36
|
-
.conflicts('remote-pxe')
|
|
37
35
|
.makeOptionMandatory(mandatory);
|
|
38
36
|
|
|
39
|
-
export const
|
|
37
|
+
export const nodeOption = makeNodeOption(true);
|
|
40
38
|
|
|
41
39
|
export const l1ChainIdOption = new Option('-c, --l1-chain-id <number>', 'Chain ID of the ethereum host')
|
|
42
40
|
.env('L1_CHAIN_ID')
|
package/src/utils/inspect.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import type { AztecAddress, ContractArtifact, Fr } from '@aztec/aztec.js';
|
|
2
1
|
import type { LogFn } from '@aztec/foundation/log';
|
|
3
|
-
import {
|
|
4
|
-
import { siloNullifier } from '@aztec/stdlib/hash';
|
|
5
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
6
|
-
import type { ExtendedNote } from '@aztec/stdlib/note';
|
|
2
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
7
3
|
import type { TxHash } from '@aztec/stdlib/tx';
|
|
8
4
|
|
|
9
|
-
export async function inspectBlock(
|
|
10
|
-
|
|
5
|
+
export async function inspectBlock(
|
|
6
|
+
aztecNode: AztecNode,
|
|
7
|
+
blockNumber: number,
|
|
8
|
+
log: LogFn,
|
|
9
|
+
opts: { showTxs?: boolean } = {},
|
|
10
|
+
) {
|
|
11
|
+
const block = await aztecNode.getBlock(blockNumber);
|
|
11
12
|
if (!block) {
|
|
12
13
|
log(`No block found for block number ${blockNumber}`);
|
|
13
14
|
return;
|
|
@@ -25,9 +26,8 @@ export async function inspectBlock(pxe: PXE, blockNumber: number, log: LogFn, op
|
|
|
25
26
|
log(` Timestamp: ${new Date(Number(block.header.globalVariables.timestamp) * 500)}`);
|
|
26
27
|
if (opts.showTxs) {
|
|
27
28
|
log(``);
|
|
28
|
-
const artifactMap = await getKnownArtifacts(pxe);
|
|
29
29
|
for (const txHash of block.body.txEffects.map(tx => tx.txHash)) {
|
|
30
|
-
await inspectTx(
|
|
30
|
+
await inspectTx(aztecNode, txHash, log, { includeBlockInfo: false });
|
|
31
31
|
}
|
|
32
32
|
} else {
|
|
33
33
|
log(` Transactions: ${block.body.txEffects.length}`);
|
|
@@ -35,12 +35,12 @@ export async function inspectBlock(pxe: PXE, blockNumber: number, log: LogFn, op
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export async function inspectTx(
|
|
38
|
-
|
|
38
|
+
aztecNode: AztecNode,
|
|
39
39
|
txHash: TxHash,
|
|
40
40
|
log: LogFn,
|
|
41
|
-
opts: { includeBlockInfo?: boolean
|
|
41
|
+
opts: { includeBlockInfo?: boolean } = {},
|
|
42
42
|
) {
|
|
43
|
-
const [receipt, effectsInBlock] = await Promise.all([
|
|
43
|
+
const [receipt, effectsInBlock] = await Promise.all([aztecNode.getTxReceipt(txHash), aztecNode.getTxEffect(txHash)]);
|
|
44
44
|
// Base tx data
|
|
45
45
|
log(`Tx ${txHash.toString()}`);
|
|
46
46
|
log(` Status: ${receipt.status} ${effectsInBlock ? `(${effectsInBlock.data.revertCode.getDescription()})` : ''}`);
|
|
@@ -53,7 +53,6 @@ export async function inspectTx(
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
const effects = effectsInBlock.data;
|
|
56
|
-
const artifactMap = opts?.artifactMap ?? (await getKnownArtifacts(pxe));
|
|
57
56
|
|
|
58
57
|
if (opts.includeBlockInfo) {
|
|
59
58
|
log(` Block: ${receipt.blockNumber} (${receipt.blockHash?.toString()})`);
|
|
@@ -90,38 +89,12 @@ export async function inspectTx(
|
|
|
90
89
|
}
|
|
91
90
|
}
|
|
92
91
|
|
|
93
|
-
//
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const deployed = deployNullifiers[nullifier.toString()];
|
|
100
|
-
const note = deployed
|
|
101
|
-
? (await pxe.getNotes({ siloedNullifier: nullifier, contractAddress: deployed }))[0]
|
|
102
|
-
: undefined;
|
|
103
|
-
const initialized = initNullifiers[nullifier.toString()];
|
|
104
|
-
const registered = classNullifiers[nullifier.toString()];
|
|
105
|
-
if (nullifier.toBuffer().equals(txHash.toBuffer())) {
|
|
106
|
-
log(` Transaction hash nullifier ${nullifier.toShortString()}`);
|
|
107
|
-
} else if (note) {
|
|
108
|
-
inspectNote(note, artifactMap, log, `Nullifier ${nullifier.toShortString()} for note`);
|
|
109
|
-
} else if (deployed) {
|
|
110
|
-
log(
|
|
111
|
-
` Contract ${toFriendlyAddress(deployed, artifactMap)} deployed via nullifier ${nullifier.toShortString()}`,
|
|
112
|
-
);
|
|
113
|
-
} else if (initialized) {
|
|
114
|
-
log(
|
|
115
|
-
` Contract ${toFriendlyAddress(
|
|
116
|
-
initialized,
|
|
117
|
-
artifactMap,
|
|
118
|
-
)} initialized via nullifier ${nullifier.toShortString()}`,
|
|
119
|
-
);
|
|
120
|
-
} else if (registered) {
|
|
121
|
-
log(` Class ${registered} registered via nullifier ${nullifier.toShortString()}`);
|
|
122
|
-
} else {
|
|
123
|
-
log(` Unknown nullifier ${nullifier.toString()}`);
|
|
124
|
-
}
|
|
92
|
+
// Created nullifiers
|
|
93
|
+
const nullifiers = effects.nullifiers;
|
|
94
|
+
if (nullifiers.length > 0) {
|
|
95
|
+
log(' Created nullifiers:');
|
|
96
|
+
for (const nullifier of nullifiers) {
|
|
97
|
+
log(` Nullifier: ${nullifier.toShortString()}`);
|
|
125
98
|
}
|
|
126
99
|
}
|
|
127
100
|
|
|
@@ -133,69 +106,3 @@ export async function inspectTx(
|
|
|
133
106
|
}
|
|
134
107
|
}
|
|
135
108
|
}
|
|
136
|
-
|
|
137
|
-
function inspectNote(note: ExtendedNote, artifactMap: ArtifactMap, log: LogFn, text = 'Note') {
|
|
138
|
-
const artifact = artifactMap[note.contractAddress.toString()];
|
|
139
|
-
const contract = artifact?.name ?? note.contractAddress.toString();
|
|
140
|
-
log(` ${text} at ${contract}`);
|
|
141
|
-
log(` Recipient: ${toFriendlyAddress(note.recipient, artifactMap)}`);
|
|
142
|
-
for (const field of note.note.items) {
|
|
143
|
-
log(` ${field.toString()}`);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
function toFriendlyAddress(address: AztecAddress, artifactMap: ArtifactMap) {
|
|
148
|
-
const artifact = artifactMap[address.toString()];
|
|
149
|
-
if (!artifact) {
|
|
150
|
-
return address.toString();
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
return `${artifact.name}<${address.toString()}>`;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
async function getKnownNullifiers(pxe: PXE, artifactMap: ArtifactMap) {
|
|
157
|
-
const knownContracts = await pxe.getContracts();
|
|
158
|
-
const deployerAddress = ProtocolContractAddress.ContractInstanceRegistry;
|
|
159
|
-
const classRegistryAddress = ProtocolContractAddress.ContractClassRegistry;
|
|
160
|
-
const initNullifiers: Record<string, AztecAddress> = {};
|
|
161
|
-
const deployNullifiers: Record<string, AztecAddress> = {};
|
|
162
|
-
const classNullifiers: Record<string, string> = {};
|
|
163
|
-
for (const contract of knownContracts) {
|
|
164
|
-
initNullifiers[(await siloNullifier(contract, contract.toField())).toString()] = contract;
|
|
165
|
-
deployNullifiers[(await siloNullifier(deployerAddress, contract.toField())).toString()] = contract;
|
|
166
|
-
}
|
|
167
|
-
for (const artifact of Object.values(artifactMap)) {
|
|
168
|
-
classNullifiers[(await siloNullifier(classRegistryAddress, artifact.classId)).toString()] =
|
|
169
|
-
`${artifact.name}Class<${artifact.classId}>`;
|
|
170
|
-
}
|
|
171
|
-
return { initNullifiers, deployNullifiers, classNullifiers };
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
type ArtifactMap = Record<string, ContractArtifactWithClassId>;
|
|
175
|
-
type ContractArtifactWithClassId = ContractArtifact & { classId: Fr };
|
|
176
|
-
async function getKnownArtifacts(pxe: PXE): Promise<ArtifactMap> {
|
|
177
|
-
const knownContractAddresses = await pxe.getContracts();
|
|
178
|
-
const knownContracts = (
|
|
179
|
-
await Promise.all(knownContractAddresses.map(contractAddress => pxe.getContractMetadata(contractAddress)))
|
|
180
|
-
).map(contractMetadata => contractMetadata.contractInstance);
|
|
181
|
-
const classIds = [...new Set(knownContracts.map(contract => contract?.currentContractClassId))];
|
|
182
|
-
const knownArtifacts = (
|
|
183
|
-
await Promise.all(classIds.map(classId => (classId ? pxe.getContractClassMetadata(classId) : undefined)))
|
|
184
|
-
).map(contractClassMetadata =>
|
|
185
|
-
contractClassMetadata
|
|
186
|
-
? { ...contractClassMetadata.artifact, classId: contractClassMetadata.contractClass?.id }
|
|
187
|
-
: undefined,
|
|
188
|
-
);
|
|
189
|
-
const map: Record<string, ContractArtifactWithClassId> = {};
|
|
190
|
-
for (const instance of knownContracts) {
|
|
191
|
-
if (instance) {
|
|
192
|
-
const artifact = knownArtifacts.find(a =>
|
|
193
|
-
a?.classId?.equals(instance.currentContractClassId),
|
|
194
|
-
) as ContractArtifactWithClassId;
|
|
195
|
-
if (artifact) {
|
|
196
|
-
map[instance.address.toString()] = artifact;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
return map;
|
|
201
|
-
}
|
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Fr,
|
|
5
|
-
type PXE,
|
|
6
|
-
SignerlessWallet,
|
|
7
|
-
SponsoredFeePaymentMethod,
|
|
8
|
-
type WaitForProvenOpts,
|
|
9
|
-
getContractInstanceFromInstantiationParams,
|
|
10
|
-
waitForProven,
|
|
11
|
-
} from '@aztec/aztec.js';
|
|
1
|
+
import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import { getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
|
|
3
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
12
4
|
import { SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
13
|
-
import { DefaultMultiCallEntrypoint } from '@aztec/entrypoints/multicall';
|
|
14
|
-
import type { LogFn } from '@aztec/foundation/log';
|
|
15
5
|
|
|
16
6
|
async function getSponsoredFPCContract() {
|
|
17
7
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -20,39 +10,10 @@ async function getSponsoredFPCContract() {
|
|
|
20
10
|
return SponsoredFPCContract;
|
|
21
11
|
}
|
|
22
12
|
|
|
23
|
-
export async function getSponsoredFPCAddress() {
|
|
13
|
+
export async function getSponsoredFPCAddress(): Promise<AztecAddress> {
|
|
24
14
|
const SponsoredFPCContract = await getSponsoredFPCContract();
|
|
25
15
|
const sponsoredFPCInstance = await getContractInstanceFromInstantiationParams(SponsoredFPCContract.artifact, {
|
|
26
16
|
salt: new Fr(SPONSORED_FPC_SALT),
|
|
27
17
|
});
|
|
28
18
|
return sponsoredFPCInstance.address;
|
|
29
19
|
}
|
|
30
|
-
|
|
31
|
-
export async function setupSponsoredFPC(
|
|
32
|
-
pxe: PXE,
|
|
33
|
-
log: LogFn,
|
|
34
|
-
waitOpts = DefaultWaitOpts,
|
|
35
|
-
waitForProvenOptions?: WaitForProvenOpts,
|
|
36
|
-
) {
|
|
37
|
-
const SponsoredFPCContract = await getSponsoredFPCContract();
|
|
38
|
-
const address = await getSponsoredFPCAddress();
|
|
39
|
-
const paymentMethod = new SponsoredFeePaymentMethod(address);
|
|
40
|
-
const { l1ChainId: chainId, rollupVersion } = await pxe.getNodeInfo();
|
|
41
|
-
|
|
42
|
-
const deployer = new SignerlessWallet(pxe, new DefaultMultiCallEntrypoint(chainId, rollupVersion));
|
|
43
|
-
|
|
44
|
-
const deployTx = SponsoredFPCContract.deploy(deployer).send({
|
|
45
|
-
from: AztecAddress.ZERO,
|
|
46
|
-
contractAddressSalt: new Fr(SPONSORED_FPC_SALT),
|
|
47
|
-
universalDeploy: true,
|
|
48
|
-
fee: { paymentMethod },
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
const deployed = await deployTx.deployed(waitOpts);
|
|
52
|
-
|
|
53
|
-
if (waitForProvenOptions !== undefined) {
|
|
54
|
-
await waitForProven(pxe, await deployTx.getReceipt(), waitForProvenOptions);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
log(`SponsoredFPC: ${deployed.address}`);
|
|
58
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { AztecAddress, type Fr } from '@aztec/aztec.js';
|
|
2
|
-
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
3
|
-
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
4
|
-
export declare function addContract(rpcUrl: string, contractArtifactPath: string, address: AztecAddress, initializationHash: Fr, salt: Fr, publicKeys: PublicKeys, deployer: AztecAddress | undefined, debugLogger: Logger, log: LogFn): Promise<void>;
|
|
5
|
-
//# sourceMappingURL=add_contract.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add_contract.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/add_contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoC,KAAK,EAAE,EAAgC,MAAM,iBAAiB,CAAC;AAExH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIhD,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,oBAAoB,EAAE,MAAM,EAC5B,OAAO,EAAE,YAAY,EACrB,kBAAkB,EAAE,EAAE,EACtB,IAAI,EAAE,EAAE,EACR,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,YAAY,GAAG,SAAS,EAClC,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK,iBAuBX"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { AztecAddress, getContractClassFromArtifact } from '@aztec/aztec.js';
|
|
2
|
-
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
3
|
-
import { computeContractAddressFromInstance } from '@aztec/stdlib/contract';
|
|
4
|
-
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
5
|
-
import { getContractArtifact } from '../../utils/aztec.js';
|
|
6
|
-
export async function addContract(rpcUrl, contractArtifactPath, address, initializationHash, salt, publicKeys, deployer, debugLogger, log) {
|
|
7
|
-
const artifact = await getContractArtifact(contractArtifactPath, log);
|
|
8
|
-
const contractClass = await getContractClassFromArtifact(artifact);
|
|
9
|
-
const instance = {
|
|
10
|
-
version: 1,
|
|
11
|
-
salt,
|
|
12
|
-
initializationHash,
|
|
13
|
-
currentContractClassId: contractClass.id,
|
|
14
|
-
originalContractClassId: contractClass.id,
|
|
15
|
-
publicKeys: publicKeys ?? PublicKeys.default(),
|
|
16
|
-
address,
|
|
17
|
-
deployer: deployer ?? AztecAddress.ZERO
|
|
18
|
-
};
|
|
19
|
-
const computed = await computeContractAddressFromInstance(instance);
|
|
20
|
-
if (!computed.equals(address)) {
|
|
21
|
-
throw new Error(`Contract address ${address.toString()} does not match computed address ${computed.toString()}`);
|
|
22
|
-
}
|
|
23
|
-
const client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
24
|
-
await client.registerContract({
|
|
25
|
-
artifact,
|
|
26
|
-
instance
|
|
27
|
-
});
|
|
28
|
-
log(`\nContract added to PXE at ${address.toString()} with class ${instance.currentContractClassId.toString()}\n`);
|
|
29
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"block_number.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/block_number.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAKhF"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
2
|
-
export async function blockNumber(rpcUrl, debugLogger, log) {
|
|
3
|
-
const client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
4
|
-
const [latestNum, provenNum] = await Promise.all([
|
|
5
|
-
client.getBlockNumber(),
|
|
6
|
-
client.getProvenBlockNumber()
|
|
7
|
-
]);
|
|
8
|
-
log(`Latest block: ${latestNum}`);
|
|
9
|
-
log(`Proven block: ${provenNum}`);
|
|
10
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { AztecAddress } from '@aztec/aztec.js';
|
|
2
|
-
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
3
|
-
export declare function getAccount(aztecAddress: AztecAddress, rpcUrl: string, debugLogger: Logger, log: LogFn): Promise<void>;
|
|
4
|
-
//# sourceMappingURL=get_account.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get_account.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,UAAU,CAAC,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAW3G"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
2
|
-
export async function getAccount(aztecAddress, rpcUrl, debugLogger, log) {
|
|
3
|
-
const client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
4
|
-
const account = (await client.getRegisteredAccounts()).find((completeAddress)=>completeAddress.address.equals(aztecAddress));
|
|
5
|
-
if (!account) {
|
|
6
|
-
log(`Unknown account ${aztecAddress.toString()}`);
|
|
7
|
-
} else {
|
|
8
|
-
log(account.toReadableString());
|
|
9
|
-
}
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get_accounts.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_accounts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK,EACV,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,iBA0B/B"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
2
|
-
export async function getAccounts(rpcUrl, json, debugLogger, log, logJson) {
|
|
3
|
-
const client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
4
|
-
const accounts = await client.getRegisteredAccounts();
|
|
5
|
-
if (!accounts.length) {
|
|
6
|
-
if (json) {
|
|
7
|
-
logJson([]);
|
|
8
|
-
} else {
|
|
9
|
-
log('No accounts found.');
|
|
10
|
-
}
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
if (json) {
|
|
14
|
-
logJson(accounts.map((a)=>({
|
|
15
|
-
address: a.address.toString(),
|
|
16
|
-
publicKeys: a.publicKeys.toString(),
|
|
17
|
-
partialAddress: a.partialAddress.toString()
|
|
18
|
-
})));
|
|
19
|
-
} else {
|
|
20
|
-
log(`Accounts found: \n`);
|
|
21
|
-
for (const account of accounts){
|
|
22
|
-
log(account.toReadableString());
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get_block.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_block.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI3D,wBAAsB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAInH"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
2
|
-
import { inspectBlock } from '../../utils/inspect.js';
|
|
3
|
-
export async function getBlock(rpcUrl, maybeBlockNumber, debugLogger, log) {
|
|
4
|
-
const client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
5
|
-
const blockNumber = maybeBlockNumber ?? await client.getBlockNumber();
|
|
6
|
-
await inspectBlock(client, blockNumber, log, {
|
|
7
|
-
showTxs: true
|
|
8
|
-
});
|
|
9
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { AztecAddress } from '@aztec/aztec.js';
|
|
2
|
-
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
3
|
-
export declare function getContractData(rpcUrl: string, contractAddress: AztecAddress, includeBytecode: boolean, debugLogger: Logger, log: LogFn): Promise<void>;
|
|
4
|
-
//# sourceMappingURL=get_contract_data.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get_contract_data.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_contract_data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,YAAY,EAC7B,eAAe,EAAE,OAAO,EACxB,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK,iBAyCX"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
2
|
-
export async function getContractData(rpcUrl, contractAddress, includeBytecode, debugLogger, log) {
|
|
3
|
-
const client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
4
|
-
const { contractInstance: instance, isContractInitialized: isInitialized, isContractPublished: isPubliclyDeployed } = await client.getContractMetadata(contractAddress);
|
|
5
|
-
const contractClass = includeBytecode && instance && (await client.getContractClassMetadata(instance?.currentContractClassId)).contractClass;
|
|
6
|
-
const isPrivatelyDeployed = !!instance;
|
|
7
|
-
const initStr = isInitialized ? 'initialized' : 'not initialized';
|
|
8
|
-
const addrStr = contractAddress.toString();
|
|
9
|
-
if (isPubliclyDeployed && isPrivatelyDeployed) {
|
|
10
|
-
log(`Contract is ${initStr} and publicly deployed at ${addrStr}`);
|
|
11
|
-
} else if (isPrivatelyDeployed) {
|
|
12
|
-
log(`Contract is ${initStr} and registered in the local pxe at ${addrStr} but not publicly deployed`);
|
|
13
|
-
} else if (isPubliclyDeployed) {
|
|
14
|
-
log(`Contract is ${initStr} and publicly deployed at ${addrStr} but not registered in the local pxe`);
|
|
15
|
-
} else if (isInitialized) {
|
|
16
|
-
log(`Contract is initialized but not publicly deployed nor registered in the local pxe at ${addrStr}`);
|
|
17
|
-
} else {
|
|
18
|
-
log(`No contract found at ${addrStr}`);
|
|
19
|
-
}
|
|
20
|
-
if (instance) {
|
|
21
|
-
log(``);
|
|
22
|
-
Object.entries(instance).forEach(([key, value])=>{
|
|
23
|
-
const capitalized = key.charAt(0).toUpperCase() + key.slice(1);
|
|
24
|
-
log(`${capitalized}: ${value.toString()}`);
|
|
25
|
-
});
|
|
26
|
-
if (contractClass) {
|
|
27
|
-
log(`\nBytecode: ${contractClass.packedBytecode.toString('base64')}`);
|
|
28
|
-
}
|
|
29
|
-
log('');
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get_current_base_fee.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_current_base_fee.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAItF"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
2
|
-
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
3
|
-
export async function getCurrentBaseFee(rpcUrl, debugLogger, log) {
|
|
4
|
-
const client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
5
|
-
const fees = await client.getCurrentBaseFees();
|
|
6
|
-
log(`Current fees: ${jsonStringify(fees)}`);
|
|
7
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type AztecAddress, type Fr } from '@aztec/aztec.js';
|
|
2
|
-
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
3
|
-
export declare function getL1ToL2MessageWitness(rpcUrl: string, contractAddress: AztecAddress, messageHash: Fr, secret: Fr, debugLogger: Logger, log: LogFn): Promise<void>;
|
|
4
|
-
//# sourceMappingURL=get_l1_to_l2_message_witness.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get_l1_to_l2_message_witness.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_l1_to_l2_message_witness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,EAAE,EAA0B,MAAM,iBAAiB,CAAC;AACrF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,YAAY,EAC7B,WAAW,EAAE,EAAE,EACf,MAAM,EAAE,EAAE,EACV,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK,iBAeX"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
2
|
-
export async function getL1ToL2MessageWitness(rpcUrl, contractAddress, messageHash, secret, debugLogger, log) {
|
|
3
|
-
const client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
4
|
-
const messageWitness = await client.getL1ToL2MembershipWitness(contractAddress, messageHash, secret);
|
|
5
|
-
log(messageWitness === undefined ? `
|
|
6
|
-
L1 to L2 Message not found.
|
|
7
|
-
` : `
|
|
8
|
-
L1 to L2 message index: ${messageWitness[0]}
|
|
9
|
-
L1 to L2 message sibling path: ${messageWitness[1]}
|
|
10
|
-
`);
|
|
11
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { AztecAddress, LogId, TxHash } from '@aztec/aztec.js';
|
|
2
|
-
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
3
|
-
export declare function getLogs(txHash: TxHash, fromBlock: number, toBlock: number, afterLog: LogId, contractAddress: AztecAddress, rpcUrl: string, follow: boolean, debugLogger: Logger, log: LogFn): Promise<void>;
|
|
4
|
-
//# sourceMappingURL=get_logs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get_logs.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_logs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAa,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAG3D,wBAAsB,OAAO,CAC3B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,KAAK,EACf,eAAe,EAAE,YAAY,EAC7B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,OAAO,EACf,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK,iBAmDX"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
2
|
-
export declare function getNodeInfo(rpcUrl: string, pxeRequest: boolean, debugLogger: Logger, json: boolean, log: LogFn, logJson: (output: any) => void): Promise<void>;
|
|
3
|
-
//# sourceMappingURL=get_node_info.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get_node_info.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_node_info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,OAAO,EACnB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,KAAK,EACV,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,iBAgE/B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get_pxe_info.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_pxe_info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAS/E"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
2
|
-
export async function getPXEInfo(rpcUrl, debugLogger, log) {
|
|
3
|
-
const client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
4
|
-
const info = await client.getPXEInfo();
|
|
5
|
-
log(`PXE Version: ${info.pxeVersion}`);
|
|
6
|
-
log(`Protocol Contract Addresses:`);
|
|
7
|
-
log(` Class Registry: ${info.protocolContractAddresses.classRegistry.toString()}`);
|
|
8
|
-
log(` Fee Juice: ${info.protocolContractAddresses.feeJuice.toString()}`);
|
|
9
|
-
log(` Instance Deployer: ${info.protocolContractAddresses.instanceRegistry.toString()}`);
|
|
10
|
-
log(` Multi Call Entrypoint: ${info.protocolContractAddresses.multiCallEntrypoint.toString()}`);
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiBzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAqJ/E"}
|