@layr-labs/ecloud-sdk 0.1.0-dev.2 → 0.1.0-rc.1
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/README.md +0 -2
- package/VERSION +2 -2
- package/dist/index.cjs +16 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -6
- package/dist/index.d.ts +1 -6
- package/dist/index.js +16 -39
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/VERSION
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
version=0.1.0-
|
|
2
|
-
commit=
|
|
1
|
+
version=0.1.0-rc.1
|
|
2
|
+
commit=bd1a94f02bdaebb6621925b9137be57d7240075c
|
package/dist/index.cjs
CHANGED
|
@@ -35,7 +35,6 @@ __export(index_exports, {
|
|
|
35
35
|
assertValidFilePath: () => assertValidFilePath,
|
|
36
36
|
assertValidImageReference: () => assertValidImageReference,
|
|
37
37
|
assertValidPrivateKey: () => assertValidPrivateKey,
|
|
38
|
-
checkERC7702Delegation: () => checkERC7702Delegation,
|
|
39
38
|
createApp: () => createApp,
|
|
40
39
|
createAppModule: () => createAppModule,
|
|
41
40
|
createBillingModule: () => createBillingModule,
|
|
@@ -194,7 +193,7 @@ function getBillingEnvironmentConfig(build) {
|
|
|
194
193
|
return config;
|
|
195
194
|
}
|
|
196
195
|
function getBuildType() {
|
|
197
|
-
const buildTimeType = true ? "
|
|
196
|
+
const buildTimeType = true ? "prod"?.toLowerCase() : void 0;
|
|
198
197
|
const runtimeType = process.env.BUILD_TYPE?.toLowerCase();
|
|
199
198
|
const buildType = buildTimeType || runtimeType;
|
|
200
199
|
if (buildType === "dev") {
|
|
@@ -1218,7 +1217,7 @@ Please verify the image exists: docker manifest inspect ${finalImageRef}`
|
|
|
1218
1217
|
} else {
|
|
1219
1218
|
logger.info("Continuing without environment file");
|
|
1220
1219
|
}
|
|
1221
|
-
publicEnv["
|
|
1220
|
+
publicEnv["EIGEN_MACHINE_TYPE"] = instanceType;
|
|
1222
1221
|
logger.info(`Instance type: ${instanceType}`);
|
|
1223
1222
|
logger.info("Encrypting environment variables...");
|
|
1224
1223
|
const { encryptionKey } = getKMSKeysForEnvironment(
|
|
@@ -2355,13 +2354,13 @@ async function executeBatch(options, logger) {
|
|
|
2355
2354
|
);
|
|
2356
2355
|
executeBatchData = (0, import_viem.concat)([selector, encodedParams]);
|
|
2357
2356
|
}
|
|
2358
|
-
const
|
|
2357
|
+
const isDelegated = await checkERC7702Delegation(
|
|
2359
2358
|
publicClient,
|
|
2360
2359
|
account.address,
|
|
2361
2360
|
environmentConfig.erc7702DelegatorAddress
|
|
2362
2361
|
);
|
|
2363
2362
|
let authorizationList = [];
|
|
2364
|
-
if (!
|
|
2363
|
+
if (!isDelegated) {
|
|
2365
2364
|
const transactionNonce = await publicClient.getTransactionCount({
|
|
2366
2365
|
address: account.address,
|
|
2367
2366
|
blockTag: "pending"
|
|
@@ -2513,7 +2512,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
|
|
|
2513
2512
|
var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
|
|
2514
2513
|
var CanUpdateAppProfilePermission = "0x036fef61";
|
|
2515
2514
|
function getDefaultClientId() {
|
|
2516
|
-
const version = true ? "0.1.0-
|
|
2515
|
+
const version = true ? "0.1.0-rc.1" : "0.0.0";
|
|
2517
2516
|
return `ecloud-sdk/v${version}`;
|
|
2518
2517
|
}
|
|
2519
2518
|
var UserApiClient = class {
|
|
@@ -4769,21 +4768,6 @@ async function getBlockTimestamps(rpcUrl, environmentConfig, blockNumbers) {
|
|
|
4769
4768
|
}
|
|
4770
4769
|
return timestamps;
|
|
4771
4770
|
}
|
|
4772
|
-
async function isDelegated(options) {
|
|
4773
|
-
const { privateKey, rpcUrl, environmentConfig } = options;
|
|
4774
|
-
const privateKeyHex = addHexPrefix(privateKey);
|
|
4775
|
-
const account = (0, import_accounts2.privateKeyToAccount)(privateKeyHex);
|
|
4776
|
-
const chain = getChainFromID(environmentConfig.chainID);
|
|
4777
|
-
const publicClient = (0, import_viem5.createPublicClient)({
|
|
4778
|
-
chain,
|
|
4779
|
-
transport: (0, import_viem5.http)(rpcUrl)
|
|
4780
|
-
});
|
|
4781
|
-
return checkERC7702Delegation(
|
|
4782
|
-
publicClient,
|
|
4783
|
-
account.address,
|
|
4784
|
-
environmentConfig.erc7702DelegatorAddress
|
|
4785
|
-
);
|
|
4786
|
-
}
|
|
4787
4771
|
async function undelegate(options, logger) {
|
|
4788
4772
|
const { privateKey, rpcUrl, environmentConfig } = options;
|
|
4789
4773
|
const privateKeyHex = addHexPrefix(privateKey);
|
|
@@ -4916,7 +4900,7 @@ async function watchUntilUpgradeComplete(options, logger) {
|
|
|
4916
4900
|
if (status === APP_STATUS_STOPPED && ip) {
|
|
4917
4901
|
logger.info("App upgrade complete.");
|
|
4918
4902
|
logger.info(`Status: ${status}`);
|
|
4919
|
-
logger.info(`To start the app, run:
|
|
4903
|
+
logger.info(`To start the app, run: eigenx app start ${appId}`);
|
|
4920
4904
|
return true;
|
|
4921
4905
|
}
|
|
4922
4906
|
}
|
|
@@ -4926,7 +4910,7 @@ async function watchUntilUpgradeComplete(options, logger) {
|
|
|
4926
4910
|
if (status === APP_STATUS_STOPPED && ip && hasChanged) {
|
|
4927
4911
|
logger.info("App upgrade complete.");
|
|
4928
4912
|
logger.info(`Status: ${status}`);
|
|
4929
|
-
logger.info(`To start the app, run:
|
|
4913
|
+
logger.info(`To start the app, run: eigenx app start ${appId}`);
|
|
4930
4914
|
return true;
|
|
4931
4915
|
}
|
|
4932
4916
|
if (status === APP_STATUS_RUNNING && ip && hasChanged) {
|
|
@@ -5443,7 +5427,7 @@ async function checkQuotaAvailable(preflightCtx) {
|
|
|
5443
5427
|
}
|
|
5444
5428
|
if (maxQuota === 0) {
|
|
5445
5429
|
throw new Error(
|
|
5446
|
-
"no app quota available. Run 'ecloud billing subscribe' to enable app deployment"
|
|
5430
|
+
"no app quota available. Run 'npx ecloud billing subscribe' to enable app deployment"
|
|
5447
5431
|
);
|
|
5448
5432
|
}
|
|
5449
5433
|
let activeCount;
|
|
@@ -6059,7 +6043,7 @@ Before deploying, you'll need:
|
|
|
6059
6043
|
## Deployment
|
|
6060
6044
|
|
|
6061
6045
|
\`\`\`bash
|
|
6062
|
-
|
|
6046
|
+
eigenx app deploy username/image-name
|
|
6063
6047
|
\`\`\`
|
|
6064
6048
|
|
|
6065
6049
|
The CLI will automatically detect the \`Dockerfile\` and build your app before deploying.
|
|
@@ -6067,13 +6051,13 @@ The CLI will automatically detect the \`Dockerfile\` and build your app before d
|
|
|
6067
6051
|
## Management & Monitoring
|
|
6068
6052
|
|
|
6069
6053
|
\`\`\`bash
|
|
6070
|
-
ecloud
|
|
6071
|
-
ecloud
|
|
6072
|
-
ecloud
|
|
6073
|
-
ecloud
|
|
6074
|
-
ecloud
|
|
6075
|
-
ecloud
|
|
6076
|
-
ecloud
|
|
6054
|
+
npx ecloud app list # List all apps
|
|
6055
|
+
npx ecloud app info [app-name] # Get app details
|
|
6056
|
+
npx ecloud app logs [app-name] # View logs
|
|
6057
|
+
npx ecloud app start [app-name] # Start stopped app
|
|
6058
|
+
npx ecloud app stop [app-name] # Stop running app
|
|
6059
|
+
npx ecloud app terminate [app-name] # Terminate app
|
|
6060
|
+
npx ecloud app upgrade [app-name] [image] # Update deployment
|
|
6077
6061
|
\`\`\`
|
|
6078
6062
|
`;
|
|
6079
6063
|
}
|
|
@@ -6568,13 +6552,6 @@ function createAppModule(ctx) {
|
|
|
6568
6552
|
);
|
|
6569
6553
|
return { tx };
|
|
6570
6554
|
},
|
|
6571
|
-
async isDelegated() {
|
|
6572
|
-
return isDelegated({
|
|
6573
|
-
privateKey,
|
|
6574
|
-
rpcUrl: ctx.rpcUrl,
|
|
6575
|
-
environmentConfig: environment
|
|
6576
|
-
});
|
|
6577
|
-
},
|
|
6578
6555
|
async undelegate() {
|
|
6579
6556
|
const tx = await undelegate(
|
|
6580
6557
|
{
|
|
@@ -7023,7 +7000,6 @@ function createECloudClient(cfg) {
|
|
|
7023
7000
|
assertValidFilePath,
|
|
7024
7001
|
assertValidImageReference,
|
|
7025
7002
|
assertValidPrivateKey,
|
|
7026
|
-
checkERC7702Delegation,
|
|
7027
7003
|
createApp,
|
|
7028
7004
|
createAppModule,
|
|
7029
7005
|
createBillingModule,
|