@@ -9,7 +9,8 @@ use std::sync::Arc;
9
9
use std:: time:: Duration ;
10
10
11
11
use nostr_ffi:: {
12
- ClientMessage , Event , EventId , FileMetadata , Filter , Metadata , PublicKey , RelayMessage ,
12
+ ClientMessage , Event , EventBuilder , EventId , FileMetadata , Filter , Metadata , PublicKey ,
13
+ RelayMessage ,
13
14
} ;
14
15
use nostr_sdk:: client:: blocking:: Client as ClientSdk ;
15
16
use nostr_sdk:: relay:: RelayPoolNotification as RelayPoolNotificationSdk ;
@@ -174,14 +175,10 @@ impl Client {
174
175
Ok ( self . inner . send_msg ( msg. into ( ) ) ?)
175
176
}
176
177
177
- // TODO: add send_msg_with_custom_wait
178
-
179
178
pub fn send_msg_to ( & self , url : String , msg : ClientMessage ) -> Result < ( ) > {
180
179
Ok ( self . inner . send_msg_to ( url, msg. into ( ) ) ?)
181
180
}
182
181
183
- // TODO: add send_msg_to_with_custom_wait
184
-
185
182
pub fn send_event ( & self , event : Arc < Event > ) -> Result < Arc < EventId > > {
186
183
Ok ( Arc :: new (
187
184
self . inner
@@ -190,8 +187,6 @@ impl Client {
190
187
) )
191
188
}
192
189
193
- // TODO: add send_event_with_custom_wait
194
-
195
190
pub fn send_event_to ( & self , url : String , event : Arc < Event > ) -> Result < Arc < EventId > > {
196
191
Ok ( Arc :: new (
197
192
self . inner
@@ -200,7 +195,31 @@ impl Client {
200
195
) )
201
196
}
202
197
203
- // TODO: add send_event_to_with_custom_wait
198
+ /// Take an [`EventBuilder`], sign it by using the [`ClientSigner`] and broadcast to all relays.
199
+ ///
200
+ /// Rise an error if the [`ClientSigner`] is not set.
201
+ pub fn send_event_builder ( & self , builder : Arc < EventBuilder > ) -> Result < Arc < EventId > > {
202
+ Ok ( Arc :: new (
203
+ self . inner
204
+ . send_event_builder ( builder. as_ref ( ) . deref ( ) . clone ( ) ) ?
205
+ . into ( ) ,
206
+ ) )
207
+ }
208
+
209
+ /// Take an [`EventBuilder`], sign it by using the [`ClientSigner`] and broadcast to specific relays.
210
+ ///
211
+ /// Rise an error if the [`ClientSigner`] is not set.
212
+ pub fn send_event_builder_to (
213
+ & self ,
214
+ url : String ,
215
+ builder : Arc < EventBuilder > ,
216
+ ) -> Result < Arc < EventId > > {
217
+ Ok ( Arc :: new (
218
+ self . inner
219
+ . send_event_builder_to ( url, builder. as_ref ( ) . deref ( ) . clone ( ) ) ?
220
+ . into ( ) ,
221
+ ) )
222
+ }
204
223
205
224
pub fn set_metadata ( & self , metadata : Arc < Metadata > ) -> Result < Arc < EventId > > {
206
225
Ok ( Arc :: new (
0 commit comments