@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/dist/index.d.cts CHANGED
@@ -358,7 +358,6 @@ interface AppModule {
358
358
  terminate: (appId: AppId, opts?: LifecycleOpts) => Promise<{
359
359
  tx: `0x${string}` | false;
360
360
  }>;
361
- isDelegated: () => Promise<boolean>;
362
361
  undelegate: () => Promise<{
363
362
  tx: `0x${string}` | false;
364
363
  }>;
@@ -1065,10 +1064,6 @@ interface EstimateBatchGasOptions {
1065
1064
  * through EIP-7702 can have variable costs.
1066
1065
  */
1067
1066
  declare function estimateBatchGas(options: EstimateBatchGasOptions): Promise<GasEstimate>;
1068
- /**
1069
- * Check if account is delegated to ERC-7702 delegator
1070
- */
1071
- declare function checkERC7702Delegation(publicClient: PublicClient, account: Address, delegatorAddress: Address): Promise<boolean>;
1072
1067
 
1073
1068
  /**
1074
1069
  * Preflight checks
@@ -1185,4 +1180,4 @@ interface ECloudClient {
1185
1180
  }
1186
1181
  declare function createECloudClient(cfg: ClientConfig): ECloudClient;
1187
1182
 
1188
- export { type AlreadyActiveResponse, type AppId, type AppInfo, type AppMetrics, type AppModuleConfig, type AppProfile, type AppProfileInfo, type AppProfileResponse, type AppRecord, type BillingEnvironmentConfig, type BillingModuleConfig, type CancelResponse, type CancelSuccessResponse, type ChainID, type CheckoutCreatedResponse, type ClientConfig, type CreateAppOpts, type CreateAppParams, type CreateSubscriptionResponse, type DeployAppOpts, type DeployOptions, type DeployParams, type DeployResult, type DockerImageConfig, type ECloudClient, type Environment, type EnvironmentConfig, type EstimateBatchGasOptions, type EstimateGasOptions, type GasEstimate, type GeneratedKey, type ImageDigestResult, type LegacyKey, type LifecycleOpts, type LogVisibility, type Logger, type LogsOptions, type LogsParams, type NoActiveSubscriptionResponse, PRIMARY_LANGUAGES, type ParsedEnvironment, type PaymentIssueResponse, type PrepareDeployResult, type PrepareUpgradeResult, type PreparedDeploy, type PreparedUpgrade, type PrivateKeySource, type ProductID, type ProductSubscriptionResponse, type Release, type ResourceUsageMonitoring, type SDKCreateAppOpts, type SDKDeployOptions, type SDKLogsOptions, type SDKUpgradeOptions, type StoredKey, type SubscribeResponse, type SubscriptionLineItem, type SubscriptionOpts, type SubscriptionStatus, type UpgradeAppOpts, type UpgradeParams, UserApiClient, assertValidFilePath, assertValidImageReference, assertValidPrivateKey, checkERC7702Delegation, createApp, createAppModule, createBillingModule, createECloudClient, deleteLegacyPrivateKey, deletePrivateKey, encodeStartAppData, encodeStopAppData, encodeTerminateAppData, estimateBatchGas, estimateTransactionGas, executeDeploy, executeUpgrade, extractAppNameFromImage, fetchTemplateCatalog, formatETH, generateNewPrivateKey, getAddressFromPrivateKey, getAllAppsByDeveloper, getAppLatestReleaseBlockNumbers, getAvailableEnvironments, getAvailableTemplates, getBlockTimestamps, getBuildType, getCategoryDescriptions, getCurrentInstanceType, getEnvironmentConfig, getLegacyKeys, getLegacyPrivateKey, getPrivateKey, getPrivateKeyWithSource, getTemplate, isEnvironmentAvailable, isMainnet, isSubscriptionActive, keyExists, listStoredKeys, type logVisibility, logs, prepareDeploy, prepareUpgrade, requirePrivateKey, sanitizeString, sanitizeURL, sanitizeXURL, storePrivateKey, validateAppID, validateAppName, validateCreateAppParams, validateDeployParams, validateDescription, validateFilePath, validateImagePath, validateImageReference, validateInstanceTypeSKU, validateLogVisibility, validateLogsParams, validatePrivateKey, validatePrivateKeyFormat, validateResourceUsageMonitoring, validateURL, validateUpgradeParams, validateXURL, watchDeployment, watchUpgrade };
1183
+ export { type AlreadyActiveResponse, type AppId, type AppInfo, type AppMetrics, type AppModuleConfig, type AppProfile, type AppProfileInfo, type AppProfileResponse, type AppRecord, type BillingEnvironmentConfig, type BillingModuleConfig, type CancelResponse, type CancelSuccessResponse, type ChainID, type CheckoutCreatedResponse, type ClientConfig, type CreateAppOpts, type CreateAppParams, type CreateSubscriptionResponse, type DeployAppOpts, type DeployOptions, type DeployParams, type DeployResult, type DockerImageConfig, type ECloudClient, type Environment, type EnvironmentConfig, type EstimateBatchGasOptions, type EstimateGasOptions, type GasEstimate, type GeneratedKey, type ImageDigestResult, type LegacyKey, type LifecycleOpts, type LogVisibility, type Logger, type LogsOptions, type LogsParams, type NoActiveSubscriptionResponse, PRIMARY_LANGUAGES, type ParsedEnvironment, type PaymentIssueResponse, type PrepareDeployResult, type PrepareUpgradeResult, type PreparedDeploy, type PreparedUpgrade, type PrivateKeySource, type ProductID, type ProductSubscriptionResponse, type Release, type ResourceUsageMonitoring, type SDKCreateAppOpts, type SDKDeployOptions, type SDKLogsOptions, type SDKUpgradeOptions, type StoredKey, type SubscribeResponse, type SubscriptionLineItem, type SubscriptionOpts, type SubscriptionStatus, type UpgradeAppOpts, type UpgradeParams, UserApiClient, assertValidFilePath, assertValidImageReference, assertValidPrivateKey, createApp, createAppModule, createBillingModule, createECloudClient, deleteLegacyPrivateKey, deletePrivateKey, encodeStartAppData, encodeStopAppData, encodeTerminateAppData, estimateBatchGas, estimateTransactionGas, executeDeploy, executeUpgrade, extractAppNameFromImage, fetchTemplateCatalog, formatETH, generateNewPrivateKey, getAddressFromPrivateKey, getAllAppsByDeveloper, getAppLatestReleaseBlockNumbers, getAvailableEnvironments, getAvailableTemplates, getBlockTimestamps, getBuildType, getCategoryDescriptions, getCurrentInstanceType, getEnvironmentConfig, getLegacyKeys, getLegacyPrivateKey, getPrivateKey, getPrivateKeyWithSource, getTemplate, isEnvironmentAvailable, isMainnet, isSubscriptionActive, keyExists, listStoredKeys, type logVisibility, logs, prepareDeploy, prepareUpgrade, requirePrivateKey, sanitizeString, sanitizeURL, sanitizeXURL, storePrivateKey, validateAppID, validateAppName, validateCreateAppParams, validateDeployParams, validateDescription, validateFilePath, validateImagePath, validateImageReference, validateInstanceTypeSKU, validateLogVisibility, validateLogsParams, validatePrivateKey, validatePrivateKeyFormat, validateResourceUsageMonitoring, validateURL, validateUpgradeParams, validateXURL, watchDeployment, watchUpgrade };
package/dist/index.d.ts CHANGED
@@ -358,7 +358,6 @@ interface AppModule {
358
358
  terminate: (appId: AppId, opts?: LifecycleOpts) => Promise<{
359
359
  tx: `0x${string}` | false;
360
360
  }>;
361
- isDelegated: () => Promise<boolean>;
362
361
  undelegate: () => Promise<{
363
362
  tx: `0x${string}` | false;
364
363
  }>;
@@ -1065,10 +1064,6 @@ interface EstimateBatchGasOptions {
1065
1064
  * through EIP-7702 can have variable costs.
1066
1065
  */
1067
1066
  declare function estimateBatchGas(options: EstimateBatchGasOptions): Promise<GasEstimate>;
1068
- /**
1069
- * Check if account is delegated to ERC-7702 delegator
1070
- */
1071
- declare function checkERC7702Delegation(publicClient: PublicClient, account: Address, delegatorAddress: Address): Promise<boolean>;
1072
1067
 
1073
1068
  /**
1074
1069
  * Preflight checks
@@ -1185,4 +1180,4 @@ interface ECloudClient {
1185
1180
  }
1186
1181
  declare function createECloudClient(cfg: ClientConfig): ECloudClient;
1187
1182
 
1188
- export { type AlreadyActiveResponse, type AppId, type AppInfo, type AppMetrics, type AppModuleConfig, type AppProfile, type AppProfileInfo, type AppProfileResponse, type AppRecord, type BillingEnvironmentConfig, type BillingModuleConfig, type CancelResponse, type CancelSuccessResponse, type ChainID, type CheckoutCreatedResponse, type ClientConfig, type CreateAppOpts, type CreateAppParams, type CreateSubscriptionResponse, type DeployAppOpts, type DeployOptions, type DeployParams, type DeployResult, type DockerImageConfig, type ECloudClient, type Environment, type EnvironmentConfig, type EstimateBatchGasOptions, type EstimateGasOptions, type GasEstimate, type GeneratedKey, type ImageDigestResult, type LegacyKey, type LifecycleOpts, type LogVisibility, type Logger, type LogsOptions, type LogsParams, type NoActiveSubscriptionResponse, PRIMARY_LANGUAGES, type ParsedEnvironment, type PaymentIssueResponse, type PrepareDeployResult, type PrepareUpgradeResult, type PreparedDeploy, type PreparedUpgrade, type PrivateKeySource, type ProductID, type ProductSubscriptionResponse, type Release, type ResourceUsageMonitoring, type SDKCreateAppOpts, type SDKDeployOptions, type SDKLogsOptions, type SDKUpgradeOptions, type StoredKey, type SubscribeResponse, type SubscriptionLineItem, type SubscriptionOpts, type SubscriptionStatus, type UpgradeAppOpts, type UpgradeParams, UserApiClient, assertValidFilePath, assertValidImageReference, assertValidPrivateKey, checkERC7702Delegation, createApp, createAppModule, createBillingModule, createECloudClient, deleteLegacyPrivateKey, deletePrivateKey, encodeStartAppData, encodeStopAppData, encodeTerminateAppData, estimateBatchGas, estimateTransactionGas, executeDeploy, executeUpgrade, extractAppNameFromImage, fetchTemplateCatalog, formatETH, generateNewPrivateKey, getAddressFromPrivateKey, getAllAppsByDeveloper, getAppLatestReleaseBlockNumbers, getAvailableEnvironments, getAvailableTemplates, getBlockTimestamps, getBuildType, getCategoryDescriptions, getCurrentInstanceType, getEnvironmentConfig, getLegacyKeys, getLegacyPrivateKey, getPrivateKey, getPrivateKeyWithSource, getTemplate, isEnvironmentAvailable, isMainnet, isSubscriptionActive, keyExists, listStoredKeys, type logVisibility, logs, prepareDeploy, prepareUpgrade, requirePrivateKey, sanitizeString, sanitizeURL, sanitizeXURL, storePrivateKey, validateAppID, validateAppName, validateCreateAppParams, validateDeployParams, validateDescription, validateFilePath, validateImagePath, validateImageReference, validateInstanceTypeSKU, validateLogVisibility, validateLogsParams, validatePrivateKey, validatePrivateKeyFormat, validateResourceUsageMonitoring, validateURL, validateUpgradeParams, validateXURL, watchDeployment, watchUpgrade };
1183
+ export { type AlreadyActiveResponse, type AppId, type AppInfo, type AppMetrics, type AppModuleConfig, type AppProfile, type AppProfileInfo, type AppProfileResponse, type AppRecord, type BillingEnvironmentConfig, type BillingModuleConfig, type CancelResponse, type CancelSuccessResponse, type ChainID, type CheckoutCreatedResponse, type ClientConfig, type CreateAppOpts, type CreateAppParams, type CreateSubscriptionResponse, type DeployAppOpts, type DeployOptions, type DeployParams, type DeployResult, type DockerImageConfig, type ECloudClient, type Environment, type EnvironmentConfig, type EstimateBatchGasOptions, type EstimateGasOptions, type GasEstimate, type GeneratedKey, type ImageDigestResult, type LegacyKey, type LifecycleOpts, type LogVisibility, type Logger, type LogsOptions, type LogsParams, type NoActiveSubscriptionResponse, PRIMARY_LANGUAGES, type ParsedEnvironment, type PaymentIssueResponse, type PrepareDeployResult, type PrepareUpgradeResult, type PreparedDeploy, type PreparedUpgrade, type PrivateKeySource, type ProductID, type ProductSubscriptionResponse, type Release, type ResourceUsageMonitoring, type SDKCreateAppOpts, type SDKDeployOptions, type SDKLogsOptions, type SDKUpgradeOptions, type StoredKey, type SubscribeResponse, type SubscriptionLineItem, type SubscriptionOpts, type SubscriptionStatus, type UpgradeAppOpts, type UpgradeParams, UserApiClient, assertValidFilePath, assertValidImageReference, assertValidPrivateKey, createApp, createAppModule, createBillingModule, createECloudClient, deleteLegacyPrivateKey, deletePrivateKey, encodeStartAppData, encodeStopAppData, encodeTerminateAppData, estimateBatchGas, estimateTransactionGas, executeDeploy, executeUpgrade, extractAppNameFromImage, fetchTemplateCatalog, formatETH, generateNewPrivateKey, getAddressFromPrivateKey, getAllAppsByDeveloper, getAppLatestReleaseBlockNumbers, getAvailableEnvironments, getAvailableTemplates, getBlockTimestamps, getBuildType, getCategoryDescriptions, getCurrentInstanceType, getEnvironmentConfig, getLegacyKeys, getLegacyPrivateKey, getPrivateKey, getPrivateKeyWithSource, getTemplate, isEnvironmentAvailable, isMainnet, isSubscriptionActive, keyExists, listStoredKeys, type logVisibility, logs, prepareDeploy, prepareUpgrade, requirePrivateKey, sanitizeString, sanitizeURL, sanitizeXURL, storePrivateKey, validateAppID, validateAppName, validateCreateAppParams, validateDeployParams, validateDescription, validateFilePath, validateImagePath, validateImageReference, validateInstanceTypeSKU, validateLogVisibility, validateLogsParams, validatePrivateKey, validatePrivateKeyFormat, validateResourceUsageMonitoring, validateURL, validateUpgradeParams, validateXURL, watchDeployment, watchUpgrade };
package/dist/index.js CHANGED
@@ -89,7 +89,7 @@ function getBillingEnvironmentConfig(build) {
89
89
  return config;
90
90
  }
91
91
  function getBuildType() {
92
- const buildTimeType = true ? "dev"?.toLowerCase() : void 0;
92
+ const buildTimeType = true ? "prod"?.toLowerCase() : void 0;
93
93
  const runtimeType = process.env.BUILD_TYPE?.toLowerCase();
94
94
  const buildType = buildTimeType || runtimeType;
95
95
  if (buildType === "dev") {
@@ -1112,7 +1112,7 @@ Please verify the image exists: docker manifest inspect ${finalImageRef}`
1112
1112
  } else {
1113
1113
  logger.info("Continuing without environment file");
1114
1114
  }
1115
- publicEnv["EIGEN_MACHINE_TYPE_PUBLIC"] = instanceType;
1115
+ publicEnv["EIGEN_MACHINE_TYPE"] = instanceType;
1116
1116
  logger.info(`Instance type: ${instanceType}`);
1117
1117
  logger.info("Encrypting environment variables...");
1118
1118
  const { encryptionKey } = getKMSKeysForEnvironment(
@@ -2256,13 +2256,13 @@ async function executeBatch(options, logger) {
2256
2256
  );
2257
2257
  executeBatchData = concat([selector, encodedParams]);
2258
2258
  }
2259
- const isDelegated2 = await checkERC7702Delegation(
2259
+ const isDelegated = await checkERC7702Delegation(
2260
2260
  publicClient,
2261
2261
  account.address,
2262
2262
  environmentConfig.erc7702DelegatorAddress
2263
2263
  );
2264
2264
  let authorizationList = [];
2265
- if (!isDelegated2) {
2265
+ if (!isDelegated) {
2266
2266
  const transactionNonce = await publicClient.getTransactionCount({
2267
2267
  address: account.address,
2268
2268
  blockTag: "pending"
@@ -2420,7 +2420,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
2420
2420
  var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
2421
2421
  var CanUpdateAppProfilePermission = "0x036fef61";
2422
2422
  function getDefaultClientId() {
2423
- const version = true ? "0.1.0-dev.2" : "0.0.0";
2423
+ const version = true ? "0.1.0-rc.1" : "0.0.0";
2424
2424
  return `ecloud-sdk/v${version}`;
2425
2425
  }
2426
2426
  var UserApiClient = class {
@@ -4676,21 +4676,6 @@ async function getBlockTimestamps(rpcUrl, environmentConfig, blockNumbers) {
4676
4676
  }
4677
4677
  return timestamps;
4678
4678
  }
4679
- async function isDelegated(options) {
4680
- const { privateKey, rpcUrl, environmentConfig } = options;
4681
- const privateKeyHex = addHexPrefix(privateKey);
4682
- const account = privateKeyToAccount2(privateKeyHex);
4683
- const chain = getChainFromID(environmentConfig.chainID);
4684
- const publicClient = createPublicClient2({
4685
- chain,
4686
- transport: http2(rpcUrl)
4687
- });
4688
- return checkERC7702Delegation(
4689
- publicClient,
4690
- account.address,
4691
- environmentConfig.erc7702DelegatorAddress
4692
- );
4693
- }
4694
4679
  async function undelegate(options, logger) {
4695
4680
  const { privateKey, rpcUrl, environmentConfig } = options;
4696
4681
  const privateKeyHex = addHexPrefix(privateKey);
@@ -4823,7 +4808,7 @@ async function watchUntilUpgradeComplete(options, logger) {
4823
4808
  if (status === APP_STATUS_STOPPED && ip) {
4824
4809
  logger.info("App upgrade complete.");
4825
4810
  logger.info(`Status: ${status}`);
4826
- logger.info(`To start the app, run: ecloud compute app start ${appId}`);
4811
+ logger.info(`To start the app, run: eigenx app start ${appId}`);
4827
4812
  return true;
4828
4813
  }
4829
4814
  }
@@ -4833,7 +4818,7 @@ async function watchUntilUpgradeComplete(options, logger) {
4833
4818
  if (status === APP_STATUS_STOPPED && ip && hasChanged) {
4834
4819
  logger.info("App upgrade complete.");
4835
4820
  logger.info(`Status: ${status}`);
4836
- logger.info(`To start the app, run: ecloud compute app start ${appId}`);
4821
+ logger.info(`To start the app, run: eigenx app start ${appId}`);
4837
4822
  return true;
4838
4823
  }
4839
4824
  if (status === APP_STATUS_RUNNING && ip && hasChanged) {
@@ -5350,7 +5335,7 @@ async function checkQuotaAvailable(preflightCtx) {
5350
5335
  }
5351
5336
  if (maxQuota === 0) {
5352
5337
  throw new Error(
5353
- "no app quota available. Run 'ecloud billing subscribe' to enable app deployment"
5338
+ "no app quota available. Run 'npx ecloud billing subscribe' to enable app deployment"
5354
5339
  );
5355
5340
  }
5356
5341
  let activeCount;
@@ -5966,7 +5951,7 @@ Before deploying, you'll need:
5966
5951
  ## Deployment
5967
5952
 
5968
5953
  \`\`\`bash
5969
- ecloud compute app deploy username/image-name
5954
+ eigenx app deploy username/image-name
5970
5955
  \`\`\`
5971
5956
 
5972
5957
  The CLI will automatically detect the \`Dockerfile\` and build your app before deploying.
@@ -5974,13 +5959,13 @@ The CLI will automatically detect the \`Dockerfile\` and build your app before d
5974
5959
  ## Management & Monitoring
5975
5960
 
5976
5961
  \`\`\`bash
5977
- ecloud compute app list # List all apps
5978
- ecloud compute app info [app-name] # Get app details
5979
- ecloud compute app logs [app-name] # View logs
5980
- ecloud compute app start [app-name] # Start stopped app
5981
- ecloud compute app stop [app-name] # Stop running app
5982
- ecloud compute app terminate [app-name] # Terminate app
5983
- ecloud compute app upgrade [app-name] [image] # Update deployment
5962
+ npx ecloud app list # List all apps
5963
+ npx ecloud app info [app-name] # Get app details
5964
+ npx ecloud app logs [app-name] # View logs
5965
+ npx ecloud app start [app-name] # Start stopped app
5966
+ npx ecloud app stop [app-name] # Stop running app
5967
+ npx ecloud app terminate [app-name] # Terminate app
5968
+ npx ecloud app upgrade [app-name] [image] # Update deployment
5984
5969
  \`\`\`
5985
5970
  `;
5986
5971
  }
@@ -6475,13 +6460,6 @@ function createAppModule(ctx) {
6475
6460
  );
6476
6461
  return { tx };
6477
6462
  },
6478
- async isDelegated() {
6479
- return isDelegated({
6480
- privateKey,
6481
- rpcUrl: ctx.rpcUrl,
6482
- environmentConfig: environment
6483
- });
6484
- },
6485
6463
  async undelegate() {
6486
6464
  const tx = await undelegate(
6487
6465
  {
@@ -6929,7 +6907,6 @@ export {
6929
6907
  assertValidFilePath,
6930
6908
  assertValidImageReference,
6931
6909
  assertValidPrivateKey,
6932
- checkERC7702Delegation,
6933
6910
  createApp,
6934
6911
  createAppModule,
6935
6912
  createBillingModule,