diff --git a/apps/cowswap-frontend/.env b/apps/cowswap-frontend/.env index 2ea99eeddf..75848496b1 100644 --- a/apps/cowswap-frontend/.env +++ b/apps/cowswap-frontend/.env @@ -102,13 +102,6 @@ INTEGRATION_TESTS_INFURA_KEY= -####################################### -# Development -####################################### - -# Enables mock mode (default = false) -REACT_APP_MOCK=true - ####################################### diff --git a/apps/cowswap-frontend/.env.production b/apps/cowswap-frontend/.env.production index f6aaf29cee..8b13789179 100644 --- a/apps/cowswap-frontend/.env.production +++ b/apps/cowswap-frontend/.env.production @@ -1,6 +1 @@ -####################################### -# Development -####################################### -# Enables mock mode (default = false) -REACT_APP_MOCK=false diff --git a/apps/cowswap-frontend/src/api/cowProtocol/api.ts b/apps/cowswap-frontend/src/api/cowProtocol/api.ts index 90ff5493cf..b85d2395e4 100644 --- a/apps/cowswap-frontend/src/api/cowProtocol/api.ts +++ b/apps/cowswap-frontend/src/api/cowProtocol/api.ts @@ -36,7 +36,7 @@ import { getQuoteValidFor } from 'utils/orderUtils/getQuoteValidFor' import { ApiErrorCodes } from './errors/OperatorError' import QuoteApiError, { mapOperatorErrorToQuoteError, QuoteApiErrorDetails } from './errors/QuoteError' import { getIsOrderBookTypedError } from './getIsOrderBookTypedError' - +export { getIsOrderBookTypedError } from './getIsOrderBookTypedError' function getProfileUrl(): Partial> { if (isLocal || isDev || isPr || isBarn) { diff --git a/apps/cowswap-frontend/src/api/cowProtocol/index.ts b/apps/cowswap-frontend/src/api/cowProtocol/index.ts index 6f5cc47bff..3318fdbc97 100644 --- a/apps/cowswap-frontend/src/api/cowProtocol/index.ts +++ b/apps/cowswap-frontend/src/api/cowProtocol/index.ts @@ -1,21 +1 @@ -import * as realApi from './api' -import * as mockApi from './mock' - -export { getIsOrderBookTypedError } from './getIsOrderBookTypedError' - -const useMock = process.env.REACT_APP_MOCK === 'true' - -// Re-exporting the result, mocked or not. -// Unfortunately, did not find a way to export -// a mix of mock/real implementations -// without manually naming the exports -export const { - // functions that have a mock - getProfileData, - getQuote = realApi.getQuote, - getOrder = realApi.getOrder, - getNativePrice = realApi.getNativePrice, - getTrades = realApi.getTrades, - getOrders = realApi.getOrders, - // functions that only have a mock -} = useMock ? { ...mockApi } : { ...realApi } +export * from './api' diff --git a/apps/cowswap-frontend/src/api/cowProtocol/mock.ts b/apps/cowswap-frontend/src/api/cowProtocol/mock.ts deleted file mode 100644 index da882d5c60..0000000000 --- a/apps/cowswap-frontend/src/api/cowProtocol/mock.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ProfileData } from './api' - -export async function getProfileData(): Promise { - console.log('[utils:operatorMock] Get profile data') - return { - lastUpdated: new Date(2021, 9, 4, 7).toUTCString(), - referralVolumeUsd: 250_000, - totalReferrals: 45, - totalTrades: 542, - tradeVolumeUsd: 1_250_300, - } -} diff --git a/apps/widget-configurator/.env.production b/apps/widget-configurator/.env.production index f6aaf29cee..139597f9cb 100644 --- a/apps/widget-configurator/.env.production +++ b/apps/widget-configurator/.env.production @@ -1,6 +1,2 @@ -####################################### -# Development -####################################### -# Enables mock mode (default = false) -REACT_APP_MOCK=false +