@@ -5,11 +5,13 @@ import "package:http/http.dart" as http;
55import 'package:locus/constants/apis.dart' ;
66import 'package:locus/constants/values.dart' ;
77
8+ import '../widgets/RelaySelectSheet.dart' ;
9+
810final RELAY_FETCHER_FUNCTIONS = [
911 NostrWatchAPI .getPublicNostrRelays,
1012 NostrBandAPI .getTrendingProfiles,
1113 NostrWatchAPI .getAllNostrRelays,
12- () => Future .value (FALLBACK_RELAYS ),
14+ () => Future .value (FALLBACK_RELAYS ),
1315];
1416
1517// Tries each of the fallback relays until one works
@@ -73,40 +75,15 @@ class NostrBandAPI {
7375 List <dynamic >.from (jsonDecode (response.body)["profiles" ])
7476 .map ((e) => e["relays" ])
7577 .expand ((element) => element)
76- .toSet ());
78+ .toSet ()
79+ .map ((element) {
80+ final rawDomain = DOMAIN_REPLACE_REGEX .firstMatch (element);
81+
82+ if (rawDomain == null ) {
83+ return null ;
84+ }
85+
86+ return addProtocol (rawDomain.group (1 )! );
87+ }).where ((element) => element != null ));
7788 }
7889}
79-
80- // Top 30 most used free relays
81- const FALLBACK_RELAYS = [
82- "relay.damus.io" ,
83- "eden.nostr.land" ,
84- "nos.lol" ,
85- "relay.snort.social" ,
86- "relay.current.fyi" ,
87- "brb.io" ,
88- "nostr.orangepill.dev" ,
89- "nostr-pub.wellorder.net" ,
90- "nostr.bitcoiner.social" ,
91- "nostr.wine" ,
92- "nostr.oxtr.dev" ,
93- "relay.nostr.bg" ,
94- "nostr.mom" ,
95- "nostr.fmt.wiz.biz" ,
96- "relay.nostr.band" ,
97- "nostr-pub.semisol.dev" ,
98- "nostr.milou.lol" ,
99- "nostr.onsats.org" ,
100- "relay.nostr.info" ,
101- "puravida.nostr.land" ,
102- "offchain.pub" ,
103- "relay.orangepill.dev" ,
104- "no.str.cr" ,
105- "nostr.zebedee.cloud" ,
106- "atlas.nostr.land" ,
107- "nostr-relay.wlvs.space" ,
108- "relay.nostrati.com" ,
109- "relay.nostr.com.au" ,
110- "relay.inosta.cc" ,
111- "nostr.rocks" ,
112- ];
0 commit comments