Socket
Socket
Sign inDemoInstall

@chainsafe/lodestar-api

Package Overview
Dependencies
128
Maintainers
3
Versions
819
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.39.0-dev.5e735016cc to 0.39.0-dev.5e9288b64c

10

lib/beacon/routes/beacon/block.d.ts
import { ForkName } from "@chainsafe/lodestar-params";
import { IChainForkConfig } from "@chainsafe/lodestar-config";
import { phase0, allForks, Slot, Root } from "@chainsafe/lodestar-types";
import { phase0, allForks, Slot, Root, bellatrix } from "@chainsafe/lodestar-types";
import { RoutesData, ReturnTypes, ReqSerializers } from "../../../utils/index.js";

@@ -85,2 +85,7 @@ export declare type BlockId = "head" | "genesis" | "finalized" | string | number;

publishBlock(block: allForks.SignedBeaconBlock): Promise<void>;
/**
* Publish a signed blinded block by submitting it to the mev relay and patching in the block
* transactions beacon node gets in response.
*/
publishBlindedBlock(block: bellatrix.SignedBlindedBeaconBlock): Promise<void>;
};

@@ -111,2 +116,5 @@ /**

};
publishBlindedBlock: {
body: unknown;
};
};

@@ -113,0 +121,0 @@ export declare function getReqSerializers(config: IChainForkConfig): ReqSerializers<Api, ReqTypes>;

@@ -15,2 +15,3 @@ import { ContainerType } from "@chainsafe/ssz";

publishBlock: { url: "/eth/v1/beacon/blocks", method: "POST" },
publishBlindedBlock: { url: "/eth/v1/beacon/blinded_blocks", method: "POST" },
};

@@ -41,2 +42,3 @@ export function getReqSerializers(config) {

publishBlock: reqOnlyBody(AllForksSignedBeaconBlock, Schema.Object),
publishBlindedBlock: reqOnlyBody(ssz.bellatrix.SignedBlindedBeaconBlock, Schema.Object),
};

@@ -43,0 +45,0 @@ }

@@ -358,2 +358,133 @@ import { IChainForkConfig } from "@chainsafe/lodestar-config";

}>;
publishBlindedBlock: import("../../../utils/types.js").ReqSerializer<(block: import("@chainsafe/ssz/lib/view/container").ValueOfFields<{
message: import("@chainsafe/ssz").ContainerType<{
slot: import("@chainsafe/ssz").UintNumberType;
proposerIndex: import("@chainsafe/ssz").UintNumberType;
parentRoot: import("@chainsafe/ssz").ByteVectorType;
stateRoot: import("@chainsafe/ssz").ByteVectorType;
body: import("@chainsafe/ssz").ContainerType<{
executionPayloadHeader: import("@chainsafe/ssz").ContainerType<{
transactionsRoot: import("@chainsafe/ssz").ByteVectorType;
parentHash: import("@chainsafe/ssz").ByteVectorType;
feeRecipient: import("@chainsafe/ssz").ByteVectorType;
stateRoot: import("@chainsafe/ssz").ByteVectorType;
receiptsRoot: import("@chainsafe/ssz").ByteVectorType;
logsBloom: import("@chainsafe/ssz").ByteVectorType;
prevRandao: import("@chainsafe/ssz").ByteVectorType;
blockNumber: import("@chainsafe/ssz").UintNumberType;
gasLimit: import("@chainsafe/ssz").UintNumberType;
gasUsed: import("@chainsafe/ssz").UintNumberType;
timestamp: import("@chainsafe/ssz").UintNumberType;
extraData: import("@chainsafe/ssz").ByteListType;
baseFeePerGas: import("@chainsafe/ssz").UintBigintType;
blockHash: import("@chainsafe/ssz").ByteVectorType;
}>;
syncAggregate: import("@chainsafe/ssz").ContainerType<{
syncCommitteeBits: import("@chainsafe/ssz").BitVectorType;
syncCommitteeSignature: import("@chainsafe/ssz").ByteVectorType;
}>;
randaoReveal: import("@chainsafe/ssz").ByteVectorType;
eth1Data: import("@chainsafe/ssz").ContainerType<{
depositRoot: import("@chainsafe/ssz").ByteVectorType;
depositCount: import("@chainsafe/ssz").UintNumberType;
blockHash: import("@chainsafe/ssz").ByteVectorType;
}>;
graffiti: import("@chainsafe/ssz").ByteVectorType;
proposerSlashings: import("@chainsafe/ssz").ListCompositeType<import("@chainsafe/ssz").ContainerType<{
signedHeader1: import("@chainsafe/ssz").ContainerType<{
message: import("@chainsafe/ssz").ContainerType<{
slot: import("@chainsafe/ssz").UintBigintType;
proposerIndex: import("@chainsafe/ssz").UintNumberType;
parentRoot: import("@chainsafe/ssz").ByteVectorType;
stateRoot: import("@chainsafe/ssz").ByteVectorType;
bodyRoot: import("@chainsafe/ssz").ByteVectorType;
}>;
signature: import("@chainsafe/ssz").ByteVectorType;
}>;
signedHeader2: import("@chainsafe/ssz").ContainerType<{
message: import("@chainsafe/ssz").ContainerType<{
slot: import("@chainsafe/ssz").UintBigintType;
proposerIndex: import("@chainsafe/ssz").UintNumberType;
parentRoot: import("@chainsafe/ssz").ByteVectorType;
stateRoot: import("@chainsafe/ssz").ByteVectorType;
bodyRoot: import("@chainsafe/ssz").ByteVectorType;
}>;
signature: import("@chainsafe/ssz").ByteVectorType;
}>;
}>>;
attesterSlashings: import("@chainsafe/ssz").ListCompositeType<import("@chainsafe/ssz").ContainerType<{
attestation1: import("@chainsafe/ssz").ContainerType<{
attestingIndices: import("@chainsafe/ssz").ListBasicType<import("@chainsafe/ssz").UintNumberType>;
data: import("@chainsafe/ssz").ContainerType<{
slot: import("@chainsafe/ssz").UintBigintType;
index: import("@chainsafe/ssz").UintBigintType;
beaconBlockRoot: import("@chainsafe/ssz").ByteVectorType;
source: import("@chainsafe/ssz").ContainerType<{
epoch: import("@chainsafe/ssz").UintBigintType;
root: import("@chainsafe/ssz").ByteVectorType;
}>;
target: import("@chainsafe/ssz").ContainerType<{
epoch: import("@chainsafe/ssz").UintBigintType;
root: import("@chainsafe/ssz").ByteVectorType;
}>;
}>;
signature: import("@chainsafe/ssz").ByteVectorType;
}>;
attestation2: import("@chainsafe/ssz").ContainerType<{
attestingIndices: import("@chainsafe/ssz").ListBasicType<import("@chainsafe/ssz").UintNumberType>;
data: import("@chainsafe/ssz").ContainerType<{
slot: import("@chainsafe/ssz").UintBigintType;
index: import("@chainsafe/ssz").UintBigintType;
beaconBlockRoot: import("@chainsafe/ssz").ByteVectorType;
source: import("@chainsafe/ssz").ContainerType<{
epoch: import("@chainsafe/ssz").UintBigintType;
root: import("@chainsafe/ssz").ByteVectorType;
}>;
target: import("@chainsafe/ssz").ContainerType<{
epoch: import("@chainsafe/ssz").UintBigintType;
root: import("@chainsafe/ssz").ByteVectorType;
}>;
}>;
signature: import("@chainsafe/ssz").ByteVectorType;
}>;
}>>;
attestations: import("@chainsafe/ssz").ListCompositeType<import("@chainsafe/ssz").ContainerType<{
aggregationBits: import("@chainsafe/ssz").BitListType;
data: import("@chainsafe/ssz").ContainerType<{
slot: import("@chainsafe/ssz").UintNumberType;
index: import("@chainsafe/ssz").UintNumberType;
beaconBlockRoot: import("@chainsafe/ssz").ByteVectorType;
source: import("@chainsafe/ssz").ContainerType<{
epoch: import("@chainsafe/ssz").UintNumberType;
root: import("@chainsafe/ssz").ByteVectorType;
}>;
target: import("@chainsafe/ssz").ContainerType<{
epoch: import("@chainsafe/ssz").UintNumberType;
root: import("@chainsafe/ssz").ByteVectorType;
}>;
}>;
signature: import("@chainsafe/ssz").ByteVectorType;
}>>;
deposits: import("@chainsafe/ssz").ListCompositeType<import("@chainsafe/ssz").ContainerType<{
proof: import("@chainsafe/ssz").VectorCompositeType<import("@chainsafe/ssz").ByteVectorType>;
data: import("@chainsafe/ssz").ContainerType<{
pubkey: import("@chainsafe/ssz").ByteVectorType;
withdrawalCredentials: import("@chainsafe/ssz").ByteVectorType;
amount: import("@chainsafe/ssz").UintNumberType;
signature: import("@chainsafe/ssz").ByteVectorType;
}>;
}>>;
voluntaryExits: import("@chainsafe/ssz").ListCompositeType<import("@chainsafe/ssz").ContainerType<{
message: import("@chainsafe/ssz").ContainerType<{
epoch: import("@chainsafe/ssz").UintNumberType;
validatorIndex: import("@chainsafe/ssz").UintNumberType;
}>;
signature: import("@chainsafe/ssz").ByteVectorType;
}>>;
}>;
}>;
signature: import("@chainsafe/ssz").ByteVectorType;
}>) => Promise<void>, {
body: unknown;
}>;
getGenesis: import("../../../utils/types.js").ReqSerializer<() => void, import("../../../utils/types.js").ReqGeneric>;

@@ -360,0 +491,0 @@ };

import { ForkName } from "@chainsafe/lodestar-params";
import { allForks, altair, BLSPubkey, BLSSignature, CommitteeIndex, Epoch, phase0, Root, Slot, UintNum64, ValidatorIndex } from "@chainsafe/lodestar-types";
import { allForks, altair, BLSPubkey, BLSSignature, CommitteeIndex, Epoch, phase0, bellatrix, Root, Slot, UintNum64, ValidatorIndex } from "@chainsafe/lodestar-types";
import { RoutesData, ReturnTypes, ReqSerializers } from "../../utils/index.js";

@@ -51,2 +51,7 @@ export declare type BeaconCommitteeSubscription = {

};
export declare type LivenessResponseData = {
index: ValidatorIndex;
epoch: Epoch;
isLive: boolean;
};
export declare type Api = {

@@ -115,2 +120,6 @@ /**

}>;
produceBlindedBlock(slot: Slot, randaoReveal: BLSSignature, graffiti: string): Promise<{
data: bellatrix.BlindedBeaconBlock;
version: ForkName;
}>;
/**

@@ -169,2 +178,7 @@ * Produce an attestation data

prepareBeaconProposer(proposers: ProposerPreparationData[]): Promise<void>;
/** Returns validator indices that have been observed to be active on the network */
getLiveness(indices: ValidatorIndex[], epoch: Epoch): Promise<{
data: LivenessResponseData[];
}>;
registerValidator(registrations: bellatrix.SignedValidatorRegistrationV1[]): Promise<void>;
};

@@ -211,2 +225,11 @@ /**

};
produceBlindedBlock: {
params: {
slot: number;
};
query: {
randao_reveal: string;
grafitti: string;
};
};
produceAttestationData: {

@@ -246,2 +269,11 @@ query: {

};
getLiveness: {
query: {
indices: ValidatorIndex[];
epoch: Epoch;
};
};
registerValidator: {
body: unknown;
};
};

@@ -248,0 +280,0 @@ export declare function getReqSerializers(): ReqSerializers<Api, ReqTypes>;

@@ -13,2 +13,3 @@ import { ContainerType, fromHexString, toHexString } from "@chainsafe/ssz";

produceBlockV2: { url: "/eth/v2/validator/blocks/:slot", method: "GET" },
produceBlindedBlock: { url: "/eth/v2/validator/blinded_blocks/:slot", method: "GET" },
produceAttestationData: { url: "/eth/v1/validator/attestation_data", method: "GET" },

@@ -22,2 +23,4 @@ produceSyncCommitteeContribution: { url: "/eth/v1/validator/sync_committee_contribution", method: "GET" },

prepareBeaconProposer: { url: "/eth/v1/validator/prepare_beacon_proposer", method: "POST" },
getLiveness: { url: "/eth/v1/validator/liveness", method: "GET" },
registerValidator: { url: "/eth/v1/validator/register_validator", method: "POST" },
};

@@ -74,2 +77,3 @@ export function getReqSerializers() {

produceBlockV2: produceBlock,
produceBlindedBlock: produceBlock,
produceAttestationData: {

@@ -113,2 +117,8 @@ writeReq: (index, slot) => ({ query: { slot, committee_index: index } }),

},
getLiveness: {
writeReq: (indices, epoch) => ({ query: { indices, epoch } }),
parseReq: ({ query }) => [query.indices, query.epoch],
schema: { query: { indices: Schema.UintArray, epoch: Schema.Uint } },
},
registerValidator: reqOnlyBody(ArrayOf(ssz.bellatrix.SignedValidatorRegistrationV1), Schema.ObjectArray),
};

@@ -144,7 +154,9 @@ }

produceBlockV2: WithVersion((fork) => ssz[fork].BeaconBlock),
produceBlindedBlock: WithVersion((_fork) => ssz.bellatrix.BlindedBeaconBlock),
produceAttestationData: ContainerData(ssz.phase0.AttestationData),
produceSyncCommitteeContribution: ContainerData(ssz.altair.SyncCommitteeContribution),
getAggregatedAttestation: ContainerData(ssz.phase0.Attestation),
getLiveness: jsonType("camel"),
};
}
//# sourceMappingURL=validator.js.map

@@ -0,4 +1,12 @@

import { bellatrix, Slot, Root, BLSPubkey } from "@chainsafe/lodestar-types";
import { ReturnTypes, RoutesData, ReqSerializers, ReqEmpty } from "../utils/index.js";
export declare type Api = {
checkStatus(): Promise<void>;
registerValidator(registrations: bellatrix.SignedValidatorRegistrationV1[]): Promise<void>;
getPayloadHeader(slot: Slot, parentHash: Root, proposerPubKey: BLSPubkey): Promise<{
data: bellatrix.SignedBuilderBid;
}>;
submitSignedBlindedBlock(signedBlock: bellatrix.SignedBlindedBeaconBlock): Promise<{
data: bellatrix.ExecutionPayload;
}>;
};

@@ -11,2 +19,15 @@ /**

checkStatus: ReqEmpty;
registerValidator: {
body: unknown;
};
getPayloadHeader: {
params: {
slot: Slot;
parent_hash: string;
pubkey: string;
};
};
submitSignedBlindedBlock: {
body: unknown;
};
};

@@ -13,0 +34,0 @@ export declare function getReqSerializers(): ReqSerializers<Api, ReqTypes>;

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

import { reqEmpty } from "../utils/index.js";
import { ssz } from "@chainsafe/lodestar-types";
import { fromHexString, toHexString } from "@chainsafe/ssz";
import { Schema, reqOnlyBody, ContainerData, reqEmpty, ArrayOf, } from "../utils/index.js";
/**

@@ -7,2 +9,5 @@ * Define javascript values for each route

checkStatus: { url: "/eth/v1/builder/status", method: "GET" },
registerValidator: { url: "/eth/v1/builder/validators", method: "POST" },
getPayloadHeader: { url: "/eth/v1/builder/header/:slot/:parent_hash/:pubkey", method: "GET" },
submitSignedBlindedBlock: { url: "/eth/v1/builder/blinded_blocks", method: "POST" },
};

@@ -12,7 +17,21 @@ export function getReqSerializers() {

checkStatus: reqEmpty,
registerValidator: reqOnlyBody(ArrayOf(ssz.bellatrix.SignedValidatorRegistrationV1), Schema.ObjectArray),
getPayloadHeader: {
writeReq: (slot, parentHash, proposerPubKey) => ({
params: { slot, parent_hash: toHexString(parentHash), pubkey: toHexString(proposerPubKey) },
}),
parseReq: ({ params }) => [params.slot, fromHexString(params.parent_hash), fromHexString(params.pubkey)],
schema: {
params: { slot: Schema.UintRequired, parent_hash: Schema.StringRequired, pubkey: Schema.StringRequired },
},
},
submitSignedBlindedBlock: reqOnlyBody(ssz.bellatrix.SignedBlindedBeaconBlock, Schema.Object),
};
}
export function getReturnTypes() {
return {};
return {
getPayloadHeader: ContainerData(ssz.bellatrix.SignedBuilderBid),
submitSignedBlindedBlock: ContainerData(ssz.bellatrix.ExecutionPayload),
};
}
//# sourceMappingURL=routes.js.map

2

lib/keymanager/index.d.ts
import { IChainForkConfig } from "@chainsafe/lodestar-config";
import { IHttpClient, HttpClientModules, HttpClientOptions } from "../utils/client/index.js";
import { Api } from "./routes.js";
export { ImportStatus, DeletionStatus, KeystoreStr, SlashingProtectionData, PubkeyHex, Api } from "./routes.js";
export { ImportStatus, DeletionStatus, ImportRemoteKeyStatus, DeleteRemoteKeyStatus, ResponseStatus, SignerDefinition, KeystoreStr, SlashingProtectionData, PubkeyHex, Api, } from "./routes.js";
declare type ClientModules = HttpClientModules & {

@@ -6,0 +6,0 @@ config: IChainForkConfig;

import { HttpClient } from "../utils/client/index.js";
import * as keymanager from "./client.js";
// NOTE: Don't export server here so it's not bundled to all consumers
export { ImportStatus, DeletionStatus } from "./routes.js";
export { ImportStatus, DeletionStatus, ImportRemoteKeyStatus, DeleteRemoteKeyStatus, } from "./routes.js";
/**

@@ -6,0 +6,0 @@ * REST HTTP client for all keymanager routes

@@ -20,2 +20,36 @@ import { ReturnTypes, RoutesData, ReqSerializers, ReqEmpty } from "../utils/index.js";

}
export declare enum ImportRemoteKeyStatus {
/** Remote key successfully imported to validator client permanent storage */
imported = "imported",
/** Remote key's pubkey is already known to the validator client */
duplicate = "duplicate",
/** Any other status different to the above: I/O errors, etc. */
error = "error"
}
export declare enum DeleteRemoteKeyStatus {
/** key was active and removed */
deleted = "deleted",
/** key was not found to be removed */
not_found = "not_found",
/**
* unexpected condition meant the key could not be removed (the key was actually found,
* but we couldn't stop using it) - this would be a sign that making it active elsewhere would
* almost certainly cause you headaches / slashing conditions etc.
*/
error = "error"
}
export declare type ResponseStatus<Status> = {
status: Status;
message?: string;
};
export declare type SignerDefinition = {
pubkey: PubkeyHex;
/**
* URL to API implementing EIP-3030: BLS Remote Signer HTTP API
* `"https://remote.signer"`
*/
url: string;
/** The signer associated with this pubkey cannot be deleted from the API */
readonly: boolean;
};
/**

@@ -42,18 +76,2 @@ * JSON serialized representation of a single keystore in EIP-2335: BLS12-381 Keystore format.

export declare type PubkeyHex = string;
declare type Statuses<Status> = {
status: Status;
message?: string;
}[];
declare type ImportKeystoresReq = {
keystores: KeystoreStr[];
passwords: string[];
slashingProtection: SlashingProtectionData;
};
declare type ListKeysResponse = {
validatingPubkey: PubkeyHex;
/** The derivation path (if present in the imported keystore) */
derivationPath?: string;
/** The key associated with this pubkey cannot be deleted from the API */
readonly?: boolean;
};
export declare type Api = {

@@ -66,3 +84,9 @@ /**

listKeys(): Promise<{
data: ListKeysResponse[];
data: {
validatingPubkey: PubkeyHex;
/** The derivation path (if present in the imported keystore) */
derivationPath?: string;
/** The key associated with this pubkey cannot be deleted from the API */
readonly?: boolean;
}[];
}>;

@@ -83,3 +107,3 @@ /**

importKeystores(keystoresStr: KeystoreStr[], passwords: string[], slashingProtectionStr: SlashingProtectionData): Promise<{
data: Statuses<ImportStatus>;
data: ResponseStatus<ImportStatus>[];
}>;

@@ -108,5 +132,20 @@ /**

deleteKeystores(pubkeysHex: string[]): Promise<{
data: Statuses<DeletionStatus>;
data: ResponseStatus<DeletionStatus>[];
slashingProtection: SlashingProtectionData;
}>;
/**
* List all remote validating pubkeys known to this validator client binary
*/
listRemoteKeys(): Promise<{
data: SignerDefinition[];
}>;
/**
* Import remote keys for the validator client to request duties for
*/
importRemoteKeys(remoteSigners: Pick<SignerDefinition, "pubkey" | "url">[]): Promise<{
data: ResponseStatus<ImportRemoteKeyStatus>[];
}>;
deleteRemoteKeys(pubkeys: PubkeyHex[]): Promise<{
data: ResponseStatus<DeleteRemoteKeyStatus>[];
}>;
};

@@ -117,3 +156,7 @@ export declare const routesData: RoutesData<Api>;

importKeystores: {
body: ImportKeystoresReq;
body: {
keystores: KeystoreStr[];
passwords: string[];
slashingProtection: SlashingProtectionData;
};
};

@@ -125,6 +168,16 @@ deleteKeystores: {

};
listRemoteKeys: ReqEmpty;
importRemoteKeys: {
body: {
remoteKeys: Pick<SignerDefinition, "pubkey" | "url">[];
};
};
deleteRemoteKeys: {
body: {
pubkeys: string[];
};
};
};
export declare function getReqSerializers(): ReqSerializers<Api, ReqTypes>;
export declare function getReturnTypes(): ReturnTypes<Api>;
export {};
//# sourceMappingURL=routes.d.ts.map

@@ -22,2 +22,24 @@ import { Schema, reqEmpty, jsonType } from "../utils/index.js";

})(DeletionStatus || (DeletionStatus = {}));
export var ImportRemoteKeyStatus;
(function (ImportRemoteKeyStatus) {
/** Remote key successfully imported to validator client permanent storage */
ImportRemoteKeyStatus["imported"] = "imported";
/** Remote key's pubkey is already known to the validator client */
ImportRemoteKeyStatus["duplicate"] = "duplicate";
/** Any other status different to the above: I/O errors, etc. */
ImportRemoteKeyStatus["error"] = "error";
})(ImportRemoteKeyStatus || (ImportRemoteKeyStatus = {}));
export var DeleteRemoteKeyStatus;
(function (DeleteRemoteKeyStatus) {
/** key was active and removed */
DeleteRemoteKeyStatus["deleted"] = "deleted";
/** key was not found to be removed */
DeleteRemoteKeyStatus["not_found"] = "not_found";
/**
* unexpected condition meant the key could not be removed (the key was actually found,
* but we couldn't stop using it) - this would be a sign that making it active elsewhere would
* almost certainly cause you headaches / slashing conditions etc.
*/
DeleteRemoteKeyStatus["error"] = "error";
})(DeleteRemoteKeyStatus || (DeleteRemoteKeyStatus = {}));
export const routesData = {

@@ -27,2 +49,5 @@ listKeys: { url: "/eth/v1/keystores", method: "GET" },

deleteKeystores: { url: "/eth/v1/keystores", method: "DELETE" },
listRemoteKeys: { url: "/eth/v1/remotekeys", method: "GET" },
importRemoteKeys: { url: "/eth/v1/remotekeys", method: "POST" },
deleteRemoteKeys: { url: "/eth/v1/remotekeys", method: "DELETE" },
};

@@ -42,2 +67,13 @@ export function getReqSerializers() {

},
listRemoteKeys: reqEmpty,
importRemoteKeys: {
writeReq: (remoteKeys) => ({ body: { remoteKeys } }),
parseReq: ({ body: { remoteKeys } }) => [remoteKeys],
schema: { body: Schema.Object },
},
deleteRemoteKeys: {
writeReq: (pubkeys) => ({ body: { pubkeys } }),
parseReq: ({ body: { pubkeys } }) => [pubkeys],
schema: { body: Schema.Object },
},
};

@@ -51,4 +87,7 @@ }

deleteKeystores: jsonType("camel"),
listRemoteKeys: jsonType("camel"),
importRemoteKeys: jsonType("camel"),
deleteRemoteKeys: jsonType("camel"),
};
}
//# sourceMappingURL=routes.js.map

@@ -28,2 +28,3 @@ import { fetch } from "cross-fetch";

timeoutMs?: number;
bearerToken?: string;
/** Return an AbortSignal to be attached to all requests */

@@ -41,2 +42,3 @@ getAbortSignal?: () => AbortSignal | undefined;

private readonly timeoutMs;
private readonly bearerToken?;
private readonly getAbortSignal?;

@@ -43,0 +45,0 @@ private readonly fetch;

@@ -20,2 +20,3 @@ import { fetch } from "cross-fetch";

this.timeoutMs = (_a = opts.timeoutMs) !== null && _a !== void 0 ? _a : 60000;
this.bearerToken = opts.bearerToken;
this.getAbortSignal = opts.getAbortSignal;

@@ -49,4 +50,8 @@ this.fetch = (_b = opts.fetch) !== null && _b !== void 0 ? _b : fetch;

const headers = opts.headers || {};
if (opts.body)
if (opts.body && headers["Content-Type"] === undefined) {
headers["Content-Type"] = "application/json";
}
if (this.bearerToken && headers["Authorization"] === undefined) {
headers["Authorization"] = `Bearer ${this.bearerToken}`;
}
(_c = this.logger) === null || _c === void 0 ? void 0 : _c.debug("HttpClient request", { routeId });

@@ -53,0 +58,0 @@ const res = await this.fetch(url, {

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

},
"version": "0.39.0-dev.5e735016cc",
"version": "0.39.0-dev.5e9288b64c",
"type": "module",

@@ -73,6 +73,6 @@ "exports": {

"dependencies": {
"@chainsafe/lodestar-config": "0.39.0-dev.5e735016cc",
"@chainsafe/lodestar-params": "0.39.0-dev.5e735016cc",
"@chainsafe/lodestar-types": "0.39.0-dev.5e735016cc",
"@chainsafe/lodestar-utils": "0.39.0-dev.5e735016cc",
"@chainsafe/lodestar-config": "0.39.0-dev.5e9288b64c",
"@chainsafe/lodestar-params": "0.39.0-dev.5e9288b64c",
"@chainsafe/lodestar-types": "0.39.0-dev.5e9288b64c",
"@chainsafe/lodestar-utils": "0.39.0-dev.5e9288b64c",
"@chainsafe/persistent-merkle-tree": "^0.4.2",

@@ -99,3 +99,3 @@ "@chainsafe/ssz": "^0.9.2",

],
"gitHead": "a17af58e97cafb40b2ddcdddb9af6009f2e79b46"
"gitHead": "ada6403cbc7d49a4f19bf9460ed9ced7f0cab3b3"
}

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc