dAppBooster
    Preparing search index...

    Function updateTokensBalances

    • Updates the tokens balances by extending the tokens with balance information and sorting them by balance.

      Parameters

      • tokens: {
            address: string;
            chainId: number;
            decimals: number;
            extensions?: Record<
                string,
                | string
                | number
                | bigint
                | boolean
                | Record<
                    string,
                    | string
                    | number
                    | bigint
                    | boolean
                    | Record<string, string | number | bigint | boolean | null | undefined>
                    | null
                    | undefined,
                >
                | null
                | undefined,
            >;
            logoURI?: string;
            name: string;
            symbol: string;
        }[]

        The array of tokens.

      • results: [TokenAmount[], TokensResponse]

        The results containing the balance tokens and prices.

      • __namedParameters: { sortByBalance?: boolean } = {}

      Returns {
          tokens: {
              address: string;
              chainId: number;
              decimals: number;
              extensions?: Record<
                  string,
                  | string
                  | number
                  | bigint
                  | boolean
                  | Record<
                      string,
                      | string
                      | number
                      | bigint
                      | boolean
                      | Record<string, string | number | bigint | boolean | null | undefined>
                      | null
                      | undefined,
                  >
                  | null
                  | undefined,
              >;
              logoURI?: string;
              name: string;
              symbol: string;
          }[];
          tokensByChainId: {
              [chainId: number]: {
                  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;
              }[];
          };
      }

      An object containing the updated tokens and tokens grouped by chain ID.