@btc-vision/cli 1.0.5 → 1.0.6
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/package.json +4 -1
- package/.gitattributes +0 -2
- package/.github/dependabot.yml +0 -9
- package/.github/workflows/ci.yml +0 -48
- package/.prettierrc.json +0 -12
- package/CONTRIBUTING.md +0 -56
- package/NOTICE +0 -17
- package/SECURITY.md +0 -35
- package/eslint.config.js +0 -41
- package/gulpfile.js +0 -41
- package/src/commands/AcceptCommand.ts +0 -224
- package/src/commands/BaseCommand.ts +0 -59
- package/src/commands/CompileCommand.ts +0 -195
- package/src/commands/ConfigCommand.ts +0 -117
- package/src/commands/DeprecateCommand.ts +0 -193
- package/src/commands/InfoCommand.ts +0 -293
- package/src/commands/InitCommand.ts +0 -541
- package/src/commands/InstallCommand.ts +0 -179
- package/src/commands/KeygenCommand.ts +0 -157
- package/src/commands/ListCommand.ts +0 -169
- package/src/commands/LoginCommand.ts +0 -197
- package/src/commands/LogoutCommand.ts +0 -76
- package/src/commands/PublishCommand.ts +0 -340
- package/src/commands/ScopeRegisterCommand.ts +0 -164
- package/src/commands/SearchCommand.ts +0 -140
- package/src/commands/SignCommand.ts +0 -110
- package/src/commands/TransferCommand.ts +0 -363
- package/src/commands/UndeprecateCommand.ts +0 -167
- package/src/commands/UpdateCommand.ts +0 -200
- package/src/commands/VerifyCommand.ts +0 -228
- package/src/commands/WhoamiCommand.ts +0 -113
- package/src/index.ts +0 -88
- package/src/lib/PackageRegistry.abi.json +0 -765
- package/src/lib/PackageRegistry.abi.ts +0 -365
- package/src/lib/binary.ts +0 -338
- package/src/lib/config.ts +0 -265
- package/src/lib/credentials.ts +0 -176
- package/src/lib/ipfs.ts +0 -382
- package/src/lib/manifest.ts +0 -195
- package/src/lib/provider.ts +0 -121
- package/src/lib/registry.ts +0 -467
- package/src/lib/transaction.ts +0 -205
- package/src/lib/wallet.ts +0 -262
- package/src/types/PackageRegistry.ts +0 -344
- package/src/types/index.ts +0 -147
- package/tsconfig.json +0 -25
package/src/types/index.ts
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OPNet CLI Type Definitions
|
|
3
|
-
*
|
|
4
|
-
* CLI-specific types only. Use @btc-vision/plugin-sdk directly for plugin types.
|
|
5
|
-
*
|
|
6
|
-
* @module types
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { MLDSA_PUBLIC_KEY_SIZES, MLDSA_SIGNATURE_SIZES, MLDSALevel } from '@btc-vision/plugin-sdk';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Network name type
|
|
13
|
-
*/
|
|
14
|
-
export type NetworkName = 'mainnet' | 'testnet' | 'regtest';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* CLI MLDSA level type (44, 65, 87) - user-facing values
|
|
18
|
-
*/
|
|
19
|
-
export type CLIMldsaLevel = 44 | 65 | 87;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* CLI Configuration stored in ~/.opnet/config.json
|
|
23
|
-
*/
|
|
24
|
-
export interface CLIConfig {
|
|
25
|
-
/** Default network: mainnet, testnet, or regtest */
|
|
26
|
-
defaultNetwork: NetworkName;
|
|
27
|
-
/** RPC URLs for each network */
|
|
28
|
-
rpcUrls: Record<NetworkName, string>;
|
|
29
|
-
/** Default IPFS gateway for downloads */
|
|
30
|
-
ipfsGateway: string;
|
|
31
|
-
/** Fallback IPFS gateways */
|
|
32
|
-
ipfsGateways: string[];
|
|
33
|
-
/** IPFS pinning service endpoint */
|
|
34
|
-
ipfsPinningEndpoint: string;
|
|
35
|
-
/** IPFS pinning API key (or JWT token) */
|
|
36
|
-
ipfsPinningApiKey: string;
|
|
37
|
-
/** IPFS pinning API secret (for services requiring key+secret) */
|
|
38
|
-
ipfsPinningSecret: string;
|
|
39
|
-
/** Authorization header name for pinning service */
|
|
40
|
-
ipfsPinningAuthHeader: string;
|
|
41
|
-
/** Registry contract addresses per network */
|
|
42
|
-
registryAddresses: Record<NetworkName, string>;
|
|
43
|
-
/** Default MLDSA security level (44, 65, or 87) */
|
|
44
|
-
defaultMldsaLevel: CLIMldsaLevel;
|
|
45
|
-
/** Indexer API URL for search */
|
|
46
|
-
indexerUrl: string;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Credentials stored in ~/.opnet/credentials.json
|
|
51
|
-
*/
|
|
52
|
-
export interface CLICredentials {
|
|
53
|
-
/** BIP-39 mnemonic phrase (primary method) */
|
|
54
|
-
mnemonic?: string;
|
|
55
|
-
/** Bitcoin private key in WIF format (advanced) */
|
|
56
|
-
wif?: string;
|
|
57
|
-
/** Standalone MLDSA private key hex (advanced) */
|
|
58
|
-
mldsaPrivateKey?: string;
|
|
59
|
-
/** MLDSA security level used for derivation */
|
|
60
|
-
mldsaLevel: CLIMldsaLevel;
|
|
61
|
-
/** Network the credentials are configured for */
|
|
62
|
-
network: NetworkName;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Plugin types for registry
|
|
67
|
-
*/
|
|
68
|
-
export type RegistryPluginType = 'standalone' | 'library';
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Convert CLI level (44, 65, 87) to MLDSALevel enum (0, 1, 2)
|
|
72
|
-
*/
|
|
73
|
-
export function cliLevelToMLDSALevel(level: CLIMldsaLevel): MLDSALevel {
|
|
74
|
-
switch (level) {
|
|
75
|
-
case 44:
|
|
76
|
-
return MLDSALevel.MLDSA44;
|
|
77
|
-
case 65:
|
|
78
|
-
return MLDSALevel.MLDSA65;
|
|
79
|
-
case 87:
|
|
80
|
-
return MLDSALevel.MLDSA87;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Convert MLDSALevel enum (0, 1, 2) to CLI level (44, 65, 87)
|
|
86
|
-
*/
|
|
87
|
-
export function mldsaLevelToCLI(level: MLDSALevel): CLIMldsaLevel {
|
|
88
|
-
switch (level) {
|
|
89
|
-
case MLDSALevel.MLDSA44:
|
|
90
|
-
return 44;
|
|
91
|
-
case MLDSALevel.MLDSA65:
|
|
92
|
-
return 65;
|
|
93
|
-
case MLDSALevel.MLDSA87:
|
|
94
|
-
return 87;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Convert registry MLDSA level (1,2,3) to CLI level (44,65,87)
|
|
100
|
-
*/
|
|
101
|
-
export function registryLevelToCLI(level: number): CLIMldsaLevel {
|
|
102
|
-
switch (level) {
|
|
103
|
-
case 1:
|
|
104
|
-
return 44;
|
|
105
|
-
case 2:
|
|
106
|
-
return 65;
|
|
107
|
-
case 3:
|
|
108
|
-
return 87;
|
|
109
|
-
default:
|
|
110
|
-
throw new Error(`Invalid registry MLDSA level: ${level}`);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Convert CLI MLDSA level (44,65,87) to registry level (1,2,3)
|
|
116
|
-
*/
|
|
117
|
-
export function cliLevelToRegistry(level: CLIMldsaLevel): number {
|
|
118
|
-
switch (level) {
|
|
119
|
-
case 44:
|
|
120
|
-
return 1;
|
|
121
|
-
case 65:
|
|
122
|
-
return 2;
|
|
123
|
-
case 87:
|
|
124
|
-
return 3;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Get public key size for CLI MLDSA level
|
|
130
|
-
*/
|
|
131
|
-
export function getPublicKeySize(level: CLIMldsaLevel): number {
|
|
132
|
-
return MLDSA_PUBLIC_KEY_SIZES[cliLevelToMLDSALevel(level)];
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Get signature size for CLI MLDSA level
|
|
137
|
-
*/
|
|
138
|
-
export function getSignatureSize(level: CLIMldsaLevel): number {
|
|
139
|
-
return MLDSA_SIGNATURE_SIZES[cliLevelToMLDSALevel(level)];
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Check if a number is a valid CLI MLDSA level
|
|
144
|
-
*/
|
|
145
|
-
export function isValidCLIMldsaLevel(level: number): level is CLIMldsaLevel {
|
|
146
|
-
return level === 44 || level === 65 || level === 87;
|
|
147
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "ESNext",
|
|
4
|
-
"target": "ES2022",
|
|
5
|
-
"moduleResolution": "node",
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"outDir": "./build",
|
|
8
|
-
"strict": true,
|
|
9
|
-
"strictNullChecks": true,
|
|
10
|
-
"strictFunctionTypes": true,
|
|
11
|
-
"strictBindCallApply": true,
|
|
12
|
-
"strictPropertyInitialization": true,
|
|
13
|
-
"alwaysStrict": true,
|
|
14
|
-
"noImplicitAny": true,
|
|
15
|
-
"esModuleInterop": true,
|
|
16
|
-
"skipLibCheck": true,
|
|
17
|
-
"removeComments": true,
|
|
18
|
-
"preserveConstEnums": true,
|
|
19
|
-
"resolveJsonModule": true,
|
|
20
|
-
"moduleDetection": "force",
|
|
21
|
-
"lib": ["ES2022"]
|
|
22
|
-
},
|
|
23
|
-
"include": ["src/**/*.ts"],
|
|
24
|
-
"exclude": ["node_modules", "build", "templates"]
|
|
25
|
-
}
|