@layr-labs/ecloud-sdk 1.0.0-dev.3 → 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.
@@ -1,10 +1,11 @@
1
- import { E as EnvironmentConfig, a7 as SubscriptionStatus, f as BillingEnvironmentConfig, $ as ProductID, k as CreateSubscriptionOptions, l as CreateSubscriptionResponse, z as GetSubscriptionOptions, a0 as ProductSubscriptionResponse, M as PaymentMethodsResponse, m as CreditPurchaseResponse, G as GasEstimate, H as Logger } from './index-Bac4HjC0.js';
1
+ import { E as EnvironmentConfig, af as SubscriptionStatus, i as BillingEnvironmentConfig, a6 as ProductID, o as CreateSubscriptionOptions, p as CreateSubscriptionResponse, K as GetSubscriptionOptions, a7 as ProductSubscriptionResponse, V as PaymentMethodsResponse, q as CreditPurchaseResponse, n as CreateCouponResponse, P as ListCouponsResponse, J as GetCouponResponse, a as AddAdminResponse, O as ListAdminsResponse, a8 as RedeemCouponResponse, H as GasEstimate, Q as Logger } from './index-CLhRJNai.cjs';
2
2
  import { Address, Hex, 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
  */
@@ -800,6 +801,20 @@ declare class BillingApiClient {
800
801
  cancelSubscription(productId?: ProductID): Promise<void>;
801
802
  getPaymentMethods(): Promise<PaymentMethodsResponse>;
802
803
  purchaseCredits(amountCents: number, paymentMethodId?: string): Promise<CreditPurchaseResponse>;
804
+ createCoupon(amountCents: number): Promise<CreateCouponResponse>;
805
+ listCoupons(opts?: {
806
+ offset?: number;
807
+ limit?: number;
808
+ active?: boolean;
809
+ redeemed?: boolean;
810
+ }): Promise<ListCouponsResponse>;
811
+ getCoupon(id: string): Promise<GetCouponResponse>;
812
+ deactivateCoupon(id: string): Promise<void>;
813
+ redeemCouponForUser(id: string, address: string): Promise<void>;
814
+ addAdmin(address: string): Promise<AddAdminResponse>;
815
+ removeAdmin(address: string): Promise<void>;
816
+ listAdmins(): Promise<ListAdminsResponse>;
817
+ redeemCoupon(code: string): Promise<RedeemCouponResponse>;
803
818
  /**
804
819
  * Make an authenticated request to the billing API
805
820
  *
@@ -992,4 +1007,4 @@ declare function addHexPrefix(value: string): Hex;
992
1007
  */
993
1008
  declare function stripHexPrefix(value: string): string;
994
1009
 
995
- export { loginToComputeApi as $, type AppInfo as A, BillingApiClient as B, type ComputeApiConfig as C, extractAppNameFromImage as D, type EstimateBatchGasOptions as E, generateNewPrivateKey as F, type GeneratedKey as G, generateNonce as H, getAvailableEnvironments as I, getBillingApiSession as J, getBillingEnvironmentConfig as K, type LogVisibility as L, getBuildType as M, getChainFromID as N, getComputeApiSession as O, getEnvironmentConfig as P, isBillingSessionValid as Q, isEnvironmentAvailable as R, type SessionInfo as S, isMainnet as T, UserApiClient as U, isSessionValid as V, isSiweMessageExpired as W, isSiweMessageNotYetValid as X, isSubscriptionActive as Y, loginToBillingApi as Z, loginToBothApis as _, SessionError as a, logoutFromBillingApi as a0, logoutFromBothApis as a1, logoutFromComputeApi as a2, parseSiweMessage as a3, sanitizeString as a4, sanitizeURL as a5, sanitizeXURL as a6, stripHexPrefix as a7, validateAppID as a8, validateAppName as a9, validateCreateAppParams as aa, validateDescription as ab, validateImageReference as ac, validateInstanceTypeSKU as ad, validateLogVisibility as ae, validateLogsParams as af, validatePrivateKeyFormat as ag, validateURL as ah, validateXURL as ai, type ResourceUsageMonitoring as aj, type AppRelease as ak, type AppReleaseBuild as al, type AppResponse as am, type DeployParams as an, type UpgradeParams as ao, assertValidFilePath as ap, createClients as aq, validateDeployParams as ar, validateFilePath as as, validateImagePath as at, validateResourceUsageMonitoring as au, validateUpgradeParams as av, 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 CreateAppParams as l, type ExecuteBatchOptions as m, type Execution as n, type LoginRequest as o, type LoginResult as p, type LogsParams as q, type SiweMessageResult as r, type UserApiClientOptions as s, addHexPrefix as t, assertValidImageReference as u, assertValidPrivateKey as v, checkERC7702Delegation as w, createSiweMessage as x, estimateBatchGas as y, executeBatch as z };
1010
+ export { loginToComputeApi as $, type AppInfo as A, BillingApiClient as B, type ComputeApiConfig as C, extractAppNameFromImage as D, type EstimateBatchGasOptions as E, generateNewPrivateKey as F, type GeneratedKey as G, generateNonce as H, getAvailableEnvironments as I, getBillingApiSession as J, getBillingEnvironmentConfig as K, type LogVisibility as L, getBuildType as M, getChainFromID as N, getComputeApiSession as O, getEnvironmentConfig as P, isBillingSessionValid as Q, isEnvironmentAvailable as R, type SessionInfo as S, isMainnet as T, UserApiClient as U, isSessionValid as V, isSiweMessageExpired as W, isSiweMessageNotYetValid as X, isSubscriptionActive as Y, loginToBillingApi as Z, loginToBothApis as _, SessionError as a, logoutFromBillingApi as a0, logoutFromBothApis as a1, logoutFromComputeApi as a2, parseSiweMessage as a3, sanitizeString as a4, sanitizeURL as a5, sanitizeXURL as a6, stripHexPrefix as a7, validateAppID as a8, validateAppName as a9, validateCreateAppParams as aa, validateDescription as ab, validateImageReference as ac, validateInstanceTypeSKU as ad, validateLogVisibility as ae, validateLogsParams as af, validatePrivateKeyFormat as ag, validateURL as ah, validateXURL as ai, type ResourceUsageMonitoring as aj, type AppRelease as ak, type AppReleaseBuild as al, type AppResponse as am, BASE_SEPOLIA_CHAIN_ID as an, type DeployParams as ao, type UpgradeParams as ap, assertValidFilePath as aq, createClients as ar, validateDeployParams as as, validateFilePath as at, validateImagePath as au, validateResourceUsageMonitoring as av, validateUpgradeParams as aw, 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 CreateAppParams as l, type ExecuteBatchOptions as m, type Execution as n, type LoginRequest as o, type LoginResult as p, type LogsParams as q, type SiweMessageResult as r, type UserApiClientOptions as s, addHexPrefix as t, assertValidImageReference as u, assertValidPrivateKey as v, checkERC7702Delegation as w, createSiweMessage as x, estimateBatchGas as y, executeBatch as z };
@@ -1,10 +1,11 @@
1
- import { E as EnvironmentConfig, a7 as SubscriptionStatus, f as BillingEnvironmentConfig, $ as ProductID, k as CreateSubscriptionOptions, l as CreateSubscriptionResponse, z as GetSubscriptionOptions, a0 as ProductSubscriptionResponse, M as PaymentMethodsResponse, m as CreditPurchaseResponse, G as GasEstimate, H as Logger } from './index-Bac4HjC0.cjs';
1
+ import { E as EnvironmentConfig, af as SubscriptionStatus, i as BillingEnvironmentConfig, a6 as ProductID, o as CreateSubscriptionOptions, p as CreateSubscriptionResponse, K as GetSubscriptionOptions, a7 as ProductSubscriptionResponse, V as PaymentMethodsResponse, q as CreditPurchaseResponse, n as CreateCouponResponse, P as ListCouponsResponse, J as GetCouponResponse, a as AddAdminResponse, O as ListAdminsResponse, a8 as RedeemCouponResponse, H as GasEstimate, Q as Logger } from './index-CLhRJNai.js';
2
2
  import { Address, Hex, 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
  */
@@ -800,6 +801,20 @@ declare class BillingApiClient {
800
801
  cancelSubscription(productId?: ProductID): Promise<void>;
801
802
  getPaymentMethods(): Promise<PaymentMethodsResponse>;
802
803
  purchaseCredits(amountCents: number, paymentMethodId?: string): Promise<CreditPurchaseResponse>;
804
+ createCoupon(amountCents: number): Promise<CreateCouponResponse>;
805
+ listCoupons(opts?: {
806
+ offset?: number;
807
+ limit?: number;
808
+ active?: boolean;
809
+ redeemed?: boolean;
810
+ }): Promise<ListCouponsResponse>;
811
+ getCoupon(id: string): Promise<GetCouponResponse>;
812
+ deactivateCoupon(id: string): Promise<void>;
813
+ redeemCouponForUser(id: string, address: string): Promise<void>;
814
+ addAdmin(address: string): Promise<AddAdminResponse>;
815
+ removeAdmin(address: string): Promise<void>;
816
+ listAdmins(): Promise<ListAdminsResponse>;
817
+ redeemCoupon(code: string): Promise<RedeemCouponResponse>;
803
818
  /**
804
819
  * Make an authenticated request to the billing API
805
820
  *
@@ -992,4 +1007,4 @@ declare function addHexPrefix(value: string): Hex;
992
1007
  */
993
1008
  declare function stripHexPrefix(value: string): string;
994
1009
 
995
- export { loginToComputeApi as $, type AppInfo as A, BillingApiClient as B, type ComputeApiConfig as C, extractAppNameFromImage as D, type EstimateBatchGasOptions as E, generateNewPrivateKey as F, type GeneratedKey as G, generateNonce as H, getAvailableEnvironments as I, getBillingApiSession as J, getBillingEnvironmentConfig as K, type LogVisibility as L, getBuildType as M, getChainFromID as N, getComputeApiSession as O, getEnvironmentConfig as P, isBillingSessionValid as Q, isEnvironmentAvailable as R, type SessionInfo as S, isMainnet as T, UserApiClient as U, isSessionValid as V, isSiweMessageExpired as W, isSiweMessageNotYetValid as X, isSubscriptionActive as Y, loginToBillingApi as Z, loginToBothApis as _, SessionError as a, logoutFromBillingApi as a0, logoutFromBothApis as a1, logoutFromComputeApi as a2, parseSiweMessage as a3, sanitizeString as a4, sanitizeURL as a5, sanitizeXURL as a6, stripHexPrefix as a7, validateAppID as a8, validateAppName as a9, validateCreateAppParams as aa, validateDescription as ab, validateImageReference as ac, validateInstanceTypeSKU as ad, validateLogVisibility as ae, validateLogsParams as af, validatePrivateKeyFormat as ag, validateURL as ah, validateXURL as ai, type ResourceUsageMonitoring as aj, type AppRelease as ak, type AppReleaseBuild as al, type AppResponse as am, type DeployParams as an, type UpgradeParams as ao, assertValidFilePath as ap, createClients as aq, validateDeployParams as ar, validateFilePath as as, validateImagePath as at, validateResourceUsageMonitoring as au, validateUpgradeParams as av, 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 CreateAppParams as l, type ExecuteBatchOptions as m, type Execution as n, type LoginRequest as o, type LoginResult as p, type LogsParams as q, type SiweMessageResult as r, type UserApiClientOptions as s, addHexPrefix as t, assertValidImageReference as u, assertValidPrivateKey as v, checkERC7702Delegation as w, createSiweMessage as x, estimateBatchGas as y, executeBatch as z };
1010
+ export { loginToComputeApi as $, type AppInfo as A, BillingApiClient as B, type ComputeApiConfig as C, extractAppNameFromImage as D, type EstimateBatchGasOptions as E, generateNewPrivateKey as F, type GeneratedKey as G, generateNonce as H, getAvailableEnvironments as I, getBillingApiSession as J, getBillingEnvironmentConfig as K, type LogVisibility as L, getBuildType as M, getChainFromID as N, getComputeApiSession as O, getEnvironmentConfig as P, isBillingSessionValid as Q, isEnvironmentAvailable as R, type SessionInfo as S, isMainnet as T, UserApiClient as U, isSessionValid as V, isSiweMessageExpired as W, isSiweMessageNotYetValid as X, isSubscriptionActive as Y, loginToBillingApi as Z, loginToBothApis as _, SessionError as a, logoutFromBillingApi as a0, logoutFromBothApis as a1, logoutFromComputeApi as a2, parseSiweMessage as a3, sanitizeString as a4, sanitizeURL as a5, sanitizeXURL as a6, stripHexPrefix as a7, validateAppID as a8, validateAppName as a9, validateCreateAppParams as aa, validateDescription as ab, validateImageReference as ac, validateInstanceTypeSKU as ad, validateLogVisibility as ae, validateLogsParams as af, validatePrivateKeyFormat as ag, validateURL as ah, validateXURL as ai, type ResourceUsageMonitoring as aj, type AppRelease as ak, type AppReleaseBuild as al, type AppResponse as am, BASE_SEPOLIA_CHAIN_ID as an, type DeployParams as ao, type UpgradeParams as ap, assertValidFilePath as aq, createClients as ar, validateDeployParams as as, validateFilePath as at, validateImagePath as au, validateResourceUsageMonitoring as av, validateUpgradeParams as aw, 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 CreateAppParams as l, type ExecuteBatchOptions as m, type Execution as n, type LoginRequest as o, type LoginResult as p, type LogsParams as q, type SiweMessageResult as r, type UserApiClientOptions as s, addHexPrefix as t, assertValidImageReference as u, assertValidPrivateKey as v, checkERC7702Delegation as w, createSiweMessage as x, estimateBatchGas as y, executeBatch as z };
@@ -616,6 +616,8 @@ interface EnvironmentConfig {
616
616
  defaultRPCURL: string;
617
617
  billingRPCURL?: string;
618
618
  usdcCreditsAddress?: Address;
619
+ baseUsdcCreditsAddress?: Address;
620
+ baseRPCURL?: string;
619
621
  }
620
622
  interface Release {
621
623
  rmsRelease: {
@@ -791,5 +793,38 @@ interface SequentialDeployResult {
791
793
  setPublicLogs?: Hex;
792
794
  };
793
795
  }
796
+ interface AdminCoupon {
797
+ id: string;
798
+ amountCents: number;
799
+ active: boolean;
800
+ redeemedBy: string;
801
+ redeemedAt: string | null;
802
+ createdBy: string;
803
+ createdAt: string;
804
+ }
805
+ interface CreateCouponResponse {
806
+ coupon: AdminCoupon;
807
+ }
808
+ interface ListCouponsResponse {
809
+ coupons: AdminCoupon[];
810
+ total: number;
811
+ }
812
+ interface GetCouponResponse {
813
+ coupon: AdminCoupon;
814
+ }
815
+ interface AdminUser {
816
+ id: string;
817
+ address: string;
818
+ createdAt: string;
819
+ }
820
+ interface AddAdminResponse {
821
+ admin: AdminUser;
822
+ }
823
+ interface ListAdminsResponse {
824
+ admins: AdminUser[];
825
+ }
826
+ interface RedeemCouponResponse {
827
+ amountCents: number;
828
+ }
794
829
 
795
- export { type ProductID as $, type AppId as A, type BatchedDeployResult as B, type CalculateAppIDOptions as C, type DeployAppOptions as D, type EnvironmentConfig as E, type IsDelegatedOptions as F, type GasEstimate as G, type Logger as H, type ImageDigestResult as I, type PaymentIssueResponse as J, type PaymentMethod as K, type LifecycleOpts as L, type PaymentMethodsResponse as M, type NoActiveSubscriptionResponse as N, type PrepareDeployBatchOptions as O, type ParsedEnvironment as P, type PrepareDeployFromVerifiableBuildOpts as Q, type PrepareDeployOpts as R, type PrepareUpgradeBatchOptions as S, type PrepareUpgradeFromVerifiableBuildOpts as T, type PrepareUpgradeOpts as U, type PreparedDeploy as V, type PreparedDeployBatch as W, type PreparedDeployData as X, type PreparedUpgrade as Y, type PreparedUpgradeBatch as Z, type PreparedUpgradeData as _, type AlreadyActiveResponse as a, type ProductSubscriptionResponse as a0, type Release as a1, type SendTransactionOptions as a2, type SequentialDeployResult as a3, type SubscribeResponse as a4, type SubscriptionLineItem as a5, type SubscriptionOpts as a6, type SubscriptionStatus as a7, type SuspendOptions as a8, type UndelegateOptions as a9, undelegate as aA, upgradeApp as aB, getAppLatestReleaseBlockNumbers as aC, getBlockTimestamps as aD, type UpgradeAppOptions as aa, type UpgradeAppOpts as ab, calculateAppID as ac, deployApp as ad, estimateTransactionGas as ae, executeDeployBatch as af, executeDeployBatched as ag, executeDeploySequential as ah, executeUpgradeBatch as ai, formatETH as aj, getActiveAppCount as ak, getAllAppsByDeveloper as al, getAppsByBillingAccount as am, getAppsByCreator as an, getAppsByDeveloper as ao, getBillingType as ap, getMaxActiveAppsPerUser as aq, isDelegated as ar, type logVisibility as as, noopLogger as at, prepareDeployBatch as au, prepareUpgradeBatch as av, sendAndWaitForTransaction as aw, supportsEIP5792 as ax, supportsEIP7702 as ay, suspend as az, type AppConfig as b, type AppProfile as c, type AppProfileResponse as d, type AppRecord as e, type BillingEnvironmentConfig as f, type CancelResponse as g, type CancelSuccessResponse as h, type ChainID as i, type CheckoutCreatedResponse as j, type CreateSubscriptionOptions as k, type CreateSubscriptionResponse as l, type CreditPurchaseResponse as m, type DeployAppOpts as n, type DeployOptions as o, type DeployProgressCallback as p, type DeployResult as q, type DeployStep as r, type DockerImageConfig as s, type EstimateGasOptions as t, type ExecuteDeployBatchedOptions as u, type ExecuteDeployResult as v, type ExecuteDeploySequentialOptions as w, type ExecuteUpgradeResult as x, type GasOpts as y, type GetSubscriptionOptions as z };
830
+ export { type PrepareUpgradeOpts as $, type AppId as A, type BatchedDeployResult as B, type CalculateAppIDOptions as C, type DeployAppOptions as D, type EnvironmentConfig as E, type ExecuteDeploySequentialOptions as F, type ExecuteUpgradeResult as G, type GasEstimate as H, type GasOpts as I, type GetCouponResponse as J, type GetSubscriptionOptions as K, type ImageDigestResult as L, type IsDelegatedOptions as M, type LifecycleOpts as N, type ListAdminsResponse as O, type ListCouponsResponse as P, type Logger as Q, type NoActiveSubscriptionResponse as R, type ParsedEnvironment as S, type PaymentIssueResponse as T, type PaymentMethod as U, type PaymentMethodsResponse as V, type PrepareDeployBatchOptions as W, type PrepareDeployFromVerifiableBuildOpts as X, type PrepareDeployOpts as Y, type PrepareUpgradeBatchOptions as Z, type PrepareUpgradeFromVerifiableBuildOpts as _, type AddAdminResponse as a, type PreparedDeploy as a0, type PreparedDeployBatch as a1, type PreparedDeployData as a2, type PreparedUpgrade as a3, type PreparedUpgradeBatch as a4, type PreparedUpgradeData as a5, type ProductID as a6, type ProductSubscriptionResponse as a7, type RedeemCouponResponse as a8, type Release as a9, type logVisibility as aA, noopLogger as aB, prepareDeployBatch as aC, prepareUpgradeBatch as aD, sendAndWaitForTransaction as aE, supportsEIP5792 as aF, supportsEIP7702 as aG, suspend as aH, undelegate as aI, upgradeApp as aJ, getAppLatestReleaseBlockNumbers as aK, getBlockTimestamps as aL, type SendTransactionOptions as aa, type SequentialDeployResult as ab, type SubscribeResponse as ac, type SubscriptionLineItem as ad, type SubscriptionOpts as ae, type SubscriptionStatus as af, type SuspendOptions as ag, type UndelegateOptions as ah, type UpgradeAppOptions as ai, type UpgradeAppOpts as aj, calculateAppID as ak, deployApp as al, estimateTransactionGas as am, executeDeployBatch as an, executeDeployBatched as ao, executeDeploySequential as ap, executeUpgradeBatch as aq, formatETH as ar, getActiveAppCount as as, getAllAppsByDeveloper as at, getAppsByBillingAccount as au, getAppsByCreator as av, getAppsByDeveloper as aw, getBillingType as ax, getMaxActiveAppsPerUser as ay, isDelegated as az, type AdminCoupon as b, type AdminUser as c, type AlreadyActiveResponse as d, type AppConfig as e, type AppProfile as f, type AppProfileResponse as g, type AppRecord as h, type BillingEnvironmentConfig as i, type CancelResponse as j, type CancelSuccessResponse as k, type ChainID as l, type CheckoutCreatedResponse as m, type CreateCouponResponse as n, type CreateSubscriptionOptions as o, type CreateSubscriptionResponse as p, type CreditPurchaseResponse as q, type DeployAppOpts as r, type DeployOptions as s, type DeployProgressCallback as t, type DeployResult as u, type DeployStep as v, type DockerImageConfig as w, type EstimateGasOptions as x, type ExecuteDeployBatchedOptions as y, type ExecuteDeployResult as z };
@@ -616,6 +616,8 @@ interface EnvironmentConfig {
616
616
  defaultRPCURL: string;
617
617
  billingRPCURL?: string;
618
618
  usdcCreditsAddress?: Address;
619
+ baseUsdcCreditsAddress?: Address;
620
+ baseRPCURL?: string;
619
621
  }
620
622
  interface Release {
621
623
  rmsRelease: {
@@ -791,5 +793,38 @@ interface SequentialDeployResult {
791
793
  setPublicLogs?: Hex;
792
794
  };
793
795
  }
796
+ interface AdminCoupon {
797
+ id: string;
798
+ amountCents: number;
799
+ active: boolean;
800
+ redeemedBy: string;
801
+ redeemedAt: string | null;
802
+ createdBy: string;
803
+ createdAt: string;
804
+ }
805
+ interface CreateCouponResponse {
806
+ coupon: AdminCoupon;
807
+ }
808
+ interface ListCouponsResponse {
809
+ coupons: AdminCoupon[];
810
+ total: number;
811
+ }
812
+ interface GetCouponResponse {
813
+ coupon: AdminCoupon;
814
+ }
815
+ interface AdminUser {
816
+ id: string;
817
+ address: string;
818
+ createdAt: string;
819
+ }
820
+ interface AddAdminResponse {
821
+ admin: AdminUser;
822
+ }
823
+ interface ListAdminsResponse {
824
+ admins: AdminUser[];
825
+ }
826
+ interface RedeemCouponResponse {
827
+ amountCents: number;
828
+ }
794
829
 
795
- export { type ProductID as $, type AppId as A, type BatchedDeployResult as B, type CalculateAppIDOptions as C, type DeployAppOptions as D, type EnvironmentConfig as E, type IsDelegatedOptions as F, type GasEstimate as G, type Logger as H, type ImageDigestResult as I, type PaymentIssueResponse as J, type PaymentMethod as K, type LifecycleOpts as L, type PaymentMethodsResponse as M, type NoActiveSubscriptionResponse as N, type PrepareDeployBatchOptions as O, type ParsedEnvironment as P, type PrepareDeployFromVerifiableBuildOpts as Q, type PrepareDeployOpts as R, type PrepareUpgradeBatchOptions as S, type PrepareUpgradeFromVerifiableBuildOpts as T, type PrepareUpgradeOpts as U, type PreparedDeploy as V, type PreparedDeployBatch as W, type PreparedDeployData as X, type PreparedUpgrade as Y, type PreparedUpgradeBatch as Z, type PreparedUpgradeData as _, type AlreadyActiveResponse as a, type ProductSubscriptionResponse as a0, type Release as a1, type SendTransactionOptions as a2, type SequentialDeployResult as a3, type SubscribeResponse as a4, type SubscriptionLineItem as a5, type SubscriptionOpts as a6, type SubscriptionStatus as a7, type SuspendOptions as a8, type UndelegateOptions as a9, undelegate as aA, upgradeApp as aB, getAppLatestReleaseBlockNumbers as aC, getBlockTimestamps as aD, type UpgradeAppOptions as aa, type UpgradeAppOpts as ab, calculateAppID as ac, deployApp as ad, estimateTransactionGas as ae, executeDeployBatch as af, executeDeployBatched as ag, executeDeploySequential as ah, executeUpgradeBatch as ai, formatETH as aj, getActiveAppCount as ak, getAllAppsByDeveloper as al, getAppsByBillingAccount as am, getAppsByCreator as an, getAppsByDeveloper as ao, getBillingType as ap, getMaxActiveAppsPerUser as aq, isDelegated as ar, type logVisibility as as, noopLogger as at, prepareDeployBatch as au, prepareUpgradeBatch as av, sendAndWaitForTransaction as aw, supportsEIP5792 as ax, supportsEIP7702 as ay, suspend as az, type AppConfig as b, type AppProfile as c, type AppProfileResponse as d, type AppRecord as e, type BillingEnvironmentConfig as f, type CancelResponse as g, type CancelSuccessResponse as h, type ChainID as i, type CheckoutCreatedResponse as j, type CreateSubscriptionOptions as k, type CreateSubscriptionResponse as l, type CreditPurchaseResponse as m, type DeployAppOpts as n, type DeployOptions as o, type DeployProgressCallback as p, type DeployResult as q, type DeployStep as r, type DockerImageConfig as s, type EstimateGasOptions as t, type ExecuteDeployBatchedOptions as u, type ExecuteDeployResult as v, type ExecuteDeploySequentialOptions as w, type ExecuteUpgradeResult as x, type GasOpts as y, type GetSubscriptionOptions as z };
830
+ export { type PrepareUpgradeOpts as $, type AppId as A, type BatchedDeployResult as B, type CalculateAppIDOptions as C, type DeployAppOptions as D, type EnvironmentConfig as E, type ExecuteDeploySequentialOptions as F, type ExecuteUpgradeResult as G, type GasEstimate as H, type GasOpts as I, type GetCouponResponse as J, type GetSubscriptionOptions as K, type ImageDigestResult as L, type IsDelegatedOptions as M, type LifecycleOpts as N, type ListAdminsResponse as O, type ListCouponsResponse as P, type Logger as Q, type NoActiveSubscriptionResponse as R, type ParsedEnvironment as S, type PaymentIssueResponse as T, type PaymentMethod as U, type PaymentMethodsResponse as V, type PrepareDeployBatchOptions as W, type PrepareDeployFromVerifiableBuildOpts as X, type PrepareDeployOpts as Y, type PrepareUpgradeBatchOptions as Z, type PrepareUpgradeFromVerifiableBuildOpts as _, type AddAdminResponse as a, type PreparedDeploy as a0, type PreparedDeployBatch as a1, type PreparedDeployData as a2, type PreparedUpgrade as a3, type PreparedUpgradeBatch as a4, type PreparedUpgradeData as a5, type ProductID as a6, type ProductSubscriptionResponse as a7, type RedeemCouponResponse as a8, type Release as a9, type logVisibility as aA, noopLogger as aB, prepareDeployBatch as aC, prepareUpgradeBatch as aD, sendAndWaitForTransaction as aE, supportsEIP5792 as aF, supportsEIP7702 as aG, suspend as aH, undelegate as aI, upgradeApp as aJ, getAppLatestReleaseBlockNumbers as aK, getBlockTimestamps as aL, type SendTransactionOptions as aa, type SequentialDeployResult as ab, type SubscribeResponse as ac, type SubscriptionLineItem as ad, type SubscriptionOpts as ae, type SubscriptionStatus as af, type SuspendOptions as ag, type UndelegateOptions as ah, type UpgradeAppOptions as ai, type UpgradeAppOpts as aj, calculateAppID as ak, deployApp as al, estimateTransactionGas as am, executeDeployBatch as an, executeDeployBatched as ao, executeDeploySequential as ap, executeUpgradeBatch as aq, formatETH as ar, getActiveAppCount as as, getAllAppsByDeveloper as at, getAppsByBillingAccount as au, getAppsByCreator as av, getAppsByDeveloper as aw, getBillingType as ax, getMaxActiveAppsPerUser as ay, isDelegated as az, type AdminCoupon as b, type AdminUser as c, type AlreadyActiveResponse as d, type AppConfig as e, type AppProfile as f, type AppProfileResponse as g, type AppRecord as h, type BillingEnvironmentConfig as i, type CancelResponse as j, type CancelSuccessResponse as k, type ChainID as l, type CheckoutCreatedResponse as m, type CreateCouponResponse as n, type CreateSubscriptionOptions as o, type CreateSubscriptionResponse as p, type CreditPurchaseResponse as q, type DeployAppOpts as r, type DeployOptions as s, type DeployProgressCallback as t, type DeployResult as u, type DeployStep as v, type DockerImageConfig as w, type EstimateGasOptions as x, type ExecuteDeployBatchedOptions as y, type ExecuteDeployResult as z };
package/dist/index.cjs CHANGED
@@ -164,6 +164,7 @@ var index_exports = {};
164
164
  __export(index_exports, {
165
165
  AttestClient: () => AttestClient,
166
166
  AuthRequiredError: () => AuthRequiredError,
167
+ BASE_SEPOLIA_CHAIN_ID: () => BASE_SEPOLIA_CHAIN_ID,
167
168
  BUILD_STATUS: () => BUILD_STATUS,
168
169
  BadRequestError: () => BadRequestError,
169
170
  BillingApiClient: () => BillingApiClient,
@@ -189,6 +190,7 @@ __export(index_exports, {
189
190
  assertValidPrivateKey: () => assertValidPrivateKey,
190
191
  calculateAppID: () => calculateAppID,
191
192
  checkERC7702Delegation: () => checkERC7702Delegation,
193
+ createAdminModule: () => createAdminModule,
192
194
  createApp: () => createApp,
193
195
  createAppEnvironment: () => createAppEnvironment,
194
196
  createBillingModule: () => createBillingModule,
@@ -292,7 +294,7 @@ var import_util = require("util");
292
294
 
293
295
  // src/client/common/constants.ts
294
296
  var import_chains = require("viem/chains");
295
- var SUPPORTED_CHAINS = [import_chains.mainnet, import_chains.sepolia];
297
+ var SUPPORTED_CHAINS = [import_chains.mainnet, import_chains.sepolia, import_chains.baseSepolia];
296
298
  var DOCKER_PLATFORM = "linux/amd64";
297
299
  var REGISTRY_PROPAGATION_WAIT_SECONDS = 3;
298
300
  var LAYERED_DOCKERFILE_NAME = "Dockerfile.eigencompute";
@@ -4986,7 +4988,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
4986
4988
  var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
4987
4989
  var CanUpdateAppProfilePermission = "0x036fef61";
4988
4990
  function getDefaultClientId() {
4989
- const version = true ? "1.0.0-dev.3" : "0.0.0";
4991
+ const version = true ? "1.0.0-dev.5" : "0.0.0";
4990
4992
  return `ecloud-sdk/v${version}`;
4991
4993
  }
4992
4994
  var UserApiClient = class {
@@ -5745,6 +5747,7 @@ function validateLogsParams(params) {
5745
5747
  // src/client/common/config/environment.ts
5746
5748
  var SEPOLIA_CHAIN_ID = 11155111;
5747
5749
  var MAINNET_CHAIN_ID = 1;
5750
+ var BASE_SEPOLIA_CHAIN_ID = 84532;
5748
5751
  var CommonAddresses = {
5749
5752
  ERC7702Delegator: "0x63c0c19a282a1b52b07dd5a65b58948a07dae32b"
5750
5753
  };
@@ -5774,7 +5777,9 @@ var ENVIRONMENTS = {
5774
5777
  kmsServerURL: "http://10.128.0.57:8080",
5775
5778
  userApiServerURL: "https://userapi-compute-sepolia-dev.eigencloud.xyz",
5776
5779
  defaultRPCURL: "https://ethereum-sepolia-rpc.publicnode.com",
5777
- usdcCreditsAddress: "0xbdA3897c3A428763B59015C64AB766c288C97376"
5780
+ usdcCreditsAddress: "0xbdA3897c3A428763B59015C64AB766c288C97376",
5781
+ baseUsdcCreditsAddress: "0x7673a47463F80c6a3553Db9E54c8cDcd5313d0ac",
5782
+ baseRPCURL: "https://base-sepolia-rpc.publicnode.com"
5778
5783
  },
5779
5784
  sepolia: {
5780
5785
  name: "sepolia",
@@ -5786,7 +5791,9 @@ var ENVIRONMENTS = {
5786
5791
  userApiServerURL: "https://userapi-compute-sepolia-prod.eigencloud.xyz",
5787
5792
  defaultRPCURL: "https://ethereum-sepolia-rpc.publicnode.com",
5788
5793
  billingRPCURL: "https://ethereum-rpc.publicnode.com",
5789
- usdcCreditsAddress: "0xed9c88640ca9149Bd9f7ee6620074af10F2E145d"
5794
+ usdcCreditsAddress: "0xed9c88640ca9149Bd9f7ee6620074af10F2E145d",
5795
+ baseUsdcCreditsAddress: "0x7673a47463F80c6a3553Db9E54c8cDcd5313d0ac",
5796
+ baseRPCURL: "https://base-sepolia-rpc.publicnode.com"
5790
5797
  },
5791
5798
  "mainnet-alpha": {
5792
5799
  name: "mainnet-alpha",
@@ -6174,6 +6181,63 @@ var BillingApiClient = class {
6174
6181
  return resp.json();
6175
6182
  }
6176
6183
  // ==========================================================================
6184
+ // Admin - Coupon Methods
6185
+ // ==========================================================================
6186
+ async createCoupon(amountCents) {
6187
+ const endpoint = `${this.config.billingApiServerURL}/admin/coupons`;
6188
+ const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { amountCents });
6189
+ return resp.json();
6190
+ }
6191
+ async listCoupons(opts) {
6192
+ const params = new URLSearchParams();
6193
+ if (opts?.offset !== void 0) params.set("offset", opts.offset.toString());
6194
+ if (opts?.limit !== void 0) params.set("limit", opts.limit.toString());
6195
+ if (opts?.active !== void 0) params.set("active", opts.active.toString());
6196
+ if (opts?.redeemed !== void 0) params.set("redeemed", opts.redeemed.toString());
6197
+ const qs = params.toString();
6198
+ const endpoint = `${this.config.billingApiServerURL}/admin/coupons${qs ? `?${qs}` : ""}`;
6199
+ const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
6200
+ return resp.json();
6201
+ }
6202
+ async getCoupon(id) {
6203
+ const endpoint = `${this.config.billingApiServerURL}/admin/coupons/${id}`;
6204
+ const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
6205
+ return resp.json();
6206
+ }
6207
+ async deactivateCoupon(id) {
6208
+ const endpoint = `${this.config.billingApiServerURL}/admin/coupons/${id}/deactivate`;
6209
+ await this.makeAuthenticatedRequest(endpoint, "POST", "compute");
6210
+ }
6211
+ async redeemCouponForUser(id, address) {
6212
+ const endpoint = `${this.config.billingApiServerURL}/admin/coupons/${id}/redeem`;
6213
+ await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { address });
6214
+ }
6215
+ // ==========================================================================
6216
+ // Admin - Admin Management Methods
6217
+ // ==========================================================================
6218
+ async addAdmin(address) {
6219
+ const endpoint = `${this.config.billingApiServerURL}/admin/admins`;
6220
+ const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { address });
6221
+ return resp.json();
6222
+ }
6223
+ async removeAdmin(address) {
6224
+ const endpoint = `${this.config.billingApiServerURL}/admin/admins/${address}`;
6225
+ await this.makeAuthenticatedRequest(endpoint, "DELETE", "compute");
6226
+ }
6227
+ async listAdmins() {
6228
+ const endpoint = `${this.config.billingApiServerURL}/admin/admins`;
6229
+ const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
6230
+ return resp.json();
6231
+ }
6232
+ // ==========================================================================
6233
+ // User - Coupon Redemption
6234
+ // ==========================================================================
6235
+ async redeemCoupon(code) {
6236
+ const endpoint = `${this.config.billingApiServerURL}/v1/coupons/redeem`;
6237
+ const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { code });
6238
+ return resp.json();
6239
+ }
6240
+ // ==========================================================================
6177
6241
  // Internal Methods
6178
6242
  // ==========================================================================
6179
6243
  /**
@@ -8379,7 +8443,7 @@ var ERC20_default = [
8379
8443
 
8380
8444
  // src/client/modules/billing/index.ts
8381
8445
  function createBillingModule(config) {
8382
- const { verbose = false, skipTelemetry = false, walletClient, publicClient, environment } = config;
8446
+ const { verbose = false, skipTelemetry = false, walletClient, publicClient, environment, privateKey } = config;
8383
8447
  if (!walletClient.account) {
8384
8448
  throw new Error("WalletClient must have an account attached");
8385
8449
  }
@@ -8388,35 +8452,69 @@ function createBillingModule(config) {
8388
8452
  const billingEnvConfig = getBillingEnvironmentConfig(getBuildType());
8389
8453
  const billingApi = new BillingApiClient(billingEnvConfig, walletClient, { verbose });
8390
8454
  const environmentConfig = getEnvironmentConfig(environment);
8391
- const usdcCreditsAddress = environmentConfig.usdcCreditsAddress;
8392
- if (!usdcCreditsAddress) {
8455
+ if (!environmentConfig.usdcCreditsAddress) {
8393
8456
  throw new Error(`USDCCredits contract address not configured for environment "${environment}"`);
8394
8457
  }
8458
+ const usdcCreditsAddress = environmentConfig.usdcCreditsAddress;
8459
+ const baseUsdcCreditsAddress = environmentConfig.baseUsdcCreditsAddress;
8460
+ const baseRPCURL = environmentConfig.baseRPCURL;
8461
+ function resolveChainConfig(chain) {
8462
+ if (chain === "base") {
8463
+ if (!baseUsdcCreditsAddress || !baseRPCURL) {
8464
+ throw new Error(`Base chain not configured for environment "${environment}"`);
8465
+ }
8466
+ if (!privateKey) {
8467
+ throw new Error("Private key required for Base chain transactions");
8468
+ }
8469
+ const baseClients = createClients({
8470
+ privateKey,
8471
+ rpcUrl: baseRPCURL,
8472
+ chainId: BigInt(BASE_SEPOLIA_CHAIN_ID)
8473
+ });
8474
+ return {
8475
+ pub: baseClients.publicClient,
8476
+ wallet: baseClients.walletClient,
8477
+ creditsAddress: baseUsdcCreditsAddress,
8478
+ envConfig: {
8479
+ ...environmentConfig,
8480
+ chainID: BigInt(BASE_SEPOLIA_CHAIN_ID),
8481
+ defaultRPCURL: baseRPCURL
8482
+ }
8483
+ };
8484
+ }
8485
+ return {
8486
+ pub: publicClient,
8487
+ wallet: walletClient,
8488
+ creditsAddress: usdcCreditsAddress,
8489
+ envConfig: environmentConfig
8490
+ };
8491
+ }
8395
8492
  const module2 = {
8396
8493
  address,
8397
- async getTopUpInfo() {
8398
- const usdcAddress = await publicClient.readContract({
8399
- address: usdcCreditsAddress,
8494
+ async getTopUpInfo(opts) {
8495
+ const { pub, creditsAddress } = resolveChainConfig(opts?.chain);
8496
+ const usdcAddress = await pub.readContract({
8497
+ address: creditsAddress,
8400
8498
  abi: USDCCredits_default,
8401
8499
  functionName: "usdc"
8402
8500
  });
8403
8501
  const [minimumPurchase, usdcBalance, currentAllowance] = await Promise.all([
8404
- publicClient.readContract({
8405
- address: usdcCreditsAddress,
8502
+ pub.readContract({
8503
+ address: creditsAddress,
8406
8504
  abi: USDCCredits_default,
8407
8505
  functionName: "minimumPurchase"
8408
8506
  }),
8409
- publicClient.readContract({
8507
+ pub.readContract({
8410
8508
  address: usdcAddress,
8411
8509
  abi: ERC20_default,
8412
8510
  functionName: "balanceOf",
8413
8511
  args: [address]
8414
8512
  }),
8415
- publicClient.readContract({
8513
+ pub.readContract({
8416
8514
  address: usdcAddress,
8417
8515
  abi: ERC20_default,
8418
8516
  functionName: "allowance",
8419
- args: [address, usdcCreditsAddress]
8517
+ args: [address, creditsAddress]
8420
8518
  })
8421
8519
  ]);
8422
8520
  return { usdcAddress, minimumPurchase, usdcBalance, currentAllowance };
@@ -8426,11 +8524,12 @@ function createBillingModule(config) {
8426
8524
  {
8427
8525
  functionName: "topUp",
8428
8526
  skipTelemetry,
8429
- properties: { amount: opts.amount.toString() }
8527
+ properties: { amount: opts.amount.toString(), chain: opts.chain || "ethereum" }
8430
8528
  },
8431
8529
  async () => {
8432
8530
  const targetAccount = opts.account ?? address;
8433
- const { usdcAddress, currentAllowance } = await module2.getTopUpInfo();
8531
+ const { pub, wallet, creditsAddress, envConfig } = resolveChainConfig(opts.chain);
8532
+ const { usdcAddress, currentAllowance } = await module2.getTopUpInfo({ chain: opts.chain });
8434
8533
  const executions = [];
8435
8534
  if (currentAllowance < opts.amount) {
8436
8535
  executions.push({
@@ -8439,12 +8538,12 @@ function createBillingModule(config) {
8439
8538
  callData: (0, import_viem7.encodeFunctionData)({
8440
8539
  abi: ERC20_default,
8441
8540
  functionName: "approve",
8442
- args: [usdcCreditsAddress, opts.amount]
8541
+ args: [creditsAddress, opts.amount]
8443
8542
  })
8444
8543
  });
8445
8544
  }
8446
8545
  executions.push({
8447
- target: usdcCreditsAddress,
8546
+ target: creditsAddress,
8448
8547
  value: 0n,
8449
8548
  callData: (0, import_viem7.encodeFunctionData)({
8450
8549
  abi: USDCCredits_default,
@@ -8454,9 +8553,9 @@ function createBillingModule(config) {
8454
8553
  });
8455
8554
  const txHash = await executeBatch(
8456
8555
  {
8457
- walletClient,
8458
- publicClient,
8459
- environmentConfig,
8556
+ walletClient: wallet,
8557
+ publicClient: pub,
8558
+ environmentConfig: envConfig,
8460
8559
  executions,
8461
8560
  pendingMessage: "Submitting credit purchase..."
8462
8561
  },
@@ -8556,6 +8655,12 @@ function createBillingModule(config) {
8556
8655
  },
8557
8656
  async purchaseCredits(amountCents, paymentMethodId) {
8558
8657
  return billingApi.purchaseCredits(amountCents, paymentMethodId);
8658
+ },
8659
+ hasBaseSupport() {
8660
+ return !!baseUsdcCreditsAddress && !!baseRPCURL;
8661
+ },
8662
+ async redeemCoupon(code) {
8663
+ return billingApi.redeemCoupon(code);
8559
8664
  }
8560
8665
  };
8561
8666
  return module2;
@@ -8991,6 +9096,44 @@ function transformVerifyResult(raw) {
8991
9096
  };
8992
9097
  }
8993
9098
 
9099
+ // src/client/modules/admin/index.ts
9100
+ function createAdminModule(config) {
9101
+ const { verbose = false, walletClient } = config;
9102
+ if (!walletClient.account) {
9103
+ throw new Error("WalletClient must have an account attached");
9104
+ }
9105
+ const address = walletClient.account.address;
9106
+ const billingEnvConfig = getBillingEnvironmentConfig(getBuildType());
9107
+ const billingApi = new BillingApiClient(billingEnvConfig, walletClient, { verbose });
9108
+ return {
9109
+ address,
9110
+ async createCoupon(amountCents) {
9111
+ return billingApi.createCoupon(amountCents);
9112
+ },
9113
+ async listCoupons(opts) {
9114
+ return billingApi.listCoupons(opts);
9115
+ },
9116
+ async getCoupon(id) {
9117
+ return billingApi.getCoupon(id);
9118
+ },
9119
+ async deactivateCoupon(id) {
9120
+ return billingApi.deactivateCoupon(id);
9121
+ },
9122
+ async redeemCouponForUser(id, userAddress) {
9123
+ return billingApi.redeemCouponForUser(id, userAddress);
9124
+ },
9125
+ async addAdmin(adminAddress) {
9126
+ return billingApi.addAdmin(adminAddress);
9127
+ },
9128
+ async removeAdmin(adminAddress) {
9129
+ return billingApi.removeAdmin(adminAddress);
9130
+ },
9131
+ async listAdmins() {
9132
+ return billingApi.listAdmins();
9133
+ }
9134
+ };
9135
+ }
9136
+
8994
9137
  // src/client/common/auth/keyring.ts
8995
9138
  var import_keyring = require("@napi-rs/keyring");
8996
9139
  var import_accounts2 = require("viem/accounts");
@@ -9529,6 +9672,7 @@ var JwtProvider = class {
9529
9672
  0 && (module.exports = {
9530
9673
  AttestClient,
9531
9674
  AuthRequiredError,
9675
+ BASE_SEPOLIA_CHAIN_ID,
9532
9676
  BUILD_STATUS,
9533
9677
  BadRequestError,
9534
9678
  BillingApiClient,
@@ -9554,6 +9698,7 @@ var JwtProvider = class {
9554
9698
  assertValidPrivateKey,
9555
9699
  calculateAppID,
9556
9700
  checkERC7702Delegation,
9701
+ createAdminModule,
9557
9702
  createApp,
9558
9703
  createAppEnvironment,
9559
9704
  createBillingModule,