@aztec/aztec.js 0.0.1-commit.21caa21 → 0.0.1-commit.23b0eb0

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 (197) hide show
  1. package/dest/account/account.d.ts +25 -40
  2. package/dest/account/account.d.ts.map +1 -1
  3. package/dest/account/account.js +19 -47
  4. package/dest/account/account_contract.d.ts +9 -10
  5. package/dest/account/account_contract.d.ts.map +1 -1
  6. package/dest/account/account_with_secret_key.d.ts +21 -9
  7. package/dest/account/account_with_secret_key.d.ts.map +1 -1
  8. package/dest/account/account_with_secret_key.js +21 -4
  9. package/dest/account/index.d.ts +4 -3
  10. package/dest/account/index.d.ts.map +1 -1
  11. package/dest/account/index.js +2 -0
  12. package/dest/account/signerless_account.d.ts +6 -7
  13. package/dest/account/signerless_account.d.ts.map +1 -1
  14. package/dest/account/signerless_account.js +8 -11
  15. package/dest/api/account.d.ts +2 -4
  16. package/dest/api/account.d.ts.map +1 -1
  17. package/dest/api/account.js +1 -3
  18. package/dest/api/authorization.d.ts +2 -2
  19. package/dest/api/authorization.d.ts.map +1 -1
  20. package/dest/api/authorization.js +1 -1
  21. package/dest/api/contract.d.ts +16 -10
  22. package/dest/api/contract.d.ts.map +1 -1
  23. package/dest/api/contract.js +14 -8
  24. package/dest/api/fields.d.ts +3 -2
  25. package/dest/api/fields.d.ts.map +1 -1
  26. package/dest/api/fields.js +2 -1
  27. package/dest/api/keys.d.ts +1 -1
  28. package/dest/api/keys.js +1 -1
  29. package/dest/api/node.d.ts +8 -4
  30. package/dest/api/node.d.ts.map +1 -1
  31. package/dest/api/node.js +7 -3
  32. package/dest/api/protocol.d.ts +7 -1
  33. package/dest/api/protocol.d.ts.map +1 -1
  34. package/dest/api/protocol.js +6 -0
  35. package/dest/api/tx.d.ts +2 -2
  36. package/dest/api/tx.d.ts.map +1 -1
  37. package/dest/api/tx.js +1 -1
  38. package/dest/api/wallet.d.ts +3 -2
  39. package/dest/api/wallet.d.ts.map +1 -1
  40. package/dest/api/wallet.js +2 -1
  41. package/dest/authorization/call_authorization_request.d.ts +23 -2
  42. package/dest/authorization/call_authorization_request.d.ts.map +1 -1
  43. package/dest/contract/base_contract_interaction.d.ts +8 -10
  44. package/dest/contract/base_contract_interaction.d.ts.map +1 -1
  45. package/dest/contract/base_contract_interaction.js +5 -17
  46. package/dest/contract/batch_call.d.ts +1 -1
  47. package/dest/contract/batch_call.d.ts.map +1 -1
  48. package/dest/contract/batch_call.js +3 -1
  49. package/dest/contract/contract_base.d.ts +4 -1
  50. package/dest/contract/contract_base.d.ts.map +1 -1
  51. package/dest/contract/contract_function_interaction.d.ts +1 -1
  52. package/dest/contract/deploy_method.d.ts +64 -17
  53. package/dest/contract/deploy_method.d.ts.map +1 -1
  54. package/dest/contract/deploy_method.js +42 -24
  55. package/dest/contract/interaction_options.d.ts +42 -5
  56. package/dest/contract/interaction_options.d.ts.map +1 -1
  57. package/dest/contract/interaction_options.js +8 -1
  58. package/dest/contract/protocol_contracts/auth-registry.d.ts +27 -0
  59. package/dest/contract/protocol_contracts/auth-registry.d.ts.map +1 -0
  60. package/dest/contract/protocol_contracts/auth-registry.js +558 -0
  61. package/dest/contract/protocol_contracts/contract-class-registry.d.ts +26 -0
  62. package/dest/contract/protocol_contracts/contract-class-registry.d.ts.map +1 -0
  63. package/dest/contract/protocol_contracts/contract-class-registry.js +385 -0
  64. package/dest/contract/protocol_contracts/contract-instance-registry.d.ts +22 -0
  65. package/dest/contract/protocol_contracts/contract-instance-registry.d.ts.map +1 -0
  66. package/dest/contract/protocol_contracts/contract-instance-registry.js +465 -0
  67. package/dest/contract/protocol_contracts/fee-juice.d.ts +21 -0
  68. package/dest/contract/protocol_contracts/fee-juice.d.ts.map +1 -0
  69. package/dest/contract/protocol_contracts/fee-juice.js +426 -0
  70. package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts +34 -0
  71. package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts.map +1 -0
  72. package/dest/contract/protocol_contracts/multi-call-entrypoint.js +567 -0
  73. package/dest/contract/protocol_contracts/public-checks.d.ts +26 -0
  74. package/dest/contract/protocol_contracts/public-checks.d.ts.map +1 -0
  75. package/dest/contract/protocol_contracts/public-checks.js +575 -0
  76. package/dest/contract/wait_for_proven.d.ts +2 -2
  77. package/dest/contract/wait_for_proven.d.ts.map +1 -1
  78. package/dest/contract/wait_for_proven.js +1 -1
  79. package/dest/contract/wait_opts.d.ts +16 -0
  80. package/dest/contract/wait_opts.d.ts.map +1 -0
  81. package/dest/contract/wait_opts.js +5 -0
  82. package/dest/deployment/broadcast_function.js +4 -4
  83. package/dest/deployment/publish_class.js +3 -3
  84. package/dest/deployment/publish_instance.d.ts +2 -2
  85. package/dest/deployment/publish_instance.d.ts.map +1 -1
  86. package/dest/deployment/publish_instance.js +3 -3
  87. package/dest/ethereum/portal_manager.d.ts +9 -6
  88. package/dest/ethereum/portal_manager.d.ts.map +1 -1
  89. package/dest/ethereum/portal_manager.js +17 -18
  90. package/dest/fee/fee_juice_payment_method_with_claim.js +1 -1
  91. package/dest/fee/private_fee_payment_method.js +1 -1
  92. package/dest/fee/public_fee_payment_method.js +1 -1
  93. package/dest/scripts/generate_protocol_contract_types.d.ts +2 -0
  94. package/dest/scripts/generate_protocol_contract_types.d.ts.map +1 -0
  95. package/dest/scripts/generate_protocol_contract_types.js +120 -0
  96. package/dest/utils/abi_types.d.ts +2 -2
  97. package/dest/utils/abi_types.d.ts.map +1 -1
  98. package/dest/utils/authwit.d.ts +9 -7
  99. package/dest/utils/authwit.d.ts.map +1 -1
  100. package/dest/utils/authwit.js +6 -10
  101. package/dest/utils/cross_chain.d.ts +2 -2
  102. package/dest/utils/cross_chain.d.ts.map +1 -1
  103. package/dest/utils/fee_juice.js +1 -1
  104. package/dest/utils/field_compressed_string.js +1 -1
  105. package/dest/utils/node.d.ts +12 -1
  106. package/dest/utils/node.d.ts.map +1 -1
  107. package/dest/utils/node.js +46 -0
  108. package/dest/utils/pub_key.d.ts +2 -2
  109. package/dest/utils/pub_key.d.ts.map +1 -1
  110. package/dest/utils/pub_key.js +1 -1
  111. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts +5 -8
  112. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -1
  113. package/dest/wallet/account_entrypoint_meta_payment_method.js +28 -43
  114. package/dest/wallet/account_manager.d.ts +6 -9
  115. package/dest/wallet/account_manager.d.ts.map +1 -1
  116. package/dest/wallet/account_manager.js +6 -12
  117. package/dest/wallet/capabilities.d.ts +444 -0
  118. package/dest/wallet/capabilities.d.ts.map +1 -0
  119. package/dest/wallet/capabilities.js +3 -0
  120. package/dest/wallet/deploy_account_method.d.ts +35 -7
  121. package/dest/wallet/deploy_account_method.d.ts.map +1 -1
  122. package/dest/wallet/deploy_account_method.js +8 -6
  123. package/dest/wallet/index.d.ts +2 -1
  124. package/dest/wallet/index.d.ts.map +1 -1
  125. package/dest/wallet/index.js +1 -0
  126. package/dest/wallet/wallet.d.ts +1542 -917
  127. package/dest/wallet/wallet.d.ts.map +1 -1
  128. package/dest/wallet/wallet.js +191 -86
  129. package/package.json +15 -13
  130. package/src/account/account.ts +34 -58
  131. package/src/account/account_contract.ts +7 -8
  132. package/src/account/account_with_secret_key.ts +34 -9
  133. package/src/account/index.ts +3 -2
  134. package/src/account/signerless_account.ts +14 -13
  135. package/src/api/account.ts +9 -3
  136. package/src/api/authorization.ts +1 -0
  137. package/src/api/contract.ts +22 -7
  138. package/src/api/fields.ts +2 -1
  139. package/src/api/keys.ts +2 -2
  140. package/src/api/node.ts +7 -3
  141. package/src/api/protocol.ts +7 -0
  142. package/src/api/tx.ts +2 -0
  143. package/src/api/wallet.ts +47 -2
  144. package/src/authorization/call_authorization_request.ts +1 -1
  145. package/src/contract/base_contract_interaction.ts +27 -15
  146. package/src/contract/batch_call.ts +4 -2
  147. package/src/contract/deploy_method.ts +123 -30
  148. package/src/contract/interaction_options.ts +49 -4
  149. package/src/contract/protocol_contracts/auth-registry.ts +351 -0
  150. package/src/contract/protocol_contracts/contract-class-registry.ts +241 -0
  151. package/src/contract/protocol_contracts/contract-instance-registry.ts +302 -0
  152. package/src/contract/protocol_contracts/fee-juice.ts +264 -0
  153. package/src/contract/protocol_contracts/multi-call-entrypoint.ts +330 -0
  154. package/src/contract/protocol_contracts/public-checks.ts +314 -0
  155. package/src/contract/wait_for_proven.ts +1 -1
  156. package/src/contract/wait_opts.ts +21 -0
  157. package/src/deployment/broadcast_function.ts +4 -4
  158. package/src/deployment/publish_class.ts +3 -3
  159. package/src/deployment/publish_instance.ts +3 -6
  160. package/src/ethereum/portal_manager.ts +20 -24
  161. package/src/fee/fee_juice_payment_method_with_claim.ts +1 -1
  162. package/src/fee/private_fee_payment_method.ts +1 -1
  163. package/src/fee/public_fee_payment_method.ts +1 -1
  164. package/src/scripts/generate_protocol_contract_types.ts +150 -0
  165. package/src/utils/abi_types.ts +1 -1
  166. package/src/utils/authwit.ts +20 -8
  167. package/src/utils/cross_chain.ts +1 -1
  168. package/src/utils/fee_juice.ts +1 -1
  169. package/src/utils/field_compressed_string.ts +1 -1
  170. package/src/utils/node.ts +62 -0
  171. package/src/utils/pub_key.ts +2 -2
  172. package/src/wallet/account_entrypoint_meta_payment_method.ts +28 -60
  173. package/src/wallet/account_manager.ts +6 -14
  174. package/src/wallet/capabilities.ts +491 -0
  175. package/src/wallet/deploy_account_method.ts +38 -14
  176. package/src/wallet/index.ts +1 -0
  177. package/src/wallet/wallet.ts +307 -92
  178. package/dest/account/interface.d.ts +0 -19
  179. package/dest/account/interface.d.ts.map +0 -1
  180. package/dest/account/interface.js +0 -5
  181. package/dest/contract/deploy_sent_tx.d.ts +0 -48
  182. package/dest/contract/deploy_sent_tx.d.ts.map +0 -1
  183. package/dest/contract/deploy_sent_tx.js +0 -46
  184. package/dest/contract/protocol_contracts.d.ts +0 -9
  185. package/dest/contract/protocol_contracts.d.ts.map +0 -1
  186. package/dest/contract/protocol_contracts.js +0 -26
  187. package/dest/contract/sent_tx.d.ts +0 -51
  188. package/dest/contract/sent_tx.d.ts.map +0 -1
  189. package/dest/contract/sent_tx.js +0 -90
  190. package/dest/contract/unsafe_contract.d.ts +0 -15
  191. package/dest/contract/unsafe_contract.d.ts.map +0 -1
  192. package/dest/contract/unsafe_contract.js +0 -6
  193. package/src/account/interface.ts +0 -25
  194. package/src/contract/deploy_sent_tx.ts +0 -75
  195. package/src/contract/protocol_contracts.ts +0 -35
  196. package/src/contract/sent_tx.ts +0 -130
  197. package/src/contract/unsafe_contract.ts +0 -19
@@ -0,0 +1,575 @@
1
+ /* Autogenerated file, do not edit! */ /* eslint-disable */ import { ProtocolContractAddress } from '@aztec/protocol-contracts';
2
+ import { FunctionType } from '@aztec/stdlib/abi';
3
+ import { ContractBase } from '../contract_base.js';
4
+ const PublicChecksContractArtifact = {
5
+ name: 'PublicChecks',
6
+ functions: [
7
+ {
8
+ ...{
9
+ functionType: FunctionType.UTILITY,
10
+ name: 'process_message',
11
+ isOnlySelf: false,
12
+ isStatic: false,
13
+ isInitializer: false,
14
+ parameters: [
15
+ {
16
+ name: 'message_ciphertext',
17
+ type: {
18
+ kind: 'struct',
19
+ fields: [
20
+ {
21
+ name: 'storage',
22
+ type: {
23
+ kind: 'array',
24
+ length: 17,
25
+ type: {
26
+ kind: 'field'
27
+ }
28
+ }
29
+ },
30
+ {
31
+ name: 'len',
32
+ type: {
33
+ kind: 'integer',
34
+ sign: 'unsigned',
35
+ width: 32
36
+ }
37
+ }
38
+ ],
39
+ path: 'std::collections::bounded_vec::BoundedVec'
40
+ },
41
+ visibility: 'private'
42
+ },
43
+ {
44
+ name: 'message_context',
45
+ type: {
46
+ kind: 'struct',
47
+ fields: [
48
+ {
49
+ name: 'tx_hash',
50
+ type: {
51
+ kind: 'field'
52
+ }
53
+ },
54
+ {
55
+ name: 'unique_note_hashes_in_tx',
56
+ type: {
57
+ kind: 'struct',
58
+ fields: [
59
+ {
60
+ name: 'storage',
61
+ type: {
62
+ kind: 'array',
63
+ length: 64,
64
+ type: {
65
+ kind: 'field'
66
+ }
67
+ }
68
+ },
69
+ {
70
+ name: 'len',
71
+ type: {
72
+ kind: 'integer',
73
+ sign: 'unsigned',
74
+ width: 32
75
+ }
76
+ }
77
+ ],
78
+ path: 'std::collections::bounded_vec::BoundedVec'
79
+ }
80
+ },
81
+ {
82
+ name: 'first_nullifier_in_tx',
83
+ type: {
84
+ kind: 'field'
85
+ }
86
+ },
87
+ {
88
+ name: 'recipient',
89
+ type: {
90
+ kind: 'struct',
91
+ fields: [
92
+ {
93
+ name: 'inner',
94
+ type: {
95
+ kind: 'field'
96
+ }
97
+ }
98
+ ],
99
+ path: 'aztec::protocol_types::address::aztec_address::AztecAddress'
100
+ }
101
+ }
102
+ ],
103
+ path: 'aztec::messages::processing::message_context::MessageContext'
104
+ },
105
+ visibility: 'private'
106
+ }
107
+ ],
108
+ returnTypes: [],
109
+ errorTypes: {
110
+ '361444214588792908': {
111
+ error_kind: 'string',
112
+ string: 'attempt to multiply with overflow'
113
+ },
114
+ '992401946138144806': {
115
+ error_kind: 'string',
116
+ string: 'Attempted to read past end of BoundedVec'
117
+ },
118
+ '1998584279744703196': {
119
+ error_kind: 'string',
120
+ string: 'attempt to subtract with overflow'
121
+ },
122
+ '2967937905572420042': {
123
+ error_kind: 'fmtstring',
124
+ length: 61,
125
+ item_types: [
126
+ {
127
+ kind: 'field'
128
+ },
129
+ {
130
+ kind: 'field'
131
+ }
132
+ ]
133
+ },
134
+ '3330370348214585450': {
135
+ error_kind: 'fmtstring',
136
+ length: 48,
137
+ item_types: [
138
+ {
139
+ kind: 'field'
140
+ },
141
+ {
142
+ kind: 'field'
143
+ }
144
+ ]
145
+ },
146
+ '3670003311596808700': {
147
+ error_kind: 'fmtstring',
148
+ length: 77,
149
+ item_types: [
150
+ {
151
+ kind: 'integer',
152
+ sign: 'unsigned',
153
+ width: 32
154
+ }
155
+ ]
156
+ },
157
+ '4261968856572588300': {
158
+ error_kind: 'string',
159
+ string: 'Value does not fit in field'
160
+ },
161
+ '4440399188109668273': {
162
+ error_kind: 'string',
163
+ string: 'Input length must be a multiple of 32'
164
+ },
165
+ '9791669845391776238': {
166
+ error_kind: 'string',
167
+ string: '0 has a square root; you cannot claim it is not square'
168
+ },
169
+ '10135509984888824963': {
170
+ error_kind: 'fmtstring',
171
+ length: 58,
172
+ item_types: [
173
+ {
174
+ kind: 'field'
175
+ }
176
+ ]
177
+ },
178
+ '10791800398362570014': {
179
+ error_kind: 'string',
180
+ string: 'extend_from_bounded_vec out of bounds'
181
+ },
182
+ '11692359521570349358': {
183
+ error_kind: 'fmtstring',
184
+ length: 40,
185
+ item_types: []
186
+ },
187
+ '12469291177396340830': {
188
+ error_kind: 'string',
189
+ string: 'call to assert_max_bit_size'
190
+ },
191
+ '12913276134398371456': {
192
+ error_kind: 'string',
193
+ string: 'push out of bounds'
194
+ },
195
+ '13557316507370296400': {
196
+ error_kind: 'fmtstring',
197
+ length: 130,
198
+ item_types: [
199
+ {
200
+ kind: 'integer',
201
+ sign: 'unsigned',
202
+ width: 32
203
+ }
204
+ ]
205
+ },
206
+ '14938672389828944159': {
207
+ error_kind: 'fmtstring',
208
+ length: 146,
209
+ item_types: [
210
+ {
211
+ kind: 'integer',
212
+ sign: 'unsigned',
213
+ width: 32
214
+ }
215
+ ]
216
+ },
217
+ '14990209321349310352': {
218
+ error_kind: 'string',
219
+ string: 'attempt to add with overflow'
220
+ },
221
+ '15764276373176857197': {
222
+ error_kind: 'string',
223
+ string: 'Stack too deep'
224
+ },
225
+ '16431471497789672479': {
226
+ error_kind: 'string',
227
+ string: 'Index out of bounds'
228
+ },
229
+ '17531474008201752295': {
230
+ error_kind: 'fmtstring',
231
+ length: 133,
232
+ item_types: [
233
+ {
234
+ kind: 'integer',
235
+ sign: 'unsigned',
236
+ width: 32
237
+ }
238
+ ]
239
+ }
240
+ }
241
+ },
242
+ bytecode: Buffer.from([]),
243
+ debugSymbols: ''
244
+ },
245
+ {
246
+ ...{
247
+ functionType: FunctionType.PUBLIC,
248
+ name: 'public_dispatch',
249
+ isOnlySelf: false,
250
+ isStatic: false,
251
+ isInitializer: false,
252
+ parameters: [
253
+ {
254
+ name: 'selector',
255
+ type: {
256
+ kind: 'field'
257
+ },
258
+ visibility: 'private'
259
+ }
260
+ ],
261
+ returnTypes: [],
262
+ errorTypes: {
263
+ '3445904810750103705': {
264
+ error_kind: 'string',
265
+ string: 'Block number mismatch.'
266
+ },
267
+ '6989792215391248978': {
268
+ error_kind: 'string',
269
+ string: 'Function check_timestamp can only be called statically'
270
+ },
271
+ '7259463707251703666': {
272
+ error_kind: 'string',
273
+ string: 'Function check_block_number can only be called statically'
274
+ },
275
+ '12511970388699677811': {
276
+ error_kind: 'fmtstring',
277
+ length: 27,
278
+ item_types: [
279
+ {
280
+ kind: 'field'
281
+ }
282
+ ]
283
+ },
284
+ '13950240626967988787': {
285
+ error_kind: 'string',
286
+ string: 'Timestamp mismatch.'
287
+ },
288
+ '15015303112667403944': {
289
+ error_kind: 'fmtstring',
290
+ length: 17,
291
+ item_types: []
292
+ },
293
+ '15764276373176857197': {
294
+ error_kind: 'string',
295
+ string: 'Stack too deep'
296
+ }
297
+ }
298
+ },
299
+ bytecode: Buffer.from([]),
300
+ debugSymbols: ''
301
+ },
302
+ {
303
+ ...{
304
+ functionType: FunctionType.UTILITY,
305
+ name: 'sync_state',
306
+ isOnlySelf: false,
307
+ isStatic: false,
308
+ isInitializer: false,
309
+ parameters: [],
310
+ returnTypes: [],
311
+ errorTypes: {
312
+ '361444214588792908': {
313
+ error_kind: 'string',
314
+ string: 'attempt to multiply with overflow'
315
+ },
316
+ '992401946138144806': {
317
+ error_kind: 'string',
318
+ string: 'Attempted to read past end of BoundedVec'
319
+ },
320
+ '1998584279744703196': {
321
+ error_kind: 'string',
322
+ string: 'attempt to subtract with overflow'
323
+ },
324
+ '2967937905572420042': {
325
+ error_kind: 'fmtstring',
326
+ length: 61,
327
+ item_types: [
328
+ {
329
+ kind: 'field'
330
+ },
331
+ {
332
+ kind: 'field'
333
+ }
334
+ ]
335
+ },
336
+ '3330370348214585450': {
337
+ error_kind: 'fmtstring',
338
+ length: 48,
339
+ item_types: [
340
+ {
341
+ kind: 'field'
342
+ },
343
+ {
344
+ kind: 'field'
345
+ }
346
+ ]
347
+ },
348
+ '3670003311596808700': {
349
+ error_kind: 'fmtstring',
350
+ length: 77,
351
+ item_types: [
352
+ {
353
+ kind: 'integer',
354
+ sign: 'unsigned',
355
+ width: 32
356
+ }
357
+ ]
358
+ },
359
+ '4261968856572588300': {
360
+ error_kind: 'string',
361
+ string: 'Value does not fit in field'
362
+ },
363
+ '4440399188109668273': {
364
+ error_kind: 'string',
365
+ string: 'Input length must be a multiple of 32'
366
+ },
367
+ '9791669845391776238': {
368
+ error_kind: 'string',
369
+ string: '0 has a square root; you cannot claim it is not square'
370
+ },
371
+ '9885968605480832328': {
372
+ error_kind: 'string',
373
+ string: 'Attempted to read past the length of a CapsuleArray'
374
+ },
375
+ '10135509984888824963': {
376
+ error_kind: 'fmtstring',
377
+ length: 58,
378
+ item_types: [
379
+ {
380
+ kind: 'field'
381
+ }
382
+ ]
383
+ },
384
+ '10791800398362570014': {
385
+ error_kind: 'string',
386
+ string: 'extend_from_bounded_vec out of bounds'
387
+ },
388
+ '11021520179822076911': {
389
+ error_kind: 'string',
390
+ string: 'Attempted to delete past the length of a CapsuleArray'
391
+ },
392
+ '11692359521570349358': {
393
+ error_kind: 'fmtstring',
394
+ length: 40,
395
+ item_types: []
396
+ },
397
+ '12327971061804302172': {
398
+ error_kind: 'fmtstring',
399
+ length: 98,
400
+ item_types: []
401
+ },
402
+ '12469291177396340830': {
403
+ error_kind: 'string',
404
+ string: 'call to assert_max_bit_size'
405
+ },
406
+ '12913276134398371456': {
407
+ error_kind: 'string',
408
+ string: 'push out of bounds'
409
+ },
410
+ '13557316507370296400': {
411
+ error_kind: 'fmtstring',
412
+ length: 130,
413
+ item_types: [
414
+ {
415
+ kind: 'integer',
416
+ sign: 'unsigned',
417
+ width: 32
418
+ }
419
+ ]
420
+ },
421
+ '14938672389828944159': {
422
+ error_kind: 'fmtstring',
423
+ length: 146,
424
+ item_types: [
425
+ {
426
+ kind: 'integer',
427
+ sign: 'unsigned',
428
+ width: 32
429
+ }
430
+ ]
431
+ },
432
+ '14990209321349310352': {
433
+ error_kind: 'string',
434
+ string: 'attempt to add with overflow'
435
+ },
436
+ '15764276373176857197': {
437
+ error_kind: 'string',
438
+ string: 'Stack too deep'
439
+ },
440
+ '16431471497789672479': {
441
+ error_kind: 'string',
442
+ string: 'Index out of bounds'
443
+ },
444
+ '17531474008201752295': {
445
+ error_kind: 'fmtstring',
446
+ length: 133,
447
+ item_types: [
448
+ {
449
+ kind: 'integer',
450
+ sign: 'unsigned',
451
+ width: 32
452
+ }
453
+ ]
454
+ },
455
+ '17655676068928457687': {
456
+ error_kind: 'string',
457
+ string: 'Reader did not read all data'
458
+ }
459
+ }
460
+ },
461
+ bytecode: Buffer.from([]),
462
+ debugSymbols: ''
463
+ }
464
+ ],
465
+ nonDispatchPublicFunctions: [
466
+ {
467
+ functionType: FunctionType.PUBLIC,
468
+ name: 'check_block_number',
469
+ isOnlySelf: false,
470
+ isStatic: true,
471
+ isInitializer: false,
472
+ parameters: [
473
+ {
474
+ name: 'operation',
475
+ type: {
476
+ kind: 'integer',
477
+ sign: 'unsigned',
478
+ width: 8
479
+ },
480
+ visibility: 'private'
481
+ },
482
+ {
483
+ name: 'value',
484
+ type: {
485
+ kind: 'integer',
486
+ sign: 'unsigned',
487
+ width: 32
488
+ },
489
+ visibility: 'private'
490
+ }
491
+ ],
492
+ returnTypes: [],
493
+ errorTypes: {
494
+ '3445904810750103705': {
495
+ error_kind: 'string',
496
+ string: 'Block number mismatch.'
497
+ },
498
+ '7259463707251703666': {
499
+ error_kind: 'string',
500
+ string: 'Function check_block_number can only be called statically'
501
+ },
502
+ '15015303112667403944': {
503
+ error_kind: 'fmtstring',
504
+ length: 17,
505
+ item_types: []
506
+ },
507
+ '15764276373176857197': {
508
+ error_kind: 'string',
509
+ string: 'Stack too deep'
510
+ }
511
+ }
512
+ },
513
+ {
514
+ functionType: FunctionType.PUBLIC,
515
+ name: 'check_timestamp',
516
+ isOnlySelf: false,
517
+ isStatic: true,
518
+ isInitializer: false,
519
+ parameters: [
520
+ {
521
+ name: 'operation',
522
+ type: {
523
+ kind: 'integer',
524
+ sign: 'unsigned',
525
+ width: 8
526
+ },
527
+ visibility: 'private'
528
+ },
529
+ {
530
+ name: 'value',
531
+ type: {
532
+ kind: 'integer',
533
+ sign: 'unsigned',
534
+ width: 64
535
+ },
536
+ visibility: 'private'
537
+ }
538
+ ],
539
+ returnTypes: [],
540
+ errorTypes: {
541
+ '6989792215391248978': {
542
+ error_kind: 'string',
543
+ string: 'Function check_timestamp can only be called statically'
544
+ },
545
+ '13950240626967988787': {
546
+ error_kind: 'string',
547
+ string: 'Timestamp mismatch.'
548
+ },
549
+ '15015303112667403944': {
550
+ error_kind: 'fmtstring',
551
+ length: 17,
552
+ item_types: []
553
+ },
554
+ '15764276373176857197': {
555
+ error_kind: 'string',
556
+ string: 'Stack too deep'
557
+ }
558
+ }
559
+ }
560
+ ],
561
+ outputs: {
562
+ structs: {},
563
+ globals: {}
564
+ },
565
+ storageLayout: {},
566
+ fileMap: {}
567
+ };
568
+ export class PublicChecksContract extends ContractBase {
569
+ constructor(wallet){
570
+ super(ProtocolContractAddress.PublicChecks, PublicChecksContractArtifact, wallet);
571
+ }
572
+ static at(wallet) {
573
+ return new PublicChecksContract(wallet);
574
+ }
575
+ }
@@ -13,5 +13,5 @@ export declare const DefaultWaitForProvenOpts: WaitForProvenOpts;
13
13
  /**
14
14
  * Wait for a transaction to be proven by polling the node
15
15
  */
16
- export declare function waitForProven(node: AztecNode, receipt: TxReceipt, opts?: WaitForProvenOpts): Promise<number>;
17
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2FpdF9mb3JfcHJvdmVuLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29udHJhY3Qvd2FpdF9mb3JfcHJvdmVuLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ2pFLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBSWxEOztHQUVHO0FBQ0gsTUFBTSxNQUFNLGlCQUFpQixHQUFHO0lBQzlCLDZEQUE2RDtJQUM3RCxhQUFhLENBQUMsRUFBRSxNQUFNLENBQUM7SUFDdkIsNkNBQTZDO0lBQzdDLFFBQVEsQ0FBQyxFQUFFLE1BQU0sQ0FBQztDQUNuQixDQUFDO0FBRUYsZUFBTyxNQUFNLHdCQUF3QixFQUFFLGlCQUd0QyxDQUFDO0FBRUY7O0dBRUc7QUFDSCx3QkFBc0IsYUFBYSxDQUFDLElBQUksRUFBRSxTQUFTLEVBQUUsT0FBTyxFQUFFLFNBQVMsRUFBRSxJQUFJLENBQUMsRUFBRSxpQkFBaUIsbUJBYWhHIn0=
16
+ export declare function waitForProven(node: AztecNode, receipt: TxReceipt, opts?: WaitForProvenOpts): Promise<NonNullable<import("@aztec/foundation/branded-types").BlockNumber>>;
17
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2FpdF9mb3JfcHJvdmVuLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29udHJhY3Qvd2FpdF9mb3JfcHJvdmVuLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ2pFLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBSWxEOztHQUVHO0FBQ0gsTUFBTSxNQUFNLGlCQUFpQixHQUFHO0lBQzlCLDZEQUE2RDtJQUM3RCxhQUFhLENBQUMsRUFBRSxNQUFNLENBQUM7SUFDdkIsNkNBQTZDO0lBQzdDLFFBQVEsQ0FBQyxFQUFFLE1BQU0sQ0FBQztDQUNuQixDQUFDO0FBRUYsZUFBTyxNQUFNLHdCQUF3QixFQUFFLGlCQUd0QyxDQUFDO0FBRUY7O0dBRUc7QUFDSCx3QkFBc0IsYUFBYSxDQUFDLElBQUksRUFBRSxTQUFTLEVBQUUsT0FBTyxFQUFFLFNBQVMsRUFBRSxJQUFJLENBQUMsRUFBRSxpQkFBaUIsK0VBYWhHIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"wait_for_proven.d.ts","sourceRoot":"","sources":["../../src/contract/wait_for_proven.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAIlD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,6DAA6D;IAC7D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,iBAGtC,CAAC;AAEF;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,iBAAiB,mBAahG"}
1
+ {"version":3,"file":"wait_for_proven.d.ts","sourceRoot":"","sources":["../../src/contract/wait_for_proven.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAIlD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,6DAA6D;IAC7D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,iBAGtC,CAAC;AAEF;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,iBAAiB,+EAahG"}
@@ -1,5 +1,5 @@
1
1
  import { retryUntil } from '@aztec/foundation/retry';
2
- import { DefaultWaitOpts } from './sent_tx.js';
2
+ import { DefaultWaitOpts } from './wait_opts.js';
3
3
  export const DefaultWaitForProvenOpts = {
4
4
  provenTimeout: 600,
5
5
  interval: DefaultWaitOpts.interval
@@ -0,0 +1,16 @@
1
+ import type { TxStatus } from '@aztec/stdlib/tx';
2
+ /** Options related to waiting for a tx. */
3
+ export type WaitOpts = {
4
+ /** The amount of time to ignore TxStatus.DROPPED receipts (in seconds) due to the presumption that it is being propagated by the p2p network. Defaults to 5. */
5
+ ignoreDroppedReceiptsFor?: number;
6
+ /** The maximum time (in seconds) to wait for the transaction to be mined. Defaults to 60. */
7
+ timeout?: number;
8
+ /** The time interval (in seconds) between retries to fetch the transaction receipt. Defaults to 1. */
9
+ interval?: number;
10
+ /** Whether to accept a revert as a status code for the tx when waiting for it. If false, will throw if the tx reverts. */
11
+ dontThrowOnRevert?: boolean;
12
+ /** The minimum inclusion status to wait for. If set, waits until the receipt reaches this status or higher. Defaults to CHECKPOINTED. */
13
+ waitForStatus?: TxStatus;
14
+ };
15
+ export declare const DefaultWaitOpts: WaitOpts;
16
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2FpdF9vcHRzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29udHJhY3Qvd2FpdF9vcHRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLFFBQVEsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBRWpELDJDQUEyQztBQUMzQyxNQUFNLE1BQU0sUUFBUSxHQUFHO0lBQ3JCLGdLQUFnSztJQUNoSyx3QkFBd0IsQ0FBQyxFQUFFLE1BQU0sQ0FBQztJQUNsQyw2RkFBNkY7SUFDN0YsT0FBTyxDQUFDLEVBQUUsTUFBTSxDQUFDO0lBQ2pCLHNHQUFzRztJQUN0RyxRQUFRLENBQUMsRUFBRSxNQUFNLENBQUM7SUFDbEIsMEhBQTBIO0lBQzFILGlCQUFpQixDQUFDLEVBQUUsT0FBTyxDQUFDO0lBQzVCLHlJQUF5STtJQUN6SSxhQUFhLENBQUMsRUFBRSxRQUFRLENBQUM7Q0FDMUIsQ0FBQztBQUVGLGVBQU8sTUFBTSxlQUFlLEVBQUUsUUFJN0IsQ0FBQyJ9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wait_opts.d.ts","sourceRoot":"","sources":["../../src/contract/wait_opts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,2CAA2C;AAC3C,MAAM,MAAM,QAAQ,GAAG;IACrB,gKAAgK;IAChK,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,6FAA6F;IAC7F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sGAAsG;IACtG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0HAA0H;IAC1H,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,yIAAyI;IACzI,aAAa,CAAC,EAAE,QAAQ,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,QAI7B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export const DefaultWaitOpts = {
2
+ ignoreDroppedReceiptsFor: 5,
3
+ timeout: 300,
4
+ interval: 1
5
+ };
@@ -1,11 +1,11 @@
1
1
  import { ARTIFACT_FUNCTION_TREE_MAX_HEIGHT, CONTRACT_CLASS_REGISTRY_BYTECODE_CAPSULE_SLOT, MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS } from '@aztec/constants';
2
2
  import { padArrayEnd } from '@aztec/foundation/collection';
3
- import { Fr } from '@aztec/foundation/fields';
3
+ import { Fr } from '@aztec/foundation/curves/bn254';
4
4
  import { ProtocolContractAddress } from '@aztec/protocol-contracts';
5
5
  import { FunctionSelector, FunctionType, bufferAsFields } from '@aztec/stdlib/abi';
6
6
  import { computeVerificationKeyHash, createPrivateFunctionMembershipProof, createUtilityFunctionMembershipProof, getContractClassFromArtifact } from '@aztec/stdlib/contract';
7
7
  import { Capsule } from '@aztec/stdlib/tx';
8
- import { getClassRegistryContract } from '../contract/protocol_contracts.js';
8
+ import { ContractClassRegistryContract } from '../contract/protocol_contracts/contract-class-registry.js';
9
9
  /**
10
10
  * Sets up a call to broadcast a private function's bytecode via the ClassRegistry contract.
11
11
  * Note that this is not required for users to call the function, but is rather a convenience to make
@@ -27,7 +27,7 @@ import { getClassRegistryContract } from '../contract/protocol_contracts.js';
27
27
  }
28
28
  const { artifactTreeSiblingPath, artifactTreeLeafIndex, artifactMetadataHash, functionMetadataHash, utilityFunctionsTreeRoot, privateFunctionTreeSiblingPath, privateFunctionTreeLeafIndex } = await createPrivateFunctionMembershipProof(selector, artifact);
29
29
  const vkHash = await computeVerificationKeyHash(privateFunctionArtifact);
30
- const classRegistry = await getClassRegistryContract(wallet);
30
+ const classRegistry = ContractClassRegistryContract.at(wallet);
31
31
  const bytecode = bufferAsFields(privateFunctionArtifact.bytecode, MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS);
32
32
  return classRegistry.methods.broadcast_private_function(contractClass.id, artifactMetadataHash, utilityFunctionsTreeRoot, privateFunctionTreeSiblingPath, privateFunctionTreeLeafIndex, padArrayEnd(artifactTreeSiblingPath, Fr.ZERO, ARTIFACT_FUNCTION_TREE_MAX_HEIGHT), artifactTreeLeafIndex, // eslint-disable-next-line camelcase
33
33
  {
@@ -60,7 +60,7 @@ import { getClassRegistryContract } from '../contract/protocol_contracts.js';
60
60
  throw new Error(`Utility function with selector ${selector.toString()} not found`);
61
61
  }
62
62
  const { artifactMetadataHash, artifactTreeLeafIndex, artifactTreeSiblingPath, functionMetadataHash, privateFunctionsArtifactTreeRoot } = await createUtilityFunctionMembershipProof(selector, artifact);
63
- const classRegistry = await getClassRegistryContract(wallet);
63
+ const classRegistry = ContractClassRegistryContract.at(wallet);
64
64
  const bytecode = bufferAsFields(utilityFunctionArtifact.bytecode, MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS);
65
65
  return classRegistry.methods.broadcast_utility_function(contractClass.id, artifactMetadataHash, privateFunctionsArtifactTreeRoot, padArrayEnd(artifactTreeSiblingPath, Fr.ZERO, ARTIFACT_FUNCTION_TREE_MAX_HEIGHT), artifactTreeLeafIndex, // eslint-disable-next-line camelcase
66
66
  {