@aztec/aztec 4.0.0-nightly.20250907 → 4.0.0-nightly.20260107

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.
Files changed (127) hide show
  1. package/README.md +1 -1
  2. package/dest/bin/index.d.ts +1 -1
  3. package/dest/bin/index.js +11 -10
  4. package/dest/cli/aztec_start_action.d.ts +1 -1
  5. package/dest/cli/aztec_start_action.d.ts.map +1 -1
  6. package/dest/cli/aztec_start_action.js +9 -25
  7. package/dest/cli/aztec_start_options.d.ts +1 -1
  8. package/dest/cli/aztec_start_options.d.ts.map +1 -1
  9. package/dest/cli/aztec_start_options.js +22 -39
  10. package/dest/cli/cli.d.ts +1 -1
  11. package/dest/cli/cli.d.ts.map +1 -1
  12. package/dest/cli/cli.js +46 -1
  13. package/dest/cli/cmds/start_archiver.d.ts +1 -1
  14. package/dest/cli/cmds/start_archiver.d.ts.map +1 -1
  15. package/dest/cli/cmds/start_archiver.js +9 -9
  16. package/dest/cli/cmds/start_bot.d.ts +4 -7
  17. package/dest/cli/cmds/start_bot.d.ts.map +1 -1
  18. package/dest/cli/cmds/start_bot.js +25 -14
  19. package/dest/cli/cmds/start_node.d.ts +1 -1
  20. package/dest/cli/cmds/start_node.d.ts.map +1 -1
  21. package/dest/cli/cmds/start_node.js +13 -21
  22. package/dest/cli/cmds/start_p2p_bootstrap.d.ts +1 -1
  23. package/dest/cli/cmds/start_p2p_bootstrap.js +1 -1
  24. package/dest/cli/cmds/start_prover_agent.d.ts +1 -1
  25. package/dest/cli/cmds/start_prover_agent.d.ts.map +1 -1
  26. package/dest/cli/cmds/start_prover_agent.js +11 -2
  27. package/dest/cli/cmds/start_prover_broker.d.ts +1 -1
  28. package/dest/cli/cmds/start_prover_broker.d.ts.map +1 -1
  29. package/dest/cli/cmds/start_prover_broker.js +8 -3
  30. package/dest/cli/cmds/start_prover_node.d.ts +1 -1
  31. package/dest/cli/cmds/start_prover_node.d.ts.map +1 -1
  32. package/dest/cli/cmds/start_prover_node.js +16 -7
  33. package/dest/cli/cmds/start_txe.d.ts +1 -1
  34. package/dest/cli/index.d.ts +1 -1
  35. package/dest/cli/preload_crs.d.ts +1 -1
  36. package/dest/cli/release_version.d.ts +1 -1
  37. package/dest/cli/util.d.ts +12 -10
  38. package/dest/cli/util.d.ts.map +1 -1
  39. package/dest/cli/util.js +7 -7
  40. package/dest/cli/versioning.d.ts +1 -1
  41. package/dest/cli/versioning.js +3 -3
  42. package/dest/examples/token.d.ts +1 -1
  43. package/dest/examples/token.js +18 -16
  44. package/dest/examples/util.d.ts +3 -3
  45. package/dest/examples/util.d.ts.map +1 -1
  46. package/dest/examples/util.js +1 -1
  47. package/dest/index.d.ts +2 -2
  48. package/dest/index.d.ts.map +1 -1
  49. package/dest/index.js +1 -1
  50. package/dest/local-network/banana_fpc.d.ts +10 -0
  51. package/dest/local-network/banana_fpc.d.ts.map +1 -0
  52. package/dest/{sandbox → local-network}/banana_fpc.js +15 -19
  53. package/dest/local-network/index.d.ts +4 -0
  54. package/dest/local-network/index.d.ts.map +1 -0
  55. package/dest/local-network/index.js +3 -0
  56. package/dest/local-network/local-network.d.ts +72 -0
  57. package/dest/local-network/local-network.d.ts.map +1 -0
  58. package/dest/{sandbox/sandbox.js → local-network/local-network.js} +43 -57
  59. package/dest/local-network/sponsored_fpc.d.ts +5 -0
  60. package/dest/local-network/sponsored_fpc.d.ts.map +1 -0
  61. package/dest/{sandbox → local-network}/sponsored_fpc.js +7 -8
  62. package/dest/mnemonic.d.ts +1 -1
  63. package/dest/splash.d.ts +1 -1
  64. package/dest/testing/anvil_test_watcher.d.ts +4 -4
  65. package/dest/testing/anvil_test_watcher.d.ts.map +1 -1
  66. package/dest/testing/anvil_test_watcher.js +19 -18
  67. package/dest/testing/cheat_codes.d.ts +7 -10
  68. package/dest/testing/cheat_codes.d.ts.map +1 -1
  69. package/dest/testing/cheat_codes.js +9 -10
  70. package/dest/testing/index.d.ts +1 -2
  71. package/dest/testing/index.d.ts.map +1 -1
  72. package/dest/testing/index.js +0 -1
  73. package/package.json +39 -37
  74. package/src/bin/index.ts +12 -10
  75. package/src/cli/aztec_start_action.ts +9 -22
  76. package/src/cli/aztec_start_options.ts +23 -40
  77. package/src/cli/cli.ts +46 -1
  78. package/src/cli/cmds/start_archiver.ts +9 -9
  79. package/src/cli/cmds/start_bot.ts +36 -13
  80. package/src/cli/cmds/start_node.ts +16 -17
  81. package/src/cli/cmds/start_p2p_bootstrap.ts +1 -1
  82. package/src/cli/cmds/start_prover_agent.ts +7 -2
  83. package/src/cli/cmds/start_prover_broker.ts +17 -3
  84. package/src/cli/cmds/start_prover_node.ts +13 -8
  85. package/src/cli/util.ts +12 -10
  86. package/src/cli/versioning.ts +3 -3
  87. package/src/examples/token.ts +20 -17
  88. package/src/examples/util.ts +2 -2
  89. package/src/index.ts +5 -5
  90. package/src/{sandbox → local-network}/banana_fpc.ts +16 -21
  91. package/src/local-network/index.ts +7 -0
  92. package/src/{sandbox/sandbox.ts → local-network/local-network.ts} +68 -99
  93. package/src/local-network/sponsored_fpc.ts +26 -0
  94. package/src/testing/anvil_test_watcher.ts +18 -19
  95. package/src/testing/cheat_codes.ts +13 -13
  96. package/src/testing/index.ts +0 -1
  97. package/dest/cli/chain_l2_config.d.ts +0 -31
  98. package/dest/cli/chain_l2_config.d.ts.map +0 -1
  99. package/dest/cli/chain_l2_config.js +0 -261
  100. package/dest/cli/cmds/start_blob_sink.d.ts +0 -3
  101. package/dest/cli/cmds/start_blob_sink.d.ts.map +0 -1
  102. package/dest/cli/cmds/start_blob_sink.js +0 -33
  103. package/dest/cli/cmds/start_pxe.d.ts +0 -16
  104. package/dest/cli/cmds/start_pxe.d.ts.map +0 -1
  105. package/dest/cli/cmds/start_pxe.js +0 -31
  106. package/dest/cli/get_l1_config.d.ts +0 -7
  107. package/dest/cli/get_l1_config.d.ts.map +0 -1
  108. package/dest/cli/get_l1_config.js +0 -13
  109. package/dest/sandbox/banana_fpc.d.ts +0 -11
  110. package/dest/sandbox/banana_fpc.d.ts.map +0 -1
  111. package/dest/sandbox/index.d.ts +0 -4
  112. package/dest/sandbox/index.d.ts.map +0 -1
  113. package/dest/sandbox/index.js +0 -3
  114. package/dest/sandbox/sandbox.d.ts +0 -83
  115. package/dest/sandbox/sandbox.d.ts.map +0 -1
  116. package/dest/sandbox/sponsored_fpc.d.ts +0 -4
  117. package/dest/sandbox/sponsored_fpc.d.ts.map +0 -1
  118. package/dest/testing/aztec_cheat_codes.d.ts +0 -59
  119. package/dest/testing/aztec_cheat_codes.d.ts.map +0 -1
  120. package/dest/testing/aztec_cheat_codes.js +0 -62
  121. package/src/cli/chain_l2_config.ts +0 -341
  122. package/src/cli/cmds/start_blob_sink.ts +0 -57
  123. package/src/cli/cmds/start_pxe.ts +0 -49
  124. package/src/cli/get_l1_config.ts +0 -19
  125. package/src/sandbox/index.ts +0 -4
  126. package/src/sandbox/sponsored_fpc.ts +0 -27
  127. package/src/testing/aztec_cheat_codes.ts +0 -77
@@ -1,19 +0,0 @@
1
- import { type L1ContractAddresses, RegistryContract, getL1ContractsConfig, getPublicClient } from '@aztec/ethereum';
2
- import type { EthAddress } from '@aztec/foundation/eth-address';
3
-
4
- export async function getL1Config(
5
- registryAddress: EthAddress,
6
- l1RpcUrls: string[],
7
- l1ChainId: number,
8
- rollupVersion: number | 'canonical' = 'canonical',
9
- ): Promise<{ addresses: L1ContractAddresses; config: Awaited<ReturnType<typeof getL1ContractsConfig>> }> {
10
- const publicClient = getPublicClient({ l1RpcUrls, l1ChainId });
11
- const addresses = await RegistryContract.collectAddresses(publicClient, registryAddress, rollupVersion);
12
-
13
- const config = await getL1ContractsConfig(publicClient, addresses);
14
-
15
- return {
16
- addresses,
17
- config,
18
- };
19
- }
@@ -1,4 +0,0 @@
1
- export * from './sandbox.js';
2
-
3
- export { getDeployedBananaCoinAddress, getDeployedBananaFPCAddress } from './banana_fpc.js';
4
- export { getDeployedSponsoredFPCAddress } from './sponsored_fpc.js';
@@ -1,27 +0,0 @@
1
- import {
2
- type ContractInstanceWithAddress,
3
- Fr,
4
- type PXE,
5
- getContractInstanceFromInstantiationParams,
6
- } from '@aztec/aztec.js';
7
- import { SPONSORED_FPC_SALT } from '@aztec/constants';
8
- import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
9
-
10
- async function getSponsoredFPCInstance(): Promise<ContractInstanceWithAddress> {
11
- return await getContractInstanceFromInstantiationParams(SponsoredFPCContract.artifact, {
12
- salt: new Fr(SPONSORED_FPC_SALT),
13
- });
14
- }
15
-
16
- export async function getSponsoredFPCAddress() {
17
- return (await getSponsoredFPCInstance()).address;
18
- }
19
-
20
- export async function getDeployedSponsoredFPCAddress(pxe: PXE) {
21
- const fpc = await getSponsoredFPCAddress();
22
- const contracts = await pxe.getContracts();
23
- if (!contracts.find(c => c.equals(fpc))) {
24
- throw new Error('SponsoredFPC not deployed.');
25
- }
26
- return fpc;
27
- }
@@ -1,77 +0,0 @@
1
- import { Fr } from '@aztec/foundation/fields';
2
- import { createLogger } from '@aztec/foundation/log';
3
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
4
- import { deriveStorageSlotInMap } from '@aztec/stdlib/hash';
5
- import type { PXE } from '@aztec/stdlib/interfaces/client';
6
- import type { Note } from '@aztec/stdlib/note';
7
-
8
- /**
9
- * A class that provides utility functions for interacting with the aztec chain.
10
- */
11
- export class AztecCheatCodes {
12
- constructor(
13
- /**
14
- * The PXE Service to use for interacting with the chain
15
- */
16
- public pxe: PXE,
17
- /**
18
- * The logger to use for the aztec cheatcodes
19
- */
20
- public logger = createLogger('aztecjs:cheat_codes'),
21
- ) {}
22
-
23
- /**
24
- * Computes the slot value for a given map and key.
25
- * @param mapSlot - The slot of the map (specified in Aztec.nr contract)
26
- * @param key - The key to lookup in the map
27
- * @returns The storage slot of the value in the map
28
- */
29
- public computeSlotInMap(mapSlot: Fr | bigint, key: Fr | bigint | AztecAddress): Promise<Fr> {
30
- const keyFr = typeof key === 'bigint' ? new Fr(key) : key.toField();
31
- return deriveStorageSlotInMap(mapSlot, keyFr);
32
- }
33
-
34
- /**
35
- * Get the current blocknumber
36
- * @returns The current block number
37
- */
38
- public async blockNumber(): Promise<number> {
39
- return await this.pxe.getBlockNumber();
40
- }
41
-
42
- /**
43
- * Get the current timestamp
44
- * @returns The current timestamp
45
- */
46
- public async timestamp(): Promise<number> {
47
- const res = await this.pxe.getBlock(await this.blockNumber());
48
- return Number(res?.header.globalVariables.timestamp ?? 0);
49
- }
50
-
51
- /**
52
- * Loads the value stored at the given slot in the public storage of the given contract.
53
- * @param who - The address of the contract
54
- * @param slot - The storage slot to lookup
55
- * @returns The value stored at the given slot
56
- */
57
- public async loadPublic(who: AztecAddress, slot: Fr | bigint): Promise<Fr> {
58
- const storageValue = await this.pxe.getPublicStorageAt(who, new Fr(slot));
59
- return storageValue;
60
- }
61
-
62
- /**
63
- * Loads the value stored at the given slot in the private storage of the given contract.
64
- * @param contract - The address of the contract
65
- * @param recipient - The address whose public key was used to encrypt the note
66
- * @param slot - The storage slot to lookup
67
- * @returns The notes stored at the given slot
68
- */
69
- public async loadPrivate(recipient: AztecAddress, contract: AztecAddress, slot: Fr | bigint): Promise<Note[]> {
70
- const extendedNotes = await this.pxe.getNotes({
71
- recipient,
72
- contractAddress: contract,
73
- storageSlot: new Fr(slot),
74
- });
75
- return extendedNotes.map(extendedNote => extendedNote.note);
76
- }
77
- }