nostr_client 0.2.0 copy "nostr_client: ^0.2.0" to clipboard
nostr_client: ^0.2.0 copied to clipboard

A nostr client package.

example/nostr_client_example.dart

import 'package:nostr_client/nostr_client.dart';

void main() {
  // Create a new relay instance and connect to the relay
  final relay = Relay('wss://relay.nostr.info');
  relay.connect();

  // Print events sent by the relay
  relay.stream.whereIsEvent().listen(print);

  // Request text events from the relay and subscribe to updates
  final filter = Filter(
    kinds: [EventKind.text],
    limit: 10,
  );
  final subscriptionId = relay.subscribe(filter);

  // Cancel the subscription
  relay.unsubscribe(subscriptionId);

  // Disconnect from the relay
  relay.disconnect();
}
0
likes
140
points
10
downloads

Publisher

unverified uploader

Weekly Downloads

A nostr client package.

Repository (GitHub)
View/report issues

Documentation

API reference

License

LGPL-3.0 (license)

Dependencies

bip340, collection, convert, http, json_annotation, logging, meta, pointycastle, uuid, web_socket_channel

More

Packages that depend on nostr_client