updateUserProfile
Update the authenticated user's profile settings including strategy. Requires SIWE authentication.
Signature
updateUserProfile(params: UpdateUserProfileParams): Promise<UpdateUserProfileResponse>
Parameters
interface UpdateUserProfileParams {
strategy?: "conservative" | "aggressive";
}
Returns
Confirmation of the profile update
Return Type
interface UpdateUserProfileResponse {
success: boolean;
}
Example
await sdk.connectAccount(privateKey, chainId);
// Update strategy from conservative to aggressive
await sdk.updateUserProfile({
strategy: "aggressive",
});
// Fetch updated user details to confirm the change
const response = await sdk.getUserDetails();
console.log("Strategy updated:", response.user.strategy);
Notes
- When you deploy a Safe with deploySafe, the
strategyparameter sets the initial risk profile - You can change the strategy at any time after deployment
- After the strategy is updated:
- Subsequent rebalancing uses the new active strategy
- Data methods such as getUserDetails, getPositions, and getHistory return data for the current active strategy