@aztec/stdlib 0.80.0 → 0.82.0
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.
- package/dest/abi/abi.d.ts +5 -1
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +2 -1
- package/dest/abi/contract_artifact.d.ts.map +1 -1
- package/dest/abi/contract_artifact.js +11 -0
- package/dest/auth_witness/auth_witness.d.ts +21 -0
- package/dest/auth_witness/auth_witness.d.ts.map +1 -1
- package/dest/auth_witness/auth_witness.js +29 -0
- package/dest/avm/avm.d.ts +173 -405
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +34 -27
- package/dest/avm/avm_proving_request.d.ts +84 -186
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/avm/public_data_write.d.ts +1 -0
- package/dest/avm/public_data_write.d.ts.map +1 -1
- package/dest/avm/public_data_write.js +3 -0
- package/dest/block/body.d.ts +1 -0
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +3 -0
- package/dest/block/index.d.ts +1 -1
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +1 -1
- package/dest/block/l2_block.d.ts +2 -1
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +3 -0
- package/dest/block/l2_block_downloader/l2_block_stream.d.ts +3 -3
- package/dest/block/l2_block_downloader/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_downloader/l2_block_stream.js +2 -4
- package/dest/block/l2_block_source.d.ts +9 -0
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/published_l2_block.d.ts +89 -0
- package/dest/block/published_l2_block.d.ts.map +1 -0
- package/dest/block/published_l2_block.js +32 -0
- package/dest/contract/interfaces/contract_data_source.d.ts +3 -14
- package/dest/contract/interfaces/contract_data_source.d.ts.map +1 -1
- package/dest/database-version/version_manager.d.ts +5 -0
- package/dest/database-version/version_manager.d.ts.map +1 -1
- package/dest/database-version/version_manager.js +8 -1
- package/dest/interfaces/archiver.d.ts +1 -2
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +5 -6
- package/dest/interfaces/aztec-node-admin.d.ts +20 -0
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -0
- package/dest/interfaces/aztec-node-admin.js +16 -0
- package/dest/interfaces/aztec-node.d.ts +9 -39
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +6 -12
- package/dest/interfaces/client.d.ts +1 -0
- package/dest/interfaces/client.d.ts.map +1 -1
- package/dest/interfaces/client.js +1 -0
- package/dest/interfaces/private_kernel_prover.d.ts +2 -3
- package/dest/interfaces/private_kernel_prover.d.ts.map +1 -1
- package/dest/interfaces/prover-node.d.ts +1 -2
- package/dest/interfaces/prover-node.d.ts.map +1 -1
- package/dest/interfaces/prover-node.js +5 -4
- package/dest/interfaces/proving-job.d.ts +106 -208
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/pxe.d.ts +21 -39
- package/dest/interfaces/pxe.d.ts.map +1 -1
- package/dest/interfaces/pxe.js +10 -9
- package/dest/kernel/index.d.ts +1 -1
- package/dest/kernel/index.d.ts.map +1 -1
- package/dest/kernel/index.js +1 -1
- package/dest/kernel/private_kernel_prover_output.d.ts +49 -0
- package/dest/kernel/private_kernel_prover_output.d.ts.map +1 -0
- package/dest/kernel/private_kernel_prover_output.js +8 -0
- package/dest/kernel/private_kernel_simulated_output.d.ts +3 -7
- package/dest/kernel/private_kernel_simulated_output.d.ts.map +1 -1
- package/dest/logs/contract_class_log.d.ts +1 -0
- package/dest/logs/contract_class_log.d.ts.map +1 -1
- package/dest/logs/contract_class_log.js +3 -0
- package/dest/logs/l1_payload/index.d.ts +1 -1
- package/dest/logs/l1_payload/index.d.ts.map +1 -1
- package/dest/logs/l1_payload/index.js +1 -1
- package/dest/logs/log_with_tx_data.js +2 -2
- package/dest/logs/private_log.d.ts +2 -1
- package/dest/logs/private_log.d.ts.map +1 -1
- package/dest/logs/private_log.js +14 -3
- package/dest/logs/public_log.d.ts.map +1 -1
- package/dest/logs/public_log.js +4 -1
- package/dest/logs/tx_scoped_l2_log.d.ts +16 -28
- package/dest/logs/tx_scoped_l2_log.d.ts.map +1 -1
- package/dest/logs/tx_scoped_l2_log.js +28 -19
- package/dest/noir/index.d.ts +5 -1
- package/dest/noir/index.d.ts.map +1 -1
- package/dest/note/extended_note.d.ts +10 -21
- package/dest/note/extended_note.d.ts.map +1 -1
- package/dest/note/extended_note.js +19 -28
- package/dest/note/notes_filter.d.ts +2 -2
- package/dest/note/notes_filter.d.ts.map +1 -1
- package/dest/note/notes_filter.js +1 -1
- package/dest/p2p/consensus_payload.d.ts +3 -1
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +3 -0
- package/dest/proofs/client_ivc_proof.d.ts +1 -2
- package/dest/proofs/client_ivc_proof.d.ts.map +1 -1
- package/dest/proofs/client_ivc_proof.js +6 -9
- package/dest/proofs/proof.d.ts +0 -1
- package/dest/proofs/proof.d.ts.map +1 -1
- package/dest/proofs/proof.js +2 -7
- package/dest/rollup/block_root_rollup.d.ts +1 -1
- package/dest/rollup/tube_inputs.d.ts +7 -2
- package/dest/rollup/tube_inputs.d.ts.map +1 -1
- package/dest/rollup/tube_inputs.js +10 -4
- package/dest/tests/factories.d.ts +3 -2
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +14 -8
- package/dest/tests/mocks.d.ts +2 -2
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +4 -5
- package/dest/trees/nullifier_membership_witness.d.ts +11 -7
- package/dest/trees/nullifier_membership_witness.d.ts.map +1 -1
- package/dest/trees/nullifier_membership_witness.js +10 -0
- package/dest/trees/public_data_witness.d.ts +12 -12
- package/dest/trees/public_data_witness.d.ts.map +1 -1
- package/dest/trees/public_data_witness.js +13 -0
- package/dest/tx/capsule.d.ts +2 -0
- package/dest/tx/capsule.d.ts.map +1 -1
- package/dest/tx/capsule.js +2 -0
- package/dest/tx/index.d.ts +2 -0
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +2 -0
- package/dest/tx/private_execution_result.d.ts +4 -0
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +5 -0
- package/dest/tx/profiled_tx.d.ts +9 -0
- package/dest/tx/profiled_tx.d.ts.map +1 -0
- package/dest/tx/profiled_tx.js +27 -0
- package/dest/tx/proven_tx.d.ts +33 -0
- package/dest/tx/proven_tx.d.ts.map +1 -0
- package/dest/tx/proven_tx.js +35 -0
- package/dest/tx/simulated_tx.d.ts +8 -44
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/simulated_tx.js +17 -40
- package/dest/tx/tx_effect.d.ts +1 -0
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +4 -1
- package/dest/tx/tx_receipt.d.ts +1 -30
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +3 -13
- package/package.json +6 -7
- package/src/abi/abi.ts +7 -2
- package/src/abi/contract_artifact.ts +11 -0
- package/src/auth_witness/auth_witness.ts +29 -0
- package/src/avm/avm.ts +42 -39
- package/src/avm/public_data_write.ts +4 -0
- package/src/block/body.ts +6 -0
- package/src/block/index.ts +1 -1
- package/src/block/l2_block.ts +4 -0
- package/src/block/l2_block_downloader/l2_block_stream.ts +5 -7
- package/src/block/l2_block_source.ts +11 -0
- package/src/block/published_l2_block.ts +45 -0
- package/src/contract/interfaces/contract_data_source.ts +3 -16
- package/src/database-version/version_manager.ts +11 -1
- package/src/interfaces/archiver.ts +11 -14
- package/src/interfaces/aztec-node-admin.ts +39 -0
- package/src/interfaces/aztec-node.ts +13 -72
- package/src/interfaces/client.ts +1 -0
- package/src/interfaces/private_kernel_prover.ts +2 -3
- package/src/interfaces/prover-node.ts +2 -4
- package/src/interfaces/pxe.ts +34 -56
- package/src/kernel/index.ts +1 -1
- package/src/kernel/private_kernel_prover_output.ts +44 -0
- package/src/kernel/private_kernel_simulated_output.ts +4 -13
- package/src/logs/contract_class_log.ts +8 -0
- package/src/logs/l1_payload/index.ts +1 -1
- package/src/logs/log_with_tx_data.ts +2 -2
- package/src/logs/private_log.ts +13 -3
- package/src/logs/public_log.ts +11 -1
- package/src/logs/tx_scoped_l2_log.ts +28 -25
- package/src/noir/index.ts +6 -1
- package/src/note/extended_note.ts +17 -36
- package/src/note/notes_filter.ts +3 -3
- package/src/p2p/consensus_payload.ts +9 -0
- package/src/proofs/client_ivc_proof.ts +5 -15
- package/src/proofs/proof.ts +2 -8
- package/src/rollup/tube_inputs.ts +8 -4
- package/src/tests/factories.ts +15 -14
- package/src/tests/mocks.ts +4 -9
- package/src/trees/nullifier_membership_witness.ts +12 -0
- package/src/trees/public_data_witness.ts +15 -0
- package/src/tx/capsule.ts +2 -0
- package/src/tx/index.ts +2 -0
- package/src/tx/private_execution_result.ts +7 -0
- package/src/tx/profiled_tx.ts +27 -0
- package/src/tx/proven_tx.ts +58 -0
- package/src/tx/simulated_tx.ts +11 -63
- package/src/tx/tx_effect.ts +23 -1
- package/src/tx/tx_receipt.ts +0 -36
- package/dest/block/nullifier_with_block_source.d.ts +0 -6
- package/dest/block/nullifier_with_block_source.d.ts.map +0 -1
- package/dest/block/nullifier_with_block_source.js +0 -1
- package/dest/kernel/private_kernel_prover_profile_result.d.ts +0 -25
- package/dest/kernel/private_kernel_prover_profile_result.d.ts.map +0 -1
- package/dest/kernel/private_kernel_prover_profile_result.js +0 -7
- package/dest/logs/l1_payload/l1_note_payload.d.ts +0 -82
- package/dest/logs/l1_payload/l1_note_payload.d.ts.map +0 -1
- package/dest/logs/l1_payload/l1_note_payload.js +0 -129
- package/src/block/nullifier_with_block_source.ts +0 -7
- package/src/kernel/private_kernel_prover_profile_result.ts +0 -7
- package/src/logs/l1_payload/l1_note_payload.ts +0 -182
package/src/interfaces/pxe.ts
CHANGED
|
@@ -29,15 +29,9 @@ import { type LogFilter, LogFilterSchema } from '../logs/log_filter.js';
|
|
|
29
29
|
import { UniqueNote } from '../note/extended_note.js';
|
|
30
30
|
import { type NotesFilter, NotesFilterSchema } from '../note/notes_filter.js';
|
|
31
31
|
import { AbiDecodedSchema, optional, schemas } from '../schemas/schemas.js';
|
|
32
|
-
import {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
TxExecutionRequest,
|
|
36
|
-
TxHash,
|
|
37
|
-
TxProvingResult,
|
|
38
|
-
TxReceipt,
|
|
39
|
-
TxSimulationResult,
|
|
40
|
-
} from '../tx/index.js';
|
|
32
|
+
import { PrivateExecutionResult, Tx, TxExecutionRequest, TxHash, TxReceipt, TxSimulationResult } from '../tx/index.js';
|
|
33
|
+
import { TxProfileResult } from '../tx/profiled_tx.js';
|
|
34
|
+
import { TxProvingResult } from '../tx/proven_tx.js';
|
|
41
35
|
import { TxEffect } from '../tx/tx_effect.js';
|
|
42
36
|
import {
|
|
43
37
|
type GetContractClassLogsResponse,
|
|
@@ -61,38 +55,6 @@ export interface PXE {
|
|
|
61
55
|
*/
|
|
62
56
|
isL1ToL2MessageSynced(l1ToL2Message: Fr): Promise<boolean>;
|
|
63
57
|
|
|
64
|
-
/**
|
|
65
|
-
* Insert an auth witness for a given message hash. Auth witnesses are used to authorize actions on
|
|
66
|
-
* behalf of a user. For instance, a token transfer initiated by a different address may request
|
|
67
|
-
* authorization from the user to move their tokens. This authorization is granted by the user
|
|
68
|
-
* account contract by verifying an auth witness requested to the execution oracle. Witnesses are
|
|
69
|
-
* usually a signature over a hash of the action to be authorized, but their actual contents depend
|
|
70
|
-
* on the account contract that consumes them.
|
|
71
|
-
*
|
|
72
|
-
* @param authWitness - The auth witness to insert. Composed of an identifier, which is the hash of
|
|
73
|
-
* the action to be authorized, and the actual witness as an array of fields, which are to be
|
|
74
|
-
* deserialized and processed by the account contract.
|
|
75
|
-
*/
|
|
76
|
-
addAuthWitness(authWitness: AuthWitness): Promise<void>;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Fetches the serialized auth witness for a given message hash or returns undefined if not found.
|
|
80
|
-
* @param messageHash - The hash of the message for which to get the auth witness.
|
|
81
|
-
* @returns The serialized auth witness for the given message hash.
|
|
82
|
-
*/
|
|
83
|
-
getAuthWitness(messageHash: Fr): Promise<Fr[] | undefined>;
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Adds a capsule.
|
|
87
|
-
* @param contract - The address of the contract to add the capsule to.
|
|
88
|
-
* @param storageSlot - The storage slot to add the capsule to.
|
|
89
|
-
* @param capsule - An array of field elements representing the capsule.
|
|
90
|
-
* @remarks A capsule is a "blob" of data that is passed to the contract through an oracle. It works similarly
|
|
91
|
-
* to public contract storage in that it's indexed by the contract address and storage slot but instead of the global
|
|
92
|
-
* network state it's backed by local PXE db.
|
|
93
|
-
*/
|
|
94
|
-
storeCapsule(contract: AztecAddress, storageSlot: Fr, capsule: Fr[]): Promise<void>;
|
|
95
|
-
|
|
96
58
|
/**
|
|
97
59
|
* Registers a user account in PXE given its master encryption private key.
|
|
98
60
|
* Once a new account is registered, the PXE Service will trial-decrypt all published notes on
|
|
@@ -166,14 +128,13 @@ export interface PXE {
|
|
|
166
128
|
getContracts(): Promise<AztecAddress[]>;
|
|
167
129
|
|
|
168
130
|
/**
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* It returns an object that contains the proof and public inputs of the tail circuit, which can be converted into a Tx ready to be sent to the network
|
|
131
|
+
* Proves the private portion of a simulated transaction, ready to send to the network
|
|
132
|
+
* (where valiators prove the public portion).
|
|
172
133
|
*
|
|
173
134
|
* @param txRequest - An authenticated tx request ready for proving
|
|
174
135
|
* @param privateExecutionResult - The result of the private execution of the transaction
|
|
175
|
-
* @returns A
|
|
176
|
-
* @throws If
|
|
136
|
+
* @returns A result containing the proof and public inputs of the tail circuit.
|
|
137
|
+
* @throws If contract code not found, or public simulation reverts.
|
|
177
138
|
* Also throws if simulatePublic is true and public simulation reverts.
|
|
178
139
|
*/
|
|
179
140
|
proveTx(txRequest: TxExecutionRequest, privateExecutionResult: PrivateExecutionResult): Promise<TxProvingResult>;
|
|
@@ -193,10 +154,10 @@ export interface PXE {
|
|
|
193
154
|
* @param simulatePublic - Whether to simulate the public part of the transaction.
|
|
194
155
|
* @param msgSender - (Optional) The message sender to use for the simulation.
|
|
195
156
|
* @param skipTxValidation - (Optional) If false, this function throws if the transaction is unable to be included in a block at the current state.
|
|
196
|
-
* @param
|
|
157
|
+
* @param skipFeeEnforcement - (Optional) If false, fees are enforced.
|
|
197
158
|
* @param scopes - (Optional) The accounts whose notes we can access in this call. Currently optional and will default to all.
|
|
198
159
|
* @returns A simulated transaction result object that includes public and private return values.
|
|
199
|
-
* @throws If the code for the functions executed in this transaction
|
|
160
|
+
* @throws If the code for the functions executed in this transaction have not been made available via `addContracts`.
|
|
200
161
|
* Also throws if simulatePublic is true and public simulation reverts.
|
|
201
162
|
*/
|
|
202
163
|
simulateTx(
|
|
@@ -205,10 +166,24 @@ export interface PXE {
|
|
|
205
166
|
msgSender?: AztecAddress,
|
|
206
167
|
skipTxValidation?: boolean,
|
|
207
168
|
skipFeeEnforcement?: boolean,
|
|
208
|
-
profile?: boolean,
|
|
209
169
|
scopes?: AztecAddress[],
|
|
210
170
|
): Promise<TxSimulationResult>;
|
|
211
171
|
|
|
172
|
+
/**
|
|
173
|
+
* Profiles a transaction, reporting gate counts (unless disabled) and returns an execution trace.
|
|
174
|
+
*
|
|
175
|
+
* @param txRequest - An authenticated tx request ready for simulation
|
|
176
|
+
* @param msgSender - (Optional) The message sender to use for the simulation.
|
|
177
|
+
* @param skipTxValidation - (Optional) If false, this function throws if the transaction is unable to be included in a block at the current state.
|
|
178
|
+
* @returns A trace of the program execution with gate counts.
|
|
179
|
+
* @throws If the code for the functions executed in this transaction have not been made available via `addContracts`.
|
|
180
|
+
*/
|
|
181
|
+
profileTx(
|
|
182
|
+
txRequest: TxExecutionRequest,
|
|
183
|
+
profileMode: 'gates' | 'execution-steps' | 'full',
|
|
184
|
+
msgSender?: AztecAddress,
|
|
185
|
+
): Promise<TxProfileResult>;
|
|
186
|
+
|
|
212
187
|
/**
|
|
213
188
|
* Sends a transaction to an Aztec node to be broadcasted to the network and mined.
|
|
214
189
|
* @param tx - The transaction as created via `proveTx`.
|
|
@@ -305,6 +280,7 @@ export interface PXE {
|
|
|
305
280
|
functionName: string,
|
|
306
281
|
args: any[],
|
|
307
282
|
to: AztecAddress,
|
|
283
|
+
authwits?: AuthWitness[],
|
|
308
284
|
from?: AztecAddress,
|
|
309
285
|
scopes?: AztecAddress[],
|
|
310
286
|
): Promise<AbiDecoded>;
|
|
@@ -454,12 +430,6 @@ const PXEInfoSchema = z.object({
|
|
|
454
430
|
|
|
455
431
|
export const PXESchema: ApiSchemaFor<PXE> = {
|
|
456
432
|
isL1ToL2MessageSynced: z.function().args(schemas.Fr).returns(z.boolean()),
|
|
457
|
-
addAuthWitness: z.function().args(AuthWitness.schema).returns(z.void()),
|
|
458
|
-
getAuthWitness: z
|
|
459
|
-
.function()
|
|
460
|
-
.args(schemas.Fr)
|
|
461
|
-
.returns(z.union([z.undefined(), z.array(schemas.Fr)])),
|
|
462
|
-
storeCapsule: z.function().args(schemas.AztecAddress, schemas.Fr, z.array(schemas.Fr)).returns(z.void()),
|
|
463
433
|
registerAccount: z.function().args(schemas.Fr, schemas.Fr).returns(CompleteAddress.schema),
|
|
464
434
|
getRegisteredAccounts: z.function().returns(z.array(CompleteAddress.schema)),
|
|
465
435
|
registerSender: z.function().args(schemas.AztecAddress).returns(schemas.AztecAddress),
|
|
@@ -473,6 +443,14 @@ export const PXESchema: ApiSchemaFor<PXE> = {
|
|
|
473
443
|
updateContract: z.function().args(schemas.AztecAddress, ContractArtifactSchema).returns(z.void()),
|
|
474
444
|
getContracts: z.function().returns(z.array(schemas.AztecAddress)),
|
|
475
445
|
proveTx: z.function().args(TxExecutionRequest.schema, PrivateExecutionResult.schema).returns(TxProvingResult.schema),
|
|
446
|
+
profileTx: z
|
|
447
|
+
.function()
|
|
448
|
+
.args(
|
|
449
|
+
TxExecutionRequest.schema,
|
|
450
|
+
z.union([z.literal('gates'), z.literal('full'), z.literal('execution-steps')]),
|
|
451
|
+
optional(schemas.AztecAddress),
|
|
452
|
+
)
|
|
453
|
+
.returns(TxProfileResult.schema),
|
|
476
454
|
simulateTx: z
|
|
477
455
|
.function()
|
|
478
456
|
.args(
|
|
@@ -481,7 +459,6 @@ export const PXESchema: ApiSchemaFor<PXE> = {
|
|
|
481
459
|
optional(schemas.AztecAddress),
|
|
482
460
|
optional(z.boolean()),
|
|
483
461
|
optional(z.boolean()),
|
|
484
|
-
optional(z.boolean()),
|
|
485
462
|
optional(z.array(schemas.AztecAddress)),
|
|
486
463
|
)
|
|
487
464
|
.returns(TxSimulationResult.schema),
|
|
@@ -513,6 +490,7 @@ export const PXESchema: ApiSchemaFor<PXE> = {
|
|
|
513
490
|
z.string(),
|
|
514
491
|
z.array(z.any()),
|
|
515
492
|
schemas.AztecAddress,
|
|
493
|
+
optional(z.array(AuthWitness.schema)),
|
|
516
494
|
optional(schemas.AztecAddress),
|
|
517
495
|
optional(z.array(schemas.AztecAddress)),
|
|
518
496
|
)
|
package/src/kernel/index.ts
CHANGED
|
@@ -26,5 +26,5 @@ export * from './note_hash.js';
|
|
|
26
26
|
export * from './private_log_data.js';
|
|
27
27
|
export * from './private_call_request.js';
|
|
28
28
|
export * from './private_validation_requests.js';
|
|
29
|
-
export * from './private_kernel_prover_profile_result.js';
|
|
30
29
|
export * from './private_kernel_simulated_output.js';
|
|
30
|
+
export * from './private_kernel_prover_output.js';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { bufferSchema, mapSchema } from '@aztec/foundation/schemas';
|
|
2
|
+
import type { WitnessMap } from '@aztec/noir-acvm_js';
|
|
3
|
+
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
|
|
6
|
+
import type { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
7
|
+
import type { VerificationKeyAsFields } from '../vks/verification_key.js';
|
|
8
|
+
import type { PrivateKernelCircuitPublicInputs } from './private_kernel_circuit_public_inputs.js';
|
|
9
|
+
import type { PrivateKernelTailCircuitPublicInputs } from './private_kernel_tail_circuit_public_inputs.js';
|
|
10
|
+
|
|
11
|
+
export const PrivateExecutionStepSchema = z.object({
|
|
12
|
+
functionName: z.string(),
|
|
13
|
+
gateCount: z.number().optional(),
|
|
14
|
+
bytecode: bufferSchema,
|
|
15
|
+
witness: mapSchema(z.number(), z.string()),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Represents either a simulated private kernel circuit or one of our application function circuits.
|
|
20
|
+
*/
|
|
21
|
+
export interface PrivateExecutionStep {
|
|
22
|
+
functionName: string;
|
|
23
|
+
gateCount?: number;
|
|
24
|
+
bytecode: Buffer;
|
|
25
|
+
witness: WitnessMap;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Represents the output of proven PrivateKernelSimulateOutput.*/
|
|
29
|
+
export interface PrivateKernelExecutionProofOutput<
|
|
30
|
+
PublicInputsType extends PrivateKernelCircuitPublicInputs | PrivateKernelTailCircuitPublicInputs,
|
|
31
|
+
> {
|
|
32
|
+
/** The public inputs used by the proof generation process. */
|
|
33
|
+
publicInputs: PublicInputsType;
|
|
34
|
+
/** The private IVC proof optimized for user devices. It will be consumed by an Aztec prover,
|
|
35
|
+
* which recursively verifies it through the "tube" circuit.*/
|
|
36
|
+
clientIvcProof: ClientIvcProof;
|
|
37
|
+
verificationKey: VerificationKeyAsFields;
|
|
38
|
+
/**
|
|
39
|
+
* The trace the clientIvcProof corresponds to.
|
|
40
|
+
* A trace of app circuits interleaved with private kernel circuits.
|
|
41
|
+
* If simulate is ran with profiling mode, also includes gate counts.
|
|
42
|
+
*/
|
|
43
|
+
executionSteps: PrivateExecutionStep[];
|
|
44
|
+
}
|
|
@@ -1,31 +1,22 @@
|
|
|
1
1
|
import type { WitnessMap } from '@aztec/noir-acvm_js';
|
|
2
2
|
|
|
3
|
-
import type { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
4
3
|
import type { VerificationKeyAsFields } from '../vks/verification_key.js';
|
|
5
4
|
import type { PrivateKernelCircuitPublicInputs } from './private_kernel_circuit_public_inputs.js';
|
|
6
|
-
import type { PrivateKernelProverProfileResult } from './private_kernel_prover_profile_result.js';
|
|
7
5
|
import type { PrivateKernelTailCircuitPublicInputs } from './private_kernel_tail_circuit_public_inputs.js';
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
8
|
* Represents the output of the proof creation process for init and inner private kernel circuit.
|
|
11
9
|
* Contains the public inputs required for the init and inner private kernel circuit and the generated proof.
|
|
12
10
|
*/
|
|
13
|
-
export
|
|
11
|
+
export interface PrivateKernelSimulateOutput<
|
|
14
12
|
PublicInputsType extends PrivateKernelCircuitPublicInputs | PrivateKernelTailCircuitPublicInputs,
|
|
15
|
-
>
|
|
13
|
+
> {
|
|
16
14
|
/** The public inputs required for the proof generation process. */
|
|
17
15
|
publicInputs: PublicInputsType;
|
|
18
|
-
|
|
19
|
-
clientIvcProof?: ClientIvcProof;
|
|
20
|
-
|
|
21
|
-
verificationKey: VerificationKeyAsFields;
|
|
22
|
-
|
|
23
16
|
outputWitness: WitnessMap;
|
|
24
|
-
|
|
17
|
+
verificationKey: VerificationKeyAsFields;
|
|
25
18
|
bytecode: Buffer;
|
|
26
|
-
|
|
27
|
-
profileResult?: PrivateKernelProverProfileResult;
|
|
28
|
-
};
|
|
19
|
+
}
|
|
29
20
|
|
|
30
21
|
/**
|
|
31
22
|
* Represents the output of the circuit simulation process for init and inner private kernel circuit.
|
|
@@ -28,6 +28,14 @@ export class ContractClassLog {
|
|
|
28
28
|
return [this.contractAddress.toField(), ...this.fields];
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
equals(other: ContractClassLog) {
|
|
32
|
+
return (
|
|
33
|
+
this.contractAddress.equals(other.contractAddress) &&
|
|
34
|
+
this.fields.length === other.fields.length &&
|
|
35
|
+
this.fields.every((f, i) => f.equals(other.fields[i]))
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
31
39
|
static fromFields(fields: Fr[] | FieldReader) {
|
|
32
40
|
const reader = FieldReader.asReader(fields);
|
|
33
41
|
// Below line gives error 'Type instantiation is excessively deep and possibly infinite. ts(2589)'
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './encrypted_log_payload.js';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './shared_secret_derivation.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MAX_NOTE_HASHES_PER_TX, PUBLIC_LOG_DATA_SIZE_IN_FIELDS } from '@aztec/constants';
|
|
2
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
3
|
|
|
4
|
-
// TypeScript representation of the Noir aztec::oracle::
|
|
5
|
-
// for PXE's custom getLogByTag oracle.
|
|
4
|
+
// TypeScript representation of the Noir aztec::oracle::message_discovery::LogWithTxData struct. This is used as a
|
|
5
|
+
// response for PXE's custom getLogByTag oracle.
|
|
6
6
|
export class LogWithTxData {
|
|
7
7
|
constructor(
|
|
8
8
|
public logContent: Fr[],
|
package/src/logs/private_log.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PRIVATE_LOG_SIZE_IN_FIELDS } from '@aztec/constants';
|
|
1
|
+
import { PRIVATE_LOG_SIZE_IN_FIELDS, PUBLIC_LOG_DATA_SIZE_IN_FIELDS } from '@aztec/constants';
|
|
2
2
|
import { makeTuple } from '@aztec/foundation/array';
|
|
3
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
4
|
import { schemas } from '@aztec/foundation/schemas';
|
|
@@ -38,8 +38,8 @@ export class PrivateLog {
|
|
|
38
38
|
return new PrivateLog(reader.readArray(PRIVATE_LOG_SIZE_IN_FIELDS, Fr));
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
static random() {
|
|
42
|
-
return
|
|
41
|
+
static random(tag = Fr.random()) {
|
|
42
|
+
return PrivateLog.fromFields([tag, ...Array.from({ length: PRIVATE_LOG_SIZE_IN_FIELDS - 1 }, () => Fr.random())]);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
getEmittedLength() {
|
|
@@ -54,6 +54,12 @@ export class PrivateLog {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
static get schema() {
|
|
57
|
+
if (PUBLIC_LOG_DATA_SIZE_IN_FIELDS + 1 == PRIVATE_LOG_SIZE_IN_FIELDS) {
|
|
58
|
+
throw new Error(
|
|
59
|
+
'Constants got updated and schema for PublicLog matches that of PrivateLog. This needs to be updated now as Zod is no longer able to differentiate the 2 in TxScopedL2Log.',
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
57
63
|
return z
|
|
58
64
|
.object({
|
|
59
65
|
fields: z.array(schemas.Fr),
|
|
@@ -61,6 +67,10 @@ export class PrivateLog {
|
|
|
61
67
|
.transform(({ fields }) => PrivateLog.fromFields(fields));
|
|
62
68
|
}
|
|
63
69
|
|
|
70
|
+
equals(other: PrivateLog) {
|
|
71
|
+
return this.fields.every((field, i) => field.equals(other.fields[i]));
|
|
72
|
+
}
|
|
73
|
+
|
|
64
74
|
[inspect.custom](): string {
|
|
65
75
|
return `PrivateLog {
|
|
66
76
|
fields: [${this.fields.map(x => inspect(x)).join(', ')}],
|
package/src/logs/public_log.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
PRIVATE_LOG_SIZE_IN_FIELDS,
|
|
3
|
+
PUBLIC_LOG_DATA_SIZE_IN_FIELDS,
|
|
4
|
+
PUBLIC_LOG_SIZE_IN_FIELDS,
|
|
5
|
+
} from '@aztec/constants';
|
|
2
6
|
import { type FieldsOf, makeTuple } from '@aztec/foundation/array';
|
|
3
7
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
8
|
import { type ZodFor, schemas } from '@aztec/foundation/schemas';
|
|
@@ -78,6 +82,12 @@ export class PublicLog {
|
|
|
78
82
|
}
|
|
79
83
|
|
|
80
84
|
static get schema(): ZodFor<PublicLog> {
|
|
85
|
+
if (PUBLIC_LOG_DATA_SIZE_IN_FIELDS + 1 == PRIVATE_LOG_SIZE_IN_FIELDS) {
|
|
86
|
+
throw new Error(
|
|
87
|
+
'Constants got updated and schema for PrivateLog matches that of PublicLog. This needs to be updated now as Zod is no longer able to differentiate the 2 in TxScopedL2Log.',
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
81
91
|
return z
|
|
82
92
|
.object({
|
|
83
93
|
contractAddress: AztecAddress.schema,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
1
|
import { BufferReader, boolToBuffer, numToUInt32BE } from '@aztec/foundation/serialize';
|
|
3
2
|
|
|
4
3
|
import { z } from 'zod';
|
|
5
4
|
|
|
6
|
-
import { schemas } from '../schemas/schemas.js';
|
|
7
5
|
import { TxHash } from '../tx/tx_hash.js';
|
|
6
|
+
import { PrivateLog } from './private_log.js';
|
|
7
|
+
import { PublicLog } from './public_log.js';
|
|
8
8
|
|
|
9
9
|
export class TxScopedL2Log {
|
|
10
10
|
constructor(
|
|
@@ -22,53 +22,55 @@ export class TxScopedL2Log {
|
|
|
22
22
|
*/
|
|
23
23
|
public blockNumber: number,
|
|
24
24
|
/*
|
|
25
|
-
*
|
|
25
|
+
* The log data as either a PrivateLog or PublicLog
|
|
26
26
|
*/
|
|
27
|
-
public
|
|
28
|
-
/*
|
|
29
|
-
* The log data
|
|
30
|
-
*/
|
|
31
|
-
public logData: Buffer,
|
|
27
|
+
public log: PrivateLog | PublicLog,
|
|
32
28
|
) {}
|
|
33
29
|
|
|
30
|
+
get isFromPublic() {
|
|
31
|
+
return this.log instanceof PublicLog;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
34
|
static get schema() {
|
|
35
35
|
return z
|
|
36
36
|
.object({
|
|
37
37
|
txHash: TxHash.schema,
|
|
38
38
|
dataStartIndexForTx: z.number(),
|
|
39
39
|
blockNumber: z.number(),
|
|
40
|
-
|
|
41
|
-
logData: schemas.Buffer,
|
|
40
|
+
log: z.union([PrivateLog.schema, PublicLog.schema]),
|
|
42
41
|
})
|
|
43
42
|
.transform(
|
|
44
|
-
({ txHash, dataStartIndexForTx, blockNumber,
|
|
45
|
-
new TxScopedL2Log(txHash, dataStartIndexForTx, blockNumber,
|
|
43
|
+
({ txHash, dataStartIndexForTx, blockNumber, log }) =>
|
|
44
|
+
new TxScopedL2Log(txHash, dataStartIndexForTx, blockNumber, log),
|
|
46
45
|
);
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
toBuffer() {
|
|
49
|
+
const isFromPublic = this.log instanceof PublicLog;
|
|
50
50
|
return Buffer.concat([
|
|
51
51
|
this.txHash.toBuffer(),
|
|
52
52
|
numToUInt32BE(this.dataStartIndexForTx),
|
|
53
53
|
numToUInt32BE(this.blockNumber),
|
|
54
|
-
boolToBuffer(
|
|
55
|
-
this.
|
|
54
|
+
boolToBuffer(isFromPublic),
|
|
55
|
+
this.log.toBuffer(),
|
|
56
56
|
]);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
static fromBuffer(buffer: Buffer) {
|
|
60
60
|
const reader = BufferReader.asReader(buffer);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
);
|
|
61
|
+
const txHash = reader.readObject(TxHash);
|
|
62
|
+
const dataStartIndexForTx = reader.readNumber();
|
|
63
|
+
const blockNumber = reader.readNumber();
|
|
64
|
+
const isFromPublic = reader.readBoolean();
|
|
65
|
+
const log = isFromPublic ? PublicLog.fromBuffer(reader) : PrivateLog.fromBuffer(reader);
|
|
66
|
+
|
|
67
|
+
return new TxScopedL2Log(txHash, dataStartIndexForTx, blockNumber, log);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
static random() {
|
|
71
|
-
|
|
70
|
+
static async random() {
|
|
71
|
+
const isFromPublic = Math.random() < 0.5;
|
|
72
|
+
const log = isFromPublic ? await PublicLog.random() : PrivateLog.random();
|
|
73
|
+
return new TxScopedL2Log(TxHash.random(), 1, 1, log);
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
equals(other: TxScopedL2Log) {
|
|
@@ -76,8 +78,9 @@ export class TxScopedL2Log {
|
|
|
76
78
|
this.txHash.equals(other.txHash) &&
|
|
77
79
|
this.dataStartIndexForTx === other.dataStartIndexForTx &&
|
|
78
80
|
this.blockNumber === other.blockNumber &&
|
|
79
|
-
this.
|
|
80
|
-
|
|
81
|
+
((this.log instanceof PublicLog && other.log instanceof PublicLog) ||
|
|
82
|
+
(this.log instanceof PrivateLog && other.log instanceof PrivateLog)) &&
|
|
83
|
+
this.log.equals(other.log as any)
|
|
81
84
|
);
|
|
82
85
|
}
|
|
83
86
|
}
|
package/src/noir/index.ts
CHANGED
|
@@ -75,7 +75,7 @@ export interface NoirCompiledContract {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
* The compilation result of
|
|
78
|
+
* The compilation result of a protocol (non-contract) circuit.
|
|
79
79
|
*/
|
|
80
80
|
export interface NoirCompiledCircuit {
|
|
81
81
|
/** The hash of the circuit. */
|
|
@@ -92,6 +92,11 @@ export interface NoirCompiledCircuit {
|
|
|
92
92
|
file_map: DebugFileMap;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
export interface NoirCompiledCircuitWithName extends NoirCompiledCircuit {
|
|
96
|
+
/** The name of the circuit. */
|
|
97
|
+
name: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
95
100
|
/**
|
|
96
101
|
* The debug metadata of an Aztec.nr contract.
|
|
97
102
|
*/
|
|
@@ -4,7 +4,6 @@ import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
|
4
4
|
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
|
|
7
|
-
import { NoteSelector } from '../abi/note_selector.js';
|
|
8
7
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
9
8
|
import { type ZodFor, schemas } from '../schemas/index.js';
|
|
10
9
|
import { TxHash } from '../tx/tx_hash.js';
|
|
@@ -17,54 +16,43 @@ export class ExtendedNote {
|
|
|
17
16
|
constructor(
|
|
18
17
|
/** The note as emitted from the Noir contract. */
|
|
19
18
|
public note: Note,
|
|
20
|
-
/** The
|
|
21
|
-
public
|
|
19
|
+
/** The address whose public key was used to encrypt the note. */
|
|
20
|
+
public recipient: AztecAddress,
|
|
22
21
|
/** The contract address this note is created in. */
|
|
23
22
|
public contractAddress: AztecAddress,
|
|
24
23
|
/** The specific storage location of the note on the contract. */
|
|
25
24
|
public storageSlot: Fr,
|
|
26
|
-
/** The type identifier of the note on the contract. */
|
|
27
|
-
public noteTypeId: NoteSelector,
|
|
28
25
|
/** The hash of the tx the note was created in. */
|
|
29
26
|
public txHash: TxHash,
|
|
30
27
|
) {}
|
|
31
28
|
|
|
32
29
|
toBuffer(): Buffer {
|
|
33
|
-
return serializeToBuffer([
|
|
34
|
-
this.note,
|
|
35
|
-
this.owner,
|
|
36
|
-
this.contractAddress,
|
|
37
|
-
this.storageSlot,
|
|
38
|
-
this.noteTypeId,
|
|
39
|
-
this.txHash,
|
|
40
|
-
]);
|
|
30
|
+
return serializeToBuffer([this.note, this.recipient, this.contractAddress, this.storageSlot, this.txHash]);
|
|
41
31
|
}
|
|
42
32
|
|
|
43
33
|
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
44
34
|
const reader = BufferReader.asReader(buffer);
|
|
45
35
|
|
|
46
36
|
const note = reader.readObject(Note);
|
|
47
|
-
const
|
|
37
|
+
const recipient = reader.readObject(AztecAddress);
|
|
48
38
|
const contractAddress = reader.readObject(AztecAddress);
|
|
49
39
|
const storageSlot = reader.readObject(Fr);
|
|
50
|
-
const noteTypeId = reader.readObject(NoteSelector);
|
|
51
40
|
const txHash = reader.readObject(TxHash);
|
|
52
41
|
|
|
53
|
-
return new this(note,
|
|
42
|
+
return new this(note, recipient, contractAddress, storageSlot, txHash);
|
|
54
43
|
}
|
|
55
44
|
|
|
56
45
|
static get schema(): ZodFor<ExtendedNote> {
|
|
57
46
|
return z
|
|
58
47
|
.object({
|
|
59
48
|
note: Note.schema,
|
|
60
|
-
|
|
49
|
+
recipient: schemas.AztecAddress,
|
|
61
50
|
contractAddress: schemas.AztecAddress,
|
|
62
51
|
storageSlot: schemas.Fr,
|
|
63
|
-
noteTypeId: schemas.NoteSelector,
|
|
64
52
|
txHash: TxHash.schema,
|
|
65
53
|
})
|
|
66
|
-
.transform(({ note,
|
|
67
|
-
return new ExtendedNote(note,
|
|
54
|
+
.transform(({ note, recipient, contractAddress, storageSlot, txHash }) => {
|
|
55
|
+
return new ExtendedNote(note, recipient, contractAddress, storageSlot, txHash);
|
|
68
56
|
});
|
|
69
57
|
}
|
|
70
58
|
|
|
@@ -82,7 +70,6 @@ export class ExtendedNote {
|
|
|
82
70
|
await AztecAddress.random(),
|
|
83
71
|
await AztecAddress.random(),
|
|
84
72
|
Fr.random(),
|
|
85
|
-
NoteSelector.random(),
|
|
86
73
|
TxHash.random(),
|
|
87
74
|
);
|
|
88
75
|
}
|
|
@@ -92,45 +79,41 @@ export class UniqueNote extends ExtendedNote {
|
|
|
92
79
|
constructor(
|
|
93
80
|
/** The note as emitted from the Noir contract. */
|
|
94
81
|
note: Note,
|
|
95
|
-
/** The
|
|
96
|
-
|
|
82
|
+
/** The recipient whose public key was used to encrypt the note. */
|
|
83
|
+
recipient: AztecAddress,
|
|
97
84
|
/** The contract address this note is created in. */
|
|
98
85
|
contractAddress: AztecAddress,
|
|
99
86
|
/** The specific storage location of the note on the contract. */
|
|
100
87
|
storageSlot: Fr,
|
|
101
|
-
/** The type identifier of the note on the contract. */
|
|
102
|
-
noteTypeId: NoteSelector,
|
|
103
88
|
/** The hash of the tx the note was created in. */
|
|
104
89
|
txHash: TxHash,
|
|
105
90
|
/** The nonce of the note. */
|
|
106
91
|
public nonce: Fr,
|
|
107
92
|
) {
|
|
108
|
-
super(note,
|
|
93
|
+
super(note, recipient, contractAddress, storageSlot, txHash);
|
|
109
94
|
}
|
|
110
95
|
|
|
111
96
|
static override get schema() {
|
|
112
97
|
return z
|
|
113
98
|
.object({
|
|
114
99
|
note: Note.schema,
|
|
115
|
-
|
|
100
|
+
recipient: schemas.AztecAddress,
|
|
116
101
|
contractAddress: schemas.AztecAddress,
|
|
117
102
|
storageSlot: schemas.Fr,
|
|
118
|
-
noteTypeId: schemas.NoteSelector,
|
|
119
103
|
txHash: TxHash.schema,
|
|
120
104
|
nonce: schemas.Fr,
|
|
121
105
|
})
|
|
122
|
-
.transform(({ note,
|
|
123
|
-
return new UniqueNote(note,
|
|
106
|
+
.transform(({ note, recipient, contractAddress, storageSlot, txHash, nonce }) => {
|
|
107
|
+
return new UniqueNote(note, recipient, contractAddress, storageSlot, txHash, nonce);
|
|
124
108
|
});
|
|
125
109
|
}
|
|
126
110
|
|
|
127
111
|
override toBuffer(): Buffer {
|
|
128
112
|
return serializeToBuffer([
|
|
129
113
|
this.note,
|
|
130
|
-
this.
|
|
114
|
+
this.recipient,
|
|
131
115
|
this.contractAddress,
|
|
132
116
|
this.storageSlot,
|
|
133
|
-
this.noteTypeId,
|
|
134
117
|
this.txHash,
|
|
135
118
|
this.nonce,
|
|
136
119
|
]);
|
|
@@ -142,7 +125,6 @@ export class UniqueNote extends ExtendedNote {
|
|
|
142
125
|
await AztecAddress.random(),
|
|
143
126
|
await AztecAddress.random(),
|
|
144
127
|
Fr.random(),
|
|
145
|
-
NoteSelector.random(),
|
|
146
128
|
TxHash.random(),
|
|
147
129
|
Fr.random(),
|
|
148
130
|
);
|
|
@@ -152,14 +134,13 @@ export class UniqueNote extends ExtendedNote {
|
|
|
152
134
|
const reader = BufferReader.asReader(buffer);
|
|
153
135
|
|
|
154
136
|
const note = reader.readObject(Note);
|
|
155
|
-
const
|
|
137
|
+
const recipient = reader.readObject(AztecAddress);
|
|
156
138
|
const contractAddress = reader.readObject(AztecAddress);
|
|
157
139
|
const storageSlot = reader.readObject(Fr);
|
|
158
|
-
const noteTypeId = reader.readObject(NoteSelector);
|
|
159
140
|
const txHash = reader.readObject(TxHash);
|
|
160
141
|
const nonce = reader.readObject(Fr);
|
|
161
142
|
|
|
162
|
-
return new this(note,
|
|
143
|
+
return new this(note, recipient, contractAddress, storageSlot, txHash, nonce);
|
|
163
144
|
}
|
|
164
145
|
|
|
165
146
|
static override fromString(str: string) {
|
package/src/note/notes_filter.ts
CHANGED
|
@@ -18,8 +18,8 @@ export type NotesFilter = {
|
|
|
18
18
|
contractAddress?: AztecAddress;
|
|
19
19
|
/** The specific storage location of the note on the contract. */
|
|
20
20
|
storageSlot?: Fr;
|
|
21
|
-
/** The
|
|
22
|
-
|
|
21
|
+
/** The recipient of the note (whose public key was used to encrypt the note). */
|
|
22
|
+
recipient?: AztecAddress;
|
|
23
23
|
/** The status of the note. Defaults to 'ACTIVE'. */
|
|
24
24
|
status?: NoteStatus;
|
|
25
25
|
/** The siloed nullifier for the note. */
|
|
@@ -32,7 +32,7 @@ export const NotesFilterSchema: ZodFor<NotesFilter> = z.object({
|
|
|
32
32
|
txHash: TxHash.schema.optional(),
|
|
33
33
|
contractAddress: schemas.AztecAddress.optional(),
|
|
34
34
|
storageSlot: schemas.Fr.optional(),
|
|
35
|
-
|
|
35
|
+
recipient: schemas.AztecAddress.optional(),
|
|
36
36
|
status: z.nativeEnum(NoteStatus).optional(),
|
|
37
37
|
siloedNullifier: schemas.Fr.optional(),
|
|
38
38
|
scopes: z.array(schemas.AztecAddress).optional(),
|