@aztec/aztec.js 3.0.0-devnet.6 → 3.0.0-devnet.6-patch.1

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 (192) hide show
  1. package/README.md +1 -1
  2. package/dest/account/account.d.ts +3 -4
  3. package/dest/account/account.d.ts.map +1 -1
  4. package/dest/account/account.js +1 -1
  5. package/dest/account/account_contract.d.ts +2 -2
  6. package/dest/account/account_contract.d.ts.map +1 -1
  7. package/dest/account/account_with_secret_key.d.ts +3 -4
  8. package/dest/account/account_with_secret_key.d.ts.map +1 -1
  9. package/dest/account/index.d.ts +2 -2
  10. package/dest/account/index.d.ts.map +1 -1
  11. package/dest/account/interface.d.ts +2 -2
  12. package/dest/account/interface.d.ts.map +1 -1
  13. package/dest/account/signerless_account.d.ts +3 -4
  14. package/dest/account/signerless_account.d.ts.map +1 -1
  15. package/dest/api/abi.d.ts +1 -1
  16. package/dest/api/account.d.ts +2 -1
  17. package/dest/api/account.d.ts.map +1 -1
  18. package/dest/api/account.js +1 -0
  19. package/dest/api/addresses.d.ts +1 -1
  20. package/dest/api/authorization.d.ts +1 -1
  21. package/dest/api/block.d.ts +1 -1
  22. package/dest/api/contract.d.ts +5 -5
  23. package/dest/api/contract.d.ts.map +1 -1
  24. package/dest/api/contract.js +3 -3
  25. package/dest/api/crypto.d.ts +1 -1
  26. package/dest/api/deployment.d.ts +1 -1
  27. package/dest/api/eth_address.d.ts +1 -1
  28. package/dest/api/ethereum.d.ts +1 -1
  29. package/dest/api/events.d.ts +1 -1
  30. package/dest/api/fee.d.ts +1 -1
  31. package/dest/api/fee_testing.d.ts +1 -1
  32. package/dest/api/fields.d.ts +3 -2
  33. package/dest/api/fields.d.ts.map +1 -1
  34. package/dest/api/fields.js +2 -1
  35. package/dest/api/keys.d.ts +1 -1
  36. package/dest/api/log.d.ts +1 -1
  37. package/dest/api/messaging.d.ts +1 -1
  38. package/dest/api/node.d.ts +1 -1
  39. package/dest/api/note.d.ts +2 -2
  40. package/dest/api/note.d.ts.map +1 -1
  41. package/dest/api/note.js +1 -1
  42. package/dest/api/protocol.d.ts +1 -1
  43. package/dest/api/trees.d.ts +1 -1
  44. package/dest/api/tx.d.ts +2 -2
  45. package/dest/api/tx.d.ts.map +1 -1
  46. package/dest/api/tx.js +1 -1
  47. package/dest/api/utils.d.ts +1 -1
  48. package/dest/api/wallet.d.ts +2 -3
  49. package/dest/api/wallet.d.ts.map +1 -1
  50. package/dest/api/wallet.js +1 -2
  51. package/dest/authorization/call_authorization_request.d.ts +2 -23
  52. package/dest/authorization/call_authorization_request.d.ts.map +1 -1
  53. package/dest/contract/base_contract_interaction.d.ts +2 -3
  54. package/dest/contract/base_contract_interaction.d.ts.map +1 -1
  55. package/dest/contract/base_contract_interaction.js +1 -1
  56. package/dest/contract/batch_call.d.ts +8 -9
  57. package/dest/contract/batch_call.d.ts.map +1 -1
  58. package/dest/contract/batch_call.js +51 -33
  59. package/dest/contract/checker.d.ts +1 -1
  60. package/dest/contract/contract.d.ts +2 -2
  61. package/dest/contract/contract.d.ts.map +1 -1
  62. package/dest/contract/contract.js +4 -5
  63. package/dest/contract/contract_base.d.ts +5 -12
  64. package/dest/contract/contract_base.d.ts.map +1 -1
  65. package/dest/contract/contract_base.js +5 -12
  66. package/dest/contract/contract_function_interaction.d.ts +4 -4
  67. package/dest/contract/contract_function_interaction.d.ts.map +1 -1
  68. package/dest/contract/contract_function_interaction.js +9 -6
  69. package/dest/contract/deploy_method.d.ts +9 -8
  70. package/dest/contract/deploy_method.d.ts.map +1 -1
  71. package/dest/contract/deploy_method.js +9 -7
  72. package/dest/contract/deploy_sent_tx.d.ts +12 -7
  73. package/dest/contract/deploy_sent_tx.d.ts.map +1 -1
  74. package/dest/contract/deploy_sent_tx.js +10 -4
  75. package/dest/contract/get_gas_limits.d.ts +1 -1
  76. package/dest/contract/interaction_options.d.ts +5 -5
  77. package/dest/contract/interaction_options.d.ts.map +1 -1
  78. package/dest/contract/interaction_options.js +4 -10
  79. package/dest/contract/protocol_contracts.d.ts +1 -1
  80. package/dest/contract/sent_tx.d.ts +2 -3
  81. package/dest/contract/sent_tx.d.ts.map +1 -1
  82. package/dest/contract/sent_tx.js +1 -1
  83. package/dest/contract/unsafe_contract.d.ts +1 -1
  84. package/dest/contract/unsafe_contract.d.ts.map +1 -1
  85. package/dest/contract/unsafe_contract.js +1 -1
  86. package/dest/contract/wait_for_proven.d.ts +2 -2
  87. package/dest/contract/wait_for_proven.d.ts.map +1 -1
  88. package/dest/deployment/broadcast_function.d.ts +1 -1
  89. package/dest/deployment/broadcast_function.js +1 -1
  90. package/dest/deployment/contract_deployer.d.ts +1 -1
  91. package/dest/deployment/contract_deployer.d.ts.map +1 -1
  92. package/dest/deployment/contract_deployer.js +1 -1
  93. package/dest/deployment/publish_class.d.ts +1 -1
  94. package/dest/deployment/publish_class.js +1 -1
  95. package/dest/deployment/publish_instance.d.ts +1 -1
  96. package/dest/ethereum/portal_manager.d.ts +4 -6
  97. package/dest/ethereum/portal_manager.d.ts.map +1 -1
  98. package/dest/ethereum/portal_manager.js +40 -14
  99. package/dest/fee/fee_juice_payment_method_with_claim.d.ts +2 -2
  100. package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -1
  101. package/dest/fee/fee_juice_payment_method_with_claim.js +3 -3
  102. package/dest/fee/fee_payment_method.d.ts +2 -2
  103. package/dest/fee/fee_payment_method.d.ts.map +1 -1
  104. package/dest/fee/private_fee_payment_method.d.ts +2 -2
  105. package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
  106. package/dest/fee/private_fee_payment_method.js +4 -4
  107. package/dest/fee/public_fee_payment_method.d.ts +2 -2
  108. package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
  109. package/dest/fee/public_fee_payment_method.js +4 -4
  110. package/dest/fee/sponsored_fee_payment.d.ts +2 -2
  111. package/dest/fee/sponsored_fee_payment.d.ts.map +1 -1
  112. package/dest/fee/sponsored_fee_payment.js +2 -2
  113. package/dest/utils/abi_types.d.ts +2 -2
  114. package/dest/utils/abi_types.d.ts.map +1 -1
  115. package/dest/utils/authwit.d.ts +7 -7
  116. package/dest/utils/authwit.d.ts.map +1 -1
  117. package/dest/utils/authwit.js +22 -11
  118. package/dest/utils/cross_chain.d.ts +2 -2
  119. package/dest/utils/cross_chain.d.ts.map +1 -1
  120. package/dest/utils/fee_juice.d.ts +2 -2
  121. package/dest/utils/fee_juice.js +2 -2
  122. package/dest/utils/field_compressed_string.d.ts +1 -1
  123. package/dest/utils/field_compressed_string.d.ts.map +1 -1
  124. package/dest/utils/field_compressed_string.js +1 -1
  125. package/dest/utils/node.d.ts +2 -2
  126. package/dest/utils/node.d.ts.map +1 -1
  127. package/dest/utils/pub_key.d.ts +2 -2
  128. package/dest/utils/pub_key.d.ts.map +1 -1
  129. package/dest/utils/pub_key.js +2 -3
  130. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts +2 -2
  131. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -1
  132. package/dest/wallet/account_entrypoint_meta_payment_method.js +2 -2
  133. package/dest/wallet/account_manager.d.ts +2 -5
  134. package/dest/wallet/account_manager.d.ts.map +1 -1
  135. package/dest/wallet/account_manager.js +2 -2
  136. package/dest/wallet/deploy_account_method.d.ts +5 -5
  137. package/dest/wallet/deploy_account_method.d.ts.map +1 -1
  138. package/dest/wallet/deploy_account_method.js +2 -2
  139. package/dest/wallet/index.d.ts +1 -2
  140. package/dest/wallet/index.d.ts.map +1 -1
  141. package/dest/wallet/index.js +0 -1
  142. package/dest/wallet/wallet.d.ts +686 -1148
  143. package/dest/wallet/wallet.d.ts.map +1 -1
  144. package/dest/wallet/wallet.js +37 -41
  145. package/package.json +13 -12
  146. package/src/account/account.ts +2 -3
  147. package/src/account/account_contract.ts +1 -1
  148. package/src/account/account_with_secret_key.ts +1 -1
  149. package/src/account/index.ts +1 -1
  150. package/src/account/interface.ts +1 -1
  151. package/src/account/signerless_account.ts +2 -3
  152. package/src/api/account.ts +1 -0
  153. package/src/api/contract.ts +4 -3
  154. package/src/api/fields.ts +2 -1
  155. package/src/api/note.ts +1 -1
  156. package/src/api/tx.ts +2 -0
  157. package/src/api/wallet.ts +5 -7
  158. package/src/authorization/call_authorization_request.ts +1 -1
  159. package/src/contract/base_contract_interaction.ts +2 -3
  160. package/src/contract/batch_call.ts +65 -48
  161. package/src/contract/contract.ts +7 -5
  162. package/src/contract/contract_base.ts +5 -15
  163. package/src/contract/contract_function_interaction.ts +10 -11
  164. package/src/contract/deploy_method.ts +13 -12
  165. package/src/contract/deploy_sent_tx.ts +17 -10
  166. package/src/contract/interaction_options.ts +5 -11
  167. package/src/contract/sent_tx.ts +2 -3
  168. package/src/contract/unsafe_contract.ts +1 -1
  169. package/src/deployment/broadcast_function.ts +1 -1
  170. package/src/deployment/contract_deployer.ts +3 -2
  171. package/src/deployment/publish_class.ts +1 -1
  172. package/src/ethereum/portal_manager.ts +58 -28
  173. package/src/fee/fee_juice_payment_method_with_claim.ts +4 -2
  174. package/src/fee/fee_payment_method.ts +1 -1
  175. package/src/fee/private_fee_payment_method.ts +5 -3
  176. package/src/fee/public_fee_payment_method.ts +5 -3
  177. package/src/fee/sponsored_fee_payment.ts +3 -1
  178. package/src/utils/abi_types.ts +1 -1
  179. package/src/utils/authwit.ts +21 -15
  180. package/src/utils/cross_chain.ts +1 -1
  181. package/src/utils/fee_juice.ts +2 -2
  182. package/src/utils/field_compressed_string.ts +1 -1
  183. package/src/utils/pub_key.ts +3 -4
  184. package/src/wallet/account_entrypoint_meta_payment_method.ts +2 -1
  185. package/src/wallet/account_manager.ts +2 -2
  186. package/src/wallet/deploy_account_method.ts +4 -3
  187. package/src/wallet/index.ts +0 -1
  188. package/src/wallet/wallet.ts +81 -80
  189. package/dest/wallet/base_wallet.d.ts +0 -91
  190. package/dest/wallet/base_wallet.d.ts.map +0 -1
  191. package/dest/wallet/base_wallet.js +0 -238
  192. package/src/wallet/base_wallet.ts +0 -350
@@ -1 +0,0 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CAAC;IAIrE,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAIhD,gBAAgB,CAAC,CAAC,EAChB,eAAe,EAAE,YAAY,EAC7B,KAAK,EAAE,uBAAuB,EAC9B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,UAAU,GAAE,YAAY,EAAO,GAC9B,OAAO,CAAC,CAAC,EAAE,CAAC;CAGhB"}
@@ -1,238 +0,0 @@
1
- import { GAS_ESTIMATION_DA_GAS_LIMIT, GAS_ESTIMATION_L2_GAS_LIMIT, GAS_ESTIMATION_TEARDOWN_DA_GAS_LIMIT, GAS_ESTIMATION_TEARDOWN_L2_GAS_LIMIT } from '@aztec/constants';
2
- import { AccountFeePaymentMethodOptions } from '@aztec/entrypoints/account';
3
- import { mergeExecutionPayloads } from '@aztec/entrypoints/payload';
4
- import { Fr } from '@aztec/foundation/fields';
5
- import { createLogger } from '@aztec/foundation/log';
6
- import { computePartialAddress, getContractClassFromArtifact, getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
7
- import { SimulationError } from '@aztec/stdlib/errors';
8
- import { Gas, GasSettings } from '@aztec/stdlib/gas';
9
- import { inspect } from 'util';
10
- /**
11
- * A base class for Wallet implementations
12
- */ export class BaseWallet {
13
- pxe;
14
- aztecNode;
15
- log;
16
- baseFeePadding;
17
- cancellableTransactions;
18
- // Protected because we want to force wallets to instantiate their own PXE.
19
- constructor(// TODO: We cannot type here pxe because we cannot import that package as that would result in a circular
20
- // dependency. This will eventually get resolved by the introduction of @aztec/wallet-sdk package.
21
- pxe, aztecNode){
22
- this.pxe = pxe;
23
- this.aztecNode = aztecNode;
24
- this.log = createLogger('aztecjs:base_wallet');
25
- this.baseFeePadding = 0.5;
26
- this.cancellableTransactions = false;
27
- }
28
- /**
29
- * Returns the list of aliased contacts associated with the wallet.
30
- * This base implementation directly returns PXE's senders, but note that in general contacts are a superset of senders.
31
- * - Senders: Addresses we check during synching in case they sent us notes,
32
- * - Contacts: more general concept akin to a phone's contact list.
33
- * @returns The aliased collection of AztecAddresses that form this wallet's address book
34
- */ async getAddressBook() {
35
- const senders = await this.pxe.getSenders();
36
- return senders.map((sender)=>({
37
- item: sender,
38
- alias: ''
39
- }));
40
- }
41
- async getChainInfo() {
42
- const { l1ChainId, rollupVersion } = await this.aztecNode.getNodeInfo();
43
- return {
44
- chainId: new Fr(l1ChainId),
45
- version: new Fr(rollupVersion)
46
- };
47
- }
48
- async createTxExecutionRequestFromPayloadAndFee(executionPayload, from, feeOptions) {
49
- const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
50
- const executionOptions = {
51
- txNonce: Fr.random(),
52
- cancellable: this.cancellableTransactions,
53
- feePaymentMethodOptions: feeOptions.accountFeePaymentMethodOptions
54
- };
55
- const finalExecutionPayload = feeExecutionPayload ? mergeExecutionPayloads([
56
- feeExecutionPayload,
57
- executionPayload
58
- ]) : executionPayload;
59
- const fromAccount = await this.getAccountFromAddress(from);
60
- return fromAccount.createTxExecutionRequest(finalExecutionPayload, feeOptions.gasSettings, executionOptions);
61
- }
62
- async createAuthWit(from, messageHashOrIntent) {
63
- const account = await this.getAccountFromAddress(from);
64
- return account.createAuthWit(messageHashOrIntent);
65
- }
66
- async batch(methods) {
67
- const results = [];
68
- for (const method of methods){
69
- const { name, args } = method;
70
- // Type safety is guaranteed by the BatchedMethod type, which ensures that:
71
- // 1. `name` is a valid batchable method name
72
- // 2. `args` matches the parameter types of that specific method
73
- // 3. The return type is correctly mapped in BatchResults<T>
74
- // We use dynamic dispatch here for simplicity, but the types are enforced at the call site.
75
- const fn = this[name];
76
- const result = await fn.apply(this, args);
77
- // Wrap result with method name for discriminated union deserialization
78
- results.push({
79
- name,
80
- result
81
- });
82
- }
83
- return results;
84
- }
85
- /**
86
- * Returns default values for the transaction fee options
87
- * if they were omitted by the user.
88
- * @param from - The address where the transaction is being sent from
89
- * @param userFeeOptions - User-provided fee options, which might be incomplete
90
- * @returns - Populated fee options that can be used to create a transaction execution request
91
- */ async getDefaultFeeOptions(from, userFeeOptions) {
92
- const maxFeesPerGas = userFeeOptions?.gasSettings?.maxFeesPerGas ?? (await this.aztecNode.getCurrentBaseFees()).mul(1 + this.baseFeePadding);
93
- let accountFeePaymentMethodOptions;
94
- // The transaction does not include a fee payment method, so we set the flag
95
- // for the account to use its fee juice balance
96
- if (!userFeeOptions?.embeddedPaymentMethodFeePayer) {
97
- accountFeePaymentMethodOptions = AccountFeePaymentMethodOptions.PREEXISTING_FEE_JUICE;
98
- } else {
99
- // The transaction includes fee payment method, so we check if we are the fee payer for it
100
- // (this can only happen if the embedded payment method is FeeJuiceWithClaim)
101
- accountFeePaymentMethodOptions = from.equals(userFeeOptions.embeddedPaymentMethodFeePayer) ? AccountFeePaymentMethodOptions.FEE_JUICE_WITH_CLAIM : AccountFeePaymentMethodOptions.EXTERNAL;
102
- }
103
- const gasSettings = GasSettings.default({
104
- ...userFeeOptions?.gasSettings,
105
- maxFeesPerGas
106
- });
107
- this.log.debug(`Using L2 gas settings`, gasSettings);
108
- return {
109
- gasSettings,
110
- walletFeePaymentMethod: undefined,
111
- accountFeePaymentMethodOptions
112
- };
113
- }
114
- /**
115
- * Returns unreasonably high gas limits in order to execute a simulation
116
- * with the goal of estimating its gas cost. It will otherwise try to respect
117
- * the user-specified fee options, filling the gaps with default values as needed.
118
- * @param from - The address where the transaction is being sent from
119
- * @param userFeeOptions - User-provided fee options to use as a basis for the fully populated `FeeOptions` type.
120
- */ async getFeeOptionsForGasEstimation(from, userFeeOptions) {
121
- const defaultFeeOptions = await this.getDefaultFeeOptions(from, userFeeOptions);
122
- const { gasSettings: { maxFeesPerGas, maxPriorityFeesPerGas } } = defaultFeeOptions;
123
- // Use unrealistically high gas limits for estimation to avoid running out of gas.
124
- // They will be tuned down after the simulation.
125
- const gasSettingsForEstimation = new GasSettings(new Gas(GAS_ESTIMATION_DA_GAS_LIMIT, GAS_ESTIMATION_L2_GAS_LIMIT), new Gas(GAS_ESTIMATION_TEARDOWN_DA_GAS_LIMIT, GAS_ESTIMATION_TEARDOWN_L2_GAS_LIMIT), maxFeesPerGas, maxPriorityFeesPerGas);
126
- return {
127
- ...defaultFeeOptions,
128
- gasSettings: gasSettingsForEstimation
129
- };
130
- }
131
- registerSender(address, _alias = '') {
132
- return this.pxe.registerSender(address);
133
- }
134
- async registerContract(instanceData, artifact, secretKey) {
135
- /** Determines if the provided instance data is already a contract instance with an address. */ function isInstanceWithAddress(instanceData) {
136
- return instanceData.address !== undefined;
137
- }
138
- /** Determines if the provided instance data is contract instantiation data */ function isContractInstantiationData(instanceData) {
139
- return instanceData.salt !== undefined;
140
- }
141
- /** Determines if the provided instance data is already a contract */ function isContractInstanceAndArtifact(instanceData) {
142
- return instanceData.instance !== undefined && instanceData.artifact !== undefined;
143
- }
144
- let instance;
145
- if (isContractInstanceAndArtifact(instanceData)) {
146
- instance = instanceData.instance;
147
- await this.pxe.registerContract(instanceData);
148
- } else if (isInstanceWithAddress(instanceData)) {
149
- instance = instanceData;
150
- await this.pxe.registerContract({
151
- artifact,
152
- instance
153
- });
154
- } else if (isContractInstantiationData(instanceData)) {
155
- if (!artifact) {
156
- throw new Error(`Contract artifact must be provided when registering a contract using instantiation data`);
157
- }
158
- instance = await getContractInstanceFromInstantiationParams(artifact, instanceData);
159
- await this.pxe.registerContract({
160
- artifact,
161
- instance
162
- });
163
- } else {
164
- if (!artifact) {
165
- throw new Error(`Contract artifact must be provided when registering a contract using an address`);
166
- }
167
- const { contractInstance: maybeContractInstance } = await this.pxe.getContractMetadata(instanceData);
168
- if (!maybeContractInstance) {
169
- throw new Error(`Contract instance at ${instanceData.toString()} has not been registered in the wallet's PXE`);
170
- }
171
- instance = maybeContractInstance;
172
- const thisContractClass = await getContractClassFromArtifact(artifact);
173
- if (!thisContractClass.id.equals(instance.currentContractClassId)) {
174
- // wallet holds an outdated version of this contract
175
- await this.pxe.updateContract(instance.address, artifact);
176
- instance.currentContractClassId = thisContractClass.id;
177
- }
178
- }
179
- if (secretKey) {
180
- await this.pxe.registerAccount(secretKey, await computePartialAddress(instance));
181
- }
182
- return instance;
183
- }
184
- async simulateTx(executionPayload, opts) {
185
- const feeOptions = opts.fee?.estimateGas ? await this.getFeeOptionsForGasEstimation(opts.from, opts.fee) : await this.getDefaultFeeOptions(opts.from, opts.fee);
186
- const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(executionPayload, opts.from, feeOptions);
187
- return this.pxe.simulateTx(txRequest, true, opts?.skipTxValidation, opts?.skipFeeEnforcement ?? true);
188
- }
189
- async profileTx(executionPayload, opts) {
190
- const fee = await this.getDefaultFeeOptions(opts.from, opts.fee);
191
- const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(executionPayload, opts.from, fee);
192
- return this.pxe.profileTx(txRequest, opts.profileMode, opts.skipProofGeneration ?? true);
193
- }
194
- async sendTx(executionPayload, opts) {
195
- const fee = await this.getDefaultFeeOptions(opts.from, opts.fee);
196
- const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(executionPayload, opts.from, fee);
197
- const provenTx = await this.pxe.proveTx(txRequest);
198
- const tx = await provenTx.toTx();
199
- const txHash = tx.getTxHash();
200
- if (await this.aztecNode.getTxEffect(txHash)) {
201
- throw new Error(`A settled tx with equal hash ${txHash.toString()} exists.`);
202
- }
203
- this.log.debug(`Sending transaction ${txHash}`);
204
- await this.aztecNode.sendTx(tx).catch((err)=>{
205
- throw this.contextualizeError(err, inspect(tx));
206
- });
207
- this.log.info(`Sent transaction ${txHash}`);
208
- return txHash;
209
- }
210
- contextualizeError(err, ...context) {
211
- let contextStr = '';
212
- if (context.length > 0) {
213
- contextStr = `\nContext:\n${context.join('\n')}`;
214
- }
215
- if (err instanceof SimulationError) {
216
- err.setAztecContext(contextStr);
217
- } else {
218
- this.log.error(err.name, err);
219
- this.log.debug(contextStr);
220
- }
221
- return err;
222
- }
223
- simulateUtility(functionName, args, to, authwits, from) {
224
- return this.pxe.simulateUtility(functionName, args, to, authwits, from);
225
- }
226
- getContractClassMetadata(id, includeArtifact = false) {
227
- return this.pxe.getContractClassMetadata(id, includeArtifact);
228
- }
229
- getContractMetadata(address) {
230
- return this.pxe.getContractMetadata(address);
231
- }
232
- getTxReceipt(txHash) {
233
- return this.aztecNode.getTxReceipt(txHash);
234
- }
235
- getPrivateEvents(contractAddress, event, from, limit, recipients = []) {
236
- return this.pxe.getPrivateEvents(contractAddress, event, from, limit, recipients);
237
- }
238
- }
@@ -1,350 +0,0 @@
1
- import {
2
- GAS_ESTIMATION_DA_GAS_LIMIT,
3
- GAS_ESTIMATION_L2_GAS_LIMIT,
4
- GAS_ESTIMATION_TEARDOWN_DA_GAS_LIMIT,
5
- GAS_ESTIMATION_TEARDOWN_L2_GAS_LIMIT,
6
- } from '@aztec/constants';
7
- import { AccountFeePaymentMethodOptions, type DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
8
- import type { ChainInfo } from '@aztec/entrypoints/interfaces';
9
- import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/entrypoints/payload';
10
- import { Fr } from '@aztec/foundation/fields';
11
- import { createLogger } from '@aztec/foundation/log';
12
- import type { ContractArtifact, EventMetadataDefinition } from '@aztec/stdlib/abi';
13
- import type { AuthWitness } from '@aztec/stdlib/auth-witness';
14
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
15
- import {
16
- type ContractClassMetadata,
17
- type ContractInstanceWithAddress,
18
- type ContractInstantiationData,
19
- type ContractMetadata,
20
- computePartialAddress,
21
- getContractClassFromArtifact,
22
- getContractInstanceFromInstantiationParams,
23
- } from '@aztec/stdlib/contract';
24
- import { SimulationError } from '@aztec/stdlib/errors';
25
- import { Gas, GasSettings } from '@aztec/stdlib/gas';
26
- import type { AztecNode } from '@aztec/stdlib/interfaces/client';
27
- import type {
28
- TxExecutionRequest,
29
- TxHash,
30
- TxProfileResult,
31
- TxReceipt,
32
- TxSimulationResult,
33
- UtilitySimulationResult,
34
- } from '@aztec/stdlib/tx';
35
-
36
- import { inspect } from 'util';
37
-
38
- import type { Account } from '../account/account.js';
39
- import type { FeePaymentMethod } from '../fee/fee_payment_method.js';
40
- import type { CallIntent, IntentInnerHash } from '../utils/authwit.js';
41
- import type {
42
- Aliased,
43
- BatchResults,
44
- BatchableMethods,
45
- BatchedMethod,
46
- ContractInstanceAndArtifact,
47
- ProfileOptions,
48
- SendOptions,
49
- SimulateOptions,
50
- UserFeeOptions,
51
- Wallet,
52
- } from './wallet.js';
53
-
54
- /**
55
- * Options to configure fee payment for a transaction
56
- */
57
- export type FeeOptions = {
58
- /**
59
- * A wallet-provided fallback fee payment method that is used only if the transaction that is being constructed
60
- * doesn't already include one
61
- */
62
- walletFeePaymentMethod?: FeePaymentMethod;
63
- /** Configuration options for the account to properly handle the selected fee payment method */
64
- accountFeePaymentMethodOptions: AccountFeePaymentMethodOptions;
65
- /** The gas settings to use for the transaction */
66
- gasSettings: GasSettings;
67
- };
68
-
69
- /**
70
- * A base class for Wallet implementations
71
- */
72
- export abstract class BaseWallet implements Wallet {
73
- protected log = createLogger('aztecjs:base_wallet');
74
-
75
- protected baseFeePadding = 0.5;
76
- protected cancellableTransactions = false;
77
-
78
- // Protected because we want to force wallets to instantiate their own PXE.
79
- protected constructor(
80
- // TODO: We cannot type here pxe because we cannot import that package as that would result in a circular
81
- // dependency. This will eventually get resolved by the introduction of @aztec/wallet-sdk package.
82
- protected readonly pxe: any,
83
- protected readonly aztecNode: AztecNode,
84
- ) {}
85
-
86
- protected abstract getAccountFromAddress(address: AztecAddress): Promise<Account>;
87
-
88
- abstract getAccounts(): Promise<Aliased<AztecAddress>[]>;
89
-
90
- /**
91
- * Returns the list of aliased contacts associated with the wallet.
92
- * This base implementation directly returns PXE's senders, but note that in general contacts are a superset of senders.
93
- * - Senders: Addresses we check during synching in case they sent us notes,
94
- * - Contacts: more general concept akin to a phone's contact list.
95
- * @returns The aliased collection of AztecAddresses that form this wallet's address book
96
- */
97
- async getAddressBook(): Promise<Aliased<AztecAddress>[]> {
98
- const senders: AztecAddress[] = await this.pxe.getSenders();
99
- return senders.map(sender => ({ item: sender, alias: '' }));
100
- }
101
-
102
- async getChainInfo(): Promise<ChainInfo> {
103
- const { l1ChainId, rollupVersion } = await this.aztecNode.getNodeInfo();
104
- return { chainId: new Fr(l1ChainId), version: new Fr(rollupVersion) };
105
- }
106
-
107
- protected async createTxExecutionRequestFromPayloadAndFee(
108
- executionPayload: ExecutionPayload,
109
- from: AztecAddress,
110
- feeOptions: FeeOptions,
111
- ): Promise<TxExecutionRequest> {
112
- const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
113
- const executionOptions: DefaultAccountEntrypointOptions = {
114
- txNonce: Fr.random(),
115
- cancellable: this.cancellableTransactions,
116
- feePaymentMethodOptions: feeOptions.accountFeePaymentMethodOptions,
117
- };
118
- const finalExecutionPayload = feeExecutionPayload
119
- ? mergeExecutionPayloads([feeExecutionPayload, executionPayload])
120
- : executionPayload;
121
- const fromAccount = await this.getAccountFromAddress(from);
122
- return fromAccount.createTxExecutionRequest(finalExecutionPayload, feeOptions.gasSettings, executionOptions);
123
- }
124
-
125
- public async createAuthWit(
126
- from: AztecAddress,
127
- messageHashOrIntent: Fr | Buffer | IntentInnerHash | CallIntent,
128
- ): Promise<AuthWitness> {
129
- const account = await this.getAccountFromAddress(from);
130
- return account.createAuthWit(messageHashOrIntent);
131
- }
132
-
133
- public async batch<const T extends readonly BatchedMethod<keyof BatchableMethods>[]>(
134
- methods: T,
135
- ): Promise<BatchResults<T>> {
136
- const results: any[] = [];
137
- for (const method of methods) {
138
- const { name, args } = method;
139
- // Type safety is guaranteed by the BatchedMethod type, which ensures that:
140
- // 1. `name` is a valid batchable method name
141
- // 2. `args` matches the parameter types of that specific method
142
- // 3. The return type is correctly mapped in BatchResults<T>
143
- // We use dynamic dispatch here for simplicity, but the types are enforced at the call site.
144
-
145
- const fn = this[name] as (...args: any[]) => Promise<any>;
146
- const result = await fn.apply(this, args);
147
- // Wrap result with method name for discriminated union deserialization
148
- results.push({ name, result });
149
- }
150
- return results as BatchResults<T>;
151
- }
152
-
153
- /**
154
- * Returns default values for the transaction fee options
155
- * if they were omitted by the user.
156
- * @param from - The address where the transaction is being sent from
157
- * @param userFeeOptions - User-provided fee options, which might be incomplete
158
- * @returns - Populated fee options that can be used to create a transaction execution request
159
- */
160
- protected async getDefaultFeeOptions(from: AztecAddress, userFeeOptions?: UserFeeOptions): Promise<FeeOptions> {
161
- const maxFeesPerGas =
162
- userFeeOptions?.gasSettings?.maxFeesPerGas ??
163
- (await this.aztecNode.getCurrentBaseFees()).mul(1 + this.baseFeePadding);
164
- let accountFeePaymentMethodOptions;
165
- // The transaction does not include a fee payment method, so we set the flag
166
- // for the account to use its fee juice balance
167
- if (!userFeeOptions?.embeddedPaymentMethodFeePayer) {
168
- accountFeePaymentMethodOptions = AccountFeePaymentMethodOptions.PREEXISTING_FEE_JUICE;
169
- } else {
170
- // The transaction includes fee payment method, so we check if we are the fee payer for it
171
- // (this can only happen if the embedded payment method is FeeJuiceWithClaim)
172
- accountFeePaymentMethodOptions = from.equals(userFeeOptions.embeddedPaymentMethodFeePayer)
173
- ? AccountFeePaymentMethodOptions.FEE_JUICE_WITH_CLAIM
174
- : AccountFeePaymentMethodOptions.EXTERNAL;
175
- }
176
- const gasSettings: GasSettings = GasSettings.default({ ...userFeeOptions?.gasSettings, maxFeesPerGas });
177
- this.log.debug(`Using L2 gas settings`, gasSettings);
178
- return {
179
- gasSettings,
180
- walletFeePaymentMethod: undefined,
181
- accountFeePaymentMethodOptions,
182
- };
183
- }
184
-
185
- /**
186
- * Returns unreasonably high gas limits in order to execute a simulation
187
- * with the goal of estimating its gas cost. It will otherwise try to respect
188
- * the user-specified fee options, filling the gaps with default values as needed.
189
- * @param from - The address where the transaction is being sent from
190
- * @param userFeeOptions - User-provided fee options to use as a basis for the fully populated `FeeOptions` type.
191
- */
192
- protected async getFeeOptionsForGasEstimation(from: AztecAddress, userFeeOptions?: UserFeeOptions) {
193
- const defaultFeeOptions = await this.getDefaultFeeOptions(from, userFeeOptions);
194
- const {
195
- gasSettings: { maxFeesPerGas, maxPriorityFeesPerGas },
196
- } = defaultFeeOptions;
197
- // Use unrealistically high gas limits for estimation to avoid running out of gas.
198
- // They will be tuned down after the simulation.
199
- const gasSettingsForEstimation = new GasSettings(
200
- new Gas(GAS_ESTIMATION_DA_GAS_LIMIT, GAS_ESTIMATION_L2_GAS_LIMIT),
201
- new Gas(GAS_ESTIMATION_TEARDOWN_DA_GAS_LIMIT, GAS_ESTIMATION_TEARDOWN_L2_GAS_LIMIT),
202
- maxFeesPerGas,
203
- maxPriorityFeesPerGas,
204
- );
205
- return {
206
- ...defaultFeeOptions,
207
- gasSettings: gasSettingsForEstimation,
208
- };
209
- }
210
-
211
- registerSender(address: AztecAddress, _alias: string = ''): Promise<AztecAddress> {
212
- return this.pxe.registerSender(address);
213
- }
214
-
215
- async registerContract(
216
- instanceData: AztecAddress | ContractInstanceWithAddress | ContractInstantiationData | ContractInstanceAndArtifact,
217
- artifact?: ContractArtifact,
218
- secretKey?: Fr,
219
- ): Promise<ContractInstanceWithAddress> {
220
- /** Determines if the provided instance data is already a contract instance with an address. */
221
- function isInstanceWithAddress(instanceData: any): instanceData is ContractInstanceWithAddress {
222
- return (instanceData as ContractInstanceWithAddress).address !== undefined;
223
- }
224
- /** Determines if the provided instance data is contract instantiation data */
225
- function isContractInstantiationData(instanceData: any): instanceData is ContractInstantiationData {
226
- return (instanceData as ContractInstantiationData).salt !== undefined;
227
- }
228
- /** Determines if the provided instance data is already a contract */
229
- function isContractInstanceAndArtifact(instanceData: any): instanceData is ContractInstanceAndArtifact {
230
- return (
231
- (instanceData as ContractInstanceAndArtifact).instance !== undefined &&
232
- (instanceData as ContractInstanceAndArtifact).artifact !== undefined
233
- );
234
- }
235
- let instance: ContractInstanceWithAddress;
236
- if (isContractInstanceAndArtifact(instanceData)) {
237
- instance = instanceData.instance;
238
- await this.pxe.registerContract(instanceData);
239
- } else if (isInstanceWithAddress(instanceData)) {
240
- instance = instanceData;
241
- await this.pxe.registerContract({ artifact, instance });
242
- } else if (isContractInstantiationData(instanceData)) {
243
- if (!artifact) {
244
- throw new Error(`Contract artifact must be provided when registering a contract using instantiation data`);
245
- }
246
- instance = await getContractInstanceFromInstantiationParams(artifact, instanceData);
247
- await this.pxe.registerContract({ artifact, instance });
248
- } else {
249
- if (!artifact) {
250
- throw new Error(`Contract artifact must be provided when registering a contract using an address`);
251
- }
252
- const { contractInstance: maybeContractInstance } = await this.pxe.getContractMetadata(instanceData);
253
- if (!maybeContractInstance) {
254
- throw new Error(`Contract instance at ${instanceData.toString()} has not been registered in the wallet's PXE`);
255
- }
256
- instance = maybeContractInstance;
257
- const thisContractClass = await getContractClassFromArtifact(artifact);
258
- if (!thisContractClass.id.equals(instance.currentContractClassId)) {
259
- // wallet holds an outdated version of this contract
260
- await this.pxe.updateContract(instance.address, artifact);
261
- instance.currentContractClassId = thisContractClass.id;
262
- }
263
- }
264
- if (secretKey) {
265
- await this.pxe.registerAccount(secretKey, await computePartialAddress(instance));
266
- }
267
- return instance;
268
- }
269
-
270
- async simulateTx(executionPayload: ExecutionPayload, opts: SimulateOptions): Promise<TxSimulationResult> {
271
- const feeOptions = opts.fee?.estimateGas
272
- ? await this.getFeeOptionsForGasEstimation(opts.from, opts.fee)
273
- : await this.getDefaultFeeOptions(opts.from, opts.fee);
274
- const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(executionPayload, opts.from, feeOptions);
275
- return this.pxe.simulateTx(
276
- txRequest,
277
- true /* simulatePublic */,
278
- opts?.skipTxValidation,
279
- opts?.skipFeeEnforcement ?? true,
280
- );
281
- }
282
-
283
- async profileTx(executionPayload: ExecutionPayload, opts: ProfileOptions): Promise<TxProfileResult> {
284
- const fee = await this.getDefaultFeeOptions(opts.from, opts.fee);
285
- const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(executionPayload, opts.from, fee);
286
- return this.pxe.profileTx(txRequest, opts.profileMode, opts.skipProofGeneration ?? true);
287
- }
288
-
289
- async sendTx(executionPayload: ExecutionPayload, opts: SendOptions): Promise<TxHash> {
290
- const fee = await this.getDefaultFeeOptions(opts.from, opts.fee);
291
- const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(executionPayload, opts.from, fee);
292
- const provenTx = await this.pxe.proveTx(txRequest);
293
- const tx = await provenTx.toTx();
294
- const txHash = tx.getTxHash();
295
- if (await this.aztecNode.getTxEffect(txHash)) {
296
- throw new Error(`A settled tx with equal hash ${txHash.toString()} exists.`);
297
- }
298
- this.log.debug(`Sending transaction ${txHash}`);
299
- await this.aztecNode.sendTx(tx).catch(err => {
300
- throw this.contextualizeError(err, inspect(tx));
301
- });
302
- this.log.info(`Sent transaction ${txHash}`);
303
- return txHash;
304
- }
305
-
306
- protected contextualizeError(err: Error, ...context: string[]): Error {
307
- let contextStr = '';
308
- if (context.length > 0) {
309
- contextStr = `\nContext:\n${context.join('\n')}`;
310
- }
311
- if (err instanceof SimulationError) {
312
- err.setAztecContext(contextStr);
313
- } else {
314
- this.log.error(err.name, err);
315
- this.log.debug(contextStr);
316
- }
317
- return err;
318
- }
319
-
320
- simulateUtility(
321
- functionName: string,
322
- args: any[],
323
- to: AztecAddress,
324
- authwits?: AuthWitness[],
325
- from?: AztecAddress,
326
- ): Promise<UtilitySimulationResult> {
327
- return this.pxe.simulateUtility(functionName, args, to, authwits, from);
328
- }
329
-
330
- getContractClassMetadata(id: Fr, includeArtifact: boolean = false): Promise<ContractClassMetadata> {
331
- return this.pxe.getContractClassMetadata(id, includeArtifact);
332
- }
333
- getContractMetadata(address: AztecAddress): Promise<ContractMetadata> {
334
- return this.pxe.getContractMetadata(address);
335
- }
336
-
337
- getTxReceipt(txHash: TxHash): Promise<TxReceipt> {
338
- return this.aztecNode.getTxReceipt(txHash);
339
- }
340
-
341
- getPrivateEvents<T>(
342
- contractAddress: AztecAddress,
343
- event: EventMetadataDefinition,
344
- from: number,
345
- limit: number,
346
- recipients: AztecAddress[] = [],
347
- ): Promise<T[]> {
348
- return this.pxe.getPrivateEvents(contractAddress, event, from, limit, recipients);
349
- }
350
- }