"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Transaction = void 0;
class Transaction {
    id;
    hash;
    status;
    block;
    networkId;
    timestamp;
    from;
    to;
    interactedWith;
    value;
    fee;
    gasPrice;
    gasLimit;
    method;
    data;
    createdAt;
    updatedAt;
    fromAddress;
    toAddress;
    constructor(id, hash, status, block, networkId, timestamp, from, to, interactedWith, value, fee, gasPrice, gasLimit, method, data, createdAt, updatedAt, fromAddress = null, toAddress = null) {
        this.id = id;
        this.hash = hash;
        this.status = status;
        this.block = block;
        this.networkId = networkId;
        this.timestamp = timestamp;
        this.from = from;
        this.to = to;
        this.interactedWith = interactedWith;
        this.value = value;
        this.fee = fee;
        this.gasPrice = gasPrice;
        this.gasLimit = gasLimit;
        this.method = method;
        this.data = data;
        this.createdAt = createdAt;
        this.updatedAt = updatedAt;
        this.fromAddress = fromAddress;
        this.toAddress = toAddress;
    }
    static create(id, hash, status, block, networkId, timestamp, from, to, interactedWith, value, fee, gasPrice, gasLimit, method, data) {
        const now = new Date();
        return new Transaction(id, hash, status, block, networkId, timestamp, from, to, interactedWith, value, fee, gasPrice, gasLimit, method, data, now, now);
    }
    updateStatus(status, block) {
        return new Transaction(this.id, this.hash, status, block ?? this.block, this.networkId, this.timestamp, this.from, this.to, this.interactedWith, this.value, this.fee, this.gasPrice, this.gasLimit, this.method, this.data, this.createdAt, new Date());
    }
}
exports.Transaction = Transaction;
//# sourceMappingURL=transaction.js.map