import { isEvmChain as c } from "../../utils/evm/isEvmChain.js";
import { EVM_CHAIN_BASE_TOKENS as d } from "../../constants/chains.js";
import { CHAINS_MAP as f } from "./types.js";
import { revertAlchemyChainsMap as m } from "./utils.js";
const l = (s, i) => {
  const n = {}, a = m(f);
  return i.forEach((r) => {
    let o;
    if (r.tokenAddress)
      o = s.find((e) => r.tokenAddress ? e.contractAddress?.toLowerCase() === r.tokenAddress.toLowerCase() : !1);
    else {
      const e = a[r.network];
      e && (o = s.find(
        (t) => t.contractAddress == null && t.blockchain.toLowerCase() === e.toLowerCase() && t.symbol.toLowerCase() === (c(e) ? d[e] ?? e : e).toLowerCase()
      ));
    }
    if (o) {
      const e = BigInt(r.tokenBalance).toString();
      e !== "0" && (n[o.assetId] = e);
    }
  }), n;
};
export {
  l as parse
};
//# sourceMappingURL=parse.js.map
