"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Wallet = void 0;
class Wallet {
    id;
    name;
    syncType;
    syncedAt;
    encryptedPhrase;
    deviceIds;
    isAdmin;
    isActive;
    lastAccessedAt;
    version;
    createdAt;
    updatedAt;
    constructor(id, name, syncType, syncedAt, encryptedPhrase, deviceIds, isAdmin, isActive, lastAccessedAt, version, createdAt, updatedAt) {
        this.id = id;
        this.name = name;
        this.syncType = syncType;
        this.syncedAt = syncedAt;
        this.encryptedPhrase = encryptedPhrase;
        this.deviceIds = deviceIds;
        this.isAdmin = isAdmin;
        this.isActive = isActive;
        this.lastAccessedAt = lastAccessedAt;
        this.version = version;
        this.createdAt = createdAt;
        this.updatedAt = updatedAt;
    }
    static create(id, name, syncType, encryptedPhrase, deviceIds, isAdmin = false) {
        const now = new Date();
        return new Wallet(id, name, syncType, now, encryptedPhrase, deviceIds, isAdmin, true, now, 1, now, now);
    }
    withEncryptedPhrase(encryptedPhrase) {
        return new Wallet(this.id, this.name, this.syncType, this.syncedAt, encryptedPhrase, this.deviceIds, this.isAdmin, this.isActive, new Date(), this.version, this.createdAt, new Date());
    }
    touch() {
        return new Wallet(this.id, this.name, this.syncType, this.syncedAt, this.encryptedPhrase, this.deviceIds, this.isAdmin, this.isActive, new Date(), this.version, this.createdAt, new Date());
    }
    incrementVersion() {
        return new Wallet(this.id, this.name, this.syncType, this.syncedAt, this.encryptedPhrase, this.deviceIds, this.isAdmin, this.isActive, new Date(), this.version + 1, this.createdAt, new Date());
    }
}
exports.Wallet = Wallet;
//# sourceMappingURL=wallet.js.map