@lodestar/api 1.23.0-dev.404f13abfd → 1.23.0-dev.4b7d871ab3

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.
Files changed (53) hide show
  1. package/lib/beacon/client/events.js +1 -2
  2. package/lib/beacon/client/events.js.map +1 -1
  3. package/lib/beacon/routes/beacon/block.js +1 -2
  4. package/lib/beacon/routes/beacon/block.js.map +1 -1
  5. package/lib/beacon/routes/beacon/index.d.ts +1 -1
  6. package/lib/beacon/routes/beacon/index.js.map +1 -1
  7. package/lib/beacon/routes/beacon/pool.d.ts +1 -4
  8. package/lib/beacon/routes/beacon/pool.js.map +1 -1
  9. package/lib/beacon/routes/beacon/rewards.js +0 -1
  10. package/lib/beacon/routes/beacon/rewards.js.map +1 -1
  11. package/lib/beacon/routes/beacon/state.d.ts +34 -5
  12. package/lib/beacon/routes/beacon/state.js +29 -2
  13. package/lib/beacon/routes/beacon/state.js.map +1 -1
  14. package/lib/beacon/routes/config.js +0 -1
  15. package/lib/beacon/routes/config.js.map +1 -1
  16. package/lib/beacon/routes/debug.d.ts +26 -1
  17. package/lib/beacon/routes/debug.js +33 -1
  18. package/lib/beacon/routes/debug.js.map +1 -1
  19. package/lib/beacon/routes/events.js +0 -2
  20. package/lib/beacon/routes/events.js.map +1 -1
  21. package/lib/beacon/routes/lightclient.js +0 -1
  22. package/lib/beacon/routes/lightclient.js.map +1 -1
  23. package/lib/beacon/routes/node.js +0 -1
  24. package/lib/beacon/routes/node.js.map +1 -1
  25. package/lib/beacon/routes/proof.js +0 -1
  26. package/lib/beacon/routes/proof.js.map +1 -1
  27. package/lib/beacon/routes/validator.d.ts +1 -1
  28. package/lib/beacon/routes/validator.js +0 -1
  29. package/lib/beacon/routes/validator.js.map +1 -1
  30. package/lib/builder/routes.js +0 -1
  31. package/lib/builder/routes.js.map +1 -1
  32. package/lib/keymanager/routes.js +0 -1
  33. package/lib/keymanager/routes.js.map +1 -1
  34. package/lib/utils/client/eventSource.js +0 -1
  35. package/lib/utils/client/eventSource.js.map +1 -1
  36. package/lib/utils/client/fetch.js +1 -1
  37. package/lib/utils/client/fetch.js.map +1 -1
  38. package/lib/utils/client/httpClient.js +1 -2
  39. package/lib/utils/client/httpClient.js.map +1 -1
  40. package/lib/utils/client/response.js +8 -3
  41. package/lib/utils/client/response.js.map +1 -1
  42. package/lib/utils/codecs.js +0 -1
  43. package/lib/utils/codecs.js.map +1 -1
  44. package/lib/utils/metadata.js +0 -1
  45. package/lib/utils/metadata.js.map +1 -1
  46. package/lib/utils/schema.js +11 -1
  47. package/lib/utils/schema.js.map +1 -1
  48. package/lib/utils/serdes.js +1 -1
  49. package/lib/utils/serdes.js.map +1 -1
  50. package/lib/utils/server/handler.js.map +1 -1
  51. package/lib/utils/server/parser.js +1 -11
  52. package/lib/utils/server/parser.js.map +1 -1
  53. package/package.json +9 -9
@@ -1,16 +1,6 @@
1
1
  import { MediaType } from "../headers.js";
2
2
  export function addSszContentTypeParser(server) {
3
- // Cache body schema symbol, does not change per request
4
- let bodySchemaSymbol;
5
- server.addContentTypeParser(MediaType.ssz, { parseAs: "buffer" }, async (request, payload) => {
6
- if (bodySchemaSymbol === undefined) {
7
- // Get body schema symbol to be able to access validation function
8
- // https://github.com/fastify/fastify/blob/af2ccb5ff681c1d0ac22eb7314c6fa803f73c873/lib/symbols.js#L25
9
- bodySchemaSymbol = Object.getOwnPropertySymbols(request.context).find((s) => s.description === "body-schema");
10
- }
11
- // JSON schema validation will be applied to `Buffer` object, it is required to override validation function
12
- // See https://github.com/fastify/help/issues/1012, it is not possible right now to define a schema per content type
13
- request.context[bodySchemaSymbol] = () => true;
3
+ server.addContentTypeParser(MediaType.ssz, { parseAs: "buffer" }, async (_request, payload) => {
14
4
  // We could just return the `Buffer` here which is a subclass of `Uint8Array` but downstream code does not require it
15
5
  // and it's better to convert it here to avoid unexpected behavior such as `Buffer.prototype.slice` not copying memory
16
6
  // See https://github.com/nodejs/node/issues/41588#issuecomment-1016269584
@@ -1 +1 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../src/utils/server/parser.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAExC,MAAM,UAAU,uBAAuB,CAAC,MAA+B;IACrE,wDAAwD;IACxD,IAAI,gBAAoC,CAAC;IAEzC,MAAM,CAAC,oBAAoB,CACzB,SAAS,CAAC,GAAG,EACb,EAAC,OAAO,EAAE,QAAQ,EAAC,EACnB,KAAK,EAAE,OAA+B,EAAE,OAAe,EAAE,EAAE;QACzD,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;YACnC,kEAAkE;YAClE,sGAAsG;YACtG,gBAAgB,GAAG,MAAM,CAAC,qBAAqB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,KAAK,aAAa,CAAC,CAAC;QAChH,CAAC;QACD,4GAA4G;QAC5G,oHAAoH;QACnH,OAAO,CAAC,OAA8C,CAAC,gBAA0B,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;QAEjG,qHAAqH;QACrH,sHAAsH;QACtH,0EAA0E;QAC1E,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAChF,CAAC,CACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../src/utils/server/parser.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAExC,MAAM,UAAU,uBAAuB,CAAC,MAA+B;IACrE,MAAM,CAAC,oBAAoB,CACzB,SAAS,CAAC,GAAG,EACb,EAAC,OAAO,EAAE,QAAQ,EAAC,EACnB,KAAK,EAAE,QAAgC,EAAE,OAAe,EAAE,EAAE;QAC1D,qHAAqH;QACrH,sHAAsH;QACtH,0EAA0E;QAC1E,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAChF,CAAC,CACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "bugs": {
12
12
  "url": "https://github.com/ChainSafe/lodestar/issues"
13
13
  },
14
- "version": "1.23.0-dev.404f13abfd",
14
+ "version": "1.23.0-dev.4b7d871ab3",
15
15
  "type": "module",
16
16
  "exports": {
17
17
  ".": {
@@ -63,8 +63,8 @@
63
63
  "build:release": "yarn clean && yarn run build",
64
64
  "check-build": "node -e \"(async function() { await import('./lib/index.js') })()\"",
65
65
  "check-types": "tsc",
66
- "lint": "eslint --color --ext .ts src/ test/",
67
- "lint:fix": "yarn run lint --fix",
66
+ "lint": "biome check src/ test/",
67
+ "lint:fix": "yarn run lint --write",
68
68
  "test": "yarn test:unit",
69
69
  "test:unit": "vitest --run --dir test/unit/",
70
70
  "check-readme": "typescript-docs-verifier"
@@ -72,10 +72,10 @@
72
72
  "dependencies": {
73
73
  "@chainsafe/persistent-merkle-tree": "^0.8.0",
74
74
  "@chainsafe/ssz": "^0.17.1",
75
- "@lodestar/config": "1.23.0-dev.404f13abfd",
76
- "@lodestar/params": "1.23.0-dev.404f13abfd",
77
- "@lodestar/types": "1.23.0-dev.404f13abfd",
78
- "@lodestar/utils": "1.23.0-dev.404f13abfd",
75
+ "@lodestar/config": "1.23.0-dev.4b7d871ab3",
76
+ "@lodestar/params": "1.23.0-dev.4b7d871ab3",
77
+ "@lodestar/types": "1.23.0-dev.4b7d871ab3",
78
+ "@lodestar/utils": "1.23.0-dev.4b7d871ab3",
79
79
  "eventsource": "^2.0.2",
80
80
  "qs": "^6.11.1"
81
81
  },
@@ -83,7 +83,7 @@
83
83
  "@types/eventsource": "^1.1.11",
84
84
  "@types/qs": "^6.9.7",
85
85
  "ajv": "^8.12.0",
86
- "fastify": "^4.27.0"
86
+ "fastify": "^5.0.0"
87
87
  },
88
88
  "keywords": [
89
89
  "ethereum",
@@ -92,5 +92,5 @@
92
92
  "api",
93
93
  "blockchain"
94
94
  ],
95
- "gitHead": "210af28ff9c15d785c08f1a6716b66ca33f60b87"
95
+ "gitHead": "2a199218317a38cd0da15bf67c4c1ef14aa7913e"
96
96
  }