@degengineering/web3pgp-cli 1.0.0
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.
- package/LICENSE +21 -0
- package/README.md +151 -0
- package/dist/commands/blockchain/addSubkey.d.ts +9 -0
- package/dist/commands/blockchain/addSubkey.d.ts.map +1 -0
- package/dist/commands/blockchain/addSubkey.js +49 -0
- package/dist/commands/blockchain/addSubkey.js.map +1 -0
- package/dist/commands/blockchain/certify.d.ts +13 -0
- package/dist/commands/blockchain/certify.d.ts.map +1 -0
- package/dist/commands/blockchain/certify.js +75 -0
- package/dist/commands/blockchain/certify.js.map +1 -0
- package/dist/commands/blockchain/challenge.d.ts +13 -0
- package/dist/commands/blockchain/challenge.d.ts.map +1 -0
- package/dist/commands/blockchain/challenge.js +58 -0
- package/dist/commands/blockchain/challenge.js.map +1 -0
- package/dist/commands/blockchain/generateKey.d.ts +7 -0
- package/dist/commands/blockchain/generateKey.d.ts.map +1 -0
- package/dist/commands/blockchain/generateKey.js +36 -0
- package/dist/commands/blockchain/generateKey.js.map +1 -0
- package/dist/commands/blockchain/getPublicKey.d.ts +9 -0
- package/dist/commands/blockchain/getPublicKey.d.ts.map +1 -0
- package/dist/commands/blockchain/getPublicKey.js +37 -0
- package/dist/commands/blockchain/getPublicKey.js.map +1 -0
- package/dist/commands/blockchain/index.d.ts +12 -0
- package/dist/commands/blockchain/index.d.ts.map +1 -0
- package/dist/commands/blockchain/index.js +33 -0
- package/dist/commands/blockchain/index.js.map +1 -0
- package/dist/commands/blockchain/keccak256.d.ts +7 -0
- package/dist/commands/blockchain/keccak256.d.ts.map +1 -0
- package/dist/commands/blockchain/keccak256.js +38 -0
- package/dist/commands/blockchain/keccak256.js.map +1 -0
- package/dist/commands/blockchain/listen.d.ts +9 -0
- package/dist/commands/blockchain/listen.d.ts.map +1 -0
- package/dist/commands/blockchain/listen.js +30 -0
- package/dist/commands/blockchain/listen.js.map +1 -0
- package/dist/commands/blockchain/prove.d.ts +13 -0
- package/dist/commands/blockchain/prove.d.ts.map +1 -0
- package/dist/commands/blockchain/prove.js +123 -0
- package/dist/commands/blockchain/prove.js.map +1 -0
- package/dist/commands/blockchain/register.d.ts +13 -0
- package/dist/commands/blockchain/register.d.ts.map +1 -0
- package/dist/commands/blockchain/register.js +65 -0
- package/dist/commands/blockchain/register.js.map +1 -0
- package/dist/commands/blockchain/revoke-certification.d.ts +13 -0
- package/dist/commands/blockchain/revoke-certification.d.ts.map +1 -0
- package/dist/commands/blockchain/revoke-certification.js +75 -0
- package/dist/commands/blockchain/revoke-certification.js.map +1 -0
- package/dist/commands/blockchain/revoke.d.ts +19 -0
- package/dist/commands/blockchain/revoke.d.ts.map +1 -0
- package/dist/commands/blockchain/revoke.js +118 -0
- package/dist/commands/blockchain/revoke.js.map +1 -0
- package/dist/commands/blockchain/sync.d.ts +20 -0
- package/dist/commands/blockchain/sync.d.ts.map +1 -0
- package/dist/commands/blockchain/sync.js +246 -0
- package/dist/commands/blockchain/sync.js.map +1 -0
- package/dist/commands/blockchain/update.d.ts +13 -0
- package/dist/commands/blockchain/update.d.ts.map +1 -0
- package/dist/commands/blockchain/update.js +60 -0
- package/dist/commands/blockchain/update.js.map +1 -0
- package/dist/commands/configuration/display.d.ts +10 -0
- package/dist/commands/configuration/display.d.ts.map +1 -0
- package/dist/commands/configuration/display.js +58 -0
- package/dist/commands/configuration/display.js.map +1 -0
- package/dist/commands/configuration/generate.d.ts +14 -0
- package/dist/commands/configuration/generate.d.ts.map +1 -0
- package/dist/commands/configuration/generate.js +222 -0
- package/dist/commands/configuration/generate.js.map +1 -0
- package/dist/commands/configuration/index.d.ts +6 -0
- package/dist/commands/configuration/index.d.ts.map +1 -0
- package/dist/commands/configuration/index.js +21 -0
- package/dist/commands/configuration/index.js.map +1 -0
- package/dist/commands/configuration/validate.d.ts +10 -0
- package/dist/commands/configuration/validate.d.ts.map +1 -0
- package/dist/commands/configuration/validate.js +45 -0
- package/dist/commands/configuration/validate.js.map +1 -0
- package/dist/commands/factory.d.ts +33 -0
- package/dist/commands/factory.d.ts.map +1 -0
- package/dist/commands/factory.js +48 -0
- package/dist/commands/factory.js.map +1 -0
- package/dist/config/defaults.d.ts +8 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +11 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/loader.d.ts +12 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +205 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/testnet.d.ts +6 -0
- package/dist/config/testnet.d.ts.map +1 -0
- package/dist/config/testnet.js +26 -0
- package/dist/config/testnet.js.map +1 -0
- package/dist/config/transport.d.ts +17 -0
- package/dist/config/transport.d.ts.map +1 -0
- package/dist/config/transport.js +46 -0
- package/dist/config/transport.js.map +1 -0
- package/dist/config/types.d.ts +92 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +12 -0
- package/dist/config/types.js.map +1 -0
- package/dist/config/validator.d.ts +14 -0
- package/dist/config/validator.d.ts.map +1 -0
- package/dist/config/validator.js +156 -0
- package/dist/config/validator.js.map +1 -0
- package/dist/errors.d.ts +13 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +28 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +61 -0
- package/dist/index.js.map +1 -0
- package/dist/services/web3pgpServiceFactory.d.ts +14 -0
- package/dist/services/web3pgpServiceFactory.d.ts.map +1 -0
- package/dist/services/web3pgpServiceFactory.js +228 -0
- package/dist/services/web3pgpServiceFactory.js.map +1 -0
- package/dist/setup.d.ts +14 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +46 -0
- package/dist/setup.js.map +1 -0
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/clients.d.ts +49373 -0
- package/dist/utils/clients.d.ts.map +1 -0
- package/dist/utils/clients.js +129 -0
- package/dist/utils/clients.js.map +1 -0
- package/dist/utils/input.d.ts +24 -0
- package/dist/utils/input.d.ts.map +1 -0
- package/dist/utils/input.js +138 -0
- package/dist/utils/input.js.map +1 -0
- package/dist/utils/logger.d.ts +12 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +35 -0
- package/dist/utils/logger.js.map +1 -0
- package/package.json +75 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration type definitions
|
|
3
|
+
*/
|
|
4
|
+
import { Address } from 'viem';
|
|
5
|
+
import { LogLevel } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* Enumeration of supported wallet types.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum WalletType {
|
|
10
|
+
PrivateKey = "private-key"
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* RPC endpoint configuration
|
|
14
|
+
* @property url - The RPC endpoint URL
|
|
15
|
+
* @property priority - Priority for selecting this endpoint (lower is higher priority)
|
|
16
|
+
* @property batching - Optional batching configuration
|
|
17
|
+
*/
|
|
18
|
+
export interface RpcEndpoint {
|
|
19
|
+
url: string;
|
|
20
|
+
priority: number;
|
|
21
|
+
batching?: BatchingConfig;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Batching configuration for RPC requests
|
|
25
|
+
* @property size - Maximum number of requests to batch together
|
|
26
|
+
* @property waitMs - Maximum time to wait before sending a batch in milliseconds
|
|
27
|
+
*/
|
|
28
|
+
export interface BatchingConfig {
|
|
29
|
+
size?: number;
|
|
30
|
+
waitMs?: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Retry configuration for RPC requests
|
|
34
|
+
* @property count - Number of retry attempts
|
|
35
|
+
* @property delayMs - Delay between retries in milliseconds with an exponential backoff
|
|
36
|
+
*/
|
|
37
|
+
export interface RetryConfig {
|
|
38
|
+
count?: number;
|
|
39
|
+
delayMs?: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Either a well-known Viem chain name or a custom chain ID number.
|
|
43
|
+
* Viem chains: mainnet, sepolia, anvil, ink-sepolia, etc.
|
|
44
|
+
* Custom: numeric chain ID
|
|
45
|
+
*/
|
|
46
|
+
export type ChainConfig = 'mainnet' | 'sepolia' | 'anvil' | 'ink-sepolia' | number;
|
|
47
|
+
/**
|
|
48
|
+
* Ethereum network configuration
|
|
49
|
+
* @property chain - The chain configuration (well-known name or custom chain ID)
|
|
50
|
+
* @property rpc - Optional RPC endpoints configuration
|
|
51
|
+
* @property wallet - Optional wallet configuration
|
|
52
|
+
*/
|
|
53
|
+
export interface EthereumConfig {
|
|
54
|
+
chain: ChainConfig;
|
|
55
|
+
rpc?: {
|
|
56
|
+
endpoints: RpcEndpoint[];
|
|
57
|
+
maxBlockRange?: number;
|
|
58
|
+
retry?: RetryConfig;
|
|
59
|
+
};
|
|
60
|
+
wallet?: {
|
|
61
|
+
type: WalletType;
|
|
62
|
+
privateKey?: `0x${string}`;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Web3PGP contract configuration
|
|
67
|
+
* @property contract - The address of the Web3PGP smart contract
|
|
68
|
+
*/
|
|
69
|
+
export interface Web3PGPConfig {
|
|
70
|
+
contract: Address;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Monitoring configuration
|
|
74
|
+
* @property logging - Logging configuration
|
|
75
|
+
*/
|
|
76
|
+
export interface MonitoringConfig {
|
|
77
|
+
logging: {
|
|
78
|
+
level: LogLevel;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Merged configuration for the Web3PGP CLI
|
|
83
|
+
* @property ethereum - Ethereum network configuration
|
|
84
|
+
* @property web3pgp - Web3PGP contract configuration
|
|
85
|
+
* @property monitoring - Monitoring configuration
|
|
86
|
+
*/
|
|
87
|
+
export interface MergedConfig {
|
|
88
|
+
ethereum: EthereumConfig;
|
|
89
|
+
web3pgp: Web3PGPConfig;
|
|
90
|
+
monitoring: MonitoringConfig;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC;;GAEG;AACH,oBAAY,UAAU;IAEpB,UAAU,gBAAgB;CAC3B;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAG,cAAc,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,GAAG,MAAM,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,WAAW,CAAC;IACnB,GAAG,CAAC,EAAE;QACJ,SAAS,EAAE,WAAW,EAAE,CAAC;QACzB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,KAAK,CAAC,EAAE,WAAW,CAAC;KACrB,CAAC;IACF,MAAM,CAAC,EAAE;QACP,IAAI,EAAE,UAAU,CAAC;QACjB,UAAU,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;KAC5B,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE;QACP,KAAK,EAAE,QAAQ,CAAC;KACjB,CAAC;CACH;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,aAAa,CAAC;IACvB,UAAU,EAAE,gBAAgB,CAAC;CAC9B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WalletType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Enumeration of supported wallet types.
|
|
6
|
+
*/
|
|
7
|
+
var WalletType;
|
|
8
|
+
(function (WalletType) {
|
|
9
|
+
// Use a private key for signing transactions
|
|
10
|
+
WalletType["PrivateKey"] = "private-key";
|
|
11
|
+
})(WalletType || (exports.WalletType = WalletType = {}));
|
|
12
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":";;;AAMA;;GAEG;AACH,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,6CAA6C;IAC7C,wCAA0B,CAAA;AAC5B,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate that YAML content is well-formed and can be parsed
|
|
3
|
+
*/
|
|
4
|
+
export declare function validateYamlFormat(content: string): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Validate that parsed YAML structure matches expected shape
|
|
7
|
+
* This is format validation only - no semantic validation
|
|
8
|
+
*/
|
|
9
|
+
export declare function validateYamlStructure(data: unknown): void;
|
|
10
|
+
/**
|
|
11
|
+
* Full YAML format validation (parse + structure check)
|
|
12
|
+
*/
|
|
13
|
+
export declare function validateConfigFormat(content: string): void;
|
|
14
|
+
//# sourceMappingURL=validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/config/validator.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAQ3D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAuIzD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAI1D"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateYamlFormat = validateYamlFormat;
|
|
4
|
+
exports.validateYamlStructure = validateYamlStructure;
|
|
5
|
+
exports.validateConfigFormat = validateConfigFormat;
|
|
6
|
+
const yaml_1 = require("yaml");
|
|
7
|
+
const errors_1 = require("../errors");
|
|
8
|
+
const types_1 = require("./types");
|
|
9
|
+
/**
|
|
10
|
+
* Validate that YAML content is well-formed and can be parsed
|
|
11
|
+
*/
|
|
12
|
+
function validateYamlFormat(content) {
|
|
13
|
+
try {
|
|
14
|
+
(0, yaml_1.parse)(content);
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
19
|
+
throw new errors_1.ConfigError(`Invalid YAML format: ${message}`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Validate that parsed YAML structure matches expected shape
|
|
24
|
+
* This is format validation only - no semantic validation
|
|
25
|
+
*/
|
|
26
|
+
function validateYamlStructure(data) {
|
|
27
|
+
if (!data || typeof data !== 'object') {
|
|
28
|
+
throw new errors_1.ConfigError('Configuration must be an object');
|
|
29
|
+
}
|
|
30
|
+
const config = data;
|
|
31
|
+
// Check top-level required keys
|
|
32
|
+
if (!config.ethereum) {
|
|
33
|
+
throw new errors_1.ConfigError('Missing required field: ethereum');
|
|
34
|
+
}
|
|
35
|
+
if (!config.web3pgp) {
|
|
36
|
+
throw new errors_1.ConfigError('Missing required field: web3pgp');
|
|
37
|
+
}
|
|
38
|
+
if (!config.monitoring) {
|
|
39
|
+
throw new errors_1.ConfigError('Missing required field: monitoring');
|
|
40
|
+
}
|
|
41
|
+
// Validate ethereum section
|
|
42
|
+
const ethereum = config.ethereum;
|
|
43
|
+
if (typeof ethereum !== 'object' || ethereum === null) {
|
|
44
|
+
throw new errors_1.ConfigError('ethereum must be an object');
|
|
45
|
+
}
|
|
46
|
+
if (!('chain' in ethereum)) {
|
|
47
|
+
throw new errors_1.ConfigError('Missing required field: ethereum.chain');
|
|
48
|
+
}
|
|
49
|
+
// Validate rpc section (optional)
|
|
50
|
+
const rpc = ethereum.rpc;
|
|
51
|
+
if (rpc !== undefined) {
|
|
52
|
+
if (typeof rpc !== 'object' || rpc === null) {
|
|
53
|
+
throw new errors_1.ConfigError('ethereum.rpc must be an object');
|
|
54
|
+
}
|
|
55
|
+
if (!('endpoints' in rpc)) {
|
|
56
|
+
throw new errors_1.ConfigError('Missing required field: ethereum.rpc.endpoints');
|
|
57
|
+
}
|
|
58
|
+
if (!Array.isArray(rpc.endpoints)) {
|
|
59
|
+
throw new errors_1.ConfigError('ethereum.rpc.endpoints must be an array');
|
|
60
|
+
}
|
|
61
|
+
// Validate endpoints array structure
|
|
62
|
+
const endpoints = rpc.endpoints;
|
|
63
|
+
for (let i = 0; i < endpoints.length; i++) {
|
|
64
|
+
const ep = endpoints[i];
|
|
65
|
+
if (!ep || typeof ep !== 'object') {
|
|
66
|
+
throw new errors_1.ConfigError(`ethereum.rpc.endpoints[${i}] must be an object`);
|
|
67
|
+
}
|
|
68
|
+
if (!('url' in ep)) {
|
|
69
|
+
throw new errors_1.ConfigError(`Missing required field: ethereum.rpc.endpoints[${i}].url`);
|
|
70
|
+
}
|
|
71
|
+
if (!('priority' in ep)) {
|
|
72
|
+
throw new errors_1.ConfigError(`Missing required field: ethereum.rpc.endpoints[${i}].priority`);
|
|
73
|
+
}
|
|
74
|
+
// Validate optional maxBlockRange if present
|
|
75
|
+
const epObj = ep;
|
|
76
|
+
if ('maxBlockRange' in epObj && epObj.maxBlockRange !== undefined) {
|
|
77
|
+
if (typeof epObj.maxBlockRange !== 'number') {
|
|
78
|
+
throw new errors_1.ConfigError(`ethereum.rpc.endpoints[${i}].maxBlockRange must be a number`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// Validate optional batching config if present
|
|
82
|
+
if ('batching' in epObj && epObj.batching !== undefined) {
|
|
83
|
+
if (typeof epObj.batching !== 'object' || epObj.batching === null) {
|
|
84
|
+
throw new errors_1.ConfigError(`ethereum.rpc.endpoints[${i}].batching must be an object`);
|
|
85
|
+
}
|
|
86
|
+
const batchingCfg = epObj.batching;
|
|
87
|
+
if ('size' in batchingCfg && typeof batchingCfg.size !== 'number') {
|
|
88
|
+
throw new errors_1.ConfigError(`ethereum.rpc.endpoints[${i}].batching.size must be a number`);
|
|
89
|
+
}
|
|
90
|
+
if ('waitMs' in batchingCfg && typeof batchingCfg.waitMs !== 'number') {
|
|
91
|
+
throw new errors_1.ConfigError(`ethereum.rpc.endpoints[${i}].batching.waitMs must be a number`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// Validate optional retry config if present
|
|
95
|
+
if ('retry' in epObj && epObj.retry !== undefined) {
|
|
96
|
+
if (typeof epObj.retry !== 'object' || epObj.retry === null) {
|
|
97
|
+
throw new errors_1.ConfigError(`ethereum.rpc.endpoints[${i}].retry must be an object`);
|
|
98
|
+
}
|
|
99
|
+
const retryCfg = epObj.retry;
|
|
100
|
+
if ('count' in retryCfg && typeof retryCfg.count !== 'number') {
|
|
101
|
+
throw new errors_1.ConfigError(`ethereum.rpc.endpoints[${i}].retry.count must be a number`);
|
|
102
|
+
}
|
|
103
|
+
if ('delayMs' in retryCfg && typeof retryCfg.delayMs !== 'number') {
|
|
104
|
+
throw new errors_1.ConfigError(`ethereum.rpc.endpoints[${i}].retry.delayMs must be a number`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// Validate wallet section (optional - for read-only mode)
|
|
110
|
+
const wallet = ethereum.wallet;
|
|
111
|
+
if (wallet !== undefined) {
|
|
112
|
+
if (typeof wallet !== 'object' || wallet === null) {
|
|
113
|
+
throw new errors_1.ConfigError('ethereum.wallet must be an object');
|
|
114
|
+
}
|
|
115
|
+
if (!('type' in wallet)) {
|
|
116
|
+
throw new errors_1.ConfigError('Missing required field: ethereum.wallet.type');
|
|
117
|
+
}
|
|
118
|
+
const walletType = wallet.type;
|
|
119
|
+
if (walletType !== types_1.WalletType.PrivateKey) {
|
|
120
|
+
throw new errors_1.ConfigError(`ethereum.wallet.type must be '${types_1.WalletType.PrivateKey}', got '${walletType}'`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
// Validate web3pgp section
|
|
124
|
+
const web3pgp = config.web3pgp;
|
|
125
|
+
if (typeof web3pgp !== 'object' || web3pgp === null) {
|
|
126
|
+
throw new errors_1.ConfigError('web3pgp must be an object');
|
|
127
|
+
}
|
|
128
|
+
if (!('contract' in web3pgp)) {
|
|
129
|
+
throw new errors_1.ConfigError('Missing required field: web3pgp.contract');
|
|
130
|
+
}
|
|
131
|
+
// Validate monitoring section
|
|
132
|
+
const monitoring = config.monitoring;
|
|
133
|
+
if (typeof monitoring !== 'object' || monitoring === null) {
|
|
134
|
+
throw new errors_1.ConfigError('monitoring must be an object');
|
|
135
|
+
}
|
|
136
|
+
if (!('logging' in monitoring)) {
|
|
137
|
+
throw new errors_1.ConfigError('Missing required field: monitoring.logging');
|
|
138
|
+
}
|
|
139
|
+
// Validate logging section
|
|
140
|
+
const logging = monitoring.logging;
|
|
141
|
+
if (typeof logging !== 'object' || logging === null) {
|
|
142
|
+
throw new errors_1.ConfigError('monitoring.logging must be an object');
|
|
143
|
+
}
|
|
144
|
+
if (!('level' in logging)) {
|
|
145
|
+
throw new errors_1.ConfigError('Missing required field: monitoring.logging.level');
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Full YAML format validation (parse + structure check)
|
|
150
|
+
*/
|
|
151
|
+
function validateConfigFormat(content) {
|
|
152
|
+
validateYamlFormat(content);
|
|
153
|
+
const parsed = (0, yaml_1.parse)(content);
|
|
154
|
+
validateYamlStructure(parsed);
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/config/validator.ts"],"names":[],"mappings":";;AAOA,gDAQC;AAMD,sDAuIC;AAKD,oDAIC;AArKD,+BAA0C;AAC1C,sCAAwC;AACxC,mCAAqC;AAErC;;GAEG;AACH,SAAgB,kBAAkB,CAAC,OAAe;IAChD,IAAI,CAAC;QACH,IAAA,YAAS,EAAC,OAAO,CAAC,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QACzE,MAAM,IAAI,oBAAW,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,IAAa;IACjD,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtC,MAAM,IAAI,oBAAW,CAAC,iCAAiC,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,MAAM,GAAG,IAA+B,CAAC;IAE/C,gCAAgC;IAChC,IAAI,CAAC,MAAM,CAA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CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,oBAAW,CAAC,kDAAkD,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,oBAAoB,CAAC,OAAe;IAClD,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAC5B,MAAM,MAAM,GAAG,IAAA,YAAS,EAAC,OAAO,CAAC,CAAC;IAClC,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom error classes for Web3PGP CLI
|
|
3
|
+
*/
|
|
4
|
+
export declare class ConfigError extends Error {
|
|
5
|
+
constructor(message: string);
|
|
6
|
+
}
|
|
7
|
+
export declare class ValidationError extends Error {
|
|
8
|
+
constructor(message: string);
|
|
9
|
+
}
|
|
10
|
+
export declare class BlockchainError extends Error {
|
|
11
|
+
constructor(message: string);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,qBAAa,WAAY,SAAQ,KAAK;gBACxB,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,OAAO,EAAE,MAAM;CAI5B"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Custom error classes for Web3PGP CLI
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BlockchainError = exports.ValidationError = exports.ConfigError = void 0;
|
|
7
|
+
class ConfigError extends Error {
|
|
8
|
+
constructor(message) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.name = 'ConfigError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.ConfigError = ConfigError;
|
|
14
|
+
class ValidationError extends Error {
|
|
15
|
+
constructor(message) {
|
|
16
|
+
super(message);
|
|
17
|
+
this.name = 'ValidationError';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.ValidationError = ValidationError;
|
|
21
|
+
class BlockchainError extends Error {
|
|
22
|
+
constructor(message) {
|
|
23
|
+
super(message);
|
|
24
|
+
this.name = 'BlockchainError';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.BlockchainError = BlockchainError;
|
|
28
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,MAAa,WAAY,SAAQ,KAAK;IACpC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;IAC5B,CAAC;CACF;AALD,kCAKC;AAED,MAAa,eAAgB,SAAQ,KAAK;IACxC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AALD,0CAKC;AAED,MAAa,eAAgB,SAAQ,KAAK;IACxC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AALD,0CAKC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const setup_1 = require("./setup");
|
|
6
|
+
const logger_1 = require("./utils/logger");
|
|
7
|
+
const loader_1 = require("./config/loader");
|
|
8
|
+
const web3pgpServiceFactory_1 = require("./services/web3pgpServiceFactory");
|
|
9
|
+
const blockchain_1 = require("./commands/blockchain");
|
|
10
|
+
const configuration_1 = require("./commands/configuration");
|
|
11
|
+
const errors_1 = require("./errors");
|
|
12
|
+
async function main() {
|
|
13
|
+
// Load config first to get logging level
|
|
14
|
+
// Extract --config option if provided
|
|
15
|
+
let configPath;
|
|
16
|
+
const configIndex = process.argv.indexOf('--config');
|
|
17
|
+
if (configIndex > -1 && configIndex + 1 < process.argv.length) {
|
|
18
|
+
configPath = process.argv[configIndex + 1];
|
|
19
|
+
}
|
|
20
|
+
const config = (0, loader_1.loadConfig)({ configPath });
|
|
21
|
+
const logger = (0, logger_1.createRootLogger)(config.monitoring.logging.level);
|
|
22
|
+
const rootLogger = logger.child({ component: 'cli' });
|
|
23
|
+
// Initialize console patching to capture SDK logs
|
|
24
|
+
(0, setup_1.initializeConsolePatch)(logger);
|
|
25
|
+
try {
|
|
26
|
+
rootLogger.debug('Web3PGP CLI starting');
|
|
27
|
+
rootLogger.debug('Configuration loaded');
|
|
28
|
+
const service = await (0, web3pgpServiceFactory_1.createWeb3PGPService)(config, logger);
|
|
29
|
+
rootLogger.debug('Web3PGP service initialized');
|
|
30
|
+
const program = new commander_1.Command()
|
|
31
|
+
.name('web3pgp')
|
|
32
|
+
.version('1.0.0', '-v, --version')
|
|
33
|
+
.description('Web3PGP CLI - Decentralized OpenPGP key infrastructure on Ethereum')
|
|
34
|
+
.helpOption('-h, --help', 'Show help');
|
|
35
|
+
const blockchainCommands = (0, blockchain_1.createBlockchainCommands)({ logger, service });
|
|
36
|
+
const configurationCommands = (0, configuration_1.createConfigurationCommands)();
|
|
37
|
+
// Add blockchain commands as direct subcommands
|
|
38
|
+
blockchainCommands.forEach(cmd => program.addCommand(cmd));
|
|
39
|
+
// Add configuration command as a group
|
|
40
|
+
program.addCommand(configurationCommands);
|
|
41
|
+
program.parse(process.argv);
|
|
42
|
+
if (!process.argv.slice(2).length) {
|
|
43
|
+
program.outputHelp();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
if (error instanceof errors_1.ConfigError) {
|
|
48
|
+
rootLogger.error({ error: error.message }, 'Configuration error');
|
|
49
|
+
console.error(JSON.stringify({ error: error.message }, null, 2));
|
|
50
|
+
process.exit(2);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
54
|
+
rootLogger.error({ error: msg }, 'Fatal error');
|
|
55
|
+
console.error(JSON.stringify({ error: msg }, null, 2));
|
|
56
|
+
process.exit(1);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
main();
|
|
61
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,yCAAoC;AACpC,mCAAiD;AACjD,2CAAkD;AAClD,4CAA6C;AAC7C,4EAAwE;AACxE,sDAAiE;AACjE,4DAAuE;AACvE,qCAAuC;AAEvC,KAAK,UAAU,IAAI;IACjB,yCAAyC;IACzC,sCAAsC;IACtC,IAAI,UAA8B,CAAC;IACnC,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACrD,IAAI,WAAW,GAAG,CAAC,CAAC,IAAI,WAAW,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QAC9D,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,MAAM,GA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AAC;YAClC,OAAO,CAAC,UAAU,EAAE,CAAC;QACvB,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,oBAAW,EAAE,CAAC;YACjC,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,qBAAqB,CAAC,CAAC;YAClE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YACjE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACnE,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,aAAa,CAAC,CAAC;YAChD,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YACvD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MergedConfig } from '../config/types';
|
|
2
|
+
import { Logger } from '../utils/logger';
|
|
3
|
+
import { IWeb3PGPService } from '@degengineering/dexes';
|
|
4
|
+
/**
|
|
5
|
+
* Create the Web3PGP service from configuration.
|
|
6
|
+
* Orchestrates Viem client setup, contract initialization, and service creation.
|
|
7
|
+
*
|
|
8
|
+
* @param config - Merged configuration with Ethereum and Web3PGP settings
|
|
9
|
+
* @param logger - Logger instance to use for logging
|
|
10
|
+
* @returns Promise resolving to IWeb3PGPService instance
|
|
11
|
+
* @throws ConfigError if configuration is invalid
|
|
12
|
+
*/
|
|
13
|
+
export declare function createWeb3PGPService(config: MergedConfig, logger: Logger): Promise<IWeb3PGPService>;
|
|
14
|
+
//# sourceMappingURL=web3pgpServiceFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web3pgpServiceFactory.d.ts","sourceRoot":"","sources":["../../src/services/web3pgpServiceFactory.ts"],"names":[],"mappings":"AAUA,OAAO,EAAe,YAAY,EAAe,MAAM,iBAAiB,CAAC;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,eAAe,EAA2B,MAAM,uBAAuB,CAAC;AAoOjF;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAgDzG"}
|