@aztec/cli-wallet 0.82.2 → 0.82.3-nightly.20250330
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/create_account.d.ts.map +1 -1
- package/dest/cmds/create_account.js +16 -1
- package/dest/cmds/deploy_account.d.ts.map +1 -1
- package/dest/cmds/deploy_account.js +17 -1
- package/dest/storage/wallet_db.d.ts +1 -1
- package/dest/utils/accounts.d.ts +1 -1
- package/dest/utils/accounts.d.ts.map +1 -1
- package/dest/utils/accounts.js +7 -0
- package/package.json +12 -12
- package/src/cmds/create_account.ts +13 -1
- package/src/cmds/deploy_account.ts +14 -1
- package/src/utils/accounts.ts +6 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create_account.d.ts","sourceRoot":"","sources":["../../src/cmds/create_account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAwB,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEjE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,WAAW,EAA2B,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,KAAK,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAE5E,wBAAsB,aAAa,CACjC,MAAM,EAAE,GAAG,EACX,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,EAAE,GAAG,SAAS,EACzB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,OAAO,EACrB,kBAAkB,EAAE,OAAO,EAC3B,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,OAAO,EACb,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK;;;;;
|
|
1
|
+
{"version":3,"file":"create_account.d.ts","sourceRoot":"","sources":["../../src/cmds/create_account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAwB,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEjE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,WAAW,EAA2B,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,KAAK,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAE5E,wBAAsB,aAAa,CACjC,MAAM,EAAE,GAAG,EACX,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,EAAE,GAAG,SAAS,EACzB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,OAAO,EACrB,kBAAkB,EAAE,OAAO,EAC3B,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,OAAO,EACb,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK;;;;;GA8GX"}
|
|
@@ -43,7 +43,22 @@ export async function createAccount(client, accountType, secretKey, publicKey, a
|
|
|
43
43
|
...await feeOpts.toDeployAccountOpts(wallet)
|
|
44
44
|
};
|
|
45
45
|
if (feeOpts.estimateOnly) {
|
|
46
|
-
|
|
46
|
+
/*
|
|
47
|
+
* This is usually handled by accountManager.deploy(), but we're accessing the lower
|
|
48
|
+
* level method to get the gas estimates. That means we have to replicate some of the logic here.
|
|
49
|
+
* In case we're deploying our own account, we need to hijack the payment method for the fee,
|
|
50
|
+
* wrapping it in the one that will make use of the freshly deployed account's
|
|
51
|
+
* entrypoint. For reference, see aztec.js/src/account_manager.ts:deploy()
|
|
52
|
+
*/ const fee = !deployOpts?.deployWallet && deployOpts?.fee ? {
|
|
53
|
+
...deployOpts.fee,
|
|
54
|
+
paymentMethod: await account.getSelfPaymentMethod(deployOpts.fee.paymentMethod)
|
|
55
|
+
} : deployOpts?.fee;
|
|
56
|
+
const deployMethod = await account.getDeployMethod(deployOpts.deployWallet);
|
|
57
|
+
const gas = await deployMethod.estimateGas({
|
|
58
|
+
...deployOpts,
|
|
59
|
+
fee,
|
|
60
|
+
universalDeploy: true
|
|
61
|
+
});
|
|
47
62
|
if (json) {
|
|
48
63
|
out.fee = {
|
|
49
64
|
gasLimits: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy_account.d.ts","sourceRoot":"","sources":["../../src/cmds/deploy_account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAwB,MAAM,iBAAiB,CAAC;AAE5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAE5E,wBAAsB,aAAa,CACjC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,OAAO,EACb,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,KAAK,EAAE,cAAc,EAAwB,MAAM,iBAAiB,CAAC;AAE5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAE5E,wBAAsB,aAAa,CACjC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,OAAO,EACb,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK;;;;GA6FX"}
|
|
@@ -28,10 +28,26 @@ export async function deployAccount(account, wait, feeOpts, json, debugLogger, l
|
|
|
28
28
|
let txReceipt;
|
|
29
29
|
const deployOpts = {
|
|
30
30
|
skipInitialization: false,
|
|
31
|
+
skipPublicDeployment: false,
|
|
31
32
|
...await feeOpts.toDeployAccountOpts(wallet)
|
|
32
33
|
};
|
|
33
34
|
if (feeOpts.estimateOnly) {
|
|
34
|
-
|
|
35
|
+
/*
|
|
36
|
+
* This is usually handled by accountManager.deploy(), but we're accessing the lower
|
|
37
|
+
* level method to get the gas estimates. That means we have to replicate some of the logic here.
|
|
38
|
+
* In case we're deploying our own account, we need to hijack the payment method for the fee,
|
|
39
|
+
* wrapping it in the one that will make use of the freshly deployed account's
|
|
40
|
+
* entrypoint. For reference, see aztec.js/src/account_manager.ts:deploy()
|
|
41
|
+
*/ const fee = !deployOpts?.deployWallet && deployOpts?.fee ? {
|
|
42
|
+
...deployOpts.fee,
|
|
43
|
+
paymentMethod: await account.getSelfPaymentMethod(deployOpts.fee.paymentMethod)
|
|
44
|
+
} : deployOpts?.fee;
|
|
45
|
+
const deployMethod = await account.getDeployMethod(deployOpts.deployWallet);
|
|
46
|
+
const gas = await deployMethod.estimateGas({
|
|
47
|
+
...deployOpts,
|
|
48
|
+
fee,
|
|
49
|
+
universalDeploy: true
|
|
50
|
+
});
|
|
35
51
|
if (json) {
|
|
36
52
|
out.fee = {
|
|
37
53
|
gasLimits: {
|
|
@@ -58,7 +58,7 @@ export declare class WalletDB {
|
|
|
58
58
|
address: string | AztecAddress;
|
|
59
59
|
secretKey: Fr;
|
|
60
60
|
salt: Fr;
|
|
61
|
-
type: "schnorr" | "ecdsasecp256r1ssh" | "ecdsasecp256k1";
|
|
61
|
+
type: "schnorr" | "ecdsasecp256r1" | "ecdsasecp256r1ssh" | "ecdsasecp256k1";
|
|
62
62
|
}>;
|
|
63
63
|
storeAlias(type: AliasType, key: string, value: Buffer, log: LogFn): Promise<void>;
|
|
64
64
|
}
|
package/dest/utils/accounts.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
3
3
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
4
|
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
5
5
|
import type { WalletDB } from '../storage/wallet_db.js';
|
|
6
|
-
export declare const AccountTypes: readonly ["schnorr", "ecdsasecp256r1ssh", "ecdsasecp256k1"];
|
|
6
|
+
export declare const AccountTypes: readonly ["schnorr", "ecdsasecp256r1", "ecdsasecp256r1ssh", "ecdsasecp256k1"];
|
|
7
7
|
export type AccountType = (typeof AccountTypes)[number];
|
|
8
8
|
export declare function createOrRetrieveAccount(pxe: PXE, address?: AztecAddress, db?: WalletDB, secretKey?: Fr, type?: AccountType, salt?: Fr, publicKey?: string | undefined): Promise<AccountManager>;
|
|
9
9
|
//# sourceMappingURL=accounts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/utils/accounts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAG3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGxD,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/utils/accounts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAG3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGxD,eAAO,MAAM,YAAY,+EAAgF,CAAC;AAC1G,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAExD,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,GAAG,EACR,OAAO,CAAC,EAAE,YAAY,EACtB,EAAE,CAAC,EAAE,QAAQ,EACb,SAAS,CAAC,EAAE,EAAE,EACd,IAAI,GAAE,WAAuB,EAC7B,IAAI,CAAC,EAAE,EAAE,EACT,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,GAC7B,OAAO,CAAC,cAAc,CAAC,CAuDzB"}
|
package/dest/utils/accounts.js
CHANGED
|
@@ -4,6 +4,7 @@ import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
|
4
4
|
import { extractECDSAPublicKeyFromBase64String } from './ecdsa.js';
|
|
5
5
|
export const AccountTypes = [
|
|
6
6
|
'schnorr',
|
|
7
|
+
'ecdsasecp256r1',
|
|
7
8
|
'ecdsasecp256r1ssh',
|
|
8
9
|
'ecdsasecp256k1'
|
|
9
10
|
];
|
|
@@ -26,6 +27,12 @@ export async function createOrRetrieveAccount(pxe, address, db, secretKey, type
|
|
|
26
27
|
account = getSchnorrAccount(pxe, secretKey, deriveSigningKey(secretKey), salt);
|
|
27
28
|
break;
|
|
28
29
|
}
|
|
30
|
+
case 'ecdsasecp256r1':
|
|
31
|
+
{
|
|
32
|
+
const { getEcdsaRAccount } = await import('@aztec/accounts/ecdsa');
|
|
33
|
+
account = getEcdsaRAccount(pxe, secretKey, deriveSigningKey(secretKey).toBuffer(), salt);
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
29
36
|
case 'ecdsasecp256r1ssh':
|
|
30
37
|
{
|
|
31
38
|
let publicSigningKey;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/cli-wallet",
|
|
3
|
-
"version": "0.82.
|
|
3
|
+
"version": "0.82.3-nightly.20250330",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/cmds/index.js",
|
|
@@ -65,17 +65,17 @@
|
|
|
65
65
|
]
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@aztec/accounts": "0.82.
|
|
69
|
-
"@aztec/aztec.js": "0.82.
|
|
70
|
-
"@aztec/cli": "0.82.
|
|
71
|
-
"@aztec/entrypoints": "0.82.
|
|
72
|
-
"@aztec/ethereum": "0.82.
|
|
73
|
-
"@aztec/foundation": "0.82.
|
|
74
|
-
"@aztec/kv-store": "0.82.
|
|
75
|
-
"@aztec/noir-contracts.js": "0.82.
|
|
76
|
-
"@aztec/noir-noirc_abi": "0.82.
|
|
77
|
-
"@aztec/pxe": "0.82.
|
|
78
|
-
"@aztec/stdlib": "0.82.
|
|
68
|
+
"@aztec/accounts": "0.82.3-nightly.20250330",
|
|
69
|
+
"@aztec/aztec.js": "0.82.3-nightly.20250330",
|
|
70
|
+
"@aztec/cli": "0.82.3-nightly.20250330",
|
|
71
|
+
"@aztec/entrypoints": "0.82.3-nightly.20250330",
|
|
72
|
+
"@aztec/ethereum": "0.82.3-nightly.20250330",
|
|
73
|
+
"@aztec/foundation": "0.82.3-nightly.20250330",
|
|
74
|
+
"@aztec/kv-store": "0.82.3-nightly.20250330",
|
|
75
|
+
"@aztec/noir-contracts.js": "0.82.3-nightly.20250330",
|
|
76
|
+
"@aztec/noir-noirc_abi": "0.82.3-nightly.20250330",
|
|
77
|
+
"@aztec/pxe": "0.82.3-nightly.20250330",
|
|
78
|
+
"@aztec/stdlib": "0.82.3-nightly.20250330",
|
|
79
79
|
"@msgpack/msgpack": "^3.0.0-beta2",
|
|
80
80
|
"commander": "^12.1.0",
|
|
81
81
|
"inquirer": "^10.1.8",
|
|
@@ -72,7 +72,19 @@ export async function createAccount(
|
|
|
72
72
|
...(await feeOpts.toDeployAccountOpts(wallet)),
|
|
73
73
|
};
|
|
74
74
|
if (feeOpts.estimateOnly) {
|
|
75
|
-
|
|
75
|
+
/*
|
|
76
|
+
* This is usually handled by accountManager.deploy(), but we're accessing the lower
|
|
77
|
+
* level method to get the gas estimates. That means we have to replicate some of the logic here.
|
|
78
|
+
* In case we're deploying our own account, we need to hijack the payment method for the fee,
|
|
79
|
+
* wrapping it in the one that will make use of the freshly deployed account's
|
|
80
|
+
* entrypoint. For reference, see aztec.js/src/account_manager.ts:deploy()
|
|
81
|
+
*/
|
|
82
|
+
const fee =
|
|
83
|
+
!deployOpts?.deployWallet && deployOpts?.fee
|
|
84
|
+
? { ...deployOpts.fee, paymentMethod: await account.getSelfPaymentMethod(deployOpts.fee.paymentMethod) }
|
|
85
|
+
: deployOpts?.fee;
|
|
86
|
+
const deployMethod = await account.getDeployMethod(deployOpts.deployWallet);
|
|
87
|
+
const gas = await deployMethod.estimateGas({ ...deployOpts, fee, universalDeploy: true });
|
|
76
88
|
if (json) {
|
|
77
89
|
out.fee = {
|
|
78
90
|
gasLimits: {
|
|
@@ -42,11 +42,24 @@ export async function deployAccount(
|
|
|
42
42
|
|
|
43
43
|
const deployOpts: DeployAccountOptions = {
|
|
44
44
|
skipInitialization: false,
|
|
45
|
+
skipPublicDeployment: false,
|
|
45
46
|
...(await feeOpts.toDeployAccountOpts(wallet)),
|
|
46
47
|
};
|
|
47
48
|
|
|
48
49
|
if (feeOpts.estimateOnly) {
|
|
49
|
-
|
|
50
|
+
/*
|
|
51
|
+
* This is usually handled by accountManager.deploy(), but we're accessing the lower
|
|
52
|
+
* level method to get the gas estimates. That means we have to replicate some of the logic here.
|
|
53
|
+
* In case we're deploying our own account, we need to hijack the payment method for the fee,
|
|
54
|
+
* wrapping it in the one that will make use of the freshly deployed account's
|
|
55
|
+
* entrypoint. For reference, see aztec.js/src/account_manager.ts:deploy()
|
|
56
|
+
*/
|
|
57
|
+
const fee =
|
|
58
|
+
!deployOpts?.deployWallet && deployOpts?.fee
|
|
59
|
+
? { ...deployOpts.fee, paymentMethod: await account.getSelfPaymentMethod(deployOpts.fee.paymentMethod) }
|
|
60
|
+
: deployOpts?.fee;
|
|
61
|
+
const deployMethod = await account.getDeployMethod(deployOpts.deployWallet);
|
|
62
|
+
const gas = await deployMethod.estimateGas({ ...deployOpts, fee, universalDeploy: true });
|
|
50
63
|
if (json) {
|
|
51
64
|
out.fee = {
|
|
52
65
|
gasLimits: {
|
package/src/utils/accounts.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
|
8
8
|
import type { WalletDB } from '../storage/wallet_db.js';
|
|
9
9
|
import { extractECDSAPublicKeyFromBase64String } from './ecdsa.js';
|
|
10
10
|
|
|
11
|
-
export const AccountTypes = ['schnorr', 'ecdsasecp256r1ssh', 'ecdsasecp256k1'] as const;
|
|
11
|
+
export const AccountTypes = ['schnorr', 'ecdsasecp256r1', 'ecdsasecp256r1ssh', 'ecdsasecp256k1'] as const;
|
|
12
12
|
export type AccountType = (typeof AccountTypes)[number];
|
|
13
13
|
|
|
14
14
|
export async function createOrRetrieveAccount(
|
|
@@ -42,6 +42,11 @@ export async function createOrRetrieveAccount(
|
|
|
42
42
|
account = getSchnorrAccount(pxe, secretKey, deriveSigningKey(secretKey), salt);
|
|
43
43
|
break;
|
|
44
44
|
}
|
|
45
|
+
case 'ecdsasecp256r1': {
|
|
46
|
+
const { getEcdsaRAccount } = await import('@aztec/accounts/ecdsa');
|
|
47
|
+
account = getEcdsaRAccount(pxe, secretKey, deriveSigningKey(secretKey).toBuffer(), salt);
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
45
50
|
case 'ecdsasecp256r1ssh': {
|
|
46
51
|
let publicSigningKey;
|
|
47
52
|
if (db && address) {
|