"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ofacGeoBlockApi = void 0;
const react_1 = require("@reduxjs/toolkit/query/react");
const live_env_1 = require("@ledgerhq/live-env");
exports.ofacGeoBlockApi = (0, react_1.createApi)({
    reducerPath: "ofacGeoBlockApi",
    baseQuery: (0, react_1.fetchBaseQuery)({
        baseUrl: (0, live_env_1.getEnv)("LEDGER_COUNTERVALUES_API"),
        validateStatus: response => [200, 451].includes(response.status), // Treat both 200 (not blocked) and 451 (blocked) as successful responses
    }),
    endpoints: build => ({
        check: build.query({
            query: () => ({
                url: "/v3/markets",
            }),
            transformResponse: (response, meta) => meta?.response?.status === 451,
        }),
    }),
});
//# sourceMappingURL=ofacGeoBlockApi.js.map