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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +575 -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 +583 -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 +14 -12
  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 +332 -0
  154. package/src/contract/protocol_contracts/public-checks.ts +316 -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,583 @@
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
+ '9530675838293881722': {
166
+ error_kind: 'string',
167
+ string: 'Writer did not write all data'
168
+ },
169
+ '9791669845391776238': {
170
+ error_kind: 'string',
171
+ string: '0 has a square root; you cannot claim it is not square'
172
+ },
173
+ '10135509984888824963': {
174
+ error_kind: 'fmtstring',
175
+ length: 58,
176
+ item_types: [
177
+ {
178
+ kind: 'field'
179
+ }
180
+ ]
181
+ },
182
+ '10791800398362570014': {
183
+ error_kind: 'string',
184
+ string: 'extend_from_bounded_vec out of bounds'
185
+ },
186
+ '11692359521570349358': {
187
+ error_kind: 'fmtstring',
188
+ length: 40,
189
+ item_types: []
190
+ },
191
+ '12469291177396340830': {
192
+ error_kind: 'string',
193
+ string: 'call to assert_max_bit_size'
194
+ },
195
+ '12913276134398371456': {
196
+ error_kind: 'string',
197
+ string: 'push out of bounds'
198
+ },
199
+ '13557316507370296400': {
200
+ error_kind: 'fmtstring',
201
+ length: 130,
202
+ item_types: [
203
+ {
204
+ kind: 'integer',
205
+ sign: 'unsigned',
206
+ width: 32
207
+ }
208
+ ]
209
+ },
210
+ '14938672389828944159': {
211
+ error_kind: 'fmtstring',
212
+ length: 146,
213
+ item_types: [
214
+ {
215
+ kind: 'integer',
216
+ sign: 'unsigned',
217
+ width: 32
218
+ }
219
+ ]
220
+ },
221
+ '14990209321349310352': {
222
+ error_kind: 'string',
223
+ string: 'attempt to add with overflow'
224
+ },
225
+ '15764276373176857197': {
226
+ error_kind: 'string',
227
+ string: 'Stack too deep'
228
+ },
229
+ '16431471497789672479': {
230
+ error_kind: 'string',
231
+ string: 'Index out of bounds'
232
+ },
233
+ '17531474008201752295': {
234
+ error_kind: 'fmtstring',
235
+ length: 133,
236
+ item_types: [
237
+ {
238
+ kind: 'integer',
239
+ sign: 'unsigned',
240
+ width: 32
241
+ }
242
+ ]
243
+ }
244
+ }
245
+ },
246
+ bytecode: Buffer.from([]),
247
+ debugSymbols: ''
248
+ },
249
+ {
250
+ ...{
251
+ functionType: FunctionType.PUBLIC,
252
+ name: 'public_dispatch',
253
+ isOnlySelf: false,
254
+ isStatic: false,
255
+ isInitializer: false,
256
+ parameters: [
257
+ {
258
+ name: 'selector',
259
+ type: {
260
+ kind: 'field'
261
+ },
262
+ visibility: 'private'
263
+ }
264
+ ],
265
+ returnTypes: [],
266
+ errorTypes: {
267
+ '3445904810750103705': {
268
+ error_kind: 'string',
269
+ string: 'Block number mismatch.'
270
+ },
271
+ '6989792215391248978': {
272
+ error_kind: 'string',
273
+ string: 'Function check_timestamp can only be called statically'
274
+ },
275
+ '7259463707251703666': {
276
+ error_kind: 'string',
277
+ string: 'Function check_block_number can only be called statically'
278
+ },
279
+ '12511970388699677811': {
280
+ error_kind: 'fmtstring',
281
+ length: 27,
282
+ item_types: [
283
+ {
284
+ kind: 'field'
285
+ }
286
+ ]
287
+ },
288
+ '13950240626967988787': {
289
+ error_kind: 'string',
290
+ string: 'Timestamp mismatch.'
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
+ }
302
+ },
303
+ bytecode: Buffer.from([]),
304
+ debugSymbols: ''
305
+ },
306
+ {
307
+ ...{
308
+ functionType: FunctionType.UTILITY,
309
+ name: 'sync_state',
310
+ isOnlySelf: false,
311
+ isStatic: false,
312
+ isInitializer: false,
313
+ parameters: [],
314
+ returnTypes: [],
315
+ errorTypes: {
316
+ '361444214588792908': {
317
+ error_kind: 'string',
318
+ string: 'attempt to multiply with overflow'
319
+ },
320
+ '992401946138144806': {
321
+ error_kind: 'string',
322
+ string: 'Attempted to read past end of BoundedVec'
323
+ },
324
+ '1998584279744703196': {
325
+ error_kind: 'string',
326
+ string: 'attempt to subtract with overflow'
327
+ },
328
+ '2967937905572420042': {
329
+ error_kind: 'fmtstring',
330
+ length: 61,
331
+ item_types: [
332
+ {
333
+ kind: 'field'
334
+ },
335
+ {
336
+ kind: 'field'
337
+ }
338
+ ]
339
+ },
340
+ '3330370348214585450': {
341
+ error_kind: 'fmtstring',
342
+ length: 48,
343
+ item_types: [
344
+ {
345
+ kind: 'field'
346
+ },
347
+ {
348
+ kind: 'field'
349
+ }
350
+ ]
351
+ },
352
+ '3670003311596808700': {
353
+ error_kind: 'fmtstring',
354
+ length: 77,
355
+ item_types: [
356
+ {
357
+ kind: 'integer',
358
+ sign: 'unsigned',
359
+ width: 32
360
+ }
361
+ ]
362
+ },
363
+ '4261968856572588300': {
364
+ error_kind: 'string',
365
+ string: 'Value does not fit in field'
366
+ },
367
+ '4440399188109668273': {
368
+ error_kind: 'string',
369
+ string: 'Input length must be a multiple of 32'
370
+ },
371
+ '9530675838293881722': {
372
+ error_kind: 'string',
373
+ string: 'Writer did not write all data'
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
+ '17655676068928457687': {
464
+ error_kind: 'string',
465
+ string: 'Reader did not read all data'
466
+ }
467
+ }
468
+ },
469
+ bytecode: Buffer.from([]),
470
+ debugSymbols: ''
471
+ }
472
+ ],
473
+ nonDispatchPublicFunctions: [
474
+ {
475
+ functionType: FunctionType.PUBLIC,
476
+ name: 'check_block_number',
477
+ isOnlySelf: false,
478
+ isStatic: true,
479
+ isInitializer: false,
480
+ parameters: [
481
+ {
482
+ name: 'operation',
483
+ type: {
484
+ kind: 'integer',
485
+ sign: 'unsigned',
486
+ width: 8
487
+ },
488
+ visibility: 'private'
489
+ },
490
+ {
491
+ name: 'value',
492
+ type: {
493
+ kind: 'integer',
494
+ sign: 'unsigned',
495
+ width: 32
496
+ },
497
+ visibility: 'private'
498
+ }
499
+ ],
500
+ returnTypes: [],
501
+ errorTypes: {
502
+ '3445904810750103705': {
503
+ error_kind: 'string',
504
+ string: 'Block number mismatch.'
505
+ },
506
+ '7259463707251703666': {
507
+ error_kind: 'string',
508
+ string: 'Function check_block_number can only be called statically'
509
+ },
510
+ '15015303112667403944': {
511
+ error_kind: 'fmtstring',
512
+ length: 17,
513
+ item_types: []
514
+ },
515
+ '15764276373176857197': {
516
+ error_kind: 'string',
517
+ string: 'Stack too deep'
518
+ }
519
+ }
520
+ },
521
+ {
522
+ functionType: FunctionType.PUBLIC,
523
+ name: 'check_timestamp',
524
+ isOnlySelf: false,
525
+ isStatic: true,
526
+ isInitializer: false,
527
+ parameters: [
528
+ {
529
+ name: 'operation',
530
+ type: {
531
+ kind: 'integer',
532
+ sign: 'unsigned',
533
+ width: 8
534
+ },
535
+ visibility: 'private'
536
+ },
537
+ {
538
+ name: 'value',
539
+ type: {
540
+ kind: 'integer',
541
+ sign: 'unsigned',
542
+ width: 64
543
+ },
544
+ visibility: 'private'
545
+ }
546
+ ],
547
+ returnTypes: [],
548
+ errorTypes: {
549
+ '6989792215391248978': {
550
+ error_kind: 'string',
551
+ string: 'Function check_timestamp can only be called statically'
552
+ },
553
+ '13950240626967988787': {
554
+ error_kind: 'string',
555
+ string: 'Timestamp mismatch.'
556
+ },
557
+ '15015303112667403944': {
558
+ error_kind: 'fmtstring',
559
+ length: 17,
560
+ item_types: []
561
+ },
562
+ '15764276373176857197': {
563
+ error_kind: 'string',
564
+ string: 'Stack too deep'
565
+ }
566
+ }
567
+ }
568
+ ],
569
+ outputs: {
570
+ structs: {},
571
+ globals: {}
572
+ },
573
+ storageLayout: {},
574
+ fileMap: {}
575
+ };
576
+ export class PublicChecksContract extends ContractBase {
577
+ constructor(wallet){
578
+ super(ProtocolContractAddress.PublicChecks, PublicChecksContractArtifact, wallet);
579
+ }
580
+ static at(wallet) {
581
+ return new PublicChecksContract(wallet);
582
+ }
583
+ }
@@ -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<NonNullable<import("../../../foundation/dest/branded-types/block_number.js").BlockNumber>>;
17
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2FpdF9mb3JfcHJvdmVuLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29udHJhY3Qvd2FpdF9mb3JfcHJvdmVuLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ2pFLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBSWxEOztHQUVHO0FBQ0gsTUFBTSxNQUFNLGlCQUFpQixHQUFHO0lBQzlCLDZEQUE2RDtJQUM3RCxhQUFhLENBQUMsRUFBRSxNQUFNLENBQUM7SUFDdkIsNkNBQTZDO0lBQzdDLFFBQVEsQ0FBQyxFQUFFLE1BQU0sQ0FBQztDQUNuQixDQUFDO0FBRUYsZUFBTyxNQUFNLHdCQUF3QixFQUFFLGlCQUd0QyxDQUFDO0FBRUY7O0dBRUc7QUFDSCx3QkFBc0IsYUFBYSxDQUFDLElBQUksRUFBRSxTQUFTLEVBQUUsT0FBTyxFQUFFLFNBQVMsRUFBRSxJQUFJLENBQUMsRUFBRSxpQkFBaUIsc0dBYWhHIn0=
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,sGAahG"}
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
  {