dostr_nip55 0.1.0
dostr_nip55: ^0.1.0 copied to clipboard
NIP-55 Android signer for Nostr, to log in, sign and encrypt with a signer app from a Flutter app, without depending on dostr_flutter.
example/dostr_nip55_example.dart
import 'package:dostr_nip55/dostr_nip55.dart';
import 'package:dostr_signer/dostr_signer.dart';
import 'package:flutter/widgets.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
const signerApp = Nip55SignerApp();
if (!await signerApp.isAppInstalled()) {
debugPrint('No NIP-55 signer app installed');
return;
}
final Nip55LoginResult login;
try {
login = await signerApp.login();
} on SignerRequestRejectedException {
debugPrint('The user refused to log in');
return;
}
final signer = Nip55Signer(
publicKey: login.pubkey,
signerApp: Nip55SignerApp(package: login.package),
);
debugPrint(signer.publicKey);
}