@aztec/aztec.js 0.0.1-commit.d431d1c → 0.0.1-commit.e310a4c8

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 (97) hide show
  1. package/dest/api/block.d.ts +2 -2
  2. package/dest/api/block.d.ts.map +1 -1
  3. package/dest/api/block.js +1 -1
  4. package/dest/api/contract.d.ts +16 -10
  5. package/dest/api/contract.d.ts.map +1 -1
  6. package/dest/api/contract.js +14 -8
  7. package/dest/api/keys.d.ts +1 -1
  8. package/dest/api/keys.js +1 -1
  9. package/dest/api/node.d.ts +8 -4
  10. package/dest/api/node.d.ts.map +1 -1
  11. package/dest/api/node.js +7 -3
  12. package/dest/api/tx.d.ts +2 -2
  13. package/dest/api/tx.d.ts.map +1 -1
  14. package/dest/api/tx.js +1 -1
  15. package/dest/api/wallet.d.ts +3 -2
  16. package/dest/api/wallet.d.ts.map +1 -1
  17. package/dest/api/wallet.js +2 -1
  18. package/dest/contract/base_contract_interaction.d.ts +8 -10
  19. package/dest/contract/base_contract_interaction.d.ts.map +1 -1
  20. package/dest/contract/base_contract_interaction.js +5 -17
  21. package/dest/contract/deploy_method.d.ts +63 -16
  22. package/dest/contract/deploy_method.d.ts.map +1 -1
  23. package/dest/contract/deploy_method.js +36 -19
  24. package/dest/contract/interaction_options.d.ts +42 -5
  25. package/dest/contract/interaction_options.d.ts.map +1 -1
  26. package/dest/contract/interaction_options.js +8 -1
  27. package/dest/contract/protocol_contracts/auth-registry.d.ts +1 -10
  28. package/dest/contract/protocol_contracts/auth-registry.d.ts.map +1 -1
  29. package/dest/contract/protocol_contracts/auth-registry.js +61 -479
  30. package/dest/contract/protocol_contracts/contract-class-registry.d.ts +2 -11
  31. package/dest/contract/protocol_contracts/contract-class-registry.d.ts.map +1 -1
  32. package/dest/contract/protocol_contracts/contract-class-registry.js +10 -422
  33. package/dest/contract/protocol_contracts/contract-instance-registry.d.ts +2 -11
  34. package/dest/contract/protocol_contracts/contract-instance-registry.d.ts.map +1 -1
  35. package/dest/contract/protocol_contracts/contract-instance-registry.js +80 -486
  36. package/dest/contract/protocol_contracts/fee-juice.d.ts +1 -10
  37. package/dest/contract/protocol_contracts/fee-juice.d.ts.map +1 -1
  38. package/dest/contract/protocol_contracts/fee-juice.js +0 -414
  39. package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts +3 -3
  40. package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts.map +1 -1
  41. package/dest/contract/protocol_contracts/multi-call-entrypoint.js +13 -14
  42. package/dest/contract/protocol_contracts/public-checks.d.ts +3 -3
  43. package/dest/contract/protocol_contracts/public-checks.d.ts.map +1 -1
  44. package/dest/contract/protocol_contracts/public-checks.js +13 -22
  45. package/dest/contract/wait_for_proven.js +1 -1
  46. package/dest/contract/wait_opts.d.ts +16 -0
  47. package/dest/contract/wait_opts.d.ts.map +1 -0
  48. package/dest/contract/wait_opts.js +5 -0
  49. package/dest/utils/authwit.d.ts +6 -6
  50. package/dest/utils/authwit.d.ts.map +1 -1
  51. package/dest/utils/authwit.js +2 -6
  52. package/dest/utils/node.d.ts +12 -1
  53. package/dest/utils/node.d.ts.map +1 -1
  54. package/dest/utils/node.js +46 -0
  55. package/dest/wallet/capabilities.d.ts +444 -0
  56. package/dest/wallet/capabilities.d.ts.map +1 -0
  57. package/dest/wallet/capabilities.js +3 -0
  58. package/dest/wallet/deploy_account_method.d.ts +19 -5
  59. package/dest/wallet/deploy_account_method.d.ts.map +1 -1
  60. package/dest/wallet/index.d.ts +2 -1
  61. package/dest/wallet/index.d.ts.map +1 -1
  62. package/dest/wallet/index.js +1 -0
  63. package/dest/wallet/wallet.d.ts +1356 -18
  64. package/dest/wallet/wallet.d.ts.map +1 -1
  65. package/dest/wallet/wallet.js +136 -4
  66. package/package.json +9 -9
  67. package/src/api/block.ts +1 -1
  68. package/src/api/contract.ts +22 -7
  69. package/src/api/keys.ts +2 -2
  70. package/src/api/node.ts +7 -3
  71. package/src/api/tx.ts +2 -0
  72. package/src/api/wallet.ts +43 -0
  73. package/src/contract/base_contract_interaction.ts +27 -15
  74. package/src/contract/deploy_method.ts +115 -23
  75. package/src/contract/interaction_options.ts +49 -4
  76. package/src/contract/protocol_contracts/auth-registry.ts +37 -240
  77. package/src/contract/protocol_contracts/contract-class-registry.ts +3 -204
  78. package/src/contract/protocol_contracts/contract-instance-registry.ts +34 -234
  79. package/src/contract/protocol_contracts/fee-juice.ts +0 -202
  80. package/src/contract/protocol_contracts/multi-call-entrypoint.ts +6 -12
  81. package/src/contract/protocol_contracts/public-checks.ts +6 -14
  82. package/src/contract/wait_for_proven.ts +1 -1
  83. package/src/contract/wait_opts.ts +21 -0
  84. package/src/utils/authwit.ts +16 -4
  85. package/src/utils/node.ts +62 -0
  86. package/src/wallet/capabilities.ts +491 -0
  87. package/src/wallet/deploy_account_method.ts +19 -4
  88. package/src/wallet/index.ts +1 -0
  89. package/src/wallet/wallet.ts +148 -12
  90. package/dest/contract/deploy_sent_tx.d.ts +0 -48
  91. package/dest/contract/deploy_sent_tx.d.ts.map +0 -1
  92. package/dest/contract/deploy_sent_tx.js +0 -46
  93. package/dest/contract/sent_tx.d.ts +0 -50
  94. package/dest/contract/sent_tx.d.ts.map +0 -1
  95. package/dest/contract/sent_tx.js +0 -90
  96. package/src/contract/deploy_sent_tx.ts +0 -75
  97. package/src/contract/sent_tx.ts +0 -129
@@ -9,27 +9,46 @@ import {
9
9
  getContractInstanceFromInstantiationParams,
10
10
  } from '@aztec/stdlib/contract';
11
11
  import type { PublicKeys } from '@aztec/stdlib/keys';
12
- import { type Capsule, type TxProfileResult, collectOffchainEffects } from '@aztec/stdlib/tx';
12
+ import { type Capsule, TxHash, type TxProfileResult, type TxReceipt, collectOffchainEffects } from '@aztec/stdlib/tx';
13
13
  import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/stdlib/tx';
14
14
 
15
15
  import { publishContractClass } from '../deployment/publish_class.js';
16
16
  import { publishInstance } from '../deployment/publish_instance.js';
17
- import type { Wallet } from '../wallet/wallet.js';
17
+ import type { SendOptions, Wallet } from '../wallet/wallet.js';
18
18
  import { BaseContractInteraction } from './base_contract_interaction.js';
19
19
  import type { ContractBase } from './contract_base.js';
20
20
  import { ContractFunctionInteraction } from './contract_function_interaction.js';
21
- import { DeploySentTx } from './deploy_sent_tx.js';
22
21
  import { getGasLimits } from './get_gas_limits.js';
23
22
  import {
23
+ NO_WAIT,
24
+ type NoWait,
24
25
  type ProfileInteractionOptions,
25
26
  type RequestInteractionOptions,
26
- type SendInteractionOptions,
27
+ type SendInteractionOptionsWithoutWait,
27
28
  type SimulationInteractionFeeOptions,
28
29
  type SimulationReturn,
29
30
  toProfileOptions,
30
31
  toSendOptions,
31
32
  toSimulateOptions,
32
33
  } from './interaction_options.js';
34
+ import type { WaitOpts } from './wait_opts.js';
35
+
36
+ /**
37
+ * Wait options specific to deployment transactions.
38
+ * Extends WaitOpts with a flag to return the full receipt instead of just the contract.
39
+ */
40
+ export type DeployWaitOptions = WaitOpts & {
41
+ /** If true, return the full DeployTxReceipt instead of just the contract. Defaults to false. */
42
+ returnReceipt?: boolean;
43
+ };
44
+
45
+ /**
46
+ * Type for wait options in deployment interactions.
47
+ * - NO_WAIT symbol: Don't wait, return TxHash immediately
48
+ * - DeployWaitOptions: Wait with custom options
49
+ * - undefined: Wait with default options
50
+ */
51
+ export type DeployInteractionWaitOptions = NoWait | DeployWaitOptions | undefined;
33
52
 
34
53
  /**
35
54
  * Options for deploying a contract on the Aztec network.
@@ -55,21 +74,34 @@ export type RequestDeployOptions = RequestInteractionOptions & {
55
74
  };
56
75
 
57
76
  /**
58
- * Extends the deployment options with the required parameters to send the transaction
77
+ * Base deployment options without wait parameter.
59
78
  */
60
- export type DeployOptions = Omit<RequestDeployOptions, 'deployer'> & {
79
+ export type DeployOptionsWithoutWait = Omit<RequestDeployOptions, 'deployer'> & {
61
80
  /**
62
81
  * Set to true to *not* include the sender in the address computation. This option
63
82
  * is mutually exclusive with "deployer"
64
83
  */
65
84
  universalDeploy?: boolean;
66
- } & Pick<SendInteractionOptions, 'from' | 'fee'>;
85
+ } & Pick<SendInteractionOptionsWithoutWait, 'from' | 'fee'>;
86
+
87
+ /**
88
+ * Extends the deployment options with the required parameters to send the transaction.
89
+ */
90
+ export type DeployOptions<W extends DeployInteractionWaitOptions = undefined> = DeployOptionsWithoutWait & {
91
+ /**
92
+ * Options for waiting for the transaction to be mined.
93
+ * - undefined (default): wait with default options and return the contract instance
94
+ * - DeployWaitOptions: wait with custom options and return contract or receipt based on returnReceipt flag
95
+ * - NO_WAIT: return TxHash immediately without waiting
96
+ */
97
+ wait?: W;
98
+ };
67
99
 
68
100
  /**
69
101
  * Options for simulating the deployment of a contract
70
102
  * Allows skipping certain validations and computing gas estimations
71
103
  */
72
- export type SimulateDeployOptions = Omit<DeployOptions, 'fee'> & {
104
+ export type SimulateDeployOptions = Omit<DeployOptionsWithoutWait, 'fee'> & {
73
105
  /** The fee options for the transaction. */
74
106
  fee?: SimulationInteractionFeeOptions;
75
107
  /** Simulate without checking for the validity of the resulting transaction,
@@ -83,6 +115,29 @@ export type SimulateDeployOptions = Omit<DeployOptions, 'fee'> & {
83
115
  includeMetadata?: boolean;
84
116
  };
85
117
 
118
+ /** Receipt for a deployment transaction with the deployed contract instance. */
119
+ export type DeployTxReceipt<TContract extends ContractBase = ContractBase> = TxReceipt & {
120
+ /** Type-safe wrapper around the deployed contract instance, linked to the deployment wallet */
121
+ contract: TContract;
122
+ /** The deployed contract instance with address and metadata. */
123
+ instance: ContractInstanceWithAddress;
124
+ };
125
+
126
+ /**
127
+ * Represents the result type of deploying a contract.
128
+ * - If wait is NO_WAIT, returns TxHash immediately.
129
+ * - If wait has returnReceipt: true, returns DeployTxReceipt after waiting.
130
+ * - Otherwise (undefined or DeployWaitOptions without returnReceipt), returns TContract after waiting.
131
+ */
132
+ export type DeployReturn<TContract extends ContractBase, W extends DeployInteractionWaitOptions> = W extends NoWait
133
+ ? TxHash
134
+ : W extends {
135
+ // eslint-disable-next-line jsdoc/require-jsdoc
136
+ returnReceipt: true;
137
+ }
138
+ ? DeployTxReceipt<TContract>
139
+ : TContract;
140
+
86
141
  /**
87
142
  * Contract interaction for deployment.
88
143
  * Handles class publication, instance publication, and initialization of the contract.
@@ -92,8 +147,6 @@ export type SimulateDeployOptions = Omit<DeployOptions, 'fee'> & {
92
147
  * then technically the contract has already been "created", and all of the contract's
93
148
  * functions (private and utility) can be interacted-with immediately, without any
94
149
  * "deployment tx".
95
- *
96
- * Extends the BaseContractInteraction class.
97
150
  */
98
151
  export class DeployMethod<TContract extends ContractBase = ContractBase> extends BaseContractInteraction {
99
152
  /** The contract instance to be deployed. */
@@ -142,13 +195,30 @@ export class DeployMethod<TContract extends ContractBase = ContractBase> extends
142
195
  return finalExecutionPayload;
143
196
  }
144
197
 
145
- convertDeployOptionsToRequestOptions(options: DeployOptions): RequestDeployOptions {
198
+ convertDeployOptionsToRequestOptions(options: DeployOptionsWithoutWait): RequestDeployOptions {
146
199
  return {
147
200
  ...options,
148
201
  deployer: !options?.universalDeploy ? options.from : undefined,
149
202
  };
150
203
  }
151
204
 
205
+ /**
206
+ * Converts DeployOptions to SendOptions, stripping out the returnReceipt flag if present.
207
+ * @param options - Deploy options with wait parameter
208
+ * @returns Send options with wait parameter
209
+ */
210
+ private convertDeployOptionsToSendOptions<W extends DeployInteractionWaitOptions>(
211
+ options: DeployOptions<W>,
212
+ // eslint-disable-next-line jsdoc/require-jsdoc
213
+ ): SendOptions<W extends { returnReceipt: true } ? WaitOpts : W> {
214
+ return {
215
+ ...toSendOptions({
216
+ ...options,
217
+ wait: options.wait as any,
218
+ }),
219
+ } as any;
220
+ }
221
+
152
222
  /**
153
223
  * Adds this contract to the wallet and returns the Contract object.
154
224
  * @param options - Deployment options.
@@ -232,20 +302,42 @@ export class DeployMethod<TContract extends ContractBase = ContractBase> extends
232
302
 
233
303
  /**
234
304
  * Send a contract deployment transaction (initialize and/or publish) using the provided options.
235
- * This function extends the 'send' method from the ContractFunctionInteraction class,
236
- * allowing us to send a transaction specifically for contract deployment.
305
+ * By default, waits for the transaction to be mined and returns the deployed contract instance.
237
306
  *
238
307
  * @param options - An object containing various deployment options such as contractAddressSalt and from.
239
- * @returns A SentTx object that returns the receipt and the deployed contract instance.
308
+ * @returns TxHash (if wait is NO_WAIT), TContract (if wait is undefined or doesn't have returnReceipt), or DeployTxReceipt (if wait.returnReceipt is true)
240
309
  */
241
- public override send(options: DeployOptions): DeploySentTx<TContract> {
242
- const sendTx = async () => {
243
- const executionPayload = await this.request(this.convertDeployOptionsToRequestOptions(options));
244
- const sendOptions = toSendOptions(options);
245
- return this.wallet.sendTx(executionPayload, sendOptions);
246
- };
247
- this.log.debug(`Sent deployment tx of ${this.artifact.name} contract`);
248
- return new DeploySentTx(this.wallet, sendTx, this.postDeployCtor, () => this.getInstance(options));
310
+ // Overload for when wait is not specified at all - returns the contract
311
+ public override send(options: DeployOptionsWithoutWait): Promise<TContract>;
312
+ // Generic overload for explicit wait values
313
+ // eslint-disable-next-line jsdoc/require-jsdoc
314
+ public override send<W extends DeployInteractionWaitOptions>(
315
+ options: DeployOptions<W>,
316
+ ): Promise<DeployReturn<TContract, W>>;
317
+ // eslint-disable-next-line jsdoc/require-jsdoc
318
+ public override async send(options: DeployOptions<DeployInteractionWaitOptions>): Promise<any> {
319
+ const executionPayload = await this.request(this.convertDeployOptionsToRequestOptions(options));
320
+ const sendOptions = this.convertDeployOptionsToSendOptions(options);
321
+
322
+ if (options.wait === NO_WAIT) {
323
+ const txHash = await this.wallet.sendTx(executionPayload, sendOptions as SendOptions<NoWait>);
324
+ this.log.debug(`Sent deployment tx ${txHash.hash} of ${this.artifact.name} contract`);
325
+ return txHash;
326
+ }
327
+
328
+ const receipt = await this.wallet.sendTx(executionPayload, sendOptions as SendOptions<WaitOpts | undefined>);
329
+ this.log.debug(`Deployed ${this.artifact.name} contract in tx ${receipt.txHash}`);
330
+
331
+ // Attach contract instance
332
+ const instance = await this.getInstance(options);
333
+ const contract = this.postDeployCtor(instance, this.wallet) as TContract;
334
+
335
+ // Return full receipt if requested, otherwise just the contract
336
+ if (options.wait && typeof options.wait === 'object' && options.wait.returnReceipt) {
337
+ return { ...receipt, contract, instance };
338
+ }
339
+
340
+ return contract;
249
341
  }
250
342
 
251
343
  /**
@@ -296,7 +388,7 @@ export class DeployMethod<TContract extends ContractBase = ContractBase> extends
296
388
  *
297
389
  * @returns An object containing the function return value and profile result.
298
390
  */
299
- public async profile(options: DeployOptions & ProfileInteractionOptions): Promise<TxProfileResult> {
391
+ public async profile(options: DeployOptionsWithoutWait & ProfileInteractionOptions): Promise<TxProfileResult> {
300
392
  const executionPayload = await this.request(this.convertDeployOptionsToRequestOptions(options));
301
393
  return await this.wallet.profileTx(executionPayload, {
302
394
  ...toProfileOptions(options),
@@ -2,10 +2,11 @@ import type { FieldsOf } from '@aztec/foundation/types';
2
2
  import type { AuthWitness } from '@aztec/stdlib/auth-witness';
3
3
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
4
4
  import type { GasSettings } from '@aztec/stdlib/gas';
5
- import type { Capsule, OffchainEffect, SimulationStats } from '@aztec/stdlib/tx';
5
+ import type { Capsule, OffchainEffect, SimulationStats, TxHash, TxReceipt } from '@aztec/stdlib/tx';
6
6
 
7
7
  import type { FeePaymentMethod } from '../fee/fee_payment_method.js';
8
8
  import type { ProfileOptions, SendOptions, SimulateOptions } from '../wallet/index.js';
9
+ import type { WaitOpts } from './wait_opts.js';
9
10
 
10
11
  /**
11
12
  * Options used to tweak the simulation and add gas estimation capabilities
@@ -55,15 +56,47 @@ export type RequestInteractionOptions = {
55
56
  };
56
57
 
57
58
  /**
58
- * Represents options for calling a (constrained) function in a contract.
59
+ * Constant for explicitly not waiting for transaction confirmation.
60
+ * We use this instead of false to avoid confusion with falsy checks.
61
+ */
62
+ export const NO_WAIT = 'NO_WAIT' as const;
63
+
64
+ /**
65
+ * Type for the NO_WAIT constant.
66
+ */
67
+ export type NoWait = typeof NO_WAIT;
68
+
69
+ /**
70
+ * Type for wait options in interactions.
71
+ * - NO_WAIT symbol: Don't wait for confirmation, return TxHash immediately
72
+ * - WaitOpts object: Wait with custom options and return receipt/result
73
+ * - undefined: Wait with default options and return receipt/result
74
+ */
75
+ export type InteractionWaitOptions = NoWait | WaitOpts | undefined;
76
+
77
+ /**
78
+ * Base options for calling a (constrained) function in a contract, without wait parameter.
59
79
  */
60
- export type SendInteractionOptions = RequestInteractionOptions & {
80
+ export type SendInteractionOptionsWithoutWait = RequestInteractionOptions & {
61
81
  /** The sender's Aztec address. */
62
82
  from: AztecAddress;
63
83
  /** The fee options for the transaction. */
64
84
  fee?: InteractionFeeOptions;
65
85
  };
66
86
 
87
+ /**
88
+ * Represents options for calling a (constrained) function in a contract.
89
+ */
90
+ export type SendInteractionOptions<W extends InteractionWaitOptions = undefined> = SendInteractionOptionsWithoutWait & {
91
+ /**
92
+ * Whether to wait for the transaction to be mined.
93
+ * - undefined (default): wait with default options and return TxReceipt
94
+ * - WaitOpts object: wait with custom options and return TxReceipt
95
+ * - NO_WAIT: return txHash immediately without waiting
96
+ */
97
+ wait?: W;
98
+ };
99
+
67
100
  /**
68
101
  * Represents the options for simulating a contract function interaction.
69
102
  * Allows specifying the address from which the method should be called.
@@ -110,11 +143,22 @@ export type SimulationReturn<T extends boolean | undefined> = T extends true
110
143
  }
111
144
  : any;
112
145
 
146
+ /**
147
+ * Represents the result type of sending a transaction.
148
+ * If `wait` is NO_WAIT, returns TxHash immediately without waiting.
149
+ * If `wait` is undefined or WaitOpts, returns TReturn (defaults to TxReceipt) after waiting.
150
+ */
151
+ export type SendReturn<T extends InteractionWaitOptions, TReturn = TxReceipt> = T extends NoWait ? TxHash : TReturn;
152
+
113
153
  /**
114
154
  * Transforms and cleans up the higher level SendInteractionOptions defined by the interaction into
115
155
  * SendOptions, which are the ones that can be serialized and forwarded to the wallet
156
+ * @param options - The send interaction options with optional wait parameter
157
+ * @returns The send options to forward to the wallet
116
158
  */
117
- export function toSendOptions(options: SendInteractionOptions): SendOptions {
159
+ export function toSendOptions<W extends InteractionWaitOptions = undefined>(
160
+ options: SendInteractionOptions<W>,
161
+ ): SendOptions<W> {
118
162
  return {
119
163
  ...options,
120
164
  fee: {
@@ -126,6 +170,7 @@ export function toSendOptions(options: SendInteractionOptions): SendOptions {
126
170
  ...options.fee?.gasSettings,
127
171
  },
128
172
  },
173
+ wait: options.wait, // Pass through wait option
129
174
  };
130
175
  }
131
176
 
@@ -21,32 +21,38 @@ const AuthRegistryContractArtifact: ContractArtifact = {
21
21
  functions: [
22
22
  {
23
23
  ...{
24
- functionType: FunctionType.PRIVATE,
25
- name: 'set_authorized_private',
24
+ functionType: FunctionType.PUBLIC,
25
+ name: 'public_dispatch',
26
26
  isOnlySelf: false,
27
27
  isStatic: false,
28
28
  isInitializer: false,
29
- parameters: [
30
- {
31
- name: 'approver',
32
- type: {
33
- kind: 'struct',
34
- fields: [{ name: 'inner', type: { kind: 'field' } }],
35
- path: 'aztec::protocol_types::address::aztec_address::AztecAddress',
36
- },
37
- visibility: 'private',
38
- },
39
- { name: 'message_hash', type: { kind: 'field' }, visibility: 'private' },
40
- { name: 'authorize', type: { kind: 'boolean' }, visibility: 'private' },
41
- ],
29
+ parameters: [{ name: 'selector', type: { kind: 'field' }, visibility: 'private' }],
42
30
  returnTypes: [],
43
31
  errorTypes: {
44
- '2754040237334517471': { error_kind: 'fmtstring', length: 92, item_types: [] },
45
- '7555607922535724711': { error_kind: 'string', string: 'Preimage mismatch' },
46
- '9894212961085021188': { error_kind: 'string', string: 'Message not authorized by account' },
32
+ '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
33
+ '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
34
+ '5525725861591553972': { error_kind: 'string', string: 'rejecting all' },
35
+ '11691217184967371519': {
36
+ error_kind: 'string',
37
+ string: 'Function is_reject_all can only be called statically',
38
+ },
39
+ '12511970388699677811': { error_kind: 'fmtstring', length: 27, item_types: [{ kind: 'field' }] },
40
+ '13455385521185560676': {
41
+ error_kind: 'string',
42
+ string: 'Storage slot 0 not allowed. Storage slots must start from 1.',
43
+ },
44
+ '13929691561421487185': {
45
+ error_kind: 'string',
46
+ string: 'Function _set_authorized can only be called by the same contract',
47
+ },
47
48
  '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
48
49
  '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
49
50
  '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
51
+ '17089945683942782951': { error_kind: 'string', string: 'unauthorized' },
52
+ '17312933876399746100': {
53
+ error_kind: 'string',
54
+ string: 'Function is_consumable can only be called statically',
55
+ },
50
56
  },
51
57
  },
52
58
  bytecode: Buffer.from([]),
@@ -54,14 +60,14 @@ const AuthRegistryContractArtifact: ContractArtifact = {
54
60
  },
55
61
  {
56
62
  ...{
57
- functionType: FunctionType.UTILITY,
58
- name: 'utility_is_consumable',
63
+ functionType: FunctionType.PRIVATE,
64
+ name: 'set_authorized_private',
59
65
  isOnlySelf: false,
60
66
  isStatic: false,
61
67
  isInitializer: false,
62
68
  parameters: [
63
69
  {
64
- name: 'on_behalf_of',
70
+ name: 'approver',
65
71
  type: {
66
72
  kind: 'struct',
67
73
  fields: [{ name: 'inner', type: { kind: 'field' } }],
@@ -70,18 +76,14 @@ const AuthRegistryContractArtifact: ContractArtifact = {
70
76
  visibility: 'private',
71
77
  },
72
78
  { name: 'message_hash', type: { kind: 'field' }, visibility: 'private' },
79
+ { name: 'authorize', type: { kind: 'boolean' }, visibility: 'private' },
73
80
  ],
74
- returnTypes: [{ kind: 'boolean' }],
81
+ returnTypes: [],
75
82
  errorTypes: {
76
- '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
77
- '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
78
- '13455385521185560676': {
79
- error_kind: 'string',
80
- string: 'Storage slot 0 not allowed. Storage slots must start from 1.',
81
- },
83
+ '7555607922535724711': { error_kind: 'string', string: 'Preimage mismatch' },
84
+ '9894212961085021188': { error_kind: 'string', string: 'Message not authorized by account' },
82
85
  '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
83
86
  '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
84
- '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
85
87
  },
86
88
  },
87
89
  bytecode: Buffer.from([]),
@@ -90,223 +92,33 @@ const AuthRegistryContractArtifact: ContractArtifact = {
90
92
  {
91
93
  ...{
92
94
  functionType: FunctionType.UTILITY,
93
- name: 'process_message',
95
+ name: 'utility_is_consumable',
94
96
  isOnlySelf: false,
95
97
  isStatic: false,
96
98
  isInitializer: false,
97
99
  parameters: [
98
100
  {
99
- name: 'message_ciphertext',
100
- type: {
101
- kind: 'struct',
102
- fields: [
103
- { name: 'storage', type: { kind: 'array', length: 17, type: { kind: 'field' } } },
104
- { name: 'len', type: { kind: 'integer', sign: 'unsigned', width: 32 } },
105
- ],
106
- path: 'std::collections::bounded_vec::BoundedVec',
107
- },
108
- visibility: 'private',
109
- },
110
- {
111
- name: 'message_context',
101
+ name: 'on_behalf_of',
112
102
  type: {
113
103
  kind: 'struct',
114
- fields: [
115
- { name: 'tx_hash', type: { kind: 'field' } },
116
- {
117
- name: 'unique_note_hashes_in_tx',
118
- type: {
119
- kind: 'struct',
120
- fields: [
121
- { name: 'storage', type: { kind: 'array', length: 64, type: { kind: 'field' } } },
122
- { name: 'len', type: { kind: 'integer', sign: 'unsigned', width: 32 } },
123
- ],
124
- path: 'std::collections::bounded_vec::BoundedVec',
125
- },
126
- },
127
- { name: 'first_nullifier_in_tx', type: { kind: 'field' } },
128
- {
129
- name: 'recipient',
130
- type: {
131
- kind: 'struct',
132
- fields: [{ name: 'inner', type: { kind: 'field' } }],
133
- path: 'aztec::protocol_types::address::aztec_address::AztecAddress',
134
- },
135
- },
136
- ],
137
- path: 'aztec::messages::processing::message_context::MessageContext',
104
+ fields: [{ name: 'inner', type: { kind: 'field' } }],
105
+ path: 'aztec::protocol_types::address::aztec_address::AztecAddress',
138
106
  },
139
107
  visibility: 'private',
140
108
  },
109
+ { name: 'message_hash', type: { kind: 'field' }, visibility: 'private' },
141
110
  ],
142
- returnTypes: [],
143
- errorTypes: {
144
- '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
145
- '992401946138144806': { error_kind: 'string', string: 'Attempted to read past end of BoundedVec' },
146
- '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
147
- '2967937905572420042': {
148
- error_kind: 'fmtstring',
149
- length: 61,
150
- item_types: [{ kind: 'field' }, { kind: 'field' }],
151
- },
152
- '3330370348214585450': {
153
- error_kind: 'fmtstring',
154
- length: 48,
155
- item_types: [{ kind: 'field' }, { kind: 'field' }],
156
- },
157
- '3670003311596808700': {
158
- error_kind: 'fmtstring',
159
- length: 77,
160
- item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
161
- },
162
- '4261968856572588300': { error_kind: 'string', string: 'Value does not fit in field' },
163
- '4440399188109668273': { error_kind: 'string', string: 'Input length must be a multiple of 32' },
164
- '9791669845391776238': {
165
- error_kind: 'string',
166
- string: '0 has a square root; you cannot claim it is not square',
167
- },
168
- '9885968605480832328': {
169
- error_kind: 'string',
170
- string: 'Attempted to read past the length of a CapsuleArray',
171
- },
172
- '10135509984888824963': { error_kind: 'fmtstring', length: 58, item_types: [{ kind: 'field' }] },
173
- '10791800398362570014': { error_kind: 'string', string: 'extend_from_bounded_vec out of bounds' },
174
- '11021520179822076911': {
175
- error_kind: 'string',
176
- string: 'Attempted to delete past the length of a CapsuleArray',
177
- },
178
- '11692359521570349358': { error_kind: 'fmtstring', length: 40, item_types: [] },
179
- '12327971061804302172': { error_kind: 'fmtstring', length: 98, item_types: [] },
180
- '12469291177396340830': { error_kind: 'string', string: 'call to assert_max_bit_size' },
181
- '12913276134398371456': { error_kind: 'string', string: 'push out of bounds' },
182
- '13557316507370296400': {
183
- error_kind: 'fmtstring',
184
- length: 130,
185
- item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
186
- },
187
- '14938672389828944159': {
188
- error_kind: 'fmtstring',
189
- length: 146,
190
- item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
191
- },
192
- '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
193
- '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
194
- '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
195
- '17531474008201752295': {
196
- error_kind: 'fmtstring',
197
- length: 133,
198
- item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
199
- },
200
- },
201
- },
202
- bytecode: Buffer.from([]),
203
- debugSymbols: '',
204
- },
205
- {
206
- ...{
207
- functionType: FunctionType.PUBLIC,
208
- name: 'public_dispatch',
209
- isOnlySelf: false,
210
- isStatic: false,
211
- isInitializer: false,
212
- parameters: [{ name: 'selector', type: { kind: 'field' }, visibility: 'private' }],
213
- returnTypes: [],
111
+ returnTypes: [{ kind: 'boolean' }],
214
112
  errorTypes: {
215
113
  '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
216
114
  '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
217
- '5525725861591553972': { error_kind: 'string', string: 'rejecting all' },
218
- '11691217184967371519': {
219
- error_kind: 'string',
220
- string: 'Function is_reject_all can only be called statically',
221
- },
222
- '12511970388699677811': { error_kind: 'fmtstring', length: 27, item_types: [{ kind: 'field' }] },
223
115
  '13455385521185560676': {
224
116
  error_kind: 'string',
225
117
  string: 'Storage slot 0 not allowed. Storage slots must start from 1.',
226
118
  },
227
- '13929691561421487185': {
228
- error_kind: 'string',
229
- string: 'Function _set_authorized can only be called by the same contract',
230
- },
231
119
  '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
232
120
  '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
233
121
  '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
234
- '17089945683942782951': { error_kind: 'string', string: 'unauthorized' },
235
- '17312933876399746100': {
236
- error_kind: 'string',
237
- string: 'Function is_consumable can only be called statically',
238
- },
239
- },
240
- },
241
- bytecode: Buffer.from([]),
242
- debugSymbols: '',
243
- },
244
- {
245
- ...{
246
- functionType: FunctionType.UTILITY,
247
- name: 'sync_private_state',
248
- isOnlySelf: false,
249
- isStatic: false,
250
- isInitializer: false,
251
- parameters: [],
252
- returnTypes: [],
253
- errorTypes: {
254
- '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
255
- '992401946138144806': { error_kind: 'string', string: 'Attempted to read past end of BoundedVec' },
256
- '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
257
- '2967937905572420042': {
258
- error_kind: 'fmtstring',
259
- length: 61,
260
- item_types: [{ kind: 'field' }, { kind: 'field' }],
261
- },
262
- '3330370348214585450': {
263
- error_kind: 'fmtstring',
264
- length: 48,
265
- item_types: [{ kind: 'field' }, { kind: 'field' }],
266
- },
267
- '3670003311596808700': {
268
- error_kind: 'fmtstring',
269
- length: 77,
270
- item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
271
- },
272
- '4261968856572588300': { error_kind: 'string', string: 'Value does not fit in field' },
273
- '4440399188109668273': { error_kind: 'string', string: 'Input length must be a multiple of 32' },
274
- '9791669845391776238': {
275
- error_kind: 'string',
276
- string: '0 has a square root; you cannot claim it is not square',
277
- },
278
- '9885968605480832328': {
279
- error_kind: 'string',
280
- string: 'Attempted to read past the length of a CapsuleArray',
281
- },
282
- '10135509984888824963': { error_kind: 'fmtstring', length: 58, item_types: [{ kind: 'field' }] },
283
- '10791800398362570014': { error_kind: 'string', string: 'extend_from_bounded_vec out of bounds' },
284
- '11021520179822076911': {
285
- error_kind: 'string',
286
- string: 'Attempted to delete past the length of a CapsuleArray',
287
- },
288
- '11692359521570349358': { error_kind: 'fmtstring', length: 40, item_types: [] },
289
- '12327971061804302172': { error_kind: 'fmtstring', length: 98, item_types: [] },
290
- '12469291177396340830': { error_kind: 'string', string: 'call to assert_max_bit_size' },
291
- '12913276134398371456': { error_kind: 'string', string: 'push out of bounds' },
292
- '13557316507370296400': {
293
- error_kind: 'fmtstring',
294
- length: 130,
295
- item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
296
- },
297
- '14938672389828944159': {
298
- error_kind: 'fmtstring',
299
- length: 146,
300
- item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
301
- },
302
- '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
303
- '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
304
- '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
305
- '17531474008201752295': {
306
- error_kind: 'fmtstring',
307
- length: 133,
308
- item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
309
- },
310
122
  },
311
123
  },
312
124
  bytecode: Buffer.from([]),
@@ -514,18 +326,6 @@ export class AuthRegistryContract extends ContractBase {
514
326
  /** is_reject_all(on_behalf_of: struct) */
515
327
  is_reject_all: ((on_behalf_of: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
516
328
 
517
- /** process_message(message_ciphertext: struct, message_context: struct) */
518
- process_message: ((
519
- message_ciphertext: FieldLike[],
520
- message_context: {
521
- tx_hash: FieldLike;
522
- unique_note_hashes_in_tx: FieldLike[];
523
- first_nullifier_in_tx: FieldLike;
524
- recipient: AztecAddressLike;
525
- },
526
- ) => ContractFunctionInteraction) &
527
- Pick<ContractMethod, 'selector'>;
528
-
529
329
  /** public_dispatch(selector: field) */
530
330
  public_dispatch: ((selector: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
531
331
 
@@ -544,9 +344,6 @@ export class AuthRegistryContract extends ContractBase {
544
344
  /** set_reject_all(reject: boolean) */
545
345
  set_reject_all: ((reject: boolean) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
546
346
 
547
- /** sync_private_state() */
548
- sync_private_state: (() => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
549
-
550
347
  /** utility_is_consumable(on_behalf_of: struct, message_hash: field) */
551
348
  utility_is_consumable: ((on_behalf_of: AztecAddressLike, message_hash: FieldLike) => ContractFunctionInteraction) &
552
349
  Pick<ContractMethod, 'selector'>;