chore: setup bunker

This commit is contained in:
2025-05-15 11:12:12 +01:00
parent 2d855362e4
commit 787a848257
2 changed files with 28 additions and 1 deletions

View File

@ -12,8 +12,14 @@ class LoginAccount {
final AccountType type;
final String pubkey;
final String? privateKey;
final List<String>? signerRelays;
LoginAccount._({required this.type, required this.pubkey, this.privateKey});
LoginAccount._({
required this.type,
required this.pubkey,
this.privateKey,
this.signerRelays,
});
static LoginAccount nip19(String key) {
final keyData = bech32ToHex(key);
@ -42,6 +48,19 @@ class LoginAccount {
return LoginAccount._(type: AccountType.externalSigner, pubkey: key);
}
static LoginAccount bunker(
String privateKey,
String pubkey,
List<String> relays,
) {
return LoginAccount._(
type: AccountType.externalSigner,
pubkey: pubkey,
privateKey: privateKey,
signerRelays: relays,
);
}
static Map<String, dynamic> toJson(LoginAccount? acc) => {
"type": acc?.type.name,
"pubKey": acc?.pubkey,