nostr_bunker 1.4.0 copy "nostr_bunker: ^1.4.0" to clipboard
nostr_bunker: ^1.4.0 copied to clipboard

With this package your app can act as a bunker and will be able to sign events from others Nostr apps.

example/nostr_bunker_example.dart

import 'package:ndk/ndk.dart';
import 'package:ndk/shared/nips/nip01/bip340.dart';
import 'package:nostr_bunker/nostr_bunker.dart';

void main() async {
  final userKeyPair = Bip340.generatePrivateKey();
  final bunker = Bunker(
    ndk: Ndk.defaultConfig(),
    privateKeys: [userKeyPair.privateKey!],
  );

  final bunkerUrl = bunker.getBunkerUrl(userPubkey: userKeyPair.publicKey);

  final ndkClient = Ndk.defaultConfig();

  final connection = await ndkClient.bunkers.connectWithBunkerUrl(bunkerUrl);

  print("Connected: ${connection != null}");
}
1
likes
150
points
93
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

With this package your app can act as a bunker and will be able to sign events from others Nostr apps.

Repository

Topics

#nostr #nip46

License

MIT (license)

Dependencies

ndk

More

Packages that depend on nostr_bunker