field_lib

Cross-platform Rust runtime for Radroots iOS and Android apps
git clone https://radroots.dev/git/field_lib.git
Log | Files | Refs | README | LICENSE

commit 6779537ea0947f1759cd61abfb146c1f2a8d8d97
parent c998293000db6aa1c97bd83ed3259a1d3005246c
Author: triesap <tyson@radroots.org>
Date:   Fri, 19 Jun 2026 16:49:07 -0700

api: remove retired mobile trade endpoints

- delete retired validation request, order request, and message fetch exports.
- remove the generated-only trade order and listing message records.
- drop unsupported-shim tests for APIs that no longer exist.
- keep listing publish and fetch as the remaining mobile trade surface.

Diffstat:
Mcrates/field_core/src/runtime/trade_listing.rs | 70----------------------------------------------------------------------
Mcrates/field_core/tests/error_mapping.rs | 20--------------------
2 files changed, 0 insertions(+), 90 deletions(-)

diff --git a/crates/field_core/src/runtime/trade_listing.rs b/crates/field_core/src/runtime/trade_listing.rs @@ -78,36 +78,6 @@ pub struct TradeListingEventParts { pub tags_json: String, } -#[derive(uniffi::Record, Debug, Clone)] -pub struct TradeOrderDraft { - pub listing_addr: String, - pub seller_pubkey: String, - pub bin_id: String, - pub bin_count: String, - pub notes: Option<String>, - pub order_id: Option<String>, - pub recipient_pubkey: String, -} - -#[derive(uniffi::Record, Debug, Clone)] -pub struct TradeOrderSendResult { - pub event_id: String, - pub order_id: String, -} - -#[derive(uniffi::Record, Debug, Clone)] -pub struct TradeListingMessageSummary { - pub event_id: String, - pub author: String, - pub published_at: u64, - pub kind: u32, - pub message_type: String, - pub listing_addr: String, - pub order_id: Option<String>, - pub summary: String, - pub payload_json: String, -} - #[cfg_attr(not(coverage_nightly), uniffi::export)] impl RadrootsRuntime { pub fn trade_listing_build_event_parts( @@ -203,46 +173,6 @@ impl RadrootsRuntime { Err(RadrootsAppError::unsupported("nostr disabled")) } } - - pub fn trade_listing_send_validation_request( - &self, - listing_event_id: String, - seller_pubkey: String, - listing_id: String, - recipient_pubkey: String, - ) -> Result<String, RadrootsAppError> { - let _ = ( - listing_event_id, - seller_pubkey, - listing_id, - recipient_pubkey, - ); - Err(RadrootsAppError::unsupported( - "legacy listing validation requests are retired", - )) - } - - pub fn trade_listing_send_order_request( - &self, - draft: TradeOrderDraft, - ) -> Result<TradeOrderSendResult, RadrootsAppError> { - let _ = draft; - Err(RadrootsAppError::unsupported( - "legacy listing order requests are retired; use active trade order APIs", - )) - } - - pub fn trade_listing_fetch_messages( - &self, - listing_addr: String, - limit: u16, - since_unix: Option<u64>, - ) -> Result<Vec<TradeListingMessageSummary>, RadrootsAppError> { - let _ = (listing_addr, limit, since_unix); - Err(RadrootsAppError::unsupported( - "legacy listing message fetch is retired", - )) - } } fn listing_from_draft(draft: &TradeListingDraft) -> Result<RadrootsListing, RadrootsAppError> { diff --git a/crates/field_core/tests/error_mapping.rs b/crates/field_core/tests/error_mapping.rs @@ -70,23 +70,3 @@ fn post_stream_read_without_started_stream_returns_no_data() { assert!(event.is_none()); } - -#[test] -fn retired_trade_operations_map_to_unsupported_error() { - let runtime = RadrootsRuntime::new().expect("runtime"); - - let validation_err = runtime - .trade_listing_send_validation_request( - "event".to_string(), - "seller".to_string(), - "listing".to_string(), - "recipient".to_string(), - ) - .expect_err("retired validation request should fail"); - let messages_err = runtime - .trade_listing_fetch_messages("listing".to_string(), 10, None) - .expect_err("retired message fetch should fail"); - - assert!(matches!(validation_err, RadrootsAppError::Unsupported(_))); - assert!(matches!(messages_err, RadrootsAppError::Unsupported(_))); -}