A generalized theory of international trade