@layr-labs/ecloud-sdk 1.0.0-dev.3 → 1.0.0-devep1

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
@@ -357,13 +357,7 @@ function getEnvironmentConfig(environment, chainID) {
357
357
  return {
358
358
  ...env,
359
359
  chainID: BigInt(resolvedChainID),
360
- ...apiUrlOverride ? { userApiServerURL: apiUrlOverride } : {},
361
- ...process.env.ECLOUD_USER_API_URL && {
362
- userApiServerURL: process.env.ECLOUD_USER_API_URL
363
- },
364
- ...process.env.ECLOUD_RPC_URL && {
365
- defaultRPCURL: process.env.ECLOUD_RPC_URL
366
- }
360
+ ...apiUrlOverride ? { userApiServerURL: apiUrlOverride } : {}
367
361
  };
368
362
  }
369
363
  function getBillingEnvironmentConfig(build) {
@@ -375,12 +369,7 @@ function getBillingEnvironmentConfig(build) {
375
369
  if (apiUrlOverride) {
376
370
  return { billingApiServerURL: apiUrlOverride };
377
371
  }
378
- return {
379
- ...config,
380
- ...process.env.ECLOUD_BILLING_API_URL && {
381
- billingApiServerURL: process.env.ECLOUD_BILLING_API_URL
382
- }
383
- };
372
+ return config;
384
373
  }
385
374
  function getBuildType() {
386
375
  const buildTimeType = true ? "dev"?.toLowerCase() : void 0;
@@ -740,7 +729,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
740
729
  var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
741
730
  var CanUpdateAppProfilePermission = "0x036fef61";
742
731
  function getDefaultClientId() {
743
- const version = true ? "1.0.0-dev.3" : "0.0.0";
732
+ const version = true ? "1.0.0-devep1" : "0.0.0";
744
733
  return `ecloud-sdk/v${version}`;
745
734
  }
746
735
  var UserApiClient = class {
@@ -1328,20 +1317,6 @@ var BillingApiClient = class {
1328
1317
  const endpoint = `${this.config.billingApiServerURL}/products/${productId}/subscription`;
1329
1318
  await this.makeAuthenticatedRequest(endpoint, "DELETE", productId);
1330
1319
  }
1331
- async getPaymentMethods() {
1332
- const endpoint = `${this.config.billingApiServerURL}/v1/payment-methods`;
1333
- const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
1334
- return resp.json();
1335
- }
1336
- async purchaseCredits(amountCents, paymentMethodId) {
1337
- const endpoint = `${this.config.billingApiServerURL}/v1/credits/purchase`;
1338
- const body = { amountCents };
1339
- if (paymentMethodId) {
1340
- body.paymentMethodId = paymentMethodId;
1341
- }
1342
- const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", body);
1343
- return resp.json();
1344
- }
1345
1320
  // ==========================================================================
1346
1321
  // Internal Methods
1347
1322
  // ==========================================================================
@@ -1351,22 +1326,10 @@ var BillingApiClient = class {
1351
1326
  * Uses session auth if useSession is true, otherwise uses EIP-712 signature auth.
1352
1327
  */
1353
1328
  async makeAuthenticatedRequest(url, method, productId, body) {
1354
- if (this.options.verbose) {
1355
- console.debug(`[BillingAPI] ${method} ${url}`);
1356
- if (body) {
1357
- console.debug(`[BillingAPI] Payload:`, JSON.stringify(body, null, 2));
1358
- }
1359
- }
1360
- const resp = this.useSession ? await this.makeSessionAuthenticatedRequest(url, method, body) : await this.makeSignatureAuthenticatedRequest(url, method, productId, body);
1361
- if (this.options.verbose) {
1362
- const data = await resp.json();
1363
- console.debug(`[BillingAPI] Response:`, JSON.stringify(data, null, 2));
1364
- return {
1365
- json: async () => data,
1366
- text: async () => JSON.stringify(data)
1367
- };
1329
+ if (this.useSession) {
1330
+ return this.makeSessionAuthenticatedRequest(url, method, body);
1368
1331
  }
1369
- return resp;
1332
+ return this.makeSignatureAuthenticatedRequest(url, method, productId, body);
1370
1333
  }
1371
1334
  /**
1372
1335
  * Make a request using session-based authentication (cookies)