@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/VERSION +2 -2
- package/dist/billing.cjs +15 -0
- package/dist/billing.cjs.map +1 -1
- package/dist/billing.d.cts +1 -1
- package/dist/billing.d.ts +1 -1
- package/dist/billing.js +15 -0
- package/dist/billing.js.map +1 -1
- package/dist/browser.cjs +16 -1
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +4 -4
- package/dist/browser.d.ts +4 -4
- package/dist/browser.js +16 -1
- package/dist/browser.js.map +1 -1
- package/dist/{compute-Do2t0Fo8.d.ts → compute-BbgMH6Ef.d.ts} +1 -1
- package/dist/{compute-Bn6KcW3x.d.cts → compute-yAqGf5hM.d.cts} +1 -1
- package/dist/compute.cjs +9 -1
- package/dist/compute.cjs.map +1 -1
- package/dist/compute.d.cts +2 -2
- package/dist/compute.d.ts +2 -2
- package/dist/compute.js +9 -1
- package/dist/compute.js.map +1 -1
- package/dist/{helpers-CfsfcGJO.d.cts → helpers-CnlJ5yPE.d.cts} +1 -1
- package/dist/{helpers-BRamdfGn.d.ts → helpers-GWlLS3gz.d.ts} +1 -1
- package/dist/{index-BbH7ZCIu.d.cts → index-Bac4HjC0.d.cts} +2 -0
- package/dist/{index-BbH7ZCIu.d.ts → index-Bac4HjC0.d.ts} +2 -0
- package/dist/index.cjs +16 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/billing.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Address, Hex, WalletClient, PublicClient } from 'viem';
|
|
2
|
-
import { a6 as SubscriptionOpts, a4 as SubscribeResponse, a0 as ProductSubscriptionResponse, g as CancelResponse, M as PaymentMethodsResponse, m as CreditPurchaseResponse } from './index-
|
|
2
|
+
import { a6 as SubscriptionOpts, a4 as SubscribeResponse, a0 as ProductSubscriptionResponse, g as CancelResponse, M as PaymentMethodsResponse, m as CreditPurchaseResponse } from './index-Bac4HjC0.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Main Billing namespace entry point
|
package/dist/billing.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Address, Hex, WalletClient, PublicClient } from 'viem';
|
|
2
|
-
import { a6 as SubscriptionOpts, a4 as SubscribeResponse, a0 as ProductSubscriptionResponse, g as CancelResponse, M as PaymentMethodsResponse, m as CreditPurchaseResponse } from './index-
|
|
2
|
+
import { a6 as SubscriptionOpts, a4 as SubscribeResponse, a0 as ProductSubscriptionResponse, g as CancelResponse, M as PaymentMethodsResponse, m as CreditPurchaseResponse } from './index-Bac4HjC0.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Main Billing namespace entry point
|
package/dist/billing.js
CHANGED
|
@@ -308,6 +308,9 @@ var BillingApiClient = class {
|
|
|
308
308
|
async makeAuthenticatedRequest(url, method, productId, body) {
|
|
309
309
|
if (this.options.verbose) {
|
|
310
310
|
console.debug(`[BillingAPI] ${method} ${url}`);
|
|
311
|
+
if (body) {
|
|
312
|
+
console.debug(`[BillingAPI] Payload:`, JSON.stringify(body, null, 2));
|
|
313
|
+
}
|
|
311
314
|
}
|
|
312
315
|
const resp = this.useSession ? await this.makeSessionAuthenticatedRequest(url, method, body) : await this.makeSignatureAuthenticatedRequest(url, method, productId, body);
|
|
313
316
|
if (this.options.verbose) {
|
|
@@ -485,6 +488,12 @@ var CHAIN_ID_TO_ENVIRONMENT = {
|
|
|
485
488
|
[SEPOLIA_CHAIN_ID.toString()]: "sepolia",
|
|
486
489
|
[MAINNET_CHAIN_ID.toString()]: "mainnet-alpha"
|
|
487
490
|
};
|
|
491
|
+
function getApiUrlOverride() {
|
|
492
|
+
const raw = process.env.ECLOUD_API_URL;
|
|
493
|
+
if (!raw) return void 0;
|
|
494
|
+
const trimmed = raw.trim().replace(/\/+$/, "");
|
|
495
|
+
return trimmed.length > 0 ? trimmed : void 0;
|
|
496
|
+
}
|
|
488
497
|
function getEnvironmentConfig(environment, chainID) {
|
|
489
498
|
const env = ENVIRONMENTS[environment];
|
|
490
499
|
if (!env) {
|
|
@@ -502,9 +511,11 @@ function getEnvironmentConfig(environment, chainID) {
|
|
|
502
511
|
}
|
|
503
512
|
}
|
|
504
513
|
const resolvedChainID = chainID || (environment === "sepolia" || environment === "sepolia-dev" ? SEPOLIA_CHAIN_ID : MAINNET_CHAIN_ID);
|
|
514
|
+
const apiUrlOverride = getApiUrlOverride();
|
|
505
515
|
return {
|
|
506
516
|
...env,
|
|
507
517
|
chainID: BigInt(resolvedChainID),
|
|
518
|
+
...apiUrlOverride ? { userApiServerURL: apiUrlOverride } : {},
|
|
508
519
|
...process.env.ECLOUD_USER_API_URL && {
|
|
509
520
|
userApiServerURL: process.env.ECLOUD_USER_API_URL
|
|
510
521
|
},
|
|
@@ -518,6 +529,10 @@ function getBillingEnvironmentConfig(build) {
|
|
|
518
529
|
if (!config) {
|
|
519
530
|
throw new Error(`Unknown billing environment: ${build}`);
|
|
520
531
|
}
|
|
532
|
+
const apiUrlOverride = getApiUrlOverride();
|
|
533
|
+
if (apiUrlOverride) {
|
|
534
|
+
return { billingApiServerURL: apiUrlOverride };
|
|
535
|
+
}
|
|
521
536
|
return {
|
|
522
537
|
...config,
|
|
523
538
|
...process.env.ECLOUD_BILLING_API_URL && {
|