Skip to main content

dostr_nip55 0.1.0 copy "dostr_nip55: ^0.1.0" to clipboard
dostr_nip55: ^0.1.0 copied to clipboard

PlatformAndroid

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);
}
0
likes
160
points
--
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

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.

Repository (GitHub)
View/report issues

Topics

#nostr #dostr #nip55 #signer

License

MIT (license)

Dependencies

dostr_nip01, dostr_nip19, dostr_signer, flutter, rxdart

More

Packages that depend on dostr_nip55

Packages that implement dostr_nip55