diff --git a/src/commands/KeysCommand.ts b/src/commands/KeysCommand.ts index 3ba5522..d330726 100644 --- a/src/commands/KeysCommand.ts +++ b/src/commands/KeysCommand.ts @@ -126,7 +126,7 @@ export class KeysCommand { ); const keychainFiles = files.filter((f) => f.endsWith(".keychain.json")); - const keypairData = await Promise.all( + const keypairResults = await Promise.allSettled( keypairFiles.map(async (file) => { const name = file.replace(".json", ""); const signer = await Signer.load(name); @@ -139,6 +139,17 @@ export class KeysCommand { }) ); + const keypairData = keypairResults + .map((result, index) => { + if (result.status === "fulfilled") { + return result.value; + } + const name = keypairFiles[index]?.replace(".json", "") ?? "unknown"; + console.warn(`Warning: Failed to load keypair "${name}": ${result.reason}`); + return null; + }) + .filter((item): item is NonNullable => item !== null); + const keychainData = keychainFiles.map((file) => { const name = file.replace(".keychain.json", ""); const config = KeychainConfig.load(name); diff --git a/src/commands/SpotCommand.ts b/src/commands/SpotCommand.ts index ab28856..34c0e65 100644 --- a/src/commands/SpotCommand.ts +++ b/src/commands/SpotCommand.ts @@ -400,6 +400,20 @@ export class SpotCommand { } const info = tokenMap.get(mint); if (!info) { + console.warn(`Warning: Token metadata not found for mint ${mint}. Displaying with limited info.`); + outputTokens.push({ + id: mint, + symbol: mint.slice(0, 8) + '...', + decimals: 0, + amount: Number(ata.amount), + rawAmount: ata.amount, + value: 0, + price: 0, + priceChange: 0, + isVerified: false, + scaledUiMultiplier: 1, + reclaimableLamports: ata.reclaimableLamports, + }); continue; } const multiplier = Swap.getScaledUiMultiplier(info);