This paper presents a unified framework for examining the general equilibrium effects of transactions costs and trading constraints on security market trades and prices. The model uses a discrete time/state framework and Kuhn- Tucker theory to characterize the optimal decisions of consumers and financial intermediaries. Transaction costs and constraints give rise to regions of no trade and to bid-ask spreads: their existence frustrate the derivation of standard results in arbitrage-based pricing. Nevertheless, we are able to obtain as dual characterisations of our primal problems, one-sided arbitrage pricing results and a personalised martingale representation of asset pricing. These pricing results are identical to those derived by Jouini and Kallal (1995) using arbitrage arguments. The paper's framework incorporates a number of specialised existing models and results, proves new results and discusses new directions for research. In particular, we include characterisations of intermediaries who hold optimal portfolios; brokers who do not hold portfolios, and consumer-specific transactions costs and trading constraints. Furthermore we show that in the special case of equiproportional transaction costs and a sufficient number of assets, there is an analogue of the arbitrage pricing result for European derivatives where prices are interpreted as mid-prices between the bid-ask spread. We discuss the effects of non-convex transaction technologies on prices and trades.