@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.cjs CHANGED
@@ -330,6 +330,12 @@ var CHAIN_ID_TO_ENVIRONMENT = {
330
330
  [SEPOLIA_CHAIN_ID.toString()]: "sepolia",
331
331
  [MAINNET_CHAIN_ID.toString()]: "mainnet-alpha"
332
332
  };
333
+ function getApiUrlOverride() {
334
+ const raw = process.env.ECLOUD_API_URL;
335
+ if (!raw) return void 0;
336
+ const trimmed = raw.trim().replace(/\/+$/, "");
337
+ return trimmed.length > 0 ? trimmed : void 0;
338
+ }
333
339
  function getEnvironmentConfig(environment, chainID) {
334
340
  const env = ENVIRONMENTS[environment];
335
341
  if (!env) {
@@ -347,9 +353,11 @@ function getEnvironmentConfig(environment, chainID) {
347
353
  }
348
354
  }
349
355
  const resolvedChainID = chainID || (environment === "sepolia" || environment === "sepolia-dev" ? SEPOLIA_CHAIN_ID : MAINNET_CHAIN_ID);
356
+ const apiUrlOverride = getApiUrlOverride();
350
357
  return {
351
358
  ...env,
352
- chainID: BigInt(resolvedChainID)
359
+ chainID: BigInt(resolvedChainID),
360
+ ...apiUrlOverride ? { userApiServerURL: apiUrlOverride } : {}
353
361
  };
354
362
  }
355
363
  function getBillingEnvironmentConfig(build) {
@@ -357,10 +365,14 @@ function getBillingEnvironmentConfig(build) {
357
365
  if (!config) {
358
366
  throw new Error(`Unknown billing environment: ${build}`);
359
367
  }
368
+ const apiUrlOverride = getApiUrlOverride();
369
+ if (apiUrlOverride) {
370
+ return { billingApiServerURL: apiUrlOverride };
371
+ }
360
372
  return config;
361
373
  }
362
374
  function getBuildType() {
363
- const buildTimeType = true ? "prod"?.toLowerCase() : void 0;
375
+ const buildTimeType = true ? "dev"?.toLowerCase() : void 0;
364
376
  const runtimeType = process.env.BUILD_TYPE?.toLowerCase();
365
377
  const buildType = buildTimeType || runtimeType;
366
378
  if (buildType === "dev") {
@@ -717,7 +729,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
717
729
  var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
718
730
  var CanUpdateAppProfilePermission = "0x036fef61";
719
731
  function getDefaultClientId() {
720
- const version = true ? "0.5.0" : "0.0.0";
732
+ const version = true ? "1.0.0-dev.2" : "0.0.0";
721
733
  return `ecloud-sdk/v${version}`;
722
734
  }
723
735
  var UserApiClient = class {