dAppBooster
    Preparing search index...

    Function fetchTokenList

    • Fetches a token list from a URL. Returns an empty token list on failure instead of throwing, so one broken source doesn't block the entire app.

      Parameters

      • url: string

        a link to a list of tokens or 'default' to use the bundled list

      Returns Promise<
          {
              keywords?: string[];
              logoURI?: string;
              name: string;
              tags?: Record<string, { description: string; name: string }>;
              timestamp: string;
              tokens: {
                  address: string;
                  chainId: number;
                  decimals: number;
                  extensions?: Record<
                      string,
                      | string
                      | number
                      | bigint
                      | boolean
                      | Record<
                          string,
                          | string
                          | number
                          | bigint
                          | boolean
                          | Record<string, (...) | (...) | (...) | (...) | (...) | (...) | (...)>
                          | null
                          | undefined,
                      >
                      | null
                      | undefined,
                  >;
                  logoURI?: string;
                  name: string;
                  symbol: string;
              }[];
              version: { major: number; minor: number; patch: number };
          },
      >

      a token list (empty on failure)