import { __assign, __rest } from "tslib";
import { FillType } from "../../src/interfaces";
import { getMessageHash } from "../../src/utils";
export function fillFromDeposit(deposit, relayer) {
    var _a, _b, _c, _d;
    var blockNumber = deposit.blockNumber, txnRef = deposit.txnRef, txnIndex = deposit.txnIndex, partialDeposit = __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 = __assign(__assign({}, partialDeposit), { relayer: relayer, message: message, 
        // Caller can modify these later.
        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: getMessageHash(updatedMessage),
            updatedOutputAmount: (_d = deposit.updatedOutputAmount) !== null && _d !== void 0 ? _d : deposit.outputAmount,
            fillType: FillType.FastFill,
        } });
    return fill;
}
//# sourceMappingURL=SpokePoolUtils.js.map