@layr-labs/ecloud-sdk 0.5.0 → 1.0.0-dev.1
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/attest.cjs +31 -9
- package/dist/attest.cjs.map +1 -1
- package/dist/attest.d.cts +3 -2
- package/dist/attest.d.ts +3 -2
- package/dist/attest.js +31 -9
- package/dist/attest.js.map +1 -1
- package/dist/billing.cjs +47 -7
- package/dist/billing.cjs.map +1 -1
- package/dist/billing.d.cts +3 -1
- package/dist/billing.d.ts +3 -1
- package/dist/billing.js +47 -7
- package/dist/billing.js.map +1 -1
- package/dist/browser.cjs +41 -7
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +4 -4
- package/dist/browser.d.ts +4 -4
- package/dist/browser.js +41 -7
- package/dist/browser.js.map +1 -1
- package/dist/{compute-Ckyn8ils.d.cts → compute-Bn6KcW3x.d.cts} +1 -1
- package/dist/{compute-Cnw6rwSB.d.ts → compute-Do2t0Fo8.d.ts} +1 -1
- package/dist/compute.cjs +9 -3
- 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 +9 -3
- package/dist/compute.js.map +1 -1
- package/dist/{helpers-DZL2bg9p.d.cts → helpers-BRamdfGn.d.ts} +5 -1
- package/dist/{helpers-Dj2ME5rp.d.ts → helpers-CfsfcGJO.d.cts} +5 -1
- package/dist/{index-U2vKBrry.d.cts → index-BbH7ZCIu.d.cts} +15 -1
- package/dist/{index-U2vKBrry.d.ts → index-BbH7ZCIu.d.ts} +15 -1
- package/dist/index.cjs +79 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +79 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/browser.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as AppId } from './index-
|
|
2
|
-
export { a as AlreadyActiveResponse, b as AppConfig, c as AppProfile, d as AppProfileResponse, e as AppRecord, B as BatchedDeployResult, f as BillingEnvironmentConfig, C as CalculateAppIDOptions, g as CancelResponse, h as CancelSuccessResponse, i as ChainID, j as CheckoutCreatedResponse, k as CreateSubscriptionOptions, l as CreateSubscriptionResponse, D as DeployAppOptions,
|
|
3
|
-
import { C as ComputeApiConfig, S as SessionInfo, a as SessionError, b as SiweMessageParams } from './helpers-
|
|
4
|
-
export { A as AppInfo, c as AppInfoResponse, d as AppMetrics, e as AppProfileInfo, B as BillingApiClient, f as BillingApiClientOptions, g as BillingApiConfig, h as BillingLoginRequest, i as BillingLoginResult, j as BillingSessionError, k as BillingSessionInfo, l as CreateAppParams, E as EstimateBatchGasOptions, m as ExecuteBatchOptions, n as Execution, G as GeneratedKey, L as LogVisibility, o as LoginRequest, p as LoginResult, q as LogsParams, r as SiweMessageResult, U as UserApiClient, s as UserApiClientOptions, t as addHexPrefix, u as assertValidImageReference, v as assertValidPrivateKey, w as checkERC7702Delegation, x as createSiweMessage, y as estimateBatchGas, z as executeBatch, D as extractAppNameFromImage, F as generateNewPrivateKey, H as generateNonce, I as getAvailableEnvironments, J as getBillingApiSession, K as getBillingEnvironmentConfig, M as getBuildType, N as getChainFromID, O as getComputeApiSession, P as getEnvironmentConfig, Q as isBillingSessionValid, R as isEnvironmentAvailable, T as isMainnet, V as isSessionValid, W as isSiweMessageExpired, X as isSiweMessageNotYetValid, Y as isSubscriptionActive, Z as loginToBillingApi, _ as loginToBothApis, $ as loginToComputeApi, a0 as logoutFromBillingApi, a1 as logoutFromBothApis, a2 as logoutFromComputeApi, a3 as parseSiweMessage, a4 as sanitizeString, a5 as sanitizeURL, a6 as sanitizeXURL, a7 as stripHexPrefix, a8 as validateAppID, a9 as validateAppName, aa as validateCreateAppParams, ab as validateDescription, ac as validateImageReference, ad as validateInstanceTypeSKU, ae as validateLogVisibility, af as validateLogsParams, ag as validatePrivateKeyFormat, ah as validateURL, ai as validateXURL } from './helpers-
|
|
1
|
+
import { A as AppId } from './index-BbH7ZCIu.cjs';
|
|
2
|
+
export { a as AlreadyActiveResponse, b as AppConfig, c as AppProfile, d as AppProfileResponse, e as AppRecord, B as BatchedDeployResult, f as BillingEnvironmentConfig, C as CalculateAppIDOptions, g as CancelResponse, h as CancelSuccessResponse, i as ChainID, j as CheckoutCreatedResponse, k as CreateSubscriptionOptions, l as CreateSubscriptionResponse, m as CreditPurchaseResponse, D as DeployAppOptions, n as DeployAppOpts, o as DeployOptions, p as DeployProgressCallback, q as DeployResult, r as DeployStep, s as DockerImageConfig, E as EnvironmentConfig, t as EstimateGasOptions, u as ExecuteDeployBatchedOptions, v as ExecuteDeployResult, w as ExecuteDeploySequentialOptions, x as ExecuteUpgradeResult, G as GasEstimate, y as GasOpts, z as GetSubscriptionOptions, I as ImageDigestResult, F as IsDelegatedOptions, L as LifecycleOpts, H as Logger, N as NoActiveSubscriptionResponse, P as ParsedEnvironment, J as PaymentIssueResponse, K as PaymentMethod, M as PaymentMethodsResponse, O as PrepareDeployBatchOptions, Q as PrepareDeployFromVerifiableBuildOpts, R as PrepareDeployOpts, S as PrepareUpgradeBatchOptions, T as PrepareUpgradeFromVerifiableBuildOpts, U as PrepareUpgradeOpts, V as PreparedDeploy, W as PreparedDeployBatch, X as PreparedDeployData, Y as PreparedUpgrade, Z as PreparedUpgradeBatch, _ as PreparedUpgradeData, $ as ProductID, a0 as ProductSubscriptionResponse, a1 as Release, a2 as SendTransactionOptions, a3 as SequentialDeployResult, a4 as SubscribeResponse, a5 as SubscriptionLineItem, a6 as SubscriptionOpts, a7 as SubscriptionStatus, a8 as SuspendOptions, a9 as UndelegateOptions, aa as UpgradeAppOptions, ab as UpgradeAppOpts, ac as calculateAppID, ad as deployApp, ae as estimateTransactionGas, af as executeDeployBatch, ag as executeDeployBatched, ah as executeDeploySequential, ai as executeUpgradeBatch, aj as formatETH, ak as getActiveAppCount, al as getAllAppsByDeveloper, am as getAppsByBillingAccount, an as getAppsByCreator, ao as getAppsByDeveloper, ap as getBillingType, aq as getMaxActiveAppsPerUser, ar as isDelegated, as as logVisibility, at as noopLogger, au as prepareDeployBatch, av as prepareUpgradeBatch, aw as sendAndWaitForTransaction, ax as supportsEIP5792, ay as supportsEIP7702, az as suspend, aA as undelegate, aB as upgradeApp } from './index-BbH7ZCIu.cjs';
|
|
3
|
+
import { C as ComputeApiConfig, S as SessionInfo, a as SessionError, b as SiweMessageParams } from './helpers-CfsfcGJO.cjs';
|
|
4
|
+
export { A as AppInfo, c as AppInfoResponse, d as AppMetrics, e as AppProfileInfo, B as BillingApiClient, f as BillingApiClientOptions, g as BillingApiConfig, h as BillingLoginRequest, i as BillingLoginResult, j as BillingSessionError, k as BillingSessionInfo, l as CreateAppParams, E as EstimateBatchGasOptions, m as ExecuteBatchOptions, n as Execution, G as GeneratedKey, L as LogVisibility, o as LoginRequest, p as LoginResult, q as LogsParams, r as SiweMessageResult, U as UserApiClient, s as UserApiClientOptions, t as addHexPrefix, u as assertValidImageReference, v as assertValidPrivateKey, w as checkERC7702Delegation, x as createSiweMessage, y as estimateBatchGas, z as executeBatch, D as extractAppNameFromImage, F as generateNewPrivateKey, H as generateNonce, I as getAvailableEnvironments, J as getBillingApiSession, K as getBillingEnvironmentConfig, M as getBuildType, N as getChainFromID, O as getComputeApiSession, P as getEnvironmentConfig, Q as isBillingSessionValid, R as isEnvironmentAvailable, T as isMainnet, V as isSessionValid, W as isSiweMessageExpired, X as isSiweMessageNotYetValid, Y as isSubscriptionActive, Z as loginToBillingApi, _ as loginToBothApis, $ as loginToComputeApi, a0 as logoutFromBillingApi, a1 as logoutFromBothApis, a2 as logoutFromComputeApi, a3 as parseSiweMessage, a4 as sanitizeString, a5 as sanitizeURL, a6 as sanitizeXURL, a7 as stripHexPrefix, a8 as validateAppID, a9 as validateAppName, aa as validateCreateAppParams, ab as validateDescription, ac as validateImageReference, ad as validateInstanceTypeSKU, ae as validateLogVisibility, af as validateLogsParams, ag as validatePrivateKeyFormat, ah as validateURL, ai as validateXURL } from './helpers-CfsfcGJO.cjs';
|
|
5
5
|
import { WalletClient, Address, Hex } from 'viem';
|
|
6
6
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
7
7
|
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as AppId } from './index-
|
|
2
|
-
export { a as AlreadyActiveResponse, b as AppConfig, c as AppProfile, d as AppProfileResponse, e as AppRecord, B as BatchedDeployResult, f as BillingEnvironmentConfig, C as CalculateAppIDOptions, g as CancelResponse, h as CancelSuccessResponse, i as ChainID, j as CheckoutCreatedResponse, k as CreateSubscriptionOptions, l as CreateSubscriptionResponse, D as DeployAppOptions,
|
|
3
|
-
import { C as ComputeApiConfig, S as SessionInfo, a as SessionError, b as SiweMessageParams } from './helpers-
|
|
4
|
-
export { A as AppInfo, c as AppInfoResponse, d as AppMetrics, e as AppProfileInfo, B as BillingApiClient, f as BillingApiClientOptions, g as BillingApiConfig, h as BillingLoginRequest, i as BillingLoginResult, j as BillingSessionError, k as BillingSessionInfo, l as CreateAppParams, E as EstimateBatchGasOptions, m as ExecuteBatchOptions, n as Execution, G as GeneratedKey, L as LogVisibility, o as LoginRequest, p as LoginResult, q as LogsParams, r as SiweMessageResult, U as UserApiClient, s as UserApiClientOptions, t as addHexPrefix, u as assertValidImageReference, v as assertValidPrivateKey, w as checkERC7702Delegation, x as createSiweMessage, y as estimateBatchGas, z as executeBatch, D as extractAppNameFromImage, F as generateNewPrivateKey, H as generateNonce, I as getAvailableEnvironments, J as getBillingApiSession, K as getBillingEnvironmentConfig, M as getBuildType, N as getChainFromID, O as getComputeApiSession, P as getEnvironmentConfig, Q as isBillingSessionValid, R as isEnvironmentAvailable, T as isMainnet, V as isSessionValid, W as isSiweMessageExpired, X as isSiweMessageNotYetValid, Y as isSubscriptionActive, Z as loginToBillingApi, _ as loginToBothApis, $ as loginToComputeApi, a0 as logoutFromBillingApi, a1 as logoutFromBothApis, a2 as logoutFromComputeApi, a3 as parseSiweMessage, a4 as sanitizeString, a5 as sanitizeURL, a6 as sanitizeXURL, a7 as stripHexPrefix, a8 as validateAppID, a9 as validateAppName, aa as validateCreateAppParams, ab as validateDescription, ac as validateImageReference, ad as validateInstanceTypeSKU, ae as validateLogVisibility, af as validateLogsParams, ag as validatePrivateKeyFormat, ah as validateURL, ai as validateXURL } from './helpers-
|
|
1
|
+
import { A as AppId } from './index-BbH7ZCIu.js';
|
|
2
|
+
export { a as AlreadyActiveResponse, b as AppConfig, c as AppProfile, d as AppProfileResponse, e as AppRecord, B as BatchedDeployResult, f as BillingEnvironmentConfig, C as CalculateAppIDOptions, g as CancelResponse, h as CancelSuccessResponse, i as ChainID, j as CheckoutCreatedResponse, k as CreateSubscriptionOptions, l as CreateSubscriptionResponse, m as CreditPurchaseResponse, D as DeployAppOptions, n as DeployAppOpts, o as DeployOptions, p as DeployProgressCallback, q as DeployResult, r as DeployStep, s as DockerImageConfig, E as EnvironmentConfig, t as EstimateGasOptions, u as ExecuteDeployBatchedOptions, v as ExecuteDeployResult, w as ExecuteDeploySequentialOptions, x as ExecuteUpgradeResult, G as GasEstimate, y as GasOpts, z as GetSubscriptionOptions, I as ImageDigestResult, F as IsDelegatedOptions, L as LifecycleOpts, H as Logger, N as NoActiveSubscriptionResponse, P as ParsedEnvironment, J as PaymentIssueResponse, K as PaymentMethod, M as PaymentMethodsResponse, O as PrepareDeployBatchOptions, Q as PrepareDeployFromVerifiableBuildOpts, R as PrepareDeployOpts, S as PrepareUpgradeBatchOptions, T as PrepareUpgradeFromVerifiableBuildOpts, U as PrepareUpgradeOpts, V as PreparedDeploy, W as PreparedDeployBatch, X as PreparedDeployData, Y as PreparedUpgrade, Z as PreparedUpgradeBatch, _ as PreparedUpgradeData, $ as ProductID, a0 as ProductSubscriptionResponse, a1 as Release, a2 as SendTransactionOptions, a3 as SequentialDeployResult, a4 as SubscribeResponse, a5 as SubscriptionLineItem, a6 as SubscriptionOpts, a7 as SubscriptionStatus, a8 as SuspendOptions, a9 as UndelegateOptions, aa as UpgradeAppOptions, ab as UpgradeAppOpts, ac as calculateAppID, ad as deployApp, ae as estimateTransactionGas, af as executeDeployBatch, ag as executeDeployBatched, ah as executeDeploySequential, ai as executeUpgradeBatch, aj as formatETH, ak as getActiveAppCount, al as getAllAppsByDeveloper, am as getAppsByBillingAccount, an as getAppsByCreator, ao as getAppsByDeveloper, ap as getBillingType, aq as getMaxActiveAppsPerUser, ar as isDelegated, as as logVisibility, at as noopLogger, au as prepareDeployBatch, av as prepareUpgradeBatch, aw as sendAndWaitForTransaction, ax as supportsEIP5792, ay as supportsEIP7702, az as suspend, aA as undelegate, aB as upgradeApp } from './index-BbH7ZCIu.js';
|
|
3
|
+
import { C as ComputeApiConfig, S as SessionInfo, a as SessionError, b as SiweMessageParams } from './helpers-BRamdfGn.js';
|
|
4
|
+
export { A as AppInfo, c as AppInfoResponse, d as AppMetrics, e as AppProfileInfo, B as BillingApiClient, f as BillingApiClientOptions, g as BillingApiConfig, h as BillingLoginRequest, i as BillingLoginResult, j as BillingSessionError, k as BillingSessionInfo, l as CreateAppParams, E as EstimateBatchGasOptions, m as ExecuteBatchOptions, n as Execution, G as GeneratedKey, L as LogVisibility, o as LoginRequest, p as LoginResult, q as LogsParams, r as SiweMessageResult, U as UserApiClient, s as UserApiClientOptions, t as addHexPrefix, u as assertValidImageReference, v as assertValidPrivateKey, w as checkERC7702Delegation, x as createSiweMessage, y as estimateBatchGas, z as executeBatch, D as extractAppNameFromImage, F as generateNewPrivateKey, H as generateNonce, I as getAvailableEnvironments, J as getBillingApiSession, K as getBillingEnvironmentConfig, M as getBuildType, N as getChainFromID, O as getComputeApiSession, P as getEnvironmentConfig, Q as isBillingSessionValid, R as isEnvironmentAvailable, T as isMainnet, V as isSessionValid, W as isSiweMessageExpired, X as isSiweMessageNotYetValid, Y as isSubscriptionActive, Z as loginToBillingApi, _ as loginToBothApis, $ as loginToComputeApi, a0 as logoutFromBillingApi, a1 as logoutFromBothApis, a2 as logoutFromComputeApi, a3 as parseSiweMessage, a4 as sanitizeString, a5 as sanitizeURL, a6 as sanitizeXURL, a7 as stripHexPrefix, a8 as validateAppID, a9 as validateAppName, aa as validateCreateAppParams, ab as validateDescription, ac as validateImageReference, ad as validateInstanceTypeSKU, ae as validateLogVisibility, af as validateLogsParams, ag as validatePrivateKeyFormat, ah as validateURL, ai as validateXURL } from './helpers-BRamdfGn.js';
|
|
5
5
|
import { WalletClient, Address, Hex } from 'viem';
|
|
6
6
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
7
7
|
|
package/dist/browser.js
CHANGED
|
@@ -238,7 +238,13 @@ function getEnvironmentConfig(environment, chainID) {
|
|
|
238
238
|
const resolvedChainID = chainID || (environment === "sepolia" || environment === "sepolia-dev" ? SEPOLIA_CHAIN_ID : MAINNET_CHAIN_ID);
|
|
239
239
|
return {
|
|
240
240
|
...env,
|
|
241
|
-
chainID: BigInt(resolvedChainID)
|
|
241
|
+
chainID: BigInt(resolvedChainID),
|
|
242
|
+
...process.env.ECLOUD_USER_API_URL && {
|
|
243
|
+
userApiServerURL: process.env.ECLOUD_USER_API_URL
|
|
244
|
+
},
|
|
245
|
+
...process.env.ECLOUD_RPC_URL && {
|
|
246
|
+
defaultRPCURL: process.env.ECLOUD_RPC_URL
|
|
247
|
+
}
|
|
242
248
|
};
|
|
243
249
|
}
|
|
244
250
|
function getBillingEnvironmentConfig(build) {
|
|
@@ -246,10 +252,15 @@ function getBillingEnvironmentConfig(build) {
|
|
|
246
252
|
if (!config) {
|
|
247
253
|
throw new Error(`Unknown billing environment: ${build}`);
|
|
248
254
|
}
|
|
249
|
-
return
|
|
255
|
+
return {
|
|
256
|
+
...config,
|
|
257
|
+
...process.env.ECLOUD_BILLING_API_URL && {
|
|
258
|
+
billingApiServerURL: process.env.ECLOUD_BILLING_API_URL
|
|
259
|
+
}
|
|
260
|
+
};
|
|
250
261
|
}
|
|
251
262
|
function getBuildType() {
|
|
252
|
-
const buildTimeType = true ? "
|
|
263
|
+
const buildTimeType = true ? "dev"?.toLowerCase() : void 0;
|
|
253
264
|
const runtimeType = process.env.BUILD_TYPE?.toLowerCase();
|
|
254
265
|
const buildType = buildTimeType || runtimeType;
|
|
255
266
|
if (buildType === "dev") {
|
|
@@ -606,7 +617,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
|
|
|
606
617
|
var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
|
|
607
618
|
var CanUpdateAppProfilePermission = "0x036fef61";
|
|
608
619
|
function getDefaultClientId() {
|
|
609
|
-
const version = true ? "0.
|
|
620
|
+
const version = true ? "1.0.0-dev.1" : "0.0.0";
|
|
610
621
|
return `ecloud-sdk/v${version}`;
|
|
611
622
|
}
|
|
612
623
|
var UserApiClient = class {
|
|
@@ -1194,6 +1205,20 @@ var BillingApiClient = class {
|
|
|
1194
1205
|
const endpoint = `${this.config.billingApiServerURL}/products/${productId}/subscription`;
|
|
1195
1206
|
await this.makeAuthenticatedRequest(endpoint, "DELETE", productId);
|
|
1196
1207
|
}
|
|
1208
|
+
async getPaymentMethods() {
|
|
1209
|
+
const endpoint = `${this.config.billingApiServerURL}/v1/payment-methods`;
|
|
1210
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
|
|
1211
|
+
return resp.json();
|
|
1212
|
+
}
|
|
1213
|
+
async purchaseCredits(amountCents, paymentMethodId) {
|
|
1214
|
+
const endpoint = `${this.config.billingApiServerURL}/v1/credits/purchase`;
|
|
1215
|
+
const body = { amountCents };
|
|
1216
|
+
if (paymentMethodId) {
|
|
1217
|
+
body.paymentMethodId = paymentMethodId;
|
|
1218
|
+
}
|
|
1219
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", body);
|
|
1220
|
+
return resp.json();
|
|
1221
|
+
}
|
|
1197
1222
|
// ==========================================================================
|
|
1198
1223
|
// Internal Methods
|
|
1199
1224
|
// ==========================================================================
|
|
@@ -1203,10 +1228,19 @@ var BillingApiClient = class {
|
|
|
1203
1228
|
* Uses session auth if useSession is true, otherwise uses EIP-712 signature auth.
|
|
1204
1229
|
*/
|
|
1205
1230
|
async makeAuthenticatedRequest(url, method, productId, body) {
|
|
1206
|
-
if (this.
|
|
1207
|
-
|
|
1231
|
+
if (this.options.verbose) {
|
|
1232
|
+
console.debug(`[BillingAPI] ${method} ${url}`);
|
|
1233
|
+
}
|
|
1234
|
+
const resp = this.useSession ? await this.makeSessionAuthenticatedRequest(url, method, body) : await this.makeSignatureAuthenticatedRequest(url, method, productId, body);
|
|
1235
|
+
if (this.options.verbose) {
|
|
1236
|
+
const data = await resp.json();
|
|
1237
|
+
console.debug(`[BillingAPI] Response:`, JSON.stringify(data, null, 2));
|
|
1238
|
+
return {
|
|
1239
|
+
json: async () => data,
|
|
1240
|
+
text: async () => JSON.stringify(data)
|
|
1241
|
+
};
|
|
1208
1242
|
}
|
|
1209
|
-
return
|
|
1243
|
+
return resp;
|
|
1210
1244
|
}
|
|
1211
1245
|
/**
|
|
1212
1246
|
* Make a request using session-based authentication (cookies)
|