"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fillFromDeposit = fillFromDeposit;
const interfaces_1 = require("../../src/interfaces");
const utils_1 = require("../../src/utils");
function fillFromDeposit(deposit, relayer) {
    const { blockNumber, txnRef, txnIndex, ...partialDeposit } = deposit;
    const { recipient, message } = partialDeposit;
    const updatedMessage = deposit.updatedMessage ?? message;
    const fill = {
        ...partialDeposit,
        relayer,
        message,
        exclusiveRelayer: relayer,
        repaymentChainId: deposit.destinationChainId,
        relayExecutionInfo: {
            updatedRecipient: deposit.updatedRecipient?.toBytes32() ?? recipient,
            updatedMessage,
            updatedMessageHash: (0, utils_1.getMessageHash)(updatedMessage),
            updatedOutputAmount: deposit.updatedOutputAmount ?? deposit.outputAmount,
            fillType: interfaces_1.FillType.FastFill,
        },
    };
    return fill;
}
//# sourceMappingURL=SpokePoolUtils.js.map