@aztec/stdlib 3.0.0-nightly.20251104 → 3.0.0-nightly.20251106

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 (48) hide show
  1. package/dest/avm/avm.d.ts +2202 -250
  2. package/dest/avm/avm.d.ts.map +1 -1
  3. package/dest/avm/avm.js +93 -14
  4. package/dest/avm/avm_accumulated_data.d.ts +7 -7
  5. package/dest/avm/avm_circuit_public_inputs.d.ts +27 -27
  6. package/dest/avm/avm_proving_request.d.ts +667 -118
  7. package/dest/avm/avm_proving_request.d.ts.map +1 -1
  8. package/dest/contract/contract_deployment_data.d.ts +111 -0
  9. package/dest/contract/contract_deployment_data.d.ts.map +1 -0
  10. package/dest/contract/contract_deployment_data.js +87 -0
  11. package/dest/contract/index.d.ts +1 -0
  12. package/dest/contract/index.d.ts.map +1 -1
  13. package/dest/contract/index.js +1 -0
  14. package/dest/contract/interfaces/contract_class.d.ts +16 -16
  15. package/dest/contract/private_function_membership_proof.d.ts +1 -1
  16. package/dest/contract/private_function_membership_proof.js +1 -1
  17. package/dest/hash/hash.d.ts +9 -1
  18. package/dest/hash/hash.d.ts.map +1 -1
  19. package/dest/hash/hash.js +11 -1
  20. package/dest/interfaces/get_logs_response.d.ts +1 -1
  21. package/dest/interfaces/merkle_tree_operations.d.ts +2 -2
  22. package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
  23. package/dest/interfaces/proving-job.d.ts +667 -118
  24. package/dest/interfaces/proving-job.d.ts.map +1 -1
  25. package/dest/kernel/private_to_avm_accumulated_data.d.ts +7 -7
  26. package/dest/logs/extended_public_log.d.ts +1 -1
  27. package/dest/messaging/l2_to_l1_message.d.ts +20 -20
  28. package/dest/slashing/types.d.ts +1 -1
  29. package/dest/snapshots/types.d.ts +4 -4
  30. package/dest/tests/factories.d.ts +11 -2
  31. package/dest/tests/factories.d.ts.map +1 -1
  32. package/dest/tests/factories.js +24 -8
  33. package/dest/world-state/world_state_revision.d.ts +33 -1
  34. package/dest/world-state/world_state_revision.d.ts.map +1 -1
  35. package/dest/world-state/world_state_revision.js +24 -1
  36. package/dest/zkpassport/index.d.ts +1 -3
  37. package/dest/zkpassport/index.d.ts.map +1 -1
  38. package/dest/zkpassport/index.js +5 -10
  39. package/package.json +8 -8
  40. package/src/avm/avm.ts +100 -3
  41. package/src/contract/contract_deployment_data.ts +108 -0
  42. package/src/contract/index.ts +1 -0
  43. package/src/contract/private_function_membership_proof.ts +1 -1
  44. package/src/hash/hash.ts +13 -2
  45. package/src/interfaces/merkle_tree_operations.ts +2 -2
  46. package/src/tests/factories.ts +29 -3
  47. package/src/world-state/world_state_revision.ts +47 -5
  48. package/src/zkpassport/index.ts +0 -8
@@ -7,15 +7,57 @@ export class WorldStateRevision {
7
7
  public readonly includeUncommitted: boolean,
8
8
  ) {}
9
9
 
10
+ public toString() {
11
+ return `WorldStateRevision(forkId: ${this.forkId}, blockNumber: ${this.blockNumber}, includeUncommitted: ${this.includeUncommitted})`;
12
+ }
13
+
10
14
  static empty() {
11
15
  return new WorldStateRevision(0, 0, false);
12
16
  }
13
17
 
14
18
  static get schema() {
15
- return z.object({
16
- forkId: z.number(),
17
- blockNumber: z.number(),
18
- includeUncommitted: z.boolean(),
19
- });
19
+ return z
20
+ .object({
21
+ forkId: z.number(),
22
+ blockNumber: z.number(),
23
+ includeUncommitted: z.boolean(),
24
+ })
25
+ .transform(
26
+ ({ forkId, blockNumber, includeUncommitted }) =>
27
+ new WorldStateRevision(forkId, blockNumber, includeUncommitted),
28
+ );
29
+ }
30
+ }
31
+
32
+ export class WorldStateRevisionWithHandle extends WorldStateRevision {
33
+ constructor(
34
+ forkId: number,
35
+ blockNumber: number,
36
+ includeUncommitted: boolean,
37
+ public readonly handle: any,
38
+ ) {
39
+ super(forkId, blockNumber, includeUncommitted);
40
+ }
41
+
42
+ public toWorldStateRevision() {
43
+ return new WorldStateRevision(this.forkId, this.blockNumber, this.includeUncommitted);
44
+ }
45
+
46
+ static fromWorldStateRevision(revision: WorldStateRevision, handle: any) {
47
+ return new WorldStateRevisionWithHandle(revision.forkId, revision.blockNumber, revision.includeUncommitted, handle);
48
+ }
49
+
50
+ static override get schema() {
51
+ return z
52
+ .object({
53
+ forkId: z.number(),
54
+ blockNumber: z.number(),
55
+ includeUncommitted: z.boolean(),
56
+ handle: z.any(),
57
+ })
58
+ .transform(
59
+ ({ forkId, blockNumber, includeUncommitted, handle }) =>
60
+ new WorldStateRevisionWithHandle(forkId, blockNumber, includeUncommitted, handle),
61
+ );
20
62
  }
21
63
  }
@@ -12,7 +12,6 @@ export type ViemZkPassportProofParams = {
12
12
  };
13
13
  commitments: {
14
14
  committedInputs: `0x${string}`;
15
- committedInputCounts: bigint[];
16
15
  };
17
16
  serviceConfig: {
18
17
  validityPeriodInSeconds: bigint;
@@ -31,7 +30,6 @@ export class ZkPassportProofParams {
31
30
  public proof: Buffer,
32
31
  public publicInputs: Fr[],
33
32
  public committedInputs: Buffer,
34
- public committedInputCounts: bigint[],
35
33
  public validityPeriodInSeconds: bigint,
36
34
  public domain: string,
37
35
  public scope: string,
@@ -47,8 +45,6 @@ export class ZkPassportProofParams {
47
45
  this.publicInputs,
48
46
  this.committedInputs.length,
49
47
  this.committedInputs,
50
- this.committedInputCounts.length,
51
- this.committedInputCounts,
52
48
  this.validityPeriodInSeconds,
53
49
  this.domain,
54
50
  this.scope,
@@ -69,7 +65,6 @@ export class ZkPassportProofParams {
69
65
  randomBytes(1024),
70
66
  publicInputs,
71
67
  committedInputs,
72
- committedInputCounts,
73
68
  BigInt(7 * 24 * 60 * 60), // 7 days
74
69
  'sequencer.alpha-testnet.aztec.network',
75
70
  'personhood',
@@ -84,7 +79,6 @@ export class ZkPassportProofParams {
84
79
  reader.readBuffer(),
85
80
  reader.readVector(Fr),
86
81
  reader.readBuffer(),
87
- reader.readUint256Vector(),
88
82
  reader.readUInt256(),
89
83
  reader.readString(),
90
84
  reader.readString(),
@@ -98,7 +92,6 @@ export class ZkPassportProofParams {
98
92
  Buffer.from(withoutHexPrefix(params.proofVerificationData.proof), 'hex'),
99
93
  params.proofVerificationData.publicInputs.map(input => Fr.fromString(input)),
100
94
  Buffer.from(withoutHexPrefix(params.commitments.committedInputs), 'hex'),
101
- params.commitments.committedInputCounts,
102
95
  params.serviceConfig.validityPeriodInSeconds,
103
96
  params.serviceConfig.domain,
104
97
  params.serviceConfig.scope,
@@ -120,7 +113,6 @@ export class ZkPassportProofParams {
120
113
  },
121
114
  commitments: {
122
115
  committedInputs: `0x${this.committedInputs.toString('hex')}`,
123
- committedInputCounts: this.committedInputCounts,
124
116
  },
125
117
  };
126
118
  }