@aztec/aztec.js 0.0.1-commit.9b94fc1 → 0.0.1-commit.bf2612ae

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 (186) 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/node.d.ts +8 -4
  28. package/dest/api/node.d.ts.map +1 -1
  29. package/dest/api/node.js +7 -3
  30. package/dest/api/protocol.d.ts +7 -1
  31. package/dest/api/protocol.d.ts.map +1 -1
  32. package/dest/api/protocol.js +6 -0
  33. package/dest/api/tx.d.ts +2 -2
  34. package/dest/api/tx.d.ts.map +1 -1
  35. package/dest/api/tx.js +1 -1
  36. package/dest/api/wallet.d.ts +2 -2
  37. package/dest/api/wallet.d.ts.map +1 -1
  38. package/dest/api/wallet.js +1 -1
  39. package/dest/authorization/call_authorization_request.d.ts +23 -2
  40. package/dest/authorization/call_authorization_request.d.ts.map +1 -1
  41. package/dest/contract/base_contract_interaction.d.ts +8 -10
  42. package/dest/contract/base_contract_interaction.d.ts.map +1 -1
  43. package/dest/contract/base_contract_interaction.js +5 -17
  44. package/dest/contract/batch_call.d.ts +1 -1
  45. package/dest/contract/batch_call.d.ts.map +1 -1
  46. package/dest/contract/batch_call.js +3 -1
  47. package/dest/contract/contract_base.d.ts +4 -1
  48. package/dest/contract/contract_base.d.ts.map +1 -1
  49. package/dest/contract/contract_function_interaction.d.ts +1 -1
  50. package/dest/contract/deploy_method.d.ts +64 -17
  51. package/dest/contract/deploy_method.d.ts.map +1 -1
  52. package/dest/contract/deploy_method.js +42 -24
  53. package/dest/contract/interaction_options.d.ts +42 -5
  54. package/dest/contract/interaction_options.d.ts.map +1 -1
  55. package/dest/contract/interaction_options.js +8 -1
  56. package/dest/contract/protocol_contracts/auth-registry.d.ts +36 -0
  57. package/dest/contract/protocol_contracts/auth-registry.d.ts.map +1 -0
  58. package/dest/contract/protocol_contracts/auth-registry.js +963 -0
  59. package/dest/contract/protocol_contracts/contract-class-registry.d.ts +35 -0
  60. package/dest/contract/protocol_contracts/contract-class-registry.d.ts.map +1 -0
  61. package/dest/contract/protocol_contracts/contract-class-registry.js +784 -0
  62. package/dest/contract/protocol_contracts/contract-instance-registry.d.ts +31 -0
  63. package/dest/contract/protocol_contracts/contract-instance-registry.d.ts.map +1 -0
  64. package/dest/contract/protocol_contracts/contract-instance-registry.js +858 -0
  65. package/dest/contract/protocol_contracts/fee-juice.d.ts +30 -0
  66. package/dest/contract/protocol_contracts/fee-juice.d.ts.map +1 -0
  67. package/dest/contract/protocol_contracts/fee-juice.js +827 -0
  68. package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts +34 -0
  69. package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts.map +1 -0
  70. package/dest/contract/protocol_contracts/multi-call-entrypoint.js +563 -0
  71. package/dest/contract/protocol_contracts/public-checks.d.ts +26 -0
  72. package/dest/contract/protocol_contracts/public-checks.d.ts.map +1 -0
  73. package/dest/contract/protocol_contracts/public-checks.js +579 -0
  74. package/dest/contract/wait_for_proven.d.ts +2 -2
  75. package/dest/contract/wait_for_proven.d.ts.map +1 -1
  76. package/dest/contract/wait_for_proven.js +1 -1
  77. package/dest/contract/wait_opts.d.ts +16 -0
  78. package/dest/contract/wait_opts.d.ts.map +1 -0
  79. package/dest/contract/wait_opts.js +5 -0
  80. package/dest/deployment/broadcast_function.js +4 -4
  81. package/dest/deployment/publish_class.js +3 -3
  82. package/dest/deployment/publish_instance.d.ts +2 -2
  83. package/dest/deployment/publish_instance.d.ts.map +1 -1
  84. package/dest/deployment/publish_instance.js +3 -3
  85. package/dest/ethereum/portal_manager.d.ts +9 -6
  86. package/dest/ethereum/portal_manager.d.ts.map +1 -1
  87. package/dest/ethereum/portal_manager.js +17 -18
  88. package/dest/fee/fee_juice_payment_method_with_claim.js +1 -1
  89. package/dest/fee/private_fee_payment_method.js +1 -1
  90. package/dest/fee/public_fee_payment_method.js +1 -1
  91. package/dest/scripts/generate_protocol_contract_types.d.ts +2 -0
  92. package/dest/scripts/generate_protocol_contract_types.d.ts.map +1 -0
  93. package/dest/scripts/generate_protocol_contract_types.js +120 -0
  94. package/dest/utils/abi_types.d.ts +2 -2
  95. package/dest/utils/abi_types.d.ts.map +1 -1
  96. package/dest/utils/authwit.d.ts +9 -7
  97. package/dest/utils/authwit.d.ts.map +1 -1
  98. package/dest/utils/authwit.js +6 -10
  99. package/dest/utils/cross_chain.d.ts +2 -2
  100. package/dest/utils/cross_chain.d.ts.map +1 -1
  101. package/dest/utils/fee_juice.js +1 -1
  102. package/dest/utils/field_compressed_string.js +1 -1
  103. package/dest/utils/node.d.ts +12 -1
  104. package/dest/utils/node.d.ts.map +1 -1
  105. package/dest/utils/node.js +46 -0
  106. package/dest/utils/pub_key.d.ts +2 -2
  107. package/dest/utils/pub_key.d.ts.map +1 -1
  108. package/dest/utils/pub_key.js +1 -1
  109. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts +5 -8
  110. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -1
  111. package/dest/wallet/account_entrypoint_meta_payment_method.js +28 -43
  112. package/dest/wallet/account_manager.d.ts +6 -9
  113. package/dest/wallet/account_manager.d.ts.map +1 -1
  114. package/dest/wallet/account_manager.js +6 -12
  115. package/dest/wallet/deploy_account_method.d.ts +35 -7
  116. package/dest/wallet/deploy_account_method.d.ts.map +1 -1
  117. package/dest/wallet/deploy_account_method.js +8 -6
  118. package/dest/wallet/wallet.d.ts +292 -960
  119. package/dest/wallet/wallet.d.ts.map +1 -1
  120. package/dest/wallet/wallet.js +76 -90
  121. package/package.json +15 -13
  122. package/src/account/account.ts +34 -58
  123. package/src/account/account_contract.ts +7 -8
  124. package/src/account/account_with_secret_key.ts +34 -9
  125. package/src/account/index.ts +3 -2
  126. package/src/account/signerless_account.ts +14 -13
  127. package/src/api/account.ts +9 -3
  128. package/src/api/authorization.ts +1 -0
  129. package/src/api/contract.ts +22 -7
  130. package/src/api/fields.ts +2 -1
  131. package/src/api/node.ts +7 -3
  132. package/src/api/protocol.ts +7 -0
  133. package/src/api/tx.ts +2 -0
  134. package/src/api/wallet.ts +9 -2
  135. package/src/authorization/call_authorization_request.ts +1 -1
  136. package/src/contract/base_contract_interaction.ts +27 -15
  137. package/src/contract/batch_call.ts +4 -2
  138. package/src/contract/deploy_method.ts +123 -30
  139. package/src/contract/interaction_options.ts +49 -4
  140. package/src/contract/protocol_contracts/auth-registry.ts +545 -0
  141. package/src/contract/protocol_contracts/contract-class-registry.ts +433 -0
  142. package/src/contract/protocol_contracts/contract-instance-registry.ts +493 -0
  143. package/src/contract/protocol_contracts/fee-juice.ts +457 -0
  144. package/src/contract/protocol_contracts/multi-call-entrypoint.ts +329 -0
  145. package/src/contract/protocol_contracts/public-checks.ts +315 -0
  146. package/src/contract/wait_for_proven.ts +1 -1
  147. package/src/contract/wait_opts.ts +21 -0
  148. package/src/deployment/broadcast_function.ts +4 -4
  149. package/src/deployment/publish_class.ts +3 -3
  150. package/src/deployment/publish_instance.ts +3 -6
  151. package/src/ethereum/portal_manager.ts +20 -24
  152. package/src/fee/fee_juice_payment_method_with_claim.ts +1 -1
  153. package/src/fee/private_fee_payment_method.ts +1 -1
  154. package/src/fee/public_fee_payment_method.ts +1 -1
  155. package/src/scripts/generate_protocol_contract_types.ts +150 -0
  156. package/src/utils/abi_types.ts +1 -1
  157. package/src/utils/authwit.ts +20 -8
  158. package/src/utils/cross_chain.ts +1 -1
  159. package/src/utils/fee_juice.ts +1 -1
  160. package/src/utils/field_compressed_string.ts +1 -1
  161. package/src/utils/node.ts +62 -0
  162. package/src/utils/pub_key.ts +2 -2
  163. package/src/wallet/account_entrypoint_meta_payment_method.ts +28 -60
  164. package/src/wallet/account_manager.ts +6 -14
  165. package/src/wallet/deploy_account_method.ts +38 -14
  166. package/src/wallet/wallet.ts +192 -93
  167. package/dest/account/interface.d.ts +0 -19
  168. package/dest/account/interface.d.ts.map +0 -1
  169. package/dest/account/interface.js +0 -5
  170. package/dest/contract/deploy_sent_tx.d.ts +0 -48
  171. package/dest/contract/deploy_sent_tx.d.ts.map +0 -1
  172. package/dest/contract/deploy_sent_tx.js +0 -46
  173. package/dest/contract/protocol_contracts.d.ts +0 -9
  174. package/dest/contract/protocol_contracts.d.ts.map +0 -1
  175. package/dest/contract/protocol_contracts.js +0 -26
  176. package/dest/contract/sent_tx.d.ts +0 -51
  177. package/dest/contract/sent_tx.d.ts.map +0 -1
  178. package/dest/contract/sent_tx.js +0 -90
  179. package/dest/contract/unsafe_contract.d.ts +0 -15
  180. package/dest/contract/unsafe_contract.d.ts.map +0 -1
  181. package/dest/contract/unsafe_contract.js +0 -6
  182. package/src/account/interface.ts +0 -25
  183. package/src/contract/deploy_sent_tx.ts +0 -75
  184. package/src/contract/protocol_contracts.ts +0 -35
  185. package/src/contract/sent_tx.ts +0 -130
  186. package/src/contract/unsafe_contract.ts +0 -19
@@ -0,0 +1,579 @@
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
+ '14990209321349310352': {
289
+ error_kind: 'string',
290
+ string: 'attempt to add with overflow'
291
+ },
292
+ '15015303112667403944': {
293
+ error_kind: 'fmtstring',
294
+ length: 17,
295
+ item_types: []
296
+ },
297
+ '15764276373176857197': {
298
+ error_kind: 'string',
299
+ string: 'Stack too deep'
300
+ },
301
+ '16431471497789672479': {
302
+ error_kind: 'string',
303
+ string: 'Index out of bounds'
304
+ }
305
+ }
306
+ },
307
+ bytecode: Buffer.from([]),
308
+ debugSymbols: ''
309
+ },
310
+ {
311
+ ...{
312
+ functionType: FunctionType.UTILITY,
313
+ name: 'sync_state',
314
+ isOnlySelf: false,
315
+ isStatic: false,
316
+ isInitializer: false,
317
+ parameters: [],
318
+ returnTypes: [],
319
+ errorTypes: {
320
+ '361444214588792908': {
321
+ error_kind: 'string',
322
+ string: 'attempt to multiply with overflow'
323
+ },
324
+ '992401946138144806': {
325
+ error_kind: 'string',
326
+ string: 'Attempted to read past end of BoundedVec'
327
+ },
328
+ '1998584279744703196': {
329
+ error_kind: 'string',
330
+ string: 'attempt to subtract with overflow'
331
+ },
332
+ '2967937905572420042': {
333
+ error_kind: 'fmtstring',
334
+ length: 61,
335
+ item_types: [
336
+ {
337
+ kind: 'field'
338
+ },
339
+ {
340
+ kind: 'field'
341
+ }
342
+ ]
343
+ },
344
+ '3330370348214585450': {
345
+ error_kind: 'fmtstring',
346
+ length: 48,
347
+ item_types: [
348
+ {
349
+ kind: 'field'
350
+ },
351
+ {
352
+ kind: 'field'
353
+ }
354
+ ]
355
+ },
356
+ '3670003311596808700': {
357
+ error_kind: 'fmtstring',
358
+ length: 77,
359
+ item_types: [
360
+ {
361
+ kind: 'integer',
362
+ sign: 'unsigned',
363
+ width: 32
364
+ }
365
+ ]
366
+ },
367
+ '4261968856572588300': {
368
+ error_kind: 'string',
369
+ string: 'Value does not fit in field'
370
+ },
371
+ '4440399188109668273': {
372
+ error_kind: 'string',
373
+ string: 'Input length must be a multiple of 32'
374
+ },
375
+ '9791669845391776238': {
376
+ error_kind: 'string',
377
+ string: '0 has a square root; you cannot claim it is not square'
378
+ },
379
+ '9885968605480832328': {
380
+ error_kind: 'string',
381
+ string: 'Attempted to read past the length of a CapsuleArray'
382
+ },
383
+ '10135509984888824963': {
384
+ error_kind: 'fmtstring',
385
+ length: 58,
386
+ item_types: [
387
+ {
388
+ kind: 'field'
389
+ }
390
+ ]
391
+ },
392
+ '10791800398362570014': {
393
+ error_kind: 'string',
394
+ string: 'extend_from_bounded_vec out of bounds'
395
+ },
396
+ '11021520179822076911': {
397
+ error_kind: 'string',
398
+ string: 'Attempted to delete past the length of a CapsuleArray'
399
+ },
400
+ '11692359521570349358': {
401
+ error_kind: 'fmtstring',
402
+ length: 40,
403
+ item_types: []
404
+ },
405
+ '12327971061804302172': {
406
+ error_kind: 'fmtstring',
407
+ length: 98,
408
+ item_types: []
409
+ },
410
+ '12469291177396340830': {
411
+ error_kind: 'string',
412
+ string: 'call to assert_max_bit_size'
413
+ },
414
+ '12913276134398371456': {
415
+ error_kind: 'string',
416
+ string: 'push out of bounds'
417
+ },
418
+ '13557316507370296400': {
419
+ error_kind: 'fmtstring',
420
+ length: 130,
421
+ item_types: [
422
+ {
423
+ kind: 'integer',
424
+ sign: 'unsigned',
425
+ width: 32
426
+ }
427
+ ]
428
+ },
429
+ '14938672389828944159': {
430
+ error_kind: 'fmtstring',
431
+ length: 146,
432
+ item_types: [
433
+ {
434
+ kind: 'integer',
435
+ sign: 'unsigned',
436
+ width: 32
437
+ }
438
+ ]
439
+ },
440
+ '14990209321349310352': {
441
+ error_kind: 'string',
442
+ string: 'attempt to add with overflow'
443
+ },
444
+ '15764276373176857197': {
445
+ error_kind: 'string',
446
+ string: 'Stack too deep'
447
+ },
448
+ '16431471497789672479': {
449
+ error_kind: 'string',
450
+ string: 'Index out of bounds'
451
+ },
452
+ '17531474008201752295': {
453
+ error_kind: 'fmtstring',
454
+ length: 133,
455
+ item_types: [
456
+ {
457
+ kind: 'integer',
458
+ sign: 'unsigned',
459
+ width: 32
460
+ }
461
+ ]
462
+ }
463
+ }
464
+ },
465
+ bytecode: Buffer.from([]),
466
+ debugSymbols: ''
467
+ }
468
+ ],
469
+ nonDispatchPublicFunctions: [
470
+ {
471
+ functionType: FunctionType.PUBLIC,
472
+ name: 'check_block_number',
473
+ isOnlySelf: false,
474
+ isStatic: true,
475
+ isInitializer: false,
476
+ parameters: [
477
+ {
478
+ name: 'operation',
479
+ type: {
480
+ kind: 'integer',
481
+ sign: 'unsigned',
482
+ width: 8
483
+ },
484
+ visibility: 'private'
485
+ },
486
+ {
487
+ name: 'value',
488
+ type: {
489
+ kind: 'integer',
490
+ sign: 'unsigned',
491
+ width: 32
492
+ },
493
+ visibility: 'private'
494
+ }
495
+ ],
496
+ returnTypes: [],
497
+ errorTypes: {
498
+ '3445904810750103705': {
499
+ error_kind: 'string',
500
+ string: 'Block number mismatch.'
501
+ },
502
+ '7259463707251703666': {
503
+ error_kind: 'string',
504
+ string: 'Function check_block_number can only be called statically'
505
+ },
506
+ '15015303112667403944': {
507
+ error_kind: 'fmtstring',
508
+ length: 17,
509
+ item_types: []
510
+ },
511
+ '15764276373176857197': {
512
+ error_kind: 'string',
513
+ string: 'Stack too deep'
514
+ }
515
+ }
516
+ },
517
+ {
518
+ functionType: FunctionType.PUBLIC,
519
+ name: 'check_timestamp',
520
+ isOnlySelf: false,
521
+ isStatic: true,
522
+ isInitializer: false,
523
+ parameters: [
524
+ {
525
+ name: 'operation',
526
+ type: {
527
+ kind: 'integer',
528
+ sign: 'unsigned',
529
+ width: 8
530
+ },
531
+ visibility: 'private'
532
+ },
533
+ {
534
+ name: 'value',
535
+ type: {
536
+ kind: 'integer',
537
+ sign: 'unsigned',
538
+ width: 64
539
+ },
540
+ visibility: 'private'
541
+ }
542
+ ],
543
+ returnTypes: [],
544
+ errorTypes: {
545
+ '6989792215391248978': {
546
+ error_kind: 'string',
547
+ string: 'Function check_timestamp can only be called statically'
548
+ },
549
+ '13950240626967988787': {
550
+ error_kind: 'string',
551
+ string: 'Timestamp mismatch.'
552
+ },
553
+ '15015303112667403944': {
554
+ error_kind: 'fmtstring',
555
+ length: 17,
556
+ item_types: []
557
+ },
558
+ '15764276373176857197': {
559
+ error_kind: 'string',
560
+ string: 'Stack too deep'
561
+ }
562
+ }
563
+ }
564
+ ],
565
+ outputs: {
566
+ structs: {},
567
+ globals: {}
568
+ },
569
+ storageLayout: {},
570
+ fileMap: {}
571
+ };
572
+ export class PublicChecksContract extends ContractBase {
573
+ constructor(wallet){
574
+ super(ProtocolContractAddress.PublicChecks, PublicChecksContractArtifact, wallet);
575
+ }
576
+ static at(wallet) {
577
+ return new PublicChecksContract(wallet);
578
+ }
579
+ }
@@ -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
  {