@tokamak-private-dapps/private-state-cli 2.1.0 → 2.1.2

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.
@@ -0,0 +1,86 @@
1
+ import {
2
+ assertProviderChainIdMatchesNetwork,
3
+ assertListLocalWalletsArgs,
4
+ assertRecoverWalletArgs,
5
+ assertWalletChannelMoveArgs,
6
+ assertWalletExportBackupArgs,
7
+ assertWalletExportKeyArgs,
8
+ assertWalletGetChannelFundArgs,
9
+ assertWalletGetMetaArgs,
10
+ assertWalletImportBackupArgs,
11
+ assertWalletImportKeyArgs,
12
+ handleGrothVaultMove,
13
+ handleListLocalWallets,
14
+ handleRecoverWallet,
15
+ handleWalletExportBackup,
16
+ handleWalletExportKey,
17
+ handleWalletGetChannelFund,
18
+ handleWalletGetMeta,
19
+ handleWalletImportBackup,
20
+ handleWalletImportKey,
21
+ loadExplicitCommandRuntime,
22
+ loadWalletCommandRuntime,
23
+ prepareDeploymentArtifacts,
24
+ } from "../lib/runtime.mjs";
25
+
26
+ export const walletCommands = Object.freeze({
27
+ "wallet-list": async (args) => {
28
+ assertListLocalWalletsArgs(args);
29
+ handleListLocalWallets({ args });
30
+ },
31
+ "wallet-export-backup": async (args) => {
32
+ assertWalletExportBackupArgs(args);
33
+ handleWalletExportBackup({ args });
34
+ },
35
+ "wallet-export-viewing-key": async (args) => {
36
+ assertWalletExportKeyArgs(args, "wallet-export-viewing-key");
37
+ handleWalletExportKey({ args, keyKind: "viewing" });
38
+ },
39
+ "wallet-export-spending-key": async (args) => {
40
+ assertWalletExportKeyArgs(args, "wallet-export-spending-key");
41
+ handleWalletExportKey({ args, keyKind: "spending" });
42
+ },
43
+ "wallet-import-backup": async (args) => {
44
+ assertWalletImportBackupArgs(args);
45
+ handleWalletImportBackup({ args });
46
+ },
47
+ "wallet-import-viewing-key": async (args) => {
48
+ assertWalletImportKeyArgs(args, "wallet-import-viewing-key");
49
+ handleWalletImportKey({ args, keyKind: "viewing" });
50
+ },
51
+ "wallet-import-spending-key": async (args) => {
52
+ assertWalletImportKeyArgs(args, "wallet-import-spending-key");
53
+ handleWalletImportKey({ args, keyKind: "spending" });
54
+ },
55
+ "wallet-recover-workspace": async (args) => {
56
+ assertRecoverWalletArgs(args);
57
+ const { network, provider, rpcUrl } = loadExplicitCommandRuntime(args, { staticNetwork: true });
58
+ await assertProviderChainIdMatchesNetwork({ provider, network, rpcUrl });
59
+ await prepareDeploymentArtifacts(network.chainId);
60
+ await handleRecoverWallet({ args, network, provider, rpcUrl });
61
+ },
62
+ "wallet-get-meta": async (args) => {
63
+ assertWalletGetMetaArgs(args);
64
+ const { network, provider } = loadWalletCommandRuntime(args);
65
+ await prepareDeploymentArtifacts(network.chainId);
66
+ await handleWalletGetMeta({ args, provider });
67
+ },
68
+ "wallet-get-channel-fund": async (args) => {
69
+ assertWalletGetChannelFundArgs(args);
70
+ const { network, provider } = loadWalletCommandRuntime(args);
71
+ await prepareDeploymentArtifacts(network.chainId);
72
+ await handleWalletGetChannelFund({ args, provider });
73
+ },
74
+ "wallet-deposit-channel": async (args) => {
75
+ assertWalletChannelMoveArgs(args, "wallet-deposit-channel");
76
+ const { network, provider } = loadWalletCommandRuntime(args);
77
+ await prepareDeploymentArtifacts(network.chainId);
78
+ await handleGrothVaultMove({ args, provider, direction: "deposit" });
79
+ },
80
+ "wallet-withdraw-channel": async (args) => {
81
+ assertWalletChannelMoveArgs(args, "wallet-withdraw-channel");
82
+ const { network, provider } = loadWalletCommandRuntime(args);
83
+ await prepareDeploymentArtifacts(network.chainId);
84
+ await handleGrothVaultMove({ args, provider, direction: "withdraw" });
85
+ },
86
+ });
@@ -10,13 +10,13 @@ private-state-cli wallet get-notes \
10
10
  --acknowledge-full-note-plaintext-export
11
11
  ```
12
12
 
13
- Open `index.html` in a modern browser, load the raw ZIP, select a filter scope, and build a narrower
14
- user-consent disclosure ZIP. From an installed CLI package, `private-state-cli investigator` prints the bundled
15
- HTML path and opens it in the default browser.
13
+ Open `index.html` in a modern browser, load the raw ZIP, choose the disclosure request type, inspect the graph, and
14
+ build a narrower user-consent disclosure ZIP. From an installed CLI package, `private-state-cli investigator` prints
15
+ the bundled HTML path and opens it in the default browser.
16
16
 
17
17
  The tool does not run a server and does not send files over the network. It reads the selected ZIP in
18
- the browser and writes a new ZIP with selected note records plus directly referenced transaction,
19
- receipt, and event files.
18
+ the browser. It can write a new ZIP with selected note records plus directly referenced transaction,
19
+ receipt, and event files, and it can export a Markdown ASCII-art linkage report.
20
20
 
21
21
  The raw evidence bundle contains plaintext for all locally known notes. Do not submit the raw bundle
22
22
  as an exchange or auditor package unless full wallet-history disclosure is intended. Use the
@@ -26,7 +26,17 @@ The investigator accepts current epoch-aware evidence bundles only. Supported no
26
26
  `wallets/<wallet>/epochs/<epoch-id>/notes/` inside the ZIP. If a bundle uses an older layout, rebuild the local wallet
27
27
  workspace with `wallet recover-workspace` and export a new evidence ZIP with `wallet get-notes --export-evidence`.
28
28
 
29
- ## Supported Filtering
29
+ ## Supported Investigation Views
30
+
31
+ - purpose-first request presets for full graph view, specific note receipt, specific note use, transaction linkage,
32
+ period receipts, and counterparty subsets
33
+ - an interactive SVG note-linkage graph where every matched note is a node
34
+ - graph edges for external note creation, external note spend, and locally recoverable note-to-note linkage
35
+ - node detail overlays showing commitment, nullifier, value, status, creation reference, spend reference, direction, and
36
+ available counterparty metadata
37
+ - a Markdown ASCII-art report with a compact graph section and separate note detail sections
38
+
39
+ ## Supported Filtering Inputs
30
40
 
31
41
  - note commitment or nullifier
32
42
  - creation transaction or spend transaction