File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
bindings/nostr-ffi/src/nips Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ pub mod nip47;
17
17
pub mod nip48;
18
18
pub mod nip53;
19
19
pub mod nip57;
20
+ pub mod nip65;
20
21
pub mod nip90;
21
22
pub mod nip94;
22
23
pub mod nip98;
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2023-2024 Rust Nostr Developers
2
+ // Distributed under the MIT software license
3
+
4
+ use std:: { ops:: Deref , sync:: Arc } ;
5
+
6
+ use nostr:: nips:: nip65;
7
+
8
+ use crate :: { Event , RelayMetadata } ;
9
+
10
+ /// Extracts the relay info (url, optional read/write flag) from the event
11
+ pub fn extract_relay_list ( event : Arc < Event > ) -> Vec < ( String , Option < RelayMetadata > ) > {
12
+ nip65:: extract_relay_list ( event. deref ( ) )
13
+ . into_iter ( )
14
+ . map ( |( s, r) | ( s. to_string ( ) , r. map ( |r| r. into ( ) ) ) )
15
+ . collect ( )
16
+ }
You can’t perform that action at this time.
0 commit comments