@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/VERSION +2 -2
- package/dist/billing.cjs +6 -49
- package/dist/billing.cjs.map +1 -1
- package/dist/billing.d.cts +1 -3
- package/dist/billing.d.ts +1 -3
- package/dist/billing.js +6 -49
- package/dist/billing.js.map +1 -1
- package/dist/browser.cjs +6 -43
- 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 +6 -43
- package/dist/browser.js.map +1 -1
- package/dist/{compute-yAqGf5hM.d.cts → compute-Ckyn8ils.d.cts} +1 -1
- package/dist/{compute-BbgMH6Ef.d.ts → compute-Cnw6rwSB.d.ts} +1 -1
- package/dist/compute.cjs +325 -59
- 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 +325 -59
- package/dist/compute.js.map +1 -1
- package/dist/{helpers-GWlLS3gz.d.ts → helpers-DZL2bg9p.d.cts} +1 -5
- package/dist/{helpers-CnlJ5yPE.d.cts → helpers-Dj2ME5rp.d.ts} +1 -5
- package/dist/{index-Bac4HjC0.d.cts → index-U2vKBrry.d.cts} +1 -17
- package/dist/{index-Bac4HjC0.d.ts → index-U2vKBrry.d.ts} +1 -17
- package/dist/index.cjs +330 -101
- 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 +330 -101
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
- package/tools/ecloud-drain-watcher-linux-amd64 +0 -0
- package/tools/tls-keygen-linux-amd64 +0 -0
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-
|
|
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.
|
|
1355
|
-
|
|
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
|
|
1332
|
+
return this.makeSignatureAuthenticatedRequest(url, method, productId, body);
|
|
1370
1333
|
}
|
|
1371
1334
|
/**
|
|
1372
1335
|
* Make a request using session-based authentication (cookies)
|