mudular code ready to fork
This commit is contained in:
@@ -1,26 +1,15 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:web_socket_channel/web_socket_channel.dart';
|
||||
import 'package:nostr_tools/nostr_tools.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import '../../core/logger.dart';
|
||||
import '../../core/exceptions/nostr_exception.dart';
|
||||
import 'models/nostr_keypair.dart';
|
||||
import 'models/nostr_event.dart';
|
||||
import 'models/nostr_relay.dart';
|
||||
import 'models/nostr_profile.dart';
|
||||
|
||||
/// Exception thrown when Nostr operations fail.
|
||||
class NostrException implements Exception {
|
||||
/// Error message.
|
||||
final String message;
|
||||
|
||||
/// Creates a [NostrException] with the provided message.
|
||||
NostrException(this.message);
|
||||
|
||||
@override
|
||||
String toString() => 'NostrException: $message';
|
||||
}
|
||||
|
||||
/// Service for interacting with Nostr protocol.
|
||||
///
|
||||
/// This service provides:
|
||||
@@ -492,7 +481,7 @@ class NostrService {
|
||||
}
|
||||
} catch (e) {
|
||||
// Ignore parsing errors
|
||||
debugPrint('Error parsing profile event: $e');
|
||||
Logger.warning('Error parsing profile event: $e');
|
||||
}
|
||||
} else if (message['type'] == 'EOSE' &&
|
||||
message['subscription_id'] == reqId) {
|
||||
@@ -634,7 +623,7 @@ class NostrService {
|
||||
addedCount++;
|
||||
} catch (e) {
|
||||
// Skip invalid relay URLs
|
||||
debugPrint('Warning: Invalid relay URL from NIP-05: $relayUrl');
|
||||
Logger.warning('Invalid relay URL from NIP-05: $relayUrl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user