Problem
In api/src/services/stellar.service.ts, Keypair.fromSecret(userSecret) is called inside try-catch blocks, but the error message doesn't distinguish between invalid key format vs other errors.
Context
If a user provides an invalid secret key, the error message is generic. Users need to know specifically that their key format is wrong.
Proposed Solution
Catch the specific error from Keypair.fromSecret():
try {
const keypair = Keypair.fromSecret(userSecret);
} catch (error) {
if (error instanceof Error && error.message.includes('Invalid')) {
throw new ApiError(400, 'Invalid secret key format');
}
throw error;
}
Acceptance Criteria
Technical Notes
- File:
api/src/services/stellar.service.ts
Constraints
- Never include the key value in error responses or logs
Problem
In
api/src/services/stellar.service.ts,Keypair.fromSecret(userSecret)is called inside try-catch blocks, but the error message doesn't distinguish between invalid key format vs other errors.Context
If a user provides an invalid secret key, the error message is generic. Users need to know specifically that their key format is wrong.
Proposed Solution
Catch the specific error from
Keypair.fromSecret():Acceptance Criteria
Technical Notes
api/src/services/stellar.service.tsConstraints