From 0543dc4aa8ef6062faa690f983d5f7a162fd1cdf Mon Sep 17 00:00:00 2001 From: Shine Li Date: Fri, 21 Jun 2024 11:33:20 +1000 Subject: [PATCH] chore: make tsc happy on typechecking (#1930) --- packages/internal/bridge/sdk/package.json | 3 ++- packages/internal/bridge/sdk/src/tokenBridge.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/internal/bridge/sdk/package.json b/packages/internal/bridge/sdk/package.json index fad7a2cf07..a6f1fbd28c 100644 --- a/packages/internal/bridge/sdk/package.json +++ b/packages/internal/bridge/sdk/package.json @@ -47,7 +47,8 @@ "lint": "eslint ./src --ext .ts --max-warnings=0", "lint:fix": "cd ../../../../ && yarn wsrun -p @imtbl/bridge-sdk -c lint --fix", "test": "jest test -- --silent=false", - "test:watch": "jest --watch" + "test:watch": "jest --watch", + "typecheck": "tsc --noEmit" }, "source": "src/index.ts", "type": "module", diff --git a/packages/internal/bridge/sdk/src/tokenBridge.ts b/packages/internal/bridge/sdk/src/tokenBridge.ts index 513c94e52d..82a85f4253 100644 --- a/packages/internal/bridge/sdk/src/tokenBridge.ts +++ b/packages/internal/bridge/sdk/src/tokenBridge.ts @@ -210,7 +210,7 @@ export class TokenBridge { if (!isNativeTokenBridgeFeeRequest(req)) { if (isValidDeposit(direction, this.config.bridgeInstance)) { approvalFee = calculateGasFee(feeData, BridgeMethodsGasLimit.APPROVE_TOKEN); - } else if (isWithdrawWrappedIMX(req.token, direction, this.config.bridgeInstance)) { + } else if ('token' in req && isWithdrawWrappedIMX(req.token, direction, this.config.bridgeInstance)) { // On child chain, only WIMX requires approval. approvalFee = calculateGasFee(feeData, BridgeMethodsGasLimit.APPROVE_TOKEN); }