nip07_event_signer 1.0.4-dev.7 copy "nip07_event_signer: ^1.0.4-dev.7" to clipboard
nip07_event_signer: ^1.0.4-dev.7 copied to clipboard

Nostr nip07 signer for ndk

example/nip07_event_signer_example.dart

import 'package:ndk/ndk.dart';

/// import web signer package
import 'package:nip07_event_signer/nip07_event_signer.dart';

void main() async {
  /// create ndk obj
  final ndk = Ndk.defaultConfig();

  /// create web signer
  final webSigner = Nip07EventSigner();

  /// On the web, you need to call this first!
  /// getPublicKeyAsync() caches the public key, and ndk uses the cached version
  /// If you want to update from the real signer, call getPublicKeyAsync() again
  await webSigner.getPublicKeyAsync();

  /// login with the web signer
  ndk.accounts.loginExternalSigner(signer: webSigner);
}
1
likes
0
points
677
downloads

Publisher

unverified uploader

Weekly Downloads

Nostr nip07 signer for ndk

Repository (GitHub)
View/report issues

Topics

#nostr

License

unknown (license)

Dependencies

ndk

More

Packages that depend on nip07_event_signer