"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TransactionEntity = void 0;
const typeorm_1 = require("typeorm");
let TransactionEntity = class TransactionEntity {
    id;
    hash;
    status;
    block;
    networkId;
    timestamp;
    fromAddressId;
    toAddressId;
    interactedWith;
    value;
    fee;
    gasPrice;
    gasLimit;
    method;
    data;
    createdAt;
    updatedAt;
};
exports.TransactionEntity = TransactionEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], TransactionEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)(),
    __metadata("design:type", String)
], TransactionEntity.prototype, "hash", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'enum', enum: ['pending', 'confirmed', 'failed', 'dropped'] }),
    __metadata("design:type", String)
], TransactionEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'bigint',
        nullable: true,
        transformer: {
            from: (value) => value === null ? null : Number(value),
            to: (value) => value === null ? null : String(value),
        },
    }),
    __metadata("design:type", Object)
], TransactionEntity.prototype, "block", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'network_id' }),
    __metadata("design:type", String)
], TransactionEntity.prototype, "networkId", void 0);
__decorate([
    (0, typeorm_1.Column)(),
    __metadata("design:type", Date)
], TransactionEntity.prototype, "timestamp", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'from_address_id', type: 'varchar', length: 255, nullable: true }),
    __metadata("design:type", Object)
], TransactionEntity.prototype, "fromAddressId", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'to_address_id', type: 'varchar', length: 255, nullable: true }),
    __metadata("design:type", Object)
], TransactionEntity.prototype, "toAddressId", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'interacted_with', type: 'varchar', length: 255, nullable: true }),
    __metadata("design:type", Object)
], TransactionEntity.prototype, "interactedWith", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'decimal', precision: 65, scale: 0 }),
    __metadata("design:type", String)
], TransactionEntity.prototype, "value", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'decimal', precision: 65, scale: 0, nullable: true }),
    __metadata("design:type", Object)
], TransactionEntity.prototype, "fee", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'gas_price', type: 'decimal', precision: 65, scale: 0, nullable: true }),
    __metadata("design:type", Object)
], TransactionEntity.prototype, "gasPrice", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'gas_limit', type: 'int', nullable: true }),
    __metadata("design:type", Object)
], TransactionEntity.prototype, "gasLimit", void 0);
__decorate([
    (0, typeorm_1.Column)(),
    __metadata("design:type", String)
], TransactionEntity.prototype, "method", void 0);
__decorate([
    (0, typeorm_1.Column)('json'),
    __metadata("design:type", Array)
], TransactionEntity.prototype, "data", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
    __metadata("design:type", Date)
], TransactionEntity.prototype, "createdAt", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ name: 'updated_at' }),
    __metadata("design:type", Date)
], TransactionEntity.prototype, "updatedAt", void 0);
exports.TransactionEntity = TransactionEntity = __decorate([
    (0, typeorm_1.Entity)('transactions')
], TransactionEntity);
//# sourceMappingURL=transaction.entity.js.map