@layr-labs/ecloud-sdk 1.0.0-dev.1 → 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/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
359
  chainID: BigInt(resolvedChainID),
360
+ ...apiUrlOverride ? { userApiServerURL: apiUrlOverride } : {},
353
361
  ...process.env.ECLOUD_USER_API_URL && {
354
362
  userApiServerURL: process.env.ECLOUD_USER_API_URL
355
363
  },
@@ -363,6 +371,10 @@ function getBillingEnvironmentConfig(build) {
363
371
  if (!config) {
364
372
  throw new Error(`Unknown billing environment: ${build}`);
365
373
  }
374
+ const apiUrlOverride = getApiUrlOverride();
375
+ if (apiUrlOverride) {
376
+ return { billingApiServerURL: apiUrlOverride };
377
+ }
366
378
  return {
367
379
  ...config,
368
380
  ...process.env.ECLOUD_BILLING_API_URL && {
@@ -728,7 +740,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
728
740
  var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
729
741
  var CanUpdateAppProfilePermission = "0x036fef61";
730
742
  function getDefaultClientId() {
731
- const version = true ? "1.0.0-dev.1" : "0.0.0";
743
+ const version = true ? "1.0.0-dev.3" : "0.0.0";
732
744
  return `ecloud-sdk/v${version}`;
733
745
  }
734
746
  var UserApiClient = class {
@@ -1341,6 +1353,9 @@ var BillingApiClient = class {
1341
1353
  async makeAuthenticatedRequest(url, method, productId, body) {
1342
1354
  if (this.options.verbose) {
1343
1355
  console.debug(`[BillingAPI] ${method} ${url}`);
1356
+ if (body) {
1357
+ console.debug(`[BillingAPI] Payload:`, JSON.stringify(body, null, 2));
1358
+ }
1344
1359
  }
1345
1360
  const resp = this.useSession ? await this.makeSessionAuthenticatedRequest(url, method, body) : await this.makeSignatureAuthenticatedRequest(url, method, productId, body);
1346
1361
  if (this.options.verbose) {