Add json converted to CompactProfile
This commit is contained in:
parent
5b4dc640bd
commit
916959e0e1
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user