nostr-tools 2.23.7 → 2.23.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/abstract-pool.js +128 -4
- package/lib/cjs/abstract-pool.js.map +4 -4
- package/lib/cjs/abstract-relay.js +29 -4
- package/lib/cjs/abstract-relay.js.map +2 -2
- package/lib/cjs/filter.js.map +1 -1
- package/lib/cjs/index.js +393 -70
- package/lib/cjs/index.js.map +4 -4
- package/lib/cjs/kinds.js +196 -4
- package/lib/cjs/kinds.js.map +2 -2
- package/lib/cjs/nip10.js +5 -4
- package/lib/cjs/nip10.js.map +2 -2
- package/lib/cjs/nip17.js.map +2 -2
- package/lib/cjs/nip18.js.map +2 -2
- package/lib/cjs/nip22.js +11 -5
- package/lib/cjs/nip22.js.map +2 -2
- package/lib/cjs/nip25.js.map +1 -1
- package/lib/cjs/nip28.js.map +2 -2
- package/lib/cjs/nip42.js.map +2 -2
- package/lib/cjs/nip45.js +183 -0
- package/lib/cjs/nip45.js.map +7 -0
- package/lib/cjs/nip46.js +135 -6
- package/lib/cjs/nip46.js.map +4 -4
- package/lib/cjs/nip47.js.map +2 -2
- package/lib/cjs/nip57.js.map +1 -1
- package/lib/cjs/nip58.js.map +2 -2
- package/lib/cjs/nip59.js.map +2 -2
- package/lib/cjs/nip75.js.map +2 -2
- package/lib/cjs/nip94.js.map +2 -2
- package/lib/cjs/nip98.js.map +2 -2
- package/lib/cjs/nip99.js.map +2 -2
- package/lib/cjs/nipb0.js +1064 -0
- package/lib/cjs/nipb0.js.map +7 -0
- package/lib/cjs/pool.js +128 -4
- package/lib/cjs/pool.js.map +4 -4
- package/lib/cjs/relay.js +29 -4
- package/lib/cjs/relay.js.map +2 -2
- package/lib/esm/abstract-pool.js +128 -4
- package/lib/esm/abstract-pool.js.map +4 -4
- package/lib/esm/abstract-relay.js +29 -4
- package/lib/esm/abstract-relay.js.map +2 -2
- package/lib/esm/filter.js.map +1 -1
- package/lib/esm/index.js +369 -46
- package/lib/esm/index.js.map +4 -4
- package/lib/esm/kinds.js +196 -4
- package/lib/esm/kinds.js.map +2 -2
- package/lib/esm/nip10.js +5 -4
- package/lib/esm/nip10.js.map +2 -2
- package/lib/esm/nip17.js.map +2 -2
- package/lib/esm/nip18.js.map +2 -2
- package/lib/esm/nip22.js +11 -5
- package/lib/esm/nip22.js.map +2 -2
- package/lib/esm/nip25.js.map +1 -1
- package/lib/esm/nip28.js.map +2 -2
- package/lib/esm/nip42.js.map +2 -2
- package/lib/esm/nip45.js +162 -0
- package/lib/esm/nip45.js.map +7 -0
- package/lib/esm/nip46.js +135 -6
- package/lib/esm/nip46.js.map +4 -4
- package/lib/esm/nip47.js.map +2 -2
- package/lib/esm/nip57.js.map +1 -1
- package/lib/esm/nip58.js.map +2 -2
- package/lib/esm/nip59.js.map +2 -2
- package/lib/esm/nip75.js.map +2 -2
- package/lib/esm/nip94.js.map +2 -2
- package/lib/esm/nip98.js.map +2 -2
- package/lib/esm/nip99.js.map +2 -2
- package/lib/esm/nipb0.js +1049 -0
- package/lib/esm/nipb0.js.map +7 -0
- package/lib/esm/pool.js +128 -4
- package/lib/esm/pool.js.map +4 -4
- package/lib/esm/relay.js +29 -4
- package/lib/esm/relay.js.map +2 -2
- package/lib/nostr.bundle.js +342 -21
- package/lib/nostr.bundle.js.map +4 -4
- package/lib/types/abstract-pool.d.ts +9 -0
- package/lib/types/abstract-relay.d.ts +10 -1
- package/lib/types/kinds.d.ts +200 -8
- package/lib/types/nip45.d.ts +13 -0
- package/lib/types/nip45.test.d.ts +1 -0
- package/lib/types/nip46.d.ts +7 -5
- package/lib/types/nipb0.d.ts +129 -0
- package/package.json +13 -1
package/lib/esm/kinds.js
CHANGED
|
@@ -66,40 +66,83 @@ var Repost = 6;
|
|
|
66
66
|
var Reaction = 7;
|
|
67
67
|
var BadgeAward = 8;
|
|
68
68
|
var ChatMessage = 9;
|
|
69
|
+
var SimpleGroupThreadedReply = 10;
|
|
69
70
|
var ForumThread = 11;
|
|
71
|
+
var SimpleGroupReply = 12;
|
|
70
72
|
var Seal = 13;
|
|
71
73
|
var PrivateDirectMessage = 14;
|
|
72
74
|
var FileMessage = 15;
|
|
73
75
|
var GenericRepost = 16;
|
|
76
|
+
var ReactionToWebsite = 17;
|
|
74
77
|
var Photo = 20;
|
|
75
78
|
var NormalVideo = 21;
|
|
76
79
|
var ShortVideo = 22;
|
|
80
|
+
var PublicMessage = 24;
|
|
77
81
|
var ChannelCreation = 40;
|
|
78
82
|
var ChannelMetadata = 41;
|
|
79
83
|
var ChannelMessage = 42;
|
|
80
84
|
var ChannelHideMessage = 43;
|
|
81
85
|
var ChannelMuteUser = 44;
|
|
86
|
+
var PodcastEpisode = 54;
|
|
87
|
+
var Chess = 64;
|
|
88
|
+
var MergeRequests = 818;
|
|
89
|
+
var PollResponse = 1018;
|
|
90
|
+
var Bid = 1021;
|
|
91
|
+
var BidConfirmation = 1022;
|
|
82
92
|
var OpenTimestamps = 1040;
|
|
83
93
|
var GiftWrap = 1059;
|
|
84
|
-
var Poll = 1068;
|
|
85
94
|
var FileMetadata = 1063;
|
|
95
|
+
var Poll = 1068;
|
|
86
96
|
var Comment = 1111;
|
|
87
|
-
var LiveChatMessage = 1311;
|
|
88
97
|
var Voice = 1222;
|
|
98
|
+
var Scroll = 1227;
|
|
89
99
|
var VoiceComment = 1244;
|
|
100
|
+
var LiveChatMessage = 1311;
|
|
101
|
+
var CodeSnippet = 1337;
|
|
102
|
+
var Patch = 1617;
|
|
103
|
+
var GitPullRequest = 1618;
|
|
104
|
+
var GitPullRequestUpdate = 1619;
|
|
105
|
+
var Issue = 1621;
|
|
106
|
+
var Reply = 1622;
|
|
107
|
+
var StatusOpen = 1630;
|
|
108
|
+
var StatusApplied = 1631;
|
|
109
|
+
var StatusClosed = 1632;
|
|
110
|
+
var StatusDraft = 1633;
|
|
90
111
|
var ProblemTracker = 1971;
|
|
91
112
|
var Report = 1984;
|
|
92
113
|
var Reporting = 1984;
|
|
93
114
|
var Label = 1985;
|
|
115
|
+
var RelayReviews = 1986;
|
|
116
|
+
var AIEmbeddings = 1987;
|
|
117
|
+
var Torrent = 2003;
|
|
118
|
+
var TorrentComment = 2004;
|
|
119
|
+
var CoinjoinPool = 2022;
|
|
120
|
+
var DecoupledKeyClientAnnouncement = 4454;
|
|
121
|
+
var DecoupledEncryptionKeyDistribution = 4455;
|
|
94
122
|
var CommunityPostApproval = 4550;
|
|
95
123
|
var JobRequest = 5999;
|
|
96
124
|
var JobResult = 6999;
|
|
97
125
|
var JobFeedback = 7e3;
|
|
126
|
+
var ReservedCashuWalletTokens = 7374;
|
|
127
|
+
var CashuWalletTokens = 7375;
|
|
128
|
+
var CashuWalletHistory = 7376;
|
|
129
|
+
var GeocacheLog = 7516;
|
|
130
|
+
var GeocacheProofOfFind = 7517;
|
|
131
|
+
var SimpleGroupPutUser = 9e3;
|
|
132
|
+
var SimpleGroupRemoveUser = 9001;
|
|
133
|
+
var SimpleGroupEditMetadata = 9002;
|
|
134
|
+
var SimpleGroupDeleteEvent = 9005;
|
|
135
|
+
var SimpleGroupCreateGroup = 9007;
|
|
136
|
+
var SimpleGroupDeleteGroup = 9008;
|
|
137
|
+
var SimpleGroupCreateInvite = 9009;
|
|
138
|
+
var SimpleGroupJoinRequest = 9021;
|
|
139
|
+
var SimpleGroupLeaveRequest = 9022;
|
|
98
140
|
var ZapGoal = 9041;
|
|
141
|
+
var NutZap = 9321;
|
|
142
|
+
var TidalLogin = 9467;
|
|
99
143
|
var ZapRequest = 9734;
|
|
100
144
|
var Zap = 9735;
|
|
101
145
|
var Highlights = 9802;
|
|
102
|
-
var PollResponse = 1018;
|
|
103
146
|
var Mutelist = 1e4;
|
|
104
147
|
var Pinlist = 10001;
|
|
105
148
|
var RelayList = 10002;
|
|
@@ -108,37 +151,74 @@ var CommunitiesList = 10004;
|
|
|
108
151
|
var PublicChatsList = 10005;
|
|
109
152
|
var BlockedRelaysList = 10006;
|
|
110
153
|
var SearchRelaysList = 10007;
|
|
154
|
+
var SimpleGroupList = 10009;
|
|
111
155
|
var FavoriteRelays = 10012;
|
|
156
|
+
var PrivateEventRelayList = 10013;
|
|
112
157
|
var InterestsList = 10015;
|
|
158
|
+
var NutZapInfo = 10019;
|
|
159
|
+
var MediaFollows = 10020;
|
|
113
160
|
var UserEmojiList = 10030;
|
|
161
|
+
var DecoupledKeyAnnouncement = 10044;
|
|
114
162
|
var DirectMessageRelaysList = 10050;
|
|
115
|
-
var
|
|
163
|
+
var FavoritePodcasts = 10054;
|
|
116
164
|
var BlossomServerList = 10063;
|
|
165
|
+
var FileServerPreference = 10096;
|
|
166
|
+
var GoodWikiAuthorList = 10101;
|
|
167
|
+
var GoodWikiRelayList = 10102;
|
|
168
|
+
var PodcastMetadata = 10154;
|
|
169
|
+
var AuthoredPodcasts = 10164;
|
|
170
|
+
var RelayMonitorAnnouncement = 10166;
|
|
171
|
+
var RoomPresence = 10312;
|
|
172
|
+
var UserGraspList = 10317;
|
|
173
|
+
var ProxyAnnouncement = 10377;
|
|
174
|
+
var TransportMethodAnnouncement = 11111;
|
|
117
175
|
var NWCWalletInfo = 13194;
|
|
176
|
+
var NsiteRoot = 15128;
|
|
177
|
+
var CashuWalletEvent = 17375;
|
|
118
178
|
var LightningPubRPC = 21e3;
|
|
119
179
|
var ClientAuth = 22242;
|
|
120
180
|
var NWCWalletRequest = 23194;
|
|
121
181
|
var NWCWalletResponse = 23195;
|
|
122
182
|
var NostrConnect = 24133;
|
|
183
|
+
var BlobsAuth = 24242;
|
|
123
184
|
var HTTPAuth = 27235;
|
|
124
185
|
var Followsets = 3e4;
|
|
125
186
|
var Genericlists = 30001;
|
|
126
187
|
var Relaysets = 30002;
|
|
127
188
|
var Bookmarksets = 30003;
|
|
128
189
|
var Curationsets = 30004;
|
|
190
|
+
var CuratedVideoSets = 30005;
|
|
191
|
+
var MuteSets = 30007;
|
|
129
192
|
var ProfileBadges = 30008;
|
|
130
193
|
var BadgeDefinition = 30009;
|
|
131
194
|
var Interestsets = 30015;
|
|
132
195
|
var CreateOrUpdateStall = 30017;
|
|
133
196
|
var CreateOrUpdateProduct = 30018;
|
|
197
|
+
var MarketplaceUI = 30019;
|
|
198
|
+
var ProductSoldAsAuction = 30020;
|
|
134
199
|
var LongFormArticle = 30023;
|
|
135
200
|
var DraftLong = 30024;
|
|
136
201
|
var Emojisets = 30030;
|
|
202
|
+
var ModularArticleHeader = 30040;
|
|
203
|
+
var ModularArticleContent = 30041;
|
|
204
|
+
var ReleaseArtifactSets = 30063;
|
|
137
205
|
var Application = 30078;
|
|
206
|
+
var RelayDiscovery = 30166;
|
|
207
|
+
var AppCurationSet = 30267;
|
|
138
208
|
var LiveEvent = 30311;
|
|
209
|
+
var InteractiveRoom = 30312;
|
|
210
|
+
var ConferenceEvent = 30313;
|
|
139
211
|
var UserStatuses = 30315;
|
|
212
|
+
var SlideSet = 30388;
|
|
140
213
|
var ClassifiedListing = 30402;
|
|
141
214
|
var DraftClassifiedListing = 30403;
|
|
215
|
+
var RepositoryAnnouncement = 30617;
|
|
216
|
+
var RepositoryState = 30618;
|
|
217
|
+
var WikiArticle = 30818;
|
|
218
|
+
var Redirects = 30819;
|
|
219
|
+
var DraftEvent = 31234;
|
|
220
|
+
var LinkSet = 31388;
|
|
221
|
+
var Feed = 31890;
|
|
142
222
|
var Date = 31922;
|
|
143
223
|
var Time = 31923;
|
|
144
224
|
var Calendar = 31924;
|
|
@@ -146,42 +226,80 @@ var CalendarEventRSVP = 31925;
|
|
|
146
226
|
var RelayReview = 31987;
|
|
147
227
|
var Handlerrecommendation = 31989;
|
|
148
228
|
var Handlerinformation = 31990;
|
|
229
|
+
var SoftwareApplication = 32267;
|
|
230
|
+
var LegacyNsiteFile = 34128;
|
|
231
|
+
var VideoViewEvent = 34237;
|
|
149
232
|
var CommunityDefinition = 34550;
|
|
233
|
+
var NsiteNamed = 35128;
|
|
234
|
+
var GeocacheListing = 37515;
|
|
235
|
+
var GeocacheLogEntry = 37516;
|
|
236
|
+
var CashuMintAnnouncement = 38172;
|
|
237
|
+
var FedimintAnnouncement = 38173;
|
|
238
|
+
var PeerToPeerOrderEvents = 38383;
|
|
150
239
|
var GroupMetadata = 39e3;
|
|
240
|
+
var SimpleGroupAdmins = 39001;
|
|
241
|
+
var SimpleGroupMembers = 39002;
|
|
242
|
+
var SimpleGroupRoles = 39003;
|
|
243
|
+
var SimpleGroupLiveKitParticipants = 39004;
|
|
244
|
+
var StarterPacks = 39089;
|
|
245
|
+
var MediaStarterPacks = 39092;
|
|
246
|
+
var WebBookmarks = 39701;
|
|
151
247
|
export {
|
|
248
|
+
AIEmbeddings,
|
|
249
|
+
AppCurationSet,
|
|
152
250
|
Application,
|
|
251
|
+
AuthoredPodcasts,
|
|
153
252
|
BadgeAward,
|
|
154
253
|
BadgeDefinition,
|
|
254
|
+
Bid,
|
|
255
|
+
BidConfirmation,
|
|
256
|
+
BlobsAuth,
|
|
155
257
|
BlockedRelaysList,
|
|
156
258
|
BlossomServerList,
|
|
157
259
|
BookmarkList,
|
|
158
260
|
Bookmarksets,
|
|
159
261
|
Calendar,
|
|
160
262
|
CalendarEventRSVP,
|
|
263
|
+
CashuMintAnnouncement,
|
|
264
|
+
CashuWalletEvent,
|
|
265
|
+
CashuWalletHistory,
|
|
266
|
+
CashuWalletTokens,
|
|
161
267
|
ChannelCreation,
|
|
162
268
|
ChannelHideMessage,
|
|
163
269
|
ChannelMessage,
|
|
164
270
|
ChannelMetadata,
|
|
165
271
|
ChannelMuteUser,
|
|
166
272
|
ChatMessage,
|
|
273
|
+
Chess,
|
|
167
274
|
ClassifiedListing,
|
|
168
275
|
ClientAuth,
|
|
276
|
+
CodeSnippet,
|
|
277
|
+
CoinjoinPool,
|
|
169
278
|
Comment,
|
|
170
279
|
CommunitiesList,
|
|
171
280
|
CommunityDefinition,
|
|
172
281
|
CommunityPostApproval,
|
|
282
|
+
ConferenceEvent,
|
|
173
283
|
Contacts,
|
|
174
284
|
CreateOrUpdateProduct,
|
|
175
285
|
CreateOrUpdateStall,
|
|
286
|
+
CuratedVideoSets,
|
|
176
287
|
Curationsets,
|
|
177
288
|
Date,
|
|
289
|
+
DecoupledEncryptionKeyDistribution,
|
|
290
|
+
DecoupledKeyAnnouncement,
|
|
291
|
+
DecoupledKeyClientAnnouncement,
|
|
178
292
|
DirectMessageRelaysList,
|
|
179
293
|
DraftClassifiedListing,
|
|
294
|
+
DraftEvent,
|
|
180
295
|
DraftLong,
|
|
181
296
|
Emojisets,
|
|
182
297
|
EncryptedDirectMessage,
|
|
183
298
|
EventDeletion,
|
|
299
|
+
FavoritePodcasts,
|
|
184
300
|
FavoriteRelays,
|
|
301
|
+
FedimintAnnouncement,
|
|
302
|
+
Feed,
|
|
185
303
|
FileMessage,
|
|
186
304
|
FileMetadata,
|
|
187
305
|
FileServerPreference,
|
|
@@ -189,55 +307,129 @@ export {
|
|
|
189
307
|
ForumThread,
|
|
190
308
|
GenericRepost,
|
|
191
309
|
Genericlists,
|
|
310
|
+
GeocacheListing,
|
|
311
|
+
GeocacheLog,
|
|
312
|
+
GeocacheLogEntry,
|
|
313
|
+
GeocacheProofOfFind,
|
|
192
314
|
GiftWrap,
|
|
315
|
+
GitPullRequest,
|
|
316
|
+
GitPullRequestUpdate,
|
|
317
|
+
GoodWikiAuthorList,
|
|
318
|
+
GoodWikiRelayList,
|
|
193
319
|
GroupMetadata,
|
|
194
320
|
HTTPAuth,
|
|
195
321
|
Handlerinformation,
|
|
196
322
|
Handlerrecommendation,
|
|
197
323
|
Highlights,
|
|
324
|
+
InteractiveRoom,
|
|
198
325
|
InterestsList,
|
|
199
326
|
Interestsets,
|
|
327
|
+
Issue,
|
|
200
328
|
JobFeedback,
|
|
201
329
|
JobRequest,
|
|
202
330
|
JobResult,
|
|
203
331
|
Label,
|
|
332
|
+
LegacyNsiteFile,
|
|
204
333
|
LightningPubRPC,
|
|
334
|
+
LinkSet,
|
|
205
335
|
LiveChatMessage,
|
|
206
336
|
LiveEvent,
|
|
207
337
|
LongFormArticle,
|
|
338
|
+
MarketplaceUI,
|
|
339
|
+
MediaFollows,
|
|
340
|
+
MediaStarterPacks,
|
|
341
|
+
MergeRequests,
|
|
208
342
|
Metadata,
|
|
343
|
+
ModularArticleContent,
|
|
344
|
+
ModularArticleHeader,
|
|
345
|
+
MuteSets,
|
|
209
346
|
Mutelist,
|
|
210
347
|
NWCWalletInfo,
|
|
211
348
|
NWCWalletRequest,
|
|
212
349
|
NWCWalletResponse,
|
|
213
350
|
NormalVideo,
|
|
214
351
|
NostrConnect,
|
|
352
|
+
NsiteNamed,
|
|
353
|
+
NsiteRoot,
|
|
354
|
+
NutZap,
|
|
355
|
+
NutZapInfo,
|
|
215
356
|
OpenTimestamps,
|
|
357
|
+
Patch,
|
|
358
|
+
PeerToPeerOrderEvents,
|
|
216
359
|
Photo,
|
|
217
360
|
Pinlist,
|
|
361
|
+
PodcastEpisode,
|
|
362
|
+
PodcastMetadata,
|
|
218
363
|
Poll,
|
|
219
364
|
PollResponse,
|
|
220
365
|
PrivateDirectMessage,
|
|
366
|
+
PrivateEventRelayList,
|
|
221
367
|
ProblemTracker,
|
|
368
|
+
ProductSoldAsAuction,
|
|
222
369
|
ProfileBadges,
|
|
370
|
+
ProxyAnnouncement,
|
|
223
371
|
PublicChatsList,
|
|
372
|
+
PublicMessage,
|
|
224
373
|
Reaction,
|
|
374
|
+
ReactionToWebsite,
|
|
225
375
|
RecommendRelay,
|
|
376
|
+
Redirects,
|
|
377
|
+
RelayDiscovery,
|
|
226
378
|
RelayList,
|
|
379
|
+
RelayMonitorAnnouncement,
|
|
227
380
|
RelayReview,
|
|
381
|
+
RelayReviews,
|
|
228
382
|
Relaysets,
|
|
383
|
+
ReleaseArtifactSets,
|
|
384
|
+
Reply,
|
|
229
385
|
Report,
|
|
230
386
|
Reporting,
|
|
387
|
+
RepositoryAnnouncement,
|
|
388
|
+
RepositoryState,
|
|
231
389
|
Repost,
|
|
390
|
+
ReservedCashuWalletTokens,
|
|
391
|
+
RoomPresence,
|
|
392
|
+
Scroll,
|
|
232
393
|
Seal,
|
|
233
394
|
SearchRelaysList,
|
|
234
395
|
ShortTextNote,
|
|
235
396
|
ShortVideo,
|
|
397
|
+
SimpleGroupAdmins,
|
|
398
|
+
SimpleGroupCreateGroup,
|
|
399
|
+
SimpleGroupCreateInvite,
|
|
400
|
+
SimpleGroupDeleteEvent,
|
|
401
|
+
SimpleGroupDeleteGroup,
|
|
402
|
+
SimpleGroupEditMetadata,
|
|
403
|
+
SimpleGroupJoinRequest,
|
|
404
|
+
SimpleGroupLeaveRequest,
|
|
405
|
+
SimpleGroupList,
|
|
406
|
+
SimpleGroupLiveKitParticipants,
|
|
407
|
+
SimpleGroupMembers,
|
|
408
|
+
SimpleGroupPutUser,
|
|
409
|
+
SimpleGroupRemoveUser,
|
|
410
|
+
SimpleGroupReply,
|
|
411
|
+
SimpleGroupRoles,
|
|
412
|
+
SimpleGroupThreadedReply,
|
|
413
|
+
SlideSet,
|
|
414
|
+
SoftwareApplication,
|
|
415
|
+
StarterPacks,
|
|
416
|
+
StatusApplied,
|
|
417
|
+
StatusClosed,
|
|
418
|
+
StatusDraft,
|
|
419
|
+
StatusOpen,
|
|
420
|
+
TidalLogin,
|
|
236
421
|
Time,
|
|
422
|
+
Torrent,
|
|
423
|
+
TorrentComment,
|
|
424
|
+
TransportMethodAnnouncement,
|
|
237
425
|
UserEmojiList,
|
|
426
|
+
UserGraspList,
|
|
238
427
|
UserStatuses,
|
|
428
|
+
VideoViewEvent,
|
|
239
429
|
Voice,
|
|
240
430
|
VoiceComment,
|
|
431
|
+
WebBookmarks,
|
|
432
|
+
WikiArticle,
|
|
241
433
|
Zap,
|
|
242
434
|
ZapGoal,
|
|
243
435
|
ZapRequest,
|
package/lib/esm/kinds.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../core.ts", "../../kinds.ts"],
|
|
4
|
-
"sourcesContent": ["export interface Nostr {\n generateSecretKey(): Uint8Array\n getPublicKey(secretKey: Uint8Array): string\n finalizeEvent(event: EventTemplate, secretKey: Uint8Array): VerifiedEvent\n verifyEvent(event: Event): event is VerifiedEvent\n}\n\n/** Designates a verified event signature. */\nexport const verifiedSymbol = Symbol('verified')\n\nexport type NostrEvent = {\n kind: number\n tags: string[][]\n content: string\n created_at: number\n pubkey: string\n id: string\n sig: string\n [verifiedSymbol]?: boolean\n}\n\nexport type Event = NostrEvent\nexport type EventTemplate = Pick<Event, 'kind' | 'tags' | 'content' | 'created_at'>\nexport type UnsignedEvent = Pick<Event, 'kind' | 'tags' | 'content' | 'created_at' | 'pubkey'>\n\n/** An event whose signature has been verified. */\nexport interface VerifiedEvent extends Event {\n [verifiedSymbol]: true\n}\n\nconst isRecord = (obj: unknown): obj is Record<string, unknown> => obj instanceof Object\n\nexport function validateEvent<T>(event: T): event is T & UnsignedEvent {\n if (!isRecord(event)) return false\n if (typeof event.kind !== 'number') return false\n if (typeof event.content !== 'string') return false\n if (typeof event.created_at !== 'number') return false\n if (typeof event.pubkey !== 'string') return false\n if (!event.pubkey.match(/^[a-f0-9]{64}$/)) return false\n\n if (!Array.isArray(event.tags)) return false\n for (let i = 0; i < event.tags.length; i++) {\n let tag = event.tags[i]\n if (!Array.isArray(tag)) return false\n for (let j = 0; j < tag.length; j++) {\n if (typeof tag[j] !== 'string') return false\n }\n }\n\n return true\n}\n\n/**\n * Sort events in reverse-chronological order by the `created_at` timestamp,\n * and then by the event `id` (lexicographically) in case of ties.\n * This mutates the array.\n */\nexport function sortEvents(events: Event[]): Event[] {\n return events.sort((a: NostrEvent, b: NostrEvent): number => {\n if (a.created_at !== b.created_at) {\n return b.created_at - a.created_at\n }\n return a.id.localeCompare(b.id)\n })\n}\n", "import { NostrEvent, validateEvent } from './pure.ts'\n\n/** Events are **regular**, which means they're all expected to be stored by relays. */\nexport function isRegularKind(kind: number): boolean {\n return kind < 10000 && kind !== 0 && kind !== 3\n}\n\n/** Events are **replaceable**, which means that, for each combination of `pubkey` and `kind`, only the latest event is expected to (SHOULD) be stored by relays, older versions are expected to be discarded. */\nexport function isReplaceableKind(kind: number): boolean {\n return kind === 0 || kind === 3 || (10000 <= kind && kind < 20000)\n}\n\n/** Events are **ephemeral**, which means they are not expected to be stored by relays. */\nexport function isEphemeralKind(kind: number): boolean {\n return 20000 <= kind && kind < 30000\n}\n\n/** Events are **addressable**, which means that, for each combination of `pubkey`, `kind` and the `d` tag, only the latest event is expected to be stored by relays, older versions are expected to be discarded. */\nexport function isAddressableKind(kind: number): boolean {\n return 30000 <= kind && kind < 40000\n}\n\n/** Classification of the event kind. */\nexport type KindClassification = 'regular' | 'replaceable' | 'ephemeral' | 'parameterized' | 'unknown'\n\n/** Determine the classification of this kind of event if known, or `unknown`. */\nexport function classifyKind(kind: number): KindClassification {\n if (isRegularKind(kind)) return 'regular'\n if (isReplaceableKind(kind)) return 'replaceable'\n if (isEphemeralKind(kind)) return 'ephemeral'\n if (isAddressableKind(kind)) return 'parameterized'\n return 'unknown'\n}\n\nexport function isKind<T extends number>(event: unknown, kind: T | Array<T>): event is NostrEvent & { kind: T } {\n const kindAsArray: number[] = kind instanceof Array ? kind : [kind]\n return (validateEvent(event) && kindAsArray.includes(event.kind)) || false\n}\n\nexport const Metadata = 0\nexport type Metadata = typeof Metadata\nexport const ShortTextNote = 1\nexport type ShortTextNote = typeof ShortTextNote\nexport const RecommendRelay = 2\nexport type RecommendRelay = typeof RecommendRelay\nexport const Contacts = 3\nexport type Contacts = typeof Contacts\nexport const EncryptedDirectMessage = 4\nexport type EncryptedDirectMessage = typeof EncryptedDirectMessage\nexport const EventDeletion = 5\nexport type EventDeletion = typeof EventDeletion\nexport const Repost = 6\nexport type Repost = typeof Repost\nexport const Reaction = 7\nexport type Reaction = typeof Reaction\nexport const BadgeAward = 8\nexport type BadgeAward = typeof BadgeAward\nexport const ChatMessage = 9\nexport type ChatMessage = typeof ChatMessage\nexport const ForumThread = 11\nexport type ForumThread = typeof ForumThread\nexport const Seal = 13\nexport type Seal = typeof Seal\nexport const PrivateDirectMessage = 14\nexport type PrivateDirectMessage = typeof PrivateDirectMessage\nexport const FileMessage = 15\nexport type FileMessage = typeof FileMessage\nexport const GenericRepost = 16\nexport type GenericRepost = typeof GenericRepost\nexport const Photo = 20\nexport type Photo = typeof Photo\nexport const NormalVideo = 21\nexport type NormalVideo = typeof NormalVideo\nexport const ShortVideo = 22\nexport type ShortVideo = typeof ShortVideo\nexport const ChannelCreation = 40\nexport type ChannelCreation = typeof ChannelCreation\nexport const ChannelMetadata = 41\nexport type ChannelMetadata = typeof ChannelMetadata\nexport const ChannelMessage = 42\nexport type ChannelMessage = typeof ChannelMessage\nexport const ChannelHideMessage = 43\nexport type ChannelHideMessage = typeof ChannelHideMessage\nexport const ChannelMuteUser = 44\nexport type ChannelMuteUser = typeof ChannelMuteUser\nexport const OpenTimestamps = 1040\nexport type OpenTimestamps = typeof OpenTimestamps\nexport const GiftWrap = 1059\nexport type GiftWrap = typeof GiftWrap\nexport const Poll = 1068\nexport type Poll = typeof Poll\nexport const FileMetadata = 1063\nexport type FileMetadata = typeof FileMetadata\nexport const Comment = 1111\nexport type Comment = typeof Comment\nexport const LiveChatMessage = 1311\nexport type LiveChatMessage = typeof LiveChatMessage\nexport const Voice = 1222\nexport type Voice = typeof Voice\nexport const VoiceComment = 1244\nexport type VoiceComment = typeof VoiceComment\nexport const ProblemTracker = 1971\nexport type ProblemTracker = typeof ProblemTracker\nexport const Report = 1984\nexport type Report = typeof Report\nexport const Reporting = 1984\nexport type Reporting = typeof Reporting\nexport const Label = 1985\nexport type Label = typeof Label\nexport const CommunityPostApproval = 4550\nexport type CommunityPostApproval = typeof CommunityPostApproval\nexport const JobRequest = 5999\nexport type JobRequest = typeof JobRequest\nexport const JobResult = 6999\nexport type JobResult = typeof JobResult\nexport const JobFeedback = 7000\nexport type JobFeedback = typeof JobFeedback\nexport const ZapGoal = 9041\nexport type ZapGoal = typeof ZapGoal\nexport const ZapRequest = 9734\nexport type ZapRequest = typeof ZapRequest\nexport const Zap = 9735\nexport type Zap = typeof Zap\nexport const Highlights = 9802\nexport type Highlights = typeof Highlights\nexport const PollResponse = 1018\nexport type PollResponse = typeof PollResponse\nexport const Mutelist = 10000\nexport type Mutelist = typeof Mutelist\nexport const Pinlist = 10001\nexport type Pinlist = typeof Pinlist\nexport const RelayList = 10002\nexport type RelayList = typeof RelayList\nexport const BookmarkList = 10003\nexport type BookmarkList = typeof BookmarkList\nexport const CommunitiesList = 10004\nexport type CommunitiesList = typeof CommunitiesList\nexport const PublicChatsList = 10005\nexport type PublicChatsList = typeof PublicChatsList\nexport const BlockedRelaysList = 10006\nexport type BlockedRelaysList = typeof BlockedRelaysList\nexport const SearchRelaysList = 10007\nexport type SearchRelaysList = typeof SearchRelaysList\nexport const FavoriteRelays = 10012\nexport type FavoriteRelays = typeof FavoriteRelays\nexport const InterestsList = 10015\nexport type InterestsList = typeof InterestsList\nexport const UserEmojiList = 10030\nexport type UserEmojiList = typeof UserEmojiList\nexport const DirectMessageRelaysList = 10050\nexport type DirectMessageRelaysList = typeof DirectMessageRelaysList\nexport const FileServerPreference = 10096\nexport type FileServerPreference = typeof FileServerPreference\nexport const BlossomServerList = 10063\nexport type BlossomServerList = typeof BlossomServerList\nexport const NWCWalletInfo = 13194\nexport type NWCWalletInfo = typeof NWCWalletInfo\nexport const LightningPubRPC = 21000\nexport type LightningPubRPC = typeof LightningPubRPC\nexport const ClientAuth = 22242\nexport type ClientAuth = typeof ClientAuth\nexport const NWCWalletRequest = 23194\nexport type NWCWalletRequest = typeof NWCWalletRequest\nexport const NWCWalletResponse = 23195\nexport type NWCWalletResponse = typeof NWCWalletResponse\nexport const NostrConnect = 24133\nexport type NostrConnect = typeof NostrConnect\nexport const HTTPAuth = 27235\nexport type HTTPAuth = typeof HTTPAuth\nexport const Followsets = 30000\nexport type Followsets = typeof Followsets\nexport const Genericlists = 30001\nexport type Genericlists = typeof Genericlists\nexport const Relaysets = 30002\nexport type Relaysets = typeof Relaysets\nexport const Bookmarksets = 30003\nexport type Bookmarksets = typeof Bookmarksets\nexport const Curationsets = 30004\nexport type Curationsets = typeof Curationsets\nexport const ProfileBadges = 30008\nexport type ProfileBadges = typeof ProfileBadges\nexport const BadgeDefinition = 30009\nexport type BadgeDefinition = typeof BadgeDefinition\nexport const Interestsets = 30015\nexport type Interestsets = typeof Interestsets\nexport const CreateOrUpdateStall = 30017\nexport type CreateOrUpdateStall = typeof CreateOrUpdateStall\nexport const CreateOrUpdateProduct = 30018\nexport type CreateOrUpdateProduct = typeof CreateOrUpdateProduct\nexport const LongFormArticle = 30023\nexport type LongFormArticle = typeof LongFormArticle\nexport const DraftLong = 30024\nexport type DraftLong = typeof DraftLong\nexport const Emojisets = 30030\nexport type Emojisets = typeof Emojisets\nexport const Application = 30078\nexport type Application = typeof Application\nexport const LiveEvent = 30311\nexport type LiveEvent = typeof LiveEvent\nexport const UserStatuses = 30315\nexport type UserStatuses = typeof UserStatuses\nexport const ClassifiedListing = 30402\nexport type ClassifiedListing = typeof ClassifiedListing\nexport const DraftClassifiedListing = 30403\nexport type DraftClassifiedListing = typeof DraftClassifiedListing\nexport const Date = 31922\nexport type Date = typeof Date\nexport const Time = 31923\nexport type Time = typeof Time\nexport const Calendar = 31924\nexport type Calendar = typeof Calendar\nexport const CalendarEventRSVP = 31925\nexport type CalendarEventRSVP = typeof CalendarEventRSVP\nexport const RelayReview = 31987\nexport type RelayReview = typeof RelayReview\nexport const Handlerrecommendation = 31989\nexport type Handlerrecommendation = typeof Handlerrecommendation\nexport const Handlerinformation = 31990\nexport type Handlerinformation = typeof Handlerinformation\nexport const CommunityDefinition = 34550\nexport type CommunityDefinition = typeof CommunityDefinition\nexport const GroupMetadata = 39000\nexport type GroupMetadata = typeof GroupMetadata\n"],
|
|
5
|
-
"mappings": ";AAQO,IAAM,iBAAiB,OAAO,UAAU;AAsB/C,IAAM,WAAW,CAAC,QAAiD,eAAe;AAE3E,SAAS,cAAiB,OAA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,KAAM;AACvE;AAEO,IAAM,WAAW;AAEjB,IAAM,gBAAgB;AAEtB,IAAM,iBAAiB;AAEvB,IAAM,WAAW;AAEjB,IAAM,yBAAyB;AAE/B,IAAM,gBAAgB;AAEtB,IAAM,SAAS;AAEf,IAAM,WAAW;AAEjB,IAAM,aAAa;AAEnB,IAAM,cAAc;AAEpB,IAAM,cAAc;AAEpB,IAAM,OAAO;AAEb,IAAM,uBAAuB;AAE7B,IAAM,cAAc;AAEpB,IAAM,gBAAgB;AAEtB,IAAM,QAAQ;AAEd,IAAM,cAAc;AAEpB,IAAM,aAAa;AAEnB,IAAM,kBAAkB;AAExB,IAAM,kBAAkB;AAExB,IAAM,iBAAiB;AAEvB,IAAM,qBAAqB;AAE3B,IAAM,kBAAkB;AAExB,IAAM,iBAAiB;AAEvB,IAAM,
|
|
4
|
+
"sourcesContent": ["export interface Nostr {\n generateSecretKey(): Uint8Array\n getPublicKey(secretKey: Uint8Array): string\n finalizeEvent(event: EventTemplate, secretKey: Uint8Array): VerifiedEvent\n verifyEvent(event: Event): event is VerifiedEvent\n}\n\n/** Designates a verified event signature. */\nexport const verifiedSymbol = Symbol('verified')\n\nexport type NostrEvent = {\n kind: number\n tags: string[][]\n content: string\n created_at: number\n pubkey: string\n id: string\n sig: string\n [verifiedSymbol]?: boolean\n}\n\nexport type Event = NostrEvent\nexport type EventTemplate = Pick<Event, 'kind' | 'tags' | 'content' | 'created_at'>\nexport type UnsignedEvent = Pick<Event, 'kind' | 'tags' | 'content' | 'created_at' | 'pubkey'>\n\n/** An event whose signature has been verified. */\nexport interface VerifiedEvent extends Event {\n [verifiedSymbol]: true\n}\n\nconst isRecord = (obj: unknown): obj is Record<string, unknown> => obj instanceof Object\n\nexport function validateEvent<T>(event: T): event is T & UnsignedEvent {\n if (!isRecord(event)) return false\n if (typeof event.kind !== 'number') return false\n if (typeof event.content !== 'string') return false\n if (typeof event.created_at !== 'number') return false\n if (typeof event.pubkey !== 'string') return false\n if (!event.pubkey.match(/^[a-f0-9]{64}$/)) return false\n\n if (!Array.isArray(event.tags)) return false\n for (let i = 0; i < event.tags.length; i++) {\n let tag = event.tags[i]\n if (!Array.isArray(tag)) return false\n for (let j = 0; j < tag.length; j++) {\n if (typeof tag[j] !== 'string') return false\n }\n }\n\n return true\n}\n\n/**\n * Sort events in reverse-chronological order by the `created_at` timestamp,\n * and then by the event `id` (lexicographically) in case of ties.\n * This mutates the array.\n */\nexport function sortEvents(events: Event[]): Event[] {\n return events.sort((a: NostrEvent, b: NostrEvent): number => {\n if (a.created_at !== b.created_at) {\n return b.created_at - a.created_at\n }\n return a.id.localeCompare(b.id)\n })\n}\n", "import { NostrEvent, validateEvent } from './pure.ts'\n\n/** Events are **regular**, which means they're all expected to be stored by relays. */\nexport function isRegularKind(kind: number): boolean {\n return kind < 10000 && kind !== 0 && kind !== 3\n}\n\n/** Events are **replaceable**, which means that, for each combination of `pubkey` and `kind`, only the latest event is expected to (SHOULD) be stored by relays, older versions are expected to be discarded. */\nexport function isReplaceableKind(kind: number): boolean {\n return kind === 0 || kind === 3 || (10000 <= kind && kind < 20000)\n}\n\n/** Events are **ephemeral**, which means they are not expected to be stored by relays. */\nexport function isEphemeralKind(kind: number): boolean {\n return 20000 <= kind && kind < 30000\n}\n\n/** Events are **addressable**, which means that, for each combination of `pubkey`, `kind` and the `d` tag, only the latest event is expected to be stored by relays, older versions are expected to be discarded. */\nexport function isAddressableKind(kind: number): boolean {\n return 30000 <= kind && kind < 40000\n}\n\n/** Classification of the event kind. */\nexport type KindClassification = 'regular' | 'replaceable' | 'ephemeral' | 'parameterized' | 'unknown'\n\n/** Determine the classification of this kind of event if known, or `unknown`. */\nexport function classifyKind(kind: number): KindClassification {\n if (isRegularKind(kind)) return 'regular'\n if (isReplaceableKind(kind)) return 'replaceable'\n if (isEphemeralKind(kind)) return 'ephemeral'\n if (isAddressableKind(kind)) return 'parameterized'\n return 'unknown'\n}\n\nexport function isKind<T extends number>(event: unknown, kind: T | Array<T>): event is NostrEvent & { kind: T } {\n const kindAsArray: number[] = kind instanceof Array ? kind : [kind]\n return (validateEvent(event) && kindAsArray.includes(event.kind)) || false\n}\n\nexport const Metadata = 0\nexport type Metadata = typeof Metadata\nexport const ShortTextNote = 1\nexport type ShortTextNote = typeof ShortTextNote\nexport const RecommendRelay = 2\nexport type RecommendRelay = typeof RecommendRelay\nexport const Contacts = 3\nexport type Contacts = typeof Contacts\nexport const EncryptedDirectMessage = 4\nexport type EncryptedDirectMessage = typeof EncryptedDirectMessage\nexport const EventDeletion = 5\nexport type EventDeletion = typeof EventDeletion\nexport const Repost = 6\nexport type Repost = typeof Repost\nexport const Reaction = 7\nexport type Reaction = typeof Reaction\nexport const BadgeAward = 8\nexport type BadgeAward = typeof BadgeAward\nexport const ChatMessage = 9\nexport type ChatMessage = typeof ChatMessage\nexport const SimpleGroupThreadedReply = 10\nexport type SimpleGroupThreadedReply = typeof SimpleGroupThreadedReply\nexport const ForumThread = 11\nexport type ForumThread = typeof ForumThread\nexport const SimpleGroupReply = 12\nexport type SimpleGroupReply = typeof SimpleGroupReply\nexport const Seal = 13\nexport type Seal = typeof Seal\nexport const PrivateDirectMessage = 14\nexport type PrivateDirectMessage = typeof PrivateDirectMessage\nexport const FileMessage = 15\nexport type FileMessage = typeof FileMessage\nexport const GenericRepost = 16\nexport type GenericRepost = typeof GenericRepost\nexport const ReactionToWebsite = 17\nexport type ReactionToWebsite = typeof ReactionToWebsite\nexport const Photo = 20\nexport type Photo = typeof Photo\nexport const NormalVideo = 21\nexport type NormalVideo = typeof NormalVideo\nexport const ShortVideo = 22\nexport type ShortVideo = typeof ShortVideo\nexport const PublicMessage = 24\nexport type PublicMessage = typeof PublicMessage\nexport const ChannelCreation = 40\nexport type ChannelCreation = typeof ChannelCreation\nexport const ChannelMetadata = 41\nexport type ChannelMetadata = typeof ChannelMetadata\nexport const ChannelMessage = 42\nexport type ChannelMessage = typeof ChannelMessage\nexport const ChannelHideMessage = 43\nexport type ChannelHideMessage = typeof ChannelHideMessage\nexport const ChannelMuteUser = 44\nexport type ChannelMuteUser = typeof ChannelMuteUser\nexport const PodcastEpisode = 54\nexport type PodcastEpisode = typeof PodcastEpisode\nexport const Chess = 64\nexport type Chess = typeof Chess\nexport const MergeRequests = 818\nexport type MergeRequests = typeof MergeRequests\nexport const PollResponse = 1018\nexport type PollResponse = typeof PollResponse\nexport const Bid = 1021\nexport type Bid = typeof Bid\nexport const BidConfirmation = 1022\nexport type BidConfirmation = typeof BidConfirmation\nexport const OpenTimestamps = 1040\nexport type OpenTimestamps = typeof OpenTimestamps\nexport const GiftWrap = 1059\nexport type GiftWrap = typeof GiftWrap\nexport const FileMetadata = 1063\nexport type FileMetadata = typeof FileMetadata\nexport const Poll = 1068\nexport type Poll = typeof Poll\nexport const Comment = 1111\nexport type Comment = typeof Comment\nexport const Voice = 1222\nexport type Voice = typeof Voice\nexport const Scroll = 1227\nexport type Scroll = typeof Scroll\nexport const VoiceComment = 1244\nexport type VoiceComment = typeof VoiceComment\nexport const LiveChatMessage = 1311\nexport type LiveChatMessage = typeof LiveChatMessage\nexport const CodeSnippet = 1337\nexport type CodeSnippet = typeof CodeSnippet\nexport const Patch = 1617\nexport type Patch = typeof Patch\nexport const GitPullRequest = 1618\nexport type GitPullRequest = typeof GitPullRequest\nexport const GitPullRequestUpdate = 1619\nexport type GitPullRequestUpdate = typeof GitPullRequestUpdate\nexport const Issue = 1621\nexport type Issue = typeof Issue\nexport const Reply = 1622\nexport type Reply = typeof Reply\nexport const StatusOpen = 1630\nexport type StatusOpen = typeof StatusOpen\nexport const StatusApplied = 1631\nexport type StatusApplied = typeof StatusApplied\nexport const StatusClosed = 1632\nexport type StatusClosed = typeof StatusClosed\nexport const StatusDraft = 1633\nexport type StatusDraft = typeof StatusDraft\nexport const ProblemTracker = 1971\nexport type ProblemTracker = typeof ProblemTracker\nexport const Report = 1984\nexport type Report = typeof Report\nexport const Reporting = 1984\nexport type Reporting = typeof Reporting\nexport const Label = 1985\nexport type Label = typeof Label\nexport const RelayReviews = 1986\nexport type RelayReviews = typeof RelayReviews\nexport const AIEmbeddings = 1987\nexport type AIEmbeddings = typeof AIEmbeddings\nexport const Torrent = 2003\nexport type Torrent = typeof Torrent\nexport const TorrentComment = 2004\nexport type TorrentComment = typeof TorrentComment\nexport const CoinjoinPool = 2022\nexport type CoinjoinPool = typeof CoinjoinPool\nexport const DecoupledKeyClientAnnouncement = 4454\nexport type DecoupledKeyClientAnnouncement = typeof DecoupledKeyClientAnnouncement\nexport const DecoupledEncryptionKeyDistribution = 4455\nexport type DecoupledEncryptionKeyDistribution = typeof DecoupledEncryptionKeyDistribution\nexport const CommunityPostApproval = 4550\nexport type CommunityPostApproval = typeof CommunityPostApproval\nexport const JobRequest = 5999\nexport type JobRequest = typeof JobRequest\nexport const JobResult = 6999\nexport type JobResult = typeof JobResult\nexport const JobFeedback = 7000\nexport type JobFeedback = typeof JobFeedback\nexport const ReservedCashuWalletTokens = 7374\nexport type ReservedCashuWalletTokens = typeof ReservedCashuWalletTokens\nexport const CashuWalletTokens = 7375\nexport type CashuWalletTokens = typeof CashuWalletTokens\nexport const CashuWalletHistory = 7376\nexport type CashuWalletHistory = typeof CashuWalletHistory\nexport const GeocacheLog = 7516\nexport type GeocacheLog = typeof GeocacheLog\nexport const GeocacheProofOfFind = 7517\nexport type GeocacheProofOfFind = typeof GeocacheProofOfFind\nexport const SimpleGroupPutUser = 9000\nexport type SimpleGroupPutUser = typeof SimpleGroupPutUser\nexport const SimpleGroupRemoveUser = 9001\nexport type SimpleGroupRemoveUser = typeof SimpleGroupRemoveUser\nexport const SimpleGroupEditMetadata = 9002\nexport type SimpleGroupEditMetadata = typeof SimpleGroupEditMetadata\nexport const SimpleGroupDeleteEvent = 9005\nexport type SimpleGroupDeleteEvent = typeof SimpleGroupDeleteEvent\nexport const SimpleGroupCreateGroup = 9007\nexport type SimpleGroupCreateGroup = typeof SimpleGroupCreateGroup\nexport const SimpleGroupDeleteGroup = 9008\nexport type SimpleGroupDeleteGroup = typeof SimpleGroupDeleteGroup\nexport const SimpleGroupCreateInvite = 9009\nexport type SimpleGroupCreateInvite = typeof SimpleGroupCreateInvite\nexport const SimpleGroupJoinRequest = 9021\nexport type SimpleGroupJoinRequest = typeof SimpleGroupJoinRequest\nexport const SimpleGroupLeaveRequest = 9022\nexport type SimpleGroupLeaveRequest = typeof SimpleGroupLeaveRequest\nexport const ZapGoal = 9041\nexport type ZapGoal = typeof ZapGoal\nexport const NutZap = 9321\nexport type NutZap = typeof NutZap\nexport const TidalLogin = 9467\nexport type TidalLogin = typeof TidalLogin\nexport const ZapRequest = 9734\nexport type ZapRequest = typeof ZapRequest\nexport const Zap = 9735\nexport type Zap = typeof Zap\nexport const Highlights = 9802\nexport type Highlights = typeof Highlights\nexport const Mutelist = 10000\nexport type Mutelist = typeof Mutelist\nexport const Pinlist = 10001\nexport type Pinlist = typeof Pinlist\nexport const RelayList = 10002\nexport type RelayList = typeof RelayList\nexport const BookmarkList = 10003\nexport type BookmarkList = typeof BookmarkList\nexport const CommunitiesList = 10004\nexport type CommunitiesList = typeof CommunitiesList\nexport const PublicChatsList = 10005\nexport type PublicChatsList = typeof PublicChatsList\nexport const BlockedRelaysList = 10006\nexport type BlockedRelaysList = typeof BlockedRelaysList\nexport const SearchRelaysList = 10007\nexport type SearchRelaysList = typeof SearchRelaysList\nexport const SimpleGroupList = 10009\nexport type SimpleGroupList = typeof SimpleGroupList\nexport const FavoriteRelays = 10012\nexport type FavoriteRelays = typeof FavoriteRelays\nexport const PrivateEventRelayList = 10013\nexport type PrivateEventRelayList = typeof PrivateEventRelayList\nexport const InterestsList = 10015\nexport type InterestsList = typeof InterestsList\nexport const NutZapInfo = 10019\nexport type NutZapInfo = typeof NutZapInfo\nexport const MediaFollows = 10020\nexport type MediaFollows = typeof MediaFollows\nexport const UserEmojiList = 10030\nexport type UserEmojiList = typeof UserEmojiList\nexport const DecoupledKeyAnnouncement = 10044\nexport type DecoupledKeyAnnouncement = typeof DecoupledKeyAnnouncement\nexport const DirectMessageRelaysList = 10050\nexport type DirectMessageRelaysList = typeof DirectMessageRelaysList\nexport const FavoritePodcasts = 10054\nexport type FavoritePodcasts = typeof FavoritePodcasts\nexport const BlossomServerList = 10063\nexport type BlossomServerList = typeof BlossomServerList\nexport const FileServerPreference = 10096\nexport type FileServerPreference = typeof FileServerPreference\nexport const GoodWikiAuthorList = 10101\nexport type GoodWikiAuthorList = typeof GoodWikiAuthorList\nexport const GoodWikiRelayList = 10102\nexport type GoodWikiRelayList = typeof GoodWikiRelayList\nexport const PodcastMetadata = 10154\nexport type PodcastMetadata = typeof PodcastMetadata\nexport const AuthoredPodcasts = 10164\nexport type AuthoredPodcasts = typeof AuthoredPodcasts\nexport const RelayMonitorAnnouncement = 10166\nexport type RelayMonitorAnnouncement = typeof RelayMonitorAnnouncement\nexport const RoomPresence = 10312\nexport type RoomPresence = typeof RoomPresence\nexport const UserGraspList = 10317\nexport type UserGraspList = typeof UserGraspList\nexport const ProxyAnnouncement = 10377\nexport type ProxyAnnouncement = typeof ProxyAnnouncement\nexport const TransportMethodAnnouncement = 11111\nexport type TransportMethodAnnouncement = typeof TransportMethodAnnouncement\nexport const NWCWalletInfo = 13194\nexport type NWCWalletInfo = typeof NWCWalletInfo\nexport const NsiteRoot = 15128\nexport type NsiteRoot = typeof NsiteRoot\nexport const CashuWalletEvent = 17375\nexport type CashuWalletEvent = typeof CashuWalletEvent\nexport const LightningPubRPC = 21000\nexport type LightningPubRPC = typeof LightningPubRPC\nexport const ClientAuth = 22242\nexport type ClientAuth = typeof ClientAuth\nexport const NWCWalletRequest = 23194\nexport type NWCWalletRequest = typeof NWCWalletRequest\nexport const NWCWalletResponse = 23195\nexport type NWCWalletResponse = typeof NWCWalletResponse\nexport const NostrConnect = 24133\nexport type NostrConnect = typeof NostrConnect\nexport const BlobsAuth = 24242\nexport type BlobsAuth = typeof BlobsAuth\nexport const HTTPAuth = 27235\nexport type HTTPAuth = typeof HTTPAuth\nexport const Followsets = 30000\nexport type Followsets = typeof Followsets\nexport const Genericlists = 30001\nexport type Genericlists = typeof Genericlists\nexport const Relaysets = 30002\nexport type Relaysets = typeof Relaysets\nexport const Bookmarksets = 30003\nexport type Bookmarksets = typeof Bookmarksets\nexport const Curationsets = 30004\nexport type Curationsets = typeof Curationsets\nexport const CuratedVideoSets = 30005\nexport type CuratedVideoSets = typeof CuratedVideoSets\nexport const MuteSets = 30007\nexport type MuteSets = typeof MuteSets\nexport const ProfileBadges = 30008\nexport type ProfileBadges = typeof ProfileBadges\nexport const BadgeDefinition = 30009\nexport type BadgeDefinition = typeof BadgeDefinition\nexport const Interestsets = 30015\nexport type Interestsets = typeof Interestsets\nexport const CreateOrUpdateStall = 30017\nexport type CreateOrUpdateStall = typeof CreateOrUpdateStall\nexport const CreateOrUpdateProduct = 30018\nexport type CreateOrUpdateProduct = typeof CreateOrUpdateProduct\nexport const MarketplaceUI = 30019\nexport type MarketplaceUI = typeof MarketplaceUI\nexport const ProductSoldAsAuction = 30020\nexport type ProductSoldAsAuction = typeof ProductSoldAsAuction\nexport const LongFormArticle = 30023\nexport type LongFormArticle = typeof LongFormArticle\nexport const DraftLong = 30024\nexport type DraftLong = typeof DraftLong\nexport const Emojisets = 30030\nexport type Emojisets = typeof Emojisets\nexport const ModularArticleHeader = 30040\nexport type ModularArticleHeader = typeof ModularArticleHeader\nexport const ModularArticleContent = 30041\nexport type ModularArticleContent = typeof ModularArticleContent\nexport const ReleaseArtifactSets = 30063\nexport type ReleaseArtifactSets = typeof ReleaseArtifactSets\nexport const Application = 30078\nexport type Application = typeof Application\nexport const RelayDiscovery = 30166\nexport type RelayDiscovery = typeof RelayDiscovery\nexport const AppCurationSet = 30267\nexport type AppCurationSet = typeof AppCurationSet\nexport const LiveEvent = 30311\nexport type LiveEvent = typeof LiveEvent\nexport const InteractiveRoom = 30312\nexport type InteractiveRoom = typeof InteractiveRoom\nexport const ConferenceEvent = 30313\nexport type ConferenceEvent = typeof ConferenceEvent\nexport const UserStatuses = 30315\nexport type UserStatuses = typeof UserStatuses\nexport const SlideSet = 30388\nexport type SlideSet = typeof SlideSet\nexport const ClassifiedListing = 30402\nexport type ClassifiedListing = typeof ClassifiedListing\nexport const DraftClassifiedListing = 30403\nexport type DraftClassifiedListing = typeof DraftClassifiedListing\nexport const RepositoryAnnouncement = 30617\nexport type RepositoryAnnouncement = typeof RepositoryAnnouncement\nexport const RepositoryState = 30618\nexport type RepositoryState = typeof RepositoryState\nexport const WikiArticle = 30818\nexport type WikiArticle = typeof WikiArticle\nexport const Redirects = 30819\nexport type Redirects = typeof Redirects\nexport const DraftEvent = 31234\nexport type DraftEvent = typeof DraftEvent\nexport const LinkSet = 31388\nexport type LinkSet = typeof LinkSet\nexport const Feed = 31890\nexport type Feed = typeof Feed\nexport const Date = 31922\nexport type Date = typeof Date\nexport const Time = 31923\nexport type Time = typeof Time\nexport const Calendar = 31924\nexport type Calendar = typeof Calendar\nexport const CalendarEventRSVP = 31925\nexport type CalendarEventRSVP = typeof CalendarEventRSVP\nexport const RelayReview = 31987\nexport type RelayReview = typeof RelayReview\nexport const Handlerrecommendation = 31989\nexport type Handlerrecommendation = typeof Handlerrecommendation\nexport const Handlerinformation = 31990\nexport type Handlerinformation = typeof Handlerinformation\nexport const SoftwareApplication = 32267\nexport type SoftwareApplication = typeof SoftwareApplication\nexport const LegacyNsiteFile = 34128\nexport type LegacyNsiteFile = typeof LegacyNsiteFile\nexport const VideoViewEvent = 34237\nexport type VideoViewEvent = typeof VideoViewEvent\nexport const CommunityDefinition = 34550\nexport type CommunityDefinition = typeof CommunityDefinition\nexport const NsiteNamed = 35128\nexport type NsiteNamed = typeof NsiteNamed\nexport const GeocacheListing = 37515\nexport type GeocacheListing = typeof GeocacheListing\nexport const GeocacheLogEntry = 37516\nexport type GeocacheLogEntry = typeof GeocacheLogEntry\nexport const CashuMintAnnouncement = 38172\nexport type CashuMintAnnouncement = typeof CashuMintAnnouncement\nexport const FedimintAnnouncement = 38173\nexport type FedimintAnnouncement = typeof FedimintAnnouncement\nexport const PeerToPeerOrderEvents = 38383\nexport type PeerToPeerOrderEvents = typeof PeerToPeerOrderEvents\nexport const GroupMetadata = 39000\nexport type GroupMetadata = typeof GroupMetadata\nexport const SimpleGroupAdmins = 39001\nexport type SimpleGroupAdmins = typeof SimpleGroupAdmins\nexport const SimpleGroupMembers = 39002\nexport type SimpleGroupMembers = typeof SimpleGroupMembers\nexport const SimpleGroupRoles = 39003\nexport type SimpleGroupRoles = typeof SimpleGroupRoles\nexport const SimpleGroupLiveKitParticipants = 39004\nexport type SimpleGroupLiveKitParticipants = typeof SimpleGroupLiveKitParticipants\nexport const StarterPacks = 39089\nexport type StarterPacks = typeof StarterPacks\nexport const MediaStarterPacks = 39092\nexport type MediaStarterPacks = typeof MediaStarterPacks\nexport const WebBookmarks = 39701\nexport type WebBookmarks = typeof WebBookmarks\n"],
|
|
5
|
+
"mappings": ";AAQO,IAAM,iBAAiB,OAAO,UAAU;AAsB/C,IAAM,WAAW,CAAC,QAAiD,eAAe;AAE3E,SAAS,cAAiB,OAAsC;AACrE,MAAI,CAAC,SAAS,KAAK;AAAG,WAAO;AAC7B,MAAI,OAAO,MAAM,SAAS;AAAU,WAAO;AAC3C,MAAI,OAAO,MAAM,YAAY;AAAU,WAAO;AAC9C,MAAI,OAAO,MAAM,eAAe;AAAU,WAAO;AACjD,MAAI,OAAO,MAAM,WAAW;AAAU,WAAO;AAC7C,MAAI,CAAC,MAAM,OAAO,MAAM,gBAAgB;AAAG,WAAO;AAElD,MAAI,CAAC,MAAM,QAAQ,MAAM,IAAI;AAAG,WAAO;AACvC,WAAS,IAAI,GAAG,IAAI,MAAM,KAAK,QAAQ,KAAK;AAC1C,QAAI,MAAM,MAAM,KAAK;AACrB,QAAI,CAAC,MAAM,QAAQ,GAAG;AAAG,aAAO;AAChC,aAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,UAAI,OAAO,IAAI,OAAO;AAAU,eAAO;AAAA,IACzC;AAAA,EACF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AAElB,IAAM,kBAAkB;AAExB,IAAM,kBAAkB;AAExB,IAAM,eAAe;AAErB,IAAM,WAAW;AAEjB,IAAM,oBAAoB;AAE1B,IAAM,yBAAyB;AAE/B,IAAM,yBAAyB;AAE/B,IAAM,kBAAkB;AAExB,IAAM,cAAc;AAEpB,IAAM,YAAY;AAElB,IAAM,aAAa;AAEnB,IAAM,UAAU;AAEhB,IAAM,OAAO;AAEb,IAAM,OAAO;AAEb,IAAM,OAAO;AAEb,IAAM,WAAW;AAEjB,IAAM,oBAAoB;AAE1B,IAAM,cAAc;AAEpB,IAAM,wBAAwB;AAE9B,IAAM,qBAAqB;AAE3B,IAAM,sBAAsB;AAE5B,IAAM,kBAAkB;AAExB,IAAM,iBAAiB;AAEvB,IAAM,sBAAsB;AAE5B,IAAM,aAAa;AAEnB,IAAM,kBAAkB;AAExB,IAAM,mBAAmB;AAEzB,IAAM,wBAAwB;AAE9B,IAAM,uBAAuB;AAE7B,IAAM,wBAAwB;AAE9B,IAAM,gBAAgB;AAEtB,IAAM,oBAAoB;AAE1B,IAAM,qBAAqB;AAE3B,IAAM,mBAAmB;AAEzB,IAAM,iCAAiC;AAEvC,IAAM,eAAe;AAErB,IAAM,oBAAoB;AAE1B,IAAM,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/lib/esm/nip10.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// nip10.ts
|
|
2
|
+
var HEX64 = /^[0-9a-fA-F]{64}$/;
|
|
2
3
|
function parse(event) {
|
|
3
4
|
const result = {
|
|
4
5
|
reply: void 0,
|
|
@@ -11,12 +12,12 @@ function parse(event) {
|
|
|
11
12
|
let maybeRoot;
|
|
12
13
|
for (let i = event.tags.length - 1; i >= 0; i--) {
|
|
13
14
|
const tag = event.tags[i];
|
|
14
|
-
if (tag[0] === "e" && tag[1]) {
|
|
15
|
+
if (tag[0] === "e" && tag[1] && HEX64.test(tag[1])) {
|
|
15
16
|
const [_, eTagEventId, eTagRelayUrl, eTagMarker, eTagAuthor] = tag;
|
|
16
17
|
const eventPointer = {
|
|
17
18
|
id: eTagEventId,
|
|
18
19
|
relays: eTagRelayUrl ? [eTagRelayUrl] : [],
|
|
19
|
-
author: eTagAuthor
|
|
20
|
+
author: eTagAuthor && HEX64.test(eTagAuthor) ? eTagAuthor : void 0
|
|
20
21
|
};
|
|
21
22
|
if (eTagMarker === "root") {
|
|
22
23
|
result.root = eventPointer;
|
|
@@ -38,14 +39,14 @@ function parse(event) {
|
|
|
38
39
|
result.mentions.push(eventPointer);
|
|
39
40
|
continue;
|
|
40
41
|
}
|
|
41
|
-
if (tag[0] === "q" && tag[1]) {
|
|
42
|
+
if (tag[0] === "q" && tag[1] && HEX64.test(tag[1])) {
|
|
42
43
|
const [_, eTagEventId, eTagRelayUrl] = tag;
|
|
43
44
|
result.quotes.push({
|
|
44
45
|
id: eTagEventId,
|
|
45
46
|
relays: eTagRelayUrl ? [eTagRelayUrl] : []
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
|
-
if (tag[0] === "p" && tag[1]) {
|
|
49
|
+
if (tag[0] === "p" && tag[1] && HEX64.test(tag[1])) {
|
|
49
50
|
result.profiles.push({
|
|
50
51
|
pubkey: tag[1],
|
|
51
52
|
relays: tag[2] ? [tag[2]] : []
|
package/lib/esm/nip10.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../nip10.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Event } from './core.ts'\nimport type { EventPointer, ProfilePointer } from './nip19.ts'\n\nexport function parse(event: Pick<Event, 'tags'>): {\n /**\n * Pointer to the root of the thread.\n */\n root: EventPointer | undefined\n\n /**\n * Pointer to a \"parent\" event that parsed event replies to (responded to).\n */\n reply: EventPointer | undefined\n\n /**\n * Pointers to events that may or may not be in the reply chain.\n */\n mentions: EventPointer[]\n\n /**\n * Pointers to events that were directly quoted.\n */\n quotes: EventPointer[]\n\n /**\n * List of pubkeys that are involved in the thread in no particular order.\n */\n profiles: ProfilePointer[]\n} {\n const result: ReturnType<typeof parse> = {\n reply: undefined,\n root: undefined,\n mentions: [],\n profiles: [],\n quotes: [],\n }\n\n let maybeParent: EventPointer | undefined\n let maybeRoot: EventPointer | undefined\n\n for (let i = event.tags.length - 1; i >= 0; i--) {\n const tag = event.tags[i]\n\n if (tag[0] === 'e' && tag[1]) {\n const [_, eTagEventId, eTagRelayUrl, eTagMarker, eTagAuthor] = tag as [\n string,\n string,\n undefined | string,\n undefined | string,\n undefined | string,\n ]\n\n const eventPointer: EventPointer = {\n id: eTagEventId,\n relays: eTagRelayUrl ? [eTagRelayUrl] : [],\n author: eTagAuthor,\n }\n\n if (eTagMarker === 'root') {\n result.root = eventPointer\n continue\n }\n\n if (eTagMarker === 'reply') {\n result.reply = eventPointer\n continue\n }\n\n if (eTagMarker === 'mention') {\n result.mentions.push(eventPointer)\n continue\n }\n\n if (!maybeParent) {\n maybeParent = eventPointer\n } else {\n maybeRoot = eventPointer\n }\n\n result.mentions.push(eventPointer)\n continue\n }\n\n if (tag[0] === 'q' && tag[1]) {\n const [_, eTagEventId, eTagRelayUrl] = tag as [string, string, undefined | string]\n result.quotes.push({\n id: eTagEventId,\n relays: eTagRelayUrl ? [eTagRelayUrl] : [],\n })\n }\n\n if (tag[0] === 'p' && tag[1]) {\n result.profiles.push({\n pubkey: tag[1],\n relays: tag[2] ? [tag[2]] : [],\n })\n continue\n }\n }\n\n // get legacy (positional) markers, set reply to root and vice-versa if one of them is missing\n if (!result.root) {\n result.root = maybeRoot || maybeParent || result.reply\n }\n if (!result.reply) {\n result.reply = maybeParent || result.root\n }\n\n // remove root and reply from mentions, inherit relay hints from authors if any\n ;[result.reply, result.root].forEach(ref => {\n if (!ref) return\n\n let idx = result.mentions.indexOf(ref)\n if (idx !== -1) {\n result.mentions.splice(idx, 1)\n }\n if (ref.author) {\n let author = result.profiles.find(p => p.pubkey === ref.author)\n if (author && author.relays) {\n if (!ref.relays) {\n ref.relays = []\n }\n author.relays.forEach(url => {\n if (ref.relays!?.indexOf(url) === -1) ref.relays!.push(url)\n })\n author.relays = ref.relays\n }\n }\n })\n\n result.mentions.forEach(ref => {\n if (ref!.author) {\n let author = result.profiles.find(p => p.pubkey === ref.author)\n if (author && author.relays) {\n if (!ref.relays) {\n ref.relays = []\n }\n author.relays.forEach(url => {\n if (ref.relays!.indexOf(url) === -1) ref.relays!.push(url)\n })\n author.relays = ref.relays\n }\n }\n })\n\n return result\n}\n"],
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["import type { Event } from './core.ts'\nimport type { EventPointer, ProfilePointer } from './nip19.ts'\n\nconst HEX64 = /^[0-9a-fA-F]{64}$/\n\nexport function parse(event: Pick<Event, 'tags'>): {\n /**\n * Pointer to the root of the thread.\n */\n root: EventPointer | undefined\n\n /**\n * Pointer to a \"parent\" event that parsed event replies to (responded to).\n */\n reply: EventPointer | undefined\n\n /**\n * Pointers to events that may or may not be in the reply chain.\n */\n mentions: EventPointer[]\n\n /**\n * Pointers to events that were directly quoted.\n */\n quotes: EventPointer[]\n\n /**\n * List of pubkeys that are involved in the thread in no particular order.\n */\n profiles: ProfilePointer[]\n} {\n const result: ReturnType<typeof parse> = {\n reply: undefined,\n root: undefined,\n mentions: [],\n profiles: [],\n quotes: [],\n }\n\n let maybeParent: EventPointer | undefined\n let maybeRoot: EventPointer | undefined\n\n for (let i = event.tags.length - 1; i >= 0; i--) {\n const tag = event.tags[i]\n\n if (tag[0] === 'e' && tag[1] && HEX64.test(tag[1])) {\n const [_, eTagEventId, eTagRelayUrl, eTagMarker, eTagAuthor] = tag as [\n string,\n string,\n undefined | string,\n undefined | string,\n undefined | string,\n ]\n\n const eventPointer: EventPointer = {\n id: eTagEventId,\n relays: eTagRelayUrl ? [eTagRelayUrl] : [],\n author: eTagAuthor && HEX64.test(eTagAuthor) ? eTagAuthor : undefined,\n }\n\n if (eTagMarker === 'root') {\n result.root = eventPointer\n continue\n }\n\n if (eTagMarker === 'reply') {\n result.reply = eventPointer\n continue\n }\n\n if (eTagMarker === 'mention') {\n result.mentions.push(eventPointer)\n continue\n }\n\n if (!maybeParent) {\n maybeParent = eventPointer\n } else {\n maybeRoot = eventPointer\n }\n\n result.mentions.push(eventPointer)\n continue\n }\n\n if (tag[0] === 'q' && tag[1] && HEX64.test(tag[1])) {\n const [_, eTagEventId, eTagRelayUrl] = tag as [string, string, undefined | string]\n result.quotes.push({\n id: eTagEventId,\n relays: eTagRelayUrl ? [eTagRelayUrl] : [],\n })\n }\n\n if (tag[0] === 'p' && tag[1] && HEX64.test(tag[1])) {\n result.profiles.push({\n pubkey: tag[1],\n relays: tag[2] ? [tag[2]] : [],\n })\n continue\n }\n }\n\n // get legacy (positional) markers, set reply to root and vice-versa if one of them is missing\n if (!result.root) {\n result.root = maybeRoot || maybeParent || result.reply\n }\n if (!result.reply) {\n result.reply = maybeParent || result.root\n }\n\n // remove root and reply from mentions, inherit relay hints from authors if any\n ;[result.reply, result.root].forEach(ref => {\n if (!ref) return\n\n let idx = result.mentions.indexOf(ref)\n if (idx !== -1) {\n result.mentions.splice(idx, 1)\n }\n if (ref.author) {\n let author = result.profiles.find(p => p.pubkey === ref.author)\n if (author && author.relays) {\n if (!ref.relays) {\n ref.relays = []\n }\n author.relays.forEach(url => {\n if (ref.relays!?.indexOf(url) === -1) ref.relays!.push(url)\n })\n author.relays = ref.relays\n }\n }\n })\n\n result.mentions.forEach(ref => {\n if (ref!.author) {\n let author = result.profiles.find(p => p.pubkey === ref.author)\n if (author && author.relays) {\n if (!ref.relays) {\n ref.relays = []\n }\n author.relays.forEach(url => {\n if (ref.relays!.indexOf(url) === -1) ref.relays!.push(url)\n })\n author.relays = ref.relays\n }\n }\n })\n\n return result\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,IAAM,QAAQ;AAEP,SAAS,MAAM,OAyBpB;AACA,QAAM,SAAmC;AAAA,IACvC,OAAO;AAAA,IACP,MAAM;A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