@aztec/aztec.js 3.0.0-nightly.20251112 → 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.
Files changed (76) hide show
  1. package/dest/account/account.d.ts +1 -2
  2. package/dest/account/account.d.ts.map +1 -1
  3. package/dest/account/signerless_account.d.ts +1 -2
  4. package/dest/account/signerless_account.d.ts.map +1 -1
  5. package/dest/api/contract.d.ts +1 -1
  6. package/dest/api/contract.d.ts.map +1 -1
  7. package/dest/api/tx.d.ts +1 -1
  8. package/dest/api/tx.d.ts.map +1 -1
  9. package/dest/api/tx.js +1 -1
  10. package/dest/api/wallet.d.ts +1 -1
  11. package/dest/api/wallet.d.ts.map +1 -1
  12. package/dest/api/wallet.js +1 -1
  13. package/dest/contract/base_contract_interaction.d.ts +1 -2
  14. package/dest/contract/base_contract_interaction.d.ts.map +1 -1
  15. package/dest/contract/base_contract_interaction.js +1 -1
  16. package/dest/contract/batch_call.d.ts +7 -8
  17. package/dest/contract/batch_call.d.ts.map +1 -1
  18. package/dest/contract/batch_call.js +53 -34
  19. package/dest/contract/contract_function_interaction.d.ts +1 -1
  20. package/dest/contract/contract_function_interaction.d.ts.map +1 -1
  21. package/dest/contract/contract_function_interaction.js +9 -6
  22. package/dest/contract/deploy_method.d.ts +1 -1
  23. package/dest/contract/deploy_method.d.ts.map +1 -1
  24. package/dest/contract/deploy_method.js +4 -4
  25. package/dest/contract/interaction_options.d.ts +3 -3
  26. package/dest/contract/interaction_options.d.ts.map +1 -1
  27. package/dest/contract/interaction_options.js +4 -10
  28. package/dest/fee/fee_juice_payment_method_with_claim.d.ts +1 -1
  29. package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -1
  30. package/dest/fee/fee_juice_payment_method_with_claim.js +2 -2
  31. package/dest/fee/fee_payment_method.d.ts +1 -1
  32. package/dest/fee/fee_payment_method.d.ts.map +1 -1
  33. package/dest/fee/private_fee_payment_method.d.ts +1 -1
  34. package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
  35. package/dest/fee/private_fee_payment_method.js +3 -3
  36. package/dest/fee/public_fee_payment_method.d.ts +1 -1
  37. package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
  38. package/dest/fee/public_fee_payment_method.js +3 -3
  39. package/dest/fee/sponsored_fee_payment.d.ts +1 -1
  40. package/dest/fee/sponsored_fee_payment.d.ts.map +1 -1
  41. package/dest/fee/sponsored_fee_payment.js +2 -2
  42. package/dest/utils/authwit.d.ts.map +1 -1
  43. package/dest/utils/authwit.js +20 -4
  44. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts +1 -1
  45. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -1
  46. package/dest/wallet/account_entrypoint_meta_payment_method.js +2 -2
  47. package/dest/wallet/base_wallet.d.ts +16 -14
  48. package/dest/wallet/base_wallet.d.ts.map +1 -1
  49. package/dest/wallet/base_wallet.js +27 -26
  50. package/dest/wallet/deploy_account_method.d.ts +1 -1
  51. package/dest/wallet/deploy_account_method.d.ts.map +1 -1
  52. package/dest/wallet/deploy_account_method.js +1 -1
  53. package/dest/wallet/wallet.d.ts +540 -916
  54. package/dest/wallet/wallet.d.ts.map +1 -1
  55. package/dest/wallet/wallet.js +19 -10
  56. package/package.json +8 -8
  57. package/src/account/account.ts +1 -2
  58. package/src/account/signerless_account.ts +1 -2
  59. package/src/api/contract.ts +1 -0
  60. package/src/api/tx.ts +1 -0
  61. package/src/api/wallet.ts +1 -2
  62. package/src/contract/base_contract_interaction.ts +2 -3
  63. package/src/contract/batch_call.ts +65 -48
  64. package/src/contract/contract_function_interaction.ts +10 -11
  65. package/src/contract/deploy_method.ts +4 -4
  66. package/src/contract/interaction_options.ts +4 -10
  67. package/src/fee/fee_juice_payment_method_with_claim.ts +3 -1
  68. package/src/fee/fee_payment_method.ts +1 -1
  69. package/src/fee/private_fee_payment_method.ts +4 -2
  70. package/src/fee/public_fee_payment_method.ts +4 -2
  71. package/src/fee/sponsored_fee_payment.ts +3 -1
  72. package/src/utils/authwit.ts +15 -4
  73. package/src/wallet/account_entrypoint_meta_payment_method.ts +2 -1
  74. package/src/wallet/base_wallet.ts +43 -32
  75. package/src/wallet/deploy_account_method.ts +1 -1
  76. package/src/wallet/wallet.ts +21 -25
@@ -169,9 +169,20 @@ export async function lookupValidity(
169
169
  name: 'lookup_validity',
170
170
  isInitializer: false,
171
171
  functionType: FunctionType.UTILITY,
172
- isInternal: false,
172
+ isOnlySelf: false,
173
173
  isStatic: false,
174
- parameters: [{ name: 'message_hash', type: { kind: 'field' }, visibility: 'private' as ABIParameterVisibility }],
174
+ parameters: [
175
+ {
176
+ name: 'consumer',
177
+ type: {
178
+ fields: [{ name: 'inner', type: { kind: 'field' } }],
179
+ kind: 'struct',
180
+ path: 'aztec::protocol_types::address::aztec_address::AztecAddress',
181
+ },
182
+ visibility: 'private' as ABIParameterVisibility,
183
+ },
184
+ { name: 'inner_hash', type: { kind: 'field' }, visibility: 'private' as ABIParameterVisibility },
185
+ ],
175
186
  returnTypes: [{ kind: 'boolean' }],
176
187
  errorTypes: {},
177
188
  } as FunctionAbi;
@@ -189,7 +200,7 @@ export async function lookupValidity(
189
200
  name: 'utility_is_consumable',
190
201
  isInitializer: false,
191
202
  functionType: FunctionType.UTILITY,
192
- isInternal: false,
203
+ isOnlySelf: false,
193
204
  isStatic: false,
194
205
  parameters: [
195
206
  {
@@ -286,7 +297,7 @@ export class SetPublicAuthwitContractInteraction extends ContractFunctionInterac
286
297
  name: 'set_authorized',
287
298
  isInitializer: false,
288
299
  functionType: FunctionType.PUBLIC,
289
- isInternal: true,
300
+ isOnlySelf: true,
290
301
  isStatic: false,
291
302
  parameters: [
292
303
  {
@@ -1,6 +1,5 @@
1
1
  import { AccountFeePaymentMethodOptions } from '@aztec/entrypoints/account';
2
2
  import { EncodedAppEntrypointCalls } from '@aztec/entrypoints/encoding';
3
- import { ExecutionPayload } from '@aztec/entrypoints/payload';
4
3
  import { ProtocolContractAddress } from '@aztec/protocol-contracts';
5
4
  import {
6
5
  type ContractArtifact,
@@ -12,6 +11,7 @@ import {
12
11
  } from '@aztec/stdlib/abi';
13
12
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
14
13
  import type { GasSettings } from '@aztec/stdlib/gas';
14
+ import { ExecutionPayload } from '@aztec/stdlib/tx';
15
15
 
16
16
  import type { FeePaymentMethod } from '../fee/fee_payment_method.js';
17
17
  import type { Wallet } from './index.js';
@@ -92,6 +92,7 @@ export class AccountEntrypointMetaPaymentMethod implements FeePaymentMethod {
92
92
  [payloadAuthWitness, ...feeAuthwitnesses],
93
93
  [],
94
94
  feeEncodedCalls.hashedArguments,
95
+ feePayer,
95
96
  );
96
97
  }
97
98
 
@@ -6,10 +6,15 @@ import {
6
6
  } from '@aztec/constants';
7
7
  import { AccountFeePaymentMethodOptions, type DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
8
8
  import type { ChainInfo } from '@aztec/entrypoints/interfaces';
9
- import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/entrypoints/payload';
10
9
  import { Fr } from '@aztec/foundation/fields';
11
10
  import { createLogger } from '@aztec/foundation/log';
12
- import { type ContractArtifact, type EventMetadataDefinition, decodeFromAbi } from '@aztec/stdlib/abi';
11
+ import type { FieldsOf } from '@aztec/foundation/types';
12
+ import {
13
+ type ContractArtifact,
14
+ type EventMetadataDefinition,
15
+ type FunctionCall,
16
+ decodeFromAbi,
17
+ } from '@aztec/stdlib/abi';
13
18
  import type { AuthWitness } from '@aztec/stdlib/auth-witness';
14
19
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
15
20
  import {
@@ -32,6 +37,7 @@ import type {
32
37
  TxSimulationResult,
33
38
  UtilitySimulationResult,
34
39
  } from '@aztec/stdlib/tx';
40
+ import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/stdlib/tx';
35
41
 
36
42
  import { inspect } from 'util';
37
43
 
@@ -47,7 +53,6 @@ import type {
47
53
  ProfileOptions,
48
54
  SendOptions,
49
55
  SimulateOptions,
50
- UserFeeOptions,
51
56
  Wallet,
52
57
  } from './wallet.js';
53
58
 
@@ -151,46 +156,54 @@ export abstract class BaseWallet implements Wallet {
151
156
  }
152
157
 
153
158
  /**
154
- * Returns default values for the transaction fee options
155
- * if they were omitted by the user.
159
+ * Completes partial user-provided fee options with wallet defaults.
156
160
  * @param from - The address where the transaction is being sent from
157
- * @param userFeeOptions - User-provided fee options, which might be incomplete
158
- * @returns - Populated fee options that can be used to create a transaction execution request
161
+ * @param feePayer - The address paying for fees (if any fee payment method is embedded in the execution payload)
162
+ * @param gasSettings - User-provided partial gas settings
163
+ * @returns - Complete fee options that can be used to create a transaction execution request
159
164
  */
160
- protected async getDefaultFeeOptions(from: AztecAddress, userFeeOptions?: UserFeeOptions): Promise<FeeOptions> {
165
+ protected async completeFeeOptions(
166
+ from: AztecAddress,
167
+ feePayer?: AztecAddress,
168
+ gasSettings?: Partial<FieldsOf<GasSettings>>,
169
+ ): Promise<FeeOptions> {
161
170
  const maxFeesPerGas =
162
- userFeeOptions?.gasSettings?.maxFeesPerGas ??
163
- (await this.aztecNode.getCurrentBaseFees()).mul(1 + this.baseFeePadding);
171
+ gasSettings?.maxFeesPerGas ?? (await this.aztecNode.getCurrentBaseFees()).mul(1 + this.baseFeePadding);
164
172
  let accountFeePaymentMethodOptions;
165
173
  // The transaction does not include a fee payment method, so we set the flag
166
174
  // for the account to use its fee juice balance
167
- if (!userFeeOptions?.embeddedPaymentMethodFeePayer) {
175
+ if (!feePayer) {
168
176
  accountFeePaymentMethodOptions = AccountFeePaymentMethodOptions.PREEXISTING_FEE_JUICE;
169
177
  } else {
170
178
  // The transaction includes fee payment method, so we check if we are the fee payer for it
171
179
  // (this can only happen if the embedded payment method is FeeJuiceWithClaim)
172
- accountFeePaymentMethodOptions = from.equals(userFeeOptions.embeddedPaymentMethodFeePayer)
180
+ accountFeePaymentMethodOptions = from.equals(feePayer)
173
181
  ? AccountFeePaymentMethodOptions.FEE_JUICE_WITH_CLAIM
174
182
  : AccountFeePaymentMethodOptions.EXTERNAL;
175
183
  }
176
- const gasSettings: GasSettings = GasSettings.default({ ...userFeeOptions?.gasSettings, maxFeesPerGas });
177
- this.log.debug(`Using L2 gas settings`, gasSettings);
184
+ const fullGasSettings: GasSettings = GasSettings.default({ ...gasSettings, maxFeesPerGas });
185
+ this.log.debug(`Using L2 gas settings`, fullGasSettings);
178
186
  return {
179
- gasSettings,
187
+ gasSettings: fullGasSettings,
180
188
  walletFeePaymentMethod: undefined,
181
189
  accountFeePaymentMethodOptions,
182
190
  };
183
191
  }
184
192
 
185
193
  /**
186
- * Returns unreasonably high gas limits in order to execute a simulation
187
- * with the goal of estimating its gas cost. It will otherwise try to respect
188
- * the user-specified fee options, filling the gaps with default values as needed.
194
+ * Completes partial user-provided fee options with unreasonably high gas limits
195
+ * for gas estimation. Uses the same logic as completeFeeOptions but sets high limits
196
+ * to avoid running out of gas during estimation.
189
197
  * @param from - The address where the transaction is being sent from
190
- * @param userFeeOptions - User-provided fee options to use as a basis for the fully populated `FeeOptions` type.
198
+ * @param feePayer - The address paying for fees (if any fee payment method is embedded in the execution payload)
199
+ * @param gasSettings - User-provided partial gas settings
191
200
  */
192
- protected async getFeeOptionsForGasEstimation(from: AztecAddress, userFeeOptions?: UserFeeOptions) {
193
- const defaultFeeOptions = await this.getDefaultFeeOptions(from, userFeeOptions);
201
+ protected async completeFeeOptionsForEstimation(
202
+ from: AztecAddress,
203
+ feePayer?: AztecAddress,
204
+ gasSettings?: Partial<FieldsOf<GasSettings>>,
205
+ ) {
206
+ const defaultFeeOptions = await this.completeFeeOptions(from, feePayer, gasSettings);
194
207
  const {
195
208
  gasSettings: { maxFeesPerGas, maxPriorityFeesPerGas },
196
209
  } = defaultFeeOptions;
@@ -269,8 +282,8 @@ export abstract class BaseWallet implements Wallet {
269
282
 
270
283
  async simulateTx(executionPayload: ExecutionPayload, opts: SimulateOptions): Promise<TxSimulationResult> {
271
284
  const feeOptions = opts.fee?.estimateGas
272
- ? await this.getFeeOptionsForGasEstimation(opts.from, opts.fee)
273
- : await this.getDefaultFeeOptions(opts.from, opts.fee);
285
+ ? await this.completeFeeOptionsForEstimation(opts.from, executionPayload.feePayer, opts.fee?.gasSettings)
286
+ : await this.completeFeeOptions(opts.from, executionPayload.feePayer, opts.fee?.gasSettings);
274
287
  const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(executionPayload, opts.from, feeOptions);
275
288
  return this.pxe.simulateTx(
276
289
  txRequest,
@@ -281,14 +294,14 @@ export abstract class BaseWallet implements Wallet {
281
294
  }
282
295
 
283
296
  async profileTx(executionPayload: ExecutionPayload, opts: ProfileOptions): Promise<TxProfileResult> {
284
- const fee = await this.getDefaultFeeOptions(opts.from, opts.fee);
285
- const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(executionPayload, opts.from, fee);
297
+ const feeOptions = await this.completeFeeOptions(opts.from, executionPayload.feePayer, opts.fee?.gasSettings);
298
+ const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(executionPayload, opts.from, feeOptions);
286
299
  return this.pxe.profileTx(txRequest, opts.profileMode, opts.skipProofGeneration ?? true);
287
300
  }
288
301
 
289
302
  async sendTx(executionPayload: ExecutionPayload, opts: SendOptions): Promise<TxHash> {
290
- const fee = await this.getDefaultFeeOptions(opts.from, opts.fee);
291
- const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(executionPayload, opts.from, fee);
303
+ const feeOptions = await this.completeFeeOptions(opts.from, executionPayload.feePayer, opts.fee?.gasSettings);
304
+ const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(executionPayload, opts.from, feeOptions);
292
305
  const provenTx = await this.pxe.proveTx(txRequest);
293
306
  const tx = await provenTx.toTx();
294
307
  const txHash = tx.getTxHash();
@@ -318,13 +331,11 @@ export abstract class BaseWallet implements Wallet {
318
331
  }
319
332
 
320
333
  simulateUtility(
321
- functionName: string,
322
- args: any[],
323
- to: AztecAddress,
334
+ call: FunctionCall,
324
335
  authwits?: AuthWitness[],
325
- from?: AztecAddress,
336
+ scopes?: AztecAddress[],
326
337
  ): Promise<UtilitySimulationResult> {
327
- return this.pxe.simulateUtility(functionName, args, to, authwits, from);
338
+ return this.pxe.simulateUtility(call, authwits, scopes);
328
339
  }
329
340
 
330
341
  getContractClassMetadata(id: Fr, includeArtifact: boolean = false): Promise<ContractClassMetadata> {
@@ -1,8 +1,8 @@
1
- import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/entrypoints/payload';
2
1
  import { Fr } from '@aztec/foundation/fields';
3
2
  import type { ContractArtifact, FunctionArtifact } from '@aztec/stdlib/abi';
4
3
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
5
4
  import type { PublicKeys } from '@aztec/stdlib/keys';
5
+ import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/stdlib/tx';
6
6
 
7
7
  import type { Contract } from '../contract/contract.js';
8
8
  import type { ContractBase } from '../contract/contract_base.js';
@@ -1,5 +1,4 @@
1
1
  import type { ChainInfo } from '@aztec/entrypoints/interfaces';
2
- import type { ExecutionPayload } from '@aztec/entrypoints/payload';
3
2
  import type { Fr } from '@aztec/foundation/fields';
4
3
  import {
5
4
  AbiTypeSchema,
@@ -7,6 +6,7 @@ import {
7
6
  ContractArtifactSchema,
8
7
  type EventMetadataDefinition,
9
8
  FunctionAbiSchema,
9
+ type FunctionCall,
10
10
  FunctionType,
11
11
  } from '@aztec/stdlib/abi';
12
12
  import { AuthWitness } from '@aztec/stdlib/auth-witness';
@@ -31,6 +31,7 @@ import {
31
31
  TxSimulationResult,
32
32
  UtilitySimulationResult,
33
33
  } from '@aztec/stdlib/tx';
34
+ import type { ExecutionPayload } from '@aztec/stdlib/tx';
34
35
 
35
36
  import { z } from 'zod';
36
37
 
@@ -63,17 +64,6 @@ export type Aliased<T> = {
63
64
  */
64
65
  export type ContractInstanceAndArtifact = Pick<Contract, 'artifact' | 'instance'>;
65
66
 
66
- /**
67
- * Options that can be provided to the wallet for configuration of the fee payment.
68
- */
69
- export type UserFeeOptions = {
70
- /**
71
- * Informs the wallet that the crafted tx already contains the necessary calls to pay for its fee
72
- * and who is paying
73
- */
74
- embeddedPaymentMethodFeePayer?: AztecAddress;
75
- } & GasSettingsOption;
76
-
77
67
  /**
78
68
  * Options for simulating interactions with the wallet. Overrides the fee settings of an interaction with
79
69
  * a simplified version that only hints at the wallet wether the interaction contains a
@@ -81,7 +71,7 @@ export type UserFeeOptions = {
81
71
  */
82
72
  export type SimulateOptions = Omit<SimulateInteractionOptions, 'fee'> & {
83
73
  /** The fee options */
84
- fee?: UserFeeOptions & FeeEstimationOptions;
74
+ fee?: GasSettingsOption & FeeEstimationOptions;
85
75
  };
86
76
 
87
77
  /**
@@ -91,7 +81,7 @@ export type SimulateOptions = Omit<SimulateInteractionOptions, 'fee'> & {
91
81
  */
92
82
  export type ProfileOptions = Omit<ProfileInteractionOptions, 'fee'> & {
93
83
  /** The fee options */
94
- fee?: UserFeeOptions;
84
+ fee?: GasSettingsOption;
95
85
  };
96
86
 
97
87
  /**
@@ -101,13 +91,16 @@ export type ProfileOptions = Omit<ProfileInteractionOptions, 'fee'> & {
101
91
  */
102
92
  export type SendOptions = Omit<SendInteractionOptions, 'fee'> & {
103
93
  /** The fee options */
104
- fee?: UserFeeOptions;
94
+ fee?: GasSettingsOption;
105
95
  };
106
96
 
107
97
  /**
108
98
  * Helper type that represents all methods that can be batched.
109
99
  */
110
- export type BatchableMethods = Pick<Wallet, 'registerContract' | 'sendTx' | 'registerSender' | 'simulateUtility'>;
100
+ export type BatchableMethods = Pick<
101
+ Wallet,
102
+ 'registerContract' | 'sendTx' | 'registerSender' | 'simulateUtility' | 'simulateTx'
103
+ >;
111
104
 
112
105
  /**
113
106
  * From the batchable methods, we create a type that represents a method call with its name and arguments.
@@ -178,10 +171,9 @@ export type Wallet = {
178
171
  ): Promise<ContractInstanceWithAddress>;
179
172
  simulateTx(exec: ExecutionPayload, opts: SimulateOptions): Promise<TxSimulationResult>;
180
173
  simulateUtility(
181
- functionName: string,
182
- args: any[],
183
- to: AztecAddress,
174
+ call: FunctionCall,
184
175
  authwits?: AuthWitness[],
176
+ scopes?: AztecAddress[],
185
177
  ): Promise<UtilitySimulationResult>;
186
178
  profileTx(exec: ExecutionPayload, opts: ProfileOptions): Promise<TxProfileResult>;
187
179
  sendTx(exec: ExecutionPayload, opts: SendOptions): Promise<TxHash>;
@@ -216,7 +208,7 @@ export const ExecutionPayloadSchema = z.object({
216
208
  extraHashedArgs: z.array(HashedValues.schema),
217
209
  });
218
210
 
219
- export const UserFeeOptionsSchema = z.object({
211
+ export const GasSettingsOptionSchema = z.object({
220
212
  gasSettings: optional(
221
213
  z.object({
222
214
  gasLimits: optional(Gas.schema),
@@ -225,10 +217,9 @@ export const UserFeeOptionsSchema = z.object({
225
217
  maxPriorityFeePerGas: optional(z.object({ feePerDaGas: schemas.BigInt, feePerL2Gas: schemas.BigInt })),
226
218
  }),
227
219
  ),
228
- embeddedPaymentMethodFeePayer: optional(schemas.AztecAddress),
229
220
  });
230
221
 
231
- export const WalletSimulationFeeOptionSchema = UserFeeOptionsSchema.extend({
222
+ export const WalletSimulationFeeOptionSchema = GasSettingsOptionSchema.extend({
232
223
  estimatedGasPadding: optional(z.number()),
233
224
  estimateGas: optional(z.boolean()),
234
225
  });
@@ -237,7 +228,7 @@ export const SendOptionsSchema = z.object({
237
228
  from: schemas.AztecAddress,
238
229
  authWitnesses: optional(z.array(AuthWitness.schema)),
239
230
  capsules: optional(z.array(Capsule.schema)),
240
- fee: optional(UserFeeOptionsSchema),
231
+ fee: optional(GasSettingsOptionSchema),
241
232
  });
242
233
 
243
234
  export const SimulateOptionsSchema = z.object({
@@ -286,7 +277,11 @@ export const BatchedMethodSchema = z.union([
286
277
  }),
287
278
  z.object({
288
279
  name: z.literal('simulateUtility'),
289
- args: z.tuple([z.string(), z.array(z.any()), schemas.AztecAddress, optional(z.array(AuthWitness.schema))]),
280
+ args: z.tuple([FunctionCallSchema, optional(z.array(AuthWitness.schema)), optional(z.array(schemas.AztecAddress))]),
281
+ }),
282
+ z.object({
283
+ name: z.literal('simulateTx'),
284
+ args: z.tuple([ExecutionPayloadSchema, SimulateOptionsSchema]),
290
285
  }),
291
286
  ]);
292
287
 
@@ -336,7 +331,7 @@ export const WalletSchema: ApiSchemaFor<Wallet> = {
336
331
  simulateTx: z.function().args(ExecutionPayloadSchema, SimulateOptionsSchema).returns(TxSimulationResult.schema),
337
332
  simulateUtility: z
338
333
  .function()
339
- .args(z.string(), z.array(z.any()), schemas.AztecAddress, optional(z.array(AuthWitness.schema)))
334
+ .args(FunctionCallSchema, optional(z.array(AuthWitness.schema)), optional(z.array(schemas.AztecAddress)))
340
335
  .returns(UtilitySimulationResult.schema),
341
336
  profileTx: z.function().args(ExecutionPayloadSchema, ProfileOptionsSchema).returns(TxProfileResult.schema),
342
337
  sendTx: z.function().args(ExecutionPayloadSchema, SendOptionsSchema).returns(TxHash.schema),
@@ -352,6 +347,7 @@ export const WalletSchema: ApiSchemaFor<Wallet> = {
352
347
  z.object({ name: z.literal('registerContract'), result: ContractInstanceWithAddressSchema }),
353
348
  z.object({ name: z.literal('sendTx'), result: TxHash.schema }),
354
349
  z.object({ name: z.literal('simulateUtility'), result: UtilitySimulationResult.schema }),
350
+ z.object({ name: z.literal('simulateTx'), result: TxSimulationResult.schema }),
355
351
  ]),
356
352
  ),
357
353
  ),