@t2000/cli 0.26.2 → 0.28.0

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/index.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  saveKey,
18
18
  truncateAddress,
19
19
  walletExists
20
- } from "./chunk-KLHAR3XK.js";
20
+ } from "./chunk-2JUMTEBB.js";
21
21
  import "./chunk-V7PXDEKG.js";
22
22
  import "./chunk-Q2LY5BHK.js";
23
23
  import "./chunk-3XUF7GM3.js";
@@ -7835,7 +7835,7 @@ function registerLock(program3) {
7835
7835
  });
7836
7836
  program3.command("unlock").description("Unlock agent \u2014 resume operations").action(async () => {
7837
7837
  try {
7838
- const { T2000: T20003 } = await import("./dist-KWDZR46D.js");
7838
+ const { T2000: T20003 } = await import("./dist-F462ZUVT.js");
7839
7839
  const MAX_ATTEMPTS2 = 3;
7840
7840
  let pin;
7841
7841
  for (let attempt = 1; attempt <= MAX_ATTEMPTS2; attempt++) {
@@ -8009,7 +8009,7 @@ function registerMcp(program3) {
8009
8009
  mcp.command("start", { isDefault: true }).description("Start MCP server (stdio transport)").option("--key <path>", "Key file path").action(async (opts) => {
8010
8010
  let mod;
8011
8011
  try {
8012
- mod = await import("./dist-KAYOSIOG.js");
8012
+ mod = await import("./dist-UDCEDQVB.js");
8013
8013
  } catch {
8014
8014
  console.error(
8015
8015
  "MCP server not installed. Run:\n npm install -g @t2000/mcp"
@@ -8387,6 +8387,56 @@ function registerUnstake(program3) {
8387
8387
  });
8388
8388
  }
8389
8389
 
8390
+ // src/commands/receive.ts
8391
+ var import_picocolors18 = __toESM(require_picocolors(), 1);
8392
+ function registerReceive(program3) {
8393
+ program3.command("receive").description("Generate a payment request with address and QR code").option("--amount <number>", "Amount to request").option("--currency <symbol>", "Currency (default: USDC)", "USDC").option("--memo <text>", "Payment note").option("--label <text>", "Description for the request").option("--key <path>", "Key file path").action(async (opts) => {
8394
+ try {
8395
+ const pin = await resolvePin();
8396
+ const agent = await T2000.create({ pin, keyPath: opts.key });
8397
+ const amount = opts.amount ? parseFloat(opts.amount) : void 0;
8398
+ if (amount !== void 0 && (isNaN(amount) || amount <= 0)) {
8399
+ throw new Error("Amount must be a positive number");
8400
+ }
8401
+ const request = agent.receive({
8402
+ amount,
8403
+ currency: opts.currency,
8404
+ memo: opts.memo,
8405
+ label: opts.label
8406
+ });
8407
+ if (isJsonMode()) {
8408
+ printJson(request);
8409
+ return;
8410
+ }
8411
+ printHeader("Payment Request");
8412
+ if (request.label) {
8413
+ printLine(import_picocolors18.default.bold(request.label));
8414
+ printBlank();
8415
+ }
8416
+ if (request.amount != null) {
8417
+ printLine(import_picocolors18.default.bold(` $${request.amount.toFixed(2)} ${request.currency}`));
8418
+ } else {
8419
+ printLine(import_picocolors18.default.dim(" Any amount") + ` ${request.currency}`);
8420
+ }
8421
+ printBlank();
8422
+ printDivider();
8423
+ printKeyValue("Address", request.address);
8424
+ printKeyValue("Network", "Sui Mainnet");
8425
+ if (request.memo) {
8426
+ printKeyValue("Memo", request.memo);
8427
+ }
8428
+ printDivider();
8429
+ printBlank();
8430
+ printKeyValue("QR Data", request.qrUri);
8431
+ printBlank();
8432
+ printLine(import_picocolors18.default.dim("Share this address or QR data to receive payment."));
8433
+ printBlank();
8434
+ } catch (error) {
8435
+ handleError(error);
8436
+ }
8437
+ });
8438
+ }
8439
+
8390
8440
  // src/program.ts
8391
8441
  var require2 = createRequire(import.meta.url);
8392
8442
  var { version: CLI_VERSION } = require2("../package.json");
@@ -8434,6 +8484,7 @@ Examples:
8434
8484
  registerSwapQuote(program3);
8435
8485
  registerStake(program3);
8436
8486
  registerUnstake(program3);
8487
+ registerReceive(program3);
8437
8488
  return program3;
8438
8489
  }
8439
8490