@layr-labs/ecloud-cli 0.2.0-dev.3 → 0.2.1-dev
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/VERSION +2 -2
- package/dist/commands/auth/whoami.js +16 -3
- package/dist/commands/auth/whoami.js.map +1 -1
- package/dist/commands/billing/cancel.js +44 -5
- package/dist/commands/billing/cancel.js.map +1 -1
- package/dist/commands/billing/status.js +44 -5
- package/dist/commands/billing/status.js.map +1 -1
- package/dist/commands/billing/subscribe.js +44 -5
- package/dist/commands/billing/subscribe.js.map +1 -1
- package/dist/commands/compute/app/create.js +16 -3
- package/dist/commands/compute/app/create.js.map +1 -1
- package/dist/commands/compute/app/deploy.js +111 -24
- package/dist/commands/compute/app/deploy.js.map +1 -1
- package/dist/commands/compute/app/info.js +107 -33
- package/dist/commands/compute/app/info.js.map +1 -1
- package/dist/commands/compute/app/list.js +70 -13
- package/dist/commands/compute/app/list.js.map +1 -1
- package/dist/commands/compute/app/logs.js +68 -27
- package/dist/commands/compute/app/logs.js.map +1 -1
- package/dist/commands/compute/app/profile/set.js +107 -38
- package/dist/commands/compute/app/profile/set.js.map +1 -1
- package/dist/commands/compute/app/releases.js +68 -24
- package/dist/commands/compute/app/releases.js.map +1 -1
- package/dist/commands/compute/app/start.js +76 -34
- package/dist/commands/compute/app/start.js.map +1 -1
- package/dist/commands/compute/app/stop.js +76 -34
- package/dist/commands/compute/app/stop.js.map +1 -1
- package/dist/commands/compute/app/terminate.js +76 -34
- package/dist/commands/compute/app/terminate.js.map +1 -1
- package/dist/commands/compute/app/upgrade.js +106 -36
- package/dist/commands/compute/app/upgrade.js.map +1 -1
- package/dist/commands/compute/build/info.js +52 -13
- package/dist/commands/compute/build/info.js.map +1 -1
- package/dist/commands/compute/build/list.js +52 -13
- package/dist/commands/compute/build/list.js.map +1 -1
- package/dist/commands/compute/build/logs.js +52 -13
- package/dist/commands/compute/build/logs.js.map +1 -1
- package/dist/commands/compute/build/status.js +52 -13
- package/dist/commands/compute/build/status.js.map +1 -1
- package/dist/commands/compute/build/submit.js +65 -9
- package/dist/commands/compute/build/submit.js.map +1 -1
- package/dist/commands/compute/build/verify.js +52 -13
- package/dist/commands/compute/build/verify.js.map +1 -1
- package/dist/commands/compute/environment/set.js +20 -7
- package/dist/commands/compute/environment/set.js.map +1 -1
- package/dist/commands/compute/undelegate.js +46 -10
- package/dist/commands/compute/undelegate.js.map +1 -1
- package/package.json +2 -2
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// src/commands/compute/build/list.ts
|
|
4
4
|
import { Command, Flags as Flags2 } from "@oclif/core";
|
|
5
5
|
import chalk2 from "chalk";
|
|
6
|
-
import { privateKeyToAccount as
|
|
7
|
-
import { addHexPrefix } from "@layr-labs/ecloud-sdk";
|
|
6
|
+
import { privateKeyToAccount as privateKeyToAccount4 } from "viem/accounts";
|
|
7
|
+
import { addHexPrefix as addHexPrefix2 } from "@layr-labs/ecloud-sdk";
|
|
8
8
|
|
|
9
9
|
// src/flags.ts
|
|
10
10
|
import { Flags } from "@oclif/core";
|
|
@@ -16,9 +16,9 @@ import fs3 from "fs";
|
|
|
16
16
|
import path3 from "path";
|
|
17
17
|
import os3 from "os";
|
|
18
18
|
import { isAddress as isAddress2 } from "viem";
|
|
19
|
-
import { privateKeyToAccount as
|
|
19
|
+
import { privateKeyToAccount as privateKeyToAccount3 } from "viem/accounts";
|
|
20
20
|
import {
|
|
21
|
-
getEnvironmentConfig,
|
|
21
|
+
getEnvironmentConfig as getEnvironmentConfig2,
|
|
22
22
|
getAvailableEnvironments,
|
|
23
23
|
isEnvironmentAvailable,
|
|
24
24
|
getAllAppsByDeveloper as getAllAppsByDeveloper2,
|
|
@@ -35,12 +35,43 @@ import {
|
|
|
35
35
|
|
|
36
36
|
// src/utils/appResolver.ts
|
|
37
37
|
import { isAddress } from "viem";
|
|
38
|
-
import { privateKeyToAccount } from "viem/accounts";
|
|
38
|
+
import { privateKeyToAccount as privateKeyToAccount2 } from "viem/accounts";
|
|
39
39
|
import {
|
|
40
40
|
UserApiClient,
|
|
41
41
|
getAllAppsByDeveloper
|
|
42
42
|
} from "@layr-labs/ecloud-sdk";
|
|
43
43
|
|
|
44
|
+
// src/utils/viemClients.ts
|
|
45
|
+
import {
|
|
46
|
+
createPublicClient,
|
|
47
|
+
http
|
|
48
|
+
} from "viem";
|
|
49
|
+
import { privateKeyToAccount } from "viem/accounts";
|
|
50
|
+
import {
|
|
51
|
+
getEnvironmentConfig,
|
|
52
|
+
addHexPrefix,
|
|
53
|
+
createViemClients as sdkCreateViemClients,
|
|
54
|
+
getChainFromID
|
|
55
|
+
} from "@layr-labs/ecloud-sdk";
|
|
56
|
+
function createViemClients(options) {
|
|
57
|
+
const privateKey = addHexPrefix(options.privateKey);
|
|
58
|
+
const environmentConfig = getEnvironmentConfig(options.environment);
|
|
59
|
+
const rpcUrl = options.rpcUrl || environmentConfig.defaultRPCURL;
|
|
60
|
+
const chain = getChainFromID(environmentConfig.chainID);
|
|
61
|
+
const { publicClient, walletClient } = sdkCreateViemClients({
|
|
62
|
+
privateKey,
|
|
63
|
+
rpcUrl,
|
|
64
|
+
chainId: environmentConfig.chainID
|
|
65
|
+
});
|
|
66
|
+
const account = privateKeyToAccount(privateKey);
|
|
67
|
+
return {
|
|
68
|
+
publicClient,
|
|
69
|
+
walletClient,
|
|
70
|
+
chain,
|
|
71
|
+
address: account.address
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
44
75
|
// src/utils/globalConfig.ts
|
|
45
76
|
import * as fs from "fs";
|
|
46
77
|
import * as path from "path";
|
|
@@ -127,7 +158,7 @@ var APPS_DIR = path2.join(CONFIG_DIR, "apps");
|
|
|
127
158
|
|
|
128
159
|
// src/utils/version.ts
|
|
129
160
|
function getCliVersion() {
|
|
130
|
-
return true ? "0.2.
|
|
161
|
+
return true ? "0.2.1-dev" : "0.0.0";
|
|
131
162
|
}
|
|
132
163
|
function getClientId() {
|
|
133
164
|
return `ecloud-cli/v${getCliVersion()}`;
|
|
@@ -164,7 +195,7 @@ async function getPrivateKeyInteractive(privateKey) {
|
|
|
164
195
|
async function getEnvironmentInteractive(environment) {
|
|
165
196
|
if (environment) {
|
|
166
197
|
try {
|
|
167
|
-
|
|
198
|
+
getEnvironmentConfig2(environment);
|
|
168
199
|
if (!isEnvironmentAvailable(environment)) {
|
|
169
200
|
throw new Error(`Environment ${environment} is not available in this build`);
|
|
170
201
|
}
|
|
@@ -177,7 +208,7 @@ async function getEnvironmentInteractive(environment) {
|
|
|
177
208
|
const configDefaultEnv = getDefaultEnvironment();
|
|
178
209
|
if (configDefaultEnv && availableEnvs.includes(configDefaultEnv)) {
|
|
179
210
|
try {
|
|
180
|
-
|
|
211
|
+
getEnvironmentConfig2(configDefaultEnv);
|
|
181
212
|
defaultEnv = configDefaultEnv;
|
|
182
213
|
} catch {
|
|
183
214
|
}
|
|
@@ -244,16 +275,24 @@ import {
|
|
|
244
275
|
createComputeModule,
|
|
245
276
|
createBillingModule,
|
|
246
277
|
createBuildModule,
|
|
247
|
-
getEnvironmentConfig as
|
|
278
|
+
getEnvironmentConfig as getEnvironmentConfig3,
|
|
248
279
|
requirePrivateKey,
|
|
249
280
|
getPrivateKeyWithSource
|
|
250
281
|
} from "@layr-labs/ecloud-sdk";
|
|
251
282
|
async function createBuildClient(flags) {
|
|
252
283
|
flags = await validateCommonFlags(flags, { requirePrivateKey: false });
|
|
284
|
+
const environment = flags.environment || "mainnet";
|
|
285
|
+
const environmentConfig = getEnvironmentConfig3(environment);
|
|
286
|
+
const rpcUrl = flags["rpc-url"] || environmentConfig.defaultRPCURL;
|
|
287
|
+
const { walletClient } = createViemClients({
|
|
288
|
+
privateKey: flags["private-key"],
|
|
289
|
+
rpcUrl,
|
|
290
|
+
environment
|
|
291
|
+
});
|
|
253
292
|
return createBuildModule({
|
|
254
293
|
verbose: flags.verbose,
|
|
255
|
-
|
|
256
|
-
environment
|
|
294
|
+
walletClient: flags["private-key"] ? walletClient : void 0,
|
|
295
|
+
environment,
|
|
257
296
|
clientId: getClientId(),
|
|
258
297
|
skipTelemetry: true
|
|
259
298
|
// CLI already has telemetry, skip SDK telemetry
|
|
@@ -410,8 +449,8 @@ var BuildList = class _BuildList extends Command {
|
|
|
410
449
|
const { flags } = await this.parse(_BuildList);
|
|
411
450
|
const validatedFlags = await validateCommonFlags(flags);
|
|
412
451
|
const client = await createBuildClient(validatedFlags);
|
|
413
|
-
const billingAddress =
|
|
414
|
-
|
|
452
|
+
const billingAddress = privateKeyToAccount4(
|
|
453
|
+
addHexPrefix2(validatedFlags["private-key"])
|
|
415
454
|
).address;
|
|
416
455
|
const limit = Math.max(1, Math.min(100, flags.limit ?? 20));
|
|
417
456
|
const offset = Math.max(0, flags.offset ?? 0);
|