@aztec/aztec.js 3.0.0-canary.a9708bd → 3.0.0-devnet.2

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 (278) hide show
  1. package/dest/account/account.d.ts +60 -0
  2. package/dest/account/account.d.ts.map +1 -0
  3. package/dest/account/account.js +59 -0
  4. package/dest/account/account_contract.d.ts +5 -5
  5. package/dest/account/account_contract.d.ts.map +1 -1
  6. package/dest/account/account_contract.js +0 -1
  7. package/dest/{wallet/account_wallet_with_private_key.d.ts → account/account_with_secret_key.d.ts} +7 -8
  8. package/dest/account/account_with_secret_key.d.ts.map +1 -0
  9. package/dest/{wallet/account_wallet_with_private_key.js → account/account_with_secret_key.js} +5 -5
  10. package/dest/account/index.d.ts +1 -4
  11. package/dest/account/index.d.ts.map +1 -1
  12. package/dest/account/index.js +1 -4
  13. package/dest/account/signerless_account.d.ts +24 -0
  14. package/dest/account/signerless_account.d.ts.map +1 -0
  15. package/dest/account/signerless_account.js +27 -0
  16. package/dest/api/abi.d.ts +1 -0
  17. package/dest/api/abi.d.ts.map +1 -1
  18. package/dest/api/account.d.ts +4 -2
  19. package/dest/api/account.d.ts.map +1 -1
  20. package/dest/api/account.js +3 -1
  21. package/dest/api/addresses.d.ts +1 -0
  22. package/dest/api/addresses.d.ts.map +1 -1
  23. package/dest/api/addresses.js +1 -0
  24. package/dest/api/authorization.d.ts +2 -0
  25. package/dest/api/authorization.d.ts.map +1 -1
  26. package/dest/api/authorization.js +2 -0
  27. package/dest/api/block.d.ts +3 -0
  28. package/dest/api/block.d.ts.map +1 -0
  29. package/dest/api/block.js +2 -0
  30. package/dest/api/contract.d.ts +4 -5
  31. package/dest/api/contract.d.ts.map +1 -1
  32. package/dest/api/contract.js +3 -3
  33. package/dest/api/crypto.d.ts +2 -0
  34. package/dest/api/crypto.d.ts.map +1 -0
  35. package/dest/api/crypto.js +1 -0
  36. package/dest/api/ethereum.d.ts +0 -1
  37. package/dest/api/ethereum.d.ts.map +1 -1
  38. package/dest/api/ethereum.js +0 -1
  39. package/dest/api/events.d.ts +12 -0
  40. package/dest/api/events.d.ts.map +1 -0
  41. package/dest/api/events.js +30 -0
  42. package/dest/api/fee.d.ts +1 -2
  43. package/dest/api/fee.d.ts.map +1 -1
  44. package/dest/api/fee.js +0 -1
  45. package/dest/api/keys.d.ts +4 -0
  46. package/dest/api/keys.d.ts.map +1 -0
  47. package/dest/api/keys.js +3 -0
  48. package/dest/api/log.d.ts +1 -0
  49. package/dest/api/log.d.ts.map +1 -1
  50. package/dest/api/log.js +1 -0
  51. package/dest/api/messaging.d.ts +3 -0
  52. package/dest/api/messaging.d.ts.map +1 -0
  53. package/dest/api/messaging.js +2 -0
  54. package/dest/api/node.d.ts +21 -0
  55. package/dest/api/node.d.ts.map +1 -0
  56. package/dest/api/node.js +18 -0
  57. package/dest/api/note.d.ts +2 -0
  58. package/dest/api/note.d.ts.map +1 -0
  59. package/dest/api/note.js +1 -0
  60. package/dest/api/protocol.d.ts +3 -0
  61. package/dest/api/protocol.d.ts.map +1 -0
  62. package/dest/api/protocol.js +2 -0
  63. package/dest/api/trees.d.ts +3 -0
  64. package/dest/api/trees.d.ts.map +1 -0
  65. package/dest/api/trees.js +2 -0
  66. package/dest/api/tx.d.ts +2 -0
  67. package/dest/api/tx.d.ts.map +1 -0
  68. package/dest/api/tx.js +1 -0
  69. package/dest/api/utils.d.ts +10 -6
  70. package/dest/api/utils.d.ts.map +1 -1
  71. package/dest/api/utils.js +10 -5
  72. package/dest/api/wallet.d.ts +4 -1
  73. package/dest/api/wallet.d.ts.map +1 -1
  74. package/dest/api/wallet.js +4 -1
  75. package/dest/contract/base_contract_interaction.d.ts +6 -48
  76. package/dest/contract/base_contract_interaction.d.ts.map +1 -1
  77. package/dest/contract/base_contract_interaction.js +6 -106
  78. package/dest/contract/batch_call.d.ts +6 -14
  79. package/dest/contract/batch_call.d.ts.map +1 -1
  80. package/dest/contract/batch_call.js +42 -52
  81. package/dest/contract/contract.d.ts +1 -1
  82. package/dest/contract/contract.d.ts.map +1 -1
  83. package/dest/contract/contract.js +2 -12
  84. package/dest/contract/contract_base.d.ts +1 -1
  85. package/dest/contract/contract_base.d.ts.map +1 -1
  86. package/dest/contract/contract_function_interaction.d.ts +29 -40
  87. package/dest/contract/contract_function_interaction.d.ts.map +1 -1
  88. package/dest/contract/contract_function_interaction.js +41 -53
  89. package/dest/contract/deploy_method.d.ts +63 -56
  90. package/dest/contract/deploy_method.d.ts.map +1 -1
  91. package/dest/contract/deploy_method.js +68 -86
  92. package/dest/contract/deploy_sent_tx.d.ts +0 -1
  93. package/dest/contract/deploy_sent_tx.d.ts.map +1 -1
  94. package/dest/contract/deploy_sent_tx.js +7 -10
  95. package/dest/contract/interaction_options.d.ts +74 -19
  96. package/dest/contract/interaction_options.d.ts.map +1 -1
  97. package/dest/contract/interaction_options.js +51 -3
  98. package/dest/contract/sent_tx.d.ts +3 -3
  99. package/dest/contract/sent_tx.d.ts.map +1 -1
  100. package/dest/contract/sent_tx.js +5 -5
  101. package/dest/contract/wait_for_proven.d.ts +3 -3
  102. package/dest/contract/wait_for_proven.d.ts.map +1 -1
  103. package/dest/contract/wait_for_proven.js +2 -2
  104. package/dest/deployment/publish_instance.d.ts +1 -1
  105. package/dest/deployment/publish_instance.d.ts.map +1 -1
  106. package/dest/deployment/publish_instance.js +2 -5
  107. package/dest/ethereum/portal_manager.d.ts +3 -4
  108. package/dest/ethereum/portal_manager.d.ts.map +1 -1
  109. package/dest/ethereum/portal_manager.js +3 -5
  110. package/dest/fee/fee_juice_payment_method_with_claim.d.ts +12 -7
  111. package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -1
  112. package/dest/fee/fee_juice_payment_method_with_claim.js +21 -12
  113. package/dest/fee/fee_payment_method.d.ts +26 -0
  114. package/dest/fee/fee_payment_method.d.ts.map +1 -0
  115. package/dest/fee/fee_payment_method.js +3 -0
  116. package/dest/fee/private_fee_payment_method.d.ts +22 -5
  117. package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
  118. package/dest/fee/private_fee_payment_method.js +34 -13
  119. package/dest/fee/public_fee_payment_method.d.ts +22 -5
  120. package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
  121. package/dest/fee/public_fee_payment_method.js +37 -14
  122. package/dest/fee/sponsored_fee_payment.d.ts +2 -0
  123. package/dest/fee/sponsored_fee_payment.d.ts.map +1 -1
  124. package/dest/fee/sponsored_fee_payment.js +4 -0
  125. package/dest/utils/authwit.d.ts +77 -25
  126. package/dest/utils/authwit.d.ts.map +1 -1
  127. package/dest/utils/authwit.js +219 -24
  128. package/dest/utils/cross_chain.d.ts +24 -0
  129. package/dest/utils/cross_chain.d.ts.map +1 -0
  130. package/dest/utils/cross_chain.js +30 -0
  131. package/dest/utils/fee_juice.d.ts +3 -2
  132. package/dest/utils/fee_juice.d.ts.map +1 -1
  133. package/dest/utils/fee_juice.js +3 -2
  134. package/dest/{fee → wallet}/account_entrypoint_meta_payment_method.d.ts +13 -10
  135. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -0
  136. package/dest/wallet/account_entrypoint_meta_payment_method.js +76 -0
  137. package/dest/wallet/account_manager.d.ts +69 -0
  138. package/dest/wallet/account_manager.d.ts.map +1 -0
  139. package/dest/wallet/account_manager.js +113 -0
  140. package/dest/wallet/base_wallet.d.ts +78 -35
  141. package/dest/wallet/base_wallet.d.ts.map +1 -1
  142. package/dest/wallet/base_wallet.js +216 -48
  143. package/dest/wallet/deploy_account_method.d.ts +52 -0
  144. package/dest/wallet/deploy_account_method.d.ts.map +1 -0
  145. package/dest/wallet/deploy_account_method.js +77 -0
  146. package/dest/wallet/index.d.ts +2 -15
  147. package/dest/wallet/index.d.ts.map +1 -1
  148. package/dest/wallet/index.js +2 -19
  149. package/dest/wallet/wallet.d.ts +2473 -6
  150. package/dest/wallet/wallet.d.ts.map +1 -1
  151. package/dest/wallet/wallet.js +202 -3
  152. package/package.json +25 -21
  153. package/src/account/account.ts +97 -0
  154. package/src/account/account_contract.ts +4 -6
  155. package/src/{wallet/account_wallet_with_private_key.ts → account/account_with_secret_key.ts} +6 -8
  156. package/src/account/index.ts +1 -4
  157. package/src/account/signerless_account.ts +46 -0
  158. package/src/api/abi.ts +11 -0
  159. package/src/api/account.ts +4 -2
  160. package/src/api/addresses.ts +1 -0
  161. package/src/api/authorization.ts +11 -0
  162. package/src/api/block.ts +2 -0
  163. package/src/api/contract.ts +16 -8
  164. package/src/api/crypto.ts +1 -0
  165. package/src/api/ethereum.ts +0 -1
  166. package/src/api/events.ts +44 -0
  167. package/src/api/fee.ts +1 -2
  168. package/src/api/keys.ts +8 -0
  169. package/src/api/log.ts +1 -0
  170. package/src/api/messaging.ts +2 -0
  171. package/src/api/node.ts +20 -0
  172. package/src/api/note.ts +1 -0
  173. package/src/api/protocol.ts +2 -0
  174. package/src/api/trees.ts +2 -0
  175. package/src/api/tx.ts +11 -0
  176. package/src/api/utils.ts +12 -19
  177. package/src/api/wallet.ts +33 -5
  178. package/src/contract/base_contract_interaction.ts +9 -138
  179. package/src/contract/batch_call.ts +52 -61
  180. package/src/contract/contract.ts +2 -12
  181. package/src/contract/contract_function_interaction.ts +65 -97
  182. package/src/contract/deploy_method.ts +117 -99
  183. package/src/contract/deploy_sent_tx.ts +4 -10
  184. package/src/contract/interaction_options.ts +126 -24
  185. package/src/contract/sent_tx.ts +4 -4
  186. package/src/contract/wait_for_proven.ts +4 -4
  187. package/src/deployment/publish_instance.ts +3 -8
  188. package/src/ethereum/portal_manager.ts +4 -12
  189. package/src/fee/fee_juice_payment_method_with_claim.ts +26 -17
  190. package/src/fee/fee_payment_method.ts +26 -0
  191. package/src/fee/private_fee_payment_method.ts +60 -41
  192. package/src/fee/public_fee_payment_method.ts +73 -49
  193. package/src/fee/sponsored_fee_payment.ts +6 -0
  194. package/src/utils/authwit.ts +250 -38
  195. package/src/utils/cross_chain.ts +53 -0
  196. package/src/utils/fee_juice.ts +4 -3
  197. package/src/wallet/account_entrypoint_meta_payment_method.ts +105 -0
  198. package/src/wallet/account_manager.ts +154 -0
  199. package/src/wallet/base_wallet.ts +287 -78
  200. package/src/wallet/deploy_account_method.ts +125 -0
  201. package/src/wallet/index.ts +2 -32
  202. package/src/wallet/wallet.ts +357 -29
  203. package/dest/account_manager/account_manager.d.ts +0 -119
  204. package/dest/account_manager/account_manager.d.ts.map +0 -1
  205. package/dest/account_manager/account_manager.js +0 -202
  206. package/dest/account_manager/deploy_account_sent_tx.d.ts +0 -30
  207. package/dest/account_manager/deploy_account_sent_tx.d.ts.map +0 -1
  208. package/dest/account_manager/deploy_account_sent_tx.js +0 -29
  209. package/dest/account_manager/index.d.ts +0 -3
  210. package/dest/account_manager/index.d.ts.map +0 -1
  211. package/dest/account_manager/index.js +0 -2
  212. package/dest/api/interfaces.d.ts +0 -2
  213. package/dest/api/interfaces.d.ts.map +0 -1
  214. package/dest/api/interfaces.js +0 -1
  215. package/dest/api/log_id.d.ts +0 -2
  216. package/dest/api/log_id.d.ts.map +0 -1
  217. package/dest/api/log_id.js +0 -1
  218. package/dest/api/rpc.d.ts +0 -3
  219. package/dest/api/rpc.d.ts.map +0 -1
  220. package/dest/api/rpc.js +0 -2
  221. package/dest/api/tx_hash.d.ts +0 -2
  222. package/dest/api/tx_hash.d.ts.map +0 -1
  223. package/dest/api/tx_hash.js +0 -1
  224. package/dest/contract/deploy_proven_tx.d.ts +0 -21
  225. package/dest/contract/deploy_proven_tx.d.ts.map +0 -1
  226. package/dest/contract/deploy_proven_tx.js +0 -21
  227. package/dest/contract/proven_tx.d.ts +0 -21
  228. package/dest/contract/proven_tx.d.ts.map +0 -1
  229. package/dest/contract/proven_tx.js +0 -23
  230. package/dest/ethereum/l1_contracts.d.ts +0 -3
  231. package/dest/ethereum/l1_contracts.d.ts.map +0 -1
  232. package/dest/ethereum/l1_contracts.js +0 -13
  233. package/dest/fee/account_entrypoint_meta_payment_method.d.ts.map +0 -1
  234. package/dest/fee/account_entrypoint_meta_payment_method.js +0 -64
  235. package/dest/fee/fee_juice_payment_method.d.ts +0 -14
  236. package/dest/fee/fee_juice_payment_method.d.ts.map +0 -1
  237. package/dest/fee/fee_juice_payment_method.js +0 -21
  238. package/dest/fee/utils.d.ts +0 -13
  239. package/dest/fee/utils.d.ts.map +0 -1
  240. package/dest/fee/utils.js +0 -32
  241. package/dest/index.d.ts +0 -59
  242. package/dest/index.d.ts.map +0 -1
  243. package/dest/index.js +0 -62
  244. package/dest/rpc_clients/node/index.d.ts +0 -12
  245. package/dest/rpc_clients/node/index.d.ts.map +0 -1
  246. package/dest/rpc_clients/node/index.js +0 -72
  247. package/dest/rpc_clients/pxe_client.d.ts +0 -10
  248. package/dest/rpc_clients/pxe_client.d.ts.map +0 -1
  249. package/dest/rpc_clients/pxe_client.js +0 -23
  250. package/dest/utils/pxe.d.ts +0 -4
  251. package/dest/utils/pxe.d.ts.map +0 -1
  252. package/dest/utils/pxe.js +0 -14
  253. package/dest/wallet/account_wallet.d.ts +0 -74
  254. package/dest/wallet/account_wallet.d.ts.map +0 -1
  255. package/dest/wallet/account_wallet.js +0 -232
  256. package/dest/wallet/account_wallet_with_private_key.d.ts.map +0 -1
  257. package/dest/wallet/signerless_wallet.d.ts +0 -23
  258. package/dest/wallet/signerless_wallet.d.ts.map +0 -1
  259. package/dest/wallet/signerless_wallet.js +0 -33
  260. package/src/account_manager/account_manager.ts +0 -276
  261. package/src/account_manager/deploy_account_sent_tx.ts +0 -46
  262. package/src/account_manager/index.ts +0 -2
  263. package/src/api/interfaces.ts +0 -1
  264. package/src/api/log_id.ts +0 -1
  265. package/src/api/rpc.ts +0 -2
  266. package/src/api/tx_hash.ts +0 -1
  267. package/src/contract/deploy_proven_tx.ts +0 -45
  268. package/src/contract/proven_tx.ts +0 -36
  269. package/src/ethereum/l1_contracts.ts +0 -21
  270. package/src/fee/account_entrypoint_meta_payment_method.ts +0 -89
  271. package/src/fee/fee_juice_payment_method.ts +0 -25
  272. package/src/fee/utils.ts +0 -39
  273. package/src/index.ts +0 -85
  274. package/src/rpc_clients/node/index.ts +0 -77
  275. package/src/rpc_clients/pxe_client.ts +0 -25
  276. package/src/utils/pxe.ts +0 -17
  277. package/src/wallet/account_wallet.ts +0 -246
  278. package/src/wallet/signerless_wallet.ts +0 -56
@@ -1 +1 @@
1
- {"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,gBAAgB,GACnC,IAAI,CACF,GAAG,EACD,YAAY,GACZ,iBAAiB,GACjB,WAAW,GACX,QAAQ,GACR,0BAA0B,GAC1B,qBAAqB,GACrB,kBAAkB,GAClB,uBAAuB,GACvB,SAAS,GACT,aAAa,GACb,YAAY,GACZ,oBAAoB,GACpB,gBAAgB,GAChB,gBAAgB,GAChB,YAAY,GACZ,cAAc,GACd,cAAc,GACd,kBAAkB,GAClB,iBAAiB,CACpB,GAAG;IACF,aAAa,CAAC,MAAM,EAAE,eAAe,GAAG,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CAC7E,CAAC"}
1
+ {"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAEL,KAAK,gBAAgB,EAErB,KAAK,uBAAu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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiB9B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIE,CAAC;AAEtC,eAAO,MAAM,2BAA2B;;;;;;;;;;;;oBA7IM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAiBG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAAD,CAAC;;;EAgIT,CAAC;AAE3C,eAAO,MAAM,6BAA6B;;;;;;;;;;;;EAIxC,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,MAAM,CA+C7C,CAAC"}
@@ -1,3 +1,202 @@
1
- /**
2
- * The wallet interface.
3
- */ export { };
1
+ import { AbiTypeSchema, ContractArtifactSchema, FunctionAbiSchema, FunctionType } from '@aztec/stdlib/abi';
2
+ import { AuthWitness } from '@aztec/stdlib/auth-witness';
3
+ import { ContractClassWithIdSchema, ContractInstanceWithAddressSchema } from '@aztec/stdlib/contract';
4
+ import { Gas } from '@aztec/stdlib/gas';
5
+ import { PublicKeys } from '@aztec/stdlib/keys';
6
+ import { AbiDecodedSchema, optional, schemas } from '@aztec/stdlib/schemas';
7
+ import { Capsule, HashedValues, TxHash, TxProfileResult, TxReceipt, TxSimulationResult, UtilitySimulationResult } from '@aztec/stdlib/tx';
8
+ import { z } from 'zod';
9
+ export const ContractInstantiationDataSchema = z.object({
10
+ constructorArtifact: optional(z.union([
11
+ FunctionAbiSchema,
12
+ z.string()
13
+ ])),
14
+ constructorArgs: optional(z.array(z.any())),
15
+ skipArgsDecoding: optional(z.boolean()),
16
+ salt: schemas.Fr,
17
+ publicKeys: optional(PublicKeys.schema),
18
+ deployer: optional(schemas.AztecAddress)
19
+ });
20
+ export const FunctionCallSchema = z.object({
21
+ name: z.string(),
22
+ to: schemas.AztecAddress,
23
+ selector: schemas.FunctionSelector,
24
+ type: z.nativeEnum(FunctionType),
25
+ isStatic: z.boolean(),
26
+ hideMsgSender: z.boolean(),
27
+ args: z.array(schemas.Fr),
28
+ returnTypes: z.array(AbiTypeSchema)
29
+ });
30
+ export const ExecutionPayloadSchema = z.object({
31
+ calls: z.array(FunctionCallSchema),
32
+ authWitnesses: z.array(AuthWitness.schema),
33
+ capsules: z.array(Capsule.schema),
34
+ extraHashedArgs: z.array(HashedValues.schema)
35
+ });
36
+ export const UserFeeOptionsSchema = z.object({
37
+ gasSettings: optional(z.object({
38
+ gasLimits: optional(Gas.schema),
39
+ teardownGasLimits: optional(Gas.schema),
40
+ maxFeePerGas: optional(z.object({
41
+ feePerDaGas: schemas.BigInt,
42
+ feePerL2Gas: schemas.BigInt
43
+ })),
44
+ maxPriorityFeePerGas: optional(z.object({
45
+ feePerDaGas: schemas.BigInt,
46
+ feePerL2Gas: schemas.BigInt
47
+ }))
48
+ })),
49
+ embeddedPaymentMethodFeePayer: optional(schemas.AztecAddress)
50
+ });
51
+ export const WalletSimulationFeeOptionSchema = UserFeeOptionsSchema.extend({
52
+ estimatedGasPadding: optional(z.number()),
53
+ estimateGas: optional(z.boolean())
54
+ });
55
+ export const SendOptionsSchema = z.object({
56
+ from: schemas.AztecAddress,
57
+ authWitnesses: optional(z.array(AuthWitness.schema)),
58
+ capsules: optional(z.array(Capsule.schema)),
59
+ fee: optional(UserFeeOptionsSchema)
60
+ });
61
+ export const SimulateOptionsSchema = z.object({
62
+ from: schemas.AztecAddress,
63
+ authWitnesses: optional(z.array(AuthWitness.schema)),
64
+ capsules: optional(z.array(Capsule.schema)),
65
+ fee: optional(WalletSimulationFeeOptionSchema),
66
+ skipTxValidation: optional(z.boolean()),
67
+ skipFeeEnforcement: optional(z.boolean()),
68
+ includeMetadata: optional(z.boolean())
69
+ });
70
+ export const ProfileOptionsSchema = SimulateOptionsSchema.extend({
71
+ profileMode: z.enum([
72
+ 'gates',
73
+ 'execution-steps',
74
+ 'full'
75
+ ]),
76
+ skipProofGeneration: optional(z.boolean())
77
+ });
78
+ export const InstanceDataSchema = z.union([
79
+ schemas.AztecAddress,
80
+ ContractInstanceWithAddressSchema,
81
+ ContractInstantiationDataSchema,
82
+ z.object({
83
+ instance: ContractInstanceWithAddressSchema,
84
+ artifact: ContractArtifactSchema
85
+ })
86
+ ]);
87
+ export const MessageHashOrIntentSchema = z.union([
88
+ schemas.Fr,
89
+ schemas.Buffer,
90
+ z.object({
91
+ consumer: schemas.AztecAddress,
92
+ innerHash: z.union([
93
+ schemas.Buffer,
94
+ schemas.Fr
95
+ ])
96
+ }),
97
+ z.object({
98
+ caller: schemas.AztecAddress,
99
+ call: FunctionCallSchema
100
+ })
101
+ ]);
102
+ export const BatchedMethodSchema = z.union([
103
+ z.object({
104
+ name: z.literal('registerSender'),
105
+ args: z.tuple([
106
+ schemas.AztecAddress,
107
+ optional(z.string())
108
+ ])
109
+ }),
110
+ z.object({
111
+ name: z.literal('registerContract'),
112
+ args: z.tuple([
113
+ InstanceDataSchema,
114
+ optional(ContractArtifactSchema),
115
+ optional(schemas.Fr)
116
+ ])
117
+ }),
118
+ z.object({
119
+ name: z.literal('sendTx'),
120
+ args: z.tuple([
121
+ ExecutionPayloadSchema,
122
+ SendOptionsSchema
123
+ ])
124
+ }),
125
+ z.object({
126
+ name: z.literal('simulateUtility'),
127
+ args: z.tuple([
128
+ z.string(),
129
+ z.array(z.any()),
130
+ schemas.AztecAddress,
131
+ optional(z.array(AuthWitness.schema))
132
+ ])
133
+ })
134
+ ]);
135
+ export const ContractMetadataSchema = z.object({
136
+ contractInstance: z.union([
137
+ ContractInstanceWithAddressSchema,
138
+ z.undefined()
139
+ ]),
140
+ isContractInitialized: z.boolean(),
141
+ isContractPublished: z.boolean()
142
+ });
143
+ export const ContractClassMetadataSchema = z.object({
144
+ contractClass: z.union([
145
+ ContractClassWithIdSchema,
146
+ z.undefined()
147
+ ]),
148
+ isContractClassPubliclyRegistered: z.boolean(),
149
+ artifact: z.union([
150
+ ContractArtifactSchema,
151
+ z.undefined()
152
+ ])
153
+ });
154
+ export const EventMetadataDefinitionSchema = z.object({
155
+ eventSelector: schemas.EventSelector,
156
+ abiType: AbiTypeSchema,
157
+ fieldNames: z.array(z.string())
158
+ });
159
+ export const WalletSchema = {
160
+ getChainInfo: z.function().args().returns(z.object({
161
+ chainId: schemas.Fr,
162
+ version: schemas.Fr
163
+ })),
164
+ getContractClassMetadata: z.function().args(schemas.Fr, optional(z.boolean())).returns(ContractClassMetadataSchema),
165
+ getContractMetadata: z.function().args(schemas.AztecAddress).returns(ContractMetadataSchema),
166
+ getTxReceipt: z.function().args(TxHash.schema).returns(TxReceipt.schema),
167
+ getPrivateEvents: z.function().args(schemas.AztecAddress, EventMetadataDefinitionSchema, z.number(), z.number(), z.array(schemas.AztecAddress)).returns(z.array(AbiDecodedSchema)),
168
+ registerSender: z.function().args(schemas.AztecAddress, optional(z.string())).returns(schemas.AztecAddress),
169
+ getAddressBook: z.function().args().returns(z.array(z.object({
170
+ alias: z.string(),
171
+ item: schemas.AztecAddress
172
+ }))),
173
+ getAccounts: z.function().args().returns(z.array(z.object({
174
+ alias: z.string(),
175
+ item: schemas.AztecAddress
176
+ }))),
177
+ registerContract: z.function().args(InstanceDataSchema, optional(ContractArtifactSchema), optional(schemas.Fr)).returns(ContractInstanceWithAddressSchema),
178
+ simulateTx: z.function().args(ExecutionPayloadSchema, SimulateOptionsSchema).returns(TxSimulationResult.schema),
179
+ simulateUtility: z.function().args(z.string(), z.array(z.any()), schemas.AztecAddress, optional(z.array(AuthWitness.schema))).returns(UtilitySimulationResult.schema),
180
+ profileTx: z.function().args(ExecutionPayloadSchema, ProfileOptionsSchema).returns(TxProfileResult.schema),
181
+ sendTx: z.function().args(ExecutionPayloadSchema, SendOptionsSchema).returns(TxHash.schema),
182
+ createAuthWit: z.function().args(schemas.AztecAddress, MessageHashOrIntentSchema).returns(AuthWitness.schema),
183
+ // @ts-expect-error - ApiSchemaFor cannot properly type generic methods with readonly arrays
184
+ batch: z.function().args(z.array(BatchedMethodSchema)).returns(z.array(z.discriminatedUnion('name', [
185
+ z.object({
186
+ name: z.literal('registerSender'),
187
+ result: schemas.AztecAddress
188
+ }),
189
+ z.object({
190
+ name: z.literal('registerContract'),
191
+ result: ContractInstanceWithAddressSchema
192
+ }),
193
+ z.object({
194
+ name: z.literal('sendTx'),
195
+ result: TxHash.schema
196
+ }),
197
+ z.object({
198
+ name: z.literal('simulateUtility'),
199
+ result: UtilitySimulationResult.schema
200
+ })
201
+ ])))
202
+ };
package/package.json CHANGED
@@ -1,29 +1,32 @@
1
1
  {
2
2
  "name": "@aztec/aztec.js",
3
3
  "homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/aztec.js",
4
- "version": "3.0.0-canary.a9708bd",
4
+ "version": "3.0.0-devnet.2",
5
5
  "type": "module",
6
6
  "exports": {
7
- ".": "./dest/index.js",
8
- "./interfaces": "./dest/api/interfaces.js",
9
7
  "./abi": "./dest/api/abi.js",
10
8
  "./account": "./dest/api/account.js",
11
9
  "./addresses": "./dest/api/addresses.js",
12
- "./cheatcodes": "./dest/api/cheatcodes.js",
10
+ "./authorization": "./dest/api/authorization.js",
11
+ "./block": "./dest/api/block.js",
13
12
  "./contracts": "./dest/api/contract.js",
13
+ "./crypto": "./dest/api/crypto.js",
14
14
  "./deployment": "./dest/api/deployment.js",
15
- "./entrypoint": "./dest/api/entrypoint.js",
16
- "./eth_address": "./dest/api/eth_address.js",
17
15
  "./ethereum": "./dest/api/ethereum.js",
16
+ "./events": "./dest/api/events.js",
18
17
  "./fee": "./dest/api/fee.js",
18
+ "./fee/testing": "./dest/api/fee_testing.js",
19
19
  "./fields": "./dest/api/fields.js",
20
+ "./keys": "./dest/api/keys.js",
20
21
  "./log": "./dest/api/log.js",
21
- "./log_id": "./dest/api/log_id.js",
22
- "./rpc": "./dest/api/rpc.js",
23
- "./tx_hash": "./dest/api/tx_hash.js",
24
- "./wallet": "./dest/api/wallet.js",
22
+ "./messaging": "./dest/api/messaging.js",
23
+ "./node": "./dest/api/node.js",
24
+ "./note": "./dest/api/note.js",
25
+ "./protocol": "./dest/api/protocol.js",
26
+ "./trees": "./dest/api/trees.js",
27
+ "./tx": "./dest/api/tx.js",
25
28
  "./utils": "./dest/api/utils.js",
26
- "./fee/testing": "./dest/api/fee_testing.js"
29
+ "./wallet": "./dest/api/wallet.js"
27
30
  },
28
31
  "typedocOptions": {
29
32
  "entryPoints": [
@@ -81,16 +84,17 @@
81
84
  ]
82
85
  },
83
86
  "dependencies": {
84
- "@aztec/constants": "3.0.0-canary.a9708bd",
85
- "@aztec/entrypoints": "3.0.0-canary.a9708bd",
86
- "@aztec/ethereum": "3.0.0-canary.a9708bd",
87
- "@aztec/foundation": "3.0.0-canary.a9708bd",
88
- "@aztec/l1-artifacts": "3.0.0-canary.a9708bd",
89
- "@aztec/protocol-contracts": "3.0.0-canary.a9708bd",
90
- "@aztec/stdlib": "3.0.0-canary.a9708bd",
91
- "axios": "^1.8.2",
87
+ "@aztec/constants": "3.0.0-devnet.2",
88
+ "@aztec/entrypoints": "3.0.0-devnet.2",
89
+ "@aztec/ethereum": "3.0.0-devnet.2",
90
+ "@aztec/foundation": "3.0.0-devnet.2",
91
+ "@aztec/l1-artifacts": "3.0.0-devnet.2",
92
+ "@aztec/protocol-contracts": "3.0.0-devnet.2",
93
+ "@aztec/stdlib": "3.0.0-devnet.2",
94
+ "axios": "^1.12.0",
92
95
  "tslib": "^2.4.0",
93
- "viem": "2.23.7"
96
+ "viem": "npm:@spalladino/viem@2.38.2-eip7594.0",
97
+ "zod": "^3.23.8"
94
98
  },
95
99
  "devDependencies": {
96
100
  "@jest/globals": "^30.0.0",
@@ -103,7 +107,7 @@
103
107
  "process": "^0.11.10",
104
108
  "resolve-typescript-plugin": "^2.0.1",
105
109
  "stream-browserify": "^3.0.0",
106
- "ts-loader": "^9.4.4",
110
+ "ts-loader": "^9.5.4",
107
111
  "ts-node": "^10.9.1",
108
112
  "typescript": "^5.3.3",
109
113
  "util": "^0.12.5"
@@ -0,0 +1,97 @@
1
+ import type { DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
2
+ import type { ExecutionPayload } from '@aztec/entrypoints/payload';
3
+ import { Fr } from '@aztec/foundation/fields';
4
+ import { AuthWitness } from '@aztec/stdlib/auth-witness';
5
+ import type { GasSettings } from '@aztec/stdlib/gas';
6
+ import type { TxExecutionRequest } from '@aztec/stdlib/tx';
7
+
8
+ import { type CallIntent, type IntentInnerHash, computeAuthWitMessageHash } from '../utils/authwit.js';
9
+ import type { AccountInterface } from './interface.js';
10
+
11
+ /**
12
+ * An authwit provider that can create both private and public authwits
13
+ * with an intent as input, as opposed to just a precomputed inner hash
14
+ */
15
+ interface AuthwitnessIntentProvider {
16
+ /**
17
+ * Creates a private authwit from an intent or inner hash, to be provided
18
+ * during function execution
19
+ * @param intent - The action (or inner hash) to authorize
20
+ */
21
+ createAuthWit(intent: IntentInnerHash | CallIntent | Buffer | Fr): Promise<AuthWitness>;
22
+ }
23
+
24
+ /**
25
+ * A type defining an account, capable of both creating authwits and using them
26
+ * to authenticate transaction execution requests.
27
+ */
28
+ export type Account = AccountInterface & AuthwitnessIntentProvider;
29
+
30
+ /**
31
+ * An account implementation that uses authwits as an authentication mechanism
32
+ * and can assemble transaction execution requests for an entrypoint.
33
+ */
34
+ export class BaseAccount implements Account {
35
+ constructor(protected account: AccountInterface) {}
36
+
37
+ createTxExecutionRequest(
38
+ exec: ExecutionPayload,
39
+ gasSettings: GasSettings,
40
+ options: DefaultAccountEntrypointOptions,
41
+ ): Promise<TxExecutionRequest> {
42
+ return this.account.createTxExecutionRequest(exec, gasSettings, options);
43
+ }
44
+
45
+ getChainId(): Fr {
46
+ return this.account.getChainId();
47
+ }
48
+
49
+ getVersion(): Fr {
50
+ return this.account.getVersion();
51
+ }
52
+
53
+ /** Returns the complete address of the account that implements this wallet. */
54
+ public getCompleteAddress() {
55
+ return this.account.getCompleteAddress();
56
+ }
57
+
58
+ /** Returns the address of the account that implements this wallet. */
59
+ public getAddress() {
60
+ return this.getCompleteAddress().address;
61
+ }
62
+
63
+ /**
64
+ * Computes an authentication witness from either a message hash or an intent.
65
+ *
66
+ * If a message hash is provided, it will create a witness for the hash directly.
67
+ * Otherwise, it will compute the message hash using the intent, along with the
68
+ * chain id and the version values provided by the wallet.
69
+ *
70
+ * @param messageHashOrIntent - The message hash of the intent to approve
71
+ * @returns The authentication witness
72
+ */
73
+ async createAuthWit(messageHashOrIntent: Fr | Buffer | CallIntent | IntentInnerHash): Promise<AuthWitness> {
74
+ let messageHash: Fr;
75
+ if (Buffer.isBuffer(messageHashOrIntent)) {
76
+ messageHash = Fr.fromBuffer(messageHashOrIntent);
77
+ } else if (messageHashOrIntent instanceof Fr) {
78
+ messageHash = messageHashOrIntent;
79
+ } else {
80
+ messageHash = await this.getMessageHash(messageHashOrIntent);
81
+ }
82
+
83
+ return this.account.createAuthWit(messageHash);
84
+ }
85
+
86
+ /**
87
+ * Returns the message hash for the given intent
88
+ *
89
+ * @param intent - A tuple of (consumer and inner hash) or (caller and action)
90
+ * @returns The message hash
91
+ */
92
+ private getMessageHash(intent: IntentInnerHash | CallIntent): Promise<Fr> {
93
+ const chainId = this.getChainId();
94
+ const version = this.getVersion();
95
+ return computeAuthWitMessageHash(intent, { chainId, version });
96
+ }
97
+ }
@@ -1,13 +1,12 @@
1
- import type { AuthWitnessProvider } from '@aztec/entrypoints/interfaces';
1
+ import type { AuthWitnessProvider, ChainInfo } from '@aztec/entrypoints/interfaces';
2
2
  import { Fr } from '@aztec/foundation/fields';
3
3
  import type { ContractArtifact } from '@aztec/stdlib/abi';
4
- import type { CompleteAddress, NodeInfo } from '@aztec/stdlib/contract';
4
+ import type { CompleteAddress } from '@aztec/stdlib/contract';
5
5
  import { getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
6
6
  import { deriveKeys } from '@aztec/stdlib/keys';
7
7
 
8
8
  import type { AccountInterface } from './interface.js';
9
9
 
10
- // docs:start:account-contract-interface
11
10
  /**
12
11
  * An account contract instance. Knows its artifact, deployment arguments, how to create
13
12
  * transaction execution requests out of function calls, and how to authorize actions.
@@ -36,10 +35,10 @@ export interface AccountContract {
36
35
  * The account interface is responsible for assembling tx requests given requested function calls, and
37
36
  * for creating signed auth witnesses given action identifiers (message hashes).
38
37
  * @param address - Address of this account contract.
39
- * @param nodeInfo - Info on the chain where it is initialized / published.
38
+ * @param chainInfo - Chain id and version of the rollup where the account contract is initialized / published.
40
39
  * @returns An account interface instance for creating tx requests and authorizing actions.
41
40
  */
42
- getInterface(address: CompleteAddress, nodeInfo: NodeInfo): AccountInterface;
41
+ getInterface(address: CompleteAddress, chainInfo: ChainInfo): AccountInterface;
43
42
 
44
43
  /**
45
44
  * Returns the auth witness provider for the given address.
@@ -47,7 +46,6 @@ export interface AccountContract {
47
46
  */
48
47
  getAuthWitnessProvider(address: CompleteAddress): AuthWitnessProvider;
49
48
  }
50
- // docs:end:account-contract-interface
51
49
 
52
50
  /**
53
51
  * Compute the address of an account contract from secret and salt.
@@ -1,25 +1,23 @@
1
1
  import type { Fr } from '@aztec/foundation/fields';
2
- import type { PXE } from '@aztec/stdlib/interfaces/client';
3
2
  import { computeAddressSecret, deriveMasterIncomingViewingSecretKey } from '@aztec/stdlib/keys';
4
3
 
5
- import type { Salt } from '../account/index.js';
6
- import type { AccountInterface } from '../account/interface.js';
7
- import { AccountWallet } from './account_wallet.js';
4
+ import { BaseAccount } from './account.js';
5
+ import type { Salt } from './index.js';
6
+ import type { AccountInterface } from './interface.js';
8
7
 
9
8
  /**
10
- * Extends {@link AccountWallet} with the encryption private key. Not required for
9
+ * Extends {@link Account} with the encryption private key. Not required for
11
10
  * implementing the wallet interface but useful for testing purposes or exporting
12
11
  * an account to another pxe.
13
12
  */
14
- export class AccountWalletWithSecretKey extends AccountWallet {
13
+ export class AccountWithSecretKey extends BaseAccount {
15
14
  constructor(
16
- pxe: PXE,
17
15
  account: AccountInterface,
18
16
  private secretKey: Fr,
19
17
  /** Deployment salt for this account contract. */
20
18
  public readonly salt: Salt,
21
19
  ) {
22
- super(pxe, account);
20
+ super(account);
23
21
  }
24
22
 
25
23
  /** Returns the encryption private key associated with this account. */
@@ -1,8 +1,5 @@
1
1
  /**
2
- * The `account` module provides utilities for managing accounts. The {@link AccountManager} class
3
- * allows to instantiate, initialize and publish a fresh account, or to obtain a `Wallet` instance out of an
4
- * already-deployed account. Use the `@aztec/accounts` package to load default account implementations that rely
5
- * on ECDSA or Schnorr signatures.
2
+ * The `account` module provides utilities for managing accounts.
6
3
  *
7
4
  * @packageDocumentation
8
5
  */
@@ -0,0 +1,46 @@
1
+ import type { ChainInfo, EntrypointInterface } from '@aztec/entrypoints/interfaces';
2
+ import { DefaultMultiCallEntrypoint } from '@aztec/entrypoints/multicall';
3
+ import type { ExecutionPayload } from '@aztec/entrypoints/payload';
4
+ import type { Fr } from '@aztec/foundation/fields';
5
+ import { AuthWitness } from '@aztec/stdlib/auth-witness';
6
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
7
+ import type { CompleteAddress } from '@aztec/stdlib/contract';
8
+ import type { GasSettings } from '@aztec/stdlib/gas';
9
+ import type { TxExecutionRequest } from '@aztec/stdlib/tx';
10
+
11
+ import type { CallIntent, IntentInnerHash } from '../utils/authwit.js';
12
+ import type { Account } from './account.js';
13
+
14
+ /**
15
+ * Account implementation which creates a transaction using the multicall protocol contract as entrypoint.
16
+ */
17
+ export class SignerlessAccount implements Account {
18
+ private entrypoint: EntrypointInterface;
19
+ constructor(chainInfo: ChainInfo) {
20
+ this.entrypoint = new DefaultMultiCallEntrypoint(chainInfo.chainId.toNumber(), chainInfo.version.toNumber());
21
+ }
22
+
23
+ createTxExecutionRequest(exec: ExecutionPayload, gasSettings: GasSettings): Promise<TxExecutionRequest> {
24
+ return this.entrypoint.createTxExecutionRequest(exec, gasSettings);
25
+ }
26
+
27
+ getChainId(): Fr {
28
+ throw new Error('SignerlessAccount: Method getChainId not implemented.');
29
+ }
30
+
31
+ getVersion(): Fr {
32
+ throw new Error('SignerlessAccount: Method getVersion not implemented.');
33
+ }
34
+
35
+ getCompleteAddress(): CompleteAddress {
36
+ throw new Error('SignerlessAccount: Method getCompleteAddress not implemented.');
37
+ }
38
+
39
+ getAddress(): AztecAddress {
40
+ throw new Error('SignerlessAccount: Method getAddress not implemented.');
41
+ }
42
+
43
+ createAuthWit(_intent: Fr | Buffer | IntentInnerHash | CallIntent): Promise<AuthWitness> {
44
+ throw new Error('SignerlessAccount: Method createAuthWit not implemented.');
45
+ }
46
+ }
package/src/api/abi.ts CHANGED
@@ -23,3 +23,14 @@ export {
23
23
  contractArtifactFromBuffer,
24
24
  } from '@aztec/stdlib/abi';
25
25
  export { type NoirCompiledContract } from '@aztec/stdlib/noir';
26
+
27
+ // Type converters for flexible parameter types in contract calls
28
+ export {
29
+ type AztecAddressLike,
30
+ type EthAddressLike,
31
+ type EventSelectorLike,
32
+ type FieldLike,
33
+ type FunctionSelectorLike,
34
+ type U128Like,
35
+ type WrappedFieldLike,
36
+ } from '../utils/abi_types.js';
@@ -1,4 +1,6 @@
1
1
  export { type AccountContract, type AccountInterface, type Salt, getAccountContractAddress } from '../account/index.js';
2
- export type { AuthWitnessProvider } from '@aztec/entrypoints/interfaces';
2
+ export type { AuthWitnessProvider, ChainInfo } from '@aztec/entrypoints/interfaces';
3
3
 
4
- export { AccountManager, type DeployAccountOptions } from '../account_manager/index.js';
4
+ export { AccountWithSecretKey } from '../account/account_with_secret_key.js';
5
+ export { type Account, BaseAccount } from '../account/account.js';
6
+ export { SignerlessAccount } from '../account/signerless_account.js';
@@ -1,2 +1,3 @@
1
1
  export { AztecAddress } from '@aztec/stdlib/aztec-address';
2
2
  export { CompleteAddress } from '@aztec/stdlib/contract';
3
+ export { EthAddress } from '@aztec/foundation/eth-address';
@@ -1,3 +1,14 @@
1
1
  export { AuthWitness } from '@aztec/stdlib/auth-witness';
2
+ export {
3
+ SetPublicAuthwitContractInteraction,
4
+ type ContractFunctionInteractionCallIntent,
5
+ getMessageHashFromIntent,
6
+ computeAuthWitMessageHash,
7
+ computeInnerAuthWitHashFromAction,
8
+ lookupValidity,
9
+ type CallIntent,
10
+ type IntentInnerHash,
11
+ } from '../utils/authwit.js';
12
+ export { computeInnerAuthWitHash } from '@aztec/stdlib/auth-witness';
2
13
 
3
14
  export { CallAuthorizationRequest } from '../authorization/call_authorization_request.js';
@@ -0,0 +1,2 @@
1
+ export { Body, L2Block } from '@aztec/stdlib/block';
2
+ export { getTimestampRangeForEpoch } from '@aztec/stdlib/epoch-helpers';
@@ -26,7 +26,7 @@
26
26
  * or obtaining the `request` for aggregating into a {@link BatchCall}.
27
27
  *
28
28
  * The result of `send`ing a transaction is a {@link SentTx} object, from which you can get the
29
- * transaction hash, or simply `wait` until the transaction is mined and the local PXE Service
29
+ * transaction hash, or simply `wait` until the transaction is mined and the local PXE
30
30
  * has synchronized its changes.
31
31
  *
32
32
  * @remarks If you are using typescript, consider using the
@@ -39,20 +39,28 @@ export { Contract } from '../contract/contract.js';
39
39
  export { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
40
40
 
41
41
  export {
42
- type RequestMethodOptions,
43
- type SendMethodOptions,
44
- type ProfileMethodOptions,
45
- type SimulateMethodOptions,
42
+ type RequestInteractionOptions,
43
+ type SendInteractionOptions,
44
+ type ProfileInteractionOptions,
45
+ type SimulateInteractionOptions,
46
+ type InteractionFeeOptions,
47
+ toProfileOptions,
48
+ toSendOptions,
49
+ toSimulateOptions,
46
50
  } from '../contract/interaction_options.js';
47
51
 
48
- export { TxProfileResult } from '@aztec/stdlib/tx';
49
52
  export { DefaultWaitOpts, SentTx, type WaitOpts } from '../contract/sent_tx.js';
50
- export { ProvenTx } from '../contract/proven_tx.js';
51
53
  export { ContractBase, type ContractMethod, type ContractStorageLayout } from '../contract/contract_base.js';
52
54
  export { BatchCall } from '../contract/batch_call.js';
53
- export { type DeployOptions, DeployMethod } from '../contract/deploy_method.js';
55
+ export {
56
+ type DeployOptions,
57
+ DeployMethod,
58
+ type RequestDeployOptions,
59
+ type SimulateDeployOptions,
60
+ } from '../contract/deploy_method.js';
54
61
  export { DeploySentTx } from '../contract/deploy_sent_tx.js';
55
62
  export { waitForProven, type WaitForProvenOpts, DefaultWaitForProvenOpts } from '../contract/wait_for_proven.js';
63
+ export { getGasLimits } from '../contract/get_gas_limits.js';
56
64
 
57
65
  export {
58
66
  type PartialAddress,
@@ -0,0 +1 @@
1
+ export { computeSecretHash } from '@aztec/stdlib/hash';
@@ -8,4 +8,3 @@ export {
8
8
  type L2Claim,
9
9
  generateClaimSecret,
10
10
  } from '../ethereum/portal_manager.js';
11
- export { getL1ContractAddresses } from '../ethereum/l1_contracts.js';