@chainsafe/lodestar-api
Advanced tools
Comparing version 0.39.0-dev.4c439ad456 to 0.39.0-dev.4d7852e106
@@ -1,4 +0,3 @@ | ||
export * as routes from "./routes/index.js"; | ||
export * from "./interface.js"; | ||
export { getClient, HttpClient, HttpClientOptions, HttpError } from "./client/index.js"; | ||
export * from "./beacon/index.js"; | ||
export { HttpClient, IHttpClient, HttpClientOptions, HttpClientModules, HttpError } from "./utils/client/index.js"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,5 +0,5 @@ | ||
export * as routes from "./routes/index.js"; | ||
export * from "./interface.js"; | ||
export { getClient, HttpClient, HttpError } from "./client/index.js"; | ||
// Node: Don't export server here so it's not bundled to all consumers | ||
// Re-exporting beacon only for backwards compatibility | ||
export * from "./beacon/index.js"; | ||
export { HttpClient, HttpError } from "./utils/client/index.js"; | ||
// NOTE: Don't export server here so it's not bundled to all consumers | ||
//# sourceMappingURL=index.js.map |
import { IChainForkConfig } from "@chainsafe/lodestar-config"; | ||
import { IHttpClient } from "../client/utils/index.js"; | ||
import { IHttpClient } from "../utils/client/index.js"; | ||
import { Api } from "./routes.js"; | ||
export declare function getClient(_config: IChainForkConfig, httpClient: IHttpClient): Api; | ||
//# sourceMappingURL=client.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { generateGenericJsonClient } from "../client/utils/index.js"; | ||
import { generateGenericJsonClient } from "../utils/client/index.js"; | ||
import { routesData, getReqSerializers, getReturnTypes } from "./routes.js"; | ||
@@ -3,0 +3,0 @@ export function getClient(_config, httpClient) { |
import { IChainForkConfig } from "@chainsafe/lodestar-config"; | ||
import { HttpClientOptions } from "../client/index.js"; | ||
import { IHttpClient } from "../client/utils/index.js"; | ||
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 & { | ||
config: IChainForkConfig; | ||
httpClient?: IHttpClient; | ||
}; | ||
/** | ||
* REST HTTP client for all keymanager routes | ||
*/ | ||
export declare function getClient(config: IChainForkConfig, opts: HttpClientOptions, httpClient?: IHttpClient): Api; | ||
export declare function getClient(opts: HttpClientOptions, modules: ClientModules): Api; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,12 +0,14 @@ | ||
import { HttpClient } from "../client/index.js"; | ||
import { HttpClient } from "../utils/client/index.js"; | ||
import * as keymanager from "./client.js"; | ||
export { ImportStatus, DeletionStatus } from "./routes.js"; | ||
// NOTE: Don't export server here so it's not bundled to all consumers | ||
export { ImportStatus, DeletionStatus, ImportRemoteKeyStatus, DeleteRemoteKeyStatus, } from "./routes.js"; | ||
/** | ||
* REST HTTP client for all keymanager routes | ||
*/ | ||
export function getClient(config, opts, httpClient) { | ||
if (!httpClient) | ||
httpClient = new HttpClient(opts); | ||
export function getClient(opts, modules) { | ||
var _a; | ||
const { config } = modules; | ||
const httpClient = (_a = modules.httpClient) !== null && _a !== void 0 ? _a : new HttpClient(opts, modules); | ||
return keymanager.getClient(config, httpClient); | ||
} | ||
//# sourceMappingURL=index.js.map |
@@ -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 |
@@ -14,3 +14,3 @@ { | ||
}, | ||
"version": "0.39.0-dev.4c439ad456", | ||
"version": "0.39.0-dev.4d7852e106", | ||
"type": "module", | ||
@@ -21,2 +21,14 @@ "exports": { | ||
}, | ||
"./beacon": { | ||
"import": "./lib/beacon/index.js" | ||
}, | ||
"./beacon/server": { | ||
"import": "./lib/beacon/server/index.js" | ||
}, | ||
"./builder": { | ||
"import": "./lib/builder/index.js" | ||
}, | ||
"./builder/server": { | ||
"import": "./lib/builder/server/index.js" | ||
}, | ||
"./keymanager": { | ||
@@ -26,6 +38,3 @@ "import": "./lib/keymanager/index.js" | ||
"./keymanager/server": { | ||
"import": "./lib/keymanager/server.js" | ||
}, | ||
"./server": { | ||
"import": "./lib/server/index.js" | ||
"import": "./lib/keymanager/server/index.js" | ||
} | ||
@@ -66,6 +75,6 @@ }, | ||
"dependencies": { | ||
"@chainsafe/lodestar-config": "0.39.0-dev.4c439ad456", | ||
"@chainsafe/lodestar-params": "0.39.0-dev.4c439ad456", | ||
"@chainsafe/lodestar-types": "0.39.0-dev.4c439ad456", | ||
"@chainsafe/lodestar-utils": "0.39.0-dev.4c439ad456", | ||
"@chainsafe/lodestar-config": "0.39.0-dev.4d7852e106", | ||
"@chainsafe/lodestar-params": "0.39.0-dev.4d7852e106", | ||
"@chainsafe/lodestar-types": "0.39.0-dev.4d7852e106", | ||
"@chainsafe/lodestar-utils": "0.39.0-dev.4d7852e106", | ||
"@chainsafe/persistent-merkle-tree": "^0.4.2", | ||
@@ -75,3 +84,2 @@ "@chainsafe/ssz": "^0.9.2", | ||
"eventsource": "^2.0.2", | ||
"fastify": "3.15.1", | ||
"qs": "^6.10.1" | ||
@@ -81,3 +89,4 @@ }, | ||
"@types/eventsource": "^1.1.5", | ||
"@types/qs": "^6.9.6" | ||
"@types/qs": "^6.9.6", | ||
"fastify": "3.15.1" | ||
}, | ||
@@ -94,3 +103,3 @@ "peerDependencies": { | ||
], | ||
"gitHead": "031c2373e7312d3b8f14998bfffb53b8d4b20445" | ||
"gitHead": "7fb8648b4c4a3d8524e39da4dc1eefca10a2254b" | ||
} |
@@ -41,3 +41,3 @@ # Lodestar Eth Consensus API | ||
- Follow the [installation guide](https://chainsafe.github.io/lodestar/installation) to install Lodestar. | ||
- Follow the [installation guide](https://chainsafe.github.io/lodestar/) to install Lodestar. | ||
- Quickly try out the whole stack by [starting a local testnet](https://chainsafe.github.io/lodestar/usage/local). | ||
@@ -44,0 +44,0 @@ - View the [typedoc code docs](https://chainsafe.github.io/lodestar/packages). |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
268713
10
165
4152
3
2
+ Added@chainsafe/lodestar-config@0.39.0-dev.4d7852e106(transitive)
+ Added@chainsafe/lodestar-params@0.39.0-dev.4d7852e106(transitive)
+ Added@chainsafe/lodestar-types@0.39.0-dev.4d7852e106(transitive)
+ Added@chainsafe/lodestar-utils@0.39.0-dev.4d7852e106(transitive)
- Removedfastify@3.15.1
- Removed@chainsafe/lodestar-config@0.39.0-dev.4c439ad456(transitive)
- Removed@chainsafe/lodestar-params@0.39.0-dev.4c439ad456(transitive)
- Removed@chainsafe/lodestar-types@0.39.0-dev.4c439ad456(transitive)
- Removed@chainsafe/lodestar-utils@0.39.0-dev.4c439ad456(transitive)