@aztec/aztec.js 3.0.0-nightly.20251113 → 3.0.0-nightly.20251114

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.
@@ -13,13 +13,12 @@ export declare class BatchCall extends BaseContractInteraction {
13
13
  */
14
14
  request(options?: RequestInteractionOptions): Promise<ExecutionPayload>;
15
15
  /**
16
- * Simulate a transaction and get its return values
17
- * Differs from prove in a few important ways:
18
- * 1. It returns the values of the function execution
19
- * 2. It supports `utility`, `private` and `public` functions
20
- *
21
- * @param options - An optional object containing additional configuration for the transaction.
22
- * @returns The result of the transaction as returned by the contract function.
16
+ * Simulates the batch, supporting private, public and utility functions. Although this is a single
17
+ * interaction with the wallet, private and public functions will be grouped into a single ExecutionPayload
18
+ * that the wallet will simulate as a single transaction. Utility function calls will simply be executed
19
+ * one by one.
20
+ * @param options - An optional object containing additional configuration for the interaction.
21
+ * @returns The results of all the interactions that make up the batch
23
22
  */
24
23
  simulate(options: SimulateInteractionOptions): Promise<any>;
25
24
  protected getExecutionPayloads(): Promise<ExecutionPayload[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"batch_call.d.ts","sourceRoot":"","sources":["../../src/contract/batch_call.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAA0B,MAAM,kBAAkB,CAAC;AAE5E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAEhC,MAAM,0BAA0B,CAAC;AAElC,qFAAqF;AACrF,qBAAa,SAAU,SAAQ,uBAAuB;IAGlD,SAAS,CAAC,YAAY,EAAE,CAAC,uBAAuB,GAAG,gBAAgB,CAAC,EAAE;gBADtE,MAAM,EAAE,MAAM,EACJ,YAAY,EAAE,CAAC,uBAAuB,GAAG,gBAAgB,CAAC,EAAE;IAKxE;;;;OAIG;IACU,OAAO,CAAC,OAAO,GAAE,yBAA8B,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAWxF;;;;;;;;OAQG;IACU,QAAQ,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,GAAG,CAAC;cAgFxD,oBAAoB,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;CAGpE"}
1
+ {"version":3,"file":"batch_call.d.ts","sourceRoot":"","sources":["../../src/contract/batch_call.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,EAIjB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAiB,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAEhC,MAAM,0BAA0B,CAAC;AAElC,qFAAqF;AACrF,qBAAa,SAAU,SAAQ,uBAAuB;IAGlD,SAAS,CAAC,YAAY,EAAE,CAAC,uBAAuB,GAAG,gBAAgB,CAAC,EAAE;gBADtE,MAAM,EAAE,MAAM,EACJ,YAAY,EAAE,CAAC,uBAAuB,GAAG,gBAAgB,CAAC,EAAE;IAKxE;;;;OAIG;IACU,OAAO,CAAC,OAAO,GAAE,yBAA8B,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAWxF;;;;;;;OAOG;IACU,QAAQ,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,GAAG,CAAC;cA2FxD,oBAAoB,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;CAGpE"}
@@ -23,13 +23,12 @@ import { toSimulateOptions } from './interaction_options.js';
23
23
  return finalExecutionPayload;
24
24
  }
25
25
  /**
26
- * Simulate a transaction and get its return values
27
- * Differs from prove in a few important ways:
28
- * 1. It returns the values of the function execution
29
- * 2. It supports `utility`, `private` and `public` functions
30
- *
31
- * @param options - An optional object containing additional configuration for the transaction.
32
- * @returns The result of the transaction as returned by the contract function.
26
+ * Simulates the batch, supporting private, public and utility functions. Although this is a single
27
+ * interaction with the wallet, private and public functions will be grouped into a single ExecutionPayload
28
+ * that the wallet will simulate as a single transaction. Utility function calls will simply be executed
29
+ * one by one.
30
+ * @param options - An optional object containing additional configuration for the interaction.
31
+ * @returns The results of all the interactions that make up the batch
33
32
  */ async simulate(options) {
34
33
  const { indexedExecutionPayloads, utility } = (await this.getExecutionPayloads()).reduce((acc, current, index)=>{
35
34
  const call = current.calls[0];
@@ -52,38 +51,57 @@ import { toSimulateOptions } from './interaction_options.js';
52
51
  publicIndex: 0,
53
52
  privateIndex: 0
54
53
  });
55
- const payloads = indexedExecutionPayloads.map(([request])=>request);
56
- const combinedPayload = mergeExecutionPayloads(payloads);
57
- const executionPayload = new ExecutionPayload(combinedPayload.calls, combinedPayload.authWitnesses.concat(options.authWitnesses ?? []), combinedPayload.capsules.concat(options.capsules ?? []), combinedPayload.extraHashedArgs);
58
- const utilityBatchPromise = utility.length > 0 ? this.wallet.batch(utility.map(([call])=>({
54
+ const batchRequests = [];
55
+ // Add utility calls to batch
56
+ for (const [call] of utility){
57
+ batchRequests.push({
59
58
  name: 'simulateUtility',
60
59
  args: [
61
60
  call,
62
61
  options?.authWitnesses,
63
62
  undefined
64
63
  ]
65
- }))) : Promise.resolve([]);
66
- const [utilityBatchResults, simulatedTx] = await Promise.all([
67
- utilityBatchPromise,
68
- indexedExecutionPayloads.length > 0 ? this.wallet.simulateTx(executionPayload, toSimulateOptions(options)) : Promise.resolve()
69
- ]);
70
- const results = [];
71
- utilityBatchResults.forEach((wrappedResult, utilityIndex)=>{
72
- const [call, originalIndex] = utility[utilityIndex];
73
- // Decode the raw field elements to the actual return type
74
- const rawReturnValues = wrappedResult.result.result;
75
- results[originalIndex] = rawReturnValues ? decodeFromAbi(call.returnTypes, rawReturnValues) : [];
76
- });
77
- if (simulatedTx) {
78
- indexedExecutionPayloads.forEach(([request, callIndex, resultIndex])=>{
79
- const call = request.calls[0];
80
- // As account entrypoints are private, for private functions we retrieve the return values from the first nested call
81
- // since we're interested in the first set of values AFTER the account entrypoint
82
- // For public functions we retrieve the first values directly from the public output.
83
- const rawReturnValues = call.type == FunctionType.PRIVATE ? simulatedTx.getPrivateReturnValues()?.nested?.[resultIndex].values : simulatedTx.getPublicReturnValues()?.[resultIndex].values;
84
- results[callIndex] = rawReturnValues ? decodeFromAbi(call.returnTypes, rawReturnValues) : [];
85
64
  });
86
65
  }
66
+ // Add tx simulation to batch if there are any private/public calls
67
+ if (indexedExecutionPayloads.length > 0) {
68
+ const payloads = indexedExecutionPayloads.map(([request])=>request);
69
+ const combinedPayload = mergeExecutionPayloads(payloads);
70
+ const executionPayload = new ExecutionPayload(combinedPayload.calls, combinedPayload.authWitnesses.concat(options.authWitnesses ?? []), combinedPayload.capsules.concat(options.capsules ?? []), combinedPayload.extraHashedArgs);
71
+ batchRequests.push({
72
+ name: 'simulateTx',
73
+ args: [
74
+ executionPayload,
75
+ toSimulateOptions(options)
76
+ ]
77
+ });
78
+ }
79
+ const batchResults = batchRequests.length > 0 ? await this.wallet.batch(batchRequests) : [];
80
+ const results = [];
81
+ // Process utility results (they come first in batch results)
82
+ for(let i = 0; i < utility.length; i++){
83
+ const [call, resultIndex] = utility[i];
84
+ const wrappedResult = batchResults[i];
85
+ if (wrappedResult.name === 'simulateUtility') {
86
+ const rawReturnValues = wrappedResult.result.result;
87
+ results[resultIndex] = rawReturnValues ? decodeFromAbi(call.returnTypes, rawReturnValues) : [];
88
+ }
89
+ }
90
+ // Process tx simulation result (it comes last if present)
91
+ if (indexedExecutionPayloads.length > 0) {
92
+ const txResultWrapper = batchResults[utility.length];
93
+ if (txResultWrapper.name === 'simulateTx') {
94
+ const simulatedTx = txResultWrapper.result;
95
+ indexedExecutionPayloads.forEach(([request, callIndex, resultIndex])=>{
96
+ const call = request.calls[0];
97
+ // As account entrypoints are private, for private functions we retrieve the return values from the first nested call
98
+ // since we're interested in the first set of values AFTER the account entrypoint
99
+ // For public functions we retrieve the first values directly from the public output.
100
+ const rawReturnValues = call.type == FunctionType.PRIVATE ? simulatedTx.getPrivateReturnValues()?.nested?.[resultIndex].values : simulatedTx.getPublicReturnValues()?.[resultIndex].values;
101
+ results[callIndex] = rawReturnValues ? decodeFromAbi(call.returnTypes, rawReturnValues) : [];
102
+ });
103
+ }
104
+ }
87
105
  return results;
88
106
  }
89
107
  async getExecutionPayloads() {
@@ -60,7 +60,7 @@ export type SendOptions = Omit<SendInteractionOptions, 'fee'> & {
60
60
  /**
61
61
  * Helper type that represents all methods that can be batched.
62
62
  */
63
- export type BatchableMethods = Pick<Wallet, 'registerContract' | 'sendTx' | 'registerSender' | 'simulateUtility'>;
63
+ export type BatchableMethods = Pick<Wallet, 'registerContract' | 'sendTx' | 'registerSender' | 'simulateUtility' | 'simulateTx'>;
64
64
  /**
65
65
  * From the batchable methods, we create a type that represents a method call with its name and arguments.
66
66
  * This is what the wallet will accept as arguments to the `batch` method.
@@ -2267,6 +2267,331 @@ export declare const BatchedMethodSchema: z.ZodUnion<[z.ZodObject<{
2267
2267
  to?: any;
2268
2268
  selector?: any;
2269
2269
  }, string[] | undefined, any[] | undefined];
2270
+ }>, z.ZodObject<{
2271
+ name: z.ZodLiteral<"simulateTx">;
2272
+ args: z.ZodTuple<[z.ZodObject<{
2273
+ calls: z.ZodArray<z.ZodObject<{
2274
+ name: z.ZodString;
2275
+ to: ZodFor<AztecAddress>;
2276
+ selector: ZodFor<import("@aztec/stdlib/abi").FunctionSelector>;
2277
+ type: z.ZodNativeEnum<typeof FunctionType>;
2278
+ isStatic: z.ZodBoolean;
2279
+ hideMsgSender: z.ZodBoolean;
2280
+ args: z.ZodArray<ZodFor<Fr>, "many">;
2281
+ returnTypes: z.ZodArray<z.ZodType<import("@aztec/stdlib/abi").AbiType, z.ZodTypeDef, import("@aztec/stdlib/abi").AbiType>, "many">;
2282
+ }, "strip", z.ZodTypeAny, {
2283
+ name: string;
2284
+ args: Fr[];
2285
+ type: FunctionType;
2286
+ to: AztecAddress;
2287
+ selector: import("@aztec/stdlib/abi").FunctionSelector;
2288
+ isStatic: boolean;
2289
+ hideMsgSender: boolean;
2290
+ returnTypes: import("@aztec/stdlib/abi").AbiType[];
2291
+ }, {
2292
+ name: string;
2293
+ args: any[];
2294
+ type: FunctionType;
2295
+ isStatic: boolean;
2296
+ hideMsgSender: boolean;
2297
+ returnTypes: import("@aztec/stdlib/abi").AbiType[];
2298
+ to?: any;
2299
+ selector?: any;
2300
+ }>, "many">;
2301
+ authWitnesses: z.ZodArray<z.ZodType<AuthWitness, any, string>, "many">;
2302
+ capsules: z.ZodArray<z.ZodType<Capsule, any, string>, "many">;
2303
+ extraHashedArgs: z.ZodArray<ZodFor<HashedValues>, "many">;
2304
+ }, "strip", z.ZodTypeAny, {
2305
+ authWitnesses: AuthWitness[];
2306
+ capsules: Capsule[];
2307
+ calls: {
2308
+ name: string;
2309
+ args: Fr[];
2310
+ type: FunctionType;
2311
+ to: AztecAddress;
2312
+ selector: import("@aztec/stdlib/abi").FunctionSelector;
2313
+ isStatic: boolean;
2314
+ hideMsgSender: boolean;
2315
+ returnTypes: import("@aztec/stdlib/abi").AbiType[];
2316
+ }[];
2317
+ extraHashedArgs: HashedValues[];
2318
+ }, {
2319
+ authWitnesses: string[];
2320
+ capsules: string[];
2321
+ calls: {
2322
+ name: string;
2323
+ args: any[];
2324
+ type: FunctionType;
2325
+ isStatic: boolean;
2326
+ hideMsgSender: boolean;
2327
+ returnTypes: import("@aztec/stdlib/abi").AbiType[];
2328
+ to?: any;
2329
+ selector?: any;
2330
+ }[];
2331
+ extraHashedArgs: any[];
2332
+ }>, z.ZodObject<{
2333
+ from: ZodFor<AztecAddress>;
2334
+ authWitnesses: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodArray<z.ZodType<AuthWitness, any, string>, "many">>;
2335
+ capsules: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodArray<z.ZodType<Capsule, any, string>, "many">>;
2336
+ fee: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodObject<{
2337
+ gasSettings: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodObject<{
2338
+ gasLimits: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodEffects<z.ZodObject<{
2339
+ daGas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
2340
+ l2Gas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
2341
+ }, "strip", z.ZodTypeAny, {
2342
+ daGas: number;
2343
+ l2Gas: number;
2344
+ }, {
2345
+ daGas: string | number | bigint;
2346
+ l2Gas: string | number | bigint;
2347
+ }>, Gas, {
2348
+ daGas: string | number | bigint;
2349
+ l2Gas: string | number | bigint;
2350
+ }>>;
2351
+ teardownGasLimits: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodEffects<z.ZodObject<{
2352
+ daGas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
2353
+ l2Gas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
2354
+ }, "strip", z.ZodTypeAny, {
2355
+ daGas: number;
2356
+ l2Gas: number;
2357
+ }, {
2358
+ daGas: string | number | bigint;
2359
+ l2Gas: string | number | bigint;
2360
+ }>, Gas, {
2361
+ daGas: string | number | bigint;
2362
+ l2Gas: string | number | bigint;
2363
+ }>>;
2364
+ maxFeePerGas: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodObject<{
2365
+ feePerDaGas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
2366
+ feePerL2Gas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
2367
+ }, "strip", z.ZodTypeAny, {
2368
+ feePerDaGas: bigint;
2369
+ feePerL2Gas: bigint;
2370
+ }, {
2371
+ feePerDaGas: string | number | bigint;
2372
+ feePerL2Gas: string | number | bigint;
2373
+ }>>;
2374
+ maxPriorityFeePerGas: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodObject<{
2375
+ feePerDaGas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
2376
+ feePerL2Gas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
2377
+ }, "strip", z.ZodTypeAny, {
2378
+ feePerDaGas: bigint;
2379
+ feePerL2Gas: bigint;
2380
+ }, {
2381
+ feePerDaGas: string | number | bigint;
2382
+ feePerL2Gas: string | number | bigint;
2383
+ }>>;
2384
+ }, "strip", z.ZodTypeAny, {
2385
+ gasLimits?: Gas | undefined;
2386
+ teardownGasLimits?: Gas | undefined;
2387
+ maxFeePerGas?: {
2388
+ feePerDaGas: bigint;
2389
+ feePerL2Gas: bigint;
2390
+ } | undefined;
2391
+ maxPriorityFeePerGas?: {
2392
+ feePerDaGas: bigint;
2393
+ feePerL2Gas: bigint;
2394
+ } | undefined;
2395
+ }, {
2396
+ gasLimits?: {
2397
+ daGas: string | number | bigint;
2398
+ l2Gas: string | number | bigint;
2399
+ } | undefined;
2400
+ teardownGasLimits?: {
2401
+ daGas: string | number | bigint;
2402
+ l2Gas: string | number | bigint;
2403
+ } | undefined;
2404
+ maxFeePerGas?: {
2405
+ feePerDaGas: string | number | bigint;
2406
+ feePerL2Gas: string | number | bigint;
2407
+ } | undefined;
2408
+ maxPriorityFeePerGas?: {
2409
+ feePerDaGas: string | number | bigint;
2410
+ feePerL2Gas: string | number | bigint;
2411
+ } | undefined;
2412
+ }>>;
2413
+ } & {
2414
+ estimatedGasPadding: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodNumber>;
2415
+ estimateGas: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodBoolean>;
2416
+ }, "strip", z.ZodTypeAny, {
2417
+ gasSettings?: {
2418
+ gasLimits?: Gas | undefined;
2419
+ teardownGasLimits?: Gas | undefined;
2420
+ maxFeePerGas?: {
2421
+ feePerDaGas: bigint;
2422
+ feePerL2Gas: bigint;
2423
+ } | undefined;
2424
+ maxPriorityFeePerGas?: {
2425
+ feePerDaGas: bigint;
2426
+ feePerL2Gas: bigint;
2427
+ } | undefined;
2428
+ } | undefined;
2429
+ estimateGas?: boolean | undefined;
2430
+ estimatedGasPadding?: number | undefined;
2431
+ }, {
2432
+ gasSettings?: {
2433
+ gasLimits?: {
2434
+ daGas: string | number | bigint;
2435
+ l2Gas: string | number | bigint;
2436
+ } | undefined;
2437
+ teardownGasLimits?: {
2438
+ daGas: string | number | bigint;
2439
+ l2Gas: string | number | bigint;
2440
+ } | undefined;
2441
+ maxFeePerGas?: {
2442
+ feePerDaGas: string | number | bigint;
2443
+ feePerL2Gas: string | number | bigint;
2444
+ } | undefined;
2445
+ maxPriorityFeePerGas?: {
2446
+ feePerDaGas: string | number | bigint;
2447
+ feePerL2Gas: string | number | bigint;
2448
+ } | undefined;
2449
+ } | undefined;
2450
+ estimateGas?: boolean | undefined;
2451
+ estimatedGasPadding?: number | undefined;
2452
+ }>>;
2453
+ skipTxValidation: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodBoolean>;
2454
+ skipFeeEnforcement: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodBoolean>;
2455
+ includeMetadata: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodBoolean>;
2456
+ }, "strip", z.ZodTypeAny, {
2457
+ from: AztecAddress;
2458
+ fee?: {
2459
+ gasSettings?: {
2460
+ gasLimits?: Gas | undefined;
2461
+ teardownGasLimits?: Gas | undefined;
2462
+ maxFeePerGas?: {
2463
+ feePerDaGas: bigint;
2464
+ feePerL2Gas: bigint;
2465
+ } | undefined;
2466
+ maxPriorityFeePerGas?: {
2467
+ feePerDaGas: bigint;
2468
+ feePerL2Gas: bigint;
2469
+ } | undefined;
2470
+ } | undefined;
2471
+ estimateGas?: boolean | undefined;
2472
+ estimatedGasPadding?: number | undefined;
2473
+ } | undefined;
2474
+ authWitnesses?: AuthWitness[] | undefined;
2475
+ capsules?: Capsule[] | undefined;
2476
+ skipTxValidation?: boolean | undefined;
2477
+ skipFeeEnforcement?: boolean | undefined;
2478
+ includeMetadata?: boolean | undefined;
2479
+ }, {
2480
+ fee?: {
2481
+ gasSettings?: {
2482
+ gasLimits?: {
2483
+ daGas: string | number | bigint;
2484
+ l2Gas: string | number | bigint;
2485
+ } | undefined;
2486
+ teardownGasLimits?: {
2487
+ daGas: string | number | bigint;
2488
+ l2Gas: string | number | bigint;
2489
+ } | undefined;
2490
+ maxFeePerGas?: {
2491
+ feePerDaGas: string | number | bigint;
2492
+ feePerL2Gas: string | number | bigint;
2493
+ } | undefined;
2494
+ maxPriorityFeePerGas?: {
2495
+ feePerDaGas: string | number | bigint;
2496
+ feePerL2Gas: string | number | bigint;
2497
+ } | undefined;
2498
+ } | undefined;
2499
+ estimateGas?: boolean | undefined;
2500
+ estimatedGasPadding?: number | undefined;
2501
+ } | undefined;
2502
+ authWitnesses?: string[] | undefined;
2503
+ capsules?: string[] | undefined;
2504
+ from?: any;
2505
+ skipTxValidation?: boolean | undefined;
2506
+ skipFeeEnforcement?: boolean | undefined;
2507
+ includeMetadata?: boolean | undefined;
2508
+ }>], null>;
2509
+ }, "strip", z.ZodTypeAny, {
2510
+ name: "simulateTx";
2511
+ args: [{
2512
+ authWitnesses: AuthWitness[];
2513
+ capsules: Capsule[];
2514
+ calls: {
2515
+ name: string;
2516
+ args: Fr[];
2517
+ type: FunctionType;
2518
+ to: AztecAddress;
2519
+ selector: import("@aztec/stdlib/abi").FunctionSelector;
2520
+ isStatic: boolean;
2521
+ hideMsgSender: boolean;
2522
+ returnTypes: import("@aztec/stdlib/abi").AbiType[];
2523
+ }[];
2524
+ extraHashedArgs: HashedValues[];
2525
+ }, {
2526
+ from: AztecAddress;
2527
+ fee?: {
2528
+ gasSettings?: {
2529
+ gasLimits?: Gas | undefined;
2530
+ teardownGasLimits?: Gas | undefined;
2531
+ maxFeePerGas?: {
2532
+ feePerDaGas: bigint;
2533
+ feePerL2Gas: bigint;
2534
+ } | undefined;
2535
+ maxPriorityFeePerGas?: {
2536
+ feePerDaGas: bigint;
2537
+ feePerL2Gas: bigint;
2538
+ } | undefined;
2539
+ } | undefined;
2540
+ estimateGas?: boolean | undefined;
2541
+ estimatedGasPadding?: number | undefined;
2542
+ } | undefined;
2543
+ authWitnesses?: AuthWitness[] | undefined;
2544
+ capsules?: Capsule[] | undefined;
2545
+ skipTxValidation?: boolean | undefined;
2546
+ skipFeeEnforcement?: boolean | undefined;
2547
+ includeMetadata?: boolean | undefined;
2548
+ }];
2549
+ }, {
2550
+ name: "simulateTx";
2551
+ args: [{
2552
+ authWitnesses: string[];
2553
+ capsules: string[];
2554
+ calls: {
2555
+ name: string;
2556
+ args: any[];
2557
+ type: FunctionType;
2558
+ isStatic: boolean;
2559
+ hideMsgSender: boolean;
2560
+ returnTypes: import("@aztec/stdlib/abi").AbiType[];
2561
+ to?: any;
2562
+ selector?: any;
2563
+ }[];
2564
+ extraHashedArgs: any[];
2565
+ }, {
2566
+ fee?: {
2567
+ gasSettings?: {
2568
+ gasLimits?: {
2569
+ daGas: string | number | bigint;
2570
+ l2Gas: string | number | bigint;
2571
+ } | undefined;
2572
+ teardownGasLimits?: {
2573
+ daGas: string | number | bigint;
2574
+ l2Gas: string | number | bigint;
2575
+ } | undefined;
2576
+ maxFeePerGas?: {
2577
+ feePerDaGas: string | number | bigint;
2578
+ feePerL2Gas: string | number | bigint;
2579
+ } | undefined;
2580
+ maxPriorityFeePerGas?: {
2581
+ feePerDaGas: string | number | bigint;
2582
+ feePerL2Gas: string | number | bigint;
2583
+ } | undefined;
2584
+ } | undefined;
2585
+ estimateGas?: boolean | undefined;
2586
+ estimatedGasPadding?: number | undefined;
2587
+ } | undefined;
2588
+ authWitnesses?: string[] | undefined;
2589
+ capsules?: string[] | undefined;
2590
+ from?: any;
2591
+ skipTxValidation?: boolean | undefined;
2592
+ skipFeeEnforcement?: boolean | undefined;
2593
+ includeMetadata?: boolean | undefined;
2594
+ }];
2270
2595
  }>]>;
2271
2596
  export declare const ContractMetadataSchema: z.ZodObject<{
2272
2597
  contractInstance: z.ZodUnion<[z.ZodIntersection<z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAEL,KAAK,gBAAgB,EAErB,KAAK,uBAAuB,EAE5B,KAAK,YAAY,EACjB,YAAY,EACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EACL,KAAK,qBAAqB,EAE1B,KAAK,2BAA2B,EAEhC,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAoB,KAAK,YAAY,EAAE,KAAK,MAAM,EAAqB,MAAM,uBAAuB,CAAC;AAC5G,OAAO,EACL,OAAO,EACP,YAAY,EACZ,MAAM,EACN,eAAe,EACf,SAAS,EACT,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,QAAQ,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,CAAC,MAAM,CAgD7C,CAAC"}
@@ -124,6 +124,13 @@ export const BatchedMethodSchema = z.union([
124
124
  optional(z.array(AuthWitness.schema)),
125
125
  optional(z.array(schemas.AztecAddress))
126
126
  ])
127
+ }),
128
+ z.object({
129
+ name: z.literal('simulateTx'),
130
+ args: z.tuple([
131
+ ExecutionPayloadSchema,
132
+ SimulateOptionsSchema
133
+ ])
127
134
  })
128
135
  ]);
129
136
  export const ContractMetadataSchema = z.object({
@@ -191,6 +198,10 @@ export const WalletSchema = {
191
198
  z.object({
192
199
  name: z.literal('simulateUtility'),
193
200
  result: UtilitySimulationResult.schema
201
+ }),
202
+ z.object({
203
+ name: z.literal('simulateTx'),
204
+ result: TxSimulationResult.schema
194
205
  })
195
206
  ])))
196
207
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aztec/aztec.js",
3
3
  "homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/aztec.js",
4
- "version": "3.0.0-nightly.20251113",
4
+ "version": "3.0.0-nightly.20251114",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  "./abi": "./dest/api/abi.js",
@@ -84,13 +84,13 @@
84
84
  ]
85
85
  },
86
86
  "dependencies": {
87
- "@aztec/constants": "3.0.0-nightly.20251113",
88
- "@aztec/entrypoints": "3.0.0-nightly.20251113",
89
- "@aztec/ethereum": "3.0.0-nightly.20251113",
90
- "@aztec/foundation": "3.0.0-nightly.20251113",
91
- "@aztec/l1-artifacts": "3.0.0-nightly.20251113",
92
- "@aztec/protocol-contracts": "3.0.0-nightly.20251113",
93
- "@aztec/stdlib": "3.0.0-nightly.20251113",
87
+ "@aztec/constants": "3.0.0-nightly.20251114",
88
+ "@aztec/entrypoints": "3.0.0-nightly.20251114",
89
+ "@aztec/ethereum": "3.0.0-nightly.20251114",
90
+ "@aztec/foundation": "3.0.0-nightly.20251114",
91
+ "@aztec/l1-artifacts": "3.0.0-nightly.20251114",
92
+ "@aztec/protocol-contracts": "3.0.0-nightly.20251114",
93
+ "@aztec/stdlib": "3.0.0-nightly.20251114",
94
94
  "axios": "^1.12.0",
95
95
  "tslib": "^2.4.0",
96
96
  "viem": "npm:@spalladino/viem@2.38.2-eip7594.0",
@@ -1,7 +1,12 @@
1
1
  import { type FunctionCall, FunctionType, decodeFromAbi } from '@aztec/stdlib/abi';
2
- import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/stdlib/tx';
2
+ import {
3
+ ExecutionPayload,
4
+ TxSimulationResult,
5
+ UtilitySimulationResult,
6
+ mergeExecutionPayloads,
7
+ } from '@aztec/stdlib/tx';
3
8
 
4
- import type { Wallet } from '../wallet/wallet.js';
9
+ import type { BatchedMethod, Wallet } from '../wallet/wallet.js';
5
10
  import { BaseContractInteraction } from './base_contract_interaction.js';
6
11
  import {
7
12
  type RequestInteractionOptions,
@@ -35,13 +40,12 @@ export class BatchCall extends BaseContractInteraction {
35
40
  }
36
41
 
37
42
  /**
38
- * Simulate a transaction and get its return values
39
- * Differs from prove in a few important ways:
40
- * 1. It returns the values of the function execution
41
- * 2. It supports `utility`, `private` and `public` functions
42
- *
43
- * @param options - An optional object containing additional configuration for the transaction.
44
- * @returns The result of the transaction as returned by the contract function.
43
+ * Simulates the batch, supporting private, public and utility functions. Although this is a single
44
+ * interaction with the wallet, private and public functions will be grouped into a single ExecutionPayload
45
+ * that the wallet will simulate as a single transaction. Utility function calls will simply be executed
46
+ * one by one.
47
+ * @param options - An optional object containing additional configuration for the interaction.
48
+ * @returns The results of all the interactions that make up the batch
45
49
  */
46
50
  public async simulate(options: SimulateInteractionOptions): Promise<any> {
47
51
  const { indexedExecutionPayloads, utility } = (await this.getExecutionPayloads()).reduce<{
@@ -70,54 +74,65 @@ export class BatchCall extends BaseContractInteraction {
70
74
  { indexedExecutionPayloads: [], utility: [], publicIndex: 0, privateIndex: 0 },
71
75
  );
72
76
 
73
- const payloads = indexedExecutionPayloads.map(([request]) => request);
74
- const combinedPayload = mergeExecutionPayloads(payloads);
75
- const executionPayload = new ExecutionPayload(
76
- combinedPayload.calls,
77
- combinedPayload.authWitnesses.concat(options.authWitnesses ?? []),
78
- combinedPayload.capsules.concat(options.capsules ?? []),
79
- combinedPayload.extraHashedArgs,
80
- );
77
+ const batchRequests: Array<BatchedMethod<'simulateUtility'> | BatchedMethod<'simulateTx'>> = [];
78
+
79
+ // Add utility calls to batch
80
+ for (const [call] of utility) {
81
+ batchRequests.push({
82
+ name: 'simulateUtility' as const,
83
+ args: [call, options?.authWitnesses, undefined] as const,
84
+ });
85
+ }
81
86
 
82
- const utilityBatchPromise =
83
- utility.length > 0
84
- ? this.wallet.batch(
85
- utility.map(([call]) => ({
86
- name: 'simulateUtility' as const,
87
- args: [call, options?.authWitnesses, undefined] as const,
88
- })),
89
- )
90
- : Promise.resolve([]);
87
+ // Add tx simulation to batch if there are any private/public calls
88
+ if (indexedExecutionPayloads.length > 0) {
89
+ const payloads = indexedExecutionPayloads.map(([request]) => request);
90
+ const combinedPayload = mergeExecutionPayloads(payloads);
91
+ const executionPayload = new ExecutionPayload(
92
+ combinedPayload.calls,
93
+ combinedPayload.authWitnesses.concat(options.authWitnesses ?? []),
94
+ combinedPayload.capsules.concat(options.capsules ?? []),
95
+ combinedPayload.extraHashedArgs,
96
+ );
91
97
 
92
- const [utilityBatchResults, simulatedTx] = await Promise.all([
93
- utilityBatchPromise,
94
- indexedExecutionPayloads.length > 0
95
- ? this.wallet.simulateTx(executionPayload, toSimulateOptions(options))
96
- : Promise.resolve(),
97
- ]);
98
+ batchRequests.push({
99
+ name: 'simulateTx' as const,
100
+ args: [executionPayload, toSimulateOptions(options)],
101
+ });
102
+ }
103
+
104
+ const batchResults = batchRequests.length > 0 ? await this.wallet.batch(batchRequests) : [];
98
105
 
99
106
  const results: any[] = [];
100
107
 
101
- utilityBatchResults.forEach((wrappedResult, utilityIndex) => {
102
- const [call, originalIndex] = utility[utilityIndex];
103
- // Decode the raw field elements to the actual return type
104
- const rawReturnValues = wrappedResult.result.result;
105
- results[originalIndex] = rawReturnValues ? decodeFromAbi(call.returnTypes, rawReturnValues) : [];
106
- });
108
+ // Process utility results (they come first in batch results)
109
+ for (let i = 0; i < utility.length; i++) {
110
+ const [call, resultIndex] = utility[i];
111
+ const wrappedResult = batchResults[i];
112
+ if (wrappedResult.name === 'simulateUtility') {
113
+ const rawReturnValues = (wrappedResult.result as UtilitySimulationResult).result;
114
+ results[resultIndex] = rawReturnValues ? decodeFromAbi(call.returnTypes, rawReturnValues) : [];
115
+ }
116
+ }
107
117
 
108
- if (simulatedTx) {
109
- indexedExecutionPayloads.forEach(([request, callIndex, resultIndex]) => {
110
- const call = request.calls[0];
111
- // As account entrypoints are private, for private functions we retrieve the return values from the first nested call
112
- // since we're interested in the first set of values AFTER the account entrypoint
113
- // For public functions we retrieve the first values directly from the public output.
114
- const rawReturnValues =
115
- call.type == FunctionType.PRIVATE
116
- ? simulatedTx.getPrivateReturnValues()?.nested?.[resultIndex].values
117
- : simulatedTx.getPublicReturnValues()?.[resultIndex].values;
118
+ // Process tx simulation result (it comes last if present)
119
+ if (indexedExecutionPayloads.length > 0) {
120
+ const txResultWrapper = batchResults[utility.length];
121
+ if (txResultWrapper.name === 'simulateTx') {
122
+ const simulatedTx = txResultWrapper.result as TxSimulationResult;
123
+ indexedExecutionPayloads.forEach(([request, callIndex, resultIndex]) => {
124
+ const call = request.calls[0];
125
+ // As account entrypoints are private, for private functions we retrieve the return values from the first nested call
126
+ // since we're interested in the first set of values AFTER the account entrypoint
127
+ // For public functions we retrieve the first values directly from the public output.
128
+ const rawReturnValues =
129
+ call.type == FunctionType.PRIVATE
130
+ ? simulatedTx.getPrivateReturnValues()?.nested?.[resultIndex].values
131
+ : simulatedTx.getPublicReturnValues()?.[resultIndex].values;
118
132
 
119
- results[callIndex] = rawReturnValues ? decodeFromAbi(call.returnTypes, rawReturnValues) : [];
120
- });
133
+ results[callIndex] = rawReturnValues ? decodeFromAbi(call.returnTypes, rawReturnValues) : [];
134
+ });
135
+ }
121
136
  }
122
137
 
123
138
  return results;
@@ -97,7 +97,10 @@ export type SendOptions = Omit<SendInteractionOptions, 'fee'> & {
97
97
  /**
98
98
  * Helper type that represents all methods that can be batched.
99
99
  */
100
- export type BatchableMethods = Pick<Wallet, 'registerContract' | 'sendTx' | 'registerSender' | 'simulateUtility'>;
100
+ export type BatchableMethods = Pick<
101
+ Wallet,
102
+ 'registerContract' | 'sendTx' | 'registerSender' | 'simulateUtility' | 'simulateTx'
103
+ >;
101
104
 
102
105
  /**
103
106
  * From the batchable methods, we create a type that represents a method call with its name and arguments.
@@ -276,6 +279,10 @@ export const BatchedMethodSchema = z.union([
276
279
  name: z.literal('simulateUtility'),
277
280
  args: z.tuple([FunctionCallSchema, optional(z.array(AuthWitness.schema)), optional(z.array(schemas.AztecAddress))]),
278
281
  }),
282
+ z.object({
283
+ name: z.literal('simulateTx'),
284
+ args: z.tuple([ExecutionPayloadSchema, SimulateOptionsSchema]),
285
+ }),
279
286
  ]);
280
287
 
281
288
  export const ContractMetadataSchema = z.object({
@@ -340,6 +347,7 @@ export const WalletSchema: ApiSchemaFor<Wallet> = {
340
347
  z.object({ name: z.literal('registerContract'), result: ContractInstanceWithAddressSchema }),
341
348
  z.object({ name: z.literal('sendTx'), result: TxHash.schema }),
342
349
  z.object({ name: z.literal('simulateUtility'), result: UtilitySimulationResult.schema }),
350
+ z.object({ name: z.literal('simulateTx'), result: TxSimulationResult.schema }),
343
351
  ]),
344
352
  ),
345
353
  ),