Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@chainsafe/lodestar-api

Package Overview
Dependencies
Maintainers
2
Versions
819
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chainsafe/lodestar-api - npm Package Compare versions

Comparing version 0.23.0 to 0.23.1-alpha.0

2

lib/client/beacon.js

@@ -17,3 +17,3 @@ "use strict";

const reqSerializers = (0, _beacon.getReqSerializers)(config);
const returnTypes = (0, _beacon.getReturnTypes)(config); // All routes return JSON, use a client auto-generator
const returnTypes = (0, _beacon.getReturnTypes)(); // All routes return JSON, use a client auto-generator

@@ -20,0 +20,0 @@ return (0, _utils.generateGenericJsonClient)(_beacon.routesData, reqSerializers, returnTypes, httpClient);

@@ -7,3 +7,3 @@ import { IBeaconConfig } from "@chainsafe/lodestar-config";

*/
export declare function getClient(config: IBeaconConfig, httpClient: IHttpClient): Api;
export declare function getClient(_config: IBeaconConfig, httpClient: IHttpClient): Api;
//# sourceMappingURL=config.d.ts.map

@@ -10,3 +10,3 @@ "use strict";

var _config = require("../routes/config");
var _config2 = require("../routes/config");

@@ -16,8 +16,8 @@ /**

*/
function getClient(config, httpClient) {
const reqSerializers = (0, _config.getReqSerializers)();
const returnTypes = (0, _config.getReturnTypes)(config); // All routes return JSON, use a client auto-generator
function getClient(_config, httpClient) {
const reqSerializers = (0, _config2.getReqSerializers)();
const returnTypes = (0, _config2.getReturnTypes)(); // All routes return JSON, use a client auto-generator
return (0, _utils.generateGenericJsonClient)(_config.routesData, reqSerializers, returnTypes, httpClient);
return (0, _utils.generateGenericJsonClient)(_config2.routesData, reqSerializers, returnTypes, httpClient);
}
//# sourceMappingURL=config.js.map

@@ -7,3 +7,3 @@ import { IBeaconConfig } from "@chainsafe/lodestar-config";

*/
export declare function getClient(config: IBeaconConfig, httpClient: IHttpClient): Api;
export declare function getClient(_config: IBeaconConfig, httpClient: IHttpClient): Api;
//# sourceMappingURL=debug.d.ts.map

@@ -15,5 +15,5 @@ "use strict";

*/
function getClient(config, httpClient) {
function getClient(_config, httpClient) {
const reqSerializers = (0, _debug.getReqSerializers)();
const returnTypes = (0, _debug.getReturnTypes)(config); // All routes return JSON, use a client auto-generator
const returnTypes = (0, _debug.getReturnTypes)(); // All routes return JSON, use a client auto-generator

@@ -20,0 +20,0 @@ return (0, _utils.generateGenericJsonClient)(_debug.routesData, reqSerializers, returnTypes, httpClient);

@@ -6,3 +6,3 @@ import { IBeaconConfig } from "@chainsafe/lodestar-config";

*/
export declare function getClient(config: IBeaconConfig, baseUrl: string): Api;
export declare function getClient(_config: IBeaconConfig, baseUrl: string): Api;
//# sourceMappingURL=events.d.ts.map

@@ -19,4 +19,4 @@ "use strict";

*/
function getClient(config, baseUrl) {
const eventSerdes = (0, _events.getEventSerdes)(config);
function getClient(_config, baseUrl) {
const eventSerdes = (0, _events.getEventSerdes)();
return {

@@ -23,0 +23,0 @@ eventstream: async (topics, signal, onEvent) => {

@@ -7,3 +7,3 @@ import { IBeaconConfig } from "@chainsafe/lodestar-config";

*/
export declare function getClient(config: IBeaconConfig, httpClient: IHttpClient): Api;
export declare function getClient(_config: IBeaconConfig, httpClient: IHttpClient): Api;
//# sourceMappingURL=lightclient.d.ts.map

@@ -23,5 +23,5 @@ "use strict";

*/
function getClient(config, httpClient) {
function getClient(_config, httpClient) {
const reqSerializers = (0, _lightclient.getReqSerializers)();
const returnTypes = (0, _lightclient.getReturnTypes)(config); // Some routes return JSON, use a client auto-generator
const returnTypes = (0, _lightclient.getReturnTypes)(); // Some routes return JSON, use a client auto-generator

@@ -28,0 +28,0 @@ const client = (0, _utils.generateGenericJsonClient)(_lightclient.routesData, reqSerializers, returnTypes, httpClient); // For `getStateProof()` generate request serializer

@@ -7,3 +7,3 @@ import { IBeaconConfig } from "@chainsafe/lodestar-config";

*/
export declare function getClient(config: IBeaconConfig, httpClient: IHttpClient): Api;
export declare function getClient(_config: IBeaconConfig, httpClient: IHttpClient): Api;
//# sourceMappingURL=node.d.ts.map

@@ -15,5 +15,5 @@ "use strict";

*/
function getClient(config, httpClient) {
function getClient(_config, httpClient) {
const reqSerializers = (0, _node.getReqSerializers)();
const returnTypes = (0, _node.getReturnTypes)(config); // All routes return JSON, use a client auto-generator
const returnTypes = (0, _node.getReturnTypes)(); // All routes return JSON, use a client auto-generator

@@ -20,0 +20,0 @@ return (0, _utils.generateGenericJsonClient)(_node.routesData, reqSerializers, returnTypes, httpClient);

@@ -7,3 +7,3 @@ import { IBeaconConfig } from "@chainsafe/lodestar-config";

*/
export declare function getClient(config: IBeaconConfig, httpClient: IHttpClient): Api;
export declare function getClient(_config: IBeaconConfig, httpClient: IHttpClient): Api;
//# sourceMappingURL=validator.d.ts.map

@@ -15,5 +15,5 @@ "use strict";

*/
function getClient(config, httpClient) {
const reqSerializers = (0, _validator.getReqSerializers)(config);
const returnTypes = (0, _validator.getReturnTypes)(config); // All routes return JSON, use a client auto-generator
function getClient(_config, httpClient) {
const reqSerializers = (0, _validator.getReqSerializers)();
const returnTypes = (0, _validator.getReturnTypes)(); // All routes return JSON, use a client auto-generator

@@ -20,0 +20,0 @@ return (0, _utils.generateGenericJsonClient)(_validator.routesData, reqSerializers, returnTypes, httpClient);

import { Json } from "@chainsafe/ssz";
import { ForkName, IBeaconConfig } from "@chainsafe/lodestar-config";
import { ForkName } from "@chainsafe/lodestar-params";
import { IBeaconConfig } from "@chainsafe/lodestar-config";
import { phase0, allForks, Slot, Root } from "@chainsafe/lodestar-types";

@@ -112,4 +113,4 @@ import { RoutesData, ReturnTypes, ReqSerializers } from "../../utils";

export declare function getReqSerializers(config: IBeaconConfig): ReqSerializers<Api, ReqTypes>;
export declare function getReturnTypes(config: IBeaconConfig): ReturnTypes<Api>;
export declare function getReturnTypes(): ReturnTypes<Api>;
export {};
//# sourceMappingURL=block.d.ts.map

@@ -12,2 +12,4 @@ "use strict";

var _lodestarTypes = require("@chainsafe/lodestar-types");
var _utils = require("../../utils");

@@ -103,19 +105,19 @@

function getReturnTypes(config) {
function getReturnTypes() {
const BeaconHeaderResType = new _ssz.ContainerType({
fields: {
root: config.types.Root,
canonical: config.types.Boolean,
header: config.types.phase0.SignedBeaconBlockHeader
root: _lodestarTypes.ssz.Root,
canonical: _lodestarTypes.ssz.Boolean,
header: _lodestarTypes.ssz.phase0.SignedBeaconBlockHeader
}
});
return {
getBlock: (0, _utils.ContainerData)(config.types.phase0.SignedBeaconBlock),
getBlockV2: (0, _utils.WithVersion)(fork => config.types[fork].SignedBeaconBlock),
getBlockAttestations: (0, _utils.ContainerData)((0, _utils.ArrayOf)(config.types.phase0.Attestation)),
getBlock: (0, _utils.ContainerData)(_lodestarTypes.ssz.phase0.SignedBeaconBlock),
getBlockV2: (0, _utils.WithVersion)(fork => _lodestarTypes.ssz[fork].SignedBeaconBlock),
getBlockAttestations: (0, _utils.ContainerData)((0, _utils.ArrayOf)(_lodestarTypes.ssz.phase0.Attestation)),
getBlockHeader: (0, _utils.ContainerData)(BeaconHeaderResType),
getBlockHeaders: (0, _utils.ContainerData)((0, _utils.ArrayOf)(BeaconHeaderResType)),
getBlockRoot: (0, _utils.ContainerData)(config.types.Root)
getBlockRoot: (0, _utils.ContainerData)(_lodestarTypes.ssz.Root)
};
}
//# sourceMappingURL=block.js.map

@@ -121,7 +121,7 @@ import { IBeaconConfig } from "@chainsafe/lodestar-config";

}>;
submitPoolSyncCommitteeSignatures: import("../../utils").ReqSerializer<(signatures: import("@chainsafe/lodestar-types/lib/altair").SyncCommitteeSignature[]) => Promise<void>, {
submitPoolSyncCommitteeSignatures: import("../../utils").ReqSerializer<(signatures: import("@chainsafe/lodestar-types/lib/altair/types").SyncCommitteeSignature[]) => Promise<void>, {
body: import("@chainsafe/ssz").Json;
}>;
getBlock: import("../../utils").ReqSerializer<(blockId: block.BlockId) => Promise<{
data: import("@chainsafe/lodestar-types/lib/allForks").SignedBeaconBlock;
data: import("@chainsafe/lodestar-types/lib/allForks/types").SignedBeaconBlock;
}>, {

@@ -133,4 +133,4 @@ params: {

getBlockV2: import("../../utils").ReqSerializer<(blockId: block.BlockId) => Promise<{
data: import("@chainsafe/lodestar-types/lib/allForks").SignedBeaconBlock;
version: import("@chainsafe/lodestar-config").ForkName;
data: import("@chainsafe/lodestar-types/lib/allForks/types").SignedBeaconBlock;
version: import("@chainsafe/lodestar-params").ForkName;
}>, {

@@ -173,3 +173,3 @@ params: {

}>;
publishBlock: import("../../utils").ReqSerializer<(block: import("@chainsafe/lodestar-types/lib/allForks").SignedBeaconBlock) => Promise<void>, {
publishBlock: import("../../utils").ReqSerializer<(block: import("@chainsafe/lodestar-types/lib/allForks/types").SignedBeaconBlock) => Promise<void>, {
body: import("@chainsafe/ssz").Json;

@@ -179,3 +179,3 @@ }>;

};
export declare function getReturnTypes(config: IBeaconConfig): ReturnTypes<Api>;
export declare function getReturnTypes(): ReturnTypes<Api>;
//# sourceMappingURL=index.d.ts.map

@@ -88,2 +88,4 @@ "use strict";

var _lodestarTypes = require("@chainsafe/lodestar-types");
var _utils = require("../../utils");

@@ -120,10 +122,10 @@

getGenesis: _utils.reqEmpty
}, block.getReqSerializers(config)), pool.getReqSerializers(config)), state.getReqSerializers());
}, block.getReqSerializers(config)), pool.getReqSerializers()), state.getReqSerializers());
}
function getReturnTypes(config) {
function getReturnTypes() {
return _objectSpread(_objectSpread(_objectSpread({
getGenesis: (0, _utils.ContainerData)(config.types.phase0.Genesis)
}, block.getReturnTypes(config)), pool.getReturnTypes(config)), state.getReturnTypes(config));
getGenesis: (0, _utils.ContainerData)(_lodestarTypes.ssz.phase0.Genesis)
}, block.getReturnTypes()), pool.getReturnTypes()), state.getReturnTypes());
}
//# sourceMappingURL=index.js.map

@@ -1,2 +0,1 @@

import { IBeaconConfig } from "@chainsafe/lodestar-config";
import { phase0, altair, CommitteeIndex, Slot } from "@chainsafe/lodestar-types";

@@ -120,4 +119,4 @@ import { Json } from "@chainsafe/ssz";

};
export declare function getReqSerializers(config: IBeaconConfig): ReqSerializers<Api, ReqTypes>;
export declare function getReturnTypes(config: IBeaconConfig): ReturnTypes<Api>;
export declare function getReqSerializers(): ReqSerializers<Api, ReqTypes>;
export declare function getReturnTypes(): ReturnTypes<Api>;
//# sourceMappingURL=pool.d.ts.map

@@ -10,2 +10,4 @@ "use strict";

var _lodestarTypes = require("@chainsafe/lodestar-types");
var _utils = require("../../utils");

@@ -58,3 +60,3 @@

function getReqSerializers(config) {
function getReqSerializers() {
return {

@@ -84,18 +86,18 @@ getPoolAttestations: {

getPoolVoluntaryExits: _utils.reqEmpty,
submitPoolAttestations: (0, _utils.reqOnlyBody)((0, _utils.ArrayOf)(config.types.phase0.Attestation), _utils.Schema.ObjectArray),
submitPoolAttesterSlashing: (0, _utils.reqOnlyBody)(config.types.phase0.AttesterSlashing, _utils.Schema.Object),
submitPoolProposerSlashing: (0, _utils.reqOnlyBody)(config.types.phase0.ProposerSlashing, _utils.Schema.Object),
submitPoolVoluntaryExit: (0, _utils.reqOnlyBody)(config.types.phase0.SignedVoluntaryExit, _utils.Schema.Object),
submitPoolSyncCommitteeSignatures: (0, _utils.reqOnlyBody)((0, _utils.ArrayOf)(config.types.altair.SyncCommitteeSignature), _utils.Schema.ObjectArray)
submitPoolAttestations: (0, _utils.reqOnlyBody)((0, _utils.ArrayOf)(_lodestarTypes.ssz.phase0.Attestation), _utils.Schema.ObjectArray),
submitPoolAttesterSlashing: (0, _utils.reqOnlyBody)(_lodestarTypes.ssz.phase0.AttesterSlashing, _utils.Schema.Object),
submitPoolProposerSlashing: (0, _utils.reqOnlyBody)(_lodestarTypes.ssz.phase0.ProposerSlashing, _utils.Schema.Object),
submitPoolVoluntaryExit: (0, _utils.reqOnlyBody)(_lodestarTypes.ssz.phase0.SignedVoluntaryExit, _utils.Schema.Object),
submitPoolSyncCommitteeSignatures: (0, _utils.reqOnlyBody)((0, _utils.ArrayOf)(_lodestarTypes.ssz.altair.SyncCommitteeSignature), _utils.Schema.ObjectArray)
};
}
function getReturnTypes(config) {
function getReturnTypes() {
return {
getPoolAttestations: (0, _utils.ContainerData)((0, _utils.ArrayOf)(config.types.phase0.Attestation)),
getPoolAttesterSlashings: (0, _utils.ContainerData)((0, _utils.ArrayOf)(config.types.phase0.AttesterSlashing)),
getPoolProposerSlashings: (0, _utils.ContainerData)((0, _utils.ArrayOf)(config.types.phase0.ProposerSlashing)),
getPoolVoluntaryExits: (0, _utils.ContainerData)((0, _utils.ArrayOf)(config.types.phase0.SignedVoluntaryExit))
getPoolAttestations: (0, _utils.ContainerData)((0, _utils.ArrayOf)(_lodestarTypes.ssz.phase0.Attestation)),
getPoolAttesterSlashings: (0, _utils.ContainerData)((0, _utils.ArrayOf)(_lodestarTypes.ssz.phase0.AttesterSlashing)),
getPoolProposerSlashings: (0, _utils.ContainerData)((0, _utils.ArrayOf)(_lodestarTypes.ssz.phase0.ProposerSlashing)),
getPoolVoluntaryExits: (0, _utils.ContainerData)((0, _utils.ArrayOf)(_lodestarTypes.ssz.phase0.SignedVoluntaryExit))
};
}
//# sourceMappingURL=pool.js.map

@@ -1,2 +0,1 @@

import { IBeaconConfig } from "@chainsafe/lodestar-config";
import { phase0, CommitteeIndex, Slot, ValidatorIndex, Epoch, Root, Gwei } from "@chainsafe/lodestar-types";

@@ -175,4 +174,4 @@ import { RoutesData, ReturnTypes, ReqSerializers } from "../../utils";

export declare function getReqSerializers(): ReqSerializers<Api, ReqTypes>;
export declare function getReturnTypes(config: IBeaconConfig): ReturnTypes<Api>;
export declare function getReturnTypes(): ReturnTypes<Api>;
export {};
//# sourceMappingURL=state.d.ts.map

@@ -12,2 +12,4 @@ "use strict";

var _lodestarTypes = require("@chainsafe/lodestar-types");
var _utils = require("../../utils");

@@ -183,8 +185,8 @@

function getReturnTypes(config) {
function getReturnTypes() {
const FinalityCheckpoints = new _ssz.ContainerType({
fields: {
previousJustified: config.types.phase0.Checkpoint,
currentJustified: config.types.phase0.Checkpoint,
finalized: config.types.phase0.Checkpoint
previousJustified: _lodestarTypes.ssz.phase0.Checkpoint,
currentJustified: _lodestarTypes.ssz.phase0.Checkpoint,
finalized: _lodestarTypes.ssz.phase0.Checkpoint
}

@@ -194,6 +196,6 @@ });

fields: {
index: config.types.ValidatorIndex,
balance: config.types.Gwei,
index: _lodestarTypes.ssz.ValidatorIndex,
balance: _lodestarTypes.ssz.Gwei,
status: new _utils.StringType(),
validator: config.types.phase0.Validator
validator: _lodestarTypes.ssz.phase0.Validator
}

@@ -203,4 +205,4 @@ });

fields: {
index: config.types.ValidatorIndex,
balance: config.types.Gwei
index: _lodestarTypes.ssz.ValidatorIndex,
balance: _lodestarTypes.ssz.Gwei
}

@@ -210,5 +212,5 @@ });

fields: {
index: config.types.CommitteeIndex,
slot: config.types.Slot,
validators: config.types.phase0.CommitteeIndices
index: _lodestarTypes.ssz.CommitteeIndex,
slot: _lodestarTypes.ssz.Slot,
validators: _lodestarTypes.ssz.phase0.CommitteeIndices
}

@@ -218,9 +220,9 @@ });

fields: {
validators: (0, _utils.ArrayOf)(config.types.ValidatorIndex),
validatorAggregates: (0, _utils.ArrayOf)(config.types.ValidatorIndex)
validators: (0, _utils.ArrayOf)(_lodestarTypes.ssz.ValidatorIndex),
validatorAggregates: (0, _utils.ArrayOf)(_lodestarTypes.ssz.ValidatorIndex)
}
});
return {
getStateRoot: (0, _utils.ContainerData)(config.types.Root),
getStateFork: (0, _utils.ContainerData)(config.types.phase0.Fork),
getStateRoot: (0, _utils.ContainerData)(_lodestarTypes.ssz.Root),
getStateFork: (0, _utils.ContainerData)(_lodestarTypes.ssz.phase0.Fork),
getStateFinalityCheckpoints: (0, _utils.ContainerData)(FinalityCheckpoints),

@@ -227,0 +229,0 @@ getStateValidators: (0, _utils.ContainerData)((0, _utils.ArrayOf)(ValidatorResponse)),

@@ -1,4 +0,5 @@

import { IBeaconConfig } from "@chainsafe/lodestar-config";
import { IBeaconParams } from "@chainsafe/lodestar-params";
import { IBeaconPreset } from "@chainsafe/lodestar-params";
import { IChainConfig } from "@chainsafe/lodestar-config";
import { Bytes32, Number64, phase0 } from "@chainsafe/lodestar-types";
import { ContainerType } from "@chainsafe/ssz";
import { ReqEmpty, ReturnTypes, ReqSerializers, RoutesData } from "../utils";

@@ -9,2 +10,4 @@ export declare type DepositContract = {

};
export declare type ISpec = IBeaconPreset & IChainConfig;
export declare const Spec: ContainerType<ISpec>;
export declare type Api = {

@@ -35,3 +38,3 @@ /**

getSpec(): Promise<{
data: IBeaconParams;
data: ISpec;
}>;

@@ -47,3 +50,3 @@ };

export declare function getReqSerializers(): ReqSerializers<Api, ReqTypes>;
export declare function getReturnTypes(config: IBeaconConfig): ReturnTypes<Api>;
export declare function getReturnTypes(): ReturnTypes<Api>;
//# sourceMappingURL=config.d.ts.map

@@ -8,6 +8,10 @@ "use strict";

exports.getReturnTypes = getReturnTypes;
exports.routesData = void 0;
exports.routesData = exports.Spec = void 0;
var _lodestarParams = require("@chainsafe/lodestar-params");
var _lodestarConfig = require("@chainsafe/lodestar-config");
var _lodestarTypes = require("@chainsafe/lodestar-types");
var _lodestarUtils = require("@chainsafe/lodestar-utils");

@@ -19,2 +23,14 @@

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
// eslint-disable-next-line @typescript-eslint/naming-convention
const Spec = new _ssz.ContainerType({
fields: _objectSpread(_objectSpread({}, _lodestarParams.BeaconPreset.fields), _lodestarConfig.ChainConfig.fields)
});
exports.Spec = Spec;
/**

@@ -45,6 +61,6 @@ * Define javascript values for each route

function getReturnTypes(config) {
function getReturnTypes() {
const DepositContract = new _ssz.ContainerType({
fields: {
chainId: config.types.Number64,
chainId: _lodestarTypes.ssz.Number64,
address: new _ssz.ByteVectorType({

@@ -57,6 +73,6 @@ length: 20

getDepositContract: (0, _utils.ContainerData)(DepositContract),
getForkSchedule: (0, _utils.ContainerData)((0, _utils.ArrayOf)(config.types.phase0.Fork)),
getSpec: (0, _utils.ContainerData)(_lodestarParams.BeaconParams)
getForkSchedule: (0, _utils.ContainerData)((0, _utils.ArrayOf)(_lodestarTypes.ssz.phase0.Fork)),
getSpec: (0, _utils.ContainerData)(Spec)
};
}
//# sourceMappingURL=config.js.map

@@ -1,2 +0,2 @@

import { ForkName, IBeaconConfig } from "@chainsafe/lodestar-config";
import { ForkName } from "@chainsafe/lodestar-params";
import { allForks, Slot, Root } from "@chainsafe/lodestar-types";

@@ -77,4 +77,4 @@ import { StateId } from "./beacon/state";

export declare function getReqSerializers(): ReqSerializers<Api, ReqTypes>;
export declare function getReturnTypes(config: IBeaconConfig): ReturnTypes<Api>;
export declare function getReturnTypes(): ReturnTypes<Api>;
export {};
//# sourceMappingURL=debug.d.ts.map

@@ -10,2 +10,4 @@ "use strict";

var _lodestarTypes = require("@chainsafe/lodestar-types");
var _ssz = require("@chainsafe/ssz");

@@ -97,7 +99,7 @@

function getReturnTypes(config) {
function getReturnTypes() {
const SlotRoot = new _ssz.ContainerType({
fields: {
slot: config.types.Slot,
root: config.types.Root
slot: _lodestarTypes.ssz.Slot,
root: _lodestarTypes.ssz.Root
}

@@ -107,6 +109,6 @@ });

getHeads: (0, _utils.ContainerData)((0, _utils.ArrayOf)(SlotRoot)),
getState: (0, _utils.ContainerData)(config.types.phase0.BeaconState),
getStateV2: (0, _utils.WithVersion)(fork => config.types[fork].BeaconState)
getState: (0, _utils.ContainerData)(_lodestarTypes.ssz.phase0.BeaconState),
getStateV2: (0, _utils.WithVersion)(fork => _lodestarTypes.ssz[fork].BeaconState)
};
}
//# sourceMappingURL=debug.js.map

@@ -1,2 +0,1 @@

import { IBeaconConfig } from "@chainsafe/lodestar-config";
import { Epoch, Number64, phase0, Slot, Root } from "@chainsafe/lodestar-types";

@@ -82,6 +81,6 @@ import { Json, Type } from "@chainsafe/ssz";

};
export declare function getTypeByEvent(config: IBeaconConfig): {
export declare function getTypeByEvent(): {
[K in EventType]: Type<EventData[K]>;
};
export declare function getEventSerdes(config: IBeaconConfig): {
export declare function getEventSerdes(): {
toJson: (event: BeaconEvent) => Json;

@@ -88,0 +87,0 @@ fromJson: (type: EventType, data: Json) => BeaconEvent["message"];

@@ -10,2 +10,4 @@ "use strict";

var _lodestarTypes = require("@chainsafe/lodestar-types");
var _ssz = require("@chainsafe/ssz");

@@ -38,12 +40,12 @@

// The request is very simple: (topics) => {query: {topics}}, and the test will ensure compatibility server - client
function getTypeByEvent(config) {
function getTypeByEvent() {
return {
[EventType.head]: new _ssz.ContainerType({
fields: {
slot: config.types.Slot,
block: config.types.Root,
state: config.types.Root,
epochTransition: config.types.Boolean,
previousDutyDependentRoot: config.types.Root,
currentDutyDependentRoot: config.types.Root
slot: _lodestarTypes.ssz.Slot,
block: _lodestarTypes.ssz.Root,
state: _lodestarTypes.ssz.Root,
epochTransition: _lodestarTypes.ssz.Boolean,
previousDutyDependentRoot: _lodestarTypes.ssz.Root,
currentDutyDependentRoot: _lodestarTypes.ssz.Root
}

@@ -53,13 +55,13 @@ }),

fields: {
slot: config.types.Slot,
block: config.types.Root
slot: _lodestarTypes.ssz.Slot,
block: _lodestarTypes.ssz.Root
}
}),
[EventType.attestation]: config.types.phase0.Attestation,
[EventType.voluntaryExit]: config.types.phase0.SignedVoluntaryExit,
[EventType.attestation]: _lodestarTypes.ssz.phase0.Attestation,
[EventType.voluntaryExit]: _lodestarTypes.ssz.phase0.SignedVoluntaryExit,
[EventType.finalizedCheckpoint]: new _ssz.ContainerType({
fields: {
block: config.types.Root,
state: config.types.Root,
epoch: config.types.Epoch
block: _lodestarTypes.ssz.Root,
state: _lodestarTypes.ssz.Root,
epoch: _lodestarTypes.ssz.Epoch
}

@@ -69,9 +71,9 @@ }),

fields: {
slot: config.types.Slot,
depth: config.types.Number64,
oldHeadBlock: config.types.Root,
newHeadBlock: config.types.Root,
oldHeadState: config.types.Root,
newHeadState: config.types.Root,
epoch: config.types.Epoch
slot: _lodestarTypes.ssz.Slot,
depth: _lodestarTypes.ssz.Number64,
oldHeadBlock: _lodestarTypes.ssz.Root,
newHeadBlock: _lodestarTypes.ssz.Root,
oldHeadState: _lodestarTypes.ssz.Root,
newHeadState: _lodestarTypes.ssz.Root,
epoch: _lodestarTypes.ssz.Epoch
}

@@ -83,4 +85,4 @@ })

function getEventSerdes(config) {
const typeByEvent = getTypeByEvent(config);
function getEventSerdes() {
const typeByEvent = getTypeByEvent();
return {

@@ -87,0 +89,0 @@ toJson: event => {

@@ -1,2 +0,1 @@

import { IBeaconConfig } from "@chainsafe/lodestar-config";
import { Path } from "@chainsafe/ssz";

@@ -45,3 +44,3 @@ import { Proof } from "@chainsafe/persistent-merkle-tree";

export declare function getReqSerializers(): ReqSerializers<Api, ReqTypes>;
export declare function getReturnTypes(config: IBeaconConfig): ReturnTypes<Api>;
export declare function getReturnTypes(): ReturnTypes<Api>;
//# sourceMappingURL=lightclient.d.ts.map

@@ -10,2 +10,4 @@ "use strict";

var _lodestarTypes = require("@chainsafe/lodestar-types");
var _utils = require("../utils");

@@ -78,11 +80,11 @@

function getReturnTypes(config) {
function getReturnTypes() {
return {
// Just sent the proof JSON as-is
getStateProof: (0, _utils.sameType)(),
getBestUpdates: (0, _utils.ContainerData)((0, _utils.ArrayOf)(config.types.altair.LightClientUpdate)),
getLatestUpdateFinalized: (0, _utils.ContainerData)(config.types.altair.LightClientUpdate),
getLatestUpdateNonFinalized: (0, _utils.ContainerData)(config.types.altair.LightClientUpdate)
getBestUpdates: (0, _utils.ContainerData)((0, _utils.ArrayOf)(_lodestarTypes.ssz.altair.LightClientUpdate)),
getLatestUpdateFinalized: (0, _utils.ContainerData)(_lodestarTypes.ssz.altair.LightClientUpdate),
getLatestUpdateNonFinalized: (0, _utils.ContainerData)(_lodestarTypes.ssz.altair.LightClientUpdate)
};
}
//# sourceMappingURL=lightclient.js.map

@@ -1,2 +0,1 @@

import { IBeaconConfig } from "@chainsafe/lodestar-config";
import { allForks, Slot } from "@chainsafe/lodestar-types";

@@ -119,3 +118,3 @@ import { ReturnTypes, RoutesData, ReqSerializers, ReqEmpty } from "../utils";

export declare function getReqSerializers(): ReqSerializers<Api, ReqTypes>;
export declare function getReturnTypes(config: IBeaconConfig): ReturnTypes<Api>;
export declare function getReturnTypes(): ReturnTypes<Api>;
//# sourceMappingURL=node.d.ts.map

@@ -10,2 +10,4 @@ "use strict";

var _lodestarTypes = require("@chainsafe/lodestar-types");
var _ssz = require("@chainsafe/ssz");

@@ -88,3 +90,3 @@

function getReturnTypes(config) {
function getReturnTypes() {
const stringType = new _utils.StringType();

@@ -97,3 +99,3 @@ const NetworkIdentity = new _ssz.ContainerType({

discoveryAddresses: (0, _utils.ArrayOf)(stringType),
metadata: config.types.altair.Metadata
metadata: _lodestarTypes.ssz.altair.Metadata
}

@@ -100,0 +102,0 @@ });

import { Json } from "@chainsafe/ssz";
import { ForkName, IBeaconConfig } from "@chainsafe/lodestar-config";
import { ForkName } from "@chainsafe/lodestar-params";
import { allForks, altair, BLSPubkey, BLSSignature, CommitteeIndex, Epoch, Number64, phase0, Root, Slot, ValidatorIndex } from "@chainsafe/lodestar-types";

@@ -210,4 +210,4 @@ import { RoutesData, ReturnTypes, ReqSerializers } from "../utils";

};
export declare function getReqSerializers(config: IBeaconConfig): ReqSerializers<Api, ReqTypes>;
export declare function getReturnTypes(config: IBeaconConfig): ReturnTypes<Api>;
export declare function getReqSerializers(): ReqSerializers<Api, ReqTypes>;
export declare function getReturnTypes(): ReturnTypes<Api>;
//# sourceMappingURL=validator.d.ts.map

@@ -12,2 +12,4 @@ "use strict";

var _lodestarTypes = require("@chainsafe/lodestar-types");
var _utils = require("../utils");

@@ -68,10 +70,10 @@

function getReqSerializers(config) {
function getReqSerializers() {
const BeaconCommitteeSubscription = new _ssz.ContainerType({
fields: {
validatorIndex: config.types.ValidatorIndex,
committeeIndex: config.types.CommitteeIndex,
committeesAtSlot: config.types.Slot,
slot: config.types.Slot,
isAggregator: config.types.Boolean
validatorIndex: _lodestarTypes.ssz.ValidatorIndex,
committeeIndex: _lodestarTypes.ssz.CommitteeIndex,
committeesAtSlot: _lodestarTypes.ssz.Slot,
slot: _lodestarTypes.ssz.Slot,
isAggregator: _lodestarTypes.ssz.Boolean
}

@@ -81,5 +83,5 @@ });

fields: {
validatorIndex: config.types.ValidatorIndex,
syncCommitteeIndices: (0, _utils.ArrayOf)(config.types.CommitteeIndex),
untilEpoch: config.types.Epoch
validatorIndex: _lodestarTypes.ssz.ValidatorIndex,
syncCommitteeIndices: (0, _utils.ArrayOf)(_lodestarTypes.ssz.CommitteeIndex),
untilEpoch: _lodestarTypes.ssz.Epoch
}

@@ -216,4 +218,4 @@ });

},
publishAggregateAndProofs: (0, _utils.reqOnlyBody)((0, _utils.ArrayOf)(config.types.phase0.SignedAggregateAndProof), _utils.Schema.ObjectArray),
publishContributionAndProofs: (0, _utils.reqOnlyBody)((0, _utils.ArrayOf)(config.types.altair.SignedContributionAndProof), _utils.Schema.ObjectArray),
publishAggregateAndProofs: (0, _utils.reqOnlyBody)((0, _utils.ArrayOf)(_lodestarTypes.ssz.phase0.SignedAggregateAndProof), _utils.Schema.ObjectArray),
publishContributionAndProofs: (0, _utils.reqOnlyBody)((0, _utils.ArrayOf)(_lodestarTypes.ssz.altair.SignedContributionAndProof), _utils.Schema.ObjectArray),
prepareBeaconCommitteeSubnet: (0, _utils.reqOnlyBody)((0, _utils.ArrayOf)(BeaconCommitteeSubscription), _utils.Schema.ObjectArray),

@@ -224,7 +226,7 @@ prepareSyncCommitteeSubnets: (0, _utils.reqOnlyBody)((0, _utils.ArrayOf)(SyncCommitteeSubscription), _utils.Schema.ObjectArray)

function getReturnTypes(config) {
function getReturnTypes() {
const WithDependentRoot = dataType => new _ssz.ContainerType({
fields: {
data: dataType,
dependentRoot: config.types.Root
dependentRoot: _lodestarTypes.ssz.Root
}

@@ -235,9 +237,9 @@ });

fields: {
pubkey: config.types.BLSPubkey,
validatorIndex: config.types.ValidatorIndex,
committeeIndex: config.types.CommitteeIndex,
committeeLength: config.types.Number64,
committeesAtSlot: config.types.Number64,
validatorCommitteeIndex: config.types.Number64,
slot: config.types.Slot
pubkey: _lodestarTypes.ssz.BLSPubkey,
validatorIndex: _lodestarTypes.ssz.ValidatorIndex,
committeeIndex: _lodestarTypes.ssz.CommitteeIndex,
committeeLength: _lodestarTypes.ssz.Number64,
committeesAtSlot: _lodestarTypes.ssz.Number64,
validatorCommitteeIndex: _lodestarTypes.ssz.Number64,
slot: _lodestarTypes.ssz.Slot
}

@@ -247,5 +249,5 @@ });

fields: {
slot: config.types.Slot,
validatorIndex: config.types.ValidatorIndex,
pubkey: config.types.BLSPubkey
slot: _lodestarTypes.ssz.Slot,
validatorIndex: _lodestarTypes.ssz.ValidatorIndex,
pubkey: _lodestarTypes.ssz.BLSPubkey
}

@@ -255,5 +257,5 @@ });

fields: {
pubkey: config.types.BLSPubkey,
validatorIndex: config.types.ValidatorIndex,
validatorSyncCommitteeIndices: (0, _utils.ArrayOf)(config.types.Number64)
pubkey: _lodestarTypes.ssz.BLSPubkey,
validatorIndex: _lodestarTypes.ssz.ValidatorIndex,
validatorSyncCommitteeIndices: (0, _utils.ArrayOf)(_lodestarTypes.ssz.Number64)
}

@@ -265,8 +267,8 @@ });

getSyncCommitteeDuties: WithDependentRoot((0, _utils.ArrayOf)(SyncDuty)),
produceBlock: (0, _utils.WithVersion)(fork => config.types[fork].BeaconBlock),
produceAttestationData: (0, _utils.ContainerData)(config.types.phase0.AttestationData),
produceSyncCommitteeContribution: (0, _utils.ContainerData)(config.types.altair.SyncCommitteeContribution),
getAggregatedAttestation: (0, _utils.ContainerData)(config.types.phase0.Attestation)
produceBlock: (0, _utils.WithVersion)(fork => _lodestarTypes.ssz[fork].BeaconBlock),
produceAttestationData: (0, _utils.ContainerData)(_lodestarTypes.ssz.phase0.AttestationData),
produceSyncCommitteeContribution: (0, _utils.ContainerData)(_lodestarTypes.ssz.altair.SyncCommitteeContribution),
getAggregatedAttestation: (0, _utils.ContainerData)(_lodestarTypes.ssz.phase0.Attestation)
};
}
//# sourceMappingURL=validator.js.map

@@ -24,3 +24,3 @@ "use strict";

const reqSerializers = (0, _debug.getReqSerializers)();
const returnTypes = (0, _debug.getReturnTypes)(config);
const returnTypes = (0, _debug.getReturnTypes)();
const serverRoutes = (0, _utils2.getGenericJsonServer)({

@@ -27,0 +27,0 @@ routesData: _debug.routesData,

@@ -14,3 +14,3 @@ "use strict";

function getRoutes(config, api) {
const eventSerdes = (0, _events.getEventSerdes)(config);
const eventSerdes = (0, _events.getEventSerdes)();
return {

@@ -17,0 +17,0 @@ // Non-JSON route. Server Sent Events (SSE)

import { ContainerType, IJsonOptions, Json, ListType, Type } from "@chainsafe/ssz";
import { ForkName, IBeaconConfig } from "@chainsafe/lodestar-config";
import { ForkName } from "@chainsafe/lodestar-params";
import { IBeaconConfig } from "@chainsafe/lodestar-config";
import { Schema, SchemaDefinition } from "./schema";

@@ -4,0 +5,0 @@ /** All JSON must be sent in snake case */

@@ -14,3 +14,3 @@ {

},
"version": "0.23.0",
"version": "0.23.1-alpha.0+7ff5465",
"main": "lib/index.js",

@@ -38,6 +38,6 @@ "files": [

"dependencies": {
"@chainsafe/lodestar-config": "^0.23.0",
"@chainsafe/lodestar-params": "^0.23.0",
"@chainsafe/lodestar-types": "^0.23.0",
"@chainsafe/lodestar-utils": "^0.23.0",
"@chainsafe/lodestar-config": "^0.23.1-alpha.0+7ff5465",
"@chainsafe/lodestar-params": "^0.23.1-alpha.0+7ff5465",
"@chainsafe/lodestar-types": "^0.23.1-alpha.0+7ff5465",
"@chainsafe/lodestar-utils": "^0.23.1-alpha.0+7ff5465",
"@chainsafe/persistent-merkle-tree": "^0.3.2",

@@ -64,3 +64,4 @@ "@chainsafe/ssz": "^0.8.7",

"blockchain"
]
],
"gitHead": "7ff5465baa2414e78c9b0519ff3e262f1d09f36d"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc