@shieldedtech/moth-tui 0.13.0-canary.20260903151454-e3385c4 → 0.13.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/screens/onboarding/SeedEntryScreen.d.ts.map +1 -1
- package/dist/screens/onboarding/SeedEntryScreen.js +15 -30
- package/dist/screens/onboarding/SeedEntryScreen.js.map +1 -1
- package/dist/screens/onboarding/SeedSourceScreen.js +1 -1
- package/dist/screens/onboarding/SeedSourceScreen.js.map +1 -1
- package/dist/screens/onboarding/seed-input.d.ts +15 -0
- package/dist/screens/onboarding/seed-input.d.ts.map +1 -0
- package/dist/screens/onboarding/seed-input.js +44 -0
- package/dist/screens/onboarding/seed-input.js.map +1 -0
- package/package.json +3 -3
- package/CHANGELOG.md +0 -227
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SeedEntryScreen.d.ts","sourceRoot":"","sources":["../../../src/screens/onboarding/SeedEntryScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAMxC,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElE,UAAU,KAAK;IACb,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAChC,GAAG,EAAE,SAAS,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"SeedEntryScreen.d.ts","sourceRoot":"","sources":["../../../src/screens/onboarding/SeedEntryScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAMxC,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElE,UAAU,KAAK;IACb,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAChC,GAAG,EAAE,SAAS,CAAC;CAChB;AAED,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,KAAK,qBAmDpD"}
|
|
@@ -2,48 +2,33 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { Box, Text } from 'ink';
|
|
4
4
|
import TextInput from 'ink-text-input';
|
|
5
|
-
import { validateMnemonic } from '@shieldedtech/moth-wallet';
|
|
6
5
|
import { BackHint } from '../../components/BackHint.js';
|
|
7
6
|
import { SectionHeader } from '../../components/SectionHeader.js';
|
|
8
|
-
|
|
9
|
-
return /^[0-9a-fA-F]{64}$/.test(seed);
|
|
10
|
-
}
|
|
7
|
+
import { checkSeedInput, HEX_SEED_NO_CHECKSUM_NOTE } from './seed-input.js';
|
|
11
8
|
export function SeedEntryScreen({ route, nav }) {
|
|
12
9
|
const { onComplete, partial } = route.params;
|
|
13
10
|
const source = partial.source;
|
|
14
11
|
const [value, setValue] = useState('');
|
|
15
12
|
const [error, setError] = useState('');
|
|
13
|
+
// Recomputed as the user types so an unusual length is flagged *before*
|
|
14
|
+
// Enter: submitting a derivable seed navigates away, so a warning shown at
|
|
15
|
+
// that point would never be read.
|
|
16
|
+
const live = source === 'hex' && value.trim().length > 0 ? checkSeedInput(source, value) : undefined;
|
|
16
17
|
const handleSubmit = (input) => {
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
setError('Invalid mnemonic. Must be 24 valid BIP-39 words (space or comma separated).');
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
nav.push('onboarding-passphrase', {
|
|
25
|
-
onComplete,
|
|
26
|
-
partial: { ...partial, seedInput: normalized },
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
else if (source === 'hex') {
|
|
30
|
-
if (!isValidHexSeed(trimmed)) {
|
|
31
|
-
setError('Invalid hex seed. Must be exactly 64 hex characters (0-9, a-f).');
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
nav.push('onboarding-passphrase', {
|
|
35
|
-
onComplete,
|
|
36
|
-
partial: { ...partial, seedInput: trimmed.toLowerCase() },
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
setError(`Unexpected seed source: ${String(source)}`);
|
|
18
|
+
const check = checkSeedInput(source, input);
|
|
19
|
+
if (!check.ok) {
|
|
20
|
+
setError(check.error ?? 'Invalid seed.');
|
|
21
|
+
return;
|
|
41
22
|
}
|
|
23
|
+
nav.push('onboarding-passphrase', {
|
|
24
|
+
onComplete,
|
|
25
|
+
partial: { ...partial, seedInput: check.value },
|
|
26
|
+
});
|
|
42
27
|
};
|
|
43
28
|
const promptText = source === 'mnemonic'
|
|
44
29
|
? 'Enter 24-word mnemonic (space or comma separated):'
|
|
45
|
-
: 'Enter wallet seed (64 hex characters):';
|
|
30
|
+
: 'Enter wallet seed (64 hex characters, or 128 if derived from a recovery phrase):';
|
|
46
31
|
const placeholder = source === 'mnemonic' ? 'word1 word2 word3…' : 'a1b2c3…';
|
|
47
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(SectionHeader, { title: "Enter seed", hint: promptText }), _jsxs(Box, { flexDirection: "column", paddingLeft: 2, children: [_jsxs(Box, { children: [_jsx(Text, { children: "\u203A " }), _jsx(TextInput, { value: value, onChange: (v) => { setValue(v); setError(''); }, onSubmit: handleSubmit, placeholder: placeholder, mask: "*" })] }), error && _jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: "red", children: ["\u2717 ", error] }) }), _jsx(BackHint, {})] })] }));
|
|
32
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(SectionHeader, { title: "Enter seed", hint: promptText }), _jsxs(Box, { flexDirection: "column", paddingLeft: 2, children: [_jsxs(Box, { children: [_jsx(Text, { children: "\u203A " }), _jsx(TextInput, { value: value, onChange: (v) => { setValue(v); setError(''); }, onSubmit: handleSubmit, placeholder: placeholder, mask: "*" })] }), error && _jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: "red", children: ["\u2717 ", error] }) }), !error && live?.warning && _jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: "yellow", children: ["\u26A0 ", live.warning] }) }), source === 'hex' && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: HEX_SEED_NO_CHECKSUM_NOTE }) })), _jsx(BackHint, {})] })] }));
|
|
48
33
|
}
|
|
49
34
|
//# sourceMappingURL=SeedEntryScreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SeedEntryScreen.js","sourceRoot":"","sources":["../../../src/screens/onboarding/SeedEntryScreen.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SeedEntryScreen.js","sourceRoot":"","sources":["../../../src/screens/onboarding/SeedEntryScreen.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAQ5E,MAAM,UAAU,eAAe,CAAC,EAAE,KAAK,EAAE,GAAG,EAAS;IACnD,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;IAC7C,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC9B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACvC,MAAM,CAAC,K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,EAAE,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAC/C,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,WAAW,EACxB,IAAI,EAAC,GAAG,GACR,IACE,EACL,KAAK,IAAI,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YAAE,MAAC,IAAI,IAAC,KAAK,EAAC,KAAK,wBAAI,KAAK,IAAQ,GAAM,EACpE,CAAC,KAAK,IAAI,IAAI,EAAE,OAAO,IAAI,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YAAE,MAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,wBAAI,IAAI,CAAC,OAAO,IAAQ,GAAM,EAChG,MAAM,KAAK,KAAK,IAAI,CACnB,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YAAE,KAAC,IAAI,IAAC,QAAQ,kBAAE,yBAAyB,GAAQ,GAAM,CAC3E,EACD,KAAC,QAAQ,KAAG,IACR,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { Select } from '../../components/Select.js';
|
|
|
6
6
|
const SOURCES = [
|
|
7
7
|
{ label: 'Generate new (random)', value: 'random', hint: '24-word mnemonic will be shown for you to save' },
|
|
8
8
|
{ label: 'Import mnemonic', value: 'mnemonic', hint: '24 BIP-39 words' },
|
|
9
|
-
{ label: 'Import hex seed', value: 'hex', hint: '64 hex characters' },
|
|
9
|
+
{ label: 'Import hex seed', value: 'hex', hint: '64 hex characters, or 128 from a recovery phrase' },
|
|
10
10
|
];
|
|
11
11
|
export function SeedSourceScreen({ route, nav }) {
|
|
12
12
|
const { onComplete, partial } = route.params;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SeedSourceScreen.js","sourceRoot":"","sources":["../../../src/screens/onboarding/SeedSourceScreen.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MA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AY,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE5G,MAAM,YAAY,GAAG,CAAC,MAAkB,EAAE,EAAE;QAC1C,GAAG,CAAC,IAAI,CAAC,iBAAiB,EAAE;YAC1B,UAAU;YACV,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE;SAChC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,aACpC,KAAC,aAAa,IAAC,KAAK,EAAC,aAAa,EAAC,IAAI,EAAC,gEAA2D,GAAG,EACtG,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,WAAW,EAAE,CAAC,aACxC,KAAC,MAAM,IAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,GAAI,EAC9E,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YAAE,KAAC,IAAI,IAAC,QAAQ,6DAAoC,GAAM,EAC3E,KAAC,QAAQ,KAAG,IACR,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SeedSource } from '../../navigation/index.js';
|
|
2
|
+
export interface SeedInputCheck {
|
|
3
|
+
/** False only for input that cannot be imported at all. */
|
|
4
|
+
readonly ok: boolean;
|
|
5
|
+
/** The normalised value to hand to the importer, when `ok`. */
|
|
6
|
+
readonly value?: string;
|
|
7
|
+
/** Why the input was refused. Set whenever `ok` is false. */
|
|
8
|
+
readonly error?: string;
|
|
9
|
+
/** Advisory shown alongside an accepted value; never blocks submission. */
|
|
10
|
+
readonly warning?: string;
|
|
11
|
+
}
|
|
12
|
+
/** Standing note for the hex field: the only warning a seed can ever give. */
|
|
13
|
+
export declare const HEX_SEED_NO_CHECKSUM_NOTE = "A seed has no built-in check, unlike a recovery phrase. One wrong character imports a different, empty wallet and reports no error \u2014 compare it against your backup.";
|
|
14
|
+
export declare function checkSeedInput(source: SeedSource | undefined, raw: string): SeedInputCheck;
|
|
15
|
+
//# sourceMappingURL=seed-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed-input.d.ts","sourceRoot":"","sources":["../../../src/screens/onboarding/seed-input.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,MAAM,WAAW,cAAc;IAC7B,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,+DAA+D;IAC/D,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,6DAA6D;IAC7D,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,8EAA8E;AAC9E,eAAO,MAAM,yBAAyB,8KACkI,CAAC;AAEzK,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,cAAc,CA0B1F"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Copyright (C) Shielded Technologies
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
//
|
|
4
|
+
// Validation for the onboarding seed field, kept out of the screen so it can be
|
|
5
|
+
// tested without rendering ink.
|
|
6
|
+
//
|
|
7
|
+
// The hex arm delegates to core's `checkHexSeed` rather than matching a length
|
|
8
|
+
// itself. The old local `/^[0-9a-fA-F]{64}$/` refused every seed the SDK accepts
|
|
9
|
+
// bar one length — including the 128-character seed a phrase-backed wallet
|
|
10
|
+
// exports, which the CLI and the extension both take. It also ran *before*
|
|
11
|
+
// `importFromSeed`, so core's validation never got the chance to speak.
|
|
12
|
+
//
|
|
13
|
+
// A hex seed has no checksum, so an unusual-but-derivable length is reported as
|
|
14
|
+
// a warning and not a refusal: a truncated paste and a wallet genuinely created
|
|
15
|
+
// at that length are indistinguishable here, and refusing would lock the latter
|
|
16
|
+
// out. See `core/src/wallet/hex-seed.ts`.
|
|
17
|
+
import { checkHexSeed, describeHexSeedProblem, validateMnemonic } from '@shieldedtech/moth-wallet';
|
|
18
|
+
/** Standing note for the hex field: the only warning a seed can ever give. */
|
|
19
|
+
export const HEX_SEED_NO_CHECKSUM_NOTE = 'A seed has no built-in check, unlike a recovery phrase. One wrong character imports a different, empty wallet and reports no error — compare it against your backup.';
|
|
20
|
+
export function checkSeedInput(source, raw) {
|
|
21
|
+
const trimmed = raw.trim();
|
|
22
|
+
if (source === 'mnemonic') {
|
|
23
|
+
const normalized = trimmed.replace(/,/g, ' ').replace(/\s+/g, ' ').trim();
|
|
24
|
+
if (!validateMnemonic(normalized)) {
|
|
25
|
+
return { ok: false, error: 'Invalid mnemonic. Must be 24 valid BIP-39 words (space or comma separated).' };
|
|
26
|
+
}
|
|
27
|
+
return { ok: true, value: normalized };
|
|
28
|
+
}
|
|
29
|
+
if (source === 'hex') {
|
|
30
|
+
const check = checkHexSeed(trimmed);
|
|
31
|
+
if (!check.ok) {
|
|
32
|
+
return { ok: false, error: describeHexSeedProblem(check.problem, check.bytes) };
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
ok: true,
|
|
36
|
+
value: trimmed.toLowerCase(),
|
|
37
|
+
warning: check.unusualLength
|
|
38
|
+
? `This seed is ${check.bytes} bytes. Tools produce 32 or 64, so check the paste is complete — an incomplete seed imports a different wallet.`
|
|
39
|
+
: undefined,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
return { ok: false, error: `Unexpected seed source: ${String(source)}` };
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=seed-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed-input.js","sourceRoot":"","sources":["../../../src/screens/onboarding/seed-input.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,sCAAsC;AACtC,EAAE;AACF,gFAAgF;AAChF,gCAAgC;AAChC,EAAE;AACF,+EAA+E;AAC/E,iFAAiF;AACjF,2EAA2E;AAC3E,2EAA2E;AAC3E,wEAAwE;AACxE,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAChF,0CAA0C;AAE1C,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAcnG,8EAA8E;AAC9E,MAAM,CAAC,MAAM,yBAAyB,GACpC,sKAAsK,CAAC;AAEzK,MAAM,UAAU,cAAc,CAAC,MAA8B,EAAE,GAAW;IACxE,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAE3B,IAAI,MAAM,KAAK,UAAU,EAAE,CAAC;QAC1B,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QAC1E,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,EAAE,CAAC;YAClC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,6EAA6E,EAAE,CAAC;QAC7G,CAAC;QACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;IACzC,CAAC;IAED,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;QACrB,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;YACd,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,sBAAsB,CAAC,KAAK,CAAC,OAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QACnF,CAAC;QACD,OAAO;YACL,EAAE,EAAE,IAAI;YACR,KAAK,EAAE,OAAO,CAAC,WAAW,EAAE;YAC5B,OAAO,EAAE,KAAK,CAAC,aAAa;gBAC1B,CAAC,CAAC,gBAAgB,KAAK,CAAC,KAAK,iHAAiH;gBAC9I,CAAC,CAAC,SAAS;SACd,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,2BAA2B,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;AAC3E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shieldedtech/moth-tui",
|
|
3
|
-
"version": "0.13.0
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Terminal UI for Midnight Network wallet operations. USE AT YOUR OWN RISK. Experimental software provided AS-IS with no warranty. Not audited. For development and testing purposes only.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@midnight-ntwrk/ledger-v8": "8.1.0",
|
|
30
30
|
"@midnightntwrk/wallet-sdk": "^1.2.0",
|
|
31
|
-
"@shieldedtech/moth-wallet": "0.13.0
|
|
31
|
+
"@shieldedtech/moth-wallet": "^0.13.0",
|
|
32
32
|
"ink": "^7.0.1",
|
|
33
33
|
"ink-spinner": "^5.0.0",
|
|
34
34
|
"ink-text-input": "^6.0.0",
|
|
@@ -39,4 +39,4 @@
|
|
|
39
39
|
"typescript": "^5.5.0",
|
|
40
40
|
"vitest": "^3.1.0"
|
|
41
41
|
}
|
|
42
|
-
}
|
|
42
|
+
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
# @shieldedtech/moth-tui
|
|
2
|
-
|
|
3
|
-
## 0.13.0-canary.20260903151454-e3385c4
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- b49c96d: Give the CLI and TUI the pre-seed, timings and DUST-registration behaviour the
|
|
8
|
-
extension already had.
|
|
9
|
-
|
|
10
|
-
**Birthdays.** `chainTip` moves from the extension's background handlers into
|
|
11
|
-
core, and `wallet generate` on both surfaces records the chain tip as the new
|
|
12
|
-
wallet's birthday. Without one the `reference.height <= birthday` guard can never
|
|
13
|
-
pass, so no CLI or TUI wallet could ever be pre-seeded — the difference between
|
|
14
|
-
29.3s and 78.6 min on preprod. Imports still get none, deliberately: a restored
|
|
15
|
-
wallet may hold funds at any height, and seeding it past its own history would
|
|
16
|
-
lose them silently.
|
|
17
|
-
|
|
18
|
-
**`moth preseed status|refresh|build`.** Thin wrappers over core functions
|
|
19
|
-
that already existed but had no caller outside the extension. `refresh` is the
|
|
20
|
-
one worth having — 9.1s to catch a reference up, against 53.6 min to rebuild it
|
|
21
|
-
from genesis, which is what someone does by hand when the command is missing.
|
|
22
|
-
`build` says how long it will take before starting, because an unattended command
|
|
23
|
-
that appears to hang for an hour is indistinguishable from a broken one.
|
|
24
|
-
|
|
25
|
-
**Phase timings on disk.** `createFileTimingStore` backs the existing
|
|
26
|
-
storage-agnostic recorder with `~/.moth/timings.json` — the path
|
|
27
|
-
`docs/BENCHMARKING.md` already documented and nothing wrote. `moth diagnostics
|
|
28
|
-
timings` shows the timeline as deltas, and recording stays off until switched on.
|
|
29
|
-
A headless sync is where this matters most: it is the surface with no other
|
|
30
|
-
signal about where the time went.
|
|
31
|
-
|
|
32
|
-
**DUST registration in the TUI.** `DustRegistrationNotYetError` is now caught
|
|
33
|
-
distinctly, so a wallet whose NIGHT is too new to cover the registration fee is
|
|
34
|
-
told "not yet" instead of shown the raw SDK error as a failure. The panel and the
|
|
35
|
-
CLI already did this; the TUI was the surface still reporting it as a defect.
|
|
36
|
-
- 43eb678: Bound the Wallet State view's coin lists to what the terminal can show.
|
|
37
|
-
|
|
38
|
-
Observed on mainnet, where a shielded wallet holds far more coins than a test
|
|
39
|
-
wallet does. The itemised list ran past its own section and painted over the ones
|
|
40
|
-
beneath it, so the Unshielded and Dust sections printed lines like
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
▸ Unshielded Wallet
|
|
44
|
-
Ba29ed4a053c1ec576e7f7684832c062bebc5cf67c0a4a9242f4defebd4b112b94 522 (1 coin)
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
— that section's `Balance` label with a token row on top of it.
|
|
48
|
-
|
|
49
|
-
The cause is not formatting. Ink renders a frame in full and has no viewport, so a
|
|
50
|
-
frame taller than the terminal corrupts its redraw and lines overwrite one
|
|
51
|
-
another. `components/Select.tsx` already documents exactly this ("makes Ink
|
|
52
|
-
collapse the two lines onto one") and windows its list against `stdout.rows` to
|
|
53
|
-
avoid it; `StateView` had no equivalent and emitted a row per token plus a row per
|
|
54
|
-
coin, unbounded. `Label` pads with `padEnd` and never truncates, which is what
|
|
55
|
-
identifies the 2-character `Ba` as terminal overwrite rather than a truncation
|
|
56
|
-
bug — and why truncating the label would have fixed nothing.
|
|
57
|
-
|
|
58
|
-
Each block is now bounded as a whole, with the remainder reported:
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
Balance
|
|
62
|
-
29ed4a05…4b112b94 522 (1 coin)
|
|
63
|
-
… and 4,312 more
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Bounded as a whole because volume arrives from either direction — a wallet with
|
|
67
|
-
many tokens, or a token with many coins — and capping only the inner coin list
|
|
68
|
-
leaves the outer one unbounded. The rows are flattened into one list and one
|
|
69
|
-
budget covers them, so neither shape can overflow. The three sections split the
|
|
70
|
-
terminal's spare height; the `… and N more` line is counted against the budget it
|
|
71
|
-
belongs to.
|
|
72
|
-
|
|
73
|
-
Long token ids are now middle-elided to fit the terminal width. That is not only
|
|
74
|
-
cosmetic: at 80 columns a full 64-character id wrapped the header onto a second
|
|
75
|
-
line, which cost two rows where the budget assumed one.
|
|
76
|
-
|
|
77
|
-
`Dust` had the same unbounded shape and is fixed the same way, costing a
|
|
78
|
-
deregistered coin as two rows since it renders its `dtime` on a second line.
|
|
79
|
-
|
|
80
|
-
The row arithmetic lives in `utils/` as `flattenBalanceRows`, `windowRows`,
|
|
81
|
-
`truncateMiddle` and `balanceBudget`, unit-tested without rendering Ink.
|
|
82
|
-
- Updated dependencies [b49c96d]
|
|
83
|
-
- Updated dependencies [b49c96d]
|
|
84
|
-
- Updated dependencies [0508a38]
|
|
85
|
-
- Updated dependencies [2dabc50]
|
|
86
|
-
- Updated dependencies [3e131e2]
|
|
87
|
-
- Updated dependencies [9afd580]
|
|
88
|
-
- Updated dependencies [b49c96d]
|
|
89
|
-
- Updated dependencies [e31eaf8]
|
|
90
|
-
- Updated dependencies [c2f8b73]
|
|
91
|
-
- Updated dependencies [b49c96d]
|
|
92
|
-
- Updated dependencies [b49c96d]
|
|
93
|
-
- Updated dependencies [b49c96d]
|
|
94
|
-
- Updated dependencies [9be5669]
|
|
95
|
-
- Updated dependencies [ea1793d]
|
|
96
|
-
- Updated dependencies [316ca82]
|
|
97
|
-
- Updated dependencies [89f34aa]
|
|
98
|
-
- Updated dependencies [04f1aa4]
|
|
99
|
-
- @shieldedtech/moth-wallet@0.13.0-canary.20260903151454-e3385c4
|
|
100
|
-
|
|
101
|
-
## 0.12.1
|
|
102
|
-
|
|
103
|
-
### Patch Changes
|
|
104
|
-
|
|
105
|
-
- bd8d41f: Fix the published TUI package to use a semver dependency range for `moth-wallet` so npm consumers can install it outside the Yarn workspace.
|
|
106
|
-
- @shieldedtech/moth-wallet@0.12.1
|
|
107
|
-
|
|
108
|
-
## 0.12.0
|
|
109
|
-
|
|
110
|
-
### Minor Changes
|
|
111
|
-
|
|
112
|
-
- ea15676: Coordinate the first public package release under the Moth package names.
|
|
113
|
-
|
|
114
|
-
This is a minor bump because no package has previously been published under the
|
|
115
|
-
new names. The release remains experimental and unsupported, so it stays below
|
|
116
|
-
1.0.0. Package names, CLI identifiers, environment variables, connector identity,
|
|
117
|
-
and local state paths are aligned before publication; no compatibility shim is
|
|
118
|
-
required for an unpublished package.
|
|
119
|
-
|
|
120
|
-
### Patch Changes
|
|
121
|
-
|
|
122
|
-
- Updated dependencies [be98f55]
|
|
123
|
-
- Updated dependencies [ea15676]
|
|
124
|
-
- @shieldedtech/moth-wallet@0.12.0
|
|
125
|
-
|
|
126
|
-
## 0.2.0
|
|
127
|
-
|
|
128
|
-
### Minor Changes
|
|
129
|
-
|
|
130
|
-
- 36cb067: Add selectable proof-server and local WASM proving across the core wallet, CLI,
|
|
131
|
-
terminal dashboard, browser extension, and dApp connector API.
|
|
132
|
-
- fc93b31: Add the opt-in daemon for sharing one live wallet between a long-running host
|
|
133
|
-
(the TUI dashboard or `moth daemon serve`) and CLI clients over an authenticated
|
|
134
|
-
Unix-socket or TCP RPC. The daemon owns the sync engine and spending keys;
|
|
135
|
-
clients route the build/balance/prove/sign/submit pipeline through it, so keys
|
|
136
|
-
never leave the host process. Adds the `moth daemon serve|transfer|call|deploy|
|
|
137
|
-
submit-tx|dust register|dust deregister|key gen|key list|key revoke|maintenance`
|
|
138
|
-
subcommands, API-key authentication with read/write scopes, an append-only audit
|
|
139
|
-
log, and an L3 confirmation queue (interactive modal, or headless auto-approve
|
|
140
|
-
gated behind an explicit flag + env var).
|
|
141
|
-
|
|
142
|
-
### Patch Changes
|
|
143
|
-
|
|
144
|
-
- b157dd2: Add the browser extension wallet and dApp connector workflow.
|
|
145
|
-
|
|
146
|
-
The wallet core now supports browser-safe persisted sync state, activity history,
|
|
147
|
-
message signing, staged transfer construction and submission, fee estimation,
|
|
148
|
-
and DUST and intent operations. Add the WXT side-panel extension and Connector
|
|
149
|
-
Lab mock dApp, expose the new APIs through the browser adapter, and keep the CLI
|
|
150
|
-
and TUI integrations compatible with asynchronous sync cache handling and the
|
|
151
|
-
Ink runtime.
|
|
152
|
-
|
|
153
|
-
- 003720d: Clear balances on wallet/network switch in the terminal dashboard.
|
|
154
|
-
|
|
155
|
-
`useBalance` reset with `{...prev}`, so switching or importing a wallet briefly
|
|
156
|
-
showed the previous wallet's balances, coins, and sync progress under the new
|
|
157
|
-
wallet's name until the new sync emitted. It now resets to the empty state on a
|
|
158
|
-
switch. There is no steady-state flicker, since the sync effect only re-runs
|
|
159
|
-
when the wallet keys, network, or wallet name change.
|
|
160
|
-
|
|
161
|
-
- b7e2f00: add local network support
|
|
162
|
-
- e431662: Count booked unshielded inputs in the TUI's Wallet State balances.
|
|
163
|
-
|
|
164
|
-
The core folds booked (pending) unshielded inputs into the balance it reports,
|
|
165
|
-
but the state view summed only the available coin list, so the TUI and the
|
|
166
|
-
extension showed different NIGHT totals for the same wallet — observed on
|
|
167
|
-
preprod as 5,423.9987 against 8,423.998700, a gap of exactly the three booked
|
|
168
|
-
coins. A token whose coins were all booked had no row at all and read as not
|
|
169
|
-
held, while the extension still listed it.
|
|
170
|
-
|
|
171
|
-
The fungible balance block now groups over both populations and marks booked
|
|
172
|
-
coins `[in flight]` beside the existing `[Registered for Dust]` flag, so the
|
|
173
|
-
booked portion is visible rather than hidden behind an opaque "Pending N coins"
|
|
174
|
-
count. The grouping moved to `utils/balance.ts` as `groupCoinsForDisplay`, where
|
|
175
|
-
the arithmetic is unit-tested without rendering Ink. Shielded is unchanged: its
|
|
176
|
-
pending also holds incoming coins, which would over-count receipts.
|
|
177
|
-
|
|
178
|
-
- 717639a: Show DUST in DUST, not in NIGHT units, in the TUI balance table.
|
|
179
|
-
|
|
180
|
-
`useBalance` formatted the DUST balance with `formatNight`, which divides by
|
|
181
|
-
10^6 (STARS per NIGHT). DUST is denominated in SPECKS, 10^15 per DUST, so every
|
|
182
|
-
figure the balance table has ever shown was too large by a factor of a billion —
|
|
183
|
-
and plausibly so, which is why it survived. Now uses `formatDustBalance`, which
|
|
184
|
-
core has exported all along.
|
|
185
|
-
|
|
186
|
-
Reported as #78, with the arithmetic worked through against `formatNight`'s
|
|
187
|
-
source. The same substitution was fixed separately in core's sync log line; this
|
|
188
|
-
is the other call site, and the one a user actually reads.
|
|
189
|
-
|
|
190
|
-
- e8b98da: Restore the TUI build after `SyncProgress` gained a required `slowest` field.
|
|
191
|
-
|
|
192
|
-
`overallSyncProgress` now reports which sub-wallet the percentage came from, so
|
|
193
|
-
the sync line can say "syncing 27% (dust)" instead of leaving a reader to guess
|
|
194
|
-
why it disagrees with a gauge showing shielded and unshielded at 100%. Making
|
|
195
|
-
`slowest` required was deliberate — an unlabelled percentage is the defect — but
|
|
196
|
-
two TUI literals construct `SyncProgress` by hand and were not updated, so
|
|
197
|
-
`packages/tui` stopped typechecking the moment that landed.
|
|
198
|
-
|
|
199
|
-
Both are cases where nothing is behind: the fallback used before any progress has
|
|
200
|
-
been reported, and a fully-synced test stub. Both take `slowest: null`.
|
|
201
|
-
|
|
202
|
-
- Updated dependencies [fc93b31]
|
|
203
|
-
- Updated dependencies [fc93b31]
|
|
204
|
-
- Updated dependencies [12881a3]
|
|
205
|
-
- Updated dependencies [b157dd2]
|
|
206
|
-
- Updated dependencies [c7d1ef7]
|
|
207
|
-
- Updated dependencies [36cb067]
|
|
208
|
-
- Updated dependencies [fc93b31]
|
|
209
|
-
- Updated dependencies [6f914fc]
|
|
210
|
-
- Updated dependencies [fc93b31]
|
|
211
|
-
- Updated dependencies [fc93b31]
|
|
212
|
-
- Updated dependencies [771338d]
|
|
213
|
-
- Updated dependencies [fc93b31]
|
|
214
|
-
- Updated dependencies [ba86b72]
|
|
215
|
-
- Updated dependencies [fc93b31]
|
|
216
|
-
- Updated dependencies [b7e2f00]
|
|
217
|
-
- Updated dependencies [1c597ff]
|
|
218
|
-
- Updated dependencies [24cb16c]
|
|
219
|
-
- Updated dependencies [0f9369f]
|
|
220
|
-
- Updated dependencies [bf49ced]
|
|
221
|
-
- Updated dependencies [0f197e2]
|
|
222
|
-
- Updated dependencies [1f69f66]
|
|
223
|
-
- Updated dependencies [fc93b31]
|
|
224
|
-
- Updated dependencies [6766583]
|
|
225
|
-
- Updated dependencies [fc93b31]
|
|
226
|
-
- Updated dependencies [2fde86f]
|
|
227
|
-
- @shieldedtech/moth-wallet@0.2.0
|