"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const Amount_1 = __importDefault(require("./Amount"));
class Outcome {
    constructor(message, local, remote) {
        this.message = message;
        this.local = local;
        this.remote = remote;
    }
    toJSON() {
        return Object.assign({}, this, {
            message: this.message,
            local: this.local.toJSON(),
            remote: this.remote.toJSON(),
        });
    }
    static fromJSON(json) {
        const outcome = Object.create(Outcome.prototype);
        return Object.assign(outcome, json, {
            message: json.message,
            local: Amount_1.default.fromJSON(json.local),
            remote: Amount_1.default.fromJSON(json.remote),
        });
    }
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    static reviver(key, value) {
        return key === '' ? Outcome.fromJSON(value) : value;
    }
}
exports.default = Outcome;
//# sourceMappingURL=Outcome.js.map