import completeExchangeSwap from "../swap/completeExchange";
import completeExchangeTransfer from "./transfer/completeExchange";
const completeExchange = (input) => {
    switch (input.exchangeType) {
        case 0 /* ExchangeTypes.Swap */:
            if (!input.exchange.toAccount) {
                throw new Error("'toAccount' requested for Swap exchange");
            }
            return completeExchangeSwap(input);
        case 1 /* ExchangeTypes.Sell */:
        case 2 /* ExchangeTypes.Fund */:
            return completeExchangeTransfer(input);
        default:
            throw new Error("exchangeType not handled");
    }
};
export default completeExchange;
//# sourceMappingURL=completeExchange.js.map