@aztec/builder 1.2.1 → 2.0.0-nightly.20250813
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/contract-interface-gen/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,gBAAgB,EAWtB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/contract-interface-gen/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,gBAAgB,EAWtB,MAAM,mBAAmB,CAAC;AAwQ3B;;;;;GAKG;AACH,wBAAsB,mCAAmC,CAAC,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,EAAE,MAAM,mBAyE7G"}
|
|
@@ -184,25 +184,6 @@ import { EventSelector, decodeFunctionSignature, getAllFunctionAbis, getDefaultI
|
|
|
184
184
|
}
|
|
185
185
|
`;
|
|
186
186
|
}
|
|
187
|
-
/**
|
|
188
|
-
* Generates a getter for the contract notes
|
|
189
|
-
* @param input - The contract artifact.
|
|
190
|
-
*/ function generateNotesGetter(input) {
|
|
191
|
-
const entries = Object.entries(input.notes);
|
|
192
|
-
if (entries.length === 0) {
|
|
193
|
-
return '';
|
|
194
|
-
}
|
|
195
|
-
const notesUnionType = entries.map(([name])=>`'${name}'`).join(' | ');
|
|
196
|
-
const noteMetadata = entries.map(([name, { id }])=>`${name}: {
|
|
197
|
-
id: new NoteSelector(${id.value}),
|
|
198
|
-
}`).join(',\n');
|
|
199
|
-
return `public static get notes(): ContractNotes<${notesUnionType}> {
|
|
200
|
-
return {
|
|
201
|
-
${noteMetadata}
|
|
202
|
-
} as ContractNotes<${notesUnionType}>;
|
|
203
|
-
}
|
|
204
|
-
`;
|
|
205
|
-
}
|
|
206
187
|
// events is of type AbiType
|
|
207
188
|
async function generateEvents(events) {
|
|
208
189
|
if (events === undefined) {
|
|
@@ -259,7 +240,6 @@ async function generateEvents(events) {
|
|
|
259
240
|
const artifactStatement = artifactImportPath && generateAbiStatement(input.name, artifactImportPath);
|
|
260
241
|
const artifactGetter = artifactImportPath && generateArtifactGetters(input.name);
|
|
261
242
|
const storageLayoutGetter = artifactImportPath && generateStorageLayoutGetter(input);
|
|
262
|
-
const notesGetter = artifactImportPath && generateNotesGetter(input);
|
|
263
243
|
const { eventDefs, events } = await generateEvents(input.outputs.structs?.events);
|
|
264
244
|
return `
|
|
265
245
|
/* Autogenerated file, do not edit! */
|
|
@@ -277,7 +257,6 @@ import {
|
|
|
277
257
|
type ContractInstanceWithAddress,
|
|
278
258
|
type ContractMethod,
|
|
279
259
|
type ContractStorageLayout,
|
|
280
|
-
type ContractNotes,
|
|
281
260
|
decodeFromAbi,
|
|
282
261
|
DeployMethod,
|
|
283
262
|
EthAddress,
|
|
@@ -289,7 +268,6 @@ import {
|
|
|
289
268
|
loadContractArtifact,
|
|
290
269
|
loadContractArtifactForPublic,
|
|
291
270
|
type NoirCompiledContract,
|
|
292
|
-
NoteSelector,
|
|
293
271
|
Point,
|
|
294
272
|
type PublicKey,
|
|
295
273
|
PublicKeys,
|
|
@@ -315,8 +293,6 @@ export class ${input.name}Contract extends ContractBase {
|
|
|
315
293
|
|
|
316
294
|
${storageLayoutGetter}
|
|
317
295
|
|
|
318
|
-
${notesGetter}
|
|
319
|
-
|
|
320
296
|
/** Type-safe wrappers for the public methods exposed by the contract. */
|
|
321
297
|
public declare methods: {
|
|
322
298
|
${methods.join('\n')}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/builder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-nightly.20250813",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
]
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@aztec/foundation": "
|
|
73
|
-
"@aztec/stdlib": "
|
|
72
|
+
"@aztec/foundation": "2.0.0-nightly.20250813",
|
|
73
|
+
"@aztec/stdlib": "2.0.0-nightly.20250813",
|
|
74
74
|
"commander": "^12.1.0"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
@@ -226,35 +226,6 @@ function generateStorageLayoutGetter(input: ContractArtifact) {
|
|
|
226
226
|
`;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
/**
|
|
230
|
-
* Generates a getter for the contract notes
|
|
231
|
-
* @param input - The contract artifact.
|
|
232
|
-
*/
|
|
233
|
-
function generateNotesGetter(input: ContractArtifact) {
|
|
234
|
-
const entries = Object.entries(input.notes);
|
|
235
|
-
|
|
236
|
-
if (entries.length === 0) {
|
|
237
|
-
return '';
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
const notesUnionType = entries.map(([name]) => `'${name}'`).join(' | ');
|
|
241
|
-
const noteMetadata = entries
|
|
242
|
-
.map(
|
|
243
|
-
([name, { id }]) =>
|
|
244
|
-
`${name}: {
|
|
245
|
-
id: new NoteSelector(${id.value}),
|
|
246
|
-
}`,
|
|
247
|
-
)
|
|
248
|
-
.join(',\n');
|
|
249
|
-
|
|
250
|
-
return `public static get notes(): ContractNotes<${notesUnionType}> {
|
|
251
|
-
return {
|
|
252
|
-
${noteMetadata}
|
|
253
|
-
} as ContractNotes<${notesUnionType}>;
|
|
254
|
-
}
|
|
255
|
-
`;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
229
|
// events is of type AbiType
|
|
259
230
|
async function generateEvents(events: any[] | undefined) {
|
|
260
231
|
if (events === undefined) {
|
|
@@ -322,7 +293,6 @@ export async function generateTypescriptContractInterface(input: ContractArtifac
|
|
|
322
293
|
const artifactStatement = artifactImportPath && generateAbiStatement(input.name, artifactImportPath);
|
|
323
294
|
const artifactGetter = artifactImportPath && generateArtifactGetters(input.name);
|
|
324
295
|
const storageLayoutGetter = artifactImportPath && generateStorageLayoutGetter(input);
|
|
325
|
-
const notesGetter = artifactImportPath && generateNotesGetter(input);
|
|
326
296
|
const { eventDefs, events } = await generateEvents(input.outputs.structs?.events);
|
|
327
297
|
|
|
328
298
|
return `
|
|
@@ -341,7 +311,6 @@ import {
|
|
|
341
311
|
type ContractInstanceWithAddress,
|
|
342
312
|
type ContractMethod,
|
|
343
313
|
type ContractStorageLayout,
|
|
344
|
-
type ContractNotes,
|
|
345
314
|
decodeFromAbi,
|
|
346
315
|
DeployMethod,
|
|
347
316
|
EthAddress,
|
|
@@ -353,7 +322,6 @@ import {
|
|
|
353
322
|
loadContractArtifact,
|
|
354
323
|
loadContractArtifactForPublic,
|
|
355
324
|
type NoirCompiledContract,
|
|
356
|
-
NoteSelector,
|
|
357
325
|
Point,
|
|
358
326
|
type PublicKey,
|
|
359
327
|
PublicKeys,
|
|
@@ -379,8 +347,6 @@ export class ${input.name}Contract extends ContractBase {
|
|
|
379
347
|
|
|
380
348
|
${storageLayoutGetter}
|
|
381
349
|
|
|
382
|
-
${notesGetter}
|
|
383
|
-
|
|
384
350
|
/** Type-safe wrappers for the public methods exposed by the contract. */
|
|
385
351
|
public declare methods: {
|
|
386
352
|
${methods.join('\n')}
|