@layr-labs/ecloud-sdk 0.1.0-dev.1 → 0.1.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.
@@ -0,0 +1,3 @@
1
+ export { A as AppModule, k as AppModuleConfig, C as ComputeModule, e as ComputeModuleConfig, j as createAppModule, d as createComputeModule, f as encodeStartAppData, h as encodeStopAppData, i as encodeTerminateAppData } from './compute-B_ibIORD.cjs';
2
+ import './index-D-SUX3IG.cjs';
3
+ import 'viem';
@@ -0,0 +1,3 @@
1
+ export { A as AppModule, k as AppModuleConfig, C as ComputeModule, e as ComputeModuleConfig, j as createAppModule, d as createComputeModule, f as encodeStartAppData, h as encodeStopAppData, i as encodeTerminateAppData } from './compute-gpepEsn3.js';
2
+ import './index-D-SUX3IG.js';
3
+ import 'viem';
@@ -0,0 +1,16 @@
1
+ import {
2
+ createAppModule,
3
+ createComputeModule,
4
+ encodeStartAppData,
5
+ encodeStopAppData,
6
+ encodeTerminateAppData
7
+ } from "./chunk-RDONKJY6.js";
8
+ import "./chunk-6WSXUSKJ.js";
9
+ export {
10
+ createAppModule,
11
+ createComputeModule,
12
+ encodeStartAppData,
13
+ encodeStopAppData,
14
+ encodeTerminateAppData
15
+ };
16
+ //# sourceMappingURL=compute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,218 @@
1
+ import { Address } from 'viem';
2
+
3
+ /**
4
+ * Core types for ECloud SDK
5
+ */
6
+
7
+ type AppId = Address;
8
+ type logVisibility = "public" | "private" | "off";
9
+ interface DeployAppOpts {
10
+ /** App name - required */
11
+ name: string;
12
+ /** Path to Dockerfile (if building from Dockerfile) - either this or imageRef is required */
13
+ dockerfile?: string;
14
+ /** Path to .env file - optional */
15
+ envFile?: string;
16
+ /** Image reference (registry/path:tag) - either this or dockerfile is required */
17
+ imageRef?: string;
18
+ /** Instance type SKU - required */
19
+ instanceType: string;
20
+ /** Log visibility setting - required */
21
+ logVisibility: logVisibility;
22
+ /** Optional gas params from estimation */
23
+ gas?: {
24
+ maxFeePerGas?: bigint;
25
+ maxPriorityFeePerGas?: bigint;
26
+ };
27
+ }
28
+ interface UpgradeAppOpts {
29
+ /** Path to Dockerfile (if building from Dockerfile) - either this or imageRef is required */
30
+ dockerfile?: string;
31
+ /** Image reference (registry/path:tag) - either this or dockerfile is required */
32
+ imageRef?: string;
33
+ /** Path to .env file - optional */
34
+ envFile?: string;
35
+ /** Instance type SKU - required */
36
+ instanceType: string;
37
+ /** Log visibility setting - required */
38
+ logVisibility: logVisibility;
39
+ gas?: {
40
+ maxFeePerGas?: bigint;
41
+ maxPriorityFeePerGas?: bigint;
42
+ };
43
+ }
44
+ interface LifecycleOpts {
45
+ gas?: {
46
+ maxFeePerGas?: bigint;
47
+ maxPriorityFeePerGas?: bigint;
48
+ };
49
+ }
50
+ interface AppRecord {
51
+ id: AppId;
52
+ owner: `0x${string}`;
53
+ image: string;
54
+ status: "starting" | "running" | "stopped" | "terminated";
55
+ createdAt: number;
56
+ lastUpdatedAt: number;
57
+ }
58
+ interface DeployOptions {
59
+ /** Private key for signing transactions (hex string with or without 0x prefix) - optional, will prompt if not provided */
60
+ privateKey?: string;
61
+ /** RPC URL for blockchain connection - optional, uses environment default if not provided */
62
+ rpcUrl?: string;
63
+ /** Environment name (e.g., 'sepolia', 'mainnet-alpha') - optional, defaults to 'sepolia' */
64
+ environment?: string;
65
+ /** Path to Dockerfile (if building from Dockerfile) */
66
+ dockerfilePath?: string;
67
+ /** Image reference (registry/path:tag) - optional, will prompt if not provided */
68
+ imageRef?: string;
69
+ /** Path to .env file - optional, will use .env if exists or prompt */
70
+ envFilePath?: string;
71
+ /** App name - optional, will prompt if not provided */
72
+ appName?: string;
73
+ /** Instance type - optional, will prompt if not provided */
74
+ instanceType?: string;
75
+ /** Log visibility setting - optional, will prompt if not provided */
76
+ logVisibility?: logVisibility;
77
+ }
78
+ interface DeployResult {
79
+ /** App ID (contract address) */
80
+ appId: string;
81
+ /** App name */
82
+ appName: string;
83
+ /** Final image reference */
84
+ imageRef: string;
85
+ /** IP address (if available) */
86
+ ipAddress?: string;
87
+ /** Transaction hash */
88
+ txHash: `0x${string}`;
89
+ }
90
+ interface EnvironmentConfig {
91
+ name: string;
92
+ build: "dev" | "prod";
93
+ chainID: bigint;
94
+ appControllerAddress: string;
95
+ permissionControllerAddress: string;
96
+ erc7702DelegatorAddress: string;
97
+ kmsServerURL: string;
98
+ userApiServerURL: string;
99
+ defaultRPCURL: string;
100
+ }
101
+ interface Release {
102
+ rmsRelease: {
103
+ artifacts: Array<{
104
+ digest: Uint8Array;
105
+ registry: string;
106
+ }>;
107
+ upgradeByTime: number;
108
+ };
109
+ publicEnv: Uint8Array;
110
+ encryptedEnv: Uint8Array;
111
+ }
112
+ interface ParsedEnvironment {
113
+ public: Record<string, string>;
114
+ private: Record<string, string>;
115
+ }
116
+ interface ImageDigestResult {
117
+ digest: Uint8Array;
118
+ registry: string;
119
+ platform: string;
120
+ }
121
+ interface DockerImageConfig {
122
+ cmd: string[];
123
+ entrypoint: string[];
124
+ user: string;
125
+ labels: Record<string, string>;
126
+ }
127
+ interface Logger {
128
+ debug(message: string, ...args: any[]): void;
129
+ info(message: string, ...args: any[]): void;
130
+ warn(message: string, ...args: any[]): void;
131
+ error(message: string, ...args: any[]): void;
132
+ }
133
+ /**
134
+ * Profile information for an app
135
+ */
136
+ interface AppProfile {
137
+ /** App name (required) */
138
+ name: string;
139
+ /** Website URL (optional) */
140
+ website?: string;
141
+ /** Description (optional) */
142
+ description?: string;
143
+ /** X (Twitter) URL (optional) */
144
+ xURL?: string;
145
+ /** Path to image file (optional) */
146
+ imagePath?: string;
147
+ }
148
+ /**
149
+ * Profile response from API
150
+ */
151
+ interface AppProfileResponse {
152
+ name: string;
153
+ website?: string;
154
+ description?: string;
155
+ xURL?: string;
156
+ imageURL?: string;
157
+ }
158
+ type ProductID = "compute";
159
+ type ChainID = "ethereum-mainnet" | "ethereum-sepolia";
160
+ type SubscriptionStatus = "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused" | "inactive";
161
+ interface SubscriptionLineItem {
162
+ description: string;
163
+ price: number;
164
+ quantity: number;
165
+ currency: string;
166
+ subtotal: number;
167
+ }
168
+ interface CreateSubscriptionResponse {
169
+ checkoutUrl: string;
170
+ }
171
+ interface CheckoutCreatedResponse {
172
+ type: "checkout_created";
173
+ checkoutUrl: string;
174
+ }
175
+ interface AlreadyActiveResponse {
176
+ type: "already_active";
177
+ status: SubscriptionStatus;
178
+ }
179
+ interface PaymentIssueResponse {
180
+ type: "payment_issue";
181
+ status: SubscriptionStatus;
182
+ portalUrl?: string;
183
+ }
184
+ type SubscribeResponse = CheckoutCreatedResponse | AlreadyActiveResponse | PaymentIssueResponse;
185
+ interface CancelSuccessResponse {
186
+ type: "canceled";
187
+ }
188
+ interface NoActiveSubscriptionResponse {
189
+ type: "no_active_subscription";
190
+ status: SubscriptionStatus;
191
+ }
192
+ type CancelResponse = CancelSuccessResponse | NoActiveSubscriptionResponse;
193
+ interface ProductSubscriptionResponse {
194
+ productId: ProductID;
195
+ subscriptionStatus: SubscriptionStatus;
196
+ currentPeriodStart?: string;
197
+ currentPeriodEnd?: string;
198
+ lineItems?: SubscriptionLineItem[];
199
+ upcomingInvoiceSubtotal?: number;
200
+ upcomingInvoiceTotal?: number;
201
+ creditsApplied?: number;
202
+ remainingCredits?: number;
203
+ nextCreditExpiry?: number;
204
+ cancelAtPeriodEnd?: boolean;
205
+ canceledAt?: string;
206
+ portalUrl?: string;
207
+ }
208
+ interface SubscriptionOpts {
209
+ productId?: ProductID;
210
+ }
211
+ interface BillingEnvironmentConfig {
212
+ billingApiServerURL: string;
213
+ }
214
+ interface BillingEnvironmentConfig {
215
+ billingApiServerURL: string;
216
+ }
217
+
218
+ export type { AppId as A, BillingEnvironmentConfig as B, ChainID as C, DeployResult as D, EnvironmentConfig as E, ImageDigestResult as I, Logger as L, NoActiveSubscriptionResponse as N, ParsedEnvironment as P, Release as R, SubscriptionStatus as S, UpgradeAppOpts as U, DeployAppOpts as a, LifecycleOpts as b, AppRecord as c, DeployOptions as d, DockerImageConfig as e, AppProfile as f, AppProfileResponse as g, ProductID as h, SubscriptionLineItem as i, CreateSubscriptionResponse as j, CheckoutCreatedResponse as k, logVisibility as l, AlreadyActiveResponse as m, PaymentIssueResponse as n, SubscribeResponse as o, CancelSuccessResponse as p, CancelResponse as q, ProductSubscriptionResponse as r, SubscriptionOpts as s };
@@ -0,0 +1,218 @@
1
+ import { Address } from 'viem';
2
+
3
+ /**
4
+ * Core types for ECloud SDK
5
+ */
6
+
7
+ type AppId = Address;
8
+ type logVisibility = "public" | "private" | "off";
9
+ interface DeployAppOpts {
10
+ /** App name - required */
11
+ name: string;
12
+ /** Path to Dockerfile (if building from Dockerfile) - either this or imageRef is required */
13
+ dockerfile?: string;
14
+ /** Path to .env file - optional */
15
+ envFile?: string;
16
+ /** Image reference (registry/path:tag) - either this or dockerfile is required */
17
+ imageRef?: string;
18
+ /** Instance type SKU - required */
19
+ instanceType: string;
20
+ /** Log visibility setting - required */
21
+ logVisibility: logVisibility;
22
+ /** Optional gas params from estimation */
23
+ gas?: {
24
+ maxFeePerGas?: bigint;
25
+ maxPriorityFeePerGas?: bigint;
26
+ };
27
+ }
28
+ interface UpgradeAppOpts {
29
+ /** Path to Dockerfile (if building from Dockerfile) - either this or imageRef is required */
30
+ dockerfile?: string;
31
+ /** Image reference (registry/path:tag) - either this or dockerfile is required */
32
+ imageRef?: string;
33
+ /** Path to .env file - optional */
34
+ envFile?: string;
35
+ /** Instance type SKU - required */
36
+ instanceType: string;
37
+ /** Log visibility setting - required */
38
+ logVisibility: logVisibility;
39
+ gas?: {
40
+ maxFeePerGas?: bigint;
41
+ maxPriorityFeePerGas?: bigint;
42
+ };
43
+ }
44
+ interface LifecycleOpts {
45
+ gas?: {
46
+ maxFeePerGas?: bigint;
47
+ maxPriorityFeePerGas?: bigint;
48
+ };
49
+ }
50
+ interface AppRecord {
51
+ id: AppId;
52
+ owner: `0x${string}`;
53
+ image: string;
54
+ status: "starting" | "running" | "stopped" | "terminated";
55
+ createdAt: number;
56
+ lastUpdatedAt: number;
57
+ }
58
+ interface DeployOptions {
59
+ /** Private key for signing transactions (hex string with or without 0x prefix) - optional, will prompt if not provided */
60
+ privateKey?: string;
61
+ /** RPC URL for blockchain connection - optional, uses environment default if not provided */
62
+ rpcUrl?: string;
63
+ /** Environment name (e.g., 'sepolia', 'mainnet-alpha') - optional, defaults to 'sepolia' */
64
+ environment?: string;
65
+ /** Path to Dockerfile (if building from Dockerfile) */
66
+ dockerfilePath?: string;
67
+ /** Image reference (registry/path:tag) - optional, will prompt if not provided */
68
+ imageRef?: string;
69
+ /** Path to .env file - optional, will use .env if exists or prompt */
70
+ envFilePath?: string;
71
+ /** App name - optional, will prompt if not provided */
72
+ appName?: string;
73
+ /** Instance type - optional, will prompt if not provided */
74
+ instanceType?: string;
75
+ /** Log visibility setting - optional, will prompt if not provided */
76
+ logVisibility?: logVisibility;
77
+ }
78
+ interface DeployResult {
79
+ /** App ID (contract address) */
80
+ appId: string;
81
+ /** App name */
82
+ appName: string;
83
+ /** Final image reference */
84
+ imageRef: string;
85
+ /** IP address (if available) */
86
+ ipAddress?: string;
87
+ /** Transaction hash */
88
+ txHash: `0x${string}`;
89
+ }
90
+ interface EnvironmentConfig {
91
+ name: string;
92
+ build: "dev" | "prod";
93
+ chainID: bigint;
94
+ appControllerAddress: string;
95
+ permissionControllerAddress: string;
96
+ erc7702DelegatorAddress: string;
97
+ kmsServerURL: string;
98
+ userApiServerURL: string;
99
+ defaultRPCURL: string;
100
+ }
101
+ interface Release {
102
+ rmsRelease: {
103
+ artifacts: Array<{
104
+ digest: Uint8Array;
105
+ registry: string;
106
+ }>;
107
+ upgradeByTime: number;
108
+ };
109
+ publicEnv: Uint8Array;
110
+ encryptedEnv: Uint8Array;
111
+ }
112
+ interface ParsedEnvironment {
113
+ public: Record<string, string>;
114
+ private: Record<string, string>;
115
+ }
116
+ interface ImageDigestResult {
117
+ digest: Uint8Array;
118
+ registry: string;
119
+ platform: string;
120
+ }
121
+ interface DockerImageConfig {
122
+ cmd: string[];
123
+ entrypoint: string[];
124
+ user: string;
125
+ labels: Record<string, string>;
126
+ }
127
+ interface Logger {
128
+ debug(message: string, ...args: any[]): void;
129
+ info(message: string, ...args: any[]): void;
130
+ warn(message: string, ...args: any[]): void;
131
+ error(message: string, ...args: any[]): void;
132
+ }
133
+ /**
134
+ * Profile information for an app
135
+ */
136
+ interface AppProfile {
137
+ /** App name (required) */
138
+ name: string;
139
+ /** Website URL (optional) */
140
+ website?: string;
141
+ /** Description (optional) */
142
+ description?: string;
143
+ /** X (Twitter) URL (optional) */
144
+ xURL?: string;
145
+ /** Path to image file (optional) */
146
+ imagePath?: string;
147
+ }
148
+ /**
149
+ * Profile response from API
150
+ */
151
+ interface AppProfileResponse {
152
+ name: string;
153
+ website?: string;
154
+ description?: string;
155
+ xURL?: string;
156
+ imageURL?: string;
157
+ }
158
+ type ProductID = "compute";
159
+ type ChainID = "ethereum-mainnet" | "ethereum-sepolia";
160
+ type SubscriptionStatus = "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused" | "inactive";
161
+ interface SubscriptionLineItem {
162
+ description: string;
163
+ price: number;
164
+ quantity: number;
165
+ currency: string;
166
+ subtotal: number;
167
+ }
168
+ interface CreateSubscriptionResponse {
169
+ checkoutUrl: string;
170
+ }
171
+ interface CheckoutCreatedResponse {
172
+ type: "checkout_created";
173
+ checkoutUrl: string;
174
+ }
175
+ interface AlreadyActiveResponse {
176
+ type: "already_active";
177
+ status: SubscriptionStatus;
178
+ }
179
+ interface PaymentIssueResponse {
180
+ type: "payment_issue";
181
+ status: SubscriptionStatus;
182
+ portalUrl?: string;
183
+ }
184
+ type SubscribeResponse = CheckoutCreatedResponse | AlreadyActiveResponse | PaymentIssueResponse;
185
+ interface CancelSuccessResponse {
186
+ type: "canceled";
187
+ }
188
+ interface NoActiveSubscriptionResponse {
189
+ type: "no_active_subscription";
190
+ status: SubscriptionStatus;
191
+ }
192
+ type CancelResponse = CancelSuccessResponse | NoActiveSubscriptionResponse;
193
+ interface ProductSubscriptionResponse {
194
+ productId: ProductID;
195
+ subscriptionStatus: SubscriptionStatus;
196
+ currentPeriodStart?: string;
197
+ currentPeriodEnd?: string;
198
+ lineItems?: SubscriptionLineItem[];
199
+ upcomingInvoiceSubtotal?: number;
200
+ upcomingInvoiceTotal?: number;
201
+ creditsApplied?: number;
202
+ remainingCredits?: number;
203
+ nextCreditExpiry?: number;
204
+ cancelAtPeriodEnd?: boolean;
205
+ canceledAt?: string;
206
+ portalUrl?: string;
207
+ }
208
+ interface SubscriptionOpts {
209
+ productId?: ProductID;
210
+ }
211
+ interface BillingEnvironmentConfig {
212
+ billingApiServerURL: string;
213
+ }
214
+ interface BillingEnvironmentConfig {
215
+ billingApiServerURL: string;
216
+ }
217
+
218
+ export type { AppId as A, BillingEnvironmentConfig as B, ChainID as C, DeployResult as D, EnvironmentConfig as E, ImageDigestResult as I, Logger as L, NoActiveSubscriptionResponse as N, ParsedEnvironment as P, Release as R, SubscriptionStatus as S, UpgradeAppOpts as U, DeployAppOpts as a, LifecycleOpts as b, AppRecord as c, DeployOptions as d, DockerImageConfig as e, AppProfile as f, AppProfileResponse as g, ProductID as h, SubscriptionLineItem as i, CreateSubscriptionResponse as j, CheckoutCreatedResponse as k, logVisibility as l, AlreadyActiveResponse as m, PaymentIssueResponse as n, SubscribeResponse as o, CancelSuccessResponse as p, CancelResponse as q, ProductSubscriptionResponse as r, SubscriptionOpts as s };