@aztec/cli-wallet 3.0.0-nightly.20251114 → 3.0.0-nightly.20251118

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/dest/bin/index.js CHANGED
@@ -2,15 +2,14 @@ import { computeSecretHash } from '@aztec/aztec.js/crypto';
2
2
  import { Fr } from '@aztec/aztec.js/fields';
3
3
  import { createAztecNodeClient } from '@aztec/aztec.js/node';
4
4
  import { ProtocolContractAddress } from '@aztec/aztec.js/protocol';
5
+ import { BackendType, Barretenberg } from '@aztec/bb.js';
5
6
  import { LOCALHOST } from '@aztec/cli/cli-utils';
6
7
  import { createConsoleLogger, createLogger } from '@aztec/foundation/log';
7
8
  import { openStoreAt } from '@aztec/kv-store/lmdb-v2';
8
9
  import { getPackageVersion } from '@aztec/stdlib/update-checker';
9
10
  import { Argument, Command, Option } from 'commander';
10
- import { mkdirSync } from 'fs';
11
11
  import { homedir } from 'os';
12
- import { dirname, join, resolve } from 'path';
13
- import { fileURLToPath } from 'url';
12
+ import { join } from 'path';
14
13
  import { injectCommands } from '../cmds/index.js';
15
14
  import { Aliases, WalletDB } from '../storage/wallet_db.js';
16
15
  import { CliWalletAndNodeWrapper } from '../utils/cli_wallet_and_node_wrapper.js';
@@ -62,15 +61,20 @@ function injectInternalCommands(program, log, db) {
62
61
  }
63
62
  const { dataDir, nodeUrl, prover } = command.optsWithGlobals();
64
63
  const proverEnabled = prover !== 'none';
65
- const bbBinaryPath = prover === 'native' ? process.env.BB_BINARY_PATH ?? resolve(dirname(fileURLToPath(import.meta.url)), '../../../../barretenberg/cpp/build/bin/bb') : undefined;
66
- const bbWorkingDirectory = dataDir + '/bb';
67
- mkdirSync(bbWorkingDirectory, {
68
- recursive: true
69
- });
64
+ switch(prover){
65
+ case 'native':
66
+ await Barretenberg.initSingleton({
67
+ backend: BackendType.NativeUnixSocket
68
+ });
69
+ break;
70
+ case 'wasm':
71
+ await Barretenberg.initSingleton({
72
+ backend: BackendType.Wasm
73
+ });
74
+ break;
75
+ }
70
76
  const overridePXEConfig = {
71
77
  proverEnabled,
72
- bbBinaryPath: prover === 'native' ? bbBinaryPath : undefined,
73
- bbWorkingDirectory: prover === 'native' ? bbWorkingDirectory : undefined,
74
78
  dataDirectory: join(dataDir, 'pxe')
75
79
  };
76
80
  const node = createAztecNodeClient(nodeUrl);
@@ -93,6 +97,7 @@ function injectInternalCommands(program, log, db) {
93
97
  injectCommands(program, userLog, debugLogger, walletAndNodeWrapper, db);
94
98
  injectInternalCommands(program, userLog, db);
95
99
  await program.parseAsync(process.argv);
100
+ await Barretenberg.destroySingleton();
96
101
  }
97
102
  main().catch((err)=>{
98
103
  debugLogger.error(`Error in command execution`);
@@ -82,7 +82,7 @@ export function injectCommands(program, log, debugLogger, walletAndNodeWrapper,
82
82
  const authWitnesses = cleanupAuthWitnesses(authWitnessArray);
83
83
  const sentTx = await send(wallet, node, parsedFromAddress, functionName, args, artifactPath, contractAddress, wait, alias, CLIFeeArgs.parse(options, log, db), authWitnesses, verbose, log);
84
84
  if (db && sentTx) {
85
- const txAlias = alias ? alias : `${functionName}-${randomBytes(16).toString()}`;
85
+ const txAlias = alias ? alias : `${functionName}-${randomBytes(16).toString('hex')}`;
86
86
  await db.storeTx(sentTx, log, txAlias);
87
87
  }
88
88
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/cli-wallet",
3
- "version": "3.0.0-nightly.20251114",
3
+ "version": "3.0.0-nightly.20251118",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dest/cmds/index.js",
@@ -67,17 +67,18 @@
67
67
  ]
68
68
  },
69
69
  "dependencies": {
70
- "@aztec/accounts": "3.0.0-nightly.20251114",
71
- "@aztec/aztec.js": "3.0.0-nightly.20251114",
72
- "@aztec/cli": "3.0.0-nightly.20251114",
73
- "@aztec/entrypoints": "3.0.0-nightly.20251114",
74
- "@aztec/ethereum": "3.0.0-nightly.20251114",
75
- "@aztec/foundation": "3.0.0-nightly.20251114",
76
- "@aztec/kv-store": "3.0.0-nightly.20251114",
77
- "@aztec/noir-contracts.js": "3.0.0-nightly.20251114",
78
- "@aztec/noir-noirc_abi": "3.0.0-nightly.20251114",
79
- "@aztec/pxe": "3.0.0-nightly.20251114",
80
- "@aztec/stdlib": "3.0.0-nightly.20251114",
70
+ "@aztec/accounts": "3.0.0-nightly.20251118",
71
+ "@aztec/aztec.js": "3.0.0-nightly.20251118",
72
+ "@aztec/bb.js": "3.0.0-nightly.20251118",
73
+ "@aztec/cli": "3.0.0-nightly.20251118",
74
+ "@aztec/entrypoints": "3.0.0-nightly.20251118",
75
+ "@aztec/ethereum": "3.0.0-nightly.20251118",
76
+ "@aztec/foundation": "3.0.0-nightly.20251118",
77
+ "@aztec/kv-store": "3.0.0-nightly.20251118",
78
+ "@aztec/noir-contracts.js": "3.0.0-nightly.20251118",
79
+ "@aztec/noir-noirc_abi": "3.0.0-nightly.20251118",
80
+ "@aztec/pxe": "3.0.0-nightly.20251118",
81
+ "@aztec/stdlib": "3.0.0-nightly.20251118",
81
82
  "commander": "^12.1.0",
82
83
  "inquirer": "^10.1.8",
83
84
  "source-map-support": "^0.5.21",
package/src/bin/index.ts CHANGED
@@ -2,6 +2,7 @@ import { computeSecretHash } from '@aztec/aztec.js/crypto';
2
2
  import { Fr } from '@aztec/aztec.js/fields';
3
3
  import { createAztecNodeClient } from '@aztec/aztec.js/node';
4
4
  import { ProtocolContractAddress } from '@aztec/aztec.js/protocol';
5
+ import { BackendType, Barretenberg } from '@aztec/bb.js';
5
6
  import { LOCALHOST } from '@aztec/cli/cli-utils';
6
7
  import { type LogFn, createConsoleLogger, createLogger } from '@aztec/foundation/log';
7
8
  import { openStoreAt } from '@aztec/kv-store/lmdb-v2';
@@ -9,10 +10,8 @@ import type { PXEConfig } from '@aztec/pxe/config';
9
10
  import { getPackageVersion } from '@aztec/stdlib/update-checker';
10
11
 
11
12
  import { Argument, Command, Option } from 'commander';
12
- import { mkdirSync } from 'fs';
13
13
  import { homedir } from 'os';
14
- import { dirname, join, resolve } from 'path';
15
- import { fileURLToPath } from 'url';
14
+ import { join } from 'path';
16
15
 
17
16
  import { injectCommands } from '../cmds/index.js';
18
17
  import { Aliases, WalletDB } from '../storage/wallet_db.js';
@@ -104,18 +103,17 @@ async function main() {
104
103
 
105
104
  const proverEnabled = prover !== 'none';
106
105
 
107
- const bbBinaryPath =
108
- prover === 'native'
109
- ? (process.env.BB_BINARY_PATH ??
110
- resolve(dirname(fileURLToPath(import.meta.url)), '../../../../barretenberg/cpp/build/bin/bb'))
111
- : undefined;
112
- const bbWorkingDirectory = dataDir + '/bb';
113
- mkdirSync(bbWorkingDirectory, { recursive: true });
106
+ switch (prover) {
107
+ case 'native':
108
+ await Barretenberg.initSingleton({ backend: BackendType.NativeUnixSocket });
109
+ break;
110
+ case 'wasm':
111
+ await Barretenberg.initSingleton({ backend: BackendType.Wasm });
112
+ break;
113
+ }
114
114
 
115
115
  const overridePXEConfig: Partial<PXEConfig> = {
116
116
  proverEnabled,
117
- bbBinaryPath: prover === 'native' ? bbBinaryPath : undefined,
118
- bbWorkingDirectory: prover === 'native' ? bbWorkingDirectory : undefined,
119
117
  dataDirectory: join(dataDir, 'pxe'),
120
118
  };
121
119
 
@@ -147,6 +145,8 @@ async function main() {
147
145
  injectCommands(program, userLog, debugLogger, walletAndNodeWrapper, db);
148
146
  injectInternalCommands(program, userLog, db);
149
147
  await program.parseAsync(process.argv);
148
+
149
+ await Barretenberg.destroySingleton();
150
150
  }
151
151
 
152
152
  main().catch(err => {
package/src/cmds/index.ts CHANGED
@@ -346,7 +346,7 @@ export function injectCommands(
346
346
  log,
347
347
  );
348
348
  if (db && sentTx) {
349
- const txAlias = alias ? alias : `${functionName}-${randomBytes(16).toString()}`;
349
+ const txAlias = alias ? alias : `${functionName}-${randomBytes(16).toString('hex')}`;
350
350
  await db.storeTx(sentTx, log, txAlias);
351
351
  }
352
352
  });