@@ -49,10 +49,12 @@ function getChainId(cluster: Cluster): ChainId | undefined {
4949function makeUtlClient ( cluster : Cluster , connectionString : string ) : Client | undefined {
5050 const chainId = getChainId ( cluster ) ;
5151 if ( ! chainId ) return undefined ;
52+
5253 const config : UtlConfig = new UtlConfig ( {
5354 chainId,
5455 connection : new Connection ( connectionString ) ,
5556 } ) ;
57+
5658 return new Client ( config ) ;
5759}
5860
@@ -72,7 +74,7 @@ export async function getTokenInfo(
7274 let token ;
7375 try {
7476 token = await client . fetchMint ( address ) ;
75- } catch ( error ) {
77+ } catch ( error ) {
7678 console . error ( error ) ;
7779 }
7880
@@ -116,14 +118,13 @@ async function getFullLegacyTokenInfoUsingCdn(
116118 const tokenListResponse = await fetch (
117119 'https://cdn.jsdelivr.net/gh/solana-labs/token-list@latest/src/tokens/solana.tokenlist.json'
118120 ) ;
119-
121+
120122 if ( tokenListResponse . status >= 400 ) {
121123 console . error ( new Error ( 'Error fetching token list from CDN' ) ) ;
122124 return undefined ;
123125 }
124126 const { tokens } = ( await tokenListResponse . json ( ) ) as FullLegacyTokenInfoList ;
125127 const tokenInfo = tokens . find ( t => t . address === address . toString ( ) && t . chainId === chainId ) ;
126-
127128 return tokenInfo ;
128129}
129130
@@ -139,7 +140,6 @@ export async function getFullTokenInfo(
139140 connectionString : string
140141) : Promise < FullTokenInfo | undefined > {
141142 const chainId = getChainId ( cluster ) ;
142-
143143 if ( ! chainId ) return undefined ;
144144
145145 const [ legacyCdnTokenInfo , sdkTokenInfo ] = await Promise . all ( [
0 commit comments