@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/index.d.cts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { C as ComputeModule } from './compute-
|
|
2
|
-
export { a as ComputeModuleConfig, b as CreateAppOpts, L as LogsOptions, P as PRIMARY_LANGUAGES, S as SDKCreateAppOpts, c as createApp, d as createComputeModule, e as encodeStartAppData, f as encodeStopAppData, g as encodeTerminateAppData, h as getAvailableTemplates, l as logs } from './compute-
|
|
1
|
+
import { C as ComputeModule } from './compute-yAqGf5hM.cjs';
|
|
2
|
+
export { a as ComputeModuleConfig, b as CreateAppOpts, L as LogsOptions, P as PRIMARY_LANGUAGES, S as SDKCreateAppOpts, c as createApp, d as createComputeModule, e as encodeStartAppData, f as encodeStopAppData, g as encodeTerminateAppData, h as getAvailableTemplates, l as logs } from './compute-yAqGf5hM.cjs';
|
|
3
3
|
import { BillingModule } from './billing.cjs';
|
|
4
4
|
export { BillingModuleConfig, createBillingModule } from './billing.cjs';
|
|
5
5
|
import { WalletClient, PublicClient, Address, Hex } from 'viem';
|
|
6
6
|
export { AttestClient, AttestClientConfig, JwtProvider } from './attest.cjs';
|
|
7
|
-
import {
|
|
8
|
-
export { a as AlreadyActiveResponse, c as AppProfile, d as AppProfileResponse, e as AppRecord, f as BillingEnvironmentConfig, g as CancelResponse, h as CancelSuccessResponse, i as ChainID, j as CheckoutCreatedResponse, k as CreateSubscriptionOptions, l as CreateSubscriptionResponse, m as
|
|
9
|
-
import { L as LogVisibility, aj as ResourceUsageMonitoring } from './helpers-
|
|
10
|
-
export { A as AppInfo, d as AppMetrics, e as AppProfileInfo, ak as AppRelease, al as AppReleaseBuild, am as AppResponse, B as BillingApiClient, C as ComputeApiConfig, l as CreateAppParams, an as DeployParams, E as EstimateBatchGasOptions, G as GeneratedKey, o as LoginRequest, p as LoginResult, q as LogsParams, a as SessionError, S as SessionInfo, b as SiweMessageParams, r as SiweMessageResult, ao as UpgradeParams, U as UserApiClient, t as addHexPrefix, ap as assertValidFilePath, u as assertValidImageReference, v as assertValidPrivateKey, w as checkERC7702Delegation, x as createSiweMessage, aq as createViemClients, y as estimateBatchGas, D as extractAppNameFromImage, F as generateNewPrivateKey, H as generateNonce, I as getAvailableEnvironments, K as getBillingEnvironmentConfig, M as getBuildType, N as getChainFromID, O as getComputeApiSession, P as getEnvironmentConfig, R as isEnvironmentAvailable, T as isMainnet, V as isSessionValid, W as isSiweMessageExpired, X as isSiweMessageNotYetValid, Y as isSubscriptionActive, $ as loginToComputeApi, 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, ar as validateDeployParams, ab as validateDescription, as as validateFilePath, at as validateImagePath, ac as validateImageReference, ad as validateInstanceTypeSKU, ae as validateLogVisibility, af as validateLogsParams, ag as validatePrivateKeyFormat, au as validateResourceUsageMonitoring, ah as validateURL, av as validateUpgradeParams, ai as validateXURL } from './helpers-
|
|
7
|
+
import { V as PreparedDeploy, G as GasEstimate, E as EnvironmentConfig, H as Logger, q as DeployResult, Y as PreparedUpgrade, A as AppId } from './index-Bac4HjC0.cjs';
|
|
8
|
+
export { a as AlreadyActiveResponse, c as AppProfile, d as AppProfileResponse, e as AppRecord, f as BillingEnvironmentConfig, g as CancelResponse, h as CancelSuccessResponse, i as ChainID, j as CheckoutCreatedResponse, k as CreateSubscriptionOptions, l as CreateSubscriptionResponse, m as CreditPurchaseResponse, n as DeployAppOpts, o as DeployOptions, p as DeployProgressCallback, r as DeployStep, s as DockerImageConfig, t as EstimateGasOptions, v as ExecuteDeployResult, x as ExecuteUpgradeResult, y as GasOpts, z as GetSubscriptionOptions, I as ImageDigestResult, L as LifecycleOpts, N as NoActiveSubscriptionResponse, P as ParsedEnvironment, J as PaymentIssueResponse, K as PaymentMethod, M as PaymentMethodsResponse, Q as PrepareDeployFromVerifiableBuildOpts, R as PrepareDeployOpts, T as PrepareUpgradeFromVerifiableBuildOpts, U as PrepareUpgradeOpts, X as PreparedDeployData, _ as PreparedUpgradeData, $ as ProductID, a0 as ProductSubscriptionResponse, a1 as Release, a3 as SequentialDeployResult, a4 as SubscribeResponse, a5 as SubscriptionLineItem, a6 as SubscriptionOpts, a7 as SubscriptionStatus, ab as UpgradeAppOpts, ac as calculateAppID, ae as estimateTransactionGas, aj as formatETH, al as getAllAppsByDeveloper, aC as getAppLatestReleaseBlockNumbers, am as getAppsByBillingAccount, ap as getBillingType, aD as getBlockTimestamps, as as logVisibility, at as noopLogger } from './index-Bac4HjC0.cjs';
|
|
9
|
+
import { L as LogVisibility, aj as ResourceUsageMonitoring } from './helpers-CnlJ5yPE.cjs';
|
|
10
|
+
export { A as AppInfo, d as AppMetrics, e as AppProfileInfo, ak as AppRelease, al as AppReleaseBuild, am as AppResponse, B as BillingApiClient, C as ComputeApiConfig, l as CreateAppParams, an as DeployParams, E as EstimateBatchGasOptions, G as GeneratedKey, o as LoginRequest, p as LoginResult, q as LogsParams, a as SessionError, S as SessionInfo, b as SiweMessageParams, r as SiweMessageResult, ao as UpgradeParams, U as UserApiClient, t as addHexPrefix, ap as assertValidFilePath, u as assertValidImageReference, v as assertValidPrivateKey, w as checkERC7702Delegation, x as createSiweMessage, aq as createViemClients, y as estimateBatchGas, D as extractAppNameFromImage, F as generateNewPrivateKey, H as generateNonce, I as getAvailableEnvironments, K as getBillingEnvironmentConfig, M as getBuildType, N as getChainFromID, O as getComputeApiSession, P as getEnvironmentConfig, R as isEnvironmentAvailable, T as isMainnet, V as isSessionValid, W as isSiweMessageExpired, X as isSiweMessageNotYetValid, Y as isSubscriptionActive, $ as loginToComputeApi, 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, ar as validateDeployParams, ab as validateDescription, as as validateFilePath, at as validateImagePath, ac as validateImageReference, ad as validateInstanceTypeSKU, ae as validateLogVisibility, af as validateLogsParams, ag as validatePrivateKeyFormat, au as validateResourceUsageMonitoring, ah as validateURL, av as validateUpgradeParams, ai as validateXURL } from './helpers-CnlJ5yPE.cjs';
|
|
11
11
|
|
|
12
12
|
interface SubmitBuildRequest {
|
|
13
13
|
repoUrl: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { C as ComputeModule } from './compute-
|
|
2
|
-
export { a as ComputeModuleConfig, b as CreateAppOpts, L as LogsOptions, P as PRIMARY_LANGUAGES, S as SDKCreateAppOpts, c as createApp, d as createComputeModule, e as encodeStartAppData, f as encodeStopAppData, g as encodeTerminateAppData, h as getAvailableTemplates, l as logs } from './compute-
|
|
1
|
+
import { C as ComputeModule } from './compute-BbgMH6Ef.js';
|
|
2
|
+
export { a as ComputeModuleConfig, b as CreateAppOpts, L as LogsOptions, P as PRIMARY_LANGUAGES, S as SDKCreateAppOpts, c as createApp, d as createComputeModule, e as encodeStartAppData, f as encodeStopAppData, g as encodeTerminateAppData, h as getAvailableTemplates, l as logs } from './compute-BbgMH6Ef.js';
|
|
3
3
|
import { BillingModule } from './billing.js';
|
|
4
4
|
export { BillingModuleConfig, createBillingModule } from './billing.js';
|
|
5
5
|
import { WalletClient, PublicClient, Address, Hex } from 'viem';
|
|
6
6
|
export { AttestClient, AttestClientConfig, JwtProvider } from './attest.js';
|
|
7
|
-
import {
|
|
8
|
-
export { a as AlreadyActiveResponse, c as AppProfile, d as AppProfileResponse, e as AppRecord, f as BillingEnvironmentConfig, g as CancelResponse, h as CancelSuccessResponse, i as ChainID, j as CheckoutCreatedResponse, k as CreateSubscriptionOptions, l as CreateSubscriptionResponse, m as
|
|
9
|
-
import { L as LogVisibility, aj as ResourceUsageMonitoring } from './helpers-
|
|
10
|
-
export { A as AppInfo, d as AppMetrics, e as AppProfileInfo, ak as AppRelease, al as AppReleaseBuild, am as AppResponse, B as BillingApiClient, C as ComputeApiConfig, l as CreateAppParams, an as DeployParams, E as EstimateBatchGasOptions, G as GeneratedKey, o as LoginRequest, p as LoginResult, q as LogsParams, a as SessionError, S as SessionInfo, b as SiweMessageParams, r as SiweMessageResult, ao as UpgradeParams, U as UserApiClient, t as addHexPrefix, ap as assertValidFilePath, u as assertValidImageReference, v as assertValidPrivateKey, w as checkERC7702Delegation, x as createSiweMessage, aq as createViemClients, y as estimateBatchGas, D as extractAppNameFromImage, F as generateNewPrivateKey, H as generateNonce, I as getAvailableEnvironments, K as getBillingEnvironmentConfig, M as getBuildType, N as getChainFromID, O as getComputeApiSession, P as getEnvironmentConfig, R as isEnvironmentAvailable, T as isMainnet, V as isSessionValid, W as isSiweMessageExpired, X as isSiweMessageNotYetValid, Y as isSubscriptionActive, $ as loginToComputeApi, 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, ar as validateDeployParams, ab as validateDescription, as as validateFilePath, at as validateImagePath, ac as validateImageReference, ad as validateInstanceTypeSKU, ae as validateLogVisibility, af as validateLogsParams, ag as validatePrivateKeyFormat, au as validateResourceUsageMonitoring, ah as validateURL, av as validateUpgradeParams, ai as validateXURL } from './helpers-
|
|
7
|
+
import { V as PreparedDeploy, G as GasEstimate, E as EnvironmentConfig, H as Logger, q as DeployResult, Y as PreparedUpgrade, A as AppId } from './index-Bac4HjC0.js';
|
|
8
|
+
export { a as AlreadyActiveResponse, c as AppProfile, d as AppProfileResponse, e as AppRecord, f as BillingEnvironmentConfig, g as CancelResponse, h as CancelSuccessResponse, i as ChainID, j as CheckoutCreatedResponse, k as CreateSubscriptionOptions, l as CreateSubscriptionResponse, m as CreditPurchaseResponse, n as DeployAppOpts, o as DeployOptions, p as DeployProgressCallback, r as DeployStep, s as DockerImageConfig, t as EstimateGasOptions, v as ExecuteDeployResult, x as ExecuteUpgradeResult, y as GasOpts, z as GetSubscriptionOptions, I as ImageDigestResult, L as LifecycleOpts, N as NoActiveSubscriptionResponse, P as ParsedEnvironment, J as PaymentIssueResponse, K as PaymentMethod, M as PaymentMethodsResponse, Q as PrepareDeployFromVerifiableBuildOpts, R as PrepareDeployOpts, T as PrepareUpgradeFromVerifiableBuildOpts, U as PrepareUpgradeOpts, X as PreparedDeployData, _ as PreparedUpgradeData, $ as ProductID, a0 as ProductSubscriptionResponse, a1 as Release, a3 as SequentialDeployResult, a4 as SubscribeResponse, a5 as SubscriptionLineItem, a6 as SubscriptionOpts, a7 as SubscriptionStatus, ab as UpgradeAppOpts, ac as calculateAppID, ae as estimateTransactionGas, aj as formatETH, al as getAllAppsByDeveloper, aC as getAppLatestReleaseBlockNumbers, am as getAppsByBillingAccount, ap as getBillingType, aD as getBlockTimestamps, as as logVisibility, at as noopLogger } from './index-Bac4HjC0.js';
|
|
9
|
+
import { L as LogVisibility, aj as ResourceUsageMonitoring } from './helpers-GWlLS3gz.js';
|
|
10
|
+
export { A as AppInfo, d as AppMetrics, e as AppProfileInfo, ak as AppRelease, al as AppReleaseBuild, am as AppResponse, B as BillingApiClient, C as ComputeApiConfig, l as CreateAppParams, an as DeployParams, E as EstimateBatchGasOptions, G as GeneratedKey, o as LoginRequest, p as LoginResult, q as LogsParams, a as SessionError, S as SessionInfo, b as SiweMessageParams, r as SiweMessageResult, ao as UpgradeParams, U as UserApiClient, t as addHexPrefix, ap as assertValidFilePath, u as assertValidImageReference, v as assertValidPrivateKey, w as checkERC7702Delegation, x as createSiweMessage, aq as createViemClients, y as estimateBatchGas, D as extractAppNameFromImage, F as generateNewPrivateKey, H as generateNonce, I as getAvailableEnvironments, K as getBillingEnvironmentConfig, M as getBuildType, N as getChainFromID, O as getComputeApiSession, P as getEnvironmentConfig, R as isEnvironmentAvailable, T as isMainnet, V as isSessionValid, W as isSiweMessageExpired, X as isSiweMessageNotYetValid, Y as isSubscriptionActive, $ as loginToComputeApi, 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, ar as validateDeployParams, ab as validateDescription, as as validateFilePath, at as validateImagePath, ac as validateImageReference, ad as validateInstanceTypeSKU, ae as validateLogVisibility, af as validateLogsParams, ag as validatePrivateKeyFormat, au as validateResourceUsageMonitoring, ah as validateURL, av as validateUpgradeParams, ai as validateXURL } from './helpers-GWlLS3gz.js';
|
|
11
11
|
|
|
12
12
|
interface SubmitBuildRequest {
|
|
13
13
|
repoUrl: string;
|
package/dist/index.js
CHANGED
|
@@ -4837,7 +4837,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
|
|
|
4837
4837
|
var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
|
|
4838
4838
|
var CanUpdateAppProfilePermission = "0x036fef61";
|
|
4839
4839
|
function getDefaultClientId() {
|
|
4840
|
-
const version = true ? "1.0.0-dev.
|
|
4840
|
+
const version = true ? "1.0.0-dev.3" : "0.0.0";
|
|
4841
4841
|
return `ecloud-sdk/v${version}`;
|
|
4842
4842
|
}
|
|
4843
4843
|
var UserApiClient = class {
|
|
@@ -5682,7 +5682,13 @@ function getEnvironmentConfig(environment, chainID) {
|
|
|
5682
5682
|
return {
|
|
5683
5683
|
...env,
|
|
5684
5684
|
chainID: BigInt(resolvedChainID),
|
|
5685
|
-
...apiUrlOverride ? { userApiServerURL: apiUrlOverride } : {}
|
|
5685
|
+
...apiUrlOverride ? { userApiServerURL: apiUrlOverride } : {},
|
|
5686
|
+
...process.env.ECLOUD_USER_API_URL && {
|
|
5687
|
+
userApiServerURL: process.env.ECLOUD_USER_API_URL
|
|
5688
|
+
},
|
|
5689
|
+
...process.env.ECLOUD_RPC_URL && {
|
|
5690
|
+
defaultRPCURL: process.env.ECLOUD_RPC_URL
|
|
5691
|
+
}
|
|
5686
5692
|
};
|
|
5687
5693
|
}
|
|
5688
5694
|
function getBillingEnvironmentConfig(build) {
|
|
@@ -5694,7 +5700,12 @@ function getBillingEnvironmentConfig(build) {
|
|
|
5694
5700
|
if (apiUrlOverride) {
|
|
5695
5701
|
return { billingApiServerURL: apiUrlOverride };
|
|
5696
5702
|
}
|
|
5697
|
-
return
|
|
5703
|
+
return {
|
|
5704
|
+
...config,
|
|
5705
|
+
...process.env.ECLOUD_BILLING_API_URL && {
|
|
5706
|
+
billingApiServerURL: process.env.ECLOUD_BILLING_API_URL
|
|
5707
|
+
}
|
|
5708
|
+
};
|
|
5698
5709
|
}
|
|
5699
5710
|
function getBuildType() {
|
|
5700
5711
|
const buildTimeType = true ? "dev"?.toLowerCase() : void 0;
|
|
@@ -5999,6 +6010,20 @@ var BillingApiClient = class {
|
|
|
5999
6010
|
const endpoint = `${this.config.billingApiServerURL}/products/${productId}/subscription`;
|
|
6000
6011
|
await this.makeAuthenticatedRequest(endpoint, "DELETE", productId);
|
|
6001
6012
|
}
|
|
6013
|
+
async getPaymentMethods() {
|
|
6014
|
+
const endpoint = `${this.config.billingApiServerURL}/v1/payment-methods`;
|
|
6015
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
|
|
6016
|
+
return resp.json();
|
|
6017
|
+
}
|
|
6018
|
+
async purchaseCredits(amountCents, paymentMethodId) {
|
|
6019
|
+
const endpoint = `${this.config.billingApiServerURL}/v1/credits/purchase`;
|
|
6020
|
+
const body = { amountCents };
|
|
6021
|
+
if (paymentMethodId) {
|
|
6022
|
+
body.paymentMethodId = paymentMethodId;
|
|
6023
|
+
}
|
|
6024
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", body);
|
|
6025
|
+
return resp.json();
|
|
6026
|
+
}
|
|
6002
6027
|
// ==========================================================================
|
|
6003
6028
|
// Internal Methods
|
|
6004
6029
|
// ==========================================================================
|
|
@@ -6008,10 +6033,22 @@ var BillingApiClient = class {
|
|
|
6008
6033
|
* Uses session auth if useSession is true, otherwise uses EIP-712 signature auth.
|
|
6009
6034
|
*/
|
|
6010
6035
|
async makeAuthenticatedRequest(url, method, productId, body) {
|
|
6011
|
-
if (this.
|
|
6012
|
-
|
|
6036
|
+
if (this.options.verbose) {
|
|
6037
|
+
console.debug(`[BillingAPI] ${method} ${url}`);
|
|
6038
|
+
if (body) {
|
|
6039
|
+
console.debug(`[BillingAPI] Payload:`, JSON.stringify(body, null, 2));
|
|
6040
|
+
}
|
|
6041
|
+
}
|
|
6042
|
+
const resp = this.useSession ? await this.makeSessionAuthenticatedRequest(url, method, body) : await this.makeSignatureAuthenticatedRequest(url, method, productId, body);
|
|
6043
|
+
if (this.options.verbose) {
|
|
6044
|
+
const data = await resp.json();
|
|
6045
|
+
console.debug(`[BillingAPI] Response:`, JSON.stringify(data, null, 2));
|
|
6046
|
+
return {
|
|
6047
|
+
json: async () => data,
|
|
6048
|
+
text: async () => JSON.stringify(data)
|
|
6049
|
+
};
|
|
6013
6050
|
}
|
|
6014
|
-
return
|
|
6051
|
+
return resp;
|
|
6015
6052
|
}
|
|
6016
6053
|
/**
|
|
6017
6054
|
* Make a request using session-based authentication (cookies)
|
|
@@ -8200,7 +8237,7 @@ function createBillingModule(config) {
|
|
|
8200
8237
|
const address = walletClient.account.address;
|
|
8201
8238
|
const logger = getLogger(verbose);
|
|
8202
8239
|
const billingEnvConfig = getBillingEnvironmentConfig(getBuildType());
|
|
8203
|
-
const billingApi = new BillingApiClient(billingEnvConfig, walletClient);
|
|
8240
|
+
const billingApi = new BillingApiClient(billingEnvConfig, walletClient, { verbose });
|
|
8204
8241
|
const environmentConfig = getEnvironmentConfig(environment);
|
|
8205
8242
|
const usdcCreditsAddress = environmentConfig.usdcCreditsAddress;
|
|
8206
8243
|
if (!usdcCreditsAddress) {
|
|
@@ -8364,6 +8401,12 @@ function createBillingModule(config) {
|
|
|
8364
8401
|
};
|
|
8365
8402
|
}
|
|
8366
8403
|
);
|
|
8404
|
+
},
|
|
8405
|
+
async getPaymentMethods() {
|
|
8406
|
+
return billingApi.getPaymentMethods();
|
|
8407
|
+
},
|
|
8408
|
+
async purchaseCredits(amountCents, paymentMethodId) {
|
|
8409
|
+
return billingApi.purchaseCredits(amountCents, paymentMethodId);
|
|
8367
8410
|
}
|
|
8368
8411
|
};
|
|
8369
8412
|
return module;
|