mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-03-28 18:51:53 +01:00
add kinds
This commit is contained in:
parent
27bd9bfc8c
commit
f08e4e9af7
80
kinds.go
80
kinds.go
@ -9,16 +9,45 @@ const (
|
|||||||
KindDeletion int = 5
|
KindDeletion int = 5
|
||||||
KindRepost int = 6
|
KindRepost int = 6
|
||||||
KindReaction int = 7
|
KindReaction int = 7
|
||||||
|
KindBadgeAward int = 8
|
||||||
KindSimpleGroupChatMessage int = 9
|
KindSimpleGroupChatMessage int = 9
|
||||||
|
KindSimpleGroupThreadedReply int = 10
|
||||||
KindSimpleGroupThread int = 11
|
KindSimpleGroupThread int = 11
|
||||||
KindSimpleGroupReply int = 12
|
KindSimpleGroupReply int = 12
|
||||||
|
KindSeal int = 13
|
||||||
|
KindDirectMessage int = 14
|
||||||
|
KindGenericRepost int = 16
|
||||||
|
KindReactionToWebsite int = 17
|
||||||
KindChannelCreation int = 40
|
KindChannelCreation int = 40
|
||||||
KindChannelMetadata int = 41
|
KindChannelMetadata int = 41
|
||||||
KindChannelMessage int = 42
|
KindChannelMessage int = 42
|
||||||
KindChannelHideMessage int = 43
|
KindChannelHideMessage int = 43
|
||||||
KindChannelMuteUser int = 44
|
KindChannelMuteUser int = 44
|
||||||
KindPatch int = 1617
|
KindChess int = 64
|
||||||
|
KindMergeRequests int = 818
|
||||||
|
KindBid int = 1021
|
||||||
|
KIndBidConfirmation int = 1022
|
||||||
|
KindOpenTimestamps int = 1040
|
||||||
|
KindGiftWrap int = 1059
|
||||||
KindFileMetadata int = 1063
|
KindFileMetadata int = 1063
|
||||||
|
KindLiveChatMessage int = 1311
|
||||||
|
KindPatch int = 1617
|
||||||
|
KindIssue int = 1621
|
||||||
|
KindReply int = 1622
|
||||||
|
KindStatusOpen int = 1630
|
||||||
|
KindStatusApplied int = 1631
|
||||||
|
KindStatusClosed int = 1632
|
||||||
|
KindStatusDraft int = 1633
|
||||||
|
KindProblemTracker int = 1971
|
||||||
|
KindReporting int = 1984
|
||||||
|
KindLabel int = 1985
|
||||||
|
KindRelayReviews int = 1986
|
||||||
|
KindAIEmbeddings int = 1987
|
||||||
|
KindTorrent int = 2003
|
||||||
|
KindTorrentComment int = 2004
|
||||||
|
KindCoinjoinPool int = 2022
|
||||||
|
KindCommunityPostApproval int = 4550
|
||||||
|
KindJobFeedback int = 7000
|
||||||
KindSimpleGroupAddUser int = 9000
|
KindSimpleGroupAddUser int = 9000
|
||||||
KindSimpleGroupRemoveUser int = 9001
|
KindSimpleGroupRemoveUser int = 9001
|
||||||
KindSimpleGroupEditMetadata int = 9002
|
KindSimpleGroupEditMetadata int = 9002
|
||||||
@ -30,27 +59,76 @@ const (
|
|||||||
KindSimpleGroupDeleteGroup int = 9008
|
KindSimpleGroupDeleteGroup int = 9008
|
||||||
KindSimpleGroupJoinRequest int = 9021
|
KindSimpleGroupJoinRequest int = 9021
|
||||||
KindSimpleGroupLeaveRequest int = 9022
|
KindSimpleGroupLeaveRequest int = 9022
|
||||||
|
KindZapGoal int = 9041
|
||||||
|
KindTidalLogin int = 9467
|
||||||
KindZapRequest int = 9734
|
KindZapRequest int = 9734
|
||||||
KindZap int = 9735
|
KindZap int = 9735
|
||||||
|
KindHighlights int = 9802
|
||||||
KindMuteList int = 10000
|
KindMuteList int = 10000
|
||||||
KindPinList int = 10001
|
KindPinList int = 10001
|
||||||
KindRelayListMetadata int = 10002
|
KindRelayListMetadata int = 10002
|
||||||
|
KindBookmarkList int = 10003
|
||||||
|
KindCommunityList int = 10004
|
||||||
|
KindPublicChatList int = 10005
|
||||||
|
KindBlockedRelayList int = 10006
|
||||||
|
KindSearchRelayList int = 10007
|
||||||
|
KindSimpleGroupList int = 10009
|
||||||
|
KindInterestList int = 10015
|
||||||
|
KindEmojiList int = 10030
|
||||||
|
KindDMRelayList int = 10050
|
||||||
|
KindUserServerList int = 10063
|
||||||
|
KindFileStorageServerList int = 10096
|
||||||
|
KindGoodWikiAuthorList int = 10101
|
||||||
|
KindGoodWikiRelayList int = 10102
|
||||||
KindNWCWalletInfo int = 13194
|
KindNWCWalletInfo int = 13194
|
||||||
|
KindLightningPubRPC int = 21000
|
||||||
KindClientAuthentication int = 22242
|
KindClientAuthentication int = 22242
|
||||||
KindNWCWalletRequest int = 23194
|
KindNWCWalletRequest int = 23194
|
||||||
KindNWCWalletResponse int = 23195
|
KindNWCWalletResponse int = 23195
|
||||||
KindNostrConnect int = 24133
|
KindNostrConnect int = 24133
|
||||||
|
KindBlobs int = 24242
|
||||||
|
KindHTTPAuth int = 27235
|
||||||
KindCategorizedPeopleList int = 30000
|
KindCategorizedPeopleList int = 30000
|
||||||
KindCategorizedBookmarksList int = 30001
|
KindCategorizedBookmarksList int = 30001
|
||||||
|
KindRelaySets int = 30002
|
||||||
|
KindBookmarkSets int = 30003
|
||||||
|
KindCuratedSets int = 30004
|
||||||
|
KindCuratedVideoSets int = 30005
|
||||||
|
KindMuteSets int = 30007
|
||||||
KindProfileBadges int = 30008
|
KindProfileBadges int = 30008
|
||||||
KindBadgeDefinition int = 30009
|
KindBadgeDefinition int = 30009
|
||||||
|
KindInterestSets int = 30015
|
||||||
KindStallDefinition int = 30017
|
KindStallDefinition int = 30017
|
||||||
KindProductDefinition int = 30018
|
KindProductDefinition int = 30018
|
||||||
|
KindMarketplaceUI int = 30019
|
||||||
|
KindProductSoldAsAuction int = 30020
|
||||||
KindArticle int = 30023
|
KindArticle int = 30023
|
||||||
|
KindDraftArticle int = 30024
|
||||||
|
KindEmojiSets int = 30030
|
||||||
|
KindModularArticleHeader int = 30040
|
||||||
|
KindModularArticleContent int = 30041
|
||||||
|
KindReleaseArtifactSets int = 30063
|
||||||
KindApplicationSpecificData int = 30078
|
KindApplicationSpecificData int = 30078
|
||||||
|
KindLiveEvent int = 30311
|
||||||
|
KindUserStatuses int = 30315
|
||||||
|
KindClassifiedListing int = 30402
|
||||||
|
KindDraftClassifiedListing int = 30403
|
||||||
KindRepositoryAnnouncement int = 30617
|
KindRepositoryAnnouncement int = 30617
|
||||||
KindRepositoryState int = 30618
|
KindRepositoryState int = 30618
|
||||||
KindSimpleGroupMetadata int = 39000
|
KindSimpleGroupMetadata int = 39000
|
||||||
|
KindWikiArticle int = 30818
|
||||||
|
KindRedirects int = 30819
|
||||||
|
KindFeed int = 31890
|
||||||
|
KindDateCalendarEvent int = 31922
|
||||||
|
KindTimeCalendarEvent int = 31923
|
||||||
|
KindCalendar int = 31924
|
||||||
|
KindCalendarEventRSVP int = 31925
|
||||||
|
KindHandlerRecommendation int = 31989
|
||||||
|
KindHandlerInformation int = 31990
|
||||||
|
KindVideoEvent int = 34235
|
||||||
|
KindShortVideoEvent int = 34236
|
||||||
|
KindVideoViewEvent int = 34237
|
||||||
|
KindCommunityDefinition int = 34550
|
||||||
KindSimpleGroupAdmins int = 39001
|
KindSimpleGroupAdmins int = 39001
|
||||||
KindSimpleGroupMembers int = 39002
|
KindSimpleGroupMembers int = 39002
|
||||||
)
|
)
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
func GetDMRelays(ctx context.Context, pubkey string, pool *nostr.SimplePool, relaysToQuery []string) []string {
|
func GetDMRelays(ctx context.Context, pubkey string, pool *nostr.SimplePool, relaysToQuery []string) []string {
|
||||||
ie := pool.QuerySingle(ctx, relaysToQuery, nostr.Filter{
|
ie := pool.QuerySingle(ctx, relaysToQuery, nostr.Filter{
|
||||||
Authors: []string{pubkey},
|
Authors: []string{pubkey},
|
||||||
Kinds: []int{10050},
|
Kinds: []int{nostr.KindDMRelayList},
|
||||||
})
|
})
|
||||||
if ie == nil {
|
if ie == nil {
|
||||||
return nil
|
return nil
|
||||||
@ -102,7 +102,7 @@ func PrepareMessage(
|
|||||||
}
|
}
|
||||||
|
|
||||||
rumor := nostr.Event{
|
rumor := nostr.Event{
|
||||||
Kind: 14,
|
Kind: nostr.KindDirectMessage,
|
||||||
Content: content,
|
Content: content,
|
||||||
Tags: append(tags, nostr.Tag{"p", recipientPubKey}),
|
Tags: append(tags, nostr.Tag{"p", recipientPubKey}),
|
||||||
CreatedAt: nostr.Now(),
|
CreatedAt: nostr.Now(),
|
||||||
@ -156,7 +156,7 @@ func ListenForMessages(
|
|||||||
|
|
||||||
for ie := range pool.SubMany(ctx, ourRelays, nostr.Filters{
|
for ie := range pool.SubMany(ctx, ourRelays, nostr.Filters{
|
||||||
{
|
{
|
||||||
Kinds: []int{1059},
|
Kinds: []int{nostr.KindGiftWrap},
|
||||||
Tags: nostr.TagMap{"p": []string{pk}},
|
Tags: nostr.TagMap{"p": []string{pk}},
|
||||||
Since: &since,
|
Since: &since,
|
||||||
},
|
},
|
||||||
|
@ -26,7 +26,7 @@ func GiftWrap(
|
|||||||
}
|
}
|
||||||
|
|
||||||
seal := nostr.Event{
|
seal := nostr.Event{
|
||||||
Kind: 13,
|
Kind: nostr.KindSeal,
|
||||||
Content: rumorCiphertext,
|
Content: rumorCiphertext,
|
||||||
CreatedAt: nostr.Now() - nostr.Timestamp(60*rand.Int63n(600) /* up to 6 hours in the past */),
|
CreatedAt: nostr.Now() - nostr.Timestamp(60*rand.Int63n(600) /* up to 6 hours in the past */),
|
||||||
Tags: make(nostr.Tags, 0),
|
Tags: make(nostr.Tags, 0),
|
||||||
@ -47,7 +47,7 @@ func GiftWrap(
|
|||||||
}
|
}
|
||||||
|
|
||||||
gw := nostr.Event{
|
gw := nostr.Event{
|
||||||
Kind: 1059,
|
Kind: nostr.KindGiftWrap,
|
||||||
Content: sealCiphertext,
|
Content: sealCiphertext,
|
||||||
CreatedAt: nostr.Now() - nostr.Timestamp(60*rand.Int63n(600) /* up to 6 hours in the past */),
|
CreatedAt: nostr.Now() - nostr.Timestamp(60*rand.Int63n(600) /* up to 6 hours in the past */),
|
||||||
Tags: nostr.Tags{
|
Tags: nostr.Tags{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user