chainlesschain 0.66.0 → 0.132.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/bin/chainlesschain.js +0 -0
- package/package.json +1 -1
- package/src/commands/a2a.js +380 -0
- package/src/commands/agent-network.js +254 -1
- package/src/commands/audit.js +302 -0
- package/src/commands/automation.js +271 -1
- package/src/commands/bi.js +348 -0
- package/src/commands/codegen.js +224 -0
- package/src/commands/collab.js +341 -0
- package/src/commands/compliance.js +1035 -0
- package/src/commands/cowork.js +221 -0
- package/src/commands/crosschain.js +218 -0
- package/src/commands/dbevo.js +284 -0
- package/src/commands/dev.js +252 -0
- package/src/commands/did.js +358 -0
- package/src/commands/dlp.js +341 -0
- package/src/commands/encrypt.js +341 -0
- package/src/commands/evomap.js +394 -0
- package/src/commands/export.js +256 -1
- package/src/commands/federation.js +283 -0
- package/src/commands/fusion.js +258 -0
- package/src/commands/governance.js +325 -0
- package/src/commands/hardening.js +411 -0
- package/src/commands/hook.js +148 -0
- package/src/commands/import.js +252 -0
- package/src/commands/incentive.js +322 -0
- package/src/commands/inference.js +318 -0
- package/src/commands/infra.js +244 -0
- package/src/commands/instinct.js +260 -0
- package/src/commands/ipfs.js +318 -0
- package/src/commands/kg.js +387 -0
- package/src/commands/llm.js +263 -0
- package/src/commands/lowcode.js +356 -0
- package/src/commands/marketplace.js +256 -0
- package/src/commands/mcp.js +221 -0
- package/src/commands/memory.js +248 -0
- package/src/commands/multimodal.js +296 -0
- package/src/commands/nlprog.js +356 -0
- package/src/commands/note.js +244 -0
- package/src/commands/ops.js +354 -0
- package/src/commands/orchestrate.js +166 -0
- package/src/commands/org.js +277 -0
- package/src/commands/p2p.js +390 -0
- package/src/commands/perception.js +290 -0
- package/src/commands/permmem.js +251 -0
- package/src/commands/plugin-ecosystem.js +273 -0
- package/src/commands/pqc.js +393 -0
- package/src/commands/privacy.js +321 -0
- package/src/commands/quantization.js +351 -0
- package/src/commands/rcache.js +271 -0
- package/src/commands/recommend.js +340 -0
- package/src/commands/reputation.js +261 -0
- package/src/commands/runtime.js +307 -0
- package/src/commands/scim.js +262 -0
- package/src/commands/session.js +258 -0
- package/src/commands/siem.js +246 -0
- package/src/commands/skill.js +267 -1
- package/src/commands/sla.js +259 -0
- package/src/commands/social.js +256 -0
- package/src/commands/sso.js +186 -1
- package/src/commands/stress.js +230 -0
- package/src/commands/sync.js +256 -0
- package/src/commands/tech.js +338 -0
- package/src/commands/tenant.js +351 -0
- package/src/commands/terraform.js +245 -0
- package/src/commands/tokens.js +269 -0
- package/src/commands/trust.js +249 -0
- package/src/commands/wallet.js +277 -0
- package/src/commands/workflow.js +171 -0
- package/src/commands/zkp.js +335 -0
- package/src/index.js +4 -0
- package/src/lib/a2a-protocol.js +451 -0
- package/src/lib/agent-coordinator.js +325 -0
- package/src/lib/agent-network.js +387 -0
- package/src/lib/agent-router.js +395 -0
- package/src/lib/aiops.js +478 -0
- package/src/lib/app-builder.js +239 -0
- package/src/lib/audit-logger.js +379 -0
- package/src/lib/automation-engine.js +330 -0
- package/src/lib/autonomous-developer.js +350 -0
- package/src/lib/bi-engine.js +338 -0
- package/src/lib/code-agent.js +323 -0
- package/src/lib/collaboration-governance.js +364 -0
- package/src/lib/community-governance.js +436 -0
- package/src/lib/compliance-manager.js +434 -0
- package/src/lib/content-recommendation.js +469 -0
- package/src/lib/cross-chain.js +345 -0
- package/src/lib/crypto-manager.js +350 -0
- package/src/lib/dbevo.js +338 -0
- package/src/lib/decentral-infra.js +340 -0
- package/src/lib/did-manager.js +367 -0
- package/src/lib/dlp-engine.js +389 -0
- package/src/lib/evomap-federation.js +177 -0
- package/src/lib/evomap-governance.js +276 -0
- package/src/lib/federation-hardening.js +259 -0
- package/src/lib/hardening-manager.js +348 -0
- package/src/lib/hook-manager.js +380 -0
- package/src/lib/inference-network.js +330 -0
- package/src/lib/instinct-manager.js +332 -0
- package/src/lib/ipfs-storage.js +334 -0
- package/src/lib/knowledge-exporter.js +381 -0
- package/src/lib/knowledge-graph.js +432 -0
- package/src/lib/knowledge-importer.js +379 -0
- package/src/lib/llm-providers.js +391 -0
- package/src/lib/mcp-registry.js +333 -0
- package/src/lib/memory-manager.js +330 -0
- package/src/lib/multimodal.js +346 -0
- package/src/lib/nl-programming.js +343 -0
- package/src/lib/note-versioning.js +327 -0
- package/src/lib/org-manager.js +323 -0
- package/src/lib/p2p-manager.js +387 -0
- package/src/lib/perception.js +346 -0
- package/src/lib/perf-tuning.js +4 -1
- package/src/lib/permanent-memory.js +320 -0
- package/src/lib/plugin-ecosystem.js +377 -0
- package/src/lib/pqc-manager.js +368 -0
- package/src/lib/privacy-computing.js +427 -0
- package/src/lib/protocol-fusion.js +417 -0
- package/src/lib/quantization.js +325 -0
- package/src/lib/reputation-optimizer.js +299 -0
- package/src/lib/response-cache.js +327 -0
- package/src/lib/scim-manager.js +329 -0
- package/src/lib/session-manager.js +329 -0
- package/src/lib/siem-exporter.js +333 -0
- package/src/lib/skill-loader.js +377 -0
- package/src/lib/skill-marketplace.js +325 -0
- package/src/lib/sla-manager.js +275 -0
- package/src/lib/social-manager.js +326 -0
- package/src/lib/sso-manager.js +332 -0
- package/src/lib/stress-tester.js +330 -0
- package/src/lib/sync-manager.js +326 -0
- package/src/lib/tech-learning-engine.js +369 -0
- package/src/lib/tenant-saas.js +460 -0
- package/src/lib/terraform-manager.js +363 -0
- package/src/lib/threat-intel.js +335 -0
- package/src/lib/token-incentive.js +293 -0
- package/src/lib/token-tracker.js +329 -0
- package/src/lib/trust-security.js +390 -0
- package/src/lib/ueba.js +389 -0
- package/src/lib/universal-runtime.js +325 -0
- package/src/lib/wallet-manager.js +326 -0
- package/src/lib/workflow-engine.js +322 -0
- package/src/lib/zkp-engine.js +274 -0
package/src/commands/trust.js
CHANGED
|
@@ -27,8 +27,48 @@ import {
|
|
|
27
27
|
listHsmDevices,
|
|
28
28
|
signWithHsm,
|
|
29
29
|
getTrustSecurityStats,
|
|
30
|
+
HSM_MATURITY_V2,
|
|
31
|
+
TRANSMISSION_V2,
|
|
32
|
+
getMaxActiveDevicesPerOperator,
|
|
33
|
+
setMaxActiveDevicesPerOperator,
|
|
34
|
+
getMaxPendingTransmissionsPerDevice,
|
|
35
|
+
setMaxPendingTransmissionsPerDevice,
|
|
36
|
+
getDeviceIdleMs,
|
|
37
|
+
setDeviceIdleMs,
|
|
38
|
+
getTransmissionStuckMs,
|
|
39
|
+
setTransmissionStuckMs,
|
|
40
|
+
getActiveDeviceCount,
|
|
41
|
+
getPendingTransmissionCount,
|
|
42
|
+
registerDeviceV2,
|
|
43
|
+
getDeviceV2,
|
|
44
|
+
listDevicesV2,
|
|
45
|
+
setDeviceMaturityV2,
|
|
46
|
+
activateDevice,
|
|
47
|
+
degradeDevice,
|
|
48
|
+
retireDevice,
|
|
49
|
+
touchDeviceUsage,
|
|
50
|
+
enqueueTransmissionV2,
|
|
51
|
+
getTransmissionV2,
|
|
52
|
+
listTransmissionsV2,
|
|
53
|
+
setTransmissionStatusV2,
|
|
54
|
+
startTransmission,
|
|
55
|
+
confirmTransmission,
|
|
56
|
+
failTransmission,
|
|
57
|
+
cancelTransmission,
|
|
58
|
+
autoRetireIdleDevices,
|
|
59
|
+
autoFailStuckTransmissions,
|
|
60
|
+
getTrustSecurityStatsV2,
|
|
30
61
|
} from "../lib/trust-security.js";
|
|
31
62
|
|
|
63
|
+
function _parseJsonV2(s) {
|
|
64
|
+
if (!s) return undefined;
|
|
65
|
+
try {
|
|
66
|
+
return JSON.parse(s);
|
|
67
|
+
} catch {
|
|
68
|
+
throw new Error(`invalid JSON: ${s}`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
32
72
|
function _dbFromCtx(cmd) {
|
|
33
73
|
const root = cmd?.parent?.parent ?? cmd?.parent;
|
|
34
74
|
return root?._db;
|
|
@@ -362,5 +402,214 @@ export function registerTrustCommand(program) {
|
|
|
362
402
|
console.log(`HSM Devices: ${s.hsm.total}`);
|
|
363
403
|
});
|
|
364
404
|
|
|
405
|
+
/* ── V2 Surface (Phase 68-71) ─────────────────────────── */
|
|
406
|
+
|
|
407
|
+
tr.command("hsm-maturities-v2")
|
|
408
|
+
.description("List HSM_MATURITY_V2 enum")
|
|
409
|
+
.action(() => {
|
|
410
|
+
for (const v of Object.values(HSM_MATURITY_V2)) console.log(` ${v}`);
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
tr.command("transmissions-v2")
|
|
414
|
+
.description("List TRANSMISSION_V2 enum")
|
|
415
|
+
.action(() => {
|
|
416
|
+
for (const v of Object.values(TRANSMISSION_V2)) console.log(` ${v}`);
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
tr.command("max-active-devices-per-operator")
|
|
420
|
+
.description("Get current max-active-devices-per-operator cap")
|
|
421
|
+
.action(() => console.log(getMaxActiveDevicesPerOperator()));
|
|
422
|
+
tr.command("set-max-active-devices-per-operator <n>").action((n) =>
|
|
423
|
+
console.log(setMaxActiveDevicesPerOperator(Number(n))),
|
|
424
|
+
);
|
|
425
|
+
|
|
426
|
+
tr.command("max-pending-transmissions-per-device")
|
|
427
|
+
.description("Get current max-pending-transmissions-per-device cap")
|
|
428
|
+
.action(() => console.log(getMaxPendingTransmissionsPerDevice()));
|
|
429
|
+
tr.command("set-max-pending-transmissions-per-device <n>").action((n) =>
|
|
430
|
+
console.log(setMaxPendingTransmissionsPerDevice(Number(n))),
|
|
431
|
+
);
|
|
432
|
+
|
|
433
|
+
tr.command("device-idle-ms")
|
|
434
|
+
.description("Get current device-idle-ms threshold")
|
|
435
|
+
.action(() => console.log(getDeviceIdleMs()));
|
|
436
|
+
tr.command("set-device-idle-ms <n>").action((n) =>
|
|
437
|
+
console.log(setDeviceIdleMs(Number(n))),
|
|
438
|
+
);
|
|
439
|
+
|
|
440
|
+
tr.command("transmission-stuck-ms")
|
|
441
|
+
.description("Get current transmission-stuck-ms threshold")
|
|
442
|
+
.action(() => console.log(getTransmissionStuckMs()));
|
|
443
|
+
tr.command("set-transmission-stuck-ms <n>").action((n) =>
|
|
444
|
+
console.log(setTransmissionStuckMs(Number(n))),
|
|
445
|
+
);
|
|
446
|
+
|
|
447
|
+
tr.command("active-device-count")
|
|
448
|
+
.description("Count active+degraded devices (optionally by operator)")
|
|
449
|
+
.option("-o, --operator <operator>", "scope to operator")
|
|
450
|
+
.action((opts) => console.log(getActiveDeviceCount(opts.operator)));
|
|
451
|
+
|
|
452
|
+
tr.command("pending-transmission-count")
|
|
453
|
+
.description("Count non-terminal transmissions (optionally by device)")
|
|
454
|
+
.option("-d, --device <device>", "scope to device")
|
|
455
|
+
.action((opts) => console.log(getPendingTransmissionCount(opts.device)));
|
|
456
|
+
|
|
457
|
+
tr.command("register-device-v2 <device-id>")
|
|
458
|
+
.description("Register V2 HSM device")
|
|
459
|
+
.requiredOption("-o, --operator <operator>", "operator id")
|
|
460
|
+
.requiredOption("-v, --vendor <vendor>", "HSM vendor")
|
|
461
|
+
.option(
|
|
462
|
+
"-i, --initial <status>",
|
|
463
|
+
"initial status",
|
|
464
|
+
HSM_MATURITY_V2.PROVISIONAL,
|
|
465
|
+
)
|
|
466
|
+
.option("--metadata <json>", "metadata JSON")
|
|
467
|
+
.action((id, opts) => {
|
|
468
|
+
const d = registerDeviceV2({
|
|
469
|
+
id,
|
|
470
|
+
operator: opts.operator,
|
|
471
|
+
vendor: opts.vendor,
|
|
472
|
+
initialStatus: opts.initial,
|
|
473
|
+
metadata: _parseJsonV2(opts.metadata),
|
|
474
|
+
});
|
|
475
|
+
console.log(JSON.stringify(d, null, 2));
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
tr.command("device-v2 <device-id>")
|
|
479
|
+
.description("Show V2 device")
|
|
480
|
+
.action((id) => {
|
|
481
|
+
const d = getDeviceV2(id);
|
|
482
|
+
if (!d) return console.error(`device ${id} not found`);
|
|
483
|
+
console.log(JSON.stringify(d, null, 2));
|
|
484
|
+
});
|
|
485
|
+
|
|
486
|
+
tr.command("list-devices-v2")
|
|
487
|
+
.description("List V2 devices")
|
|
488
|
+
.option("-o, --operator <operator>", "filter by operator")
|
|
489
|
+
.option("-s, --status <status>", "filter by status")
|
|
490
|
+
.action((opts) =>
|
|
491
|
+
console.log(JSON.stringify(listDevicesV2(opts), null, 2)),
|
|
492
|
+
);
|
|
493
|
+
|
|
494
|
+
tr.command("set-device-maturity-v2 <device-id> <status>")
|
|
495
|
+
.description("Transition V2 device maturity")
|
|
496
|
+
.option("-r, --reason <reason>", "transition reason")
|
|
497
|
+
.option("--metadata <json>", "metadata patch JSON")
|
|
498
|
+
.action((id, status, opts) => {
|
|
499
|
+
const d = setDeviceMaturityV2(id, status, {
|
|
500
|
+
reason: opts.reason,
|
|
501
|
+
metadata: _parseJsonV2(opts.metadata),
|
|
502
|
+
});
|
|
503
|
+
console.log(JSON.stringify(d, null, 2));
|
|
504
|
+
});
|
|
505
|
+
|
|
506
|
+
for (const [name, fn] of [
|
|
507
|
+
["activate-device", activateDevice],
|
|
508
|
+
["degrade-device", degradeDevice],
|
|
509
|
+
["retire-device", retireDevice],
|
|
510
|
+
]) {
|
|
511
|
+
tr.command(`${name} <device-id>`)
|
|
512
|
+
.description(`Shortcut for ${name.replace("-device", "")} transition`)
|
|
513
|
+
.option("-r, --reason <reason>", "transition reason")
|
|
514
|
+
.action((id, opts) => {
|
|
515
|
+
const d = fn(id, { reason: opts.reason });
|
|
516
|
+
console.log(JSON.stringify(d, null, 2));
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
tr.command("touch-device-usage <device-id>")
|
|
521
|
+
.description("Mark V2 device as used now")
|
|
522
|
+
.action((id) => {
|
|
523
|
+
const d = touchDeviceUsage(id);
|
|
524
|
+
console.log(JSON.stringify(d, null, 2));
|
|
525
|
+
});
|
|
526
|
+
|
|
527
|
+
tr.command("enqueue-transmission-v2 <transmission-id>")
|
|
528
|
+
.description("Enqueue V2 satellite transmission")
|
|
529
|
+
.requiredOption("-d, --device <device>", "device id")
|
|
530
|
+
.requiredOption("-p, --provider <provider>", "satellite provider")
|
|
531
|
+
.requiredOption("-x, --payload <payload>", "message payload")
|
|
532
|
+
.option("--metadata <json>", "metadata JSON")
|
|
533
|
+
.action((id, opts) => {
|
|
534
|
+
const t = enqueueTransmissionV2({
|
|
535
|
+
id,
|
|
536
|
+
deviceId: opts.device,
|
|
537
|
+
provider: opts.provider,
|
|
538
|
+
payload: opts.payload,
|
|
539
|
+
metadata: _parseJsonV2(opts.metadata),
|
|
540
|
+
});
|
|
541
|
+
console.log(JSON.stringify(t, null, 2));
|
|
542
|
+
});
|
|
543
|
+
|
|
544
|
+
tr.command("transmission-v2 <transmission-id>")
|
|
545
|
+
.description("Show V2 transmission")
|
|
546
|
+
.action((id) => {
|
|
547
|
+
const t = getTransmissionV2(id);
|
|
548
|
+
if (!t) return console.error(`transmission ${id} not found`);
|
|
549
|
+
console.log(JSON.stringify(t, null, 2));
|
|
550
|
+
});
|
|
551
|
+
|
|
552
|
+
tr.command("list-transmissions-v2")
|
|
553
|
+
.description("List V2 transmissions")
|
|
554
|
+
.option("-d, --device <device>", "filter by device")
|
|
555
|
+
.option("-s, --status <status>", "filter by status")
|
|
556
|
+
.action((opts) =>
|
|
557
|
+
console.log(JSON.stringify(listTransmissionsV2(opts), null, 2)),
|
|
558
|
+
);
|
|
559
|
+
|
|
560
|
+
tr.command("set-transmission-status-v2 <transmission-id> <status>")
|
|
561
|
+
.option("-r, --reason <reason>", "transition reason")
|
|
562
|
+
.option("--metadata <json>", "metadata patch JSON")
|
|
563
|
+
.action((id, status, opts) => {
|
|
564
|
+
const t = setTransmissionStatusV2(id, status, {
|
|
565
|
+
reason: opts.reason,
|
|
566
|
+
metadata: _parseJsonV2(opts.metadata),
|
|
567
|
+
});
|
|
568
|
+
console.log(JSON.stringify(t, null, 2));
|
|
569
|
+
});
|
|
570
|
+
|
|
571
|
+
for (const [name, fn] of [
|
|
572
|
+
["start-transmission", startTransmission],
|
|
573
|
+
["confirm-transmission", confirmTransmission],
|
|
574
|
+
["fail-transmission", failTransmission],
|
|
575
|
+
["cancel-transmission", cancelTransmission],
|
|
576
|
+
]) {
|
|
577
|
+
tr.command(`${name} <transmission-id>`)
|
|
578
|
+
.description(
|
|
579
|
+
`Shortcut for ${name.replace("-transmission", "")} transition`,
|
|
580
|
+
)
|
|
581
|
+
.option("-r, --reason <reason>", "transition reason")
|
|
582
|
+
.action((id, opts) => {
|
|
583
|
+
const t = fn(id, { reason: opts.reason });
|
|
584
|
+
console.log(JSON.stringify(t, null, 2));
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
tr.command("auto-retire-idle-devices")
|
|
589
|
+
.description(
|
|
590
|
+
"Bulk-retire ACTIVE/DEGRADED devices whose lastUsedAt is older than deviceIdleMs",
|
|
591
|
+
)
|
|
592
|
+
.action(() =>
|
|
593
|
+
console.log(
|
|
594
|
+
JSON.stringify({ flipped: autoRetireIdleDevices() }, null, 2),
|
|
595
|
+
),
|
|
596
|
+
);
|
|
597
|
+
|
|
598
|
+
tr.command("auto-fail-stuck-transmissions")
|
|
599
|
+
.description(
|
|
600
|
+
"Bulk-fail SENDING transmissions whose startedAt is older than transmissionStuckMs",
|
|
601
|
+
)
|
|
602
|
+
.action(() =>
|
|
603
|
+
console.log(
|
|
604
|
+
JSON.stringify({ flipped: autoFailStuckTransmissions() }, null, 2),
|
|
605
|
+
),
|
|
606
|
+
);
|
|
607
|
+
|
|
608
|
+
tr.command("stats-v2")
|
|
609
|
+
.description("Show V2 trust/security stats")
|
|
610
|
+
.action(() =>
|
|
611
|
+
console.log(JSON.stringify(getTrustSecurityStatsV2(), null, 2)),
|
|
612
|
+
);
|
|
613
|
+
|
|
365
614
|
program.addCommand(tr);
|
|
366
615
|
}
|
package/src/commands/wallet.js
CHANGED
|
@@ -18,6 +18,37 @@ import {
|
|
|
18
18
|
transferAsset,
|
|
19
19
|
getTransactions,
|
|
20
20
|
getWalletSummary,
|
|
21
|
+
WALLET_MATURITY_V2,
|
|
22
|
+
TX_LIFECYCLE_V2,
|
|
23
|
+
getMaxActiveWalletsPerOwnerV2,
|
|
24
|
+
setMaxActiveWalletsPerOwnerV2,
|
|
25
|
+
getMaxPendingTxPerWalletV2,
|
|
26
|
+
setMaxPendingTxPerWalletV2,
|
|
27
|
+
getWalletIdleMsV2,
|
|
28
|
+
setWalletIdleMsV2,
|
|
29
|
+
getTxStuckMsV2,
|
|
30
|
+
setTxStuckMsV2,
|
|
31
|
+
getActiveWalletCountV2,
|
|
32
|
+
getPendingTxCountV2,
|
|
33
|
+
registerWalletV2,
|
|
34
|
+
getWalletV2,
|
|
35
|
+
listWalletsV2,
|
|
36
|
+
setWalletMaturityV2,
|
|
37
|
+
activateWalletV2,
|
|
38
|
+
freezeWalletV2,
|
|
39
|
+
retireWalletV2,
|
|
40
|
+
touchWalletV2,
|
|
41
|
+
createTxV2,
|
|
42
|
+
getTxV2,
|
|
43
|
+
listTxsV2,
|
|
44
|
+
setTxStatusV2,
|
|
45
|
+
submitTxV2,
|
|
46
|
+
confirmTxV2,
|
|
47
|
+
failTxV2,
|
|
48
|
+
rejectTxV2,
|
|
49
|
+
autoRetireIdleWalletsV2,
|
|
50
|
+
autoFailStuckTxV2,
|
|
51
|
+
getWalletManagerStatsV2,
|
|
21
52
|
} from "../lib/wallet-manager.js";
|
|
22
53
|
|
|
23
54
|
export function registerWalletCommand(program) {
|
|
@@ -413,4 +444,250 @@ export function registerWalletCommand(program) {
|
|
|
413
444
|
process.exit(1);
|
|
414
445
|
}
|
|
415
446
|
});
|
|
447
|
+
|
|
448
|
+
/* ═══ Wallet V2 — in-memory maturity + tx lifecycle ═══ */
|
|
449
|
+
|
|
450
|
+
wallet
|
|
451
|
+
.command("maturities-v2")
|
|
452
|
+
.description("List wallet maturity states (V2)")
|
|
453
|
+
.action(() => {
|
|
454
|
+
for (const v of Object.values(WALLET_MATURITY_V2)) console.log(` ${v}`);
|
|
455
|
+
});
|
|
456
|
+
|
|
457
|
+
wallet
|
|
458
|
+
.command("tx-lifecycles-v2")
|
|
459
|
+
.description("List tx lifecycle states (V2)")
|
|
460
|
+
.action(() => {
|
|
461
|
+
for (const v of Object.values(TX_LIFECYCLE_V2)) console.log(` ${v}`);
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
wallet
|
|
465
|
+
.command("stats-v2")
|
|
466
|
+
.description("Show V2 wallet/tx stats")
|
|
467
|
+
.action(() => {
|
|
468
|
+
console.log(JSON.stringify(getWalletManagerStatsV2(), null, 2));
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
wallet
|
|
472
|
+
.command("max-active-wallets-per-owner")
|
|
473
|
+
.argument("[n]", "New cap")
|
|
474
|
+
.description("Get/set max active wallets per owner (V2)")
|
|
475
|
+
.action((n) => {
|
|
476
|
+
if (n !== undefined) setMaxActiveWalletsPerOwnerV2(n);
|
|
477
|
+
console.log(getMaxActiveWalletsPerOwnerV2());
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
wallet
|
|
481
|
+
.command("max-pending-tx-per-wallet")
|
|
482
|
+
.argument("[n]", "New cap")
|
|
483
|
+
.description("Get/set max pending+submitted tx per wallet (V2)")
|
|
484
|
+
.action((n) => {
|
|
485
|
+
if (n !== undefined) setMaxPendingTxPerWalletV2(n);
|
|
486
|
+
console.log(getMaxPendingTxPerWalletV2());
|
|
487
|
+
});
|
|
488
|
+
|
|
489
|
+
wallet
|
|
490
|
+
.command("wallet-idle-ms")
|
|
491
|
+
.argument("[ms]", "New idle window")
|
|
492
|
+
.description("Get/set wallet idle window ms (V2)")
|
|
493
|
+
.action((ms) => {
|
|
494
|
+
if (ms !== undefined) setWalletIdleMsV2(ms);
|
|
495
|
+
console.log(getWalletIdleMsV2());
|
|
496
|
+
});
|
|
497
|
+
|
|
498
|
+
wallet
|
|
499
|
+
.command("tx-stuck-ms")
|
|
500
|
+
.argument("[ms]", "New stuck window")
|
|
501
|
+
.description("Get/set tx stuck window ms (V2)")
|
|
502
|
+
.action((ms) => {
|
|
503
|
+
if (ms !== undefined) setTxStuckMsV2(ms);
|
|
504
|
+
console.log(getTxStuckMsV2());
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
wallet
|
|
508
|
+
.command("active-wallet-count-v2 <owner>")
|
|
509
|
+
.description("Count active wallets for owner (V2)")
|
|
510
|
+
.action((owner) => {
|
|
511
|
+
console.log(getActiveWalletCountV2(owner));
|
|
512
|
+
});
|
|
513
|
+
|
|
514
|
+
wallet
|
|
515
|
+
.command("pending-tx-count-v2 <walletId>")
|
|
516
|
+
.description("Count pending+submitted tx for wallet (V2)")
|
|
517
|
+
.action((walletId) => {
|
|
518
|
+
console.log(getPendingTxCountV2(walletId));
|
|
519
|
+
});
|
|
520
|
+
|
|
521
|
+
wallet
|
|
522
|
+
.command("register-wallet-v2 <id>")
|
|
523
|
+
.requiredOption("-o, --owner <owner>", "Owner")
|
|
524
|
+
.requiredOption("-a, --address <address>", "Wallet address")
|
|
525
|
+
.description("Register a new provisional wallet (V2)")
|
|
526
|
+
.action((id, opts) => {
|
|
527
|
+
console.log(
|
|
528
|
+
JSON.stringify(
|
|
529
|
+
registerWalletV2(id, { owner: opts.owner, address: opts.address }),
|
|
530
|
+
null,
|
|
531
|
+
2,
|
|
532
|
+
),
|
|
533
|
+
);
|
|
534
|
+
});
|
|
535
|
+
|
|
536
|
+
wallet
|
|
537
|
+
.command("wallet-v2 <id>")
|
|
538
|
+
.description("Show wallet by id (V2)")
|
|
539
|
+
.action((id) => {
|
|
540
|
+
const w = getWalletV2(id);
|
|
541
|
+
if (!w) {
|
|
542
|
+
console.error(`wallet ${id} not found`);
|
|
543
|
+
process.exit(1);
|
|
544
|
+
}
|
|
545
|
+
console.log(JSON.stringify(w, null, 2));
|
|
546
|
+
});
|
|
547
|
+
|
|
548
|
+
wallet
|
|
549
|
+
.command("list-wallets-v2")
|
|
550
|
+
.option("-o, --owner <owner>", "Filter by owner")
|
|
551
|
+
.option("-m, --maturity <m>", "Filter by maturity")
|
|
552
|
+
.description("List wallets (V2)")
|
|
553
|
+
.action((opts) => {
|
|
554
|
+
console.log(
|
|
555
|
+
JSON.stringify(
|
|
556
|
+
listWalletsV2({ owner: opts.owner, maturity: opts.maturity }),
|
|
557
|
+
null,
|
|
558
|
+
2,
|
|
559
|
+
),
|
|
560
|
+
);
|
|
561
|
+
});
|
|
562
|
+
|
|
563
|
+
wallet
|
|
564
|
+
.command("set-wallet-maturity-v2 <id> <next>")
|
|
565
|
+
.description("Transition wallet maturity (V2)")
|
|
566
|
+
.action((id, next) => {
|
|
567
|
+
console.log(JSON.stringify(setWalletMaturityV2(id, next), null, 2));
|
|
568
|
+
});
|
|
569
|
+
|
|
570
|
+
wallet
|
|
571
|
+
.command("activate-wallet-v2 <id>")
|
|
572
|
+
.description("Activate wallet (V2)")
|
|
573
|
+
.action((id) => {
|
|
574
|
+
console.log(JSON.stringify(activateWalletV2(id), null, 2));
|
|
575
|
+
});
|
|
576
|
+
|
|
577
|
+
wallet
|
|
578
|
+
.command("freeze-wallet-v2 <id>")
|
|
579
|
+
.description("Freeze wallet (V2)")
|
|
580
|
+
.action((id) => {
|
|
581
|
+
console.log(JSON.stringify(freezeWalletV2(id), null, 2));
|
|
582
|
+
});
|
|
583
|
+
|
|
584
|
+
wallet
|
|
585
|
+
.command("retire-wallet-v2 <id>")
|
|
586
|
+
.description("Retire wallet terminally (V2)")
|
|
587
|
+
.action((id) => {
|
|
588
|
+
console.log(JSON.stringify(retireWalletV2(id), null, 2));
|
|
589
|
+
});
|
|
590
|
+
|
|
591
|
+
wallet
|
|
592
|
+
.command("touch-wallet-v2 <id>")
|
|
593
|
+
.description("Update wallet lastSeenAt (V2)")
|
|
594
|
+
.action((id) => {
|
|
595
|
+
console.log(JSON.stringify(touchWalletV2(id), null, 2));
|
|
596
|
+
});
|
|
597
|
+
|
|
598
|
+
wallet
|
|
599
|
+
.command("create-tx-v2 <id>")
|
|
600
|
+
.requiredOption("-w, --wallet <walletId>", "Wallet id")
|
|
601
|
+
.requiredOption("-k, --kind <kind>", "Tx kind")
|
|
602
|
+
.option("-a, --amount <n>", "Amount")
|
|
603
|
+
.description("Create a pending tx (V2)")
|
|
604
|
+
.action((id, opts) => {
|
|
605
|
+
console.log(
|
|
606
|
+
JSON.stringify(
|
|
607
|
+
createTxV2(id, {
|
|
608
|
+
walletId: opts.wallet,
|
|
609
|
+
kind: opts.kind,
|
|
610
|
+
amount: opts.amount,
|
|
611
|
+
}),
|
|
612
|
+
null,
|
|
613
|
+
2,
|
|
614
|
+
),
|
|
615
|
+
);
|
|
616
|
+
});
|
|
617
|
+
|
|
618
|
+
wallet
|
|
619
|
+
.command("tx-v2 <id>")
|
|
620
|
+
.description("Show tx by id (V2)")
|
|
621
|
+
.action((id) => {
|
|
622
|
+
const t = getTxV2(id);
|
|
623
|
+
if (!t) {
|
|
624
|
+
console.error(`tx ${id} not found`);
|
|
625
|
+
process.exit(1);
|
|
626
|
+
}
|
|
627
|
+
console.log(JSON.stringify(t, null, 2));
|
|
628
|
+
});
|
|
629
|
+
|
|
630
|
+
wallet
|
|
631
|
+
.command("list-txs-v2")
|
|
632
|
+
.option("-w, --wallet <walletId>", "Filter by walletId")
|
|
633
|
+
.option("-s, --status <s>", "Filter by status")
|
|
634
|
+
.description("List txs (V2)")
|
|
635
|
+
.action((opts) => {
|
|
636
|
+
console.log(
|
|
637
|
+
JSON.stringify(
|
|
638
|
+
listTxsV2({ walletId: opts.wallet, status: opts.status }),
|
|
639
|
+
null,
|
|
640
|
+
2,
|
|
641
|
+
),
|
|
642
|
+
);
|
|
643
|
+
});
|
|
644
|
+
|
|
645
|
+
wallet
|
|
646
|
+
.command("set-tx-status-v2 <id> <next>")
|
|
647
|
+
.description("Transition tx status (V2)")
|
|
648
|
+
.action((id, next) => {
|
|
649
|
+
console.log(JSON.stringify(setTxStatusV2(id, next), null, 2));
|
|
650
|
+
});
|
|
651
|
+
|
|
652
|
+
wallet
|
|
653
|
+
.command("submit-tx-v2 <id>")
|
|
654
|
+
.description("Submit tx (V2)")
|
|
655
|
+
.action((id) => {
|
|
656
|
+
console.log(JSON.stringify(submitTxV2(id), null, 2));
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
wallet
|
|
660
|
+
.command("confirm-tx-v2 <id>")
|
|
661
|
+
.description("Confirm tx terminally (V2)")
|
|
662
|
+
.action((id) => {
|
|
663
|
+
console.log(JSON.stringify(confirmTxV2(id), null, 2));
|
|
664
|
+
});
|
|
665
|
+
|
|
666
|
+
wallet
|
|
667
|
+
.command("fail-tx-v2 <id>")
|
|
668
|
+
.description("Fail tx terminally (V2)")
|
|
669
|
+
.action((id) => {
|
|
670
|
+
console.log(JSON.stringify(failTxV2(id), null, 2));
|
|
671
|
+
});
|
|
672
|
+
|
|
673
|
+
wallet
|
|
674
|
+
.command("reject-tx-v2 <id>")
|
|
675
|
+
.description("Reject tx terminally (V2)")
|
|
676
|
+
.action((id) => {
|
|
677
|
+
console.log(JSON.stringify(rejectTxV2(id), null, 2));
|
|
678
|
+
});
|
|
679
|
+
|
|
680
|
+
wallet
|
|
681
|
+
.command("auto-retire-idle-wallets")
|
|
682
|
+
.description("Auto-retire non-provisional wallets idle past window (V2)")
|
|
683
|
+
.action(() => {
|
|
684
|
+
console.log(JSON.stringify(autoRetireIdleWalletsV2(), null, 2));
|
|
685
|
+
});
|
|
686
|
+
|
|
687
|
+
wallet
|
|
688
|
+
.command("auto-fail-stuck-tx")
|
|
689
|
+
.description("Auto-fail submitted tx stuck past window (V2)")
|
|
690
|
+
.action(() => {
|
|
691
|
+
console.log(JSON.stringify(autoFailStuckTxV2(), null, 2));
|
|
692
|
+
});
|
|
416
693
|
}
|