@aztec/cli-wallet 0.0.1-commit.023c3e5 → 0.0.1-commit.033589e
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/cmds/authorize_action.d.ts +2 -2
- package/dest/cmds/authorize_action.d.ts.map +1 -1
- package/dest/cmds/check_tx.js +2 -1
- package/dest/cmds/create_account.d.ts +1 -1
- package/dest/cmds/create_account.d.ts.map +1 -1
- package/dest/cmds/create_account.js +21 -13
- package/dest/cmds/deploy.d.ts +1 -1
- package/dest/cmds/deploy.d.ts.map +1 -1
- package/dest/cmds/deploy.js +6 -3
- package/dest/cmds/deploy_account.d.ts +1 -1
- package/dest/cmds/deploy_account.d.ts.map +1 -1
- package/dest/cmds/deploy_account.js +21 -13
- package/dest/cmds/index.js +1 -1
- package/dest/cmds/send.d.ts +1 -1
- package/dest/cmds/send.d.ts.map +1 -1
- package/dest/cmds/send.js +6 -3
- package/dest/utils/wallet.d.ts +8 -3
- package/dest/utils/wallet.d.ts.map +1 -1
- package/dest/utils/wallet.js +32 -28
- package/package.json +14 -14
- package/src/cmds/check_tx.ts +1 -1
- package/src/cmds/create_account.ts +14 -9
- package/src/cmds/deploy.ts +6 -3
- package/src/cmds/deploy_account.ts +14 -9
- package/src/cmds/index.ts +1 -1
- package/src/cmds/send.ts +6 -3
- package/src/cmds/simulate.ts +1 -1
- package/src/utils/wallet.ts +53 -46
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
2
|
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
3
3
|
import type { LogFn } from '@aztec/foundation/log';
|
|
4
|
-
export declare function authorizeAction(wallet: Wallet, from: AztecAddress, functionName: string, caller: AztecAddress, functionArgsIn: any[], contractArtifactPath: string, contractAddress: AztecAddress, log: LogFn): Promise<import("@aztec/stdlib/tx").TxReceipt
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
4
|
+
export declare function authorizeAction(wallet: Wallet, from: AztecAddress, functionName: string, caller: AztecAddress, functionArgsIn: any[], contractArtifactPath: string, contractAddress: AztecAddress, log: LogFn): Promise<import("@aztec/aztec.js/contracts").TxSendResultMined<import("@aztec/stdlib/tx").TxReceipt>>;
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yaXplX2FjdGlvbi5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NtZHMvYXV0aG9yaXplX2FjdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUc5RCxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUVyRCxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUluRCx3QkFBc0IsZUFBZSxDQUNuQyxNQUFNLEVBQUUsTUFBTSxFQUNkLElBQUksRUFBRSxZQUFZLEVBQ2xCLFlBQVksRUFBRSxNQUFNLEVBQ3BCLE1BQU0sRUFBRSxZQUFZLEVBQ3BCLGNBQWMsRUFBRSxHQUFHLEVBQUUsRUFDckIsb0JBQW9CLEVBQUUsTUFBTSxFQUM1QixlQUFlLEVBQUUsWUFBWSxFQUM3QixHQUFHLEVBQUUsS0FBSyx3R0E2QlgifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorize_action.d.ts","sourceRoot":"","sources":["../../src/cmds/authorize_action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAInD,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,YAAY,EAClB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,YAAY,EACpB,cAAc,EAAE,GAAG,EAAE,EACrB,oBAAoB,EAAE,MAAM,EAC5B,eAAe,EAAE,YAAY,EAC7B,GAAG,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"authorize_action.d.ts","sourceRoot":"","sources":["../../src/cmds/authorize_action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAInD,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,YAAY,EAClB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,YAAY,EACpB,cAAc,EAAE,GAAG,EAAE,EACrB,oBAAoB,EAAE,MAAM,EAC5B,eAAe,EAAE,YAAY,EAC7B,GAAG,EAAE,KAAK,wGA6BX"}
|
package/dest/cmds/check_tx.js
CHANGED
|
@@ -67,7 +67,8 @@ async function inspectTx(wallet, aztecNode, txHash, log) {
|
|
|
67
67
|
const deployed = deployNullifiers[nullifier.toString()];
|
|
68
68
|
const note = deployed ? (await wallet.getNotes({
|
|
69
69
|
siloedNullifier: nullifier,
|
|
70
|
-
contractAddress: deployed
|
|
70
|
+
contractAddress: deployed,
|
|
71
|
+
scopes: 'ALL_SCOPES'
|
|
71
72
|
}))[0] : undefined;
|
|
72
73
|
const initialized = initNullifiers[nullifier.toString()];
|
|
73
74
|
const registered = classNullifiers[nullifier.toString()];
|
|
@@ -11,4 +11,4 @@ export declare function createAccount(wallet: CLIWallet, aztecNode: AztecNode, a
|
|
|
11
11
|
secretKey: Fr;
|
|
12
12
|
salt: Fr;
|
|
13
13
|
}>;
|
|
14
|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"create_account.d.ts","sourceRoot":"","sources":["../../src/cmds/create_account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,wBAAsB,aAAa,CACjC,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,EAAE,GAAG,SAAS,EACzB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,QAAQ,EAAE,YAAY,GAAG,SAAS,EAClC,YAAY,EAAE,OAAO,EACrB,kBAAkB,EAAE,OAAO,EAC3B,YAAY,EAAE,OAAO,EACrB,aAAa,EAAE,OAAO,EACtB,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK;;;;;GA0HX"}
|
|
@@ -47,13 +47,16 @@ export async function createAccount(wallet, aztecNode, accountType, secretKey, p
|
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
const deployMethod = await account.getDeployMethod();
|
|
50
|
-
const
|
|
50
|
+
const sim = await deployMethod.simulate({
|
|
51
51
|
...deployAccountOpts,
|
|
52
52
|
fee: {
|
|
53
53
|
...deployAccountOpts.fee,
|
|
54
54
|
estimateGas: true
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
|
+
// estimateGas: true guarantees these fields are present
|
|
58
|
+
const estimatedGas = sim.estimatedGas;
|
|
59
|
+
const stats = sim.stats;
|
|
57
60
|
if (feeOpts.estimateOnly) {
|
|
58
61
|
if (json) {
|
|
59
62
|
out.fee = {
|
|
@@ -74,27 +77,32 @@ export async function createAccount(wallet, aztecNode, accountType, secretKey, p
|
|
|
74
77
|
if (!json) {
|
|
75
78
|
log(`\nWaiting for account contract deployment...`);
|
|
76
79
|
}
|
|
77
|
-
const
|
|
80
|
+
const sendOpts = {
|
|
78
81
|
...deployAccountOpts,
|
|
79
82
|
fee: deployAccountOpts.fee ? {
|
|
80
83
|
...deployAccountOpts.fee,
|
|
81
84
|
gasSettings: estimatedGas
|
|
82
|
-
} : undefined
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
} : undefined
|
|
86
|
+
};
|
|
87
|
+
if (wait) {
|
|
88
|
+
const { receipt } = await deployMethod.send({
|
|
89
|
+
...sendOpts,
|
|
90
|
+
wait: {
|
|
91
|
+
timeout: DEFAULT_TX_TIMEOUT_S,
|
|
92
|
+
returnReceipt: true
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
txReceipt = receipt;
|
|
96
|
+
txHash = receipt.txHash;
|
|
92
97
|
out.txReceipt = {
|
|
93
98
|
status: txReceipt.status,
|
|
94
99
|
transactionFee: txReceipt.transactionFee
|
|
95
100
|
};
|
|
96
101
|
} else {
|
|
97
|
-
txHash =
|
|
102
|
+
({ txHash } = await deployMethod.send({
|
|
103
|
+
...sendOpts,
|
|
104
|
+
wait: NO_WAIT
|
|
105
|
+
}));
|
|
98
106
|
}
|
|
99
107
|
debugLogger.debug(`Account contract tx sent with hash ${txHash.toString()}`);
|
|
100
108
|
out.txHash = txHash;
|
package/dest/cmds/deploy.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ import { PublicKeys } from '@aztec/stdlib/keys';
|
|
|
6
6
|
import { CLIFeeArgs } from '../utils/options/fees.js';
|
|
7
7
|
import type { CLIWallet } from '../utils/wallet.js';
|
|
8
8
|
export declare function deploy(wallet: CLIWallet, node: AztecNode, deployer: AztecAddress, artifactPath: string, json: boolean, publicKeys: PublicKeys | undefined, rawArgs: any[], salt: Fr | undefined, initializer: string | undefined, skipInstancePublication: boolean, skipClassPublication: boolean, skipInitialization: boolean | undefined, wait: boolean, feeOpts: CLIFeeArgs, verbose: boolean, timeout: number | undefined, debugLogger: Logger, log: LogFn): Promise<AztecAddress | undefined>;
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVwbG95LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY21kcy9kZXBsb3kudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBSXpELE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUM1QyxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUV0RCxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFFM0QsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBR2hELE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUV0RCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUVwRCx3QkFBc0IsTUFBTSxDQUMxQixNQUFNLEVBQUUsU0FBUyxFQUNqQixJQUFJLEVBQUUsU0FBUyxF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AO,GAAG,SAAS,EACvC,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,OAAO,EAChB,OAAO,oBAA+B,EACtC,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK,qCAqHX"}
|
package/dest/cmds/deploy.js
CHANGED
|
@@ -38,13 +38,16 @@ export async function deploy(wallet, node, deployer, artifactPath, json, publicK
|
|
|
38
38
|
skipInitialization,
|
|
39
39
|
skipInstancePublication
|
|
40
40
|
};
|
|
41
|
-
const
|
|
41
|
+
const sim = await deploy1.simulate({
|
|
42
42
|
...deployOpts,
|
|
43
43
|
fee: {
|
|
44
44
|
...deployOpts.fee,
|
|
45
45
|
estimateGas: true
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
+
// estimateGas: true guarantees these fields are present
|
|
49
|
+
const estimatedGas = sim.estimatedGas;
|
|
50
|
+
const stats = sim.stats;
|
|
48
51
|
if (feeOpts.estimateOnly) {
|
|
49
52
|
if (json) {
|
|
50
53
|
out.fee = {
|
|
@@ -65,7 +68,7 @@ export async function deploy(wallet, node, deployer, artifactPath, json, publicK
|
|
|
65
68
|
const { address, partialAddress } = deploy1;
|
|
66
69
|
const instance = await deploy1.getInstance();
|
|
67
70
|
if (wait) {
|
|
68
|
-
const receipt = await deploy1.send({
|
|
71
|
+
const { receipt } = await deploy1.send({
|
|
69
72
|
...deployOpts,
|
|
70
73
|
wait: {
|
|
71
74
|
timeout,
|
|
@@ -93,7 +96,7 @@ export async function deploy(wallet, node, deployer, artifactPath, json, publicK
|
|
|
93
96
|
};
|
|
94
97
|
}
|
|
95
98
|
} else {
|
|
96
|
-
const txHash = await deploy1.send({
|
|
99
|
+
const { txHash } = await deploy1.send({
|
|
97
100
|
...deployOpts,
|
|
98
101
|
wait: NO_WAIT
|
|
99
102
|
});
|
|
@@ -4,4 +4,4 @@ import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
|
4
4
|
import type { CLIFeeArgs } from '../utils/options/fees.js';
|
|
5
5
|
import type { CLIWallet } from '../utils/wallet.js';
|
|
6
6
|
export declare function deployAccount(wallet: CLIWallet, aztecNode: AztecNode, address: AztecAddress, wait: boolean, deployer: AztecAddress | undefined, registerClass: boolean, publicDeploy: boolean, skipInitialization: boolean, feeOpts: CLIFeeArgs, json: boolean, verbose: boolean, debugLogger: Logger, log: LogFn): Promise<void>;
|
|
7
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVwbG95X2FjY291bnQuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jbWRzL2RlcGxveV9hY2NvdW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUV6RCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUd0RCxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFJM0QsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFFM0QsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFFcEQsd0JBQXNCLGFBQWEsQ0FDakMsTUFBTSxFQUFFLFNBQVMsRUFDakIsU0FBUyxFQUFFLFNBQVMsRUFDcEIsT0FBTyxFQUFFLFlBQVksRUFDckIsSUFBSSxFQUFFLE9BQU8sRUFDYixRQUFRLEVBQUUsWUFBWSxHQUFHLFNBQVMsRUFDbEMsYUFBYSxFQUFFLE9BQU8sRUFDdEIsWUFBWSxFQUFFLE9BQU8sRUFDckIsa0JBQWtCLEVBQUUsT0FBTyxFQUMzQixPQUFPLEVBQUUsVUFBVSxFQUNuQixJQUFJLEVBQUUsT0FBTyxFQUNiLE9BQU8sRUFBRSxPQUFPLEVBQ2hCLFdBQVcsRUFBRSxNQUFNLEVBQ25CLEdBQUcsRUFBRSxLQUFLLGlCQXlHWCJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy_account.d.ts","sourceRoot":"","sources":["../../src/cmds/deploy_account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,wBAAsB,aAAa,CACjC,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE,YAAY,GAAG,SAAS,EAClC,aAAa,EAAE,OAAO,EACtB,YAAY,EAAE,OAAO,EACrB,kBAAkB,EAAE,OAAO,EAC3B,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"deploy_account.d.ts","sourceRoot":"","sources":["../../src/cmds/deploy_account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,wBAAsB,aAAa,CACjC,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE,YAAY,GAAG,SAAS,EAClC,aAAa,EAAE,OAAO,EACtB,YAAY,EAAE,OAAO,EACrB,kBAAkB,EAAE,OAAO,EAC3B,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK,iBAyGX"}
|
|
@@ -38,13 +38,16 @@ export async function deployAccount(wallet, aztecNode, address, wait, deployer,
|
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
const deployMethod = await account.getDeployMethod();
|
|
41
|
-
const
|
|
41
|
+
const sim = await deployMethod.simulate({
|
|
42
42
|
...deployAccountOpts,
|
|
43
43
|
fee: {
|
|
44
44
|
...deployAccountOpts.fee,
|
|
45
45
|
estimateGas: true
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
+
// estimateGas: true guarantees these fields are present
|
|
49
|
+
const estimatedGas = sim.estimatedGas;
|
|
50
|
+
const stats = sim.stats;
|
|
48
51
|
if (feeOpts.estimateOnly) {
|
|
49
52
|
if (json) {
|
|
50
53
|
out.fee = {
|
|
@@ -65,27 +68,32 @@ export async function deployAccount(wallet, aztecNode, address, wait, deployer,
|
|
|
65
68
|
if (!json) {
|
|
66
69
|
log(`\nWaiting for account contract deployment...`);
|
|
67
70
|
}
|
|
68
|
-
const
|
|
71
|
+
const sendOpts = {
|
|
69
72
|
...deployAccountOpts,
|
|
70
73
|
fee: deployAccountOpts.fee ? {
|
|
71
74
|
...deployAccountOpts.fee,
|
|
72
75
|
gasSettings: estimatedGas
|
|
73
|
-
} : undefined
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
} : undefined
|
|
77
|
+
};
|
|
78
|
+
if (wait) {
|
|
79
|
+
const { receipt } = await deployMethod.send({
|
|
80
|
+
...sendOpts,
|
|
81
|
+
wait: {
|
|
82
|
+
timeout: DEFAULT_TX_TIMEOUT_S,
|
|
83
|
+
returnReceipt: true
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
txReceipt = receipt;
|
|
87
|
+
txHash = receipt.txHash;
|
|
83
88
|
out.txReceipt = {
|
|
84
89
|
status: txReceipt.status,
|
|
85
90
|
transactionFee: txReceipt.transactionFee
|
|
86
91
|
};
|
|
87
92
|
} else {
|
|
88
|
-
txHash =
|
|
93
|
+
({ txHash } = await deployMethod.send({
|
|
94
|
+
...sendOpts,
|
|
95
|
+
wait: NO_WAIT
|
|
96
|
+
}));
|
|
89
97
|
}
|
|
90
98
|
debugLogger.debug(`Account contract tx sent with hash ${txHash.toString()}`);
|
|
91
99
|
out.txHash = txHash;
|
package/dest/cmds/index.js
CHANGED
|
@@ -13,7 +13,7 @@ export function injectCommands(program, log, debugLogger, walletAndNodeWrapper,
|
|
|
13
13
|
const { importTestAccounts } = await import('./import_test_accounts.js');
|
|
14
14
|
await importTestAccounts(wallet, db, json, log);
|
|
15
15
|
});
|
|
16
|
-
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
|
|
16
|
+
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 account which uses an immutable key for authentication.').summary('Creates an aztec account that can be used for sending transactions.').addOption(createAccountOption('Alias or address of the account performing the deployment', !db, db)).option('--skip-initialization', 'Skip initializing the account contract. Useful for publicly deploying an existing account.').option('--public-deploy', 'Publishes the account contract instance (and the class, if needed). Needed if the contract contains public functions.').option('--register-class', 'Register the contract class (useful for when the contract class has not been deployed yet).').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(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 Wallet. 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.
|
|
17
17
|
// https://github.com/tj/commander.js#other-option-types-negatable-boolean-and-booleanvalue
|
|
18
18
|
.option('--no-wait', 'Skip waiting for the contract to be deployed. Print the hash of deployment transaction').addOption(createVerboseOption());
|
|
19
19
|
addOptions(createAccountCommand, CLIFeeArgs.getOptions()).action(async (_options, command)=>{
|
package/dest/cmds/send.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ import type { CLIWallet } from '../utils/wallet.js';
|
|
|
7
7
|
export declare function send(wallet: CLIWallet, node: AztecNode, from: AztecAddress, functionName: string, functionArgsIn: any[], contractArtifactPath: string, contractAddress: AztecAddress, wait: boolean, cancellable: boolean, feeOpts: CLIFeeArgs, authWitnesses: AuthWitness[], verbose: boolean, log: LogFn): Promise<{
|
|
8
8
|
txHash: import("@aztec/stdlib/tx").TxHash;
|
|
9
9
|
} | undefined>;
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VuZC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NtZHMvc2VuZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUM5RCxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFFNUQsT0FB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;AAEpD,wBAAsB,IAAI,CACxB,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,YAAY,EAClB,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,GAAG,EAAE,EACrB,oBAAoB,EAAE,MAAM,EAC5B,eAAe,EAAE,YAAY,EAC7B,IAAI,EAAE,OAAO,EACb,WAAW,EAAE,OAAO,EACpB,OAAO,EAAE,UAAU,EACnB,aAAa,EAAE,WAAW,EAAE,EAC5B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,KAAK;;
|
|
1
|
+
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../src/cmds/send.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,wBAAsB,IAAI,CACxB,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,YAAY,EAClB,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,GAAG,EAAE,EACrB,oBAAoB,EAAE,MAAM,EAC5B,eAAe,EAAE,YAAY,EAC7B,IAAI,EAAE,OAAO,EACb,WAAW,EAAE,OAAO,EACpB,OAAO,EAAE,UAAU,EACnB,aAAa,EAAE,WAAW,EAAE,EAC5B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,KAAK;;eAiEX"}
|
package/dest/cmds/send.js
CHANGED
|
@@ -15,13 +15,16 @@ export async function send(wallet, node, from, functionName, functionArgsIn, con
|
|
|
15
15
|
from,
|
|
16
16
|
authWitnesses
|
|
17
17
|
};
|
|
18
|
-
const
|
|
18
|
+
const sim = await call.simulate({
|
|
19
19
|
...sendOptions,
|
|
20
20
|
fee: {
|
|
21
21
|
...sendOptions.fee,
|
|
22
22
|
estimateGas: true
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
|
+
// estimateGas: true guarantees these fields are present
|
|
26
|
+
const estimatedGas = sim.estimatedGas;
|
|
27
|
+
const stats = sim.stats;
|
|
25
28
|
if (feeOpts.estimateOnly) {
|
|
26
29
|
return;
|
|
27
30
|
}
|
|
@@ -30,7 +33,7 @@ export async function send(wallet, node, from, functionName, functionArgsIn, con
|
|
|
30
33
|
}
|
|
31
34
|
if (wait) {
|
|
32
35
|
try {
|
|
33
|
-
const receipt = await call.send({
|
|
36
|
+
const { receipt } = await call.send({
|
|
34
37
|
...sendOptions,
|
|
35
38
|
fee: {
|
|
36
39
|
...sendOptions.fee,
|
|
@@ -55,7 +58,7 @@ export async function send(wallet, node, from, functionName, functionArgsIn, con
|
|
|
55
58
|
throw err;
|
|
56
59
|
}
|
|
57
60
|
} else {
|
|
58
|
-
const txHash = await call.send({
|
|
61
|
+
const { txHash } = await call.send({
|
|
59
62
|
...sendOptions,
|
|
60
63
|
fee: {
|
|
61
64
|
...sendOptions.fee,
|
package/dest/utils/wallet.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ import type { AztecNode } from '@aztec/aztec.js/node';
|
|
|
4
4
|
import { AccountManager, type Aliased, type SimulateOptions } from '@aztec/aztec.js/wallet';
|
|
5
5
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
6
6
|
import type { LogFn } from '@aztec/foundation/log';
|
|
7
|
+
import type { AccessScopes, NotesFilter } from '@aztec/pxe/client/lazy';
|
|
7
8
|
import type { PXEConfig } from '@aztec/pxe/config';
|
|
8
9
|
import type { PXE } from '@aztec/pxe/server';
|
|
9
10
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
10
11
|
import { NoteDao } from '@aztec/stdlib/note';
|
|
11
|
-
import type { NotesFilter } from '@aztec/stdlib/note';
|
|
12
12
|
import type { TxProvingResult, TxSimulationResult } from '@aztec/stdlib/tx';
|
|
13
13
|
import { ExecutionPayload } from '@aztec/stdlib/tx';
|
|
14
|
-
import { BaseWallet } from '@aztec/wallet-sdk/base-wallet';
|
|
14
|
+
import { BaseWallet, type FeeOptions } from '@aztec/wallet-sdk/base-wallet';
|
|
15
15
|
import type { WalletDB } from '../storage/wallet_db.js';
|
|
16
16
|
import type { AccountType } from './constants.js';
|
|
17
17
|
export declare class CLIWallet extends BaseWallet {
|
|
@@ -28,8 +28,13 @@ export declare class CLIWallet extends BaseWallet {
|
|
|
28
28
|
createOrRetrieveAccount(address?: AztecAddress, secretKey?: Fr, type?: AccountType, salt?: Fr, publicKey?: string): Promise<AccountManager>;
|
|
29
29
|
private getFakeAccountDataFor;
|
|
30
30
|
simulateTx(executionPayload: ExecutionPayload, opts: SimulateOptions): Promise<TxSimulationResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Uses a stub account for kernelless simulation, bypassing real account authorization.
|
|
33
|
+
* Falls through to the standard entrypoint path for SignerlessAccount (ZERO address).
|
|
34
|
+
*/
|
|
35
|
+
protected simulateViaEntrypoint(executionPayload: ExecutionPayload, from: AztecAddress, feeOptions: FeeOptions, scopes: AccessScopes, skipTxValidation?: boolean, skipFeeEnforcement?: boolean): Promise<TxSimulationResult>;
|
|
31
36
|
getContracts(): Promise<AztecAddress[]>;
|
|
32
37
|
getNotes(filter: NotesFilter): Promise<NoteDao[]>;
|
|
33
38
|
getContractArtifact(id: Fr): Promise<import("@aztec/stdlib/abi").ContractArtifact | undefined>;
|
|
34
39
|
}
|
|
35
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
40
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2FsbGV0LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbHMvd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CAEhD;IAID,mBAAmB,CAAC,EAAE,EAAE,EAAE,qEAEzB;CACF"}
|
package/dest/utils/wallet.js
CHANGED
|
@@ -48,7 +48,7 @@ export class CLIWallet extends BaseWallet {
|
|
|
48
48
|
}
|
|
49
49
|
async proveCancellationTx(from, txNonce, increasedFee) {
|
|
50
50
|
const cancellationTxRequest = await this.createCancellationTxExecutionRequest(from, txNonce, increasedFee);
|
|
51
|
-
return await this.pxe.proveTx(cancellationTxRequest);
|
|
51
|
+
return await this.pxe.proveTx(cancellationTxRequest, this.scopesFrom(from));
|
|
52
52
|
}
|
|
53
53
|
async getAccountFromAddress(address) {
|
|
54
54
|
let account;
|
|
@@ -147,10 +147,22 @@ export class CLIWallet extends BaseWallet {
|
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
149
|
async simulateTx(executionPayload, opts) {
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
const simulationResults = await super.simulateTx(executionPayload, opts);
|
|
151
|
+
if (opts.fee?.estimateGas) {
|
|
152
|
+
const feeOptions = await this.completeFeeOptions(opts.from, executionPayload.feePayer, opts.fee?.gasSettings);
|
|
153
|
+
const limits = getGasLimits(simulationResults, opts.fee?.estimatedGasPadding);
|
|
154
|
+
printGasEstimates(feeOptions, limits, this.userLog);
|
|
155
|
+
}
|
|
156
|
+
return simulationResults;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Uses a stub account for kernelless simulation, bypassing real account authorization.
|
|
160
|
+
* Falls through to the standard entrypoint path for SignerlessAccount (ZERO address).
|
|
161
|
+
*/ async simulateViaEntrypoint(executionPayload, from, feeOptions, scopes, skipTxValidation, skipFeeEnforcement) {
|
|
162
|
+
if (from.equals(AztecAddress.ZERO)) {
|
|
163
|
+
return super.simulateViaEntrypoint(executionPayload, from, feeOptions, scopes, skipTxValidation, skipFeeEnforcement);
|
|
164
|
+
}
|
|
152
165
|
const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
|
|
153
|
-
const chainInfo = await this.getChainInfo();
|
|
154
166
|
const executionOptions = {
|
|
155
167
|
txNonce: Fr.random(),
|
|
156
168
|
cancellable: this.cancellableTransactions,
|
|
@@ -160,31 +172,23 @@ export class CLIWallet extends BaseWallet {
|
|
|
160
172
|
feeExecutionPayload,
|
|
161
173
|
executionPayload
|
|
162
174
|
]) : executionPayload;
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
artifact
|
|
175
|
+
const { account: fromAccount, instance, artifact } = await this.getFakeAccountDataFor(from);
|
|
176
|
+
const chainInfo = await this.getChainInfo();
|
|
177
|
+
const txRequest = await fromAccount.createTxExecutionRequest(finalExecutionPayload, feeOptions.gasSettings, chainInfo, executionOptions);
|
|
178
|
+
return this.pxe.simulateTx(txRequest, {
|
|
179
|
+
simulatePublic: true,
|
|
180
|
+
skipFeeEnforcement: true,
|
|
181
|
+
skipTxValidation: true,
|
|
182
|
+
overrides: {
|
|
183
|
+
contracts: {
|
|
184
|
+
[from.toString()]: {
|
|
185
|
+
instance,
|
|
186
|
+
artifact
|
|
187
|
+
}
|
|
177
188
|
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
if (opts.fee?.estimateGas) {
|
|
184
|
-
const limits = getGasLimits(simulationResults, opts.fee?.estimatedGasPadding);
|
|
185
|
-
printGasEstimates(feeOptions, limits, this.userLog);
|
|
186
|
-
}
|
|
187
|
-
return simulationResults;
|
|
189
|
+
},
|
|
190
|
+
scopes
|
|
191
|
+
});
|
|
188
192
|
}
|
|
189
193
|
// Exposed because of the `aztec-wallet get-tx` command. It has been decided that it's fine to keep around because
|
|
190
194
|
// this is just a CLI wallet.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/cli-wallet",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.033589e",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/cmds/index.js",
|
|
@@ -67,19 +67,19 @@
|
|
|
67
67
|
]
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@aztec/accounts": "0.0.1-commit.
|
|
71
|
-
"@aztec/aztec.js": "0.0.1-commit.
|
|
72
|
-
"@aztec/bb.js": "0.0.1-commit.
|
|
73
|
-
"@aztec/cli": "0.0.1-commit.
|
|
74
|
-
"@aztec/entrypoints": "0.0.1-commit.
|
|
75
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
76
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
77
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
78
|
-
"@aztec/noir-contracts.js": "0.0.1-commit.
|
|
79
|
-
"@aztec/noir-noirc_abi": "0.0.1-commit.
|
|
80
|
-
"@aztec/pxe": "0.0.1-commit.
|
|
81
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
82
|
-
"@aztec/wallet-sdk": "0.0.1-commit.
|
|
70
|
+
"@aztec/accounts": "0.0.1-commit.033589e",
|
|
71
|
+
"@aztec/aztec.js": "0.0.1-commit.033589e",
|
|
72
|
+
"@aztec/bb.js": "0.0.1-commit.033589e",
|
|
73
|
+
"@aztec/cli": "0.0.1-commit.033589e",
|
|
74
|
+
"@aztec/entrypoints": "0.0.1-commit.033589e",
|
|
75
|
+
"@aztec/ethereum": "0.0.1-commit.033589e",
|
|
76
|
+
"@aztec/foundation": "0.0.1-commit.033589e",
|
|
77
|
+
"@aztec/kv-store": "0.0.1-commit.033589e",
|
|
78
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.033589e",
|
|
79
|
+
"@aztec/noir-noirc_abi": "0.0.1-commit.033589e",
|
|
80
|
+
"@aztec/pxe": "0.0.1-commit.033589e",
|
|
81
|
+
"@aztec/stdlib": "0.0.1-commit.033589e",
|
|
82
|
+
"@aztec/wallet-sdk": "0.0.1-commit.033589e",
|
|
83
83
|
"commander": "^12.1.0",
|
|
84
84
|
"inquirer": "^10.1.8",
|
|
85
85
|
"source-map-support": "^0.5.21",
|
package/src/cmds/check_tx.ts
CHANGED
|
@@ -88,7 +88,7 @@ async function inspectTx(wallet: CLIWallet, aztecNode: AztecNode, txHash: TxHash
|
|
|
88
88
|
for (const nullifier of effects.nullifiers) {
|
|
89
89
|
const deployed = deployNullifiers[nullifier.toString()];
|
|
90
90
|
const note = deployed
|
|
91
|
-
? (await wallet.getNotes({ siloedNullifier: nullifier, contractAddress: deployed }))[0]
|
|
91
|
+
? (await wallet.getNotes({ siloedNullifier: nullifier, contractAddress: deployed, scopes: 'ALL_SCOPES' }))[0]
|
|
92
92
|
: undefined;
|
|
93
93
|
const initialized = initNullifiers[nullifier.toString()];
|
|
94
94
|
const registered = classNullifiers[nullifier.toString()];
|
|
@@ -83,10 +83,13 @@ export async function createAccount(
|
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
const deployMethod = await account.getDeployMethod();
|
|
86
|
-
const
|
|
86
|
+
const sim = await deployMethod.simulate({
|
|
87
87
|
...deployAccountOpts,
|
|
88
88
|
fee: { ...deployAccountOpts.fee, estimateGas: true },
|
|
89
89
|
});
|
|
90
|
+
// estimateGas: true guarantees these fields are present
|
|
91
|
+
const estimatedGas = sim.estimatedGas!;
|
|
92
|
+
const stats = sim.stats!;
|
|
90
93
|
|
|
91
94
|
if (feeOpts.estimateOnly) {
|
|
92
95
|
if (json) {
|
|
@@ -109,7 +112,7 @@ export async function createAccount(
|
|
|
109
112
|
if (!json) {
|
|
110
113
|
log(`\nWaiting for account contract deployment...`);
|
|
111
114
|
}
|
|
112
|
-
const
|
|
115
|
+
const sendOpts = {
|
|
113
116
|
...deployAccountOpts,
|
|
114
117
|
fee: deployAccountOpts.fee
|
|
115
118
|
? {
|
|
@@ -117,18 +120,20 @@ export async function createAccount(
|
|
|
117
120
|
gasSettings: estimatedGas,
|
|
118
121
|
}
|
|
119
122
|
: undefined,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
};
|
|
124
|
+
if (wait) {
|
|
125
|
+
const { receipt } = await deployMethod.send({
|
|
126
|
+
...sendOpts,
|
|
127
|
+
wait: { timeout: DEFAULT_TX_TIMEOUT_S, returnReceipt: true },
|
|
128
|
+
});
|
|
129
|
+
txReceipt = receipt;
|
|
130
|
+
txHash = receipt.txHash;
|
|
126
131
|
out.txReceipt = {
|
|
127
132
|
status: txReceipt.status,
|
|
128
133
|
transactionFee: txReceipt.transactionFee,
|
|
129
134
|
};
|
|
130
135
|
} else {
|
|
131
|
-
txHash =
|
|
136
|
+
({ txHash } = await deployMethod.send({ ...sendOpts, wait: NO_WAIT }));
|
|
132
137
|
}
|
|
133
138
|
debugLogger.debug(`Account contract tx sent with hash ${txHash.toString()}`);
|
|
134
139
|
out.txHash = txHash;
|
package/src/cmds/deploy.ts
CHANGED
|
@@ -71,10 +71,13 @@ export async function deploy(
|
|
|
71
71
|
skipInstancePublication,
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
-
const
|
|
74
|
+
const sim = await deploy.simulate({
|
|
75
75
|
...deployOpts,
|
|
76
76
|
fee: { ...deployOpts.fee, estimateGas: true },
|
|
77
77
|
});
|
|
78
|
+
// estimateGas: true guarantees these fields are present
|
|
79
|
+
const estimatedGas = sim.estimatedGas!;
|
|
80
|
+
const stats = sim.stats!;
|
|
78
81
|
|
|
79
82
|
if (feeOpts.estimateOnly) {
|
|
80
83
|
if (json) {
|
|
@@ -98,7 +101,7 @@ export async function deploy(
|
|
|
98
101
|
const instance = await deploy.getInstance();
|
|
99
102
|
|
|
100
103
|
if (wait) {
|
|
101
|
-
const receipt = await deploy.send({ ...deployOpts, wait: { timeout, returnReceipt: true } });
|
|
104
|
+
const { receipt } = await deploy.send({ ...deployOpts, wait: { timeout, returnReceipt: true } });
|
|
102
105
|
const txHash = receipt.txHash;
|
|
103
106
|
debugLogger.debug(`Deploy tx sent with hash ${txHash.toString()}`);
|
|
104
107
|
out.hash = txHash;
|
|
@@ -121,7 +124,7 @@ export async function deploy(
|
|
|
121
124
|
};
|
|
122
125
|
}
|
|
123
126
|
} else {
|
|
124
|
-
const txHash = await deploy.send({ ...deployOpts, wait: NO_WAIT });
|
|
127
|
+
const { txHash } = await deploy.send({ ...deployOpts, wait: NO_WAIT });
|
|
125
128
|
debugLogger.debug(`Deploy tx sent with hash ${txHash.toString()}`);
|
|
126
129
|
out.hash = txHash;
|
|
127
130
|
|
|
@@ -63,10 +63,13 @@ export async function deployAccount(
|
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
const deployMethod = await account.getDeployMethod();
|
|
66
|
-
const
|
|
66
|
+
const sim = await deployMethod.simulate({
|
|
67
67
|
...deployAccountOpts,
|
|
68
68
|
fee: { ...deployAccountOpts.fee, estimateGas: true },
|
|
69
69
|
});
|
|
70
|
+
// estimateGas: true guarantees these fields are present
|
|
71
|
+
const estimatedGas = sim.estimatedGas!;
|
|
72
|
+
const stats = sim.stats!;
|
|
70
73
|
|
|
71
74
|
if (feeOpts.estimateOnly) {
|
|
72
75
|
if (json) {
|
|
@@ -89,7 +92,7 @@ export async function deployAccount(
|
|
|
89
92
|
if (!json) {
|
|
90
93
|
log(`\nWaiting for account contract deployment...`);
|
|
91
94
|
}
|
|
92
|
-
const
|
|
95
|
+
const sendOpts = {
|
|
93
96
|
...deployAccountOpts,
|
|
94
97
|
fee: deployAccountOpts.fee
|
|
95
98
|
? {
|
|
@@ -97,18 +100,20 @@ export async function deployAccount(
|
|
|
97
100
|
gasSettings: estimatedGas,
|
|
98
101
|
}
|
|
99
102
|
: undefined,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
};
|
|
104
|
+
if (wait) {
|
|
105
|
+
const { receipt } = await deployMethod.send({
|
|
106
|
+
...sendOpts,
|
|
107
|
+
wait: { timeout: DEFAULT_TX_TIMEOUT_S, returnReceipt: true },
|
|
108
|
+
});
|
|
109
|
+
txReceipt = receipt;
|
|
110
|
+
txHash = receipt.txHash;
|
|
106
111
|
out.txReceipt = {
|
|
107
112
|
status: txReceipt.status,
|
|
108
113
|
transactionFee: txReceipt.transactionFee,
|
|
109
114
|
};
|
|
110
115
|
} else {
|
|
111
|
-
txHash =
|
|
116
|
+
({ txHash } = await deployMethod.send({ ...sendOpts, wait: NO_WAIT }));
|
|
112
117
|
}
|
|
113
118
|
debugLogger.debug(`Account contract tx sent with hash ${txHash.toString()}`);
|
|
114
119
|
out.txHash = txHash;
|
package/src/cmds/index.ts
CHANGED
|
@@ -63,7 +63,7 @@ export function injectCommands(
|
|
|
63
63
|
const createAccountCommand = program
|
|
64
64
|
.command('create-account')
|
|
65
65
|
.description(
|
|
66
|
-
'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
|
|
66
|
+
'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 account which uses an immutable key for authentication.',
|
|
67
67
|
)
|
|
68
68
|
.summary('Creates an aztec account that can be used for sending transactions.')
|
|
69
69
|
.addOption(createAccountOption('Alias or address of the account performing the deployment', !db, db))
|
package/src/cmds/send.ts
CHANGED
|
@@ -37,10 +37,13 @@ export async function send(
|
|
|
37
37
|
authWitnesses,
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
const
|
|
40
|
+
const sim = await call.simulate({
|
|
41
41
|
...sendOptions,
|
|
42
42
|
fee: { ...sendOptions.fee, estimateGas: true },
|
|
43
43
|
});
|
|
44
|
+
// estimateGas: true guarantees these fields are present
|
|
45
|
+
const estimatedGas = sim.estimatedGas!;
|
|
46
|
+
const stats = sim.stats!;
|
|
44
47
|
|
|
45
48
|
if (feeOpts.estimateOnly) {
|
|
46
49
|
return;
|
|
@@ -52,7 +55,7 @@ export async function send(
|
|
|
52
55
|
|
|
53
56
|
if (wait) {
|
|
54
57
|
try {
|
|
55
|
-
const receipt = await call.send({
|
|
58
|
+
const { receipt } = await call.send({
|
|
56
59
|
...sendOptions,
|
|
57
60
|
fee: { ...sendOptions.fee, gasSettings: estimatedGas },
|
|
58
61
|
wait: { timeout: DEFAULT_TX_TIMEOUT_S },
|
|
@@ -74,7 +77,7 @@ export async function send(
|
|
|
74
77
|
throw err;
|
|
75
78
|
}
|
|
76
79
|
} else {
|
|
77
|
-
const txHash = await call.send({
|
|
80
|
+
const { txHash } = await call.send({
|
|
78
81
|
...sendOptions,
|
|
79
82
|
fee: { ...sendOptions.fee, gasSettings: estimatedGas },
|
|
80
83
|
wait: NO_WAIT,
|
package/src/cmds/simulate.ts
CHANGED
|
@@ -38,7 +38,7 @@ export async function simulate(
|
|
|
38
38
|
});
|
|
39
39
|
if (verbose) {
|
|
40
40
|
await printAuthorizations(
|
|
41
|
-
simulationResult.offchainEffects
|
|
41
|
+
simulationResult.offchainEffects,
|
|
42
42
|
async (address: AztecAddress) => {
|
|
43
43
|
const metadata = await wallet.getContractMetadata(address);
|
|
44
44
|
if (!metadata.instance) {
|
package/src/utils/wallet.ts
CHANGED
|
@@ -13,16 +13,16 @@ import { AccountManager, type Aliased, type SimulateOptions } from '@aztec/aztec
|
|
|
13
13
|
import type { DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
|
|
14
14
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
15
15
|
import type { LogFn } from '@aztec/foundation/log';
|
|
16
|
+
import type { AccessScopes, NotesFilter } from '@aztec/pxe/client/lazy';
|
|
16
17
|
import type { PXEConfig } from '@aztec/pxe/config';
|
|
17
18
|
import type { PXE } from '@aztec/pxe/server';
|
|
18
19
|
import { createPXE, getPXEConfig } from '@aztec/pxe/server';
|
|
19
20
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
20
21
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
21
22
|
import { NoteDao } from '@aztec/stdlib/note';
|
|
22
|
-
import type { NotesFilter } from '@aztec/stdlib/note';
|
|
23
23
|
import type { TxProvingResult, TxSimulationResult } from '@aztec/stdlib/tx';
|
|
24
24
|
import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/stdlib/tx';
|
|
25
|
-
import { BaseWallet } from '@aztec/wallet-sdk/base-wallet';
|
|
25
|
+
import { BaseWallet, type FeeOptions } from '@aztec/wallet-sdk/base-wallet';
|
|
26
26
|
|
|
27
27
|
import type { WalletDB } from '../storage/wallet_db.js';
|
|
28
28
|
import type { AccountType } from './constants.js';
|
|
@@ -87,7 +87,7 @@ export class CLIWallet extends BaseWallet {
|
|
|
87
87
|
increasedFee: InteractionFeeOptions,
|
|
88
88
|
): Promise<TxProvingResult> {
|
|
89
89
|
const cancellationTxRequest = await this.createCancellationTxExecutionRequest(from, txNonce, increasedFee);
|
|
90
|
-
return await this.pxe.proveTx(cancellationTxRequest);
|
|
90
|
+
return await this.pxe.proveTx(cancellationTxRequest, this.scopesFrom(from));
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
override async getAccountFromAddress(address: AztecAddress) {
|
|
@@ -208,12 +208,40 @@ export class CLIWallet extends BaseWallet {
|
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
override async simulateTx(executionPayload: ExecutionPayload, opts: SimulateOptions): Promise<TxSimulationResult> {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
211
|
+
const simulationResults = await super.simulateTx(executionPayload, opts);
|
|
212
|
+
|
|
213
|
+
if (opts.fee?.estimateGas) {
|
|
214
|
+
const feeOptions = await this.completeFeeOptions(opts.from, executionPayload.feePayer, opts.fee?.gasSettings);
|
|
215
|
+
const limits = getGasLimits(simulationResults, opts.fee?.estimatedGasPadding);
|
|
216
|
+
printGasEstimates(feeOptions, limits, this.userLog);
|
|
217
|
+
}
|
|
218
|
+
return simulationResults;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Uses a stub account for kernelless simulation, bypassing real account authorization.
|
|
223
|
+
* Falls through to the standard entrypoint path for SignerlessAccount (ZERO address).
|
|
224
|
+
*/
|
|
225
|
+
protected override async simulateViaEntrypoint(
|
|
226
|
+
executionPayload: ExecutionPayload,
|
|
227
|
+
from: AztecAddress,
|
|
228
|
+
feeOptions: FeeOptions,
|
|
229
|
+
scopes: AccessScopes,
|
|
230
|
+
skipTxValidation?: boolean,
|
|
231
|
+
skipFeeEnforcement?: boolean,
|
|
232
|
+
): Promise<TxSimulationResult> {
|
|
233
|
+
if (from.equals(AztecAddress.ZERO)) {
|
|
234
|
+
return super.simulateViaEntrypoint(
|
|
235
|
+
executionPayload,
|
|
236
|
+
from,
|
|
237
|
+
feeOptions,
|
|
238
|
+
scopes,
|
|
239
|
+
skipTxValidation,
|
|
240
|
+
skipFeeEnforcement,
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
|
|
215
244
|
const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
|
|
216
|
-
const chainInfo = await this.getChainInfo();
|
|
217
245
|
const executionOptions: DefaultAccountEntrypointOptions = {
|
|
218
246
|
txNonce: Fr.random(),
|
|
219
247
|
cancellable: this.cancellableTransactions,
|
|
@@ -223,44 +251,23 @@ export class CLIWallet extends BaseWallet {
|
|
|
223
251
|
? mergeExecutionPayloads([feeExecutionPayload, executionPayload])
|
|
224
252
|
: executionPayload;
|
|
225
253
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
} else {
|
|
244
|
-
const { account: fromAccount, instance, artifact } = await this.getFakeAccountDataFor(opts.from);
|
|
245
|
-
const txRequest = await fromAccount.createTxExecutionRequest(
|
|
246
|
-
finalExecutionPayload,
|
|
247
|
-
feeOptions.gasSettings,
|
|
248
|
-
chainInfo,
|
|
249
|
-
executionOptions,
|
|
250
|
-
);
|
|
251
|
-
const contractOverrides = {
|
|
252
|
-
[opts.from.toString()]: { instance, artifact },
|
|
253
|
-
};
|
|
254
|
-
simulationResults = await this.pxe.simulateTx(txRequest, true /* simulatePublic */, true, true, {
|
|
255
|
-
contracts: contractOverrides,
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
if (opts.fee?.estimateGas) {
|
|
260
|
-
const limits = getGasLimits(simulationResults, opts.fee?.estimatedGasPadding);
|
|
261
|
-
printGasEstimates(feeOptions, limits, this.userLog);
|
|
262
|
-
}
|
|
263
|
-
return simulationResults;
|
|
254
|
+
const { account: fromAccount, instance, artifact } = await this.getFakeAccountDataFor(from);
|
|
255
|
+
const chainInfo = await this.getChainInfo();
|
|
256
|
+
const txRequest = await fromAccount.createTxExecutionRequest(
|
|
257
|
+
finalExecutionPayload,
|
|
258
|
+
feeOptions.gasSettings,
|
|
259
|
+
chainInfo,
|
|
260
|
+
executionOptions,
|
|
261
|
+
);
|
|
262
|
+
return this.pxe.simulateTx(txRequest, {
|
|
263
|
+
simulatePublic: true,
|
|
264
|
+
skipFeeEnforcement: true,
|
|
265
|
+
skipTxValidation: true,
|
|
266
|
+
overrides: {
|
|
267
|
+
contracts: { [from.toString()]: { instance, artifact } },
|
|
268
|
+
},
|
|
269
|
+
scopes,
|
|
270
|
+
});
|
|
264
271
|
}
|
|
265
272
|
|
|
266
273
|
// Exposed because of the `aztec-wallet get-tx` command. It has been decided that it's fine to keep around because
|