"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const completeExchange_1 = __importDefault(require("../swap/completeExchange"));
const completeExchange_2 = __importDefault(require("./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 (0, completeExchange_1.default)(input);
        case 1 /* ExchangeTypes.Sell */:
        case 2 /* ExchangeTypes.Fund */:
            return (0, completeExchange_2.default)(input);
        default:
            throw new Error("exchangeType not handled");
    }
};
exports.default = completeExchange;
//# sourceMappingURL=completeExchange.js.map