Skip to content

Commit

Permalink
Merge pull request #845 from paraswap/feat/BACK-1776
Browse files Browse the repository at this point in the history
BACK-1776: Update to support node v20 & typescript v5
  • Loading branch information
JackieJoo authored Dec 11, 2024
2 parents c064602 + 8308373 commit e4536d5
Show file tree
Hide file tree
Showing 8 changed files with 195 additions and 182 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['16.x']
node: ['20.x']
name: Node ${{ matrix.node }} sample
steps:
- uses: actions/checkout@v2
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@paraswap/dex-lib",
"version": "3.11.11",
"version": "4.0.0",
"main": "build/index.js",
"types": "build/index.d.ts",
"repository": "https://github.com/paraswap/paraswap-dex-lib",
Expand All @@ -17,11 +17,11 @@
"@types/express": "^4.17.14",
"@types/jest": "26.0.24",
"@types/lodash": "4.14.178",
"@types/node": "^17.0.21",
"@types/node": "^20",
"@types/uuid": "^9.0.1",
"@types/websocket": "^1.0.10",
"@typescript-eslint/eslint-plugin": "^5.47.0",
"@typescript-eslint/parser": "^5.47.0",
"@typescript-eslint/eslint-plugin": "^8.17.0",
"@typescript-eslint/parser": "^8.17.0",
"change-case": "^4.1.2",
"dotenv": "16.0.0",
"eslint": "^8.30.0",
Expand All @@ -33,9 +33,9 @@
"jest": "^29.0.3",
"prettier": "^2.8.1",
"pretty-quick": "^3.1.3",
"ts-jest": "^29.0.3",
"ts-node": "^10.6.0",
"typescript": "4.6.4",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"typescript": "^5.7.2",
"yargs": "^17.0.1"
},
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions src/dex/algebra/lib/AlgebraMath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ interface PriceMovementCache {
}

const isPoolV1_9 = (
poolState: PoolStateV1_1 | PoolState_v1_9,
): poolState is PoolState_v1_9 =>
poolState: DeepReadonly<PoolStateV1_1> | DeepReadonly<PoolState_v1_9>,
): poolState is DeepReadonly<PoolState_v1_9> =>
'feeZto' in poolState.globalState && 'feeOtz' in poolState.globalState;

// % START OF COPY PASTA FROM UNISWAPV3 %
function _priceComputationCycles(
networkId: number,
poolState: DeepReadonly<PoolStateV1_1 | PoolState_v1_9>,
poolState: DeepReadonly<PoolStateV1_1> | DeepReadonly<PoolState_v1_9>,
ticksCopy: Record<NumberAsString, TickInfo>,
state: PriceComputationState,
cache: PriceComputationCache,
Expand Down
2 changes: 1 addition & 1 deletion src/dex/angle-transmuter/angle-transmuter-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class AngleTransmuterEventPool extends ComposedEventSubscriber<PoolState>
public transmuter: Contract;
public readonly angleTransmuterIface;
readonly config: PoolConfig;
timer: NodeJS.Timer;
timer: NodeJS.Timeout;

constructor(
readonly parentName: string,
Expand Down
2 changes: 1 addition & 1 deletion src/dex/balancer-v2/balancer-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ export class BalancerV2
// In memory pool state for non-event pools
nonEventPoolStateCache: PoolStateCache;

eventDisabledPoolsTimer?: NodeJS.Timer;
eventDisabledPoolsTimer?: NodeJS.Timeout;
eventDisabledPools: Address[] = [];

constructor(
Expand Down
2 changes: 1 addition & 1 deletion src/dex/synthetix/synthetix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class Synthetix extends SimpleExchange implements IDex<SynthetixData> {
synthetixState: SynthetixState;

// It is intermediate measure before we have event base Oracles
statePollingTimer?: NodeJS.Timer;
statePollingTimer?: NodeJS.Timeout;

public static dexKeysWithNetwork: { key: string; networks: Network[] }[] =
getDexKeysWithNetwork(SynthetixConfig);
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"lib": ["es2019"],
"lib": ["ESNext"],
"module": "commonjs",
"noImplicitAny": true,
"outDir": "build",
Expand All @@ -12,7 +12,7 @@
"sourceMap": true,
"declaration": true,
"skipLibCheck": true,
"target": "es2020",
"target": "ESNext",
"resolveJsonModule": true,
"allowJs": true,
"typeRoots": ["node_modules/@types"],
Expand Down
Loading

0 comments on commit e4536d5

Please sign in to comment.