@layr-labs/ecloud-sdk 0.1.1 → 0.1.2
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/VERSION +2 -2
- package/dist/billing.cjs.map +1 -1
- package/dist/billing.d.cts +1 -1
- package/dist/billing.d.ts +1 -1
- package/dist/billing.js +2 -2
- package/dist/{chunk-XNWF467Z.js → chunk-4RG5IMZ7.js} +2 -2
- package/dist/chunk-4RG5IMZ7.js.map +1 -0
- package/dist/{chunk-73YDSHDG.js → chunk-AOZRDBLK.js} +2 -2
- package/dist/chunk-AOZRDBLK.js.map +1 -0
- package/dist/{chunk-LUFEUEOG.js → chunk-MQ2NGP4C.js} +225 -52
- package/dist/chunk-MQ2NGP4C.js.map +1 -0
- package/dist/{compute-gpepEsn3.d.ts → compute-BlUpqWKo.d.cts} +93 -15
- package/dist/{compute-B_ibIORD.d.cts → compute-CottWiST.d.ts} +93 -15
- package/dist/compute.cjs +478 -30
- package/dist/compute.cjs.map +1 -1
- package/dist/compute.d.cts +2 -2
- package/dist/compute.d.ts +2 -2
- package/dist/compute.js +2 -2
- package/dist/{index-D-SUX3IG.d.ts → index-Fb_S-Cqk.d.cts} +98 -6
- package/dist/{index-D-SUX3IG.d.cts → index-Fb_S-Cqk.d.ts} +98 -6
- package/dist/index.cjs +222 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +45 -158
- package/dist/index.d.ts +45 -158
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/chunk-73YDSHDG.js.map +0 -1
- package/dist/chunk-LUFEUEOG.js.map +0 -1
- package/dist/chunk-XNWF467Z.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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, G as GasOpts, e as ExecuteDeployResult, d as PrepareUpgradeOpts, a as PreparedUpgrade, f as ExecuteUpgradeResult, o as AppProfile, p as AppProfileResponse, i as LifecycleOpts } from './index-Fb_S-Cqk.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Create command
|
|
@@ -109,6 +109,71 @@ interface LogsOptions {
|
|
|
109
109
|
*/
|
|
110
110
|
declare function logs(options: SDKLogsOptions | LogsOptions, logger?: Logger, skipTelemetry?: boolean): Promise<void>;
|
|
111
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>>;
|
|
176
|
+
|
|
112
177
|
/**
|
|
113
178
|
* Main App namespace entry point
|
|
114
179
|
*/
|
|
@@ -116,47 +181,60 @@ declare function logs(options: SDKLogsOptions | LogsOptions, logger?: Logger, sk
|
|
|
116
181
|
/**
|
|
117
182
|
* Encode start app call data for gas estimation
|
|
118
183
|
*/
|
|
119
|
-
declare function encodeStartAppData(appId: AppId):
|
|
184
|
+
declare function encodeStartAppData(appId: AppId): Hex;
|
|
120
185
|
/**
|
|
121
186
|
* Encode stop app call data for gas estimation
|
|
122
187
|
*/
|
|
123
|
-
declare function encodeStopAppData(appId: AppId):
|
|
188
|
+
declare function encodeStopAppData(appId: AppId): Hex;
|
|
124
189
|
/**
|
|
125
190
|
* Encode terminate app call data for gas estimation
|
|
126
191
|
*/
|
|
127
|
-
declare function encodeTerminateAppData(appId: AppId):
|
|
192
|
+
declare function encodeTerminateAppData(appId: AppId): Hex;
|
|
128
193
|
interface AppModule {
|
|
129
194
|
create: (opts: CreateAppOpts) => Promise<void>;
|
|
130
195
|
deploy: (opts: DeployAppOpts) => Promise<{
|
|
131
196
|
appId: AppId;
|
|
132
|
-
tx:
|
|
197
|
+
tx: Hex;
|
|
133
198
|
appName: string;
|
|
134
199
|
imageRef: string;
|
|
135
200
|
ipAddress?: string;
|
|
136
201
|
}>;
|
|
137
202
|
upgrade: (appId: AppId, opts: UpgradeAppOpts) => Promise<{
|
|
138
|
-
tx:
|
|
139
|
-
appId:
|
|
203
|
+
tx: Hex;
|
|
204
|
+
appId: AppId;
|
|
140
205
|
imageRef: string;
|
|
141
206
|
}>;
|
|
207
|
+
prepareDeploy: (opts: PrepareDeployOpts) => Promise<{
|
|
208
|
+
prepared: PreparedDeploy;
|
|
209
|
+
gasEstimate: GasEstimate;
|
|
210
|
+
}>;
|
|
211
|
+
executeDeploy: (prepared: PreparedDeploy, gas?: GasOpts) => Promise<ExecuteDeployResult>;
|
|
212
|
+
watchDeployment: (appId: AppId) => Promise<string | undefined>;
|
|
213
|
+
prepareUpgrade: (appId: AppId, opts: PrepareUpgradeOpts) => Promise<{
|
|
214
|
+
prepared: PreparedUpgrade;
|
|
215
|
+
gasEstimate: GasEstimate;
|
|
216
|
+
}>;
|
|
217
|
+
executeUpgrade: (prepared: PreparedUpgrade, gas?: GasOpts) => Promise<ExecuteUpgradeResult>;
|
|
218
|
+
watchUpgrade: (appId: AppId) => Promise<void>;
|
|
219
|
+
setProfile: (appId: AppId, profile: AppProfile) => Promise<AppProfileResponse>;
|
|
142
220
|
logs: (opts: LogsOptions) => Promise<void>;
|
|
143
221
|
start: (appId: AppId, opts?: LifecycleOpts) => Promise<{
|
|
144
|
-
tx:
|
|
222
|
+
tx: Hex | false;
|
|
145
223
|
}>;
|
|
146
224
|
stop: (appId: AppId, opts?: LifecycleOpts) => Promise<{
|
|
147
|
-
tx:
|
|
225
|
+
tx: Hex | false;
|
|
148
226
|
}>;
|
|
149
227
|
terminate: (appId: AppId, opts?: LifecycleOpts) => Promise<{
|
|
150
|
-
tx:
|
|
228
|
+
tx: Hex | false;
|
|
151
229
|
}>;
|
|
152
230
|
isDelegated: () => Promise<boolean>;
|
|
153
231
|
undelegate: () => Promise<{
|
|
154
|
-
tx:
|
|
232
|
+
tx: Hex | false;
|
|
155
233
|
}>;
|
|
156
234
|
}
|
|
157
235
|
interface AppModuleConfig {
|
|
158
236
|
verbose?: boolean;
|
|
159
|
-
privateKey:
|
|
237
|
+
privateKey: Hex;
|
|
160
238
|
rpcUrl: string;
|
|
161
239
|
environment: string;
|
|
162
240
|
clientId?: string;
|
|
@@ -173,7 +251,7 @@ interface ComputeModule {
|
|
|
173
251
|
}
|
|
174
252
|
interface ComputeModuleConfig {
|
|
175
253
|
verbose?: boolean;
|
|
176
|
-
privateKey:
|
|
254
|
+
privateKey: Hex;
|
|
177
255
|
rpcUrl: string;
|
|
178
256
|
environment: string;
|
|
179
257
|
clientId?: string;
|
|
@@ -181,4 +259,4 @@ interface ComputeModuleConfig {
|
|
|
181
259
|
}
|
|
182
260
|
declare function createComputeModule(config: ComputeModuleConfig): ComputeModule;
|
|
183
261
|
|
|
184
|
-
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, 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,
|
|
262
|
+
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 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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, G as GasOpts, e as ExecuteDeployResult, d as PrepareUpgradeOpts, a as PreparedUpgrade, f as ExecuteUpgradeResult, o as AppProfile, p as AppProfileResponse, i as LifecycleOpts } from './index-Fb_S-Cqk.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Create command
|
|
@@ -109,6 +109,71 @@ interface LogsOptions {
|
|
|
109
109
|
*/
|
|
110
110
|
declare function logs(options: SDKLogsOptions | LogsOptions, logger?: Logger, skipTelemetry?: boolean): Promise<void>;
|
|
111
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>>;
|
|
176
|
+
|
|
112
177
|
/**
|
|
113
178
|
* Main App namespace entry point
|
|
114
179
|
*/
|
|
@@ -116,47 +181,60 @@ declare function logs(options: SDKLogsOptions | LogsOptions, logger?: Logger, sk
|
|
|
116
181
|
/**
|
|
117
182
|
* Encode start app call data for gas estimation
|
|
118
183
|
*/
|
|
119
|
-
declare function encodeStartAppData(appId: AppId):
|
|
184
|
+
declare function encodeStartAppData(appId: AppId): Hex;
|
|
120
185
|
/**
|
|
121
186
|
* Encode stop app call data for gas estimation
|
|
122
187
|
*/
|
|
123
|
-
declare function encodeStopAppData(appId: AppId):
|
|
188
|
+
declare function encodeStopAppData(appId: AppId): Hex;
|
|
124
189
|
/**
|
|
125
190
|
* Encode terminate app call data for gas estimation
|
|
126
191
|
*/
|
|
127
|
-
declare function encodeTerminateAppData(appId: AppId):
|
|
192
|
+
declare function encodeTerminateAppData(appId: AppId): Hex;
|
|
128
193
|
interface AppModule {
|
|
129
194
|
create: (opts: CreateAppOpts) => Promise<void>;
|
|
130
195
|
deploy: (opts: DeployAppOpts) => Promise<{
|
|
131
196
|
appId: AppId;
|
|
132
|
-
tx:
|
|
197
|
+
tx: Hex;
|
|
133
198
|
appName: string;
|
|
134
199
|
imageRef: string;
|
|
135
200
|
ipAddress?: string;
|
|
136
201
|
}>;
|
|
137
202
|
upgrade: (appId: AppId, opts: UpgradeAppOpts) => Promise<{
|
|
138
|
-
tx:
|
|
139
|
-
appId:
|
|
203
|
+
tx: Hex;
|
|
204
|
+
appId: AppId;
|
|
140
205
|
imageRef: string;
|
|
141
206
|
}>;
|
|
207
|
+
prepareDeploy: (opts: PrepareDeployOpts) => Promise<{
|
|
208
|
+
prepared: PreparedDeploy;
|
|
209
|
+
gasEstimate: GasEstimate;
|
|
210
|
+
}>;
|
|
211
|
+
executeDeploy: (prepared: PreparedDeploy, gas?: GasOpts) => Promise<ExecuteDeployResult>;
|
|
212
|
+
watchDeployment: (appId: AppId) => Promise<string | undefined>;
|
|
213
|
+
prepareUpgrade: (appId: AppId, opts: PrepareUpgradeOpts) => Promise<{
|
|
214
|
+
prepared: PreparedUpgrade;
|
|
215
|
+
gasEstimate: GasEstimate;
|
|
216
|
+
}>;
|
|
217
|
+
executeUpgrade: (prepared: PreparedUpgrade, gas?: GasOpts) => Promise<ExecuteUpgradeResult>;
|
|
218
|
+
watchUpgrade: (appId: AppId) => Promise<void>;
|
|
219
|
+
setProfile: (appId: AppId, profile: AppProfile) => Promise<AppProfileResponse>;
|
|
142
220
|
logs: (opts: LogsOptions) => Promise<void>;
|
|
143
221
|
start: (appId: AppId, opts?: LifecycleOpts) => Promise<{
|
|
144
|
-
tx:
|
|
222
|
+
tx: Hex | false;
|
|
145
223
|
}>;
|
|
146
224
|
stop: (appId: AppId, opts?: LifecycleOpts) => Promise<{
|
|
147
|
-
tx:
|
|
225
|
+
tx: Hex | false;
|
|
148
226
|
}>;
|
|
149
227
|
terminate: (appId: AppId, opts?: LifecycleOpts) => Promise<{
|
|
150
|
-
tx:
|
|
228
|
+
tx: Hex | false;
|
|
151
229
|
}>;
|
|
152
230
|
isDelegated: () => Promise<boolean>;
|
|
153
231
|
undelegate: () => Promise<{
|
|
154
|
-
tx:
|
|
232
|
+
tx: Hex | false;
|
|
155
233
|
}>;
|
|
156
234
|
}
|
|
157
235
|
interface AppModuleConfig {
|
|
158
236
|
verbose?: boolean;
|
|
159
|
-
privateKey:
|
|
237
|
+
privateKey: Hex;
|
|
160
238
|
rpcUrl: string;
|
|
161
239
|
environment: string;
|
|
162
240
|
clientId?: string;
|
|
@@ -173,7 +251,7 @@ interface ComputeModule {
|
|
|
173
251
|
}
|
|
174
252
|
interface ComputeModuleConfig {
|
|
175
253
|
verbose?: boolean;
|
|
176
|
-
privateKey:
|
|
254
|
+
privateKey: Hex;
|
|
177
255
|
rpcUrl: string;
|
|
178
256
|
environment: string;
|
|
179
257
|
clientId?: string;
|
|
@@ -181,4 +259,4 @@ interface ComputeModuleConfig {
|
|
|
181
259
|
}
|
|
182
260
|
declare function createComputeModule(config: ComputeModuleConfig): ComputeModule;
|
|
183
261
|
|
|
184
|
-
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, 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,
|
|
262
|
+
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 };
|