@aztec/cli-wallet 0.0.1-commit.8afd444 → 0.0.1-commit.8f9871590
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/check_tx.js +2 -1
- 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/utils/wallet.ts +53 -46
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()];
|
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2FsbGV0LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbHMvd2FsbGV0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUlBLE9BQU8sRUFBRSxLQUFLLE9BQU8sRUFBMkMsTUFBTSx5Qk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dCQUFnQixFQUFFLElBQUksRUFBRSxlQUFlLEdBQUcsT0FBTyxDQUFDLGtCQUFrQixDQUFDLENBU2hIO0lBRUQ7OztPQUdHO0lBQ0gsVUFBeUIscUJBQXFCLENBQzVDLGdCQUFnQixFQUFFLGdCQUFnQixFQUNsQyxJQUFJLEVBQUUsWUFBWSxFQUNsQixVQUFVLEVBQUUsVUFBVSxFQUN0QixNQUFNLEVBQUUsWUFBWSxFQUNwQixnQkFBZ0IsQ0FBQyxFQUFFLE9BQU8sRUFDMUIsa0JBQWtCLENBQUMsRUFBRSxPQUFPLEdBQzNCLE9BQU8sQ0FBQyxrQkFBa0IsQ0FBQyxDQXVDN0I7SUFJRCxZQUFZLElBQUksT0FBTyxDQUFDLFlBQVksRUFBRSxDQUFDLENBRXRDO0lBSUQsUUFBUSxDQUFDLE1BQU0sRUFBRSxXQUFXLEdBQUcsT0FBTyxDQUFDLE9BQU8sRUFBRSxDQUFDLENBRWhEO0lBSUQsbUJBQW1CLENBQUMsRUFBRSxFQUFFLEVBQUUscUVBRXpCO0NBQ0YifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/utils/wallet.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAA2C,MAAM,yBAAyB,CAAC;AAChG,OAAO,EACL,KAAK,qBAAqB,EAG3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,KAAK,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE5F,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/utils/wallet.ts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allet 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.scopesFor(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.8f9871590",
|
|
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.8f9871590",
|
|
71
|
+
"@aztec/aztec.js": "0.0.1-commit.8f9871590",
|
|
72
|
+
"@aztec/bb.js": "0.0.1-commit.8f9871590",
|
|
73
|
+
"@aztec/cli": "0.0.1-commit.8f9871590",
|
|
74
|
+
"@aztec/entrypoints": "0.0.1-commit.8f9871590",
|
|
75
|
+
"@aztec/ethereum": "0.0.1-commit.8f9871590",
|
|
76
|
+
"@aztec/foundation": "0.0.1-commit.8f9871590",
|
|
77
|
+
"@aztec/kv-store": "0.0.1-commit.8f9871590",
|
|
78
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.8f9871590",
|
|
79
|
+
"@aztec/noir-noirc_abi": "0.0.1-commit.8f9871590",
|
|
80
|
+
"@aztec/pxe": "0.0.1-commit.8f9871590",
|
|
81
|
+
"@aztec/stdlib": "0.0.1-commit.8f9871590",
|
|
82
|
+
"@aztec/wallet-sdk": "0.0.1-commit.8f9871590",
|
|
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()];
|
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.scopesFor(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
|