"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fillFromDeposit = fillFromDeposit;
var tslib_1 = require("tslib");
var interfaces_1 = require("../../src/interfaces");
var utils_1 = require("../../src/utils");
function fillFromDeposit(deposit, relayer) {
    var _a, _b, _c, _d;
    var blockNumber = deposit.blockNumber, txnRef = deposit.txnRef, txnIndex = deposit.txnIndex, partialDeposit = tslib_1.__rest(deposit, ["blockNumber", "txnRef", "txnIndex"]);
    var recipient = partialDeposit.recipient, message = partialDeposit.message;
    var updatedMessage = (_a = deposit.updatedMessage) !== null && _a !== void 0 ? _a : message;
    var fill = tslib_1.__assign(tslib_1.__assign({}, partialDeposit), { relayer: relayer, message: message, exclusiveRelayer: relayer, repaymentChainId: deposit.destinationChainId, relayExecutionInfo: {
            updatedRecipient: (_c = (_b = deposit.updatedRecipient) === null || _b === void 0 ? void 0 : _b.toBytes32()) !== null && _c !== void 0 ? _c : recipient,
            updatedMessage: updatedMessage,
            updatedMessageHash: (0, utils_1.getMessageHash)(updatedMessage),
            updatedOutputAmount: (_d = deposit.updatedOutputAmount) !== null && _d !== void 0 ? _d : deposit.outputAmount,
            fillType: interfaces_1.FillType.FastFill,
        } });
    return fill;
}
//# sourceMappingURL=SpokePoolUtils.js.map