Access the Market object via discount function extension

Hi,
i want to access the market object while calculating a discount,
i found that the docs says its deprecated from the input.localization object,
what alternative do i have?

the docs regarding the market object does not refer to any way of accessing it

Hello :waving_hand:,
This endpoint has been marked as deprecated because of the functionality of new markets.

With the new markets, a buyer can match several markets.

This endpoint will return the most precise region market to retain compatibility with legacy markets.

You can still use this endpoint. We are working on the shape of the data that will replace this, and will communicate as usual in the dev docs one the replacement is ready for public use.

An alternative way to work with it, if you’re also the storefront dev, is to pass the relevant info via cart attributes from the frontend.

The Input of Discount functions can retrieve this. Cart

With the new markets, a buyer can match several markets.

This endpoint will return the most precise region market to retain compatibility with legacy markets.

I have certain app functionalities that can be disabled in certain markets, this was being handled by market-level metafields. These markets are available at different domain extensions on our site. How can I ascertain whether or not the functionality should be available to a user, if I cannot get a definite market based on a url/locale or from the user themselves?