sdk

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

commit dd50171d8225615ca9368a2c2ff987344118fe9b
parent 8c402daa4c6d4dd34b0f634fc59280b7818613fa
Author: triesap <tyson@radroots.org>
Date:   Tue, 30 Jun 2026 20:02:15 +0000

sdk: canonicalize trade product surface

- remove duplicate status and inert validation product handles
- drop trade role root escape hatch methods
- update trade workflow status call sites to direct grouped status
- add compile coverage for the canonical grouped trade entrypoint

Diffstat:
Mcrates/sdk/src/lib.rs | 3+--
Mcrates/sdk/src/orders_runtime.rs | 12+-----------
Mcrates/sdk/src/product_clients.rs | 55-------------------------------------------------------
Mcrates/sdk/tests/orders_runtime.rs | 1-
Acrates/sdk/tests/trade_public_api.rs | 28++++++++++++++++++++++++++++
5 files changed, 30 insertions(+), 69 deletions(-)

diff --git a/crates/sdk/src/lib.rs b/crates/sdk/src/lib.rs @@ -126,8 +126,7 @@ pub use crate::privacy::{ #[cfg(feature = "runtime")] pub use crate::product_clients::{ DvmClient, FarmsClient, GeoNamesClient, ListingsClient, MarketClient, SyncClient, - TradeBuyerClient, TradeResyncClient, TradeSellerClient, TradeStatusClient, - TradeValidationClient, TradesClient, + TradeBuyerClient, TradeResyncClient, TradeSellerClient, TradesClient, }; #[cfg(feature = "runtime")] pub use crate::relay_targets::{ diff --git a/crates/sdk/src/orders_runtime.rs b/crates/sdk/src/orders_runtime.rs @@ -5,7 +5,7 @@ use crate::{ AckPolicy, PrivacyPreflightConfirmation, PrivacyPreflightReceipt, ProductSensitivityField, PublishMode, PushOutboxReceipt, PushOutboxRequest, RadrootsSdkError, RadrootsSdkRecoveryAction, RadrootsSdkTimestamp, RelayResolutionPolicy, SdkIdempotencyKey, SdkMutationState, - TradeBuyerClient, TradeResyncClient, TradeSellerClient, TradeStatusClient, TradesClient, order, + TradeBuyerClient, TradeResyncClient, TradeSellerClient, TradesClient, order, workflow_runtime::SdkWorkflowEnqueueRequest, }; #[cfg(all(feature = "runtime", test))] @@ -2530,16 +2530,6 @@ impl<'sdk> TradesClient<'sdk> { } #[cfg(feature = "runtime")] -impl<'sdk> TradeStatusClient<'sdk> { - pub async fn status( - &self, - request: TradeStatusRequest, - ) -> Result<TradeStatusReceipt, RadrootsSdkError> { - trades_client(self.sdk).status(request).await - } -} - -#[cfg(feature = "runtime")] impl<'sdk> TradeResyncClient<'sdk> { pub async fn resync( &self, diff --git a/crates/sdk/src/product_clients.rs b/crates/sdk/src/product_clients.rs @@ -73,14 +73,6 @@ impl<'client> TradesClient<'client> { TradeSellerClient { sdk: self.sdk } } - pub fn validation(&self) -> TradeValidationClient<'client> { - TradeValidationClient { sdk: self.sdk } - } - - pub fn status_client(&self) -> TradeStatusClient<'client> { - TradeStatusClient { sdk: self.sdk } - } - pub fn resync(&self) -> TradeResyncClient<'client> { TradeResyncClient { sdk: self.sdk } } @@ -93,65 +85,18 @@ pub struct TradeBuyerClient<'client> { } #[cfg(feature = "runtime")] -impl<'client> TradeBuyerClient<'client> { - pub fn root(&self) -> &'client RadrootsClient { - self.sdk - } -} - -#[cfg(feature = "runtime")] #[derive(Clone, Copy)] pub struct TradeSellerClient<'client> { pub(crate) sdk: &'client RadrootsClient, } #[cfg(feature = "runtime")] -impl<'client> TradeSellerClient<'client> { - pub fn root(&self) -> &'client RadrootsClient { - self.sdk - } -} - -#[cfg(feature = "runtime")] -#[derive(Clone, Copy)] -pub struct TradeValidationClient<'client> { - pub(crate) sdk: &'client RadrootsClient, -} - -#[cfg(feature = "runtime")] -impl<'client> TradeValidationClient<'client> { - pub fn root(&self) -> &'client RadrootsClient { - self.sdk - } -} - -#[cfg(feature = "runtime")] -#[derive(Clone, Copy)] -pub struct TradeStatusClient<'client> { - pub(crate) sdk: &'client RadrootsClient, -} - -#[cfg(feature = "runtime")] -impl<'client> TradeStatusClient<'client> { - pub fn root(&self) -> &'client RadrootsClient { - self.sdk - } -} - -#[cfg(feature = "runtime")] #[derive(Clone, Copy)] pub struct TradeResyncClient<'client> { pub(crate) sdk: &'client RadrootsClient, } #[cfg(feature = "runtime")] -impl<'client> TradeResyncClient<'client> { - pub fn root(&self) -> &'client RadrootsClient { - self.sdk - } -} - -#[cfg(feature = "runtime")] #[derive(Clone, Copy)] pub struct DvmClient<'client> { pub(crate) sdk: &'client RadrootsClient, diff --git a/crates/sdk/tests/orders_runtime.rs b/crates/sdk/tests/orders_runtime.rs @@ -949,7 +949,6 @@ async fn trade_product_clients_propose_inbox_accept_status_and_resync() { ); let status = seller_sdk .trades() - .status_client() .status(TradeStatusRequest::new(propose_receipt.locator.clone())) .await .expect("facade status"); diff --git a/crates/sdk/tests/trade_public_api.rs b/crates/sdk/tests/trade_public_api.rs @@ -0,0 +1,28 @@ +#![cfg(feature = "runtime")] + +use radroots_sdk::{RadrootsClient, TradeResyncRequest, TradeStatusKind, TradeStatusRequest}; + +#[tokio::test] +async fn grouped_trade_surface_is_the_public_product_entrypoint() { + let sdk = RadrootsClient::builder().build().await.expect("sdk"); + let trades = sdk.trades(); + + let _buyer = trades.buyer(); + let _seller = trades.seller(); + let _resync = trades.resync(); + + let status = trades + .status(TradeStatusRequest::parse("trade-public-api-order").expect("status request")) + .await + .expect("status"); + + assert_eq!(status.status, TradeStatusKind::Missing); + + let resync = trades + .resync() + .resync(TradeResyncRequest::new(status.locator)) + .await + .expect("resync"); + + assert_eq!(resync.status.status, TradeStatusKind::Missing); +}