commit 1b89ecc4e6ea92ff9f8f416b08db22502a7a5dde
parent 6653844ddc926c1ab2999bcb766837a60c5291e9
Author: triesap <tyson@radroots.org>
Date: Mon, 13 Jul 2026 05:58:38 +0000
sdk: rename signed event adapter surfaces
- rename SDK signing adapter aliases to SignedEvent
- update Nostr adapter publishing signatures
- use SignedEventWire for radrootsd proxy requests
- validate SDK check, tests, formatting, and diff hygiene
Diffstat:
3 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/crates/sdk/src/adapters/nostr.rs b/crates/sdk/src/adapters/nostr.rs
@@ -1,6 +1,6 @@
use core::time::Duration;
-use crate::adapters::signing::SignedNostrEvent;
+use crate::adapters::signing::SignedEvent;
use crate::identity::RadrootsIdentity;
use radroots_nostr::prelude::{
RadrootsNostrClient, RadrootsNostrClientOptions, RadrootsNostrError, RadrootsNostrEventId,
@@ -58,7 +58,7 @@ pub async fn connected_relay_urls(client: &RadrootsNostrClient) -> Vec<String> {
pub async fn publish_signed_event(
client: &RadrootsNostrClient,
- event: &SignedNostrEvent,
+ event: &SignedEvent,
) -> Result<RadrootsNostrOutput<RadrootsNostrEventId>, RadrootsNostrError> {
client.send_event(event).await
}
diff --git a/crates/sdk/src/adapters/radrootsd.rs b/crates/sdk/src/adapters/radrootsd.rs
@@ -3,9 +3,8 @@ use core::time::Duration;
use radroots_event::draft::RadrootsSignedEvent;
use radroots_transport_publish_protocol::{
- METHOD_EVENT, SignedNostrEventWire, TransportPublishDeliveryPolicy,
- TransportPublishEventRequest, TransportPublishEventResponse, TransportPublishProtocolError,
- TransportPublishTargetPolicy,
+ METHOD_EVENT, SignedEventWire, TransportPublishDeliveryPolicy, TransportPublishEventRequest,
+ TransportPublishEventResponse, TransportPublishProtocolError, TransportPublishTargetPolicy,
};
use reqwest::header::{AUTHORIZATION, CONTENT_TYPE, HeaderMap, HeaderValue};
use serde::{Deserialize, Serialize, de::DeserializeOwned};
@@ -299,8 +298,8 @@ where
decode_jsonrpc_response(method, request_id, body.as_str())
}
-fn signed_event_wire(event: &RadrootsSignedEvent) -> SignedNostrEventWire {
- SignedNostrEventWire {
+fn signed_event_wire(event: &RadrootsSignedEvent) -> SignedEventWire {
+ SignedEventWire {
id: event.id.clone(),
pubkey: event.pubkey.clone(),
created_at: event.created_at as u64,
diff --git a/crates/sdk/src/adapters/signing.rs b/crates/sdk/src/adapters/signing.rs
@@ -2,7 +2,7 @@ use crate::identity::RadrootsIdentity;
use radroots_event_codec::wire::WireEventParts;
use radroots_nostr::prelude::{RadrootsNostrError, radroots_nostr_build_event};
-pub type SignedNostrEvent = radroots_nostr::prelude::RadrootsNostrEvent;
+pub type SignedEvent = radroots_nostr::prelude::RadrootsNostrEvent;
pub type NostrEventBuilder = radroots_nostr::prelude::RadrootsNostrEventBuilder;
pub type SigningError = RadrootsNostrError;
@@ -13,7 +13,7 @@ pub fn event_builder_from_parts(parts: WireEventParts) -> Result<NostrEventBuild
pub fn sign_parts_with_identity(
identity: &RadrootsIdentity,
parts: WireEventParts,
-) -> Result<SignedNostrEvent, SigningError> {
+) -> Result<SignedEvent, SigningError> {
let builder = event_builder_from_parts(parts)?;
sign_builder_with_identity(identity, builder)
}
@@ -21,7 +21,7 @@ pub fn sign_parts_with_identity(
pub fn sign_builder_with_identity(
identity: &RadrootsIdentity,
builder: NostrEventBuilder,
-) -> Result<SignedNostrEvent, SigningError> {
+) -> Result<SignedEvent, SigningError> {
builder.sign_with_keys(identity.keys()).map_err(Into::into)
}