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); }