When displaying a wallet's portfolio, the command fetches token metadata from the Datapi client. If any mint's metadata is not found (e.g., API failure, new token not indexed), the code silently skips that token via continue, masking the API issue. This can lead to incomplete or misleading portfolio displays without user awareness.
Expected behavior:
- Log a warning when token metadata is missing
- Still display the token with available information (mint address, on-chain balance)
- Or throw a clear error if critical metadata is unavailable
Current behavior:
- Silently skips tokens with missing metadata
- User has no indication that their portfolio is incomplete
Location: src/commands/SpotCommand.ts:401-404
Suggested fix:
for (const [mint, ata] of ataByMint) {
if (mint === Asset.SOL.id) {
continue;
}
const info = tokenMap.get(mint);
if (!info) {
console.warn(
Warning: Could not fetch metadata for token ${mint}. Skipping.
);
continue;
}
// ... rest of logic
}
Type: Bug - Error Handling
When displaying a wallet's portfolio, the command fetches token metadata from the Datapi client. If any mint's metadata is not found (e.g., API failure, new token not indexed), the code silently skips that token via continue, masking the API issue. This can lead to incomplete or misleading portfolio displays without user awareness.
Expected behavior:
Current behavior:
Location: src/commands/SpotCommand.ts:401-404
Suggested fix:
for (const [mint, ata] of ataByMint) {
if (mint === Asset.SOL.id) {
continue;
}
const info = tokenMap.get(mint);
if (!info) {
console.warn(
Warning: Could not fetch metadata for token ${mint}. Skipping.);
continue;
}
// ... rest of logic
}
Type: Bug - Error Handling