"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.transactionRateSchema = exports.getTransactionsQuerySchema = exports.transactionIdParamSchema = exports.updateTransactionSchema = exports.createTransactionSchema = exports.transactionDataSchema = void 0;
const zod_1 = require("zod");
const nativeTransferPathSchema = zod_1.z.object({
    from: zod_1.z.string().uuid(),
    to: zod_1.z.string().uuid(),
    value: zod_1.z.string(),
});
const tokenTransferPathSchema = zod_1.z.object({
    from: zod_1.z.string().uuid(),
    to: zod_1.z.string().uuid(),
    fromTokenValue: zod_1.z.string(),
    toTokenValue: zod_1.z.string(),
});
const contractTokenTransferPathSchema = zod_1.z.object({
    to: zod_1.z.string().min(1),
    amount: zod_1.z.string().min(1),
});
exports.transactionDataSchema = zod_1.z.array(zod_1.z.union([
    nativeTransferPathSchema,
    tokenTransferPathSchema,
    contractTokenTransferPathSchema,
]));
exports.createTransactionSchema = zod_1.z.object({
    hash: zod_1.z.string().min(1),
    status: zod_1.z.enum(['pending', 'confirmed', 'failed', 'dropped']),
    block: zod_1.z.number().int().nullable().optional(),
    networkId: zod_1.z.string().uuid(),
    timestamp: zod_1.z.coerce.date(),
    from: zod_1.z.string().min(1).nullable().optional(),
    to: zod_1.z.string().min(1).nullable().optional(),
    interactedWith: zod_1.z.string().uuid().nullable().optional(),
    value: zod_1.z.string(),
    fee: zod_1.z.string().nullable().optional(),
    gasPrice: zod_1.z.string().nullable().optional(),
    gasLimit: zod_1.z.number().int().nullable().optional(),
    method: zod_1.z.string().min(1),
    data: exports.transactionDataSchema.default([]),
});
exports.updateTransactionSchema = zod_1.z.object({
    status: zod_1.z.enum(['pending', 'confirmed', 'failed', 'dropped']).optional(),
    block: zod_1.z.number().int().nullable().optional(),
});
exports.transactionIdParamSchema = zod_1.z.object({
    id: zod_1.z.string().uuid(),
});
exports.getTransactionsQuerySchema = zod_1.z.object({
    walletId: zod_1.z.string().uuid().optional(),
    networkId: zod_1.z.string().uuid().optional(),
    tokenId: zod_1.z.string().uuid().optional(),
    status: zod_1.z.enum(['pending', 'confirmed', 'failed', 'dropped']).optional(),
    method: zod_1.z.string().optional(),
    limit: zod_1.z.coerce.number().int().positive().max(100).default(20),
    offset: zod_1.z.coerce.number().int().nonnegative().default(0),
});
exports.transactionRateSchema = zod_1.z.object({
    networkId: zod_1.z.string().uuid(),
    method: zod_1.z.string().min(1),
    value: zod_1.z.string().optional(),
    fee: zod_1.z.string().nullable().optional(),
    gasPrice: zod_1.z.string().nullable().optional(),
    gasLimit: zod_1.z.number().int().nullable().optional(),
    data: exports.transactionDataSchema.default([]).optional(),
    tokenIn: zod_1.z.string().min(1).optional(),
    tokenOut: zod_1.z.string().min(1).optional(),
    amountIn: zod_1.z.string().optional(),
    amountOut: zod_1.z.string().optional(),
});
//# sourceMappingURL=transaction.dto.js.map