@aztec/aztec.js 0.0.1-commit.b655e406 → 0.0.1-commit.c0b82b2

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 (261) hide show
  1. package/dest/account/account.d.ts +26 -42
  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 +20 -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 +7 -9
  13. package/dest/account/signerless_account.d.ts.map +1 -1
  14. package/dest/account/signerless_account.js +8 -11
  15. package/dest/api/abi.d.ts +1 -1
  16. package/dest/api/account.d.ts +3 -4
  17. package/dest/api/account.d.ts.map +1 -1
  18. package/dest/api/account.js +2 -3
  19. package/dest/api/addresses.d.ts +1 -1
  20. package/dest/api/authorization.d.ts +2 -2
  21. package/dest/api/authorization.d.ts.map +1 -1
  22. package/dest/api/authorization.js +1 -1
  23. package/dest/api/block.d.ts +1 -1
  24. package/dest/api/contract.d.ts +19 -13
  25. package/dest/api/contract.d.ts.map +1 -1
  26. package/dest/api/contract.js +17 -11
  27. package/dest/api/crypto.d.ts +1 -1
  28. package/dest/api/deployment.d.ts +1 -2
  29. package/dest/api/deployment.d.ts.map +1 -1
  30. package/dest/api/deployment.js +0 -1
  31. package/dest/api/eth_address.d.ts +1 -1
  32. package/dest/api/ethereum.d.ts +1 -1
  33. package/dest/api/events.d.ts +10 -6
  34. package/dest/api/events.d.ts.map +1 -1
  35. package/dest/api/events.js +30 -20
  36. package/dest/api/fee.d.ts +1 -1
  37. package/dest/api/fee_testing.d.ts +1 -1
  38. package/dest/api/fields.d.ts +4 -2
  39. package/dest/api/fields.d.ts.map +1 -1
  40. package/dest/api/fields.js +3 -1
  41. package/dest/api/keys.d.ts +2 -2
  42. package/dest/api/keys.js +1 -1
  43. package/dest/api/log.d.ts +1 -1
  44. package/dest/api/messaging.d.ts +1 -1
  45. package/dest/api/node.d.ts +8 -4
  46. package/dest/api/node.d.ts.map +1 -1
  47. package/dest/api/node.js +7 -3
  48. package/dest/api/note.d.ts +2 -2
  49. package/dest/api/note.d.ts.map +1 -1
  50. package/dest/api/note.js +1 -1
  51. package/dest/api/protocol.d.ts +7 -1
  52. package/dest/api/protocol.d.ts.map +1 -1
  53. package/dest/api/protocol.js +6 -0
  54. package/dest/api/trees.d.ts +1 -1
  55. package/dest/api/tx.d.ts +2 -2
  56. package/dest/api/tx.d.ts.map +1 -1
  57. package/dest/api/tx.js +1 -1
  58. package/dest/api/utils.d.ts +1 -1
  59. package/dest/api/wallet.d.ts +3 -3
  60. package/dest/api/wallet.d.ts.map +1 -1
  61. package/dest/api/wallet.js +2 -2
  62. package/dest/authorization/call_authorization_request.d.ts +2 -2
  63. package/dest/authorization/call_authorization_request.d.ts.map +1 -1
  64. package/dest/contract/base_contract_interaction.d.ts +8 -11
  65. package/dest/contract/base_contract_interaction.d.ts.map +1 -1
  66. package/dest/contract/base_contract_interaction.js +5 -17
  67. package/dest/contract/batch_call.d.ts +8 -9
  68. package/dest/contract/batch_call.d.ts.map +1 -1
  69. package/dest/contract/batch_call.js +59 -36
  70. package/dest/contract/checker.d.ts +1 -1
  71. package/dest/contract/contract.d.ts +2 -2
  72. package/dest/contract/contract.d.ts.map +1 -1
  73. package/dest/contract/contract.js +4 -5
  74. package/dest/contract/contract_base.d.ts +6 -10
  75. package/dest/contract/contract_base.d.ts.map +1 -1
  76. package/dest/contract/contract_base.js +5 -12
  77. package/dest/contract/contract_function_interaction.d.ts +5 -14
  78. package/dest/contract/contract_function_interaction.d.ts.map +1 -1
  79. package/dest/contract/contract_function_interaction.js +18 -12
  80. package/dest/contract/deploy_method.d.ts +85 -24
  81. package/dest/contract/deploy_method.d.ts.map +1 -1
  82. package/dest/contract/deploy_method.js +71 -36
  83. package/dest/contract/get_gas_limits.d.ts +1 -1
  84. package/dest/contract/get_gas_limits.js +3 -3
  85. package/dest/contract/interaction_options.d.ts +51 -7
  86. package/dest/contract/interaction_options.d.ts.map +1 -1
  87. package/dest/contract/interaction_options.js +12 -11
  88. package/dest/contract/protocol_contracts/auth-registry.d.ts +36 -0
  89. package/dest/contract/protocol_contracts/auth-registry.d.ts.map +1 -0
  90. package/dest/contract/protocol_contracts/auth-registry.js +1005 -0
  91. package/dest/contract/protocol_contracts/contract-class-registry.d.ts +15 -0
  92. package/dest/contract/protocol_contracts/contract-class-registry.d.ts.map +1 -0
  93. package/dest/contract/protocol_contracts/contract-class-registry.js +139 -0
  94. package/dest/contract/protocol_contracts/contract-instance-registry.d.ts +22 -0
  95. package/dest/contract/protocol_contracts/contract-instance-registry.d.ts.map +1 -0
  96. package/dest/contract/protocol_contracts/contract-instance-registry.js +465 -0
  97. package/dest/contract/protocol_contracts/fee-juice.d.ts +21 -0
  98. package/dest/contract/protocol_contracts/fee-juice.d.ts.map +1 -0
  99. package/dest/contract/protocol_contracts/fee-juice.js +434 -0
  100. package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts +34 -0
  101. package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts.map +1 -0
  102. package/dest/contract/protocol_contracts/multi-call-entrypoint.js +601 -0
  103. package/dest/contract/protocol_contracts/public-checks.d.ts +26 -0
  104. package/dest/contract/protocol_contracts/public-checks.d.ts.map +1 -0
  105. package/dest/contract/protocol_contracts/public-checks.js +609 -0
  106. package/dest/contract/wait_for_proven.d.ts +2 -2
  107. package/dest/contract/wait_for_proven.d.ts.map +1 -1
  108. package/dest/contract/wait_for_proven.js +1 -1
  109. package/dest/contract/wait_opts.d.ts +16 -0
  110. package/dest/contract/wait_opts.d.ts.map +1 -0
  111. package/dest/contract/wait_opts.js +5 -0
  112. package/dest/deployment/contract_deployer.d.ts +1 -1
  113. package/dest/deployment/contract_deployer.d.ts.map +1 -1
  114. package/dest/deployment/contract_deployer.js +1 -1
  115. package/dest/deployment/publish_class.d.ts +1 -1
  116. package/dest/deployment/publish_class.js +3 -3
  117. package/dest/deployment/publish_instance.d.ts +2 -2
  118. package/dest/deployment/publish_instance.d.ts.map +1 -1
  119. package/dest/deployment/publish_instance.js +3 -3
  120. package/dest/ethereum/portal_manager.d.ts +7 -6
  121. package/dest/ethereum/portal_manager.d.ts.map +1 -1
  122. package/dest/ethereum/portal_manager.js +48 -22
  123. package/dest/fee/fee_juice_payment_method_with_claim.d.ts +2 -2
  124. package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -1
  125. package/dest/fee/fee_juice_payment_method_with_claim.js +9 -9
  126. package/dest/fee/fee_payment_method.d.ts +2 -2
  127. package/dest/fee/fee_payment_method.d.ts.map +1 -1
  128. package/dest/fee/private_fee_payment_method.d.ts +2 -2
  129. package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
  130. package/dest/fee/private_fee_payment_method.js +14 -14
  131. package/dest/fee/public_fee_payment_method.d.ts +2 -2
  132. package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
  133. package/dest/fee/public_fee_payment_method.js +14 -14
  134. package/dest/fee/sponsored_fee_payment.d.ts +2 -2
  135. package/dest/fee/sponsored_fee_payment.d.ts.map +1 -1
  136. package/dest/fee/sponsored_fee_payment.js +5 -5
  137. package/dest/scripts/generate_protocol_contract_types.d.ts +2 -0
  138. package/dest/scripts/generate_protocol_contract_types.d.ts.map +1 -0
  139. package/dest/scripts/generate_protocol_contract_types.js +120 -0
  140. package/dest/utils/abi_types.d.ts +2 -2
  141. package/dest/utils/abi_types.d.ts.map +1 -1
  142. package/dest/utils/authwit.d.ts +14 -12
  143. package/dest/utils/authwit.d.ts.map +1 -1
  144. package/dest/utils/authwit.js +27 -20
  145. package/dest/utils/cross_chain.d.ts +2 -2
  146. package/dest/utils/cross_chain.d.ts.map +1 -1
  147. package/dest/utils/fee_juice.d.ts +2 -2
  148. package/dest/utils/fee_juice.js +2 -2
  149. package/dest/utils/field_compressed_string.d.ts +1 -1
  150. package/dest/utils/field_compressed_string.d.ts.map +1 -1
  151. package/dest/utils/field_compressed_string.js +1 -1
  152. package/dest/utils/node.d.ts +13 -2
  153. package/dest/utils/node.d.ts.map +1 -1
  154. package/dest/utils/node.js +46 -0
  155. package/dest/utils/pub_key.d.ts +2 -2
  156. package/dest/utils/pub_key.d.ts.map +1 -1
  157. package/dest/utils/pub_key.js +1 -1
  158. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts +6 -9
  159. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -1
  160. package/dest/wallet/account_entrypoint_meta_payment_method.js +29 -44
  161. package/dest/wallet/account_manager.d.ts +3 -9
  162. package/dest/wallet/account_manager.d.ts.map +1 -1
  163. package/dest/wallet/account_manager.js +6 -12
  164. package/dest/wallet/capabilities.d.ts +452 -0
  165. package/dest/wallet/capabilities.d.ts.map +1 -0
  166. package/dest/wallet/capabilities.js +3 -0
  167. package/dest/wallet/deploy_account_method.d.ts +49 -10
  168. package/dest/wallet/deploy_account_method.d.ts.map +1 -1
  169. package/dest/wallet/deploy_account_method.js +35 -7
  170. package/dest/wallet/index.d.ts +2 -2
  171. package/dest/wallet/index.d.ts.map +1 -1
  172. package/dest/wallet/index.js +1 -1
  173. package/dest/wallet/wallet.d.ts +1853 -1533
  174. package/dest/wallet/wallet.d.ts.map +1 -1
  175. package/dest/wallet/wallet.js +223 -124
  176. package/package.json +27 -15
  177. package/src/account/account.ts +35 -60
  178. package/src/account/account_contract.ts +7 -8
  179. package/src/account/account_with_secret_key.ts +34 -9
  180. package/src/account/index.ts +3 -2
  181. package/src/account/signerless_account.ts +15 -15
  182. package/src/api/account.ts +10 -3
  183. package/src/api/authorization.ts +1 -0
  184. package/src/api/contract.ts +26 -10
  185. package/src/api/deployment.ts +0 -1
  186. package/src/api/events.ts +35 -27
  187. package/src/api/fields.ts +3 -1
  188. package/src/api/keys.ts +2 -2
  189. package/src/api/node.ts +7 -3
  190. package/src/api/note.ts +1 -1
  191. package/src/api/protocol.ts +7 -0
  192. package/src/api/tx.ts +4 -0
  193. package/src/api/wallet.ts +52 -9
  194. package/src/authorization/call_authorization_request.ts +1 -1
  195. package/src/contract/base_contract_interaction.ts +27 -16
  196. package/src/contract/batch_call.ts +62 -48
  197. package/src/contract/contract.ts +7 -5
  198. package/src/contract/contract_base.ts +5 -15
  199. package/src/contract/contract_function_interaction.ts +26 -17
  200. package/src/contract/deploy_method.ts +175 -47
  201. package/src/contract/get_gas_limits.ts +3 -3
  202. package/src/contract/interaction_options.ts +59 -13
  203. package/src/contract/protocol_contracts/auth-registry.ts +553 -0
  204. package/src/contract/protocol_contracts/contract-class-registry.ts +99 -0
  205. package/src/contract/protocol_contracts/contract-instance-registry.ts +302 -0
  206. package/src/contract/protocol_contracts/fee-juice.ts +266 -0
  207. package/src/contract/protocol_contracts/multi-call-entrypoint.ts +336 -0
  208. package/src/contract/protocol_contracts/public-checks.ts +320 -0
  209. package/src/contract/wait_for_proven.ts +1 -1
  210. package/src/contract/wait_opts.ts +21 -0
  211. package/src/deployment/contract_deployer.ts +3 -2
  212. package/src/deployment/publish_class.ts +3 -3
  213. package/src/deployment/publish_instance.ts +3 -6
  214. package/src/ethereum/portal_manager.ts +65 -34
  215. package/src/fee/fee_juice_payment_method_with_claim.ts +9 -7
  216. package/src/fee/fee_payment_method.ts +1 -1
  217. package/src/fee/private_fee_payment_method.ts +12 -10
  218. package/src/fee/public_fee_payment_method.ts +13 -11
  219. package/src/fee/sponsored_fee_payment.ts +6 -4
  220. package/src/scripts/generate_protocol_contract_types.ts +150 -0
  221. package/src/utils/abi_types.ts +1 -1
  222. package/src/utils/authwit.ts +40 -22
  223. package/src/utils/cross_chain.ts +1 -1
  224. package/src/utils/fee_juice.ts +2 -2
  225. package/src/utils/field_compressed_string.ts +1 -1
  226. package/src/utils/node.ts +62 -0
  227. package/src/utils/pub_key.ts +2 -2
  228. package/src/wallet/account_entrypoint_meta_payment_method.ts +29 -60
  229. package/src/wallet/account_manager.ts +7 -15
  230. package/src/wallet/capabilities.ts +500 -0
  231. package/src/wallet/deploy_account_method.ts +78 -16
  232. package/src/wallet/index.ts +1 -1
  233. package/src/wallet/wallet.ts +387 -166
  234. package/dest/account/interface.d.ts +0 -19
  235. package/dest/account/interface.d.ts.map +0 -1
  236. package/dest/account/interface.js +0 -5
  237. package/dest/contract/deploy_sent_tx.d.ts +0 -43
  238. package/dest/contract/deploy_sent_tx.d.ts.map +0 -1
  239. package/dest/contract/deploy_sent_tx.js +0 -40
  240. package/dest/contract/protocol_contracts.d.ts +0 -9
  241. package/dest/contract/protocol_contracts.d.ts.map +0 -1
  242. package/dest/contract/protocol_contracts.js +0 -26
  243. package/dest/contract/sent_tx.d.ts +0 -51
  244. package/dest/contract/sent_tx.d.ts.map +0 -1
  245. package/dest/contract/sent_tx.js +0 -90
  246. package/dest/contract/unsafe_contract.d.ts +0 -15
  247. package/dest/contract/unsafe_contract.d.ts.map +0 -1
  248. package/dest/contract/unsafe_contract.js +0 -6
  249. package/dest/deployment/broadcast_function.d.ts +0 -24
  250. package/dest/deployment/broadcast_function.d.ts.map +0 -1
  251. package/dest/deployment/broadcast_function.js +0 -74
  252. package/dest/wallet/base_wallet.d.ts +0 -91
  253. package/dest/wallet/base_wallet.d.ts.map +0 -1
  254. package/dest/wallet/base_wallet.js +0 -238
  255. package/src/account/interface.ts +0 -25
  256. package/src/contract/deploy_sent_tx.ts +0 -68
  257. package/src/contract/protocol_contracts.ts +0 -35
  258. package/src/contract/sent_tx.ts +0 -130
  259. package/src/contract/unsafe_contract.ts +0 -19
  260. package/src/deployment/broadcast_function.ts +0 -148
  261. package/src/wallet/base_wallet.ts +0 -350
@@ -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,5 +1,5 @@
1
1
  import type { ContractArtifact } from '@aztec/stdlib/abi';
2
- import { AztecAddress } from '@aztec/stdlib/aztec-address';
2
+ import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
3
3
  import { PublicKeys } from '@aztec/stdlib/keys';
4
4
 
5
5
  import { Contract } from '../contract/contract.js';
@@ -28,7 +28,8 @@ export class ContractDeployer {
28
28
  * @returns A DeployMethod instance configured with the ABI, PXE, and constructor arguments.
29
29
  */
30
30
  public deploy(...args: any[]) {
31
- const postDeployCtor = (address: AztecAddress, wallet: Wallet) => Contract.at(address, this.artifact, wallet);
31
+ const postDeployCtor = (instance: ContractInstanceWithAddress, wallet: Wallet) =>
32
+ Contract.at(instance.address, this.artifact, wallet);
32
33
  return new DeployMethod(
33
34
  this.publicKeys ?? PublicKeys.default(),
34
35
  this.wallet,
@@ -2,14 +2,14 @@ import {
2
2
  CONTRACT_CLASS_REGISTRY_BYTECODE_CAPSULE_SLOT,
3
3
  MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS,
4
4
  } from '@aztec/constants';
5
- import { Fr } from '@aztec/foundation/fields';
5
+ import { Fr } from '@aztec/foundation/curves/bn254';
6
6
  import { ProtocolContractAddress } from '@aztec/protocol-contracts';
7
7
  import { type ContractArtifact, bufferAsFields } from '@aztec/stdlib/abi';
8
8
  import { getContractClassFromArtifact } from '@aztec/stdlib/contract';
9
9
  import { Capsule } from '@aztec/stdlib/tx';
10
10
 
11
11
  import type { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
12
- import { getClassRegistryContract } from '../contract/protocol_contracts.js';
12
+ import { ContractClassRegistryContract } from '../contract/protocol_contracts/contract-class-registry.js';
13
13
  import type { Wallet } from '../wallet/index.js';
14
14
 
15
15
  /** Sets up a call to publish a contract class given its artifact. */
@@ -19,7 +19,7 @@ export async function publishContractClass(
19
19
  ): Promise<ContractFunctionInteraction> {
20
20
  const { artifactHash, privateFunctionsRoot, publicBytecodeCommitment, packedBytecode } =
21
21
  await getContractClassFromArtifact(artifact);
22
- const classRegistry = await getClassRegistryContract(wallet);
22
+ const classRegistry = ContractClassRegistryContract.at(wallet);
23
23
 
24
24
  const encodedBytecode = bufferAsFields(packedBytecode, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS);
25
25
  return classRegistry.methods.publish(artifactHash, privateFunctionsRoot, publicBytecodeCommitment).with({
@@ -1,7 +1,7 @@
1
1
  import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
2
2
 
3
3
  import type { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
4
- import { getInstanceRegistryContract } from '../contract/protocol_contracts.js';
4
+ import { ContractInstanceRegistryContract } from '../contract/protocol_contracts/contract-instance-registry.js';
5
5
  import type { Wallet } from '../wallet/wallet.js';
6
6
 
7
7
  /**
@@ -9,11 +9,8 @@ import type { Wallet } from '../wallet/wallet.js';
9
9
  * @param wallet - The wallet to use for the publication (setup) tx.
10
10
  * @param instance - The instance to publish.
11
11
  */
12
- export async function publishInstance(
13
- wallet: Wallet,
14
- instance: ContractInstanceWithAddress,
15
- ): Promise<ContractFunctionInteraction> {
16
- const contractInstanceRegistry = await getInstanceRegistryContract(wallet);
12
+ export function publishInstance(wallet: Wallet, instance: ContractInstanceWithAddress): ContractFunctionInteraction {
13
+ const contractInstanceRegistry = ContractInstanceRegistryContract.at(wallet);
17
14
  const { salt, currentContractClassId: contractClassId, publicKeys, deployer: instanceDeployer } = instance;
18
15
  const isUniversalDeploy = instanceDeployer.isZero();
19
16
  return contractInstanceRegistry.methods.publish_for_public_execution(
@@ -1,8 +1,9 @@
1
- import type { ExtendedViemWalletClient, ViemContract } from '@aztec/ethereum';
1
+ import type { ExtendedViemWalletClient, ViemContract } from '@aztec/ethereum/types';
2
2
  import { extractEvent } from '@aztec/ethereum/utils';
3
- import { sha256ToField } from '@aztec/foundation/crypto';
3
+ import type { EpochNumber } from '@aztec/foundation/branded-types';
4
+ import { sha256ToField } from '@aztec/foundation/crypto/sha256';
5
+ import { Fr } from '@aztec/foundation/curves/bn254';
4
6
  import { EthAddress } from '@aztec/foundation/eth-address';
5
- import { Fr } from '@aztec/foundation/fields';
6
7
  import type { Logger } from '@aztec/foundation/log';
7
8
  import type { SiblingPath } from '@aztec/foundation/trees';
8
9
  import { FeeAssetHandlerAbi } from '@aztec/l1-artifacts/FeeAssetHandlerAbi';
@@ -132,7 +133,7 @@ export class L1FeeJuicePortalManager {
132
133
  constructor(
133
134
  portalAddress: EthAddress,
134
135
  tokenAddress: EthAddress,
135
- handlerAddress: EthAddress,
136
+ handlerAddress: EthAddress | undefined,
136
137
  private readonly extendedClient: ExtendedViemWalletClient,
137
138
  private readonly logger: Logger,
138
139
  ) {
@@ -157,9 +158,9 @@ export class L1FeeJuicePortalManager {
157
158
  */
158
159
  public async bridgeTokensPublic(to: AztecAddress, amount: bigint | undefined, mint = false): Promise<L2AmountClaim> {
159
160
  const [claimSecret, claimSecretHash] = await generateClaimSecret();
160
- const mintableAmount = await this.tokenManager.getMintAmount();
161
- const amountToBridge = amount ?? mintableAmount;
161
+ const amountToBridge = amount ?? (await this.tokenManager.getMintAmount());
162
162
  if (mint) {
163
+ const mintableAmount = await this.tokenManager.getMintAmount();
163
164
  if (amountToBridge !== mintableAmount) {
164
165
  throw new Error(`Minting amount must be ${mintableAmount}`);
165
166
  }
@@ -177,17 +178,32 @@ export class L1FeeJuicePortalManager {
177
178
  hash: await this.contract.write.depositToAztecPublic(args),
178
179
  });
179
180
 
180
- this.logger.info('Deposited to Aztec public successfully');
181
+ this.logger.info('Deposited to Aztec public successfully', { txReceipt });
181
182
 
182
183
  const log = extractEvent(
183
184
  txReceipt.logs,
184
185
  this.contract.address,
185
186
  this.contract.abi,
186
187
  'DepositToAztecPublic',
187
- log =>
188
- log.args.secretHash === claimSecretHash.toString() &&
189
- log.args.amount === amountToBridge &&
190
- log.args.to === to.toString(),
188
+ log => {
189
+ // Normalize hex strings for comparison (case-insensitive, handle different formats)
190
+ const normalizeHex = (val: string | bigint | number) => {
191
+ const hexStr = typeof val === 'string' ? val : `0x${val.toString(16).padStart(64, '0')}`;
192
+ return hexStr.toLowerCase();
193
+ };
194
+
195
+ const secretHashMatch = normalizeHex(log.args.secretHash) === normalizeHex(claimSecretHash.toString());
196
+ const amountMatch = log.args.amount === amountToBridge;
197
+ const toMatch = normalizeHex(log.args.to) === normalizeHex(to.toString());
198
+
199
+ this.logger.debug(
200
+ `Event filter matching: secretHash=${secretHashMatch} (${log.args.secretHash} vs ${claimSecretHash.toString()}), ` +
201
+ `amount=${amountMatch} (${log.args.amount} vs ${amountToBridge}), ` +
202
+ `to=${toMatch} (${log.args.to} vs ${to.toString()})`,
203
+ );
204
+
205
+ return secretHashMatch && amountMatch && toMatch;
206
+ },
191
207
  this.logger,
192
208
  );
193
209
 
@@ -218,17 +234,12 @@ export class L1FeeJuicePortalManager {
218
234
  if (feeJuiceAddress.isZero() || feeJuicePortalAddress.isZero()) {
219
235
  throw new Error('Portal or token not deployed on L1');
220
236
  }
221
- if (!feeAssetHandlerAddress || feeAssetHandlerAddress.isZero()) {
222
- throw new Error('Handler not deployed on L1, or handler address is zero');
223
- }
224
237
 
225
- return new L1FeeJuicePortalManager(
226
- feeJuicePortalAddress,
227
- feeJuiceAddress,
228
- feeAssetHandlerAddress,
229
- extendedClient,
230
- logger,
231
- );
238
+ // Handler is optional - it's only needed for minting tokens during testing
239
+ const handlerAddress =
240
+ feeAssetHandlerAddress && !feeAssetHandlerAddress.isZero() ? feeAssetHandlerAddress : undefined;
241
+
242
+ return new L1FeeJuicePortalManager(feeJuicePortalAddress, feeJuiceAddress, handlerAddress, extendedClient, logger);
232
243
  }
233
244
  }
234
245
 
@@ -282,10 +293,19 @@ export class L1ToL2TokenPortalManager {
282
293
  this.portal.address,
283
294
  this.portal.abi,
284
295
  'DepositToAztecPublic',
285
- log =>
286
- log.args.secretHash === claimSecretHash.toString() &&
287
- log.args.amount === amount &&
288
- log.args.to === to.toString(),
296
+ log => {
297
+ // Normalize hex strings for comparison (case-insensitive, handle different formats)
298
+ const normalizeHex = (val: string | bigint | number) => {
299
+ const hexStr = typeof val === 'string' ? val : `0x${val.toString(16).padStart(64, '0')}`;
300
+ return hexStr.toLowerCase();
301
+ };
302
+
303
+ return (
304
+ normalizeHex(log.args.secretHash) === normalizeHex(claimSecretHash.toString()) &&
305
+ log.args.amount === amount &&
306
+ normalizeHex(log.args.to) === normalizeHex(to.toString())
307
+ );
308
+ },
289
309
  this.logger,
290
310
  );
291
311
 
@@ -323,7 +343,18 @@ export class L1ToL2TokenPortalManager {
323
343
  this.portal.address,
324
344
  this.portal.abi,
325
345
  'DepositToAztecPrivate',
326
- log => log.args.amount === amount && log.args.secretHashForL2MessageConsumption === claimSecretHash.toString(),
346
+ log => {
347
+ // Normalize hex strings for comparison (case-insensitive, handle different formats)
348
+ const normalizeHex = (val: string | bigint | number) => {
349
+ const hexStr = typeof val === 'string' ? val : `0x${val.toString(16).padStart(64, '0')}`;
350
+ return hexStr.toLowerCase();
351
+ };
352
+
353
+ return (
354
+ log.args.amount === amount &&
355
+ normalizeHex(log.args.secretHashForL2MessageConsumption) === normalizeHex(claimSecretHash.toString())
356
+ );
357
+ },
327
358
  this.logger,
328
359
  );
329
360
 
@@ -378,26 +409,26 @@ export class L1TokenPortalManager extends L1ToL2TokenPortalManager {
378
409
  * Withdraws funds from the portal by consuming an L2 to L1 message. Returns once the tx is mined on L1.
379
410
  * @param amount - Amount to withdraw.
380
411
  * @param recipient - Who will receive the funds.
381
- * @param blockNumber - L2 block number of the message.
412
+ * @param epochNumber - Epoch number of the message.
382
413
  * @param messageIndex - Index of the message.
383
414
  * @param siblingPath - Sibling path of the message.
384
415
  */
385
416
  public async withdrawFunds(
386
417
  amount: bigint,
387
418
  recipient: EthAddress,
388
- blockNumber: bigint,
419
+ epochNumber: EpochNumber,
389
420
  messageIndex: bigint,
390
421
  siblingPath: SiblingPath<number>,
391
422
  ) {
392
423
  this.logger.info(
393
- `Sending L1 tx to consume message at block ${blockNumber} index ${messageIndex} to withdraw ${amount}`,
424
+ `Sending L1 tx to consume message at epoch ${epochNumber} index ${messageIndex} to withdraw ${amount}`,
394
425
  );
395
426
 
396
427
  const messageLeafId = getL2ToL1MessageLeafId({ leafIndex: messageIndex, siblingPath });
397
- const isConsumedBefore = await this.outbox.read.hasMessageBeenConsumedAtBlock([blockNumber, messageLeafId]);
428
+ const isConsumedBefore = await this.outbox.read.hasMessageBeenConsumedAtEpoch([BigInt(epochNumber), messageLeafId]);
398
429
  if (isConsumedBefore) {
399
430
  throw new Error(
400
- `L1 to L2 message at block ${blockNumber} index ${messageIndex} height ${siblingPath.pathSize} has already been consumed`,
431
+ `L2 to L1 message at epoch ${epochNumber} index ${messageIndex} height ${siblingPath.pathSize} has already been consumed`,
401
432
  );
402
433
  }
403
434
 
@@ -406,7 +437,7 @@ export class L1TokenPortalManager extends L1ToL2TokenPortalManager {
406
437
  recipient.toString(),
407
438
  amount,
408
439
  false,
409
- BigInt(blockNumber),
440
+ BigInt(epochNumber),
410
441
  messageIndex,
411
442
  siblingPath.toBufferArray().map((buf: Buffer): Hex => `0x${buf.toString('hex')}`),
412
443
  ]);
@@ -415,10 +446,10 @@ export class L1TokenPortalManager extends L1ToL2TokenPortalManager {
415
446
  hash: await this.extendedClient.writeContract(withdrawRequest),
416
447
  });
417
448
 
418
- const isConsumedAfter = await this.outbox.read.hasMessageBeenConsumedAtBlock([blockNumber, messageLeafId]);
449
+ const isConsumedAfter = await this.outbox.read.hasMessageBeenConsumedAtEpoch([BigInt(epochNumber), messageLeafId]);
419
450
  if (!isConsumedAfter) {
420
451
  throw new Error(
421
- `L1 to L2 message at block ${blockNumber} index ${messageIndex} height ${siblingPath.pathSize} not consumed after withdrawal`,
452
+ `L2 to L1 message at epoch ${epochNumber} index ${messageIndex} height ${siblingPath.pathSize} not consumed after withdrawal`,
422
453
  );
423
454
  }
424
455
  }
@@ -1,9 +1,9 @@
1
- import { ExecutionPayload } from '@aztec/entrypoints/payload';
2
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
2
  import { ProtocolContractAddress } from '@aztec/protocol-contracts';
4
- import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
3
+ import { FunctionCall, FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
5
4
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
6
5
  import type { GasSettings } from '@aztec/stdlib/gas';
6
+ import { ExecutionPayload } from '@aztec/stdlib/tx';
7
7
 
8
8
  import type { L2AmountClaim } from '../ethereum/portal_manager.js';
9
9
  import type { FeePaymentMethod } from './fee_payment_method.js';
@@ -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,11 +41,12 @@ 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
  [],
48
+ [],
49
+ this.sender, // feePayer
48
50
  );
49
51
  }
50
52
 
@@ -1,6 +1,6 @@
1
- import type { ExecutionPayload } from '@aztec/entrypoints/payload';
2
1
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
3
2
  import type { GasSettings } from '@aztec/stdlib/gas';
3
+ import type { ExecutionPayload } from '@aztec/stdlib/tx';
4
4
 
5
5
  /**
6
6
  * Holds information about how the fee for a transaction is to be paid.
@@ -1,8 +1,8 @@
1
- import { ExecutionPayload } from '@aztec/entrypoints/payload';
2
- import { Fr } from '@aztec/foundation/fields';
3
- import { type FunctionAbi, FunctionSelector, FunctionType, decodeFromAbi } from '@aztec/stdlib/abi';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
+ import { type FunctionAbi, FunctionCall, FunctionSelector, FunctionType, decodeFromAbi } from '@aztec/stdlib/abi';
4
3
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
5
4
  import type { GasSettings } from '@aztec/stdlib/gas';
5
+ import { ExecutionPayload } from '@aztec/stdlib/tx';
6
6
 
7
7
  import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
8
8
  import type { Wallet } from '../wallet/wallet.js';
@@ -49,7 +49,7 @@ export class PrivateFeePaymentMethod implements FeePaymentMethod {
49
49
  const abi = {
50
50
  name: 'get_accepted_asset',
51
51
  functionType: FunctionType.PRIVATE,
52
- isInternal: false,
52
+ isOnlySelf: false,
53
53
  isStatic: false,
54
54
  parameters: [],
55
55
  returnTypes: [
@@ -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,10 +125,12 @@ 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
  [],
132
+ [],
133
+ this.paymentContract, // feePayer
132
134
  );
133
135
  }
134
136
 
@@ -1,8 +1,8 @@
1
- import { ExecutionPayload } from '@aztec/entrypoints/payload';
2
- import { Fr } from '@aztec/foundation/fields';
3
- import { type FunctionAbi, FunctionSelector, FunctionType, decodeFromAbi } from '@aztec/stdlib/abi';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
+ import { type FunctionAbi, FunctionCall, FunctionSelector, FunctionType, decodeFromAbi } from '@aztec/stdlib/abi';
4
3
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
5
4
  import { GasSettings } from '@aztec/stdlib/gas';
5
+ import { ExecutionPayload } from '@aztec/stdlib/tx';
6
6
 
7
7
  import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
8
8
  import { SetPublicAuthwitContractInteraction } from '../utils/authwit.js';
@@ -43,7 +43,7 @@ export class PublicFeePaymentMethod implements FeePaymentMethod {
43
43
  const abi = {
44
44
  name: 'get_accepted_asset',
45
45
  functionType: FunctionType.PRIVATE,
46
- isInternal: false,
46
+ isOnlySelf: false,
47
47
  isStatic: false,
48
48
  parameters: [],
49
49
  returnTypes: [
@@ -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,10 +125,12 @@ 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
  [],
132
+ [],
133
+ this.paymentContract, // feePayer
132
134
  );
133
135
  }
134
136
 
@@ -1,8 +1,8 @@
1
1
  import type { FeePaymentMethod } from '@aztec/aztec.js/fee';
2
- import { ExecutionPayload } from '@aztec/entrypoints/payload';
3
- import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
2
+ import { FunctionCall, FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
4
3
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
5
4
  import type { GasSettings } from '@aztec/stdlib/gas';
5
+ import { ExecutionPayload } from '@aztec/stdlib/tx';
6
6
 
7
7
  /**
8
8
  * A fee payment method that uses a contract that blindly sponsors transactions.
@@ -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,10 +31,12 @@ export class SponsoredFeePaymentMethod implements FeePaymentMethod {
31
31
  isStatic: false,
32
32
  args: [],
33
33
  returnTypes: [],
34
- },
34
+ }),
35
35
  ],
36
36
  [],
37
37
  [],
38
+ [],
39
+ this.paymentContract, // feePayer
38
40
  );
39
41
  }
40
42
 
@@ -0,0 +1,150 @@
1
+ /**
2
+ * Generates type-safe contract wrappers for protocol contracts.
3
+ * These wrappers use a minimal artifact (without bytecode) since PXE already has the full artifacts registered.
4
+ */
5
+ import { generateTypescriptContractInterface } from '@aztec/builder/codegen';
6
+ import {
7
+ type ContractArtifact,
8
+ type FunctionAbi,
9
+ FunctionType,
10
+ getAllFunctionAbis,
11
+ loadContractArtifact,
12
+ } from '@aztec/stdlib/abi';
13
+ import type { NoirCompiledContract } from '@aztec/stdlib/noir';
14
+
15
+ import { promises as fs } from 'fs';
16
+ import path from 'path';
17
+
18
+ const log = console.log;
19
+
20
+ const noirContractsRoot = path.join(import.meta.dirname, '../../../../noir-projects/noir-contracts');
21
+ const srcPath = path.join(noirContractsRoot, 'target');
22
+ const outputDir = path.join(import.meta.dirname, '../contract/protocol_contracts');
23
+
24
+ function toKebabCase(str: string): string {
25
+ return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
26
+ }
27
+
28
+ function functionTypeToEnum(type: FunctionType): string {
29
+ switch (type) {
30
+ case FunctionType.PRIVATE:
31
+ return 'FunctionType.PRIVATE';
32
+ case FunctionType.PUBLIC:
33
+ return 'FunctionType.PUBLIC';
34
+ case FunctionType.UTILITY:
35
+ return 'FunctionType.UTILITY';
36
+ }
37
+ }
38
+
39
+ function generateFunctionAbiJson(abi: FunctionAbi): string {
40
+ const baseObj = {
41
+ name: abi.name,
42
+ isOnlySelf: abi.isOnlySelf,
43
+ isStatic: abi.isStatic,
44
+ isInitializer: abi.isInitializer,
45
+ parameters: abi.parameters,
46
+ returnTypes: abi.returnTypes,
47
+ errorTypes: abi.errorTypes,
48
+ };
49
+ const jsonStr = JSON.stringify(baseObj);
50
+ return jsonStr.replace('{', `{ functionType: ${functionTypeToEnum(abi.functionType)},`);
51
+ }
52
+
53
+ function generateProtocolContractArtifact(input: ContractArtifact): string {
54
+ const allAbis = getAllFunctionAbis(input);
55
+ const functionAbis = input.functions.map(f => allAbis.find(abi => abi.name === f.name)!);
56
+ const nonDispatchAbis = input.nonDispatchPublicFunctions;
57
+
58
+ const functionsArray = functionAbis
59
+ .map(abi => `{ ...${generateFunctionAbiJson(abi)}, bytecode: Buffer.from([]), debugSymbols: '' }`)
60
+ .join(',\n ');
61
+
62
+ const nonDispatchArray = nonDispatchAbis.map(abi => generateFunctionAbiJson(abi)).join(',\n ');
63
+
64
+ return `{
65
+ name: '${input.name}',
66
+ functions: [
67
+ ${functionsArray}
68
+ ],
69
+ nonDispatchPublicFunctions: [
70
+ ${nonDispatchArray}
71
+ ],
72
+ outputs: { structs: {}, globals: {} },
73
+ storageLayout: {},
74
+ fileMap: {},
75
+ }`;
76
+ }
77
+
78
+ async function generateProtocolContractInterface(
79
+ input: ContractArtifact,
80
+ protocolContractName: string,
81
+ ): Promise<string> {
82
+ const baseInterface = await generateTypescriptContractInterface(input);
83
+
84
+ // Match everything between "public declare methods: {" and the closing "};"
85
+ const methodsMatch = baseInterface.match(/public declare methods: \{([\s\S]*?)\n \};/);
86
+ if (!methodsMatch) {
87
+ throw new Error('Could not extract methods from generated interface');
88
+ }
89
+
90
+ const artifactCode = generateProtocolContractArtifact(input);
91
+ const contractName = `${input.name}Contract`;
92
+
93
+ return `
94
+ /* Autogenerated file, do not edit! */
95
+
96
+ /* eslint-disable */
97
+ import { ProtocolContractAddress } from '@aztec/protocol-contracts';
98
+ import { FunctionType } from '@aztec/stdlib/abi';
99
+
100
+ import type { ContractArtifact } from '../../api/abi.js';
101
+ import { PublicKeys } from '../../api/keys.js';
102
+ import type { AztecAddressLike, EthAddressLike, FieldLike, FunctionSelectorLike, WrappedFieldLike } from '../../utils/abi_types.js';
103
+ import { ContractBase, type ContractMethod } from '../contract_base.js';
104
+ import { ContractFunctionInteraction } from '../contract_function_interaction.js';
105
+ import type { Wallet } from '../../wallet/wallet.js';
106
+
107
+ const ${contractName}Artifact: ContractArtifact = ${artifactCode};
108
+
109
+ export class ${contractName} extends ContractBase {
110
+ private constructor(wallet: Wallet) {
111
+ super(ProtocolContractAddress.${protocolContractName}, ${contractName}Artifact, wallet);
112
+ }
113
+
114
+ public static at(wallet: Wallet): ${contractName} {
115
+ return new ${contractName}(wallet);
116
+ }
117
+
118
+ public declare methods: {${methodsMatch[1]}
119
+ };
120
+ }
121
+ `;
122
+ }
123
+
124
+ async function main() {
125
+ await fs.rm(outputDir, { recursive: true, force: true });
126
+ await fs.mkdir(outputDir, { recursive: true });
127
+
128
+ const srcNames = JSON.parse(
129
+ await fs.readFile(path.join(noirContractsRoot, 'protocol_contracts.json'), 'utf8'),
130
+ ) as string[];
131
+
132
+ for (const srcName of srcNames) {
133
+ // srcName is like "auth_registry_contract-AuthRegistry", split to get the contract name
134
+ const name = srcName.split('-')[1];
135
+ const artifactPath = path.join(srcPath, `${srcName}.json`);
136
+ const json = JSON.parse(await fs.readFile(artifactPath, 'utf8')) as NoirCompiledContract;
137
+ const contractArtifact = loadContractArtifact(json);
138
+
139
+ const content = await generateProtocolContractInterface(contractArtifact, name);
140
+ const fileName = `${toKebabCase(name)}.ts`;
141
+ await fs.writeFile(path.join(outputDir, fileName), content);
142
+
143
+ log(`Generated ${fileName}`);
144
+ }
145
+ }
146
+
147
+ main().catch(err => {
148
+ console.error('Error generating protocol contract types:', err);
149
+ process.exit(1);
150
+ });
@@ -1,5 +1,5 @@
1
+ import type { Fr } from '@aztec/foundation/curves/bn254';
1
2
  import type { EthAddress } from '@aztec/foundation/eth-address';
2
- import type { Fr } from '@aztec/foundation/fields';
3
3
  import type { EventSelector, FunctionSelector } from '@aztec/stdlib/abi';
4
4
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
5