@aztec/aztec.js 0.0.0-test.1 → 0.0.1-commit.1142ef1

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 (410) hide show
  1. package/README.md +1 -1
  2. package/dest/account/account.d.ts +59 -0
  3. package/dest/account/account.d.ts.map +1 -0
  4. package/dest/account/account.js +59 -0
  5. package/dest/account/account_contract.d.ts +43 -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 +24 -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} +5 -5
  11. package/dest/account/index.d.ts +5 -9
  12. package/dest/account/index.d.ts.map +1 -1
  13. package/dest/account/index.js +2 -6
  14. package/dest/account/interface.d.ts +3 -15
  15. package/dest/account/interface.d.ts.map +1 -1
  16. package/dest/account/interface.js +1 -0
  17. package/dest/account/signerless_account.d.ts +23 -0
  18. package/dest/account/signerless_account.d.ts.map +1 -0
  19. package/dest/account/signerless_account.js +27 -0
  20. package/dest/api/abi.d.ts +3 -2
  21. package/dest/api/abi.d.ts.map +1 -1
  22. package/dest/api/abi.js +1 -1
  23. package/dest/api/account.d.ts +7 -3
  24. package/dest/api/account.d.ts.map +1 -1
  25. package/dest/api/account.js +4 -1
  26. package/dest/api/addresses.d.ts +2 -1
  27. package/dest/api/addresses.d.ts.map +1 -1
  28. package/dest/api/addresses.js +1 -0
  29. package/dest/api/authorization.d.ts +5 -0
  30. package/dest/api/authorization.d.ts.map +1 -0
  31. package/dest/api/authorization.js +4 -0
  32. package/dest/api/block.d.ts +3 -0
  33. package/dest/api/block.d.ts.map +1 -0
  34. package/dest/api/block.js +2 -0
  35. package/dest/api/contract.d.ts +49 -0
  36. package/dest/api/contract.d.ts.map +1 -0
  37. package/dest/{contract/index.js → api/contract.js} +15 -11
  38. package/dest/api/crypto.d.ts +2 -0
  39. package/dest/api/crypto.d.ts.map +1 -0
  40. package/dest/api/crypto.js +1 -0
  41. package/dest/api/deployment.d.ts +5 -4
  42. package/dest/api/deployment.d.ts.map +1 -1
  43. package/dest/api/deployment.js +4 -3
  44. package/dest/api/eth_address.d.ts +1 -1
  45. package/dest/api/ethereum.d.ts +2 -0
  46. package/dest/api/ethereum.d.ts.map +1 -0
  47. package/dest/api/ethereum.js +1 -0
  48. package/dest/api/events.d.ts +12 -0
  49. package/dest/api/events.d.ts.map +1 -0
  50. package/dest/api/events.js +30 -0
  51. package/dest/api/fee.d.ts +2 -2
  52. package/dest/api/fee.d.ts.map +1 -1
  53. package/dest/api/fee.js +1 -1
  54. package/dest/api/fee_testing.d.ts +2 -0
  55. package/dest/api/fee_testing.d.ts.map +1 -0
  56. package/dest/api/fee_testing.js +1 -0
  57. package/dest/api/fields.d.ts +3 -2
  58. package/dest/api/fields.d.ts.map +1 -1
  59. package/dest/api/fields.js +2 -1
  60. package/dest/api/keys.d.ts +4 -0
  61. package/dest/api/keys.d.ts.map +1 -0
  62. package/dest/api/keys.js +3 -0
  63. package/dest/api/log.d.ts +2 -1
  64. package/dest/api/log.d.ts.map +1 -1
  65. package/dest/api/log.js +1 -0
  66. package/dest/api/messaging.d.ts +3 -0
  67. package/dest/api/messaging.d.ts.map +1 -0
  68. package/dest/api/messaging.js +2 -0
  69. package/dest/api/node.d.ts +21 -0
  70. package/dest/api/node.d.ts.map +1 -0
  71. package/dest/api/node.js +18 -0
  72. package/dest/api/note.d.ts +2 -0
  73. package/dest/api/note.d.ts.map +1 -0
  74. package/dest/api/note.js +1 -0
  75. package/dest/api/protocol.d.ts +3 -0
  76. package/dest/api/protocol.d.ts.map +1 -0
  77. package/dest/api/protocol.js +2 -0
  78. package/dest/api/trees.d.ts +3 -0
  79. package/dest/api/trees.d.ts.map +1 -0
  80. package/dest/api/trees.js +2 -0
  81. package/dest/api/tx.d.ts +2 -0
  82. package/dest/api/tx.d.ts.map +1 -0
  83. package/dest/api/tx.js +1 -0
  84. package/dest/api/utils.d.ts +13 -0
  85. package/dest/api/utils.d.ts.map +1 -0
  86. package/dest/api/utils.js +12 -0
  87. package/dest/api/wallet.d.ts +4 -2
  88. package/dest/api/wallet.d.ts.map +1 -1
  89. package/dest/api/wallet.js +3 -1
  90. package/dest/authorization/call_authorization_request.d.ts +46 -0
  91. package/dest/authorization/call_authorization_request.d.ts.map +1 -0
  92. package/dest/authorization/call_authorization_request.js +49 -0
  93. package/dest/contract/base_contract_interaction.d.ts +16 -80
  94. package/dest/contract/base_contract_interaction.d.ts.map +1 -1
  95. package/dest/contract/base_contract_interaction.js +15 -128
  96. package/dest/contract/batch_call.d.ts +19 -21
  97. package/dest/contract/batch_call.d.ts.map +1 -1
  98. package/dest/contract/batch_call.js +89 -69
  99. package/dest/contract/checker.d.ts +2 -2
  100. package/dest/contract/checker.d.ts.map +1 -1
  101. package/dest/contract/checker.js +2 -2
  102. package/dest/contract/contract.d.ts +9 -8
  103. package/dest/contract/contract.d.ts.map +1 -1
  104. package/dest/contract/contract.js +10 -20
  105. package/dest/contract/contract_base.d.ts +7 -20
  106. package/dest/contract/contract_base.d.ts.map +1 -1
  107. package/dest/contract/contract_base.js +7 -14
  108. package/dest/contract/contract_function_interaction.d.ts +53 -45
  109. package/dest/contract/contract_function_interaction.d.ts.map +1 -1
  110. package/dest/contract/contract_function_interaction.js +78 -74
  111. package/dest/contract/deploy_method.d.ts +106 -60
  112. package/dest/contract/deploy_method.d.ts.map +1 -1
  113. package/dest/contract/deploy_method.js +125 -133
  114. package/dest/contract/deploy_sent_tx.d.ts +14 -11
  115. package/dest/contract/deploy_sent_tx.d.ts.map +1 -1
  116. package/dest/contract/deploy_sent_tx.js +18 -15
  117. package/dest/contract/get_gas_limits.d.ts +6 -7
  118. package/dest/contract/get_gas_limits.d.ts.map +1 -1
  119. package/dest/contract/get_gas_limits.js +9 -3
  120. package/dest/contract/interaction_options.d.ts +114 -0
  121. package/dest/contract/interaction_options.d.ts.map +1 -0
  122. package/dest/contract/interaction_options.js +46 -0
  123. package/dest/contract/protocol_contracts.d.ts +7 -7
  124. package/dest/contract/protocol_contracts.d.ts.map +1 -1
  125. package/dest/contract/protocol_contracts.js +7 -7
  126. package/dest/contract/sent_tx.d.ts +10 -21
  127. package/dest/contract/sent_tx.d.ts.map +1 -1
  128. package/dest/contract/sent_tx.js +31 -43
  129. package/dest/contract/unsafe_contract.d.ts +2 -2
  130. package/dest/contract/unsafe_contract.d.ts.map +1 -1
  131. package/dest/contract/unsafe_contract.js +1 -1
  132. package/dest/contract/wait_for_proven.d.ts +17 -0
  133. package/dest/contract/wait_for_proven.d.ts.map +1 -0
  134. package/dest/contract/wait_for_proven.js +17 -0
  135. package/dest/deployment/broadcast_function.d.ts +4 -4
  136. package/dest/deployment/broadcast_function.d.ts.map +1 -1
  137. package/dest/deployment/broadcast_function.js +28 -24
  138. package/dest/deployment/contract_deployer.d.ts +2 -2
  139. package/dest/deployment/contract_deployer.d.ts.map +1 -1
  140. package/dest/deployment/contract_deployer.js +1 -1
  141. package/dest/deployment/publish_class.d.ts +6 -0
  142. package/dest/deployment/publish_class.d.ts.map +1 -0
  143. package/dest/deployment/publish_class.js +17 -0
  144. package/dest/deployment/publish_instance.d.ts +10 -0
  145. package/dest/deployment/publish_instance.d.ts.map +1 -0
  146. package/dest/deployment/publish_instance.js +11 -0
  147. package/dest/ethereum/portal_manager.d.ts +139 -0
  148. package/dest/ethereum/portal_manager.d.ts.map +1 -0
  149. package/dest/ethereum/portal_manager.js +345 -0
  150. package/dest/fee/fee_juice_payment_method_with_claim.d.ts +17 -12
  151. package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -1
  152. package/dest/fee/fee_juice_payment_method_with_claim.js +27 -17
  153. package/dest/fee/fee_payment_method.d.ts +12 -8
  154. package/dest/fee/fee_payment_method.d.ts.map +1 -1
  155. package/dest/fee/private_fee_payment_method.d.ts +26 -9
  156. package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
  157. package/dest/fee/private_fee_payment_method.js +45 -23
  158. package/dest/fee/public_fee_payment_method.d.ts +27 -10
  159. package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
  160. package/dest/fee/public_fee_payment_method.js +47 -25
  161. package/dest/fee/sponsored_fee_payment.d.ts +17 -0
  162. package/dest/fee/sponsored_fee_payment.d.ts.map +1 -0
  163. package/dest/fee/sponsored_fee_payment.js +34 -0
  164. package/dest/utils/abi_types.d.ts +2 -4
  165. package/dest/utils/abi_types.d.ts.map +1 -1
  166. package/dest/utils/authwit.d.ts +83 -26
  167. package/dest/utils/authwit.d.ts.map +1 -1
  168. package/dest/utils/authwit.js +238 -41
  169. package/dest/utils/cross_chain.d.ts +24 -0
  170. package/dest/utils/cross_chain.d.ts.map +1 -0
  171. package/dest/utils/cross_chain.js +30 -0
  172. package/dest/utils/fee_juice.d.ts +4 -3
  173. package/dest/utils/fee_juice.d.ts.map +1 -1
  174. package/dest/utils/fee_juice.js +4 -3
  175. package/dest/utils/field_compressed_string.d.ts +1 -1
  176. package/dest/utils/field_compressed_string.d.ts.map +1 -1
  177. package/dest/utils/field_compressed_string.js +1 -1
  178. package/dest/utils/node.d.ts +2 -2
  179. package/dest/utils/node.d.ts.map +1 -1
  180. package/dest/utils/node.js +1 -1
  181. package/dest/utils/pub_key.d.ts +2 -2
  182. package/dest/utils/pub_key.d.ts.map +1 -1
  183. package/dest/utils/pub_key.js +2 -3
  184. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts +34 -0
  185. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -0
  186. package/dest/wallet/account_entrypoint_meta_payment_method.js +76 -0
  187. package/dest/wallet/account_manager.d.ts +66 -0
  188. package/dest/wallet/account_manager.d.ts.map +1 -0
  189. package/dest/wallet/account_manager.js +113 -0
  190. package/dest/wallet/deploy_account_method.d.ts +52 -0
  191. package/dest/wallet/deploy_account_method.d.ts.map +1 -0
  192. package/dest/wallet/deploy_account_method.js +77 -0
  193. package/dest/wallet/index.d.ts +3 -17
  194. package/dest/wallet/index.d.ts.map +1 -1
  195. package/dest/wallet/index.js +2 -20
  196. package/dest/wallet/wallet.d.ts +3554 -0
  197. package/dest/wallet/wallet.d.ts.map +1 -0
  198. package/dest/wallet/wallet.js +198 -0
  199. package/package.json +44 -35
  200. package/src/account/account.ts +96 -0
  201. package/src/account/{contract.ts → account_contract.ts} +25 -14
  202. package/src/{wallet/account_wallet_with_private_key.ts → account/account_with_secret_key.ts} +7 -9
  203. package/src/account/index.ts +4 -8
  204. package/src/account/interface.ts +2 -13
  205. package/src/account/signerless_account.ts +45 -0
  206. package/src/api/abi.ts +26 -0
  207. package/src/api/account.ts +6 -9
  208. package/src/api/addresses.ts +1 -0
  209. package/src/api/authorization.ts +14 -0
  210. package/src/api/block.ts +2 -0
  211. package/src/{contract/index.ts → api/contract.ts} +39 -14
  212. package/src/api/crypto.ts +1 -0
  213. package/src/api/deployment.ts +4 -3
  214. package/src/api/ethereum.ts +10 -0
  215. package/src/api/events.ts +44 -0
  216. package/src/api/fee.ts +1 -1
  217. package/src/api/fee_testing.ts +1 -0
  218. package/src/api/fields.ts +2 -1
  219. package/src/api/keys.ts +8 -0
  220. package/src/api/log.ts +1 -0
  221. package/src/api/messaging.ts +2 -0
  222. package/src/api/node.ts +20 -0
  223. package/src/api/note.ts +1 -0
  224. package/src/api/protocol.ts +2 -0
  225. package/src/api/trees.ts +2 -0
  226. package/src/api/tx.ts +13 -0
  227. package/src/api/utils.ts +14 -0
  228. package/src/api/wallet.ts +31 -5
  229. package/src/authorization/call_authorization_request.ts +63 -0
  230. package/src/contract/base_contract_interaction.ts +23 -166
  231. package/src/contract/batch_call.ts +108 -57
  232. package/src/contract/checker.ts +8 -3
  233. package/src/contract/contract.ts +14 -21
  234. package/src/contract/contract_base.ts +9 -26
  235. package/src/contract/contract_function_interaction.ts +135 -106
  236. package/src/contract/deploy_method.ts +205 -134
  237. package/src/contract/deploy_sent_tx.ts +24 -23
  238. package/src/contract/get_gas_limits.ts +15 -8
  239. package/src/contract/interaction_options.ts +163 -0
  240. package/src/contract/protocol_contracts.ts +10 -10
  241. package/src/contract/sent_tx.ts +42 -54
  242. package/src/contract/unsafe_contract.ts +2 -2
  243. package/src/contract/wait_for_proven.ts +38 -0
  244. package/src/deployment/broadcast_function.ts +58 -58
  245. package/src/deployment/contract_deployer.ts +4 -3
  246. package/src/deployment/publish_class.ts +34 -0
  247. package/src/deployment/publish_instance.ts +26 -0
  248. package/src/{api/ethereum → ethereum}/portal_manager.ts +166 -89
  249. package/src/fee/fee_juice_payment_method_with_claim.ts +49 -34
  250. package/src/fee/fee_payment_method.ts +11 -7
  251. package/src/fee/private_fee_payment_method.ts +80 -58
  252. package/src/fee/public_fee_payment_method.ts +94 -68
  253. package/src/fee/sponsored_fee_payment.ts +46 -0
  254. package/src/utils/abi_types.ts +1 -1
  255. package/src/utils/authwit.ts +262 -54
  256. package/src/utils/cross_chain.ts +53 -0
  257. package/src/utils/fee_juice.ts +5 -5
  258. package/src/utils/field_compressed_string.ts +1 -1
  259. package/src/utils/node.ts +1 -1
  260. package/src/utils/pub_key.ts +3 -4
  261. package/src/wallet/account_entrypoint_meta_payment_method.ts +106 -0
  262. package/src/wallet/account_manager.ts +154 -0
  263. package/src/wallet/deploy_account_method.ts +126 -0
  264. package/src/wallet/index.ts +2 -33
  265. package/src/wallet/wallet.ts +369 -0
  266. package/dest/account/contract.d.ts +0 -37
  267. package/dest/account/contract.d.ts.map +0 -1
  268. package/dest/account/wallet.d.ts +0 -11
  269. package/dest/account/wallet.d.ts.map +0 -1
  270. package/dest/account/wallet.js +0 -3
  271. package/dest/account_manager/deploy_account_method.d.ts +0 -15
  272. package/dest/account_manager/deploy_account_method.d.ts.map +0 -1
  273. package/dest/account_manager/deploy_account_method.js +0 -43
  274. package/dest/account_manager/deploy_account_sent_tx.d.ts +0 -30
  275. package/dest/account_manager/deploy_account_sent_tx.d.ts.map +0 -1
  276. package/dest/account_manager/deploy_account_sent_tx.js +0 -29
  277. package/dest/account_manager/index.d.ts +0 -108
  278. package/dest/account_manager/index.d.ts.map +0 -1
  279. package/dest/account_manager/index.js +0 -159
  280. package/dest/api/cheat_codes.d.ts +0 -26
  281. package/dest/api/cheat_codes.d.ts.map +0 -1
  282. package/dest/api/cheat_codes.js +0 -25
  283. package/dest/api/entrypoint.d.ts +0 -2
  284. package/dest/api/entrypoint.d.ts.map +0 -1
  285. package/dest/api/entrypoint.js +0 -1
  286. package/dest/api/ethereum/anvil_test_watcher.d.ts +0 -32
  287. package/dest/api/ethereum/anvil_test_watcher.d.ts.map +0 -1
  288. package/dest/api/ethereum/anvil_test_watcher.js +0 -133
  289. package/dest/api/ethereum/chain_monitor.d.ts +0 -25
  290. package/dest/api/ethereum/chain_monitor.d.ts.map +0 -1
  291. package/dest/api/ethereum/chain_monitor.js +0 -74
  292. package/dest/api/ethereum/cheat_codes.d.ts +0 -63
  293. package/dest/api/ethereum/cheat_codes.d.ts.map +0 -1
  294. package/dest/api/ethereum/cheat_codes.js +0 -162
  295. package/dest/api/ethereum/index.d.ts +0 -7
  296. package/dest/api/ethereum/index.d.ts.map +0 -1
  297. package/dest/api/ethereum/index.js +0 -6
  298. package/dest/api/ethereum/l1_contracts.d.ts +0 -3
  299. package/dest/api/ethereum/l1_contracts.d.ts.map +0 -1
  300. package/dest/api/ethereum/l1_contracts.js +0 -13
  301. package/dest/api/ethereum/portal_manager.d.ts +0 -136
  302. package/dest/api/ethereum/portal_manager.d.ts.map +0 -1
  303. package/dest/api/ethereum/portal_manager.js +0 -286
  304. package/dest/api/interfaces/pxe.d.ts +0 -2
  305. package/dest/api/interfaces/pxe.d.ts.map +0 -1
  306. package/dest/api/interfaces/pxe.js +0 -1
  307. package/dest/api/log_id.d.ts +0 -2
  308. package/dest/api/log_id.d.ts.map +0 -1
  309. package/dest/api/log_id.js +0 -1
  310. package/dest/api/tx_hash.d.ts +0 -2
  311. package/dest/api/tx_hash.d.ts.map +0 -1
  312. package/dest/api/tx_hash.js +0 -1
  313. package/dest/contract/deploy_proven_tx.d.ts +0 -21
  314. package/dest/contract/deploy_proven_tx.d.ts.map +0 -1
  315. package/dest/contract/deploy_proven_tx.js +0 -19
  316. package/dest/contract/index.d.ts +0 -45
  317. package/dest/contract/index.d.ts.map +0 -1
  318. package/dest/contract/proven_tx.d.ts +0 -17
  319. package/dest/contract/proven_tx.d.ts.map +0 -1
  320. package/dest/contract/proven_tx.js +0 -22
  321. package/dest/deployment/deploy_instance.d.ts +0 -10
  322. package/dest/deployment/deploy_instance.d.ts.map +0 -1
  323. package/dest/deployment/deploy_instance.js +0 -14
  324. package/dest/deployment/index.d.ts +0 -2
  325. package/dest/deployment/index.d.ts.map +0 -1
  326. package/dest/deployment/index.js +0 -1
  327. package/dest/deployment/register_class.d.ts +0 -6
  328. package/dest/deployment/register_class.d.ts.map +0 -1
  329. package/dest/deployment/register_class.js +0 -22
  330. package/dest/entrypoint/default_entrypoint.d.ts +0 -12
  331. package/dest/entrypoint/default_entrypoint.d.ts.map +0 -1
  332. package/dest/entrypoint/default_entrypoint.js +0 -28
  333. package/dest/entrypoint/default_multi_call_entrypoint.d.ts +0 -15
  334. package/dest/entrypoint/default_multi_call_entrypoint.d.ts.map +0 -1
  335. package/dest/entrypoint/default_multi_call_entrypoint.js +0 -130
  336. package/dest/entrypoint/entrypoint.d.ts +0 -35
  337. package/dest/entrypoint/entrypoint.d.ts.map +0 -1
  338. package/dest/entrypoint/entrypoint.js +0 -4
  339. package/dest/entrypoint/payload.d.ts +0 -128
  340. package/dest/entrypoint/payload.d.ts.map +0 -1
  341. package/dest/entrypoint/payload.js +0 -143
  342. package/dest/fee/fee_juice_payment_method.d.ts +0 -14
  343. package/dest/fee/fee_juice_payment_method.d.ts.map +0 -1
  344. package/dest/fee/fee_juice_payment_method.js +0 -20
  345. package/dest/index.d.ts +0 -66
  346. package/dest/index.d.ts.map +0 -1
  347. package/dest/index.js +0 -69
  348. package/dest/rpc_clients/index.d.ts +0 -3
  349. package/dest/rpc_clients/index.d.ts.map +0 -1
  350. package/dest/rpc_clients/index.js +0 -2
  351. package/dest/rpc_clients/node/index.d.ts +0 -12
  352. package/dest/rpc_clients/node/index.d.ts.map +0 -1
  353. package/dest/rpc_clients/node/index.js +0 -78
  354. package/dest/rpc_clients/pxe_client.d.ts +0 -10
  355. package/dest/rpc_clients/pxe_client.d.ts.map +0 -1
  356. package/dest/rpc_clients/pxe_client.js +0 -23
  357. package/dest/utils/aztec_cheatcodes.d.ts +0 -59
  358. package/dest/utils/aztec_cheatcodes.d.ts.map +0 -1
  359. package/dest/utils/aztec_cheatcodes.js +0 -62
  360. package/dest/utils/index.d.ts +0 -8
  361. package/dest/utils/index.d.ts.map +0 -1
  362. package/dest/utils/index.js +0 -6
  363. package/dest/utils/pxe.d.ts +0 -4
  364. package/dest/utils/pxe.d.ts.map +0 -1
  365. package/dest/utils/pxe.js +0 -14
  366. package/dest/wallet/account_wallet.d.ts +0 -76
  367. package/dest/wallet/account_wallet.d.ts.map +0 -1
  368. package/dest/wallet/account_wallet.js +0 -231
  369. package/dest/wallet/account_wallet_with_private_key.d.ts +0 -26
  370. package/dest/wallet/account_wallet_with_private_key.d.ts.map +0 -1
  371. package/dest/wallet/base_wallet.d.ts +0 -73
  372. package/dest/wallet/base_wallet.d.ts.map +0 -1
  373. package/dest/wallet/base_wallet.js +0 -123
  374. package/dest/wallet/signerless_wallet.d.ts +0 -25
  375. package/dest/wallet/signerless_wallet.d.ts.map +0 -1
  376. package/dest/wallet/signerless_wallet.js +0 -36
  377. package/src/account/wallet.ts +0 -13
  378. package/src/account_manager/deploy_account_method.ts +0 -86
  379. package/src/account_manager/deploy_account_sent_tx.ts +0 -42
  380. package/src/account_manager/index.ts +0 -229
  381. package/src/api/cheat_codes.ts +0 -35
  382. package/src/api/entrypoint.ts +0 -1
  383. package/src/api/ethereum/anvil_test_watcher.ts +0 -158
  384. package/src/api/ethereum/chain_monitor.ts +0 -88
  385. package/src/api/ethereum/cheat_codes.ts +0 -184
  386. package/src/api/ethereum/index.ts +0 -19
  387. package/src/api/ethereum/l1_contracts.ts +0 -21
  388. package/src/api/interfaces/pxe.ts +0 -1
  389. package/src/api/log_id.ts +0 -1
  390. package/src/api/tx_hash.ts +0 -1
  391. package/src/contract/deploy_proven_tx.ts +0 -34
  392. package/src/contract/proven_tx.ts +0 -42
  393. package/src/deployment/deploy_instance.ts +0 -31
  394. package/src/deployment/index.ts +0 -1
  395. package/src/deployment/register_class.ts +0 -44
  396. package/src/entrypoint/default_entrypoint.ts +0 -39
  397. package/src/entrypoint/default_multi_call_entrypoint.ts +0 -93
  398. package/src/entrypoint/entrypoint.ts +0 -39
  399. package/src/entrypoint/payload.ts +0 -238
  400. package/src/fee/fee_juice_payment_method.ts +0 -26
  401. package/src/index.ts +0 -106
  402. package/src/rpc_clients/index.ts +0 -2
  403. package/src/rpc_clients/node/index.ts +0 -77
  404. package/src/rpc_clients/pxe_client.ts +0 -25
  405. package/src/utils/aztec_cheatcodes.ts +0 -77
  406. package/src/utils/index.ts +0 -21
  407. package/src/utils/pxe.ts +0 -17
  408. package/src/wallet/account_wallet.ts +0 -242
  409. package/src/wallet/base_wallet.ts +0 -198
  410. 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
- /**
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,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
- }
@@ -1,10 +0,0 @@
1
- import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
2
- import type { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
3
- import type { Wallet } from '../wallet/index.js';
4
- /**
5
- * Sets up a call to the canonical deployer contract to publicly deploy a contract instance.
6
- * @param wallet - The wallet to use for the deployment.
7
- * @param instance - The instance to deploy.
8
- */
9
- export declare function deployInstance(wallet: Wallet, instance: ContractInstanceWithAddress): Promise<ContractFunctionInteraction>;
10
- //# sourceMappingURL=deploy_instance.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deploy_instance.d.ts","sourceRoot":"","sources":["../../src/deployment/deploy_instance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAE1E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAEhG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,2BAA2B,GACpC,OAAO,CAAC,2BAA2B,CAAC,CAgBtC"}
@@ -1,14 +0,0 @@
1
- import { getDeployerContract } from '../contract/protocol_contracts.js';
2
- /**
3
- * Sets up a call to the canonical deployer contract to publicly deploy a contract instance.
4
- * @param wallet - The wallet to use for the deployment.
5
- * @param instance - The instance to deploy.
6
- */ export async function deployInstance(wallet, instance) {
7
- const deployerContract = await getDeployerContract(wallet);
8
- const { salt, currentContractClassId: contractClassId, publicKeys, deployer } = instance;
9
- const isUniversalDeploy = deployer.isZero();
10
- if (!isUniversalDeploy && !wallet.getAddress().equals(deployer)) {
11
- throw new Error(`Expected deployer ${deployer.toString()} does not match sender wallet ${wallet.getAddress().toString()}`);
12
- }
13
- return deployerContract.methods.deploy(salt, contractClassId, instance.initializationHash, publicKeys, isUniversalDeploy);
14
- }
@@ -1,2 +0,0 @@
1
- export * from './contract_deployer.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/deployment/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
@@ -1 +0,0 @@
1
- export * from './contract_deployer.js';
@@ -1,6 +0,0 @@
1
- import { type ContractArtifact } from '@aztec/stdlib/abi';
2
- import type { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
3
- import type { Wallet } from '../wallet/index.js';
4
- /** Sets up a call to register a contract class given its artifact. */
5
- export declare function registerContractClass(wallet: Wallet, artifact: ContractArtifact, emitPublicBytecode?: boolean): Promise<ContractFunctionInteraction>;
6
- //# sourceMappingURL=register_class.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"register_class.d.ts","sourceRoot":"","sources":["../../src/deployment/register_class.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,gBAAgB,EAAkB,MAAM,mBAAmB,CAAC;AAI1E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAEhG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAQjD,sEAAsE;AACtE,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,gBAAgB,EAC1B,kBAAkB,UAA4B,GAC7C,OAAO,CAAC,2BAA2B,CAAC,CAqBtC"}
@@ -1,22 +0,0 @@
1
- import { MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS, REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT } from '@aztec/constants';
2
- import { Fr } from '@aztec/foundation/fields';
3
- import { ProtocolContractAddress } from '@aztec/protocol-contracts';
4
- import { bufferAsFields } from '@aztec/stdlib/abi';
5
- import { getContractClassFromArtifact } from '@aztec/stdlib/contract';
6
- import { Capsule } from '@aztec/stdlib/tx';
7
- import { getRegistererContract } from '../contract/protocol_contracts.js';
8
- const defaultEmitPublicBytecode = // guard against `process` not being defined (e.g. in the browser)
9
- typeof process === 'object' && typeof process.env === 'object' ? [
10
- '1',
11
- 'true',
12
- 'yes',
13
- ''
14
- ].includes(process.env.AZTEC_EMIT_PUBLIC_BYTECODE ?? '') : true;
15
- /** Sets up a call to register a contract class given its artifact. */ export async function registerContractClass(wallet, artifact, emitPublicBytecode = defaultEmitPublicBytecode) {
16
- const { artifactHash, privateFunctionsRoot, publicBytecodeCommitment, packedBytecode } = await getContractClassFromArtifact(artifact);
17
- const registerer = await getRegistererContract(wallet);
18
- const fn = registerer.methods.register(artifactHash, privateFunctionsRoot, publicBytecodeCommitment, emitPublicBytecode);
19
- const encodedBytecode = bufferAsFields(packedBytecode, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS);
20
- fn.addCapsule(new Capsule(ProtocolContractAddress.ContractClassRegisterer, new Fr(REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT), encodedBytecode));
21
- return fn;
22
- }
@@ -1,12 +0,0 @@
1
- import { TxExecutionRequest } from '@aztec/stdlib/tx';
2
- import type { EntrypointInterface, ExecutionRequestInit } from './entrypoint.js';
3
- /**
4
- * Default implementation of the entrypoint interface. It calls a function on a contract directly
5
- */
6
- export declare class DefaultEntrypoint implements EntrypointInterface {
7
- private chainId;
8
- private protocolVersion;
9
- constructor(chainId: number, protocolVersion: number);
10
- createTxExecutionRequest(exec: ExecutionRequestInit): Promise<TxExecutionRequest>;
11
- }
12
- //# sourceMappingURL=default_entrypoint.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"default_entrypoint.d.ts","sourceRoot":"","sources":["../../src/entrypoint/default_entrypoint.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEjF;;GAEG;AACH,qBAAa,iBAAkB,YAAW,mBAAmB;IAC/C,OAAO,CAAC,OAAO;IAAU,OAAO,CAAC,eAAe;gBAAxC,OAAO,EAAE,MAAM,EAAU,eAAe,EAAE,MAAM;IAE9D,wBAAwB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CA2BxF"}
@@ -1,28 +0,0 @@
1
- import { FunctionType } from '@aztec/stdlib/abi';
2
- import { HashedValues, TxContext, TxExecutionRequest } from '@aztec/stdlib/tx';
3
- /**
4
- * Default implementation of the entrypoint interface. It calls a function on a contract directly
5
- */ export class DefaultEntrypoint {
6
- chainId;
7
- protocolVersion;
8
- constructor(chainId, protocolVersion){
9
- this.chainId = chainId;
10
- this.protocolVersion = protocolVersion;
11
- }
12
- async createTxExecutionRequest(exec) {
13
- const { fee, calls, authWitnesses = [], hashedArguments = [], capsules = [] } = exec;
14
- if (calls.length > 1) {
15
- throw new Error(`Expected a single call, got ${calls.length}`);
16
- }
17
- const call = calls[0];
18
- if (call.type !== FunctionType.PRIVATE) {
19
- throw new Error('Public entrypoints are not allowed');
20
- }
21
- const entrypointHashedValues = await HashedValues.fromValues(call.args);
22
- const txContext = new TxContext(this.chainId, this.protocolVersion, fee.gasSettings);
23
- return Promise.resolve(new TxExecutionRequest(call.to, call.selector, entrypointHashedValues.hash, txContext, [
24
- ...hashedArguments,
25
- entrypointHashedValues
26
- ], authWitnesses, capsules));
27
- }
28
- }
@@ -1,15 +0,0 @@
1
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
2
- import { TxExecutionRequest } from '@aztec/stdlib/tx';
3
- import { type EntrypointInterface, type ExecutionRequestInit } from './entrypoint.js';
4
- /**
5
- * Implementation for an entrypoint interface that can execute multiple function calls in a single transaction
6
- */
7
- export declare class DefaultMultiCallEntrypoint implements EntrypointInterface {
8
- private chainId;
9
- private version;
10
- private address;
11
- constructor(chainId: number, version: number, address?: AztecAddress);
12
- createTxExecutionRequest(executions: ExecutionRequestInit): Promise<TxExecutionRequest>;
13
- private getEntrypointAbi;
14
- }
15
- //# sourceMappingURL=default_multi_call_entrypoint.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"default_multi_call_entrypoint.d.ts","sourceRoot":"","sources":["../../src/entrypoint/default_multi_call_entrypoint.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAA2B,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE/E,OAAO,EAAE,KAAK,mBAAmB,EAAqB,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEzG;;GAEG;AACH,qBAAa,0BAA2B,YAAW,mBAAmB;IAElE,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO;gBAFP,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,YAA0D;IAGvE,wBAAwB,CAAC,UAAU,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAmB7F,OAAO,CAAC,gBAAgB;CAwDzB"}