@tokamak-private-dapps/private-state-cli 1.2.1 → 2.0.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.
@@ -0,0 +1,161 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Private-State Evidence Investigator</title>
7
+ <link rel="stylesheet" href="./styles.css">
8
+ </head>
9
+ <body>
10
+ <main class="app">
11
+ <header class="toolbar">
12
+ <div>
13
+ <h1>Private-State Evidence Investigator</h1>
14
+ <p>Filter a local raw evidence ZIP into a narrower user-consent disclosure package.</p>
15
+ </div>
16
+ <label class="file-button">
17
+ <input id="bundleFile" type="file" accept=".zip,application/zip">
18
+ Load evidence ZIP
19
+ </label>
20
+ </header>
21
+
22
+ <section class="warning">
23
+ <strong>Raw evidence bundles are not submission packages.</strong>
24
+ This tool runs entirely in the browser. It reads a full-note evidence bundle, lets the user
25
+ select a limited disclosure scope, and writes a new ZIP containing only selected records and
26
+ directly referenced transaction evidence. It does not request or include viewing keys,
27
+ spending keys, wallet secrets, or account private keys.
28
+ </section>
29
+
30
+ <section class="grid">
31
+ <form id="filters" class="panel">
32
+ <h2>Filter Scope</h2>
33
+ <label>
34
+ Commitment contains
35
+ <input name="commitment" autocomplete="off" placeholder="0x...">
36
+ </label>
37
+ <label>
38
+ Nullifier contains
39
+ <input name="nullifier" autocomplete="off" placeholder="0x...">
40
+ </label>
41
+ <label>
42
+ Creation tx
43
+ <input name="creationTx" autocomplete="off" placeholder="0x...">
44
+ </label>
45
+ <label>
46
+ Spend tx
47
+ <input name="spendTx" autocomplete="off" placeholder="0x...">
48
+ </label>
49
+ <div class="two-col">
50
+ <label>
51
+ Created from block
52
+ <input name="createdFrom" inputmode="numeric" autocomplete="off">
53
+ </label>
54
+ <label>
55
+ Created to block
56
+ <input name="createdTo" inputmode="numeric" autocomplete="off">
57
+ </label>
58
+ </div>
59
+ <div class="two-col">
60
+ <label>
61
+ Spent from block
62
+ <input name="spentFrom" inputmode="numeric" autocomplete="off">
63
+ </label>
64
+ <label>
65
+ Spent to block
66
+ <input name="spentTo" inputmode="numeric" autocomplete="off">
67
+ </label>
68
+ </div>
69
+ <div class="two-col">
70
+ <label>
71
+ Status
72
+ <select name="status">
73
+ <option value="">Any</option>
74
+ <option value="unused">Unused</option>
75
+ <option value="spent">Spent</option>
76
+ </select>
77
+ </label>
78
+ <label>
79
+ Direction
80
+ <select name="direction">
81
+ <option value="">Any</option>
82
+ <option value="self-mint">Self mint</option>
83
+ <option value="sent">Sent</option>
84
+ <option value="received">Received</option>
85
+ <option value="unknown">Unknown</option>
86
+ </select>
87
+ </label>
88
+ </div>
89
+ <label>
90
+ Counterparty L2 address
91
+ <input name="counterparty" autocomplete="off" placeholder="0x...">
92
+ </label>
93
+ <button id="applyFilters" type="button">Apply filters</button>
94
+ </form>
95
+
96
+ <form id="packageForm" class="panel">
97
+ <h2>Package Metadata</h2>
98
+ <label>
99
+ Case ID
100
+ <input name="caseId" autocomplete="off" placeholder="exchange-case-001">
101
+ </label>
102
+ <label>
103
+ Requesting party
104
+ <input name="requestingParty" autocomplete="off" placeholder="Exchange or investigator name">
105
+ </label>
106
+ <label>
107
+ Bridge deposit tx
108
+ <input name="bridgeDepositTx" autocomplete="off" placeholder="0x...">
109
+ </label>
110
+ <label>
111
+ Withdraw or claim tx
112
+ <input name="withdrawTx" autocomplete="off" placeholder="0x...">
113
+ </label>
114
+ <fieldset>
115
+ <legend>Disclosure intents</legend>
116
+ <label><input name="intent" type="checkbox" value="note-receipt" checked> Note receipt</label>
117
+ <label><input name="intent" type="checkbox" value="note-use" checked> Redeem or note use linkage</label>
118
+ <label><input name="intent" type="checkbox" value="period-receipts"> Period receipts</label>
119
+ <label><input name="intent" type="checkbox" value="counterparty-disclosure"> Counterparty subset</label>
120
+ <label><input name="intent" type="checkbox" value="deposit-mint-linkage"> Deposit to note mint linkage</label>
121
+ <label><input name="intent" type="checkbox" value="exchange-consent-package" checked> Exchange consent package</label>
122
+ </fieldset>
123
+ <label>
124
+ User statement
125
+ <textarea name="statement" rows="5" placeholder="Optional explanation included in the disclosure package."></textarea>
126
+ </label>
127
+ <button id="buildPackage" type="button" disabled>Build disclosure ZIP</button>
128
+ </form>
129
+ </section>
130
+
131
+ <section class="panel">
132
+ <div class="table-header">
133
+ <h2>Matched Notes</h2>
134
+ <div class="actions">
135
+ <button id="selectAll" type="button" disabled>Select all</button>
136
+ <button id="selectNone" type="button" disabled>Select none</button>
137
+ </div>
138
+ </div>
139
+ <div id="status" class="status">Load a raw evidence ZIP to begin.</div>
140
+ <div class="table-wrap">
141
+ <table>
142
+ <thead>
143
+ <tr>
144
+ <th>Use</th>
145
+ <th>Commitment</th>
146
+ <th>Value</th>
147
+ <th>Status</th>
148
+ <th>Created</th>
149
+ <th>Spent</th>
150
+ <th>Direction</th>
151
+ <th>Counterparty</th>
152
+ </tr>
153
+ </thead>
154
+ <tbody id="noteRows"></tbody>
155
+ </table>
156
+ </div>
157
+ </section>
158
+ </main>
159
+ <script src="./app.js"></script>
160
+ </body>
161
+ </html>
@@ -0,0 +1,249 @@
1
+ :root {
2
+ color-scheme: light;
3
+ --bg: #f6f7f9;
4
+ --panel: #ffffff;
5
+ --text: #18202a;
6
+ --muted: #647183;
7
+ --line: #d7dde6;
8
+ --accent: #0d6efd;
9
+ --accent-dark: #084fb2;
10
+ --warn-bg: #fff6dc;
11
+ --warn-line: #ebc35a;
12
+ font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
13
+ }
14
+
15
+ * {
16
+ box-sizing: border-box;
17
+ }
18
+
19
+ body {
20
+ margin: 0;
21
+ background: var(--bg);
22
+ color: var(--text);
23
+ }
24
+
25
+ .app {
26
+ max-width: 1240px;
27
+ margin: 0 auto;
28
+ padding: 24px;
29
+ }
30
+
31
+ .toolbar {
32
+ display: flex;
33
+ align-items: center;
34
+ justify-content: space-between;
35
+ gap: 24px;
36
+ margin-bottom: 16px;
37
+ }
38
+
39
+ h1,
40
+ h2 {
41
+ margin: 0;
42
+ letter-spacing: 0;
43
+ }
44
+
45
+ h1 {
46
+ font-size: 28px;
47
+ line-height: 1.2;
48
+ }
49
+
50
+ h2 {
51
+ font-size: 17px;
52
+ line-height: 1.3;
53
+ }
54
+
55
+ p {
56
+ margin: 8px 0 0;
57
+ color: var(--muted);
58
+ }
59
+
60
+ .file-button,
61
+ button {
62
+ border: 1px solid var(--accent);
63
+ background: var(--accent);
64
+ color: #fff;
65
+ border-radius: 6px;
66
+ padding: 10px 14px;
67
+ font-size: 14px;
68
+ font-weight: 600;
69
+ cursor: pointer;
70
+ white-space: nowrap;
71
+ }
72
+
73
+ .file-button input {
74
+ display: none;
75
+ }
76
+
77
+ button:disabled {
78
+ border-color: #a8b3c0;
79
+ background: #a8b3c0;
80
+ cursor: not-allowed;
81
+ }
82
+
83
+ button:hover:not(:disabled),
84
+ .file-button:hover {
85
+ background: var(--accent-dark);
86
+ }
87
+
88
+ .warning {
89
+ border: 1px solid var(--warn-line);
90
+ background: var(--warn-bg);
91
+ border-radius: 8px;
92
+ padding: 14px 16px;
93
+ margin-bottom: 18px;
94
+ line-height: 1.5;
95
+ }
96
+
97
+ .grid {
98
+ display: grid;
99
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
100
+ gap: 16px;
101
+ margin-bottom: 16px;
102
+ }
103
+
104
+ .panel {
105
+ border: 1px solid var(--line);
106
+ background: var(--panel);
107
+ border-radius: 8px;
108
+ padding: 16px;
109
+ }
110
+
111
+ form {
112
+ display: grid;
113
+ gap: 12px;
114
+ }
115
+
116
+ label {
117
+ display: grid;
118
+ gap: 6px;
119
+ color: var(--muted);
120
+ font-size: 13px;
121
+ line-height: 1.3;
122
+ }
123
+
124
+ input,
125
+ select,
126
+ textarea {
127
+ width: 100%;
128
+ border: 1px solid var(--line);
129
+ border-radius: 6px;
130
+ padding: 9px 10px;
131
+ background: #fff;
132
+ color: var(--text);
133
+ font: inherit;
134
+ min-width: 0;
135
+ }
136
+
137
+ textarea {
138
+ resize: vertical;
139
+ }
140
+
141
+ fieldset {
142
+ border: 1px solid var(--line);
143
+ border-radius: 8px;
144
+ padding: 10px 12px 12px;
145
+ display: grid;
146
+ grid-template-columns: repeat(2, minmax(0, 1fr));
147
+ gap: 8px 12px;
148
+ }
149
+
150
+ fieldset label {
151
+ display: flex;
152
+ align-items: center;
153
+ gap: 8px;
154
+ color: var(--text);
155
+ }
156
+
157
+ fieldset input {
158
+ width: auto;
159
+ }
160
+
161
+ legend {
162
+ color: var(--muted);
163
+ font-size: 13px;
164
+ padding: 0 4px;
165
+ }
166
+
167
+ .two-col {
168
+ display: grid;
169
+ grid-template-columns: repeat(2, minmax(0, 1fr));
170
+ gap: 10px;
171
+ }
172
+
173
+ .table-header {
174
+ display: flex;
175
+ justify-content: space-between;
176
+ align-items: center;
177
+ gap: 16px;
178
+ margin-bottom: 10px;
179
+ }
180
+
181
+ .actions {
182
+ display: flex;
183
+ gap: 8px;
184
+ }
185
+
186
+ .status {
187
+ min-height: 22px;
188
+ margin-bottom: 10px;
189
+ color: var(--muted);
190
+ font-size: 14px;
191
+ }
192
+
193
+ .table-wrap {
194
+ overflow: auto;
195
+ border: 1px solid var(--line);
196
+ border-radius: 8px;
197
+ }
198
+
199
+ table {
200
+ width: 100%;
201
+ min-width: 980px;
202
+ border-collapse: collapse;
203
+ font-size: 13px;
204
+ }
205
+
206
+ th,
207
+ td {
208
+ border-bottom: 1px solid var(--line);
209
+ padding: 9px 10px;
210
+ text-align: left;
211
+ vertical-align: top;
212
+ }
213
+
214
+ th {
215
+ background: #eef2f7;
216
+ color: #334155;
217
+ position: sticky;
218
+ top: 0;
219
+ }
220
+
221
+ tr:last-child td {
222
+ border-bottom: 0;
223
+ }
224
+
225
+ .mono {
226
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
227
+ overflow-wrap: anywhere;
228
+ }
229
+
230
+ .muted {
231
+ color: var(--muted);
232
+ }
233
+
234
+ @media (max-width: 900px) {
235
+ .app {
236
+ padding: 16px;
237
+ }
238
+
239
+ .toolbar,
240
+ .grid {
241
+ grid-template-columns: 1fr;
242
+ display: grid;
243
+ }
244
+
245
+ fieldset,
246
+ .two-col {
247
+ grid-template-columns: 1fr;
248
+ }
249
+ }