@aztec/foundation 0.77.0-testnet-ignition.30 → 0.77.0
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/json-rpc/convert.d.ts +7 -0
- package/dest/json-rpc/convert.d.ts.map +1 -1
- package/dest/json-rpc/convert.js +8 -0
- package/dest/json-rpc/index.d.ts +1 -1
- package/dest/json-rpc/index.d.ts.map +1 -1
- package/dest/json-rpc/index.js +1 -1
- package/dest/schemas/schemas.d.ts +1 -1
- package/dest/schemas/schemas.d.ts.map +1 -1
- package/dest/schemas/schemas.js +0 -2
- package/package.json +2 -2
- package/src/json-rpc/convert.ts +9 -0
- package/src/json-rpc/index.ts +1 -1
- package/src/schemas/schemas.ts +1 -1
|
@@ -6,6 +6,13 @@ import type { ZodFor } from '../schemas/types.js';
|
|
|
6
6
|
* @returns Result of parsing json with schema.
|
|
7
7
|
*/
|
|
8
8
|
export declare function jsonParseWithSchema<T>(json: string, schema: ZodFor<T>): Promise<T>;
|
|
9
|
+
/**
|
|
10
|
+
* Parses a json string and then feeds it to a zod schema.
|
|
11
|
+
* @param json - JSON string.
|
|
12
|
+
* @param schema - Zod schema.
|
|
13
|
+
* @returns Result of parsing json with schema.
|
|
14
|
+
*/
|
|
15
|
+
export declare function jsonParseWithSchemaSync<T>(json: string, schema: ZodFor<T>): T;
|
|
9
16
|
/**
|
|
10
17
|
* JSON.stringify helper that stringifies bigints, buffers, maps, and sets.
|
|
11
18
|
* @param obj - The object to be stringified.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../src/json-rpc/convert.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAElF;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAoBrE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAMjF"}
|
|
1
|
+
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../src/json-rpc/convert.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAElF;AACD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAE7E;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAoBrE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAMjF"}
|
package/dest/json-rpc/convert.js
CHANGED
|
@@ -7,6 +7,14 @@ import { Buffer } from 'buffer';
|
|
|
7
7
|
*/ export function jsonParseWithSchema(json, schema) {
|
|
8
8
|
return schema.parseAsync(JSON.parse(json));
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Parses a json string and then feeds it to a zod schema.
|
|
12
|
+
* @param json - JSON string.
|
|
13
|
+
* @param schema - Zod schema.
|
|
14
|
+
* @returns Result of parsing json with schema.
|
|
15
|
+
*/ export function jsonParseWithSchemaSync(json, schema) {
|
|
16
|
+
return schema.parse(JSON.parse(json));
|
|
17
|
+
}
|
|
10
18
|
/**
|
|
11
19
|
* JSON.stringify helper that stringifies bigints, buffers, maps, and sets.
|
|
12
20
|
* @param obj - The object to be stringified.
|
package/dest/json-rpc/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { jsonStringify, jsonParseWithSchema, tryJsonStringify } from './convert.js';
|
|
1
|
+
export { jsonStringify, jsonParseWithSchema, jsonParseWithSchemaSync, tryJsonStringify } from './convert.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/json-rpc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/json-rpc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
|
package/dest/json-rpc/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { jsonStringify, jsonParseWithSchema, tryJsonStringify } from './convert.js';
|
|
1
|
+
export { jsonStringify, jsonParseWithSchema, jsonParseWithSchemaSync, tryJsonStringify } from './convert.js';
|
|
@@ -41,5 +41,5 @@ export declare const schemas: {
|
|
|
41
41
|
/** Hex string with an optional 0x prefix which gets removed as part of the parsing. */
|
|
42
42
|
HexString: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
43
43
|
};
|
|
44
|
-
export { EthAddress, Point, Fr, Fq };
|
|
44
|
+
export type { EthAddress, Point, Fr, Fq };
|
|
45
45
|
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/schemas.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI3C,eAAO,MAAM,OAAO;IAClB,4BAA4B;;IAG5B,4BAA4B;;IAG5B,4BAA4B;;IAG5B,yCAAyC;;IAGzC,mCAAmC;;IAGnC,2CAA2C;;IAG3C,+BAA+B;;IAS/B,+CAA+C;;IAG/C,oGAAoG;;;;;;;;;;;;;;IAWpG,wCAAwC;;IAOxC,uFAAuF;;CAExF,CAAC;AAGF,
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/schemas.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI3C,eAAO,MAAM,OAAO;IAClB,4BAA4B;;IAG5B,4BAA4B;;IAG5B,4BAA4B;;IAG5B,yCAAyC;;IAGzC,mCAAmC;;IAGnC,2CAA2C;;IAG3C,+BAA+B;;IAS/B,+CAA+C;;IAG/C,oGAAoG;;;;;;;;;;;;;;IAWpG,wCAAwC;;IAOxC,uFAAuF;;CAExF,CAAC;AAGF,YAAY,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC"}
|
package/dest/schemas/schemas.js
CHANGED
|
@@ -36,5 +36,3 @@ export const schemas = {
|
|
|
36
36
|
/** Accepts a hex string as a buffer. */ BufferHex: z.string().refine(isHex, 'Not a valid hex string').transform(withoutHexPrefix).transform((data)=>Buffer.from(data, 'hex')),
|
|
37
37
|
/** Hex string with an optional 0x prefix which gets removed as part of the parsing. */ HexString: hexSchema
|
|
38
38
|
};
|
|
39
|
-
// These are needed to avoid errors such as: "The inferred type of 'YourClassSchema' cannot be named without a reference to..."
|
|
40
|
-
export { EthAddress, Point, Fr, Fq };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/foundation",
|
|
3
|
-
"version": "0.77.0
|
|
3
|
+
"version": "0.77.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dest/index.js",
|
|
6
6
|
"types": "./dest/index.d.ts",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
]
|
|
104
104
|
},
|
|
105
105
|
"dependencies": {
|
|
106
|
-
"@aztec/bb.js": "0.77.0
|
|
106
|
+
"@aztec/bb.js": "0.77.0",
|
|
107
107
|
"@koa/cors": "^5.0.0",
|
|
108
108
|
"@noble/curves": "^1.2.0",
|
|
109
109
|
"bn.js": "^5.2.1",
|
package/src/json-rpc/convert.ts
CHANGED
|
@@ -11,6 +11,15 @@ import type { ZodFor } from '../schemas/types.js';
|
|
|
11
11
|
export function jsonParseWithSchema<T>(json: string, schema: ZodFor<T>): Promise<T> {
|
|
12
12
|
return schema.parseAsync(JSON.parse(json));
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Parses a json string and then feeds it to a zod schema.
|
|
16
|
+
* @param json - JSON string.
|
|
17
|
+
* @param schema - Zod schema.
|
|
18
|
+
* @returns Result of parsing json with schema.
|
|
19
|
+
*/
|
|
20
|
+
export function jsonParseWithSchemaSync<T>(json: string, schema: ZodFor<T>): T {
|
|
21
|
+
return schema.parse(JSON.parse(json));
|
|
22
|
+
}
|
|
14
23
|
|
|
15
24
|
/**
|
|
16
25
|
* JSON.stringify helper that stringifies bigints, buffers, maps, and sets.
|
package/src/json-rpc/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { jsonStringify, jsonParseWithSchema, tryJsonStringify } from './convert.js';
|
|
1
|
+
export { jsonStringify, jsonParseWithSchema, jsonParseWithSchemaSync, tryJsonStringify } from './convert.js';
|
package/src/schemas/schemas.ts
CHANGED