@lodestar/api 1.39.0-dev.075956b855 → 1.39.0-dev.100ab480bb

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 (51) hide show
  1. package/lib/beacon/routes/beacon/index.d.ts +0 -1
  2. package/lib/beacon/routes/beacon/index.d.ts.map +1 -1
  3. package/lib/beacon/routes/beacon/index.js.map +1 -1
  4. package/lib/beacon/routes/beacon/pool.d.ts.map +1 -1
  5. package/lib/beacon/routes/beacon/pool.js +2 -2
  6. package/lib/beacon/routes/beacon/pool.js.map +1 -1
  7. package/lib/beacon/routes/beacon/rewards.d.ts +4 -115
  8. package/lib/beacon/routes/beacon/rewards.d.ts.map +1 -1
  9. package/lib/beacon/routes/beacon/rewards.js +5 -48
  10. package/lib/beacon/routes/beacon/rewards.js.map +1 -1
  11. package/lib/beacon/routes/beacon/state.d.ts.map +1 -1
  12. package/lib/beacon/routes/beacon/state.js +2 -2
  13. package/lib/beacon/routes/beacon/state.js.map +1 -1
  14. package/lib/beacon/routes/config.d.ts.map +1 -1
  15. package/lib/beacon/routes/config.js +2 -2
  16. package/lib/beacon/routes/config.js.map +1 -1
  17. package/lib/beacon/routes/debug.d.ts.map +1 -1
  18. package/lib/beacon/routes/debug.js +2 -2
  19. package/lib/beacon/routes/debug.js.map +1 -1
  20. package/lib/beacon/routes/lodestar.d.ts.map +1 -1
  21. package/lib/beacon/routes/lodestar.js +2 -2
  22. package/lib/beacon/routes/lodestar.js.map +1 -1
  23. package/lib/beacon/routes/node.d.ts.map +1 -1
  24. package/lib/beacon/routes/node.js +2 -2
  25. package/lib/beacon/routes/node.js.map +1 -1
  26. package/lib/beacon/routes/proof.d.ts.map +1 -1
  27. package/lib/beacon/routes/proof.js +1 -2
  28. package/lib/beacon/routes/proof.js.map +1 -1
  29. package/lib/beacon/routes/validator.d.ts.map +1 -1
  30. package/lib/beacon/routes/validator.js +2 -2
  31. package/lib/beacon/routes/validator.js.map +1 -1
  32. package/lib/builder/routes.d.ts.map +1 -1
  33. package/lib/builder/routes.js +2 -2
  34. package/lib/builder/routes.js.map +1 -1
  35. package/lib/utils/codecs.d.ts +1 -2
  36. package/lib/utils/codecs.d.ts.map +1 -1
  37. package/lib/utils/codecs.js +0 -10
  38. package/lib/utils/codecs.js.map +1 -1
  39. package/package.json +6 -6
  40. package/src/beacon/routes/beacon/index.ts +0 -7
  41. package/src/beacon/routes/beacon/pool.ts +1 -1
  42. package/src/beacon/routes/beacon/rewards.ts +8 -108
  43. package/src/beacon/routes/beacon/state.ts +2 -1
  44. package/src/beacon/routes/config.ts +1 -2
  45. package/src/beacon/routes/debug.ts +1 -2
  46. package/src/beacon/routes/lodestar.ts +1 -2
  47. package/src/beacon/routes/node.ts +1 -2
  48. package/src/beacon/routes/proof.ts +1 -2
  49. package/src/beacon/routes/validator.ts +1 -1
  50. package/src/builder/routes.ts +1 -1
  51. package/src/utils/codecs.ts +1 -11
@@ -1,8 +1,7 @@
1
1
  import {ContainerType, Type, ValueOf} from "@chainsafe/ssz";
2
2
  import {ChainForkConfig} from "@lodestar/config";
3
- import {BeaconState, StringType, fulu, ssz} from "@lodestar/types";
3
+ import {ArrayOf, BeaconState, StringType, fulu, ssz} from "@lodestar/types";
4
4
  import {
5
- ArrayOf,
6
5
  EmptyArgs,
7
6
  EmptyMeta,
8
7
  EmptyMetaCodec,
@@ -1,8 +1,7 @@
1
1
  import {ContainerType, Type, ValueOf} from "@chainsafe/ssz";
2
2
  import {ChainForkConfig} from "@lodestar/config";
3
- import {BeaconState, Epoch, RootHex, Slot, ssz} from "@lodestar/types";
3
+ import {ArrayOf, BeaconState, Epoch, RootHex, Slot, ssz} from "@lodestar/types";
4
4
  import {
5
- ArrayOf,
6
5
  EmptyArgs,
7
6
  EmptyMeta,
8
7
  EmptyRequest,
@@ -1,8 +1,7 @@
1
1
  import {ContainerType, OptionalType, ValueOf} from "@chainsafe/ssz";
2
2
  import {ChainForkConfig} from "@lodestar/config";
3
- import {StringType, fulu, ssz, stringType} from "@lodestar/types";
3
+ import {ArrayOf, StringType, fulu, ssz, stringType} from "@lodestar/types";
4
4
  import {
5
- ArrayOf,
6
5
  EmptyArgs,
7
6
  EmptyMeta,
8
7
  EmptyMetaCodec,
@@ -1,9 +1,8 @@
1
1
  import {CompactMultiProof, ProofType} from "@chainsafe/persistent-merkle-tree";
2
2
  import {ByteListType, ContainerType} from "@chainsafe/ssz";
3
3
  import {ChainForkConfig} from "@lodestar/config";
4
- import {ssz} from "@lodestar/types";
4
+ import {ArrayOf, ssz} from "@lodestar/types";
5
5
  import {fromHex, toHex} from "@lodestar/utils";
6
- import {ArrayOf} from "../../utils/codecs.js";
7
6
  import {Endpoint, RouteDefinitions, Schema} from "../../utils/index.js";
8
7
  import {VersionCodec, VersionMeta} from "../../utils/metadata.js";
9
8
 
@@ -8,6 +8,7 @@ import {
8
8
  isForkPostElectra,
9
9
  } from "@lodestar/params";
10
10
  import {
11
+ ArrayOf,
11
12
  Attestation,
12
13
  BLSSignature,
13
14
  BeaconBlock,
@@ -28,7 +29,6 @@ import {
28
29
  } from "@lodestar/types";
29
30
  import {fromHex, toHex, toRootHex} from "@lodestar/utils";
30
31
  import {
31
- ArrayOf,
32
32
  EmptyMeta,
33
33
  EmptyMetaCodec,
34
34
  EmptyResponseCodec,
@@ -1,6 +1,7 @@
1
1
  import {ChainForkConfig} from "@lodestar/config";
2
2
  import {ForkName, VALIDATOR_REGISTRY_LIMIT, isForkPostDeneb} from "@lodestar/params";
3
3
  import {
4
+ ArrayOf,
4
5
  BLSPubkey,
5
6
  ExecutionPayload,
6
7
  ExecutionPayloadAndBlobsBundle,
@@ -14,7 +15,6 @@ import {
14
15
  } from "@lodestar/types";
15
16
  import {fromHex, toPubkeyHex, toRootHex} from "@lodestar/utils";
16
17
  import {
17
- ArrayOf,
18
18
  EmptyArgs,
19
19
  EmptyMeta,
20
20
  EmptyRequest,
@@ -1,4 +1,4 @@
1
- import {ArrayType, ListBasicType, ListCompositeType, Type, isBasicType, isCompositeType} from "@chainsafe/ssz";
1
+ import {Type} from "@chainsafe/ssz";
2
2
  import {ForkName} from "@lodestar/params";
3
3
  import {objectToExpectedCase} from "@lodestar/utils";
4
4
  import {
@@ -68,16 +68,6 @@ export const EmptyResponseCodec: ResponseCodec<EmptyResponseEndpoint> = {
68
68
  isEmpty: true,
69
69
  };
70
70
 
71
- export function ArrayOf<T>(elementType: Type<T>, limit = Infinity): ArrayType<Type<T>, unknown, unknown> {
72
- if (isCompositeType(elementType)) {
73
- return new ListCompositeType(elementType, limit) as unknown as ArrayType<Type<T>, unknown, unknown>;
74
- }
75
- if (isBasicType(elementType)) {
76
- return new ListBasicType(elementType, limit) as unknown as ArrayType<Type<T>, unknown, unknown>;
77
- }
78
- throw Error(`Unknown type ${elementType.typeName}`);
79
- }
80
-
81
71
  export function WithMeta<T, M extends {version: ForkName}>(getType: (m: M) => Type<T>): ResponseDataCodec<T, M> {
82
72
  return {
83
73
  toJson: (data, meta: M) => getType(meta).toJson(data),