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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/dest/account/account.d.ts +60 -0
  2. package/dest/account/account.d.ts.map +1 -0
  3. package/dest/account/account.js +59 -0
  4. package/dest/account/account_contract.d.ts +5 -5
  5. package/dest/account/account_contract.d.ts.map +1 -1
  6. package/dest/account/account_contract.js +0 -1
  7. package/dest/{wallet/account_wallet_with_private_key.d.ts → account/account_with_secret_key.d.ts} +7 -8
  8. package/dest/account/account_with_secret_key.d.ts.map +1 -0
  9. package/dest/{wallet/account_wallet_with_private_key.js → account/account_with_secret_key.js} +5 -5
  10. package/dest/account/index.d.ts +1 -4
  11. package/dest/account/index.d.ts.map +1 -1
  12. package/dest/account/index.js +1 -4
  13. package/dest/account/signerless_account.d.ts +24 -0
  14. package/dest/account/signerless_account.d.ts.map +1 -0
  15. package/dest/account/signerless_account.js +27 -0
  16. package/dest/api/abi.d.ts +1 -0
  17. package/dest/api/abi.d.ts.map +1 -1
  18. package/dest/api/account.d.ts +4 -2
  19. package/dest/api/account.d.ts.map +1 -1
  20. package/dest/api/account.js +3 -1
  21. package/dest/api/addresses.d.ts +1 -0
  22. package/dest/api/addresses.d.ts.map +1 -1
  23. package/dest/api/addresses.js +1 -0
  24. package/dest/api/authorization.d.ts +2 -0
  25. package/dest/api/authorization.d.ts.map +1 -1
  26. package/dest/api/authorization.js +2 -0
  27. package/dest/api/block.d.ts +3 -0
  28. package/dest/api/block.d.ts.map +1 -0
  29. package/dest/api/block.js +2 -0
  30. package/dest/api/contract.d.ts +4 -5
  31. package/dest/api/contract.d.ts.map +1 -1
  32. package/dest/api/contract.js +3 -3
  33. package/dest/api/crypto.d.ts +2 -0
  34. package/dest/api/crypto.d.ts.map +1 -0
  35. package/dest/api/crypto.js +1 -0
  36. package/dest/api/ethereum.d.ts +0 -1
  37. package/dest/api/ethereum.d.ts.map +1 -1
  38. package/dest/api/ethereum.js +0 -1
  39. package/dest/api/events.d.ts +12 -0
  40. package/dest/api/events.d.ts.map +1 -0
  41. package/dest/api/events.js +30 -0
  42. package/dest/api/fee.d.ts +1 -2
  43. package/dest/api/fee.d.ts.map +1 -1
  44. package/dest/api/fee.js +0 -1
  45. package/dest/api/keys.d.ts +4 -0
  46. package/dest/api/keys.d.ts.map +1 -0
  47. package/dest/api/keys.js +3 -0
  48. package/dest/api/log.d.ts +1 -0
  49. package/dest/api/log.d.ts.map +1 -1
  50. package/dest/api/log.js +1 -0
  51. package/dest/api/messaging.d.ts +3 -0
  52. package/dest/api/messaging.d.ts.map +1 -0
  53. package/dest/api/messaging.js +2 -0
  54. package/dest/api/node.d.ts +21 -0
  55. package/dest/api/node.d.ts.map +1 -0
  56. package/dest/api/node.js +18 -0
  57. package/dest/api/note.d.ts +2 -0
  58. package/dest/api/note.d.ts.map +1 -0
  59. package/dest/api/note.js +1 -0
  60. package/dest/api/protocol.d.ts +3 -0
  61. package/dest/api/protocol.d.ts.map +1 -0
  62. package/dest/api/protocol.js +2 -0
  63. package/dest/api/trees.d.ts +3 -0
  64. package/dest/api/trees.d.ts.map +1 -0
  65. package/dest/api/trees.js +2 -0
  66. package/dest/api/tx.d.ts +2 -0
  67. package/dest/api/tx.d.ts.map +1 -0
  68. package/dest/api/tx.js +1 -0
  69. package/dest/api/utils.d.ts +10 -6
  70. package/dest/api/utils.d.ts.map +1 -1
  71. package/dest/api/utils.js +10 -5
  72. package/dest/api/wallet.d.ts +4 -1
  73. package/dest/api/wallet.d.ts.map +1 -1
  74. package/dest/api/wallet.js +4 -1
  75. package/dest/contract/base_contract_interaction.d.ts +6 -48
  76. package/dest/contract/base_contract_interaction.d.ts.map +1 -1
  77. package/dest/contract/base_contract_interaction.js +6 -106
  78. package/dest/contract/batch_call.d.ts +6 -14
  79. package/dest/contract/batch_call.d.ts.map +1 -1
  80. package/dest/contract/batch_call.js +42 -52
  81. package/dest/contract/contract.d.ts +1 -1
  82. package/dest/contract/contract.d.ts.map +1 -1
  83. package/dest/contract/contract.js +2 -12
  84. package/dest/contract/contract_base.d.ts +1 -1
  85. package/dest/contract/contract_base.d.ts.map +1 -1
  86. package/dest/contract/contract_function_interaction.d.ts +29 -40
  87. package/dest/contract/contract_function_interaction.d.ts.map +1 -1
  88. package/dest/contract/contract_function_interaction.js +41 -53
  89. package/dest/contract/deploy_method.d.ts +63 -56
  90. package/dest/contract/deploy_method.d.ts.map +1 -1
  91. package/dest/contract/deploy_method.js +68 -86
  92. package/dest/contract/deploy_sent_tx.d.ts +0 -1
  93. package/dest/contract/deploy_sent_tx.d.ts.map +1 -1
  94. package/dest/contract/deploy_sent_tx.js +7 -10
  95. package/dest/contract/interaction_options.d.ts +74 -19
  96. package/dest/contract/interaction_options.d.ts.map +1 -1
  97. package/dest/contract/interaction_options.js +51 -3
  98. package/dest/contract/sent_tx.d.ts +3 -3
  99. package/dest/contract/sent_tx.d.ts.map +1 -1
  100. package/dest/contract/sent_tx.js +5 -5
  101. package/dest/contract/wait_for_proven.d.ts +3 -3
  102. package/dest/contract/wait_for_proven.d.ts.map +1 -1
  103. package/dest/contract/wait_for_proven.js +2 -2
  104. package/dest/deployment/publish_instance.d.ts +1 -1
  105. package/dest/deployment/publish_instance.d.ts.map +1 -1
  106. package/dest/deployment/publish_instance.js +2 -5
  107. package/dest/ethereum/portal_manager.d.ts +3 -4
  108. package/dest/ethereum/portal_manager.d.ts.map +1 -1
  109. package/dest/ethereum/portal_manager.js +3 -5
  110. package/dest/fee/fee_juice_payment_method_with_claim.d.ts +12 -7
  111. package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -1
  112. package/dest/fee/fee_juice_payment_method_with_claim.js +21 -12
  113. package/dest/fee/fee_payment_method.d.ts +26 -0
  114. package/dest/fee/fee_payment_method.d.ts.map +1 -0
  115. package/dest/fee/fee_payment_method.js +3 -0
  116. package/dest/fee/private_fee_payment_method.d.ts +22 -5
  117. package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
  118. package/dest/fee/private_fee_payment_method.js +34 -13
  119. package/dest/fee/public_fee_payment_method.d.ts +22 -5
  120. package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
  121. package/dest/fee/public_fee_payment_method.js +37 -14
  122. package/dest/fee/sponsored_fee_payment.d.ts +2 -0
  123. package/dest/fee/sponsored_fee_payment.d.ts.map +1 -1
  124. package/dest/fee/sponsored_fee_payment.js +4 -0
  125. package/dest/utils/authwit.d.ts +77 -25
  126. package/dest/utils/authwit.d.ts.map +1 -1
  127. package/dest/utils/authwit.js +219 -24
  128. package/dest/utils/cross_chain.d.ts +24 -0
  129. package/dest/utils/cross_chain.d.ts.map +1 -0
  130. package/dest/utils/cross_chain.js +30 -0
  131. package/dest/utils/fee_juice.d.ts +3 -2
  132. package/dest/utils/fee_juice.d.ts.map +1 -1
  133. package/dest/utils/fee_juice.js +3 -2
  134. package/dest/{fee → wallet}/account_entrypoint_meta_payment_method.d.ts +13 -10
  135. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -0
  136. package/dest/wallet/account_entrypoint_meta_payment_method.js +76 -0
  137. package/dest/wallet/account_manager.d.ts +69 -0
  138. package/dest/wallet/account_manager.d.ts.map +1 -0
  139. package/dest/wallet/account_manager.js +113 -0
  140. package/dest/wallet/base_wallet.d.ts +78 -35
  141. package/dest/wallet/base_wallet.d.ts.map +1 -1
  142. package/dest/wallet/base_wallet.js +216 -48
  143. package/dest/wallet/deploy_account_method.d.ts +52 -0
  144. package/dest/wallet/deploy_account_method.d.ts.map +1 -0
  145. package/dest/wallet/deploy_account_method.js +77 -0
  146. package/dest/wallet/index.d.ts +2 -15
  147. package/dest/wallet/index.d.ts.map +1 -1
  148. package/dest/wallet/index.js +2 -19
  149. package/dest/wallet/wallet.d.ts +2473 -6
  150. package/dest/wallet/wallet.d.ts.map +1 -1
  151. package/dest/wallet/wallet.js +202 -3
  152. package/package.json +25 -21
  153. package/src/account/account.ts +97 -0
  154. package/src/account/account_contract.ts +4 -6
  155. package/src/{wallet/account_wallet_with_private_key.ts → account/account_with_secret_key.ts} +6 -8
  156. package/src/account/index.ts +1 -4
  157. package/src/account/signerless_account.ts +46 -0
  158. package/src/api/abi.ts +11 -0
  159. package/src/api/account.ts +4 -2
  160. package/src/api/addresses.ts +1 -0
  161. package/src/api/authorization.ts +11 -0
  162. package/src/api/block.ts +2 -0
  163. package/src/api/contract.ts +16 -8
  164. package/src/api/crypto.ts +1 -0
  165. package/src/api/ethereum.ts +0 -1
  166. package/src/api/events.ts +44 -0
  167. package/src/api/fee.ts +1 -2
  168. package/src/api/keys.ts +8 -0
  169. package/src/api/log.ts +1 -0
  170. package/src/api/messaging.ts +2 -0
  171. package/src/api/node.ts +20 -0
  172. package/src/api/note.ts +1 -0
  173. package/src/api/protocol.ts +2 -0
  174. package/src/api/trees.ts +2 -0
  175. package/src/api/tx.ts +11 -0
  176. package/src/api/utils.ts +12 -19
  177. package/src/api/wallet.ts +33 -5
  178. package/src/contract/base_contract_interaction.ts +9 -138
  179. package/src/contract/batch_call.ts +52 -61
  180. package/src/contract/contract.ts +2 -12
  181. package/src/contract/contract_function_interaction.ts +65 -97
  182. package/src/contract/deploy_method.ts +117 -99
  183. package/src/contract/deploy_sent_tx.ts +4 -10
  184. package/src/contract/interaction_options.ts +126 -24
  185. package/src/contract/sent_tx.ts +4 -4
  186. package/src/contract/wait_for_proven.ts +4 -4
  187. package/src/deployment/publish_instance.ts +3 -8
  188. package/src/ethereum/portal_manager.ts +4 -12
  189. package/src/fee/fee_juice_payment_method_with_claim.ts +26 -17
  190. package/src/fee/fee_payment_method.ts +26 -0
  191. package/src/fee/private_fee_payment_method.ts +60 -41
  192. package/src/fee/public_fee_payment_method.ts +73 -49
  193. package/src/fee/sponsored_fee_payment.ts +6 -0
  194. package/src/utils/authwit.ts +250 -38
  195. package/src/utils/cross_chain.ts +53 -0
  196. package/src/utils/fee_juice.ts +4 -3
  197. package/src/wallet/account_entrypoint_meta_payment_method.ts +105 -0
  198. package/src/wallet/account_manager.ts +154 -0
  199. package/src/wallet/base_wallet.ts +287 -78
  200. package/src/wallet/deploy_account_method.ts +125 -0
  201. package/src/wallet/index.ts +2 -32
  202. package/src/wallet/wallet.ts +357 -29
  203. package/dest/account_manager/account_manager.d.ts +0 -119
  204. package/dest/account_manager/account_manager.d.ts.map +0 -1
  205. package/dest/account_manager/account_manager.js +0 -202
  206. package/dest/account_manager/deploy_account_sent_tx.d.ts +0 -30
  207. package/dest/account_manager/deploy_account_sent_tx.d.ts.map +0 -1
  208. package/dest/account_manager/deploy_account_sent_tx.js +0 -29
  209. package/dest/account_manager/index.d.ts +0 -3
  210. package/dest/account_manager/index.d.ts.map +0 -1
  211. package/dest/account_manager/index.js +0 -2
  212. package/dest/api/interfaces.d.ts +0 -2
  213. package/dest/api/interfaces.d.ts.map +0 -1
  214. package/dest/api/interfaces.js +0 -1
  215. package/dest/api/log_id.d.ts +0 -2
  216. package/dest/api/log_id.d.ts.map +0 -1
  217. package/dest/api/log_id.js +0 -1
  218. package/dest/api/rpc.d.ts +0 -3
  219. package/dest/api/rpc.d.ts.map +0 -1
  220. package/dest/api/rpc.js +0 -2
  221. package/dest/api/tx_hash.d.ts +0 -2
  222. package/dest/api/tx_hash.d.ts.map +0 -1
  223. package/dest/api/tx_hash.js +0 -1
  224. package/dest/contract/deploy_proven_tx.d.ts +0 -21
  225. package/dest/contract/deploy_proven_tx.d.ts.map +0 -1
  226. package/dest/contract/deploy_proven_tx.js +0 -21
  227. package/dest/contract/proven_tx.d.ts +0 -21
  228. package/dest/contract/proven_tx.d.ts.map +0 -1
  229. package/dest/contract/proven_tx.js +0 -23
  230. package/dest/ethereum/l1_contracts.d.ts +0 -3
  231. package/dest/ethereum/l1_contracts.d.ts.map +0 -1
  232. package/dest/ethereum/l1_contracts.js +0 -13
  233. package/dest/fee/account_entrypoint_meta_payment_method.d.ts.map +0 -1
  234. package/dest/fee/account_entrypoint_meta_payment_method.js +0 -64
  235. package/dest/fee/fee_juice_payment_method.d.ts +0 -14
  236. package/dest/fee/fee_juice_payment_method.d.ts.map +0 -1
  237. package/dest/fee/fee_juice_payment_method.js +0 -21
  238. package/dest/fee/utils.d.ts +0 -13
  239. package/dest/fee/utils.d.ts.map +0 -1
  240. package/dest/fee/utils.js +0 -32
  241. package/dest/index.d.ts +0 -59
  242. package/dest/index.d.ts.map +0 -1
  243. package/dest/index.js +0 -62
  244. package/dest/rpc_clients/node/index.d.ts +0 -12
  245. package/dest/rpc_clients/node/index.d.ts.map +0 -1
  246. package/dest/rpc_clients/node/index.js +0 -72
  247. package/dest/rpc_clients/pxe_client.d.ts +0 -10
  248. package/dest/rpc_clients/pxe_client.d.ts.map +0 -1
  249. package/dest/rpc_clients/pxe_client.js +0 -23
  250. package/dest/utils/pxe.d.ts +0 -4
  251. package/dest/utils/pxe.d.ts.map +0 -1
  252. package/dest/utils/pxe.js +0 -14
  253. package/dest/wallet/account_wallet.d.ts +0 -74
  254. package/dest/wallet/account_wallet.d.ts.map +0 -1
  255. package/dest/wallet/account_wallet.js +0 -232
  256. package/dest/wallet/account_wallet_with_private_key.d.ts.map +0 -1
  257. package/dest/wallet/signerless_wallet.d.ts +0 -23
  258. package/dest/wallet/signerless_wallet.d.ts.map +0 -1
  259. package/dest/wallet/signerless_wallet.js +0 -33
  260. package/src/account_manager/account_manager.ts +0 -276
  261. package/src/account_manager/deploy_account_sent_tx.ts +0 -46
  262. package/src/account_manager/index.ts +0 -2
  263. package/src/api/interfaces.ts +0 -1
  264. package/src/api/log_id.ts +0 -1
  265. package/src/api/rpc.ts +0 -2
  266. package/src/api/tx_hash.ts +0 -1
  267. package/src/contract/deploy_proven_tx.ts +0 -45
  268. package/src/contract/proven_tx.ts +0 -36
  269. package/src/ethereum/l1_contracts.ts +0 -21
  270. package/src/fee/account_entrypoint_meta_payment_method.ts +0 -89
  271. package/src/fee/fee_juice_payment_method.ts +0 -25
  272. package/src/fee/utils.ts +0 -39
  273. package/src/index.ts +0 -85
  274. package/src/rpc_clients/node/index.ts +0 -77
  275. package/src/rpc_clients/pxe_client.ts +0 -25
  276. package/src/utils/pxe.ts +0 -17
  277. package/src/wallet/account_wallet.ts +0 -246
  278. package/src/wallet/signerless_wallet.ts +0 -56
package/dest/index.d.ts DELETED
@@ -1,59 +0,0 @@
1
- /**
2
- * This is our public api.
3
- * Do NOT "export * from ..." here.
4
- * Everything here should be explicit, to ensure we can clearly see everything we're exposing to the world.
5
- * If it's exposed, people will use it, and then we can't remove/change the api without breaking client code.
6
- * At the time of writing we overexpose things that should only be internal.
7
- *
8
- * TODO: Review and narrow scope of public api.
9
- * We should also consider exposing subsections of the api via package.json exports, like we do with foundation.
10
- * This can allow consumers to import much smaller parts of the library to incur less overhead.
11
- * It will also allow web bundlers do perform intelligent chunking of bundles etc.
12
- * Some work as been done on this within the api folder, providing the alternative import style of e.g.:
13
- * ```typescript
14
- * import { TxHash } from '@aztec.js/tx_hash'
15
- * import { type ContractArtifact, type FunctionArtifact, FunctionSelector } from '@aztec/aztec.js/abi';
16
- * import { AztecAddress } from '@aztec/aztec.js/addresses';
17
- * import { EthAddress } from '@aztec/aztec.js/eth_address';
18
- * ```
19
- *
20
- * TODO: Ultimately reimplement this mega exporter by mega exporting a granular api (then deprecate it).
21
- */
22
- export { Fq, Fr, Point, GrumpkinScalar } from '@aztec/foundation/fields';
23
- export { SiblingPath } from '@aztec/foundation/trees';
24
- export { INITIAL_L2_BLOCK_NUM } from '@aztec/constants';
25
- export { MerkleTreeId, merkleTreeIds } from '@aztec/stdlib/trees';
26
- export { type PublicKey, PublicKeys } from '@aztec/stdlib/keys';
27
- export { computeSecretHash } from '@aztec/stdlib/hash';
28
- export { computeAppNullifierSecretKey, deriveKeys, deriveMasterIncomingViewingSecretKey, deriveMasterNullifierSecretKey, } from '@aztec/stdlib/keys';
29
- export { getTimestampRangeForEpoch } from '@aztec/stdlib/epoch-helpers';
30
- export { Tx, TxExecutionRequest, TxHash, TxReceipt, TxStatus, Capsule, HashedValues, GlobalVariables, } from '@aztec/stdlib/tx';
31
- export { Body, L2Block } from '@aztec/stdlib/block';
32
- export { LogId, type LogFilter } from '@aztec/stdlib/logs';
33
- export { L1ToL2Message, L2Actor, L1Actor } from '@aztec/stdlib/messaging';
34
- export { UniqueNote, ExtendedNote, Comparator, Note } from '@aztec/stdlib/note';
35
- export { type PXE, EventType } from '@aztec/stdlib/interfaces/client';
36
- export { ProtocolContractAddress } from '@aztec/protocol-contracts';
37
- export { toBigIntBE } from '@aztec/foundation/bigint-buffer';
38
- export { sha256, Grumpkin, Schnorr } from '@aztec/foundation/crypto';
39
- export { makeFetch } from '@aztec/foundation/json-rpc/client';
40
- export { retry, retryUntil } from '@aztec/foundation/retry';
41
- export { to2Fields, toBigInt } from '@aztec/foundation/serialize';
42
- export { sleep } from '@aztec/foundation/sleep';
43
- export { elapsed } from '@aztec/foundation/timer';
44
- export { type FieldsOf } from '@aztec/foundation/types';
45
- export { fileURLToPath } from '@aztec/foundation/url';
46
- export * from './api/abi.js';
47
- export * from './api/authorization.js';
48
- export * from './api/account.js';
49
- export * from './api/addresses.js';
50
- export * from './api/deployment.js';
51
- export * from './api/ethereum.js';
52
- export * from './api/eth_address.js';
53
- export * from './api/fee.js';
54
- export * from './api/log.js';
55
- export * from './api/contract.js';
56
- export * from './api/utils.js';
57
- export * from './api/rpc.js';
58
- export * from './api/wallet.js';
59
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,KAAK,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EACL,4BAA4B,EAC5B,UAAU,EACV,oCAAoC,EACpC,8BAA8B,GAC/B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EACL,EAAE,EACF,kBAAkB,EAClB,MAAM,EACN,SAAS,EACT,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,KAAK,GAAG,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAKpE,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAKtD,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC"}
package/dest/index.js DELETED
@@ -1,62 +0,0 @@
1
- /**
2
- * This is our public api.
3
- * Do NOT "export * from ..." here.
4
- * Everything here should be explicit, to ensure we can clearly see everything we're exposing to the world.
5
- * If it's exposed, people will use it, and then we can't remove/change the api without breaking client code.
6
- * At the time of writing we overexpose things that should only be internal.
7
- *
8
- * TODO: Review and narrow scope of public api.
9
- * We should also consider exposing subsections of the api via package.json exports, like we do with foundation.
10
- * This can allow consumers to import much smaller parts of the library to incur less overhead.
11
- * It will also allow web bundlers do perform intelligent chunking of bundles etc.
12
- * Some work as been done on this within the api folder, providing the alternative import style of e.g.:
13
- * ```typescript
14
- * import { TxHash } from '@aztec.js/tx_hash'
15
- * import { type ContractArtifact, type FunctionArtifact, FunctionSelector } from '@aztec/aztec.js/abi';
16
- * import { AztecAddress } from '@aztec/aztec.js/addresses';
17
- * import { EthAddress } from '@aztec/aztec.js/eth_address';
18
- * ```
19
- *
20
- * TODO: Ultimately reimplement this mega exporter by mega exporting a granular api (then deprecate it).
21
- */ export { Fq, Fr, Point, GrumpkinScalar } from '@aztec/foundation/fields';
22
- export { SiblingPath } from '@aztec/foundation/trees';
23
- export { INITIAL_L2_BLOCK_NUM } from '@aztec/constants';
24
- export { MerkleTreeId, merkleTreeIds } from '@aztec/stdlib/trees';
25
- export { PublicKeys } from '@aztec/stdlib/keys';
26
- export { computeSecretHash } from '@aztec/stdlib/hash';
27
- export { computeAppNullifierSecretKey, deriveKeys, deriveMasterIncomingViewingSecretKey, deriveMasterNullifierSecretKey } from '@aztec/stdlib/keys';
28
- export { getTimestampRangeForEpoch } from '@aztec/stdlib/epoch-helpers';
29
- export { Tx, TxExecutionRequest, TxHash, TxReceipt, TxStatus, Capsule, HashedValues, GlobalVariables } from '@aztec/stdlib/tx';
30
- export { Body, L2Block } from '@aztec/stdlib/block';
31
- export { LogId } from '@aztec/stdlib/logs';
32
- export { L1ToL2Message, L2Actor, L1Actor } from '@aztec/stdlib/messaging';
33
- export { UniqueNote, ExtendedNote, Comparator, Note } from '@aztec/stdlib/note';
34
- export { EventType } from '@aztec/stdlib/interfaces/client';
35
- export { ProtocolContractAddress } from '@aztec/protocol-contracts';
36
- // TODO: These kinds of things have no place on our public api.
37
- // External devs will almost certainly have their own methods of doing these things.
38
- // If we want to use them in our own "aztec.js consuming code", import them from foundation as needed.
39
- export { toBigIntBE } from '@aztec/foundation/bigint-buffer';
40
- export { sha256, Grumpkin, Schnorr } from '@aztec/foundation/crypto';
41
- export { makeFetch } from '@aztec/foundation/json-rpc/client';
42
- export { retry, retryUntil } from '@aztec/foundation/retry';
43
- export { to2Fields, toBigInt } from '@aztec/foundation/serialize';
44
- export { sleep } from '@aztec/foundation/sleep';
45
- export { elapsed } from '@aztec/foundation/timer';
46
- export { fileURLToPath } from '@aztec/foundation/url';
47
- // Start of section that exports public api via granular api.
48
- // Here you *can* do `export *` as the granular api defacto exports things explicitly.
49
- // This entire index file will be deprecated at some point after we're satisfied.
50
- export * from './api/abi.js';
51
- export * from './api/authorization.js';
52
- export * from './api/account.js';
53
- export * from './api/addresses.js';
54
- export * from './api/deployment.js';
55
- export * from './api/ethereum.js';
56
- export * from './api/eth_address.js';
57
- export * from './api/fee.js';
58
- export * from './api/log.js';
59
- export * from './api/contract.js';
60
- export * from './api/utils.js';
61
- export * from './api/rpc.js';
62
- export * from './api/wallet.js';
@@ -1,12 +0,0 @@
1
- import { type Logger } from '@aztec/foundation/log';
2
- import type { PXE } from '@aztec/stdlib/interfaces/client';
3
- import type { ComponentsVersions } from '@aztec/stdlib/versioning';
4
- /**
5
- * Creates a PXE client with a given set of retries on non-server errors.
6
- * Checks that PXE matches the expected version, and warns if not.
7
- * @param rpcUrl - URL of the RPC server wrapping the PXE.
8
- * @param _logger - Debug logger to warn version incompatibilities.
9
- * @returns A PXE client.
10
- */
11
- export declare function createCompatibleClient(rpcUrl: string, logger?: Logger, versions?: Partial<ComponentsVersions>): Promise<PXE>;
12
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rpc_clients/node/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AA+CnE;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,MAA2C,EACnD,QAAQ,GAAE,OAAO,CAAC,kBAAkB,CAAM,GACzC,OAAO,CAAC,GAAG,CAAC,CAcd"}
@@ -1,72 +0,0 @@
1
- import { jsonStringify } from '@aztec/foundation/json-rpc';
2
- import { createLogger } from '@aztec/foundation/log';
3
- import { NoRetryError, makeBackoff, retry } from '@aztec/foundation/retry';
4
- import { Axios } from 'axios';
5
- import { inspect } from 'util';
6
- import { createPXEClient } from '../pxe_client.js';
7
- /**
8
- * A fetch implementation using axios.
9
- * @param host - The URL of the host.
10
- * @param rpcMethod - The RPC method to call.
11
- * @param body - The body of the request.
12
- * @returns The response data.
13
- */ async function axiosFetch(host, body) {
14
- const request = new Axios({
15
- headers: {
16
- 'content-type': 'application/json'
17
- },
18
- transformRequest: [
19
- (data)=>jsonStringify(data)
20
- ],
21
- transformResponse: [
22
- (data)=>JSON.parse(data)
23
- ]
24
- });
25
- const [url, content] = [
26
- host,
27
- body
28
- ];
29
- const resp = await request.post(url, content).catch((error)=>{
30
- if (error.response) {
31
- return error.response;
32
- }
33
- const errorMessage = `Error fetching from host ${host}: ${inspect(error)}`;
34
- throw new Error(errorMessage);
35
- });
36
- const isOK = resp.status >= 200 && resp.status < 300;
37
- if (isOK) {
38
- const headers = {
39
- get: (header)=>// eslint-disable-next-line @typescript-eslint/no-base-to-string
40
- typeof resp.headers.get === 'function' ? resp.headers.get(header)?.toString() : undefined
41
- };
42
- return {
43
- response: resp.data,
44
- headers
45
- };
46
- } else {
47
- const errorMessage = `Error ${resp.status} from json-rpc server ${host}: ${resp.data}`;
48
- if (resp.status >= 400 && resp.status < 500) {
49
- throw new NoRetryError(errorMessage);
50
- } else {
51
- throw new Error(errorMessage);
52
- }
53
- }
54
- }
55
- /**
56
- * Creates a PXE client with a given set of retries on non-server errors.
57
- * Checks that PXE matches the expected version, and warns if not.
58
- * @param rpcUrl - URL of the RPC server wrapping the PXE.
59
- * @param _logger - Debug logger to warn version incompatibilities.
60
- * @returns A PXE client.
61
- */ export function createCompatibleClient(rpcUrl, logger = createLogger('aztecjs:pxe_client'), versions = {}) {
62
- // Use axios due to timeout issues with fetch when proving TXs.
63
- const fetch = async (host, body)=>{
64
- return await retry(()=>axiosFetch(host, body), `JsonRpcClient request to ${host}`, makeBackoff([
65
- 1,
66
- 2,
67
- 3
68
- ]), logger, false);
69
- };
70
- const pxe = createPXEClient(rpcUrl, versions, fetch);
71
- return Promise.resolve(pxe);
72
- }
@@ -1,10 +0,0 @@
1
- import { type PXE } from '@aztec/stdlib/interfaces/client';
2
- import { type ComponentsVersions } from '@aztec/stdlib/versioning';
3
- /**
4
- * Creates a JSON-RPC client to remotely talk to PXE.
5
- * @param url - The URL of the PXE.
6
- * @param fetch - The fetch implementation to use.
7
- * @returns A JSON-RPC client of PXE.
8
- */
9
- export declare function createPXEClient(url: string, versions?: Partial<ComponentsVersions>, fetch?: typeof import("@aztec/foundation/json-rpc/client").defaultFetch): PXE;
10
- //# sourceMappingURL=pxe_client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pxe_client.d.ts","sourceRoot":"","sources":["../../src/rpc_clients/pxe_client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,GAAG,EAAa,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,KAAK,kBAAkB,EAAgC,MAAM,0BAA0B,CAAC;AAEjG;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EACX,QAAQ,GAAE,OAAO,CAAC,kBAAkB,CAAM,EAC1C,KAAK,kEAA8B,GAClC,GAAG,CASL"}
@@ -1,23 +0,0 @@
1
- import { createSafeJsonRpcClient, makeFetch } from '@aztec/foundation/json-rpc/client';
2
- import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
3
- import { PXESchema } from '@aztec/stdlib/interfaces/client';
4
- import { getVersioningResponseHandler } from '@aztec/stdlib/versioning';
5
- /**
6
- * Creates a JSON-RPC client to remotely talk to PXE.
7
- * @param url - The URL of the PXE.
8
- * @param fetch - The fetch implementation to use.
9
- * @returns A JSON-RPC client of PXE.
10
- */ export function createPXEClient(url, versions = {}, fetch = makeFetch([
11
- 1,
12
- 2,
13
- 3
14
- ], false)) {
15
- return createSafeJsonRpcClient(url, PXESchema, {
16
- namespaceMethods: 'pxe',
17
- fetch,
18
- onResponse: getVersioningResponseHandler({
19
- l2ProtocolContractsTreeRoot: protocolContractTreeRoot.toString(),
20
- ...versions
21
- })
22
- });
23
- }
@@ -1,4 +0,0 @@
1
- import type { Logger } from '@aztec/foundation/log';
2
- import type { PXE } from '@aztec/stdlib/interfaces/client';
3
- export declare const waitForPXE: (pxe: PXE, logger?: Logger) => Promise<void>;
4
- //# sourceMappingURL=pxe.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pxe.d.ts","sourceRoot":"","sources":["../../src/utils/pxe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAE3D,eAAO,MAAM,UAAU,GAAU,KAAK,GAAG,EAAE,SAAS,MAAM,kBAYzD,CAAC"}
package/dest/utils/pxe.js DELETED
@@ -1,14 +0,0 @@
1
- import { retryUntil } from '@aztec/foundation/retry';
2
- export const waitForPXE = async (pxe, logger)=>{
3
- await retryUntil(async ()=>{
4
- try {
5
- logger?.verbose('Attempting to contact PXE...');
6
- await pxe.getNodeInfo();
7
- logger?.verbose('Contacted PXE');
8
- return true;
9
- } catch {
10
- logger?.verbose('Failed to contact PXE');
11
- }
12
- return undefined;
13
- }, 'RPC Get Node Info');
14
- };
@@ -1,74 +0,0 @@
1
- import type { FeeOptions, TxExecutionOptions } from '@aztec/entrypoints/interfaces';
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 { AztecAddress } from '@aztec/stdlib/aztec-address';
6
- import type { PXE } from '@aztec/stdlib/interfaces/client';
7
- import type { TxExecutionRequest } from '@aztec/stdlib/tx';
8
- import type { AccountInterface } from '../account/interface.js';
9
- import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
10
- import { type IntentAction, type IntentInnerHash } from '../utils/authwit.js';
11
- import { BaseWallet } from './base_wallet.js';
12
- /**
13
- * A wallet implementation that forwards authentication requests to a provided account.
14
- */
15
- export declare class AccountWallet extends BaseWallet {
16
- protected account: AccountInterface;
17
- constructor(pxe: PXE, account: AccountInterface);
18
- createTxExecutionRequest(exec: ExecutionPayload, fee: FeeOptions, options: TxExecutionOptions): Promise<TxExecutionRequest>;
19
- getChainId(): Fr;
20
- getVersion(): Fr;
21
- /**
22
- * Computes an authentication witness from either a message hash or an intent.
23
- *
24
- * If a message hash is provided, it will create a witness for the hash directly.
25
- * Otherwise, it will compute the message hash using the intent, along with the
26
- * chain id and the version values provided by the wallet.
27
- *
28
- * @param messageHashOrIntent - The message hash of the intent to approve
29
- * @returns The authentication witness
30
- */
31
- createAuthWit(messageHashOrIntent: Fr | Buffer | IntentAction | IntentInnerHash): Promise<AuthWitness>;
32
- /**
33
- * Returns a function interaction to set a message hash as authorized or revoked in this account.
34
- *
35
- * Public calls can then consume this authorization.
36
- *
37
- * @param messageHashOrIntent - The message hash or intent to authorize/revoke
38
- * @param authorized - True to authorize, false to revoke authorization.
39
- * @returns - A function interaction.
40
- */
41
- setPublicAuthWit(messageHashOrIntent: Fr | Buffer | IntentInnerHash | IntentAction, authorized: boolean): Promise<ContractFunctionInteraction>;
42
- private getInnerHashAndConsumer;
43
- /**
44
- * Returns the message hash for the given intent
45
- *
46
- * @param intent - A tuple of (consumer and inner hash) or (caller and action)
47
- * @returns The message hash
48
- */
49
- private getMessageHash;
50
- /**
51
- * Lookup the validity of an authwit in private and public contexts.
52
- *
53
- * Uses the chain id and version of the wallet.
54
- *
55
- * @param onBehalfOf - The address of the "approver"
56
- * @param intent - The consumer and inner hash or the caller and action to lookup
57
- * @param witness - The computed authentication witness to check
58
- * @returns - A struct containing the validity of the authwit in private and public contexts.
59
- */
60
- lookupValidity(onBehalfOf: AztecAddress, intent: IntentInnerHash | IntentAction, witness: AuthWitness): Promise<{
61
- /** boolean flag indicating if the authwit is valid in private context */
62
- isValidInPrivate: boolean;
63
- /** boolean flag indicating if the authwit is valid in public context */
64
- isValidInPublic: boolean;
65
- }>;
66
- /** Returns the complete address of the account that implements this wallet. */
67
- getCompleteAddress(): import("../index.js").CompleteAddress;
68
- /** Returns the address of the account that implements this wallet. */
69
- getAddress(): AztecAddress;
70
- private getSetAuthorizedAbi;
71
- private getLookupValidityAbi;
72
- private getIsConsumableAbi;
73
- }
74
- //# sourceMappingURL=account_wallet.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"account_wallet.d.ts","sourceRoot":"","sources":["../../src/wallet/account_wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAG9C,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,eAAe,EAGrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;GAEG;AACH,qBAAa,aAAc,SAAQ,UAAU;IAGzC,SAAS,CAAC,OAAO,EAAE,gBAAgB;gBADnC,GAAG,EAAE,GAAG,EACE,OAAO,EAAE,gBAAgB;IAKrC,wBAAwB,CACtB,IAAI,EAAE,gBAAgB,EACtB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,kBAAkB,CAAC;IAI9B,UAAU,IAAI,EAAE;IAIhB,UAAU,IAAI,EAAE;IAIhB;;;;;;;;;OASG;IACG,aAAa,CAAC,mBAAmB,EAAE,EAAE,GAAG,MAAM,GAAG,YAAY,GAAG,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;IAa5G;;;;;;;;OAQG;IACU,gBAAgB,CAC3B,mBAAmB,EAAE,EAAE,GAAG,MAAM,GAAG,eAAe,GAAG,YAAY,EACjE,UAAU,EAAE,OAAO,GAClB,OAAO,CAAC,2BAA2B,CAAC;YAgBzB,uBAAuB;IAmBrC;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAMtB;;;;;;;;;OASG;IACG,cAAc,CAClB,UAAU,EAAE,YAAY,EACxB,MAAM,EAAE,eAAe,GAAG,YAAY,EACtC,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC;QACT,yEAAyE;QACzE,gBAAgB,EAAE,OAAO,CAAC;QAC1B,wEAAwE;QACxE,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IA2BF,+EAA+E;IACxE,kBAAkB;IAIzB,sEAAsE;IACtD,UAAU;IAI1B,OAAO,CAAC,mBAAmB;IAwB3B,OAAO,CAAC,oBAAoB;IAa5B,OAAO,CAAC,kBAAkB;CAuB3B"}
@@ -1,232 +0,0 @@
1
- import { Fr } from '@aztec/foundation/fields';
2
- import { ProtocolContractAddress } from '@aztec/protocol-contracts';
3
- import { FunctionType } from '@aztec/stdlib/abi';
4
- import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
5
- import { computeAuthWitMessageHash, computeInnerAuthWitHashFromAction } from '../utils/authwit.js';
6
- import { BaseWallet } from './base_wallet.js';
7
- /**
8
- * A wallet implementation that forwards authentication requests to a provided account.
9
- */ export class AccountWallet extends BaseWallet {
10
- account;
11
- constructor(pxe, account){
12
- super(pxe), this.account = account;
13
- }
14
- createTxExecutionRequest(exec, fee, options) {
15
- return this.account.createTxExecutionRequest(exec, fee, options);
16
- }
17
- getChainId() {
18
- return this.account.getChainId();
19
- }
20
- getVersion() {
21
- return this.account.getVersion();
22
- }
23
- /**
24
- * Computes an authentication witness from either a message hash or an intent.
25
- *
26
- * If a message hash is provided, it will create a witness for the hash directly.
27
- * Otherwise, it will compute the message hash using the intent, along with the
28
- * chain id and the version values provided by the wallet.
29
- *
30
- * @param messageHashOrIntent - The message hash of the intent to approve
31
- * @returns The authentication witness
32
- */ async createAuthWit(messageHashOrIntent) {
33
- let messageHash;
34
- if (Buffer.isBuffer(messageHashOrIntent)) {
35
- messageHash = Fr.fromBuffer(messageHashOrIntent);
36
- } else if (messageHashOrIntent instanceof Fr) {
37
- messageHash = messageHashOrIntent;
38
- } else {
39
- messageHash = await this.getMessageHash(messageHashOrIntent);
40
- }
41
- return this.account.createAuthWit(messageHash);
42
- }
43
- /**
44
- * Returns a function interaction to set a message hash as authorized or revoked in this account.
45
- *
46
- * Public calls can then consume this authorization.
47
- *
48
- * @param messageHashOrIntent - The message hash or intent to authorize/revoke
49
- * @param authorized - True to authorize, false to revoke authorization.
50
- * @returns - A function interaction.
51
- */ async setPublicAuthWit(messageHashOrIntent, authorized) {
52
- let messageHash;
53
- if (Buffer.isBuffer(messageHashOrIntent)) {
54
- messageHash = Fr.fromBuffer(messageHashOrIntent);
55
- } else if (messageHashOrIntent instanceof Fr) {
56
- messageHash = messageHashOrIntent;
57
- } else {
58
- messageHash = await this.getMessageHash(messageHashOrIntent);
59
- }
60
- return new ContractFunctionInteraction(this, ProtocolContractAddress.AuthRegistry, this.getSetAuthorizedAbi(), [
61
- messageHash,
62
- authorized
63
- ]);
64
- }
65
- async getInnerHashAndConsumer(intent) {
66
- if ('caller' in intent && 'action' in intent) {
67
- const action = intent.action instanceof ContractFunctionInteraction ? (await intent.action.request()).calls[0] : intent.action;
68
- return {
69
- innerHash: await computeInnerAuthWitHashFromAction(intent.caller, action),
70
- consumer: action.to
71
- };
72
- } else if (Buffer.isBuffer(intent.innerHash)) {
73
- return {
74
- innerHash: Fr.fromBuffer(intent.innerHash),
75
- consumer: intent.consumer
76
- };
77
- }
78
- return {
79
- innerHash: intent.innerHash,
80
- consumer: intent.consumer
81
- };
82
- }
83
- /**
84
- * Returns the message hash for the given intent
85
- *
86
- * @param intent - A tuple of (consumer and inner hash) or (caller and action)
87
- * @returns The message hash
88
- */ getMessageHash(intent) {
89
- const chainId = this.getChainId();
90
- const version = this.getVersion();
91
- return computeAuthWitMessageHash(intent, {
92
- chainId,
93
- version
94
- });
95
- }
96
- /**
97
- * Lookup the validity of an authwit in private and public contexts.
98
- *
99
- * Uses the chain id and version of the wallet.
100
- *
101
- * @param onBehalfOf - The address of the "approver"
102
- * @param intent - The consumer and inner hash or the caller and action to lookup
103
- * @param witness - The computed authentication witness to check
104
- * @returns - A struct containing the validity of the authwit in private and public contexts.
105
- */ async lookupValidity(onBehalfOf, intent, witness) {
106
- const { innerHash, consumer } = await this.getInnerHashAndConsumer(intent);
107
- const messageHash = await this.getMessageHash(intent);
108
- const results = {
109
- isValidInPrivate: false,
110
- isValidInPublic: false
111
- };
112
- // Check private
113
- try {
114
- results.isValidInPrivate = await new ContractFunctionInteraction(this, onBehalfOf, this.getLookupValidityAbi(), [
115
- consumer,
116
- innerHash
117
- ]).simulate({
118
- from: this.getAddress(),
119
- authWitnesses: [
120
- witness
121
- ]
122
- });
123
- // TODO: Narrow down the error to make sure simulation failed due to an invalid authwit
124
- // eslint-disable-next-line no-empty
125
- } catch {}
126
- // check public
127
- results.isValidInPublic = await new ContractFunctionInteraction(this, ProtocolContractAddress.AuthRegistry, this.getIsConsumableAbi(), [
128
- onBehalfOf,
129
- messageHash
130
- ]).simulate({
131
- from: this.getAddress()
132
- });
133
- return results;
134
- }
135
- /** Returns the complete address of the account that implements this wallet. */ getCompleteAddress() {
136
- return this.account.getCompleteAddress();
137
- }
138
- /** Returns the address of the account that implements this wallet. */ getAddress() {
139
- return this.getCompleteAddress().address;
140
- }
141
- getSetAuthorizedAbi() {
142
- return {
143
- name: 'set_authorized',
144
- isInitializer: false,
145
- functionType: FunctionType.PUBLIC,
146
- isInternal: true,
147
- isStatic: false,
148
- parameters: [
149
- {
150
- name: 'message_hash',
151
- type: {
152
- kind: 'field'
153
- },
154
- visibility: 'private'
155
- },
156
- {
157
- name: 'authorize',
158
- type: {
159
- kind: 'boolean'
160
- },
161
- visibility: 'private'
162
- }
163
- ],
164
- returnTypes: [],
165
- errorTypes: {}
166
- };
167
- }
168
- getLookupValidityAbi() {
169
- return {
170
- name: 'lookup_validity',
171
- isInitializer: false,
172
- functionType: FunctionType.UTILITY,
173
- isInternal: false,
174
- isStatic: false,
175
- parameters: [
176
- {
177
- name: 'message_hash',
178
- type: {
179
- kind: 'field'
180
- },
181
- visibility: 'private'
182
- }
183
- ],
184
- returnTypes: [
185
- {
186
- kind: 'boolean'
187
- }
188
- ],
189
- errorTypes: {}
190
- };
191
- }
192
- getIsConsumableAbi() {
193
- return {
194
- name: 'utility_is_consumable',
195
- isInitializer: false,
196
- functionType: FunctionType.UTILITY,
197
- isInternal: false,
198
- isStatic: false,
199
- parameters: [
200
- {
201
- name: 'address',
202
- type: {
203
- fields: [
204
- {
205
- name: 'inner',
206
- type: {
207
- kind: 'field'
208
- }
209
- }
210
- ],
211
- kind: 'struct',
212
- path: 'authwit::aztec::protocol_types::address::aztec_address::AztecAddress'
213
- },
214
- visibility: 'private'
215
- },
216
- {
217
- name: 'message_hash',
218
- type: {
219
- kind: 'field'
220
- },
221
- visibility: 'private'
222
- }
223
- ],
224
- returnTypes: [
225
- {
226
- kind: 'boolean'
227
- }
228
- ],
229
- errorTypes: {}
230
- };
231
- }
232
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"account_wallet_with_private_key.d.ts","sourceRoot":"","sources":["../../src/wallet/account_wallet_with_private_key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAG3D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;GAIG;AACH,qBAAa,0BAA2B,SAAQ,aAAa;IAIzD,OAAO,CAAC,SAAS;IACjB,iDAAiD;aACjC,IAAI,EAAE,IAAI;gBAJ1B,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,gBAAgB,EACjB,SAAS,EAAE,EAAE;IACrB,iDAAiD;IACjC,IAAI,EAAE,IAAI;IAK5B,uEAAuE;IAChE,YAAY;IAInB;;;OAGG;IACU,mBAAmB;CAMjC"}
@@ -1,23 +0,0 @@
1
- import type { EntrypointInterface, FeeOptions, TxExecutionOptions } from '@aztec/entrypoints/interfaces';
2
- import type { ExecutionPayload } from '@aztec/entrypoints/payload';
3
- import type { Fr } from '@aztec/foundation/fields';
4
- import { AuthWitness } from '@aztec/stdlib/auth-witness';
5
- import type { CompleteAddress } from '@aztec/stdlib/contract';
6
- import type { PXE } from '@aztec/stdlib/interfaces/client';
7
- import type { TxExecutionRequest } from '@aztec/stdlib/tx';
8
- import type { IntentAction, IntentInnerHash } from '../utils/authwit.js';
9
- import { BaseWallet } from './base_wallet.js';
10
- /**
11
- * Wallet implementation which creates a transaction request directly to the requested contract without any signing.
12
- */
13
- export declare class SignerlessWallet extends BaseWallet {
14
- private entrypoint?;
15
- constructor(pxe: PXE, entrypoint?: EntrypointInterface | undefined);
16
- createTxExecutionRequest(execution: ExecutionPayload, fee: FeeOptions, options: TxExecutionOptions): Promise<TxExecutionRequest>;
17
- getChainId(): Fr;
18
- getVersion(): Fr;
19
- getPublicKeysHash(): Fr;
20
- getCompleteAddress(): CompleteAddress;
21
- createAuthWit(_intent: Fr | Buffer | IntentInnerHash | IntentAction): Promise<AuthWitness>;
22
- }
23
- //# sourceMappingURL=signerless_wallet.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"signerless_wallet.d.ts","sourceRoot":"","sources":["../../src/wallet/signerless_wallet.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACzG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,UAAU;IAG5C,OAAO,CAAC,UAAU,CAAC;gBADnB,GAAG,EAAE,GAAG,EACA,UAAU,CAAC,EAAE,mBAAmB,YAAA;IAIpC,wBAAwB,CAC5B,SAAS,EAAE,gBAAgB,EAC3B,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,kBAAkB,CAAC;IAU9B,UAAU,IAAI,EAAE;IAIhB,UAAU,IAAI,EAAE;IAIhB,iBAAiB,IAAI,EAAE;IAIvB,kBAAkB,IAAI,eAAe;IAIrC,aAAa,CAAC,OAAO,EAAE,EAAE,GAAG,MAAM,GAAG,eAAe,GAAG,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;CAG3F"}