@aztec/cli-wallet 0.86.0-starknet.1 → 0.87.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.
Files changed (51) hide show
  1. package/dest/bin/index.js +1 -1
  2. package/dest/cmds/create_account.d.ts +1 -1
  3. package/dest/cmds/create_account.d.ts.map +1 -1
  4. package/dest/cmds/create_account.js +25 -15
  5. package/dest/cmds/deploy.d.ts +1 -1
  6. package/dest/cmds/deploy.d.ts.map +1 -1
  7. package/dest/cmds/deploy.js +7 -2
  8. package/dest/cmds/deploy_account.d.ts +1 -1
  9. package/dest/cmds/deploy_account.d.ts.map +1 -1
  10. package/dest/cmds/deploy_account.js +25 -16
  11. package/dest/cmds/index.d.ts.map +1 -1
  12. package/dest/cmds/index.js +17 -16
  13. package/dest/cmds/profile.d.ts.map +1 -1
  14. package/dest/cmds/profile.js +2 -22
  15. package/dest/cmds/register_contract.d.ts +1 -1
  16. package/dest/cmds/register_contract.d.ts.map +1 -1
  17. package/dest/cmds/send.d.ts +1 -1
  18. package/dest/cmds/send.d.ts.map +1 -1
  19. package/dest/cmds/send.js +7 -2
  20. package/dest/cmds/simulate.d.ts +2 -1
  21. package/dest/cmds/simulate.d.ts.map +1 -1
  22. package/dest/cmds/simulate.js +10 -4
  23. package/dest/storage/wallet_db.d.ts +1 -3
  24. package/dest/storage/wallet_db.d.ts.map +1 -1
  25. package/dest/storage/wallet_db.js +1 -1
  26. package/dest/utils/accounts.d.ts +1 -1
  27. package/dest/utils/accounts.d.ts.map +1 -1
  28. package/dest/utils/ecdsa.d.ts +0 -2
  29. package/dest/utils/ecdsa.d.ts.map +1 -1
  30. package/dest/utils/options/fees.d.ts.map +1 -1
  31. package/dest/utils/options/options.d.ts +1 -0
  32. package/dest/utils/options/options.d.ts.map +1 -1
  33. package/dest/utils/options/options.js +6 -3
  34. package/dest/utils/profiling.d.ts +5 -0
  35. package/dest/utils/profiling.d.ts.map +1 -0
  36. package/dest/utils/profiling.js +32 -0
  37. package/package.json +15 -15
  38. package/src/bin/index.ts +1 -1
  39. package/src/cmds/create_account.ts +24 -14
  40. package/src/cmds/deploy.ts +8 -1
  41. package/src/cmds/deploy_account.ts +24 -15
  42. package/src/cmds/index.ts +51 -26
  43. package/src/cmds/profile.ts +3 -60
  44. package/src/cmds/register_contract.ts +1 -1
  45. package/src/cmds/send.ts +8 -1
  46. package/src/cmds/simulate.ts +14 -2
  47. package/src/storage/wallet_db.ts +1 -1
  48. package/src/utils/accounts.ts +1 -1
  49. package/src/utils/options/fees.ts +24 -15
  50. package/src/utils/options/options.ts +10 -3
  51. package/src/utils/profiling.ts +87 -0
package/dest/bin/index.js CHANGED
@@ -33,7 +33,7 @@ function injectInternalCommands(program, log, db) {
33
33
  const options = command.optsWithGlobals();
34
34
  const { alias } = options;
35
35
  const value = Fr.random();
36
- const hash = computeSecretHash(value);
36
+ const hash = await computeSecretHash(value);
37
37
  await db.storeAlias('secrets', alias, Buffer.from(value.toString()), log);
38
38
  await db.storeAlias('secrets', `${alias}:hash`, Buffer.from(hash.toString()), log);
39
39
  });
@@ -3,7 +3,7 @@ import { Fr } from '@aztec/foundation/fields';
3
3
  import type { LogFn, Logger } from '@aztec/foundation/log';
4
4
  import { type AccountType } from '../utils/accounts.js';
5
5
  import { type IFeeOpts } from '../utils/options/fees.js';
6
- export declare function createAccount(client: PXE, accountType: AccountType, secretKey: Fr | undefined, publicKey: string | undefined, alias: string | undefined, registerOnly: boolean, publicDeploy: boolean, skipInitialization: boolean, wait: boolean, feeOpts: IFeeOpts, json: boolean, debugLogger: Logger, log: LogFn): Promise<{
6
+ export declare function createAccount(client: PXE, accountType: AccountType, secretKey: Fr | undefined, publicKey: string | undefined, alias: string | undefined, registerOnly: boolean, publicDeploy: boolean, skipInitialization: boolean, wait: boolean, feeOpts: IFeeOpts, json: boolean, verbose: boolean, debugLogger: Logger, log: LogFn): Promise<{
7
7
  alias: string | undefined;
8
8
  address: import("@aztec/aztec.js").AztecAddress;
9
9
  secretKey: Fr;
@@ -1 +1 @@
1
- {"version":3,"file":"create_account.d.ts","sourceRoot":"","sources":["../../src/cmds/create_account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAwB,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEjE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,WAAW,EAA2B,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,KAAK,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAE5E,wBAAsB,aAAa,CACjC,MAAM,EAAE,GAAG,EACX,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,EAAE,GAAG,SAAS,EACzB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,OAAO,EACrB,kBAAkB,EAAE,OAAO,EAC3B,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,OAAO,EACb,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK;;;;;GA8GX"}
1
+ {"version":3,"file":"create_account.d.ts","sourceRoot":"","sources":["../../src/cmds/create_account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAwB,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEjE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,WAAW,EAA2B,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,KAAK,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAG5E,wBAAsB,aAAa,CACjC,MAAM,EAAE,GAAG,EACX,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,EAAE,GAAG,SAAS,EACzB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,OAAO,EACrB,kBAAkB,EAAE,OAAO,EAC3B,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK;;;;;GAsHX"}
@@ -2,7 +2,8 @@ import { prettyPrintJSON } from '@aztec/cli/cli-utils';
2
2
  import { Fr } from '@aztec/foundation/fields';
3
3
  import { createOrRetrieveAccount } from '../utils/accounts.js';
4
4
  import { printGasEstimates } from '../utils/options/fees.js';
5
- export async function createAccount(client, accountType, secretKey, publicKey, alias, registerOnly, publicDeploy, skipInitialization, wait, feeOpts, json, debugLogger, log) {
5
+ import { printProfileResult } from '../utils/profiling.js';
6
+ export async function createAccount(client, accountType, secretKey, publicKey, alias, registerOnly, publicDeploy, skipInitialization, wait, feeOpts, json, verbose, debugLogger, log) {
6
7
  secretKey ??= Fr.random();
7
8
  const account = await createOrRetrieveAccount(client, undefined /* address, we don't have it yet */ , undefined /* db, as we want to create from scratch */ , secretKey, accountType, Fr.ZERO, publicKey);
8
9
  const { salt } = account.getInstance();
@@ -42,22 +43,23 @@ export async function createAccount(client, accountType, secretKey, publicKey, a
42
43
  skipInitialization: skipInitialization,
43
44
  ...await feeOpts.toDeployAccountOpts(wallet)
44
45
  };
46
+ /*
47
+ * This is usually handled by accountManager.deploy(), but we're accessing the lower
48
+ * level method to get gas and timings. That means we have to replicate some of the logic here.
49
+ * In case we're deploying our own account, we need to hijack the payment method for the fee,
50
+ * wrapping it in the one that will make use of the freshly deployed account's
51
+ * entrypoint. For reference, see aztec.js/src/account_manager.ts:deploy()
52
+ * Also, salt and universalDeploy have to be explicitly provided
53
+ */ deployOpts.fee = !deployOpts?.deployWallet && deployOpts?.fee ? {
54
+ ...deployOpts.fee,
55
+ paymentMethod: await account.getSelfPaymentMethod(deployOpts.fee.paymentMethod)
56
+ } : deployOpts?.fee;
57
+ const deployMethod = await account.getDeployMethod(deployOpts.deployWallet);
45
58
  if (feeOpts.estimateOnly) {
46
- /*
47
- * This is usually handled by accountManager.deploy(), but we're accessing the lower
48
- * level method to get the gas estimates. That means we have to replicate some of the logic here.
49
- * In case we're deploying our own account, we need to hijack the payment method for the fee,
50
- * wrapping it in the one that will make use of the freshly deployed account's
51
- * entrypoint. For reference, see aztec.js/src/account_manager.ts:deploy()
52
- */ const fee = !deployOpts?.deployWallet && deployOpts?.fee ? {
53
- ...deployOpts.fee,
54
- paymentMethod: await account.getSelfPaymentMethod(deployOpts.fee.paymentMethod)
55
- } : deployOpts?.fee;
56
- const deployMethod = await account.getDeployMethod(deployOpts.deployWallet);
57
59
  const gas = await deployMethod.estimateGas({
58
60
  ...deployOpts,
59
- fee,
60
- universalDeploy: true
61
+ universalDeploy: true,
62
+ contractAddressSalt: salt
61
63
  });
62
64
  if (json) {
63
65
  out.fee = {
@@ -74,7 +76,15 @@ export async function createAccount(client, accountType, secretKey, publicKey, a
74
76
  printGasEstimates(feeOpts, gas, log);
75
77
  }
76
78
  } else {
77
- tx = account.deploy(deployOpts);
79
+ const provenTx = await deployMethod.prove({
80
+ ...deployOpts,
81
+ universalDeploy: true,
82
+ contractAddressSalt: salt
83
+ });
84
+ if (verbose) {
85
+ printProfileResult(provenTx.timings, log);
86
+ }
87
+ tx = provenTx.send();
78
88
  const txHash = await tx.getTxHash();
79
89
  debugLogger.debug(`Account contract tx sent with hash ${txHash}`);
80
90
  out.txHash = txHash;
@@ -2,5 +2,5 @@ import { type AccountWalletWithSecretKey, Fr } from '@aztec/aztec.js';
2
2
  import type { LogFn, Logger } from '@aztec/foundation/log';
3
3
  import { PublicKeys } from '@aztec/stdlib/keys';
4
4
  import { type IFeeOpts } from '../utils/options/fees.js';
5
- export declare function deploy(wallet: AccountWalletWithSecretKey, artifactPath: string, json: boolean, publicKeys: PublicKeys | undefined, rawArgs: any[], salt: Fr | undefined, initializer: string | undefined, skipPublicDeployment: boolean, skipClassRegistration: boolean, skipInitialization: boolean | undefined, universalDeploy: boolean | undefined, wait: boolean, feeOpts: IFeeOpts, debugLogger: Logger, log: LogFn, logJson: (output: any) => void): Promise<import("@aztec/aztec.js").AztecAddress | undefined>;
5
+ export declare function deploy(wallet: AccountWalletWithSecretKey, artifactPath: string, json: boolean, publicKeys: PublicKeys | undefined, rawArgs: any[], salt: Fr | undefined, initializer: string | undefined, skipPublicDeployment: boolean, skipClassRegistration: boolean, skipInitialization: boolean | undefined, universalDeploy: boolean | undefined, wait: boolean, feeOpts: IFeeOpts, verbose: boolean, debugLogger: Logger, log: LogFn, logJson: (output: any) => void): Promise<import("@aztec/aztec.js").AztecAddress | undefined>;
6
6
  //# sourceMappingURL=deploy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/cmds/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAwC,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAE5G,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,KAAK,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAE5E,wBAAsB,MAAM,CAC1B,MAAM,EAAE,0BAA0B,EAClC,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,OAAO,EACb,UAAU,EAAE,UAAU,GAAG,SAAS,EAClC,OAAO,EAAE,GAAG,EAAE,EACd,IAAI,EAAE,EAAE,GAAG,SAAS,EACpB,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,oBAAoB,EAAE,OAAO,EAC7B,qBAAqB,EAAE,OAAO,EAC9B,kBAAkB,EAAE,OAAO,GAAG,SAAS,EACvC,eAAe,EAAE,OAAO,GAAG,SAAS,EACpC,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,QAAQ,EACjB,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK,EACV,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,+DAkF/B"}
1
+ {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/cmds/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAwC,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAE5G,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,KAAK,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAG5E,wBAAsB,MAAM,CAC1B,MAAM,EAAE,0BAA0B,EAClC,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,OAAO,EACb,UAAU,EAAE,UAAU,GAAG,SAAS,EAClC,OAAO,EAAE,GAAG,EAAE,EACd,IAAI,EAAE,EAAE,GAAG,SAAS,EACpB,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,oBAAoB,EAAE,OAAO,EAC7B,qBAAqB,EAAE,OAAO,EAC9B,kBAAkB,EAAE,OAAO,GAAG,SAAS,EACvC,eAAe,EAAE,OAAO,GAAG,SAAS,EACpC,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK,EACV,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,+DAuF/B"}
@@ -3,7 +3,8 @@ import { encodeArgs, getContractArtifact } from '@aztec/cli/utils';
3
3
  import { getAllFunctionAbis, getInitializer } from '@aztec/stdlib/abi';
4
4
  import { PublicKeys } from '@aztec/stdlib/keys';
5
5
  import { printGasEstimates } from '../utils/options/fees.js';
6
- export async function deploy(wallet, artifactPath, json, publicKeys, rawArgs, salt, initializer, skipPublicDeployment, skipClassRegistration, skipInitialization, universalDeploy, wait, feeOpts, debugLogger, log, logJson) {
6
+ import { printProfileResult } from '../utils/profiling.js';
7
+ export async function deploy(wallet, artifactPath, json, publicKeys, rawArgs, salt, initializer, skipPublicDeployment, skipClassRegistration, skipInitialization, universalDeploy, wait, feeOpts, verbose, debugLogger, log, logJson) {
7
8
  salt ??= Fr.random();
8
9
  const contractArtifact = await getContractArtifact(artifactPath, log);
9
10
  const hasInitializer = getAllFunctionAbis(contractArtifact).some((fn)=>fn.isInitializer);
@@ -33,7 +34,11 @@ export async function deploy(wallet, artifactPath, json, publicKeys, rawArgs, sa
33
34
  printGasEstimates(feeOpts, gas, log);
34
35
  return;
35
36
  }
36
- const tx = deploy.send(deployOpts);
37
+ const provenTx = await deploy.prove(deployOpts);
38
+ if (verbose) {
39
+ printProfileResult(provenTx.timings, log);
40
+ }
41
+ const tx = provenTx.send();
37
42
  const txHash = await tx.getTxHash();
38
43
  debugLogger.debug(`Deploy tx sent with hash ${txHash}`);
39
44
  if (wait) {
@@ -1,7 +1,7 @@
1
1
  import type { AccountManager } from '@aztec/aztec.js';
2
2
  import type { LogFn, Logger } from '@aztec/foundation/log';
3
3
  import { type IFeeOpts } from '../utils/options/fees.js';
4
- export declare function deployAccount(account: AccountManager, wait: boolean, registerClass: boolean, publicDeploy: boolean, feeOpts: IFeeOpts, json: boolean, debugLogger: Logger, log: LogFn): Promise<{
4
+ export declare function deployAccount(account: AccountManager, wait: boolean, registerClass: boolean, publicDeploy: boolean, feeOpts: IFeeOpts, json: boolean, verbose: boolean, debugLogger: Logger, log: LogFn): Promise<{
5
5
  address: import("@aztec/aztec.js").AztecAddress;
6
6
  secretKey: import("@aztec/aztec.js").Fr;
7
7
  salt: import("@aztec/aztec.js").Fr;
@@ -1 +1 @@
1
- {"version":3,"file":"deploy_account.d.ts","sourceRoot":"","sources":["../../src/cmds/deploy_account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAwB,MAAM,iBAAiB,CAAC;AAE5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAE5E,wBAAsB,aAAa,CACjC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,OAAO,EACb,aAAa,EAAE,OAAO,EACtB,YAAY,EAAE,OAAO,EACrB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,OAAO,EACb,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK;;;;GA8FX"}
1
+ {"version":3,"file":"deploy_account.d.ts","sourceRoot":"","sources":["../../src/cmds/deploy_account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAwB,MAAM,iBAAiB,CAAC;AAE5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAG5E,wBAAsB,aAAa,CACjC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,OAAO,EACb,aAAa,EAAE,OAAO,EACtB,YAAY,EAAE,OAAO,EACrB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK;;;;GAqGX"}
@@ -1,6 +1,7 @@
1
1
  import { prettyPrintJSON } from '@aztec/cli/cli-utils';
2
2
  import { printGasEstimates } from '../utils/options/fees.js';
3
- export async function deployAccount(account, wait, registerClass, publicDeploy, feeOpts, json, debugLogger, log) {
3
+ import { printProfileResult } from '../utils/profiling.js';
4
+ export async function deployAccount(account, wait, registerClass, publicDeploy, feeOpts, json, verbose, debugLogger, log) {
4
5
  const out = {};
5
6
  const { address, partialAddress, publicKeys } = await account.getCompleteAddress();
6
7
  const { initializationHash, deployer, salt } = account.getInstance();
@@ -27,27 +28,27 @@ export async function deployAccount(account, wait, registerClass, publicDeploy,
27
28
  let tx;
28
29
  let txReceipt;
29
30
  const deployOpts = {
30
- skipInitialization: false,
31
31
  skipPublicDeployment: !publicDeploy,
32
32
  skipClassRegistration: !registerClass,
33
33
  ...await feeOpts.toDeployAccountOpts(wallet)
34
34
  };
35
+ /*
36
+ * This is usually handled by accountManager.deploy(), but we're accessing the lower
37
+ * level method to get gas and timings. That means we have to replicate some of the logic here.
38
+ * In case we're deploying our own account, we need to hijack the payment method for the fee,
39
+ * wrapping it in the one that will make use of the freshly deployed account's
40
+ * entrypoint. For reference, see aztec.js/src/account_manager.ts:deploy()
41
+ * Also, salt and universalDeploy have to be explicitly provided
42
+ */ deployOpts.fee = !deployOpts?.deployWallet && deployOpts?.fee ? {
43
+ ...deployOpts.fee,
44
+ paymentMethod: await account.getSelfPaymentMethod(deployOpts.fee.paymentMethod)
45
+ } : deployOpts?.fee;
46
+ const deployMethod = await account.getDeployMethod(deployOpts.deployWallet);
35
47
  if (feeOpts.estimateOnly) {
36
- /*
37
- * This is usually handled by accountManager.deploy(), but we're accessing the lower
38
- * level method to get the gas estimates. That means we have to replicate some of the logic here.
39
- * In case we're deploying our own account, we need to hijack the payment method for the fee,
40
- * wrapping it in the one that will make use of the freshly deployed account's
41
- * entrypoint. For reference, see aztec.js/src/account_manager.ts:deploy()
42
- */ const fee = !deployOpts?.deployWallet && deployOpts?.fee ? {
43
- ...deployOpts.fee,
44
- paymentMethod: await account.getSelfPaymentMethod(deployOpts.fee.paymentMethod)
45
- } : deployOpts?.fee;
46
- const deployMethod = await account.getDeployMethod(deployOpts.deployWallet);
47
48
  const gas = await deployMethod.estimateGas({
48
49
  ...deployOpts,
49
- fee,
50
- universalDeploy: true
50
+ universalDeploy: true,
51
+ contractAddressSalt: salt
51
52
  });
52
53
  if (json) {
53
54
  out.fee = {
@@ -64,7 +65,15 @@ export async function deployAccount(account, wait, registerClass, publicDeploy,
64
65
  printGasEstimates(feeOpts, gas, log);
65
66
  }
66
67
  } else {
67
- tx = account.deploy(deployOpts);
68
+ const provenTx = await deployMethod.prove({
69
+ ...deployOpts,
70
+ universalDeploy: true,
71
+ contractAddressSalt: salt
72
+ });
73
+ if (verbose) {
74
+ printProfileResult(provenTx.timings, log);
75
+ }
76
+ tx = provenTx.send();
68
77
  const txHash = await tx.getTxHash();
69
78
  debugLogger.debug(`Account contract tx sent with hash ${txHash}`);
70
79
  out.txHash = txHash;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cmds/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAGjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAuBxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,wBAAgB,cAAc,CAC5B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,EACnB,EAAE,CAAC,EAAE,QAAQ,EACb,UAAU,CAAC,EAAE,UAAU,WAopBxB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cmds/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAGjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAwBxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,wBAAgB,cAAc,CAC5B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,EACnB,EAAE,CAAC,EAAE,QAAQ,EACb,UAAU,CAAC,EAAE,UAAU,WA4qBxB"}
@@ -8,7 +8,7 @@ import { Option } from 'commander';
8
8
  import inquirer from 'inquirer';
9
9
  import { createOrRetrieveAccount } from '../utils/accounts.js';
10
10
  import { FeeOpts, FeeOptsWithFeePayer } from '../utils/options/fees.js';
11
- import { ARTIFACT_DESCRIPTION, aliasedAddressParser, aliasedSecretKeyParser, aliasedTxHashParser, artifactPathFromPromiseOrAlias, artifactPathParser, cleanupAuthWitnesses, createAccountOption, createAliasOption, createArgsOption, createArtifactOption, createAuthwitnessOption, createContractAddressOption, createDebugExecutionStepsDirOption, createTypeOption, integerArgParser, parseGasFees, parsePaymentMethod } from '../utils/options/index.js';
11
+ import { ARTIFACT_DESCRIPTION, aliasedAddressParser, aliasedSecretKeyParser, aliasedTxHashParser, artifactPathFromPromiseOrAlias, artifactPathParser, cleanupAuthWitnesses, createAccountOption, createAliasOption, createArgsOption, createArtifactOption, createAuthwitnessOption, createContractAddressOption, createDebugExecutionStepsDirOption, createTypeOption, createVerboseOption, integerArgParser, parseGasFees, parsePaymentMethod } from '../utils/options/index.js';
12
12
  export function injectCommands(program, log, debugLogger, db, pxeWrapper) {
13
13
  program.command('import-test-accounts').description('Import test accounts from pxe.').addOption(pxeOption).option('--json', 'Emit output as json').action(async (options)=>{
14
14
  if (!db) {
@@ -21,11 +21,11 @@ export function injectCommands(program, log, debugLogger, db, pxeWrapper) {
21
21
  });
22
22
  const createAccountCommand = program.command('create-account').description('Creates an aztec account that can be used for sending transactions. Registers the account on the PXE and deploys an account contract. Uses a Schnorr single-key account which uses the same key for encryption and authentication (not secure for production usage).').summary('Creates an aztec account that can be used for sending transactions.').option('--skip-initialization', 'Skip initializing the account contract. Useful for publicly deploying an existing account.').option('--public-deploy', 'Publicly deploys the account and registers the class if needed.').option('-p, --public-key <string>', 'Public key that identifies a private signing key stored outside of the wallet. Used for ECDSA SSH accounts over the secp256r1 curve.').addOption(pxeOption).addOption(createSecretKeyOption('Secret key for account. Uses random by default.', false, (sk)=>aliasedSecretKeyParser(sk, db)).conflicts('public-key')).addOption(createAliasOption('Alias for the account. Used for easy reference in subsequent commands.', !db)).addOption(createTypeOption(true)).option('--register-only', 'Just register the account on the PXE. Do not deploy or initialize the account contract.').option('--json', 'Emit output as json')// `options.wait` is default true. Passing `--no-wait` will set it to false.
23
23
  // https://github.com/tj/commander.js#other-option-types-negatable-boolean-and-booleanvalue
24
- .option('--no-wait', 'Skip waiting for the contract to be deployed. Print the hash of deployment transaction');
24
+ .option('--no-wait', 'Skip waiting for the contract to be deployed. Print the hash of deployment transaction').addOption(createVerboseOption());
25
25
  addOptions(createAccountCommand, FeeOptsWithFeePayer.getOptions()).action(async (_options, command)=>{
26
26
  const { createAccount } = await import('./create_account.js');
27
27
  const options = command.optsWithGlobals();
28
- const { type, secretKey, wait, registerOnly, skipInitialization, publicDeploy, rpcUrl, alias, json } = options;
28
+ const { type, secretKey, wait, registerOnly, skipInitialization, publicDeploy, rpcUrl, alias, json, verbose } = options;
29
29
  let { publicKey } = options;
30
30
  if (type === 'ecdsasecp256r1ssh' && !publicKey) {
31
31
  const identities = await getIdentities();
@@ -40,7 +40,7 @@ export function injectCommands(program, log, debugLogger, db, pxeWrapper) {
40
40
  publicKey = answers.identity.split(' ')[1];
41
41
  }
42
42
  const client = await pxeWrapper?.getPXE() ?? await createCompatibleClient(rpcUrl, debugLogger);
43
- const accountCreationResult = await createAccount(client, type, secretKey, publicKey, alias, registerOnly, skipInitialization, publicDeploy, wait, await FeeOptsWithFeePayer.fromCli(options, client, log, db), json, debugLogger, log);
43
+ const accountCreationResult = await createAccount(client, type, secretKey, publicKey, alias, registerOnly, skipInitialization, publicDeploy, wait, await FeeOptsWithFeePayer.fromCli(options, client, log, db), json, verbose, debugLogger, log);
44
44
  if (db) {
45
45
  const { address, alias, secretKey, salt } = accountCreationResult;
46
46
  await db.storeAccount(address, {
@@ -54,59 +54,60 @@ export function injectCommands(program, log, debugLogger, db, pxeWrapper) {
54
54
  });
55
55
  const deployAccountCommand = program.command('deploy-account').description('Deploys an already registered aztec account that can be used for sending transactions.').addOption(createAccountOption('Alias or address of the account to deploy', !db, db)).addOption(pxeOption).option('--json', 'Emit output as json')// `options.wait` is default true. Passing `--no-wait` will set it to false.
56
56
  // https://github.com/tj/commander.js#other-option-types-negatable-boolean-and-booleanvalue
57
- .option('--no-wait', 'Skip waiting for the contract to be deployed. Print the hash of deployment transaction').option('--register-class', 'Register the contract class (useful for when the contract class has not been deployed yet).').option('--public-deploy', 'Publicly deploy this account contract (only useful if it contains public functions');
57
+ .option('--no-wait', 'Skip waiting for the contract to be deployed. Print the hash of deployment transaction').option('--register-class', 'Register the contract class (useful for when the contract class has not been deployed yet).').option('--public-deploy', 'Publicly deploy this account contract (only useful if it contains public functions').addOption(createVerboseOption());
58
58
  addOptions(deployAccountCommand, FeeOptsWithFeePayer.getOptions()).action(async (_options, command)=>{
59
59
  const { deployAccount } = await import('./deploy_account.js');
60
60
  const options = command.optsWithGlobals();
61
- const { rpcUrl, wait, from: parsedFromAddress, json, registerClass, publicDeploy } = options;
61
+ const { rpcUrl, wait, from: parsedFromAddress, json, registerClass, publicDeploy, verbose } = options;
62
62
  const client = await pxeWrapper?.getPXE() ?? await createCompatibleClient(rpcUrl, debugLogger);
63
63
  const account = await createOrRetrieveAccount(client, parsedFromAddress, db);
64
- await deployAccount(account, wait, registerClass, publicDeploy, await FeeOptsWithFeePayer.fromCli(options, client, log, db), json, debugLogger, log);
64
+ await deployAccount(account, wait, registerClass, publicDeploy, await FeeOptsWithFeePayer.fromCli(options, client, log, db), json, verbose, debugLogger, log);
65
65
  });
66
66
  const deployCommand = program.command('deploy').description('Deploys a compiled Aztec.nr contract to Aztec.').argument('[artifact]', ARTIFACT_DESCRIPTION, artifactPathParser).option('--init <string>', 'The contract initializer function to call', 'constructor').option('--no-init', 'Leave the contract uninitialized').option('-k, --public-key <string>', 'Optional encryption public key for this address. Set this value only if this contract is expected to receive private notes, which will be encrypted using this public key.', parsePublicKey).option('-s, --salt <hex string>', 'Optional deployment salt as a hex string for generating the deployment address.', parseFieldFromHexString).option('--universal', 'Do not mix the sender address into the deployment.').addOption(pxeOption).addOption(createArgsOption(true, db)).addOption(createSecretKeyOption("The sender's secret key", !db, (sk)=>aliasedSecretKeyParser(sk, db)).conflicts('account')).addOption(createAccountOption('Alias or address of the account to deploy from', !db, db)).addOption(createAliasOption('Alias for the contract. Used for easy reference subsequent commands.', !db)).option('--json', 'Emit output as json')// `options.wait` is default true. Passing `--no-wait` will set it to false.
67
67
  // https://github.com/tj/commander.js#other-option-types-negatable-boolean-and-booleanvalue
68
- .option('--no-wait', 'Skip waiting for the contract to be deployed. Print the hash of deployment transaction').option('--no-class-registration', "Don't register this contract class").option('--no-public-deployment', "Don't emit this contract's public bytecode");
68
+ .option('--no-wait', 'Skip waiting for the contract to be deployed. Print the hash of deployment transaction').option('--no-class-registration', "Don't register this contract class").option('--no-public-deployment', "Don't emit this contract's public bytecode").addOption(createVerboseOption());
69
69
  addOptions(deployCommand, FeeOpts.getOptions()).action(async (artifactPathPromise, _options, command)=>{
70
70
  const { deploy } = await import('./deploy.js');
71
71
  const options = command.optsWithGlobals();
72
- const { json, publicKey, args, salt, wait, secretKey, classRegistration, init, publicDeployment, universal, rpcUrl, from: parsedFromAddress, alias } = options;
72
+ const { json, publicKey, args, salt, wait, secretKey, classRegistration, init, publicDeployment, universal, rpcUrl, from: parsedFromAddress, alias, verbose } = options;
73
73
  const client = await pxeWrapper?.getPXE() ?? await createCompatibleClient(rpcUrl, debugLogger);
74
74
  const account = await createOrRetrieveAccount(client, parsedFromAddress, db, secretKey);
75
75
  const wallet = await account.getWallet();
76
76
  const artifactPath = await artifactPathPromise;
77
77
  debugLogger.info(`Using wallet with address ${wallet.getCompleteAddress().address.toString()}`);
78
- const address = await deploy(wallet, artifactPath, json, publicKey, args, salt, typeof init === 'string' ? init : undefined, !publicDeployment, !classRegistration, typeof init === 'string' ? false : init, universal, wait, await FeeOpts.fromCli(options, client, log, db), debugLogger, log, logJson(log));
78
+ const address = await deploy(wallet, artifactPath, json, publicKey, args, salt, typeof init === 'string' ? init : undefined, !publicDeployment, !classRegistration, typeof init === 'string' ? false : init, universal, wait, await FeeOpts.fromCli(options, client, log, db), verbose, debugLogger, log, logJson(log));
79
79
  if (db && address) {
80
80
  await db.storeContract(address, artifactPath, log, alias);
81
81
  }
82
82
  });
83
- const sendCommand = program.command('send').description('Calls a function on an Aztec contract.').argument('<functionName>', 'Name of function to execute').addOption(pxeOption).addOption(createArgsOption(false, db)).addOption(createArtifactOption(db)).addOption(createContractAddressOption(db)).addOption(createAliasOption('Alias for the transaction hash. Used for easy reference in subsequent commands.', !db)).addOption(createSecretKeyOption("The sender's secret key", !db, (sk)=>aliasedSecretKeyParser(sk, db)).conflicts('account')).addOption(createAuthwitnessOption('Authorization witness to use for the transaction. If using multiple, pass a comma separated string', !db, db)).addOption(createAccountOption('Alias or address of the account to send the transaction from', !db, db)).option('--no-wait', 'Print transaction hash without waiting for it to be mined').option('--no-cancel', 'Do not allow the transaction to be cancelled. This makes for cheaper transactions.');
83
+ const sendCommand = program.command('send').description('Calls a function on an Aztec contract.').argument('<functionName>', 'Name of function to execute').addOption(pxeOption).addOption(createArgsOption(false, db)).addOption(createArtifactOption(db)).addOption(createContractAddressOption(db)).addOption(createAliasOption('Alias for the transaction hash. Used for easy reference in subsequent commands.', !db)).addOption(createSecretKeyOption("The sender's secret key", !db, (sk)=>aliasedSecretKeyParser(sk, db)).conflicts('account')).addOption(createAuthwitnessOption('Authorization witness to use for the transaction. If using multiple, pass a comma separated string', !db, db)).addOption(createAccountOption('Alias or address of the account to send the transaction from', !db, db)).option('--no-wait', 'Print transaction hash without waiting for it to be mined').option('--no-cancel', 'Do not allow the transaction to be cancelled. This makes for cheaper transactions.').addOption(createVerboseOption());
84
84
  addOptions(sendCommand, FeeOpts.getOptions()).action(async (functionName, _options, command)=>{
85
85
  const { send } = await import('./send.js');
86
86
  const options = command.optsWithGlobals();
87
- const { args, contractArtifact: artifactPathPromise, contractAddress, from: parsedFromAddress, wait, rpcUrl, secretKey, alias, cancel, authWitness: authWitnessArray } = options;
87
+ const { args, contractArtifact: artifactPathPromise, contractAddress, from: parsedFromAddress, wait, rpcUrl, secretKey, alias, cancel, authWitness: authWitnessArray, verbose } = options;
88
88
  const client = await pxeWrapper?.getPXE() ?? await createCompatibleClient(rpcUrl, debugLogger);
89
89
  const account = await createOrRetrieveAccount(client, parsedFromAddress, db, secretKey);
90
90
  const wallet = await account.getWallet();
91
91
  const artifactPath = await artifactPathFromPromiseOrAlias(artifactPathPromise, contractAddress, db);
92
92
  debugLogger.info(`Using wallet with address ${wallet.getCompleteAddress().address.toString()}`);
93
93
  const authWitnesses = cleanupAuthWitnesses(authWitnessArray);
94
- const sentTx = await send(wallet, functionName, args, artifactPath, contractAddress, wait, cancel, await FeeOpts.fromCli(options, client, log, db), authWitnesses, log);
94
+ const sentTx = await send(wallet, functionName, args, artifactPath, contractAddress, wait, cancel, await FeeOpts.fromCli(options, client, log, db), authWitnesses, verbose, log);
95
95
  if (db && sentTx) {
96
96
  const txAlias = alias ? alias : `${functionName}-${sentTx.nonce.toString().slice(-4)}`;
97
97
  await db.storeTx(sentTx, log, txAlias);
98
98
  }
99
99
  });
100
- program.command('simulate').description('Simulates the execution of a function on an Aztec contract.').argument('<functionName>', 'Name of function to simulate').addOption(pxeOption).addOption(createArgsOption(false, db)).addOption(createContractAddressOption(db)).addOption(createArtifactOption(db)).addOption(createSecretKeyOption("The sender's secret key", !db, (sk)=>aliasedSecretKeyParser(sk, db)).conflicts('account')).addOption(createAuthwitnessOption('Authorization witness to use for the simulation', !db, db)).addOption(createAccountOption('Alias or address of the account to simulate from', !db, db)).action(async (functionName, _options, command)=>{
100
+ const simulateCommand = program.command('simulate').description('Simulates the execution of a function on an Aztec contract.').argument('<functionName>', 'Name of function to simulate').addOption(pxeOption).addOption(createArgsOption(false, db)).addOption(createContractAddressOption(db)).addOption(createArtifactOption(db)).addOption(createSecretKeyOption("The sender's secret key", !db, (sk)=>aliasedSecretKeyParser(sk, db)).conflicts('account')).addOption(createAuthwitnessOption('Authorization witness to use for the simulation', !db, db)).addOption(createAccountOption('Alias or address of the account to simulate from', !db, db)).addOption(createVerboseOption());
101
+ addOptions(simulateCommand, FeeOpts.getOptions()).action(async (functionName, _options, command)=>{
101
102
  const { simulate } = await import('./simulate.js');
102
103
  const options = command.optsWithGlobals();
103
- const { args, contractArtifact: artifactPathPromise, contractAddress, from: parsedFromAddress, rpcUrl, secretKey, authWitness } = options;
104
+ const { args, contractArtifact: artifactPathPromise, contractAddress, from: parsedFromAddress, rpcUrl, secretKey, verbose, authWitness } = options;
104
105
  const client = await pxeWrapper?.getPXE() ?? await createCompatibleClient(rpcUrl, debugLogger);
105
106
  const account = await createOrRetrieveAccount(client, parsedFromAddress, db, secretKey);
106
107
  const wallet = await account.getWallet();
107
108
  const artifactPath = await artifactPathFromPromiseOrAlias(artifactPathPromise, contractAddress, db);
108
109
  const authWitnesses = cleanupAuthWitnesses(authWitness);
109
- await simulate(wallet, functionName, args, artifactPath, contractAddress, authWitnesses, log);
110
+ await simulate(wallet, functionName, args, artifactPath, contractAddress, await FeeOpts.fromCli(options, client, log, db), authWitnesses, verbose, log);
110
111
  });
111
112
  const profileCommand = program.command('profile').description('Profiles a private function by counting the unconditional operations in its execution steps').argument('<functionName>', 'Name of function to simulate').addOption(pxeOption).addOption(createArgsOption(false, db)).addOption(createContractAddressOption(db)).addOption(createArtifactOption(db)).addOption(createDebugExecutionStepsDirOption()).addOption(createSecretKeyOption("The sender's secret key", !db, (sk)=>aliasedSecretKeyParser(sk, db)).conflicts('account')).addOption(createAuthwitnessOption('Authorization witness to use for the simulation', !db, db)).addOption(createAccountOption('Alias or address of the account to simulate from', !db, db));
112
113
  addOptions(profileCommand, FeeOpts.getOptions()).action(async (functionName, _options, command)=>{
@@ -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;AAQnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AA0DzD,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,OAAO,EAAE,QAAQ,EACjB,aAAa,EAAE,WAAW,EAAE,EAC5B,GAAG,EAAE,KAAK,iBAmBX"}
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;AAMnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGzD,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,OAAO,EAAE,QAAQ,EACjB,aAAa,EAAE,WAAW,EAAE,EAC5B,GAAG,EAAE,KAAK,iBAmBX"}
@@ -3,27 +3,7 @@ import { prepTx } from '@aztec/cli/utils';
3
3
  import { serializePrivateExecutionSteps } from '@aztec/stdlib/kernel';
4
4
  import { promises as fs } from 'fs';
5
5
  import path from 'path';
6
- import { format } from 'util';
7
- function printProfileResult(result, log) {
8
- log(format('\nPer circuit breakdown:\n'));
9
- log(format(' ', 'Function name'.padEnd(50), 'Time'.padStart(13).padEnd(15), 'Gates'.padStart(13).padEnd(15), 'Subtotal'.padStart(13).padEnd(15)));
10
- log(format(''.padEnd(50 + 15 + 15 + 15 + 15, '-')));
11
- let acc = 0;
12
- let biggest = result.executionSteps[0] ?? 0;
13
- result.executionSteps.forEach((r)=>{
14
- if (r.gateCount > biggest.gateCount) {
15
- biggest = r;
16
- }
17
- acc += r.gateCount;
18
- log(format(' ', r.functionName.padEnd(50), `${r.timings.witgen.toFixed(2)}ms`.padStart(13).padEnd(15), r.gateCount.toLocaleString().padStart(13).padEnd(15), acc.toLocaleString().padStart(15)));
19
- });
20
- log(format('\nTotal gates:', acc.toLocaleString(), `(Biggest circuit: ${biggest.functionName} -> ${biggest.gateCount.toLocaleString()})`));
21
- log(format('\nSync time:'.padEnd(25), `${result.timings.sync?.toFixed(2)}ms`.padStart(16)));
22
- log(format('Total simulation time:'.padEnd(25), `${result.timings.perFunction.reduce((acc, { time })=>acc + time, 0).toFixed(2)}ms`.padStart(15)));
23
- log(format('Proving time:'.padEnd(25), `${result.timings.proving?.toFixed(2)}ms`.padStart(15)));
24
- log(format('Total time:'.padEnd(25), `${result.timings.total.toFixed(2)}ms`.padStart(15), `(${result.timings.unaccounted.toFixed(2)}ms unaccounted)`));
25
- log('\n');
26
- }
6
+ import { printProfileResult } from '../utils/profiling.js';
27
7
  export async function profile(wallet, functionName, functionArgsIn, contractArtifactPath, contractAddress, debugOutputPath, feeOpts, authWitnesses, log) {
28
8
  const { functionArgs, contractArtifact } = await prepTx(contractArtifactPath, functionName, functionArgsIn, log);
29
9
  const contract = await Contract.at(contractAddress, contractArtifact, wallet);
@@ -34,7 +14,7 @@ export async function profile(wallet, functionName, functionArgsIn, contractArti
34
14
  authWitnesses,
35
15
  skipProofGeneration: false
36
16
  });
37
- printProfileResult(result, log);
17
+ printProfileResult(result.timings, log, result.executionSteps);
38
18
  if (debugOutputPath) {
39
19
  const ivcInputsPath = path.join(debugOutputPath, 'ivc-inputs.msgpack');
40
20
  log(`Debug output written to ${ivcInputsPath}.`);
@@ -1,4 +1,4 @@
1
1
  import { type AccountWalletWithSecretKey, type AztecAddress, type AztecNode, type Fr, PublicKeys } from '@aztec/aztec.js';
2
2
  import type { LogFn } from '@aztec/foundation/log';
3
- export declare function registerContract(wallet: AccountWalletWithSecretKey, node: AztecNode, address: AztecAddress, artifactPath: string, log: LogFn, initializer?: string, publicKeys?: PublicKeys, rawArgs?: any[], salt?: Fr, deployer?: AztecAddress | undefined): Promise<import("@aztec/aztec.js").ContractInstanceWithAddress>;
3
+ export declare function registerContract(wallet: AccountWalletWithSecretKey, node: AztecNode, address: AztecAddress, artifactPath: string, log: LogFn, initializer?: string, publicKeys?: PublicKeys, rawArgs?: any[], salt?: Fr, deployer?: AztecAddress): Promise<import("@aztec/aztec.js").ContractInstanceWithAddress>;
4
4
  //# sourceMappingURL=register_contract.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"register_contract.d.ts","sourceRoot":"","sources":["../../src/cmds/register_contract.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,EAAE,EACP,UAAU,EAEX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,0BAA0B,EAClC,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,YAAY,EACrB,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,KAAK,EACV,WAAW,CAAC,EAAE,MAAM,EACpB,UAAU,CAAC,EAAE,UAAU,EACvB,OAAO,CAAC,EAAE,GAAG,EAAE,EACf,IAAI,CAAC,EAAE,EAAE,EACT,QAAQ,CAAC,EAAE,YAAY,GAAG,SAAS,kEAsBpC"}
1
+ {"version":3,"file":"register_contract.d.ts","sourceRoot":"","sources":["../../src/cmds/register_contract.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,EAAE,EACP,UAAU,EAEX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,0BAA0B,EAClC,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,YAAY,EACrB,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,KAAK,EACV,WAAW,CAAC,EAAE,MAAM,EACpB,UAAU,CAAC,EAAE,UAAU,EACvB,OAAO,CAAC,EAAE,GAAG,EAAE,EACf,IAAI,CAAC,EAAE,EAAE,EACT,QAAQ,CAAC,EAAE,YAAY,kEAsBxB"}
@@ -2,7 +2,7 @@ import { type AccountWalletWithSecretKey, AuthWitness, type AztecAddress, Fr } f
2
2
  import type { LogFn } from '@aztec/foundation/log';
3
3
  import { GasSettings } from '@aztec/stdlib/gas';
4
4
  import { type IFeeOpts } from '../utils/options/fees.js';
5
- export declare function send(wallet: AccountWalletWithSecretKey, functionName: string, functionArgsIn: any[], contractArtifactPath: string, contractAddress: AztecAddress, wait: boolean, cancellable: boolean, feeOpts: IFeeOpts, authWitnesses: AuthWitness[], log: LogFn): Promise<{
5
+ export declare function send(wallet: AccountWalletWithSecretKey, functionName: string, functionArgsIn: any[], contractArtifactPath: string, contractAddress: AztecAddress, wait: boolean, cancellable: boolean, feeOpts: IFeeOpts, authWitnesses: AuthWitness[], verbose: boolean, log: LogFn): Promise<{
6
6
  txHash: import("@aztec/aztec.js").TxHash;
7
7
  nonce: Fr;
8
8
  cancellable: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../src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E,KAAK;;;;;eA0DX"}
package/dest/cmds/send.js CHANGED
@@ -2,7 +2,8 @@ import { Contract, Fr } from '@aztec/aztec.js';
2
2
  import { prepTx } from '@aztec/cli/utils';
3
3
  import { GasSettings } from '@aztec/stdlib/gas';
4
4
  import { printGasEstimates } from '../utils/options/fees.js';
5
- export async function send(wallet, functionName, functionArgsIn, contractArtifactPath, contractAddress, wait, cancellable, feeOpts, authWitnesses, log) {
5
+ import { printProfileResult } from '../utils/profiling.js';
6
+ export async function send(wallet, functionName, functionArgsIn, contractArtifactPath, contractAddress, wait, cancellable, feeOpts, authWitnesses, verbose, log) {
6
7
  const { functionArgs, contractArtifact } = await prepTx(contractArtifactPath, functionName, functionArgsIn, log);
7
8
  const contract = await Contract.at(contractAddress, contractArtifact, wallet);
8
9
  const call = contract.methods[functionName](...functionArgs);
@@ -18,7 +19,11 @@ export async function send(wallet, functionName, functionArgsIn, contractArtifac
18
19
  if (feeOpts.estimateOnly) {
19
20
  return;
20
21
  }
21
- const tx = call.send(sendOptions);
22
+ const provenTx = await call.prove(sendOptions);
23
+ if (verbose) {
24
+ printProfileResult(provenTx.timings, log);
25
+ }
26
+ const tx = provenTx.send();
22
27
  const txHash = await tx.getTxHash();
23
28
  log(`\nTransaction hash: ${txHash.toString()}`);
24
29
  if (wait) {
@@ -1,4 +1,5 @@
1
1
  import { type AccountWalletWithSecretKey, AuthWitness, type AztecAddress } from '@aztec/aztec.js';
2
2
  import type { LogFn } from '@aztec/foundation/log';
3
- export declare function simulate(wallet: AccountWalletWithSecretKey, functionName: string, functionArgsIn: any[], contractArtifactPath: string, contractAddress: AztecAddress, authWitnesses: AuthWitness[], log: LogFn): Promise<void>;
3
+ import type { IFeeOpts } from '../utils/options/fees.js';
4
+ export declare function simulate(wallet: AccountWalletWithSecretKey, functionName: string, functionArgsIn: any[], contractArtifactPath: string, contractAddress: AztecAddress, feeOpts: IFeeOpts, authWitnesses: AuthWitness[], verbose: boolean, log: LogFn): Promise<void>;
4
5
  //# sourceMappingURL=simulate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"simulate.d.ts","sourceRoot":"","sources":["../../src/cmds/simulate.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;AAInD,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,0BAA0B,EAClC,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,GAAG,EAAE,EACrB,oBAAoB,EAAE,MAAM,EAC5B,eAAe,EAAE,YAAY,EAC7B,aAAa,EAAE,WAAW,EAAE,EAC5B,GAAG,EAAE,KAAK,iBAQX"}
1
+ {"version":3,"file":"simulate.d.ts","sourceRoot":"","sources":["../../src/cmds/simulate.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;AAInD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGzD,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,0BAA0B,EAClC,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,GAAG,EAAE,EACrB,oBAAoB,EAAE,MAAM,EAC5B,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,QAAQ,EACjB,aAAa,EAAE,WAAW,EAAE,EAC5B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,KAAK,iBAeX"}
@@ -1,12 +1,18 @@
1
1
  import { Contract } from '@aztec/aztec.js';
2
2
  import { prepTx } from '@aztec/cli/utils';
3
3
  import { format } from 'util';
4
- export async function simulate(wallet, functionName, functionArgsIn, contractArtifactPath, contractAddress, authWitnesses, log) {
4
+ import { printProfileResult } from '../utils/profiling.js';
5
+ export async function simulate(wallet, functionName, functionArgsIn, contractArtifactPath, contractAddress, feeOpts, authWitnesses, verbose, log) {
5
6
  const { functionArgs, contractArtifact } = await prepTx(contractArtifactPath, functionName, functionArgsIn, log);
6
7
  const contract = await Contract.at(contractAddress, contractArtifact, wallet);
7
8
  const call = contract.methods[functionName](...functionArgs);
8
- const result = await call.simulate({
9
- authWitnesses
9
+ const simulationResult = await call.simulate({
10
+ ...await feeOpts.toSendOpts(wallet),
11
+ authWitnesses,
12
+ includeMetadata: true
10
13
  });
11
- log(format('\nSimulation result: ', result, '\n'));
14
+ if (verbose) {
15
+ printProfileResult(simulationResult.meta.timings, log);
16
+ }
17
+ log(format('\nSimulation result: ', simulationResult.result, '\n'));
12
18
  }
@@ -1,5 +1,3 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
3
1
  import { Fr } from '@aztec/foundation/fields';
4
2
  import type { LogFn } from '@aztec/foundation/log';
5
3
  import type { AztecAsyncKVStore } from '@aztec/kv-store';
@@ -53,7 +51,7 @@ export declare class WalletDB {
53
51
  value: string;
54
52
  }[]>;
55
53
  storeAccountMetadata(aliasOrAddress: AztecAddress | string, metadataKey: string, metadata: Buffer): Promise<void>;
56
- retrieveAccountMetadata(aliasOrAddress: AztecAddress | string, metadataKey: string): Promise<Buffer>;
54
+ retrieveAccountMetadata(aliasOrAddress: AztecAddress | string, metadataKey: string): Promise<Buffer<ArrayBufferLike>>;
57
55
  retrieveAccount(address: AztecAddress | string): Promise<{
58
56
  address: string | AztecAddress;
59
57
  secretKey: Fr;
@@ -1 +1 @@
1
- {"version":3,"file":"wallet_db.d.ts","sourceRoot":"","sources":["../../src/storage/wallet_db.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB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,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM;IAarF,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM;IAUjE,OAAO,CACX,EACE,MAAM,EACN,KAAK,EACL,WAAW,EACX,WAAW,GACZ,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,EAAE,CAAC;QAAC,WAAW,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,WAAW,CAAA;KAAE,EAChF,GAAG,EAAE,KAAK,EACV,KAAK,CAAC,EAAE,MAAM;IAcV,cAAc,CAAC,MAAM,EAAE,MAAM;;;;;;IAanC,gBAAgB,CAAC,GAAG,EAAE,MAAM;IAQrB,sBAAsB,CAAC,GAAG,EAAE,MAAM;IAcnC,aAAa,CAAC,GAAG,EAAE,MAAM;IAazB,WAAW,CAAC,IAAI,CAAC,EAAE,SAAS;;;;IAa5B,oBAAoB,CAAC,cAAc,EAAE,YAAY,GAAG,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAKjG,uBAAuB,CAAC,cAAc,EAAE,YAAY,GAAG,MAAM,EAAE,WAAW,EAAE,MAAM;IASlF,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM;;;;;;IAW9C,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK;CAOzE"}
@@ -129,7 +129,7 @@ export class WalletDB {
129
129
  tryRetrieveAlias(arg) {
130
130
  try {
131
131
  return this.retrieveAliasFromCache(arg);
132
- } catch (e) {
132
+ } catch {
133
133
  return arg;
134
134
  }
135
135
  }
@@ -5,5 +5,5 @@ import type { PXE } from '@aztec/stdlib/interfaces/client';
5
5
  import type { WalletDB } from '../storage/wallet_db.js';
6
6
  export declare const AccountTypes: readonly ["schnorr", "ecdsasecp256r1", "ecdsasecp256r1ssh", "ecdsasecp256k1"];
7
7
  export type AccountType = (typeof AccountTypes)[number];
8
- export declare function createOrRetrieveAccount(pxe: PXE, address?: AztecAddress, db?: WalletDB, secretKey?: Fr, type?: AccountType, salt?: Fr, publicKey?: string | undefined): Promise<AccountManager>;
8
+ export declare function createOrRetrieveAccount(pxe: PXE, address?: AztecAddress, db?: WalletDB, secretKey?: Fr, type?: AccountType, salt?: Fr, publicKey?: string): Promise<AccountManager>;
9
9
  //# sourceMappingURL=accounts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/utils/accounts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAG3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGxD,eAAO,MAAM,YAAY,+EAAgF,CAAC;AAC1G,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAExD,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,GAAG,EACR,OAAO,CAAC,EAAE,YAAY,EACtB,EAAE,CAAC,EAAE,QAAQ,EACb,SAAS,CAAC,EAAE,EAAE,EACd,IAAI,GAAE,WAAuB,EAC7B,IAAI,CAAC,EAAE,EAAE,EACT,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,GAC7B,OAAO,CAAC,cAAc,CAAC,CAuDzB"}
1
+ {"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/utils/accounts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAG3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGxD,eAAO,MAAM,YAAY,+EAAgF,CAAC;AAC1G,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAExD,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,GAAG,EACR,OAAO,CAAC,EAAE,YAAY,EACtB,EAAE,CAAC,EAAE,QAAQ,EACb,SAAS,CAAC,EAAE,EAAE,EACd,IAAI,GAAE,WAAuB,EAC7B,IAAI,CAAC,EAAE,EAAE,EACT,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,cAAc,CAAC,CAuDzB"}
@@ -1,4 +1,2 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
3
1
  export declare function extractECDSAPublicKeyFromBase64String(base64PublicKey: string): Buffer;
4
2
  //# sourceMappingURL=ecdsa.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ecdsa.d.ts","sourceRoot":"","sources":["../../src/utils/ecdsa.ts"],"names":[],"mappings":";;AAAA,wBAAgB,qCAAqC,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAcrF"}
1
+ {"version":3,"file":"ecdsa.d.ts","sourceRoot":"","sources":["../../src/utils/ecdsa.ts"],"names":[],"mappings":"AAAA,wBAAgB,qCAAqC,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAcrF"}
@@ -1 +1 @@
1
- {"version":3,"file":"fees.d.ts","sourceRoot":"","sources":["../../../src/utils/options/fees.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,oBAAoB,EAEzB,KAAK,gBAAgB,EACrB,KAAK,GAAG,E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iBAAiB,CAAC;IAU7D,mBAAmB,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAa/E,MAAM,CAAC,mBAAmB;IAI1B,MAAM,CAAC,UAAU;WAIJ,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,QAAQ;CAsB3E;AAED,qBAAa,mBAAoB,SAAQ,OAAO;WAC9B,mBAAmB;WAInB,UAAU;WAIJ,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,QAAQ;CA2BpF;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,mBAAmB,EAAE,OAAO,EAC5B,GAAG,EAAE,KAAK,EACV,EAAE,CAAC,EAAE,QAAQ,GACZ,CAAC,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAoFtD;AAyBD,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAkBrD"}
@@ -15,6 +15,7 @@ export declare function createTypeOption(mandatory: boolean): Option;
15
15
  export declare function createArgsOption(isConstructor: boolean, db?: WalletDB): Option;
16
16
  export declare function createContractAddressOption(db?: WalletDB): Option;
17
17
  export declare function createDebugExecutionStepsDirOption(): Option;
18
+ export declare function createVerboseOption(): Option;
18
19
  export declare function artifactPathParser(filePath: string, db?: WalletDB): Promise<string>;
19
20
  export declare function artifactPathFromPromiseOrAlias(artifactPathPromise: Promise<string>, contractAddress: AztecAddress, db?: WalletDB): Promise<string>;
20
21
  export declare function createArtifactOption(db?: WalletDB): Option;
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/utils/options/options.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KA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