@layr-labs/ecloud-sdk 1.0.0-dev.4 → 1.0.0-dev.5
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 +60 -0
- package/dist/billing.cjs.map +1 -1
- package/dist/billing.d.cts +2 -1
- package/dist/billing.d.ts +2 -1
- package/dist/billing.js +60 -0
- package/dist/billing.js.map +1 -1
- package/dist/browser.cjs +58 -1
- 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 +58 -1
- package/dist/browser.js.map +1 -1
- package/dist/{compute-B6SZ0VQG.d.ts → compute-9bzsfthb.d.ts} +1 -1
- package/dist/{compute-BK4PxhNh.d.cts → compute-RhRi2H8h.d.cts} +1 -1
- package/dist/compute.cjs +1 -1
- 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 +1 -1
- package/dist/compute.js.map +1 -1
- package/dist/{helpers-Qq5W-qNn.d.cts → helpers-CqrBJ39N.d.cts} +15 -1
- package/dist/{helpers-F7CeDSVX.d.ts → helpers-DEGFGA-T.d.ts} +15 -1
- package/dist/{index-BoCE0hIh.d.cts → index-CLhRJNai.d.cts} +34 -1
- package/dist/{index-BoCE0hIh.d.ts → index-CLhRJNai.d.ts} +34 -1
- package/dist/index.cjs +101 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -7
- package/dist/index.d.ts +31 -7
- package/dist/index.js +100 -1
- 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-RhRi2H8h.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-RhRi2H8h.cjs';
|
|
3
3
|
import { BillingModule } from './billing.cjs';
|
|
4
4
|
export { BillingChain, BillingModuleConfig, TopUpInfo, TopUpOpts, TopUpResult, 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 {
|
|
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, an as BASE_SEPOLIA_CHAIN_ID, B as BillingApiClient, C as ComputeApiConfig, l as CreateAppParams, ao 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, ap as UpgradeParams, U as UserApiClient, t as addHexPrefix, aq as assertValidFilePath, u as assertValidImageReference, v as assertValidPrivateKey, w as checkERC7702Delegation, x as createSiweMessage, ar 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, as as validateDeployParams, ab as validateDescription, at as validateFilePath, au as validateImagePath, ac as validateImageReference, ad as validateInstanceTypeSKU, ae as validateLogVisibility, af as validateLogsParams, ag as validatePrivateKeyFormat, av as validateResourceUsageMonitoring, ah as validateURL, aw as validateUpgradeParams, ai as validateXURL } from './helpers-
|
|
7
|
+
import { a0 as PreparedDeploy, H as GasEstimate, E as EnvironmentConfig, Q as Logger, u as DeployResult, a3 as PreparedUpgrade, A as AppId, n as CreateCouponResponse, P as ListCouponsResponse, J as GetCouponResponse, a as AddAdminResponse, O as ListAdminsResponse } from './index-CLhRJNai.cjs';
|
|
8
|
+
export { b as AdminCoupon, c as AdminUser, d as AlreadyActiveResponse, f as AppProfile, g as AppProfileResponse, h as AppRecord, i as BillingEnvironmentConfig, j as CancelResponse, k as CancelSuccessResponse, l as ChainID, m as CheckoutCreatedResponse, o as CreateSubscriptionOptions, p as CreateSubscriptionResponse, q as CreditPurchaseResponse, r as DeployAppOpts, s as DeployOptions, t as DeployProgressCallback, v as DeployStep, w as DockerImageConfig, x as EstimateGasOptions, z as ExecuteDeployResult, G as ExecuteUpgradeResult, I as GasOpts, K as GetSubscriptionOptions, L as ImageDigestResult, N as LifecycleOpts, R as NoActiveSubscriptionResponse, S as ParsedEnvironment, T as PaymentIssueResponse, U as PaymentMethod, V as PaymentMethodsResponse, X as PrepareDeployFromVerifiableBuildOpts, Y as PrepareDeployOpts, _ as PrepareUpgradeFromVerifiableBuildOpts, $ as PrepareUpgradeOpts, a2 as PreparedDeployData, a5 as PreparedUpgradeData, a6 as ProductID, a7 as ProductSubscriptionResponse, a8 as RedeemCouponResponse, a9 as Release, ab as SequentialDeployResult, ac as SubscribeResponse, ad as SubscriptionLineItem, ae as SubscriptionOpts, af as SubscriptionStatus, aj as UpgradeAppOpts, ak as calculateAppID, am as estimateTransactionGas, ar as formatETH, at as getAllAppsByDeveloper, aK as getAppLatestReleaseBlockNumbers, au as getAppsByBillingAccount, ax as getBillingType, aL as getBlockTimestamps, aA as logVisibility, aB as noopLogger } from './index-CLhRJNai.cjs';
|
|
9
|
+
import { L as LogVisibility, aj as ResourceUsageMonitoring } from './helpers-CqrBJ39N.cjs';
|
|
10
|
+
export { A as AppInfo, d as AppMetrics, e as AppProfileInfo, ak as AppRelease, al as AppReleaseBuild, am as AppResponse, an as BASE_SEPOLIA_CHAIN_ID, B as BillingApiClient, C as ComputeApiConfig, l as CreateAppParams, ao 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, ap as UpgradeParams, U as UserApiClient, t as addHexPrefix, aq as assertValidFilePath, u as assertValidImageReference, v as assertValidPrivateKey, w as checkERC7702Delegation, x as createSiweMessage, ar 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, as as validateDeployParams, ab as validateDescription, at as validateFilePath, au as validateImagePath, ac as validateImageReference, ad as validateInstanceTypeSKU, ae as validateLogVisibility, af as validateLogsParams, ag as validatePrivateKeyFormat, av as validateResourceUsageMonitoring, ah as validateURL, aw as validateUpgradeParams, ai as validateXURL } from './helpers-CqrBJ39N.cjs';
|
|
11
11
|
|
|
12
12
|
interface SubmitBuildRequest {
|
|
13
13
|
repoUrl: string;
|
|
@@ -396,6 +396,30 @@ declare function executeUpgrade(options: ExecuteUpgradeOptions): Promise<Upgrade
|
|
|
396
396
|
*/
|
|
397
397
|
declare function watchUpgrade(appId: string, walletClient: WalletClient, publicClient: PublicClient, environmentConfig: EnvironmentConfig, logger?: Logger, skipTelemetry?: boolean): Promise<void>;
|
|
398
398
|
|
|
399
|
+
interface AdminModule {
|
|
400
|
+
address: Address;
|
|
401
|
+
createCoupon: (amountCents: number) => Promise<CreateCouponResponse>;
|
|
402
|
+
listCoupons: (opts?: {
|
|
403
|
+
offset?: number;
|
|
404
|
+
limit?: number;
|
|
405
|
+
active?: boolean;
|
|
406
|
+
redeemed?: boolean;
|
|
407
|
+
}) => Promise<ListCouponsResponse>;
|
|
408
|
+
getCoupon: (id: string) => Promise<GetCouponResponse>;
|
|
409
|
+
deactivateCoupon: (id: string) => Promise<void>;
|
|
410
|
+
redeemCouponForUser: (id: string, address: string) => Promise<void>;
|
|
411
|
+
addAdmin: (address: string) => Promise<AddAdminResponse>;
|
|
412
|
+
removeAdmin: (address: string) => Promise<void>;
|
|
413
|
+
listAdmins: () => Promise<ListAdminsResponse>;
|
|
414
|
+
}
|
|
415
|
+
interface AdminModuleConfig {
|
|
416
|
+
verbose?: boolean;
|
|
417
|
+
walletClient: WalletClient;
|
|
418
|
+
publicClient: PublicClient;
|
|
419
|
+
environment: string;
|
|
420
|
+
}
|
|
421
|
+
declare function createAdminModule(config: AdminModuleConfig): AdminModule;
|
|
422
|
+
|
|
399
423
|
/**
|
|
400
424
|
* OS Keyring Integration
|
|
401
425
|
*
|
|
@@ -939,4 +963,4 @@ interface ECloudClient {
|
|
|
939
963
|
}
|
|
940
964
|
declare function createECloudClient(cfg: ClientConfig): ECloudClient;
|
|
941
965
|
|
|
942
|
-
export { type AppEnvironment, AppId, AuthRequiredError, BUILD_STATUS, BadRequestError, BillingModule, type Build, BuildError, BuildFailedError, type BuildModule, type BuildModuleConfig, type BuildProgress, type BuildStatus, type ClientConfig, ComputeModule, ConflictError, DeployResult, type ECloudClient, ERC20 as ERC20ABI, type Environment, EnvironmentConfig, ForbiddenError, GasEstimate, type LegacyKey, type LogChunk, LogVisibility, Logger, type Metric, type MetricsContext, NoopClient, NotFoundError, PostHogClient, type PrepareDeployResult, type PrepareUpgradeResult, PreparedDeploy, PreparedUpgrade, type PrivateKeySource, ResourceUsageMonitoring, type SDKDeployOptions, type SDKUpgradeOptions, type StoredKey, type SubmitBuildRequest, type SubmitBuildResponse, type TelemetryClient, type TelemetryClientOptions, type TelemetryWrapperOptions, TimeoutError, USDCCredits as USDCCreditsABI, type VerifyProvenanceFailure, type VerifyProvenanceResult, type VerifyProvenanceSuccess, addMetric, addMetricWithDimensions, createAppEnvironment, createBuildModule, createECloudClient, createMetricsContext, createTelemetryClient, deleteLegacyPrivateKey, deletePrivateKey, emitMetrics, executeDeploy, executeUpgrade, fetchTemplateCatalog, getAddressFromPrivateKey, getCategoryDescriptions, getCurrentInstanceType, getLegacyKeys, getLegacyPrivateKey, getPostHogAPIKey, getPostHogEndpoint, getPrivateKey, getPrivateKeyWithSource, getTemplate, isNoopClient, keyExists, listStoredKeys, prepareDeploy, prepareDeployFromVerifiableBuild, prepareUpgrade, prepareUpgradeFromVerifiableBuild, requirePrivateKey, storePrivateKey, validatePrivateKey, watchDeployment, watchUpgrade, withSDKTelemetry };
|
|
966
|
+
export { AddAdminResponse, type AdminModule, type AdminModuleConfig, type AppEnvironment, AppId, AuthRequiredError, BUILD_STATUS, BadRequestError, BillingModule, type Build, BuildError, BuildFailedError, type BuildModule, type BuildModuleConfig, type BuildProgress, type BuildStatus, type ClientConfig, ComputeModule, ConflictError, CreateCouponResponse, DeployResult, type ECloudClient, ERC20 as ERC20ABI, type Environment, EnvironmentConfig, ForbiddenError, GasEstimate, GetCouponResponse, type LegacyKey, ListAdminsResponse, ListCouponsResponse, type LogChunk, LogVisibility, Logger, type Metric, type MetricsContext, NoopClient, NotFoundError, PostHogClient, type PrepareDeployResult, type PrepareUpgradeResult, PreparedDeploy, PreparedUpgrade, type PrivateKeySource, ResourceUsageMonitoring, type SDKDeployOptions, type SDKUpgradeOptions, type StoredKey, type SubmitBuildRequest, type SubmitBuildResponse, type TelemetryClient, type TelemetryClientOptions, type TelemetryWrapperOptions, TimeoutError, USDCCredits as USDCCreditsABI, type VerifyProvenanceFailure, type VerifyProvenanceResult, type VerifyProvenanceSuccess, addMetric, addMetricWithDimensions, createAdminModule, createAppEnvironment, createBuildModule, createECloudClient, createMetricsContext, createTelemetryClient, deleteLegacyPrivateKey, deletePrivateKey, emitMetrics, executeDeploy, executeUpgrade, fetchTemplateCatalog, getAddressFromPrivateKey, getCategoryDescriptions, getCurrentInstanceType, getLegacyKeys, getLegacyPrivateKey, getPostHogAPIKey, getPostHogEndpoint, getPrivateKey, getPrivateKeyWithSource, getTemplate, isNoopClient, keyExists, listStoredKeys, prepareDeploy, prepareDeployFromVerifiableBuild, prepareUpgrade, prepareUpgradeFromVerifiableBuild, requirePrivateKey, storePrivateKey, validatePrivateKey, watchDeployment, watchUpgrade, withSDKTelemetry };
|
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-9bzsfthb.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-9bzsfthb.js';
|
|
3
3
|
import { BillingModule } from './billing.js';
|
|
4
4
|
export { BillingChain, BillingModuleConfig, TopUpInfo, TopUpOpts, TopUpResult, 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 {
|
|
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, an as BASE_SEPOLIA_CHAIN_ID, B as BillingApiClient, C as ComputeApiConfig, l as CreateAppParams, ao 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, ap as UpgradeParams, U as UserApiClient, t as addHexPrefix, aq as assertValidFilePath, u as assertValidImageReference, v as assertValidPrivateKey, w as checkERC7702Delegation, x as createSiweMessage, ar 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, as as validateDeployParams, ab as validateDescription, at as validateFilePath, au as validateImagePath, ac as validateImageReference, ad as validateInstanceTypeSKU, ae as validateLogVisibility, af as validateLogsParams, ag as validatePrivateKeyFormat, av as validateResourceUsageMonitoring, ah as validateURL, aw as validateUpgradeParams, ai as validateXURL } from './helpers-
|
|
7
|
+
import { a0 as PreparedDeploy, H as GasEstimate, E as EnvironmentConfig, Q as Logger, u as DeployResult, a3 as PreparedUpgrade, A as AppId, n as CreateCouponResponse, P as ListCouponsResponse, J as GetCouponResponse, a as AddAdminResponse, O as ListAdminsResponse } from './index-CLhRJNai.js';
|
|
8
|
+
export { b as AdminCoupon, c as AdminUser, d as AlreadyActiveResponse, f as AppProfile, g as AppProfileResponse, h as AppRecord, i as BillingEnvironmentConfig, j as CancelResponse, k as CancelSuccessResponse, l as ChainID, m as CheckoutCreatedResponse, o as CreateSubscriptionOptions, p as CreateSubscriptionResponse, q as CreditPurchaseResponse, r as DeployAppOpts, s as DeployOptions, t as DeployProgressCallback, v as DeployStep, w as DockerImageConfig, x as EstimateGasOptions, z as ExecuteDeployResult, G as ExecuteUpgradeResult, I as GasOpts, K as GetSubscriptionOptions, L as ImageDigestResult, N as LifecycleOpts, R as NoActiveSubscriptionResponse, S as ParsedEnvironment, T as PaymentIssueResponse, U as PaymentMethod, V as PaymentMethodsResponse, X as PrepareDeployFromVerifiableBuildOpts, Y as PrepareDeployOpts, _ as PrepareUpgradeFromVerifiableBuildOpts, $ as PrepareUpgradeOpts, a2 as PreparedDeployData, a5 as PreparedUpgradeData, a6 as ProductID, a7 as ProductSubscriptionResponse, a8 as RedeemCouponResponse, a9 as Release, ab as SequentialDeployResult, ac as SubscribeResponse, ad as SubscriptionLineItem, ae as SubscriptionOpts, af as SubscriptionStatus, aj as UpgradeAppOpts, ak as calculateAppID, am as estimateTransactionGas, ar as formatETH, at as getAllAppsByDeveloper, aK as getAppLatestReleaseBlockNumbers, au as getAppsByBillingAccount, ax as getBillingType, aL as getBlockTimestamps, aA as logVisibility, aB as noopLogger } from './index-CLhRJNai.js';
|
|
9
|
+
import { L as LogVisibility, aj as ResourceUsageMonitoring } from './helpers-DEGFGA-T.js';
|
|
10
|
+
export { A as AppInfo, d as AppMetrics, e as AppProfileInfo, ak as AppRelease, al as AppReleaseBuild, am as AppResponse, an as BASE_SEPOLIA_CHAIN_ID, B as BillingApiClient, C as ComputeApiConfig, l as CreateAppParams, ao 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, ap as UpgradeParams, U as UserApiClient, t as addHexPrefix, aq as assertValidFilePath, u as assertValidImageReference, v as assertValidPrivateKey, w as checkERC7702Delegation, x as createSiweMessage, ar 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, as as validateDeployParams, ab as validateDescription, at as validateFilePath, au as validateImagePath, ac as validateImageReference, ad as validateInstanceTypeSKU, ae as validateLogVisibility, af as validateLogsParams, ag as validatePrivateKeyFormat, av as validateResourceUsageMonitoring, ah as validateURL, aw as validateUpgradeParams, ai as validateXURL } from './helpers-DEGFGA-T.js';
|
|
11
11
|
|
|
12
12
|
interface SubmitBuildRequest {
|
|
13
13
|
repoUrl: string;
|
|
@@ -396,6 +396,30 @@ declare function executeUpgrade(options: ExecuteUpgradeOptions): Promise<Upgrade
|
|
|
396
396
|
*/
|
|
397
397
|
declare function watchUpgrade(appId: string, walletClient: WalletClient, publicClient: PublicClient, environmentConfig: EnvironmentConfig, logger?: Logger, skipTelemetry?: boolean): Promise<void>;
|
|
398
398
|
|
|
399
|
+
interface AdminModule {
|
|
400
|
+
address: Address;
|
|
401
|
+
createCoupon: (amountCents: number) => Promise<CreateCouponResponse>;
|
|
402
|
+
listCoupons: (opts?: {
|
|
403
|
+
offset?: number;
|
|
404
|
+
limit?: number;
|
|
405
|
+
active?: boolean;
|
|
406
|
+
redeemed?: boolean;
|
|
407
|
+
}) => Promise<ListCouponsResponse>;
|
|
408
|
+
getCoupon: (id: string) => Promise<GetCouponResponse>;
|
|
409
|
+
deactivateCoupon: (id: string) => Promise<void>;
|
|
410
|
+
redeemCouponForUser: (id: string, address: string) => Promise<void>;
|
|
411
|
+
addAdmin: (address: string) => Promise<AddAdminResponse>;
|
|
412
|
+
removeAdmin: (address: string) => Promise<void>;
|
|
413
|
+
listAdmins: () => Promise<ListAdminsResponse>;
|
|
414
|
+
}
|
|
415
|
+
interface AdminModuleConfig {
|
|
416
|
+
verbose?: boolean;
|
|
417
|
+
walletClient: WalletClient;
|
|
418
|
+
publicClient: PublicClient;
|
|
419
|
+
environment: string;
|
|
420
|
+
}
|
|
421
|
+
declare function createAdminModule(config: AdminModuleConfig): AdminModule;
|
|
422
|
+
|
|
399
423
|
/**
|
|
400
424
|
* OS Keyring Integration
|
|
401
425
|
*
|
|
@@ -939,4 +963,4 @@ interface ECloudClient {
|
|
|
939
963
|
}
|
|
940
964
|
declare function createECloudClient(cfg: ClientConfig): ECloudClient;
|
|
941
965
|
|
|
942
|
-
export { type AppEnvironment, AppId, AuthRequiredError, BUILD_STATUS, BadRequestError, BillingModule, type Build, BuildError, BuildFailedError, type BuildModule, type BuildModuleConfig, type BuildProgress, type BuildStatus, type ClientConfig, ComputeModule, ConflictError, DeployResult, type ECloudClient, ERC20 as ERC20ABI, type Environment, EnvironmentConfig, ForbiddenError, GasEstimate, type LegacyKey, type LogChunk, LogVisibility, Logger, type Metric, type MetricsContext, NoopClient, NotFoundError, PostHogClient, type PrepareDeployResult, type PrepareUpgradeResult, PreparedDeploy, PreparedUpgrade, type PrivateKeySource, ResourceUsageMonitoring, type SDKDeployOptions, type SDKUpgradeOptions, type StoredKey, type SubmitBuildRequest, type SubmitBuildResponse, type TelemetryClient, type TelemetryClientOptions, type TelemetryWrapperOptions, TimeoutError, USDCCredits as USDCCreditsABI, type VerifyProvenanceFailure, type VerifyProvenanceResult, type VerifyProvenanceSuccess, addMetric, addMetricWithDimensions, createAppEnvironment, createBuildModule, createECloudClient, createMetricsContext, createTelemetryClient, deleteLegacyPrivateKey, deletePrivateKey, emitMetrics, executeDeploy, executeUpgrade, fetchTemplateCatalog, getAddressFromPrivateKey, getCategoryDescriptions, getCurrentInstanceType, getLegacyKeys, getLegacyPrivateKey, getPostHogAPIKey, getPostHogEndpoint, getPrivateKey, getPrivateKeyWithSource, getTemplate, isNoopClient, keyExists, listStoredKeys, prepareDeploy, prepareDeployFromVerifiableBuild, prepareUpgrade, prepareUpgradeFromVerifiableBuild, requirePrivateKey, storePrivateKey, validatePrivateKey, watchDeployment, watchUpgrade, withSDKTelemetry };
|
|
966
|
+
export { AddAdminResponse, type AdminModule, type AdminModuleConfig, type AppEnvironment, AppId, AuthRequiredError, BUILD_STATUS, BadRequestError, BillingModule, type Build, BuildError, BuildFailedError, type BuildModule, type BuildModuleConfig, type BuildProgress, type BuildStatus, type ClientConfig, ComputeModule, ConflictError, CreateCouponResponse, DeployResult, type ECloudClient, ERC20 as ERC20ABI, type Environment, EnvironmentConfig, ForbiddenError, GasEstimate, GetCouponResponse, type LegacyKey, ListAdminsResponse, ListCouponsResponse, type LogChunk, LogVisibility, Logger, type Metric, type MetricsContext, NoopClient, NotFoundError, PostHogClient, type PrepareDeployResult, type PrepareUpgradeResult, PreparedDeploy, PreparedUpgrade, type PrivateKeySource, ResourceUsageMonitoring, type SDKDeployOptions, type SDKUpgradeOptions, type StoredKey, type SubmitBuildRequest, type SubmitBuildResponse, type TelemetryClient, type TelemetryClientOptions, type TelemetryWrapperOptions, TimeoutError, USDCCredits as USDCCreditsABI, type VerifyProvenanceFailure, type VerifyProvenanceResult, type VerifyProvenanceSuccess, addMetric, addMetricWithDimensions, createAdminModule, createAppEnvironment, createBuildModule, createECloudClient, createMetricsContext, createTelemetryClient, deleteLegacyPrivateKey, deletePrivateKey, emitMetrics, executeDeploy, executeUpgrade, fetchTemplateCatalog, getAddressFromPrivateKey, getCategoryDescriptions, getCurrentInstanceType, getLegacyKeys, getLegacyPrivateKey, getPostHogAPIKey, getPostHogEndpoint, getPrivateKey, getPrivateKeyWithSource, getTemplate, isNoopClient, keyExists, listStoredKeys, prepareDeploy, prepareDeployFromVerifiableBuild, prepareUpgrade, prepareUpgradeFromVerifiableBuild, requirePrivateKey, storePrivateKey, validatePrivateKey, watchDeployment, watchUpgrade, withSDKTelemetry };
|
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.5" : "0.0.0";
|
|
4841
4841
|
return `ecloud-sdk/v${version}`;
|
|
4842
4842
|
}
|
|
4843
4843
|
var UserApiClient = class {
|
|
@@ -6030,6 +6030,63 @@ var BillingApiClient = class {
|
|
|
6030
6030
|
return resp.json();
|
|
6031
6031
|
}
|
|
6032
6032
|
// ==========================================================================
|
|
6033
|
+
// Admin - Coupon Methods
|
|
6034
|
+
// ==========================================================================
|
|
6035
|
+
async createCoupon(amountCents) {
|
|
6036
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/coupons`;
|
|
6037
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { amountCents });
|
|
6038
|
+
return resp.json();
|
|
6039
|
+
}
|
|
6040
|
+
async listCoupons(opts) {
|
|
6041
|
+
const params = new URLSearchParams();
|
|
6042
|
+
if (opts?.offset !== void 0) params.set("offset", opts.offset.toString());
|
|
6043
|
+
if (opts?.limit !== void 0) params.set("limit", opts.limit.toString());
|
|
6044
|
+
if (opts?.active !== void 0) params.set("active", opts.active.toString());
|
|
6045
|
+
if (opts?.redeemed !== void 0) params.set("redeemed", opts.redeemed.toString());
|
|
6046
|
+
const qs = params.toString();
|
|
6047
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/coupons${qs ? `?${qs}` : ""}`;
|
|
6048
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
|
|
6049
|
+
return resp.json();
|
|
6050
|
+
}
|
|
6051
|
+
async getCoupon(id) {
|
|
6052
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/coupons/${id}`;
|
|
6053
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
|
|
6054
|
+
return resp.json();
|
|
6055
|
+
}
|
|
6056
|
+
async deactivateCoupon(id) {
|
|
6057
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/coupons/${id}/deactivate`;
|
|
6058
|
+
await this.makeAuthenticatedRequest(endpoint, "POST", "compute");
|
|
6059
|
+
}
|
|
6060
|
+
async redeemCouponForUser(id, address) {
|
|
6061
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/coupons/${id}/redeem`;
|
|
6062
|
+
await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { address });
|
|
6063
|
+
}
|
|
6064
|
+
// ==========================================================================
|
|
6065
|
+
// Admin - Admin Management Methods
|
|
6066
|
+
// ==========================================================================
|
|
6067
|
+
async addAdmin(address) {
|
|
6068
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/admins`;
|
|
6069
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { address });
|
|
6070
|
+
return resp.json();
|
|
6071
|
+
}
|
|
6072
|
+
async removeAdmin(address) {
|
|
6073
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/admins/${address}`;
|
|
6074
|
+
await this.makeAuthenticatedRequest(endpoint, "DELETE", "compute");
|
|
6075
|
+
}
|
|
6076
|
+
async listAdmins() {
|
|
6077
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/admins`;
|
|
6078
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
|
|
6079
|
+
return resp.json();
|
|
6080
|
+
}
|
|
6081
|
+
// ==========================================================================
|
|
6082
|
+
// User - Coupon Redemption
|
|
6083
|
+
// ==========================================================================
|
|
6084
|
+
async redeemCoupon(code) {
|
|
6085
|
+
const endpoint = `${this.config.billingApiServerURL}/v1/coupons/redeem`;
|
|
6086
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { code });
|
|
6087
|
+
return resp.json();
|
|
6088
|
+
}
|
|
6089
|
+
// ==========================================================================
|
|
6033
6090
|
// Internal Methods
|
|
6034
6091
|
// ==========================================================================
|
|
6035
6092
|
/**
|
|
@@ -8450,6 +8507,9 @@ function createBillingModule(config) {
|
|
|
8450
8507
|
},
|
|
8451
8508
|
hasBaseSupport() {
|
|
8452
8509
|
return !!baseUsdcCreditsAddress && !!baseRPCURL;
|
|
8510
|
+
},
|
|
8511
|
+
async redeemCoupon(code) {
|
|
8512
|
+
return billingApi.redeemCoupon(code);
|
|
8453
8513
|
}
|
|
8454
8514
|
};
|
|
8455
8515
|
return module;
|
|
@@ -8885,6 +8945,44 @@ function transformVerifyResult(raw) {
|
|
|
8885
8945
|
};
|
|
8886
8946
|
}
|
|
8887
8947
|
|
|
8948
|
+
// src/client/modules/admin/index.ts
|
|
8949
|
+
function createAdminModule(config) {
|
|
8950
|
+
const { verbose = false, walletClient } = config;
|
|
8951
|
+
if (!walletClient.account) {
|
|
8952
|
+
throw new Error("WalletClient must have an account attached");
|
|
8953
|
+
}
|
|
8954
|
+
const address = walletClient.account.address;
|
|
8955
|
+
const billingEnvConfig = getBillingEnvironmentConfig(getBuildType());
|
|
8956
|
+
const billingApi = new BillingApiClient(billingEnvConfig, walletClient, { verbose });
|
|
8957
|
+
return {
|
|
8958
|
+
address,
|
|
8959
|
+
async createCoupon(amountCents) {
|
|
8960
|
+
return billingApi.createCoupon(amountCents);
|
|
8961
|
+
},
|
|
8962
|
+
async listCoupons(opts) {
|
|
8963
|
+
return billingApi.listCoupons(opts);
|
|
8964
|
+
},
|
|
8965
|
+
async getCoupon(id) {
|
|
8966
|
+
return billingApi.getCoupon(id);
|
|
8967
|
+
},
|
|
8968
|
+
async deactivateCoupon(id) {
|
|
8969
|
+
return billingApi.deactivateCoupon(id);
|
|
8970
|
+
},
|
|
8971
|
+
async redeemCouponForUser(id, userAddress) {
|
|
8972
|
+
return billingApi.redeemCouponForUser(id, userAddress);
|
|
8973
|
+
},
|
|
8974
|
+
async addAdmin(adminAddress) {
|
|
8975
|
+
return billingApi.addAdmin(adminAddress);
|
|
8976
|
+
},
|
|
8977
|
+
async removeAdmin(adminAddress) {
|
|
8978
|
+
return billingApi.removeAdmin(adminAddress);
|
|
8979
|
+
},
|
|
8980
|
+
async listAdmins() {
|
|
8981
|
+
return billingApi.listAdmins();
|
|
8982
|
+
}
|
|
8983
|
+
};
|
|
8984
|
+
}
|
|
8985
|
+
|
|
8888
8986
|
// src/client/common/auth/keyring.ts
|
|
8889
8987
|
import { AsyncEntry, findCredentials } from "@napi-rs/keyring";
|
|
8890
8988
|
import { privateKeyToAddress } from "viem/accounts";
|
|
@@ -9448,6 +9546,7 @@ export {
|
|
|
9448
9546
|
assertValidPrivateKey,
|
|
9449
9547
|
calculateAppID,
|
|
9450
9548
|
checkERC7702Delegation,
|
|
9549
|
+
createAdminModule,
|
|
9451
9550
|
createApp,
|
|
9452
9551
|
createAppEnvironment,
|
|
9453
9552
|
createBillingModule,
|