@aztec/builder 1.0.0-nightly.20250613 → 1.0.0-nightly.20250615
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,
|
|
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;AAqS3B;;;;;GAKG;AACH,wBAAsB,mCAAmC,CAAC,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,EAAE,MAAM,mBA8E7G"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventSelector, decodeFunctionSignature, getAllFunctionAbis, getDefaultInitializer, isAztecAddressStruct, isEthAddressStruct, isFunctionSelectorStruct, isWrappedFieldStruct } from '@aztec/stdlib/abi';
|
|
1
|
+
import { EventSelector, decodeFunctionSignature, getAllFunctionAbis, getDefaultInitializer, isAztecAddressStruct, isBoundedVecStruct, isEthAddressStruct, isFunctionSelectorStruct, isWrappedFieldStruct } from '@aztec/stdlib/abi';
|
|
2
2
|
/**
|
|
3
3
|
* Returns the corresponding typescript type for a given Noir type.
|
|
4
4
|
* @param type - The input Noir type.
|
|
@@ -28,6 +28,11 @@ import { EventSelector, decodeFunctionSignature, getAllFunctionAbis, getDefaultI
|
|
|
28
28
|
if (isWrappedFieldStruct(type)) {
|
|
29
29
|
return 'WrappedFieldLike';
|
|
30
30
|
}
|
|
31
|
+
if (isBoundedVecStruct(type)) {
|
|
32
|
+
// To make BoundedVec easier to work with, we expect a simple array on the input and then we encode it
|
|
33
|
+
// as a BoundedVec in the ArgumentsEncoder.
|
|
34
|
+
return `${abiTypeToTypescript(type.fields[0].type)}`;
|
|
35
|
+
}
|
|
31
36
|
return `{ ${type.fields.map((f)=>`${f.name}: ${abiTypeToTypescript(f.type)}`).join(', ')} }`;
|
|
32
37
|
default:
|
|
33
38
|
throw new Error(`Unknown type ${type.kind}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/builder",
|
|
3
|
-
"version": "1.0.0-nightly.
|
|
3
|
+
"version": "1.0.0-nightly.20250615",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"testEnvironment": "../../foundation/src/jest/env.mjs"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@aztec/foundation": "1.0.0-nightly.
|
|
70
|
-
"@aztec/stdlib": "1.0.0-nightly.
|
|
69
|
+
"@aztec/foundation": "1.0.0-nightly.20250615",
|
|
70
|
+
"@aztec/stdlib": "1.0.0-nightly.20250615",
|
|
71
71
|
"commander": "^12.1.0"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
getAllFunctionAbis,
|
|
9
9
|
getDefaultInitializer,
|
|
10
10
|
isAztecAddressStruct,
|
|
11
|
+
isBoundedVecStruct,
|
|
11
12
|
isEthAddressStruct,
|
|
12
13
|
isFunctionSelectorStruct,
|
|
13
14
|
isWrappedFieldStruct,
|
|
@@ -43,6 +44,11 @@ function abiTypeToTypescript(type: ABIParameter['type']): string {
|
|
|
43
44
|
if (isWrappedFieldStruct(type)) {
|
|
44
45
|
return 'WrappedFieldLike';
|
|
45
46
|
}
|
|
47
|
+
if (isBoundedVecStruct(type)) {
|
|
48
|
+
// To make BoundedVec easier to work with, we expect a simple array on the input and then we encode it
|
|
49
|
+
// as a BoundedVec in the ArgumentsEncoder.
|
|
50
|
+
return `${abiTypeToTypescript(type.fields[0].type)}`;
|
|
51
|
+
}
|
|
46
52
|
return `{ ${type.fields.map(f => `${f.name}: ${abiTypeToTypescript(f.type)}`).join(', ')} }`;
|
|
47
53
|
default:
|
|
48
54
|
throw new Error(`Unknown type ${type.kind}`);
|