@aztec/aztec.js 3.0.0-nightly.20251208 → 3.0.0-nightly.20251210

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 (79) hide show
  1. package/dest/account/account.d.ts +2 -2
  2. package/dest/account/account.d.ts.map +1 -1
  3. package/dest/account/account.js +1 -1
  4. package/dest/account/account_contract.d.ts +2 -2
  5. package/dest/account/account_contract.d.ts.map +1 -1
  6. package/dest/account/account_with_secret_key.d.ts +3 -3
  7. package/dest/account/account_with_secret_key.d.ts.map +1 -1
  8. package/dest/account/index.d.ts +2 -2
  9. package/dest/account/index.d.ts.map +1 -1
  10. package/dest/account/interface.d.ts +2 -2
  11. package/dest/account/interface.d.ts.map +1 -1
  12. package/dest/account/signerless_account.d.ts +2 -2
  13. package/dest/account/signerless_account.d.ts.map +1 -1
  14. package/dest/api/fields.d.ts +3 -2
  15. package/dest/api/fields.d.ts.map +1 -1
  16. package/dest/api/fields.js +2 -1
  17. package/dest/api/wallet.d.ts +2 -2
  18. package/dest/api/wallet.d.ts.map +1 -1
  19. package/dest/api/wallet.js +1 -1
  20. package/dest/authorization/call_authorization_request.d.ts +2 -2
  21. package/dest/authorization/call_authorization_request.d.ts.map +1 -1
  22. package/dest/contract/deploy_method.d.ts +2 -2
  23. package/dest/contract/deploy_method.d.ts.map +1 -1
  24. package/dest/contract/deploy_method.js +1 -1
  25. package/dest/deployment/broadcast_function.js +1 -1
  26. package/dest/deployment/publish_class.js +1 -1
  27. package/dest/ethereum/portal_manager.d.ts +2 -2
  28. package/dest/ethereum/portal_manager.d.ts.map +1 -1
  29. package/dest/ethereum/portal_manager.js +2 -2
  30. package/dest/fee/fee_juice_payment_method_with_claim.js +1 -1
  31. package/dest/fee/private_fee_payment_method.js +1 -1
  32. package/dest/fee/public_fee_payment_method.js +1 -1
  33. package/dest/utils/abi_types.d.ts +2 -2
  34. package/dest/utils/abi_types.d.ts.map +1 -1
  35. package/dest/utils/authwit.d.ts +2 -2
  36. package/dest/utils/authwit.d.ts.map +1 -1
  37. package/dest/utils/authwit.js +1 -1
  38. package/dest/utils/cross_chain.d.ts +2 -2
  39. package/dest/utils/cross_chain.d.ts.map +1 -1
  40. package/dest/utils/fee_juice.js +1 -1
  41. package/dest/utils/field_compressed_string.js +1 -1
  42. package/dest/utils/pub_key.d.ts +2 -2
  43. package/dest/utils/pub_key.d.ts.map +1 -1
  44. package/dest/utils/pub_key.js +1 -1
  45. package/dest/wallet/account_manager.d.ts +2 -2
  46. package/dest/wallet/account_manager.d.ts.map +1 -1
  47. package/dest/wallet/account_manager.js +1 -1
  48. package/dest/wallet/deploy_account_method.d.ts +2 -2
  49. package/dest/wallet/deploy_account_method.d.ts.map +1 -1
  50. package/dest/wallet/deploy_account_method.js +1 -1
  51. package/dest/wallet/wallet.d.ts +72 -21
  52. package/dest/wallet/wallet.d.ts.map +1 -1
  53. package/dest/wallet/wallet.js +14 -2
  54. package/package.json +8 -8
  55. package/src/account/account.ts +1 -1
  56. package/src/account/account_contract.ts +1 -1
  57. package/src/account/account_with_secret_key.ts +1 -1
  58. package/src/account/index.ts +1 -1
  59. package/src/account/interface.ts +1 -1
  60. package/src/account/signerless_account.ts +1 -1
  61. package/src/api/fields.ts +2 -1
  62. package/src/api/wallet.ts +4 -0
  63. package/src/authorization/call_authorization_request.ts +1 -1
  64. package/src/contract/deploy_method.ts +1 -1
  65. package/src/deployment/broadcast_function.ts +1 -1
  66. package/src/deployment/publish_class.ts +1 -1
  67. package/src/ethereum/portal_manager.ts +2 -2
  68. package/src/fee/fee_juice_payment_method_with_claim.ts +1 -1
  69. package/src/fee/private_fee_payment_method.ts +1 -1
  70. package/src/fee/public_fee_payment_method.ts +1 -1
  71. package/src/utils/abi_types.ts +1 -1
  72. package/src/utils/authwit.ts +1 -1
  73. package/src/utils/cross_chain.ts +1 -1
  74. package/src/utils/fee_juice.ts +1 -1
  75. package/src/utils/field_compressed_string.ts +1 -1
  76. package/src/utils/pub_key.ts +2 -2
  77. package/src/wallet/account_manager.ts +1 -1
  78. package/src/wallet/deploy_account_method.ts +1 -1
  79. package/src/wallet/wallet.ts +54 -9
@@ -1,6 +1,8 @@
1
1
  import type { ChainInfo } from '@aztec/entrypoints/interfaces';
2
- import type { Fr } from '@aztec/foundation/fields';
2
+ import { BlockNumber, BlockNumberPositiveSchema } from '@aztec/foundation/branded-types';
3
+ import type { Fr } from '@aztec/foundation/curves/bn254';
3
4
  import {
5
+ type AbiDecoded,
4
6
  AbiTypeSchema,
5
7
  type ContractArtifact,
6
8
  ContractArtifactSchema,
@@ -27,8 +29,9 @@ import {
27
29
  TxReceipt,
28
30
  TxSimulationResult,
29
31
  UtilitySimulationResult,
32
+ inTxSchema,
30
33
  } from '@aztec/stdlib/tx';
31
- import type { ExecutionPayload } from '@aztec/stdlib/tx';
34
+ import type { ExecutionPayload, InTx } from '@aztec/stdlib/tx';
32
35
 
33
36
  import { z } from 'zod';
34
37
 
@@ -129,6 +132,38 @@ export type BatchResults<T extends readonly BatchedMethod<keyof BatchableMethods
129
132
  [K in keyof T]: BatchedMethodResultWrapper<T[K]>;
130
133
  };
131
134
 
135
+ /**
136
+ * Filter options when querying private events.
137
+ */
138
+ export type PrivateEventFilter = {
139
+ /** The address of the contract that emitted the events. */
140
+ contractAddress: AztecAddress;
141
+ /** Addresses of accounts that are in scope for this filter. */
142
+ scopes: AztecAddress[];
143
+ /** Transaction in which the events were emitted. */
144
+ txHash?: TxHash;
145
+ /** The block number from which to start fetching events (inclusive).
146
+ * Optional. If provided, it must be greater or equal than 1.
147
+ * Defaults to the initial L2 block number (INITIAL_L2_BLOCK_NUM).
148
+ * */
149
+ fromBlock?: BlockNumber;
150
+ /** The block number until which to fetch logs (not inclusive).
151
+ * Optional. If provided, it must be greater than fromBlock.
152
+ * Defaults to the latest known block to PXE + 1.
153
+ */
154
+ toBlock?: BlockNumber;
155
+ };
156
+
157
+ /**
158
+ * An ABI decoded private event with associated metadata.
159
+ */
160
+ export type PrivateEvent<T> = {
161
+ /** The ABI decoded event */
162
+ event: T;
163
+ /** Metadata describing event context information such as tx and block */
164
+ metadata: InTx;
165
+ };
166
+
132
167
  /**
133
168
  * The wallet interface.
134
169
  */
@@ -136,12 +171,9 @@ export type Wallet = {
136
171
  getContractClassMetadata(id: Fr, includeArtifact?: boolean): Promise<ContractClassMetadata>;
137
172
  getContractMetadata(address: AztecAddress): Promise<ContractMetadata>;
138
173
  getPrivateEvents<T>(
139
- contractAddress: AztecAddress,
140
174
  eventMetadata: EventMetadataDefinition,
141
- from: number,
142
- numBlocks: number,
143
- recipients: AztecAddress[],
144
- ): Promise<T[]>;
175
+ eventFilter: PrivateEventFilter,
176
+ ): Promise<PrivateEvent<T>[]>;
145
177
  getChainInfo(): Promise<ChainInfo>;
146
178
  getTxReceipt(txHash: TxHash): Promise<TxReceipt>;
147
179
  registerSender(address: AztecAddress, alias?: string): Promise<AztecAddress>;
@@ -267,6 +299,19 @@ export const EventMetadataDefinitionSchema = z.object({
267
299
  fieldNames: z.array(z.string()),
268
300
  });
269
301
 
302
+ export const PrivateEventSchema: ZodFor<PrivateEvent<AbiDecoded>> = z.object({
303
+ event: AbiDecodedSchema,
304
+ metadata: inTxSchema(),
305
+ });
306
+
307
+ export const PrivateEventFilterSchema = z.object({
308
+ contractAddress: schemas.AztecAddress,
309
+ scopes: z.array(schemas.AztecAddress),
310
+ txHash: optional(TxHash.schema),
311
+ fromBlock: optional(BlockNumberPositiveSchema),
312
+ toBlock: optional(BlockNumberPositiveSchema),
313
+ });
314
+
270
315
  export const WalletSchema: ApiSchemaFor<Wallet> = {
271
316
  getChainInfo: z
272
317
  .function()
@@ -277,8 +322,8 @@ export const WalletSchema: ApiSchemaFor<Wallet> = {
277
322
  getTxReceipt: z.function().args(TxHash.schema).returns(TxReceipt.schema),
278
323
  getPrivateEvents: z
279
324
  .function()
280
- .args(schemas.AztecAddress, EventMetadataDefinitionSchema, z.number(), z.number(), z.array(schemas.AztecAddress))
281
- .returns(z.array(AbiDecodedSchema)),
325
+ .args(EventMetadataDefinitionSchema, PrivateEventFilterSchema)
326
+ .returns(z.array(PrivateEventSchema)),
282
327
  registerSender: z.function().args(schemas.AztecAddress, optional(z.string())).returns(schemas.AztecAddress),
283
328
  getAddressBook: z
284
329
  .function()