@@ -847,14 +847,31 @@ async function getTokenFromDexScreener(tokenAddress: string): Promise<CryptoCurr
847847 console . log ( '获取代币图标失败:' , error ) ;
848848 }
849849
850- // 调试输出
850+ // 详细调试输出
851851 console . log ( '🔍 DexScreener 代币信息调试:' , {
852852 tokenAddress,
853853 tokenInfo,
854854 symbol : tokenInfo . symbol ,
855+ symbolType : typeof tokenInfo . symbol ,
856+ symbolLength : tokenInfo . symbol ?. length ,
857+ symbolCharCodes : tokenInfo . symbol ? Array . from ( tokenInfo . symbol ) . map ( c => c . charCodeAt ( 0 ) ) : [ ] ,
855858 name : tokenInfo . name ,
856859 symbolUpperCase : tokenInfo . symbol ?. toUpperCase ( ) ,
857- bestPair : bestPair
860+ bestPair : {
861+ chainId : bestPair . chainId ,
862+ pairAddress : bestPair . pairAddress ,
863+ baseToken : bestPair . baseToken ,
864+ quoteToken : bestPair . quoteToken
865+ }
866+ } ) ;
867+
868+ // 检查是否是 baseToken 还是 quoteToken
869+ console . log ( '🔍 代币匹配检查:' , {
870+ inputAddress : tokenAddress . toLowerCase ( ) ,
871+ baseTokenAddress : bestPair . baseToken . address . toLowerCase ( ) ,
872+ quoteTokenAddress : bestPair . quoteToken . address . toLowerCase ( ) ,
873+ isBaseToken : bestPair . baseToken . address . toLowerCase ( ) === tokenAddress . toLowerCase ( ) ,
874+ isQuoteToken : bestPair . quoteToken . address . toLowerCase ( ) === tokenAddress . toLowerCase ( )
858875 } ) ;
859876
860877 const cryptoData : CryptoCurrency = {
0 commit comments