@layr-labs/ecloud-sdk 0.2.0-dev.2 → 0.2.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.
package/dist/index.d.cts CHANGED
@@ -1,10 +1,142 @@
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, L as Logger, D as DeployResult, S as SubscriptionStatus } 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
+
9
+ interface SubmitBuildRequest {
10
+ repoUrl: string;
11
+ gitRef: string;
12
+ dockerfilePath?: string;
13
+ /**
14
+ * Path to a Caddyfile within the repository (relative to buildContextPath).
15
+ * If omitted, the build service will not copy a Caddyfile into the image.
16
+ */
17
+ caddyfilePath?: string;
18
+ buildContextPath?: string;
19
+ dependencies?: string[];
20
+ }
21
+ interface SubmitBuildResponse {
22
+ buildId: string;
23
+ }
24
+ declare const BUILD_STATUS: {
25
+ readonly BUILDING: "building";
26
+ readonly SUCCESS: "success";
27
+ readonly FAILED: "failed";
28
+ };
29
+ type BuildStatus = (typeof BUILD_STATUS)[keyof typeof BUILD_STATUS];
30
+ interface Build {
31
+ buildId: string;
32
+ billingAddress: string;
33
+ repoUrl: string;
34
+ gitRef: string;
35
+ status: BuildStatus;
36
+ /** 'application' | 'dependency' (as returned by the API) */
37
+ buildType: string;
38
+ imageName: string;
39
+ imageUrl?: string;
40
+ imageDigest?: string;
41
+ provenanceJson?: Record<string, unknown>;
42
+ provenanceSignature?: string;
43
+ errorMessage?: string;
44
+ createdAt: string;
45
+ updatedAt: string;
46
+ dependencies?: Record<string, Build>;
47
+ }
48
+ type VerifyProvenanceResult = VerifyProvenanceSuccess | VerifyProvenanceFailure;
49
+ interface VerifyProvenanceSuccess {
50
+ status: "verified";
51
+ buildId: string;
52
+ imageUrl: string;
53
+ imageDigest: string;
54
+ repoUrl: string;
55
+ gitRef: string;
56
+ provenanceJson: Record<string, unknown>;
57
+ provenanceSignature: string;
58
+ payloadType: string;
59
+ payload: string;
60
+ }
61
+ interface VerifyProvenanceFailure {
62
+ status: "failed";
63
+ error: string;
64
+ buildId?: string;
65
+ }
66
+ interface LogChunk {
67
+ content: string;
68
+ totalLength: number;
69
+ isComplete: boolean;
70
+ finalStatus?: BuildStatus;
71
+ }
72
+ interface BuildProgress {
73
+ build: Build;
74
+ logs: string;
75
+ }
76
+
77
+ declare class BuildError extends Error {
78
+ constructor(message: string);
79
+ }
80
+ declare class AuthRequiredError extends BuildError {
81
+ constructor(message?: string);
82
+ }
83
+ declare class BuildFailedError extends BuildError {
84
+ readonly buildId: string;
85
+ constructor(message: string, buildId: string);
86
+ }
87
+ declare class ConflictError extends BuildError {
88
+ constructor(message?: string);
89
+ }
90
+ declare class NotFoundError extends BuildError {
91
+ constructor(message?: string);
92
+ }
93
+ declare class ForbiddenError extends BuildError {
94
+ constructor(message?: string);
95
+ }
96
+ declare class TimeoutError extends BuildError {
97
+ constructor(message?: string);
98
+ }
99
+ declare class BadRequestError extends BuildError {
100
+ constructor(message?: string);
101
+ }
102
+
103
+ /**
104
+ * Build module entry point (verifiable builds + provenance)
105
+ */
106
+
107
+ interface BuildModuleConfig {
108
+ privateKey?: string;
109
+ environment?: string;
110
+ verbose?: boolean;
111
+ clientId?: string;
112
+ skipTelemetry?: boolean;
113
+ }
114
+ interface BuildModule {
115
+ submit(request: SubmitBuildRequest): Promise<SubmitBuildResponse>;
116
+ getLogs(buildId: string): Promise<string>;
117
+ list(options: {
118
+ billingAddress: string;
119
+ limit?: number;
120
+ offset?: number;
121
+ }): Promise<Build[]>;
122
+ get(buildId: string): Promise<Build>;
123
+ getByDigest(digest: string): Promise<Build>;
124
+ verify(identifier: string): Promise<VerifyProvenanceResult>;
125
+ submitAndWait(request: SubmitBuildRequest, options?: {
126
+ onLog?: (chunk: string) => void;
127
+ onProgress?: (progress: BuildProgress) => void;
128
+ pollIntervalMs?: number;
129
+ timeoutMs?: number;
130
+ }): Promise<Build>;
131
+ waitForBuild(buildId: string, options?: {
132
+ onLog?: (chunk: string) => void;
133
+ onProgress?: (progress: BuildProgress) => void;
134
+ pollIntervalMs?: number;
135
+ timeoutMs?: number;
136
+ }): Promise<Build>;
137
+ streamLogs(buildId: string, pollIntervalMs?: number): AsyncGenerator<LogChunk, void, unknown>;
138
+ }
139
+ declare function createBuildModule(config: BuildModuleConfig): BuildModule;
8
140
 
9
141
  /**
10
142
  * Non-interactive validation utilities for SDK
@@ -171,109 +303,143 @@ interface LogsParams {
171
303
  declare function validateLogsParams(params: Partial<LogsParams>): void;
172
304
 
173
305
  /**
174
- * Contract interactions
175
- *
176
- * This module handles on-chain contract interactions using viem
306
+ * UserAPI Client to manage interactions with the coordinator
177
307
  */
178
308
 
179
- /**
180
- * Gas estimation result
181
- */
182
- interface GasEstimate {
183
- /** Estimated gas limit for the transaction */
184
- gasLimit: bigint;
185
- /** Max fee per gas (EIP-1559) */
186
- maxFeePerGas: bigint;
187
- /** Max priority fee per gas (EIP-1559) */
188
- maxPriorityFeePerGas: bigint;
189
- /** Maximum cost in wei (gasLimit * maxFeePerGas) */
190
- maxCostWei: bigint;
191
- /** Maximum cost formatted as ETH string */
192
- maxCostEth: string;
309
+ interface AppProfileInfo {
310
+ name: string;
311
+ website?: string;
312
+ description?: string;
313
+ xURL?: string;
314
+ imageURL?: string;
193
315
  }
194
- /**
195
- * Options for estimating transaction gas
196
- */
197
- interface EstimateGasOptions {
198
- privateKey: string;
199
- rpcUrl: string;
200
- environmentConfig: EnvironmentConfig;
201
- to: Address;
202
- data: Hex;
203
- value?: bigint;
316
+ interface AppMetrics {
317
+ cpu_utilization_percent?: number;
318
+ memory_utilization_percent?: number;
319
+ memory_used_bytes?: number;
320
+ memory_total_bytes?: number;
204
321
  }
205
- /**
206
- * Format Wei to ETH string
207
- */
208
- declare function formatETH(wei: bigint): string;
209
- /**
210
- * Estimate gas cost for a transaction
211
- *
212
- * Use this to get cost estimate before prompting user for confirmation.
213
- */
214
- declare function estimateTransactionGas(options: EstimateGasOptions): Promise<GasEstimate>;
215
- /**
216
- * Prepared deploy batch ready for gas estimation and execution
217
- */
218
- interface PreparedDeployBatch {
219
- /** The app ID that will be deployed */
220
- appId: Address;
221
- /** The salt used for deployment */
222
- salt: Uint8Array;
223
- /** Batch executions to be sent */
224
- executions: Array<{
225
- target: Address;
226
- value: bigint;
227
- callData: Hex;
322
+ interface DerivedAddress {
323
+ address: string;
324
+ derivationPath: string;
325
+ }
326
+ interface AppInfo {
327
+ address: Address;
328
+ status: string;
329
+ ip: string;
330
+ machineType: string;
331
+ profile?: AppProfileInfo;
332
+ metrics?: AppMetrics;
333
+ evmAddresses: DerivedAddress[];
334
+ solanaAddresses: DerivedAddress[];
335
+ }
336
+ type AppContractStatus = "STARTED" | "STOPPED" | "TERMINATED" | "SUSPENDED" | string;
337
+ interface AppReleaseBuild {
338
+ buildId?: string;
339
+ billingAddress?: string;
340
+ repoUrl?: string;
341
+ gitRef?: string;
342
+ status?: string;
343
+ buildType?: string;
344
+ imageName?: string;
345
+ imageDigest?: string;
346
+ imageUrl?: string;
347
+ provenanceJson?: unknown;
348
+ provenanceSignature?: string;
349
+ createdAt?: string;
350
+ updatedAt?: string;
351
+ errorMessage?: string;
352
+ dependencies?: Record<string, AppReleaseBuild>;
353
+ }
354
+ interface AppRelease {
355
+ appId?: string;
356
+ rmsReleaseId?: string;
357
+ imageDigest?: string;
358
+ registryUrl?: string;
359
+ publicEnv?: string;
360
+ encryptedEnv?: string;
361
+ upgradeByTime?: number;
362
+ createdAt?: string;
363
+ createdAtBlock?: string;
364
+ build?: AppReleaseBuild;
365
+ }
366
+ interface AppResponse {
367
+ id: string;
368
+ creator?: string;
369
+ contractStatus?: AppContractStatus;
370
+ releases: AppRelease[];
371
+ }
372
+ declare class UserApiClient {
373
+ private readonly config;
374
+ private readonly account?;
375
+ private readonly rpcUrl?;
376
+ private readonly clientId;
377
+ constructor(config: EnvironmentConfig, privateKey?: string | Hex, rpcUrl?: string, clientId?: string);
378
+ getInfos(appIDs: Address[], addressCount?: number): Promise<AppInfo[]>;
379
+ /**
380
+ * Get app details from UserAPI (includes releases and build/provenance info when available).
381
+ *
382
+ * Endpoint: GET /apps/:appAddress
383
+ */
384
+ getApp(appAddress: Address): Promise<AppResponse>;
385
+ /**
386
+ * Get available SKUs (instance types) from UserAPI
387
+ */
388
+ getSKUs(): Promise<{
389
+ skus: Array<{
390
+ sku: string;
391
+ description: string;
392
+ }>;
228
393
  }>;
229
- /** Wallet client for sending transaction */
230
- walletClient: WalletClient;
231
- /** Public client for reading chain state */
232
- publicClient: PublicClient;
233
- /** Environment configuration */
234
- environmentConfig: EnvironmentConfig;
394
+ /**
395
+ * Get logs for an app
396
+ */
397
+ getLogs(appID: Address): Promise<string>;
398
+ /**
399
+ * Get statuses for apps
400
+ */
401
+ getStatuses(appIDs: Address[]): Promise<Array<{
402
+ address: Address;
403
+ status: string;
404
+ }>>;
405
+ /**
406
+ * Upload app profile information with optional image
407
+ */
408
+ uploadAppProfile(appAddress: Address, name: string, website?: string, description?: string, xURL?: string, imagePath?: string): Promise<{
409
+ name: string;
410
+ website?: string;
411
+ description?: string;
412
+ xURL?: string;
413
+ imageURL?: string;
414
+ }>;
415
+ private makeAuthenticatedRequest;
416
+ /**
417
+ * Generate authentication headers for UserAPI requests
418
+ */
419
+ private generateAuthHeaders;
235
420
  }
421
+
236
422
  /**
237
- * Prepared upgrade batch ready for gas estimation and execution
423
+ * Billing utility functions
238
424
  */
239
- interface PreparedUpgradeBatch {
240
- /** The app ID being upgraded */
241
- appId: Address;
242
- /** Batch executions to be sent */
243
- executions: Array<{
244
- target: Address;
245
- value: bigint;
246
- callData: Hex;
247
- }>;
248
- /** Wallet client for sending transaction */
249
- walletClient: WalletClient;
250
- /** Public client for reading chain state */
251
- publicClient: PublicClient;
252
- /** Environment configuration */
253
- environmentConfig: EnvironmentConfig;
254
- }
425
+
255
426
  /**
256
- * Get apps by creator (paginated)
427
+ * Check if subscription status allows deploying apps
257
428
  */
258
- interface AppConfig {
259
- release: any;
260
- status: number;
261
- }
429
+ declare function isSubscriptionActive(status: SubscriptionStatus): boolean;
430
+
262
431
  /**
263
- * Fetch all apps by a developer by auto-pagination
432
+ * General utility helpers
264
433
  */
265
- declare function getAllAppsByDeveloper(rpcUrl: string, env: EnvironmentConfig, developer: Address, pageSize?: bigint): Promise<{
266
- apps: Address[];
267
- appConfigs: AppConfig[];
268
- }>;
434
+
269
435
  /**
270
- * Get latest release block numbers for multiple apps
436
+ * Ensure hex string has 0x prefix
271
437
  */
272
- declare function getAppLatestReleaseBlockNumbers(rpcUrl: string, environmentConfig: EnvironmentConfig, appIDs: Address[]): Promise<Map<Address, number>>;
438
+ declare function addHexPrefix(value: string): Hex;
273
439
  /**
274
- * Get block timestamps for multiple block numbers
440
+ * Remove 0x prefix from hex string if present
275
441
  */
276
- declare function getBlockTimestamps(rpcUrl: string, environmentConfig: EnvironmentConfig, blockNumbers: number[]): Promise<Map<number, number>>;
442
+ declare function stripHexPrefix(value: string): string;
277
443
 
278
444
  /**
279
445
  * Main deploy function
@@ -317,23 +483,6 @@ interface SDKDeployOptions {
317
483
  /** Skip telemetry (used when called from CLI) - optional */
318
484
  skipTelemetry?: boolean;
319
485
  }
320
- /**
321
- * Prepared deployment ready for gas estimation and execution
322
- */
323
- interface PreparedDeploy {
324
- /** The prepared batch (executions, clients, etc.) */
325
- batch: PreparedDeployBatch;
326
- /** App name */
327
- appName: string;
328
- /** Final image reference */
329
- imageRef: string;
330
- /** Preflight context for post-deploy operations */
331
- preflightCtx: {
332
- privateKey: string;
333
- rpcUrl: string;
334
- environmentConfig: EnvironmentConfig;
335
- };
336
- }
337
486
  /**
338
487
  * Result from prepareDeploy - includes prepared batch and gas estimate
339
488
  */
@@ -343,6 +492,38 @@ interface PrepareDeployResult {
343
492
  /** Gas estimate for the batch transaction */
344
493
  gasEstimate: GasEstimate;
345
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
+ }
510
+ /**
511
+ * Prepare a deployment from a pre-built image (already layered) without using Docker locally.
512
+ *
513
+ * This is intended for verifiable builds where the build service outputs:
514
+ * - imageRef (tagged image URL)
515
+ * - imageDigest (sha256:... digest)
516
+ *
517
+ * Flow is the same as prepareDeploy, except:
518
+ * - Skips ensureDockerIsRunning()
519
+ * - Skips prepareRelease() image layering and digest extraction
520
+ * - Uses provided imageDigest + derived registry name to construct the Release struct
521
+ */
522
+ declare function prepareDeployFromVerifiableBuild(options: Omit<SDKDeployOptions, "gas" | "dockerfilePath" | "imageRef"> & {
523
+ imageRef: string;
524
+ imageDigest: string;
525
+ skipTelemetry?: boolean;
526
+ }, logger?: Logger): Promise<PrepareDeployResult>;
346
527
  /**
347
528
  * Prepare deployment - does all work up to the transaction
348
529
  *
@@ -361,10 +542,7 @@ declare function prepareDeploy(options: Omit<SDKDeployOptions, "gas"> & {
361
542
  * Note: This only submits the on-chain transaction. Call watchDeployment separately
362
543
  * to wait for the app to be running.
363
544
  */
364
- declare function executeDeploy(prepared: PreparedDeploy, gas: {
365
- maxFeePerGas?: bigint;
366
- maxPriorityFeePerGas?: bigint;
367
- } | undefined, logger?: Logger, skipTelemetry?: boolean): Promise<DeployResult>;
545
+ declare function executeDeploy(options: ExecuteDeployOptions): Promise<DeployResult>;
368
546
  /**
369
547
  * Watch a deployment until the app is running
370
548
  *
@@ -417,28 +595,11 @@ interface SDKUpgradeOptions {
417
595
  }
418
596
  interface UpgradeResult {
419
597
  /** App ID (contract address) */
420
- appId: string;
598
+ appId: AppId;
421
599
  /** Final image reference */
422
600
  imageRef: string;
423
601
  /** Transaction hash */
424
- txHash: `0x${string}`;
425
- }
426
- /**
427
- * Prepared upgrade ready for gas estimation and execution
428
- */
429
- interface PreparedUpgrade {
430
- /** The prepared batch (executions, clients, etc.) */
431
- batch: PreparedUpgradeBatch;
432
- /** App ID being upgraded */
433
- appId: string;
434
- /** Final image reference */
435
- imageRef: string;
436
- /** Preflight context for post-upgrade operations */
437
- preflightCtx: {
438
- privateKey: string;
439
- rpcUrl: string;
440
- environmentConfig: EnvironmentConfig;
441
- };
602
+ txHash: Hex;
442
603
  }
443
604
  /**
444
605
  * Result from prepareUpgrade - includes prepared batch and gas estimate
@@ -449,6 +610,34 @@ interface PrepareUpgradeResult {
449
610
  /** Gas estimate for the batch transaction */
450
611
  gasEstimate: GasEstimate;
451
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
+ }
628
+ /**
629
+ * Prepare an upgrade from a pre-built image (already layered) without using Docker locally.
630
+ *
631
+ * Intended for verifiable builds: build service provides imageRef + imageDigest (sha256:...).
632
+ * This skips:
633
+ * - ensureDockerIsRunning()
634
+ * - prepareRelease() layering/digest extraction
635
+ */
636
+ declare function prepareUpgradeFromVerifiableBuild(options: Omit<SDKUpgradeOptions, "gas" | "dockerfilePath" | "imageRef"> & {
637
+ imageRef: string;
638
+ imageDigest: string;
639
+ skipTelemetry?: boolean;
640
+ }, logger?: Logger): Promise<PrepareUpgradeResult>;
452
641
  /**
453
642
  * Prepare upgrade - does all work up to the transaction
454
643
  *
@@ -467,10 +656,7 @@ declare function prepareUpgrade(options: Omit<SDKUpgradeOptions, "gas"> & {
467
656
  * Note: This only submits the on-chain transaction. Call watchUpgrade separately
468
657
  * to wait for the upgrade to complete.
469
658
  */
470
- declare function executeUpgrade(prepared: PreparedUpgrade, gas: {
471
- maxFeePerGas?: bigint;
472
- maxPriorityFeePerGas?: bigint;
473
- } | undefined, logger?: Logger, skipTelemetry?: boolean): Promise<UpgradeResult>;
659
+ declare function executeUpgrade(options: ExecuteUpgradeOptions): Promise<UpgradeResult>;
474
660
  /**
475
661
  * Watch an upgrade until it completes
476
662
  *
@@ -503,15 +689,6 @@ declare function isEnvironmentAvailable(environment: string): boolean;
503
689
  */
504
690
  declare function isMainnet(environmentConfig: EnvironmentConfig): boolean;
505
691
 
506
- /**
507
- * Billing utility functions
508
- */
509
-
510
- /**
511
- * Check if subscription status allows deploying apps
512
- */
513
- declare function isSubscriptionActive(status: SubscriptionStatus): boolean;
514
-
515
692
  /**
516
693
  * OS Keyring Integration
517
694
  *
@@ -522,6 +699,7 @@ declare function isSubscriptionActive(status: SubscriptionStatus): boolean;
522
699
  *
523
700
  * Uses a single key for all environments.
524
701
  */
702
+
525
703
  interface StoredKey {
526
704
  address: string;
527
705
  }
@@ -543,7 +721,7 @@ declare function storePrivateKey(privateKey: string): Promise<void>;
543
721
  * Note: Returns the single stored key for all environments.
544
722
  * The environment parameter is kept for API compatibility but is ignored.
545
723
  */
546
- declare function getPrivateKey(): Promise<`0x${string}` | null>;
724
+ declare function getPrivateKey(): Promise<Hex | null>;
547
725
  /**
548
726
  * Delete a private key from OS keyring
549
727
  * Returns true if deletion was successful, false otherwise
@@ -595,8 +773,9 @@ declare function getAddressFromPrivateKey(privateKey: string): string;
595
773
  * 2. Environment variable (ECLOUD_PRIVATE_KEY)
596
774
  * 3. OS keyring (stored via `ecloud auth login`)
597
775
  */
776
+
598
777
  interface PrivateKeySource {
599
- key: `0x${string}`;
778
+ key: Hex;
600
779
  source: string;
601
780
  }
602
781
  /**
@@ -888,24 +1067,23 @@ declare function getCategoryDescriptions(catalog: TemplateCatalog, language: str
888
1067
  * This module handles EIP-7702 delegation and batch execution
889
1068
  */
890
1069
 
1070
+ type Execution = {
1071
+ target: Address;
1072
+ value: bigint;
1073
+ callData: Hex;
1074
+ };
891
1075
  /**
892
1076
  * Options for estimating batch gas
893
1077
  */
894
1078
  interface EstimateBatchGasOptions {
895
1079
  publicClient: PublicClient;
896
- environmentConfig: EnvironmentConfig;
897
- executions: Array<{
898
- target: Address;
899
- value: bigint;
900
- callData: Hex;
901
- }>;
1080
+ account: Address;
1081
+ executions: Execution[];
902
1082
  }
903
1083
  /**
904
1084
  * Estimate gas cost for a batch transaction
905
1085
  *
906
1086
  * Use this to get cost estimate before prompting user for confirmation.
907
- * Note: This provides a conservative estimate since batch transactions
908
- * through EIP-7702 can have variable costs.
909
1087
  */
910
1088
  declare function estimateBatchGas(options: EstimateBatchGasOptions): Promise<GasEstimate>;
911
1089
  /**
@@ -936,81 +1114,6 @@ interface PreflightContext {
936
1114
  */
937
1115
  declare function getCurrentInstanceType(preflightCtx: PreflightContext, appID: Address, logger: Logger, clientId?: string): Promise<string>;
938
1116
 
939
- /**
940
- * UserAPI Client to manage interactions with the coordinator
941
- */
942
-
943
- interface AppProfileInfo {
944
- name: string;
945
- website?: string;
946
- description?: string;
947
- xURL?: string;
948
- imageURL?: string;
949
- }
950
- interface AppMetrics {
951
- cpu_utilization_percent?: number;
952
- memory_utilization_percent?: number;
953
- memory_used_bytes?: number;
954
- memory_total_bytes?: number;
955
- }
956
- interface DerivedAddress {
957
- address: string;
958
- derivationPath: string;
959
- }
960
- interface AppInfo {
961
- address: Address;
962
- status: string;
963
- ip: string;
964
- machineType: string;
965
- profile?: AppProfileInfo;
966
- metrics?: AppMetrics;
967
- evmAddresses: DerivedAddress[];
968
- solanaAddresses: DerivedAddress[];
969
- }
970
- declare class UserApiClient {
971
- private readonly config;
972
- private readonly account?;
973
- private readonly rpcUrl?;
974
- private readonly clientId;
975
- constructor(config: EnvironmentConfig, privateKey?: string | Hex, rpcUrl?: string, clientId?: string);
976
- getInfos(appIDs: Address[], addressCount?: number): Promise<AppInfo[]>;
977
- /**
978
- * Get available SKUs (instance types) from UserAPI
979
- */
980
- getSKUs(): Promise<{
981
- skus: Array<{
982
- sku: string;
983
- description: string;
984
- }>;
985
- }>;
986
- /**
987
- * Get logs for an app
988
- */
989
- getLogs(appID: Address): Promise<string>;
990
- /**
991
- * Get statuses for apps
992
- */
993
- getStatuses(appIDs: Address[]): Promise<Array<{
994
- address: Address;
995
- status: string;
996
- }>>;
997
- /**
998
- * Upload app profile information with optional image
999
- */
1000
- uploadAppProfile(appAddress: Address, name: string, website?: string, description?: string, xURL?: string, imagePath?: string): Promise<{
1001
- name: string;
1002
- website?: string;
1003
- description?: string;
1004
- xURL?: string;
1005
- imageURL?: string;
1006
- }>;
1007
- private makeAuthenticatedRequest;
1008
- /**
1009
- * Generate authentication headers for UserAPI requests
1010
- */
1011
- private generateAuthHeaders;
1012
- }
1013
-
1014
1117
  /**
1015
1118
  * Main SDK Client entry point
1016
1119
  */
@@ -1018,7 +1121,7 @@ declare class UserApiClient {
1018
1121
  type Environment = "sepolia" | "sepolia-dev" | "mainnet-alpha";
1019
1122
  interface ClientConfig {
1020
1123
  verbose: boolean;
1021
- privateKey: `0x${string}`;
1124
+ privateKey: Hex;
1022
1125
  environment: Environment | string;
1023
1126
  rpcUrl?: string;
1024
1127
  }
@@ -1028,4 +1131,4 @@ interface ECloudClient {
1028
1131
  }
1029
1132
  declare function createECloudClient(cfg: ClientConfig): ECloudClient;
1030
1133
 
1031
- export { type AppEnvironment, type AppInfo, type AppMetrics, type AppProfileInfo, BillingModule, type ClientConfig, ComputeModule, type CreateAppParams, type DeployParams, DeployResult, type ECloudClient, type Environment, EnvironmentConfig, type EstimateBatchGasOptions, type EstimateGasOptions, type GasEstimate, type GeneratedKey, type LegacyKey, type LogVisibility, Logger, type LogsParams, type Metric, type MetricsContext, NoopClient, PostHogClient, type PrepareDeployResult, type PrepareUpgradeResult, type PreparedDeploy, type PreparedUpgrade, type PrivateKeySource, type ResourceUsageMonitoring, type SDKDeployOptions, type SDKUpgradeOptions, type StoredKey, SubscriptionStatus, type TelemetryClient, type TelemetryClientOptions, type TelemetryWrapperOptions, type UpgradeParams, UserApiClient, addMetric, addMetricWithDimensions, assertValidFilePath, assertValidImageReference, assertValidPrivateKey, checkERC7702Delegation, createAppEnvironment, 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, 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, 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 };