@aztec/cli-wallet 3.0.0-canary.a9708bd → 3.0.0-devnet.3
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/README.md +30 -0
- package/dest/bin/index.js +28 -22
- package/dest/cmds/authorize_action.d.ts +3 -2
- package/dest/cmds/authorize_action.d.ts.map +1 -1
- package/dest/cmds/authorize_action.js +5 -6
- package/dest/cmds/bridge_fee_juice.d.ts +2 -2
- package/dest/cmds/bridge_fee_juice.d.ts.map +1 -1
- package/dest/cmds/bridge_fee_juice.js +6 -5
- package/dest/cmds/check_tx.d.ts +4 -2
- package/dest/cmds/check_tx.d.ts.map +1 -1
- package/dest/cmds/check_tx.js +145 -6
- package/dest/cmds/create_account.d.ts +5 -4
- package/dest/cmds/create_account.d.ts.map +1 -1
- package/dest/cmds/create_account.js +35 -47
- package/dest/cmds/create_authwit.d.ts +3 -2
- package/dest/cmds/create_authwit.d.ts.map +1 -1
- package/dest/cmds/create_authwit.js +5 -5
- package/dest/cmds/deploy.d.ts +6 -3
- package/dest/cmds/deploy.d.ts.map +1 -1
- package/dest/cmds/deploy.js +57 -46
- package/dest/cmds/deploy_account.d.ts +5 -7
- package/dest/cmds/deploy_account.d.ts.map +1 -1
- package/dest/cmds/deploy_account.js +36 -51
- package/dest/cmds/import_test_accounts.d.ts +2 -2
- package/dest/cmds/import_test_accounts.d.ts.map +1 -1
- package/dest/cmds/import_test_accounts.js +6 -9
- package/dest/cmds/index.d.ts +2 -2
- package/dest/cmds/index.d.ts.map +1 -1
- package/dest/cmds/index.js +73 -112
- package/dest/cmds/profile.d.ts +6 -3
- package/dest/cmds/profile.d.ts.map +1 -1
- package/dest/cmds/profile.js +8 -3
- package/dest/cmds/register_contract.d.ts +6 -2
- package/dest/cmds/register_contract.d.ts.map +1 -1
- package/dest/cmds/register_contract.js +5 -6
- package/dest/cmds/register_sender.d.ts +3 -2
- package/dest/cmds/register_sender.d.ts.map +1 -1
- package/dest/cmds/send.d.ts +7 -8
- package/dest/cmds/send.d.ts.map +1 -1
- package/dest/cmds/send.js +26 -23
- package/dest/cmds/simulate.d.ts +6 -3
- package/dest/cmds/simulate.d.ts.map +1 -1
- package/dest/cmds/simulate.js +8 -3
- package/dest/storage/wallet_db.d.ts +2 -12
- package/dest/storage/wallet_db.d.ts.map +1 -1
- package/dest/storage/wallet_db.js +1 -22
- package/dest/utils/authorizations.d.ts +2 -1
- package/dest/utils/authorizations.d.ts.map +1 -1
- package/dest/utils/authorizations.js +1 -1
- package/dest/utils/cli_wallet_and_node_wrapper.d.ts +12 -0
- package/dest/utils/cli_wallet_and_node_wrapper.d.ts.map +1 -0
- package/dest/utils/cli_wallet_and_node_wrapper.js +25 -0
- package/dest/utils/options/fees.d.ts +20 -27
- package/dest/utils/options/fees.d.ts.map +1 -1
- package/dest/utils/options/fees.js +65 -132
- package/dest/utils/options/options.d.ts +2 -1
- package/dest/utils/options/options.d.ts.map +1 -1
- package/dest/utils/options/options.js +1 -1
- package/dest/utils/wallet.d.ts +35 -0
- package/dest/utils/wallet.d.ts.map +1 -0
- package/dest/utils/wallet.js +193 -0
- package/package.json +12 -12
- package/src/bin/index.ts +30 -29
- package/src/cmds/authorize_action.ts +13 -5
- package/src/cmds/bridge_fee_juice.ts +12 -9
- package/src/cmds/check_tx.ts +182 -5
- package/src/cmds/create_account.ts +42 -52
- package/src/cmds/create_authwit.ts +8 -4
- package/src/cmds/deploy.ts +58 -56
- package/src/cmds/deploy_account.ts +43 -51
- package/src/cmds/import_test_accounts.ts +7 -11
- package/src/cmds/index.ts +120 -206
- package/src/cmds/profile.ts +13 -5
- package/src/cmds/register_contract.ts +9 -11
- package/src/cmds/register_sender.ts +3 -2
- package/src/cmds/send.ts +21 -31
- package/src/cmds/simulate.ts +13 -5
- package/src/storage/wallet_db.ts +2 -30
- package/src/utils/authorizations.ts +3 -1
- package/src/utils/cli_wallet_and_node_wrapper.ts +35 -0
- package/src/utils/options/fees.ts +86 -177
- package/src/utils/options/options.ts +3 -2
- package/src/utils/wallet.ts +264 -0
- package/dest/cmds/cancel_tx.d.ts +0 -11
- package/dest/cmds/cancel_tx.d.ts.map +0 -1
- package/dest/cmds/cancel_tx.js +0 -43
- package/dest/utils/accounts.d.ts +0 -9
- package/dest/utils/accounts.d.ts.map +0 -1
- package/dest/utils/accounts.js +0 -61
- package/dest/utils/pxe_wrapper.d.ts +0 -12
- package/dest/utils/pxe_wrapper.d.ts.map +0 -1
- package/dest/utils/pxe_wrapper.js +0 -26
- package/src/cmds/cancel_tx.ts +0 -66
- package/src/utils/accounts.ts +0 -77
- package/src/utils/pxe_wrapper.ts +0 -32
package/dest/cmds/deploy.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { AztecAddress
|
|
2
|
-
import {
|
|
1
|
+
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import { ContractDeployer } from '@aztec/aztec.js/deployment';
|
|
3
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
4
|
+
import { encodeArgs, getContractArtifact, prettyPrintJSON } from '@aztec/cli/utils';
|
|
3
5
|
import { getAllFunctionAbis, getInitializer } from '@aztec/stdlib/abi';
|
|
4
6
|
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
5
|
-
import {
|
|
7
|
+
import { DEFAULT_TX_TIMEOUT_S } from '../utils/cli_wallet_and_node_wrapper.js';
|
|
6
8
|
import { printProfileResult } from '../utils/profiling.js';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
export async function deploy(wallet, node, deployer, artifactPath, json, publicKeys, rawArgs, salt, initializer, skipInstancePublication, skipClassPublication, skipInitialization, wait, feeOpts, verbose, timeout = DEFAULT_TX_TIMEOUT_S, debugLogger, log) {
|
|
10
|
+
const out = {};
|
|
9
11
|
salt ??= Fr.random();
|
|
10
12
|
const contractArtifact = await getContractArtifact(artifactPath, log);
|
|
11
13
|
const hasInitializer = getAllFunctionAbis(contractArtifact).some((fn)=>fn.isInitializer);
|
|
@@ -22,8 +24,12 @@ export async function deploy(wallet, deployer, artifactPath, json, publicKeys, r
|
|
|
22
24
|
debugLogger.debug(`Encoded arguments: ${args.join(', ')}`);
|
|
23
25
|
}
|
|
24
26
|
const deploy1 = contractDeployer.deploy(...args);
|
|
27
|
+
const { paymentMethod, gasSettings } = await feeOpts.toUserFeeOptions(node, wallet, deployer);
|
|
25
28
|
const deployOpts = {
|
|
26
|
-
|
|
29
|
+
fee: {
|
|
30
|
+
gasSettings,
|
|
31
|
+
paymentMethod
|
|
32
|
+
},
|
|
27
33
|
from: deployer ?? AztecAddress.ZERO,
|
|
28
34
|
contractAddressSalt: salt,
|
|
29
35
|
universalDeploy: !deployer,
|
|
@@ -31,59 +37,64 @@ export async function deploy(wallet, deployer, artifactPath, json, publicKeys, r
|
|
|
31
37
|
skipInitialization,
|
|
32
38
|
skipInstancePublication
|
|
33
39
|
};
|
|
40
|
+
const { estimatedGas, stats } = await deploy1.simulate({
|
|
41
|
+
...deployOpts,
|
|
42
|
+
fee: {
|
|
43
|
+
...deployOpts.fee,
|
|
44
|
+
estimateGas: true
|
|
45
|
+
}
|
|
46
|
+
});
|
|
34
47
|
if (feeOpts.estimateOnly) {
|
|
35
|
-
const gas = await deploy1.estimateGas(deployOpts);
|
|
36
|
-
printGasEstimates(feeOpts, gas, log);
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
const provenTx = await deploy1.prove(deployOpts);
|
|
40
|
-
if (verbose) {
|
|
41
|
-
printProfileResult(provenTx.stats, log);
|
|
42
|
-
}
|
|
43
|
-
const tx = provenTx.send();
|
|
44
|
-
const txHash = await tx.getTxHash();
|
|
45
|
-
debugLogger.debug(`Deploy tx sent with hash ${txHash.toString()}`);
|
|
46
|
-
if (wait) {
|
|
47
|
-
const deployed = await tx.wait({
|
|
48
|
-
timeout
|
|
49
|
-
});
|
|
50
|
-
const { address, partialAddress, instance } = deployed.contract;
|
|
51
48
|
if (json) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
log(`Contract init hash ${instance.initializationHash.toString()}`);
|
|
63
|
-
log(`Deployment tx hash: ${txHash.toString()}`);
|
|
64
|
-
log(`Deployment salt: ${salt.toString()}`);
|
|
65
|
-
log(`Deployment fee: ${deployed.transactionFee}`);
|
|
49
|
+
out.fee = {
|
|
50
|
+
gasLimits: {
|
|
51
|
+
da: estimatedGas.gasLimits.daGas,
|
|
52
|
+
l2: estimatedGas.gasLimits.l2Gas
|
|
53
|
+
},
|
|
54
|
+
teardownGasLimits: {
|
|
55
|
+
da: estimatedGas.teardownGasLimits.daGas,
|
|
56
|
+
l2: estimatedGas.teardownGasLimits
|
|
57
|
+
}
|
|
58
|
+
};
|
|
66
59
|
}
|
|
67
60
|
} else {
|
|
61
|
+
const tx = deploy1.send(deployOpts);
|
|
62
|
+
if (verbose) {
|
|
63
|
+
printProfileResult(stats, log);
|
|
64
|
+
}
|
|
65
|
+
const txHash = await tx.getTxHash();
|
|
66
|
+
debugLogger.debug(`Deploy tx sent with hash ${txHash.toString()}`);
|
|
67
|
+
out.hash = txHash;
|
|
68
68
|
const { address, partialAddress } = deploy1;
|
|
69
69
|
const instance = await deploy1.getInstance();
|
|
70
|
-
if (json) {
|
|
71
|
-
logJson({
|
|
72
|
-
address: address?.toString() ?? 'N/A',
|
|
73
|
-
partialAddress: (await partialAddress)?.toString() ?? 'N/A',
|
|
74
|
-
txHash: txHash.toString(),
|
|
75
|
-
initializationHash: instance.initializationHash.toString(),
|
|
76
|
-
salt: salt.toString(),
|
|
77
|
-
deployer: instance.deployer.toString()
|
|
78
|
-
});
|
|
79
|
-
} else {
|
|
70
|
+
if (!json) {
|
|
80
71
|
log(`Contract deployed at ${address?.toString()}`);
|
|
81
72
|
log(`Contract partial address ${(await partialAddress)?.toString()}`);
|
|
82
73
|
log(`Contract init hash ${instance.initializationHash.toString()}`);
|
|
83
74
|
log(`Deployment tx hash: ${txHash.toString()}`);
|
|
84
75
|
log(`Deployment salt: ${salt.toString()}`);
|
|
85
76
|
log(`Deployer: ${instance.deployer.toString()}`);
|
|
77
|
+
} else {
|
|
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
|
|
88
|
+
});
|
|
89
|
+
if (!json) {
|
|
90
|
+
log(`Transaction fee: ${deployed.transactionFee?.toString()}`);
|
|
91
|
+
} else {
|
|
92
|
+
out.contract.transactionFee = deployed.transactionFee?.toString();
|
|
93
|
+
}
|
|
86
94
|
}
|
|
87
95
|
}
|
|
96
|
+
if (json) {
|
|
97
|
+
log(prettyPrintJSON(out));
|
|
98
|
+
}
|
|
88
99
|
return deploy1.address;
|
|
89
100
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
2
3
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
secretKey: import("@aztec/aztec.js").Fr;
|
|
7
|
-
salt: import("@aztec/aztec.js").Fr;
|
|
8
|
-
}>;
|
|
4
|
+
import type { CLIFeeArgs } from '../utils/options/fees.js';
|
|
5
|
+
import type { CLIWallet } from '../utils/wallet.js';
|
|
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>;
|
|
9
7
|
//# sourceMappingURL=deploy_account.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy_account.d.ts","sourceRoot":"","sources":["../../src/cmds/deploy_account.ts"],"names":[],"mappings":"AAAA,OAAO,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;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,14 +1,12 @@
|
|
|
1
|
-
import { AztecAddress } from '@aztec/aztec.js';
|
|
1
|
+
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
2
|
import { prettyPrintJSON } from '@aztec/cli/cli-utils';
|
|
3
|
-
import {
|
|
3
|
+
import { DEFAULT_TX_TIMEOUT_S } from '../utils/cli_wallet_and_node_wrapper.js';
|
|
4
4
|
import { printProfileResult } from '../utils/profiling.js';
|
|
5
|
-
|
|
6
|
-
export async function deployAccount(account, wait, registerClass, publicDeploy, feeOpts, json, verbose, debugLogger, log) {
|
|
5
|
+
export async function deployAccount(wallet, aztecNode, address, wait, deployer, registerClass, publicDeploy, skipInitialization, feeOpts, json, verbose, debugLogger, log) {
|
|
7
6
|
const out = {};
|
|
8
|
-
const
|
|
9
|
-
const {
|
|
10
|
-
const
|
|
11
|
-
const secretKey = wallet.getSecretKey();
|
|
7
|
+
const account = await wallet.createOrRetrieveAccount(address);
|
|
8
|
+
const { partialAddress, publicKeys } = await account.getCompleteAddress();
|
|
9
|
+
const { initializationHash, salt } = account.getInstance();
|
|
12
10
|
if (json) {
|
|
13
11
|
out.address = address;
|
|
14
12
|
out.partialAddress = partialAddress;
|
|
@@ -19,65 +17,57 @@ export async function deployAccount(account, wait, registerClass, publicDeploy,
|
|
|
19
17
|
log(`\nNew account:\n`);
|
|
20
18
|
log(`Address: ${address.toString()}`);
|
|
21
19
|
log(`Public key: ${publicKeys.toString()}`);
|
|
22
|
-
if (secretKey) {
|
|
23
|
-
log(`Secret key: ${secretKey.toString()}`);
|
|
24
|
-
}
|
|
25
20
|
log(`Partial address: ${partialAddress.toString()}`);
|
|
26
21
|
log(`Salt: ${salt.toString()}`);
|
|
27
22
|
log(`Init hash: ${initializationHash.toString()}`);
|
|
28
|
-
log(`Deployer: ${deployer.toString()}`);
|
|
29
23
|
}
|
|
30
24
|
let tx;
|
|
31
25
|
let txReceipt;
|
|
32
|
-
const
|
|
33
|
-
|
|
26
|
+
const { paymentMethod, gasSettings } = await feeOpts.toUserFeeOptions(aztecNode, wallet, address);
|
|
27
|
+
const delegatedDeployment = deployer && !account.address.equals(deployer);
|
|
28
|
+
const from = delegatedDeployment ? deployer : AztecAddress.ZERO;
|
|
29
|
+
const deployAccountOpts = {
|
|
34
30
|
skipClassPublication: !registerClass,
|
|
35
|
-
|
|
31
|
+
skipInstancePublication: !publicDeploy,
|
|
32
|
+
skipInitialization,
|
|
33
|
+
from,
|
|
34
|
+
fee: {
|
|
35
|
+
paymentMethod,
|
|
36
|
+
gasSettings
|
|
37
|
+
}
|
|
36
38
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
...deployOpts.fee,
|
|
46
|
-
paymentMethod: await account.getSelfPaymentMethod(deployOpts.fee.paymentMethod)
|
|
47
|
-
} : deployOpts?.fee;
|
|
48
|
-
const deployMethod = await account.getDeployMethod(deployOpts.deployWallet);
|
|
39
|
+
const deployMethod = await account.getDeployMethod();
|
|
40
|
+
const { estimatedGas, stats } = await deployMethod.simulate({
|
|
41
|
+
...deployAccountOpts,
|
|
42
|
+
fee: {
|
|
43
|
+
...deployAccountOpts.fee,
|
|
44
|
+
estimateGas: true
|
|
45
|
+
}
|
|
46
|
+
});
|
|
49
47
|
if (feeOpts.estimateOnly) {
|
|
50
|
-
const gas = await deployMethod.estimateGas({
|
|
51
|
-
...deployOpts,
|
|
52
|
-
from: AztecAddress.ZERO,
|
|
53
|
-
universalDeploy: true,
|
|
54
|
-
contractAddressSalt: salt
|
|
55
|
-
});
|
|
56
48
|
if (json) {
|
|
57
49
|
out.fee = {
|
|
58
50
|
gasLimits: {
|
|
59
|
-
da:
|
|
60
|
-
l2:
|
|
51
|
+
da: estimatedGas.gasLimits.daGas,
|
|
52
|
+
l2: estimatedGas.gasLimits.l2Gas
|
|
61
53
|
},
|
|
62
54
|
teardownGasLimits: {
|
|
63
|
-
da:
|
|
64
|
-
l2:
|
|
55
|
+
da: estimatedGas.teardownGasLimits.daGas,
|
|
56
|
+
l2: estimatedGas.teardownGasLimits
|
|
65
57
|
}
|
|
66
58
|
};
|
|
67
|
-
} else {
|
|
68
|
-
printGasEstimates(feeOpts, gas, log);
|
|
69
59
|
}
|
|
70
60
|
} else {
|
|
71
|
-
|
|
72
|
-
...
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
61
|
+
tx = deployMethod.send({
|
|
62
|
+
...deployAccountOpts,
|
|
63
|
+
fee: deployAccountOpts.fee ? {
|
|
64
|
+
...deployAccountOpts.fee,
|
|
65
|
+
gasSettings: estimatedGas
|
|
66
|
+
} : undefined
|
|
76
67
|
});
|
|
77
68
|
if (verbose) {
|
|
78
|
-
printProfileResult(
|
|
69
|
+
printProfileResult(stats, log);
|
|
79
70
|
}
|
|
80
|
-
tx = provenTx.send();
|
|
81
71
|
const txHash = await tx.getTxHash();
|
|
82
72
|
debugLogger.debug(`Account contract tx sent with hash ${txHash.toString()}`);
|
|
83
73
|
out.txHash = txHash;
|
|
@@ -104,9 +94,4 @@ export async function deployAccount(account, wait, registerClass, publicDeploy,
|
|
|
104
94
|
log(`Deploy tx fee: ${txReceipt.transactionFee}`);
|
|
105
95
|
}
|
|
106
96
|
}
|
|
107
|
-
return {
|
|
108
|
-
address,
|
|
109
|
-
secretKey,
|
|
110
|
-
salt
|
|
111
|
-
};
|
|
112
97
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type PXE } from '@aztec/aztec.js';
|
|
2
1
|
import type { LogFn } from '@aztec/foundation/log';
|
|
3
2
|
import type { WalletDB } from '../storage/wallet_db.js';
|
|
4
|
-
|
|
3
|
+
import type { CLIWallet } from '../utils/wallet.js';
|
|
4
|
+
export declare function importTestAccounts(wallet: CLIWallet, db: WalletDB, json: boolean, log: LogFn): Promise<void>;
|
|
5
5
|
//# sourceMappingURL=import_test_accounts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import_test_accounts.d.ts","sourceRoot":"","sources":["../../src/cmds/import_test_accounts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"import_test_accounts.d.ts","sourceRoot":"","sources":["../../src/cmds/import_test_accounts.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,iBAkClG"}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Fr } from '@aztec/aztec.js';
|
|
1
|
+
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
4
3
|
import { prettyPrintJSON } from '@aztec/cli/cli-utils';
|
|
5
|
-
export async function importTestAccounts(
|
|
6
|
-
const testAccounts = await
|
|
7
|
-
const accounts = await Promise.all(testAccounts.map(({ secret, signingKey, salt })=>getSchnorrAccount(client, secret, signingKey, salt)));
|
|
4
|
+
export async function importTestAccounts(wallet, db, json, log) {
|
|
5
|
+
const testAccounts = await getInitialTestAccountsData();
|
|
8
6
|
const out = {};
|
|
9
|
-
await Promise.all(
|
|
7
|
+
await Promise.all(testAccounts.map(async (account, i)=>{
|
|
10
8
|
const alias = `test${i}`;
|
|
11
9
|
const secret = testAccounts[i].secret;
|
|
12
10
|
const salt = new Fr(account.salt);
|
|
13
|
-
const address = account.
|
|
14
|
-
await account.register();
|
|
11
|
+
const address = account.address;
|
|
15
12
|
await db.storeAccount(address, {
|
|
16
13
|
type: 'schnorr',
|
|
17
14
|
secretKey: secret,
|
package/dest/cmds/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
2
2
|
import { type Command } from 'commander';
|
|
3
3
|
import type { WalletDB } from '../storage/wallet_db.js';
|
|
4
|
-
import type {
|
|
5
|
-
export declare function injectCommands(program: Command, log: LogFn, debugLogger: Logger,
|
|
4
|
+
import type { CliWalletAndNodeWrapper } from '../utils/cli_wallet_and_node_wrapper.js';
|
|
5
|
+
export declare function injectCommands(program: Command, log: LogFn, debugLogger: Logger, walletAndNodeWrapper: CliWalletAndNodeWrapper, db: WalletDB): Command;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dest/cmds/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cmds/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cmds/index.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAGjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAwBvF,wBAAgB,cAAc,CAC5B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,EACnB,oBAAoB,EAAE,uBAAuB,EAC7C,EAAE,EAAE,QAAQ,WAonBb"}
|