@lodestar/api 1.45.0-dev.51a1c44b27 → 1.45.0-dev.6568180f96
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/lib/beacon/routes/beacon/block.d.ts +10 -1
- package/lib/beacon/routes/beacon/block.d.ts.map +1 -1
- package/lib/beacon/routes/beacon/block.js +34 -12
- package/lib/beacon/routes/beacon/block.js.map +1 -1
- package/lib/beacon/routes/beacon/index.d.ts +1 -1
- package/lib/beacon/routes/beacon/index.d.ts.map +1 -1
- package/lib/beacon/routes/beacon/index.js.map +1 -1
- package/lib/beacon/routes/beacon/pool.d.ts +1 -35
- package/lib/beacon/routes/beacon/pool.d.ts.map +1 -1
- package/lib/beacon/routes/beacon/pool.js +1 -44
- package/lib/beacon/routes/beacon/pool.js.map +1 -1
- package/lib/beacon/routes/beacon/state.d.ts +54 -2
- package/lib/beacon/routes/beacon/state.d.ts.map +1 -1
- package/lib/beacon/routes/beacon/state.js +34 -1
- package/lib/beacon/routes/beacon/state.js.map +1 -1
- package/lib/beacon/routes/events.d.ts +118 -3
- package/lib/beacon/routes/events.d.ts.map +1 -1
- package/lib/beacon/routes/events.js +4 -0
- package/lib/beacon/routes/events.js.map +1 -1
- package/lib/beacon/routes/node.d.ts +2 -0
- package/lib/beacon/routes/node.d.ts.map +1 -1
- package/lib/beacon/routes/node.js +2 -0
- package/lib/beacon/routes/node.js.map +1 -1
- package/lib/beacon/routes/validator.d.ts +45 -5
- package/lib/beacon/routes/validator.d.ts.map +1 -1
- package/lib/beacon/routes/validator.js +50 -9
- package/lib/beacon/routes/validator.js.map +1 -1
- package/lib/utils/metadata.d.ts +2 -0
- package/lib/utils/metadata.d.ts.map +1 -1
- package/lib/utils/metadata.js +2 -0
- package/lib/utils/metadata.js.map +1 -1
- package/lib/utils/schema.d.ts +2 -1
- package/lib/utils/schema.d.ts.map +1 -1
- package/lib/utils/schema.js +3 -0
- package/lib/utils/schema.js.map +1 -1
- package/lib/utils/serdes.d.ts +2 -0
- package/lib/utils/serdes.d.ts.map +1 -1
- package/lib/utils/serdes.js +2 -0
- package/lib/utils/serdes.js.map +1 -1
- package/lib/utils/server/handler.d.ts.map +1 -1
- package/lib/utils/server/handler.js +4 -0
- package/lib/utils/server/handler.js.map +1 -1
- package/package.json +10 -10
- package/src/beacon/routes/beacon/block.ts +51 -14
- package/src/beacon/routes/beacon/index.ts +3 -0
- package/src/beacon/routes/beacon/pool.ts +0 -72
- package/src/beacon/routes/beacon/state.ts +63 -2
- package/src/beacon/routes/events.ts +5 -0
- package/src/beacon/routes/node.ts +3 -1
- package/src/beacon/routes/validator.ts +95 -11
- package/src/utils/metadata.ts +2 -0
- package/src/utils/schema.ts +3 -0
- package/src/utils/serdes.ts +3 -0
- package/src/utils/server/handler.ts +5 -0
package/src/utils/schema.ts
CHANGED
|
@@ -34,6 +34,7 @@ export enum Schema {
|
|
|
34
34
|
ObjectArray,
|
|
35
35
|
AnyArray,
|
|
36
36
|
Boolean,
|
|
37
|
+
BooleanRequired,
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
/**
|
|
@@ -71,6 +72,7 @@ function getJsonSchemaItem(schema: Schema): JsonSchema {
|
|
|
71
72
|
return {type: "array"};
|
|
72
73
|
|
|
73
74
|
case Schema.Boolean:
|
|
75
|
+
case Schema.BooleanRequired:
|
|
74
76
|
return {type: "boolean"};
|
|
75
77
|
}
|
|
76
78
|
}
|
|
@@ -81,6 +83,7 @@ function isRequired(schema: Schema): boolean {
|
|
|
81
83
|
case Schema.StringRequired:
|
|
82
84
|
case Schema.UintOrStringRequired:
|
|
83
85
|
case Schema.StringArrayRequired:
|
|
86
|
+
case Schema.BooleanRequired:
|
|
84
87
|
return true;
|
|
85
88
|
|
|
86
89
|
default:
|
package/src/utils/serdes.ts
CHANGED
|
@@ -75,6 +75,9 @@ export function fromValidatorIdsStr(ids?: string[]): (string | number)[] | undef
|
|
|
75
75
|
return ids?.map((id) => (typeof id === "string" && id.startsWith("0x") ? id : fromU64Str(id)));
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
export const toBuilderIdsStr = toValidatorIdsStr;
|
|
79
|
+
export const fromBuilderIdsStr = fromValidatorIdsStr;
|
|
80
|
+
|
|
78
81
|
const GRAFFITI_HEX_LENGTH = 66;
|
|
79
82
|
|
|
80
83
|
export function toGraffitiHex(utf8?: string): string | undefined {
|
|
@@ -111,6 +111,11 @@ export function createFastifyHandler<E extends Endpoint>(
|
|
|
111
111
|
resp.statusCode = response.status;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
// A 204 No Content response has no body
|
|
115
|
+
if (resp.statusCode === 204) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
114
119
|
switch (responseWireFormat) {
|
|
115
120
|
case WireFormat.json: {
|
|
116
121
|
const metaHeaders = definition.resp.meta.toHeadersObject(response?.meta);
|