@aztec/foundation 4.0.3-rc.1 → 4.0.3-rc.2

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.
@@ -2,4 +2,4 @@
2
2
  * Converts bigint values to strings recursively in a log object to avoid serialization issues.
3
3
  */
4
4
  export declare function convertBigintsToStrings(obj: unknown): unknown;
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmlnaW50LXV0aWxzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbG9nL2JpZ2ludC11dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUNILHdCQUFnQix1QkFBdUIsQ0FBQyxHQUFHLEVBQUUsT0FBTyxHQUFHLE9BQU8sQ0FrQjdEIn0=
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmlnaW50LXV0aWxzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbG9nL2JpZ2ludC11dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUNILHdCQUFnQix1QkFBdUIsQ0FBQyxHQUFHLEVBQUUsT0FBTyxHQUFHLE9BQU8sQ0FxQjdEIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"bigint-utils.d.ts","sourceRoot":"","sources":["../../src/log/bigint-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAkB7D"}
1
+ {"version":3,"file":"bigint-utils.d.ts","sourceRoot":"","sources":["../../src/log/bigint-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAqB7D"}
@@ -8,6 +8,9 @@
8
8
  return obj.map((item)=>convertBigintsToStrings(item));
9
9
  }
10
10
  if (obj !== null && typeof obj === 'object') {
11
+ if (typeof obj.toJSON === 'function') {
12
+ return convertBigintsToStrings(obj.toJSON());
13
+ }
11
14
  const result = {};
12
15
  for(const key in obj){
13
16
  result[key] = convertBigintsToStrings(obj[key]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/foundation",
3
- "version": "4.0.3-rc.1",
3
+ "version": "4.0.3-rc.2",
4
4
  "type": "module",
5
5
  "main": "./dest/index.js",
6
6
  "types": "./dest/index.d.ts",
@@ -144,7 +144,7 @@
144
144
  "testEnvironment": "../../foundation/src/jest/env.mjs"
145
145
  },
146
146
  "dependencies": {
147
- "@aztec/bb.js": "4.0.3-rc.1",
147
+ "@aztec/bb.js": "4.0.3-rc.2",
148
148
  "@koa/cors": "^5.0.0",
149
149
  "@noble/curves": "=1.7.0",
150
150
  "@noble/hashes": "^1.6.1",
@@ -11,6 +11,9 @@ export function convertBigintsToStrings(obj: unknown): unknown {
11
11
  }
12
12
 
13
13
  if (obj !== null && typeof obj === 'object') {
14
+ if (typeof (obj as any).toJSON === 'function') {
15
+ return convertBigintsToStrings((obj as any).toJSON());
16
+ }
14
17
  const result: Record<string, unknown> = {};
15
18
  for (const key in obj) {
16
19
  result[key] = convertBigintsToStrings((obj as Record<string, unknown>)[key]);