fusion44 / nostr_client

A nostr client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nostr_client 0.2.0

A nostr client for dart and flutter.

Features

Getting Started

Add this package to the pubspec.yaml of your flutter project:

dependencies:
  nostr_client: ^0.2.0

Usage

import 'package:nostr_client/nostr_client.dart'

// 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();

Links

About

A nostr client

License:GNU Lesser General Public License v3.0


Languages

Language:Dart 100.0%