@aztec/aztec.js 0.0.1-commit.d6f2b3f94 → 0.0.1-commit.db765a8

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 (71) hide show
  1. package/dest/api/abi.d.ts +2 -2
  2. package/dest/api/abi.d.ts.map +1 -1
  3. package/dest/api/contract.d.ts +3 -3
  4. package/dest/api/contract.d.ts.map +1 -1
  5. package/dest/api/contract.js +1 -1
  6. package/dest/api/wallet.d.ts +2 -2
  7. package/dest/api/wallet.d.ts.map +1 -1
  8. package/dest/contract/base_contract_interaction.d.ts +3 -3
  9. package/dest/contract/base_contract_interaction.d.ts.map +1 -1
  10. package/dest/contract/batch_call.d.ts +3 -3
  11. package/dest/contract/batch_call.d.ts.map +1 -1
  12. package/dest/contract/batch_call.js +17 -8
  13. package/dest/contract/contract_function_interaction.d.ts +5 -5
  14. package/dest/contract/contract_function_interaction.d.ts.map +1 -1
  15. package/dest/contract/contract_function_interaction.js +102 -13
  16. package/dest/contract/deploy_method.d.ts +37 -12
  17. package/dest/contract/deploy_method.d.ts.map +1 -1
  18. package/dest/contract/deploy_method.js +42 -21
  19. package/dest/contract/get_gas_limits.js +3 -3
  20. package/dest/contract/interaction_options.d.ts +62 -21
  21. package/dest/contract/interaction_options.d.ts.map +1 -1
  22. package/dest/contract/interaction_options.js +33 -0
  23. package/dest/contract/protocol_contracts/auth-registry.d.ts +10 -1
  24. package/dest/contract/protocol_contracts/auth-registry.d.ts.map +1 -1
  25. package/dest/contract/protocol_contracts/auth-registry.js +506 -59
  26. package/dest/contract/protocol_contracts/contract-class-registry.d.ts +1 -1
  27. package/dest/contract/protocol_contracts/contract-class-registry.d.ts.map +1 -1
  28. package/dest/contract/protocol_contracts/contract-class-registry.js +12 -0
  29. package/dest/contract/protocol_contracts/fee-juice.d.ts +1 -1
  30. package/dest/contract/protocol_contracts/fee-juice.d.ts.map +1 -1
  31. package/dest/contract/protocol_contracts/fee-juice.js +8 -0
  32. package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts +1 -1
  33. package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts.map +1 -1
  34. package/dest/contract/protocol_contracts/multi-call-entrypoint.js +17 -1
  35. package/dest/contract/protocol_contracts/public-checks.d.ts +1 -1
  36. package/dest/contract/protocol_contracts/public-checks.d.ts.map +1 -1
  37. package/dest/contract/protocol_contracts/public-checks.js +17 -1
  38. package/dest/utils/abi_types.d.ts +6 -1
  39. package/dest/utils/abi_types.d.ts.map +1 -1
  40. package/dest/utils/abi_types.js +1 -1
  41. package/dest/utils/authwit.d.ts +5 -5
  42. package/dest/utils/authwit.d.ts.map +1 -1
  43. package/dest/utils/authwit.js +10 -6
  44. package/dest/wallet/capabilities.d.ts +13 -5
  45. package/dest/wallet/capabilities.d.ts.map +1 -1
  46. package/dest/wallet/deploy_account_method.d.ts +15 -4
  47. package/dest/wallet/deploy_account_method.d.ts.map +1 -1
  48. package/dest/wallet/deploy_account_method.js +26 -0
  49. package/dest/wallet/wallet.d.ts +163 -16
  50. package/dest/wallet/wallet.d.ts.map +1 -1
  51. package/dest/wallet/wallet.js +33 -7
  52. package/package.json +10 -10
  53. package/src/api/abi.ts +1 -0
  54. package/src/api/contract.ts +8 -1
  55. package/src/api/wallet.ts +1 -0
  56. package/src/contract/base_contract_interaction.ts +3 -2
  57. package/src/contract/batch_call.ts +17 -14
  58. package/src/contract/contract_function_interaction.ts +101 -20
  59. package/src/contract/deploy_method.ts +77 -32
  60. package/src/contract/get_gas_limits.ts +3 -3
  61. package/src/contract/interaction_options.ts +96 -23
  62. package/src/contract/protocol_contracts/auth-registry.ts +239 -37
  63. package/src/contract/protocol_contracts/contract-class-registry.ts +3 -0
  64. package/src/contract/protocol_contracts/fee-juice.ts +2 -0
  65. package/src/contract/protocol_contracts/multi-call-entrypoint.ts +5 -1
  66. package/src/contract/protocol_contracts/public-checks.ts +5 -1
  67. package/src/utils/abi_types.ts +7 -0
  68. package/src/utils/authwit.ts +20 -22
  69. package/src/wallet/capabilities.ts +13 -4
  70. package/src/wallet/deploy_account_method.ts +39 -2
  71. package/src/wallet/wallet.ts +46 -6
@@ -21,38 +21,33 @@ const AuthRegistryContractArtifact: ContractArtifact = {
21
21
  functions: [
22
22
  {
23
23
  ...{
24
- functionType: FunctionType.PUBLIC,
25
- name: 'public_dispatch',
24
+ functionType: FunctionType.PRIVATE,
25
+ name: 'set_authorized_private',
26
26
  isOnlySelf: false,
27
27
  isStatic: false,
28
28
  isInitializer: false,
29
- parameters: [{ name: 'selector', type: { kind: 'field' }, visibility: 'private' }],
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
+ ],
30
42
  returnTypes: [],
31
43
  errorTypes: {
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
- },
44
+ '7555607922535724711': { error_kind: 'string', string: 'Preimage mismatch' },
45
+ '9530675838293881722': { error_kind: 'string', string: 'Writer did not write all data' },
46
+ '9894212961085021188': { error_kind: 'string', string: 'Message not authorized by account' },
47
+ '12327971061804302172': { error_kind: 'fmtstring', length: 98, item_types: [] },
48
48
  '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
49
49
  '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
50
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
- },
56
51
  },
57
52
  },
58
53
  bytecode: Buffer.from([]),
@@ -60,14 +55,14 @@ const AuthRegistryContractArtifact: ContractArtifact = {
60
55
  },
61
56
  {
62
57
  ...{
63
- functionType: FunctionType.PRIVATE,
64
- name: 'set_authorized_private',
58
+ functionType: FunctionType.UTILITY,
59
+ name: 'utility_is_consumable',
65
60
  isOnlySelf: false,
66
61
  isStatic: false,
67
62
  isInitializer: false,
68
63
  parameters: [
69
64
  {
70
- name: 'approver',
65
+ name: 'on_behalf_of',
71
66
  type: {
72
67
  kind: 'struct',
73
68
  fields: [{ name: 'inner', type: { kind: 'field' } }],
@@ -76,14 +71,18 @@ const AuthRegistryContractArtifact: ContractArtifact = {
76
71
  visibility: 'private',
77
72
  },
78
73
  { name: 'message_hash', type: { kind: 'field' }, visibility: 'private' },
79
- { name: 'authorize', type: { kind: 'boolean' }, visibility: 'private' },
80
74
  ],
81
- returnTypes: [],
75
+ returnTypes: [{ kind: 'boolean' }],
82
76
  errorTypes: {
83
- '7555607922535724711': { error_kind: 'string', string: 'Preimage mismatch' },
84
- '9894212961085021188': { error_kind: 'string', string: 'Message not authorized by account' },
77
+ '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
78
+ '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
79
+ '13455385521185560676': {
80
+ error_kind: 'string',
81
+ string: 'Storage slot 0 not allowed. Storage slots must start from 1.',
82
+ },
85
83
  '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
86
84
  '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
85
+ '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
87
86
  },
88
87
  },
89
88
  bytecode: Buffer.from([]),
@@ -92,33 +91,221 @@ const AuthRegistryContractArtifact: ContractArtifact = {
92
91
  {
93
92
  ...{
94
93
  functionType: FunctionType.UTILITY,
95
- name: 'utility_is_consumable',
94
+ name: 'process_message',
96
95
  isOnlySelf: false,
97
96
  isStatic: false,
98
97
  isInitializer: false,
99
98
  parameters: [
100
99
  {
101
- name: 'on_behalf_of',
100
+ name: 'message_ciphertext',
102
101
  type: {
103
102
  kind: 'struct',
104
- fields: [{ name: 'inner', type: { kind: 'field' } }],
105
- path: 'aztec::protocol_types::address::aztec_address::AztecAddress',
103
+ fields: [
104
+ { name: 'storage', type: { kind: 'array', length: 15, type: { kind: 'field' } } },
105
+ { name: 'len', type: { kind: 'integer', sign: 'unsigned', width: 32 } },
106
+ ],
107
+ path: 'std::collections::bounded_vec::BoundedVec',
108
+ },
109
+ visibility: 'private',
110
+ },
111
+ {
112
+ name: 'message_context',
113
+ type: {
114
+ kind: 'struct',
115
+ fields: [
116
+ { name: 'tx_hash', type: { kind: 'field' } },
117
+ {
118
+ name: 'unique_note_hashes_in_tx',
119
+ type: {
120
+ kind: 'struct',
121
+ fields: [
122
+ { name: 'storage', type: { kind: 'array', length: 64, type: { kind: 'field' } } },
123
+ { name: 'len', type: { kind: 'integer', sign: 'unsigned', width: 32 } },
124
+ ],
125
+ path: 'std::collections::bounded_vec::BoundedVec',
126
+ },
127
+ },
128
+ { name: 'first_nullifier_in_tx', type: { kind: 'field' } },
129
+ {
130
+ name: 'recipient',
131
+ type: {
132
+ kind: 'struct',
133
+ fields: [{ name: 'inner', type: { kind: 'field' } }],
134
+ path: 'aztec::protocol_types::address::aztec_address::AztecAddress',
135
+ },
136
+ },
137
+ ],
138
+ path: 'aztec::messages::processing::message_context::MessageContext',
106
139
  },
107
140
  visibility: 'private',
108
141
  },
109
- { name: 'message_hash', type: { kind: 'field' }, visibility: 'private' },
110
142
  ],
111
- returnTypes: [{ kind: 'boolean' }],
143
+ returnTypes: [],
144
+ errorTypes: {
145
+ '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
146
+ '992401946138144806': { error_kind: 'string', string: 'Attempted to read past end of BoundedVec' },
147
+ '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
148
+ '2967937905572420042': {
149
+ error_kind: 'fmtstring',
150
+ length: 61,
151
+ item_types: [{ kind: 'field' }, { kind: 'field' }],
152
+ },
153
+ '3330370348214585450': {
154
+ error_kind: 'fmtstring',
155
+ length: 48,
156
+ item_types: [{ kind: 'field' }, { kind: 'field' }],
157
+ },
158
+ '3670003311596808700': {
159
+ error_kind: 'fmtstring',
160
+ length: 77,
161
+ item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
162
+ },
163
+ '4261968856572588300': { error_kind: 'string', string: 'Value does not fit in field' },
164
+ '4440399188109668273': { error_kind: 'string', string: 'Input length must be a multiple of 32' },
165
+ '5417577161503694006': { error_kind: 'fmtstring', length: 56, item_types: [{ kind: 'field' }] },
166
+ '5421095327929394772': { error_kind: 'string', string: 'attempt to bit-shift with overflow' },
167
+ '9530675838293881722': { error_kind: 'string', string: 'Writer did not write all data' },
168
+ '9791669845391776238': {
169
+ error_kind: 'string',
170
+ string: '0 has a square root; you cannot claim it is not square',
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
+ '11692359521570349358': { error_kind: 'fmtstring', length: 40, item_types: [] },
175
+ '12469291177396340830': { error_kind: 'string', string: 'call to assert_max_bit_size' },
176
+ '12913276134398371456': { error_kind: 'string', string: 'push out of bounds' },
177
+ '13557316507370296400': {
178
+ error_kind: 'fmtstring',
179
+ length: 130,
180
+ item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
181
+ },
182
+ '14938672389828944159': {
183
+ error_kind: 'fmtstring',
184
+ length: 146,
185
+ item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
186
+ },
187
+ '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
188
+ '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
189
+ '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
190
+ '17531474008201752295': {
191
+ error_kind: 'fmtstring',
192
+ length: 133,
193
+ item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
194
+ },
195
+ },
196
+ },
197
+ bytecode: Buffer.from([]),
198
+ debugSymbols: '',
199
+ },
200
+ {
201
+ ...{
202
+ functionType: FunctionType.PUBLIC,
203
+ name: 'public_dispatch',
204
+ isOnlySelf: false,
205
+ isStatic: false,
206
+ isInitializer: false,
207
+ parameters: [{ name: 'selector', type: { kind: 'field' }, visibility: 'private' }],
208
+ returnTypes: [],
112
209
  errorTypes: {
113
210
  '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
114
211
  '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
212
+ '5525725861591553972': { error_kind: 'string', string: 'rejecting all' },
213
+ '11691217184967371519': {
214
+ error_kind: 'string',
215
+ string: 'Function is_reject_all can only be called statically',
216
+ },
217
+ '12511970388699677811': { error_kind: 'fmtstring', length: 27, item_types: [{ kind: 'field' }] },
115
218
  '13455385521185560676': {
116
219
  error_kind: 'string',
117
220
  string: 'Storage slot 0 not allowed. Storage slots must start from 1.',
118
221
  },
222
+ '13929691561421487185': {
223
+ error_kind: 'string',
224
+ string: 'Function _set_authorized can only be called by the same contract',
225
+ },
119
226
  '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
120
227
  '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
121
228
  '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
229
+ '17089945683942782951': { error_kind: 'string', string: 'unauthorized' },
230
+ '17312933876399746100': {
231
+ error_kind: 'string',
232
+ string: 'Function is_consumable can only be called statically',
233
+ },
234
+ },
235
+ },
236
+ bytecode: Buffer.from([]),
237
+ debugSymbols: '',
238
+ },
239
+ {
240
+ ...{
241
+ functionType: FunctionType.UTILITY,
242
+ name: 'sync_state',
243
+ isOnlySelf: false,
244
+ isStatic: false,
245
+ isInitializer: false,
246
+ parameters: [],
247
+ returnTypes: [],
248
+ errorTypes: {
249
+ '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
250
+ '992401946138144806': { error_kind: 'string', string: 'Attempted to read past end of BoundedVec' },
251
+ '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
252
+ '2967937905572420042': {
253
+ error_kind: 'fmtstring',
254
+ length: 61,
255
+ item_types: [{ kind: 'field' }, { kind: 'field' }],
256
+ },
257
+ '3330370348214585450': {
258
+ error_kind: 'fmtstring',
259
+ length: 48,
260
+ item_types: [{ kind: 'field' }, { kind: 'field' }],
261
+ },
262
+ '3670003311596808700': {
263
+ error_kind: 'fmtstring',
264
+ length: 77,
265
+ item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
266
+ },
267
+ '4261968856572588300': { error_kind: 'string', string: 'Value does not fit in field' },
268
+ '4440399188109668273': { error_kind: 'string', string: 'Input length must be a multiple of 32' },
269
+ '5417577161503694006': { error_kind: 'fmtstring', length: 56, item_types: [{ kind: 'field' }] },
270
+ '5421095327929394772': { error_kind: 'string', string: 'attempt to bit-shift with overflow' },
271
+ '9530675838293881722': { error_kind: 'string', string: 'Writer did not write all data' },
272
+ '9791669845391776238': {
273
+ error_kind: 'string',
274
+ string: '0 has a square root; you cannot claim it is not square',
275
+ },
276
+ '9885968605480832328': {
277
+ error_kind: 'string',
278
+ string: 'Attempted to read past the length of a CapsuleArray',
279
+ },
280
+ '10135509984888824963': { error_kind: 'fmtstring', length: 58, item_types: [{ kind: 'field' }] },
281
+ '10791800398362570014': { error_kind: 'string', string: 'extend_from_bounded_vec out of bounds' },
282
+ '11021520179822076911': {
283
+ error_kind: 'string',
284
+ string: 'Attempted to delete past the length of a CapsuleArray',
285
+ },
286
+ '11692359521570349358': { error_kind: 'fmtstring', length: 40, item_types: [] },
287
+ '12327971061804302172': { error_kind: 'fmtstring', length: 98, item_types: [] },
288
+ '12469291177396340830': { error_kind: 'string', string: 'call to assert_max_bit_size' },
289
+ '12913276134398371456': { error_kind: 'string', string: 'push out of bounds' },
290
+ '13557316507370296400': {
291
+ error_kind: 'fmtstring',
292
+ length: 130,
293
+ item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
294
+ },
295
+ '14938672389828944159': {
296
+ error_kind: 'fmtstring',
297
+ length: 146,
298
+ item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
299
+ },
300
+ '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
301
+ '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
302
+ '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
303
+ '17531474008201752295': {
304
+ error_kind: 'fmtstring',
305
+ length: 133,
306
+ item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
307
+ },
308
+ '17655676068928457687': { error_kind: 'string', string: 'Reader did not read all data' },
122
309
  },
123
310
  },
124
311
  bytecode: Buffer.from([]),
@@ -326,6 +513,18 @@ export class AuthRegistryContract extends ContractBase {
326
513
  /** is_reject_all(on_behalf_of: struct) */
327
514
  is_reject_all: ((on_behalf_of: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
328
515
 
516
+ /** process_message(message_ciphertext: struct, message_context: struct) */
517
+ process_message: ((
518
+ message_ciphertext: FieldLike[],
519
+ message_context: {
520
+ tx_hash: FieldLike;
521
+ unique_note_hashes_in_tx: FieldLike[];
522
+ first_nullifier_in_tx: FieldLike;
523
+ recipient: AztecAddressLike;
524
+ },
525
+ ) => ContractFunctionInteraction) &
526
+ Pick<ContractMethod, 'selector'>;
527
+
329
528
  /** public_dispatch(selector: field) */
330
529
  public_dispatch: ((selector: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
331
530
 
@@ -344,6 +543,9 @@ export class AuthRegistryContract extends ContractBase {
344
543
  /** set_reject_all(reject: boolean) */
345
544
  set_reject_all: ((reject: boolean) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
346
545
 
546
+ /** sync_state() */
547
+ sync_state: (() => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
548
+
347
549
  /** utility_is_consumable(on_behalf_of: struct, message_hash: field) */
348
550
  utility_is_consumable: ((on_behalf_of: AztecAddressLike, message_hash: FieldLike) => ContractFunctionInteraction) &
349
551
  Pick<ContractMethod, 'selector'>;
@@ -36,13 +36,16 @@ const ContractClassRegistryContractArtifact: ContractArtifact = {
36
36
  '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
37
37
  '922421554006670918': { error_kind: 'string', string: 'num_items is greater than MAX_ITEMS' },
38
38
  '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
39
+ '9475115977882098926': { error_kind: 'string', string: 'Extra bytes in the last field of the bytecode' },
39
40
  '10965409165809799877': {
40
41
  error_kind: 'string',
41
42
  string: 'Given in_len to absorb is larger than the input array len',
42
43
  },
44
+ '12469291177396340830': { error_kind: 'string', string: 'call to assert_max_bit_size' },
43
45
  '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
44
46
  '15669273164684982983': { error_kind: 'string', string: 'num_permutations is greater than MAX_PERMUTATIONS' },
45
47
  '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
48
+ '15835548349546956319': { error_kind: 'string', string: 'Field failed to decompose into specified 32 limbs' },
46
49
  '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
47
50
  '16450579948625159707': { error_kind: 'string', string: 'Sponge must be in cache_size=1' },
48
51
  '17655676068928457687': { error_kind: 'string', string: 'Reader did not read all data' },
@@ -44,6 +44,7 @@ const FeeJuiceContractArtifact: ContractArtifact = {
44
44
  errorTypes: {
45
45
  '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
46
46
  '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
47
+ '5421095327929394772': { error_kind: 'string', string: 'attempt to bit-shift with overflow' },
47
48
  '6609888949476313245': { error_kind: 'string', string: 'Message not in state' },
48
49
  '11019205087382408538': { error_kind: 'string', string: 'Field failed to decompose into specified 4 limbs' },
49
50
  '12370419938245003393': { error_kind: 'string', string: 'Field failed to decompose into specified 36 limbs' },
@@ -81,6 +82,7 @@ const FeeJuiceContractArtifact: ContractArtifact = {
81
82
  errorTypes: {
82
83
  '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
83
84
  '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
85
+ '5421095327929394772': { error_kind: 'string', string: 'attempt to bit-shift with overflow' },
84
86
  '6609888949476313245': { error_kind: 'string', string: 'Message not in state' },
85
87
  '11019205087382408538': { error_kind: 'string', string: 'Field failed to decompose into specified 4 limbs' },
86
88
  '12370419938245003393': { error_kind: 'string', string: 'Field failed to decompose into specified 36 limbs' },
@@ -99,7 +99,7 @@ const MultiCallEntrypointContractArtifact: ContractArtifact = {
99
99
  type: {
100
100
  kind: 'struct',
101
101
  fields: [
102
- { name: 'storage', type: { kind: 'array', length: 17, type: { kind: 'field' } } },
102
+ { name: 'storage', type: { kind: 'array', length: 15, type: { kind: 'field' } } },
103
103
  { name: 'len', type: { kind: 'integer', sign: 'unsigned', width: 32 } },
104
104
  ],
105
105
  path: 'std::collections::bounded_vec::BoundedVec',
@@ -161,6 +161,8 @@ const MultiCallEntrypointContractArtifact: ContractArtifact = {
161
161
  '4261968856572588300': { error_kind: 'string', string: 'Value does not fit in field' },
162
162
  '4440399188109668273': { error_kind: 'string', string: 'Input length must be a multiple of 32' },
163
163
  '5417577161503694006': { error_kind: 'fmtstring', length: 56, item_types: [{ kind: 'field' }] },
164
+ '5421095327929394772': { error_kind: 'string', string: 'attempt to bit-shift with overflow' },
165
+ '9530675838293881722': { error_kind: 'string', string: 'Writer did not write all data' },
164
166
  '9791669845391776238': {
165
167
  error_kind: 'string',
166
168
  string: '0 has a square root; you cannot claim it is not square',
@@ -224,6 +226,8 @@ const MultiCallEntrypointContractArtifact: ContractArtifact = {
224
226
  '4261968856572588300': { error_kind: 'string', string: 'Value does not fit in field' },
225
227
  '4440399188109668273': { error_kind: 'string', string: 'Input length must be a multiple of 32' },
226
228
  '5417577161503694006': { error_kind: 'fmtstring', length: 56, item_types: [{ kind: 'field' }] },
229
+ '5421095327929394772': { error_kind: 'string', string: 'attempt to bit-shift with overflow' },
230
+ '9530675838293881722': { error_kind: 'string', string: 'Writer did not write all data' },
227
231
  '9791669845391776238': {
228
232
  error_kind: 'string',
229
233
  string: '0 has a square root; you cannot claim it is not square',
@@ -32,7 +32,7 @@ const PublicChecksContractArtifact: ContractArtifact = {
32
32
  type: {
33
33
  kind: 'struct',
34
34
  fields: [
35
- { name: 'storage', type: { kind: 'array', length: 17, type: { kind: 'field' } } },
35
+ { name: 'storage', type: { kind: 'array', length: 15, type: { kind: 'field' } } },
36
36
  { name: 'len', type: { kind: 'integer', sign: 'unsigned', width: 32 } },
37
37
  ],
38
38
  path: 'std::collections::bounded_vec::BoundedVec',
@@ -94,6 +94,8 @@ const PublicChecksContractArtifact: ContractArtifact = {
94
94
  '4261968856572588300': { error_kind: 'string', string: 'Value does not fit in field' },
95
95
  '4440399188109668273': { error_kind: 'string', string: 'Input length must be a multiple of 32' },
96
96
  '5417577161503694006': { error_kind: 'fmtstring', length: 56, item_types: [{ kind: 'field' }] },
97
+ '5421095327929394772': { error_kind: 'string', string: 'attempt to bit-shift with overflow' },
98
+ '9530675838293881722': { error_kind: 'string', string: 'Writer did not write all data' },
97
99
  '9791669845391776238': {
98
100
  error_kind: 'string',
99
101
  string: '0 has a square root; you cannot claim it is not square',
@@ -185,6 +187,8 @@ const PublicChecksContractArtifact: ContractArtifact = {
185
187
  '4261968856572588300': { error_kind: 'string', string: 'Value does not fit in field' },
186
188
  '4440399188109668273': { error_kind: 'string', string: 'Input length must be a multiple of 32' },
187
189
  '5417577161503694006': { error_kind: 'fmtstring', length: 56, item_types: [{ kind: 'field' }] },
190
+ '5421095327929394772': { error_kind: 'string', string: 'attempt to bit-shift with overflow' },
191
+ '9530675838293881722': { error_kind: 'string', string: 'Writer did not write all data' },
188
192
  '9791669845391776238': {
189
193
  error_kind: 'string',
190
194
  string: '0 has a square root; you cannot claim it is not square',
@@ -23,3 +23,10 @@ export type U128Like = bigint | number;
23
23
 
24
24
  /** Any type that can be converted into a struct with a single `inner` field. */
25
25
  export type WrappedFieldLike = { /** Wrapped value */ inner: FieldLike } | FieldLike;
26
+
27
+ /** Noir `Option<T>` lowered ABI shape, plus ergonomic direct `T | null | undefined` inputs. */
28
+ export type OptionLike<T> =
29
+ | T
30
+ | null
31
+ | undefined
32
+ | { /** Whether the option is populated */ _is_some: boolean; /** Wrapped value */ _value: T };
@@ -5,7 +5,7 @@ import { type ABIParameterVisibility, type FunctionAbi, type FunctionCall, Funct
5
5
  import { AuthWitness, computeInnerAuthWitHash, computeOuterAuthWitHash } from '@aztec/stdlib/auth-witness';
6
6
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
7
7
  import { computeVarArgsHash } from '@aztec/stdlib/hash';
8
- import type { TxHash, TxProfileResult, TxReceipt } from '@aztec/stdlib/tx';
8
+ import type { TxProfileResult } from '@aztec/stdlib/tx';
9
9
 
10
10
  import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
11
11
  import type {
@@ -15,7 +15,8 @@ import type {
15
15
  SendInteractionOptionsWithoutWait,
16
16
  SendReturn,
17
17
  SimulateInteractionOptions,
18
- SimulationReturn,
18
+ SimulationResult,
19
+ TxSendResultMined,
19
20
  } from '../contract/interaction_options.js';
20
21
  import type { Wallet } from '../wallet/index.js';
21
22
 
@@ -189,10 +190,12 @@ export async function lookupValidity(
189
190
  errorTypes: {},
190
191
  } as FunctionAbi;
191
192
  try {
192
- results.isValidInPrivate = (await new ContractFunctionInteraction(wallet, onBehalfOf, lookupValidityAbi, [
193
- consumer,
194
- innerHash,
195
- ]).simulate({ from: onBehalfOf, authWitnesses: [witness] })) as boolean;
193
+ results.isValidInPrivate = (
194
+ await new ContractFunctionInteraction(wallet, onBehalfOf, lookupValidityAbi, [consumer, innerHash]).simulate({
195
+ from: onBehalfOf,
196
+ authWitnesses: [witness],
197
+ })
198
+ ).result as boolean;
196
199
  // TODO: Narrow down the error to make sure simulation failed due to an invalid authwit
197
200
  // eslint-disable-next-line no-empty
198
201
  } catch {}
@@ -219,12 +222,12 @@ export async function lookupValidity(
219
222
  returnTypes: [{ kind: 'boolean' }],
220
223
  errorTypes: {},
221
224
  } as FunctionAbi;
222
- results.isValidInPublic = (await new ContractFunctionInteraction(
223
- wallet,
224
- ProtocolContractAddress.AuthRegistry,
225
- isConsumableAbi,
226
- [onBehalfOf, messageHash],
227
- ).simulate({ from: onBehalfOf })) as boolean;
225
+ results.isValidInPublic = (
226
+ await new ContractFunctionInteraction(wallet, ProtocolContractAddress.AuthRegistry, isConsumableAbi, [
227
+ onBehalfOf,
228
+ messageHash,
229
+ ]).simulate({ from: onBehalfOf })
230
+ ).result as boolean;
228
231
 
229
232
  return results;
230
233
  }
@@ -262,14 +265,10 @@ export class SetPublicAuthwitContractInteraction extends ContractFunctionInterac
262
265
  * @param options - An optional object containing additional configuration for the transaction.
263
266
  * @returns The result of the transaction as returned by the contract function.
264
267
  */
265
- public override simulate<T extends SimulateInteractionOptions>(
266
- options: Omit<T, 'from'>,
267
- ): Promise<SimulationReturn<T['includeMetadata']>>;
268
- // eslint-disable-next-line jsdoc/require-jsdoc
269
268
  public override simulate(
270
- options: Omit<SimulateInteractionOptions, 'from'> = {},
271
- ): Promise<SimulationReturn<typeof options.includeMetadata>> {
272
- return super.simulate({ ...options, from: this.from });
269
+ options: Omit<SimulateInteractionOptions, 'from'> = {} as Omit<SimulateInteractionOptions, 'from'>,
270
+ ): Promise<SimulationResult> {
271
+ return super.simulate({ ...options, from: this.from } as SimulateInteractionOptions);
273
272
  }
274
273
 
275
274
  /**
@@ -290,8 +289,7 @@ export class SetPublicAuthwitContractInteraction extends ContractFunctionInterac
290
289
  * @param options - An optional object containing 'fee' options information
291
290
  * @returns A TxReceipt (if wait is true/undefined) or TxHash (if wait is false)
292
291
  */
293
- // Overload for when wait is not specified at all - returns TxReceipt
294
- public override send(options?: Omit<SendInteractionOptionsWithoutWait, 'from'>): Promise<TxReceipt>;
292
+ public override send(options?: Omit<SendInteractionOptionsWithoutWait, 'from'>): Promise<TxSendResultMined>;
295
293
  // Generic overload for explicit wait values
296
294
  // eslint-disable-next-line jsdoc/require-jsdoc
297
295
  public override send<W extends InteractionWaitOptions>(
@@ -300,7 +298,7 @@ export class SetPublicAuthwitContractInteraction extends ContractFunctionInterac
300
298
  // eslint-disable-next-line jsdoc/require-jsdoc
301
299
  public override send(
302
300
  options?: Omit<SendInteractionOptions<InteractionWaitOptions>, 'from'>,
303
- ): Promise<TxReceipt | TxHash> {
301
+ ): Promise<SendReturn<InteractionWaitOptions>> {
304
302
  return super.send({ ...options, from: this.from });
305
303
  }
306
304
 
@@ -32,6 +32,15 @@ export interface ContractFunctionPattern {
32
32
 
33
33
  /** Function name or '*' for any function */
34
34
  function: string;
35
+
36
+ /**
37
+ * Additional addresses whose private state and keys are accessible
38
+ * when calling this function, beyond the sender's.
39
+ * - undefined: No additional scopes allowed
40
+ * - AztecAddress[]: Only these specific addresses allowed as additional scopes
41
+ * - '*': All known address allowed as an additional scope
42
+ */
43
+ additionalScopes?: AztecAddress[] | '*';
35
44
  }
36
45
 
37
46
  /**
@@ -180,11 +189,11 @@ export interface ContractClassesCapability {
180
189
  export interface GrantedContractClassesCapability extends ContractClassesCapability {}
181
190
 
182
191
  /**
183
- * Transaction simulation capability - for simulating transactions and utilities.
192
+ * Transaction simulation capability - for simulating transactions and executing utilities.
184
193
  *
185
194
  * Maps to wallet methods:
186
195
  * - simulateTx (when transactions scope specified)
187
- * - simulateUtility (when utilities scope specified)
196
+ * - executeUtility (when utilities scope specified)
188
197
  * - profileTx (when transactions scope specified)
189
198
  *
190
199
  * @example
@@ -200,7 +209,7 @@ export interface GrantedContractClassesCapability extends ContractClassesCapabil
200
209
  * \}
201
210
  *
202
211
  * @example
203
- * // Simulate any transaction and utility call
212
+ * // Simulate any transaction and execute any utility call
204
213
  * \{
205
214
  * type: 'simulation',
206
215
  * transactions: \{ scope: '*' \},
@@ -221,7 +230,7 @@ export interface SimulationCapability {
221
230
  scope: '*' | ContractFunctionPattern[];
222
231
  };
223
232
 
224
- /** Utility simulation scope (unconstrained calls). Maps to: simulateUtility */
233
+ /** Utility execution scope (unconstrained calls). Maps to: executeUtility */
225
234
  utilities?: {
226
235
  /**
227
236
  * Which contracts/functions to allow: