aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/messages.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-09-27 08:29:00 -0700
committerAdam Soltys <[email protected]>2026-09-27 08:29:00 -0700
commitb06bbb48e6c6c7f81a9592ab9562bb8e3042b2b6 (patch)
treee26dd2251b60ec0f73c0aa55d8d3fc5d40ca30ad /src/features/messages.js
parent095b5601c0b02d05f40ae7f435f9630988bd212b (diff)
downloadcoinosv3-b06bbb48e6c6c7f81a9592ab9562bb8e3042b2b6.tar.gz
coinosv3-b06bbb48e6c6c7f81a9592ab9562bb8e3042b2b6.zip
Amber (NIP-55) signs you in on Android: one intent per request, the answer read off the clipboard or pasted.
Closes #7. A "Sign in with Amber" door on Android opens nostrsigner: intents for get_public_key, sign_event and nip44 encrypt/decrypt, with a waiting card that reads the clipboard when the tab returns (or takes a paste). Requests queue one at a time — a sign-in fires the backup, relay list and follows together — and each answer is checked for its type so a stale clipboard is never mistaken for one. An interactive signer is not asked to decrypt DMs or private lists that arrive on their own; each trip through Amber is a deliberate one. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01VhUKyXKtsJ67QAFfb7QR9D
Diffstat (limited to 'src/features/messages.js')
-rw-r--r--src/features/messages.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/features/messages.js b/src/features/messages.js
index 16bc052..06cb6dd 100644
--- a/src/features/messages.js
+++ b/src/features/messages.js
@@ -2141,7 +2141,7 @@ export function messagesFeature(ctx) {
dec: async (ct) => nip44.decrypt(ct, wallet.nostr.ck),
});
const login = hook('nostrLoginIdentity');
- if (login && login.signer && login.signer.encryptSelf) out.push({
+ if (login && login.signer && login.signer.encryptSelf && !login.signer.interactive) out.push({
pk: login.pubkey,
sign: (e) => login.signer.signEvent(e),
enc: (txt) => login.signer.encryptSelf(txt),
@@ -2506,7 +2506,9 @@ export function messagesFeature(ctx) {
const out = [];
if (wallet.nostr && wallet.nostr.sk) out.push(wallet.nostr.sk);
const login = hook('nostrLoginIdentity');
- if (login && login.signer && login.signer.decryptFrom) out.push(login.signer);
+ // an interactive signer (Amber by intent) is a trip through another app
+ // per call: never for a wrap that arrives on its own
+ if (login && login.signer && login.signer.decryptFrom && !login.signer.interactive) out.push(login.signer);
return out;
}
// A "full-strength" attempt has every key this wallet expects: retries
@@ -2515,7 +2517,7 @@ export function messagesFeature(ctx) {
// sealed to the login npub.
function decryptorsComplete() {
const login = hook('nostrLoginIdentity');
- return !login || !!(login.signer && login.signer.decryptFrom);
+ return !login || !login.signer || !!login.signer.interactive || !!login.signer.decryptFrom;
}
// Raw-key unwraps (seed-derived / pasted nsec — the common case) run in