@aztec/stdlib 1.0.0-nightly.20250717 → 1.0.0-nightly.20250718
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 +0 -67
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +1 -14
- package/dest/abi/contract_artifact.d.ts.map +1 -1
- package/dest/abi/contract_artifact.js +0 -40
- package/dest/avm/avm.d.ts +84 -84
- package/dest/avm/avm_proving_request.d.ts +40 -40
- package/dest/contract/interfaces/contract_class.d.ts +2 -2
- package/dest/interfaces/get_logs_response.d.ts +1 -1
- package/dest/interfaces/proving-job.d.ts +40 -40
- package/dest/logs/extended_public_log.d.ts +1 -1
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +1 -2
- package/package.json +7 -7
- package/src/abi/abi.ts +0 -38
- package/src/abi/contract_artifact.ts +0 -49
- package/src/tests/mocks.ts +0 -1
package/dest/abi/abi.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import type { Fr } from '@aztec/foundation/fields';
|
|
|
2
2
|
import { type ZodFor } from '@aztec/foundation/schemas';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { FunctionSelector } from './function_selector.js';
|
|
5
|
-
import { NoteSelector } from './note_selector.js';
|
|
6
5
|
/** A basic value. */
|
|
7
6
|
export interface BasicValue<T extends string, V> {
|
|
8
7
|
/** The kind of the value. */
|
|
@@ -789,70 +788,6 @@ export type DebugFileMap = Record<FileId, {
|
|
|
789
788
|
/** The path of the file. */
|
|
790
789
|
path: string;
|
|
791
790
|
}>;
|
|
792
|
-
/** Type representing a field of a note (e.g. `amount` in `TokenNote`). */
|
|
793
|
-
export type NoteField = {
|
|
794
|
-
/** Name of the field (e.g. `amount`). */
|
|
795
|
-
name: string;
|
|
796
|
-
/** Index where the note field starts in the serialized note array. */
|
|
797
|
-
index: number;
|
|
798
|
-
/** Whether the field can be unset when creating the note (in the partial notes flow). */
|
|
799
|
-
nullable: boolean;
|
|
800
|
-
};
|
|
801
|
-
export declare const NoteFieldSchema: z.ZodObject<{
|
|
802
|
-
name: z.ZodString;
|
|
803
|
-
index: z.ZodNumber;
|
|
804
|
-
nullable: z.ZodBoolean;
|
|
805
|
-
}, "strip", z.ZodTypeAny, {
|
|
806
|
-
name: string;
|
|
807
|
-
index: number;
|
|
808
|
-
nullable: boolean;
|
|
809
|
-
}, {
|
|
810
|
-
name: string;
|
|
811
|
-
index: number;
|
|
812
|
-
nullable: boolean;
|
|
813
|
-
}>;
|
|
814
|
-
/** Type representing a note in use in the contract. */
|
|
815
|
-
export type ContractNote = {
|
|
816
|
-
/** Note identifier */
|
|
817
|
-
id: NoteSelector;
|
|
818
|
-
/** Type of the note (e.g., 'TransparentNote') */
|
|
819
|
-
typ: string;
|
|
820
|
-
/** Fields of the note. */
|
|
821
|
-
fields: NoteField[];
|
|
822
|
-
};
|
|
823
|
-
export declare const ContractNoteSchema: z.ZodObject<{
|
|
824
|
-
id: z.ZodType<NoteSelector, any, string>;
|
|
825
|
-
typ: z.ZodString;
|
|
826
|
-
fields: z.ZodArray<z.ZodObject<{
|
|
827
|
-
name: z.ZodString;
|
|
828
|
-
index: z.ZodNumber;
|
|
829
|
-
nullable: z.ZodBoolean;
|
|
830
|
-
}, "strip", z.ZodTypeAny, {
|
|
831
|
-
name: string;
|
|
832
|
-
index: number;
|
|
833
|
-
nullable: boolean;
|
|
834
|
-
}, {
|
|
835
|
-
name: string;
|
|
836
|
-
index: number;
|
|
837
|
-
nullable: boolean;
|
|
838
|
-
}>, "many">;
|
|
839
|
-
}, "strip", z.ZodTypeAny, {
|
|
840
|
-
fields: {
|
|
841
|
-
name: string;
|
|
842
|
-
index: number;
|
|
843
|
-
nullable: boolean;
|
|
844
|
-
}[];
|
|
845
|
-
id: NoteSelector;
|
|
846
|
-
typ: string;
|
|
847
|
-
}, {
|
|
848
|
-
fields: {
|
|
849
|
-
name: string;
|
|
850
|
-
index: number;
|
|
851
|
-
nullable: boolean;
|
|
852
|
-
}[];
|
|
853
|
-
id: string;
|
|
854
|
-
typ: string;
|
|
855
|
-
}>;
|
|
856
791
|
/** Type representing a field layout in the storage of a contract. */
|
|
857
792
|
export type FieldLayout = {
|
|
858
793
|
/** Slot in which the field is stored. */
|
|
@@ -873,8 +808,6 @@ export interface ContractArtifact {
|
|
|
873
808
|
};
|
|
874
809
|
/** Storage layout */
|
|
875
810
|
storageLayout: Record<string, FieldLayout>;
|
|
876
|
-
/** The notes used in the contract. */
|
|
877
|
-
notes: Record<string, ContractNote>;
|
|
878
811
|
/** The map of file ID to the source code and path of the file. */
|
|
879
812
|
fileMap: DebugFileMap;
|
|
880
813
|
}
|
package/dest/abi/abi.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abi.d.ts","sourceRoot":"","sources":["../../src/abi/abi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,2BAA2B,CAAC;AAGjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"abi.d.ts","sourceRoot":"","sources":["../../src/abi/abi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,2BAA2B,CAAC;AAGjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,qBAAqB;AACrB,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC;IAC7C,6BAA6B;IAC7B,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,EAAE,CAAC,CAAC;C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+3,6 @@ import { schemas } from '@aztec/foundation/schemas';
|
|
|
3
3
|
import { inflate } from 'pako';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { FunctionSelector } from './function_selector.js';
|
|
6
|
-
import { NoteSelector } from './note_selector.js';
|
|
7
6
|
const logger = createLogger('aztec:foundation:abi');
|
|
8
7
|
export const AbiValueSchema = z.discriminatedUnion('kind', [
|
|
9
8
|
z.object({
|
|
@@ -144,16 +143,6 @@ export const FunctionArtifactSchema = FunctionAbiSchema.and(z.object({
|
|
|
144
143
|
debugSymbols: z.string(),
|
|
145
144
|
debug: FunctionDebugMetadataSchema.optional()
|
|
146
145
|
}));
|
|
147
|
-
export const NoteFieldSchema = z.object({
|
|
148
|
-
name: z.string(),
|
|
149
|
-
index: z.number(),
|
|
150
|
-
nullable: z.boolean()
|
|
151
|
-
});
|
|
152
|
-
export const ContractNoteSchema = z.object({
|
|
153
|
-
id: NoteSelector.schema,
|
|
154
|
-
typ: z.string(),
|
|
155
|
-
fields: z.array(NoteFieldSchema)
|
|
156
|
-
});
|
|
157
146
|
export const ContractArtifactSchema = z.object({
|
|
158
147
|
name: z.string(),
|
|
159
148
|
functions: z.array(FunctionArtifactSchema),
|
|
@@ -176,7 +165,6 @@ export const ContractArtifactSchema = z.object({
|
|
|
176
165
|
storageLayout: z.record(z.object({
|
|
177
166
|
slot: schemas.Fr
|
|
178
167
|
})),
|
|
179
|
-
notes: z.record(ContractNoteSchema),
|
|
180
168
|
fileMap: z.record(z.coerce.number(), z.object({
|
|
181
169
|
source: z.string(),
|
|
182
170
|
path: z.string()
|
|
@@ -320,7 +308,6 @@ export function emptyContractArtifact() {
|
|
|
320
308
|
globals: {}
|
|
321
309
|
},
|
|
322
310
|
storageLayout: {},
|
|
323
|
-
fileMap: {}
|
|
324
|
-
notes: {}
|
|
311
|
+
fileMap: {}
|
|
325
312
|
};
|
|
326
313
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract_artifact.d.ts","sourceRoot":"","sources":["../../src/abi/contract_artifact.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,gBAAgB,
|
|
1
|
+
{"version":3,"file":"contract_artifact.d.ts","sourceRoot":"","sources":["../../src/abi/contract_artifact.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,gBAAgB,EAIrB,KAAK,gBAAgB,EAKtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAOL,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAC;AAE1B;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,CAE3E;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAE3E;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,oBAAoB,GAAG,gBAAgB,CAKlF;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,oBAAoB,GAAG,gBAAgB,CAE3F;AA+DD,yDAAyD;AACzD,KAAK,4BAA4B,GAAG,oBAAoB,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9E;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,4BAA4B,GAAG,gBAAgB,GAAG,OAAO,CAI9F"}
|
|
@@ -213,44 +213,6 @@ function getFunctionType(fn) {
|
|
|
213
213
|
return acc;
|
|
214
214
|
}, {});
|
|
215
215
|
}
|
|
216
|
-
/**
|
|
217
|
-
* Generates records of the notes with note type ids of the artifact.
|
|
218
|
-
* @param input - The compiled noir contract to get note types for
|
|
219
|
-
* @return A record of the note types and their ids
|
|
220
|
-
*/ function getNoteTypes(input) {
|
|
221
|
-
// The type is useless here as it does not give us any guarantee (e.g. `AbiValue` can be one of many different
|
|
222
|
-
// types) so we nuke it and later we manually check the values are as we expect.
|
|
223
|
-
const notes = input.outputs.globals.notes;
|
|
224
|
-
if (!notes) {
|
|
225
|
-
return {};
|
|
226
|
-
}
|
|
227
|
-
return notes.reduce((acc, note)=>{
|
|
228
|
-
const noteFields = note.fields;
|
|
229
|
-
// We find note type id by looking for respective kinds as each of them is unique
|
|
230
|
-
const rawNoteTypeId = noteFields.find((field)=>field.kind === 'integer');
|
|
231
|
-
const rawName = noteFields.find((field)=>field.kind === 'string');
|
|
232
|
-
const rawNoteFields = noteFields.find((field)=>field.kind === 'struct');
|
|
233
|
-
if (!rawNoteTypeId || !rawName || !rawNoteFields) {
|
|
234
|
-
throw new Error(`Could not find note type id, name or fields for note ${note}`);
|
|
235
|
-
}
|
|
236
|
-
const noteTypeId = rawNoteTypeId.value;
|
|
237
|
-
const name = rawName.value;
|
|
238
|
-
// Note type id is encoded as a hex string
|
|
239
|
-
const fields = rawNoteFields.fields.map((field)=>{
|
|
240
|
-
return {
|
|
241
|
-
name: field.name,
|
|
242
|
-
index: parseInt(field.value.fields[0].value.value, 16),
|
|
243
|
-
nullable: field.value.fields[1].value.value
|
|
244
|
-
};
|
|
245
|
-
});
|
|
246
|
-
acc[name] = {
|
|
247
|
-
id: noteTypeId,
|
|
248
|
-
typ: name,
|
|
249
|
-
fields
|
|
250
|
-
};
|
|
251
|
-
return acc;
|
|
252
|
-
}, {});
|
|
253
|
-
}
|
|
254
216
|
/**
|
|
255
217
|
* Given a Nargo output generates an Aztec-compatible contract artifact.
|
|
256
218
|
* Does not include public bytecode, apart from the public_dispatch function.
|
|
@@ -264,7 +226,6 @@ function getFunctionType(fn) {
|
|
|
264
226
|
nonDispatchPublicFunctions: contract.functions.filter((f)=>!retainBytecode(f)).map((f)=>generateFunctionAbi(f, contract)),
|
|
265
227
|
outputs: contract.outputs,
|
|
266
228
|
storageLayout: getStorageLayout(contract),
|
|
267
|
-
notes: getNoteTypes(contract),
|
|
268
229
|
fileMap: contract.file_map
|
|
269
230
|
});
|
|
270
231
|
} catch (err) {
|
|
@@ -284,7 +245,6 @@ function getFunctionType(fn) {
|
|
|
284
245
|
nonDispatchPublicFunctions: contract.functions.filter((f)=>!retainBytecode(f)).map((f)=>generateFunctionAbi(f, contract)),
|
|
285
246
|
outputs: contract.outputs,
|
|
286
247
|
storageLayout: getStorageLayout(contract),
|
|
287
|
-
notes: getNoteTypes(contract),
|
|
288
248
|
fileMap: contract.file_map
|
|
289
249
|
});
|
|
290
250
|
} catch (err) {
|