@aztec/aztec.js 0.0.1-commit.c80b6263 → 0.0.1-commit.cd76b27

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/api/contract.d.ts +2 -2
  2. package/dest/api/contract.js +2 -2
  3. package/dest/api/deployment.d.ts +1 -2
  4. package/dest/api/deployment.d.ts.map +1 -1
  5. package/dest/api/deployment.js +0 -1
  6. package/dest/api/events.d.ts +10 -6
  7. package/dest/api/events.d.ts.map +1 -1
  8. package/dest/api/events.js +30 -20
  9. package/dest/api/fields.d.ts +2 -1
  10. package/dest/api/fields.d.ts.map +1 -1
  11. package/dest/api/fields.js +1 -0
  12. package/dest/api/keys.d.ts +1 -1
  13. package/dest/api/keys.js +1 -1
  14. package/dest/api/wallet.d.ts +3 -2
  15. package/dest/api/wallet.d.ts.map +1 -1
  16. package/dest/api/wallet.js +2 -1
  17. package/dest/contract/batch_call.d.ts +3 -3
  18. package/dest/contract/batch_call.d.ts.map +1 -1
  19. package/dest/contract/batch_call.js +8 -5
  20. package/dest/contract/contract_function_interaction.d.ts +3 -12
  21. package/dest/contract/contract_function_interaction.d.ts.map +1 -1
  22. package/dest/contract/contract_function_interaction.js +10 -7
  23. package/dest/contract/protocol_contracts/auth-registry.d.ts +1 -1
  24. package/dest/contract/protocol_contracts/auth-registry.d.ts.map +1 -1
  25. package/dest/contract/protocol_contracts/auth-registry.js +32 -6
  26. package/dest/contract/protocol_contracts/contract-class-registry.d.ts +2 -22
  27. package/dest/contract/protocol_contracts/contract-class-registry.d.ts.map +1 -1
  28. package/dest/contract/protocol_contracts/contract-class-registry.js +13 -658
  29. package/dest/contract/protocol_contracts/contract-instance-registry.d.ts +2 -11
  30. package/dest/contract/protocol_contracts/contract-instance-registry.d.ts.map +1 -1
  31. package/dest/contract/protocol_contracts/contract-instance-registry.js +76 -473
  32. package/dest/contract/protocol_contracts/fee-juice.d.ts +1 -10
  33. package/dest/contract/protocol_contracts/fee-juice.d.ts.map +1 -1
  34. package/dest/contract/protocol_contracts/fee-juice.js +0 -401
  35. package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts +1 -1
  36. package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts.map +1 -1
  37. package/dest/contract/protocol_contracts/multi-call-entrypoint.js +23 -1
  38. package/dest/contract/protocol_contracts/public-checks.d.ts +1 -1
  39. package/dest/contract/protocol_contracts/public-checks.d.ts.map +1 -1
  40. package/dest/contract/protocol_contracts/public-checks.js +23 -9
  41. package/dest/fee/fee_juice_payment_method_with_claim.js +6 -6
  42. package/dest/fee/private_fee_payment_method.js +10 -10
  43. package/dest/fee/public_fee_payment_method.js +10 -10
  44. package/dest/fee/sponsored_fee_payment.js +3 -3
  45. package/dest/wallet/capabilities.d.ts +444 -0
  46. package/dest/wallet/capabilities.d.ts.map +1 -0
  47. package/dest/wallet/capabilities.js +3 -0
  48. package/dest/wallet/index.d.ts +2 -1
  49. package/dest/wallet/index.d.ts.map +1 -1
  50. package/dest/wallet/index.js +1 -0
  51. package/dest/wallet/wallet.d.ts +1452 -89
  52. package/dest/wallet/wallet.d.ts.map +1 -1
  53. package/dest/wallet/wallet.js +146 -23
  54. package/package.json +19 -10
  55. package/src/api/contract.ts +2 -2
  56. package/src/api/deployment.ts +0 -1
  57. package/src/api/events.ts +35 -27
  58. package/src/api/fields.ts +1 -0
  59. package/src/api/keys.ts +2 -2
  60. package/src/api/wallet.ts +43 -1
  61. package/src/contract/batch_call.ts +7 -12
  62. package/src/contract/contract_function_interaction.ts +17 -7
  63. package/src/contract/protocol_contracts/auth-registry.ts +6 -2
  64. package/src/contract/protocol_contracts/contract-class-registry.ts +4 -338
  65. package/src/contract/protocol_contracts/contract-instance-registry.ts +33 -225
  66. package/src/contract/protocol_contracts/fee-juice.ts +0 -193
  67. package/src/contract/protocol_contracts/multi-call-entrypoint.ts +4 -1
  68. package/src/contract/protocol_contracts/public-checks.ts +4 -3
  69. package/src/fee/fee_juice_payment_method_with_claim.ts +5 -5
  70. package/src/fee/private_fee_payment_method.ts +7 -7
  71. package/src/fee/public_fee_payment_method.ts +8 -8
  72. package/src/fee/sponsored_fee_payment.ts +3 -3
  73. package/src/wallet/capabilities.ts +491 -0
  74. package/src/wallet/index.ts +1 -0
  75. package/src/wallet/wallet.ts +201 -38
  76. package/dest/deployment/broadcast_function.d.ts +0 -24
  77. package/dest/deployment/broadcast_function.d.ts.map +0 -1
  78. package/dest/deployment/broadcast_function.js +0 -74
  79. package/src/deployment/broadcast_function.ts +0 -148
@@ -1 +1 @@
1
- {"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAA6B,MAAM,iCAAiC,CAAC;AACzF,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAGL,KAAK,gBAAgB,EAErB,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,YAAY,EACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,KAAK,2BAA2B,EAAqC,MAAM,wBAAwB,CAAC;AAC7G,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAoB,KAAK,YAAY,EAA6B,MAAM,uBAAuB,CAAC;AACvG,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,OAAO,EACP,YAAY,EACZ,MAAM,EACN,eAAe,EAEf,kBAAkB,EAClB,uBAAuB,EAExB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBhC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQnC,CAAC;AAkFH,QAAA,MAAe,mBAAmB;;;;;;;;;;;;;;;;;;QAAU,mBAAmB;;;;;;;;;;;;;;;;;;MAA4C,CAAC;AAE5G,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAC;AAEpD,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,MAAM,CAI7C,CAAC"}
@@ -1,24 +1,14 @@
1
1
  import { BlockNumberPositiveSchema } from '@aztec/foundation/branded-types';
2
- import { AbiTypeSchema, ContractArtifactSchema, FunctionType } from '@aztec/stdlib/abi';
2
+ import { AbiTypeSchema, ContractArtifactSchema, FunctionCall } from '@aztec/stdlib/abi';
3
3
  import { AuthWitness } from '@aztec/stdlib/auth-witness';
4
4
  import { ContractInstanceWithAddressSchema } from '@aztec/stdlib/contract';
5
5
  import { Gas } from '@aztec/stdlib/gas';
6
6
  import { AbiDecodedSchema, optional, schemas, zodFor } from '@aztec/stdlib/schemas';
7
- import { Capsule, HashedValues, TxHash, TxProfileResult, TxReceipt, TxSimulationResult, UtilitySimulationResult, inTxSchema } from '@aztec/stdlib/tx';
7
+ import { Capsule, HashedValues, TxHash, TxProfileResult, TxReceipt, TxSimulationResult, UtilityExecutionResult, inTxSchema } from '@aztec/stdlib/tx';
8
8
  import { z } from 'zod';
9
9
  import { NO_WAIT } from '../contract/interaction_options.js';
10
- export const FunctionCallSchema = z.object({
11
- name: z.string(),
12
- to: schemas.AztecAddress,
13
- selector: schemas.FunctionSelector,
14
- type: z.nativeEnum(FunctionType),
15
- isStatic: z.boolean(),
16
- hideMsgSender: z.boolean(),
17
- args: z.array(schemas.Fr),
18
- returnTypes: z.array(AbiTypeSchema)
19
- });
20
10
  export const ExecutionPayloadSchema = z.object({
21
- calls: z.array(FunctionCallSchema),
11
+ calls: z.array(FunctionCall.schema),
22
12
  authWitnesses: z.array(AuthWitness.schema),
23
13
  capsules: z.array(Capsule.schema),
24
14
  extraHashedArgs: z.array(HashedValues.schema),
@@ -82,7 +72,7 @@ export const MessageHashOrIntentSchema = z.union([
82
72
  }),
83
73
  z.object({
84
74
  caller: schemas.AztecAddress,
85
- call: FunctionCallSchema
75
+ call: FunctionCall.schema
86
76
  })
87
77
  ]);
88
78
  export const EventMetadataDefinitionSchema = z.object({
@@ -90,17 +80,28 @@ export const EventMetadataDefinitionSchema = z.object({
90
80
  abiType: AbiTypeSchema,
91
81
  fieldNames: z.array(z.string())
92
82
  });
93
- export const PrivateEventSchema = zodFor()(z.object({
94
- event: AbiDecodedSchema,
95
- metadata: inTxSchema()
96
- }));
97
- export const PrivateEventFilterSchema = z.object({
98
- contractAddress: schemas.AztecAddress,
99
- scopes: z.array(schemas.AztecAddress),
83
+ const EventFilterBaseSchema = z.object({
100
84
  txHash: optional(TxHash.schema),
101
85
  fromBlock: optional(BlockNumberPositiveSchema),
102
86
  toBlock: optional(BlockNumberPositiveSchema)
103
87
  });
88
+ export const PrivateEventFilterSchema = EventFilterBaseSchema.extend({
89
+ contractAddress: schemas.AztecAddress,
90
+ scopes: z.array(schemas.AztecAddress)
91
+ });
92
+ export const PublicEventFilterSchema = EventFilterBaseSchema.extend({
93
+ contractAddress: optional(schemas.AztecAddress)
94
+ });
95
+ export const PrivateEventSchema = zodFor()(z.object({
96
+ event: AbiDecodedSchema,
97
+ metadata: inTxSchema()
98
+ }));
99
+ export const PublicEventSchema = zodFor()(z.object({
100
+ event: AbiDecodedSchema,
101
+ metadata: z.intersection(inTxSchema(), z.object({
102
+ contractAddress: schemas.AztecAddress
103
+ }))
104
+ }));
104
105
  export const ContractMetadataSchema = z.object({
105
106
  instance: optional(ContractInstanceWithAddressSchema),
106
107
  isContractInitialized: z.boolean(),
@@ -112,6 +113,124 @@ export const ContractClassMetadataSchema = z.object({
112
113
  isArtifactRegistered: z.boolean(),
113
114
  isContractClassPubliclyRegistered: z.boolean()
114
115
  });
116
+ export const ContractFunctionPatternSchema = z.object({
117
+ contract: z.union([
118
+ schemas.AztecAddress,
119
+ z.literal('*')
120
+ ]),
121
+ function: z.union([
122
+ z.string(),
123
+ z.literal('*')
124
+ ])
125
+ });
126
+ export const AccountsCapabilitySchema = z.object({
127
+ type: z.literal('accounts'),
128
+ canGet: optional(z.boolean()),
129
+ canCreateAuthWit: optional(z.boolean())
130
+ });
131
+ export const GrantedAccountsCapabilitySchema = AccountsCapabilitySchema.extend({
132
+ accounts: z.array(z.object({
133
+ alias: z.string(),
134
+ item: schemas.AztecAddress
135
+ }))
136
+ });
137
+ export const ContractsCapabilitySchema = z.object({
138
+ type: z.literal('contracts'),
139
+ contracts: z.union([
140
+ z.literal('*'),
141
+ z.array(schemas.AztecAddress)
142
+ ]),
143
+ canRegister: optional(z.boolean()),
144
+ canGetMetadata: optional(z.boolean())
145
+ });
146
+ export const GrantedContractsCapabilitySchema = ContractsCapabilitySchema;
147
+ export const ContractClassesCapabilitySchema = z.object({
148
+ type: z.literal('contractClasses'),
149
+ classes: z.union([
150
+ z.literal('*'),
151
+ z.array(schemas.Fr)
152
+ ]),
153
+ canGetMetadata: z.boolean()
154
+ });
155
+ export const GrantedContractClassesCapabilitySchema = ContractClassesCapabilitySchema;
156
+ export const SimulationCapabilitySchema = z.object({
157
+ type: z.literal('simulation'),
158
+ transactions: optional(z.object({
159
+ scope: z.union([
160
+ z.literal('*'),
161
+ z.array(ContractFunctionPatternSchema)
162
+ ])
163
+ })),
164
+ utilities: optional(z.object({
165
+ scope: z.union([
166
+ z.literal('*'),
167
+ z.array(ContractFunctionPatternSchema)
168
+ ])
169
+ }))
170
+ });
171
+ export const GrantedSimulationCapabilitySchema = SimulationCapabilitySchema;
172
+ export const TransactionCapabilitySchema = z.object({
173
+ type: z.literal('transaction'),
174
+ scope: z.union([
175
+ z.literal('*'),
176
+ z.array(ContractFunctionPatternSchema)
177
+ ])
178
+ });
179
+ export const GrantedTransactionCapabilitySchema = TransactionCapabilitySchema;
180
+ export const DataCapabilitySchema = z.object({
181
+ type: z.literal('data'),
182
+ addressBook: optional(z.boolean()),
183
+ privateEvents: optional(z.object({
184
+ contracts: z.union([
185
+ z.literal('*'),
186
+ z.array(schemas.AztecAddress)
187
+ ])
188
+ }))
189
+ });
190
+ export const GrantedDataCapabilitySchema = DataCapabilitySchema;
191
+ export const CapabilitySchema = z.discriminatedUnion('type', [
192
+ AccountsCapabilitySchema,
193
+ ContractsCapabilitySchema,
194
+ ContractClassesCapabilitySchema,
195
+ SimulationCapabilitySchema,
196
+ TransactionCapabilitySchema,
197
+ DataCapabilitySchema
198
+ ]);
199
+ export const GrantedCapabilitySchema = z.discriminatedUnion('type', [
200
+ GrantedAccountsCapabilitySchema,
201
+ GrantedContractsCapabilitySchema,
202
+ GrantedContractClassesCapabilitySchema,
203
+ GrantedSimulationCapabilitySchema,
204
+ GrantedTransactionCapabilitySchema,
205
+ GrantedDataCapabilitySchema
206
+ ]);
207
+ export const AppCapabilitiesSchema = z.object({
208
+ version: z.literal('1.0'),
209
+ metadata: z.object({
210
+ name: z.string(),
211
+ version: z.string(),
212
+ description: optional(z.string()),
213
+ url: optional(z.string()),
214
+ icon: optional(z.string())
215
+ }),
216
+ capabilities: z.array(CapabilitySchema),
217
+ behavior: optional(z.object({
218
+ mode: optional(z.enum([
219
+ 'strict',
220
+ 'permissive'
221
+ ])),
222
+ expiration: optional(z.number())
223
+ }))
224
+ });
225
+ export const WalletCapabilitiesSchema = z.object({
226
+ version: z.literal('1.0'),
227
+ granted: z.array(GrantedCapabilitySchema),
228
+ wallet: z.object({
229
+ name: z.string(),
230
+ version: z.string()
231
+ }),
232
+ expiresAt: optional(z.number())
233
+ });
115
234
  /**
116
235
  * Record of all wallet method schemas (excluding batch).
117
236
  * This is the single source of truth for method schemas - batch schemas are derived from this.
@@ -134,13 +253,17 @@ export const ContractClassMetadataSchema = z.object({
134
253
  }))),
135
254
  registerContract: z.function().args(ContractInstanceWithAddressSchema, optional(ContractArtifactSchema), optional(schemas.Fr)).returns(ContractInstanceWithAddressSchema),
136
255
  simulateTx: z.function().args(ExecutionPayloadSchema, SimulateOptionsSchema).returns(TxSimulationResult.schema),
137
- simulateUtility: z.function().args(FunctionCallSchema, optional(z.array(AuthWitness.schema))).returns(UtilitySimulationResult.schema),
256
+ executeUtility: z.function().args(FunctionCall.schema, z.object({
257
+ scope: schemas.AztecAddress,
258
+ authWitnesses: optional(z.array(AuthWitness.schema))
259
+ })).returns(UtilityExecutionResult.schema),
138
260
  profileTx: z.function().args(ExecutionPayloadSchema, ProfileOptionsSchema).returns(TxProfileResult.schema),
139
261
  sendTx: z.function().args(ExecutionPayloadSchema, SendOptionsSchema).returns(z.union([
140
262
  TxHash.schema,
141
263
  TxReceipt.schema
142
264
  ])),
143
- createAuthWit: z.function().args(schemas.AztecAddress, MessageHashOrIntentSchema).returns(AuthWitness.schema)
265
+ createAuthWit: z.function().args(schemas.AztecAddress, MessageHashOrIntentSchema).returns(AuthWitness.schema),
266
+ requestCapabilities: z.function().args(AppCapabilitiesSchema).returns(WalletCapabilitiesSchema)
144
267
  };
145
268
  /**
146
269
  * Creates batch schemas from the individual wallet methods.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aztec/aztec.js",
3
3
  "homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/aztec.js",
4
- "version": "0.0.1-commit.c80b6263",
4
+ "version": "0.0.1-commit.cd76b27",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  "./abi": "./dest/api/abi.js",
@@ -30,7 +30,16 @@
30
30
  },
31
31
  "typedocOptions": {
32
32
  "entryPoints": [
33
- "./src/index.ts"
33
+ "./src/api/abi.ts",
34
+ "./src/api/account.ts",
35
+ "./src/api/contract.ts",
36
+ "./src/api/deployment.ts",
37
+ "./src/api/ethereum.ts",
38
+ "./src/api/fee.ts",
39
+ "./src/api/fields.ts",
40
+ "./src/api/keys.ts",
41
+ "./src/api/tx.ts",
42
+ "./src/api/wallet.ts"
34
43
  ],
35
44
  "name": "Aztec.js",
36
45
  "tsconfig": "./tsconfig.json"
@@ -85,20 +94,20 @@
85
94
  ]
86
95
  },
87
96
  "dependencies": {
88
- "@aztec/constants": "0.0.1-commit.c80b6263",
89
- "@aztec/entrypoints": "0.0.1-commit.c80b6263",
90
- "@aztec/ethereum": "0.0.1-commit.c80b6263",
91
- "@aztec/foundation": "0.0.1-commit.c80b6263",
92
- "@aztec/l1-artifacts": "0.0.1-commit.c80b6263",
93
- "@aztec/protocol-contracts": "0.0.1-commit.c80b6263",
94
- "@aztec/stdlib": "0.0.1-commit.c80b6263",
97
+ "@aztec/constants": "0.0.1-commit.cd76b27",
98
+ "@aztec/entrypoints": "0.0.1-commit.cd76b27",
99
+ "@aztec/ethereum": "0.0.1-commit.cd76b27",
100
+ "@aztec/foundation": "0.0.1-commit.cd76b27",
101
+ "@aztec/l1-artifacts": "0.0.1-commit.cd76b27",
102
+ "@aztec/protocol-contracts": "0.0.1-commit.cd76b27",
103
+ "@aztec/stdlib": "0.0.1-commit.cd76b27",
95
104
  "axios": "^1.12.0",
96
105
  "tslib": "^2.4.0",
97
106
  "viem": "npm:@aztec/viem@2.38.2",
98
107
  "zod": "^3.23.8"
99
108
  },
100
109
  "devDependencies": {
101
- "@aztec/builder": "0.0.1-commit.c80b6263",
110
+ "@aztec/builder": "0.0.1-commit.cd76b27",
102
111
  "@jest/globals": "^30.0.0",
103
112
  "@types/jest": "^30.0.0",
104
113
  "@types/node": "^22.15.17",
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The `contract` module provides utilities for deploying and interacting with contracts, based on a
3
3
  * `Wallet` instance and a compiled artifact. Refer to the {@link account} module for how to obtain a valid
4
- * `Wallet` instance, and to the {@link https://docs.aztec.network/developers/aztec-nr/how_to_compile_contract | Compiling contracts}
4
+ * `Wallet` instance, and to the {@link https://docs.aztec.network/developers/aztec-nr/compiling_contracts | Compiling contracts}
5
5
  * section of the documentation for how to generate an artifact out of your Noir source code.
6
6
  *
7
7
  * The {@link Contract} class is the main class in this module, and provides static methods for deploying
@@ -37,7 +37,7 @@
37
37
  * If you pass `wait: NO_WAIT` in the options, it will return a {@link TxHash} immediately without waiting.
38
38
  *
39
39
  * @remarks If you are using typescript, consider using the
40
- * {@link https://docs.aztec.network/developers/aztec-nr/how_to_compile_contract#use-generated-interfaces | autogenerated type-safe interfaces}
40
+ * {@link https://docs.aztec.network/developers/aztec-nr/compiling_contracts#use-generated-interfaces | autogenerated type-safe interfaces}
41
41
  * for interacting with your contracts.
42
42
  *
43
43
  * @packageDocumentation
@@ -1,4 +1,3 @@
1
1
  export { publishContractClass } from '../deployment/publish_class.js';
2
- export { broadcastPrivateFunction, broadcastUtilityFunction } from '../deployment/broadcast_function.js';
3
2
  export { publishInstance } from '../deployment/publish_instance.js';
4
3
  export { ContractDeployer } from '../deployment/contract_deployer.js';
package/src/api/events.ts CHANGED
@@ -1,44 +1,52 @@
1
1
  import { type EventMetadataDefinition, EventSelector, decodeFromAbi } from '@aztec/stdlib/abi';
2
2
  import type { AztecNode } from '@aztec/stdlib/interfaces/client';
3
3
 
4
+ import type { PublicEvent, PublicEventFilter } from '../wallet/wallet.js';
5
+
4
6
  /**
5
7
  * Returns decoded public events given search parameters.
6
8
  * @param node - The node to request events from
7
- * @param eventMetadata - Metadata of the event. This should be the class generated from the contract. e.g. Contract.events.Event
8
- * @param from - The block number to search from.
9
- * @param limit - The amount of blocks to search.
10
- * @returns - The deserialized events.
9
+ * @param eventMetadataDef - Metadata of the event. This should be the class generated from the contract. e.g. Contract.events.Event
10
+ * @param filter - Filter options for the event query:
11
+ * - `contractAddress`: The address of the contract that emitted the events.
12
+ * - `txHash`: Transaction in which the events were emitted.
13
+ * - `fromBlock`: The block number from which to start fetching events (inclusive). Defaults to 1.
14
+ * - `toBlock`: The block number until which to fetch events (not inclusive). Defaults to latest + 1.
15
+ * @returns - The decoded events with metadata.
11
16
  */
12
- export async function getDecodedPublicEvents<T>(
17
+ export async function getPublicEvents<T>(
13
18
  node: AztecNode,
14
19
  eventMetadataDef: EventMetadataDefinition,
15
- from: number,
16
- limit: number,
17
- ): Promise<T[]> {
20
+ filter: PublicEventFilter,
21
+ ): Promise<PublicEvent<T>[]> {
18
22
  const { logs } = await node.getPublicLogs({
19
- fromBlock: from,
20
- toBlock: from + limit,
23
+ fromBlock: filter.fromBlock ? Number(filter.fromBlock) : undefined,
24
+ toBlock: filter.toBlock ? Number(filter.toBlock) : undefined,
25
+ txHash: filter.txHash,
26
+ contractAddress: filter.contractAddress,
21
27
  });
22
28
 
23
- const decodedEvents = logs
24
- .map(log => {
25
- // +1 for the event selector
26
- const expectedLength = eventMetadataDef.fieldNames.length + 1;
27
- if (log.log.fields.length !== expectedLength) {
28
- throw new Error(
29
- `Something is weird here, we have matching EventSelectors, but the actual payload has mismatched length. Expected ${expectedLength}. Got ${log.log.fields.length}.`,
30
- );
31
- }
29
+ const decodedEvents: PublicEvent<T>[] = [];
30
+
31
+ for (const log of logs) {
32
+ const logFields = log.log.getEmittedFields();
33
+ // Event selector is at the last position of the emitted fields
34
+ const logEventSelector = EventSelector.fromField(logFields[logFields.length - 1]);
32
35
 
33
- const logFields = log.log.getEmittedFields();
34
- // We are assuming here that event logs are the last 4 bytes of the event. This is not enshrined but is a function of aztec.nr raw log emission.
35
- if (!EventSelector.fromField(logFields[logFields.length - 1]).equals(eventMetadataDef.eventSelector)) {
36
- return undefined;
37
- }
36
+ if (!logEventSelector.equals(eventMetadataDef.eventSelector)) {
37
+ continue;
38
+ }
38
39
 
39
- return decodeFromAbi([eventMetadataDef.abiType], log.log.fields) as T;
40
- })
41
- .filter(log => log !== undefined) as T[];
40
+ decodedEvents.push({
41
+ event: decodeFromAbi([eventMetadataDef.abiType], log.log.fields) as T,
42
+ metadata: {
43
+ l2BlockNumber: log.id.blockNumber,
44
+ l2BlockHash: log.id.blockHash,
45
+ txHash: log.id.txHash,
46
+ contractAddress: log.log.contractAddress,
47
+ },
48
+ });
49
+ }
42
50
 
43
51
  return decodedEvents;
44
52
  }
package/src/api/fields.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { Fr, Fq } from '@aztec/foundation/curves/bn254';
2
2
  export { GrumpkinScalar, Point } from '@aztec/foundation/curves/grumpkin';
3
+ export { BlockNumber } from '@aztec/foundation/branded-types';
package/src/api/keys.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  export { type PublicKey, PublicKeys } from '@aztec/stdlib/keys';
2
2
  export {
3
- computeAppNullifierSecretKey,
3
+ computeAppNullifierHidingKey,
4
4
  deriveKeys,
5
5
  deriveMasterIncomingViewingSecretKey,
6
- deriveMasterNullifierSecretKey,
6
+ deriveMasterNullifierHidingKey,
7
7
  } from '@aztec/stdlib/keys';
8
8
  export { generatePublicKey } from '../utils/pub_key.js';
package/src/api/wallet.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export {
2
2
  type Aliased,
3
3
  type SimulateOptions,
4
+ type ExecuteUtilityOptions,
4
5
  type ProfileOptions,
5
6
  type SendOptions,
6
7
  type BatchableMethods,
@@ -11,9 +12,12 @@ export {
11
12
  type Wallet,
12
13
  type PrivateEvent,
13
14
  type PrivateEventFilter,
15
+ type PublicEvent,
16
+ type PublicEventFilter,
14
17
  type ContractMetadata,
15
18
  type ContractClassMetadata,
16
- FunctionCallSchema,
19
+ AppCapabilitiesSchema,
20
+ WalletCapabilitiesSchema,
17
21
  ExecutionPayloadSchema,
18
22
  GasSettingsOptionSchema,
19
23
  WalletSimulationFeeOptionSchema,
@@ -26,11 +30,49 @@ export {
26
30
  EventMetadataDefinitionSchema,
27
31
  PrivateEventSchema,
28
32
  PrivateEventFilterSchema,
33
+ PublicEventSchema,
34
+ PublicEventFilterSchema,
29
35
  ContractClassMetadataSchema,
30
36
  ContractMetadataSchema,
31
37
  WalletSchema,
38
+ ContractFunctionPatternSchema,
39
+ AccountsCapabilitySchema,
40
+ GrantedAccountsCapabilitySchema,
41
+ ContractsCapabilitySchema,
42
+ GrantedContractsCapabilitySchema,
43
+ ContractClassesCapabilitySchema,
44
+ GrantedContractClassesCapabilitySchema,
45
+ SimulationCapabilitySchema,
46
+ GrantedSimulationCapabilitySchema,
47
+ TransactionCapabilitySchema,
48
+ GrantedTransactionCapabilitySchema,
49
+ DataCapabilitySchema,
50
+ GrantedDataCapabilitySchema,
51
+ CapabilitySchema,
52
+ GrantedCapabilitySchema,
32
53
  } from '../wallet/wallet.js';
33
54
 
55
+ export {
56
+ type AppCapabilities,
57
+ type WalletCapabilities,
58
+ CAPABILITY_VERSION,
59
+ type Capability,
60
+ type GrantedCapability,
61
+ type ContractFunctionPattern,
62
+ type AccountsCapability,
63
+ type GrantedAccountsCapability,
64
+ type ContractsCapability,
65
+ type GrantedContractsCapability,
66
+ type ContractClassesCapability,
67
+ type GrantedContractClassesCapability,
68
+ type SimulationCapability,
69
+ type GrantedSimulationCapability,
70
+ type TransactionCapability,
71
+ type GrantedTransactionCapability,
72
+ type DataCapability,
73
+ type GrantedDataCapability,
74
+ } from '../wallet/capabilities.js';
75
+
34
76
  export { AccountManager } from '../wallet/account_manager.js';
35
77
 
36
78
  export { type DeployAccountOptions, DeployAccountMethod } from '../wallet/deploy_account_method.js';
@@ -1,10 +1,5 @@
1
1
  import { type FunctionCall, FunctionType, decodeFromAbi } from '@aztec/stdlib/abi';
2
- import {
3
- ExecutionPayload,
4
- TxSimulationResult,
5
- UtilitySimulationResult,
6
- mergeExecutionPayloads,
7
- } from '@aztec/stdlib/tx';
2
+ import { ExecutionPayload, TxSimulationResult, UtilityExecutionResult, mergeExecutionPayloads } from '@aztec/stdlib/tx';
8
3
 
9
4
  import type { BatchedMethod, Wallet } from '../wallet/wallet.js';
10
5
  import { BaseContractInteraction } from './base_contract_interaction.js';
@@ -42,9 +37,9 @@ export class BatchCall extends BaseContractInteraction {
42
37
  }
43
38
 
44
39
  /**
45
- * Simulates the batch, supporting private, public and utility functions. Although this is a single
40
+ * Simulates/executes the batch, supporting private, public and utility functions. Although this is a single
46
41
  * interaction with the wallet, private and public functions will be grouped into a single ExecutionPayload
47
- * that the wallet will simulate as a single transaction. Utility function calls will simply be executed
42
+ * that the wallet will simulate as a single transaction. Utility function calls will be executed
48
43
  * one by one.
49
44
  * @param options - An optional object containing additional configuration for the interaction.
50
45
  * @returns The results of all the interactions that make up the batch
@@ -81,8 +76,8 @@ export class BatchCall extends BaseContractInteraction {
81
76
  // Add utility calls to batch
82
77
  for (const [call] of utility) {
83
78
  batchRequests.push({
84
- name: 'simulateUtility' as const,
85
- args: [call, options?.authWitnesses],
79
+ name: 'executeUtility' as const,
80
+ args: [call, { scope: options.from, authWitnesses: options.authWitnesses }],
86
81
  });
87
82
  }
88
83
 
@@ -111,8 +106,8 @@ export class BatchCall extends BaseContractInteraction {
111
106
  for (let i = 0; i < utility.length; i++) {
112
107
  const [call, resultIndex] = utility[i];
113
108
  const wrappedResult = batchResults[i];
114
- if (wrappedResult.name === 'simulateUtility') {
115
- const rawReturnValues = (wrappedResult.result as UtilitySimulationResult).result;
109
+ if (wrappedResult.name === 'executeUtility') {
110
+ const rawReturnValues = (wrappedResult.result as UtilityExecutionResult).result;
116
111
  results[resultIndex] = rawReturnValues ? decodeFromAbi(call.returnTypes, rawReturnValues) : [];
117
112
  }
118
113
  }
@@ -1,4 +1,11 @@
1
- import { type FunctionAbi, FunctionSelector, FunctionType, decodeFromAbi, encodeArguments } from '@aztec/stdlib/abi';
1
+ import {
2
+ type FunctionAbi,
3
+ FunctionCall,
4
+ FunctionSelector,
5
+ FunctionType,
6
+ decodeFromAbi,
7
+ encodeArguments,
8
+ } from '@aztec/stdlib/abi';
2
9
  import type { AuthWitness } from '@aztec/stdlib/auth-witness';
3
10
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
4
11
  import { type Capsule, type HashedValues, type TxProfileResult, collectOffchainEffects } from '@aztec/stdlib/tx';
@@ -43,16 +50,16 @@ export class ContractFunctionInteraction extends BaseContractInteraction {
43
50
  */
44
51
  public async getFunctionCall() {
45
52
  const args = encodeArguments(this.functionDao, this.args);
46
- return {
53
+ return FunctionCall.from({
47
54
  name: this.functionDao.name,
48
- args,
55
+ to: this.contractAddress,
49
56
  selector: await FunctionSelector.fromNameAndParameters(this.functionDao.name, this.functionDao.parameters),
50
57
  type: this.functionDao.functionType,
51
- to: this.contractAddress,
52
- isStatic: this.functionDao.isStatic,
53
58
  hideMsgSender: false /** Only set to `true` for enqueued public function calls */,
59
+ isStatic: this.functionDao.isStatic,
60
+ args,
54
61
  returnTypes: this.functionDao.returnTypes,
55
- };
62
+ });
56
63
  }
57
64
 
58
65
  /**
@@ -104,7 +111,10 @@ export class ContractFunctionInteraction extends BaseContractInteraction {
104
111
  // docs:end:simulate
105
112
  if (this.functionDao.functionType == FunctionType.UTILITY) {
106
113
  const call = await this.getFunctionCall();
107
- const utilityResult = await this.wallet.simulateUtility(call, options.authWitnesses ?? []);
114
+ const utilityResult = await this.wallet.executeUtility(call, {
115
+ scope: options.from,
116
+ authWitnesses: options.authWitnesses,
117
+ });
108
118
 
109
119
  // Decode the raw field elements to the actual return type
110
120
  const returnValue = utilityResult.result ? decodeFromAbi(this.functionDao.returnTypes, utilityResult.result) : [];
@@ -41,9 +41,10 @@ const AuthRegistryContractArtifact: ContractArtifact = {
41
41
  ],
42
42
  returnTypes: [],
43
43
  errorTypes: {
44
- '2754040237334517471': { error_kind: 'fmtstring', length: 92, item_types: [] },
45
44
  '7555607922535724711': { error_kind: 'string', string: 'Preimage mismatch' },
45
+ '9530675838293881722': { error_kind: 'string', string: 'Writer did not write all data' },
46
46
  '9894212961085021188': { error_kind: 'string', string: 'Message not authorized by account' },
47
+ '12327971061804302172': { error_kind: 'fmtstring', length: 98, item_types: [] },
47
48
  '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
48
49
  '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
49
50
  '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
@@ -100,7 +101,7 @@ const AuthRegistryContractArtifact: ContractArtifact = {
100
101
  type: {
101
102
  kind: 'struct',
102
103
  fields: [
103
- { name: 'storage', type: { kind: 'array', length: 17, type: { kind: 'field' } } },
104
+ { name: 'storage', type: { kind: 'array', length: 15, type: { kind: 'field' } } },
104
105
  { name: 'len', type: { kind: 'integer', sign: 'unsigned', width: 32 } },
105
106
  ],
106
107
  path: 'std::collections::bounded_vec::BoundedVec',
@@ -161,6 +162,7 @@ const AuthRegistryContractArtifact: ContractArtifact = {
161
162
  },
162
163
  '4261968856572588300': { error_kind: 'string', string: 'Value does not fit in field' },
163
164
  '4440399188109668273': { error_kind: 'string', string: 'Input length must be a multiple of 32' },
165
+ '5417577161503694006': { error_kind: 'fmtstring', length: 56, item_types: [{ kind: 'field' }] },
164
166
  '9791669845391776238': {
165
167
  error_kind: 'string',
166
168
  string: '0 has a square root; you cannot claim it is not square',
@@ -262,6 +264,7 @@ const AuthRegistryContractArtifact: ContractArtifact = {
262
264
  },
263
265
  '4261968856572588300': { error_kind: 'string', string: 'Value does not fit in field' },
264
266
  '4440399188109668273': { error_kind: 'string', string: 'Input length must be a multiple of 32' },
267
+ '5417577161503694006': { error_kind: 'fmtstring', length: 56, item_types: [{ kind: 'field' }] },
265
268
  '9791669845391776238': {
266
269
  error_kind: 'string',
267
270
  string: '0 has a square root; you cannot claim it is not square',
@@ -298,6 +301,7 @@ const AuthRegistryContractArtifact: ContractArtifact = {
298
301
  length: 133,
299
302
  item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
300
303
  },
304
+ '17655676068928457687': { error_kind: 'string', string: 'Reader did not read all data' },
301
305
  },
302
306
  },
303
307
  bytecode: Buffer.from([]),