@layr-labs/ecloud-sdk 1.0.0-dev.2 → 1.0.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.
- package/VERSION +2 -2
- package/dist/billing.cjs +49 -6
- 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 +49 -6
- package/dist/billing.js.map +1 -1
- package/dist/browser.cjs +43 -6
- 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 +43 -6
- package/dist/browser.js.map +1 -1
- package/dist/{compute-Cnw6rwSB.d.ts → compute-BbgMH6Ef.d.ts} +1 -1
- package/dist/{compute-Ckyn8ils.d.cts → compute-yAqGf5hM.d.cts} +1 -1
- package/dist/compute.cjs +8 -2
- 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 +8 -2
- package/dist/compute.js.map +1 -1
- package/dist/{helpers-Dj2ME5rp.d.ts → helpers-CnlJ5yPE.d.cts} +5 -1
- package/dist/{helpers-DZL2bg9p.d.cts → helpers-GWlLS3gz.d.ts} +5 -1
- package/dist/{index-U2vKBrry.d.cts → index-Bac4HjC0.d.cts} +17 -1
- package/dist/{index-U2vKBrry.d.ts → index-Bac4HjC0.d.ts} +17 -1
- package/dist/index.cjs +50 -7
- 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 +50 -7
- 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-Bac4HjC0.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-Bac4HjC0.cjs';
|
|
3
|
+
import { C as ComputeApiConfig, S as SessionInfo, a as SessionError, b as SiweMessageParams } from './helpers-CnlJ5yPE.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-CnlJ5yPE.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-Bac4HjC0.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-Bac4HjC0.js';
|
|
3
|
+
import { C as ComputeApiConfig, S as SessionInfo, a as SessionError, b as SiweMessageParams } from './helpers-GWlLS3gz.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-GWlLS3gz.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
|
@@ -246,7 +246,13 @@ function getEnvironmentConfig(environment, chainID) {
|
|
|
246
246
|
return {
|
|
247
247
|
...env,
|
|
248
248
|
chainID: BigInt(resolvedChainID),
|
|
249
|
-
...apiUrlOverride ? { userApiServerURL: apiUrlOverride } : {}
|
|
249
|
+
...apiUrlOverride ? { userApiServerURL: apiUrlOverride } : {},
|
|
250
|
+
...process.env.ECLOUD_USER_API_URL && {
|
|
251
|
+
userApiServerURL: process.env.ECLOUD_USER_API_URL
|
|
252
|
+
},
|
|
253
|
+
...process.env.ECLOUD_RPC_URL && {
|
|
254
|
+
defaultRPCURL: process.env.ECLOUD_RPC_URL
|
|
255
|
+
}
|
|
250
256
|
};
|
|
251
257
|
}
|
|
252
258
|
function getBillingEnvironmentConfig(build) {
|
|
@@ -258,7 +264,12 @@ function getBillingEnvironmentConfig(build) {
|
|
|
258
264
|
if (apiUrlOverride) {
|
|
259
265
|
return { billingApiServerURL: apiUrlOverride };
|
|
260
266
|
}
|
|
261
|
-
return
|
|
267
|
+
return {
|
|
268
|
+
...config,
|
|
269
|
+
...process.env.ECLOUD_BILLING_API_URL && {
|
|
270
|
+
billingApiServerURL: process.env.ECLOUD_BILLING_API_URL
|
|
271
|
+
}
|
|
272
|
+
};
|
|
262
273
|
}
|
|
263
274
|
function getBuildType() {
|
|
264
275
|
const buildTimeType = true ? "dev"?.toLowerCase() : void 0;
|
|
@@ -618,7 +629,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
|
|
|
618
629
|
var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
|
|
619
630
|
var CanUpdateAppProfilePermission = "0x036fef61";
|
|
620
631
|
function getDefaultClientId() {
|
|
621
|
-
const version = true ? "1.0.0-dev.
|
|
632
|
+
const version = true ? "1.0.0-dev.3" : "0.0.0";
|
|
622
633
|
return `ecloud-sdk/v${version}`;
|
|
623
634
|
}
|
|
624
635
|
var UserApiClient = class {
|
|
@@ -1206,6 +1217,20 @@ var BillingApiClient = class {
|
|
|
1206
1217
|
const endpoint = `${this.config.billingApiServerURL}/products/${productId}/subscription`;
|
|
1207
1218
|
await this.makeAuthenticatedRequest(endpoint, "DELETE", productId);
|
|
1208
1219
|
}
|
|
1220
|
+
async getPaymentMethods() {
|
|
1221
|
+
const endpoint = `${this.config.billingApiServerURL}/v1/payment-methods`;
|
|
1222
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
|
|
1223
|
+
return resp.json();
|
|
1224
|
+
}
|
|
1225
|
+
async purchaseCredits(amountCents, paymentMethodId) {
|
|
1226
|
+
const endpoint = `${this.config.billingApiServerURL}/v1/credits/purchase`;
|
|
1227
|
+
const body = { amountCents };
|
|
1228
|
+
if (paymentMethodId) {
|
|
1229
|
+
body.paymentMethodId = paymentMethodId;
|
|
1230
|
+
}
|
|
1231
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", body);
|
|
1232
|
+
return resp.json();
|
|
1233
|
+
}
|
|
1209
1234
|
// ==========================================================================
|
|
1210
1235
|
// Internal Methods
|
|
1211
1236
|
// ==========================================================================
|
|
@@ -1215,10 +1240,22 @@ var BillingApiClient = class {
|
|
|
1215
1240
|
* Uses session auth if useSession is true, otherwise uses EIP-712 signature auth.
|
|
1216
1241
|
*/
|
|
1217
1242
|
async makeAuthenticatedRequest(url, method, productId, body) {
|
|
1218
|
-
if (this.
|
|
1219
|
-
|
|
1243
|
+
if (this.options.verbose) {
|
|
1244
|
+
console.debug(`[BillingAPI] ${method} ${url}`);
|
|
1245
|
+
if (body) {
|
|
1246
|
+
console.debug(`[BillingAPI] Payload:`, JSON.stringify(body, null, 2));
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
const resp = this.useSession ? await this.makeSessionAuthenticatedRequest(url, method, body) : await this.makeSignatureAuthenticatedRequest(url, method, productId, body);
|
|
1250
|
+
if (this.options.verbose) {
|
|
1251
|
+
const data = await resp.json();
|
|
1252
|
+
console.debug(`[BillingAPI] Response:`, JSON.stringify(data, null, 2));
|
|
1253
|
+
return {
|
|
1254
|
+
json: async () => data,
|
|
1255
|
+
text: async () => JSON.stringify(data)
|
|
1256
|
+
};
|
|
1220
1257
|
}
|
|
1221
|
-
return
|
|
1258
|
+
return resp;
|
|
1222
1259
|
}
|
|
1223
1260
|
/**
|
|
1224
1261
|
* Make a request using session-based authentication (cookies)
|