@layr-labs/ecloud-sdk 1.0.0-devep7 → 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 +164 -37
- package/dist/billing.cjs.map +1 -1
- package/dist/billing.d.cts +12 -3
- package/dist/billing.d.ts +12 -3
- package/dist/billing.js +164 -37
- package/dist/billing.js.map +1 -1
- package/dist/browser.cjs +1699 -139
- 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 +1699 -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 +1884 -735
- 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 +1873 -724
- package/dist/compute.js.map +1 -1
- package/dist/{helpers-B8KBOdM4.d.ts → helpers-CkcuSkNM.d.ts} +18 -191
- package/dist/{helpers-BVSe7yTf.d.cts → helpers-fmu7es2L.d.cts} +18 -191
- package/dist/{index-XhjPvHIY.d.cts → index-BVnxNfqb.d.cts} +67 -3
- package/dist/{index-XhjPvHIY.d.ts → index-BVnxNfqb.d.ts} +67 -3
- package/dist/index.cjs +2075 -744
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +73 -241
- package/dist/index.d.ts +73 -241
- package/dist/index.js +2054 -730
- 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-2WkiO-d8.d.ts +0 -194
- package/dist/compute-CoBGVJXh.d.cts +0 -194
- package/tools/ecloud-drain-watcher-linux-amd64 +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
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
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
declare const BASE_SEPOLIA_CHAIN_ID = 84532;
|
|
8
9
|
/**
|
|
9
10
|
* Get environment configuration
|
|
10
11
|
*/
|
|
@@ -32,170 +33,6 @@ declare function isEnvironmentAvailable(environment: string): boolean;
|
|
|
32
33
|
*/
|
|
33
34
|
declare function isMainnet(environmentConfig: EnvironmentConfig): boolean;
|
|
34
35
|
|
|
35
|
-
/**
|
|
36
|
-
* Non-interactive validation utilities for SDK
|
|
37
|
-
*
|
|
38
|
-
* These functions validate parameters without any interactive prompts.
|
|
39
|
-
* They either return the validated value or throw an error.
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Validate app name format
|
|
44
|
-
* @throws Error if name is invalid
|
|
45
|
-
*/
|
|
46
|
-
declare function validateAppName(name: string): void;
|
|
47
|
-
/**
|
|
48
|
-
* Validate Docker image reference format
|
|
49
|
-
* @returns true if valid, error message string if invalid
|
|
50
|
-
*/
|
|
51
|
-
declare function validateImageReference(value: string): true | string;
|
|
52
|
-
/**
|
|
53
|
-
* Validate image reference and throw if invalid
|
|
54
|
-
* @throws Error if image reference is invalid
|
|
55
|
-
*/
|
|
56
|
-
declare function assertValidImageReference(value: string): void;
|
|
57
|
-
/**
|
|
58
|
-
* Extract app name from image reference
|
|
59
|
-
*/
|
|
60
|
-
declare function extractAppNameFromImage(imageRef: string): string;
|
|
61
|
-
/**
|
|
62
|
-
* Validate that a file path exists
|
|
63
|
-
* @returns true if valid, error message string if invalid
|
|
64
|
-
*/
|
|
65
|
-
declare function validateFilePath(value: string): true | string;
|
|
66
|
-
/**
|
|
67
|
-
* Validate file path and throw if invalid
|
|
68
|
-
* @throws Error if file path is invalid or doesn't exist
|
|
69
|
-
*/
|
|
70
|
-
declare function assertValidFilePath(value: string): void;
|
|
71
|
-
/**
|
|
72
|
-
* Validate instance type SKU against available types
|
|
73
|
-
* @returns the validated SKU
|
|
74
|
-
* @throws Error if SKU is not in the available types list
|
|
75
|
-
*/
|
|
76
|
-
declare function validateInstanceTypeSKU(sku: string, availableTypes: Array<{
|
|
77
|
-
sku: string;
|
|
78
|
-
}>): string;
|
|
79
|
-
/**
|
|
80
|
-
* Validate private key format
|
|
81
|
-
* Matches Go's common.ValidatePrivateKey() function
|
|
82
|
-
*/
|
|
83
|
-
declare function validatePrivateKeyFormat(key: string): boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Validate private key and throw if invalid
|
|
86
|
-
* @throws Error if private key format is invalid
|
|
87
|
-
*/
|
|
88
|
-
declare function assertValidPrivateKey(key: string): void;
|
|
89
|
-
/**
|
|
90
|
-
* Validate URL format
|
|
91
|
-
* @returns undefined if valid, error message string if invalid
|
|
92
|
-
*/
|
|
93
|
-
declare function validateURL(rawURL: string): string | undefined;
|
|
94
|
-
/**
|
|
95
|
-
* Validate X/Twitter URL format
|
|
96
|
-
* @returns undefined if valid, error message string if invalid
|
|
97
|
-
*/
|
|
98
|
-
declare function validateXURL(rawURL: string): string | undefined;
|
|
99
|
-
/**
|
|
100
|
-
* Validate description length
|
|
101
|
-
* @returns undefined if valid, error message string if invalid
|
|
102
|
-
*/
|
|
103
|
-
declare function validateDescription(description: string): string | undefined;
|
|
104
|
-
/**
|
|
105
|
-
* Validate image file path
|
|
106
|
-
* @returns undefined if valid, error message string if invalid
|
|
107
|
-
*/
|
|
108
|
-
declare function validateImagePath(filePath: string): string | undefined;
|
|
109
|
-
/**
|
|
110
|
-
* Validate and normalize app ID address
|
|
111
|
-
* @param appID - App ID (must be a valid address)
|
|
112
|
-
* @returns Normalized app address
|
|
113
|
-
* @throws Error if app ID is not a valid address
|
|
114
|
-
*
|
|
115
|
-
* Note: Name resolution should be handled by CLI before calling SDK functions.
|
|
116
|
-
* The SDK only accepts resolved addresses.
|
|
117
|
-
*/
|
|
118
|
-
declare function validateAppID(appID: string | Address): Address;
|
|
119
|
-
type LogVisibility = "public" | "private" | "off";
|
|
120
|
-
/**
|
|
121
|
-
* Validate and convert log visibility setting to internal format
|
|
122
|
-
* @param logVisibility - Log visibility setting
|
|
123
|
-
* @returns Object with logRedirect and publicLogs settings
|
|
124
|
-
* @throws Error if log visibility value is invalid
|
|
125
|
-
*/
|
|
126
|
-
declare function validateLogVisibility(logVisibility: LogVisibility): {
|
|
127
|
-
logRedirect: string;
|
|
128
|
-
publicLogs: boolean;
|
|
129
|
-
};
|
|
130
|
-
type ResourceUsageMonitoring = "enable" | "disable";
|
|
131
|
-
/**
|
|
132
|
-
* Validate and convert resource usage monitoring setting to internal format
|
|
133
|
-
* @param resourceUsageMonitoring - Resource usage monitoring setting
|
|
134
|
-
* @returns The resourceUsageAllow value for the Dockerfile label ("always" or "never")
|
|
135
|
-
* @throws Error if resource usage monitoring value is invalid
|
|
136
|
-
*/
|
|
137
|
-
declare function validateResourceUsageMonitoring(resourceUsageMonitoring: ResourceUsageMonitoring | undefined): string;
|
|
138
|
-
/**
|
|
139
|
-
* Sanitize string (HTML escape and trim)
|
|
140
|
-
*/
|
|
141
|
-
declare function sanitizeString(s: string): string;
|
|
142
|
-
/**
|
|
143
|
-
* Sanitize URL (add https:// if missing, validate)
|
|
144
|
-
* @throws Error if URL is invalid after sanitization
|
|
145
|
-
*/
|
|
146
|
-
declare function sanitizeURL(rawURL: string): string;
|
|
147
|
-
/**
|
|
148
|
-
* Sanitize X/Twitter URL (handle username-only input, normalize)
|
|
149
|
-
* @throws Error if URL is invalid after sanitization
|
|
150
|
-
*/
|
|
151
|
-
declare function sanitizeXURL(rawURL: string): string;
|
|
152
|
-
interface DeployParams {
|
|
153
|
-
dockerfilePath?: string;
|
|
154
|
-
imageRef?: string;
|
|
155
|
-
appName: string;
|
|
156
|
-
envFilePath?: string;
|
|
157
|
-
instanceType: string;
|
|
158
|
-
logVisibility: LogVisibility;
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Validate deploy parameters
|
|
162
|
-
* @throws Error if required parameters are missing or invalid
|
|
163
|
-
*/
|
|
164
|
-
declare function validateDeployParams(params: Partial<DeployParams>): void;
|
|
165
|
-
interface UpgradeParams {
|
|
166
|
-
appID: string | Address;
|
|
167
|
-
dockerfilePath?: string;
|
|
168
|
-
imageRef?: string;
|
|
169
|
-
envFilePath?: string;
|
|
170
|
-
instanceType: string;
|
|
171
|
-
logVisibility: LogVisibility;
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Validate upgrade parameters
|
|
175
|
-
* @throws Error if required parameters are missing or invalid
|
|
176
|
-
*/
|
|
177
|
-
declare function validateUpgradeParams(params: Partial<UpgradeParams>): void;
|
|
178
|
-
interface CreateAppParams {
|
|
179
|
-
name: string;
|
|
180
|
-
language: string;
|
|
181
|
-
template?: string;
|
|
182
|
-
templateVersion?: string;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Validate create app parameters
|
|
186
|
-
* @throws Error if required parameters are missing or invalid
|
|
187
|
-
*/
|
|
188
|
-
declare function validateCreateAppParams(params: Partial<CreateAppParams>): void;
|
|
189
|
-
interface LogsParams {
|
|
190
|
-
appID: string | Address;
|
|
191
|
-
watch?: boolean;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Validate logs parameters
|
|
195
|
-
* @throws Error if required parameters are missing or invalid
|
|
196
|
-
*/
|
|
197
|
-
declare function validateLogsParams(params: Partial<LogsParams>): void;
|
|
198
|
-
|
|
199
36
|
/**
|
|
200
37
|
* Billing utility functions
|
|
201
38
|
*/
|
|
@@ -348,7 +185,6 @@ interface AppInfo {
|
|
|
348
185
|
status: string;
|
|
349
186
|
ip: string;
|
|
350
187
|
machineType: string;
|
|
351
|
-
hostname?: string;
|
|
352
188
|
profile?: AppProfileInfo;
|
|
353
189
|
metrics?: AppMetrics;
|
|
354
190
|
evmAddresses: DerivedAddress[];
|
|
@@ -366,7 +202,6 @@ interface AppInfoResponse {
|
|
|
366
202
|
app_status: string;
|
|
367
203
|
ip: string;
|
|
368
204
|
machine_type: string;
|
|
369
|
-
hostname?: string;
|
|
370
205
|
profile?: AppProfileInfo;
|
|
371
206
|
metrics?: AppMetrics;
|
|
372
207
|
}>;
|
|
@@ -407,16 +242,6 @@ interface AppResponse {
|
|
|
407
242
|
contractStatus?: AppContractStatus;
|
|
408
243
|
releases: AppRelease[];
|
|
409
244
|
}
|
|
410
|
-
interface DeploymentInfo {
|
|
411
|
-
id: string;
|
|
412
|
-
externalId: string;
|
|
413
|
-
endpoint: string;
|
|
414
|
-
releaseId: string;
|
|
415
|
-
upgradePhase: string;
|
|
416
|
-
replacesDeploymentId: string;
|
|
417
|
-
createdAt: string;
|
|
418
|
-
updatedAt: string;
|
|
419
|
-
}
|
|
420
245
|
/**
|
|
421
246
|
* Options for UserApiClient
|
|
422
247
|
*/
|
|
@@ -476,13 +301,6 @@ declare class UserApiClient {
|
|
|
476
301
|
address: Address;
|
|
477
302
|
status: string;
|
|
478
303
|
}>>;
|
|
479
|
-
/**
|
|
480
|
-
* Get deployments for an app from the gRPC-gateway endpoint.
|
|
481
|
-
* Returns deployment records including upgrade_phase for tracking upgrade progress.
|
|
482
|
-
*
|
|
483
|
-
* Endpoint: GET /v1/apps/:appAddress/deployments
|
|
484
|
-
*/
|
|
485
|
-
getDeployments(appAddress: Address): Promise<DeploymentInfo[]>;
|
|
486
304
|
/**
|
|
487
305
|
* Upload app profile information with optional image
|
|
488
306
|
*
|
|
@@ -510,11 +328,6 @@ declare class UserApiClient {
|
|
|
510
328
|
* Generate authentication headers for UserAPI requests
|
|
511
329
|
*/
|
|
512
330
|
private generateAuthHeaders;
|
|
513
|
-
/**
|
|
514
|
-
* Make an EIP-712 authenticated request to the gRPC-gateway endpoints.
|
|
515
|
-
* Uses the billing/compute auth pattern: Authorization + X-Account + X-Expiry headers.
|
|
516
|
-
*/
|
|
517
|
-
private makeEIP712AuthenticatedRequest;
|
|
518
331
|
/**
|
|
519
332
|
* Login to the compute API using SIWE (Sign-In with Ethereum)
|
|
520
333
|
*
|
|
@@ -824,6 +637,20 @@ declare class BillingApiClient {
|
|
|
824
637
|
cancelSubscription(productId?: ProductID): Promise<void>;
|
|
825
638
|
getPaymentMethods(): Promise<PaymentMethodsResponse>;
|
|
826
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>;
|
|
827
654
|
/**
|
|
828
655
|
* Make an authenticated request to the billing API
|
|
829
656
|
*
|
|
@@ -1016,4 +843,4 @@ declare function addHexPrefix(value: string): Hex;
|
|
|
1016
843
|
*/
|
|
1017
844
|
declare function stripHexPrefix(value: string): string;
|
|
1018
845
|
|
|
1019
|
-
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,10 +1,11 @@
|
|
|
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
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
declare const BASE_SEPOLIA_CHAIN_ID = 84532;
|
|
8
9
|
/**
|
|
9
10
|
* Get environment configuration
|
|
10
11
|
*/
|
|
@@ -32,170 +33,6 @@ declare function isEnvironmentAvailable(environment: string): boolean;
|
|
|
32
33
|
*/
|
|
33
34
|
declare function isMainnet(environmentConfig: EnvironmentConfig): boolean;
|
|
34
35
|
|
|
35
|
-
/**
|
|
36
|
-
* Non-interactive validation utilities for SDK
|
|
37
|
-
*
|
|
38
|
-
* These functions validate parameters without any interactive prompts.
|
|
39
|
-
* They either return the validated value or throw an error.
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Validate app name format
|
|
44
|
-
* @throws Error if name is invalid
|
|
45
|
-
*/
|
|
46
|
-
declare function validateAppName(name: string): void;
|
|
47
|
-
/**
|
|
48
|
-
* Validate Docker image reference format
|
|
49
|
-
* @returns true if valid, error message string if invalid
|
|
50
|
-
*/
|
|
51
|
-
declare function validateImageReference(value: string): true | string;
|
|
52
|
-
/**
|
|
53
|
-
* Validate image reference and throw if invalid
|
|
54
|
-
* @throws Error if image reference is invalid
|
|
55
|
-
*/
|
|
56
|
-
declare function assertValidImageReference(value: string): void;
|
|
57
|
-
/**
|
|
58
|
-
* Extract app name from image reference
|
|
59
|
-
*/
|
|
60
|
-
declare function extractAppNameFromImage(imageRef: string): string;
|
|
61
|
-
/**
|
|
62
|
-
* Validate that a file path exists
|
|
63
|
-
* @returns true if valid, error message string if invalid
|
|
64
|
-
*/
|
|
65
|
-
declare function validateFilePath(value: string): true | string;
|
|
66
|
-
/**
|
|
67
|
-
* Validate file path and throw if invalid
|
|
68
|
-
* @throws Error if file path is invalid or doesn't exist
|
|
69
|
-
*/
|
|
70
|
-
declare function assertValidFilePath(value: string): void;
|
|
71
|
-
/**
|
|
72
|
-
* Validate instance type SKU against available types
|
|
73
|
-
* @returns the validated SKU
|
|
74
|
-
* @throws Error if SKU is not in the available types list
|
|
75
|
-
*/
|
|
76
|
-
declare function validateInstanceTypeSKU(sku: string, availableTypes: Array<{
|
|
77
|
-
sku: string;
|
|
78
|
-
}>): string;
|
|
79
|
-
/**
|
|
80
|
-
* Validate private key format
|
|
81
|
-
* Matches Go's common.ValidatePrivateKey() function
|
|
82
|
-
*/
|
|
83
|
-
declare function validatePrivateKeyFormat(key: string): boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Validate private key and throw if invalid
|
|
86
|
-
* @throws Error if private key format is invalid
|
|
87
|
-
*/
|
|
88
|
-
declare function assertValidPrivateKey(key: string): void;
|
|
89
|
-
/**
|
|
90
|
-
* Validate URL format
|
|
91
|
-
* @returns undefined if valid, error message string if invalid
|
|
92
|
-
*/
|
|
93
|
-
declare function validateURL(rawURL: string): string | undefined;
|
|
94
|
-
/**
|
|
95
|
-
* Validate X/Twitter URL format
|
|
96
|
-
* @returns undefined if valid, error message string if invalid
|
|
97
|
-
*/
|
|
98
|
-
declare function validateXURL(rawURL: string): string | undefined;
|
|
99
|
-
/**
|
|
100
|
-
* Validate description length
|
|
101
|
-
* @returns undefined if valid, error message string if invalid
|
|
102
|
-
*/
|
|
103
|
-
declare function validateDescription(description: string): string | undefined;
|
|
104
|
-
/**
|
|
105
|
-
* Validate image file path
|
|
106
|
-
* @returns undefined if valid, error message string if invalid
|
|
107
|
-
*/
|
|
108
|
-
declare function validateImagePath(filePath: string): string | undefined;
|
|
109
|
-
/**
|
|
110
|
-
* Validate and normalize app ID address
|
|
111
|
-
* @param appID - App ID (must be a valid address)
|
|
112
|
-
* @returns Normalized app address
|
|
113
|
-
* @throws Error if app ID is not a valid address
|
|
114
|
-
*
|
|
115
|
-
* Note: Name resolution should be handled by CLI before calling SDK functions.
|
|
116
|
-
* The SDK only accepts resolved addresses.
|
|
117
|
-
*/
|
|
118
|
-
declare function validateAppID(appID: string | Address): Address;
|
|
119
|
-
type LogVisibility = "public" | "private" | "off";
|
|
120
|
-
/**
|
|
121
|
-
* Validate and convert log visibility setting to internal format
|
|
122
|
-
* @param logVisibility - Log visibility setting
|
|
123
|
-
* @returns Object with logRedirect and publicLogs settings
|
|
124
|
-
* @throws Error if log visibility value is invalid
|
|
125
|
-
*/
|
|
126
|
-
declare function validateLogVisibility(logVisibility: LogVisibility): {
|
|
127
|
-
logRedirect: string;
|
|
128
|
-
publicLogs: boolean;
|
|
129
|
-
};
|
|
130
|
-
type ResourceUsageMonitoring = "enable" | "disable";
|
|
131
|
-
/**
|
|
132
|
-
* Validate and convert resource usage monitoring setting to internal format
|
|
133
|
-
* @param resourceUsageMonitoring - Resource usage monitoring setting
|
|
134
|
-
* @returns The resourceUsageAllow value for the Dockerfile label ("always" or "never")
|
|
135
|
-
* @throws Error if resource usage monitoring value is invalid
|
|
136
|
-
*/
|
|
137
|
-
declare function validateResourceUsageMonitoring(resourceUsageMonitoring: ResourceUsageMonitoring | undefined): string;
|
|
138
|
-
/**
|
|
139
|
-
* Sanitize string (HTML escape and trim)
|
|
140
|
-
*/
|
|
141
|
-
declare function sanitizeString(s: string): string;
|
|
142
|
-
/**
|
|
143
|
-
* Sanitize URL (add https:// if missing, validate)
|
|
144
|
-
* @throws Error if URL is invalid after sanitization
|
|
145
|
-
*/
|
|
146
|
-
declare function sanitizeURL(rawURL: string): string;
|
|
147
|
-
/**
|
|
148
|
-
* Sanitize X/Twitter URL (handle username-only input, normalize)
|
|
149
|
-
* @throws Error if URL is invalid after sanitization
|
|
150
|
-
*/
|
|
151
|
-
declare function sanitizeXURL(rawURL: string): string;
|
|
152
|
-
interface DeployParams {
|
|
153
|
-
dockerfilePath?: string;
|
|
154
|
-
imageRef?: string;
|
|
155
|
-
appName: string;
|
|
156
|
-
envFilePath?: string;
|
|
157
|
-
instanceType: string;
|
|
158
|
-
logVisibility: LogVisibility;
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Validate deploy parameters
|
|
162
|
-
* @throws Error if required parameters are missing or invalid
|
|
163
|
-
*/
|
|
164
|
-
declare function validateDeployParams(params: Partial<DeployParams>): void;
|
|
165
|
-
interface UpgradeParams {
|
|
166
|
-
appID: string | Address;
|
|
167
|
-
dockerfilePath?: string;
|
|
168
|
-
imageRef?: string;
|
|
169
|
-
envFilePath?: string;
|
|
170
|
-
instanceType: string;
|
|
171
|
-
logVisibility: LogVisibility;
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Validate upgrade parameters
|
|
175
|
-
* @throws Error if required parameters are missing or invalid
|
|
176
|
-
*/
|
|
177
|
-
declare function validateUpgradeParams(params: Partial<UpgradeParams>): void;
|
|
178
|
-
interface CreateAppParams {
|
|
179
|
-
name: string;
|
|
180
|
-
language: string;
|
|
181
|
-
template?: string;
|
|
182
|
-
templateVersion?: string;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Validate create app parameters
|
|
186
|
-
* @throws Error if required parameters are missing or invalid
|
|
187
|
-
*/
|
|
188
|
-
declare function validateCreateAppParams(params: Partial<CreateAppParams>): void;
|
|
189
|
-
interface LogsParams {
|
|
190
|
-
appID: string | Address;
|
|
191
|
-
watch?: boolean;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Validate logs parameters
|
|
195
|
-
* @throws Error if required parameters are missing or invalid
|
|
196
|
-
*/
|
|
197
|
-
declare function validateLogsParams(params: Partial<LogsParams>): void;
|
|
198
|
-
|
|
199
36
|
/**
|
|
200
37
|
* Billing utility functions
|
|
201
38
|
*/
|
|
@@ -348,7 +185,6 @@ interface AppInfo {
|
|
|
348
185
|
status: string;
|
|
349
186
|
ip: string;
|
|
350
187
|
machineType: string;
|
|
351
|
-
hostname?: string;
|
|
352
188
|
profile?: AppProfileInfo;
|
|
353
189
|
metrics?: AppMetrics;
|
|
354
190
|
evmAddresses: DerivedAddress[];
|
|
@@ -366,7 +202,6 @@ interface AppInfoResponse {
|
|
|
366
202
|
app_status: string;
|
|
367
203
|
ip: string;
|
|
368
204
|
machine_type: string;
|
|
369
|
-
hostname?: string;
|
|
370
205
|
profile?: AppProfileInfo;
|
|
371
206
|
metrics?: AppMetrics;
|
|
372
207
|
}>;
|
|
@@ -407,16 +242,6 @@ interface AppResponse {
|
|
|
407
242
|
contractStatus?: AppContractStatus;
|
|
408
243
|
releases: AppRelease[];
|
|
409
244
|
}
|
|
410
|
-
interface DeploymentInfo {
|
|
411
|
-
id: string;
|
|
412
|
-
externalId: string;
|
|
413
|
-
endpoint: string;
|
|
414
|
-
releaseId: string;
|
|
415
|
-
upgradePhase: string;
|
|
416
|
-
replacesDeploymentId: string;
|
|
417
|
-
createdAt: string;
|
|
418
|
-
updatedAt: string;
|
|
419
|
-
}
|
|
420
245
|
/**
|
|
421
246
|
* Options for UserApiClient
|
|
422
247
|
*/
|
|
@@ -476,13 +301,6 @@ declare class UserApiClient {
|
|
|
476
301
|
address: Address;
|
|
477
302
|
status: string;
|
|
478
303
|
}>>;
|
|
479
|
-
/**
|
|
480
|
-
* Get deployments for an app from the gRPC-gateway endpoint.
|
|
481
|
-
* Returns deployment records including upgrade_phase for tracking upgrade progress.
|
|
482
|
-
*
|
|
483
|
-
* Endpoint: GET /v1/apps/:appAddress/deployments
|
|
484
|
-
*/
|
|
485
|
-
getDeployments(appAddress: Address): Promise<DeploymentInfo[]>;
|
|
486
304
|
/**
|
|
487
305
|
* Upload app profile information with optional image
|
|
488
306
|
*
|
|
@@ -510,11 +328,6 @@ declare class UserApiClient {
|
|
|
510
328
|
* Generate authentication headers for UserAPI requests
|
|
511
329
|
*/
|
|
512
330
|
private generateAuthHeaders;
|
|
513
|
-
/**
|
|
514
|
-
* Make an EIP-712 authenticated request to the gRPC-gateway endpoints.
|
|
515
|
-
* Uses the billing/compute auth pattern: Authorization + X-Account + X-Expiry headers.
|
|
516
|
-
*/
|
|
517
|
-
private makeEIP712AuthenticatedRequest;
|
|
518
331
|
/**
|
|
519
332
|
* Login to the compute API using SIWE (Sign-In with Ethereum)
|
|
520
333
|
*
|
|
@@ -824,6 +637,20 @@ declare class BillingApiClient {
|
|
|
824
637
|
cancelSubscription(productId?: ProductID): Promise<void>;
|
|
825
638
|
getPaymentMethods(): Promise<PaymentMethodsResponse>;
|
|
826
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>;
|
|
827
654
|
/**
|
|
828
655
|
* Make an authenticated request to the billing API
|
|
829
656
|
*
|
|
@@ -1016,4 +843,4 @@ declare function addHexPrefix(value: string): Hex;
|
|
|
1016
843
|
*/
|
|
1017
844
|
declare function stripHexPrefix(value: string): string;
|
|
1018
845
|
|
|
1019
|
-
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;
|
|
@@ -616,9 +625,30 @@ interface EnvironmentConfig {
|
|
|
616
625
|
defaultRPCURL: string;
|
|
617
626
|
billingRPCURL?: string;
|
|
618
627
|
usdcCreditsAddress?: Address;
|
|
619
|
-
|
|
620
|
-
|
|
628
|
+
baseUsdcCreditsAddress?: Address;
|
|
629
|
+
baseRPCURL?: string;
|
|
630
|
+
}
|
|
631
|
+
interface EnvVar {
|
|
632
|
+
key: string;
|
|
633
|
+
value: string;
|
|
621
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;
|
|
622
652
|
interface Release {
|
|
623
653
|
rmsRelease: {
|
|
624
654
|
artifacts: Array<{
|
|
@@ -629,6 +659,7 @@ interface Release {
|
|
|
629
659
|
};
|
|
630
660
|
publicEnv: Uint8Array;
|
|
631
661
|
encryptedEnv: Uint8Array;
|
|
662
|
+
containerPolicy?: ContainerPolicy;
|
|
632
663
|
}
|
|
633
664
|
interface ParsedEnvironment {
|
|
634
665
|
public: Record<string, string>;
|
|
@@ -793,5 +824,38 @@ interface SequentialDeployResult {
|
|
|
793
824
|
setPublicLogs?: Hex;
|
|
794
825
|
};
|
|
795
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
|
+
}
|
|
796
860
|
|
|
797
|
-
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 };
|