@layr-labs/ecloud-sdk 1.0.0-dev.3 → 1.0.0-dev.5
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 +158 -28
- package/dist/billing.cjs.map +1 -1
- package/dist/billing.d.cts +12 -3
- package/dist/billing.d.ts +12 -3
- package/dist/billing.js +158 -28
- package/dist/billing.js.map +1 -1
- package/dist/browser.cjs +65 -4
- 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 +66 -5
- package/dist/browser.js.map +1 -1
- package/dist/{compute-BbgMH6Ef.d.ts → compute-9bzsfthb.d.ts} +1 -1
- package/dist/{compute-yAqGf5hM.d.cts → compute-RhRi2H8h.d.cts} +1 -1
- package/dist/compute.cjs +8 -4
- 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 -5
- package/dist/compute.js.map +1 -1
- package/dist/{helpers-GWlLS3gz.d.ts → helpers-CqrBJ39N.d.cts} +17 -2
- package/dist/{helpers-CnlJ5yPE.d.cts → helpers-DEGFGA-T.d.ts} +17 -2
- package/dist/{index-Bac4HjC0.d.cts → index-CLhRJNai.d.cts} +36 -1
- package/dist/{index-Bac4HjC0.d.ts → index-CLhRJNai.d.ts} +36 -1
- package/dist/index.cjs +167 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -8
- package/dist/index.d.ts +32 -8
- package/dist/index.js +166 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/tools/tls-keygen-linux-amd64 +0 -0
package/dist/browser.cjs
CHANGED
|
@@ -300,7 +300,9 @@ var ENVIRONMENTS = {
|
|
|
300
300
|
kmsServerURL: "http://10.128.0.57:8080",
|
|
301
301
|
userApiServerURL: "https://userapi-compute-sepolia-dev.eigencloud.xyz",
|
|
302
302
|
defaultRPCURL: "https://ethereum-sepolia-rpc.publicnode.com",
|
|
303
|
-
usdcCreditsAddress: "0xbdA3897c3A428763B59015C64AB766c288C97376"
|
|
303
|
+
usdcCreditsAddress: "0xbdA3897c3A428763B59015C64AB766c288C97376",
|
|
304
|
+
baseUsdcCreditsAddress: "0x7673a47463F80c6a3553Db9E54c8cDcd5313d0ac",
|
|
305
|
+
baseRPCURL: "https://base-sepolia-rpc.publicnode.com"
|
|
304
306
|
},
|
|
305
307
|
sepolia: {
|
|
306
308
|
name: "sepolia",
|
|
@@ -312,7 +314,9 @@ var ENVIRONMENTS = {
|
|
|
312
314
|
userApiServerURL: "https://userapi-compute-sepolia-prod.eigencloud.xyz",
|
|
313
315
|
defaultRPCURL: "https://ethereum-sepolia-rpc.publicnode.com",
|
|
314
316
|
billingRPCURL: "https://ethereum-rpc.publicnode.com",
|
|
315
|
-
usdcCreditsAddress: "0xed9c88640ca9149Bd9f7ee6620074af10F2E145d"
|
|
317
|
+
usdcCreditsAddress: "0xed9c88640ca9149Bd9f7ee6620074af10F2E145d",
|
|
318
|
+
baseUsdcCreditsAddress: "0x7673a47463F80c6a3553Db9E54c8cDcd5313d0ac",
|
|
319
|
+
baseRPCURL: "https://base-sepolia-rpc.publicnode.com"
|
|
316
320
|
},
|
|
317
321
|
"mainnet-alpha": {
|
|
318
322
|
name: "mainnet-alpha",
|
|
@@ -415,7 +419,7 @@ var import_accounts = require("viem/accounts");
|
|
|
415
419
|
|
|
416
420
|
// src/client/common/constants.ts
|
|
417
421
|
var import_chains = require("viem/chains");
|
|
418
|
-
var SUPPORTED_CHAINS = [import_chains.mainnet, import_chains.sepolia];
|
|
422
|
+
var SUPPORTED_CHAINS = [import_chains.mainnet, import_chains.sepolia, import_chains.baseSepolia];
|
|
419
423
|
|
|
420
424
|
// src/client/common/utils/helpers.ts
|
|
421
425
|
function getChainFromID(chainID, fallback2 = import_chains2.sepolia) {
|
|
@@ -740,7 +744,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
|
|
|
740
744
|
var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
|
|
741
745
|
var CanUpdateAppProfilePermission = "0x036fef61";
|
|
742
746
|
function getDefaultClientId() {
|
|
743
|
-
const version = true ? "1.0.0-dev.
|
|
747
|
+
const version = true ? "1.0.0-dev.5" : "0.0.0";
|
|
744
748
|
return `ecloud-sdk/v${version}`;
|
|
745
749
|
}
|
|
746
750
|
var UserApiClient = class {
|
|
@@ -1343,6 +1347,63 @@ var BillingApiClient = class {
|
|
|
1343
1347
|
return resp.json();
|
|
1344
1348
|
}
|
|
1345
1349
|
// ==========================================================================
|
|
1350
|
+
// Admin - Coupon Methods
|
|
1351
|
+
// ==========================================================================
|
|
1352
|
+
async createCoupon(amountCents) {
|
|
1353
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/coupons`;
|
|
1354
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { amountCents });
|
|
1355
|
+
return resp.json();
|
|
1356
|
+
}
|
|
1357
|
+
async listCoupons(opts) {
|
|
1358
|
+
const params = new URLSearchParams();
|
|
1359
|
+
if (opts?.offset !== void 0) params.set("offset", opts.offset.toString());
|
|
1360
|
+
if (opts?.limit !== void 0) params.set("limit", opts.limit.toString());
|
|
1361
|
+
if (opts?.active !== void 0) params.set("active", opts.active.toString());
|
|
1362
|
+
if (opts?.redeemed !== void 0) params.set("redeemed", opts.redeemed.toString());
|
|
1363
|
+
const qs = params.toString();
|
|
1364
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/coupons${qs ? `?${qs}` : ""}`;
|
|
1365
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
|
|
1366
|
+
return resp.json();
|
|
1367
|
+
}
|
|
1368
|
+
async getCoupon(id) {
|
|
1369
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/coupons/${id}`;
|
|
1370
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
|
|
1371
|
+
return resp.json();
|
|
1372
|
+
}
|
|
1373
|
+
async deactivateCoupon(id) {
|
|
1374
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/coupons/${id}/deactivate`;
|
|
1375
|
+
await this.makeAuthenticatedRequest(endpoint, "POST", "compute");
|
|
1376
|
+
}
|
|
1377
|
+
async redeemCouponForUser(id, address) {
|
|
1378
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/coupons/${id}/redeem`;
|
|
1379
|
+
await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { address });
|
|
1380
|
+
}
|
|
1381
|
+
// ==========================================================================
|
|
1382
|
+
// Admin - Admin Management Methods
|
|
1383
|
+
// ==========================================================================
|
|
1384
|
+
async addAdmin(address) {
|
|
1385
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/admins`;
|
|
1386
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { address });
|
|
1387
|
+
return resp.json();
|
|
1388
|
+
}
|
|
1389
|
+
async removeAdmin(address) {
|
|
1390
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/admins/${address}`;
|
|
1391
|
+
await this.makeAuthenticatedRequest(endpoint, "DELETE", "compute");
|
|
1392
|
+
}
|
|
1393
|
+
async listAdmins() {
|
|
1394
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/admins`;
|
|
1395
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
|
|
1396
|
+
return resp.json();
|
|
1397
|
+
}
|
|
1398
|
+
// ==========================================================================
|
|
1399
|
+
// User - Coupon Redemption
|
|
1400
|
+
// ==========================================================================
|
|
1401
|
+
async redeemCoupon(code) {
|
|
1402
|
+
const endpoint = `${this.config.billingApiServerURL}/v1/coupons/redeem`;
|
|
1403
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { code });
|
|
1404
|
+
return resp.json();
|
|
1405
|
+
}
|
|
1406
|
+
// ==========================================================================
|
|
1346
1407
|
// Internal Methods
|
|
1347
1408
|
// ==========================================================================
|
|
1348
1409
|
/**
|