@aztec-labs/aztec.js 6.0.0-nightly.20260829

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 (275) hide show
  1. package/README.md +44 -0
  2. package/dest/account/account.d.ts +44 -0
  3. package/dest/account/account.d.ts.map +1 -0
  4. package/dest/account/account.js +31 -0
  5. package/dest/account/account_contract.d.ts +49 -0
  6. package/dest/account/account_contract.d.ts.map +1 -0
  7. package/dest/account/account_contract.js +20 -0
  8. package/dest/account/index.d.ts +11 -0
  9. package/dest/account/index.d.ts.map +1 -0
  10. package/dest/account/index.js +6 -0
  11. package/dest/api/abi.d.ts +4 -0
  12. package/dest/api/abi.d.ts.map +1 -0
  13. package/dest/api/abi.js +1 -0
  14. package/dest/api/account.d.ts +5 -0
  15. package/dest/api/account.d.ts.map +1 -0
  16. package/dest/api/account.js +3 -0
  17. package/dest/api/addresses.d.ts +4 -0
  18. package/dest/api/addresses.d.ts.map +1 -0
  19. package/dest/api/addresses.js +3 -0
  20. package/dest/api/authorization.d.ts +5 -0
  21. package/dest/api/authorization.d.ts.map +1 -0
  22. package/dest/api/authorization.js +4 -0
  23. package/dest/api/block.d.ts +3 -0
  24. package/dest/api/block.d.ts.map +1 -0
  25. package/dest/api/block.js +2 -0
  26. package/dest/api/contract.d.ts +48 -0
  27. package/dest/api/contract.d.ts.map +1 -0
  28. package/dest/api/contract.js +46 -0
  29. package/dest/api/crypto.d.ts +2 -0
  30. package/dest/api/crypto.d.ts.map +1 -0
  31. package/dest/api/crypto.js +1 -0
  32. package/dest/api/deployment.d.ts +4 -0
  33. package/dest/api/deployment.d.ts.map +1 -0
  34. package/dest/api/deployment.js +3 -0
  35. package/dest/api/eth_address.d.ts +2 -0
  36. package/dest/api/eth_address.d.ts.map +1 -0
  37. package/dest/api/eth_address.js +1 -0
  38. package/dest/api/ethereum.d.ts +2 -0
  39. package/dest/api/ethereum.d.ts.map +1 -0
  40. package/dest/api/ethereum.js +1 -0
  41. package/dest/api/event_cursor.d.ts +44 -0
  42. package/dest/api/event_cursor.d.ts.map +1 -0
  43. package/dest/api/event_cursor.js +42 -0
  44. package/dest/api/events.d.ts +36 -0
  45. package/dest/api/events.d.ts.map +1 -0
  46. package/dest/api/events.js +59 -0
  47. package/dest/api/fee.d.ts +6 -0
  48. package/dest/api/fee.d.ts.map +1 -0
  49. package/dest/api/fee.js +4 -0
  50. package/dest/api/fee_testing.d.ts +2 -0
  51. package/dest/api/fee_testing.d.ts.map +1 -0
  52. package/dest/api/fee_testing.js +1 -0
  53. package/dest/api/fields.d.ts +4 -0
  54. package/dest/api/fields.d.ts.map +1 -0
  55. package/dest/api/fields.js +3 -0
  56. package/dest/api/keys.d.ts +4 -0
  57. package/dest/api/keys.d.ts.map +1 -0
  58. package/dest/api/keys.js +3 -0
  59. package/dest/api/log.d.ts +3 -0
  60. package/dest/api/log.d.ts.map +1 -0
  61. package/dest/api/log.js +2 -0
  62. package/dest/api/messaging.d.ts +3 -0
  63. package/dest/api/messaging.d.ts.map +1 -0
  64. package/dest/api/messaging.js +2 -0
  65. package/dest/api/node.d.ts +25 -0
  66. package/dest/api/node.d.ts.map +1 -0
  67. package/dest/api/node.js +22 -0
  68. package/dest/api/note.d.ts +2 -0
  69. package/dest/api/note.d.ts.map +1 -0
  70. package/dest/api/note.js +1 -0
  71. package/dest/api/protocol.d.ts +6 -0
  72. package/dest/api/protocol.d.ts.map +1 -0
  73. package/dest/api/protocol.js +5 -0
  74. package/dest/api/trees.d.ts +3 -0
  75. package/dest/api/trees.d.ts.map +1 -0
  76. package/dest/api/trees.js +2 -0
  77. package/dest/api/tx.d.ts +3 -0
  78. package/dest/api/tx.d.ts.map +1 -0
  79. package/dest/api/tx.js +1 -0
  80. package/dest/api/utils.d.ts +13 -0
  81. package/dest/api/utils.d.ts.map +1 -0
  82. package/dest/api/utils.js +12 -0
  83. package/dest/api/wallet.d.ts +8 -0
  84. package/dest/api/wallet.d.ts.map +1 -0
  85. package/dest/api/wallet.js +7 -0
  86. package/dest/authorization/call_authorization_request.d.ts +46 -0
  87. package/dest/authorization/call_authorization_request.d.ts.map +1 -0
  88. package/dest/authorization/call_authorization_request.js +72 -0
  89. package/dest/contract/base_contract_interaction.d.ts +32 -0
  90. package/dest/contract/base_contract_interaction.d.ts.map +1 -0
  91. package/dest/contract/base_contract_interaction.js +24 -0
  92. package/dest/contract/batch_call.d.ts +27 -0
  93. package/dest/contract/batch_call.d.ts.map +1 -0
  94. package/dest/contract/batch_call.js +152 -0
  95. package/dest/contract/checker.d.ts +11 -0
  96. package/dest/contract/checker.d.ts.map +1 -0
  97. package/dest/contract/checker.js +107 -0
  98. package/dest/contract/contract.d.ts +33 -0
  99. package/dest/contract/contract.d.ts.map +1 -0
  100. package/dest/contract/contract.js +36 -0
  101. package/dest/contract/contract_base.d.ts +51 -0
  102. package/dest/contract/contract_base.d.ts.map +1 -0
  103. package/dest/contract/contract_base.js +38 -0
  104. package/dest/contract/contract_function_interaction.d.ts +67 -0
  105. package/dest/contract/contract_function_interaction.d.ts.map +1 -0
  106. package/dest/contract/contract_function_interaction.js +218 -0
  107. package/dest/contract/deploy_method.d.ts +433 -0
  108. package/dest/contract/deploy_method.d.ts.map +1 -0
  109. package/dest/contract/deploy_method.js +471 -0
  110. package/dest/contract/fastforward_contract_update.d.ts +25 -0
  111. package/dest/contract/fastforward_contract_update.d.ts.map +1 -0
  112. package/dest/contract/fastforward_contract_update.js +57 -0
  113. package/dest/contract/interaction_options.d.ts +213 -0
  114. package/dest/contract/interaction_options.d.ts.map +1 -0
  115. package/dest/contract/interaction_options.js +87 -0
  116. package/dest/contract/protocol_contracts/contract-class-registry.d.ts +18 -0
  117. package/dest/contract/protocol_contracts/contract-class-registry.d.ts.map +1 -0
  118. package/dest/contract/protocol_contracts/contract-class-registry.js +137 -0
  119. package/dest/contract/protocol_contracts/contract-instance-registry.d.ts +25 -0
  120. package/dest/contract/protocol_contracts/contract-instance-registry.d.ts.map +1 -0
  121. package/dest/contract/protocol_contracts/contract-instance-registry.js +366 -0
  122. package/dest/contract/protocol_contracts/fee-juice.d.ts +24 -0
  123. package/dest/contract/protocol_contracts/fee-juice.d.ts.map +1 -0
  124. package/dest/contract/protocol_contracts/fee-juice.js +383 -0
  125. package/dest/contract/wait_for_proven.d.ts +18 -0
  126. package/dest/contract/wait_for_proven.d.ts.map +1 -0
  127. package/dest/contract/wait_for_proven.js +17 -0
  128. package/dest/contract/wait_opts.d.ts +21 -0
  129. package/dest/contract/wait_opts.d.ts.map +1 -0
  130. package/dest/contract/wait_opts.js +5 -0
  131. package/dest/deployment/contract_deployer.d.ts +28 -0
  132. package/dest/deployment/contract_deployer.d.ts.map +1 -0
  133. package/dest/deployment/contract_deployer.js +35 -0
  134. package/dest/deployment/publish_class.d.ts +6 -0
  135. package/dest/deployment/publish_class.d.ts.map +1 -0
  136. package/dest/deployment/publish_class.js +17 -0
  137. package/dest/deployment/publish_instance.d.ts +10 -0
  138. package/dest/deployment/publish_instance.d.ts.map +1 -0
  139. package/dest/deployment/publish_instance.js +11 -0
  140. package/dest/ethereum/portal_manager.d.ts +146 -0
  141. package/dest/ethereum/portal_manager.d.ts.map +1 -0
  142. package/dest/ethereum/portal_manager.js +415 -0
  143. package/dest/fee/fee_juice_payment_method_with_claim.d.ts +23 -0
  144. package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -0
  145. package/dest/fee/fee_juice_payment_method_with_claim.js +46 -0
  146. package/dest/fee/fee_payment_method.d.ts +26 -0
  147. package/dest/fee/fee_payment_method.d.ts.map +1 -0
  148. package/dest/fee/fee_payment_method.js +3 -0
  149. package/dest/fee/private_fee_payment_method.d.ts +69 -0
  150. package/dest/fee/private_fee_payment_method.d.ts.map +1 -0
  151. package/dest/fee/private_fee_payment_method.js +122 -0
  152. package/dest/fee/public_fee_payment_method.d.ts +59 -0
  153. package/dest/fee/public_fee_payment_method.d.ts.map +1 -0
  154. package/dest/fee/public_fee_payment_method.js +116 -0
  155. package/dest/fee/sponsored_fee_payment.d.ts +17 -0
  156. package/dest/fee/sponsored_fee_payment.d.ts.map +1 -0
  157. package/dest/fee/sponsored_fee_payment.js +33 -0
  158. package/dest/scripts/generate_protocol_contract_types.d.ts +2 -0
  159. package/dest/scripts/generate_protocol_contract_types.d.ts.map +1 -0
  160. package/dest/scripts/generate_protocol_contract_types.js +128 -0
  161. package/dest/test/fixtures.d.ts +13 -0
  162. package/dest/test/fixtures.d.ts.map +1 -0
  163. package/dest/test/fixtures.js +185 -0
  164. package/dest/utils/abi_types.d.ts +32 -0
  165. package/dest/utils/abi_types.d.ts.map +1 -0
  166. package/dest/utils/abi_types.js +1 -0
  167. package/dest/utils/authwit.d.ts +119 -0
  168. package/dest/utils/authwit.d.ts.map +1 -0
  169. package/dest/utils/authwit.js +266 -0
  170. package/dest/utils/cross_chain.d.ts +28 -0
  171. package/dest/utils/cross_chain.d.ts.map +1 -0
  172. package/dest/utils/cross_chain.js +26 -0
  173. package/dest/utils/fee_juice.d.ts +8 -0
  174. package/dest/utils/fee_juice.d.ts.map +1 -0
  175. package/dest/utils/fee_juice.js +10 -0
  176. package/dest/utils/field_compressed_string.d.ts +17 -0
  177. package/dest/utils/field_compressed_string.d.ts.map +1 -0
  178. package/dest/utils/field_compressed_string.js +15 -0
  179. package/dest/utils/node.d.ts +24 -0
  180. package/dest/utils/node.d.ts.map +1 -0
  181. package/dest/utils/node.js +80 -0
  182. package/dest/utils/pub_key.d.ts +9 -0
  183. package/dest/utils/pub_key.d.ts.map +1 -0
  184. package/dest/utils/pub_key.js +8 -0
  185. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts +33 -0
  186. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -0
  187. package/dest/wallet/account_entrypoint_meta_payment_method.js +63 -0
  188. package/dest/wallet/account_manager.d.ts +73 -0
  189. package/dest/wallet/account_manager.d.ts.map +1 -0
  190. package/dest/wallet/account_manager.js +102 -0
  191. package/dest/wallet/capabilities.d.ts +456 -0
  192. package/dest/wallet/capabilities.d.ts.map +1 -0
  193. package/dest/wallet/capabilities.js +3 -0
  194. package/dest/wallet/deploy_account_method.d.ts +97 -0
  195. package/dest/wallet/deploy_account_method.d.ts.map +1 -0
  196. package/dest/wallet/deploy_account_method.js +127 -0
  197. package/dest/wallet/index.d.ts +5 -0
  198. package/dest/wallet/index.d.ts.map +1 -0
  199. package/dest/wallet/index.js +4 -0
  200. package/dest/wallet/tx_simulation_result_with_app_offset.d.ts +40 -0
  201. package/dest/wallet/tx_simulation_result_with_app_offset.d.ts.map +1 -0
  202. package/dest/wallet/tx_simulation_result_with_app_offset.js +65 -0
  203. package/dest/wallet/wallet.d.ts +1451 -0
  204. package/dest/wallet/wallet.d.ts.map +1 -0
  205. package/dest/wallet/wallet.js +430 -0
  206. package/package.json +138 -0
  207. package/src/account/account.ts +72 -0
  208. package/src/account/account_contract.ts +80 -0
  209. package/src/account/index.ts +12 -0
  210. package/src/api/README.md +7 -0
  211. package/src/api/abi.ts +42 -0
  212. package/src/api/account.ts +12 -0
  213. package/src/api/addresses.ts +3 -0
  214. package/src/api/authorization.ts +15 -0
  215. package/src/api/block.ts +2 -0
  216. package/src/api/contract.ts +86 -0
  217. package/src/api/crypto.ts +1 -0
  218. package/src/api/deployment.ts +3 -0
  219. package/src/api/eth_address.ts +1 -0
  220. package/src/api/ethereum.ts +10 -0
  221. package/src/api/event_cursor.ts +60 -0
  222. package/src/api/events.ts +79 -0
  223. package/src/api/fee.ts +5 -0
  224. package/src/api/fee_testing.ts +1 -0
  225. package/src/api/fields.ts +3 -0
  226. package/src/api/keys.ts +8 -0
  227. package/src/api/log.ts +2 -0
  228. package/src/api/messaging.ts +2 -0
  229. package/src/api/node.ts +30 -0
  230. package/src/api/note.ts +1 -0
  231. package/src/api/protocol.ts +6 -0
  232. package/src/api/trees.ts +2 -0
  233. package/src/api/tx.ts +20 -0
  234. package/src/api/utils.ts +14 -0
  235. package/src/api/wallet.ts +83 -0
  236. package/src/authorization/call_authorization_request.ts +93 -0
  237. package/src/contract/base_contract_interaction.ts +62 -0
  238. package/src/contract/batch_call.ts +188 -0
  239. package/src/contract/checker.ts +122 -0
  240. package/src/contract/contract.ts +52 -0
  241. package/src/contract/contract_base.ts +73 -0
  242. package/src/contract/contract_function_interaction.ts +297 -0
  243. package/src/contract/deploy_method.ts +877 -0
  244. package/src/contract/fastforward_contract_update.ts +71 -0
  245. package/src/contract/interaction_options.ts +301 -0
  246. package/src/contract/protocol_contracts/contract-class-registry.ts +104 -0
  247. package/src/contract/protocol_contracts/contract-instance-registry.ts +241 -0
  248. package/src/contract/protocol_contracts/fee-juice.ts +257 -0
  249. package/src/contract/wait_for_proven.ts +43 -0
  250. package/src/contract/wait_opts.ts +26 -0
  251. package/src/deployment/contract_deployer.ts +40 -0
  252. package/src/deployment/publish_class.ts +34 -0
  253. package/src/deployment/publish_instance.ts +24 -0
  254. package/src/ethereum/portal_manager.ts +539 -0
  255. package/src/fee/fee_juice_payment_method_with_claim.ts +63 -0
  256. package/src/fee/fee_payment_method.ts +26 -0
  257. package/src/fee/private_fee_payment_method.ts +145 -0
  258. package/src/fee/public_fee_payment_method.ts +145 -0
  259. package/src/fee/sponsored_fee_payment.ts +45 -0
  260. package/src/scripts/generate_protocol_contract_types.ts +160 -0
  261. package/src/test/fixtures.ts +126 -0
  262. package/src/utils/abi_types.ts +32 -0
  263. package/src/utils/authwit.ts +327 -0
  264. package/src/utils/cross_chain.ts +55 -0
  265. package/src/utils/fee_juice.ts +14 -0
  266. package/src/utils/field_compressed_string.ts +27 -0
  267. package/src/utils/node.ts +110 -0
  268. package/src/utils/pub_key.ts +12 -0
  269. package/src/wallet/account_entrypoint_meta_payment_method.ts +76 -0
  270. package/src/wallet/account_manager.ts +164 -0
  271. package/src/wallet/capabilities.ts +505 -0
  272. package/src/wallet/deploy_account_method.ts +234 -0
  273. package/src/wallet/index.ts +4 -0
  274. package/src/wallet/tx_simulation_result_with_app_offset.ts +100 -0
  275. package/src/wallet/wallet.ts +668 -0
@@ -0,0 +1,241 @@
1
+ /* Autogenerated file, do not edit! */
2
+ /* eslint-disable */
3
+ import { ProtocolContractAddress } from '@aztec-labs/protocol-contracts';
4
+ import { FunctionType } from '@aztec-labs/stdlib/abi';
5
+
6
+ import type { ContractArtifact } from '../../api/abi.js';
7
+ import { PublicKeys } from '../../api/keys.js';
8
+ import type {
9
+ AztecAddressLike,
10
+ EthAddressLike,
11
+ FieldLike,
12
+ FunctionSelectorLike,
13
+ OptionLike,
14
+ WrappedFieldLike,
15
+ } from '../../utils/abi_types.js';
16
+ import type { Wallet } from '../../wallet/wallet.js';
17
+ import { ContractBase, type ContractMethod } from '../contract_base.js';
18
+ import { ContractFunctionInteraction } from '../contract_function_interaction.js';
19
+
20
+ const ContractInstanceRegistryContractArtifact: ContractArtifact = {
21
+ name: 'ContractInstanceRegistry',
22
+ aztecVersion: '6.0.0-nightly.20260826',
23
+ functions: [
24
+ {
25
+ ...{
26
+ functionType: FunctionType.PUBLIC,
27
+ name: 'public_dispatch',
28
+ isOnlySelf: false,
29
+ isStatic: false,
30
+ isInitializer: false,
31
+ parameters: [{ name: 'selector', type: { kind: 'field' }, visibility: 'private' }],
32
+ errorTypes: {
33
+ '11194752367584870169': { error_kind: 'fmtstring', length: 27, item_types: [{ kind: 'field' }] },
34
+ '12469291177396340830': { error_kind: 'string', string: 'call to assert_max_bit_size' },
35
+ '12579274401768182412': { error_kind: 'string', string: 'New contract class is not registered' },
36
+ '13455385521185560676': {
37
+ error_kind: 'string',
38
+ string: 'Storage slot 0 not allowed. Storage slots must start from 1.',
39
+ },
40
+ '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
41
+ '15353471697975175405': { error_kind: 'string', string: 'msg.sender is not deployed' },
42
+ '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
43
+ '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
44
+ '5755400808989454547': {
45
+ error_kind: 'string',
46
+ string: 'Function get_update_delay can only be called statically',
47
+ },
48
+ '6804164082532189961': { error_kind: 'string', string: 'New update delay is too low' },
49
+ },
50
+ },
51
+ bytecode: Buffer.from([]),
52
+ debugSymbols: '',
53
+ },
54
+ {
55
+ ...{
56
+ functionType: FunctionType.PRIVATE,
57
+ name: 'publish_for_public_execution',
58
+ isOnlySelf: false,
59
+ isStatic: false,
60
+ isInitializer: false,
61
+ parameters: [
62
+ { name: 'salt', type: { kind: 'field' }, visibility: 'private' },
63
+ {
64
+ name: 'contract_class_id',
65
+ type: {
66
+ kind: 'struct',
67
+ fields: [{ name: 'inner', type: { kind: 'field' } }],
68
+ path: 'aztec::protocol_types::contract_class_id::ContractClassId',
69
+ },
70
+ visibility: 'private',
71
+ },
72
+ { name: 'initialization_hash', type: { kind: 'field' }, visibility: 'private' },
73
+ { name: 'immutables_hash', type: { kind: 'field' }, visibility: 'private' },
74
+ {
75
+ name: 'public_keys',
76
+ type: {
77
+ kind: 'struct',
78
+ fields: [
79
+ { name: 'npk_m_hash', type: { kind: 'field' } },
80
+ {
81
+ name: 'ivpk_m',
82
+ type: {
83
+ kind: 'struct',
84
+ fields: [
85
+ {
86
+ name: 'inner',
87
+ type: {
88
+ kind: 'struct',
89
+ fields: [
90
+ { name: 'x', type: { kind: 'field' } },
91
+ { name: 'y', type: { kind: 'field' } },
92
+ ],
93
+ path: 'std::embedded_curve_ops::EmbeddedCurvePoint',
94
+ },
95
+ },
96
+ ],
97
+ path: 'aztec::protocol_types::public_keys::IvpkM',
98
+ },
99
+ },
100
+ { name: 'ovpk_m_hash', type: { kind: 'field' } },
101
+ { name: 'tpk_m_hash', type: { kind: 'field' } },
102
+ { name: 'mspk_m_hash', type: { kind: 'field' } },
103
+ { name: 'fbpk_m_hash', type: { kind: 'field' } },
104
+ ],
105
+ path: 'aztec::protocol_types::public_keys::PublicKeys',
106
+ },
107
+ visibility: 'private',
108
+ },
109
+ { name: 'universal_deploy', type: { kind: 'boolean' }, visibility: 'private' },
110
+ ],
111
+ errorTypes: {
112
+ '12469291177396340830': { error_kind: 'string', string: 'call to assert_max_bit_size' },
113
+ '14483585040754951598': { error_kind: 'string', string: 'IvpkM is the point at infinity' },
114
+ '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
115
+ '718532354304118388': { error_kind: 'string', string: 'Point not on curve' },
116
+ },
117
+ },
118
+ bytecode: Buffer.from([]),
119
+ debugSymbols: '',
120
+ },
121
+ ],
122
+ nonDispatchPublicFunctions: [
123
+ {
124
+ functionType: FunctionType.PUBLIC,
125
+ name: 'get_update_delay',
126
+ isOnlySelf: false,
127
+ isStatic: true,
128
+ isInitializer: false,
129
+ parameters: [],
130
+ returnType: { kind: 'integer', sign: 'unsigned', width: 64 },
131
+ errorTypes: {
132
+ '13455385521185560676': {
133
+ error_kind: 'string',
134
+ string: 'Storage slot 0 not allowed. Storage slots must start from 1.',
135
+ },
136
+ '5755400808989454547': {
137
+ error_kind: 'string',
138
+ string: 'Function get_update_delay can only be called statically',
139
+ },
140
+ },
141
+ },
142
+ {
143
+ functionType: FunctionType.PUBLIC,
144
+ name: 'set_update_delay',
145
+ isOnlySelf: false,
146
+ isStatic: false,
147
+ isInitializer: false,
148
+ parameters: [
149
+ { name: 'new_update_delay', type: { kind: 'integer', sign: 'unsigned', width: 64 }, visibility: 'private' },
150
+ ],
151
+ errorTypes: {
152
+ '12469291177396340830': { error_kind: 'string', string: 'call to assert_max_bit_size' },
153
+ '13455385521185560676': {
154
+ error_kind: 'string',
155
+ string: 'Storage slot 0 not allowed. Storage slots must start from 1.',
156
+ },
157
+ '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
158
+ '15353471697975175405': { error_kind: 'string', string: 'msg.sender is not deployed' },
159
+ '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
160
+ '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
161
+ '6804164082532189961': { error_kind: 'string', string: 'New update delay is too low' },
162
+ },
163
+ },
164
+ {
165
+ functionType: FunctionType.PUBLIC,
166
+ name: 'update',
167
+ isOnlySelf: false,
168
+ isStatic: false,
169
+ isInitializer: false,
170
+ parameters: [
171
+ {
172
+ name: 'new_contract_class_id',
173
+ type: {
174
+ kind: 'struct',
175
+ fields: [{ name: 'inner', type: { kind: 'field' } }],
176
+ path: 'aztec::protocol_types::contract_class_id::ContractClassId',
177
+ },
178
+ visibility: 'private',
179
+ },
180
+ ],
181
+ errorTypes: {
182
+ '12469291177396340830': { error_kind: 'string', string: 'call to assert_max_bit_size' },
183
+ '12579274401768182412': { error_kind: 'string', string: 'New contract class is not registered' },
184
+ '13455385521185560676': {
185
+ error_kind: 'string',
186
+ string: 'Storage slot 0 not allowed. Storage slots must start from 1.',
187
+ },
188
+ '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
189
+ '15353471697975175405': { error_kind: 'string', string: 'msg.sender is not deployed' },
190
+ '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
191
+ '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
192
+ },
193
+ },
194
+ ],
195
+ outputs: { structs: {}, globals: {} },
196
+ storageLayout: {},
197
+ fileMap: {},
198
+ };
199
+
200
+ export class ContractInstanceRegistryContract extends ContractBase {
201
+ private constructor(wallet: Wallet) {
202
+ super(ProtocolContractAddress.ContractInstanceRegistry, ContractInstanceRegistryContractArtifact, wallet);
203
+ }
204
+
205
+ /** Returns an interface to the canonical ContractInstanceRegistryContract instance, bound to the given wallet. */
206
+ public static withWallet(wallet: Wallet): ContractInstanceRegistryContract {
207
+ return new ContractInstanceRegistryContract(wallet);
208
+ }
209
+
210
+ /** @deprecated Use `withWallet` instead. */
211
+ public static at(wallet: Wallet): ContractInstanceRegistryContract {
212
+ return ContractInstanceRegistryContract.withWallet(wallet);
213
+ }
214
+
215
+ declare public methods: {
216
+ /** get_update_delay() */
217
+ get_update_delay: (() => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
218
+
219
+ /** public_dispatch(selector: field) */
220
+ public_dispatch: ((selector: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
221
+
222
+ /** publish_for_public_execution(salt: field, contract_class_id: struct, initialization_hash: field, immutables_hash: field, public_keys: struct, universal_deploy: boolean) */
223
+ publish_for_public_execution: ((
224
+ salt: FieldLike,
225
+ contract_class_id: WrappedFieldLike,
226
+ initialization_hash: FieldLike,
227
+ immutables_hash: FieldLike,
228
+ public_keys: PublicKeys,
229
+ universal_deploy: boolean,
230
+ ) => ContractFunctionInteraction) &
231
+ Pick<ContractMethod, 'selector'>;
232
+
233
+ /** set_update_delay(new_update_delay: integer) */
234
+ set_update_delay: ((new_update_delay: bigint | number) => ContractFunctionInteraction) &
235
+ Pick<ContractMethod, 'selector'>;
236
+
237
+ /** update(new_contract_class_id: struct) */
238
+ update: ((new_contract_class_id: WrappedFieldLike) => ContractFunctionInteraction) &
239
+ Pick<ContractMethod, 'selector'>;
240
+ };
241
+ }
@@ -0,0 +1,257 @@
1
+ /* Autogenerated file, do not edit! */
2
+ /* eslint-disable */
3
+ import { ProtocolContractAddress } from '@aztec-labs/protocol-contracts';
4
+ import { FunctionType } from '@aztec-labs/stdlib/abi';
5
+
6
+ import type { ContractArtifact } from '../../api/abi.js';
7
+ import { PublicKeys } from '../../api/keys.js';
8
+ import type {
9
+ AztecAddressLike,
10
+ EthAddressLike,
11
+ FieldLike,
12
+ FunctionSelectorLike,
13
+ OptionLike,
14
+ WrappedFieldLike,
15
+ } from '../../utils/abi_types.js';
16
+ import type { Wallet } from '../../wallet/wallet.js';
17
+ import { ContractBase, type ContractMethod } from '../contract_base.js';
18
+ import { ContractFunctionInteraction } from '../contract_function_interaction.js';
19
+
20
+ const FeeJuiceContractArtifact: ContractArtifact = {
21
+ name: 'FeeJuice',
22
+ aztecVersion: '6.0.0-nightly.20260826',
23
+ functions: [
24
+ {
25
+ ...{
26
+ functionType: FunctionType.PRIVATE,
27
+ name: 'claim',
28
+ isOnlySelf: false,
29
+ isStatic: false,
30
+ isInitializer: false,
31
+ parameters: [
32
+ {
33
+ name: 'to',
34
+ type: {
35
+ kind: 'struct',
36
+ fields: [{ name: 'inner', type: { kind: 'field' } }],
37
+ path: 'aztec::protocol_types::address::aztec_address::AztecAddress',
38
+ },
39
+ visibility: 'private',
40
+ },
41
+ { name: 'amount', type: { kind: 'integer', sign: 'unsigned', width: 128 }, visibility: 'private' },
42
+ { name: 'secret', type: { kind: 'field' }, visibility: 'private' },
43
+ { name: 'message_leaf_index', type: { kind: 'field' }, visibility: 'private' },
44
+ ],
45
+ errorTypes: {
46
+ '11019205087382408538': { error_kind: 'string', string: 'Field failed to decompose into specified 4 limbs' },
47
+ '12370419938245003393': { error_kind: 'string', string: 'Field failed to decompose into specified 36 limbs' },
48
+ '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
49
+ '15835548349546956319': { error_kind: 'string', string: 'Field failed to decompose into specified 32 limbs' },
50
+ '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
51
+ '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
52
+ '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
53
+ '5421095327929394772': { error_kind: 'string', string: 'attempt to bit-shift with overflow' },
54
+ '6609888949476313245': { error_kind: 'string', string: 'Message not in state' },
55
+ },
56
+ },
57
+ bytecode: Buffer.from([]),
58
+ debugSymbols: '',
59
+ },
60
+ {
61
+ ...{
62
+ functionType: FunctionType.PRIVATE,
63
+ name: 'claim_and_end_setup',
64
+ isOnlySelf: false,
65
+ isStatic: false,
66
+ isInitializer: false,
67
+ parameters: [
68
+ {
69
+ name: 'to',
70
+ type: {
71
+ kind: 'struct',
72
+ fields: [{ name: 'inner', type: { kind: 'field' } }],
73
+ path: 'aztec::protocol_types::address::aztec_address::AztecAddress',
74
+ },
75
+ visibility: 'private',
76
+ },
77
+ { name: 'amount', type: { kind: 'integer', sign: 'unsigned', width: 128 }, visibility: 'private' },
78
+ { name: 'secret', type: { kind: 'field' }, visibility: 'private' },
79
+ { name: 'message_leaf_index', type: { kind: 'field' }, visibility: 'private' },
80
+ ],
81
+ errorTypes: {
82
+ '11019205087382408538': { error_kind: 'string', string: 'Field failed to decompose into specified 4 limbs' },
83
+ '12370419938245003393': { error_kind: 'string', string: 'Field failed to decompose into specified 36 limbs' },
84
+ '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
85
+ '15835548349546956319': { error_kind: 'string', string: 'Field failed to decompose into specified 32 limbs' },
86
+ '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
87
+ '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
88
+ '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
89
+ '5421095327929394772': { error_kind: 'string', string: 'attempt to bit-shift with overflow' },
90
+ '6609888949476313245': { error_kind: 'string', string: 'Message not in state' },
91
+ },
92
+ },
93
+ bytecode: Buffer.from([]),
94
+ debugSymbols: '',
95
+ },
96
+ {
97
+ ...{
98
+ functionType: FunctionType.PUBLIC,
99
+ name: 'public_dispatch',
100
+ isOnlySelf: false,
101
+ isStatic: false,
102
+ isInitializer: false,
103
+ parameters: [{ name: 'selector', type: { kind: 'field' }, visibility: 'private' }],
104
+ errorTypes: {
105
+ '1080336462466469436': {
106
+ error_kind: 'string',
107
+ string: 'Function check_balance can only be called statically',
108
+ },
109
+ '11194752367584870169': { error_kind: 'fmtstring', length: 27, item_types: [{ kind: 'field' }] },
110
+ '13455385521185560676': {
111
+ error_kind: 'string',
112
+ string: 'Storage slot 0 not allowed. Storage slots must start from 1.',
113
+ },
114
+ '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
115
+ '15860392472534760515': {
116
+ error_kind: 'string',
117
+ string: 'Function balance_of_public can only be called statically',
118
+ },
119
+ '8637882143979902881': {
120
+ error_kind: 'string',
121
+ string: 'Function _increase_public_balance can only be called by the same contract',
122
+ },
123
+ '9543832133280402246': { error_kind: 'string', string: 'Balance too low' },
124
+ },
125
+ },
126
+ bytecode: Buffer.from([]),
127
+ debugSymbols: '',
128
+ },
129
+ ],
130
+ nonDispatchPublicFunctions: [
131
+ {
132
+ functionType: FunctionType.PUBLIC,
133
+ name: '_increase_public_balance',
134
+ isOnlySelf: true,
135
+ isStatic: false,
136
+ isInitializer: false,
137
+ parameters: [
138
+ {
139
+ name: 'to',
140
+ type: {
141
+ kind: 'struct',
142
+ fields: [{ name: 'inner', type: { kind: 'field' } }],
143
+ path: 'aztec::protocol_types::address::aztec_address::AztecAddress',
144
+ },
145
+ visibility: 'private',
146
+ },
147
+ { name: 'amount', type: { kind: 'integer', sign: 'unsigned', width: 128 }, visibility: 'private' },
148
+ ],
149
+ errorTypes: {
150
+ '13455385521185560676': {
151
+ error_kind: 'string',
152
+ string: 'Storage slot 0 not allowed. Storage slots must start from 1.',
153
+ },
154
+ '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
155
+ '8637882143979902881': {
156
+ error_kind: 'string',
157
+ string: 'Function _increase_public_balance can only be called by the same contract',
158
+ },
159
+ },
160
+ },
161
+ {
162
+ functionType: FunctionType.PUBLIC,
163
+ name: 'balance_of_public',
164
+ isOnlySelf: false,
165
+ isStatic: true,
166
+ isInitializer: false,
167
+ parameters: [
168
+ {
169
+ name: 'owner',
170
+ type: {
171
+ kind: 'struct',
172
+ fields: [{ name: 'inner', type: { kind: 'field' } }],
173
+ path: 'aztec::protocol_types::address::aztec_address::AztecAddress',
174
+ },
175
+ visibility: 'private',
176
+ },
177
+ ],
178
+ returnType: { kind: 'integer', sign: 'unsigned', width: 128 },
179
+ errorTypes: {
180
+ '13455385521185560676': {
181
+ error_kind: 'string',
182
+ string: 'Storage slot 0 not allowed. Storage slots must start from 1.',
183
+ },
184
+ '15860392472534760515': {
185
+ error_kind: 'string',
186
+ string: 'Function balance_of_public can only be called statically',
187
+ },
188
+ },
189
+ },
190
+ {
191
+ functionType: FunctionType.PUBLIC,
192
+ name: 'check_balance',
193
+ isOnlySelf: false,
194
+ isStatic: true,
195
+ isInitializer: false,
196
+ parameters: [
197
+ { name: 'fee_limit', type: { kind: 'integer', sign: 'unsigned', width: 128 }, visibility: 'private' },
198
+ ],
199
+ errorTypes: {
200
+ '1080336462466469436': { error_kind: 'string', string: 'Function check_balance can only be called statically' },
201
+ '13455385521185560676': {
202
+ error_kind: 'string',
203
+ string: 'Storage slot 0 not allowed. Storage slots must start from 1.',
204
+ },
205
+ '9543832133280402246': { error_kind: 'string', string: 'Balance too low' },
206
+ },
207
+ },
208
+ ],
209
+ outputs: { structs: {}, globals: {} },
210
+ storageLayout: {},
211
+ fileMap: {},
212
+ };
213
+
214
+ export class FeeJuiceContract extends ContractBase {
215
+ private constructor(wallet: Wallet) {
216
+ super(ProtocolContractAddress.FeeJuice, FeeJuiceContractArtifact, wallet);
217
+ }
218
+
219
+ /** Returns an interface to the canonical FeeJuiceContract instance, bound to the given wallet. */
220
+ public static withWallet(wallet: Wallet): FeeJuiceContract {
221
+ return new FeeJuiceContract(wallet);
222
+ }
223
+
224
+ /** @deprecated Use `withWallet` instead. */
225
+ public static at(wallet: Wallet): FeeJuiceContract {
226
+ return FeeJuiceContract.withWallet(wallet);
227
+ }
228
+
229
+ declare public methods: {
230
+ /** balance_of_public(owner: struct) */
231
+ balance_of_public: ((owner: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
232
+
233
+ /** check_balance(fee_limit: integer) */
234
+ check_balance: ((fee_limit: bigint | number) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
235
+
236
+ /** claim(to: struct, amount: integer, secret: field, message_leaf_index: field) */
237
+ claim: ((
238
+ to: AztecAddressLike,
239
+ amount: bigint | number,
240
+ secret: FieldLike,
241
+ message_leaf_index: FieldLike,
242
+ ) => ContractFunctionInteraction) &
243
+ Pick<ContractMethod, 'selector'>;
244
+
245
+ /** claim_and_end_setup(to: struct, amount: integer, secret: field, message_leaf_index: field) */
246
+ claim_and_end_setup: ((
247
+ to: AztecAddressLike,
248
+ amount: bigint | number,
249
+ secret: FieldLike,
250
+ message_leaf_index: FieldLike,
251
+ ) => ContractFunctionInteraction) &
252
+ Pick<ContractMethod, 'selector'>;
253
+
254
+ /** public_dispatch(selector: field) */
255
+ public_dispatch: ((selector: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
256
+ };
257
+ }
@@ -0,0 +1,43 @@
1
+ import type { BlockNumber } from '@aztec-labs/foundation/branded-types';
2
+ import { retryUntil } from '@aztec-labs/foundation/retry';
3
+ import type { AztecNode } from '@aztec-labs/stdlib/interfaces/client';
4
+ import type { TxReceipt } from '@aztec-labs/stdlib/tx';
5
+
6
+ import { DefaultWaitOpts } from './wait_opts.js';
7
+
8
+ /**
9
+ * Options for waiting for a transaction to be proven.
10
+ */
11
+ export type WaitForProvenOpts = {
12
+ /** Time to wait for the tx to be proven before timing out */
13
+ provenTimeout?: number;
14
+ /** Elapsed time between polls to the node */
15
+ interval?: number;
16
+ };
17
+
18
+ export const DefaultWaitForProvenOpts: WaitForProvenOpts = {
19
+ provenTimeout: 600,
20
+ interval: DefaultWaitOpts.interval,
21
+ };
22
+
23
+ /**
24
+ * Wait for a transaction to be proven by polling the node
25
+ */
26
+ export async function waitForProven(
27
+ node: AztecNode,
28
+ receipt: TxReceipt,
29
+ opts?: WaitForProvenOpts,
30
+ ): Promise<BlockNumber> {
31
+ if (!receipt.blockNumber) {
32
+ throw new Error(`Cannot wait for proven: receipt of tx ${receipt.txHash} does not have a block number`);
33
+ }
34
+ return await retryUntil(
35
+ async () => {
36
+ const provenBlock = await node.getBlockNumber('proven');
37
+ return provenBlock >= receipt.blockNumber! ? provenBlock : undefined;
38
+ },
39
+ 'isProven',
40
+ opts?.provenTimeout ?? DefaultWaitForProvenOpts.provenTimeout,
41
+ opts?.interval ?? DefaultWaitForProvenOpts.interval,
42
+ );
43
+ }
@@ -0,0 +1,26 @@
1
+ import type { TxStatus } from '@aztec-labs/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 300 (5 min). */
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
+ * The time (in seconds) to wait before the first receipt poll. Defaults to 0. Used to avoid checking for a receipt
17
+ * right after sending a tx, when we know it cannot have been mined yet. Counts against `timeout`.
18
+ */
19
+ initialDelay?: number;
20
+ };
21
+
22
+ export const DefaultWaitOpts: WaitOpts = {
23
+ ignoreDroppedReceiptsFor: 5,
24
+ timeout: 300,
25
+ interval: 1,
26
+ };
@@ -0,0 +1,40 @@
1
+ import type { ContractArtifact } from '@aztec-labs/stdlib/abi';
2
+ import type { ContractInstanceWithAddress } from '@aztec-labs/stdlib/contract';
3
+
4
+ import { Contract } from '../contract/contract.js';
5
+ import { type DeployInstantiationOptions, DeployMethod } from '../contract/deploy_method.js';
6
+ import type { Wallet } from '../wallet/wallet.js';
7
+
8
+ /**
9
+ * A class for deploying contract.
10
+ * @remarks Keeping this around even though we have Aztec.nr contract types because it can be useful for non-TS users.
11
+ */
12
+ export class ContractDeployer {
13
+ constructor(
14
+ private artifact: ContractArtifact,
15
+ private wallet: Wallet,
16
+ private constructorName?: string,
17
+ ) {}
18
+
19
+ /**
20
+ * Deploy a contract using the provided instantiation parameters and constructor arguments.
21
+ * Creates a new DeployMethod instance that can be used to send the deployment transaction.
22
+ *
23
+ * The first argument is the {@link DeployInstantiationOptions} (salt, deployer) — pass `{}` to
24
+ * accept defaults (random salt, deployer = AztecAddress.ZERO). The remaining arguments are the
25
+ * constructor arguments for the contract.
26
+ *
27
+ * @param instantiation - Salt and deployer to mix into the address derivation.
28
+ * @param args - The constructor arguments for the contract being deployed.
29
+ * @returns A DeployMethod instance configured with the ABI, PXE, and constructor arguments.
30
+ */
31
+ public deploy(args?: any[], instantiation?: DeployInstantiationOptions) {
32
+ const postDeployCtor = (instance: ContractInstanceWithAddress, wallet: Wallet) =>
33
+ Contract.at(instance.address, this.artifact, wallet);
34
+ return DeployMethod.create(
35
+ this.wallet,
36
+ { artifact: this.artifact, postDeployCtor, args, constructorNameOrArtifact: this.constructorName },
37
+ instantiation,
38
+ );
39
+ }
40
+ }
@@ -0,0 +1,34 @@
1
+ import {
2
+ CONTRACT_CLASS_REGISTRY_BYTECODE_CAPSULE_SLOT,
3
+ MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS,
4
+ } from '@aztec-labs/constants';
5
+ import { Fr } from '@aztec-labs/foundation/curves/bn254';
6
+ import { ProtocolContractAddress } from '@aztec-labs/protocol-contracts';
7
+ import { type ContractArtifact, bufferAsFields } from '@aztec-labs/stdlib/abi';
8
+ import { getContractClassFromArtifact } from '@aztec-labs/stdlib/contract';
9
+ import { Capsule } from '@aztec-labs/stdlib/tx';
10
+
11
+ import type { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
12
+ import { ContractClassRegistryContract } from '../contract/protocol_contracts/contract-class-registry.js';
13
+ import type { Wallet } from '../wallet/index.js';
14
+
15
+ /** Sets up a call to publish a contract class given its artifact. */
16
+ export async function publishContractClass(
17
+ wallet: Wallet,
18
+ artifact: ContractArtifact,
19
+ ): Promise<ContractFunctionInteraction> {
20
+ const { artifactHash, privateFunctionsRoot, publicBytecodeCommitment, packedBytecode } =
21
+ await getContractClassFromArtifact(artifact);
22
+ const classRegistry = ContractClassRegistryContract.withWallet(wallet);
23
+
24
+ const encodedBytecode = bufferAsFields(packedBytecode, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS);
25
+ return classRegistry.methods.publish(artifactHash, privateFunctionsRoot, publicBytecodeCommitment).with({
26
+ capsules: [
27
+ new Capsule(
28
+ ProtocolContractAddress.ContractClassRegistry,
29
+ new Fr(CONTRACT_CLASS_REGISTRY_BYTECODE_CAPSULE_SLOT),
30
+ encodedBytecode,
31
+ ),
32
+ ],
33
+ });
34
+ }
@@ -0,0 +1,24 @@
1
+ import type { ContractInstanceWithAddress } from '@aztec-labs/stdlib/contract';
2
+
3
+ import type { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
4
+ import { ContractInstanceRegistryContract } from '../contract/protocol_contracts/contract-instance-registry.js';
5
+ import type { Wallet } from '../wallet/wallet.js';
6
+
7
+ /**
8
+ * Sets up a call to the canonical contract instance registry to publish a contract instance.
9
+ * @param wallet - The wallet to use for the publication (setup) tx.
10
+ * @param instance - The instance to publish.
11
+ */
12
+ export function publishInstance(wallet: Wallet, instance: ContractInstanceWithAddress): ContractFunctionInteraction {
13
+ const contractInstanceRegistry = ContractInstanceRegistryContract.withWallet(wallet);
14
+ const { salt, currentContractClassId: contractClassId, publicKeys, deployer: instanceDeployer } = instance;
15
+ const isUniversalDeploy = instanceDeployer.isZero();
16
+ return contractInstanceRegistry.methods.publish_for_public_execution(
17
+ salt,
18
+ contractClassId,
19
+ instance.initializationHash,
20
+ instance.immutablesHash,
21
+ publicKeys,
22
+ isUniversalDeploy,
23
+ );
24
+ }