diff --git a/bindings/nostr-sdk-ffi/src/nostr_sdk.udl b/bindings/nostr-sdk-ffi/src/nostr_sdk.udl index b16827fd5..53f9d83a6 100644 --- a/bindings/nostr-sdk-ffi/src/nostr_sdk.udl +++ b/bindings/nostr-sdk-ffi/src/nostr_sdk.udl @@ -536,6 +536,9 @@ interface Tag { interface RelayConnectionStats { u64 attempts(); u64 success(); + u64 bytes_sent(); + u64 bytes_received(); + duration? latency(); u64 connected_at(); }; diff --git a/bindings/nostr-sdk-ffi/src/relay.rs b/bindings/nostr-sdk-ffi/src/relay.rs index ca0f0e926..c2fcbf9f2 100644 --- a/bindings/nostr-sdk-ffi/src/relay.rs +++ b/bindings/nostr-sdk-ffi/src/relay.rs @@ -33,6 +33,18 @@ impl RelayConnectionStats { pub fn connected_at(&self) -> u64 { self.inner.connected_at().as_u64() } + + pub fn bytes_sent(&self) -> u64 { + self.inner.bytes_sent() as u64 + } + + pub fn bytes_received(&self) -> u64 { + self.inner.bytes_received() as u64 + } + + pub fn latency(&self) -> Option { + self.inner.latency_blocking() + } } pub struct ActiveSubscription {