using NBitcoin.JsonConverters;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using ProtoBuf;

namespace NostrServices.Client;

[ProtoContract]
public class PubKeyStat
{
    [ProtoMember(1)]
    [JsonProperty("pubkey")]
    [JsonConverter(typeof(HexJsonConverter))]
    public byte[] PubKey { get; init; } = null!;

    [ProtoMember(2)]
    [JsonProperty("last_event")]
    [JsonConverter(typeof(UnixDateTimeConverter))]
    public DateTime? LastEvent { get; init; }

    [ProtoMember(3)]
    [JsonProperty("total_events")]
    public long TotalEvents { get; init; }
    
    [ProtoMember(4)]
    [JsonProperty("updated")]
    [JsonConverter(typeof(UnixDateTimeConverter))]
    public DateTime LastUpdate { get; init; }
}
