@layr-labs/ecloud-sdk 0.1.0-rc.1 → 0.1.0-rc.2

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 CHANGED
@@ -22,6 +22,8 @@ No SLA - Mainnet Alpha does not have SLAs around support, and uptime of infrastr
22
22
 
23
23
 
24
24
  ## Quick Start
25
+ > [!NOTE]
26
+ > Migrating from `eigenx`? Head over to [Migration guide](./MIGRATION.md) first
25
27
  ### Installation
26
28
 
27
29
  ```bash
package/VERSION CHANGED
@@ -1,2 +1,2 @@
1
- version=0.1.0-rc.1
2
- commit=bd1a94f02bdaebb6621925b9137be57d7240075c
1
+ version=0.1.0-rc.2
2
+ commit=59c794bb1aebad8f343114aa1f279b7e2136b2e2
package/dist/index.cjs CHANGED
@@ -35,6 +35,7 @@ __export(index_exports, {
35
35
  assertValidFilePath: () => assertValidFilePath,
36
36
  assertValidImageReference: () => assertValidImageReference,
37
37
  assertValidPrivateKey: () => assertValidPrivateKey,
38
+ checkERC7702Delegation: () => checkERC7702Delegation,
38
39
  createApp: () => createApp,
39
40
  createAppModule: () => createAppModule,
40
41
  createBillingModule: () => createBillingModule,
@@ -1217,7 +1218,7 @@ Please verify the image exists: docker manifest inspect ${finalImageRef}`
1217
1218
  } else {
1218
1219
  logger.info("Continuing without environment file");
1219
1220
  }
1220
- publicEnv["EIGEN_MACHINE_TYPE"] = instanceType;
1221
+ publicEnv["EIGEN_MACHINE_TYPE_PUBLIC"] = instanceType;
1221
1222
  logger.info(`Instance type: ${instanceType}`);
1222
1223
  logger.info("Encrypting environment variables...");
1223
1224
  const { encryptionKey } = getKMSKeysForEnvironment(
@@ -2354,13 +2355,13 @@ async function executeBatch(options, logger) {
2354
2355
  );
2355
2356
  executeBatchData = (0, import_viem.concat)([selector, encodedParams]);
2356
2357
  }
2357
- const isDelegated = await checkERC7702Delegation(
2358
+ const isDelegated2 = await checkERC7702Delegation(
2358
2359
  publicClient,
2359
2360
  account.address,
2360
2361
  environmentConfig.erc7702DelegatorAddress
2361
2362
  );
2362
2363
  let authorizationList = [];
2363
- if (!isDelegated) {
2364
+ if (!isDelegated2) {
2364
2365
  const transactionNonce = await publicClient.getTransactionCount({
2365
2366
  address: account.address,
2366
2367
  blockTag: "pending"
@@ -2512,7 +2513,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
2512
2513
  var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
2513
2514
  var CanUpdateAppProfilePermission = "0x036fef61";
2514
2515
  function getDefaultClientId() {
2515
- const version = true ? "0.1.0-rc.1" : "0.0.0";
2516
+ const version = true ? "0.1.0-rc.2" : "0.0.0";
2516
2517
  return `ecloud-sdk/v${version}`;
2517
2518
  }
2518
2519
  var UserApiClient = class {
@@ -4768,6 +4769,21 @@ async function getBlockTimestamps(rpcUrl, environmentConfig, blockNumbers) {
4768
4769
  }
4769
4770
  return timestamps;
4770
4771
  }
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
+ }
4771
4787
  async function undelegate(options, logger) {
4772
4788
  const { privateKey, rpcUrl, environmentConfig } = options;
4773
4789
  const privateKeyHex = addHexPrefix(privateKey);
@@ -4900,7 +4916,7 @@ async function watchUntilUpgradeComplete(options, logger) {
4900
4916
  if (status === APP_STATUS_STOPPED && ip) {
4901
4917
  logger.info("App upgrade complete.");
4902
4918
  logger.info(`Status: ${status}`);
4903
- logger.info(`To start the app, run: eigenx app start ${appId}`);
4919
+ logger.info(`To start the app, run: ecloud compute app start ${appId}`);
4904
4920
  return true;
4905
4921
  }
4906
4922
  }
@@ -4910,7 +4926,7 @@ async function watchUntilUpgradeComplete(options, logger) {
4910
4926
  if (status === APP_STATUS_STOPPED && ip && hasChanged) {
4911
4927
  logger.info("App upgrade complete.");
4912
4928
  logger.info(`Status: ${status}`);
4913
- logger.info(`To start the app, run: eigenx app start ${appId}`);
4929
+ logger.info(`To start the app, run: ecloud compute app start ${appId}`);
4914
4930
  return true;
4915
4931
  }
4916
4932
  if (status === APP_STATUS_RUNNING && ip && hasChanged) {
@@ -5427,7 +5443,7 @@ async function checkQuotaAvailable(preflightCtx) {
5427
5443
  }
5428
5444
  if (maxQuota === 0) {
5429
5445
  throw new Error(
5430
- "no app quota available. Run 'npx ecloud billing subscribe' to enable app deployment"
5446
+ "no app quota available. Run 'ecloud billing subscribe' to enable app deployment"
5431
5447
  );
5432
5448
  }
5433
5449
  let activeCount;
@@ -6043,7 +6059,7 @@ Before deploying, you'll need:
6043
6059
  ## Deployment
6044
6060
 
6045
6061
  \`\`\`bash
6046
- eigenx app deploy username/image-name
6062
+ ecloud compute app deploy username/image-name
6047
6063
  \`\`\`
6048
6064
 
6049
6065
  The CLI will automatically detect the \`Dockerfile\` and build your app before deploying.
@@ -6051,13 +6067,13 @@ The CLI will automatically detect the \`Dockerfile\` and build your app before d
6051
6067
  ## Management & Monitoring
6052
6068
 
6053
6069
  \`\`\`bash
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
6070
+ ecloud compute app list # List all apps
6071
+ ecloud compute app info [app-name] # Get app details
6072
+ ecloud compute app logs [app-name] # View logs
6073
+ ecloud compute app start [app-name] # Start stopped app
6074
+ ecloud compute app stop [app-name] # Stop running app
6075
+ ecloud compute app terminate [app-name] # Terminate app
6076
+ ecloud compute app upgrade [app-name] [image] # Update deployment
6061
6077
  \`\`\`
6062
6078
  `;
6063
6079
  }
@@ -6552,6 +6568,13 @@ function createAppModule(ctx) {
6552
6568
  );
6553
6569
  return { tx };
6554
6570
  },
6571
+ async isDelegated() {
6572
+ return isDelegated({
6573
+ privateKey,
6574
+ rpcUrl: ctx.rpcUrl,
6575
+ environmentConfig: environment
6576
+ });
6577
+ },
6555
6578
  async undelegate() {
6556
6579
  const tx = await undelegate(
6557
6580
  {
@@ -7000,6 +7023,7 @@ function createECloudClient(cfg) {
7000
7023
  assertValidFilePath,
7001
7024
  assertValidImageReference,
7002
7025
  assertValidPrivateKey,
7026
+ checkERC7702Delegation,
7003
7027
  createApp,
7004
7028
  createAppModule,
7005
7029
  createBillingModule,