@aztec/aztec.js 0.0.1-commit.f295ac2 → 0.0.1-commit.f2ce05ee

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 (157) 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 +7 -8
  5. package/dest/account/account_contract.d.ts.map +1 -1
  6. package/dest/account/account_with_secret_key.d.ts +18 -7
  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 +3 -2
  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 +5 -6
  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/block.d.ts +2 -2
  22. package/dest/api/block.d.ts.map +1 -1
  23. package/dest/api/block.js +1 -1
  24. package/dest/api/contract.d.ts +16 -10
  25. package/dest/api/contract.d.ts.map +1 -1
  26. package/dest/api/contract.js +14 -8
  27. package/dest/api/events.d.ts +10 -6
  28. package/dest/api/events.d.ts.map +1 -1
  29. package/dest/api/events.js +30 -20
  30. package/dest/api/fields.d.ts +2 -1
  31. package/dest/api/fields.d.ts.map +1 -1
  32. package/dest/api/fields.js +1 -0
  33. package/dest/api/keys.d.ts +1 -1
  34. package/dest/api/keys.js +1 -1
  35. package/dest/api/node.d.ts +8 -4
  36. package/dest/api/node.d.ts.map +1 -1
  37. package/dest/api/node.js +7 -3
  38. package/dest/api/tx.d.ts +2 -2
  39. package/dest/api/tx.d.ts.map +1 -1
  40. package/dest/api/tx.js +1 -1
  41. package/dest/api/wallet.d.ts +3 -2
  42. package/dest/api/wallet.d.ts.map +1 -1
  43. package/dest/api/wallet.js +2 -1
  44. package/dest/contract/base_contract_interaction.d.ts +8 -10
  45. package/dest/contract/base_contract_interaction.d.ts.map +1 -1
  46. package/dest/contract/base_contract_interaction.js +5 -17
  47. package/dest/contract/contract_function_interaction.d.ts +3 -12
  48. package/dest/contract/contract_function_interaction.d.ts.map +1 -1
  49. package/dest/contract/contract_function_interaction.js +6 -6
  50. package/dest/contract/deploy_method.d.ts +63 -16
  51. package/dest/contract/deploy_method.d.ts.map +1 -1
  52. package/dest/contract/deploy_method.js +36 -19
  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 +1 -10
  57. package/dest/contract/protocol_contracts/auth-registry.d.ts.map +1 -1
  58. package/dest/contract/protocol_contracts/auth-registry.js +97 -467
  59. package/dest/contract/protocol_contracts/contract-class-registry.d.ts +2 -11
  60. package/dest/contract/protocol_contracts/contract-class-registry.d.ts.map +1 -1
  61. package/dest/contract/protocol_contracts/contract-class-registry.js +10 -422
  62. package/dest/contract/protocol_contracts/contract-instance-registry.d.ts +2 -11
  63. package/dest/contract/protocol_contracts/contract-instance-registry.d.ts.map +1 -1
  64. package/dest/contract/protocol_contracts/contract-instance-registry.js +80 -482
  65. package/dest/contract/protocol_contracts/fee-juice.d.ts +1 -10
  66. package/dest/contract/protocol_contracts/fee-juice.d.ts.map +1 -1
  67. package/dest/contract/protocol_contracts/fee-juice.js +14 -412
  68. package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts +3 -3
  69. package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts.map +1 -1
  70. package/dest/contract/protocol_contracts/multi-call-entrypoint.js +23 -14
  71. package/dest/contract/protocol_contracts/public-checks.d.ts +3 -3
  72. package/dest/contract/protocol_contracts/public-checks.d.ts.map +1 -1
  73. package/dest/contract/protocol_contracts/public-checks.js +23 -22
  74. package/dest/contract/wait_for_proven.js +1 -1
  75. package/dest/contract/wait_opts.d.ts +16 -0
  76. package/dest/contract/wait_opts.d.ts.map +1 -0
  77. package/dest/contract/wait_opts.js +5 -0
  78. package/dest/fee/fee_juice_payment_method_with_claim.js +6 -6
  79. package/dest/fee/private_fee_payment_method.js +10 -10
  80. package/dest/fee/public_fee_payment_method.js +10 -10
  81. package/dest/fee/sponsored_fee_payment.js +3 -3
  82. package/dest/utils/authwit.d.ts +8 -6
  83. package/dest/utils/authwit.d.ts.map +1 -1
  84. package/dest/utils/authwit.js +5 -9
  85. package/dest/utils/node.d.ts +12 -1
  86. package/dest/utils/node.d.ts.map +1 -1
  87. package/dest/utils/node.js +46 -0
  88. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts +5 -8
  89. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -1
  90. package/dest/wallet/account_entrypoint_meta_payment_method.js +28 -43
  91. package/dest/wallet/account_manager.d.ts +1 -7
  92. package/dest/wallet/account_manager.d.ts.map +1 -1
  93. package/dest/wallet/account_manager.js +5 -11
  94. package/dest/wallet/capabilities.d.ts +444 -0
  95. package/dest/wallet/capabilities.d.ts.map +1 -0
  96. package/dest/wallet/capabilities.js +3 -0
  97. package/dest/wallet/deploy_account_method.d.ts +34 -6
  98. package/dest/wallet/deploy_account_method.d.ts.map +1 -1
  99. package/dest/wallet/deploy_account_method.js +7 -5
  100. package/dest/wallet/index.d.ts +2 -1
  101. package/dest/wallet/index.d.ts.map +1 -1
  102. package/dest/wallet/index.js +1 -0
  103. package/dest/wallet/wallet.d.ts +1493 -94
  104. package/dest/wallet/wallet.d.ts.map +1 -1
  105. package/dest/wallet/wallet.js +158 -26
  106. package/package.json +19 -10
  107. package/src/account/account.ts +34 -58
  108. package/src/account/account_contract.ts +6 -7
  109. package/src/account/account_with_secret_key.ts +33 -8
  110. package/src/account/index.ts +2 -1
  111. package/src/account/signerless_account.ts +13 -12
  112. package/src/api/account.ts +9 -3
  113. package/src/api/authorization.ts +1 -0
  114. package/src/api/block.ts +1 -1
  115. package/src/api/contract.ts +22 -7
  116. package/src/api/events.ts +35 -27
  117. package/src/api/fields.ts +1 -0
  118. package/src/api/keys.ts +2 -2
  119. package/src/api/node.ts +7 -3
  120. package/src/api/tx.ts +2 -0
  121. package/src/api/wallet.ts +47 -1
  122. package/src/contract/base_contract_interaction.ts +27 -15
  123. package/src/contract/contract_function_interaction.ts +13 -6
  124. package/src/contract/deploy_method.ts +115 -23
  125. package/src/contract/interaction_options.ts +49 -4
  126. package/src/contract/protocol_contracts/auth-registry.ts +45 -236
  127. package/src/contract/protocol_contracts/contract-class-registry.ts +3 -204
  128. package/src/contract/protocol_contracts/contract-instance-registry.ts +34 -233
  129. package/src/contract/protocol_contracts/fee-juice.ts +4 -202
  130. package/src/contract/protocol_contracts/multi-call-entrypoint.ts +6 -12
  131. package/src/contract/protocol_contracts/public-checks.ts +6 -14
  132. package/src/contract/wait_for_proven.ts +1 -1
  133. package/src/contract/wait_opts.ts +21 -0
  134. package/src/fee/fee_juice_payment_method_with_claim.ts +5 -5
  135. package/src/fee/private_fee_payment_method.ts +7 -7
  136. package/src/fee/public_fee_payment_method.ts +8 -8
  137. package/src/fee/sponsored_fee_payment.ts +3 -3
  138. package/src/utils/authwit.ts +19 -7
  139. package/src/utils/node.ts +62 -0
  140. package/src/wallet/account_entrypoint_meta_payment_method.ts +28 -60
  141. package/src/wallet/account_manager.ts +5 -13
  142. package/src/wallet/capabilities.ts +491 -0
  143. package/src/wallet/deploy_account_method.ts +37 -13
  144. package/src/wallet/index.ts +1 -0
  145. package/src/wallet/wallet.ts +214 -48
  146. package/dest/account/interface.d.ts +0 -19
  147. package/dest/account/interface.d.ts.map +0 -1
  148. package/dest/account/interface.js +0 -5
  149. package/dest/contract/deploy_sent_tx.d.ts +0 -48
  150. package/dest/contract/deploy_sent_tx.d.ts.map +0 -1
  151. package/dest/contract/deploy_sent_tx.js +0 -46
  152. package/dest/contract/sent_tx.d.ts +0 -50
  153. package/dest/contract/sent_tx.d.ts.map +0 -1
  154. package/dest/contract/sent_tx.js +0 -90
  155. package/src/account/interface.ts +0 -25
  156. package/src/contract/deploy_sent_tx.ts +0 -75
  157. package/src/contract/sent_tx.ts +0 -129
@@ -44,7 +44,6 @@ const FeeJuiceContractArtifact: ContractArtifact = {
44
44
  errorTypes: {
45
45
  '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
46
46
  '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
47
- '2754040237334517471': { error_kind: 'fmtstring', length: 92, item_types: [] },
48
47
  '6609888949476313245': { error_kind: 'string', string: 'Message not in state' },
49
48
  '11019205087382408538': { error_kind: 'string', string: 'Field failed to decompose into specified 4 limbs' },
50
49
  '12370419938245003393': { error_kind: 'string', string: 'Field failed to decompose into specified 36 limbs' },
@@ -94,121 +93,6 @@ const FeeJuiceContractArtifact: ContractArtifact = {
94
93
  bytecode: Buffer.from([]),
95
94
  debugSymbols: '',
96
95
  },
97
- {
98
- ...{
99
- functionType: FunctionType.UTILITY,
100
- name: 'process_message',
101
- isOnlySelf: false,
102
- isStatic: false,
103
- isInitializer: false,
104
- parameters: [
105
- {
106
- name: 'message_ciphertext',
107
- type: {
108
- kind: 'struct',
109
- fields: [
110
- { name: 'storage', type: { kind: 'array', length: 17, type: { kind: 'field' } } },
111
- { name: 'len', type: { kind: 'integer', sign: 'unsigned', width: 32 } },
112
- ],
113
- path: 'std::collections::bounded_vec::BoundedVec',
114
- },
115
- visibility: 'private',
116
- },
117
- {
118
- name: 'message_context',
119
- type: {
120
- kind: 'struct',
121
- fields: [
122
- { name: 'tx_hash', type: { kind: 'field' } },
123
- {
124
- name: 'unique_note_hashes_in_tx',
125
- type: {
126
- kind: 'struct',
127
- fields: [
128
- { name: 'storage', type: { kind: 'array', length: 64, type: { kind: 'field' } } },
129
- { name: 'len', type: { kind: 'integer', sign: 'unsigned', width: 32 } },
130
- ],
131
- path: 'std::collections::bounded_vec::BoundedVec',
132
- },
133
- },
134
- { name: 'first_nullifier_in_tx', type: { kind: 'field' } },
135
- {
136
- name: 'recipient',
137
- type: {
138
- kind: 'struct',
139
- fields: [{ name: 'inner', type: { kind: 'field' } }],
140
- path: 'aztec::protocol_types::address::aztec_address::AztecAddress',
141
- },
142
- },
143
- ],
144
- path: 'aztec::messages::processing::message_context::MessageContext',
145
- },
146
- visibility: 'private',
147
- },
148
- ],
149
- returnTypes: [],
150
- errorTypes: {
151
- '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
152
- '992401946138144806': { error_kind: 'string', string: 'Attempted to read past end of BoundedVec' },
153
- '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
154
- '2967937905572420042': {
155
- error_kind: 'fmtstring',
156
- length: 61,
157
- item_types: [{ kind: 'field' }, { kind: 'field' }],
158
- },
159
- '3330370348214585450': {
160
- error_kind: 'fmtstring',
161
- length: 48,
162
- item_types: [{ kind: 'field' }, { kind: 'field' }],
163
- },
164
- '3670003311596808700': {
165
- error_kind: 'fmtstring',
166
- length: 77,
167
- item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
168
- },
169
- '4261968856572588300': { error_kind: 'string', string: 'Value does not fit in field' },
170
- '4440399188109668273': { error_kind: 'string', string: 'Input length must be a multiple of 32' },
171
- '9791669845391776238': {
172
- error_kind: 'string',
173
- string: '0 has a square root; you cannot claim it is not square',
174
- },
175
- '9885968605480832328': {
176
- error_kind: 'string',
177
- string: 'Attempted to read past the length of a CapsuleArray',
178
- },
179
- '10135509984888824963': { error_kind: 'fmtstring', length: 58, item_types: [{ kind: 'field' }] },
180
- '10791800398362570014': { error_kind: 'string', string: 'extend_from_bounded_vec out of bounds' },
181
- '11021520179822076911': {
182
- error_kind: 'string',
183
- string: 'Attempted to delete past the length of a CapsuleArray',
184
- },
185
- '11692359521570349358': { error_kind: 'fmtstring', length: 40, item_types: [] },
186
- '12327971061804302172': { error_kind: 'fmtstring', length: 98, item_types: [] },
187
- '12469291177396340830': { error_kind: 'string', string: 'call to assert_max_bit_size' },
188
- '12913276134398371456': { error_kind: 'string', string: 'push out of bounds' },
189
- '13557316507370296400': {
190
- error_kind: 'fmtstring',
191
- length: 130,
192
- item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
193
- },
194
- '14938672389828944159': {
195
- error_kind: 'fmtstring',
196
- length: 146,
197
- item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
198
- },
199
- '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
200
- '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
201
- '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
202
- '17531474008201752295': {
203
- error_kind: 'fmtstring',
204
- length: 133,
205
- item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
206
- },
207
- },
208
- },
209
- bytecode: Buffer.from([]),
210
- debugSymbols: '',
211
- },
212
96
  {
213
97
  ...{
214
98
  functionType: FunctionType.PUBLIC,
@@ -219,10 +103,12 @@ const FeeJuiceContractArtifact: ContractArtifact = {
219
103
  parameters: [{ name: 'selector', type: { kind: 'field' }, visibility: 'private' }],
220
104
  returnTypes: [],
221
105
  errorTypes: {
106
+ '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
222
107
  '1080336462466469436': {
223
108
  error_kind: 'string',
224
109
  string: 'Function check_balance can only be called statically',
225
110
  },
111
+ '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
226
112
  '8637882143979902881': {
227
113
  error_kind: 'string',
228
114
  string: 'Function _increase_public_balance can only be called by the same contract',
@@ -245,77 +131,6 @@ const FeeJuiceContractArtifact: ContractArtifact = {
245
131
  bytecode: Buffer.from([]),
246
132
  debugSymbols: '',
247
133
  },
248
- {
249
- ...{
250
- functionType: FunctionType.UTILITY,
251
- name: 'sync_private_state',
252
- isOnlySelf: false,
253
- isStatic: false,
254
- isInitializer: false,
255
- parameters: [],
256
- returnTypes: [],
257
- errorTypes: {
258
- '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
259
- '992401946138144806': { error_kind: 'string', string: 'Attempted to read past end of BoundedVec' },
260
- '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
261
- '2967937905572420042': {
262
- error_kind: 'fmtstring',
263
- length: 61,
264
- item_types: [{ kind: 'field' }, { kind: 'field' }],
265
- },
266
- '3330370348214585450': {
267
- error_kind: 'fmtstring',
268
- length: 48,
269
- item_types: [{ kind: 'field' }, { kind: 'field' }],
270
- },
271
- '3670003311596808700': {
272
- error_kind: 'fmtstring',
273
- length: 77,
274
- item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
275
- },
276
- '4261968856572588300': { error_kind: 'string', string: 'Value does not fit in field' },
277
- '4440399188109668273': { error_kind: 'string', string: 'Input length must be a multiple of 32' },
278
- '9791669845391776238': {
279
- error_kind: 'string',
280
- string: '0 has a square root; you cannot claim it is not square',
281
- },
282
- '9885968605480832328': {
283
- error_kind: 'string',
284
- string: 'Attempted to read past the length of a CapsuleArray',
285
- },
286
- '10135509984888824963': { error_kind: 'fmtstring', length: 58, item_types: [{ kind: 'field' }] },
287
- '10791800398362570014': { error_kind: 'string', string: 'extend_from_bounded_vec out of bounds' },
288
- '11021520179822076911': {
289
- error_kind: 'string',
290
- string: 'Attempted to delete past the length of a CapsuleArray',
291
- },
292
- '11692359521570349358': { error_kind: 'fmtstring', length: 40, item_types: [] },
293
- '12327971061804302172': { error_kind: 'fmtstring', length: 98, item_types: [] },
294
- '12469291177396340830': { error_kind: 'string', string: 'call to assert_max_bit_size' },
295
- '12913276134398371456': { error_kind: 'string', string: 'push out of bounds' },
296
- '13557316507370296400': {
297
- error_kind: 'fmtstring',
298
- length: 130,
299
- item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
300
- },
301
- '14938672389828944159': {
302
- error_kind: 'fmtstring',
303
- length: 146,
304
- item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
305
- },
306
- '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
307
- '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
308
- '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
309
- '17531474008201752295': {
310
- error_kind: 'fmtstring',
311
- length: 133,
312
- item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
313
- },
314
- },
315
- },
316
- bytecode: Buffer.from([]),
317
- debugSymbols: '',
318
- },
319
134
  ],
320
135
  nonDispatchPublicFunctions: [
321
136
  {
@@ -338,6 +153,8 @@ const FeeJuiceContractArtifact: ContractArtifact = {
338
153
  ],
339
154
  returnTypes: [],
340
155
  errorTypes: {
156
+ '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
157
+ '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
341
158
  '8637882143979902881': {
342
159
  error_kind: 'string',
343
160
  string: 'Function _increase_public_balance can only be called by the same contract',
@@ -441,22 +258,7 @@ export class FeeJuiceContract extends ContractBase {
441
258
  ) => ContractFunctionInteraction) &
442
259
  Pick<ContractMethod, 'selector'>;
443
260
 
444
- /** process_message(message_ciphertext: struct, message_context: struct) */
445
- process_message: ((
446
- message_ciphertext: FieldLike[],
447
- message_context: {
448
- tx_hash: FieldLike;
449
- unique_note_hashes_in_tx: FieldLike[];
450
- first_nullifier_in_tx: FieldLike;
451
- recipient: AztecAddressLike;
452
- },
453
- ) => ContractFunctionInteraction) &
454
- Pick<ContractMethod, 'selector'>;
455
-
456
261
  /** public_dispatch(selector: field) */
457
262
  public_dispatch: ((selector: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
458
-
459
- /** sync_private_state() */
460
- sync_private_state: (() => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
461
263
  };
462
264
  }
@@ -160,22 +160,14 @@ const MultiCallEntrypointContractArtifact: ContractArtifact = {
160
160
  },
161
161
  '4261968856572588300': { error_kind: 'string', string: 'Value does not fit in field' },
162
162
  '4440399188109668273': { error_kind: 'string', string: 'Input length must be a multiple of 32' },
163
+ '5417577161503694006': { error_kind: 'fmtstring', length: 56, item_types: [{ kind: 'field' }] },
163
164
  '9791669845391776238': {
164
165
  error_kind: 'string',
165
166
  string: '0 has a square root; you cannot claim it is not square',
166
167
  },
167
- '9885968605480832328': {
168
- error_kind: 'string',
169
- string: 'Attempted to read past the length of a CapsuleArray',
170
- },
171
168
  '10135509984888824963': { error_kind: 'fmtstring', length: 58, item_types: [{ kind: 'field' }] },
172
169
  '10791800398362570014': { error_kind: 'string', string: 'extend_from_bounded_vec out of bounds' },
173
- '11021520179822076911': {
174
- error_kind: 'string',
175
- string: 'Attempted to delete past the length of a CapsuleArray',
176
- },
177
170
  '11692359521570349358': { error_kind: 'fmtstring', length: 40, item_types: [] },
178
- '12327971061804302172': { error_kind: 'fmtstring', length: 98, item_types: [] },
179
171
  '12469291177396340830': { error_kind: 'string', string: 'call to assert_max_bit_size' },
180
172
  '12913276134398371456': { error_kind: 'string', string: 'push out of bounds' },
181
173
  '13557316507370296400': {
@@ -204,7 +196,7 @@ const MultiCallEntrypointContractArtifact: ContractArtifact = {
204
196
  {
205
197
  ...{
206
198
  functionType: FunctionType.UTILITY,
207
- name: 'sync_private_state',
199
+ name: 'sync_state',
208
200
  isOnlySelf: false,
209
201
  isStatic: false,
210
202
  isInitializer: false,
@@ -231,6 +223,7 @@ const MultiCallEntrypointContractArtifact: ContractArtifact = {
231
223
  },
232
224
  '4261968856572588300': { error_kind: 'string', string: 'Value does not fit in field' },
233
225
  '4440399188109668273': { error_kind: 'string', string: 'Input length must be a multiple of 32' },
226
+ '5417577161503694006': { error_kind: 'fmtstring', length: 56, item_types: [{ kind: 'field' }] },
234
227
  '9791669845391776238': {
235
228
  error_kind: 'string',
236
229
  string: '0 has a square root; you cannot claim it is not square',
@@ -267,6 +260,7 @@ const MultiCallEntrypointContractArtifact: ContractArtifact = {
267
260
  length: 133,
268
261
  item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
269
262
  },
263
+ '17655676068928457687': { error_kind: 'string', string: 'Reader did not read all data' },
270
264
  },
271
265
  },
272
266
  bytecode: Buffer.from([]),
@@ -332,7 +326,7 @@ export class MultiCallEntrypointContract extends ContractBase {
332
326
  /** public_dispatch(selector: field) */
333
327
  public_dispatch: ((selector: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
334
328
 
335
- /** sync_private_state() */
336
- sync_private_state: (() => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
329
+ /** sync_state() */
330
+ sync_state: (() => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
337
331
  };
338
332
  }
@@ -93,22 +93,14 @@ const PublicChecksContractArtifact: ContractArtifact = {
93
93
  },
94
94
  '4261968856572588300': { error_kind: 'string', string: 'Value does not fit in field' },
95
95
  '4440399188109668273': { error_kind: 'string', string: 'Input length must be a multiple of 32' },
96
+ '5417577161503694006': { error_kind: 'fmtstring', length: 56, item_types: [{ kind: 'field' }] },
96
97
  '9791669845391776238': {
97
98
  error_kind: 'string',
98
99
  string: '0 has a square root; you cannot claim it is not square',
99
100
  },
100
- '9885968605480832328': {
101
- error_kind: 'string',
102
- string: 'Attempted to read past the length of a CapsuleArray',
103
- },
104
101
  '10135509984888824963': { error_kind: 'fmtstring', length: 58, item_types: [{ kind: 'field' }] },
105
102
  '10791800398362570014': { error_kind: 'string', string: 'extend_from_bounded_vec out of bounds' },
106
- '11021520179822076911': {
107
- error_kind: 'string',
108
- string: 'Attempted to delete past the length of a CapsuleArray',
109
- },
110
103
  '11692359521570349358': { error_kind: 'fmtstring', length: 40, item_types: [] },
111
- '12327971061804302172': { error_kind: 'fmtstring', length: 98, item_types: [] },
112
104
  '12469291177396340830': { error_kind: 'string', string: 'call to assert_max_bit_size' },
113
105
  '12913276134398371456': { error_kind: 'string', string: 'push out of bounds' },
114
106
  '13557316507370296400': {
@@ -155,10 +147,8 @@ const PublicChecksContractArtifact: ContractArtifact = {
155
147
  },
156
148
  '12511970388699677811': { error_kind: 'fmtstring', length: 27, item_types: [{ kind: 'field' }] },
157
149
  '13950240626967988787': { error_kind: 'string', string: 'Timestamp mismatch.' },
158
- '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
159
150
  '15015303112667403944': { error_kind: 'fmtstring', length: 17, item_types: [] },
160
151
  '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
161
- '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
162
152
  },
163
153
  },
164
154
  bytecode: Buffer.from([]),
@@ -167,7 +157,7 @@ const PublicChecksContractArtifact: ContractArtifact = {
167
157
  {
168
158
  ...{
169
159
  functionType: FunctionType.UTILITY,
170
- name: 'sync_private_state',
160
+ name: 'sync_state',
171
161
  isOnlySelf: false,
172
162
  isStatic: false,
173
163
  isInitializer: false,
@@ -194,6 +184,7 @@ const PublicChecksContractArtifact: ContractArtifact = {
194
184
  },
195
185
  '4261968856572588300': { error_kind: 'string', string: 'Value does not fit in field' },
196
186
  '4440399188109668273': { error_kind: 'string', string: 'Input length must be a multiple of 32' },
187
+ '5417577161503694006': { error_kind: 'fmtstring', length: 56, item_types: [{ kind: 'field' }] },
197
188
  '9791669845391776238': {
198
189
  error_kind: 'string',
199
190
  string: '0 has a square root; you cannot claim it is not square',
@@ -230,6 +221,7 @@ const PublicChecksContractArtifact: ContractArtifact = {
230
221
  length: 133,
231
222
  item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
232
223
  },
224
+ '17655676068928457687': { error_kind: 'string', string: 'Reader did not read all data' },
233
225
  },
234
226
  },
235
227
  bytecode: Buffer.from([]),
@@ -318,7 +310,7 @@ export class PublicChecksContract extends ContractBase {
318
310
  /** public_dispatch(selector: field) */
319
311
  public_dispatch: ((selector: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
320
312
 
321
- /** sync_private_state() */
322
- sync_private_state: (() => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
313
+ /** sync_state() */
314
+ sync_state: (() => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
323
315
  };
324
316
  }
@@ -2,7 +2,7 @@ import { retryUntil } from '@aztec/foundation/retry';
2
2
  import type { AztecNode } from '@aztec/stdlib/interfaces/client';
3
3
  import type { TxReceipt } from '@aztec/stdlib/tx';
4
4
 
5
- import { DefaultWaitOpts } from './sent_tx.js';
5
+ import { DefaultWaitOpts } from './wait_opts.js';
6
6
 
7
7
  /**
8
8
  * Options for waiting for a transaction to be proven.
@@ -0,0 +1,21 @@
1
+ import type { TxStatus } from '@aztec/stdlib/tx';
2
+
3
+ /** Options related to waiting for a tx. */
4
+ export type WaitOpts = {
5
+ /** 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. */
6
+ ignoreDroppedReceiptsFor?: number;
7
+ /** The maximum time (in seconds) to wait for the transaction to be mined. Defaults to 60. */
8
+ timeout?: number;
9
+ /** The time interval (in seconds) between retries to fetch the transaction receipt. Defaults to 1. */
10
+ interval?: number;
11
+ /** Whether to accept a revert as a status code for the tx when waiting for it. If false, will throw if the tx reverts. */
12
+ dontThrowOnRevert?: boolean;
13
+ /** The minimum inclusion status to wait for. If set, waits until the receipt reaches this status or higher. Defaults to CHECKPOINTED. */
14
+ waitForStatus?: TxStatus;
15
+ };
16
+
17
+ export const DefaultWaitOpts: WaitOpts = {
18
+ ignoreDroppedReceiptsFor: 5,
19
+ timeout: 300,
20
+ interval: 1,
21
+ };
@@ -1,6 +1,6 @@
1
1
  import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import { ProtocolContractAddress } from '@aztec/protocol-contracts';
3
- import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
3
+ import { FunctionCall, FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
4
4
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
5
  import type { GasSettings } from '@aztec/stdlib/gas';
6
6
  import { ExecutionPayload } from '@aztec/stdlib/tx';
@@ -27,10 +27,11 @@ export class FeeJuicePaymentMethodWithClaim implements FeePaymentMethod {
27
27
 
28
28
  return new ExecutionPayload(
29
29
  [
30
- {
31
- to: ProtocolContractAddress.FeeJuice,
30
+ FunctionCall.from({
32
31
  name: 'claim_and_end_setup',
32
+ to: ProtocolContractAddress.FeeJuice,
33
33
  selector,
34
+ type: FunctionType.PRIVATE,
34
35
  hideMsgSender: false,
35
36
  isStatic: false,
36
37
  args: [
@@ -40,8 +41,7 @@ export class FeeJuicePaymentMethodWithClaim implements FeePaymentMethod {
40
41
  new Fr(this.claim.messageLeafIndex),
41
42
  ],
42
43
  returnTypes: [],
43
- type: FunctionType.PRIVATE,
44
- },
44
+ }),
45
45
  ],
46
46
  [],
47
47
  [],
@@ -1,5 +1,5 @@
1
1
  import { Fr } from '@aztec/foundation/curves/bn254';
2
- import { type FunctionAbi, FunctionSelector, FunctionType, decodeFromAbi } from '@aztec/stdlib/abi';
2
+ import { type FunctionAbi, FunctionCall, FunctionSelector, FunctionType, decodeFromAbi } from '@aztec/stdlib/abi';
3
3
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
4
4
  import type { GasSettings } from '@aztec/stdlib/gas';
5
5
  import { ExecutionPayload } from '@aztec/stdlib/tx';
@@ -102,21 +102,21 @@ export class PrivateFeePaymentMethod implements FeePaymentMethod {
102
102
 
103
103
  const witness = await this.wallet.createAuthWit(this.sender, {
104
104
  caller: this.paymentContract,
105
- call: {
105
+ call: FunctionCall.from({
106
106
  name: 'transfer_to_public',
107
- args: [this.sender.toField(), this.paymentContract.toField(), maxFee, txNonce],
107
+ to: await this.getAsset(),
108
108
  selector: await FunctionSelector.fromSignature('transfer_to_public((Field),(Field),u128,Field)'),
109
109
  type: FunctionType.PRIVATE,
110
110
  hideMsgSender: false,
111
111
  isStatic: false,
112
- to: await this.getAsset(),
112
+ args: [this.sender.toField(), this.paymentContract.toField(), maxFee, txNonce],
113
113
  returnTypes: [],
114
- },
114
+ }),
115
115
  });
116
116
 
117
117
  return new ExecutionPayload(
118
118
  [
119
- {
119
+ FunctionCall.from({
120
120
  name: 'fee_entrypoint_private',
121
121
  to: this.paymentContract,
122
122
  selector: await FunctionSelector.fromSignature('fee_entrypoint_private(u128,Field)'),
@@ -125,7 +125,7 @@ export class PrivateFeePaymentMethod implements FeePaymentMethod {
125
125
  isStatic: false,
126
126
  args: [maxFee, txNonce],
127
127
  returnTypes: [],
128
- },
128
+ }),
129
129
  ],
130
130
  [witness],
131
131
  [],
@@ -1,5 +1,5 @@
1
1
  import { Fr } from '@aztec/foundation/curves/bn254';
2
- import { type FunctionAbi, FunctionSelector, FunctionType, decodeFromAbi } from '@aztec/stdlib/abi';
2
+ import { type FunctionAbi, FunctionCall, FunctionSelector, FunctionType, decodeFromAbi } from '@aztec/stdlib/abi';
3
3
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
4
4
  import { GasSettings } from '@aztec/stdlib/gas';
5
5
  import { ExecutionPayload } from '@aztec/stdlib/tx';
@@ -94,16 +94,16 @@ export class PublicFeePaymentMethod implements FeePaymentMethod {
94
94
 
95
95
  const intent = {
96
96
  caller: this.paymentContract,
97
- call: {
97
+ call: FunctionCall.from({
98
98
  name: 'transfer_in_public',
99
- args: [this.sender.toField(), this.paymentContract.toField(), maxFee, txNonce],
99
+ to: await this.getAsset(),
100
100
  selector: await FunctionSelector.fromSignature('transfer_in_public((Field),(Field),u128,Field)'),
101
101
  type: FunctionType.PUBLIC,
102
- isStatic: false,
103
102
  hideMsgSender: false /** The target function performs an authwit check, so msg_sender is needed */,
104
- to: await this.getAsset(),
103
+ isStatic: false,
104
+ args: [this.sender.toField(), this.paymentContract.toField(), maxFee, txNonce],
105
105
  returnTypes: [],
106
- },
106
+ }),
107
107
  };
108
108
 
109
109
  const setPublicAuthWitInteraction = await SetPublicAuthwitContractInteraction.create(
@@ -116,7 +116,7 @@ export class PublicFeePaymentMethod implements FeePaymentMethod {
116
116
  return new ExecutionPayload(
117
117
  [
118
118
  ...(await setPublicAuthWitInteraction.request()).calls,
119
- {
119
+ FunctionCall.from({
120
120
  name: 'fee_entrypoint_public',
121
121
  to: this.paymentContract,
122
122
  selector: await FunctionSelector.fromSignature('fee_entrypoint_public(u128,Field)'),
@@ -125,7 +125,7 @@ export class PublicFeePaymentMethod implements FeePaymentMethod {
125
125
  isStatic: false,
126
126
  args: [maxFee, txNonce],
127
127
  returnTypes: [],
128
- },
128
+ }),
129
129
  ],
130
130
  [],
131
131
  [],
@@ -1,5 +1,5 @@
1
1
  import type { FeePaymentMethod } from '@aztec/aztec.js/fee';
2
- import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
2
+ import { FunctionCall, FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
3
3
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
4
4
  import type { GasSettings } from '@aztec/stdlib/gas';
5
5
  import { ExecutionPayload } from '@aztec/stdlib/tx';
@@ -22,7 +22,7 @@ export class SponsoredFeePaymentMethod implements FeePaymentMethod {
22
22
  async getExecutionPayload(): Promise<ExecutionPayload> {
23
23
  return new ExecutionPayload(
24
24
  [
25
- {
25
+ FunctionCall.from({
26
26
  name: 'sponsor_unconditionally',
27
27
  to: this.paymentContract,
28
28
  selector: await FunctionSelector.fromSignature('sponsor_unconditionally()'),
@@ -31,7 +31,7 @@ export class SponsoredFeePaymentMethod implements FeePaymentMethod {
31
31
  isStatic: false,
32
32
  args: [],
33
33
  returnTypes: [],
34
- },
34
+ }),
35
35
  ],
36
36
  [],
37
37
  [],
@@ -5,16 +5,18 @@ import { type ABIParameterVisibility, type FunctionAbi, type FunctionCall, Funct
5
5
  import { AuthWitness, computeInnerAuthWitHash, computeOuterAuthWitHash } from '@aztec/stdlib/auth-witness';
6
6
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
7
7
  import { computeVarArgsHash } from '@aztec/stdlib/hash';
8
- import type { TxProfileResult } from '@aztec/stdlib/tx';
8
+ import type { TxHash, TxProfileResult, TxReceipt } from '@aztec/stdlib/tx';
9
9
 
10
10
  import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
11
11
  import type {
12
+ InteractionWaitOptions,
12
13
  ProfileInteractionOptions,
13
14
  SendInteractionOptions,
15
+ SendInteractionOptionsWithoutWait,
16
+ SendReturn,
14
17
  SimulateInteractionOptions,
15
18
  SimulationReturn,
16
19
  } from '../contract/interaction_options.js';
17
- import type { SentTx } from '../contract/sent_tx.js';
18
20
  import type { Wallet } from '../wallet/index.js';
19
21
 
20
22
  /** Intent with an inner hash */
@@ -42,7 +44,7 @@ export type ContractFunctionInteractionCallIntent = {
42
44
  };
43
45
 
44
46
  /** Identifies ContractFunctionInteractionCallIntents */
45
- function isContractFunctionIntractionCallIntent(
47
+ export function isContractFunctionInteractionCallIntent(
46
48
  messageHashOrIntent: Fr | IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent,
47
49
  ): messageHashOrIntent is ContractFunctionInteractionCallIntent {
48
50
  return (
@@ -81,7 +83,7 @@ export const computeAuthWitMessageHash = async (
81
83
  const version = metadata.version;
82
84
 
83
85
  if ('caller' in intent) {
84
- const call = isContractFunctionIntractionCallIntent(intent) ? await intent.action.getFunctionCall() : intent.call;
86
+ const call = isContractFunctionInteractionCallIntent(intent) ? await intent.action.getFunctionCall() : intent.call;
85
87
  return computeOuterAuthWitHash(
86
88
  call.to,
87
89
  chainId,
@@ -154,7 +156,7 @@ export async function lookupValidity(
154
156
  }> {
155
157
  let innerHash, consumer;
156
158
  if ('caller' in intent) {
157
- const call = isContractFunctionIntractionCallIntent(intent) ? await intent.action.getFunctionCall() : intent.call;
159
+ const call = isContractFunctionInteractionCallIntent(intent) ? await intent.action.getFunctionCall() : intent.call;
158
160
  innerHash = await computeInnerAuthWitHashFromAction(intent.caller, call);
159
161
  consumer = call.to;
160
162
  } else {
@@ -286,9 +288,19 @@ export class SetPublicAuthwitContractInteraction extends ContractFunctionInterac
286
288
  * Overrides the send method, adding the sender of the authwit (authorizer) as from
287
289
  * and preventing misuse
288
290
  * @param options - An optional object containing 'fee' options information
289
- * @returns A SentTx instance for tracking the transaction status and information.
291
+ * @returns A TxReceipt (if wait is true/undefined) or TxHash (if wait is false)
290
292
  */
291
- public override send(options: Omit<SendInteractionOptions, 'from'> = {}): SentTx {
293
+ // Overload for when wait is not specified at all - returns TxReceipt
294
+ public override send(options?: Omit<SendInteractionOptionsWithoutWait, 'from'>): Promise<TxReceipt>;
295
+ // Generic overload for explicit wait values
296
+ // eslint-disable-next-line jsdoc/require-jsdoc
297
+ public override send<W extends InteractionWaitOptions>(
298
+ options?: Omit<SendInteractionOptions<W>, 'from'>,
299
+ ): Promise<SendReturn<W>>;
300
+ // eslint-disable-next-line jsdoc/require-jsdoc
301
+ public override send(
302
+ options?: Omit<SendInteractionOptions<InteractionWaitOptions>, 'from'>,
303
+ ): Promise<TxReceipt | TxHash> {
292
304
  return super.send({ ...options, from: this.from });
293
305
  }
294
306