Skip to content

Conversation

@narimonf
Copy link
Contributor

@narimonf narimonf commented Dec 9, 2025

  • Sync v.2025.12.2
  • Handle the new optional request field generate_app_proofs by adding a with_app_proofs() method to client
  • Create wrapper ActivityResult so app proofs are returned

@narimonf narimonf force-pushed the nari/update_for_v.2025.12.1 branch from c12e17a to c9324b2 Compare December 9, 2025 18:27
@narimonf narimonf changed the title Update for v.2025.12.1 Update for v.2025.12.2 Dec 9, 2025
@narimonf narimonf force-pushed the nari/update_for_v.2025.12.1 branch 2 times, most recently from 2019de0 to 7fb964d Compare December 9, 2025 18:45
@narimonf narimonf marked this pull request as ready for review December 9, 2025 18:45
Copy link
Contributor

@r-n-o r-n-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider me impressed!

  • the builder arg for app proof generation is looking great: it's out of the way for most callers, and easy to use for interested parties
  • the wrapper struct is adding a bit of extra boilerplate (.result), but I think that'll be useful for more than just app proofs! Having the activity ID returned is nice for other reasons (e.g. get votes, or get full activity by ID to get the intent, that kind of thing)

Comment on lines +48 to +61
#[derive(Debug, Clone)]
pub struct ActivityResult<T> {
/// The typed result specific to this activity (e.g., `CreateWalletResult`, `SignTransactionResult`)
pub result: T,

/// The unique identifier for this activity
pub activity_id: String,

/// The status of the activity
pub status: ActivityStatus,

/// Proofs that can be used to verify the activity was performed in a secure Turnkey enclave.
pub app_proofs: Vec<AppProof>,
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dope! 🥇

Comment on lines +258 to +273
/// Enable app proof generation for all activity requests.
///
/// When enabled, the server will return app proofs with each response
/// that can be independently verified.
///
/// # Example
/// ```rust,ignore
/// let client = TurnkeyClient::builder()
/// .api_key(api_key)
/// .build()?
/// .with_app_proofs();
/// ```
pub fn with_app_proofs(mut self) -> Self {
self.generate_app_proofs = Some(true);
self
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful!

///
/// {description}
pub async fn {fn_name}(&self, organization_id: String, timestamp_ms: u128, params: immutable_activity::{activity_intent}) -> Result<immutable_activity::{activity_result}, TurnkeyClientError> {{
pub async fn {fn_name}(&self, organization_id: String, timestamp_ms: u128, params: immutable_activity::{activity_intent}) -> Result<ActivityResult<immutable_activity::{activity_result}>, TurnkeyClientError> {{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arguably this interface change is a breaking change. So maybe we should mark it as such in the changelog? Users of the SDK will have to update their code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're very right. Fixed

### Other

- Define activity result wrapper so that we return app proofs
- add with_app_proofs() method to client to toggle generate_app_proofs so that all calls don't have to be updated to populate the new optional field
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds like this should be in the ### Added section rather than "other"! Pretty big addition!

(and see my other comment, I think it's worth flagging the new return type: we go from typed results to a typed wrapper struct)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I misunderstood the changelog's structure haha I pattern-matched the entry right below. Fixed!

BREAKING CHANGE: consumers must now handle wrapped activity results
@narimonf narimonf force-pushed the nari/update_for_v.2025.12.1 branch from 7fb964d to 7d9ddc3 Compare December 10, 2025 15:26
Copy link
Contributor

@r-n-o r-n-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

@narimonf narimonf merged commit 35fd3ba into main Dec 11, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants