@aztec/cli-wallet 0.0.1-commit.d1f2d6c → 0.0.1-commit.d431d1c
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.js +2 -4
- package/dest/cmds/check_tx.js +1 -4
- 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 +18 -24
- package/dest/cmds/deploy.d.ts +1 -1
- package/dest/cmds/deploy.d.ts.map +1 -1
- package/dest/cmds/deploy.js +23 -46
- 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 +18 -24
- package/dest/cmds/send.d.ts +1 -1
- package/dest/cmds/send.d.ts.map +1 -1
- package/dest/cmds/send.js +16 -28
- package/package.json +14 -14
- package/src/cmds/authorize_action.ts +1 -1
- package/src/cmds/check_tx.ts +1 -4
- package/src/cmds/create_account.ts +17 -23
- package/src/cmds/deploy.ts +22 -41
- package/src/cmds/deploy_account.ts +17 -23
- package/src/cmds/send.ts +10 -22
|
@@ -13,10 +13,8 @@ export async function authorizeAction(wallet, from, functionName, caller, functi
|
|
|
13
13
|
caller,
|
|
14
14
|
action
|
|
15
15
|
}, true);
|
|
16
|
-
const witness = await setAuthwitnessInteraction.send({
|
|
17
|
-
|
|
18
|
-
timeout: DEFAULT_TX_TIMEOUT_S
|
|
19
|
-
}
|
|
16
|
+
const witness = await setAuthwitnessInteraction.send().wait({
|
|
17
|
+
timeout: DEFAULT_TX_TIMEOUT_S
|
|
20
18
|
});
|
|
21
19
|
log(`Authorized action ${functionName} on contract ${contractAddress} for caller ${caller}`);
|
|
22
20
|
return witness;
|
package/dest/cmds/check_tx.js
CHANGED
|
@@ -17,10 +17,7 @@ async function inspectTx(wallet, aztecNode, txHash, log) {
|
|
|
17
17
|
]);
|
|
18
18
|
// Base tx data
|
|
19
19
|
log(`Tx ${txHash.toString()}`);
|
|
20
|
-
log(` Status: ${receipt.status}`);
|
|
21
|
-
if (receipt.executionResult) {
|
|
22
|
-
log(` Execution result: ${receipt.executionResult}`);
|
|
23
|
-
}
|
|
20
|
+
log(` Status: ${receipt.status} ${effectsInBlock ? `(${effectsInBlock.data.revertCode.getDescription()})` : ''}`);
|
|
24
21
|
if (receipt.error) {
|
|
25
22
|
log(` Error: ${receipt.error}`);
|
|
26
23
|
}
|
|
@@ -11,4 +11,4 @@ export declare function createAccount(wallet: CLIWallet, aztecNode: AztecNode, a
|
|
|
11
11
|
secretKey: Fr;
|
|
12
12
|
salt: Fr;
|
|
13
13
|
}>;
|
|
14
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JlYXRlX2FjY291bnQuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jbWRzL2NyZWF0ZV9hY2NvdW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUN6RCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUd0RCxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDcEQsT0FBTyxLQUFLLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBRzNELE9BQU8sS0FBSyxFQUFFLFdBQVcsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ3pELE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUV0RCxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFFL0Msd0JBQXNCLGFBQWEsQ0FDakMsTUFBTSxFQUFFLFNBQVMsRUFDakIsU0FBUyxFQUFFLFNBQVMsRUFDcEIsV0FBVyxFQUFFLFdBQVcsRUFDeEIsU0FBUyxFQUFFLEVBQUUsR0FBRyxTQUFTLEVBQ3pCLFNBQVMsRUFBRSxNQUFNLEdBQUcsU0FBUyxFQUM3QixLQUFLLEVBQUUsTUFBTSxHQUFHLFNBQVMsRUFDekIsUUFBUSxFQUFFLFlBQVksR0FBRyxTQUFTLEVBQ2xDLFlBQVksRUFBRSxPQUFPLEVBQ3JCLGtCQUFrQixFQUFFLE9BQU8sRUFDM0IsWUFBWSxFQUFFLE9BQU8sRUFDckIsYUFBYSxFQUFFLE9BQU8sRUFDdEIsSUFBSSxFQUFFLE9BQU8sRUFDYixPQUFPLEVBQUUsVUFBVSxFQUNuQixJQUFJLEVBQUUsT0FBTyxFQUNiLE9BQU8sRUFBRSxPQUFPLEVBQ2hCLFdBQVcsRUFBRSxNQUFNLEVBQ25CLEdBQUcsRUFBRSxLQUFLOzs7OztHQWlIWCJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create_account.d.ts","sourceRoot":"","sources":["../../src/cmds/create_account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"create_account.d.ts","sourceRoot":"","sources":["../../src/cmds/create_account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,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;AAG3D,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;;;;;GAiHX"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import { NO_WAIT } from '@aztec/aztec.js/contracts';
|
|
3
2
|
import { prettyPrintJSON } from '@aztec/cli/cli-utils';
|
|
4
3
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
4
|
import { DEFAULT_TX_TIMEOUT_S } from '../utils/cli_wallet_and_node_wrapper.js';
|
|
@@ -30,7 +29,7 @@ export async function createAccount(wallet, aztecNode, accountType, secretKey, p
|
|
|
30
29
|
log(`Salt: ${salt.toString()}`);
|
|
31
30
|
log(`Init hash: ${account.getInstance().initializationHash.toString()}`);
|
|
32
31
|
}
|
|
33
|
-
let
|
|
32
|
+
let tx;
|
|
34
33
|
let txReceipt;
|
|
35
34
|
if (!registerOnly) {
|
|
36
35
|
const { paymentMethod, gasSettings } = await feeOpts.toUserFeeOptions(aztecNode, wallet, address);
|
|
@@ -68,43 +67,38 @@ export async function createAccount(wallet, aztecNode, accountType, secretKey, p
|
|
|
68
67
|
};
|
|
69
68
|
}
|
|
70
69
|
} else {
|
|
71
|
-
|
|
72
|
-
printProfileResult(stats, log);
|
|
73
|
-
}
|
|
74
|
-
if (!json) {
|
|
75
|
-
log(`\nWaiting for account contract deployment...`);
|
|
76
|
-
}
|
|
77
|
-
const result = await deployMethod.send({
|
|
70
|
+
tx = deployMethod.send({
|
|
78
71
|
...deployAccountOpts,
|
|
79
72
|
fee: deployAccountOpts.fee ? {
|
|
80
73
|
...deployAccountOpts.fee,
|
|
81
74
|
gasSettings: estimatedGas
|
|
82
|
-
} : undefined
|
|
83
|
-
wait: wait ? {
|
|
84
|
-
timeout: DEFAULT_TX_TIMEOUT_S,
|
|
85
|
-
returnReceipt: true
|
|
86
|
-
} : NO_WAIT
|
|
75
|
+
} : undefined
|
|
87
76
|
});
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
77
|
+
if (verbose) {
|
|
78
|
+
printProfileResult(stats, log);
|
|
79
|
+
}
|
|
80
|
+
const txHash = await tx.getTxHash();
|
|
81
|
+
debugLogger.debug(`Account contract tx sent with hash ${txHash.toString()}`);
|
|
82
|
+
out.txHash = txHash;
|
|
83
|
+
if (wait) {
|
|
84
|
+
if (!json) {
|
|
85
|
+
log(`\nWaiting for account contract deployment...`);
|
|
86
|
+
}
|
|
87
|
+
txReceipt = await tx.wait({
|
|
88
|
+
timeout: DEFAULT_TX_TIMEOUT_S
|
|
89
|
+
});
|
|
92
90
|
out.txReceipt = {
|
|
93
91
|
status: txReceipt.status,
|
|
94
92
|
transactionFee: txReceipt.transactionFee
|
|
95
93
|
};
|
|
96
|
-
} else {
|
|
97
|
-
txHash = result;
|
|
98
94
|
}
|
|
99
|
-
debugLogger.debug(`Account contract tx sent with hash ${txHash.toString()}`);
|
|
100
|
-
out.txHash = txHash;
|
|
101
95
|
}
|
|
102
96
|
}
|
|
103
97
|
if (json) {
|
|
104
98
|
log(prettyPrintJSON(out));
|
|
105
99
|
} else {
|
|
106
|
-
if (
|
|
107
|
-
log(`Deploy tx hash: ${
|
|
100
|
+
if (tx) {
|
|
101
|
+
log(`Deploy tx hash: ${(await tx.getTxHash()).toString()}`);
|
|
108
102
|
}
|
|
109
103
|
if (txReceipt) {
|
|
110
104
|
log(`Deploy tx fee: ${txReceipt.transactionFee}`);
|
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVwbG95LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY21kcy9kZXBsb3kudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBR3pELE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUM1QyxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUV0RCxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFFM0QsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBR2hELE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUV0RCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUVwRCx3QkFBc0IsTUFBTSxDQUMxQixNQUFNLEVBQUUsU0FBUyxFQUNqQixJQUFJLEVBQUUsU0FBUyxFQUNmLFFBQVEsRUFBRSxZQUFZLEVBQ3RCLFlBQVksRUFBRSxNQUFNLEVBQ3BCLElBQUksRUFBRSxPQUFPLEVBQ2IsVUFBVSxFQUFFLFVBQVUsR0FBRyxTQUFTLEVBQ2xDLE9BQU8sRUFBRSxHQUFHLEVBQUUsRUFDZCxJQUFJLEVBQUUsRUFBRSxHQUFHLFNBQVMsRUFDcEIsV0FBVyxFQUFFLE1BQU0sR0FBRyxTQUFTLEVBQy9CLHVCQUF1QixFQUFFLE9BQU8sRUFDaEMsb0JBQW9CLEVBQUUsT0FBTyxFQUM3QixrQkFBa0IsRUFBRSxPQUFPLEdBQUcsU0FBUyxFQUN2QyxJQUFJLEVBQUUsT0FBTyxFQUNiLE9BQU8sRUFBRSxVQUFVLEVBQ25CLE9BQU8sRUFBRSxPQUFPLEVBQ2hCLE9BQU8sb0JBQStCLEVBQ3RDLFdBQVcsRUFBRSxNQUFNLEVBQ25CLEdBQUcsRUFBRSxLQUFLLHFDQWdHWCJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/cmds/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/cmds/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,wBAAsB,MAAM,CAC1B,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,YAAY,EACtB,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,uBAAuB,EAAE,OAAO,EAChC,oBAAoB,EAAE,OAAO,EAC7B,kBAAkB,EAAE,OAAO,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,qCAgGX"}
|
package/dest/cmds/deploy.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import { NO_WAIT } from '@aztec/aztec.js/contracts';
|
|
3
2
|
import { ContractDeployer } from '@aztec/aztec.js/deployment';
|
|
4
3
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
5
4
|
import { encodeArgs, getContractArtifact, prettyPrintJSON } from '@aztec/cli/utils';
|
|
@@ -59,60 +58,38 @@ export async function deploy(wallet, node, deployer, artifactPath, json, publicK
|
|
|
59
58
|
};
|
|
60
59
|
}
|
|
61
60
|
} else {
|
|
61
|
+
const tx = deploy1.send(deployOpts);
|
|
62
62
|
if (verbose) {
|
|
63
63
|
printProfileResult(stats, log);
|
|
64
64
|
}
|
|
65
|
+
const txHash = await tx.getTxHash();
|
|
66
|
+
debugLogger.debug(`Deploy tx sent with hash ${txHash.toString()}`);
|
|
67
|
+
out.hash = txHash;
|
|
65
68
|
const { address, partialAddress } = deploy1;
|
|
66
69
|
const instance = await deploy1.getInstance();
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
});
|
|
75
|
-
const txHash = receipt.txHash;
|
|
76
|
-
debugLogger.debug(`Deploy tx sent with hash ${txHash.toString()}`);
|
|
77
|
-
out.hash = txHash;
|
|
78
|
-
if (!json) {
|
|
79
|
-
log(`Contract deployed at ${address?.toString()}`);
|
|
80
|
-
log(`Contract partial address ${(await partialAddress)?.toString()}`);
|
|
81
|
-
log(`Contract init hash ${instance.initializationHash.toString()}`);
|
|
82
|
-
log(`Deployment tx hash: ${txHash.toString()}`);
|
|
83
|
-
log(`Deployment salt: ${salt.toString()}`);
|
|
84
|
-
log(`Deployer: ${instance.deployer.toString()}`);
|
|
85
|
-
log(`Transaction fee: ${receipt.transactionFee?.toString()}`);
|
|
86
|
-
} else {
|
|
87
|
-
out.contract = {
|
|
88
|
-
address: address?.toString(),
|
|
89
|
-
partialAddress: (await partialAddress)?.toString(),
|
|
90
|
-
initializationHash: instance.initializationHash.toString(),
|
|
91
|
-
salt: salt.toString(),
|
|
92
|
-
transactionFee: receipt.transactionFee?.toString()
|
|
93
|
-
};
|
|
94
|
-
}
|
|
70
|
+
if (!json) {
|
|
71
|
+
log(`Contract deployed at ${address?.toString()}`);
|
|
72
|
+
log(`Contract partial address ${(await partialAddress)?.toString()}`);
|
|
73
|
+
log(`Contract init hash ${instance.initializationHash.toString()}`);
|
|
74
|
+
log(`Deployment tx hash: ${txHash.toString()}`);
|
|
75
|
+
log(`Deployment salt: ${salt.toString()}`);
|
|
76
|
+
log(`Deployer: ${instance.deployer.toString()}`);
|
|
95
77
|
} else {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
78
|
+
out.contract = {
|
|
79
|
+
address: address?.toString(),
|
|
80
|
+
partialAddress: (await partialAddress)?.toString(),
|
|
81
|
+
initializationHash: instance.initializationHash.toString(),
|
|
82
|
+
salt: salt.toString()
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
if (wait) {
|
|
86
|
+
const deployed = await tx.wait({
|
|
87
|
+
timeout
|
|
99
88
|
});
|
|
100
|
-
debugLogger.debug(`Deploy tx sent with hash ${txHash.toString()}`);
|
|
101
|
-
out.hash = txHash;
|
|
102
89
|
if (!json) {
|
|
103
|
-
log(`
|
|
104
|
-
log(`Contract partial address ${(await partialAddress)?.toString()}`);
|
|
105
|
-
log(`Contract init hash ${instance.initializationHash.toString()}`);
|
|
106
|
-
log(`Deployment tx hash: ${txHash.toString()}`);
|
|
107
|
-
log(`Deployment salt: ${salt.toString()}`);
|
|
108
|
-
log(`Deployer: ${instance.deployer.toString()}`);
|
|
90
|
+
log(`Transaction fee: ${deployed.transactionFee?.toString()}`);
|
|
109
91
|
} else {
|
|
110
|
-
out.contract =
|
|
111
|
-
address: address?.toString(),
|
|
112
|
-
partialAddress: (await partialAddress)?.toString(),
|
|
113
|
-
initializationHash: instance.initializationHash.toString(),
|
|
114
|
-
salt: salt.toString()
|
|
115
|
-
};
|
|
92
|
+
out.contract.transactionFee = deployed.transactionFee?.toString();
|
|
116
93
|
}
|
|
117
94
|
}
|
|
118
95
|
}
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVwbG95X2FjY291bnQuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jbWRzL2RlcGxveV9hY2NvdW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUN6RCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUd0RCxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFHM0QsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFFM0QsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFFcEQsd0JBQXNCLGFBQWEsQ0FDakMsTUFBTSxFQUFFLFNBQVMsRUFDakIsU0FBUyxFQUFFLFNBQVMsRUFDcEIsT0FBTyxFQUFFLFlBQVksRUFDckIsSUFBSSxFQUFFLE9BQU8sRUFDYixRQUFRLEVBQUUsWUFBWSxHQUFHLFNBQVMsRUFDbEMsYUFBYSxFQUFFLE9BQU8sRUFDdEIsWUFBWSxFQUFFLE9BQU8sRUFDckIsa0JBQWtCLEVBQUUsT0FBTyxFQUMzQixPQUFPLEVBQUUsVUFBVSxFQUNuQixJQUFJLEVBQUUsT0FBTyxFQUNiLE9BQU8sRUFBRSxPQUFPLEVBQ2hCLFdBQVcsRUFBRSxNQUFNLEVBQ25CLEdBQUcsRUFBRSxLQUFLLGlCQWdHWCJ9
|
|
@@ -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;
|
|
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;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAG3D,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,iBAgGX"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import { NO_WAIT } from '@aztec/aztec.js/contracts';
|
|
3
2
|
import { prettyPrintJSON } from '@aztec/cli/cli-utils';
|
|
4
3
|
import { DEFAULT_TX_TIMEOUT_S } from '../utils/cli_wallet_and_node_wrapper.js';
|
|
5
4
|
import { printProfileResult } from '../utils/profiling.js';
|
|
@@ -22,7 +21,7 @@ export async function deployAccount(wallet, aztecNode, address, wait, deployer,
|
|
|
22
21
|
log(`Salt: ${salt.toString()}`);
|
|
23
22
|
log(`Init hash: ${initializationHash.toString()}`);
|
|
24
23
|
}
|
|
25
|
-
let
|
|
24
|
+
let tx;
|
|
26
25
|
let txReceipt;
|
|
27
26
|
const { paymentMethod, gasSettings } = await feeOpts.toUserFeeOptions(aztecNode, wallet, address);
|
|
28
27
|
const delegatedDeployment = deployer && !account.address.equals(deployer);
|
|
@@ -59,42 +58,37 @@ export async function deployAccount(wallet, aztecNode, address, wait, deployer,
|
|
|
59
58
|
};
|
|
60
59
|
}
|
|
61
60
|
} else {
|
|
62
|
-
|
|
63
|
-
printProfileResult(stats, log);
|
|
64
|
-
}
|
|
65
|
-
if (!json) {
|
|
66
|
-
log(`\nWaiting for account contract deployment...`);
|
|
67
|
-
}
|
|
68
|
-
const result = await deployMethod.send({
|
|
61
|
+
tx = deployMethod.send({
|
|
69
62
|
...deployAccountOpts,
|
|
70
63
|
fee: deployAccountOpts.fee ? {
|
|
71
64
|
...deployAccountOpts.fee,
|
|
72
65
|
gasSettings: estimatedGas
|
|
73
|
-
} : undefined
|
|
74
|
-
wait: wait ? {
|
|
75
|
-
timeout: DEFAULT_TX_TIMEOUT_S,
|
|
76
|
-
returnReceipt: true
|
|
77
|
-
} : NO_WAIT
|
|
66
|
+
} : undefined
|
|
78
67
|
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
68
|
+
if (verbose) {
|
|
69
|
+
printProfileResult(stats, log);
|
|
70
|
+
}
|
|
71
|
+
const txHash = await tx.getTxHash();
|
|
72
|
+
debugLogger.debug(`Account contract tx sent with hash ${txHash.toString()}`);
|
|
73
|
+
out.txHash = txHash;
|
|
74
|
+
if (wait) {
|
|
75
|
+
if (!json) {
|
|
76
|
+
log(`\nWaiting for account contract deployment...`);
|
|
77
|
+
}
|
|
78
|
+
txReceipt = await tx.wait({
|
|
79
|
+
timeout: DEFAULT_TX_TIMEOUT_S
|
|
80
|
+
});
|
|
83
81
|
out.txReceipt = {
|
|
84
82
|
status: txReceipt.status,
|
|
85
83
|
transactionFee: txReceipt.transactionFee
|
|
86
84
|
};
|
|
87
|
-
} else {
|
|
88
|
-
txHash = result;
|
|
89
85
|
}
|
|
90
|
-
debugLogger.debug(`Account contract tx sent with hash ${txHash.toString()}`);
|
|
91
|
-
out.txHash = txHash;
|
|
92
86
|
}
|
|
93
87
|
if (json) {
|
|
94
88
|
log(prettyPrintJSON(out));
|
|
95
89
|
} else {
|
|
96
|
-
if (
|
|
97
|
-
log(`Deploy tx hash: ${
|
|
90
|
+
if (tx) {
|
|
91
|
+
log(`Deploy tx hash: ${(await tx.getTxHash()).toString()}`);
|
|
98
92
|
}
|
|
99
93
|
if (txReceipt) {
|
|
100
94
|
log(`Deploy tx fee: ${txReceipt.transactionFee}`);
|
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VuZC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NtZHMvc2VuZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUM5RCxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFFNUQsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFFdEQsT0FBTyxLQUFLLEVBQUUsS0FBSyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFHbkQsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBRXRELE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBRXBELHdCQUFzQixJQUFJLENBQ3hCLE1BQU0sRUFBRSxTQUFTLEVBQ2pCLElBQUksRUFBRSxTQUFTLEVBQ2YsSUFBSSxFQUFFLFlBQVksRUFDbEIsWUFBWSxFQUFFLE1BQU0sRUFDcEIsY0FBYyxFQUFFLEdBQUcsRUFBRSxFQUNyQixvQkFBb0IsRUFBRSxNQUFNLEVBQzVCLGVBQWUsRUFBRSxZQUFZLEVBQzdCLElBQUksRUFBRSxPQUFPLEVBQ2IsV0FBVyxFQUFFLE9BQU8sRUFDcEIsT0FBTyxFQUFFLFVBQVUsRUFDbkIsYUFBYSxFQUFFLFdBQVcsRUFBRSxFQUM1QixPQUFPLEVBQUUsT0FBTyxFQUNoQixHQUFHLEVBQUUsS0FBSzs7ZUFrRFgifQ==
|
package/dest/cmds/send.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;;
|
|
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;;eAkDX"}
|
package/dest/cmds/send.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Contract
|
|
1
|
+
import { Contract } from '@aztec/aztec.js/contracts';
|
|
2
2
|
import { prepTx } from '@aztec/cli/utils';
|
|
3
3
|
import { DEFAULT_TX_TIMEOUT_S } from '../utils/cli_wallet_and_node_wrapper.js';
|
|
4
4
|
import { printProfileResult } from '../utils/profiling.js';
|
|
@@ -25,48 +25,36 @@ export async function send(wallet, node, from, functionName, functionArgsIn, con
|
|
|
25
25
|
if (feeOpts.estimateOnly) {
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
+
const tx = call.send({
|
|
29
|
+
...sendOptions,
|
|
30
|
+
fee: {
|
|
31
|
+
...sendOptions.fee,
|
|
32
|
+
gasSettings: estimatedGas
|
|
33
|
+
}
|
|
34
|
+
});
|
|
28
35
|
if (verbose) {
|
|
29
36
|
printProfileResult(stats, log);
|
|
30
37
|
}
|
|
38
|
+
const txHash = await tx.getTxHash();
|
|
39
|
+
log(`\nTransaction hash: ${txHash.toString()}`);
|
|
31
40
|
if (wait) {
|
|
32
41
|
try {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
fee: {
|
|
36
|
-
...sendOptions.fee,
|
|
37
|
-
gasSettings: estimatedGas
|
|
38
|
-
},
|
|
39
|
-
wait: {
|
|
40
|
-
timeout: DEFAULT_TX_TIMEOUT_S
|
|
41
|
-
}
|
|
42
|
+
await tx.wait({
|
|
43
|
+
timeout: DEFAULT_TX_TIMEOUT_S
|
|
42
44
|
});
|
|
43
|
-
const txHash = receipt.txHash;
|
|
44
|
-
log(`\nTransaction hash: ${txHash.toString()}`);
|
|
45
45
|
log('Transaction has been mined');
|
|
46
|
+
const receipt = await tx.getReceipt();
|
|
46
47
|
log(` Tx fee: ${receipt.transactionFee}`);
|
|
47
48
|
log(` Status: ${receipt.status}`);
|
|
48
49
|
log(` Block number: ${receipt.blockNumber}`);
|
|
49
50
|
log(` Block hash: ${receipt.blockHash?.toString()}`);
|
|
50
|
-
return {
|
|
51
|
-
txHash
|
|
52
|
-
};
|
|
53
51
|
} catch (err) {
|
|
54
52
|
log(`Transaction failed\n ${err.message}`);
|
|
55
|
-
throw err;
|
|
56
53
|
}
|
|
57
54
|
} else {
|
|
58
|
-
const txHash = await call.send({
|
|
59
|
-
...sendOptions,
|
|
60
|
-
fee: {
|
|
61
|
-
...sendOptions.fee,
|
|
62
|
-
gasSettings: estimatedGas
|
|
63
|
-
},
|
|
64
|
-
wait: NO_WAIT
|
|
65
|
-
});
|
|
66
|
-
log(`\nTransaction hash: ${txHash.toString()}`);
|
|
67
55
|
log('Transaction pending. Check status with check-tx');
|
|
68
|
-
return {
|
|
69
|
-
txHash
|
|
70
|
-
};
|
|
71
56
|
}
|
|
57
|
+
return {
|
|
58
|
+
txHash
|
|
59
|
+
};
|
|
72
60
|
}
|
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.d431d1c",
|
|
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.d431d1c",
|
|
71
|
+
"@aztec/aztec.js": "0.0.1-commit.d431d1c",
|
|
72
|
+
"@aztec/bb.js": "0.0.1-commit.d431d1c",
|
|
73
|
+
"@aztec/cli": "0.0.1-commit.d431d1c",
|
|
74
|
+
"@aztec/entrypoints": "0.0.1-commit.d431d1c",
|
|
75
|
+
"@aztec/ethereum": "0.0.1-commit.d431d1c",
|
|
76
|
+
"@aztec/foundation": "0.0.1-commit.d431d1c",
|
|
77
|
+
"@aztec/kv-store": "0.0.1-commit.d431d1c",
|
|
78
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.d431d1c",
|
|
79
|
+
"@aztec/noir-noirc_abi": "0.0.1-commit.d431d1c",
|
|
80
|
+
"@aztec/pxe": "0.0.1-commit.d431d1c",
|
|
81
|
+
"@aztec/stdlib": "0.0.1-commit.d431d1c",
|
|
82
|
+
"@aztec/wallet-sdk": "0.0.1-commit.d431d1c",
|
|
83
83
|
"commander": "^12.1.0",
|
|
84
84
|
"inquirer": "^10.1.8",
|
|
85
85
|
"source-map-support": "^0.5.21",
|
|
@@ -39,7 +39,7 @@ export async function authorizeAction(
|
|
|
39
39
|
{ caller, action },
|
|
40
40
|
true,
|
|
41
41
|
);
|
|
42
|
-
const witness = await setAuthwitnessInteraction.send(
|
|
42
|
+
const witness = await setAuthwitnessInteraction.send().wait({ timeout: DEFAULT_TX_TIMEOUT_S });
|
|
43
43
|
|
|
44
44
|
log(`Authorized action ${functionName} on contract ${contractAddress} for caller ${caller}`);
|
|
45
45
|
|
package/src/cmds/check_tx.ts
CHANGED
|
@@ -32,10 +32,7 @@ async function inspectTx(wallet: CLIWallet, aztecNode: AztecNode, txHash: TxHash
|
|
|
32
32
|
const [receipt, effectsInBlock] = await Promise.all([aztecNode.getTxReceipt(txHash), aztecNode.getTxEffect(txHash)]);
|
|
33
33
|
// Base tx data
|
|
34
34
|
log(`Tx ${txHash.toString()}`);
|
|
35
|
-
log(` Status: ${receipt.status}`);
|
|
36
|
-
if (receipt.executionResult) {
|
|
37
|
-
log(` Execution result: ${receipt.executionResult}`);
|
|
38
|
-
}
|
|
35
|
+
log(` Status: ${receipt.status} ${effectsInBlock ? `(${effectsInBlock.data.revertCode.getDescription()})` : ''}`);
|
|
39
36
|
if (receipt.error) {
|
|
40
37
|
log(` Error: ${receipt.error}`);
|
|
41
38
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import { NO_WAIT } from '@aztec/aztec.js/contracts';
|
|
3
2
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
4
3
|
import type { DeployAccountOptions } from '@aztec/aztec.js/wallet';
|
|
5
4
|
import { prettyPrintJSON } from '@aztec/cli/cli-utils';
|
|
6
5
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
7
6
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
8
|
-
import type { TxHash, TxReceipt } from '@aztec/stdlib/tx';
|
|
9
7
|
|
|
10
8
|
import { DEFAULT_TX_TIMEOUT_S } from '../utils/cli_wallet_and_node_wrapper.js';
|
|
11
9
|
import type { AccountType } from '../utils/constants.js';
|
|
@@ -66,8 +64,8 @@ export async function createAccount(
|
|
|
66
64
|
log(`Init hash: ${account.getInstance().initializationHash.toString()}`);
|
|
67
65
|
}
|
|
68
66
|
|
|
69
|
-
let
|
|
70
|
-
let txReceipt
|
|
67
|
+
let tx;
|
|
68
|
+
let txReceipt;
|
|
71
69
|
if (!registerOnly) {
|
|
72
70
|
const { paymentMethod, gasSettings } = await feeOpts.toUserFeeOptions(aztecNode, wallet, address);
|
|
73
71
|
|
|
@@ -102,14 +100,7 @@ export async function createAccount(
|
|
|
102
100
|
};
|
|
103
101
|
}
|
|
104
102
|
} else {
|
|
105
|
-
|
|
106
|
-
printProfileResult(stats, log);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if (!json) {
|
|
110
|
-
log(`\nWaiting for account contract deployment...`);
|
|
111
|
-
}
|
|
112
|
-
const result = await deployMethod.send({
|
|
103
|
+
tx = deployMethod.send({
|
|
113
104
|
...deployAccountOpts,
|
|
114
105
|
fee: deployAccountOpts.fee
|
|
115
106
|
? {
|
|
@@ -117,29 +108,32 @@ export async function createAccount(
|
|
|
117
108
|
gasSettings: estimatedGas,
|
|
118
109
|
}
|
|
119
110
|
: undefined,
|
|
120
|
-
wait: wait ? { timeout: DEFAULT_TX_TIMEOUT_S, returnReceipt: true } : NO_WAIT,
|
|
121
111
|
});
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
112
|
+
if (verbose) {
|
|
113
|
+
printProfileResult(stats, log);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const txHash = await tx.getTxHash();
|
|
117
|
+
debugLogger.debug(`Account contract tx sent with hash ${txHash.toString()}`);
|
|
118
|
+
out.txHash = txHash;
|
|
119
|
+
if (wait) {
|
|
120
|
+
if (!json) {
|
|
121
|
+
log(`\nWaiting for account contract deployment...`);
|
|
122
|
+
}
|
|
123
|
+
txReceipt = await tx.wait({ timeout: DEFAULT_TX_TIMEOUT_S });
|
|
126
124
|
out.txReceipt = {
|
|
127
125
|
status: txReceipt.status,
|
|
128
126
|
transactionFee: txReceipt.transactionFee,
|
|
129
127
|
};
|
|
130
|
-
} else {
|
|
131
|
-
txHash = result;
|
|
132
128
|
}
|
|
133
|
-
debugLogger.debug(`Account contract tx sent with hash ${txHash.toString()}`);
|
|
134
|
-
out.txHash = txHash;
|
|
135
129
|
}
|
|
136
130
|
}
|
|
137
131
|
|
|
138
132
|
if (json) {
|
|
139
133
|
log(prettyPrintJSON(out));
|
|
140
134
|
} else {
|
|
141
|
-
if (
|
|
142
|
-
log(`Deploy tx hash: ${
|
|
135
|
+
if (tx) {
|
|
136
|
+
log(`Deploy tx hash: ${(await tx.getTxHash()).toString()}`);
|
|
143
137
|
}
|
|
144
138
|
if (txReceipt) {
|
|
145
139
|
log(`Deploy tx fee: ${txReceipt.transactionFee}`);
|
package/src/cmds/deploy.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
2
|
import type { DeployOptions } from '@aztec/aztec.js/contracts';
|
|
3
|
-
import { NO_WAIT } from '@aztec/aztec.js/contracts';
|
|
4
3
|
import { ContractDeployer } from '@aztec/aztec.js/deployment';
|
|
5
4
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
6
5
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
@@ -90,55 +89,37 @@ export async function deploy(
|
|
|
90
89
|
};
|
|
91
90
|
}
|
|
92
91
|
} else {
|
|
92
|
+
const tx = deploy.send(deployOpts);
|
|
93
93
|
if (verbose) {
|
|
94
94
|
printProfileResult(stats, log);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
const txHash = await tx.getTxHash();
|
|
98
|
+
debugLogger.debug(`Deploy tx sent with hash ${txHash.toString()}`);
|
|
99
|
+
out.hash = txHash;
|
|
97
100
|
const { address, partialAddress } = deploy;
|
|
98
101
|
const instance = await deploy.getInstance();
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if (!json) {
|
|
107
|
-
log(`Contract deployed at ${address?.toString()}`);
|
|
108
|
-
log(`Contract partial address ${(await partialAddress)?.toString()}`);
|
|
109
|
-
log(`Contract init hash ${instance.initializationHash.toString()}`);
|
|
110
|
-
log(`Deployment tx hash: ${txHash.toString()}`);
|
|
111
|
-
log(`Deployment salt: ${salt.toString()}`);
|
|
112
|
-
log(`Deployer: ${instance.deployer.toString()}`);
|
|
113
|
-
log(`Transaction fee: ${receipt.transactionFee?.toString()}`);
|
|
114
|
-
} else {
|
|
115
|
-
out.contract = {
|
|
116
|
-
address: address?.toString(),
|
|
117
|
-
partialAddress: (await partialAddress)?.toString(),
|
|
118
|
-
initializationHash: instance.initializationHash.toString(),
|
|
119
|
-
salt: salt.toString(),
|
|
120
|
-
transactionFee: receipt.transactionFee?.toString(),
|
|
121
|
-
};
|
|
122
|
-
}
|
|
102
|
+
if (!json) {
|
|
103
|
+
log(`Contract deployed at ${address?.toString()}`);
|
|
104
|
+
log(`Contract partial address ${(await partialAddress)?.toString()}`);
|
|
105
|
+
log(`Contract init hash ${instance.initializationHash.toString()}`);
|
|
106
|
+
log(`Deployment tx hash: ${txHash.toString()}`);
|
|
107
|
+
log(`Deployment salt: ${salt.toString()}`);
|
|
108
|
+
log(`Deployer: ${instance.deployer.toString()}`);
|
|
123
109
|
} else {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
110
|
+
out.contract = {
|
|
111
|
+
address: address?.toString(),
|
|
112
|
+
partialAddress: (await partialAddress)?.toString(),
|
|
113
|
+
initializationHash: instance.initializationHash.toString(),
|
|
114
|
+
salt: salt.toString(),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
if (wait) {
|
|
118
|
+
const deployed = await tx.wait({ timeout });
|
|
128
119
|
if (!json) {
|
|
129
|
-
log(`
|
|
130
|
-
log(`Contract partial address ${(await partialAddress)?.toString()}`);
|
|
131
|
-
log(`Contract init hash ${instance.initializationHash.toString()}`);
|
|
132
|
-
log(`Deployment tx hash: ${txHash.toString()}`);
|
|
133
|
-
log(`Deployment salt: ${salt.toString()}`);
|
|
134
|
-
log(`Deployer: ${instance.deployer.toString()}`);
|
|
120
|
+
log(`Transaction fee: ${deployed.transactionFee?.toString()}`);
|
|
135
121
|
} else {
|
|
136
|
-
out.contract =
|
|
137
|
-
address: address?.toString(),
|
|
138
|
-
partialAddress: (await partialAddress)?.toString(),
|
|
139
|
-
initializationHash: instance.initializationHash.toString(),
|
|
140
|
-
salt: salt.toString(),
|
|
141
|
-
};
|
|
122
|
+
out.contract.transactionFee = deployed.transactionFee?.toString();
|
|
142
123
|
}
|
|
143
124
|
}
|
|
144
125
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import { NO_WAIT } from '@aztec/aztec.js/contracts';
|
|
3
2
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
4
3
|
import type { DeployAccountOptions } from '@aztec/aztec.js/wallet';
|
|
5
4
|
import { prettyPrintJSON } from '@aztec/cli/cli-utils';
|
|
6
5
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
7
|
-
import type { TxHash, TxReceipt } from '@aztec/stdlib/tx';
|
|
8
6
|
|
|
9
7
|
import { DEFAULT_TX_TIMEOUT_S } from '../utils/cli_wallet_and_node_wrapper.js';
|
|
10
8
|
import type { CLIFeeArgs } from '../utils/options/fees.js';
|
|
@@ -47,8 +45,8 @@ export async function deployAccount(
|
|
|
47
45
|
log(`Init hash: ${initializationHash.toString()}`);
|
|
48
46
|
}
|
|
49
47
|
|
|
50
|
-
let
|
|
51
|
-
let txReceipt
|
|
48
|
+
let tx;
|
|
49
|
+
let txReceipt;
|
|
52
50
|
const { paymentMethod, gasSettings } = await feeOpts.toUserFeeOptions(aztecNode, wallet, address);
|
|
53
51
|
|
|
54
52
|
const delegatedDeployment = deployer && !account.address.equals(deployer);
|
|
@@ -82,14 +80,7 @@ export async function deployAccount(
|
|
|
82
80
|
};
|
|
83
81
|
}
|
|
84
82
|
} else {
|
|
85
|
-
|
|
86
|
-
printProfileResult(stats, log);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if (!json) {
|
|
90
|
-
log(`\nWaiting for account contract deployment...`);
|
|
91
|
-
}
|
|
92
|
-
const result = await deployMethod.send({
|
|
83
|
+
tx = deployMethod.send({
|
|
93
84
|
...deployAccountOpts,
|
|
94
85
|
fee: deployAccountOpts.fee
|
|
95
86
|
? {
|
|
@@ -97,28 +88,31 @@ export async function deployAccount(
|
|
|
97
88
|
gasSettings: estimatedGas,
|
|
98
89
|
}
|
|
99
90
|
: undefined,
|
|
100
|
-
wait: wait ? { timeout: DEFAULT_TX_TIMEOUT_S, returnReceipt: true } : NO_WAIT,
|
|
101
91
|
});
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
92
|
+
if (verbose) {
|
|
93
|
+
printProfileResult(stats, log);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const txHash = await tx.getTxHash();
|
|
97
|
+
debugLogger.debug(`Account contract tx sent with hash ${txHash.toString()}`);
|
|
98
|
+
out.txHash = txHash;
|
|
99
|
+
if (wait) {
|
|
100
|
+
if (!json) {
|
|
101
|
+
log(`\nWaiting for account contract deployment...`);
|
|
102
|
+
}
|
|
103
|
+
txReceipt = await tx.wait({ timeout: DEFAULT_TX_TIMEOUT_S });
|
|
106
104
|
out.txReceipt = {
|
|
107
105
|
status: txReceipt.status,
|
|
108
106
|
transactionFee: txReceipt.transactionFee,
|
|
109
107
|
};
|
|
110
|
-
} else {
|
|
111
|
-
txHash = result;
|
|
112
108
|
}
|
|
113
|
-
debugLogger.debug(`Account contract tx sent with hash ${txHash.toString()}`);
|
|
114
|
-
out.txHash = txHash;
|
|
115
109
|
}
|
|
116
110
|
|
|
117
111
|
if (json) {
|
|
118
112
|
log(prettyPrintJSON(out));
|
|
119
113
|
} else {
|
|
120
|
-
if (
|
|
121
|
-
log(`Deploy tx hash: ${
|
|
114
|
+
if (tx) {
|
|
115
|
+
log(`Deploy tx hash: ${(await tx.getTxHash()).toString()}`);
|
|
122
116
|
}
|
|
123
117
|
if (txReceipt) {
|
|
124
118
|
log(`Deploy tx fee: ${txReceipt.transactionFee}`);
|
package/src/cmds/send.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
2
|
import { AuthWitness } from '@aztec/aztec.js/authorization';
|
|
3
|
-
import { Contract,
|
|
3
|
+
import { Contract, type SendInteractionOptions } from '@aztec/aztec.js/contracts';
|
|
4
4
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
5
5
|
import { prepTx } from '@aztec/cli/utils';
|
|
6
6
|
import type { LogFn } from '@aztec/foundation/log';
|
|
@@ -46,43 +46,31 @@ export async function send(
|
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
const tx = call.send({ ...sendOptions, fee: { ...sendOptions.fee, gasSettings: estimatedGas } });
|
|
49
50
|
if (verbose) {
|
|
50
51
|
printProfileResult(stats!, log);
|
|
51
52
|
}
|
|
52
53
|
|
|
54
|
+
const txHash = await tx.getTxHash();
|
|
55
|
+
log(`\nTransaction hash: ${txHash.toString()}`);
|
|
53
56
|
if (wait) {
|
|
54
57
|
try {
|
|
55
|
-
|
|
56
|
-
...sendOptions,
|
|
57
|
-
fee: { ...sendOptions.fee, gasSettings: estimatedGas },
|
|
58
|
-
wait: { timeout: DEFAULT_TX_TIMEOUT_S },
|
|
59
|
-
});
|
|
58
|
+
await tx.wait({ timeout: DEFAULT_TX_TIMEOUT_S });
|
|
60
59
|
|
|
61
|
-
const txHash = receipt.txHash;
|
|
62
|
-
log(`\nTransaction hash: ${txHash.toString()}`);
|
|
63
60
|
log('Transaction has been mined');
|
|
61
|
+
|
|
62
|
+
const receipt = await tx.getReceipt();
|
|
64
63
|
log(` Tx fee: ${receipt.transactionFee}`);
|
|
65
64
|
log(` Status: ${receipt.status}`);
|
|
66
65
|
log(` Block number: ${receipt.blockNumber}`);
|
|
67
66
|
log(` Block hash: ${receipt.blockHash?.toString()}`);
|
|
68
|
-
|
|
69
|
-
return {
|
|
70
|
-
txHash,
|
|
71
|
-
};
|
|
72
67
|
} catch (err: any) {
|
|
73
68
|
log(`Transaction failed\n ${err.message}`);
|
|
74
|
-
throw err;
|
|
75
69
|
}
|
|
76
70
|
} else {
|
|
77
|
-
const txHash = await call.send({
|
|
78
|
-
...sendOptions,
|
|
79
|
-
fee: { ...sendOptions.fee, gasSettings: estimatedGas },
|
|
80
|
-
wait: NO_WAIT,
|
|
81
|
-
});
|
|
82
|
-
log(`\nTransaction hash: ${txHash.toString()}`);
|
|
83
71
|
log('Transaction pending. Check status with check-tx');
|
|
84
|
-
return {
|
|
85
|
-
txHash,
|
|
86
|
-
};
|
|
87
72
|
}
|
|
73
|
+
return {
|
|
74
|
+
txHash,
|
|
75
|
+
};
|
|
88
76
|
}
|