@layr-labs/ecloud-sdk 0.2.0-dev → 0.2.0-dev.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
@@ -1,10 +1,10 @@
1
- import { C as ComputeModule } from './compute-B_ibIORD.cjs';
2
- export { e as ComputeModuleConfig, a as CreateAppOpts, L as LogsOptions, P as PRIMARY_LANGUAGES, S as SDKCreateAppOpts, b as SDKLogsOptions, c as createApp, d as createComputeModule, f as encodeStartAppData, h as encodeStopAppData, i as encodeTerminateAppData, g as getAvailableTemplates, l as logs } from './compute-B_ibIORD.cjs';
1
+ import { G as GasEstimate, C as ComputeModule } from './compute-CbmjA8kJ.cjs';
2
+ export { e as ComputeModuleConfig, a as CreateAppOpts, E as EstimateGasOptions, L as LogsOptions, P as PRIMARY_LANGUAGES, S as SDKCreateAppOpts, b as SDKLogsOptions, c as createApp, d as createComputeModule, f as encodeStartAppData, h as encodeStopAppData, i as encodeTerminateAppData, n as estimateTransactionGas, o as formatETH, j as getAllAppsByDeveloper, k as getAppLatestReleaseBlockNumbers, g as getAvailableTemplates, m as getBlockTimestamps, l as logs } from './compute-CbmjA8kJ.cjs';
3
3
  import { BillingModule } from './billing.cjs';
4
4
  export { BillingModuleConfig, createBillingModule } from './billing.cjs';
5
- import { E as EnvironmentConfig, S as SubscriptionStatus, L as Logger, D as DeployResult } from './index-D-SUX3IG.cjs';
6
- export { m as AlreadyActiveResponse, A as AppId, f as AppProfile, g as AppProfileResponse, c as AppRecord, B as BillingEnvironmentConfig, q as CancelResponse, p as CancelSuccessResponse, C as ChainID, k as CheckoutCreatedResponse, j as CreateSubscriptionResponse, a as DeployAppOpts, d as DeployOptions, e as DockerImageConfig, I as ImageDigestResult, b as LifecycleOpts, N as NoActiveSubscriptionResponse, P as ParsedEnvironment, n as PaymentIssueResponse, h as ProductID, r as ProductSubscriptionResponse, R as Release, o as SubscribeResponse, i as SubscriptionLineItem, s as SubscriptionOpts, U as UpgradeAppOpts, l as logVisibility } from './index-D-SUX3IG.cjs';
7
5
  import { Address, Hex, WalletClient, PublicClient, PrivateKeyAccount } from 'viem';
6
+ import { E as EnvironmentConfig, S as SubscriptionStatus, L as Logger, P as PreparedDeploy, D as DeployResult, a as PreparedUpgrade, A as AppId } from './index-D2QufVB9.cjs';
7
+ export { w as AlreadyActiveResponse, q as AppProfile, r as AppProfileResponse, m as AppRecord, B as BillingEnvironmentConfig, F as CancelResponse, z as CancelSuccessResponse, C as ChainID, v as CheckoutCreatedResponse, u as CreateSubscriptionResponse, b as DeployAppOpts, n as DeployOptions, p as DockerImageConfig, g as ExecuteDeployResult, h as ExecuteUpgradeResult, G as GasOpts, I as ImageDigestResult, k as LifecycleOpts, N as NoActiveSubscriptionResponse, o as ParsedEnvironment, x as PaymentIssueResponse, e as PrepareDeployFromVerifiableBuildOpts, c as PrepareDeployOpts, f as PrepareUpgradeFromVerifiableBuildOpts, d as PrepareUpgradeOpts, i as PreparedDeployData, j as PreparedUpgradeData, s as ProductID, H as ProductSubscriptionResponse, R as Release, y as SubscribeResponse, t as SubscriptionLineItem, J as SubscriptionOpts, U as UpgradeAppOpts, l as logVisibility } from './index-D2QufVB9.cjs';
8
8
 
9
9
  interface SubmitBuildRequest {
10
10
  repoUrl: string;
@@ -435,117 +435,12 @@ declare function isSubscriptionActive(status: SubscriptionStatus): boolean;
435
435
  /**
436
436
  * Ensure hex string has 0x prefix
437
437
  */
438
- declare function addHexPrefix(value: string): `0x${string}`;
438
+ declare function addHexPrefix(value: string): Hex;
439
439
  /**
440
440
  * Remove 0x prefix from hex string if present
441
441
  */
442
442
  declare function stripHexPrefix(value: string): string;
443
443
 
444
- /**
445
- * Contract interactions
446
- *
447
- * This module handles on-chain contract interactions using viem
448
- */
449
-
450
- /**
451
- * Gas estimation result
452
- */
453
- interface GasEstimate {
454
- /** Estimated gas limit for the transaction */
455
- gasLimit: bigint;
456
- /** Max fee per gas (EIP-1559) */
457
- maxFeePerGas: bigint;
458
- /** Max priority fee per gas (EIP-1559) */
459
- maxPriorityFeePerGas: bigint;
460
- /** Maximum cost in wei (gasLimit * maxFeePerGas) */
461
- maxCostWei: bigint;
462
- /** Maximum cost formatted as ETH string */
463
- maxCostEth: string;
464
- }
465
- /**
466
- * Options for estimating transaction gas
467
- */
468
- interface EstimateGasOptions {
469
- privateKey: string;
470
- rpcUrl: string;
471
- environmentConfig: EnvironmentConfig;
472
- to: Address;
473
- data: Hex;
474
- value?: bigint;
475
- }
476
- /**
477
- * Format Wei to ETH string
478
- */
479
- declare function formatETH(wei: bigint): string;
480
- /**
481
- * Estimate gas cost for a transaction
482
- *
483
- * Use this to get cost estimate before prompting user for confirmation.
484
- */
485
- declare function estimateTransactionGas(options: EstimateGasOptions): Promise<GasEstimate>;
486
- /**
487
- * Prepared deploy batch ready for gas estimation and execution
488
- */
489
- interface PreparedDeployBatch {
490
- /** The app ID that will be deployed */
491
- appId: Address;
492
- /** The salt used for deployment */
493
- salt: Uint8Array;
494
- /** Batch executions to be sent */
495
- executions: Array<{
496
- target: Address;
497
- value: bigint;
498
- callData: Hex;
499
- }>;
500
- /** Wallet client for sending transaction */
501
- walletClient: WalletClient;
502
- /** Public client for reading chain state */
503
- publicClient: PublicClient;
504
- /** Environment configuration */
505
- environmentConfig: EnvironmentConfig;
506
- }
507
- /**
508
- * Prepared upgrade batch ready for gas estimation and execution
509
- */
510
- interface PreparedUpgradeBatch {
511
- /** The app ID being upgraded */
512
- appId: Address;
513
- /** Batch executions to be sent */
514
- executions: Array<{
515
- target: Address;
516
- value: bigint;
517
- callData: Hex;
518
- }>;
519
- /** Wallet client for sending transaction */
520
- walletClient: WalletClient;
521
- /** Public client for reading chain state */
522
- publicClient: PublicClient;
523
- /** Environment configuration */
524
- environmentConfig: EnvironmentConfig;
525
- }
526
- /**
527
- * Get apps by creator (paginated)
528
- */
529
- interface AppConfig {
530
- release: any;
531
- status: number;
532
- }
533
- /**
534
- * Fetch all apps by a developer by auto-pagination
535
- */
536
- declare function getAllAppsByDeveloper(rpcUrl: string, env: EnvironmentConfig, developer: Address, pageSize?: bigint): Promise<{
537
- apps: Address[];
538
- appConfigs: AppConfig[];
539
- }>;
540
- /**
541
- * Get latest release block numbers for multiple apps
542
- */
543
- declare function getAppLatestReleaseBlockNumbers(rpcUrl: string, environmentConfig: EnvironmentConfig, appIDs: Address[]): Promise<Map<Address, number>>;
544
- /**
545
- * Get block timestamps for multiple block numbers
546
- */
547
- declare function getBlockTimestamps(rpcUrl: string, environmentConfig: EnvironmentConfig, blockNumbers: number[]): Promise<Map<number, number>>;
548
-
549
444
  /**
550
445
  * Main deploy function
551
446
  *
@@ -588,23 +483,6 @@ interface SDKDeployOptions {
588
483
  /** Skip telemetry (used when called from CLI) - optional */
589
484
  skipTelemetry?: boolean;
590
485
  }
591
- /**
592
- * Prepared deployment ready for gas estimation and execution
593
- */
594
- interface PreparedDeploy {
595
- /** The prepared batch (executions, clients, etc.) */
596
- batch: PreparedDeployBatch;
597
- /** App name */
598
- appName: string;
599
- /** Final image reference */
600
- imageRef: string;
601
- /** Preflight context for post-deploy operations */
602
- preflightCtx: {
603
- privateKey: string;
604
- rpcUrl: string;
605
- environmentConfig: EnvironmentConfig;
606
- };
607
- }
608
486
  /**
609
487
  * Result from prepareDeploy - includes prepared batch and gas estimate
610
488
  */
@@ -614,6 +492,21 @@ interface PrepareDeployResult {
614
492
  /** Gas estimate for the batch transaction */
615
493
  gasEstimate: GasEstimate;
616
494
  }
495
+ /** Options for executing a prepared deployment */
496
+ interface ExecuteDeployOptions {
497
+ prepared: PreparedDeploy;
498
+ context: {
499
+ walletClient: WalletClient;
500
+ publicClient: PublicClient;
501
+ environmentConfig: EnvironmentConfig;
502
+ };
503
+ gas?: {
504
+ maxFeePerGas?: bigint;
505
+ maxPriorityFeePerGas?: bigint;
506
+ };
507
+ logger?: Logger;
508
+ skipTelemetry?: boolean;
509
+ }
617
510
  /**
618
511
  * Prepare a deployment from a pre-built image (already layered) without using Docker locally.
619
512
  *
@@ -649,10 +542,7 @@ declare function prepareDeploy(options: Omit<SDKDeployOptions, "gas"> & {
649
542
  * Note: This only submits the on-chain transaction. Call watchDeployment separately
650
543
  * to wait for the app to be running.
651
544
  */
652
- declare function executeDeploy(prepared: PreparedDeploy, gas: {
653
- maxFeePerGas?: bigint;
654
- maxPriorityFeePerGas?: bigint;
655
- } | undefined, logger?: Logger, skipTelemetry?: boolean): Promise<DeployResult>;
545
+ declare function executeDeploy(options: ExecuteDeployOptions): Promise<DeployResult>;
656
546
  /**
657
547
  * Watch a deployment until the app is running
658
548
  *
@@ -705,28 +595,11 @@ interface SDKUpgradeOptions {
705
595
  }
706
596
  interface UpgradeResult {
707
597
  /** App ID (contract address) */
708
- appId: string;
598
+ appId: AppId;
709
599
  /** Final image reference */
710
600
  imageRef: string;
711
601
  /** Transaction hash */
712
- txHash: `0x${string}`;
713
- }
714
- /**
715
- * Prepared upgrade ready for gas estimation and execution
716
- */
717
- interface PreparedUpgrade {
718
- /** The prepared batch (executions, clients, etc.) */
719
- batch: PreparedUpgradeBatch;
720
- /** App ID being upgraded */
721
- appId: string;
722
- /** Final image reference */
723
- imageRef: string;
724
- /** Preflight context for post-upgrade operations */
725
- preflightCtx: {
726
- privateKey: string;
727
- rpcUrl: string;
728
- environmentConfig: EnvironmentConfig;
729
- };
602
+ txHash: Hex;
730
603
  }
731
604
  /**
732
605
  * Result from prepareUpgrade - includes prepared batch and gas estimate
@@ -737,6 +610,21 @@ interface PrepareUpgradeResult {
737
610
  /** Gas estimate for the batch transaction */
738
611
  gasEstimate: GasEstimate;
739
612
  }
613
+ /** Options for executing a prepared upgrade */
614
+ interface ExecuteUpgradeOptions {
615
+ prepared: PreparedUpgrade;
616
+ context: {
617
+ walletClient: WalletClient;
618
+ publicClient: PublicClient;
619
+ environmentConfig: EnvironmentConfig;
620
+ };
621
+ gas?: {
622
+ maxFeePerGas?: bigint;
623
+ maxPriorityFeePerGas?: bigint;
624
+ };
625
+ logger?: Logger;
626
+ skipTelemetry?: boolean;
627
+ }
740
628
  /**
741
629
  * Prepare an upgrade from a pre-built image (already layered) without using Docker locally.
742
630
  *
@@ -768,10 +656,7 @@ declare function prepareUpgrade(options: Omit<SDKUpgradeOptions, "gas"> & {
768
656
  * Note: This only submits the on-chain transaction. Call watchUpgrade separately
769
657
  * to wait for the upgrade to complete.
770
658
  */
771
- declare function executeUpgrade(prepared: PreparedUpgrade, gas: {
772
- maxFeePerGas?: bigint;
773
- maxPriorityFeePerGas?: bigint;
774
- } | undefined, logger?: Logger, skipTelemetry?: boolean): Promise<UpgradeResult>;
659
+ declare function executeUpgrade(options: ExecuteUpgradeOptions): Promise<UpgradeResult>;
775
660
  /**
776
661
  * Watch an upgrade until it completes
777
662
  *
@@ -814,6 +699,7 @@ declare function isMainnet(environmentConfig: EnvironmentConfig): boolean;
814
699
  *
815
700
  * Uses a single key for all environments.
816
701
  */
702
+
817
703
  interface StoredKey {
818
704
  address: string;
819
705
  }
@@ -835,7 +721,7 @@ declare function storePrivateKey(privateKey: string): Promise<void>;
835
721
  * Note: Returns the single stored key for all environments.
836
722
  * The environment parameter is kept for API compatibility but is ignored.
837
723
  */
838
- declare function getPrivateKey(): Promise<`0x${string}` | null>;
724
+ declare function getPrivateKey(): Promise<Hex | null>;
839
725
  /**
840
726
  * Delete a private key from OS keyring
841
727
  * Returns true if deletion was successful, false otherwise
@@ -887,8 +773,9 @@ declare function getAddressFromPrivateKey(privateKey: string): string;
887
773
  * 2. Environment variable (ECLOUD_PRIVATE_KEY)
888
774
  * 3. OS keyring (stored via `ecloud auth login`)
889
775
  */
776
+
890
777
  interface PrivateKeySource {
891
- key: `0x${string}`;
778
+ key: Hex;
892
779
  source: string;
893
780
  }
894
781
  /**
@@ -1180,24 +1067,23 @@ declare function getCategoryDescriptions(catalog: TemplateCatalog, language: str
1180
1067
  * This module handles EIP-7702 delegation and batch execution
1181
1068
  */
1182
1069
 
1070
+ type Execution = {
1071
+ target: Address;
1072
+ value: bigint;
1073
+ callData: Hex;
1074
+ };
1183
1075
  /**
1184
1076
  * Options for estimating batch gas
1185
1077
  */
1186
1078
  interface EstimateBatchGasOptions {
1187
1079
  publicClient: PublicClient;
1188
- environmentConfig: EnvironmentConfig;
1189
- executions: Array<{
1190
- target: Address;
1191
- value: bigint;
1192
- callData: Hex;
1193
- }>;
1080
+ account: Address;
1081
+ executions: Execution[];
1194
1082
  }
1195
1083
  /**
1196
1084
  * Estimate gas cost for a batch transaction
1197
1085
  *
1198
1086
  * Use this to get cost estimate before prompting user for confirmation.
1199
- * Note: This provides a conservative estimate since batch transactions
1200
- * through EIP-7702 can have variable costs.
1201
1087
  */
1202
1088
  declare function estimateBatchGas(options: EstimateBatchGasOptions): Promise<GasEstimate>;
1203
1089
  /**
@@ -1235,7 +1121,7 @@ declare function getCurrentInstanceType(preflightCtx: PreflightContext, appID: A
1235
1121
  type Environment = "sepolia" | "sepolia-dev" | "mainnet-alpha";
1236
1122
  interface ClientConfig {
1237
1123
  verbose: boolean;
1238
- privateKey: `0x${string}`;
1124
+ privateKey: Hex;
1239
1125
  environment: Environment | string;
1240
1126
  rpcUrl?: string;
1241
1127
  }
@@ -1245,4 +1131,4 @@ interface ECloudClient {
1245
1131
  }
1246
1132
  declare function createECloudClient(cfg: ClientConfig): ECloudClient;
1247
1133
 
1248
- export { type AppEnvironment, type AppInfo, type AppMetrics, type AppProfileInfo, type AppRelease, type AppReleaseBuild, type AppResponse, AuthRequiredError, BUILD_STATUS, BadRequestError, BillingModule, type Build, BuildError, BuildFailedError, type BuildModule, type BuildModuleConfig, type BuildProgress, type BuildStatus, type ClientConfig, ComputeModule, ConflictError, type CreateAppParams, type DeployParams, DeployResult, type ECloudClient, type Environment, EnvironmentConfig, type EstimateBatchGasOptions, type EstimateGasOptions, ForbiddenError, type GasEstimate, type GeneratedKey, type LegacyKey, type LogChunk, type LogVisibility, Logger, type LogsParams, type Metric, type MetricsContext, NoopClient, NotFoundError, PostHogClient, type PrepareDeployResult, type PrepareUpgradeResult, type PreparedDeploy, type PreparedUpgrade, type PrivateKeySource, type ResourceUsageMonitoring, type SDKDeployOptions, type SDKUpgradeOptions, type StoredKey, type SubmitBuildRequest, type SubmitBuildResponse, SubscriptionStatus, type TelemetryClient, type TelemetryClientOptions, type TelemetryWrapperOptions, TimeoutError, type UpgradeParams, UserApiClient, type VerifyProvenanceFailure, type VerifyProvenanceResult, type VerifyProvenanceSuccess, addHexPrefix, addMetric, addMetricWithDimensions, assertValidFilePath, assertValidImageReference, assertValidPrivateKey, checkERC7702Delegation, createAppEnvironment, createBuildModule, createECloudClient, createMetricsContext, createTelemetryClient, deleteLegacyPrivateKey, deletePrivateKey, emitMetrics, estimateBatchGas, estimateTransactionGas, executeDeploy, executeUpgrade, extractAppNameFromImage, fetchTemplateCatalog, formatETH, generateNewPrivateKey, getAddressFromPrivateKey, getAllAppsByDeveloper, getAppLatestReleaseBlockNumbers, getAvailableEnvironments, getBlockTimestamps, getBuildType, getCategoryDescriptions, getCurrentInstanceType, getEnvironmentConfig, getLegacyKeys, getLegacyPrivateKey, getPostHogAPIKey, getPostHogEndpoint, getPrivateKey, getPrivateKeyWithSource, getTemplate, isEnvironmentAvailable, isMainnet, isNoopClient, isSubscriptionActive, keyExists, listStoredKeys, prepareDeploy, prepareDeployFromVerifiableBuild, prepareUpgrade, prepareUpgradeFromVerifiableBuild, requirePrivateKey, sanitizeString, sanitizeURL, sanitizeXURL, storePrivateKey, stripHexPrefix, validateAppID, validateAppName, validateCreateAppParams, validateDeployParams, validateDescription, validateFilePath, validateImagePath, validateImageReference, validateInstanceTypeSKU, validateLogVisibility, validateLogsParams, validatePrivateKey, validatePrivateKeyFormat, validateResourceUsageMonitoring, validateURL, validateUpgradeParams, validateXURL, watchDeployment, watchUpgrade, withSDKTelemetry };
1134
+ export { type AppEnvironment, AppId, type AppInfo, type AppMetrics, type AppProfileInfo, type AppRelease, type AppReleaseBuild, type AppResponse, AuthRequiredError, BUILD_STATUS, BadRequestError, BillingModule, type Build, BuildError, BuildFailedError, type BuildModule, type BuildModuleConfig, type BuildProgress, type BuildStatus, type ClientConfig, ComputeModule, ConflictError, type CreateAppParams, type DeployParams, DeployResult, type ECloudClient, type Environment, EnvironmentConfig, type EstimateBatchGasOptions, ForbiddenError, GasEstimate, type GeneratedKey, type LegacyKey, type LogChunk, type LogVisibility, Logger, type LogsParams, type Metric, type MetricsContext, NoopClient, NotFoundError, PostHogClient, type PrepareDeployResult, type PrepareUpgradeResult, PreparedDeploy, PreparedUpgrade, type PrivateKeySource, type ResourceUsageMonitoring, type SDKDeployOptions, type SDKUpgradeOptions, type StoredKey, type SubmitBuildRequest, type SubmitBuildResponse, SubscriptionStatus, type TelemetryClient, type TelemetryClientOptions, type TelemetryWrapperOptions, TimeoutError, type UpgradeParams, UserApiClient, type VerifyProvenanceFailure, type VerifyProvenanceResult, type VerifyProvenanceSuccess, addHexPrefix, addMetric, addMetricWithDimensions, assertValidFilePath, assertValidImageReference, assertValidPrivateKey, checkERC7702Delegation, createAppEnvironment, createBuildModule, createECloudClient, createMetricsContext, createTelemetryClient, deleteLegacyPrivateKey, deletePrivateKey, emitMetrics, estimateBatchGas, executeDeploy, executeUpgrade, extractAppNameFromImage, fetchTemplateCatalog, generateNewPrivateKey, getAddressFromPrivateKey, getAvailableEnvironments, getBuildType, getCategoryDescriptions, getCurrentInstanceType, getEnvironmentConfig, getLegacyKeys, getLegacyPrivateKey, getPostHogAPIKey, getPostHogEndpoint, getPrivateKey, getPrivateKeyWithSource, getTemplate, isEnvironmentAvailable, isMainnet, isNoopClient, isSubscriptionActive, keyExists, listStoredKeys, prepareDeploy, prepareDeployFromVerifiableBuild, prepareUpgrade, prepareUpgradeFromVerifiableBuild, requirePrivateKey, sanitizeString, sanitizeURL, sanitizeXURL, storePrivateKey, stripHexPrefix, validateAppID, validateAppName, validateCreateAppParams, validateDeployParams, validateDescription, validateFilePath, validateImagePath, validateImageReference, validateInstanceTypeSKU, validateLogVisibility, validateLogsParams, validatePrivateKey, validatePrivateKeyFormat, validateResourceUsageMonitoring, validateURL, validateUpgradeParams, validateXURL, watchDeployment, watchUpgrade, withSDKTelemetry };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { C as ComputeModule } from './compute-gpepEsn3.js';
2
- export { e as ComputeModuleConfig, a as CreateAppOpts, L as LogsOptions, P as PRIMARY_LANGUAGES, S as SDKCreateAppOpts, b as SDKLogsOptions, c as createApp, d as createComputeModule, f as encodeStartAppData, h as encodeStopAppData, i as encodeTerminateAppData, g as getAvailableTemplates, l as logs } from './compute-gpepEsn3.js';
1
+ import { G as GasEstimate, C as ComputeModule } from './compute-CF2HOXed.js';
2
+ export { e as ComputeModuleConfig, a as CreateAppOpts, E as EstimateGasOptions, L as LogsOptions, P as PRIMARY_LANGUAGES, S as SDKCreateAppOpts, b as SDKLogsOptions, c as createApp, d as createComputeModule, f as encodeStartAppData, h as encodeStopAppData, i as encodeTerminateAppData, n as estimateTransactionGas, o as formatETH, j as getAllAppsByDeveloper, k as getAppLatestReleaseBlockNumbers, g as getAvailableTemplates, m as getBlockTimestamps, l as logs } from './compute-CF2HOXed.js';
3
3
  import { BillingModule } from './billing.js';
4
4
  export { BillingModuleConfig, createBillingModule } from './billing.js';
5
- import { E as EnvironmentConfig, S as SubscriptionStatus, L as Logger, D as DeployResult } from './index-D-SUX3IG.js';
6
- export { m as AlreadyActiveResponse, A as AppId, f as AppProfile, g as AppProfileResponse, c as AppRecord, B as BillingEnvironmentConfig, q as CancelResponse, p as CancelSuccessResponse, C as ChainID, k as CheckoutCreatedResponse, j as CreateSubscriptionResponse, a as DeployAppOpts, d as DeployOptions, e as DockerImageConfig, I as ImageDigestResult, b as LifecycleOpts, N as NoActiveSubscriptionResponse, P as ParsedEnvironment, n as PaymentIssueResponse, h as ProductID, r as ProductSubscriptionResponse, R as Release, o as SubscribeResponse, i as SubscriptionLineItem, s as SubscriptionOpts, U as UpgradeAppOpts, l as logVisibility } from './index-D-SUX3IG.js';
7
5
  import { Address, Hex, WalletClient, PublicClient, PrivateKeyAccount } from 'viem';
6
+ import { E as EnvironmentConfig, S as SubscriptionStatus, L as Logger, P as PreparedDeploy, D as DeployResult, a as PreparedUpgrade, A as AppId } from './index-D2QufVB9.js';
7
+ export { w as AlreadyActiveResponse, q as AppProfile, r as AppProfileResponse, m as AppRecord, B as BillingEnvironmentConfig, F as CancelResponse, z as CancelSuccessResponse, C as ChainID, v as CheckoutCreatedResponse, u as CreateSubscriptionResponse, b as DeployAppOpts, n as DeployOptions, p as DockerImageConfig, g as ExecuteDeployResult, h as ExecuteUpgradeResult, G as GasOpts, I as ImageDigestResult, k as LifecycleOpts, N as NoActiveSubscriptionResponse, o as ParsedEnvironment, x as PaymentIssueResponse, e as PrepareDeployFromVerifiableBuildOpts, c as PrepareDeployOpts, f as PrepareUpgradeFromVerifiableBuildOpts, d as PrepareUpgradeOpts, i as PreparedDeployData, j as PreparedUpgradeData, s as ProductID, H as ProductSubscriptionResponse, R as Release, y as SubscribeResponse, t as SubscriptionLineItem, J as SubscriptionOpts, U as UpgradeAppOpts, l as logVisibility } from './index-D2QufVB9.js';
8
8
 
9
9
  interface SubmitBuildRequest {
10
10
  repoUrl: string;
@@ -435,117 +435,12 @@ declare function isSubscriptionActive(status: SubscriptionStatus): boolean;
435
435
  /**
436
436
  * Ensure hex string has 0x prefix
437
437
  */
438
- declare function addHexPrefix(value: string): `0x${string}`;
438
+ declare function addHexPrefix(value: string): Hex;
439
439
  /**
440
440
  * Remove 0x prefix from hex string if present
441
441
  */
442
442
  declare function stripHexPrefix(value: string): string;
443
443
 
444
- /**
445
- * Contract interactions
446
- *
447
- * This module handles on-chain contract interactions using viem
448
- */
449
-
450
- /**
451
- * Gas estimation result
452
- */
453
- interface GasEstimate {
454
- /** Estimated gas limit for the transaction */
455
- gasLimit: bigint;
456
- /** Max fee per gas (EIP-1559) */
457
- maxFeePerGas: bigint;
458
- /** Max priority fee per gas (EIP-1559) */
459
- maxPriorityFeePerGas: bigint;
460
- /** Maximum cost in wei (gasLimit * maxFeePerGas) */
461
- maxCostWei: bigint;
462
- /** Maximum cost formatted as ETH string */
463
- maxCostEth: string;
464
- }
465
- /**
466
- * Options for estimating transaction gas
467
- */
468
- interface EstimateGasOptions {
469
- privateKey: string;
470
- rpcUrl: string;
471
- environmentConfig: EnvironmentConfig;
472
- to: Address;
473
- data: Hex;
474
- value?: bigint;
475
- }
476
- /**
477
- * Format Wei to ETH string
478
- */
479
- declare function formatETH(wei: bigint): string;
480
- /**
481
- * Estimate gas cost for a transaction
482
- *
483
- * Use this to get cost estimate before prompting user for confirmation.
484
- */
485
- declare function estimateTransactionGas(options: EstimateGasOptions): Promise<GasEstimate>;
486
- /**
487
- * Prepared deploy batch ready for gas estimation and execution
488
- */
489
- interface PreparedDeployBatch {
490
- /** The app ID that will be deployed */
491
- appId: Address;
492
- /** The salt used for deployment */
493
- salt: Uint8Array;
494
- /** Batch executions to be sent */
495
- executions: Array<{
496
- target: Address;
497
- value: bigint;
498
- callData: Hex;
499
- }>;
500
- /** Wallet client for sending transaction */
501
- walletClient: WalletClient;
502
- /** Public client for reading chain state */
503
- publicClient: PublicClient;
504
- /** Environment configuration */
505
- environmentConfig: EnvironmentConfig;
506
- }
507
- /**
508
- * Prepared upgrade batch ready for gas estimation and execution
509
- */
510
- interface PreparedUpgradeBatch {
511
- /** The app ID being upgraded */
512
- appId: Address;
513
- /** Batch executions to be sent */
514
- executions: Array<{
515
- target: Address;
516
- value: bigint;
517
- callData: Hex;
518
- }>;
519
- /** Wallet client for sending transaction */
520
- walletClient: WalletClient;
521
- /** Public client for reading chain state */
522
- publicClient: PublicClient;
523
- /** Environment configuration */
524
- environmentConfig: EnvironmentConfig;
525
- }
526
- /**
527
- * Get apps by creator (paginated)
528
- */
529
- interface AppConfig {
530
- release: any;
531
- status: number;
532
- }
533
- /**
534
- * Fetch all apps by a developer by auto-pagination
535
- */
536
- declare function getAllAppsByDeveloper(rpcUrl: string, env: EnvironmentConfig, developer: Address, pageSize?: bigint): Promise<{
537
- apps: Address[];
538
- appConfigs: AppConfig[];
539
- }>;
540
- /**
541
- * Get latest release block numbers for multiple apps
542
- */
543
- declare function getAppLatestReleaseBlockNumbers(rpcUrl: string, environmentConfig: EnvironmentConfig, appIDs: Address[]): Promise<Map<Address, number>>;
544
- /**
545
- * Get block timestamps for multiple block numbers
546
- */
547
- declare function getBlockTimestamps(rpcUrl: string, environmentConfig: EnvironmentConfig, blockNumbers: number[]): Promise<Map<number, number>>;
548
-
549
444
  /**
550
445
  * Main deploy function
551
446
  *
@@ -588,23 +483,6 @@ interface SDKDeployOptions {
588
483
  /** Skip telemetry (used when called from CLI) - optional */
589
484
  skipTelemetry?: boolean;
590
485
  }
591
- /**
592
- * Prepared deployment ready for gas estimation and execution
593
- */
594
- interface PreparedDeploy {
595
- /** The prepared batch (executions, clients, etc.) */
596
- batch: PreparedDeployBatch;
597
- /** App name */
598
- appName: string;
599
- /** Final image reference */
600
- imageRef: string;
601
- /** Preflight context for post-deploy operations */
602
- preflightCtx: {
603
- privateKey: string;
604
- rpcUrl: string;
605
- environmentConfig: EnvironmentConfig;
606
- };
607
- }
608
486
  /**
609
487
  * Result from prepareDeploy - includes prepared batch and gas estimate
610
488
  */
@@ -614,6 +492,21 @@ interface PrepareDeployResult {
614
492
  /** Gas estimate for the batch transaction */
615
493
  gasEstimate: GasEstimate;
616
494
  }
495
+ /** Options for executing a prepared deployment */
496
+ interface ExecuteDeployOptions {
497
+ prepared: PreparedDeploy;
498
+ context: {
499
+ walletClient: WalletClient;
500
+ publicClient: PublicClient;
501
+ environmentConfig: EnvironmentConfig;
502
+ };
503
+ gas?: {
504
+ maxFeePerGas?: bigint;
505
+ maxPriorityFeePerGas?: bigint;
506
+ };
507
+ logger?: Logger;
508
+ skipTelemetry?: boolean;
509
+ }
617
510
  /**
618
511
  * Prepare a deployment from a pre-built image (already layered) without using Docker locally.
619
512
  *
@@ -649,10 +542,7 @@ declare function prepareDeploy(options: Omit<SDKDeployOptions, "gas"> & {
649
542
  * Note: This only submits the on-chain transaction. Call watchDeployment separately
650
543
  * to wait for the app to be running.
651
544
  */
652
- declare function executeDeploy(prepared: PreparedDeploy, gas: {
653
- maxFeePerGas?: bigint;
654
- maxPriorityFeePerGas?: bigint;
655
- } | undefined, logger?: Logger, skipTelemetry?: boolean): Promise<DeployResult>;
545
+ declare function executeDeploy(options: ExecuteDeployOptions): Promise<DeployResult>;
656
546
  /**
657
547
  * Watch a deployment until the app is running
658
548
  *
@@ -705,28 +595,11 @@ interface SDKUpgradeOptions {
705
595
  }
706
596
  interface UpgradeResult {
707
597
  /** App ID (contract address) */
708
- appId: string;
598
+ appId: AppId;
709
599
  /** Final image reference */
710
600
  imageRef: string;
711
601
  /** Transaction hash */
712
- txHash: `0x${string}`;
713
- }
714
- /**
715
- * Prepared upgrade ready for gas estimation and execution
716
- */
717
- interface PreparedUpgrade {
718
- /** The prepared batch (executions, clients, etc.) */
719
- batch: PreparedUpgradeBatch;
720
- /** App ID being upgraded */
721
- appId: string;
722
- /** Final image reference */
723
- imageRef: string;
724
- /** Preflight context for post-upgrade operations */
725
- preflightCtx: {
726
- privateKey: string;
727
- rpcUrl: string;
728
- environmentConfig: EnvironmentConfig;
729
- };
602
+ txHash: Hex;
730
603
  }
731
604
  /**
732
605
  * Result from prepareUpgrade - includes prepared batch and gas estimate
@@ -737,6 +610,21 @@ interface PrepareUpgradeResult {
737
610
  /** Gas estimate for the batch transaction */
738
611
  gasEstimate: GasEstimate;
739
612
  }
613
+ /** Options for executing a prepared upgrade */
614
+ interface ExecuteUpgradeOptions {
615
+ prepared: PreparedUpgrade;
616
+ context: {
617
+ walletClient: WalletClient;
618
+ publicClient: PublicClient;
619
+ environmentConfig: EnvironmentConfig;
620
+ };
621
+ gas?: {
622
+ maxFeePerGas?: bigint;
623
+ maxPriorityFeePerGas?: bigint;
624
+ };
625
+ logger?: Logger;
626
+ skipTelemetry?: boolean;
627
+ }
740
628
  /**
741
629
  * Prepare an upgrade from a pre-built image (already layered) without using Docker locally.
742
630
  *
@@ -768,10 +656,7 @@ declare function prepareUpgrade(options: Omit<SDKUpgradeOptions, "gas"> & {
768
656
  * Note: This only submits the on-chain transaction. Call watchUpgrade separately
769
657
  * to wait for the upgrade to complete.
770
658
  */
771
- declare function executeUpgrade(prepared: PreparedUpgrade, gas: {
772
- maxFeePerGas?: bigint;
773
- maxPriorityFeePerGas?: bigint;
774
- } | undefined, logger?: Logger, skipTelemetry?: boolean): Promise<UpgradeResult>;
659
+ declare function executeUpgrade(options: ExecuteUpgradeOptions): Promise<UpgradeResult>;
775
660
  /**
776
661
  * Watch an upgrade until it completes
777
662
  *
@@ -814,6 +699,7 @@ declare function isMainnet(environmentConfig: EnvironmentConfig): boolean;
814
699
  *
815
700
  * Uses a single key for all environments.
816
701
  */
702
+
817
703
  interface StoredKey {
818
704
  address: string;
819
705
  }
@@ -835,7 +721,7 @@ declare function storePrivateKey(privateKey: string): Promise<void>;
835
721
  * Note: Returns the single stored key for all environments.
836
722
  * The environment parameter is kept for API compatibility but is ignored.
837
723
  */
838
- declare function getPrivateKey(): Promise<`0x${string}` | null>;
724
+ declare function getPrivateKey(): Promise<Hex | null>;
839
725
  /**
840
726
  * Delete a private key from OS keyring
841
727
  * Returns true if deletion was successful, false otherwise
@@ -887,8 +773,9 @@ declare function getAddressFromPrivateKey(privateKey: string): string;
887
773
  * 2. Environment variable (ECLOUD_PRIVATE_KEY)
888
774
  * 3. OS keyring (stored via `ecloud auth login`)
889
775
  */
776
+
890
777
  interface PrivateKeySource {
891
- key: `0x${string}`;
778
+ key: Hex;
892
779
  source: string;
893
780
  }
894
781
  /**
@@ -1180,24 +1067,23 @@ declare function getCategoryDescriptions(catalog: TemplateCatalog, language: str
1180
1067
  * This module handles EIP-7702 delegation and batch execution
1181
1068
  */
1182
1069
 
1070
+ type Execution = {
1071
+ target: Address;
1072
+ value: bigint;
1073
+ callData: Hex;
1074
+ };
1183
1075
  /**
1184
1076
  * Options for estimating batch gas
1185
1077
  */
1186
1078
  interface EstimateBatchGasOptions {
1187
1079
  publicClient: PublicClient;
1188
- environmentConfig: EnvironmentConfig;
1189
- executions: Array<{
1190
- target: Address;
1191
- value: bigint;
1192
- callData: Hex;
1193
- }>;
1080
+ account: Address;
1081
+ executions: Execution[];
1194
1082
  }
1195
1083
  /**
1196
1084
  * Estimate gas cost for a batch transaction
1197
1085
  *
1198
1086
  * Use this to get cost estimate before prompting user for confirmation.
1199
- * Note: This provides a conservative estimate since batch transactions
1200
- * through EIP-7702 can have variable costs.
1201
1087
  */
1202
1088
  declare function estimateBatchGas(options: EstimateBatchGasOptions): Promise<GasEstimate>;
1203
1089
  /**
@@ -1235,7 +1121,7 @@ declare function getCurrentInstanceType(preflightCtx: PreflightContext, appID: A
1235
1121
  type Environment = "sepolia" | "sepolia-dev" | "mainnet-alpha";
1236
1122
  interface ClientConfig {
1237
1123
  verbose: boolean;
1238
- privateKey: `0x${string}`;
1124
+ privateKey: Hex;
1239
1125
  environment: Environment | string;
1240
1126
  rpcUrl?: string;
1241
1127
  }
@@ -1245,4 +1131,4 @@ interface ECloudClient {
1245
1131
  }
1246
1132
  declare function createECloudClient(cfg: ClientConfig): ECloudClient;
1247
1133
 
1248
- export { type AppEnvironment, type AppInfo, type AppMetrics, type AppProfileInfo, type AppRelease, type AppReleaseBuild, type AppResponse, AuthRequiredError, BUILD_STATUS, BadRequestError, BillingModule, type Build, BuildError, BuildFailedError, type BuildModule, type BuildModuleConfig, type BuildProgress, type BuildStatus, type ClientConfig, ComputeModule, ConflictError, type CreateAppParams, type DeployParams, DeployResult, type ECloudClient, type Environment, EnvironmentConfig, type EstimateBatchGasOptions, type EstimateGasOptions, ForbiddenError, type GasEstimate, type GeneratedKey, type LegacyKey, type LogChunk, type LogVisibility, Logger, type LogsParams, type Metric, type MetricsContext, NoopClient, NotFoundError, PostHogClient, type PrepareDeployResult, type PrepareUpgradeResult, type PreparedDeploy, type PreparedUpgrade, type PrivateKeySource, type ResourceUsageMonitoring, type SDKDeployOptions, type SDKUpgradeOptions, type StoredKey, type SubmitBuildRequest, type SubmitBuildResponse, SubscriptionStatus, type TelemetryClient, type TelemetryClientOptions, type TelemetryWrapperOptions, TimeoutError, type UpgradeParams, UserApiClient, type VerifyProvenanceFailure, type VerifyProvenanceResult, type VerifyProvenanceSuccess, addHexPrefix, addMetric, addMetricWithDimensions, assertValidFilePath, assertValidImageReference, assertValidPrivateKey, checkERC7702Delegation, createAppEnvironment, createBuildModule, createECloudClient, createMetricsContext, createTelemetryClient, deleteLegacyPrivateKey, deletePrivateKey, emitMetrics, estimateBatchGas, estimateTransactionGas, executeDeploy, executeUpgrade, extractAppNameFromImage, fetchTemplateCatalog, formatETH, generateNewPrivateKey, getAddressFromPrivateKey, getAllAppsByDeveloper, getAppLatestReleaseBlockNumbers, getAvailableEnvironments, getBlockTimestamps, getBuildType, getCategoryDescriptions, getCurrentInstanceType, getEnvironmentConfig, getLegacyKeys, getLegacyPrivateKey, getPostHogAPIKey, getPostHogEndpoint, getPrivateKey, getPrivateKeyWithSource, getTemplate, isEnvironmentAvailable, isMainnet, isNoopClient, isSubscriptionActive, keyExists, listStoredKeys, prepareDeploy, prepareDeployFromVerifiableBuild, prepareUpgrade, prepareUpgradeFromVerifiableBuild, requirePrivateKey, sanitizeString, sanitizeURL, sanitizeXURL, storePrivateKey, stripHexPrefix, validateAppID, validateAppName, validateCreateAppParams, validateDeployParams, validateDescription, validateFilePath, validateImagePath, validateImageReference, validateInstanceTypeSKU, validateLogVisibility, validateLogsParams, validatePrivateKey, validatePrivateKeyFormat, validateResourceUsageMonitoring, validateURL, validateUpgradeParams, validateXURL, watchDeployment, watchUpgrade, withSDKTelemetry };
1134
+ export { type AppEnvironment, AppId, type AppInfo, type AppMetrics, type AppProfileInfo, type AppRelease, type AppReleaseBuild, type AppResponse, AuthRequiredError, BUILD_STATUS, BadRequestError, BillingModule, type Build, BuildError, BuildFailedError, type BuildModule, type BuildModuleConfig, type BuildProgress, type BuildStatus, type ClientConfig, ComputeModule, ConflictError, type CreateAppParams, type DeployParams, DeployResult, type ECloudClient, type Environment, EnvironmentConfig, type EstimateBatchGasOptions, ForbiddenError, GasEstimate, type GeneratedKey, type LegacyKey, type LogChunk, type LogVisibility, Logger, type LogsParams, type Metric, type MetricsContext, NoopClient, NotFoundError, PostHogClient, type PrepareDeployResult, type PrepareUpgradeResult, PreparedDeploy, PreparedUpgrade, type PrivateKeySource, type ResourceUsageMonitoring, type SDKDeployOptions, type SDKUpgradeOptions, type StoredKey, type SubmitBuildRequest, type SubmitBuildResponse, SubscriptionStatus, type TelemetryClient, type TelemetryClientOptions, type TelemetryWrapperOptions, TimeoutError, type UpgradeParams, UserApiClient, type VerifyProvenanceFailure, type VerifyProvenanceResult, type VerifyProvenanceSuccess, addHexPrefix, addMetric, addMetricWithDimensions, assertValidFilePath, assertValidImageReference, assertValidPrivateKey, checkERC7702Delegation, createAppEnvironment, createBuildModule, createECloudClient, createMetricsContext, createTelemetryClient, deleteLegacyPrivateKey, deletePrivateKey, emitMetrics, estimateBatchGas, executeDeploy, executeUpgrade, extractAppNameFromImage, fetchTemplateCatalog, generateNewPrivateKey, getAddressFromPrivateKey, getAvailableEnvironments, getBuildType, getCategoryDescriptions, getCurrentInstanceType, getEnvironmentConfig, getLegacyKeys, getLegacyPrivateKey, getPostHogAPIKey, getPostHogEndpoint, getPrivateKey, getPrivateKeyWithSource, getTemplate, isEnvironmentAvailable, isMainnet, isNoopClient, isSubscriptionActive, keyExists, listStoredKeys, prepareDeploy, prepareDeployFromVerifiableBuild, prepareUpgrade, prepareUpgradeFromVerifiableBuild, requirePrivateKey, sanitizeString, sanitizeURL, sanitizeXURL, storePrivateKey, stripHexPrefix, validateAppID, validateAppName, validateCreateAppParams, validateDeployParams, validateDescription, validateFilePath, validateImagePath, validateImageReference, validateInstanceTypeSKU, validateLogVisibility, validateLogsParams, validatePrivateKey, validatePrivateKeyFormat, validateResourceUsageMonitoring, validateURL, validateUpgradeParams, validateXURL, watchDeployment, watchUpgrade, withSDKTelemetry };