From de87aa53613157f265da3cd7ae093bd0c1b55b7d Mon Sep 17 00:00:00 2001 From: cyrus Date: Tue, 16 Jun 2026 15:19:55 +0530 Subject: [PATCH] fix(sdk/rust): correct user.profile canonical payload to compile and match TS `users.rs` built the signed `user.profile` canonical payload from fields that no longer exist on `UserProfileUpdate` (`avatar`, `links`), failing to compile (E0609). It also diverged from the TypeScript source of truth: the wrong key names and a missing `harnessKey` key would have produced invalid signatures. Align the payload with `sdk/typescript/src/api/users.ts` (`userProfileSignaturePayload`): keys `avatarEmail`, `link` (singular), and the previously-missing `harnessKey`, mapping the matching struct fields (`avatar_email`, `link`, `harness_key`). Fixes #30 Co-Authored-By: Claude Opus 4.8 (1M context) --- sdk/rust/src/api/users.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sdk/rust/src/api/users.rs b/sdk/rust/src/api/users.rs index 78c4106a..073b4e56 100644 --- a/sdk/rust/src/api/users.rs +++ b/sdk/rust/src/api/users.rs @@ -73,11 +73,12 @@ fn user_profile_signature_payload(crypto_id: &str, update: &UserProfileUpdate) - "user.profile", serde_json::json!({ "actorType": or_null(&update.actor_type), - "avatar": or_null(&update.avatar), + "avatarEmail": or_null(&update.avatar_email), "bio": or_null(&update.bio), "cryptoId": crypto_id, "displayName": or_null(&update.display_name), - "links": arr_or_null(&update.links), + "harnessKey": or_null(&update.harness_key), + "link": or_null(&update.link), "tags": arr_or_null(&update.tags), }), )