"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isDepositFormedCorrectly = void 0;
var ethers_1 = require("ethers");
var superstruct_1 = require("superstruct");
var utils_1 = require("../utils");
var AddressValidator = (0, superstruct_1.define)("AddressValidator", function (v) { return ethers_1.utils.isAddress(String(v)); });
var HexValidator = (0, superstruct_1.define)("HexValidator", function (v) { return ethers_1.utils.isHexString(String(v)); });
var BigNumberValidator = (0, superstruct_1.define)("BigNumberValidator", function (v) { return utils_1.BigNumber.isBigNumber(v); });
var V3DepositSchema = (0, superstruct_1.object)({
    depositId: BigNumberValidator,
    depositor: AddressValidator,
    recipient: AddressValidator,
    inputToken: AddressValidator,
    inputAmount: BigNumberValidator,
    originChainId: (0, superstruct_1.min)((0, superstruct_1.integer)(), 0),
    destinationChainId: (0, superstruct_1.min)((0, superstruct_1.integer)(), 0),
    quoteTimestamp: (0, superstruct_1.min)((0, superstruct_1.integer)(), 0),
    fillDeadline: (0, superstruct_1.min)((0, superstruct_1.integer)(), 0),
    exclusivityDeadline: (0, superstruct_1.min)((0, superstruct_1.integer)(), 0),
    exclusiveRelayer: AddressValidator,
    realizedLpFeePct: (0, superstruct_1.optional)(BigNumberValidator),
    outputToken: AddressValidator,
    outputAmount: BigNumberValidator,
    message: (0, superstruct_1.string)(),
    speedUpSignature: (0, superstruct_1.optional)(HexValidator),
    updatedOutputAmount: (0, superstruct_1.optional)(BigNumberValidator),
    updatedRecipient: (0, superstruct_1.optional)((0, superstruct_1.string)()),
    updatedMessage: (0, superstruct_1.optional)((0, superstruct_1.string)()),
    blockNumber: (0, superstruct_1.min)((0, superstruct_1.integer)(), 0),
    transactionIndex: (0, superstruct_1.min)((0, superstruct_1.integer)(), 0),
    logIndex: (0, superstruct_1.min)((0, superstruct_1.integer)(), 0),
    quoteBlockNumber: (0, superstruct_1.min)((0, superstruct_1.integer)(), 0),
    transactionHash: HexValidator,
    fromLiteChain: (0, superstruct_1.optional)((0, superstruct_1.boolean)()),
    toLiteChain: (0, superstruct_1.optional)((0, superstruct_1.boolean)()),
});
function isDepositFormedCorrectly(deposit) {
    return V3DepositSchema.is(deposit);
}
exports.isDepositFormedCorrectly = isDepositFormedCorrectly;
//# sourceMappingURL=ValidatorUtils.js.map