diff --git a/README.md b/README.md index ec9ef36..f501ae1 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,12 @@ build configuration, and native integrations. ## Wallet development +Rust workspaces pin the shared `tx-types` 0.2 transaction core and its matching +noun runtime to one Git revision. `packages/wallet-engine` and `nockster-esp` +call the same `tx_types::planner`; their adapters provide RPC note data, wallet envelopes, +and software or hardware signatures. Composer inputs include the actual +`note_data` map and an explicit candidate height for time-locked inputs. + Use Node and npm versions matching `package.json`. Install dependencies from this directory; npm workspaces share the root lockfile. The Rust engine pins its toolchain in `packages/wallet-engine/rust-toolchain.toml`; the desktop diff --git a/apps/desktop/src-tauri/Cargo.lock b/apps/desktop/src-tauri/Cargo.lock index 84afd58..0155e68 100644 --- a/apps/desktop/src-tauri/Cargo.lock +++ b/apps/desktop/src-tauri/Cargo.lock @@ -2362,7 +2362,7 @@ checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "nockster-desktop" -version = "1.2.0" +version = "1.3.0" dependencies = [ "base64 0.22.1", "hidapi", diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml index 78ffa57..328cd7e 100644 --- a/apps/desktop/src-tauri/Cargo.toml +++ b/apps/desktop/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nockster-desktop" -version = "1.2.0" +version = "1.3.0" edition = "2021" rust-version = "1.90" diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json index 6d17138..8cddf42 100644 --- a/apps/desktop/src-tauri/tauri.conf.json +++ b/apps/desktop/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "Nockster", - "version": "1.2.0", + "version": "1.3.0", "identifier": "io.swps.nockster.desktop", "build": { "beforeDevCommand": "npm run dev:web", diff --git a/apps/desktop/src/transactions/Composer.svelte b/apps/desktop/src/transactions/Composer.svelte index 214fc5b..3d73814 100644 --- a/apps/desktop/src/transactions/Composer.svelte +++ b/apps/desktop/src/transactions/Composer.svelte @@ -45,7 +45,8 @@ commitments: '', refundAddress: '', refundHeight: '', - branch: 'claim' + branch: 'claim', + preimages: '' }; let outputs = [newOutput(1)]; let nextOutputId = 2; @@ -100,7 +101,7 @@ let selectionTimer: ReturnType | undefined; const composerWorker = createComposerWorker(); let height = ''; - let manual = { first: '', last: '', origin: '', amount: '' }; + let manual = { first: '', last: '', origin: '', amount: '', noteData: '{}' }; let notesLoading = false; let building = false; let error = ''; @@ -212,8 +213,9 @@ if (!alive || request !== noteRequest) return; notes = largestNotesFirst( loaded - .filter(note => Number(note.version) === 1) + .filter(note => note.version === '1') .map(note => ({ + note_data: note.noteData, name_first: note.firstName, name_last: note.lastName, origin_page: note.originPage, @@ -235,6 +237,7 @@ try { const wasm = await hardwareCrypto(); const note: Note = { + note_data: JSON.parse(manual.noteData), name_first: manual.first.trim(), name_last: manual.last.trim(), origin_page: wholeNumber(manual.origin, 'Origin block height'), @@ -248,7 +251,7 @@ throw new Error('This note is reserved by a pending transaction.'); notes = largestNotesFirst([...notes, note]); if (selectionMode === 'manual') selected = new Set([...selected, noteId(note)]); - manual = { first: '', last: '', origin: '', amount: '' }; + manual = { first: '', last: '', origin: '', amount: '', noteData: '{}' }; } catch (failure) { noteError = failure instanceof Error ? failure.message : String(failure); } @@ -291,6 +294,7 @@ const input: ComposeInput = { source_pkh: sourceAddress, notes: inputNotes, + manual_inputs: selectionMode === 'manual', outputs: [], current_height: wholeNumber(height, 'Current block height', 1) }; @@ -309,7 +313,12 @@ source.refundHeight, valid ), - spend_branch: source.branch === 'claim' ? 0 : 1 + spend_branch: source.branch === 'claim' ? 0 : 1, + preimages: source.preimages + .trim() + .split(/\s+/) + .filter(Boolean) + .map(value => Array.from(atob(value), ch => ch.charCodeAt(0))) }; input.outputs = outputs.map((output, index) => { try { @@ -499,6 +508,12 @@ +