@layr-labs/ecloud-sdk 0.5.0 → 1.0.0-dev.2

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/dist/browser.js CHANGED
@@ -219,6 +219,12 @@ var CHAIN_ID_TO_ENVIRONMENT = {
219
219
  [SEPOLIA_CHAIN_ID.toString()]: "sepolia",
220
220
  [MAINNET_CHAIN_ID.toString()]: "mainnet-alpha"
221
221
  };
222
+ function getApiUrlOverride() {
223
+ const raw = process.env.ECLOUD_API_URL;
224
+ if (!raw) return void 0;
225
+ const trimmed = raw.trim().replace(/\/+$/, "");
226
+ return trimmed.length > 0 ? trimmed : void 0;
227
+ }
222
228
  function getEnvironmentConfig(environment, chainID) {
223
229
  const env = ENVIRONMENTS[environment];
224
230
  if (!env) {
@@ -236,9 +242,11 @@ function getEnvironmentConfig(environment, chainID) {
236
242
  }
237
243
  }
238
244
  const resolvedChainID = chainID || (environment === "sepolia" || environment === "sepolia-dev" ? SEPOLIA_CHAIN_ID : MAINNET_CHAIN_ID);
245
+ const apiUrlOverride = getApiUrlOverride();
239
246
  return {
240
247
  ...env,
241
- chainID: BigInt(resolvedChainID)
248
+ chainID: BigInt(resolvedChainID),
249
+ ...apiUrlOverride ? { userApiServerURL: apiUrlOverride } : {}
242
250
  };
243
251
  }
244
252
  function getBillingEnvironmentConfig(build) {
@@ -246,10 +254,14 @@ function getBillingEnvironmentConfig(build) {
246
254
  if (!config) {
247
255
  throw new Error(`Unknown billing environment: ${build}`);
248
256
  }
257
+ const apiUrlOverride = getApiUrlOverride();
258
+ if (apiUrlOverride) {
259
+ return { billingApiServerURL: apiUrlOverride };
260
+ }
249
261
  return config;
250
262
  }
251
263
  function getBuildType() {
252
- const buildTimeType = true ? "prod"?.toLowerCase() : void 0;
264
+ const buildTimeType = true ? "dev"?.toLowerCase() : void 0;
253
265
  const runtimeType = process.env.BUILD_TYPE?.toLowerCase();
254
266
  const buildType = buildTimeType || runtimeType;
255
267
  if (buildType === "dev") {
@@ -606,7 +618,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
606
618
  var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
607
619
  var CanUpdateAppProfilePermission = "0x036fef61";
608
620
  function getDefaultClientId() {
609
- const version = true ? "0.5.0" : "0.0.0";
621
+ const version = true ? "1.0.0-dev.2" : "0.0.0";
610
622
  return `ecloud-sdk/v${version}`;
611
623
  }
612
624
  var UserApiClient = class {