Add json converted to CompactProfile

This commit is contained in:
Kieran 2024-01-13 19:38:37 +00:00
parent 5b4dc640bd
commit 916959e0e1
No known key found for this signature in database
GPG Key ID: DE71CEB3925BE941

View File

@ -1,4 +1,6 @@
using NBitcoin;
using NBitcoin.JsonConverters;
using Newtonsoft.Json;
using Nostr.Client.Identifiers;
using Nostr.Client.Json;
using Nostr.Client.Messages;
@ -140,27 +142,36 @@ public class CompactEvent
public class CompactProfile
{
[ProtoMember(1)]
[JsonProperty("pubkey")]
[JsonConverter(typeof(HexJsonConverter))]
public byte[] PubKey { get; init; } = null!;
[ProtoMember(2)]
[JsonProperty("name")]
public string? Name { get; init; }
[ProtoMember(3)]
[JsonProperty("about")]
public string? About { get; init; }
[ProtoMember(4)]
[JsonProperty("picture")]
public string? Picture { get; init; }
[ProtoMember(5)]
[JsonProperty("nip05")]
public string? Nip05 { get; init; }
[ProtoMember(6)]
[JsonProperty("lud16")]
public string? Lud16 { get; init; }
[ProtoMember(7)]
[JsonProperty("banner")]
public string? Banner { get; init; }
[ProtoMember(8)]
[JsonProperty("created")]
public DateTime Created { get; init; }
public static CompactProfile? FromNostrEvent(NostrEvent ev)