Merge branch 'spike/block2-derisking'

This commit is contained in:
vjrj 2026-07-10 12:42:33 +02:00
commit 1750f3fa97
22 changed files with 576 additions and 16 deletions

View file

@ -0,0 +1,20 @@
import '../security/secret_store.dart';
/// Your own display name and short "about", persisted locally (keystore-backed,
/// no plaintext at rest). The network copy is a published NIP-01 kind:0 event;
/// this local copy prefills the editor and works offline.
class ProfileStore {
ProfileStore(this._store);
final SecretStore _store;
static const _nameKey = 'tane.social.profile.name';
static const _aboutKey = 'tane.social.profile.about';
Future<String> name() async => (await _store.read(_nameKey)) ?? '';
Future<String> about() async => (await _store.read(_aboutKey)) ?? '';
Future<void> save({required String name, required String about}) async {
await _store.write(_nameKey, name.trim());
await _store.write(_aboutKey, about.trim());
}
}

View file

@ -51,13 +51,15 @@ class SocialSession {
SocialSession(this._channel)
: offers = NostrOfferTransport(_channel),
messages = NostrMessageTransport(_channel),
trust = NostrTrustTransport(_channel);
trust = NostrTrustTransport(_channel),
profile = NostrProfileTransport(_channel);
final NostrChannel _channel;
final OfferTransport offers;
final MessageTransport messages;
final TrustTransport trust;
final ProfileTransport profile;
Future<void> close() => _channel.close();
}