@layr-labs/ecloud-sdk 0.2.0 → 0.2.2-dev

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.
Files changed (40) hide show
  1. package/VERSION +2 -2
  2. package/dist/billing.cjs +48 -43
  3. package/dist/billing.cjs.map +1 -1
  4. package/dist/billing.d.cts +6 -3
  5. package/dist/billing.d.ts +6 -3
  6. package/dist/billing.js +519 -4
  7. package/dist/billing.js.map +1 -1
  8. package/dist/browser.cjs +5034 -0
  9. package/dist/browser.cjs.map +1 -0
  10. package/dist/browser.d.cts +239 -0
  11. package/dist/browser.d.ts +239 -0
  12. package/dist/browser.js +4924 -0
  13. package/dist/browser.js.map +1 -0
  14. package/dist/{compute-CF2HOXed.d.ts → compute-BYhSs8en.d.ts} +15 -96
  15. package/dist/{compute-CbmjA8kJ.d.cts → compute-Bpjb3hYD.d.cts} +15 -96
  16. package/dist/compute.cjs +875 -846
  17. package/dist/compute.cjs.map +1 -1
  18. package/dist/compute.d.cts +2 -2
  19. package/dist/compute.d.ts +2 -2
  20. package/dist/compute.js +7009 -8
  21. package/dist/compute.js.map +1 -1
  22. package/dist/helpers-CEvhJz7f.d.cts +742 -0
  23. package/dist/helpers-CQuBwQnu.d.ts +742 -0
  24. package/dist/index-DeQzn_yM.d.cts +739 -0
  25. package/dist/index-DeQzn_yM.d.ts +739 -0
  26. package/dist/index.cjs +1958 -1758
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts +69 -414
  29. package/dist/index.d.ts +69 -414
  30. package/dist/index.js +7977 -134
  31. package/dist/index.js.map +1 -1
  32. package/package.json +17 -2
  33. package/dist/chunk-CA5Y4OVI.js +0 -744
  34. package/dist/chunk-CA5Y4OVI.js.map +0 -1
  35. package/dist/chunk-ZDXN2WKP.js +0 -434
  36. package/dist/chunk-ZDXN2WKP.js.map +0 -1
  37. package/dist/chunk-ZTLKZMSW.js +0 -6719
  38. package/dist/chunk-ZTLKZMSW.js.map +0 -1
  39. package/dist/index-D2QufVB9.d.cts +0 -342
  40. package/dist/index-D2QufVB9.d.ts +0 -342
@@ -1,5 +1,5 @@
1
- import { Address, Hex } from 'viem';
2
- import { L as Logger, E as EnvironmentConfig, b as DeployAppOpts, A as AppId, U as UpgradeAppOpts, c as PrepareDeployOpts, P as PreparedDeploy, e as PrepareDeployFromVerifiableBuildOpts, G as GasOpts, g as ExecuteDeployResult, d as PrepareUpgradeOpts, a as PreparedUpgrade, f as PrepareUpgradeFromVerifiableBuildOpts, h as ExecuteUpgradeResult, q as AppProfile, r as AppProfileResponse, k as LifecycleOpts } from './index-D2QufVB9.js';
1
+ import { Address, WalletClient, PublicClient, Hex } from 'viem';
2
+ import { ab as Logger, a6 as EnvironmentConfig, N as DeployAppOpts, A as AppId, O as UpgradeAppOpts, Q as PrepareDeployOpts, $ as PreparedDeploy, G as GasEstimate, T as PrepareDeployFromVerifiableBuildOpts, X as ExecuteDeployResult, R as PrepareUpgradeOpts, a0 as PreparedUpgrade, V as PrepareUpgradeFromVerifiableBuildOpts, Y as ExecuteUpgradeResult, ac as AppProfile, ad as AppProfileResponse, a1 as LifecycleOpts } from './index-DeQzn_yM.js';
3
3
 
4
4
  /**
5
5
  * Create command
@@ -70,33 +70,13 @@ declare function createApp(options: SDKCreateAppOpts | CreateAppOpts, logger?: L
70
70
  /**
71
71
  * Required logs options for SDK (non-interactive)
72
72
  */
73
- interface SDKLogsOptions {
73
+ interface LogsOptions {
74
74
  /** App ID (address) or app name - required */
75
75
  appID: string | Address;
76
76
  /** Watch logs continuously - optional */
77
77
  watch?: boolean;
78
- /** Environment name - optional, defaults to 'sepolia' */
79
- environment?: string;
80
- /** Private key for authenticated requests - optional */
81
- privateKey?: string;
82
- /** RPC URL - optional, uses environment default */
83
- rpcUrl?: string;
84
78
  /** Client ID for API requests - optional */
85
79
  clientId?: string;
86
- /** Skip telemetry (for CLI usage) - optional */
87
- skipTelemetry?: boolean;
88
- }
89
- /**
90
- * Legacy interface for backward compatibility
91
- * @deprecated Use SDKLogsOptions instead
92
- */
93
- interface LogsOptions {
94
- appID?: string | Address;
95
- watch?: boolean;
96
- environment?: string;
97
- privateKey?: string;
98
- rpcUrl?: string;
99
- clientId?: string;
100
80
  }
101
81
  /**
102
82
  * View app logs
@@ -104,75 +84,14 @@ interface LogsOptions {
104
84
  * This function is non-interactive and requires appID to be provided explicitly.
105
85
  *
106
86
  * @param options - Required options including appID
87
+ * @param walletClient - Viem WalletClient for signing requests
88
+ * @param publicClient - Viem PublicClient for chain queries
89
+ * @param environmentConfig - Environment configuration
107
90
  * @param logger - Optional logger instance
91
+ * @param skipTelemetry - Skip telemetry (for CLI usage)
108
92
  * @throws Error if appID is missing or invalid
109
93
  */
110
- declare function logs(options: SDKLogsOptions | LogsOptions, logger?: Logger, skipTelemetry?: boolean): Promise<void>;
111
-
112
- /**
113
- * Contract interactions
114
- *
115
- * This module handles on-chain contract interactions using viem
116
- */
117
-
118
- /**
119
- * Gas estimation result
120
- */
121
- interface GasEstimate {
122
- /** Estimated gas limit for the transaction */
123
- gasLimit: bigint;
124
- /** Max fee per gas (EIP-1559) */
125
- maxFeePerGas: bigint;
126
- /** Max priority fee per gas (EIP-1559) */
127
- maxPriorityFeePerGas: bigint;
128
- /** Maximum cost in wei (gasLimit * maxFeePerGas) */
129
- maxCostWei: bigint;
130
- /** Maximum cost formatted as ETH string */
131
- maxCostEth: string;
132
- }
133
- /**
134
- * Options for estimating transaction gas
135
- */
136
- interface EstimateGasOptions {
137
- privateKey: string;
138
- rpcUrl: string;
139
- environmentConfig: EnvironmentConfig;
140
- to: Address;
141
- data: Hex;
142
- value?: bigint;
143
- }
144
- /**
145
- * Format Wei to ETH string
146
- */
147
- declare function formatETH(wei: bigint): string;
148
- /**
149
- * Estimate gas cost for a transaction
150
- *
151
- * Use this to get cost estimate before prompting user for confirmation.
152
- */
153
- declare function estimateTransactionGas(options: EstimateGasOptions): Promise<GasEstimate>;
154
- /**
155
- * Get apps by creator (paginated)
156
- */
157
- interface AppConfig {
158
- release: any;
159
- status: number;
160
- }
161
- /**
162
- * Fetch all apps by a developer by auto-pagination
163
- */
164
- declare function getAllAppsByDeveloper(rpcUrl: string, env: EnvironmentConfig, developer: Address, pageSize?: bigint): Promise<{
165
- apps: Address[];
166
- appConfigs: AppConfig[];
167
- }>;
168
- /**
169
- * Get latest release block numbers for multiple apps
170
- */
171
- declare function getAppLatestReleaseBlockNumbers(rpcUrl: string, environmentConfig: EnvironmentConfig, appIDs: Address[]): Promise<Map<Address, number>>;
172
- /**
173
- * Get block timestamps for multiple block numbers
174
- */
175
- declare function getBlockTimestamps(rpcUrl: string, environmentConfig: EnvironmentConfig, blockNumbers: number[]): Promise<Map<number, number>>;
94
+ declare function logs(options: LogsOptions, walletClient: WalletClient, publicClient: PublicClient, environmentConfig: EnvironmentConfig, logger?: Logger, skipTelemetry?: boolean): Promise<void>;
176
95
 
177
96
  /**
178
97
  * Main App namespace entry point
@@ -212,7 +131,7 @@ interface AppModule {
212
131
  prepared: PreparedDeploy;
213
132
  gasEstimate: GasEstimate;
214
133
  }>;
215
- executeDeploy: (prepared: PreparedDeploy, gas?: GasOpts) => Promise<ExecuteDeployResult>;
134
+ executeDeploy: (prepared: PreparedDeploy, gas?: GasEstimate) => Promise<ExecuteDeployResult>;
216
135
  watchDeployment: (appId: AppId) => Promise<string | undefined>;
217
136
  prepareUpgrade: (appId: AppId, opts: PrepareUpgradeOpts) => Promise<{
218
137
  prepared: PreparedUpgrade;
@@ -222,7 +141,7 @@ interface AppModule {
222
141
  prepared: PreparedUpgrade;
223
142
  gasEstimate: GasEstimate;
224
143
  }>;
225
- executeUpgrade: (prepared: PreparedUpgrade, gas?: GasOpts) => Promise<ExecuteUpgradeResult>;
144
+ executeUpgrade: (prepared: PreparedUpgrade, gas?: GasEstimate) => Promise<ExecuteUpgradeResult>;
226
145
  watchUpgrade: (appId: AppId) => Promise<void>;
227
146
  setProfile: (appId: AppId, profile: AppProfile) => Promise<AppProfileResponse>;
228
147
  logs: (opts: LogsOptions) => Promise<void>;
@@ -242,8 +161,8 @@ interface AppModule {
242
161
  }
243
162
  interface AppModuleConfig {
244
163
  verbose?: boolean;
245
- privateKey: Hex;
246
- rpcUrl: string;
164
+ walletClient: WalletClient;
165
+ publicClient: PublicClient;
247
166
  environment: string;
248
167
  clientId?: string;
249
168
  skipTelemetry?: boolean;
@@ -259,12 +178,12 @@ interface ComputeModule {
259
178
  }
260
179
  interface ComputeModuleConfig {
261
180
  verbose?: boolean;
262
- privateKey: Hex;
263
- rpcUrl: string;
181
+ walletClient: WalletClient;
182
+ publicClient: PublicClient;
264
183
  environment: string;
265
184
  clientId?: string;
266
185
  skipTelemetry?: boolean;
267
186
  }
268
187
  declare function createComputeModule(config: ComputeModuleConfig): ComputeModule;
269
188
 
270
- export { type AppModule as A, type ComputeModule as C, type EstimateGasOptions as E, type GasEstimate as G, type LogsOptions as L, PRIMARY_LANGUAGES as P, type SDKCreateAppOpts as S, type CreateAppOpts as a, type SDKLogsOptions as b, createApp as c, createComputeModule as d, type ComputeModuleConfig as e, encodeStartAppData as f, getAvailableTemplates as g, encodeStopAppData as h, encodeTerminateAppData as i, getAllAppsByDeveloper as j, getAppLatestReleaseBlockNumbers as k, logs as l, getBlockTimestamps as m, estimateTransactionGas as n, formatETH as o, createAppModule as p, type AppModuleConfig as q };
189
+ export { type AppModule as A, type ComputeModule as C, type LogsOptions as L, PRIMARY_LANGUAGES as P, type SDKCreateAppOpts as S, type CreateAppOpts as a, createComputeModule as b, createApp as c, type ComputeModuleConfig as d, encodeStartAppData as e, encodeStopAppData as f, getAvailableTemplates as g, encodeTerminateAppData as h, createAppModule as i, type AppModuleConfig as j, logs as l };
@@ -1,5 +1,5 @@
1
- import { Address, Hex } from 'viem';
2
- import { L as Logger, E as EnvironmentConfig, b as DeployAppOpts, A as AppId, U as UpgradeAppOpts, c as PrepareDeployOpts, P as PreparedDeploy, e as PrepareDeployFromVerifiableBuildOpts, G as GasOpts, g as ExecuteDeployResult, d as PrepareUpgradeOpts, a as PreparedUpgrade, f as PrepareUpgradeFromVerifiableBuildOpts, h as ExecuteUpgradeResult, q as AppProfile, r as AppProfileResponse, k as LifecycleOpts } from './index-D2QufVB9.cjs';
1
+ import { Address, WalletClient, PublicClient, Hex } from 'viem';
2
+ import { ab as Logger, a6 as EnvironmentConfig, N as DeployAppOpts, A as AppId, O as UpgradeAppOpts, Q as PrepareDeployOpts, $ as PreparedDeploy, G as GasEstimate, T as PrepareDeployFromVerifiableBuildOpts, X as ExecuteDeployResult, R as PrepareUpgradeOpts, a0 as PreparedUpgrade, V as PrepareUpgradeFromVerifiableBuildOpts, Y as ExecuteUpgradeResult, ac as AppProfile, ad as AppProfileResponse, a1 as LifecycleOpts } from './index-DeQzn_yM.cjs';
3
3
 
4
4
  /**
5
5
  * Create command
@@ -70,33 +70,13 @@ declare function createApp(options: SDKCreateAppOpts | CreateAppOpts, logger?: L
70
70
  /**
71
71
  * Required logs options for SDK (non-interactive)
72
72
  */
73
- interface SDKLogsOptions {
73
+ interface LogsOptions {
74
74
  /** App ID (address) or app name - required */
75
75
  appID: string | Address;
76
76
  /** Watch logs continuously - optional */
77
77
  watch?: boolean;
78
- /** Environment name - optional, defaults to 'sepolia' */
79
- environment?: string;
80
- /** Private key for authenticated requests - optional */
81
- privateKey?: string;
82
- /** RPC URL - optional, uses environment default */
83
- rpcUrl?: string;
84
78
  /** Client ID for API requests - optional */
85
79
  clientId?: string;
86
- /** Skip telemetry (for CLI usage) - optional */
87
- skipTelemetry?: boolean;
88
- }
89
- /**
90
- * Legacy interface for backward compatibility
91
- * @deprecated Use SDKLogsOptions instead
92
- */
93
- interface LogsOptions {
94
- appID?: string | Address;
95
- watch?: boolean;
96
- environment?: string;
97
- privateKey?: string;
98
- rpcUrl?: string;
99
- clientId?: string;
100
80
  }
101
81
  /**
102
82
  * View app logs
@@ -104,75 +84,14 @@ interface LogsOptions {
104
84
  * This function is non-interactive and requires appID to be provided explicitly.
105
85
  *
106
86
  * @param options - Required options including appID
87
+ * @param walletClient - Viem WalletClient for signing requests
88
+ * @param publicClient - Viem PublicClient for chain queries
89
+ * @param environmentConfig - Environment configuration
107
90
  * @param logger - Optional logger instance
91
+ * @param skipTelemetry - Skip telemetry (for CLI usage)
108
92
  * @throws Error if appID is missing or invalid
109
93
  */
110
- declare function logs(options: SDKLogsOptions | LogsOptions, logger?: Logger, skipTelemetry?: boolean): Promise<void>;
111
-
112
- /**
113
- * Contract interactions
114
- *
115
- * This module handles on-chain contract interactions using viem
116
- */
117
-
118
- /**
119
- * Gas estimation result
120
- */
121
- interface GasEstimate {
122
- /** Estimated gas limit for the transaction */
123
- gasLimit: bigint;
124
- /** Max fee per gas (EIP-1559) */
125
- maxFeePerGas: bigint;
126
- /** Max priority fee per gas (EIP-1559) */
127
- maxPriorityFeePerGas: bigint;
128
- /** Maximum cost in wei (gasLimit * maxFeePerGas) */
129
- maxCostWei: bigint;
130
- /** Maximum cost formatted as ETH string */
131
- maxCostEth: string;
132
- }
133
- /**
134
- * Options for estimating transaction gas
135
- */
136
- interface EstimateGasOptions {
137
- privateKey: string;
138
- rpcUrl: string;
139
- environmentConfig: EnvironmentConfig;
140
- to: Address;
141
- data: Hex;
142
- value?: bigint;
143
- }
144
- /**
145
- * Format Wei to ETH string
146
- */
147
- declare function formatETH(wei: bigint): string;
148
- /**
149
- * Estimate gas cost for a transaction
150
- *
151
- * Use this to get cost estimate before prompting user for confirmation.
152
- */
153
- declare function estimateTransactionGas(options: EstimateGasOptions): Promise<GasEstimate>;
154
- /**
155
- * Get apps by creator (paginated)
156
- */
157
- interface AppConfig {
158
- release: any;
159
- status: number;
160
- }
161
- /**
162
- * Fetch all apps by a developer by auto-pagination
163
- */
164
- declare function getAllAppsByDeveloper(rpcUrl: string, env: EnvironmentConfig, developer: Address, pageSize?: bigint): Promise<{
165
- apps: Address[];
166
- appConfigs: AppConfig[];
167
- }>;
168
- /**
169
- * Get latest release block numbers for multiple apps
170
- */
171
- declare function getAppLatestReleaseBlockNumbers(rpcUrl: string, environmentConfig: EnvironmentConfig, appIDs: Address[]): Promise<Map<Address, number>>;
172
- /**
173
- * Get block timestamps for multiple block numbers
174
- */
175
- declare function getBlockTimestamps(rpcUrl: string, environmentConfig: EnvironmentConfig, blockNumbers: number[]): Promise<Map<number, number>>;
94
+ declare function logs(options: LogsOptions, walletClient: WalletClient, publicClient: PublicClient, environmentConfig: EnvironmentConfig, logger?: Logger, skipTelemetry?: boolean): Promise<void>;
176
95
 
177
96
  /**
178
97
  * Main App namespace entry point
@@ -212,7 +131,7 @@ interface AppModule {
212
131
  prepared: PreparedDeploy;
213
132
  gasEstimate: GasEstimate;
214
133
  }>;
215
- executeDeploy: (prepared: PreparedDeploy, gas?: GasOpts) => Promise<ExecuteDeployResult>;
134
+ executeDeploy: (prepared: PreparedDeploy, gas?: GasEstimate) => Promise<ExecuteDeployResult>;
216
135
  watchDeployment: (appId: AppId) => Promise<string | undefined>;
217
136
  prepareUpgrade: (appId: AppId, opts: PrepareUpgradeOpts) => Promise<{
218
137
  prepared: PreparedUpgrade;
@@ -222,7 +141,7 @@ interface AppModule {
222
141
  prepared: PreparedUpgrade;
223
142
  gasEstimate: GasEstimate;
224
143
  }>;
225
- executeUpgrade: (prepared: PreparedUpgrade, gas?: GasOpts) => Promise<ExecuteUpgradeResult>;
144
+ executeUpgrade: (prepared: PreparedUpgrade, gas?: GasEstimate) => Promise<ExecuteUpgradeResult>;
226
145
  watchUpgrade: (appId: AppId) => Promise<void>;
227
146
  setProfile: (appId: AppId, profile: AppProfile) => Promise<AppProfileResponse>;
228
147
  logs: (opts: LogsOptions) => Promise<void>;
@@ -242,8 +161,8 @@ interface AppModule {
242
161
  }
243
162
  interface AppModuleConfig {
244
163
  verbose?: boolean;
245
- privateKey: Hex;
246
- rpcUrl: string;
164
+ walletClient: WalletClient;
165
+ publicClient: PublicClient;
247
166
  environment: string;
248
167
  clientId?: string;
249
168
  skipTelemetry?: boolean;
@@ -259,12 +178,12 @@ interface ComputeModule {
259
178
  }
260
179
  interface ComputeModuleConfig {
261
180
  verbose?: boolean;
262
- privateKey: Hex;
263
- rpcUrl: string;
181
+ walletClient: WalletClient;
182
+ publicClient: PublicClient;
264
183
  environment: string;
265
184
  clientId?: string;
266
185
  skipTelemetry?: boolean;
267
186
  }
268
187
  declare function createComputeModule(config: ComputeModuleConfig): ComputeModule;
269
188
 
270
- export { type AppModule as A, type ComputeModule as C, type EstimateGasOptions as E, type GasEstimate as G, type LogsOptions as L, PRIMARY_LANGUAGES as P, type SDKCreateAppOpts as S, type CreateAppOpts as a, type SDKLogsOptions as b, createApp as c, createComputeModule as d, type ComputeModuleConfig as e, encodeStartAppData as f, getAvailableTemplates as g, encodeStopAppData as h, encodeTerminateAppData as i, getAllAppsByDeveloper as j, getAppLatestReleaseBlockNumbers as k, logs as l, getBlockTimestamps as m, estimateTransactionGas as n, formatETH as o, createAppModule as p, type AppModuleConfig as q };
189
+ export { type AppModule as A, type ComputeModule as C, type LogsOptions as L, PRIMARY_LANGUAGES as P, type SDKCreateAppOpts as S, type CreateAppOpts as a, createComputeModule as b, createApp as c, type ComputeModuleConfig as d, encodeStartAppData as e, encodeStopAppData as f, getAvailableTemplates as g, encodeTerminateAppData as h, createAppModule as i, type AppModuleConfig as j, logs as l };