"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExchangeError = exports.createAccounIdNotFound = exports.createWrongFundParams = exports.createWrongSellParams = exports.createWrongSwapParams = void 0;
function createWrongSwapParams(params) {
    return {
        code: "WRONG_SWAP_PARAMS",
        message: "swap params are not correctly set",
        data: {
            params,
        },
    };
}
exports.createWrongSwapParams = createWrongSwapParams;
function createWrongSellParams(params) {
    return {
        code: "WRONG_SELL_PARAMS",
        message: "sell params are not correctly set",
        data: {
            params,
        },
    };
}
exports.createWrongSellParams = createWrongSellParams;
function createWrongFundParams(params) {
    return {
        code: "WRONG_FUND_PARAMS",
        message: "fund params are not correctly set",
        data: {
            params,
        },
    };
}
exports.createWrongFundParams = createWrongFundParams;
function createAccounIdNotFound(accountId) {
    return {
        code: "ACCOUNT_ID_NOT_FOUND",
        message: "unable to find account id in current wallet",
        data: {
            accountId,
        },
    };
}
exports.createAccounIdNotFound = createAccounIdNotFound;
class ExchangeError {
    name = "ExchangeError";
    get message() {
        return this.context.message;
    }
    get cause() {
        return this.context.code;
    }
    context;
    constructor(context) {
        this.context = context;
    }
}
exports.ExchangeError = ExchangeError;
//# sourceMappingURL=error.js.map