@aztec/stdlib 3.0.0-nightly.20250923 → 3.0.0-nightly.20250925
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/interfaces/pxe.d.ts +7 -183
- package/dest/interfaces/pxe.d.ts.map +1 -1
- package/dest/interfaces/pxe.js +2 -59
- package/package.json +8 -8
- package/src/interfaces/pxe.ts +10 -87
package/dest/interfaces/pxe.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import type { ApiSchemaFor, ZodFor } from '@aztec/foundation/schemas';
|
|
3
2
|
import { z } from 'zod';
|
|
4
3
|
import { type AbiType, type ContractArtifact } from '../abi/abi.js';
|
|
5
4
|
import type { EventSelector } from '../abi/event_selector.js';
|
|
@@ -7,8 +6,8 @@ import { AuthWitness } from '../auth_witness/auth_witness.js';
|
|
|
7
6
|
import type { AztecAddress } from '../aztec-address/index.js';
|
|
8
7
|
import { CompleteAddress, type ContractClassWithId, type ContractInstanceWithAddress, type PartialAddress, type ProtocolContractAddresses } from '../contract/index.js';
|
|
9
8
|
import { UniqueNote } from '../note/extended_note.js';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import type { NotesFilter } from '../note/notes_filter.js';
|
|
10
|
+
import { SimulationOverrides, TxExecutionRequest, TxSimulationResult } from '../tx/index.js';
|
|
12
11
|
import { TxProfileResult, UtilitySimulationResult } from '../tx/profiling.js';
|
|
13
12
|
import { TxProvingResult } from '../tx/proven_tx.js';
|
|
14
13
|
/**
|
|
@@ -91,13 +90,11 @@ export interface PXE {
|
|
|
91
90
|
* (where validators prove the public portion).
|
|
92
91
|
*
|
|
93
92
|
* @param txRequest - An authenticated tx request ready for proving
|
|
94
|
-
* @param privateExecutionResult - (optional) The result of the private execution of the transaction. The txRequest
|
|
95
|
-
* will be executed if not provided
|
|
96
93
|
* @returns A result containing the proof and public inputs of the tail circuit.
|
|
97
94
|
* @throws If contract code not found, or public simulation reverts.
|
|
98
95
|
* Also throws if simulatePublic is true and public simulation reverts.
|
|
99
96
|
*/
|
|
100
|
-
proveTx(txRequest: TxExecutionRequest
|
|
97
|
+
proveTx(txRequest: TxExecutionRequest): Promise<TxProvingResult>;
|
|
101
98
|
/**
|
|
102
99
|
* Simulates a transaction based on the provided preauthenticated execution request.
|
|
103
100
|
* This will run a local simulation of private execution (and optionally of public as well), run the
|
|
@@ -190,6 +187,10 @@ export interface PXE {
|
|
|
190
187
|
* @returns - The deserialized events.
|
|
191
188
|
*/
|
|
192
189
|
getPrivateEvents<T>(contractAddress: AztecAddress, eventMetadata: EventMetadataDefinition, from: number, numBlocks: number, recipients: AztecAddress[]): Promise<T[]>;
|
|
190
|
+
/**
|
|
191
|
+
* Stops the PXE's job queue.
|
|
192
|
+
*/
|
|
193
|
+
stop(): Promise<void>;
|
|
193
194
|
}
|
|
194
195
|
export type EventMetadataDefinition = {
|
|
195
196
|
eventSelector: EventSelector;
|
|
@@ -231,181 +232,4 @@ export interface ContractClassMetadata {
|
|
|
231
232
|
isContractClassPubliclyRegistered: boolean;
|
|
232
233
|
artifact?: ContractArtifact | undefined;
|
|
233
234
|
}
|
|
234
|
-
export declare const ContractMetadataSchema: z.ZodObject<{
|
|
235
|
-
contractInstance: z.ZodUnion<[z.ZodIntersection<z.ZodObject<{
|
|
236
|
-
version: z.ZodLiteral<1>;
|
|
237
|
-
salt: ZodFor<Fr>;
|
|
238
|
-
deployer: ZodFor<AztecAddress>;
|
|
239
|
-
currentContractClassId: ZodFor<Fr>;
|
|
240
|
-
originalContractClassId: ZodFor<Fr>;
|
|
241
|
-
initializationHash: ZodFor<Fr>;
|
|
242
|
-
publicKeys: z.ZodEffects<z.ZodObject<{
|
|
243
|
-
masterNullifierPublicKey: z.ZodType<import("@aztec/foundation/fields").Point, any, string>;
|
|
244
|
-
masterIncomingViewingPublicKey: z.ZodType<import("@aztec/foundation/fields").Point, any, string>;
|
|
245
|
-
masterOutgoingViewingPublicKey: z.ZodType<import("@aztec/foundation/fields").Point, any, string>;
|
|
246
|
-
masterTaggingPublicKey: z.ZodType<import("@aztec/foundation/fields").Point, any, string>;
|
|
247
|
-
}, "strip", z.ZodTypeAny, {
|
|
248
|
-
masterNullifierPublicKey: import("@aztec/foundation/fields").Point;
|
|
249
|
-
masterIncomingViewingPublicKey: import("@aztec/foundation/fields").Point;
|
|
250
|
-
masterOutgoingViewingPublicKey: import("@aztec/foundation/fields").Point;
|
|
251
|
-
masterTaggingPublicKey: import("@aztec/foundation/fields").Point;
|
|
252
|
-
}, {
|
|
253
|
-
masterNullifierPublicKey: string;
|
|
254
|
-
masterIncomingViewingPublicKey: string;
|
|
255
|
-
masterOutgoingViewingPublicKey: string;
|
|
256
|
-
masterTaggingPublicKey: string;
|
|
257
|
-
}>, import("../keys/public_keys.js").PublicKeys, {
|
|
258
|
-
masterNullifierPublicKey: string;
|
|
259
|
-
masterIncomingViewingPublicKey: string;
|
|
260
|
-
masterOutgoingViewingPublicKey: string;
|
|
261
|
-
masterTaggingPublicKey: string;
|
|
262
|
-
}>;
|
|
263
|
-
}, "strip", z.ZodTypeAny, {
|
|
264
|
-
version: 1;
|
|
265
|
-
salt: Fr;
|
|
266
|
-
publicKeys: import("../keys/public_keys.js").PublicKeys;
|
|
267
|
-
deployer: AztecAddress;
|
|
268
|
-
currentContractClassId: Fr;
|
|
269
|
-
originalContractClassId: Fr;
|
|
270
|
-
initializationHash: Fr;
|
|
271
|
-
}, {
|
|
272
|
-
version: 1;
|
|
273
|
-
publicKeys: {
|
|
274
|
-
masterNullifierPublicKey: string;
|
|
275
|
-
masterIncomingViewingPublicKey: string;
|
|
276
|
-
masterOutgoingViewingPublicKey: string;
|
|
277
|
-
masterTaggingPublicKey: string;
|
|
278
|
-
};
|
|
279
|
-
salt?: any;
|
|
280
|
-
deployer?: any;
|
|
281
|
-
currentContractClassId?: any;
|
|
282
|
-
originalContractClassId?: any;
|
|
283
|
-
initializationHash?: any;
|
|
284
|
-
}>, z.ZodObject<{
|
|
285
|
-
address: ZodFor<AztecAddress>;
|
|
286
|
-
}, "strip", z.ZodTypeAny, {
|
|
287
|
-
address: AztecAddress;
|
|
288
|
-
}, {
|
|
289
|
-
address?: any;
|
|
290
|
-
}>>, z.ZodUndefined]>;
|
|
291
|
-
isContractInitialized: z.ZodBoolean;
|
|
292
|
-
isContractPublished: z.ZodBoolean;
|
|
293
|
-
}, "strip", z.ZodTypeAny, {
|
|
294
|
-
isContractInitialized: boolean;
|
|
295
|
-
isContractPublished: boolean;
|
|
296
|
-
contractInstance?: ({
|
|
297
|
-
version: 1;
|
|
298
|
-
salt: Fr;
|
|
299
|
-
publicKeys: import("../keys/public_keys.js").PublicKeys;
|
|
300
|
-
deployer: AztecAddress;
|
|
301
|
-
currentContractClassId: Fr;
|
|
302
|
-
originalContractClassId: Fr;
|
|
303
|
-
initializationHash: Fr;
|
|
304
|
-
} & {
|
|
305
|
-
address: AztecAddress;
|
|
306
|
-
}) | undefined;
|
|
307
|
-
}, {
|
|
308
|
-
isContractInitialized: boolean;
|
|
309
|
-
isContractPublished: boolean;
|
|
310
|
-
contractInstance?: ({
|
|
311
|
-
version: 1;
|
|
312
|
-
publicKeys: {
|
|
313
|
-
masterNullifierPublicKey: string;
|
|
314
|
-
masterIncomingViewingPublicKey: string;
|
|
315
|
-
masterOutgoingViewingPublicKey: string;
|
|
316
|
-
masterTaggingPublicKey: string;
|
|
317
|
-
};
|
|
318
|
-
salt?: any;
|
|
319
|
-
deployer?: any;
|
|
320
|
-
currentContractClassId?: any;
|
|
321
|
-
originalContractClassId?: any;
|
|
322
|
-
initializationHash?: any;
|
|
323
|
-
} & {
|
|
324
|
-
address?: any;
|
|
325
|
-
}) | undefined;
|
|
326
|
-
}>;
|
|
327
|
-
export declare const ContractClassMetadataSchema: z.ZodObject<{
|
|
328
|
-
contractClass: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
|
|
329
|
-
version: z.ZodLiteral<1>;
|
|
330
|
-
artifactHash: z.ZodType<Fr, any, string>;
|
|
331
|
-
privateFunctions: z.ZodArray<z.ZodObject<{
|
|
332
|
-
selector: ZodFor<import("../abi/function_selector.js").FunctionSelector>;
|
|
333
|
-
vkHash: z.ZodType<Fr, any, string>;
|
|
334
|
-
}, "strip", z.ZodTypeAny, {
|
|
335
|
-
selector: import("../abi/function_selector.js").FunctionSelector;
|
|
336
|
-
vkHash: Fr;
|
|
337
|
-
}, {
|
|
338
|
-
vkHash: string;
|
|
339
|
-
selector?: any;
|
|
340
|
-
}>, "many">;
|
|
341
|
-
packedBytecode: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Buffer<ArrayBuffer>, string>, z.ZodEffects<z.ZodObject<{
|
|
342
|
-
type: z.ZodLiteral<"Buffer">;
|
|
343
|
-
data: z.ZodArray<z.ZodNumber, "many">;
|
|
344
|
-
}, "strip", z.ZodTypeAny, {
|
|
345
|
-
type: "Buffer";
|
|
346
|
-
data: number[];
|
|
347
|
-
}, {
|
|
348
|
-
type: "Buffer";
|
|
349
|
-
data: number[];
|
|
350
|
-
}>, Buffer<ArrayBuffer>, {
|
|
351
|
-
type: "Buffer";
|
|
352
|
-
data: number[];
|
|
353
|
-
}>]>;
|
|
354
|
-
}, {
|
|
355
|
-
id: z.ZodType<Fr, any, string>;
|
|
356
|
-
}>, "strip", z.ZodTypeAny, {
|
|
357
|
-
version: 1;
|
|
358
|
-
id: Fr;
|
|
359
|
-
artifactHash: Fr;
|
|
360
|
-
packedBytecode: Buffer<ArrayBuffer>;
|
|
361
|
-
privateFunctions: {
|
|
362
|
-
selector: import("../abi/function_selector.js").FunctionSelector;
|
|
363
|
-
vkHash: Fr;
|
|
364
|
-
}[];
|
|
365
|
-
}, {
|
|
366
|
-
version: 1;
|
|
367
|
-
id: string;
|
|
368
|
-
artifactHash: string;
|
|
369
|
-
packedBytecode: string | {
|
|
370
|
-
type: "Buffer";
|
|
371
|
-
data: number[];
|
|
372
|
-
};
|
|
373
|
-
privateFunctions: {
|
|
374
|
-
vkHash: string;
|
|
375
|
-
selector?: any;
|
|
376
|
-
}[];
|
|
377
|
-
}>, z.ZodUndefined]>;
|
|
378
|
-
isContractClassPubliclyRegistered: z.ZodBoolean;
|
|
379
|
-
artifact: z.ZodUnion<[ZodFor<ContractArtifact>, z.ZodUndefined]>;
|
|
380
|
-
}, "strip", z.ZodTypeAny, {
|
|
381
|
-
isContractClassPubliclyRegistered: boolean;
|
|
382
|
-
artifact?: ContractArtifact | undefined;
|
|
383
|
-
contractClass?: {
|
|
384
|
-
version: 1;
|
|
385
|
-
id: Fr;
|
|
386
|
-
artifactHash: Fr;
|
|
387
|
-
packedBytecode: Buffer<ArrayBuffer>;
|
|
388
|
-
privateFunctions: {
|
|
389
|
-
selector: import("../abi/function_selector.js").FunctionSelector;
|
|
390
|
-
vkHash: Fr;
|
|
391
|
-
}[];
|
|
392
|
-
} | undefined;
|
|
393
|
-
}, {
|
|
394
|
-
isContractClassPubliclyRegistered: boolean;
|
|
395
|
-
artifact?: any;
|
|
396
|
-
contractClass?: {
|
|
397
|
-
version: 1;
|
|
398
|
-
id: string;
|
|
399
|
-
artifactHash: string;
|
|
400
|
-
packedBytecode: string | {
|
|
401
|
-
type: "Buffer";
|
|
402
|
-
data: number[];
|
|
403
|
-
};
|
|
404
|
-
privateFunctions: {
|
|
405
|
-
vkHash: string;
|
|
406
|
-
selector?: any;
|
|
407
|
-
}[];
|
|
408
|
-
} | undefined;
|
|
409
|
-
}>;
|
|
410
|
-
export declare const PXESchema: ApiSchemaFor<PXE>;
|
|
411
235
|
//# sourceMappingURL=pxe.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pxe.d.ts","sourceRoot":"","sources":["../../src/interfaces/pxe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"pxe.d.ts","sourceRoot":"","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C/B,gBAAgB,CAAC,EAAE,2BAA2B,GAAG,SAAS,CAAC;IAC3D,qBAAqB,EAAE,OAAO,CAAC;IAC/B,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAChD,iCAAiC,EAAE,OAAO,CAAC;IAC3C,QAAQ,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;CACzC"}
|
package/dest/interfaces/pxe.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { AbiTypeSchema
|
|
3
|
-
import {
|
|
4
|
-
import { CompleteAddress, ContractClassWithIdSchema, ContractInstanceWithAddressSchema, ProtocolContractAddressesSchema } from '../contract/index.js';
|
|
5
|
-
import { UniqueNote } from '../note/extended_note.js';
|
|
6
|
-
import { NotesFilterSchema } from '../note/notes_filter.js';
|
|
7
|
-
import { AbiDecodedSchema, optional, schemas } from '../schemas/schemas.js';
|
|
8
|
-
import { PrivateExecutionResult, SimulationOverrides, TxExecutionRequest, TxSimulationResult } from '../tx/index.js';
|
|
9
|
-
import { TxProfileResult, UtilitySimulationResult } from '../tx/profiling.js';
|
|
10
|
-
import { TxProvingResult } from '../tx/proven_tx.js';
|
|
2
|
+
import { AbiTypeSchema } from '../abi/abi.js';
|
|
3
|
+
import { schemas } from '../schemas/schemas.js';
|
|
11
4
|
export const EventMetadataDefinitionSchema = z.object({
|
|
12
5
|
eventSelector: schemas.EventSelector,
|
|
13
6
|
abiType: AbiTypeSchema,
|
|
@@ -18,53 +11,3 @@ export const EventMetadataDefinitionSchema = z.object({
|
|
|
18
11
|
EventType["Unencrypted"] = "Unencrypted";
|
|
19
12
|
return EventType;
|
|
20
13
|
}({});
|
|
21
|
-
export const ContractMetadataSchema = z.object({
|
|
22
|
-
contractInstance: z.union([
|
|
23
|
-
ContractInstanceWithAddressSchema,
|
|
24
|
-
z.undefined()
|
|
25
|
-
]),
|
|
26
|
-
isContractInitialized: z.boolean(),
|
|
27
|
-
isContractPublished: z.boolean()
|
|
28
|
-
});
|
|
29
|
-
export const ContractClassMetadataSchema = z.object({
|
|
30
|
-
contractClass: z.union([
|
|
31
|
-
ContractClassWithIdSchema,
|
|
32
|
-
z.undefined()
|
|
33
|
-
]),
|
|
34
|
-
isContractClassPubliclyRegistered: z.boolean(),
|
|
35
|
-
artifact: z.union([
|
|
36
|
-
ContractArtifactSchema,
|
|
37
|
-
z.undefined()
|
|
38
|
-
])
|
|
39
|
-
});
|
|
40
|
-
const PXEInfoSchema = z.object({
|
|
41
|
-
pxeVersion: z.string(),
|
|
42
|
-
protocolContractAddresses: ProtocolContractAddressesSchema
|
|
43
|
-
});
|
|
44
|
-
export const PXESchema = {
|
|
45
|
-
registerAccount: z.function().args(schemas.Fr, schemas.Fr).returns(CompleteAddress.schema),
|
|
46
|
-
getRegisteredAccounts: z.function().returns(z.array(CompleteAddress.schema)),
|
|
47
|
-
registerSender: z.function().args(schemas.AztecAddress).returns(schemas.AztecAddress),
|
|
48
|
-
getSenders: z.function().returns(z.array(schemas.AztecAddress)),
|
|
49
|
-
removeSender: z.function().args(schemas.AztecAddress).returns(z.void()),
|
|
50
|
-
registerContractClass: z.function().args(ContractArtifactSchema).returns(z.void()),
|
|
51
|
-
registerContract: z.function().args(z.object({
|
|
52
|
-
instance: ContractInstanceWithAddressSchema,
|
|
53
|
-
artifact: z.optional(ContractArtifactSchema)
|
|
54
|
-
})).returns(z.void()),
|
|
55
|
-
updateContract: z.function().args(schemas.AztecAddress, ContractArtifactSchema).returns(z.void()),
|
|
56
|
-
getContracts: z.function().returns(z.array(schemas.AztecAddress)),
|
|
57
|
-
proveTx: z.function().args(TxExecutionRequest.schema, optional(PrivateExecutionResult.schema)).returns(TxProvingResult.schema),
|
|
58
|
-
profileTx: z.function().args(TxExecutionRequest.schema, z.union([
|
|
59
|
-
z.literal('gates'),
|
|
60
|
-
z.literal('full'),
|
|
61
|
-
z.literal('execution-steps')
|
|
62
|
-
]), optional(z.boolean()), optional(schemas.AztecAddress)).returns(TxProfileResult.schema),
|
|
63
|
-
simulateTx: z.function().args(TxExecutionRequest.schema, z.boolean(), optional(z.boolean()), optional(z.boolean()), optional(SimulationOverrides.schema), optional(z.array(schemas.AztecAddress))).returns(TxSimulationResult.schema),
|
|
64
|
-
getNotes: z.function().args(NotesFilterSchema).returns(z.array(UniqueNote.schema)),
|
|
65
|
-
simulateUtility: z.function().args(z.string(), z.array(z.any()), schemas.AztecAddress, optional(z.array(AuthWitness.schema)), optional(schemas.AztecAddress), optional(z.array(schemas.AztecAddress))).returns(UtilitySimulationResult.schema),
|
|
66
|
-
getPXEInfo: z.function().returns(PXEInfoSchema),
|
|
67
|
-
getContractMetadata: z.function().args(schemas.AztecAddress).returns(ContractMetadataSchema),
|
|
68
|
-
getContractClassMetadata: z.function().args(schemas.Fr, optional(z.boolean())).returns(ContractClassMetadataSchema),
|
|
69
|
-
getPrivateEvents: z.function().args(schemas.AztecAddress, EventMetadataDefinitionSchema, z.number(), z.number(), z.array(schemas.AztecAddress)).returns(z.array(AbiDecodedSchema))
|
|
70
|
-
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/stdlib",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20250925",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"inherits": [
|
|
6
6
|
"../package.common.json",
|
|
@@ -69,13 +69,13 @@
|
|
|
69
69
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@aztec/bb.js": "3.0.0-nightly.
|
|
73
|
-
"@aztec/blob-lib": "3.0.0-nightly.
|
|
74
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
75
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
76
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
77
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
78
|
-
"@aztec/noir-noirc_abi": "3.0.0-nightly.
|
|
72
|
+
"@aztec/bb.js": "3.0.0-nightly.20250925",
|
|
73
|
+
"@aztec/blob-lib": "3.0.0-nightly.20250925",
|
|
74
|
+
"@aztec/constants": "3.0.0-nightly.20250925",
|
|
75
|
+
"@aztec/ethereum": "3.0.0-nightly.20250925",
|
|
76
|
+
"@aztec/foundation": "3.0.0-nightly.20250925",
|
|
77
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20250925",
|
|
78
|
+
"@aztec/noir-noirc_abi": "3.0.0-nightly.20250925",
|
|
79
79
|
"@google-cloud/storage": "^7.15.0",
|
|
80
80
|
"axios": "^1.9.0",
|
|
81
81
|
"json-stringify-deterministic": "1.0.12",
|
package/src/interfaces/pxe.ts
CHANGED
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import type { ApiSchemaFor, ZodFor } from '@aztec/foundation/schemas';
|
|
3
2
|
|
|
4
3
|
import { z } from 'zod';
|
|
5
4
|
|
|
6
|
-
import { type AbiType, AbiTypeSchema, type ContractArtifact
|
|
5
|
+
import { type AbiType, AbiTypeSchema, type ContractArtifact } from '../abi/abi.js';
|
|
7
6
|
import type { EventSelector } from '../abi/event_selector.js';
|
|
8
7
|
import { AuthWitness } from '../auth_witness/auth_witness.js';
|
|
9
8
|
import type { AztecAddress } from '../aztec-address/index.js';
|
|
10
9
|
import {
|
|
11
10
|
CompleteAddress,
|
|
12
11
|
type ContractClassWithId,
|
|
13
|
-
ContractClassWithIdSchema,
|
|
14
12
|
type ContractInstanceWithAddress,
|
|
15
|
-
ContractInstanceWithAddressSchema,
|
|
16
13
|
type PartialAddress,
|
|
17
14
|
type ProtocolContractAddresses,
|
|
18
|
-
ProtocolContractAddressesSchema,
|
|
19
15
|
} from '../contract/index.js';
|
|
20
16
|
import { UniqueNote } from '../note/extended_note.js';
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
17
|
+
import type { NotesFilter } from '../note/notes_filter.js';
|
|
18
|
+
import { schemas } from '../schemas/schemas.js';
|
|
19
|
+
import { SimulationOverrides, TxExecutionRequest, TxSimulationResult } from '../tx/index.js';
|
|
24
20
|
import { TxProfileResult, UtilitySimulationResult } from '../tx/profiling.js';
|
|
25
21
|
import { TxProvingResult } from '../tx/proven_tx.js';
|
|
26
22
|
|
|
@@ -111,13 +107,11 @@ export interface PXE {
|
|
|
111
107
|
* (where validators prove the public portion).
|
|
112
108
|
*
|
|
113
109
|
* @param txRequest - An authenticated tx request ready for proving
|
|
114
|
-
* @param privateExecutionResult - (optional) The result of the private execution of the transaction. The txRequest
|
|
115
|
-
* will be executed if not provided
|
|
116
110
|
* @returns A result containing the proof and public inputs of the tail circuit.
|
|
117
111
|
* @throws If contract code not found, or public simulation reverts.
|
|
118
112
|
* Also throws if simulatePublic is true and public simulation reverts.
|
|
119
113
|
*/
|
|
120
|
-
proveTx(txRequest: TxExecutionRequest
|
|
114
|
+
proveTx(txRequest: TxExecutionRequest): Promise<TxProvingResult>;
|
|
121
115
|
|
|
122
116
|
/**
|
|
123
117
|
* Simulates a transaction based on the provided preauthenticated execution request.
|
|
@@ -243,6 +237,11 @@ export interface PXE {
|
|
|
243
237
|
numBlocks: number,
|
|
244
238
|
recipients: AztecAddress[],
|
|
245
239
|
): Promise<T[]>;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Stops the PXE's job queue.
|
|
243
|
+
*/
|
|
244
|
+
stop(): Promise<void>;
|
|
246
245
|
}
|
|
247
246
|
// docs:end:pxe-interface
|
|
248
247
|
|
|
@@ -283,79 +282,3 @@ export interface ContractClassMetadata {
|
|
|
283
282
|
isContractClassPubliclyRegistered: boolean;
|
|
284
283
|
artifact?: ContractArtifact | undefined;
|
|
285
284
|
}
|
|
286
|
-
|
|
287
|
-
export const ContractMetadataSchema = z.object({
|
|
288
|
-
contractInstance: z.union([ContractInstanceWithAddressSchema, z.undefined()]),
|
|
289
|
-
isContractInitialized: z.boolean(),
|
|
290
|
-
isContractPublished: z.boolean(),
|
|
291
|
-
}) satisfies ZodFor<ContractMetadata>;
|
|
292
|
-
|
|
293
|
-
export const ContractClassMetadataSchema = z.object({
|
|
294
|
-
contractClass: z.union([ContractClassWithIdSchema, z.undefined()]),
|
|
295
|
-
isContractClassPubliclyRegistered: z.boolean(),
|
|
296
|
-
artifact: z.union([ContractArtifactSchema, z.undefined()]),
|
|
297
|
-
}) satisfies ZodFor<ContractClassMetadata>;
|
|
298
|
-
|
|
299
|
-
const PXEInfoSchema = z.object({
|
|
300
|
-
pxeVersion: z.string(),
|
|
301
|
-
protocolContractAddresses: ProtocolContractAddressesSchema,
|
|
302
|
-
}) satisfies ZodFor<PXEInfo>;
|
|
303
|
-
|
|
304
|
-
export const PXESchema: ApiSchemaFor<PXE> = {
|
|
305
|
-
registerAccount: z.function().args(schemas.Fr, schemas.Fr).returns(CompleteAddress.schema),
|
|
306
|
-
getRegisteredAccounts: z.function().returns(z.array(CompleteAddress.schema)),
|
|
307
|
-
registerSender: z.function().args(schemas.AztecAddress).returns(schemas.AztecAddress),
|
|
308
|
-
getSenders: z.function().returns(z.array(schemas.AztecAddress)),
|
|
309
|
-
removeSender: z.function().args(schemas.AztecAddress).returns(z.void()),
|
|
310
|
-
registerContractClass: z.function().args(ContractArtifactSchema).returns(z.void()),
|
|
311
|
-
registerContract: z
|
|
312
|
-
.function()
|
|
313
|
-
.args(z.object({ instance: ContractInstanceWithAddressSchema, artifact: z.optional(ContractArtifactSchema) }))
|
|
314
|
-
.returns(z.void()),
|
|
315
|
-
updateContract: z.function().args(schemas.AztecAddress, ContractArtifactSchema).returns(z.void()),
|
|
316
|
-
getContracts: z.function().returns(z.array(schemas.AztecAddress)),
|
|
317
|
-
proveTx: z
|
|
318
|
-
.function()
|
|
319
|
-
.args(TxExecutionRequest.schema, optional(PrivateExecutionResult.schema))
|
|
320
|
-
.returns(TxProvingResult.schema),
|
|
321
|
-
profileTx: z
|
|
322
|
-
.function()
|
|
323
|
-
.args(
|
|
324
|
-
TxExecutionRequest.schema,
|
|
325
|
-
z.union([z.literal('gates'), z.literal('full'), z.literal('execution-steps')]),
|
|
326
|
-
optional(z.boolean()),
|
|
327
|
-
optional(schemas.AztecAddress),
|
|
328
|
-
)
|
|
329
|
-
.returns(TxProfileResult.schema),
|
|
330
|
-
simulateTx: z
|
|
331
|
-
.function()
|
|
332
|
-
.args(
|
|
333
|
-
TxExecutionRequest.schema,
|
|
334
|
-
z.boolean(),
|
|
335
|
-
optional(z.boolean()),
|
|
336
|
-
optional(z.boolean()),
|
|
337
|
-
optional(SimulationOverrides.schema),
|
|
338
|
-
optional(z.array(schemas.AztecAddress)),
|
|
339
|
-
)
|
|
340
|
-
.returns(TxSimulationResult.schema),
|
|
341
|
-
getNotes: z.function().args(NotesFilterSchema).returns(z.array(UniqueNote.schema)),
|
|
342
|
-
|
|
343
|
-
simulateUtility: z
|
|
344
|
-
.function()
|
|
345
|
-
.args(
|
|
346
|
-
z.string(),
|
|
347
|
-
z.array(z.any()),
|
|
348
|
-
schemas.AztecAddress,
|
|
349
|
-
optional(z.array(AuthWitness.schema)),
|
|
350
|
-
optional(schemas.AztecAddress),
|
|
351
|
-
optional(z.array(schemas.AztecAddress)),
|
|
352
|
-
)
|
|
353
|
-
.returns(UtilitySimulationResult.schema),
|
|
354
|
-
getPXEInfo: z.function().returns(PXEInfoSchema),
|
|
355
|
-
getContractMetadata: z.function().args(schemas.AztecAddress).returns(ContractMetadataSchema),
|
|
356
|
-
getContractClassMetadata: z.function().args(schemas.Fr, optional(z.boolean())).returns(ContractClassMetadataSchema),
|
|
357
|
-
getPrivateEvents: z
|
|
358
|
-
.function()
|
|
359
|
-
.args(schemas.AztecAddress, EventMetadataDefinitionSchema, z.number(), z.number(), z.array(schemas.AztecAddress))
|
|
360
|
-
.returns(z.array(AbiDecodedSchema)),
|
|
361
|
-
};
|