(uri: string)
| 204 | } |
| 205 | |
| 206 | async function fetchTokenlist(uri: string): Promise<Tokenlist> { |
| 207 | const response = await fetch(uri) |
| 208 | if (!response.ok) |
| 209 | throw new Error( |
| 210 | `Failed to fetch ${uri}: ${response.status} ${response.statusText}`, |
| 211 | ) |
| 212 | |
| 213 | const tokenlist = (await response.json()) as unknown |
| 214 | assertTokenlist(tokenlist, uri) |
| 215 | return tokenlist |
| 216 | } |
| 217 | |
| 218 | async function getChainTargetById(chainIds: Set<number>) { |
| 219 | const chainExports = getChainExports() |
no test coverage detected