Skip to main content

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

Normalization of Nostr relay urls, so two spellings of one relay compare equal, and a type for the normalized ones, in pure Dart.

example/dostr_relay_url_example.dart

import 'package:dostr_relay_url/dostr_relay_url.dart';

void main() {
  print(
    RelayUrl.tryParse('WSS://Relay.Primal.NET:443/'),
  ); // wss://relay.primal.net
  print(RelayUrl.tryParse('https://relay.primal.net')); // null
  print(
    ['wss://relay.ditto.pub/', 'not a url'].map(RelayUrl.tryParse).nonNulls,
  );
  print(RelayUrl.fromUserInput('relay.primal.net')); // wss://relay.primal.net
}
0
likes
160
points
24
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Normalization of Nostr relay urls, so two spellings of one relay compare equal, and a type for the normalized ones, in pure Dart.

Repository (GitHub)
View/report issues

Topics

#nostr #dostr #relay

License

MIT (license)

More

Packages that depend on dostr_relay_url