diff options
| author | Adam Soltys <[email protected]> | 2026-07-04 08:38:12 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-07-04 08:38:12 -0700 |
| commit | 65ad54a060a8035d8cf1e1ca2004f7c3bc5ff296 (patch) | |
| tree | a89500ec5f59c3cb6a8e7f79bbb71f27cf6cf2e1 /src/wallet.js | |
| parent | fdbae7472b42cf9bb8bbdf7d069be287a1cb7fc9 (diff) | |
| download | coinosv3-65ad54a060a8035d8cf1e1ca2004f7c3bc5ff296.tar.gz coinosv3-65ad54a060a8035d8cf1e1ca2004f7c3bc5ff296.zip | |
History: gifts are timeline entries, not a separate section
Gift links now sort into the send/receive timeline like any entry: a
clickable row (🎁, status tag, age, amount) opening a detail page that
carries the date/status plus the actions that used to crowd the list
row (view gift link, cancel/reclaim with the existing confirm flow).
A claimed gift merges into its claim transaction's row — labeled as the
gift, clickable to the tx detail, which gains a "This transaction
delivered your gift" section (claim txid resolved via outspend and
cached on the gift record). The old pinned gifts header and the
paginated all-gifts view are gone.
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QFAcD4V284DvYZZHP7Rxxy
Diffstat (limited to 'src/wallet.js')
| -rw-r--r-- | src/wallet.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/wallet.js b/src/wallet.js index 156d2f4..56e3726 100644 --- a/src/wallet.js +++ b/src/wallet.js @@ -1638,10 +1638,20 @@ export class Wallet { const live = new Set(this.utxos.map((u) => utxoId(u))); return Object.values(this.giftRecords()) .filter((r) => !r.revoked && r.outpoints && !r.outpoints.some((o) => live.has(o))) - .map((r) => ({ id: r.id, amount: r.amount, locked: r.locked, created: r.created })) + .map((r) => ({ id: r.id, amount: r.amount, locked: r.locked, created: r.created, claimTxid: r.claimTxid || null, outpoints: r.outpoints })) .sort((a, b) => (b.created || 0) - (a.created || 0)); } + // Remember which tx claimed a gift (resolved lazily via outspend) so the + // history can merge the gift row with its claim transaction. + setGiftClaimTx(id, txid) { + const recs = this.giftRecords(); + if (recs[id] && recs[id].claimTxid !== txid) { + recs[id].claimTxid = txid; + this._saveGiftRecords(); + } + } + // Best-fit coin selection for a gift of `gift` sats (needs gift + a dust // change): the smallest single confirmed coin that covers it — one input and // the least value locked until claim — else the fewest large coins. Returns |
