summaryrefslogtreecommitdiffstats
path: root/src/app.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-07-05 13:25:25 -0700
committerAdam Soltys <[email protected]>2026-07-05 13:25:25 -0700
commit191f6f757c596cf974ba4ee63967cdf19389fd58 (patch)
tree8e1b07195eddca5d54acaa66dbd9edcf70b362ba /src/app.js
parentf9fc0bb3e38c3387f8af5d151aa03d83376ba9cc (diff)
downloadcoinosv3-191f6f757c596cf974ba4ee63967cdf19389fd58.tar.gz
coinosv3-191f6f757c596cf974ba4ee63967cdf19389fd58.zip
Ark gifts: instant off-chain bearer gifts inside the gift flow
Ark can't presign a bearer spend, so an ark gift is a vtxo sent to an ephemeral ark identity whose seed IS the link (/ag/<code>: net, amount, 32-byte secret). The claimer rebuilds the identity, reads its mailbox, and sweeps to their own ark address — instant, free, and it works for a brand-new empty wallet with zero on-chain footprint. The sender keeps the secret, which is what makes revoke possible (first cosign wins). The gift form gains an On-chain/Ark source toggle when ark balance exists; ark gifts skip the lock/split logic entirely. Claim, choose- wallet, already-claimed, and nostr-locked (/lg/) flows all branch by code kind; unclaimed ark gifts list with one-tap revoke and lazily mark themselves claimed via GetVtxoStatus. Features stay decoupled: gifts asks for ark support via the new ctx.hook seam, so either feature builds alone. Also restores goHome in the feature ctx — lost in the plugin-seam extraction, it made the already-claimed screen throw on render. Co-Authored-By: Claude Fable 5 <[email protected]>
Diffstat (limited to 'src/app.js')
-rw-r--r--src/app.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/app.js b/src/app.js
index 4912ea1..f659097 100644
--- a/src/app.js
+++ b/src/app.js
@@ -2907,11 +2907,15 @@ async function importSnapshotFile(e) {
// sits just before boot so every helper it captures is defined; the hooks are
// only invoked at runtime (first render happens after loadLocale below).
const ctx = {
- h, ui, render, wallet, toast, copyBtn, pasteBtn, blankSend, goBack, openExternal,
+ h, ui, render, wallet, toast, copyBtn, pasteBtn, blankSend, goBack, goHome, openExternal,
fmtAmount, unitLabel, unitTag, parseAmount, getUnit: () => unit, toggleUnit, download,
brandHeader, activeAccount, setAccounts: (list) => { accounts = list; },
getAccounts: () => accounts,
claimTargets, enterWallet, activateAccount, commitAccount,
+ // cross-feature calls (e.g. gifts asking the ark feature for ark-gift
+ // support) — lazy so it resolves against the final FEATURES list, and a
+ // build without the target feature simply gets null back
+ hook: (name, ...args) => featureHook(name, ...args),
};
const FEATURES = buildFeatures(ctx);