File tree Expand file tree Collapse file tree 1 file changed +1
-40
lines changed Expand file tree Collapse file tree 1 file changed +1
-40
lines changed Original file line number Diff line number Diff line change 11# Nostr SDK – Swift Package
22
3- ## Installation
4-
5- This package is intended to be used with the [ Swift Package Manager] ( https://www.swift.org/package-manager/ ) .
6-
7- ### Xcode
8-
9- Via ` File > Add Packages... ` , add
10-
11- ```
12- https://github.com/rust-nostr/nostr-sdk-swift.git
13- ```
14-
15- as a package dependency in Xcode.
16-
17- ### Swift Package
18-
19- Add the following to the dependencies array in your ` Package.swift ` :
20-
21- ``` swift
22- .package (url : " https://github.com/rust-nostr/nostr-sdk-swift.git" , from : " 0.7.1" ),
23- ```
24-
253## 📄 Usage
264
27- ``` swift
28- import NostrSDK
29-
30- let keys = Keys.generate ();
31- let client = Client (keys : keys);
32-
33- try client.addRelay (url : " wss://relay.damus.io" );
34- client.connect ();
35-
36- let filter = Filter ()
37- .pubkey (pubkey : keys.publicKey ())
38- .since (timestamp : Timestamp.now ());
39- let events = try client.getEventsOf (filters : [filter], timeout : nil );
40- // handle events
41-
42- let event = try EventBuilder.newTextNote (content : " Hello from Rust Nostr SDK Swift bindings" , tags : []).toEvent (keys : keys);
43- client.sendEvent (event : event);
44- ```
5+ Check https://rust-nostr.org
456
467## Information for Maintainers and Contributors
478
You can’t perform that action at this time.
0 commit comments