-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feat/limit-ui-upgrade
- Loading branch information
Showing
52 changed files
with
410 additions
and
341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
{ | ||
"apps/cowswap-frontend": "1.95.3", | ||
"apps/explorer": "2.41.0", | ||
"libs/permit-utils": "0.5.0", | ||
"apps/cowswap-frontend": "1.96.1", | ||
"apps/explorer": "2.42.0", | ||
"libs/permit-utils": "0.6.0", | ||
"libs/widget-lib": "0.18.0", | ||
"libs/widget-react": "0.11.0", | ||
"apps/widget-configurator": "1.10.1", | ||
"apps/widget-configurator": "1.11.0", | ||
"libs/analytics": "1.9.0", | ||
"libs/assets": "1.12.0", | ||
"libs/common-const": "1.13.0", | ||
"libs/common-hooks": "1.6.0", | ||
"libs/common-hooks": "1.6.1", | ||
"libs/common-utils": "1.8.0", | ||
"libs/core": "1.6.0", | ||
"libs/ens": "1.3.0", | ||
"libs/events": "1.5.0", | ||
"libs/snackbars": "1.1.1", | ||
"libs/tokens": "1.13.1", | ||
"libs/tokens": "1.14.0", | ||
"libs/types": "1.5.0", | ||
"libs/ui": "1.17.1", | ||
"libs/wallet": "1.8.1", | ||
"libs/ui": "1.18.0", | ||
"libs/wallet": "1.9.0", | ||
"apps/cow-fi": "1.19.3", | ||
"libs/wallet-provider": "1.0.0", | ||
"libs/ui-utils": "1.1.0", | ||
"libs/abis": "1.2.1", | ||
"libs/balances-and-allowances": "1.2.0", | ||
"libs/iframe-transport": "1.0.0", | ||
"libs/hook-dapp-lib": "1.4.0", | ||
"libs/hook-dapp-lib": "1.5.0", | ||
"libs/multicall": "1.0.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1 @@ | ||
####################################### | ||
# Development | ||
####################################### | ||
|
||
# Enables mock mode (default = false) | ||
REACT_APP_MOCK=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { fetchWithCache } from '@cowprotocol/common-utils' | ||
import { NativePriceResponse, SupportedChainId as ChainId } from '@cowprotocol/cow-sdk' | ||
|
||
import ms from 'ms.macro' | ||
import QuickLRU from 'quick-lru' | ||
|
||
import * as api from './api' | ||
|
||
export * from './api' | ||
|
||
const nativePriceCache = new QuickLRU<string, Promise<NativePriceResponse>>({ | ||
maxSize: 1000, | ||
maxAge: ms`1m`, | ||
}) | ||
|
||
export async function getNativePrice(chainId: ChainId, currencyAddress: string): Promise<NativePriceResponse> { | ||
return fetchWithCache({ | ||
key: `${chainId}:${currencyAddress}`, | ||
fetch: () => api.getNativePrice(chainId, currencyAddress), | ||
cache: nativePriceCache, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 './apiCached' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.