@lodestar/api 1.50.0-dev.5ad1067954 → 1.50.0-dev.67e2b54129
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.
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { ValueOf } from "@chainsafe/ssz";
|
|
1
2
|
import { ChainForkConfig } from "@lodestar/config";
|
|
2
|
-
import { phase0 } from "@lodestar/types";
|
|
3
|
+
import { Root, Slot, phase0 } from "@lodestar/types";
|
|
3
4
|
import { EmptyArgs, EmptyMeta, EmptyRequest } from "../../../utils/codecs.js";
|
|
5
|
+
import { VersionMeta } from "../../../utils/metadata.js";
|
|
4
6
|
import { Endpoint, RouteDefinitions } from "../../../utils/types.js";
|
|
5
7
|
import * as block from "./block.js";
|
|
6
8
|
import * as pool from "./pool.js";
|
|
@@ -10,8 +12,32 @@ export { block, pool, state, rewards };
|
|
|
10
12
|
export type { BlockHeaderResponse, BlockId } from "./block.js";
|
|
11
13
|
export { BroadcastValidation } from "./block.js";
|
|
12
14
|
export type { BuilderId, BuilderResponse, BuilderStatus, EpochCommitteeResponse, EpochSyncCommitteeResponse, FinalityCheckpoints, StateId, ValidatorBalance, ValidatorId, ValidatorIdentities, ValidatorResponse, ValidatorStatus, } from "./state.js";
|
|
15
|
+
declare const SignedProposerPreferencesListType: import("@chainsafe/ssz").ArrayType<import("@chainsafe/ssz").Type<import("@chainsafe/ssz").ValueOfFields<{
|
|
16
|
+
message: import("@chainsafe/ssz").ContainerType<{
|
|
17
|
+
dependentRoot: import("@chainsafe/ssz").ByteVectorType;
|
|
18
|
+
proposalSlot: import("@chainsafe/ssz").UintNumberType;
|
|
19
|
+
validatorIndex: import("@chainsafe/ssz").UintNumberType;
|
|
20
|
+
feeRecipient: import("@lodestar/types").ExecutionAddressType;
|
|
21
|
+
targetGasLimit: import("@chainsafe/ssz").UintBigintType;
|
|
22
|
+
}>;
|
|
23
|
+
signature: import("@chainsafe/ssz").ByteVectorType;
|
|
24
|
+
}>>, unknown, unknown>;
|
|
25
|
+
type SignedProposerPreferencesList = ValueOf<typeof SignedProposerPreferencesListType>;
|
|
13
26
|
export type Endpoints = block.Endpoints & pool.Endpoints & state.Endpoints & rewards.Endpoints & {
|
|
14
27
|
getGenesis: Endpoint<"GET", EmptyArgs, EmptyRequest, phase0.Genesis, EmptyMeta>;
|
|
28
|
+
/**
|
|
29
|
+
* Get proposer preferences
|
|
30
|
+
* Retrieves the signed proposer preferences known by the node for upcoming proposal slots.
|
|
31
|
+
*/
|
|
32
|
+
getProposerPreferences: Endpoint<"GET", {
|
|
33
|
+
slot?: Slot;
|
|
34
|
+
dependentRoot?: Root;
|
|
35
|
+
}, {
|
|
36
|
+
query: {
|
|
37
|
+
slot?: number;
|
|
38
|
+
dependent_root?: string;
|
|
39
|
+
};
|
|
40
|
+
}, SignedProposerPreferencesList, VersionMeta>;
|
|
15
41
|
};
|
|
16
42
|
export declare function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoints>;
|
|
17
43
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/beacon/routes/beacon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AACjD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/beacon/routes/beacon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAU,IAAI,EAAE,IAAI,EAAE,MAAM,EAAM,MAAM,iBAAiB,CAAC;AAEjE,OAAO,EAAC,SAAS,EAAE,SAAS,EAAkB,YAAY,EAAoB,MAAM,0BAA0B,CAAC;AAC/G,OAAO,EAAe,WAAW,EAAC,MAAM,4BAA4B,CAAC;AAErE,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,CACZ,CAAC;CACH,CAAC;AAEJ,wBAAgB,cAAc,CAAC,MAAM,EAAE,eAAe,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAkCnF"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { ssz } from "@lodestar/types";
|
|
1
|
+
import { ArrayOf, ssz } from "@lodestar/types";
|
|
2
|
+
import { fromHex, toRootHex } from "@lodestar/utils";
|
|
2
3
|
import { EmptyMetaCodec, EmptyRequestCodec } from "../../../utils/codecs.js";
|
|
4
|
+
import { VersionCodec } from "../../../utils/metadata.js";
|
|
5
|
+
import { Schema } from "../../../utils/schema.js";
|
|
3
6
|
import * as block from "./block.js";
|
|
4
7
|
import * as pool from "./pool.js";
|
|
5
8
|
import * as rewards from "./rewards.js";
|
|
@@ -8,6 +11,7 @@ import * as state from "./state.js";
|
|
|
8
11
|
// However, for a consumer all these methods are within the same service "beacon"
|
|
9
12
|
export { block, pool, state, rewards };
|
|
10
13
|
export { BroadcastValidation } from "./block.js";
|
|
14
|
+
const SignedProposerPreferencesListType = ArrayOf(ssz.gloas.SignedProposerPreferences);
|
|
11
15
|
export function getDefinitions(config) {
|
|
12
16
|
return {
|
|
13
17
|
getGenesis: {
|
|
@@ -19,6 +23,24 @@ export function getDefinitions(config) {
|
|
|
19
23
|
meta: EmptyMetaCodec,
|
|
20
24
|
},
|
|
21
25
|
},
|
|
26
|
+
getProposerPreferences: {
|
|
27
|
+
url: "/eth/v1/beacon/proposer_preferences",
|
|
28
|
+
method: "GET",
|
|
29
|
+
req: {
|
|
30
|
+
writeReq: ({ slot, dependentRoot }) => ({
|
|
31
|
+
query: { slot, dependent_root: dependentRoot && toRootHex(dependentRoot) },
|
|
32
|
+
}),
|
|
33
|
+
parseReq: ({ query }) => ({
|
|
34
|
+
slot: query.slot,
|
|
35
|
+
dependentRoot: query.dependent_root ? fromHex(query.dependent_root) : undefined,
|
|
36
|
+
}),
|
|
37
|
+
schema: { query: { slot: Schema.Uint, dependent_root: Schema.String } },
|
|
38
|
+
},
|
|
39
|
+
resp: {
|
|
40
|
+
data: SignedProposerPreferencesListType,
|
|
41
|
+
meta: VersionCodec,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
22
44
|
...block.getDefinitions(config),
|
|
23
45
|
...pool.getDefinitions(config),
|
|
24
46
|
...state.getDefinitions(config),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/beacon/routes/beacon/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/beacon/routes/beacon/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,OAAO,EAAsB,GAAG,EAAC,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAuB,cAAc,EAAgB,iBAAiB,EAAC,MAAM,0BAA0B,CAAC;AAC/G,OAAO,EAAC,YAAY,EAAc,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAEhD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAEpC,uGAAuG;AACvG,iFAAiF;AACjF,OAAO,EAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAC,CAAC;AAGrC,OAAO,EAAC,mBAAmB,EAAC,MAAM,YAAY,CAAC;AAiB/C,MAAM,iCAAiC,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;AA8BvF,MAAM,UAAU,cAAc,CAAC,MAAuB;IACpD,OAAO;QACL,UAAU,EAAE;YACV,GAAG,EAAE,wBAAwB;YAC7B,MAAM,EAAE,KAAK;YACb,GAA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2b54129",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -76,10 +76,10 @@
|
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@chainsafe/persistent-merkle-tree": "^1.3.1",
|
|
78
78
|
"@chainsafe/ssz": "^1.8.0",
|
|
79
|
-
"@lodestar/config": "^1.50.0-dev.
|
|
80
|
-
"@lodestar/params": "^1.50.0-dev.
|
|
81
|
-
"@lodestar/types": "^1.50.0-dev.
|
|
82
|
-
"@lodestar/utils": "^1.50.0-dev.
|
|
79
|
+
"@lodestar/config": "^1.50.0-dev.67e2b54129",
|
|
80
|
+
"@lodestar/params": "^1.50.0-dev.67e2b54129",
|
|
81
|
+
"@lodestar/types": "^1.50.0-dev.67e2b54129",
|
|
82
|
+
"@lodestar/utils": "^1.50.0-dev.67e2b54129",
|
|
83
83
|
"eventsource": "^2.0.2",
|
|
84
84
|
"qs": "^6.14.2"
|
|
85
85
|
},
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"api",
|
|
97
97
|
"blockchain"
|
|
98
98
|
],
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "d9cf8b5f55968a42338b728e09f610847e33c4e6"
|
|
100
100
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import {ValueOf} from "@chainsafe/ssz";
|
|
1
2
|
import {ChainForkConfig} from "@lodestar/config";
|
|
2
|
-
import {phase0, ssz} from "@lodestar/types";
|
|
3
|
+
import {ArrayOf, Root, Slot, phase0, ssz} from "@lodestar/types";
|
|
4
|
+
import {fromHex, toRootHex} from "@lodestar/utils";
|
|
3
5
|
import {EmptyArgs, EmptyMeta, EmptyMetaCodec, EmptyRequest, EmptyRequestCodec} from "../../../utils/codecs.js";
|
|
6
|
+
import {VersionCodec, VersionMeta} from "../../../utils/metadata.js";
|
|
7
|
+
import {Schema} from "../../../utils/schema.js";
|
|
4
8
|
import {Endpoint, RouteDefinitions} from "../../../utils/types.js";
|
|
5
9
|
import * as block from "./block.js";
|
|
6
10
|
import * as pool from "./pool.js";
|
|
@@ -29,6 +33,10 @@ export type {
|
|
|
29
33
|
ValidatorStatus,
|
|
30
34
|
} from "./state.js";
|
|
31
35
|
|
|
36
|
+
const SignedProposerPreferencesListType = ArrayOf(ssz.gloas.SignedProposerPreferences);
|
|
37
|
+
|
|
38
|
+
type SignedProposerPreferencesList = ValueOf<typeof SignedProposerPreferencesListType>;
|
|
39
|
+
|
|
32
40
|
export type Endpoints = block.Endpoints &
|
|
33
41
|
pool.Endpoints &
|
|
34
42
|
state.Endpoints &
|
|
@@ -41,6 +49,18 @@ export type Endpoints = block.Endpoints &
|
|
|
41
49
|
phase0.Genesis,
|
|
42
50
|
EmptyMeta
|
|
43
51
|
>;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Get proposer preferences
|
|
55
|
+
* Retrieves the signed proposer preferences known by the node for upcoming proposal slots.
|
|
56
|
+
*/
|
|
57
|
+
getProposerPreferences: Endpoint<
|
|
58
|
+
"GET",
|
|
59
|
+
{slot?: Slot; dependentRoot?: Root},
|
|
60
|
+
{query: {slot?: number; dependent_root?: string}},
|
|
61
|
+
SignedProposerPreferencesList,
|
|
62
|
+
VersionMeta
|
|
63
|
+
>;
|
|
44
64
|
};
|
|
45
65
|
|
|
46
66
|
export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoints> {
|
|
@@ -54,6 +74,24 @@ export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoi
|
|
|
54
74
|
meta: EmptyMetaCodec,
|
|
55
75
|
},
|
|
56
76
|
},
|
|
77
|
+
getProposerPreferences: {
|
|
78
|
+
url: "/eth/v1/beacon/proposer_preferences",
|
|
79
|
+
method: "GET",
|
|
80
|
+
req: {
|
|
81
|
+
writeReq: ({slot, dependentRoot}) => ({
|
|
82
|
+
query: {slot, dependent_root: dependentRoot && toRootHex(dependentRoot)},
|
|
83
|
+
}),
|
|
84
|
+
parseReq: ({query}) => ({
|
|
85
|
+
slot: query.slot,
|
|
86
|
+
dependentRoot: query.dependent_root ? fromHex(query.dependent_root) : undefined,
|
|
87
|
+
}),
|
|
88
|
+
schema: {query: {slot: Schema.Uint, dependent_root: Schema.String}},
|
|
89
|
+
},
|
|
90
|
+
resp: {
|
|
91
|
+
data: SignedProposerPreferencesListType,
|
|
92
|
+
meta: VersionCodec,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
57
95
|
...block.getDefinitions(config),
|
|
58
96
|
...pool.getDefinitions(config),
|
|
59
97
|
...state.getDefinitions(config),
|