feat: live streaming

closes #43
This commit is contained in:
2025-05-30 13:48:37 +01:00
parent 917147605b
commit 428771462d
22 changed files with 1084 additions and 63 deletions

View File

@ -83,6 +83,7 @@ class LoginAccount {
final String? privateKey;
final List<String>? signerRelays;
final WalletConfig? wallet;
final String? streamEndpoint;
SimpleWallet? _cachedWallet;
@ -92,6 +93,7 @@ class LoginAccount {
this.privateKey,
this.signerRelays,
this.wallet,
this.streamEndpoint,
});
static LoginAccount nip19(String key) {
@ -139,6 +141,7 @@ class LoginAccount {
"pubKey": acc?.pubkey,
"privateKey": acc?.privateKey,
"wallet": acc?.wallet?.toJson(),
"streamEndpoint": acc?.streamEndpoint,
};
static LoginAccount? fromJson(Map<String, dynamic> json) {
@ -162,6 +165,7 @@ class LoginAccount {
json.containsKey("wallet") && json["wallet"] != null
? WalletConfig.fromJson(json["wallet"])
: null,
streamEndpoint: json["streamEndpoint"],
);
}
return null;
@ -215,4 +219,21 @@ class LoginData extends ValueNotifier<LoginAccount?> {
}
}
}
void configure({
List<String>? signerRelays,
WalletConfig? wallet,
String? streamEndpoint,
}) {
if (value != null) {
value = LoginAccount(
type: value!.type,
pubkey: value!.pubkey,
privateKey: value!.privateKey,
signerRelays: signerRelays ?? value!.signerRelays,
wallet: wallet,
streamEndpoint: streamEndpoint ?? value!.streamEndpoint,
);
}
}
}