"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isDepositFormedCorrectly = isDepositFormedCorrectly;
const ethers_1 = require("ethers");
const superstruct_1 = require("superstruct");
const utils_1 = require("../utils");
const AddressValidator = (0, superstruct_1.define)("AddressValidator", (v) => ethers_1.utils.isAddress(String(v)));
const HexValidator = (0, superstruct_1.define)("HexValidator", (v) => ethers_1.utils.isHexString(String(v)));
const BigNumberValidator = (0, superstruct_1.define)("BigNumberValidator", (v) => utils_1.BigNumber.isBigNumber(v));
const 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);
}
//# sourceMappingURL=ValidatorUtils.js.map