@aztec/cli-wallet 0.85.0 → 0.86.0

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.
@@ -1,14 +1,14 @@
1
1
  import { L1FeeJuicePortalManager } from '@aztec/aztec.js';
2
2
  import { prettyPrintJSON } from '@aztec/cli/utils';
3
- import { createEthereumChain, createL1Clients } from '@aztec/ethereum';
3
+ import { createEthereumChain, createExtendedL1Client } from '@aztec/ethereum';
4
4
  import { Fr } from '@aztec/foundation/fields';
5
5
  export async function bridgeL1FeeJuice(amount, recipient, pxe, l1RpcUrls, chainId, privateKey, mnemonic, mint, json, wait, interval = 60_000, log, debugLogger) {
6
6
  // Prepare L1 client
7
7
  const chain = createEthereumChain(l1RpcUrls, chainId);
8
- const { publicClient, walletClient } = createL1Clients(chain.rpcUrls, privateKey ?? mnemonic, chain.chainInfo);
8
+ const client = createExtendedL1Client(chain.rpcUrls, privateKey ?? mnemonic, chain.chainInfo);
9
9
  const { protocolContractAddresses: { feeJuice: feeJuiceAddress } } = await pxe.getPXEInfo();
10
10
  // Setup portal manager
11
- const portal = await L1FeeJuicePortalManager.new(pxe, publicClient, walletClient, debugLogger);
11
+ const portal = await L1FeeJuicePortalManager.new(pxe, client, debugLogger);
12
12
  const { claimAmount, claimSecret, messageHash, messageLeafIndex } = await portal.bridgeTokensPublic(recipient, amount, mint);
13
13
  if (json) {
14
14
  const out = {
@@ -1 +1 @@
1
- {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/cmds/profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAE,WAAW,EAAE,KAAK,YAAY,EAAY,MAAM,iBAAiB,CAAC;AAE5G,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AA8CnD,wBAAsB,OAAO,CAC3B,MAAM,EAAE,0BAA0B,EAClC,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,GAAG,EAAE,EACrB,oBAAoB,EAAE,MAAM,EAC5B,eAAe,EAAE,YAAY,EAC7B,eAAe,EAAE,MAAM,GAAG,SAAS,EACnC,aAAa,EAAE,WAAW,EAAE,EAC5B,GAAG,EAAE,KAAK,iBAcX"}
1
+ {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/cmds/profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAE,WAAW,EAAE,KAAK,YAAY,EAAY,MAAM,iBAAiB,CAAC;AAE5G,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AA6BnD,wBAAsB,OAAO,CAC3B,MAAM,EAAE,0BAA0B,EAClC,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,GAAG,EAAE,EACrB,oBAAoB,EAAE,MAAM,EAC5B,eAAe,EAAE,YAAY,EAC7B,eAAe,EAAE,MAAM,GAAG,SAAS,EACnC,aAAa,EAAE,WAAW,EAAE,EAC5B,GAAG,EAAE,KAAK,iBAeX"}
@@ -1,7 +1,6 @@
1
1
  import { Contract } from '@aztec/aztec.js';
2
2
  import { prepTx } from '@aztec/cli/utils';
3
- import { serializeWitness } from '@aztec/noir-noirc_abi';
4
- import { encode } from '@msgpack/msgpack';
3
+ import { serializePrivateExecutionSteps } from '@aztec/stdlib/kernel';
5
4
  import { promises as fs } from 'fs';
6
5
  import path from 'path';
7
6
  import { format } from 'util';
@@ -16,20 +15,6 @@ function printProfileResult(result, log) {
16
15
  });
17
16
  log(format('\nTotal gates:', acc.toLocaleString()));
18
17
  }
19
- // TODO(#7371): This is duplicated.
20
- // Longer term we won't use this hacked together msgpack format
21
- // Leaving duplicated as this eventually bb will provide a serialization
22
- // helper for passing to a generic msgpack RPC endpoint.
23
- async function _createClientIvcProofFiles(directory, executionSteps) {
24
- const acirPath = path.join(directory, 'acir.msgpack');
25
- const witnessPath = path.join(directory, 'witnesses.msgpack');
26
- await fs.writeFile(acirPath, encode(executionSteps.map((map)=>map.bytecode)));
27
- await fs.writeFile(witnessPath, encode(executionSteps.map((map)=>serializeWitness(map.witness))));
28
- return {
29
- acirPath,
30
- witnessPath
31
- };
32
- }
33
18
  export async function profile(wallet, functionName, functionArgsIn, contractArtifactPath, contractAddress, debugOutputPath, authWitnesses, log) {
34
19
  const profileMode = debugOutputPath ? 'full' : 'gates';
35
20
  const { functionArgs, contractArtifact } = await prepTx(contractArtifactPath, functionName, functionArgsIn, log);
@@ -41,7 +26,8 @@ export async function profile(wallet, functionName, functionArgsIn, contractArti
41
26
  });
42
27
  printProfileResult(result, log);
43
28
  if (debugOutputPath) {
44
- log(`Debug output written to ${debugOutputPath} (witnesses.msgpack and acir.msgpack)`);
45
- await _createClientIvcProofFiles(debugOutputPath, result.executionSteps);
29
+ const ivcInputsPath = path.join(debugOutputPath, 'ivc-inputs.msgpack');
30
+ log(`Debug output written to ${ivcInputsPath}.`);
31
+ await fs.writeFile(ivcInputsPath, serializePrivateExecutionSteps(result.executionSteps));
46
32
  }
47
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/cli-wallet",
3
- "version": "0.85.0",
3
+ "version": "0.86.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dest/cmds/index.js",
@@ -23,8 +23,6 @@
23
23
  "build": "yarn clean && tsc -b",
24
24
  "build:dev": "tsc -b --watch",
25
25
  "clean": "rm -rf ./dest .tsbuildinfo",
26
- "formatting": "run -T prettier --check ./src && run -T eslint ./src",
27
- "formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
28
26
  "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
29
27
  },
30
28
  "inherits": [
@@ -65,18 +63,17 @@
65
63
  ]
66
64
  },
67
65
  "dependencies": {
68
- "@aztec/accounts": "0.85.0",
69
- "@aztec/aztec.js": "0.85.0",
70
- "@aztec/cli": "0.85.0",
71
- "@aztec/entrypoints": "0.85.0",
72
- "@aztec/ethereum": "0.85.0",
73
- "@aztec/foundation": "0.85.0",
74
- "@aztec/kv-store": "0.85.0",
75
- "@aztec/noir-contracts.js": "0.85.0",
76
- "@aztec/noir-noirc_abi": "0.85.0",
77
- "@aztec/pxe": "0.85.0",
78
- "@aztec/stdlib": "0.85.0",
79
- "@msgpack/msgpack": "^3.0.0-beta2",
66
+ "@aztec/accounts": "0.86.0",
67
+ "@aztec/aztec.js": "0.86.0",
68
+ "@aztec/cli": "0.86.0",
69
+ "@aztec/entrypoints": "0.86.0",
70
+ "@aztec/ethereum": "0.86.0",
71
+ "@aztec/foundation": "0.86.0",
72
+ "@aztec/kv-store": "0.86.0",
73
+ "@aztec/noir-contracts.js": "0.86.0",
74
+ "@aztec/noir-noirc_abi": "0.86.0",
75
+ "@aztec/pxe": "0.86.0",
76
+ "@aztec/stdlib": "0.86.0",
80
77
  "commander": "^12.1.0",
81
78
  "inquirer": "^10.1.8",
82
79
  "source-map-support": "^0.5.21",
@@ -1,6 +1,6 @@
1
1
  import { L1FeeJuicePortalManager, type PXE } from '@aztec/aztec.js';
2
2
  import { prettyPrintJSON } from '@aztec/cli/utils';
3
- import { createEthereumChain, createL1Clients } from '@aztec/ethereum';
3
+ import { createEthereumChain, createExtendedL1Client } from '@aztec/ethereum';
4
4
  import { Fr } from '@aztec/foundation/fields';
5
5
  import type { LogFn, Logger } from '@aztec/foundation/log';
6
6
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
@@ -22,14 +22,14 @@ export async function bridgeL1FeeJuice(
22
22
  ) {
23
23
  // Prepare L1 client
24
24
  const chain = createEthereumChain(l1RpcUrls, chainId);
25
- const { publicClient, walletClient } = createL1Clients(chain.rpcUrls, privateKey ?? mnemonic, chain.chainInfo);
25
+ const client = createExtendedL1Client(chain.rpcUrls, privateKey ?? mnemonic, chain.chainInfo);
26
26
 
27
27
  const {
28
28
  protocolContractAddresses: { feeJuice: feeJuiceAddress },
29
29
  } = await pxe.getPXEInfo();
30
30
 
31
31
  // Setup portal manager
32
- const portal = await L1FeeJuicePortalManager.new(pxe, publicClient, walletClient, debugLogger);
32
+ const portal = await L1FeeJuicePortalManager.new(pxe, client, debugLogger);
33
33
  const { claimAmount, claimSecret, messageHash, messageLeafIndex } = await portal.bridgeTokensPublic(
34
34
  recipient,
35
35
  amount,
@@ -1,11 +1,9 @@
1
1
  import { type AccountWalletWithSecretKey, AuthWitness, type AztecAddress, Contract } from '@aztec/aztec.js';
2
2
  import { prepTx } from '@aztec/cli/utils';
3
3
  import type { LogFn } from '@aztec/foundation/log';
4
- import { serializeWitness } from '@aztec/noir-noirc_abi';
5
- import type { PrivateExecutionStep } from '@aztec/stdlib/kernel';
4
+ import { serializePrivateExecutionSteps } from '@aztec/stdlib/kernel';
6
5
  import type { TxProfileResult } from '@aztec/stdlib/tx';
7
6
 
8
- import { encode } from '@msgpack/msgpack';
9
7
  import { promises as fs } from 'fs';
10
8
  import path from 'path';
11
9
  import { format } from 'util';
@@ -31,21 +29,6 @@ function printProfileResult(result: TxProfileResult, log: LogFn) {
31
29
  log(format('\nTotal gates:', acc.toLocaleString()));
32
30
  }
33
31
 
34
- // TODO(#7371): This is duplicated.
35
- // Longer term we won't use this hacked together msgpack format
36
- // Leaving duplicated as this eventually bb will provide a serialization
37
- // helper for passing to a generic msgpack RPC endpoint.
38
- async function _createClientIvcProofFiles(directory: string, executionSteps: PrivateExecutionStep[]) {
39
- const acirPath = path.join(directory, 'acir.msgpack');
40
- const witnessPath = path.join(directory, 'witnesses.msgpack');
41
- await fs.writeFile(acirPath, encode(executionSteps.map(map => map.bytecode)));
42
- await fs.writeFile(witnessPath, encode(executionSteps.map(map => serializeWitness(map.witness))));
43
- return {
44
- acirPath,
45
- witnessPath,
46
- };
47
- }
48
-
49
32
  export async function profile(
50
33
  wallet: AccountWalletWithSecretKey,
51
34
  functionName: string,
@@ -65,7 +48,8 @@ export async function profile(
65
48
  const result = await call.profile({ profileMode, authWitnesses });
66
49
  printProfileResult(result, log);
67
50
  if (debugOutputPath) {
68
- log(`Debug output written to ${debugOutputPath} (witnesses.msgpack and acir.msgpack)`);
69
- await _createClientIvcProofFiles(debugOutputPath, result.executionSteps);
51
+ const ivcInputsPath = path.join(debugOutputPath, 'ivc-inputs.msgpack');
52
+ log(`Debug output written to ${ivcInputsPath}.`);
53
+ await fs.writeFile(ivcInputsPath, serializePrivateExecutionSteps(result.executionSteps));
70
54
  }
71
55
  }