@aztec/aztec.js 0.0.0-test.1 → 0.0.1-commit.023c3e5

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 (450) hide show
  1. package/README.md +1 -1
  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 +42 -0
  6. package/dest/account/account_contract.d.ts.map +1 -0
  7. package/dest/account/{contract.js → account_contract.js} +7 -4
  8. package/dest/account/account_with_secret_key.d.ts +36 -0
  9. package/dest/account/account_with_secret_key.d.ts.map +1 -0
  10. package/dest/{wallet/account_wallet_with_private_key.js → account/account_with_secret_key.js} +22 -5
  11. package/dest/account/index.d.ts +6 -9
  12. package/dest/account/index.d.ts.map +1 -1
  13. package/dest/account/index.js +4 -6
  14. package/dest/account/signerless_account.d.ts +22 -0
  15. package/dest/account/signerless_account.d.ts.map +1 -0
  16. package/dest/account/signerless_account.js +24 -0
  17. package/dest/api/abi.d.ts +3 -2
  18. package/dest/api/abi.d.ts.map +1 -1
  19. package/dest/api/abi.js +1 -1
  20. package/dest/api/account.d.ts +5 -3
  21. package/dest/api/account.d.ts.map +1 -1
  22. package/dest/api/account.js +3 -2
  23. package/dest/api/addresses.d.ts +2 -1
  24. package/dest/api/addresses.d.ts.map +1 -1
  25. package/dest/api/addresses.js +1 -0
  26. package/dest/api/authorization.d.ts +5 -0
  27. package/dest/api/authorization.d.ts.map +1 -0
  28. package/dest/api/authorization.js +4 -0
  29. package/dest/api/block.d.ts +3 -0
  30. package/dest/api/block.d.ts.map +1 -0
  31. package/dest/api/block.js +2 -0
  32. package/dest/api/contract.d.ts +55 -0
  33. package/dest/api/contract.d.ts.map +1 -0
  34. package/dest/api/contract.js +53 -0
  35. package/dest/api/crypto.d.ts +2 -0
  36. package/dest/api/crypto.d.ts.map +1 -0
  37. package/dest/api/crypto.js +1 -0
  38. package/dest/api/deployment.d.ts +5 -4
  39. package/dest/api/deployment.d.ts.map +1 -1
  40. package/dest/api/deployment.js +4 -3
  41. package/dest/api/eth_address.d.ts +1 -1
  42. package/dest/api/ethereum.d.ts +2 -0
  43. package/dest/api/ethereum.d.ts.map +1 -0
  44. package/dest/api/ethereum.js +1 -0
  45. package/dest/api/events.d.ts +12 -0
  46. package/dest/api/events.d.ts.map +1 -0
  47. package/dest/api/events.js +30 -0
  48. package/dest/api/fee.d.ts +2 -2
  49. package/dest/api/fee.d.ts.map +1 -1
  50. package/dest/api/fee.js +1 -1
  51. package/dest/api/fee_testing.d.ts +2 -0
  52. package/dest/api/fee_testing.d.ts.map +1 -0
  53. package/dest/api/fee_testing.js +1 -0
  54. package/dest/api/fields.d.ts +3 -2
  55. package/dest/api/fields.d.ts.map +1 -1
  56. package/dest/api/fields.js +2 -1
  57. package/dest/api/keys.d.ts +4 -0
  58. package/dest/api/keys.d.ts.map +1 -0
  59. package/dest/api/keys.js +3 -0
  60. package/dest/api/log.d.ts +2 -1
  61. package/dest/api/log.d.ts.map +1 -1
  62. package/dest/api/log.js +1 -0
  63. package/dest/api/messaging.d.ts +3 -0
  64. package/dest/api/messaging.d.ts.map +1 -0
  65. package/dest/api/messaging.js +2 -0
  66. package/dest/api/node.d.ts +25 -0
  67. package/dest/api/node.d.ts.map +1 -0
  68. package/dest/api/node.js +22 -0
  69. package/dest/api/note.d.ts +2 -0
  70. package/dest/api/note.d.ts.map +1 -0
  71. package/dest/api/note.js +1 -0
  72. package/dest/api/protocol.d.ts +9 -0
  73. package/dest/api/protocol.d.ts.map +1 -0
  74. package/dest/api/protocol.js +8 -0
  75. package/dest/api/trees.d.ts +3 -0
  76. package/dest/api/trees.d.ts.map +1 -0
  77. package/dest/api/trees.js +2 -0
  78. package/dest/api/tx.d.ts +2 -0
  79. package/dest/api/tx.d.ts.map +1 -0
  80. package/dest/api/tx.js +1 -0
  81. package/dest/api/utils.d.ts +13 -0
  82. package/dest/api/utils.d.ts.map +1 -0
  83. package/dest/api/utils.js +12 -0
  84. package/dest/api/wallet.d.ts +5 -2
  85. package/dest/api/wallet.d.ts.map +1 -1
  86. package/dest/api/wallet.js +4 -1
  87. package/dest/authorization/call_authorization_request.d.ts +67 -0
  88. package/dest/authorization/call_authorization_request.d.ts.map +1 -0
  89. package/dest/authorization/call_authorization_request.js +49 -0
  90. package/dest/contract/base_contract_interaction.d.ts +18 -84
  91. package/dest/contract/base_contract_interaction.d.ts.map +1 -1
  92. package/dest/contract/base_contract_interaction.js +11 -136
  93. package/dest/contract/batch_call.d.ts +19 -21
  94. package/dest/contract/batch_call.d.ts.map +1 -1
  95. package/dest/contract/batch_call.js +89 -69
  96. package/dest/contract/checker.d.ts +2 -2
  97. package/dest/contract/checker.d.ts.map +1 -1
  98. package/dest/contract/checker.js +2 -2
  99. package/dest/contract/contract.d.ts +9 -8
  100. package/dest/contract/contract.d.ts.map +1 -1
  101. package/dest/contract/contract.js +10 -20
  102. package/dest/contract/contract_base.d.ts +8 -18
  103. package/dest/contract/contract_base.d.ts.map +1 -1
  104. package/dest/contract/contract_base.js +7 -14
  105. package/dest/contract/contract_function_interaction.d.ts +53 -45
  106. package/dest/contract/contract_function_interaction.d.ts.map +1 -1
  107. package/dest/contract/contract_function_interaction.js +78 -74
  108. package/dest/contract/deploy_method.d.ts +155 -62
  109. package/dest/contract/deploy_method.d.ts.map +1 -1
  110. package/dest/contract/deploy_method.js +152 -142
  111. package/dest/contract/get_gas_limits.d.ts +6 -7
  112. package/dest/contract/get_gas_limits.d.ts.map +1 -1
  113. package/dest/contract/get_gas_limits.js +9 -3
  114. package/dest/contract/interaction_options.d.ts +151 -0
  115. package/dest/contract/interaction_options.d.ts.map +1 -0
  116. package/dest/contract/interaction_options.js +53 -0
  117. package/dest/contract/protocol_contracts/auth-registry.d.ts +27 -0
  118. package/dest/contract/protocol_contracts/auth-registry.d.ts.map +1 -0
  119. package/dest/contract/protocol_contracts/auth-registry.js +558 -0
  120. package/dest/contract/protocol_contracts/contract-class-registry.d.ts +26 -0
  121. package/dest/contract/protocol_contracts/contract-class-registry.d.ts.map +1 -0
  122. package/dest/contract/protocol_contracts/contract-class-registry.js +385 -0
  123. package/dest/contract/protocol_contracts/contract-instance-registry.d.ts +22 -0
  124. package/dest/contract/protocol_contracts/contract-instance-registry.d.ts.map +1 -0
  125. package/dest/contract/protocol_contracts/contract-instance-registry.js +465 -0
  126. package/dest/contract/protocol_contracts/fee-juice.d.ts +21 -0
  127. package/dest/contract/protocol_contracts/fee-juice.d.ts.map +1 -0
  128. package/dest/contract/protocol_contracts/fee-juice.js +426 -0
  129. package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts +34 -0
  130. package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts.map +1 -0
  131. package/dest/contract/protocol_contracts/multi-call-entrypoint.js +575 -0
  132. package/dest/contract/protocol_contracts/public-checks.d.ts +26 -0
  133. package/dest/contract/protocol_contracts/public-checks.d.ts.map +1 -0
  134. package/dest/contract/protocol_contracts/public-checks.js +583 -0
  135. package/dest/contract/wait_for_proven.d.ts +17 -0
  136. package/dest/contract/wait_for_proven.d.ts.map +1 -0
  137. package/dest/contract/wait_for_proven.js +17 -0
  138. package/dest/contract/wait_opts.d.ts +16 -0
  139. package/dest/contract/wait_opts.d.ts.map +1 -0
  140. package/dest/contract/wait_opts.js +5 -0
  141. package/dest/deployment/broadcast_function.d.ts +4 -4
  142. package/dest/deployment/broadcast_function.d.ts.map +1 -1
  143. package/dest/deployment/broadcast_function.js +28 -24
  144. package/dest/deployment/contract_deployer.d.ts +2 -2
  145. package/dest/deployment/contract_deployer.d.ts.map +1 -1
  146. package/dest/deployment/contract_deployer.js +1 -1
  147. package/dest/deployment/publish_class.d.ts +6 -0
  148. package/dest/deployment/publish_class.d.ts.map +1 -0
  149. package/dest/deployment/publish_class.js +17 -0
  150. package/dest/deployment/publish_instance.d.ts +10 -0
  151. package/dest/deployment/publish_instance.d.ts.map +1 -0
  152. package/dest/deployment/publish_instance.js +11 -0
  153. package/dest/ethereum/portal_manager.d.ts +141 -0
  154. package/dest/ethereum/portal_manager.d.ts.map +1 -0
  155. package/dest/ethereum/portal_manager.js +345 -0
  156. package/dest/fee/fee_juice_payment_method_with_claim.d.ts +17 -12
  157. package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -1
  158. package/dest/fee/fee_juice_payment_method_with_claim.js +27 -17
  159. package/dest/fee/fee_payment_method.d.ts +12 -8
  160. package/dest/fee/fee_payment_method.d.ts.map +1 -1
  161. package/dest/fee/private_fee_payment_method.d.ts +26 -9
  162. package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
  163. package/dest/fee/private_fee_payment_method.js +45 -23
  164. package/dest/fee/public_fee_payment_method.d.ts +27 -10
  165. package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
  166. package/dest/fee/public_fee_payment_method.js +47 -25
  167. package/dest/fee/sponsored_fee_payment.d.ts +17 -0
  168. package/dest/fee/sponsored_fee_payment.d.ts.map +1 -0
  169. package/dest/fee/sponsored_fee_payment.js +34 -0
  170. package/dest/scripts/generate_protocol_contract_types.d.ts +2 -0
  171. package/dest/scripts/generate_protocol_contract_types.d.ts.map +1 -0
  172. package/dest/scripts/generate_protocol_contract_types.js +120 -0
  173. package/dest/utils/abi_types.d.ts +2 -4
  174. package/dest/utils/abi_types.d.ts.map +1 -1
  175. package/dest/utils/authwit.d.ts +85 -26
  176. package/dest/utils/authwit.d.ts.map +1 -1
  177. package/dest/utils/authwit.js +234 -41
  178. package/dest/utils/cross_chain.d.ts +24 -0
  179. package/dest/utils/cross_chain.d.ts.map +1 -0
  180. package/dest/utils/cross_chain.js +30 -0
  181. package/dest/utils/fee_juice.d.ts +4 -3
  182. package/dest/utils/fee_juice.d.ts.map +1 -1
  183. package/dest/utils/fee_juice.js +4 -3
  184. package/dest/utils/field_compressed_string.d.ts +1 -1
  185. package/dest/utils/field_compressed_string.d.ts.map +1 -1
  186. package/dest/utils/field_compressed_string.js +1 -1
  187. package/dest/utils/node.d.ts +13 -2
  188. package/dest/utils/node.d.ts.map +1 -1
  189. package/dest/utils/node.js +47 -1
  190. package/dest/utils/pub_key.d.ts +2 -2
  191. package/dest/utils/pub_key.d.ts.map +1 -1
  192. package/dest/utils/pub_key.js +2 -3
  193. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts +31 -0
  194. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -0
  195. package/dest/wallet/account_entrypoint_meta_payment_method.js +61 -0
  196. package/dest/wallet/account_manager.d.ts +63 -0
  197. package/dest/wallet/account_manager.d.ts.map +1 -0
  198. package/dest/wallet/account_manager.js +107 -0
  199. package/dest/wallet/capabilities.d.ts +444 -0
  200. package/dest/wallet/capabilities.d.ts.map +1 -0
  201. package/dest/wallet/capabilities.js +3 -0
  202. package/dest/wallet/deploy_account_method.d.ts +80 -0
  203. package/dest/wallet/deploy_account_method.d.ts.map +1 -0
  204. package/dest/wallet/deploy_account_method.js +79 -0
  205. package/dest/wallet/index.d.ts +4 -17
  206. package/dest/wallet/index.d.ts.map +1 -1
  207. package/dest/wallet/index.js +3 -20
  208. package/dest/wallet/wallet.d.ts +2590 -0
  209. package/dest/wallet/wallet.d.ts.map +1 -0
  210. package/dest/wallet/wallet.js +291 -0
  211. package/package.json +47 -36
  212. package/src/account/account.ts +72 -0
  213. package/src/account/account_contract.ts +66 -0
  214. package/src/account/account_with_secret_key.ts +63 -0
  215. package/src/account/index.ts +5 -8
  216. package/src/account/signerless_account.ts +46 -0
  217. package/src/api/abi.ts +26 -0
  218. package/src/api/account.ts +8 -5
  219. package/src/api/addresses.ts +1 -0
  220. package/src/api/authorization.ts +15 -0
  221. package/src/api/block.ts +2 -0
  222. package/src/api/contract.ts +88 -0
  223. package/src/api/crypto.ts +1 -0
  224. package/src/api/deployment.ts +4 -3
  225. package/src/api/ethereum.ts +10 -0
  226. package/src/api/events.ts +44 -0
  227. package/src/api/fee.ts +1 -1
  228. package/src/api/fee_testing.ts +1 -0
  229. package/src/api/fields.ts +2 -1
  230. package/src/api/keys.ts +8 -0
  231. package/src/api/log.ts +1 -0
  232. package/src/api/messaging.ts +2 -0
  233. package/src/api/node.ts +24 -0
  234. package/src/api/note.ts +1 -0
  235. package/src/api/protocol.ts +9 -0
  236. package/src/api/trees.ts +2 -0
  237. package/src/api/tx.ts +15 -0
  238. package/src/api/utils.ts +14 -0
  239. package/src/api/wallet.ts +72 -5
  240. package/src/authorization/call_authorization_request.ts +63 -0
  241. package/src/contract/base_contract_interaction.ts +40 -171
  242. package/src/contract/batch_call.ts +108 -57
  243. package/src/contract/checker.ts +8 -3
  244. package/src/contract/contract.ts +14 -21
  245. package/src/contract/contract_base.ts +9 -26
  246. package/src/contract/contract_function_interaction.ts +135 -106
  247. package/src/contract/deploy_method.ts +307 -143
  248. package/src/contract/get_gas_limits.ts +15 -8
  249. package/src/contract/interaction_options.ts +208 -0
  250. package/src/contract/protocol_contracts/auth-registry.ts +351 -0
  251. package/src/contract/protocol_contracts/contract-class-registry.ts +241 -0
  252. package/src/contract/protocol_contracts/contract-instance-registry.ts +302 -0
  253. package/src/contract/protocol_contracts/fee-juice.ts +264 -0
  254. package/src/contract/protocol_contracts/multi-call-entrypoint.ts +332 -0
  255. package/src/contract/protocol_contracts/public-checks.ts +316 -0
  256. package/src/contract/wait_for_proven.ts +38 -0
  257. package/src/contract/wait_opts.ts +21 -0
  258. package/src/deployment/broadcast_function.ts +58 -58
  259. package/src/deployment/contract_deployer.ts +4 -3
  260. package/src/deployment/publish_class.ts +34 -0
  261. package/src/deployment/publish_instance.ts +23 -0
  262. package/src/{api/ethereum → ethereum}/portal_manager.ts +166 -89
  263. package/src/fee/fee_juice_payment_method_with_claim.ts +49 -34
  264. package/src/fee/fee_payment_method.ts +11 -7
  265. package/src/fee/private_fee_payment_method.ts +80 -58
  266. package/src/fee/public_fee_payment_method.ts +94 -68
  267. package/src/fee/sponsored_fee_payment.ts +46 -0
  268. package/src/scripts/generate_protocol_contract_types.ts +150 -0
  269. package/src/utils/abi_types.ts +1 -1
  270. package/src/utils/authwit.ts +274 -54
  271. package/src/utils/cross_chain.ts +53 -0
  272. package/src/utils/fee_juice.ts +5 -5
  273. package/src/utils/field_compressed_string.ts +1 -1
  274. package/src/utils/node.ts +63 -1
  275. package/src/utils/pub_key.ts +3 -4
  276. package/src/wallet/account_entrypoint_meta_payment_method.ts +74 -0
  277. package/src/wallet/account_manager.ts +146 -0
  278. package/src/wallet/capabilities.ts +491 -0
  279. package/src/wallet/deploy_account_method.ts +150 -0
  280. package/src/wallet/index.ts +3 -33
  281. package/src/wallet/wallet.ts +533 -0
  282. package/dest/account/contract.d.ts +0 -37
  283. package/dest/account/contract.d.ts.map +0 -1
  284. package/dest/account/interface.d.ts +0 -31
  285. package/dest/account/interface.d.ts.map +0 -1
  286. package/dest/account/interface.js +0 -4
  287. package/dest/account/wallet.d.ts +0 -11
  288. package/dest/account/wallet.d.ts.map +0 -1
  289. package/dest/account/wallet.js +0 -3
  290. package/dest/account_manager/deploy_account_method.d.ts +0 -15
  291. package/dest/account_manager/deploy_account_method.d.ts.map +0 -1
  292. package/dest/account_manager/deploy_account_method.js +0 -43
  293. package/dest/account_manager/deploy_account_sent_tx.d.ts +0 -30
  294. package/dest/account_manager/deploy_account_sent_tx.d.ts.map +0 -1
  295. package/dest/account_manager/deploy_account_sent_tx.js +0 -29
  296. package/dest/account_manager/index.d.ts +0 -108
  297. package/dest/account_manager/index.d.ts.map +0 -1
  298. package/dest/account_manager/index.js +0 -159
  299. package/dest/api/cheat_codes.d.ts +0 -26
  300. package/dest/api/cheat_codes.d.ts.map +0 -1
  301. package/dest/api/cheat_codes.js +0 -25
  302. package/dest/api/entrypoint.d.ts +0 -2
  303. package/dest/api/entrypoint.d.ts.map +0 -1
  304. package/dest/api/entrypoint.js +0 -1
  305. package/dest/api/ethereum/anvil_test_watcher.d.ts +0 -32
  306. package/dest/api/ethereum/anvil_test_watcher.d.ts.map +0 -1
  307. package/dest/api/ethereum/anvil_test_watcher.js +0 -133
  308. package/dest/api/ethereum/chain_monitor.d.ts +0 -25
  309. package/dest/api/ethereum/chain_monitor.d.ts.map +0 -1
  310. package/dest/api/ethereum/chain_monitor.js +0 -74
  311. package/dest/api/ethereum/cheat_codes.d.ts +0 -63
  312. package/dest/api/ethereum/cheat_codes.d.ts.map +0 -1
  313. package/dest/api/ethereum/cheat_codes.js +0 -162
  314. package/dest/api/ethereum/index.d.ts +0 -7
  315. package/dest/api/ethereum/index.d.ts.map +0 -1
  316. package/dest/api/ethereum/index.js +0 -6
  317. package/dest/api/ethereum/l1_contracts.d.ts +0 -3
  318. package/dest/api/ethereum/l1_contracts.d.ts.map +0 -1
  319. package/dest/api/ethereum/l1_contracts.js +0 -13
  320. package/dest/api/ethereum/portal_manager.d.ts +0 -136
  321. package/dest/api/ethereum/portal_manager.d.ts.map +0 -1
  322. package/dest/api/ethereum/portal_manager.js +0 -286
  323. package/dest/api/interfaces/pxe.d.ts +0 -2
  324. package/dest/api/interfaces/pxe.d.ts.map +0 -1
  325. package/dest/api/interfaces/pxe.js +0 -1
  326. package/dest/api/log_id.d.ts +0 -2
  327. package/dest/api/log_id.d.ts.map +0 -1
  328. package/dest/api/log_id.js +0 -1
  329. package/dest/api/tx_hash.d.ts +0 -2
  330. package/dest/api/tx_hash.d.ts.map +0 -1
  331. package/dest/api/tx_hash.js +0 -1
  332. package/dest/contract/deploy_proven_tx.d.ts +0 -21
  333. package/dest/contract/deploy_proven_tx.d.ts.map +0 -1
  334. package/dest/contract/deploy_proven_tx.js +0 -19
  335. package/dest/contract/deploy_sent_tx.d.ts +0 -45
  336. package/dest/contract/deploy_sent_tx.d.ts.map +0 -1
  337. package/dest/contract/deploy_sent_tx.js +0 -43
  338. package/dest/contract/index.d.ts +0 -45
  339. package/dest/contract/index.d.ts.map +0 -1
  340. package/dest/contract/index.js +0 -43
  341. package/dest/contract/protocol_contracts.d.ts +0 -9
  342. package/dest/contract/protocol_contracts.d.ts.map +0 -1
  343. package/dest/contract/protocol_contracts.js +0 -26
  344. package/dest/contract/proven_tx.d.ts +0 -17
  345. package/dest/contract/proven_tx.d.ts.map +0 -1
  346. package/dest/contract/proven_tx.js +0 -22
  347. package/dest/contract/sent_tx.d.ts +0 -61
  348. package/dest/contract/sent_tx.d.ts.map +0 -1
  349. package/dest/contract/sent_tx.js +0 -102
  350. package/dest/contract/unsafe_contract.d.ts +0 -15
  351. package/dest/contract/unsafe_contract.d.ts.map +0 -1
  352. package/dest/contract/unsafe_contract.js +0 -6
  353. package/dest/deployment/deploy_instance.d.ts +0 -10
  354. package/dest/deployment/deploy_instance.d.ts.map +0 -1
  355. package/dest/deployment/deploy_instance.js +0 -14
  356. package/dest/deployment/index.d.ts +0 -2
  357. package/dest/deployment/index.d.ts.map +0 -1
  358. package/dest/deployment/index.js +0 -1
  359. package/dest/deployment/register_class.d.ts +0 -6
  360. package/dest/deployment/register_class.d.ts.map +0 -1
  361. package/dest/deployment/register_class.js +0 -22
  362. package/dest/entrypoint/default_entrypoint.d.ts +0 -12
  363. package/dest/entrypoint/default_entrypoint.d.ts.map +0 -1
  364. package/dest/entrypoint/default_entrypoint.js +0 -28
  365. package/dest/entrypoint/default_multi_call_entrypoint.d.ts +0 -15
  366. package/dest/entrypoint/default_multi_call_entrypoint.d.ts.map +0 -1
  367. package/dest/entrypoint/default_multi_call_entrypoint.js +0 -130
  368. package/dest/entrypoint/entrypoint.d.ts +0 -35
  369. package/dest/entrypoint/entrypoint.d.ts.map +0 -1
  370. package/dest/entrypoint/entrypoint.js +0 -4
  371. package/dest/entrypoint/payload.d.ts +0 -128
  372. package/dest/entrypoint/payload.d.ts.map +0 -1
  373. package/dest/entrypoint/payload.js +0 -143
  374. package/dest/fee/fee_juice_payment_method.d.ts +0 -14
  375. package/dest/fee/fee_juice_payment_method.d.ts.map +0 -1
  376. package/dest/fee/fee_juice_payment_method.js +0 -20
  377. package/dest/index.d.ts +0 -66
  378. package/dest/index.d.ts.map +0 -1
  379. package/dest/index.js +0 -69
  380. package/dest/rpc_clients/index.d.ts +0 -3
  381. package/dest/rpc_clients/index.d.ts.map +0 -1
  382. package/dest/rpc_clients/index.js +0 -2
  383. package/dest/rpc_clients/node/index.d.ts +0 -12
  384. package/dest/rpc_clients/node/index.d.ts.map +0 -1
  385. package/dest/rpc_clients/node/index.js +0 -78
  386. package/dest/rpc_clients/pxe_client.d.ts +0 -10
  387. package/dest/rpc_clients/pxe_client.d.ts.map +0 -1
  388. package/dest/rpc_clients/pxe_client.js +0 -23
  389. package/dest/utils/aztec_cheatcodes.d.ts +0 -59
  390. package/dest/utils/aztec_cheatcodes.d.ts.map +0 -1
  391. package/dest/utils/aztec_cheatcodes.js +0 -62
  392. package/dest/utils/index.d.ts +0 -8
  393. package/dest/utils/index.d.ts.map +0 -1
  394. package/dest/utils/index.js +0 -6
  395. package/dest/utils/pxe.d.ts +0 -4
  396. package/dest/utils/pxe.d.ts.map +0 -1
  397. package/dest/utils/pxe.js +0 -14
  398. package/dest/wallet/account_wallet.d.ts +0 -76
  399. package/dest/wallet/account_wallet.d.ts.map +0 -1
  400. package/dest/wallet/account_wallet.js +0 -231
  401. package/dest/wallet/account_wallet_with_private_key.d.ts +0 -26
  402. package/dest/wallet/account_wallet_with_private_key.d.ts.map +0 -1
  403. package/dest/wallet/base_wallet.d.ts +0 -73
  404. package/dest/wallet/base_wallet.d.ts.map +0 -1
  405. package/dest/wallet/base_wallet.js +0 -123
  406. package/dest/wallet/signerless_wallet.d.ts +0 -25
  407. package/dest/wallet/signerless_wallet.d.ts.map +0 -1
  408. package/dest/wallet/signerless_wallet.js +0 -36
  409. package/src/account/contract.ts +0 -56
  410. package/src/account/interface.ts +0 -36
  411. package/src/account/wallet.ts +0 -13
  412. package/src/account_manager/deploy_account_method.ts +0 -86
  413. package/src/account_manager/deploy_account_sent_tx.ts +0 -42
  414. package/src/account_manager/index.ts +0 -229
  415. package/src/api/cheat_codes.ts +0 -35
  416. package/src/api/entrypoint.ts +0 -1
  417. package/src/api/ethereum/anvil_test_watcher.ts +0 -158
  418. package/src/api/ethereum/chain_monitor.ts +0 -88
  419. package/src/api/ethereum/cheat_codes.ts +0 -184
  420. package/src/api/ethereum/index.ts +0 -19
  421. package/src/api/ethereum/l1_contracts.ts +0 -21
  422. package/src/api/interfaces/pxe.ts +0 -1
  423. package/src/api/log_id.ts +0 -1
  424. package/src/api/tx_hash.ts +0 -1
  425. package/src/contract/deploy_proven_tx.ts +0 -34
  426. package/src/contract/deploy_sent_tx.ts +0 -74
  427. package/src/contract/index.ts +0 -48
  428. package/src/contract/protocol_contracts.ts +0 -35
  429. package/src/contract/proven_tx.ts +0 -42
  430. package/src/contract/sent_tx.ts +0 -141
  431. package/src/contract/unsafe_contract.ts +0 -19
  432. package/src/deployment/deploy_instance.ts +0 -31
  433. package/src/deployment/index.ts +0 -1
  434. package/src/deployment/register_class.ts +0 -44
  435. package/src/entrypoint/default_entrypoint.ts +0 -39
  436. package/src/entrypoint/default_multi_call_entrypoint.ts +0 -93
  437. package/src/entrypoint/entrypoint.ts +0 -39
  438. package/src/entrypoint/payload.ts +0 -238
  439. package/src/fee/fee_juice_payment_method.ts +0 -26
  440. package/src/index.ts +0 -106
  441. package/src/rpc_clients/index.ts +0 -2
  442. package/src/rpc_clients/node/index.ts +0 -77
  443. package/src/rpc_clients/pxe_client.ts +0 -25
  444. package/src/utils/aztec_cheatcodes.ts +0 -77
  445. package/src/utils/index.ts +0 -21
  446. package/src/utils/pxe.ts +0 -17
  447. package/src/wallet/account_wallet.ts +0 -242
  448. package/src/wallet/account_wallet_with_private_key.ts +0 -40
  449. package/src/wallet/base_wallet.ts +0 -198
  450. package/src/wallet/signerless_wallet.ts +0 -52
@@ -1,286 +0,0 @@
1
- import { extractEvent } from '@aztec/ethereum/utils';
2
- import { sha256ToField } from '@aztec/foundation/crypto';
3
- import { EthAddress } from '@aztec/foundation/eth-address';
4
- import { Fr } from '@aztec/foundation/fields';
5
- import { FeeJuicePortalAbi, OutboxAbi, TestERC20Abi, TokenPortalAbi } from '@aztec/l1-artifacts';
6
- import { computeSecretHash } from '@aztec/stdlib/hash';
7
- import { getContract, toFunctionSelector } from 'viem';
8
- /** Stringifies an eth address for logging. */ function stringifyEthAddress(address, name) {
9
- return name ? `${name} (${address.toString()})` : address.toString();
10
- }
11
- /** Generates a pair secret and secret hash */ export async function generateClaimSecret(logger) {
12
- const secret = Fr.random();
13
- const secretHash = await computeSecretHash(secret);
14
- logger?.verbose(`Generated claim secret=${secret.toString()} hash=${secretHash.toString()}`);
15
- return [
16
- secret,
17
- secretHash
18
- ];
19
- }
20
- /** Helper for managing an ERC20 on L1. */ export class L1TokenManager {
21
- address;
22
- publicClient;
23
- walletClient;
24
- logger;
25
- contract;
26
- constructor(/** Address of the ERC20 contract. */ address, publicClient, walletClient, logger){
27
- this.address = address;
28
- this.publicClient = publicClient;
29
- this.walletClient = walletClient;
30
- this.logger = logger;
31
- this.contract = getContract({
32
- address: this.address.toString(),
33
- abi: TestERC20Abi,
34
- client: this.walletClient
35
- });
36
- }
37
- /**
38
- * Returns the balance of the given address.
39
- * @param address - Address to get the balance of.
40
- */ async getL1TokenBalance(address) {
41
- return await this.contract.read.balanceOf([
42
- address
43
- ]);
44
- }
45
- /**
46
- * Mints tokens for the given address. Returns once the tx has been mined.
47
- * @param amount - Amount to mint.
48
- * @param address - Address to mint the tokens for.
49
- * @param addressName - Optional name of the address for logging.
50
- */ async mint(amount, address, addressName) {
51
- this.logger.info(`Minting ${amount} tokens for ${stringifyEthAddress(address, addressName)}`);
52
- await this.publicClient.waitForTransactionReceipt({
53
- hash: await this.contract.write.mint([
54
- address,
55
- amount
56
- ])
57
- });
58
- }
59
- /**
60
- * Approves tokens for the given address. Returns once the tx has been mined.
61
- * @param amount - Amount to approve.
62
- * @param address - Address to approve the tokens for.
63
- * @param addressName - Optional name of the address for logging.
64
- */ async approve(amount, address, addressName = '') {
65
- this.logger.info(`Approving ${amount} tokens for ${stringifyEthAddress(address, addressName)}`);
66
- await this.publicClient.waitForTransactionReceipt({
67
- hash: await this.contract.write.approve([
68
- address,
69
- amount
70
- ])
71
- });
72
- }
73
- }
74
- /** Helper for interacting with the FeeJuicePortal on L1. */ export class L1FeeJuicePortalManager {
75
- publicClient;
76
- walletClient;
77
- logger;
78
- tokenManager;
79
- contract;
80
- constructor(portalAddress, tokenAddress, publicClient, walletClient, logger){
81
- this.publicClient = publicClient;
82
- this.walletClient = walletClient;
83
- this.logger = logger;
84
- this.tokenManager = new L1TokenManager(tokenAddress, publicClient, walletClient, logger);
85
- this.contract = getContract({
86
- address: portalAddress.toString(),
87
- abi: FeeJuicePortalAbi,
88
- client: this.walletClient
89
- });
90
- }
91
- /** Returns the associated token manager for the L1 ERC20. */ getTokenManager() {
92
- return this.tokenManager;
93
- }
94
- /**
95
- * Bridges fee juice from L1 to L2 publicly. Handles L1 ERC20 approvals. Returns once the tx has been mined.
96
- * @param to - Address to send the tokens to on L2.
97
- * @param amount - Amount of tokens to send.
98
- * @param mint - Whether to mint the tokens before sending (only during testing).
99
- */ async bridgeTokensPublic(to, amount, mint = false) {
100
- const [claimSecret, claimSecretHash] = await generateClaimSecret();
101
- if (mint) {
102
- await this.tokenManager.mint(amount, this.walletClient.account.address);
103
- }
104
- await this.tokenManager.approve(amount, this.contract.address, 'FeeJuice Portal');
105
- this.logger.info('Sending L1 Fee Juice to L2 to be claimed publicly');
106
- const args = [
107
- to.toString(),
108
- amount,
109
- claimSecretHash.toString()
110
- ];
111
- await this.contract.simulate.depositToAztecPublic(args);
112
- const txReceipt = await this.publicClient.waitForTransactionReceipt({
113
- hash: await this.contract.write.depositToAztecPublic(args)
114
- });
115
- this.logger.info('Deposited to Aztec public successfully');
116
- const log = extractEvent(txReceipt.logs, this.contract.address, this.contract.abi, 'DepositToAztecPublic', (log)=>log.args.secretHash === claimSecretHash.toString() && log.args.amount === amount && log.args.to === to.toString(), this.logger);
117
- return {
118
- claimAmount: amount,
119
- claimSecret,
120
- claimSecretHash,
121
- messageHash: log.args.key,
122
- messageLeafIndex: log.args.index
123
- };
124
- }
125
- /**
126
- * Creates a new instance
127
- * @param pxe - PXE client used for retrieving the L1 contract addresses.
128
- * @param publicClient - L1 public client.
129
- * @param walletClient - L1 wallet client.
130
- * @param logger - Logger.
131
- */ static async new(pxe, publicClient, walletClient, logger) {
132
- const { l1ContractAddresses: { feeJuiceAddress, feeJuicePortalAddress } } = await pxe.getNodeInfo();
133
- if (feeJuiceAddress.isZero() || feeJuicePortalAddress.isZero()) {
134
- throw new Error('Portal or token not deployed on L1');
135
- }
136
- return new L1FeeJuicePortalManager(feeJuicePortalAddress, feeJuiceAddress, publicClient, walletClient, logger);
137
- }
138
- }
139
- /** Helper for interacting with a test TokenPortal on L1 for sending tokens to L2. */ export class L1ToL2TokenPortalManager {
140
- publicClient;
141
- walletClient;
142
- logger;
143
- portal;
144
- tokenManager;
145
- constructor(portalAddress, tokenAddress, publicClient, walletClient, logger){
146
- this.publicClient = publicClient;
147
- this.walletClient = walletClient;
148
- this.logger = logger;
149
- this.tokenManager = new L1TokenManager(tokenAddress, publicClient, walletClient, logger);
150
- this.portal = getContract({
151
- address: portalAddress.toString(),
152
- abi: TokenPortalAbi,
153
- client: this.walletClient
154
- });
155
- }
156
- /** Returns the token manager for the underlying L1 token. */ getTokenManager() {
157
- return this.tokenManager;
158
- }
159
- /**
160
- * Bridges tokens from L1 to L2. Handles token approvals. Returns once the tx has been mined.
161
- * @param to - Address to send the tokens to on L2.
162
- * @param amount - Amount of tokens to send.
163
- * @param mint - Whether to mint the tokens before sending (only during testing).
164
- */ async bridgeTokensPublic(to, amount, mint = false) {
165
- const [claimSecret, claimSecretHash] = await this.bridgeSetup(amount, mint);
166
- this.logger.info('Sending L1 tokens to L2 to be claimed publicly');
167
- const { request } = await this.portal.simulate.depositToAztecPublic([
168
- to.toString(),
169
- amount,
170
- claimSecretHash.toString()
171
- ]);
172
- const txReceipt = await this.publicClient.waitForTransactionReceipt({
173
- hash: await this.walletClient.writeContract(request)
174
- });
175
- const log = extractEvent(txReceipt.logs, this.portal.address, this.portal.abi, 'DepositToAztecPublic', (log)=>log.args.secretHash === claimSecretHash.toString() && log.args.amount === amount && log.args.to === to.toString(), this.logger);
176
- return {
177
- claimAmount: amount,
178
- claimSecret,
179
- claimSecretHash,
180
- messageHash: log.args.key,
181
- messageLeafIndex: log.args.index
182
- };
183
- }
184
- /**
185
- * Bridges tokens from L1 to L2 privately. Handles token approvals. Returns once the tx has been mined.
186
- * @param to - Address to send the tokens to on L2.
187
- * @param amount - Amount of tokens to send.
188
- * @param mint - Whether to mint the tokens before sending (only during testing).
189
- */ async bridgeTokensPrivate(to, amount, mint = false) {
190
- const [claimSecret, claimSecretHash] = await this.bridgeSetup(amount, mint);
191
- this.logger.info('Sending L1 tokens to L2 to be claimed privately');
192
- const { request } = await this.portal.simulate.depositToAztecPrivate([
193
- amount,
194
- claimSecretHash.toString()
195
- ]);
196
- const txReceipt = await this.publicClient.waitForTransactionReceipt({
197
- hash: await this.walletClient.writeContract(request)
198
- });
199
- const log = extractEvent(txReceipt.logs, this.portal.address, this.portal.abi, 'DepositToAztecPrivate', (log)=>log.args.amount === amount && log.args.secretHashForL2MessageConsumption === claimSecretHash.toString(), this.logger);
200
- this.logger.info(`Claim message secret: ${claimSecret.toString()}, claim message secret hash: ${claimSecretHash.toString()}`);
201
- return {
202
- claimAmount: amount,
203
- claimSecret,
204
- claimSecretHash,
205
- recipient: to,
206
- messageHash: log.args.key,
207
- messageLeafIndex: log.args.index
208
- };
209
- }
210
- async bridgeSetup(amount, mint) {
211
- if (mint) {
212
- await this.tokenManager.mint(amount, this.walletClient.account.address);
213
- }
214
- await this.tokenManager.approve(amount, this.portal.address, 'TokenPortal');
215
- return generateClaimSecret();
216
- }
217
- }
218
- /** Helper for interacting with a test TokenPortal on L1 for both withdrawing from and bridging to L2. */ export class L1TokenPortalManager extends L1ToL2TokenPortalManager {
219
- outbox;
220
- constructor(portalAddress, tokenAddress, outboxAddress, publicClient, walletClient, logger){
221
- super(portalAddress, tokenAddress, publicClient, walletClient, logger);
222
- this.outbox = getContract({
223
- address: outboxAddress.toString(),
224
- abi: OutboxAbi,
225
- client: walletClient
226
- });
227
- }
228
- /**
229
- * Withdraws funds from the portal by consuming an L2 to L1 message. Returns once the tx is mined on L1.
230
- * @param amount - Amount to withdraw.
231
- * @param recipient - Who will receive the funds.
232
- * @param blockNumber - L2 block number of the message.
233
- * @param messageIndex - Index of the message.
234
- * @param siblingPath - Sibling path of the message.
235
- */ async withdrawFunds(amount, recipient, blockNumber, messageIndex, siblingPath) {
236
- this.logger.info(`Sending L1 tx to consume message at block ${blockNumber} index ${messageIndex} to withdraw ${amount}`);
237
- const isConsumedBefore = await this.outbox.read.hasMessageBeenConsumedAtBlockAndIndex([
238
- blockNumber,
239
- messageIndex
240
- ]);
241
- if (isConsumedBefore) {
242
- throw new Error(`L1 to L2 message at block ${blockNumber} index ${messageIndex} has already been consumed`);
243
- }
244
- // Call function on L1 contract to consume the message
245
- const { request: withdrawRequest } = await this.portal.simulate.withdraw([
246
- recipient.toString(),
247
- amount,
248
- false,
249
- BigInt(blockNumber),
250
- messageIndex,
251
- siblingPath.toBufferArray().map((buf)=>`0x${buf.toString('hex')}`)
252
- ]);
253
- await this.publicClient.waitForTransactionReceipt({
254
- hash: await this.walletClient.writeContract(withdrawRequest)
255
- });
256
- const isConsumedAfter = await this.outbox.read.hasMessageBeenConsumedAtBlockAndIndex([
257
- blockNumber,
258
- messageIndex
259
- ]);
260
- if (!isConsumedAfter) {
261
- throw new Error(`L1 to L2 message at block ${blockNumber} index ${messageIndex} not consumed after withdrawal`);
262
- }
263
- }
264
- /**
265
- * Computes the L2 to L1 message leaf for the given parameters.
266
- * @param amount - Amount to bridge.
267
- * @param recipient - Recipient on L1.
268
- * @param l2Bridge - Address of the L2 bridge.
269
- * @param callerOnL1 - Caller address on L1.
270
- */ getL2ToL1MessageLeaf(amount, recipient, l2Bridge, callerOnL1 = EthAddress.ZERO) {
271
- const content = sha256ToField([
272
- Buffer.from(toFunctionSelector('withdraw(address,uint256,address)').substring(2), 'hex'),
273
- recipient.toBuffer32(),
274
- new Fr(amount).toBuffer(),
275
- callerOnL1.toBuffer32()
276
- ]);
277
- const leaf = sha256ToField([
278
- l2Bridge.toBuffer(),
279
- new Fr(1).toBuffer(),
280
- EthAddress.fromString(this.portal.address).toBuffer32() ?? Buffer.alloc(32, 0),
281
- new Fr(this.publicClient.chain.id).toBuffer(),
282
- content.toBuffer()
283
- ]);
284
- return leaf;
285
- }
286
- }
@@ -1,2 +0,0 @@
1
- export type { PXE } from '@aztec/stdlib/interfaces/client';
2
- //# sourceMappingURL=pxe.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pxe.d.ts","sourceRoot":"","sources":["../../../src/api/interfaces/pxe.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC"}
@@ -1 +0,0 @@
1
- export { };
@@ -1,2 +0,0 @@
1
- export { LogId } from '@aztec/stdlib/logs';
2
- //# sourceMappingURL=log_id.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log_id.d.ts","sourceRoot":"","sources":["../../src/api/log_id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1 +0,0 @@
1
- export { LogId } from '@aztec/stdlib/logs';
@@ -1,2 +0,0 @@
1
- export { TxHash } from '@aztec/stdlib/tx';
2
- //# sourceMappingURL=tx_hash.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tx_hash.d.ts","sourceRoot":"","sources":["../../src/api/tx_hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1 +0,0 @@
1
- export { TxHash } from '@aztec/stdlib/tx';
@@ -1,21 +0,0 @@
1
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
2
- import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
3
- import type { PXE } from '@aztec/stdlib/interfaces/client';
4
- import type { Tx } from '@aztec/stdlib/tx';
5
- import type { Wallet } from '../account/index.js';
6
- import type { Contract } from './contract.js';
7
- import { DeploySentTx } from './deploy_sent_tx.js';
8
- import { ProvenTx } from './proven_tx.js';
9
- /**
10
- * A proven transaction that can be sent to the network. Returned by the `prove` method of a contract deployment.
11
- */
12
- export declare class DeployProvenTx<TContract extends Contract = Contract> extends ProvenTx {
13
- private postDeployCtor;
14
- private instanceGetter;
15
- constructor(wallet: PXE | Wallet, tx: Tx, postDeployCtor: (address: AztecAddress, wallet: Wallet) => Promise<TContract>, instanceGetter: () => Promise<ContractInstanceWithAddress>);
16
- /**
17
- * Sends the transaction to the network via the provided wallet.
18
- */
19
- send(): DeploySentTx<TContract>;
20
- }
21
- //# sourceMappingURL=deploy_proven_tx.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deploy_proven_tx.d.ts","sourceRoot":"","sources":["../../src/contract/deploy_proven_tx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;GAEG;AACH,qBAAa,cAAc,CAAC,SAAS,SAAS,QAAQ,GAAG,QAAQ,CAAE,SAAQ,QAAQ;IAI/E,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,cAAc;gBAHtB,MAAM,EAAE,GAAG,GAAG,MAAM,EACpB,EAAE,EAAE,EAAE,EACE,cAAc,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,CAAC,EAC7E,cAAc,EAAE,MAAM,OAAO,CAAC,2BAA2B,CAAC;IAKpE;;OAEG;IACa,IAAI,IAAI,YAAY,CAAC,SAAS,CAAC;CAOhD"}
@@ -1,19 +0,0 @@
1
- import { DeploySentTx } from './deploy_sent_tx.js';
2
- import { ProvenTx } from './proven_tx.js';
3
- /**
4
- * A proven transaction that can be sent to the network. Returned by the `prove` method of a contract deployment.
5
- */ export class DeployProvenTx extends ProvenTx {
6
- postDeployCtor;
7
- instanceGetter;
8
- constructor(wallet, tx, postDeployCtor, instanceGetter){
9
- super(wallet, tx), this.postDeployCtor = postDeployCtor, this.instanceGetter = instanceGetter;
10
- }
11
- /**
12
- * Sends the transaction to the network via the provided wallet.
13
- */ send() {
14
- const promise = (()=>{
15
- return this.wallet.sendTx(this.getPlainDataTx());
16
- })();
17
- return new DeploySentTx(this.wallet, promise, this.postDeployCtor, this.instanceGetter);
18
- }
19
- }
@@ -1,45 +0,0 @@
1
- import type { FieldsOf } from '@aztec/foundation/types';
2
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
3
- import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
4
- import type { PXE } from '@aztec/stdlib/interfaces/client';
5
- import type { TxHash, TxReceipt } from '@aztec/stdlib/tx';
6
- import type { Wallet } from '../account/index.js';
7
- import type { Contract } from './contract.js';
8
- import type { ContractBase } from './contract_base.js';
9
- import { SentTx, type WaitOpts } from './sent_tx.js';
10
- /** Options related to waiting for a deployment tx. */
11
- export type DeployedWaitOpts = WaitOpts & {
12
- /** Wallet to use for creating a contract instance. Uses the one set in the deployer constructor if not set. */
13
- wallet?: Wallet;
14
- };
15
- /** Extends a transaction receipt with a contract instance that represents the newly deployed contract. */
16
- export type DeployTxReceipt<TContract extends ContractBase = Contract> = FieldsOf<TxReceipt> & {
17
- /** Instance of the newly deployed contract. */
18
- contract: TContract;
19
- };
20
- /**
21
- * A contract deployment transaction sent to the network, extending SentTx with methods to create a contract instance.
22
- */
23
- export declare class DeploySentTx<TContract extends Contract = Contract> extends SentTx {
24
- private postDeployCtor;
25
- /** A getter for the deployed contract instance */
26
- instanceGetter: () => Promise<ContractInstanceWithAddress>;
27
- private log;
28
- constructor(pxeOrWallet: PXE | Wallet, txHashPromise: Promise<TxHash>, postDeployCtor: (address: AztecAddress, wallet: Wallet) => Promise<TContract>,
29
- /** A getter for the deployed contract instance */
30
- instanceGetter: () => Promise<ContractInstanceWithAddress>);
31
- /**
32
- * Awaits for the tx to be mined and returns the contract instance. Throws if tx is not mined.
33
- * @param opts - Options for configuring the waiting for the tx to be mined.
34
- * @returns The deployed contract instance.
35
- */
36
- deployed(opts?: DeployedWaitOpts): Promise<TContract>;
37
- /**
38
- * Awaits for the tx to be mined and returns the receipt along with a contract instance. Throws if tx is not mined.
39
- * @param opts - Options for configuring the waiting for the tx to be mined.
40
- * @returns The transaction receipt with the deployed contract instance.
41
- */
42
- wait(opts?: DeployedWaitOpts): Promise<DeployTxReceipt<TContract>>;
43
- protected getContractObject(wallet?: Wallet): Promise<TContract>;
44
- }
45
- //# sourceMappingURL=deploy_sent_tx.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deploy_sent_tx.d.ts","sourceRoot":"","sources":["../../src/contract/deploy_sent_tx.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EAAa,GAAG,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAErD,sDAAsD;AACtD,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG;IACxC,+GAA+G;IAC/G,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,0GAA0G;AAC1G,MAAM,MAAM,eAAe,CAAC,SAAS,SAAS,YAAY,GAAG,QAAQ,IAAI,QAAQ,CAAC,SAAS,CAAC,GAAG;IAC7F,+CAA+C;IAC/C,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,qBAAa,YAAY,CAAC,SAAS,SAAS,QAAQ,GAAG,QAAQ,CAAE,SAAQ,MAAM;IAM3E,OAAO,CAAC,cAAc;IACtB,kDAAkD;IAC3C,cAAc,EAAE,MAAM,OAAO,CAAC,2BAA2B,CAAC;IAPnE,OAAO,CAAC,GAAG,CAA0C;gBAGnD,WAAW,EAAE,GAAG,GAAG,MAAM,EACzB,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,EACtB,cAAc,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,CAAC;IACrF,kDAAkD;IAC3C,cAAc,EAAE,MAAM,OAAO,CAAC,2BAA2B,CAAC;IAKnE;;;;OAIG;IACU,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IAOlE;;;;OAIG;IACmB,IAAI,CAAC,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;cAMxE,iBAAiB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;CAUvE"}
@@ -1,43 +0,0 @@
1
- import { createLogger } from '@aztec/foundation/log';
2
- import { SentTx } from './sent_tx.js';
3
- /**
4
- * A contract deployment transaction sent to the network, extending SentTx with methods to create a contract instance.
5
- */ export class DeploySentTx extends SentTx {
6
- postDeployCtor;
7
- instanceGetter;
8
- log;
9
- constructor(pxeOrWallet, txHashPromise, postDeployCtor, /** A getter for the deployed contract instance */ instanceGetter){
10
- super(pxeOrWallet, txHashPromise), this.postDeployCtor = postDeployCtor, this.instanceGetter = instanceGetter, this.log = createLogger('aztecjs:deploy_sent_tx');
11
- }
12
- /**
13
- * Awaits for the tx to be mined and returns the contract instance. Throws if tx is not mined.
14
- * @param opts - Options for configuring the waiting for the tx to be mined.
15
- * @returns The deployed contract instance.
16
- */ async deployed(opts) {
17
- const receipt = await this.wait(opts);
18
- const instance = await this.instanceGetter();
19
- this.log.info(`Contract ${instance.address.toString()} successfully deployed.`);
20
- return receipt.contract;
21
- }
22
- /**
23
- * Awaits for the tx to be mined and returns the receipt along with a contract instance. Throws if tx is not mined.
24
- * @param opts - Options for configuring the waiting for the tx to be mined.
25
- * @returns The transaction receipt with the deployed contract instance.
26
- */ async wait(opts) {
27
- const receipt = await super.wait(opts);
28
- const contract = await this.getContractObject(opts?.wallet);
29
- return {
30
- ...receipt,
31
- contract
32
- };
33
- }
34
- async getContractObject(wallet) {
35
- const isWallet = (pxeOrWallet)=>!!pxeOrWallet.createTxExecutionRequest;
36
- const contractWallet = wallet ?? (isWallet(this.pxeOrNode) && this.pxeOrNode);
37
- if (!contractWallet) {
38
- throw new Error(`A wallet is required for creating a contract instance`);
39
- }
40
- const instance = await this.instanceGetter();
41
- return this.postDeployCtor(instance.address, contractWallet);
42
- }
43
- }
@@ -1,45 +0,0 @@
1
- /**
2
- * The `contract` module provides utilities for deploying and interacting with contracts, based on a
3
- * `Wallet` instance and a compiled artifact. Refer to the {@link account} module for how to obtain a valid
4
- * `Wallet` instance, and to the {@link https://docs.aztec.network/developers/guides/smart_contracts/how_to_compile_contract | Compiling contracts}
5
- * section of the documentation for how to generate an artifact out of your Noir source code.
6
- *
7
- * The {@link Contract} class is the main class in this module, and provides static methods for deploying
8
- * a contract or interacting with an already deployed one. The `methods` property of the contract instance
9
- * provides access to private, public, and simulate methods, that can be invoked in a transaction via `send()`,
10
- * or can be queried via `simulate()`.
11
- *
12
- * ```ts
13
- * const contract = await Contract.deploy(wallet, MyContractArtifact, [...constructorArgs]).send().deployed();
14
- * console.log(`Contract deployed at ${contract.address}`);
15
- * ```
16
- *
17
- * ```ts
18
- * const contract = await Contract.at(address, MyContractArtifact, wallet);
19
- * await contract.methods.mint(1000, owner).send().wait();
20
- * console.log(`Total supply is now ${await contract.methods.totalSupply().simulate()}`);
21
- * ```
22
- *
23
- * The result of calling a method in a contract instance, such as `contract.methods.mint(1000, owner)`
24
- * in the example, is a {@link ContractFunctionInteraction} instance. Usually this will be just sent as
25
- * a transaction to the network via the `send` method, but you can also `simulate` it without sending,
26
- * or obtaining the `request` for aggregating into a {@link BatchCall}.
27
- *
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
30
- * has synchronized its changes.
31
- *
32
- * @remarks If you are using typescript, consider using the
33
- * {@link https://docs.aztec.network/developers/guides/smart_contracts/how_to_compile_contract#typescript-interfaces | autogenerated type-safe interfaces}
34
- * for interacting with your contracts.
35
- *
36
- * @packageDocumentation
37
- */
38
- export { Contract } from './contract.js';
39
- export { ContractFunctionInteraction, type ProfileResult, type SendMethodOptions, } from './contract_function_interaction.js';
40
- export { DefaultWaitOpts, SentTx, type WaitOpts } from './sent_tx.js';
41
- export { ContractBase, type ContractMethod, type ContractNotes, type ContractStorageLayout } from './contract_base.js';
42
- export { BatchCall } from './batch_call.js';
43
- export { type DeployOptions, DeployMethod } from './deploy_method.js';
44
- export { DeploySentTx } from './deploy_sent_tx.js';
45
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contract/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,2BAA2B,EAC3B,KAAK,aAAa,EAClB,KAAK,iBAAiB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACvH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,KAAK,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,43 +0,0 @@
1
- /**
2
- * The `contract` module provides utilities for deploying and interacting with contracts, based on a
3
- * `Wallet` instance and a compiled artifact. Refer to the {@link account} module for how to obtain a valid
4
- * `Wallet` instance, and to the {@link https://docs.aztec.network/developers/guides/smart_contracts/how_to_compile_contract | Compiling contracts}
5
- * section of the documentation for how to generate an artifact out of your Noir source code.
6
- *
7
- * The {@link Contract} class is the main class in this module, and provides static methods for deploying
8
- * a contract or interacting with an already deployed one. The `methods` property of the contract instance
9
- * provides access to private, public, and simulate methods, that can be invoked in a transaction via `send()`,
10
- * or can be queried via `simulate()`.
11
- *
12
- * ```ts
13
- * const contract = await Contract.deploy(wallet, MyContractArtifact, [...constructorArgs]).send().deployed();
14
- * console.log(`Contract deployed at ${contract.address}`);
15
- * ```
16
- *
17
- * ```ts
18
- * const contract = await Contract.at(address, MyContractArtifact, wallet);
19
- * await contract.methods.mint(1000, owner).send().wait();
20
- * console.log(`Total supply is now ${await contract.methods.totalSupply().simulate()}`);
21
- * ```
22
- *
23
- * The result of calling a method in a contract instance, such as `contract.methods.mint(1000, owner)`
24
- * in the example, is a {@link ContractFunctionInteraction} instance. Usually this will be just sent as
25
- * a transaction to the network via the `send` method, but you can also `simulate` it without sending,
26
- * or obtaining the `request` for aggregating into a {@link BatchCall}.
27
- *
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
30
- * has synchronized its changes.
31
- *
32
- * @remarks If you are using typescript, consider using the
33
- * {@link https://docs.aztec.network/developers/guides/smart_contracts/how_to_compile_contract#typescript-interfaces | autogenerated type-safe interfaces}
34
- * for interacting with your contracts.
35
- *
36
- * @packageDocumentation
37
- */ export { Contract } from './contract.js';
38
- export { ContractFunctionInteraction } from './contract_function_interaction.js';
39
- export { DefaultWaitOpts, SentTx } from './sent_tx.js';
40
- export { ContractBase } from './contract_base.js';
41
- export { BatchCall } from './batch_call.js';
42
- export { DeployMethod } from './deploy_method.js';
43
- export { DeploySentTx } from './deploy_sent_tx.js';
@@ -1,9 +0,0 @@
1
- import type { Wallet } from '../wallet/index.js';
2
- import { UnsafeContract } from './unsafe_contract.js';
3
- /** Returns a Contract wrapper for the class registerer. */
4
- export declare function getRegistererContract(wallet: Wallet): Promise<UnsafeContract>;
5
- /** Returns a Contract wrapper for the instance deployer. */
6
- export declare function getDeployerContract(wallet: Wallet): Promise<UnsafeContract>;
7
- /** Returns a Contract wrapper for the fee juice */
8
- export declare function getFeeJuice(wallet: Wallet): Promise<UnsafeContract>;
9
- //# sourceMappingURL=protocol_contracts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"protocol_contracts.d.ts","sourceRoot":"","sources":["../../src/contract/protocol_contracts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,2DAA2D;AAC3D,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,MAAM,2BAQzD;AAED,4DAA4D;AAC5D,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,MAAM,2BAOvD;AAED,mDAAmD;AACnD,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,2BAO/C"}
@@ -1,26 +0,0 @@
1
- import { ProtocolContractAddress } from '@aztec/protocol-contracts';
2
- import { UnsafeContract } from './unsafe_contract.js';
3
- /** Returns a Contract wrapper for the class registerer. */ export async function getRegistererContract(wallet) {
4
- const { contractInstance } = await wallet.getContractMetadata(ProtocolContractAddress.ContractClassRegisterer);
5
- if (!contractInstance) {
6
- throw new Error("ContractClassRegisterer is not registered in this wallet's instance");
7
- }
8
- const { artifact } = await wallet.getContractClassMetadata(contractInstance.currentContractClassId, true);
9
- return new UnsafeContract(contractInstance, artifact, wallet);
10
- }
11
- /** Returns a Contract wrapper for the instance deployer. */ export async function getDeployerContract(wallet) {
12
- const { contractInstance } = await wallet.getContractMetadata(ProtocolContractAddress.ContractInstanceDeployer);
13
- if (!contractInstance) {
14
- throw new Error("ContractInstanceDeployer is not registered in this wallet's instance");
15
- }
16
- const { artifact } = await wallet.getContractClassMetadata(contractInstance.currentContractClassId, true);
17
- return new UnsafeContract(contractInstance, artifact, wallet);
18
- }
19
- /** Returns a Contract wrapper for the fee juice */ export async function getFeeJuice(wallet) {
20
- const { contractInstance } = await wallet.getContractMetadata(ProtocolContractAddress.FeeJuice);
21
- if (!contractInstance) {
22
- throw new Error("FeeJuice is not registered in this wallet's instance");
23
- }
24
- const { artifact } = await wallet.getContractClassMetadata(contractInstance.currentContractClassId, true);
25
- return new UnsafeContract(contractInstance, artifact, wallet);
26
- }
@@ -1,17 +0,0 @@
1
- import type { PXE } from '@aztec/stdlib/interfaces/client';
2
- import { Tx } from '@aztec/stdlib/tx';
3
- import type { Wallet } from '../account/index.js';
4
- import { SentTx } from './sent_tx.js';
5
- /**
6
- * A proven transaction that can be sent to the network. Returned by the `prove` method of a contract interaction.
7
- */
8
- export declare class ProvenTx extends Tx {
9
- protected wallet: PXE | Wallet;
10
- constructor(wallet: PXE | Wallet, tx: Tx);
11
- protected getPlainDataTx(): Tx;
12
- /**
13
- * Sends the transaction to the network via the provided wallet.
14
- */
15
- send(): SentTx;
16
- }
17
- //# sourceMappingURL=proven_tx.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proven_tx.d.ts","sourceRoot":"","sources":["../../src/contract/proven_tx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAEtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC;;GAEG;AACH,qBAAa,QAAS,SAAQ,EAAE;IAClB,SAAS,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM;gBAApB,MAAM,EAAE,GAAG,GAAG,MAAM,EAAE,EAAE,EAAE,EAAE;IAWlD,SAAS,CAAC,cAAc,IAAI,EAAE;IAU9B;;OAEG;IACI,IAAI,IAAI,MAAM;CAOtB"}
@@ -1,22 +0,0 @@
1
- import { Tx } from '@aztec/stdlib/tx';
2
- import { SentTx } from './sent_tx.js';
3
- /**
4
- * A proven transaction that can be sent to the network. Returned by the `prove` method of a contract interaction.
5
- */ export class ProvenTx extends Tx {
6
- wallet;
7
- constructor(wallet, tx){
8
- super(tx.data, tx.clientIvcProof, tx.contractClassLogs, tx.enqueuedPublicFunctionCalls, tx.publicTeardownFunctionCall), this.wallet = wallet;
9
- }
10
- // Clone the TX data to get a serializable object.
11
- getPlainDataTx() {
12
- return new Tx(this.data, this.clientIvcProof, this.contractClassLogs, this.enqueuedPublicFunctionCalls, this.publicTeardownFunctionCall);
13
- }
14
- /**
15
- * Sends the transaction to the network via the provided wallet.
16
- */ send() {
17
- const promise = (()=>{
18
- return this.wallet.sendTx(this.getPlainDataTx());
19
- })();
20
- return new SentTx(this.wallet, promise);
21
- }
22
- }