From e43c52cecc468e9a08a894c1d9246dda175dfd2b Mon Sep 17 00:00:00 2001 From: Anxo Rodriguez Date: Thu, 22 Aug 2024 10:51:19 +0100 Subject: [PATCH] Add shared lib and handle native currency --- .../src/Erc20Repository/Erc20Repository.ts | 2 +- .../Erc20RepositoryCache.spec.ts | 2 +- .../Erc20Repository/Erc20RepositoryCache.ts | 2 +- .../Erc20RepositoryViem.spec.ts | 2 +- .../Erc20Repository/Erc20RepositoryViem.ts | 2 +- .../src/UsdRepository/UsdRepository.ts | 2 +- .../UsdRepository/UsdRepositoryCache.spec.ts | 2 +- .../src/UsdRepository/UsdRepositoryCache.ts | 2 +- .../UsdRepositoryCoingecko.test.ts | 2 +- .../UsdRepository/UsdRepositoryCoingecko.ts | 2 +- .../UsdRepository/UsdRepositoryCow.spec.ts | 2 +- .../src/UsdRepository/UsdRepositoryCow.ts | 2 +- .../UsdRepositoryFallback.spec.ts | 2 +- .../UsdRepository/UsdRepositoryFallback.ts | 2 +- libs/repositories/src/const.ts | 2 +- .../repositories/src/datasources/coingecko.ts | 2 +- libs/repositories/src/datasources/cowApi.ts | 2 +- libs/repositories/src/datasources/viem.ts | 2 +- libs/repositories/src/index.ts | 2 +- libs/repositories/tsconfig.lib.json | 2 +- .../src/SlippageService/SlippageService.ts | 2 ++ .../SlippageService/SlippageServiceMain.ts | 7 +++-- libs/shared/.eslintrc.json | 18 +++++++++++ libs/shared/README.md | 7 +++++ libs/shared/jest.config.ts | 11 +++++++ libs/shared/project.json | 30 +++++++++++++++++++ libs/shared/src/const.ts | 18 +++++++++++ libs/shared/src/index.ts | 3 ++ libs/{repositories => shared}/src/types.ts | 0 libs/shared/src/utils.ts | 19 ++++++++++++ libs/shared/tsconfig.json | 16 ++++++++++ libs/shared/tsconfig.lib.json | 11 +++++++ libs/shared/tsconfig.spec.json | 14 +++++++++ tsconfig.base.json | 3 +- 34 files changed, 176 insertions(+), 23 deletions(-) create mode 100644 libs/shared/.eslintrc.json create mode 100644 libs/shared/README.md create mode 100644 libs/shared/jest.config.ts create mode 100644 libs/shared/project.json create mode 100644 libs/shared/src/const.ts create mode 100644 libs/shared/src/index.ts rename libs/{repositories => shared}/src/types.ts (100%) create mode 100644 libs/shared/src/utils.ts create mode 100644 libs/shared/tsconfig.json create mode 100644 libs/shared/tsconfig.lib.json create mode 100644 libs/shared/tsconfig.spec.json diff --git a/libs/repositories/src/Erc20Repository/Erc20Repository.ts b/libs/repositories/src/Erc20Repository/Erc20Repository.ts index 9967bb2..63917e3 100644 --- a/libs/repositories/src/Erc20Repository/Erc20Repository.ts +++ b/libs/repositories/src/Erc20Repository/Erc20Repository.ts @@ -1,4 +1,4 @@ -import { SupportedChainId } from '../types'; +import { SupportedChainId } from '@cowprotocol/shared'; export const erc20RepositorySymbol = Symbol.for('Erc20Repository'); diff --git a/libs/repositories/src/Erc20Repository/Erc20RepositoryCache.spec.ts b/libs/repositories/src/Erc20Repository/Erc20RepositoryCache.spec.ts index e61401e..25fd277 100644 --- a/libs/repositories/src/Erc20Repository/Erc20RepositoryCache.spec.ts +++ b/libs/repositories/src/Erc20Repository/Erc20RepositoryCache.spec.ts @@ -1,7 +1,7 @@ import { Erc20RepositoryCache } from './Erc20RepositoryCache'; import { Erc20, Erc20Repository } from './Erc20Repository'; import { CacheRepository } from '../CacheRepository/CacheRepository'; -import { SupportedChainId } from '../types'; +import { SupportedChainId } from '@cowprotocol/shared'; describe('Erc20RepositoryCache', () => { let erc20RepositoryCache: Erc20RepositoryCache; diff --git a/libs/repositories/src/Erc20Repository/Erc20RepositoryCache.ts b/libs/repositories/src/Erc20Repository/Erc20RepositoryCache.ts index 597a91a..5f73ab3 100644 --- a/libs/repositories/src/Erc20Repository/Erc20RepositoryCache.ts +++ b/libs/repositories/src/Erc20Repository/Erc20RepositoryCache.ts @@ -2,7 +2,7 @@ import { inject, injectable } from 'inversify'; import NodeCache from 'node-cache'; import { Erc20, Erc20Repository } from './Erc20Repository'; import { CacheRepository } from '../CacheRepository/CacheRepository'; -import { SupportedChainId } from '../types'; +import { SupportedChainId } from '@cowprotocol/shared'; import { getCacheKey, PartialCacheKey } from '../utils/cache'; const NULL_VALUE = 'null'; diff --git a/libs/repositories/src/Erc20Repository/Erc20RepositoryViem.spec.ts b/libs/repositories/src/Erc20Repository/Erc20RepositoryViem.spec.ts index a2752f5..c59f06d 100644 --- a/libs/repositories/src/Erc20Repository/Erc20RepositoryViem.spec.ts +++ b/libs/repositories/src/Erc20Repository/Erc20RepositoryViem.spec.ts @@ -1,5 +1,5 @@ import { Erc20RepositoryViem } from './Erc20RepositoryViem'; -import { SupportedChainId } from '../types'; +import { SupportedChainId } from '@cowprotocol/shared'; import { PublicClient } from 'viem'; import { erc20Abi } from 'viem'; import { Erc20 } from './Erc20Repository'; diff --git a/libs/repositories/src/Erc20Repository/Erc20RepositoryViem.ts b/libs/repositories/src/Erc20Repository/Erc20RepositoryViem.ts index 2794270..f807e05 100644 --- a/libs/repositories/src/Erc20Repository/Erc20RepositoryViem.ts +++ b/libs/repositories/src/Erc20Repository/Erc20RepositoryViem.ts @@ -1,6 +1,6 @@ import { injectable } from 'inversify'; import { Erc20, Erc20Repository } from './Erc20Repository'; -import { SupportedChainId } from '../types'; +import { SupportedChainId } from '@cowprotocol/shared'; import { erc20Abi, getAddress, PublicClient } from 'viem'; @injectable() diff --git a/libs/repositories/src/UsdRepository/UsdRepository.ts b/libs/repositories/src/UsdRepository/UsdRepository.ts index b09b52e..eba226a 100644 --- a/libs/repositories/src/UsdRepository/UsdRepository.ts +++ b/libs/repositories/src/UsdRepository/UsdRepository.ts @@ -1,4 +1,4 @@ -import { SupportedChainId } from '../types'; +import { SupportedChainId } from '@cowprotocol/shared'; export const usdRepositorySymbol = Symbol.for('UsdRepository'); diff --git a/libs/repositories/src/UsdRepository/UsdRepositoryCache.spec.ts b/libs/repositories/src/UsdRepository/UsdRepositoryCache.spec.ts index 8f37697..dd5e94a 100644 --- a/libs/repositories/src/UsdRepository/UsdRepositoryCache.spec.ts +++ b/libs/repositories/src/UsdRepository/UsdRepositoryCache.spec.ts @@ -2,7 +2,7 @@ import { UsdRepositoryCache } from './UsdRepositoryCache'; import IORedis from 'ioredis'; import { UsdRepository } from './UsdRepository'; import { CacheRepositoryRedis } from '../CacheRepository/CacheRepositoryRedis'; -import { SupportedChainId } from '../types'; +import { SupportedChainId } from '@cowprotocol/shared'; import { WETH } from '../../test/mock'; import type { PricePoint } from './UsdRepository'; diff --git a/libs/repositories/src/UsdRepository/UsdRepositoryCache.ts b/libs/repositories/src/UsdRepository/UsdRepositoryCache.ts index 64e0da5..0a657f4 100644 --- a/libs/repositories/src/UsdRepository/UsdRepositoryCache.ts +++ b/libs/repositories/src/UsdRepository/UsdRepositoryCache.ts @@ -6,7 +6,7 @@ import { deserializePricePoints, serializePricePoints, } from './UsdRepository'; -import { SupportedChainId } from '../types'; +import { SupportedChainId } from '@cowprotocol/shared'; import ms from 'ms'; import { CacheRepository } from '../CacheRepository/CacheRepository'; import { getCacheKey, PartialCacheKey } from '../utils/cache'; diff --git a/libs/repositories/src/UsdRepository/UsdRepositoryCoingecko.test.ts b/libs/repositories/src/UsdRepository/UsdRepositoryCoingecko.test.ts index c1711c3..6d7841a 100644 --- a/libs/repositories/src/UsdRepository/UsdRepositoryCoingecko.test.ts +++ b/libs/repositories/src/UsdRepository/UsdRepositoryCoingecko.test.ts @@ -1,6 +1,6 @@ import { Container } from 'inversify'; import { UsdRepositoryCoingecko } from './UsdRepositoryCoingecko'; -import { SupportedChainId } from '../types'; +import { SupportedChainId } from '@cowprotocol/shared'; import { WETH, DEFINITELY_NOT_A_TOKEN } from '../../test/mock'; import ms from 'ms'; diff --git a/libs/repositories/src/UsdRepository/UsdRepositoryCoingecko.ts b/libs/repositories/src/UsdRepository/UsdRepositoryCoingecko.ts index ec96e6e..bc370c2 100644 --- a/libs/repositories/src/UsdRepository/UsdRepositoryCoingecko.ts +++ b/libs/repositories/src/UsdRepository/UsdRepositoryCoingecko.ts @@ -5,7 +5,7 @@ import { SimplePriceResponse, coingeckoProClient, } from '../datasources/coingecko'; -import { SupportedChainId } from '../types'; +import { SupportedChainId } from '@cowprotocol/shared'; import { throwIfUnsuccessful } from '../utils/throwIfUnsuccessful'; /** diff --git a/libs/repositories/src/UsdRepository/UsdRepositoryCow.spec.ts b/libs/repositories/src/UsdRepository/UsdRepositoryCow.spec.ts index 8ba6c61..ae90e7b 100644 --- a/libs/repositories/src/UsdRepository/UsdRepositoryCow.spec.ts +++ b/libs/repositories/src/UsdRepository/UsdRepositoryCow.spec.ts @@ -1,4 +1,4 @@ -import { SupportedChainId } from '../types'; +import { SupportedChainId } from '@cowprotocol/shared'; import { UsdRepositoryCow } from './UsdRepositoryCow'; import { diff --git a/libs/repositories/src/UsdRepository/UsdRepositoryCow.ts b/libs/repositories/src/UsdRepository/UsdRepositoryCow.ts index 482aa0b..4c06e64 100644 --- a/libs/repositories/src/UsdRepository/UsdRepositoryCow.ts +++ b/libs/repositories/src/UsdRepository/UsdRepositoryCow.ts @@ -1,7 +1,7 @@ import { injectable } from 'inversify'; import { UsdRepositoryNoop } from './UsdRepository'; import { OneBigNumber, TenBigNumber, USDC, ZeroBigNumber } from '../const'; -import { SupportedChainId } from '../types'; +import { SupportedChainId } from '@cowprotocol/shared'; import { BigNumber } from 'bignumber.js'; import { throwIfUnsuccessful } from '../utils/throwIfUnsuccessful'; import { Erc20Repository } from '../Erc20Repository/Erc20Repository'; diff --git a/libs/repositories/src/UsdRepository/UsdRepositoryFallback.spec.ts b/libs/repositories/src/UsdRepository/UsdRepositoryFallback.spec.ts index 7c9ad33..9684e4c 100644 --- a/libs/repositories/src/UsdRepository/UsdRepositoryFallback.spec.ts +++ b/libs/repositories/src/UsdRepository/UsdRepositoryFallback.spec.ts @@ -1,4 +1,4 @@ -import { SupportedChainId } from '../types'; +import { SupportedChainId } from '@cowprotocol/shared'; import { PricePoint, UsdRepository } from './UsdRepository'; import { UsdRepositoryFallback } from './UsdRepositoryFallback'; import { WETH } from '../../test/mock'; diff --git a/libs/repositories/src/UsdRepository/UsdRepositoryFallback.ts b/libs/repositories/src/UsdRepository/UsdRepositoryFallback.ts index 390ea26..4366175 100644 --- a/libs/repositories/src/UsdRepository/UsdRepositoryFallback.ts +++ b/libs/repositories/src/UsdRepository/UsdRepositoryFallback.ts @@ -1,6 +1,6 @@ import { injectable } from 'inversify'; import { PricePoint, PriceStrategy, UsdRepository } from './UsdRepository'; -import { SupportedChainId } from '../types'; +import { SupportedChainId } from '@cowprotocol/shared'; @injectable() export class UsdRepositoryFallback implements UsdRepository { diff --git a/libs/repositories/src/const.ts b/libs/repositories/src/const.ts index 9cb9888..c58ce56 100644 --- a/libs/repositories/src/const.ts +++ b/libs/repositories/src/const.ts @@ -1,5 +1,5 @@ import BigNumber from 'bignumber.js'; -import { SupportedChainId } from './types'; +import { SupportedChainId } from '../../shared/src/types'; interface TokenAddressAndDecimals { address: string; diff --git a/libs/repositories/src/datasources/coingecko.ts b/libs/repositories/src/datasources/coingecko.ts index 88a192d..329e455 100644 --- a/libs/repositories/src/datasources/coingecko.ts +++ b/libs/repositories/src/datasources/coingecko.ts @@ -1,4 +1,4 @@ -import { SupportedChainId } from '../types'; +import { SupportedChainId } from '@cowprotocol/shared'; import createClient from 'openapi-fetch'; diff --git a/libs/repositories/src/datasources/cowApi.ts b/libs/repositories/src/datasources/cowApi.ts index af07914..8f72eec 100644 --- a/libs/repositories/src/datasources/cowApi.ts +++ b/libs/repositories/src/datasources/cowApi.ts @@ -3,7 +3,7 @@ import createClient from 'openapi-fetch'; const COW_API_BASE_URL = process.env.COW_API_BASE_URL || 'https://api.cow.fi'; import type { paths } from '../gen/cow/cow-api-types'; -import { ALL_CHAIN_IDS, SupportedChainId } from '../types'; +import { ALL_CHAIN_IDS, SupportedChainId } from '@cowprotocol/shared'; export type CowApiClient = ReturnType>; diff --git a/libs/repositories/src/datasources/viem.ts b/libs/repositories/src/datasources/viem.ts index 08f8995..5e033d2 100644 --- a/libs/repositories/src/datasources/viem.ts +++ b/libs/repositories/src/datasources/viem.ts @@ -7,7 +7,7 @@ import { webSocket, } from 'viem'; import { arbitrum, gnosis, mainnet, sepolia } from 'viem/chains'; -import { ALL_CHAIN_IDS, SupportedChainId } from '../types'; +import { ALL_CHAIN_IDS, SupportedChainId } from '@cowprotocol/shared'; const NETWORKS: Record = { [SupportedChainId.MAINNET]: mainnet, diff --git a/libs/repositories/src/index.ts b/libs/repositories/src/index.ts index 2bd617b..15f3943 100644 --- a/libs/repositories/src/index.ts +++ b/libs/repositories/src/index.ts @@ -1,4 +1,4 @@ -export * from './types'; +export * from '../../shared/src/types'; // Utils export * from './utils/cache'; diff --git a/libs/repositories/tsconfig.lib.json b/libs/repositories/tsconfig.lib.json index 3f06e80..7091363 100644 --- a/libs/repositories/tsconfig.lib.json +++ b/libs/repositories/tsconfig.lib.json @@ -7,5 +7,5 @@ "types": ["node"] }, "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"], - "include": ["src/**/*.ts"] + "include": ["src/**/*.ts", "../shared/src/types.ts"] } diff --git a/libs/services/src/SlippageService/SlippageService.ts b/libs/services/src/SlippageService/SlippageService.ts index d99e973..65c3a37 100644 --- a/libs/services/src/SlippageService/SlippageService.ts +++ b/libs/services/src/SlippageService/SlippageService.ts @@ -1,4 +1,5 @@ import { PricePoint, SupportedChainId } from '@cowprotocol/repositories'; +import { Address } from 'viem'; /** * BPS (Basis Points) @@ -23,6 +24,7 @@ export interface OrderForSlippageCalculation { } export interface VolatilityDetails { + tokenAddress: string; usdPrice: number; prices: PricePoint[] | null; volatilityInUsd: number; diff --git a/libs/services/src/SlippageService/SlippageServiceMain.ts b/libs/services/src/SlippageService/SlippageServiceMain.ts index 53e02b8..da6ed32 100644 --- a/libs/services/src/SlippageService/SlippageServiceMain.ts +++ b/libs/services/src/SlippageService/SlippageServiceMain.ts @@ -12,6 +12,7 @@ import { VolatilityDetails, } from './SlippageService'; import ms from 'ms'; +import { toTokenAddress } from '@cowprotocol/shared'; export const MIN_SLIPPAGE_BPS = 50; export const MAX_SLIPPAGE_BPS = 200; @@ -56,15 +57,16 @@ export class SlippageServiceMain implements SlippageService { * Get the volatility of the asset in some time (enough for a solver to execute a solvable order) * * @param chainId - * @param tokenAddress + * @param tokenAddressString * * @returns volatility in decimal format */ async getVolatilityDetails( chainId: SupportedChainId, - tokenAddress: string, + tokenAddressString: string, order?: OrderForSlippageCalculation ): Promise { + const tokenAddress = toTokenAddress(tokenAddressString, chainId); const prices = await this.usdRepository.getUsdPrices( chainId, tokenAddress, @@ -122,6 +124,7 @@ export class SlippageServiceMain implements SlippageService { const normalizedVolatility = volatilityForFairSettlement / usdPrice; return { + tokenAddress, prices, usdPrice, volatilityInUsd: volatilityForFairSettlement, diff --git a/libs/shared/.eslintrc.json b/libs/shared/.eslintrc.json new file mode 100644 index 0000000..9d9c0db --- /dev/null +++ b/libs/shared/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/libs/shared/README.md b/libs/shared/README.md new file mode 100644 index 0000000..043b8fd --- /dev/null +++ b/libs/shared/README.md @@ -0,0 +1,7 @@ +# shared + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test shared` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/libs/shared/jest.config.ts b/libs/shared/jest.config.ts new file mode 100644 index 0000000..e0bf15c --- /dev/null +++ b/libs/shared/jest.config.ts @@ -0,0 +1,11 @@ +/* eslint-disable */ +export default { + displayName: 'shared', + preset: '../../jest.preset.js', + testEnvironment: 'node', + transform: { + '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../coverage/libs/shared', +}; diff --git a/libs/shared/project.json b/libs/shared/project.json new file mode 100644 index 0000000..a6ed9f1 --- /dev/null +++ b/libs/shared/project.json @@ -0,0 +1,30 @@ +{ + "name": "shared", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/shared/src", + "projectType": "library", + "targets": { + "lint": { + "executor": "@nx/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["libs/shared/**/*.ts"] + } + }, + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/shared/jest.config.ts", + "passWithNoTests": true + }, + "configurations": { + "ci": { + "ci": true, + "codeCoverage": true + } + } + } + }, + "tags": [] +} diff --git a/libs/shared/src/const.ts b/libs/shared/src/const.ts new file mode 100644 index 0000000..b78a4c0 --- /dev/null +++ b/libs/shared/src/const.ts @@ -0,0 +1,18 @@ +import { Address } from 'viem'; +import { SupportedChainId } from './types'; + +/** + * Native currency address. For example, represents Ether in Mainnet and Arbitrum, and xDAI in Gnosis chain. + */ +export const NativeCurrencyAddress = + '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'; + +/** + * Wrapped native token address. For example, represents WETH in Mainnet and Arbitrum, and wxDAI in Gnosis chain. + */ +export const WrappedNativeTokenAddress: Record = { + [SupportedChainId.MAINNET]: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', + [SupportedChainId.GNOSIS_CHAIN]: '0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d', + [SupportedChainId.ARBITRUM_ONE]: '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1', + [SupportedChainId.SEPOLIA]: '0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14', +}; diff --git a/libs/shared/src/index.ts b/libs/shared/src/index.ts new file mode 100644 index 0000000..7918be8 --- /dev/null +++ b/libs/shared/src/index.ts @@ -0,0 +1,3 @@ +export * from './types'; +export * from './const'; +export * from './utils'; diff --git a/libs/repositories/src/types.ts b/libs/shared/src/types.ts similarity index 100% rename from libs/repositories/src/types.ts rename to libs/shared/src/types.ts diff --git a/libs/shared/src/utils.ts b/libs/shared/src/utils.ts new file mode 100644 index 0000000..b4e78bc --- /dev/null +++ b/libs/shared/src/utils.ts @@ -0,0 +1,19 @@ +import { Address, getAddress } from 'viem'; +import { NativeCurrencyAddress, WrappedNativeTokenAddress } from './const'; +import { SupportedChainId } from './types'; + +/** + * Returns the token address. This function will throw if the address passed is not an Ethereum address. + * It will also convert the address representing the native currency (0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) into + * its wrapped version. + */ +export function toTokenAddress( + address: string, + chainId: SupportedChainId +): Address { + if (address.toLocaleLowerCase() === NativeCurrencyAddress) { + return WrappedNativeTokenAddress[chainId]; + } + + return getAddress(address.toLowerCase()); +} diff --git a/libs/shared/tsconfig.json b/libs/shared/tsconfig.json new file mode 100644 index 0000000..19b9eec --- /dev/null +++ b/libs/shared/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs" + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/shared/tsconfig.lib.json b/libs/shared/tsconfig.lib.json new file mode 100644 index 0000000..3f06e80 --- /dev/null +++ b/libs/shared/tsconfig.lib.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": ["node"] + }, + "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"], + "include": ["src/**/*.ts"] +} diff --git a/libs/shared/tsconfig.spec.json b/libs/shared/tsconfig.spec.json new file mode 100644 index 0000000..9b2a121 --- /dev/null +++ b/libs/shared/tsconfig.spec.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": [ + "jest.config.ts", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.d.ts" + ] +} diff --git a/tsconfig.base.json b/tsconfig.base.json index 1d8f577..0020d49 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -25,7 +25,8 @@ "@cowprotocol/cms-api": ["libs/cms-api/src/index.ts"], "@cowprotocol/notifications": ["libs/notifications/src/index.ts"], "@cowprotocol/repositories": ["libs/repositories/src/index.ts"], - "@cowprotocol/services": ["libs/services/src/index.ts"] + "@cowprotocol/services": ["libs/services/src/index.ts"], + "@cowprotocol/shared": ["libs/shared/src/index.ts"] } }, "exclude": ["node_modules", "tmp"]