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

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 (392) hide show
  1. package/README.md +1 -1
  2. package/dest/account/account.d.ts +60 -0
  3. package/dest/account/account.d.ts.map +1 -0
  4. package/dest/account/account.js +59 -0
  5. package/dest/account/{contract.d.ts → account_contract.d.ts} +16 -10
  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/{wallet/account_wallet_with_private_key.d.ts → account/account_with_secret_key.d.ts} +7 -8
  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 +3 -7
  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 +1 -13
  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 +24 -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 +2 -1
  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 +5 -2
  24. package/dest/api/account.d.ts.map +1 -1
  25. package/dest/api/account.js +3 -1
  26. package/dest/api/addresses.d.ts +1 -0
  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/{contract/index.d.ts → api/contract.d.ts} +15 -11
  36. package/dest/api/contract.d.ts.map +1 -0
  37. package/dest/{contract/index.js → api/contract.js} +14 -10
  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 +4 -3
  42. package/dest/api/deployment.d.ts.map +1 -1
  43. package/dest/api/deployment.js +4 -3
  44. package/dest/api/ethereum.d.ts +2 -0
  45. package/dest/api/ethereum.d.ts.map +1 -0
  46. package/dest/api/ethereum.js +1 -0
  47. package/dest/api/events.d.ts +12 -0
  48. package/dest/api/events.d.ts.map +1 -0
  49. package/dest/api/events.js +30 -0
  50. package/dest/api/fee.d.ts +1 -1
  51. package/dest/api/fee.d.ts.map +1 -1
  52. package/dest/api/fee.js +1 -1
  53. package/dest/api/fee_testing.d.ts +2 -0
  54. package/dest/api/fee_testing.d.ts.map +1 -0
  55. package/dest/api/fee_testing.js +1 -0
  56. package/dest/api/keys.d.ts +4 -0
  57. package/dest/api/keys.d.ts.map +1 -0
  58. package/dest/api/keys.js +3 -0
  59. package/dest/api/log.d.ts +1 -0
  60. package/dest/api/log.d.ts.map +1 -1
  61. package/dest/api/log.js +1 -0
  62. package/dest/api/messaging.d.ts +3 -0
  63. package/dest/api/messaging.d.ts.map +1 -0
  64. package/dest/api/messaging.js +2 -0
  65. package/dest/api/node.d.ts +21 -0
  66. package/dest/api/node.d.ts.map +1 -0
  67. package/dest/api/node.js +18 -0
  68. package/dest/api/note.d.ts +2 -0
  69. package/dest/api/note.d.ts.map +1 -0
  70. package/dest/api/note.js +1 -0
  71. package/dest/api/protocol.d.ts +3 -0
  72. package/dest/api/protocol.d.ts.map +1 -0
  73. package/dest/api/protocol.js +2 -0
  74. package/dest/api/trees.d.ts +3 -0
  75. package/dest/api/trees.d.ts.map +1 -0
  76. package/dest/api/trees.js +2 -0
  77. package/dest/api/tx.d.ts +2 -0
  78. package/dest/api/tx.d.ts.map +1 -0
  79. package/dest/api/tx.js +1 -0
  80. package/dest/api/utils.d.ts +13 -0
  81. package/dest/api/utils.d.ts.map +1 -0
  82. package/dest/api/utils.js +12 -0
  83. package/dest/api/wallet.d.ts +4 -1
  84. package/dest/api/wallet.d.ts.map +1 -1
  85. package/dest/api/wallet.js +4 -1
  86. package/dest/authorization/call_authorization_request.d.ts +67 -0
  87. package/dest/authorization/call_authorization_request.d.ts.map +1 -0
  88. package/dest/authorization/call_authorization_request.js +49 -0
  89. package/dest/contract/base_contract_interaction.d.ts +16 -79
  90. package/dest/contract/base_contract_interaction.d.ts.map +1 -1
  91. package/dest/contract/base_contract_interaction.js +15 -128
  92. package/dest/contract/batch_call.d.ts +13 -14
  93. package/dest/contract/batch_call.d.ts.map +1 -1
  94. package/dest/contract/batch_call.js +60 -60
  95. package/dest/contract/checker.d.ts +1 -1
  96. package/dest/contract/checker.d.ts.map +1 -1
  97. package/dest/contract/checker.js +2 -2
  98. package/dest/contract/contract.d.ts +7 -6
  99. package/dest/contract/contract.d.ts.map +1 -1
  100. package/dest/contract/contract.js +7 -16
  101. package/dest/contract/contract_base.d.ts +3 -9
  102. package/dest/contract/contract_base.d.ts.map +1 -1
  103. package/dest/contract/contract_base.js +2 -2
  104. package/dest/contract/contract_function_interaction.d.ts +52 -44
  105. package/dest/contract/contract_function_interaction.d.ts.map +1 -1
  106. package/dest/contract/contract_function_interaction.js +75 -74
  107. package/dest/contract/deploy_method.d.ts +102 -57
  108. package/dest/contract/deploy_method.d.ts.map +1 -1
  109. package/dest/contract/deploy_method.js +122 -132
  110. package/dest/contract/deploy_sent_tx.d.ts +3 -5
  111. package/dest/contract/deploy_sent_tx.d.ts.map +1 -1
  112. package/dest/contract/deploy_sent_tx.js +10 -13
  113. package/dest/contract/get_gas_limits.d.ts +5 -6
  114. package/dest/contract/get_gas_limits.d.ts.map +1 -1
  115. package/dest/contract/get_gas_limits.js +9 -3
  116. package/dest/contract/interaction_options.d.ts +114 -0
  117. package/dest/contract/interaction_options.d.ts.map +1 -0
  118. package/dest/contract/interaction_options.js +52 -0
  119. package/dest/contract/protocol_contracts.d.ts +6 -6
  120. package/dest/contract/protocol_contracts.d.ts.map +1 -1
  121. package/dest/contract/protocol_contracts.js +7 -7
  122. package/dest/contract/sent_tx.d.ts +8 -18
  123. package/dest/contract/sent_tx.d.ts.map +1 -1
  124. package/dest/contract/sent_tx.js +30 -42
  125. package/dest/contract/unsafe_contract.d.ts +1 -1
  126. package/dest/contract/unsafe_contract.d.ts.map +1 -1
  127. package/dest/contract/wait_for_proven.d.ts +17 -0
  128. package/dest/contract/wait_for_proven.d.ts.map +1 -0
  129. package/dest/contract/wait_for_proven.js +17 -0
  130. package/dest/deployment/broadcast_function.d.ts +3 -3
  131. package/dest/deployment/broadcast_function.d.ts.map +1 -1
  132. package/dest/deployment/broadcast_function.js +27 -23
  133. package/dest/deployment/contract_deployer.d.ts +1 -1
  134. package/dest/deployment/contract_deployer.d.ts.map +1 -1
  135. package/dest/deployment/publish_class.d.ts +6 -0
  136. package/dest/deployment/publish_class.d.ts.map +1 -0
  137. package/dest/deployment/publish_class.js +17 -0
  138. package/dest/deployment/publish_instance.d.ts +10 -0
  139. package/dest/deployment/publish_instance.d.ts.map +1 -0
  140. package/dest/deployment/publish_instance.js +11 -0
  141. package/dest/{api/ethereum → ethereum}/portal_manager.d.ts +29 -25
  142. package/dest/ethereum/portal_manager.d.ts.map +1 -0
  143. package/dest/{api/ethereum → ethereum}/portal_manager.js +106 -73
  144. package/dest/fee/fee_juice_payment_method_with_claim.d.ts +16 -11
  145. package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -1
  146. package/dest/fee/fee_juice_payment_method_with_claim.js +26 -16
  147. package/dest/fee/fee_payment_method.d.ts +11 -7
  148. package/dest/fee/fee_payment_method.d.ts.map +1 -1
  149. package/dest/fee/private_fee_payment_method.d.ts +25 -8
  150. package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
  151. package/dest/fee/private_fee_payment_method.js +43 -21
  152. package/dest/fee/public_fee_payment_method.d.ts +26 -9
  153. package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
  154. package/dest/fee/public_fee_payment_method.js +45 -23
  155. package/dest/fee/sponsored_fee_payment.d.ts +17 -0
  156. package/dest/fee/sponsored_fee_payment.d.ts.map +1 -0
  157. package/dest/fee/sponsored_fee_payment.js +34 -0
  158. package/dest/utils/abi_types.d.ts +0 -2
  159. package/dest/utils/abi_types.d.ts.map +1 -1
  160. package/dest/utils/authwit.d.ts +81 -24
  161. package/dest/utils/authwit.d.ts.map +1 -1
  162. package/dest/utils/authwit.js +226 -40
  163. package/dest/utils/cross_chain.d.ts +24 -0
  164. package/dest/utils/cross_chain.d.ts.map +1 -0
  165. package/dest/utils/cross_chain.js +30 -0
  166. package/dest/utils/fee_juice.d.ts +3 -2
  167. package/dest/utils/fee_juice.d.ts.map +1 -1
  168. package/dest/utils/fee_juice.js +3 -2
  169. package/dest/utils/field_compressed_string.d.ts.map +1 -1
  170. package/dest/utils/node.d.ts.map +1 -1
  171. package/dest/utils/node.js +1 -1
  172. package/dest/utils/pub_key.d.ts.map +1 -1
  173. package/dest/utils/pub_key.js +1 -2
  174. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts +34 -0
  175. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -0
  176. package/dest/wallet/account_entrypoint_meta_payment_method.js +76 -0
  177. package/dest/wallet/account_manager.d.ts +69 -0
  178. package/dest/wallet/account_manager.d.ts.map +1 -0
  179. package/dest/wallet/account_manager.js +113 -0
  180. package/dest/wallet/base_wallet.d.ts +81 -63
  181. package/dest/wallet/base_wallet.d.ts.map +1 -1
  182. package/dest/wallet/base_wallet.js +221 -106
  183. package/dest/wallet/deploy_account_method.d.ts +52 -0
  184. package/dest/wallet/deploy_account_method.d.ts.map +1 -0
  185. package/dest/wallet/deploy_account_method.js +77 -0
  186. package/dest/wallet/index.d.ts +3 -16
  187. package/dest/wallet/index.d.ts.map +1 -1
  188. package/dest/wallet/index.js +3 -20
  189. package/dest/wallet/wallet.d.ts +2478 -0
  190. package/dest/wallet/wallet.d.ts.map +1 -0
  191. package/dest/wallet/wallet.js +202 -0
  192. package/package.json +40 -32
  193. package/src/account/account.ts +97 -0
  194. package/src/account/{contract.ts → account_contract.ts} +24 -13
  195. package/src/{wallet/account_wallet_with_private_key.ts → account/account_with_secret_key.ts} +6 -8
  196. package/src/account/index.ts +3 -7
  197. package/src/account/interface.ts +1 -12
  198. package/src/account/signerless_account.ts +46 -0
  199. package/src/api/abi.ts +26 -0
  200. package/src/api/account.ts +5 -9
  201. package/src/api/addresses.ts +1 -0
  202. package/src/api/authorization.ts +14 -0
  203. package/src/api/block.ts +2 -0
  204. package/src/{contract/index.ts → api/contract.ts} +37 -13
  205. package/src/api/crypto.ts +1 -0
  206. package/src/api/deployment.ts +4 -3
  207. package/src/api/ethereum.ts +10 -0
  208. package/src/api/events.ts +44 -0
  209. package/src/api/fee.ts +1 -1
  210. package/src/api/fee_testing.ts +1 -0
  211. package/src/api/keys.ts +8 -0
  212. package/src/api/log.ts +1 -0
  213. package/src/api/messaging.ts +2 -0
  214. package/src/api/node.ts +20 -0
  215. package/src/api/note.ts +1 -0
  216. package/src/api/protocol.ts +2 -0
  217. package/src/api/trees.ts +2 -0
  218. package/src/api/tx.ts +11 -0
  219. package/src/api/utils.ts +14 -0
  220. package/src/api/wallet.ts +33 -5
  221. package/src/authorization/call_authorization_request.ts +63 -0
  222. package/src/contract/base_contract_interaction.ts +24 -166
  223. package/src/contract/batch_call.ts +81 -49
  224. package/src/contract/checker.ts +8 -3
  225. package/src/contract/contract.ts +8 -17
  226. package/src/contract/contract_base.ts +4 -11
  227. package/src/contract/contract_function_interaction.ts +136 -106
  228. package/src/contract/deploy_method.ts +199 -129
  229. package/src/contract/deploy_sent_tx.ts +9 -15
  230. package/src/contract/get_gas_limits.ts +15 -8
  231. package/src/contract/interaction_options.ts +169 -0
  232. package/src/contract/protocol_contracts.ts +10 -10
  233. package/src/contract/sent_tx.ts +40 -51
  234. package/src/contract/unsafe_contract.ts +1 -1
  235. package/src/contract/wait_for_proven.ts +38 -0
  236. package/src/deployment/broadcast_function.ts +57 -57
  237. package/src/deployment/contract_deployer.ts +1 -1
  238. package/src/deployment/publish_class.ts +34 -0
  239. package/src/deployment/publish_instance.ts +26 -0
  240. package/src/{api/ethereum → ethereum}/portal_manager.ts +120 -74
  241. package/src/fee/fee_juice_payment_method_with_claim.ts +46 -33
  242. package/src/fee/fee_payment_method.ts +11 -7
  243. package/src/fee/private_fee_payment_method.ts +77 -57
  244. package/src/fee/public_fee_payment_method.ts +91 -67
  245. package/src/fee/sponsored_fee_payment.ts +44 -0
  246. package/src/utils/authwit.ts +255 -53
  247. package/src/utils/cross_chain.ts +53 -0
  248. package/src/utils/fee_juice.ts +4 -4
  249. package/src/utils/node.ts +1 -1
  250. package/src/utils/pub_key.ts +1 -2
  251. package/src/wallet/account_entrypoint_meta_payment_method.ts +105 -0
  252. package/src/wallet/account_manager.ts +154 -0
  253. package/src/wallet/base_wallet.ts +295 -143
  254. package/src/wallet/deploy_account_method.ts +125 -0
  255. package/src/wallet/index.ts +3 -33
  256. package/src/wallet/wallet.ts +362 -0
  257. package/dest/account/contract.d.ts.map +0 -1
  258. package/dest/account/wallet.d.ts +0 -11
  259. package/dest/account/wallet.d.ts.map +0 -1
  260. package/dest/account/wallet.js +0 -3
  261. package/dest/account_manager/deploy_account_method.d.ts +0 -15
  262. package/dest/account_manager/deploy_account_method.d.ts.map +0 -1
  263. package/dest/account_manager/deploy_account_method.js +0 -43
  264. package/dest/account_manager/deploy_account_sent_tx.d.ts +0 -30
  265. package/dest/account_manager/deploy_account_sent_tx.d.ts.map +0 -1
  266. package/dest/account_manager/deploy_account_sent_tx.js +0 -29
  267. package/dest/account_manager/index.d.ts +0 -108
  268. package/dest/account_manager/index.d.ts.map +0 -1
  269. package/dest/account_manager/index.js +0 -159
  270. package/dest/api/cheat_codes.d.ts +0 -26
  271. package/dest/api/cheat_codes.d.ts.map +0 -1
  272. package/dest/api/cheat_codes.js +0 -25
  273. package/dest/api/entrypoint.d.ts +0 -2
  274. package/dest/api/entrypoint.d.ts.map +0 -1
  275. package/dest/api/entrypoint.js +0 -1
  276. package/dest/api/ethereum/anvil_test_watcher.d.ts +0 -32
  277. package/dest/api/ethereum/anvil_test_watcher.d.ts.map +0 -1
  278. package/dest/api/ethereum/anvil_test_watcher.js +0 -133
  279. package/dest/api/ethereum/chain_monitor.d.ts +0 -25
  280. package/dest/api/ethereum/chain_monitor.d.ts.map +0 -1
  281. package/dest/api/ethereum/chain_monitor.js +0 -74
  282. package/dest/api/ethereum/cheat_codes.d.ts +0 -63
  283. package/dest/api/ethereum/cheat_codes.d.ts.map +0 -1
  284. package/dest/api/ethereum/cheat_codes.js +0 -162
  285. package/dest/api/ethereum/index.d.ts +0 -7
  286. package/dest/api/ethereum/index.d.ts.map +0 -1
  287. package/dest/api/ethereum/index.js +0 -6
  288. package/dest/api/ethereum/l1_contracts.d.ts +0 -3
  289. package/dest/api/ethereum/l1_contracts.d.ts.map +0 -1
  290. package/dest/api/ethereum/l1_contracts.js +0 -13
  291. package/dest/api/ethereum/portal_manager.d.ts.map +0 -1
  292. package/dest/api/interfaces/pxe.d.ts +0 -2
  293. package/dest/api/interfaces/pxe.d.ts.map +0 -1
  294. package/dest/api/interfaces/pxe.js +0 -1
  295. package/dest/api/log_id.d.ts +0 -2
  296. package/dest/api/log_id.d.ts.map +0 -1
  297. package/dest/api/log_id.js +0 -1
  298. package/dest/api/tx_hash.d.ts +0 -2
  299. package/dest/api/tx_hash.d.ts.map +0 -1
  300. package/dest/api/tx_hash.js +0 -1
  301. package/dest/contract/deploy_proven_tx.d.ts +0 -21
  302. package/dest/contract/deploy_proven_tx.d.ts.map +0 -1
  303. package/dest/contract/deploy_proven_tx.js +0 -19
  304. package/dest/contract/index.d.ts.map +0 -1
  305. package/dest/contract/proven_tx.d.ts +0 -17
  306. package/dest/contract/proven_tx.d.ts.map +0 -1
  307. package/dest/contract/proven_tx.js +0 -22
  308. package/dest/deployment/deploy_instance.d.ts +0 -10
  309. package/dest/deployment/deploy_instance.d.ts.map +0 -1
  310. package/dest/deployment/deploy_instance.js +0 -14
  311. package/dest/deployment/index.d.ts +0 -2
  312. package/dest/deployment/index.d.ts.map +0 -1
  313. package/dest/deployment/index.js +0 -1
  314. package/dest/deployment/register_class.d.ts +0 -6
  315. package/dest/deployment/register_class.d.ts.map +0 -1
  316. package/dest/deployment/register_class.js +0 -22
  317. package/dest/entrypoint/default_entrypoint.d.ts +0 -12
  318. package/dest/entrypoint/default_entrypoint.d.ts.map +0 -1
  319. package/dest/entrypoint/default_entrypoint.js +0 -28
  320. package/dest/entrypoint/default_multi_call_entrypoint.d.ts +0 -15
  321. package/dest/entrypoint/default_multi_call_entrypoint.d.ts.map +0 -1
  322. package/dest/entrypoint/default_multi_call_entrypoint.js +0 -130
  323. package/dest/entrypoint/entrypoint.d.ts +0 -35
  324. package/dest/entrypoint/entrypoint.d.ts.map +0 -1
  325. package/dest/entrypoint/entrypoint.js +0 -4
  326. package/dest/entrypoint/payload.d.ts +0 -128
  327. package/dest/entrypoint/payload.d.ts.map +0 -1
  328. package/dest/entrypoint/payload.js +0 -143
  329. package/dest/fee/fee_juice_payment_method.d.ts +0 -14
  330. package/dest/fee/fee_juice_payment_method.d.ts.map +0 -1
  331. package/dest/fee/fee_juice_payment_method.js +0 -20
  332. package/dest/index.d.ts +0 -66
  333. package/dest/index.d.ts.map +0 -1
  334. package/dest/index.js +0 -69
  335. package/dest/rpc_clients/index.d.ts +0 -3
  336. package/dest/rpc_clients/index.d.ts.map +0 -1
  337. package/dest/rpc_clients/index.js +0 -2
  338. package/dest/rpc_clients/node/index.d.ts +0 -12
  339. package/dest/rpc_clients/node/index.d.ts.map +0 -1
  340. package/dest/rpc_clients/node/index.js +0 -78
  341. package/dest/rpc_clients/pxe_client.d.ts +0 -10
  342. package/dest/rpc_clients/pxe_client.d.ts.map +0 -1
  343. package/dest/rpc_clients/pxe_client.js +0 -23
  344. package/dest/utils/aztec_cheatcodes.d.ts +0 -59
  345. package/dest/utils/aztec_cheatcodes.d.ts.map +0 -1
  346. package/dest/utils/aztec_cheatcodes.js +0 -62
  347. package/dest/utils/index.d.ts +0 -8
  348. package/dest/utils/index.d.ts.map +0 -1
  349. package/dest/utils/index.js +0 -6
  350. package/dest/utils/pxe.d.ts +0 -4
  351. package/dest/utils/pxe.d.ts.map +0 -1
  352. package/dest/utils/pxe.js +0 -14
  353. package/dest/wallet/account_wallet.d.ts +0 -76
  354. package/dest/wallet/account_wallet.d.ts.map +0 -1
  355. package/dest/wallet/account_wallet.js +0 -231
  356. package/dest/wallet/account_wallet_with_private_key.d.ts.map +0 -1
  357. package/dest/wallet/signerless_wallet.d.ts +0 -25
  358. package/dest/wallet/signerless_wallet.d.ts.map +0 -1
  359. package/dest/wallet/signerless_wallet.js +0 -36
  360. package/src/account/wallet.ts +0 -13
  361. package/src/account_manager/deploy_account_method.ts +0 -86
  362. package/src/account_manager/deploy_account_sent_tx.ts +0 -42
  363. package/src/account_manager/index.ts +0 -229
  364. package/src/api/cheat_codes.ts +0 -35
  365. package/src/api/entrypoint.ts +0 -1
  366. package/src/api/ethereum/anvil_test_watcher.ts +0 -158
  367. package/src/api/ethereum/chain_monitor.ts +0 -88
  368. package/src/api/ethereum/cheat_codes.ts +0 -184
  369. package/src/api/ethereum/index.ts +0 -19
  370. package/src/api/ethereum/l1_contracts.ts +0 -21
  371. package/src/api/interfaces/pxe.ts +0 -1
  372. package/src/api/log_id.ts +0 -1
  373. package/src/api/tx_hash.ts +0 -1
  374. package/src/contract/deploy_proven_tx.ts +0 -34
  375. package/src/contract/proven_tx.ts +0 -42
  376. package/src/deployment/deploy_instance.ts +0 -31
  377. package/src/deployment/index.ts +0 -1
  378. package/src/deployment/register_class.ts +0 -44
  379. package/src/entrypoint/default_entrypoint.ts +0 -39
  380. package/src/entrypoint/default_multi_call_entrypoint.ts +0 -93
  381. package/src/entrypoint/entrypoint.ts +0 -39
  382. package/src/entrypoint/payload.ts +0 -238
  383. package/src/fee/fee_juice_payment_method.ts +0 -26
  384. package/src/index.ts +0 -106
  385. package/src/rpc_clients/index.ts +0 -2
  386. package/src/rpc_clients/node/index.ts +0 -77
  387. package/src/rpc_clients/pxe_client.ts +0 -25
  388. package/src/utils/aztec_cheatcodes.ts +0 -77
  389. package/src/utils/index.ts +0 -21
  390. package/src/utils/pxe.ts +0 -17
  391. package/src/wallet/account_wallet.ts +0 -242
  392. package/src/wallet/signerless_wallet.ts +0 -52
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAEL,KAAK,gBAAgB,EAErB,KAAK,uBAAuB,EAE5B,YAAY,EACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EACL,KAAK,qBAAqB,EAE1B,KAAK,2BAA2B,EAEhC,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAoB,KAAK,YAAY,EAAE,KAAK,MAAM,EAAqB,MAAM,uBAAuB,CAAC;AAC5G,OAAO,EACL,OAAO,EACP,YAAY,EACZ,MAAM,EACN,eAAe,EACf,SAAS,EACT,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA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;;;;;;;;;;;;;;;;oBAAD,CAAC;;;EAgIT,CAAC;AAE3C,eAAO,MAAM,6BAA6B;;;;;;;;;;;;EAIxC,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,MAAM,CA+C7C,CAAC"}
@@ -0,0 +1,202 @@
1
+ import { AbiTypeSchema, ContractArtifactSchema, FunctionAbiSchema, FunctionType } from '@aztec/stdlib/abi';
2
+ import { AuthWitness } from '@aztec/stdlib/auth-witness';
3
+ import { ContractClassWithIdSchema, ContractInstanceWithAddressSchema } from '@aztec/stdlib/contract';
4
+ import { Gas } from '@aztec/stdlib/gas';
5
+ import { PublicKeys } from '@aztec/stdlib/keys';
6
+ import { AbiDecodedSchema, optional, schemas } from '@aztec/stdlib/schemas';
7
+ import { Capsule, HashedValues, TxHash, TxProfileResult, TxReceipt, TxSimulationResult, UtilitySimulationResult } from '@aztec/stdlib/tx';
8
+ import { z } from 'zod';
9
+ export const ContractInstantiationDataSchema = z.object({
10
+ constructorArtifact: optional(z.union([
11
+ FunctionAbiSchema,
12
+ z.string()
13
+ ])),
14
+ constructorArgs: optional(z.array(z.any())),
15
+ skipArgsDecoding: optional(z.boolean()),
16
+ salt: schemas.Fr,
17
+ publicKeys: optional(PublicKeys.schema),
18
+ deployer: optional(schemas.AztecAddress)
19
+ });
20
+ export const FunctionCallSchema = z.object({
21
+ name: z.string(),
22
+ to: schemas.AztecAddress,
23
+ selector: schemas.FunctionSelector,
24
+ type: z.nativeEnum(FunctionType),
25
+ isStatic: z.boolean(),
26
+ hideMsgSender: z.boolean(),
27
+ args: z.array(schemas.Fr),
28
+ returnTypes: z.array(AbiTypeSchema)
29
+ });
30
+ export const ExecutionPayloadSchema = z.object({
31
+ calls: z.array(FunctionCallSchema),
32
+ authWitnesses: z.array(AuthWitness.schema),
33
+ capsules: z.array(Capsule.schema),
34
+ extraHashedArgs: z.array(HashedValues.schema)
35
+ });
36
+ export const UserFeeOptionsSchema = z.object({
37
+ gasSettings: optional(z.object({
38
+ gasLimits: optional(Gas.schema),
39
+ teardownGasLimits: optional(Gas.schema),
40
+ maxFeePerGas: optional(z.object({
41
+ feePerDaGas: schemas.BigInt,
42
+ feePerL2Gas: schemas.BigInt
43
+ })),
44
+ maxPriorityFeePerGas: optional(z.object({
45
+ feePerDaGas: schemas.BigInt,
46
+ feePerL2Gas: schemas.BigInt
47
+ }))
48
+ })),
49
+ embeddedPaymentMethodFeePayer: optional(schemas.AztecAddress)
50
+ });
51
+ export const WalletSimulationFeeOptionSchema = UserFeeOptionsSchema.extend({
52
+ estimatedGasPadding: optional(z.number()),
53
+ estimateGas: optional(z.boolean())
54
+ });
55
+ export const SendOptionsSchema = z.object({
56
+ from: schemas.AztecAddress,
57
+ authWitnesses: optional(z.array(AuthWitness.schema)),
58
+ capsules: optional(z.array(Capsule.schema)),
59
+ fee: optional(UserFeeOptionsSchema)
60
+ });
61
+ export const SimulateOptionsSchema = z.object({
62
+ from: schemas.AztecAddress,
63
+ authWitnesses: optional(z.array(AuthWitness.schema)),
64
+ capsules: optional(z.array(Capsule.schema)),
65
+ fee: optional(WalletSimulationFeeOptionSchema),
66
+ skipTxValidation: optional(z.boolean()),
67
+ skipFeeEnforcement: optional(z.boolean()),
68
+ includeMetadata: optional(z.boolean())
69
+ });
70
+ export const ProfileOptionsSchema = SimulateOptionsSchema.extend({
71
+ profileMode: z.enum([
72
+ 'gates',
73
+ 'execution-steps',
74
+ 'full'
75
+ ]),
76
+ skipProofGeneration: optional(z.boolean())
77
+ });
78
+ export const InstanceDataSchema = z.union([
79
+ schemas.AztecAddress,
80
+ ContractInstanceWithAddressSchema,
81
+ ContractInstantiationDataSchema,
82
+ z.object({
83
+ instance: ContractInstanceWithAddressSchema,
84
+ artifact: ContractArtifactSchema
85
+ })
86
+ ]);
87
+ export const MessageHashOrIntentSchema = z.union([
88
+ schemas.Fr,
89
+ schemas.Buffer,
90
+ z.object({
91
+ consumer: schemas.AztecAddress,
92
+ innerHash: z.union([
93
+ schemas.Buffer,
94
+ schemas.Fr
95
+ ])
96
+ }),
97
+ z.object({
98
+ caller: schemas.AztecAddress,
99
+ call: FunctionCallSchema
100
+ })
101
+ ]);
102
+ export const BatchedMethodSchema = z.union([
103
+ z.object({
104
+ name: z.literal('registerSender'),
105
+ args: z.tuple([
106
+ schemas.AztecAddress,
107
+ optional(z.string())
108
+ ])
109
+ }),
110
+ z.object({
111
+ name: z.literal('registerContract'),
112
+ args: z.tuple([
113
+ InstanceDataSchema,
114
+ optional(ContractArtifactSchema),
115
+ optional(schemas.Fr)
116
+ ])
117
+ }),
118
+ z.object({
119
+ name: z.literal('sendTx'),
120
+ args: z.tuple([
121
+ ExecutionPayloadSchema,
122
+ SendOptionsSchema
123
+ ])
124
+ }),
125
+ z.object({
126
+ name: z.literal('simulateUtility'),
127
+ args: z.tuple([
128
+ z.string(),
129
+ z.array(z.any()),
130
+ schemas.AztecAddress,
131
+ optional(z.array(AuthWitness.schema))
132
+ ])
133
+ })
134
+ ]);
135
+ export const ContractMetadataSchema = z.object({
136
+ contractInstance: z.union([
137
+ ContractInstanceWithAddressSchema,
138
+ z.undefined()
139
+ ]),
140
+ isContractInitialized: z.boolean(),
141
+ isContractPublished: z.boolean()
142
+ });
143
+ export const ContractClassMetadataSchema = z.object({
144
+ contractClass: z.union([
145
+ ContractClassWithIdSchema,
146
+ z.undefined()
147
+ ]),
148
+ isContractClassPubliclyRegistered: z.boolean(),
149
+ artifact: z.union([
150
+ ContractArtifactSchema,
151
+ z.undefined()
152
+ ])
153
+ });
154
+ export const EventMetadataDefinitionSchema = z.object({
155
+ eventSelector: schemas.EventSelector,
156
+ abiType: AbiTypeSchema,
157
+ fieldNames: z.array(z.string())
158
+ });
159
+ export const WalletSchema = {
160
+ getChainInfo: z.function().args().returns(z.object({
161
+ chainId: schemas.Fr,
162
+ version: schemas.Fr
163
+ })),
164
+ getContractClassMetadata: z.function().args(schemas.Fr, optional(z.boolean())).returns(ContractClassMetadataSchema),
165
+ getContractMetadata: z.function().args(schemas.AztecAddress).returns(ContractMetadataSchema),
166
+ getTxReceipt: z.function().args(TxHash.schema).returns(TxReceipt.schema),
167
+ getPrivateEvents: z.function().args(schemas.AztecAddress, EventMetadataDefinitionSchema, z.number(), z.number(), z.array(schemas.AztecAddress)).returns(z.array(AbiDecodedSchema)),
168
+ registerSender: z.function().args(schemas.AztecAddress, optional(z.string())).returns(schemas.AztecAddress),
169
+ getAddressBook: z.function().args().returns(z.array(z.object({
170
+ alias: z.string(),
171
+ item: schemas.AztecAddress
172
+ }))),
173
+ getAccounts: z.function().args().returns(z.array(z.object({
174
+ alias: z.string(),
175
+ item: schemas.AztecAddress
176
+ }))),
177
+ registerContract: z.function().args(InstanceDataSchema, optional(ContractArtifactSchema), optional(schemas.Fr)).returns(ContractInstanceWithAddressSchema),
178
+ simulateTx: z.function().args(ExecutionPayloadSchema, SimulateOptionsSchema).returns(TxSimulationResult.schema),
179
+ simulateUtility: z.function().args(z.string(), z.array(z.any()), schemas.AztecAddress, optional(z.array(AuthWitness.schema))).returns(UtilitySimulationResult.schema),
180
+ profileTx: z.function().args(ExecutionPayloadSchema, ProfileOptionsSchema).returns(TxProfileResult.schema),
181
+ sendTx: z.function().args(ExecutionPayloadSchema, SendOptionsSchema).returns(TxHash.schema),
182
+ createAuthWit: z.function().args(schemas.AztecAddress, MessageHashOrIntentSchema).returns(AuthWitness.schema),
183
+ // @ts-expect-error - ApiSchemaFor cannot properly type generic methods with readonly arrays
184
+ batch: z.function().args(z.array(BatchedMethodSchema)).returns(z.array(z.discriminatedUnion('name', [
185
+ z.object({
186
+ name: z.literal('registerSender'),
187
+ result: schemas.AztecAddress
188
+ }),
189
+ z.object({
190
+ name: z.literal('registerContract'),
191
+ result: ContractInstanceWithAddressSchema
192
+ }),
193
+ z.object({
194
+ name: z.literal('sendTx'),
195
+ result: TxHash.schema
196
+ }),
197
+ z.object({
198
+ name: z.literal('simulateUtility'),
199
+ result: UtilitySimulationResult.schema
200
+ })
201
+ ])))
202
+ };
package/package.json CHANGED
@@ -1,28 +1,32 @@
1
1
  {
2
2
  "name": "@aztec/aztec.js",
3
3
  "homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/aztec.js",
4
- "version": "0.0.0-test.1",
4
+ "version": "0.0.1-commit.b655e406",
5
5
  "type": "module",
6
6
  "exports": {
7
- ".": "./dest/index.js",
8
- "./interfaces/pxe": "./dest/api/interfaces/pxe.js",
9
7
  "./abi": "./dest/api/abi.js",
10
8
  "./account": "./dest/api/account.js",
11
9
  "./addresses": "./dest/api/addresses.js",
12
- "./cheatcodes": "./dest/api/cheatcodes.js",
13
- "./contracts": "./dest/contract/index.js",
10
+ "./authorization": "./dest/api/authorization.js",
11
+ "./block": "./dest/api/block.js",
12
+ "./contracts": "./dest/api/contract.js",
13
+ "./crypto": "./dest/api/crypto.js",
14
14
  "./deployment": "./dest/api/deployment.js",
15
- "./entrypoint": "./dest/api/entrypoint.js",
16
- "./eth_address": "./dest/api/eth_address.js",
17
- "./ethereum": "./dest/api/ethereum/index.js",
15
+ "./ethereum": "./dest/api/ethereum.js",
16
+ "./events": "./dest/api/events.js",
18
17
  "./fee": "./dest/api/fee.js",
18
+ "./fee/testing": "./dest/api/fee_testing.js",
19
19
  "./fields": "./dest/api/fields.js",
20
+ "./keys": "./dest/api/keys.js",
20
21
  "./log": "./dest/api/log.js",
21
- "./log_id": "./dest/api/log_id.js",
22
- "./rpc": "./dest/rpc_clients/index.js",
23
- "./tx_hash": "./dest/api/tx_hash.js",
24
- "./wallet": "./dest/api/wallet.js",
25
- "./utils": "./dest/utils/index.js"
22
+ "./messaging": "./dest/api/messaging.js",
23
+ "./node": "./dest/api/node.js",
24
+ "./note": "./dest/api/note.js",
25
+ "./protocol": "./dest/api/protocol.js",
26
+ "./trees": "./dest/api/trees.js",
27
+ "./tx": "./dest/api/tx.js",
28
+ "./utils": "./dest/api/utils.js",
29
+ "./wallet": "./dest/api/wallet.js"
26
30
  },
27
31
  "typedocOptions": {
28
32
  "entryPoints": [
@@ -36,8 +40,6 @@
36
40
  "build:dev": "tsc -b --watch",
37
41
  "build:ts": "tsc -b",
38
42
  "clean": "rm -rf ./dest .tsbuildinfo ./src/account_contract/artifacts",
39
- "formatting": "run -T prettier --check ./src && run -T eslint ./src",
40
- "formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
41
43
  "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
42
44
  },
43
45
  "inherits": [
@@ -75,33 +77,39 @@
75
77
  "testTimeout": 120000,
76
78
  "setupFiles": [
77
79
  "../../foundation/src/jest/setup.mjs"
80
+ ],
81
+ "testEnvironment": "../../foundation/src/jest/env.mjs",
82
+ "setupFilesAfterEnv": [
83
+ "../../foundation/src/jest/setupAfterEnv.mjs"
78
84
  ]
79
85
  },
80
86
  "dependencies": {
81
- "@aztec/constants": "0.0.0-test.1",
82
- "@aztec/ethereum": "0.0.0-test.1",
83
- "@aztec/foundation": "0.0.0-test.1",
84
- "@aztec/l1-artifacts": "0.0.0-test.1",
85
- "@aztec/protocol-contracts": "0.0.0-test.1",
86
- "@aztec/stdlib": "0.0.0-test.1",
87
- "axios": "^1.7.2",
87
+ "@aztec/constants": "0.0.1-commit.b655e406",
88
+ "@aztec/entrypoints": "0.0.1-commit.b655e406",
89
+ "@aztec/ethereum": "0.0.1-commit.b655e406",
90
+ "@aztec/foundation": "0.0.1-commit.b655e406",
91
+ "@aztec/l1-artifacts": "0.0.1-commit.b655e406",
92
+ "@aztec/protocol-contracts": "0.0.1-commit.b655e406",
93
+ "@aztec/stdlib": "0.0.1-commit.b655e406",
94
+ "axios": "^1.12.0",
88
95
  "tslib": "^2.4.0",
89
- "viem": "2.22.8"
96
+ "viem": "npm:@spalladino/viem@2.38.2-eip7594.0",
97
+ "zod": "^3.23.8"
90
98
  },
91
99
  "devDependencies": {
92
- "@jest/globals": "^29.5.0",
93
- "@types/jest": "^29.5.0",
94
- "@types/node": "^18.7.23",
100
+ "@jest/globals": "^30.0.0",
101
+ "@types/jest": "^30.0.0",
102
+ "@types/node": "^22.15.17",
95
103
  "buffer": "^6.0.3",
96
- "crypto-browserify": "^3.12.0",
97
- "jest": "^29.5.0",
98
- "jest-mock-extended": "^3.0.3",
104
+ "crypto-browserify": "^3.12.1",
105
+ "jest": "^30.0.0",
106
+ "jest-mock-extended": "^4.0.0",
99
107
  "process": "^0.11.10",
100
108
  "resolve-typescript-plugin": "^2.0.1",
101
109
  "stream-browserify": "^3.0.0",
102
- "ts-loader": "^9.4.4",
110
+ "ts-loader": "^9.5.4",
103
111
  "ts-node": "^10.9.1",
104
- "typescript": "^5.0.4",
112
+ "typescript": "^5.3.3",
105
113
  "util": "^0.12.5"
106
114
  },
107
115
  "files": [
@@ -111,6 +119,6 @@
111
119
  ],
112
120
  "types": "./dest/index.d.ts",
113
121
  "engines": {
114
- "node": ">=18"
122
+ "node": ">=20.10"
115
123
  }
116
124
  }
@@ -0,0 +1,97 @@
1
+ import type { DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
2
+ import type { ExecutionPayload } from '@aztec/entrypoints/payload';
3
+ import { Fr } from '@aztec/foundation/fields';
4
+ import { AuthWitness } from '@aztec/stdlib/auth-witness';
5
+ import type { GasSettings } from '@aztec/stdlib/gas';
6
+ import type { TxExecutionRequest } from '@aztec/stdlib/tx';
7
+
8
+ import { type CallIntent, type IntentInnerHash, computeAuthWitMessageHash } from '../utils/authwit.js';
9
+ import type { AccountInterface } from './interface.js';
10
+
11
+ /**
12
+ * An authwit provider that can create both private and public authwits
13
+ * with an intent as input, as opposed to just a precomputed inner hash
14
+ */
15
+ interface AuthwitnessIntentProvider {
16
+ /**
17
+ * Creates a private authwit from an intent or inner hash, to be provided
18
+ * during function execution
19
+ * @param intent - The action (or inner hash) to authorize
20
+ */
21
+ createAuthWit(intent: IntentInnerHash | CallIntent | Buffer | Fr): Promise<AuthWitness>;
22
+ }
23
+
24
+ /**
25
+ * A type defining an account, capable of both creating authwits and using them
26
+ * to authenticate transaction execution requests.
27
+ */
28
+ export type Account = AccountInterface & AuthwitnessIntentProvider;
29
+
30
+ /**
31
+ * An account implementation that uses authwits as an authentication mechanism
32
+ * and can assemble transaction execution requests for an entrypoint.
33
+ */
34
+ export class BaseAccount implements Account {
35
+ constructor(protected account: AccountInterface) {}
36
+
37
+ createTxExecutionRequest(
38
+ exec: ExecutionPayload,
39
+ gasSettings: GasSettings,
40
+ options: DefaultAccountEntrypointOptions,
41
+ ): Promise<TxExecutionRequest> {
42
+ return this.account.createTxExecutionRequest(exec, gasSettings, options);
43
+ }
44
+
45
+ getChainId(): Fr {
46
+ return this.account.getChainId();
47
+ }
48
+
49
+ getVersion(): Fr {
50
+ return this.account.getVersion();
51
+ }
52
+
53
+ /** Returns the complete address of the account that implements this wallet. */
54
+ public getCompleteAddress() {
55
+ return this.account.getCompleteAddress();
56
+ }
57
+
58
+ /** Returns the address of the account that implements this wallet. */
59
+ public getAddress() {
60
+ return this.getCompleteAddress().address;
61
+ }
62
+
63
+ /**
64
+ * Computes an authentication witness from either a message hash or an intent.
65
+ *
66
+ * If a message hash is provided, it will create a witness for the hash directly.
67
+ * Otherwise, it will compute the message hash using the intent, along with the
68
+ * chain id and the version values provided by the wallet.
69
+ *
70
+ * @param messageHashOrIntent - The message hash of the intent to approve
71
+ * @returns The authentication witness
72
+ */
73
+ async createAuthWit(messageHashOrIntent: Fr | Buffer | CallIntent | IntentInnerHash): Promise<AuthWitness> {
74
+ let messageHash: Fr;
75
+ if (Buffer.isBuffer(messageHashOrIntent)) {
76
+ messageHash = Fr.fromBuffer(messageHashOrIntent);
77
+ } else if (messageHashOrIntent instanceof Fr) {
78
+ messageHash = messageHashOrIntent;
79
+ } else {
80
+ messageHash = await this.getMessageHash(messageHashOrIntent);
81
+ }
82
+
83
+ return this.account.createAuthWit(messageHash);
84
+ }
85
+
86
+ /**
87
+ * Returns the message hash for the given intent
88
+ *
89
+ * @param intent - A tuple of (consumer and inner hash) or (caller and action)
90
+ * @returns The message hash
91
+ */
92
+ private getMessageHash(intent: IntentInnerHash | CallIntent): Promise<Fr> {
93
+ const chainId = this.getChainId();
94
+ const version = this.getVersion();
95
+ return computeAuthWitMessageHash(intent, { chainId, version });
96
+ }
97
+ }
@@ -1,12 +1,12 @@
1
+ import type { AuthWitnessProvider, ChainInfo } from '@aztec/entrypoints/interfaces';
1
2
  import { Fr } from '@aztec/foundation/fields';
2
3
  import type { ContractArtifact } from '@aztec/stdlib/abi';
3
- import type { CompleteAddress, NodeInfo } from '@aztec/stdlib/contract';
4
- import { getContractInstanceFromDeployParams } from '@aztec/stdlib/contract';
4
+ import type { CompleteAddress } from '@aztec/stdlib/contract';
5
+ import { getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
5
6
  import { deriveKeys } from '@aztec/stdlib/keys';
6
7
 
7
- import type { AccountInterface, AuthWitnessProvider } from './interface.js';
8
+ import type { AccountInterface } from './interface.js';
8
9
 
9
- // docs:start:account-contract-interface
10
10
  /**
11
11
  * An account contract instance. Knows its artifact, deployment arguments, how to create
12
12
  * transaction execution requests out of function calls, and how to authorize actions.
@@ -18,19 +18,27 @@ export interface AccountContract {
18
18
  getContractArtifact(): Promise<ContractArtifact>;
19
19
 
20
20
  /**
21
- * Returns the deployment arguments for this instance, or undefined if this contract does not require deployment.
21
+ * Returns the initializer function name and arguments for this instance, or undefined if this contract does not require initialization.
22
22
  */
23
- getDeploymentArgs(): Promise<any[] | undefined>;
23
+ getInitializationFunctionAndArgs(): Promise<
24
+ | {
25
+ /** The name of the function used to initialize the contract */
26
+ constructorName: string;
27
+ /** The args to the function used to initialize the contract */
28
+ constructorArgs: any[];
29
+ }
30
+ | undefined
31
+ >;
24
32
 
25
33
  /**
26
- * Returns the account interface for this account contract given a deployment at the provided address.
34
+ * Returns the account interface for this account contract given an instance at the provided address.
27
35
  * The account interface is responsible for assembling tx requests given requested function calls, and
28
36
  * for creating signed auth witnesses given action identifiers (message hashes).
29
- * @param address - Address where this account contract is deployed.
30
- * @param nodeInfo - Info on the chain where it is deployed.
37
+ * @param address - Address of this account contract.
38
+ * @param chainInfo - Chain id and version of the rollup where the account contract is initialized / published.
31
39
  * @returns An account interface instance for creating tx requests and authorizing actions.
32
40
  */
33
- getInterface(address: CompleteAddress, nodeInfo: NodeInfo): AccountInterface;
41
+ getInterface(address: CompleteAddress, chainInfo: ChainInfo): AccountInterface;
34
42
 
35
43
  /**
36
44
  * Returns the auth witness provider for the given address.
@@ -38,16 +46,19 @@ export interface AccountContract {
38
46
  */
39
47
  getAuthWitnessProvider(address: CompleteAddress): AuthWitnessProvider;
40
48
  }
41
- // docs:end:account-contract-interface
42
49
 
43
50
  /**
44
51
  * Compute the address of an account contract from secret and salt.
45
52
  */
46
53
  export async function getAccountContractAddress(accountContract: AccountContract, secret: Fr, salt: Fr) {
47
54
  const { publicKeys } = await deriveKeys(secret);
48
- const constructorArgs = await accountContract.getDeploymentArgs();
55
+ const { constructorName, constructorArgs } = (await accountContract.getInitializationFunctionAndArgs()) ?? {
56
+ constructorName: undefined,
57
+ constructorArgs: undefined,
58
+ };
49
59
  const artifact = await accountContract.getContractArtifact();
50
- const instance = await getContractInstanceFromDeployParams(artifact, {
60
+ const instance = await getContractInstanceFromInstantiationParams(artifact, {
61
+ constructorArtifact: constructorName,
51
62
  constructorArgs,
52
63
  salt,
53
64
  publicKeys,
@@ -1,25 +1,23 @@
1
1
  import type { Fr } from '@aztec/foundation/fields';
2
- import type { PXE } from '@aztec/stdlib/interfaces/client';
3
2
  import { computeAddressSecret, deriveMasterIncomingViewingSecretKey } from '@aztec/stdlib/keys';
4
3
 
5
- import type { Salt } from '../account/index.js';
6
- import type { AccountInterface } from '../account/interface.js';
7
- import { AccountWallet } from './account_wallet.js';
4
+ import { BaseAccount } from './account.js';
5
+ import type { Salt } from './index.js';
6
+ import type { AccountInterface } from './interface.js';
8
7
 
9
8
  /**
10
- * Extends {@link AccountWallet} with the encryption private key. Not required for
9
+ * Extends {@link Account} with the encryption private key. Not required for
11
10
  * implementing the wallet interface but useful for testing purposes or exporting
12
11
  * an account to another pxe.
13
12
  */
14
- export class AccountWalletWithSecretKey extends AccountWallet {
13
+ export class AccountWithSecretKey extends BaseAccount {
15
14
  constructor(
16
- pxe: PXE,
17
15
  account: AccountInterface,
18
16
  private secretKey: Fr,
19
17
  /** Deployment salt for this account contract. */
20
18
  public readonly salt: Salt,
21
19
  ) {
22
- super(pxe, account);
20
+ super(account);
23
21
  }
24
22
 
25
23
  /** Returns the encryption private key associated with this account. */
@@ -1,16 +1,12 @@
1
1
  /**
2
- * The `account` module provides utilities for managing accounts. The {@link AccountManager} class
3
- * allows to deploy and register a fresh account, or to obtain a `Wallet` instance out of an account
4
- * already deployed. Use the `@aztec/accounts` package to load default account implementations that rely
5
- * on ECDSA or Schnorr signatures.
2
+ * The `account` module provides utilities for managing accounts.
6
3
  *
7
4
  * @packageDocumentation
8
5
  */
9
6
  import type { Fr } from '@aztec/foundation/fields';
10
7
 
11
- export { type AccountContract, getAccountContractAddress } from './contract.js';
12
- export { type AccountInterface, type AuthWitnessProvider } from './interface.js';
13
- export * from './wallet.js';
8
+ export { type AccountContract, getAccountContractAddress } from './account_contract.js';
9
+ export { type AccountInterface } from './interface.js';
14
10
 
15
11
  /** A contract deployment salt. */
16
12
  export type Salt = Fr | number | bigint;
@@ -1,20 +1,9 @@
1
+ import type { AuthWitnessProvider, EntrypointInterface } from '@aztec/entrypoints/interfaces';
1
2
  import type { Fr } from '@aztec/foundation/fields';
2
- import type { AuthWitness } from '@aztec/stdlib/auth-witness';
3
3
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
4
4
  import type { CompleteAddress } from '@aztec/stdlib/contract';
5
5
 
6
- import type { EntrypointInterface } from '../entrypoint/entrypoint.js';
7
-
8
6
  // docs:start:account-interface
9
- /** Creates authorization witnesses. */
10
- export interface AuthWitnessProvider {
11
- /**
12
- * Computes an authentication witness from either a message hash
13
- * @param messageHash - The message hash to approve
14
- * @returns The authentication witness
15
- */
16
- createAuthWit(messageHash: Fr | Buffer): Promise<AuthWitness>;
17
- }
18
7
 
19
8
  /**
20
9
  * Handler for interfacing with an account. Knows how to create transaction execution
@@ -0,0 +1,46 @@
1
+ import type { ChainInfo, EntrypointInterface } from '@aztec/entrypoints/interfaces';
2
+ import { DefaultMultiCallEntrypoint } from '@aztec/entrypoints/multicall';
3
+ import type { ExecutionPayload } from '@aztec/entrypoints/payload';
4
+ import type { Fr } from '@aztec/foundation/fields';
5
+ import { AuthWitness } from '@aztec/stdlib/auth-witness';
6
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
7
+ import type { CompleteAddress } from '@aztec/stdlib/contract';
8
+ import type { GasSettings } from '@aztec/stdlib/gas';
9
+ import type { TxExecutionRequest } from '@aztec/stdlib/tx';
10
+
11
+ import type { CallIntent, IntentInnerHash } from '../utils/authwit.js';
12
+ import type { Account } from './account.js';
13
+
14
+ /**
15
+ * Account implementation which creates a transaction using the multicall protocol contract as entrypoint.
16
+ */
17
+ export class SignerlessAccount implements Account {
18
+ private entrypoint: EntrypointInterface;
19
+ constructor(chainInfo: ChainInfo) {
20
+ this.entrypoint = new DefaultMultiCallEntrypoint(chainInfo.chainId.toNumber(), chainInfo.version.toNumber());
21
+ }
22
+
23
+ createTxExecutionRequest(exec: ExecutionPayload, gasSettings: GasSettings): Promise<TxExecutionRequest> {
24
+ return this.entrypoint.createTxExecutionRequest(exec, gasSettings);
25
+ }
26
+
27
+ getChainId(): Fr {
28
+ throw new Error('SignerlessAccount: Method getChainId not implemented.');
29
+ }
30
+
31
+ getVersion(): Fr {
32
+ throw new Error('SignerlessAccount: Method getVersion not implemented.');
33
+ }
34
+
35
+ getCompleteAddress(): CompleteAddress {
36
+ throw new Error('SignerlessAccount: Method getCompleteAddress not implemented.');
37
+ }
38
+
39
+ getAddress(): AztecAddress {
40
+ throw new Error('SignerlessAccount: Method getAddress not implemented.');
41
+ }
42
+
43
+ createAuthWit(_intent: Fr | Buffer | IntentInnerHash | CallIntent): Promise<AuthWitness> {
44
+ throw new Error('SignerlessAccount: Method createAuthWit not implemented.');
45
+ }
46
+ }