@layr-labs/ecloud-sdk 1.0.0-dev.1 → 1.0.0-dev.3

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.
@@ -1,7 +1,7 @@
1
- import { A as AppId } from './index-BbH7ZCIu.cjs';
2
- export { a as AlreadyActiveResponse, b as AppConfig, c as AppProfile, d as AppProfileResponse, e as AppRecord, B as BatchedDeployResult, f as BillingEnvironmentConfig, C as CalculateAppIDOptions, g as CancelResponse, h as CancelSuccessResponse, i as ChainID, j as CheckoutCreatedResponse, k as CreateSubscriptionOptions, l as CreateSubscriptionResponse, m as CreditPurchaseResponse, D as DeployAppOptions, n as DeployAppOpts, o as DeployOptions, p as DeployProgressCallback, q as DeployResult, r as DeployStep, s as DockerImageConfig, E as EnvironmentConfig, t as EstimateGasOptions, u as ExecuteDeployBatchedOptions, v as ExecuteDeployResult, w as ExecuteDeploySequentialOptions, x as ExecuteUpgradeResult, G as GasEstimate, y as GasOpts, z as GetSubscriptionOptions, I as ImageDigestResult, F as IsDelegatedOptions, L as LifecycleOpts, H as Logger, N as NoActiveSubscriptionResponse, P as ParsedEnvironment, J as PaymentIssueResponse, K as PaymentMethod, M as PaymentMethodsResponse, O as PrepareDeployBatchOptions, Q as PrepareDeployFromVerifiableBuildOpts, R as PrepareDeployOpts, S as PrepareUpgradeBatchOptions, T as PrepareUpgradeFromVerifiableBuildOpts, U as PrepareUpgradeOpts, V as PreparedDeploy, W as PreparedDeployBatch, X as PreparedDeployData, Y as PreparedUpgrade, Z as PreparedUpgradeBatch, _ as PreparedUpgradeData, $ as ProductID, a0 as ProductSubscriptionResponse, a1 as Release, a2 as SendTransactionOptions, a3 as SequentialDeployResult, a4 as SubscribeResponse, a5 as SubscriptionLineItem, a6 as SubscriptionOpts, a7 as SubscriptionStatus, a8 as SuspendOptions, a9 as UndelegateOptions, aa as UpgradeAppOptions, ab as UpgradeAppOpts, ac as calculateAppID, ad as deployApp, ae as estimateTransactionGas, af as executeDeployBatch, ag as executeDeployBatched, ah as executeDeploySequential, ai as executeUpgradeBatch, aj as formatETH, ak as getActiveAppCount, al as getAllAppsByDeveloper, am as getAppsByBillingAccount, an as getAppsByCreator, ao as getAppsByDeveloper, ap as getBillingType, aq as getMaxActiveAppsPerUser, ar as isDelegated, as as logVisibility, at as noopLogger, au as prepareDeployBatch, av as prepareUpgradeBatch, aw as sendAndWaitForTransaction, ax as supportsEIP5792, ay as supportsEIP7702, az as suspend, aA as undelegate, aB as upgradeApp } from './index-BbH7ZCIu.cjs';
3
- import { C as ComputeApiConfig, S as SessionInfo, a as SessionError, b as SiweMessageParams } from './helpers-CfsfcGJO.cjs';
4
- export { A as AppInfo, c as AppInfoResponse, d as AppMetrics, e as AppProfileInfo, B as BillingApiClient, f as BillingApiClientOptions, g as BillingApiConfig, h as BillingLoginRequest, i as BillingLoginResult, j as BillingSessionError, k as BillingSessionInfo, l as CreateAppParams, E as EstimateBatchGasOptions, m as ExecuteBatchOptions, n as Execution, G as GeneratedKey, L as LogVisibility, o as LoginRequest, p as LoginResult, q as LogsParams, r as SiweMessageResult, U as UserApiClient, s as UserApiClientOptions, t as addHexPrefix, u as assertValidImageReference, v as assertValidPrivateKey, w as checkERC7702Delegation, x as createSiweMessage, y as estimateBatchGas, z as executeBatch, D as extractAppNameFromImage, F as generateNewPrivateKey, H as generateNonce, I as getAvailableEnvironments, J as getBillingApiSession, K as getBillingEnvironmentConfig, M as getBuildType, N as getChainFromID, O as getComputeApiSession, P as getEnvironmentConfig, Q as isBillingSessionValid, R as isEnvironmentAvailable, T as isMainnet, V as isSessionValid, W as isSiweMessageExpired, X as isSiweMessageNotYetValid, Y as isSubscriptionActive, Z as loginToBillingApi, _ as loginToBothApis, $ as loginToComputeApi, a0 as logoutFromBillingApi, a1 as logoutFromBothApis, a2 as logoutFromComputeApi, a3 as parseSiweMessage, a4 as sanitizeString, a5 as sanitizeURL, a6 as sanitizeXURL, a7 as stripHexPrefix, a8 as validateAppID, a9 as validateAppName, aa as validateCreateAppParams, ab as validateDescription, ac as validateImageReference, ad as validateInstanceTypeSKU, ae as validateLogVisibility, af as validateLogsParams, ag as validatePrivateKeyFormat, ah as validateURL, ai as validateXURL } from './helpers-CfsfcGJO.cjs';
1
+ import { A as AppId } from './index-Bac4HjC0.cjs';
2
+ export { a as AlreadyActiveResponse, b as AppConfig, c as AppProfile, d as AppProfileResponse, e as AppRecord, B as BatchedDeployResult, f as BillingEnvironmentConfig, C as CalculateAppIDOptions, g as CancelResponse, h as CancelSuccessResponse, i as ChainID, j as CheckoutCreatedResponse, k as CreateSubscriptionOptions, l as CreateSubscriptionResponse, m as CreditPurchaseResponse, D as DeployAppOptions, n as DeployAppOpts, o as DeployOptions, p as DeployProgressCallback, q as DeployResult, r as DeployStep, s as DockerImageConfig, E as EnvironmentConfig, t as EstimateGasOptions, u as ExecuteDeployBatchedOptions, v as ExecuteDeployResult, w as ExecuteDeploySequentialOptions, x as ExecuteUpgradeResult, G as GasEstimate, y as GasOpts, z as GetSubscriptionOptions, I as ImageDigestResult, F as IsDelegatedOptions, L as LifecycleOpts, H as Logger, N as NoActiveSubscriptionResponse, P as ParsedEnvironment, J as PaymentIssueResponse, K as PaymentMethod, M as PaymentMethodsResponse, O as PrepareDeployBatchOptions, Q as PrepareDeployFromVerifiableBuildOpts, R as PrepareDeployOpts, S as PrepareUpgradeBatchOptions, T as PrepareUpgradeFromVerifiableBuildOpts, U as PrepareUpgradeOpts, V as PreparedDeploy, W as PreparedDeployBatch, X as PreparedDeployData, Y as PreparedUpgrade, Z as PreparedUpgradeBatch, _ as PreparedUpgradeData, $ as ProductID, a0 as ProductSubscriptionResponse, a1 as Release, a2 as SendTransactionOptions, a3 as SequentialDeployResult, a4 as SubscribeResponse, a5 as SubscriptionLineItem, a6 as SubscriptionOpts, a7 as SubscriptionStatus, a8 as SuspendOptions, a9 as UndelegateOptions, aa as UpgradeAppOptions, ab as UpgradeAppOpts, ac as calculateAppID, ad as deployApp, ae as estimateTransactionGas, af as executeDeployBatch, ag as executeDeployBatched, ah as executeDeploySequential, ai as executeUpgradeBatch, aj as formatETH, ak as getActiveAppCount, al as getAllAppsByDeveloper, am as getAppsByBillingAccount, an as getAppsByCreator, ao as getAppsByDeveloper, ap as getBillingType, aq as getMaxActiveAppsPerUser, ar as isDelegated, as as logVisibility, at as noopLogger, au as prepareDeployBatch, av as prepareUpgradeBatch, aw as sendAndWaitForTransaction, ax as supportsEIP5792, ay as supportsEIP7702, az as suspend, aA as undelegate, aB as upgradeApp } from './index-Bac4HjC0.cjs';
3
+ import { C as ComputeApiConfig, S as SessionInfo, a as SessionError, b as SiweMessageParams } from './helpers-CnlJ5yPE.cjs';
4
+ export { A as AppInfo, c as AppInfoResponse, d as AppMetrics, e as AppProfileInfo, B as BillingApiClient, f as BillingApiClientOptions, g as BillingApiConfig, h as BillingLoginRequest, i as BillingLoginResult, j as BillingSessionError, k as BillingSessionInfo, l as CreateAppParams, E as EstimateBatchGasOptions, m as ExecuteBatchOptions, n as Execution, G as GeneratedKey, L as LogVisibility, o as LoginRequest, p as LoginResult, q as LogsParams, r as SiweMessageResult, U as UserApiClient, s as UserApiClientOptions, t as addHexPrefix, u as assertValidImageReference, v as assertValidPrivateKey, w as checkERC7702Delegation, x as createSiweMessage, y as estimateBatchGas, z as executeBatch, D as extractAppNameFromImage, F as generateNewPrivateKey, H as generateNonce, I as getAvailableEnvironments, J as getBillingApiSession, K as getBillingEnvironmentConfig, M as getBuildType, N as getChainFromID, O as getComputeApiSession, P as getEnvironmentConfig, Q as isBillingSessionValid, R as isEnvironmentAvailable, T as isMainnet, V as isSessionValid, W as isSiweMessageExpired, X as isSiweMessageNotYetValid, Y as isSubscriptionActive, Z as loginToBillingApi, _ as loginToBothApis, $ as loginToComputeApi, a0 as logoutFromBillingApi, a1 as logoutFromBothApis, a2 as logoutFromComputeApi, a3 as parseSiweMessage, a4 as sanitizeString, a5 as sanitizeURL, a6 as sanitizeXURL, a7 as stripHexPrefix, a8 as validateAppID, a9 as validateAppName, aa as validateCreateAppParams, ab as validateDescription, ac as validateImageReference, ad as validateInstanceTypeSKU, ae as validateLogVisibility, af as validateLogsParams, ag as validatePrivateKeyFormat, ah as validateURL, ai as validateXURL } from './helpers-CnlJ5yPE.cjs';
5
5
  import { WalletClient, Address, Hex } from 'viem';
6
6
  import { Buffer as Buffer$1 } from 'buffer';
7
7
 
package/dist/browser.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { A as AppId } from './index-BbH7ZCIu.js';
2
- export { a as AlreadyActiveResponse, b as AppConfig, c as AppProfile, d as AppProfileResponse, e as AppRecord, B as BatchedDeployResult, f as BillingEnvironmentConfig, C as CalculateAppIDOptions, g as CancelResponse, h as CancelSuccessResponse, i as ChainID, j as CheckoutCreatedResponse, k as CreateSubscriptionOptions, l as CreateSubscriptionResponse, m as CreditPurchaseResponse, D as DeployAppOptions, n as DeployAppOpts, o as DeployOptions, p as DeployProgressCallback, q as DeployResult, r as DeployStep, s as DockerImageConfig, E as EnvironmentConfig, t as EstimateGasOptions, u as ExecuteDeployBatchedOptions, v as ExecuteDeployResult, w as ExecuteDeploySequentialOptions, x as ExecuteUpgradeResult, G as GasEstimate, y as GasOpts, z as GetSubscriptionOptions, I as ImageDigestResult, F as IsDelegatedOptions, L as LifecycleOpts, H as Logger, N as NoActiveSubscriptionResponse, P as ParsedEnvironment, J as PaymentIssueResponse, K as PaymentMethod, M as PaymentMethodsResponse, O as PrepareDeployBatchOptions, Q as PrepareDeployFromVerifiableBuildOpts, R as PrepareDeployOpts, S as PrepareUpgradeBatchOptions, T as PrepareUpgradeFromVerifiableBuildOpts, U as PrepareUpgradeOpts, V as PreparedDeploy, W as PreparedDeployBatch, X as PreparedDeployData, Y as PreparedUpgrade, Z as PreparedUpgradeBatch, _ as PreparedUpgradeData, $ as ProductID, a0 as ProductSubscriptionResponse, a1 as Release, a2 as SendTransactionOptions, a3 as SequentialDeployResult, a4 as SubscribeResponse, a5 as SubscriptionLineItem, a6 as SubscriptionOpts, a7 as SubscriptionStatus, a8 as SuspendOptions, a9 as UndelegateOptions, aa as UpgradeAppOptions, ab as UpgradeAppOpts, ac as calculateAppID, ad as deployApp, ae as estimateTransactionGas, af as executeDeployBatch, ag as executeDeployBatched, ah as executeDeploySequential, ai as executeUpgradeBatch, aj as formatETH, ak as getActiveAppCount, al as getAllAppsByDeveloper, am as getAppsByBillingAccount, an as getAppsByCreator, ao as getAppsByDeveloper, ap as getBillingType, aq as getMaxActiveAppsPerUser, ar as isDelegated, as as logVisibility, at as noopLogger, au as prepareDeployBatch, av as prepareUpgradeBatch, aw as sendAndWaitForTransaction, ax as supportsEIP5792, ay as supportsEIP7702, az as suspend, aA as undelegate, aB as upgradeApp } from './index-BbH7ZCIu.js';
3
- import { C as ComputeApiConfig, S as SessionInfo, a as SessionError, b as SiweMessageParams } from './helpers-BRamdfGn.js';
4
- export { A as AppInfo, c as AppInfoResponse, d as AppMetrics, e as AppProfileInfo, B as BillingApiClient, f as BillingApiClientOptions, g as BillingApiConfig, h as BillingLoginRequest, i as BillingLoginResult, j as BillingSessionError, k as BillingSessionInfo, l as CreateAppParams, E as EstimateBatchGasOptions, m as ExecuteBatchOptions, n as Execution, G as GeneratedKey, L as LogVisibility, o as LoginRequest, p as LoginResult, q as LogsParams, r as SiweMessageResult, U as UserApiClient, s as UserApiClientOptions, t as addHexPrefix, u as assertValidImageReference, v as assertValidPrivateKey, w as checkERC7702Delegation, x as createSiweMessage, y as estimateBatchGas, z as executeBatch, D as extractAppNameFromImage, F as generateNewPrivateKey, H as generateNonce, I as getAvailableEnvironments, J as getBillingApiSession, K as getBillingEnvironmentConfig, M as getBuildType, N as getChainFromID, O as getComputeApiSession, P as getEnvironmentConfig, Q as isBillingSessionValid, R as isEnvironmentAvailable, T as isMainnet, V as isSessionValid, W as isSiweMessageExpired, X as isSiweMessageNotYetValid, Y as isSubscriptionActive, Z as loginToBillingApi, _ as loginToBothApis, $ as loginToComputeApi, a0 as logoutFromBillingApi, a1 as logoutFromBothApis, a2 as logoutFromComputeApi, a3 as parseSiweMessage, a4 as sanitizeString, a5 as sanitizeURL, a6 as sanitizeXURL, a7 as stripHexPrefix, a8 as validateAppID, a9 as validateAppName, aa as validateCreateAppParams, ab as validateDescription, ac as validateImageReference, ad as validateInstanceTypeSKU, ae as validateLogVisibility, af as validateLogsParams, ag as validatePrivateKeyFormat, ah as validateURL, ai as validateXURL } from './helpers-BRamdfGn.js';
1
+ import { A as AppId } from './index-Bac4HjC0.js';
2
+ export { a as AlreadyActiveResponse, b as AppConfig, c as AppProfile, d as AppProfileResponse, e as AppRecord, B as BatchedDeployResult, f as BillingEnvironmentConfig, C as CalculateAppIDOptions, g as CancelResponse, h as CancelSuccessResponse, i as ChainID, j as CheckoutCreatedResponse, k as CreateSubscriptionOptions, l as CreateSubscriptionResponse, m as CreditPurchaseResponse, D as DeployAppOptions, n as DeployAppOpts, o as DeployOptions, p as DeployProgressCallback, q as DeployResult, r as DeployStep, s as DockerImageConfig, E as EnvironmentConfig, t as EstimateGasOptions, u as ExecuteDeployBatchedOptions, v as ExecuteDeployResult, w as ExecuteDeploySequentialOptions, x as ExecuteUpgradeResult, G as GasEstimate, y as GasOpts, z as GetSubscriptionOptions, I as ImageDigestResult, F as IsDelegatedOptions, L as LifecycleOpts, H as Logger, N as NoActiveSubscriptionResponse, P as ParsedEnvironment, J as PaymentIssueResponse, K as PaymentMethod, M as PaymentMethodsResponse, O as PrepareDeployBatchOptions, Q as PrepareDeployFromVerifiableBuildOpts, R as PrepareDeployOpts, S as PrepareUpgradeBatchOptions, T as PrepareUpgradeFromVerifiableBuildOpts, U as PrepareUpgradeOpts, V as PreparedDeploy, W as PreparedDeployBatch, X as PreparedDeployData, Y as PreparedUpgrade, Z as PreparedUpgradeBatch, _ as PreparedUpgradeData, $ as ProductID, a0 as ProductSubscriptionResponse, a1 as Release, a2 as SendTransactionOptions, a3 as SequentialDeployResult, a4 as SubscribeResponse, a5 as SubscriptionLineItem, a6 as SubscriptionOpts, a7 as SubscriptionStatus, a8 as SuspendOptions, a9 as UndelegateOptions, aa as UpgradeAppOptions, ab as UpgradeAppOpts, ac as calculateAppID, ad as deployApp, ae as estimateTransactionGas, af as executeDeployBatch, ag as executeDeployBatched, ah as executeDeploySequential, ai as executeUpgradeBatch, aj as formatETH, ak as getActiveAppCount, al as getAllAppsByDeveloper, am as getAppsByBillingAccount, an as getAppsByCreator, ao as getAppsByDeveloper, ap as getBillingType, aq as getMaxActiveAppsPerUser, ar as isDelegated, as as logVisibility, at as noopLogger, au as prepareDeployBatch, av as prepareUpgradeBatch, aw as sendAndWaitForTransaction, ax as supportsEIP5792, ay as supportsEIP7702, az as suspend, aA as undelegate, aB as upgradeApp } from './index-Bac4HjC0.js';
3
+ import { C as ComputeApiConfig, S as SessionInfo, a as SessionError, b as SiweMessageParams } from './helpers-GWlLS3gz.js';
4
+ export { A as AppInfo, c as AppInfoResponse, d as AppMetrics, e as AppProfileInfo, B as BillingApiClient, f as BillingApiClientOptions, g as BillingApiConfig, h as BillingLoginRequest, i as BillingLoginResult, j as BillingSessionError, k as BillingSessionInfo, l as CreateAppParams, E as EstimateBatchGasOptions, m as ExecuteBatchOptions, n as Execution, G as GeneratedKey, L as LogVisibility, o as LoginRequest, p as LoginResult, q as LogsParams, r as SiweMessageResult, U as UserApiClient, s as UserApiClientOptions, t as addHexPrefix, u as assertValidImageReference, v as assertValidPrivateKey, w as checkERC7702Delegation, x as createSiweMessage, y as estimateBatchGas, z as executeBatch, D as extractAppNameFromImage, F as generateNewPrivateKey, H as generateNonce, I as getAvailableEnvironments, J as getBillingApiSession, K as getBillingEnvironmentConfig, M as getBuildType, N as getChainFromID, O as getComputeApiSession, P as getEnvironmentConfig, Q as isBillingSessionValid, R as isEnvironmentAvailable, T as isMainnet, V as isSessionValid, W as isSiweMessageExpired, X as isSiweMessageNotYetValid, Y as isSubscriptionActive, Z as loginToBillingApi, _ as loginToBothApis, $ as loginToComputeApi, a0 as logoutFromBillingApi, a1 as logoutFromBothApis, a2 as logoutFromComputeApi, a3 as parseSiweMessage, a4 as sanitizeString, a5 as sanitizeURL, a6 as sanitizeXURL, a7 as stripHexPrefix, a8 as validateAppID, a9 as validateAppName, aa as validateCreateAppParams, ab as validateDescription, ac as validateImageReference, ad as validateInstanceTypeSKU, ae as validateLogVisibility, af as validateLogsParams, ag as validatePrivateKeyFormat, ah as validateURL, ai as validateXURL } from './helpers-GWlLS3gz.js';
5
5
  import { WalletClient, Address, Hex } from 'viem';
6
6
  import { Buffer as Buffer$1 } from 'buffer';
7
7
 
package/dist/browser.js CHANGED
@@ -219,6 +219,12 @@ var CHAIN_ID_TO_ENVIRONMENT = {
219
219
  [SEPOLIA_CHAIN_ID.toString()]: "sepolia",
220
220
  [MAINNET_CHAIN_ID.toString()]: "mainnet-alpha"
221
221
  };
222
+ function getApiUrlOverride() {
223
+ const raw = process.env.ECLOUD_API_URL;
224
+ if (!raw) return void 0;
225
+ const trimmed = raw.trim().replace(/\/+$/, "");
226
+ return trimmed.length > 0 ? trimmed : void 0;
227
+ }
222
228
  function getEnvironmentConfig(environment, chainID) {
223
229
  const env = ENVIRONMENTS[environment];
224
230
  if (!env) {
@@ -236,9 +242,11 @@ function getEnvironmentConfig(environment, chainID) {
236
242
  }
237
243
  }
238
244
  const resolvedChainID = chainID || (environment === "sepolia" || environment === "sepolia-dev" ? SEPOLIA_CHAIN_ID : MAINNET_CHAIN_ID);
245
+ const apiUrlOverride = getApiUrlOverride();
239
246
  return {
240
247
  ...env,
241
248
  chainID: BigInt(resolvedChainID),
249
+ ...apiUrlOverride ? { userApiServerURL: apiUrlOverride } : {},
242
250
  ...process.env.ECLOUD_USER_API_URL && {
243
251
  userApiServerURL: process.env.ECLOUD_USER_API_URL
244
252
  },
@@ -252,6 +260,10 @@ function getBillingEnvironmentConfig(build) {
252
260
  if (!config) {
253
261
  throw new Error(`Unknown billing environment: ${build}`);
254
262
  }
263
+ const apiUrlOverride = getApiUrlOverride();
264
+ if (apiUrlOverride) {
265
+ return { billingApiServerURL: apiUrlOverride };
266
+ }
255
267
  return {
256
268
  ...config,
257
269
  ...process.env.ECLOUD_BILLING_API_URL && {
@@ -617,7 +629,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
617
629
  var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
618
630
  var CanUpdateAppProfilePermission = "0x036fef61";
619
631
  function getDefaultClientId() {
620
- const version = true ? "1.0.0-dev.1" : "0.0.0";
632
+ const version = true ? "1.0.0-dev.3" : "0.0.0";
621
633
  return `ecloud-sdk/v${version}`;
622
634
  }
623
635
  var UserApiClient = class {
@@ -1230,6 +1242,9 @@ var BillingApiClient = class {
1230
1242
  async makeAuthenticatedRequest(url, method, productId, body) {
1231
1243
  if (this.options.verbose) {
1232
1244
  console.debug(`[BillingAPI] ${method} ${url}`);
1245
+ if (body) {
1246
+ console.debug(`[BillingAPI] Payload:`, JSON.stringify(body, null, 2));
1247
+ }
1233
1248
  }
1234
1249
  const resp = this.useSession ? await this.makeSessionAuthenticatedRequest(url, method, body) : await this.makeSignatureAuthenticatedRequest(url, method, productId, body);
1235
1250
  if (this.options.verbose) {