Task: Implement Save Profile Integration Using User Management Hook
Description
Extend the existing onboarding flow to allow users to save their profile through the user_management smart contract. When the “Build Profile” button is pressed on the welcome page, the frontend should call the contract using the existing useUserManagement hook to persist user information on the Stellar testnet.
Prerequisites
- The
useUserManagement hook must already be implemented and functional with createUser, updateUser, and getUser methods.
- The wallet provider must supply the connected address and signer context.
- The
user_management contract binding should be available in src/contract_connections/user_management_binding.
Requirements
-
UI Update in Welcome Page
-
Contract Interaction
-
Import the useUserManagement hook.
-
Initialize the hook by passing required parameters (e.g., contractId, server, etc.).
-
Call:
await createUser(address, profileData);
-
After a successful transaction, redirect to /dashboard.
-
Error & UX Handling
- Show loading state while the transaction is pending.
- Catch and display any contract errors clearly.
- Disable the button during contract execution.
-
Testing
- Verify that a new user profile is created on testnet.
- Confirm redirection to
/dashboard after success.
- Validate error and loading feedback.
Deliverables
Acceptance Criteria
- Pressing “Build Profile” successfully triggers the contract call through the hook.
- The hook receives wallet and contract parameters externally (no context inside the hook).
- User profile creation works on Stellar testnet.
- UX provides proper feedback for success, errors, and loading state.
- Code follows clean and modular TypeScript standards.
Task: Implement Save Profile Integration Using User Management Hook
Description
Extend the existing onboarding flow to allow users to save their profile through the
user_managementsmart contract. When the “Build Profile” button is pressed on thewelcomepage, the frontend should call the contract using the existinguseUserManagementhook to persist user information on the Stellar testnet.Prerequisites
useUserManagementhook must already be implemented and functional withcreateUser,updateUser, andgetUsermethods.user_managementcontract binding should be available insrc/contract_connections/user_management_binding.Requirements
UI Update in Welcome Page
File:
src/app/welcome/page.tsxAdd or update the “Build Profile” button handler to:
createUserfunction from the hook.Contract Interaction
Import the
useUserManagementhook.Initialize the hook by passing required parameters (e.g.,
contractId,server, etc.).Call:
After a successful transaction, redirect to
/dashboard.Error & UX Handling
Testing
/dashboardafter success.Deliverables
src/app/welcome/page.tsxwith integratedcreateUserlogic./dashboardafter successful profile save.Acceptance Criteria