@layr-labs/ecloud-sdk 1.0.0-devep8 → 1.0.0
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 +70 -13
- package/dist/billing.cjs.map +1 -1
- package/dist/billing.d.cts +2 -1
- package/dist/billing.d.ts +2 -1
- package/dist/billing.js +70 -13
- package/dist/billing.js.map +1 -1
- package/dist/browser.cjs +1696 -140
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +5 -4
- package/dist/browser.d.ts +5 -4
- package/dist/browser.js +1695 -140
- package/dist/browser.js.map +1 -1
- package/dist/compute-B-V7Dbj9.d.cts +465 -0
- package/dist/compute-BJ_sqrKn.d.ts +465 -0
- package/dist/compute.cjs +1881 -812
- package/dist/compute.cjs.map +1 -1
- package/dist/compute.d.cts +3 -2
- package/dist/compute.d.ts +3 -2
- package/dist/compute.js +1869 -800
- package/dist/compute.js.map +1 -1
- package/dist/{helpers-NGE0oIa9.d.ts → helpers-CkcuSkNM.d.ts} +17 -191
- package/dist/{helpers-0Tz3MuQK.d.cts → helpers-fmu7es2L.d.cts} +17 -191
- package/dist/{index-DFqQ7v8_.d.cts → index-BVnxNfqb.d.cts} +65 -3
- package/dist/{index-DFqQ7v8_.d.ts → index-BVnxNfqb.d.ts} +65 -3
- package/dist/index.cjs +2013 -803
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +72 -240
- package/dist/index.d.ts +72 -240
- package/dist/index.js +1992 -788
- package/dist/index.js.map +1 -1
- package/dist/validation-D3yIUF-Z.d.cts +167 -0
- package/dist/validation-D3yIUF-Z.d.ts +167 -0
- package/package.json +4 -5
- package/dist/compute-DfFZvbPD.d.cts +0 -194
- package/dist/compute-GcTgGp_x.d.ts +0 -194
- package/tools/ecloud-drain-watcher-linux-amd64 +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { F as EnvironmentConfig, aj as SubscriptionStatus, j as BillingEnvironmentConfig, aa as ProductID, q as CreateSubscriptionOptions, r as CreateSubscriptionResponse, O as GetSubscriptionOptions, ab as ProductSubscriptionResponse, Z as PaymentMethodsResponse, s as CreditPurchaseResponse, p as CreateCouponResponse, T as ListCouponsResponse, N as GetCouponResponse, a as AddAdminResponse, S as ListAdminsResponse, ac as RedeemCouponResponse, L as GasEstimate, U as Logger } from './index-BVnxNfqb.js';
|
|
2
|
+
import { Hex, Address, WalletClient, PublicClient, SignAuthorizationReturnType, Chain } from 'viem';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Environment configuration for different networks
|
|
@@ -33,170 +33,6 @@ declare function isEnvironmentAvailable(environment: string): boolean;
|
|
|
33
33
|
*/
|
|
34
34
|
declare function isMainnet(environmentConfig: EnvironmentConfig): boolean;
|
|
35
35
|
|
|
36
|
-
/**
|
|
37
|
-
* Non-interactive validation utilities for SDK
|
|
38
|
-
*
|
|
39
|
-
* These functions validate parameters without any interactive prompts.
|
|
40
|
-
* They either return the validated value or throw an error.
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Validate app name format
|
|
45
|
-
* @throws Error if name is invalid
|
|
46
|
-
*/
|
|
47
|
-
declare function validateAppName(name: string): void;
|
|
48
|
-
/**
|
|
49
|
-
* Validate Docker image reference format
|
|
50
|
-
* @returns true if valid, error message string if invalid
|
|
51
|
-
*/
|
|
52
|
-
declare function validateImageReference(value: string): true | string;
|
|
53
|
-
/**
|
|
54
|
-
* Validate image reference and throw if invalid
|
|
55
|
-
* @throws Error if image reference is invalid
|
|
56
|
-
*/
|
|
57
|
-
declare function assertValidImageReference(value: string): void;
|
|
58
|
-
/**
|
|
59
|
-
* Extract app name from image reference
|
|
60
|
-
*/
|
|
61
|
-
declare function extractAppNameFromImage(imageRef: string): string;
|
|
62
|
-
/**
|
|
63
|
-
* Validate that a file path exists
|
|
64
|
-
* @returns true if valid, error message string if invalid
|
|
65
|
-
*/
|
|
66
|
-
declare function validateFilePath(value: string): true | string;
|
|
67
|
-
/**
|
|
68
|
-
* Validate file path and throw if invalid
|
|
69
|
-
* @throws Error if file path is invalid or doesn't exist
|
|
70
|
-
*/
|
|
71
|
-
declare function assertValidFilePath(value: string): void;
|
|
72
|
-
/**
|
|
73
|
-
* Validate instance type SKU against available types
|
|
74
|
-
* @returns the validated SKU
|
|
75
|
-
* @throws Error if SKU is not in the available types list
|
|
76
|
-
*/
|
|
77
|
-
declare function validateInstanceTypeSKU(sku: string, availableTypes: Array<{
|
|
78
|
-
sku: string;
|
|
79
|
-
}>): string;
|
|
80
|
-
/**
|
|
81
|
-
* Validate private key format
|
|
82
|
-
* Matches Go's common.ValidatePrivateKey() function
|
|
83
|
-
*/
|
|
84
|
-
declare function validatePrivateKeyFormat(key: string): boolean;
|
|
85
|
-
/**
|
|
86
|
-
* Validate private key and throw if invalid
|
|
87
|
-
* @throws Error if private key format is invalid
|
|
88
|
-
*/
|
|
89
|
-
declare function assertValidPrivateKey(key: string): void;
|
|
90
|
-
/**
|
|
91
|
-
* Validate URL format
|
|
92
|
-
* @returns undefined if valid, error message string if invalid
|
|
93
|
-
*/
|
|
94
|
-
declare function validateURL(rawURL: string): string | undefined;
|
|
95
|
-
/**
|
|
96
|
-
* Validate X/Twitter URL format
|
|
97
|
-
* @returns undefined if valid, error message string if invalid
|
|
98
|
-
*/
|
|
99
|
-
declare function validateXURL(rawURL: string): string | undefined;
|
|
100
|
-
/**
|
|
101
|
-
* Validate description length
|
|
102
|
-
* @returns undefined if valid, error message string if invalid
|
|
103
|
-
*/
|
|
104
|
-
declare function validateDescription(description: string): string | undefined;
|
|
105
|
-
/**
|
|
106
|
-
* Validate image file path
|
|
107
|
-
* @returns undefined if valid, error message string if invalid
|
|
108
|
-
*/
|
|
109
|
-
declare function validateImagePath(filePath: string): string | undefined;
|
|
110
|
-
/**
|
|
111
|
-
* Validate and normalize app ID address
|
|
112
|
-
* @param appID - App ID (must be a valid address)
|
|
113
|
-
* @returns Normalized app address
|
|
114
|
-
* @throws Error if app ID is not a valid address
|
|
115
|
-
*
|
|
116
|
-
* Note: Name resolution should be handled by CLI before calling SDK functions.
|
|
117
|
-
* The SDK only accepts resolved addresses.
|
|
118
|
-
*/
|
|
119
|
-
declare function validateAppID(appID: string | Address): Address;
|
|
120
|
-
type LogVisibility = "public" | "private" | "off";
|
|
121
|
-
/**
|
|
122
|
-
* Validate and convert log visibility setting to internal format
|
|
123
|
-
* @param logVisibility - Log visibility setting
|
|
124
|
-
* @returns Object with logRedirect and publicLogs settings
|
|
125
|
-
* @throws Error if log visibility value is invalid
|
|
126
|
-
*/
|
|
127
|
-
declare function validateLogVisibility(logVisibility: LogVisibility): {
|
|
128
|
-
logRedirect: string;
|
|
129
|
-
publicLogs: boolean;
|
|
130
|
-
};
|
|
131
|
-
type ResourceUsageMonitoring = "enable" | "disable";
|
|
132
|
-
/**
|
|
133
|
-
* Validate and convert resource usage monitoring setting to internal format
|
|
134
|
-
* @param resourceUsageMonitoring - Resource usage monitoring setting
|
|
135
|
-
* @returns The resourceUsageAllow value for the Dockerfile label ("always" or "never")
|
|
136
|
-
* @throws Error if resource usage monitoring value is invalid
|
|
137
|
-
*/
|
|
138
|
-
declare function validateResourceUsageMonitoring(resourceUsageMonitoring: ResourceUsageMonitoring | undefined): string;
|
|
139
|
-
/**
|
|
140
|
-
* Sanitize string (HTML escape and trim)
|
|
141
|
-
*/
|
|
142
|
-
declare function sanitizeString(s: string): string;
|
|
143
|
-
/**
|
|
144
|
-
* Sanitize URL (add https:// if missing, validate)
|
|
145
|
-
* @throws Error if URL is invalid after sanitization
|
|
146
|
-
*/
|
|
147
|
-
declare function sanitizeURL(rawURL: string): string;
|
|
148
|
-
/**
|
|
149
|
-
* Sanitize X/Twitter URL (handle username-only input, normalize)
|
|
150
|
-
* @throws Error if URL is invalid after sanitization
|
|
151
|
-
*/
|
|
152
|
-
declare function sanitizeXURL(rawURL: string): string;
|
|
153
|
-
interface DeployParams {
|
|
154
|
-
dockerfilePath?: string;
|
|
155
|
-
imageRef?: string;
|
|
156
|
-
appName: string;
|
|
157
|
-
envFilePath?: string;
|
|
158
|
-
instanceType: string;
|
|
159
|
-
logVisibility: LogVisibility;
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Validate deploy parameters
|
|
163
|
-
* @throws Error if required parameters are missing or invalid
|
|
164
|
-
*/
|
|
165
|
-
declare function validateDeployParams(params: Partial<DeployParams>): void;
|
|
166
|
-
interface UpgradeParams {
|
|
167
|
-
appID: string | Address;
|
|
168
|
-
dockerfilePath?: string;
|
|
169
|
-
imageRef?: string;
|
|
170
|
-
envFilePath?: string;
|
|
171
|
-
instanceType: string;
|
|
172
|
-
logVisibility: LogVisibility;
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Validate upgrade parameters
|
|
176
|
-
* @throws Error if required parameters are missing or invalid
|
|
177
|
-
*/
|
|
178
|
-
declare function validateUpgradeParams(params: Partial<UpgradeParams>): void;
|
|
179
|
-
interface CreateAppParams {
|
|
180
|
-
name: string;
|
|
181
|
-
language: string;
|
|
182
|
-
template?: string;
|
|
183
|
-
templateVersion?: string;
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Validate create app parameters
|
|
187
|
-
* @throws Error if required parameters are missing or invalid
|
|
188
|
-
*/
|
|
189
|
-
declare function validateCreateAppParams(params: Partial<CreateAppParams>): void;
|
|
190
|
-
interface LogsParams {
|
|
191
|
-
appID: string | Address;
|
|
192
|
-
watch?: boolean;
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Validate logs parameters
|
|
196
|
-
* @throws Error if required parameters are missing or invalid
|
|
197
|
-
*/
|
|
198
|
-
declare function validateLogsParams(params: Partial<LogsParams>): void;
|
|
199
|
-
|
|
200
36
|
/**
|
|
201
37
|
* Billing utility functions
|
|
202
38
|
*/
|
|
@@ -349,7 +185,6 @@ interface AppInfo {
|
|
|
349
185
|
status: string;
|
|
350
186
|
ip: string;
|
|
351
187
|
machineType: string;
|
|
352
|
-
hostname?: string;
|
|
353
188
|
profile?: AppProfileInfo;
|
|
354
189
|
metrics?: AppMetrics;
|
|
355
190
|
evmAddresses: DerivedAddress[];
|
|
@@ -367,7 +202,6 @@ interface AppInfoResponse {
|
|
|
367
202
|
app_status: string;
|
|
368
203
|
ip: string;
|
|
369
204
|
machine_type: string;
|
|
370
|
-
hostname?: string;
|
|
371
205
|
profile?: AppProfileInfo;
|
|
372
206
|
metrics?: AppMetrics;
|
|
373
207
|
}>;
|
|
@@ -408,16 +242,6 @@ interface AppResponse {
|
|
|
408
242
|
contractStatus?: AppContractStatus;
|
|
409
243
|
releases: AppRelease[];
|
|
410
244
|
}
|
|
411
|
-
interface DeploymentInfo {
|
|
412
|
-
id: string;
|
|
413
|
-
externalId: string;
|
|
414
|
-
endpoint: string;
|
|
415
|
-
releaseId: string;
|
|
416
|
-
upgradePhase: string;
|
|
417
|
-
replacesDeploymentId: string;
|
|
418
|
-
createdAt: string;
|
|
419
|
-
updatedAt: string;
|
|
420
|
-
}
|
|
421
245
|
/**
|
|
422
246
|
* Options for UserApiClient
|
|
423
247
|
*/
|
|
@@ -477,13 +301,6 @@ declare class UserApiClient {
|
|
|
477
301
|
address: Address;
|
|
478
302
|
status: string;
|
|
479
303
|
}>>;
|
|
480
|
-
/**
|
|
481
|
-
* Get deployments for an app from the gRPC-gateway endpoint.
|
|
482
|
-
* Returns deployment records including upgrade_phase for tracking upgrade progress.
|
|
483
|
-
*
|
|
484
|
-
* Endpoint: GET /v1/apps/:appAddress/deployments
|
|
485
|
-
*/
|
|
486
|
-
getDeployments(appAddress: Address): Promise<DeploymentInfo[]>;
|
|
487
304
|
/**
|
|
488
305
|
* Upload app profile information with optional image
|
|
489
306
|
*
|
|
@@ -511,11 +328,6 @@ declare class UserApiClient {
|
|
|
511
328
|
* Generate authentication headers for UserAPI requests
|
|
512
329
|
*/
|
|
513
330
|
private generateAuthHeaders;
|
|
514
|
-
/**
|
|
515
|
-
* Make an EIP-712 authenticated request to the gRPC-gateway endpoints.
|
|
516
|
-
* Uses the billing/compute auth pattern: Authorization + X-Account + X-Expiry headers.
|
|
517
|
-
*/
|
|
518
|
-
private makeEIP712AuthenticatedRequest;
|
|
519
331
|
/**
|
|
520
332
|
* Login to the compute API using SIWE (Sign-In with Ethereum)
|
|
521
333
|
*
|
|
@@ -825,6 +637,20 @@ declare class BillingApiClient {
|
|
|
825
637
|
cancelSubscription(productId?: ProductID): Promise<void>;
|
|
826
638
|
getPaymentMethods(): Promise<PaymentMethodsResponse>;
|
|
827
639
|
purchaseCredits(amountCents: number, paymentMethodId?: string): Promise<CreditPurchaseResponse>;
|
|
640
|
+
createCoupon(amountCents: number): Promise<CreateCouponResponse>;
|
|
641
|
+
listCoupons(opts?: {
|
|
642
|
+
offset?: number;
|
|
643
|
+
limit?: number;
|
|
644
|
+
active?: boolean;
|
|
645
|
+
redeemed?: boolean;
|
|
646
|
+
}): Promise<ListCouponsResponse>;
|
|
647
|
+
getCoupon(id: string): Promise<GetCouponResponse>;
|
|
648
|
+
deactivateCoupon(id: string): Promise<void>;
|
|
649
|
+
redeemCouponForUser(id: string, address: string): Promise<void>;
|
|
650
|
+
addAdmin(address: string): Promise<AddAdminResponse>;
|
|
651
|
+
removeAdmin(address: string): Promise<void>;
|
|
652
|
+
listAdmins(): Promise<ListAdminsResponse>;
|
|
653
|
+
redeemCoupon(code: string): Promise<RedeemCouponResponse>;
|
|
828
654
|
/**
|
|
829
655
|
* Make an authenticated request to the billing API
|
|
830
656
|
*
|
|
@@ -1017,4 +843,4 @@ declare function addHexPrefix(value: string): Hex;
|
|
|
1017
843
|
*/
|
|
1018
844
|
declare function stripHexPrefix(value: string): string;
|
|
1019
845
|
|
|
1020
|
-
export {
|
|
846
|
+
export { type AppRelease as $, type AppInfo as A, BillingApiClient as B, type ComputeApiConfig as C, getBuildType as D, type EstimateBatchGasOptions as E, getChainFromID as F, type GeneratedKey as G, getComputeApiSession as H, getEnvironmentConfig as I, isBillingSessionValid as J, isEnvironmentAvailable as K, type LoginRequest as L, isMainnet as M, isSessionValid as N, isSiweMessageExpired as O, isSiweMessageNotYetValid as P, isSubscriptionActive as Q, loginToBillingApi as R, type SessionInfo as S, loginToBothApis as T, UserApiClient as U, loginToComputeApi as V, logoutFromBillingApi as W, logoutFromBothApis as X, logoutFromComputeApi as Y, parseSiweMessage as Z, stripHexPrefix as _, SessionError as a, type AppReleaseBuild as a0, type AppResponse as a1, BASE_SEPOLIA_CHAIN_ID as a2, createClients as a3, type SiweMessageParams as b, type AppInfoResponse as c, type AppMetrics as d, type AppProfileInfo as e, type BillingApiClientOptions as f, type BillingApiConfig as g, type BillingLoginRequest as h, type BillingLoginResult as i, BillingSessionError as j, type BillingSessionInfo as k, type ExecuteBatchOptions as l, type Execution as m, type LoginResult as n, type SiweMessageResult as o, type UserApiClientOptions as p, addHexPrefix as q, checkERC7702Delegation as r, createSiweMessage as s, estimateBatchGas as t, executeBatch as u, generateNewPrivateKey as v, generateNonce as w, getAvailableEnvironments as x, getBillingApiSession as y, getBillingEnvironmentConfig as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { F as EnvironmentConfig, aj as SubscriptionStatus, j as BillingEnvironmentConfig, aa as ProductID, q as CreateSubscriptionOptions, r as CreateSubscriptionResponse, O as GetSubscriptionOptions, ab as ProductSubscriptionResponse, Z as PaymentMethodsResponse, s as CreditPurchaseResponse, p as CreateCouponResponse, T as ListCouponsResponse, N as GetCouponResponse, a as AddAdminResponse, S as ListAdminsResponse, ac as RedeemCouponResponse, L as GasEstimate, U as Logger } from './index-BVnxNfqb.cjs';
|
|
2
|
+
import { Hex, Address, WalletClient, PublicClient, SignAuthorizationReturnType, Chain } from 'viem';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Environment configuration for different networks
|
|
@@ -33,170 +33,6 @@ declare function isEnvironmentAvailable(environment: string): boolean;
|
|
|
33
33
|
*/
|
|
34
34
|
declare function isMainnet(environmentConfig: EnvironmentConfig): boolean;
|
|
35
35
|
|
|
36
|
-
/**
|
|
37
|
-
* Non-interactive validation utilities for SDK
|
|
38
|
-
*
|
|
39
|
-
* These functions validate parameters without any interactive prompts.
|
|
40
|
-
* They either return the validated value or throw an error.
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Validate app name format
|
|
45
|
-
* @throws Error if name is invalid
|
|
46
|
-
*/
|
|
47
|
-
declare function validateAppName(name: string): void;
|
|
48
|
-
/**
|
|
49
|
-
* Validate Docker image reference format
|
|
50
|
-
* @returns true if valid, error message string if invalid
|
|
51
|
-
*/
|
|
52
|
-
declare function validateImageReference(value: string): true | string;
|
|
53
|
-
/**
|
|
54
|
-
* Validate image reference and throw if invalid
|
|
55
|
-
* @throws Error if image reference is invalid
|
|
56
|
-
*/
|
|
57
|
-
declare function assertValidImageReference(value: string): void;
|
|
58
|
-
/**
|
|
59
|
-
* Extract app name from image reference
|
|
60
|
-
*/
|
|
61
|
-
declare function extractAppNameFromImage(imageRef: string): string;
|
|
62
|
-
/**
|
|
63
|
-
* Validate that a file path exists
|
|
64
|
-
* @returns true if valid, error message string if invalid
|
|
65
|
-
*/
|
|
66
|
-
declare function validateFilePath(value: string): true | string;
|
|
67
|
-
/**
|
|
68
|
-
* Validate file path and throw if invalid
|
|
69
|
-
* @throws Error if file path is invalid or doesn't exist
|
|
70
|
-
*/
|
|
71
|
-
declare function assertValidFilePath(value: string): void;
|
|
72
|
-
/**
|
|
73
|
-
* Validate instance type SKU against available types
|
|
74
|
-
* @returns the validated SKU
|
|
75
|
-
* @throws Error if SKU is not in the available types list
|
|
76
|
-
*/
|
|
77
|
-
declare function validateInstanceTypeSKU(sku: string, availableTypes: Array<{
|
|
78
|
-
sku: string;
|
|
79
|
-
}>): string;
|
|
80
|
-
/**
|
|
81
|
-
* Validate private key format
|
|
82
|
-
* Matches Go's common.ValidatePrivateKey() function
|
|
83
|
-
*/
|
|
84
|
-
declare function validatePrivateKeyFormat(key: string): boolean;
|
|
85
|
-
/**
|
|
86
|
-
* Validate private key and throw if invalid
|
|
87
|
-
* @throws Error if private key format is invalid
|
|
88
|
-
*/
|
|
89
|
-
declare function assertValidPrivateKey(key: string): void;
|
|
90
|
-
/**
|
|
91
|
-
* Validate URL format
|
|
92
|
-
* @returns undefined if valid, error message string if invalid
|
|
93
|
-
*/
|
|
94
|
-
declare function validateURL(rawURL: string): string | undefined;
|
|
95
|
-
/**
|
|
96
|
-
* Validate X/Twitter URL format
|
|
97
|
-
* @returns undefined if valid, error message string if invalid
|
|
98
|
-
*/
|
|
99
|
-
declare function validateXURL(rawURL: string): string | undefined;
|
|
100
|
-
/**
|
|
101
|
-
* Validate description length
|
|
102
|
-
* @returns undefined if valid, error message string if invalid
|
|
103
|
-
*/
|
|
104
|
-
declare function validateDescription(description: string): string | undefined;
|
|
105
|
-
/**
|
|
106
|
-
* Validate image file path
|
|
107
|
-
* @returns undefined if valid, error message string if invalid
|
|
108
|
-
*/
|
|
109
|
-
declare function validateImagePath(filePath: string): string | undefined;
|
|
110
|
-
/**
|
|
111
|
-
* Validate and normalize app ID address
|
|
112
|
-
* @param appID - App ID (must be a valid address)
|
|
113
|
-
* @returns Normalized app address
|
|
114
|
-
* @throws Error if app ID is not a valid address
|
|
115
|
-
*
|
|
116
|
-
* Note: Name resolution should be handled by CLI before calling SDK functions.
|
|
117
|
-
* The SDK only accepts resolved addresses.
|
|
118
|
-
*/
|
|
119
|
-
declare function validateAppID(appID: string | Address): Address;
|
|
120
|
-
type LogVisibility = "public" | "private" | "off";
|
|
121
|
-
/**
|
|
122
|
-
* Validate and convert log visibility setting to internal format
|
|
123
|
-
* @param logVisibility - Log visibility setting
|
|
124
|
-
* @returns Object with logRedirect and publicLogs settings
|
|
125
|
-
* @throws Error if log visibility value is invalid
|
|
126
|
-
*/
|
|
127
|
-
declare function validateLogVisibility(logVisibility: LogVisibility): {
|
|
128
|
-
logRedirect: string;
|
|
129
|
-
publicLogs: boolean;
|
|
130
|
-
};
|
|
131
|
-
type ResourceUsageMonitoring = "enable" | "disable";
|
|
132
|
-
/**
|
|
133
|
-
* Validate and convert resource usage monitoring setting to internal format
|
|
134
|
-
* @param resourceUsageMonitoring - Resource usage monitoring setting
|
|
135
|
-
* @returns The resourceUsageAllow value for the Dockerfile label ("always" or "never")
|
|
136
|
-
* @throws Error if resource usage monitoring value is invalid
|
|
137
|
-
*/
|
|
138
|
-
declare function validateResourceUsageMonitoring(resourceUsageMonitoring: ResourceUsageMonitoring | undefined): string;
|
|
139
|
-
/**
|
|
140
|
-
* Sanitize string (HTML escape and trim)
|
|
141
|
-
*/
|
|
142
|
-
declare function sanitizeString(s: string): string;
|
|
143
|
-
/**
|
|
144
|
-
* Sanitize URL (add https:// if missing, validate)
|
|
145
|
-
* @throws Error if URL is invalid after sanitization
|
|
146
|
-
*/
|
|
147
|
-
declare function sanitizeURL(rawURL: string): string;
|
|
148
|
-
/**
|
|
149
|
-
* Sanitize X/Twitter URL (handle username-only input, normalize)
|
|
150
|
-
* @throws Error if URL is invalid after sanitization
|
|
151
|
-
*/
|
|
152
|
-
declare function sanitizeXURL(rawURL: string): string;
|
|
153
|
-
interface DeployParams {
|
|
154
|
-
dockerfilePath?: string;
|
|
155
|
-
imageRef?: string;
|
|
156
|
-
appName: string;
|
|
157
|
-
envFilePath?: string;
|
|
158
|
-
instanceType: string;
|
|
159
|
-
logVisibility: LogVisibility;
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Validate deploy parameters
|
|
163
|
-
* @throws Error if required parameters are missing or invalid
|
|
164
|
-
*/
|
|
165
|
-
declare function validateDeployParams(params: Partial<DeployParams>): void;
|
|
166
|
-
interface UpgradeParams {
|
|
167
|
-
appID: string | Address;
|
|
168
|
-
dockerfilePath?: string;
|
|
169
|
-
imageRef?: string;
|
|
170
|
-
envFilePath?: string;
|
|
171
|
-
instanceType: string;
|
|
172
|
-
logVisibility: LogVisibility;
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Validate upgrade parameters
|
|
176
|
-
* @throws Error if required parameters are missing or invalid
|
|
177
|
-
*/
|
|
178
|
-
declare function validateUpgradeParams(params: Partial<UpgradeParams>): void;
|
|
179
|
-
interface CreateAppParams {
|
|
180
|
-
name: string;
|
|
181
|
-
language: string;
|
|
182
|
-
template?: string;
|
|
183
|
-
templateVersion?: string;
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Validate create app parameters
|
|
187
|
-
* @throws Error if required parameters are missing or invalid
|
|
188
|
-
*/
|
|
189
|
-
declare function validateCreateAppParams(params: Partial<CreateAppParams>): void;
|
|
190
|
-
interface LogsParams {
|
|
191
|
-
appID: string | Address;
|
|
192
|
-
watch?: boolean;
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Validate logs parameters
|
|
196
|
-
* @throws Error if required parameters are missing or invalid
|
|
197
|
-
*/
|
|
198
|
-
declare function validateLogsParams(params: Partial<LogsParams>): void;
|
|
199
|
-
|
|
200
36
|
/**
|
|
201
37
|
* Billing utility functions
|
|
202
38
|
*/
|
|
@@ -349,7 +185,6 @@ interface AppInfo {
|
|
|
349
185
|
status: string;
|
|
350
186
|
ip: string;
|
|
351
187
|
machineType: string;
|
|
352
|
-
hostname?: string;
|
|
353
188
|
profile?: AppProfileInfo;
|
|
354
189
|
metrics?: AppMetrics;
|
|
355
190
|
evmAddresses: DerivedAddress[];
|
|
@@ -367,7 +202,6 @@ interface AppInfoResponse {
|
|
|
367
202
|
app_status: string;
|
|
368
203
|
ip: string;
|
|
369
204
|
machine_type: string;
|
|
370
|
-
hostname?: string;
|
|
371
205
|
profile?: AppProfileInfo;
|
|
372
206
|
metrics?: AppMetrics;
|
|
373
207
|
}>;
|
|
@@ -408,16 +242,6 @@ interface AppResponse {
|
|
|
408
242
|
contractStatus?: AppContractStatus;
|
|
409
243
|
releases: AppRelease[];
|
|
410
244
|
}
|
|
411
|
-
interface DeploymentInfo {
|
|
412
|
-
id: string;
|
|
413
|
-
externalId: string;
|
|
414
|
-
endpoint: string;
|
|
415
|
-
releaseId: string;
|
|
416
|
-
upgradePhase: string;
|
|
417
|
-
replacesDeploymentId: string;
|
|
418
|
-
createdAt: string;
|
|
419
|
-
updatedAt: string;
|
|
420
|
-
}
|
|
421
245
|
/**
|
|
422
246
|
* Options for UserApiClient
|
|
423
247
|
*/
|
|
@@ -477,13 +301,6 @@ declare class UserApiClient {
|
|
|
477
301
|
address: Address;
|
|
478
302
|
status: string;
|
|
479
303
|
}>>;
|
|
480
|
-
/**
|
|
481
|
-
* Get deployments for an app from the gRPC-gateway endpoint.
|
|
482
|
-
* Returns deployment records including upgrade_phase for tracking upgrade progress.
|
|
483
|
-
*
|
|
484
|
-
* Endpoint: GET /v1/apps/:appAddress/deployments
|
|
485
|
-
*/
|
|
486
|
-
getDeployments(appAddress: Address): Promise<DeploymentInfo[]>;
|
|
487
304
|
/**
|
|
488
305
|
* Upload app profile information with optional image
|
|
489
306
|
*
|
|
@@ -511,11 +328,6 @@ declare class UserApiClient {
|
|
|
511
328
|
* Generate authentication headers for UserAPI requests
|
|
512
329
|
*/
|
|
513
330
|
private generateAuthHeaders;
|
|
514
|
-
/**
|
|
515
|
-
* Make an EIP-712 authenticated request to the gRPC-gateway endpoints.
|
|
516
|
-
* Uses the billing/compute auth pattern: Authorization + X-Account + X-Expiry headers.
|
|
517
|
-
*/
|
|
518
|
-
private makeEIP712AuthenticatedRequest;
|
|
519
331
|
/**
|
|
520
332
|
* Login to the compute API using SIWE (Sign-In with Ethereum)
|
|
521
333
|
*
|
|
@@ -825,6 +637,20 @@ declare class BillingApiClient {
|
|
|
825
637
|
cancelSubscription(productId?: ProductID): Promise<void>;
|
|
826
638
|
getPaymentMethods(): Promise<PaymentMethodsResponse>;
|
|
827
639
|
purchaseCredits(amountCents: number, paymentMethodId?: string): Promise<CreditPurchaseResponse>;
|
|
640
|
+
createCoupon(amountCents: number): Promise<CreateCouponResponse>;
|
|
641
|
+
listCoupons(opts?: {
|
|
642
|
+
offset?: number;
|
|
643
|
+
limit?: number;
|
|
644
|
+
active?: boolean;
|
|
645
|
+
redeemed?: boolean;
|
|
646
|
+
}): Promise<ListCouponsResponse>;
|
|
647
|
+
getCoupon(id: string): Promise<GetCouponResponse>;
|
|
648
|
+
deactivateCoupon(id: string): Promise<void>;
|
|
649
|
+
redeemCouponForUser(id: string, address: string): Promise<void>;
|
|
650
|
+
addAdmin(address: string): Promise<AddAdminResponse>;
|
|
651
|
+
removeAdmin(address: string): Promise<void>;
|
|
652
|
+
listAdmins(): Promise<ListAdminsResponse>;
|
|
653
|
+
redeemCoupon(code: string): Promise<RedeemCouponResponse>;
|
|
828
654
|
/**
|
|
829
655
|
* Make an authenticated request to the billing API
|
|
830
656
|
*
|
|
@@ -1017,4 +843,4 @@ declare function addHexPrefix(value: string): Hex;
|
|
|
1017
843
|
*/
|
|
1018
844
|
declare function stripHexPrefix(value: string): string;
|
|
1019
845
|
|
|
1020
|
-
export {
|
|
846
|
+
export { type AppRelease as $, type AppInfo as A, BillingApiClient as B, type ComputeApiConfig as C, getBuildType as D, type EstimateBatchGasOptions as E, getChainFromID as F, type GeneratedKey as G, getComputeApiSession as H, getEnvironmentConfig as I, isBillingSessionValid as J, isEnvironmentAvailable as K, type LoginRequest as L, isMainnet as M, isSessionValid as N, isSiweMessageExpired as O, isSiweMessageNotYetValid as P, isSubscriptionActive as Q, loginToBillingApi as R, type SessionInfo as S, loginToBothApis as T, UserApiClient as U, loginToComputeApi as V, logoutFromBillingApi as W, logoutFromBothApis as X, logoutFromComputeApi as Y, parseSiweMessage as Z, stripHexPrefix as _, SessionError as a, type AppReleaseBuild as a0, type AppResponse as a1, BASE_SEPOLIA_CHAIN_ID as a2, createClients as a3, type SiweMessageParams as b, type AppInfoResponse as c, type AppMetrics as d, type AppProfileInfo as e, type BillingApiClientOptions as f, type BillingApiConfig as g, type BillingLoginRequest as h, type BillingLoginResult as i, BillingSessionError as j, type BillingSessionInfo as k, type ExecuteBatchOptions as l, type Execution as m, type LoginResult as n, type SiweMessageResult as o, type UserApiClientOptions as p, addHexPrefix as q, checkERC7702Delegation as r, createSiweMessage as s, estimateBatchGas as t, executeBatch as u, generateNewPrivateKey as v, generateNonce as w, getAvailableEnvironments as x, getBillingApiSession as y, getBillingEnvironmentConfig as z };
|
|
@@ -604,11 +604,20 @@ interface DeployResult {
|
|
|
604
604
|
/** Transaction hash */
|
|
605
605
|
txHash: Hex;
|
|
606
606
|
}
|
|
607
|
+
/**
|
|
608
|
+
* On-chain AppController ABI version for an environment.
|
|
609
|
+
* - "v1.4": 3-field Release struct (sepolia, mainnet-alpha)
|
|
610
|
+
* - "v1.5": 4-field Release struct with containerPolicy (sepolia-dev)
|
|
611
|
+
* Omitted defaults to the latest ("v1.5") in the contract caller.
|
|
612
|
+
*/
|
|
613
|
+
type AppControllerAbiVersion = "v1.4" | "v1.5";
|
|
607
614
|
interface EnvironmentConfig {
|
|
608
615
|
name: string;
|
|
609
616
|
build: "dev" | "prod";
|
|
610
617
|
chainID: bigint;
|
|
611
618
|
appControllerAddress: Address;
|
|
619
|
+
/** Deployed AppController ABI version; selects Release encoding. Defaults to v1.5 when omitted. */
|
|
620
|
+
releaseAbiVersion?: AppControllerAbiVersion;
|
|
612
621
|
permissionControllerAddress: string;
|
|
613
622
|
erc7702DelegatorAddress: string;
|
|
614
623
|
kmsServerURL: string;
|
|
@@ -618,9 +627,28 @@ interface EnvironmentConfig {
|
|
|
618
627
|
usdcCreditsAddress?: Address;
|
|
619
628
|
baseUsdcCreditsAddress?: Address;
|
|
620
629
|
baseRPCURL?: string;
|
|
621
|
-
platformEnv: string;
|
|
622
|
-
appBaseDomain: string;
|
|
623
630
|
}
|
|
631
|
+
interface EnvVar {
|
|
632
|
+
key: string;
|
|
633
|
+
value: string;
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* Container runtime policy attached to a release (AppController v1.5.0+).
|
|
637
|
+
*
|
|
638
|
+
* Added to the on-chain `Release` struct in eigenx-contracts (KMS-006). All
|
|
639
|
+
* fields are optional knobs over the container's entrypoint/runtime; an empty
|
|
640
|
+
* policy (see EMPTY_CONTAINER_POLICY) preserves the image's own
|
|
641
|
+
* CMD/ENTRYPOINT/env.
|
|
642
|
+
*/
|
|
643
|
+
interface ContainerPolicy {
|
|
644
|
+
args: string[];
|
|
645
|
+
cmdOverride: string[];
|
|
646
|
+
env: EnvVar[];
|
|
647
|
+
envOverride: EnvVar[];
|
|
648
|
+
restartPolicy: string;
|
|
649
|
+
}
|
|
650
|
+
/** An empty ContainerPolicy — defers entirely to the image defaults. */
|
|
651
|
+
declare const EMPTY_CONTAINER_POLICY: ContainerPolicy;
|
|
624
652
|
interface Release {
|
|
625
653
|
rmsRelease: {
|
|
626
654
|
artifacts: Array<{
|
|
@@ -631,6 +659,7 @@ interface Release {
|
|
|
631
659
|
};
|
|
632
660
|
publicEnv: Uint8Array;
|
|
633
661
|
encryptedEnv: Uint8Array;
|
|
662
|
+
containerPolicy?: ContainerPolicy;
|
|
634
663
|
}
|
|
635
664
|
interface ParsedEnvironment {
|
|
636
665
|
public: Record<string, string>;
|
|
@@ -795,5 +824,38 @@ interface SequentialDeployResult {
|
|
|
795
824
|
setPublicLogs?: Hex;
|
|
796
825
|
};
|
|
797
826
|
}
|
|
827
|
+
interface AdminCoupon {
|
|
828
|
+
id: string;
|
|
829
|
+
amountCents: number;
|
|
830
|
+
active: boolean;
|
|
831
|
+
redeemedBy: string;
|
|
832
|
+
redeemedAt: string | null;
|
|
833
|
+
createdBy: string;
|
|
834
|
+
createdAt: string;
|
|
835
|
+
}
|
|
836
|
+
interface CreateCouponResponse {
|
|
837
|
+
coupon: AdminCoupon;
|
|
838
|
+
}
|
|
839
|
+
interface ListCouponsResponse {
|
|
840
|
+
coupons: AdminCoupon[];
|
|
841
|
+
total: number;
|
|
842
|
+
}
|
|
843
|
+
interface GetCouponResponse {
|
|
844
|
+
coupon: AdminCoupon;
|
|
845
|
+
}
|
|
846
|
+
interface AdminUser {
|
|
847
|
+
id: string;
|
|
848
|
+
address: string;
|
|
849
|
+
createdAt: string;
|
|
850
|
+
}
|
|
851
|
+
interface AddAdminResponse {
|
|
852
|
+
admin: AdminUser;
|
|
853
|
+
}
|
|
854
|
+
interface ListAdminsResponse {
|
|
855
|
+
admins: AdminUser[];
|
|
856
|
+
}
|
|
857
|
+
interface RedeemCouponResponse {
|
|
858
|
+
amountCents: number;
|
|
859
|
+
}
|
|
798
860
|
|
|
799
|
-
export { type
|
|
861
|
+
export { type PrepareDeployFromVerifiableBuildOpts as $, type AppId as A, type BatchedDeployResult as B, type CalculateAppIDOptions as C, type DeployAppOptions as D, EMPTY_CONTAINER_POLICY as E, type EnvironmentConfig as F, type EstimateGasOptions as G, type ExecuteDeployBatchedOptions as H, type ExecuteDeployResult as I, type ExecuteDeploySequentialOptions as J, type ExecuteUpgradeResult as K, type GasEstimate as L, type GasOpts as M, type GetCouponResponse as N, type GetSubscriptionOptions as O, type ImageDigestResult as P, type IsDelegatedOptions as Q, type LifecycleOpts as R, type ListAdminsResponse as S, type ListCouponsResponse as T, type Logger as U, type NoActiveSubscriptionResponse as V, type ParsedEnvironment as W, type PaymentIssueResponse as X, type PaymentMethod as Y, type PaymentMethodsResponse as Z, type PrepareDeployBatchOptions as _, type AddAdminResponse as a, type PrepareDeployOpts as a0, type PrepareUpgradeBatchOptions as a1, type PrepareUpgradeFromVerifiableBuildOpts as a2, type PrepareUpgradeOpts as a3, type PreparedDeploy as a4, type PreparedDeployBatch as a5, type PreparedDeployData as a6, type PreparedUpgrade as a7, type PreparedUpgradeBatch as a8, type PreparedUpgradeData as a9, getAppsByDeveloper as aA, getBillingType as aB, getMaxActiveAppsPerUser as aC, isDelegated as aD, type logVisibility as aE, noopLogger as aF, prepareDeployBatch as aG, prepareUpgradeBatch as aH, sendAndWaitForTransaction as aI, supportsEIP5792 as aJ, supportsEIP7702 as aK, suspend as aL, undelegate as aM, upgradeApp as aN, getAppLatestReleaseBlockNumbers as aO, getBlockTimestamps as aP, type ProductID as aa, type ProductSubscriptionResponse as ab, type RedeemCouponResponse as ac, type Release as ad, type SendTransactionOptions as ae, type SequentialDeployResult as af, type SubscribeResponse as ag, type SubscriptionLineItem as ah, type SubscriptionOpts as ai, type SubscriptionStatus as aj, type SuspendOptions as ak, type UndelegateOptions as al, type UpgradeAppOptions as am, type UpgradeAppOpts as an, calculateAppID as ao, deployApp as ap, estimateTransactionGas as aq, executeDeployBatch as ar, executeDeployBatched as as, executeDeploySequential as at, executeUpgradeBatch as au, formatETH as av, getActiveAppCount as aw, getAllAppsByDeveloper as ax, getAppsByBillingAccount as ay, getAppsByCreator as az, type AdminCoupon as b, type AdminUser as c, type AlreadyActiveResponse as d, type AppConfig as e, type AppControllerAbiVersion as f, type AppProfile as g, type AppProfileResponse as h, type AppRecord as i, type BillingEnvironmentConfig as j, type CancelResponse as k, type CancelSuccessResponse as l, type ChainID as m, type CheckoutCreatedResponse as n, type ContainerPolicy as o, type CreateCouponResponse as p, type CreateSubscriptionOptions as q, type CreateSubscriptionResponse as r, type CreditPurchaseResponse as s, type DeployAppOpts as t, type DeployOptions as u, type DeployProgressCallback as v, type DeployResult as w, type DeployStep as x, type DockerImageConfig as y, type EnvVar as z };
|