@layr-labs/ecloud-cli 1.0.0-devep6 → 1.0.0-devep8
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/commands/billing/__tests__/status.test.js +2 -1
- package/dist/commands/billing/__tests__/status.test.js.map +1 -1
- package/dist/commands/billing/__tests__/subscribe.test.js +2 -1
- package/dist/commands/billing/__tests__/subscribe.test.js.map +1 -1
- package/dist/commands/billing/__tests__/top-up.test.js +91 -7
- package/dist/commands/billing/__tests__/top-up.test.js.map +1 -1
- package/dist/commands/billing/cancel.js +2 -1
- package/dist/commands/billing/cancel.js.map +1 -1
- package/dist/commands/billing/list-cards.js +2 -1
- package/dist/commands/billing/list-cards.js.map +1 -1
- package/dist/commands/billing/status.js +2 -1
- package/dist/commands/billing/status.js.map +1 -1
- package/dist/commands/billing/subscribe.js +2 -1
- package/dist/commands/billing/subscribe.js.map +1 -1
- package/dist/commands/billing/top-up.js +22 -4
- package/dist/commands/billing/top-up.js.map +1 -1
- package/dist/commands/compute/app/deploy.js +1 -1
- package/dist/commands/compute/app/deploy.js.map +1 -1
- package/dist/commands/compute/app/info.js +1 -1
- package/dist/commands/compute/app/list.js +1 -1
- package/dist/commands/compute/app/logs.js +1 -1
- package/dist/commands/compute/app/logs.js.map +1 -1
- package/dist/commands/compute/app/profile/set.js +1 -1
- package/dist/commands/compute/app/profile/set.js.map +1 -1
- package/dist/commands/compute/app/releases.js +1 -1
- package/dist/commands/compute/app/start.js +1 -1
- package/dist/commands/compute/app/start.js.map +1 -1
- package/dist/commands/compute/app/stop.js +1 -1
- package/dist/commands/compute/app/stop.js.map +1 -1
- package/dist/commands/compute/app/terminate.js +1 -1
- package/dist/commands/compute/app/terminate.js.map +1 -1
- package/dist/commands/compute/app/upgrade.js +1 -1
- package/dist/commands/compute/app/upgrade.js.map +1 -1
- package/dist/commands/compute/build/info.js +1 -1
- package/dist/commands/compute/build/info.js.map +1 -1
- package/dist/commands/compute/build/list.js +1 -1
- package/dist/commands/compute/build/list.js.map +1 -1
- package/dist/commands/compute/build/logs.js +1 -1
- package/dist/commands/compute/build/logs.js.map +1 -1
- package/dist/commands/compute/build/status.js +1 -1
- package/dist/commands/compute/build/status.js.map +1 -1
- package/dist/commands/compute/build/submit.js +1 -1
- package/dist/commands/compute/build/submit.js.map +1 -1
- package/dist/commands/compute/build/verify.js +1 -1
- package/dist/commands/compute/build/verify.js.map +1 -1
- package/dist/commands/compute/undelegate.js +1 -1
- package/dist/commands/compute/undelegate.js.map +1 -1
- package/dist/hooks/init/__tests__/version-check.test.js +1 -1
- package/dist/hooks/init/version-check.js +1 -1
- package/package.json +2 -2
|
@@ -309,7 +309,8 @@ async function createBillingClient(flags) {
|
|
|
309
309
|
walletClient,
|
|
310
310
|
publicClient,
|
|
311
311
|
environment,
|
|
312
|
-
skipTelemetry: true
|
|
312
|
+
skipTelemetry: true,
|
|
313
|
+
privateKey
|
|
313
314
|
});
|
|
314
315
|
}
|
|
315
316
|
|
|
@@ -408,6 +409,11 @@ var BillingTopUp = class _BillingTopUp extends Command {
|
|
|
408
409
|
default: "compute",
|
|
409
410
|
options: ["compute"],
|
|
410
411
|
env: "ECLOUD_PRODUCT_ID"
|
|
412
|
+
}),
|
|
413
|
+
chain: Flags2.string({
|
|
414
|
+
required: false,
|
|
415
|
+
description: "Blockchain network for USDC payment: ethereum or base",
|
|
416
|
+
options: ["ethereum", "base"]
|
|
411
417
|
})
|
|
412
418
|
};
|
|
413
419
|
async run() {
|
|
@@ -451,14 +457,25 @@ ${chalk2.bold("Purchase EigenCompute credits")}`);
|
|
|
451
457
|
});
|
|
452
458
|
}
|
|
453
459
|
async handleUsdc(billing, flags, walletAddress, targetAccount, baselineTotal) {
|
|
454
|
-
|
|
460
|
+
let selectedChain = "ethereum";
|
|
461
|
+
if (billing.hasBaseSupport()) {
|
|
462
|
+
selectedChain = flags.chain ?? await select2({
|
|
463
|
+
message: "Which network?",
|
|
464
|
+
choices: [
|
|
465
|
+
{ value: "ethereum", name: "Ethereum" },
|
|
466
|
+
{ value: "base", name: "Base" }
|
|
467
|
+
]
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
const onChainState = await billing.getTopUpInfo({ chain: selectedChain });
|
|
455
471
|
const { usdcBalance, minimumPurchase } = onChainState;
|
|
456
472
|
const balanceFormatted = formatUnits(usdcBalance, 6);
|
|
457
473
|
this.log(` ${chalk2.bold("USDC:")} ${balanceFormatted} USDC`);
|
|
458
474
|
if (usdcBalance === BigInt(0)) {
|
|
475
|
+
const networkName = selectedChain === "base" ? "Base Sepolia" : "Sepolia";
|
|
459
476
|
this.log(`
|
|
460
477
|
${chalk2.yellow(" No USDC in wallet.")}`);
|
|
461
|
-
this.log(` Send USDC on
|
|
478
|
+
this.log(` Send USDC on ${networkName} to: ${chalk2.cyan(walletAddress)}`);
|
|
462
479
|
this.log(` Then re-run: ${chalk2.cyan("ecloud billing top-up")}
|
|
463
480
|
`);
|
|
464
481
|
return;
|
|
@@ -491,7 +508,8 @@ ${chalk2.yellow(" No USDC in wallet.")}`);
|
|
|
491
508
|
Purchasing ${chalk2.bold(`$${amountFloat.toFixed(2)}`)} in credits...`);
|
|
492
509
|
const { txHash } = await billing.topUp({
|
|
493
510
|
amount: amountRaw,
|
|
494
|
-
account: targetAccount
|
|
511
|
+
account: targetAccount,
|
|
512
|
+
chain: selectedChain
|
|
495
513
|
});
|
|
496
514
|
this.log(` ${chalk2.green("\u2713")} Transaction confirmed: ${txHash}`);
|
|
497
515
|
await this.pollForCredits(billing, flags, baselineTotal, amountFloat);
|