@tokamak-private-dapps/private-state-cli 2.1.1 → 2.2.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/CHANGELOG.md +45 -0
- package/README.md +109 -38
- package/cli-assistant.html +11 -5
- package/commands/account.mjs +39 -0
- package/commands/channel.mjs +58 -0
- package/commands/index.mjs +62 -0
- package/commands/investigator.mjs +11 -0
- package/commands/notes.mjs +34 -0
- package/commands/system.mjs +49 -0
- package/commands/wallet.mjs +80 -0
- package/investigator/README.md +16 -6
- package/investigator/app.js +612 -17
- package/investigator/index.html +153 -90
- package/investigator/styles.css +277 -28
- package/lib/private-state-cli-command-registry.mjs +102 -30
- package/lib/private-state-runtime-management.mjs +294 -25
- package/lib/runtime.mjs +11572 -0
- package/package.json +2 -1
- package/private-state-bridge-cli.mjs +2 -11269
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
} from "../lib/runtime.mjs";
|
|
24
|
+
|
|
25
|
+
export const walletCommands = Object.freeze({
|
|
26
|
+
"wallet-list": async (args) => {
|
|
27
|
+
assertListLocalWalletsArgs(args);
|
|
28
|
+
handleListLocalWallets({ args });
|
|
29
|
+
},
|
|
30
|
+
"wallet-export-backup": async (args) => {
|
|
31
|
+
assertWalletExportBackupArgs(args);
|
|
32
|
+
handleWalletExportBackup({ args });
|
|
33
|
+
},
|
|
34
|
+
"wallet-export-viewing-key": async (args) => {
|
|
35
|
+
assertWalletExportKeyArgs(args, "wallet-export-viewing-key");
|
|
36
|
+
handleWalletExportKey({ args, keyKind: "viewing" });
|
|
37
|
+
},
|
|
38
|
+
"wallet-export-spending-key": async (args) => {
|
|
39
|
+
assertWalletExportKeyArgs(args, "wallet-export-spending-key");
|
|
40
|
+
handleWalletExportKey({ args, keyKind: "spending" });
|
|
41
|
+
},
|
|
42
|
+
"wallet-import-backup": async (args) => {
|
|
43
|
+
assertWalletImportBackupArgs(args);
|
|
44
|
+
handleWalletImportBackup({ args });
|
|
45
|
+
},
|
|
46
|
+
"wallet-import-viewing-key": async (args) => {
|
|
47
|
+
assertWalletImportKeyArgs(args, "wallet-import-viewing-key");
|
|
48
|
+
handleWalletImportKey({ args, keyKind: "viewing" });
|
|
49
|
+
},
|
|
50
|
+
"wallet-import-spending-key": async (args) => {
|
|
51
|
+
assertWalletImportKeyArgs(args, "wallet-import-spending-key");
|
|
52
|
+
handleWalletImportKey({ args, keyKind: "spending" });
|
|
53
|
+
},
|
|
54
|
+
"wallet-recover-workspace": async (args) => {
|
|
55
|
+
assertRecoverWalletArgs(args);
|
|
56
|
+
const { network, provider, rpcUrl } = loadExplicitCommandRuntime(args, { staticNetwork: true, prepareArtifacts: true });
|
|
57
|
+
await assertProviderChainIdMatchesNetwork({ provider, network, rpcUrl });
|
|
58
|
+
await handleRecoverWallet({ args, network, provider, rpcUrl });
|
|
59
|
+
},
|
|
60
|
+
"wallet-get-meta": async (args) => {
|
|
61
|
+
assertWalletGetMetaArgs(args);
|
|
62
|
+
const { provider } = loadWalletCommandRuntime(args, { prepareArtifacts: true });
|
|
63
|
+
await handleWalletGetMeta({ args, provider });
|
|
64
|
+
},
|
|
65
|
+
"wallet-get-channel-fund": async (args) => {
|
|
66
|
+
assertWalletGetChannelFundArgs(args);
|
|
67
|
+
const { provider } = loadWalletCommandRuntime(args, { prepareArtifacts: true });
|
|
68
|
+
await handleWalletGetChannelFund({ args, provider });
|
|
69
|
+
},
|
|
70
|
+
"wallet-deposit-channel": async (args) => {
|
|
71
|
+
assertWalletChannelMoveArgs(args, "wallet-deposit-channel");
|
|
72
|
+
const { provider } = loadWalletCommandRuntime(args, { prepareArtifacts: true });
|
|
73
|
+
await handleGrothVaultMove({ args, provider, direction: "deposit" });
|
|
74
|
+
},
|
|
75
|
+
"wallet-withdraw-channel": async (args) => {
|
|
76
|
+
assertWalletChannelMoveArgs(args, "wallet-withdraw-channel");
|
|
77
|
+
const { provider } = loadWalletCommandRuntime(args, { prepareArtifacts: true });
|
|
78
|
+
await handleGrothVaultMove({ args, provider, direction: "withdraw" });
|
|
79
|
+
},
|
|
80
|
+
});
|
package/investigator/README.md
CHANGED
|
@@ -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,
|
|
14
|
-
user-consent disclosure ZIP. From an installed CLI package, `private-state-cli investigator` prints
|
|
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
|
|
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
|
|
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
|