spasm.js 1.0.0 → 1.0.1
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/README.md +39 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,6 +23,24 @@ export type UnknownEvent =
|
|
|
23
23
|
SpasmEvent
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
After converting an unknown event to the Spasm event, you can now easily access common properties across most public messaging formats such as:
|
|
27
|
+
- `spasmEvent.eventId`
|
|
28
|
+
- `spasmEvent.author`
|
|
29
|
+
- `spasmEvent.action`
|
|
30
|
+
- `spasmEvent.content`
|
|
31
|
+
- `spasmEvent.timestamp`
|
|
32
|
+
- `spasmEvent.signature`
|
|
33
|
+
- `spasmEvent.parentEvent`
|
|
34
|
+
|
|
35
|
+
The original event will be stored under:
|
|
36
|
+
- `spasmEvent.originalEventObject`
|
|
37
|
+
- `spasmEvent.originalEventString`
|
|
38
|
+
|
|
39
|
+
The event metadata can be found under:
|
|
40
|
+
- `spasmEvent.meta`
|
|
41
|
+
|
|
42
|
+
See the full list of properties of `SpasmEvent` at `./src.ts/types/interfaces.ts`.
|
|
43
|
+
|
|
26
44
|
### Features
|
|
27
45
|
|
|
28
46
|
- identify web2 posts and web3 events
|
|
@@ -195,6 +213,7 @@ export const event: NostrSpasmEventSignedOpened = {
|
|
|
195
213
|
pubkey: "2d2d9f19a98e533c27500e5f056a2a56db8fe92393e7a2135db63ad300486f42",
|
|
196
214
|
id: "db300d320853b25b57fa03c586d18f69ad9786ec5e21114253fc3762b22a5651",
|
|
197
215
|
sig: "db60516accfc025582bf556e3c7660c89e3982d2a656201aaea4189c6d3e3779b202c60302e55ad782ca711df20550384516abe4d7387470bc83ac757ed8f0f1"
|
|
216
|
+
}
|
|
198
217
|
```
|
|
199
218
|
|
|
200
219
|
Here is the result of `identifyEvent(event)`
|
|
@@ -223,33 +242,34 @@ const spasmEvent: SpasmEvent = {
|
|
|
223
242
|
meta: {
|
|
224
243
|
baseProtocol: 'nostr',
|
|
225
244
|
hasExtraSpasmFields: true,
|
|
226
|
-
convertedFrom: 'NostrSpasmEventSignedOpened',
|
|
227
245
|
extraSpasmFieldsVersion: '1.0.0',
|
|
228
|
-
|
|
246
|
+
convertedFrom: 'NostrSpasmEventSignedOpened',
|
|
229
247
|
privateKeyType: 'nostr'
|
|
248
|
+
license: 'SPDX-License-Identifier: CC0-1.0]',
|
|
230
249
|
},
|
|
231
250
|
spasmVersion: '1.0.0',
|
|
232
|
-
eventId: '
|
|
233
|
-
|
|
234
|
-
|
|
251
|
+
eventId: 'db60516accfc025582bf556e3c7660c89e3982d2a656201aaea4189c6d3e3779b202c60302e55ad782ca711df20550384516abe4d7387470bc83ac757ed8f0f1'
|
|
252
|
+
action: 'post',
|
|
253
|
+
title: 'Nostr Spasm genesis',
|
|
254
|
+
content: 'Walled gardens became prisons, and Spasm is the second step towards tearing down the prison walls.',
|
|
255
|
+
timestamp: 1705462957,
|
|
235
256
|
author: 'npub195ke7xdf3efncf6spe0s26322mdcl6frj0n6yy6akcadxqzgdapqjsm60y',
|
|
236
|
-
action: 'reply',
|
|
237
257
|
originalEventObject: {
|
|
238
258
|
kind: 1,
|
|
239
|
-
created_at:
|
|
240
|
-
tags:
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
259
|
+
created_at: 1705462957,
|
|
260
|
+
tags:[
|
|
261
|
+
["license","SPDX-License-Identifier: CC0-1.0"],
|
|
262
|
+
["spasm_version","1.0.0"],
|
|
263
|
+
["spasm_action","post"],
|
|
264
|
+
["spasm_title","Nostr Spasm genesis"]
|
|
265
|
+
],
|
|
266
|
+
content: "Walled gardens became prisons, and Spasm is the second step towards tearing down the prison walls.",
|
|
267
|
+
pubkey: "2d2d9f19a98e533c27500e5f056a2a56db8fe92393e7a2135db63ad300486f42",
|
|
268
|
+
id: "db300d320853b25b57fa03c586d18f69ad9786ec5e21114253fc3762b22a5651",
|
|
269
|
+
sig: "db60516accfc025582bf556e3c7660c89e3982d2a656201aaea4189c6d3e3779b202c60302e55ad782ca711df20550384516abe4d7387470bc83ac757ed8f0f1"
|
|
245
270
|
},
|
|
246
|
-
originalEventString: '{"kind":1,"created_at":
|
|
247
|
-
|
|
248
|
-
ff95ae572af25dd3e204a71b"]],"content":"To the SPASM!","pubkey":"2d2d9f19a98e533c27500e5f056a2a56db8fe92393e7a2135db63ad300486f42","id":"4ca9b330a
|
|
249
|
-
d821509acbfe90ebcc25f267e02718377eb4d831bc5bb9482c85f","sig":"2f8f195c70070f0c434c397da2fb44b1196994a2f24515d76477a8c8b5a4f289fcc5287d8163cbadfee
|
|
250
|
-
af55450fa9fa6b15ac732877d732e98e2be10acb290"}',
|
|
251
|
-
parentEvent: '0xbd934a01dc3bd9bb183bda807d35e61accf7396c527b8a3d029c20c00b294cf029997be953772da32483b077eea856e6bafcae7a2aff95ae572af25dd3e204a71b',
|
|
252
|
-
signature: '2f8f195c70070f0c434c397da2fb44b1196994a2f24515d76477a8c8b5a4f289fcc5287d8163cbadfee29af55450fa9fa6b15ac732877d732e98e2be10acb290'
|
|
271
|
+
originalEventString: '{"kind":1,"created_at":1705462957,"tags":[["license","SPDX-License-Identifier: CC0-1.0"],["spasm_version","1.0.0"],["spasm_action","post"],["spasm_title","Nostr Spasm genesis"]],"content":"Walled gardens became prisons, and Spasm is the second step towards tearing down the prison walls.","pubkey":"2d2d9f19a98e533c27500e5f056a2a56db8fe92393e7a2135db63ad300486f42","id":"db300d320853b25b57fa03c586d18f69ad9786ec5e21114253fc3762b22a5651","sig":"db60516accfc025582bf556e3c7660c89e3982d2a656201aaea4189c6d3e3779b202c60302e55ad782ca711df20550384516abe4d7387470bc83ac757ed8f0f1"}',
|
|
272
|
+
signature: 'db60516accfc025582bf556e3c7660c89e3982d2a656201aaea4189c6d3e3779b202c60302e55ad782ca711df20550384516abe4d7387470bc83ac757ed8f0f1'
|
|
253
273
|
}
|
|
254
274
|
```
|
|
255
275
|
|