sdk

Radroots SDK and bindings
git clone https://radroots.dev/git/sdk.git
Log | Files | Refs | README

commit 17273d9cdaaa567fc988dfccb7cc5b1c6d6348c9
parent 418a3ca6860407f0bc38366e27d0c269202fbb65
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:
Mcrates/sdk/src/adapters/nostr.rs | 4++--
Mcrates/sdk/src/adapters/radrootsd.rs | 9++++-----
Mcrates/sdk/src/adapters/signing.rs | 6+++---
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) }