spasm.js 2.0.0-beta.13 → 2.0.0-beta.15
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.commonjs/convert/convertToNostr.d.ts +3 -2
- package/lib.commonjs/convert/convertToNostr.d.ts.map +1 -1
- package/lib.commonjs/convert/convertToNostr.js +398 -29
- package/lib.commonjs/convert/convertToNostr.js.map +1 -1
- package/lib.commonjs/convert/convertToSpasm.d.ts +4 -0
- package/lib.commonjs/convert/convertToSpasm.d.ts.map +1 -1
- package/lib.commonjs/convert/convertToSpasm.js +546 -19
- package/lib.commonjs/convert/convertToSpasm.js.map +1 -1
- package/lib.commonjs/convert/convertToSpasmEventEnvelope.d.ts.map +1 -1
- package/lib.commonjs/convert/convertToSpasmEventEnvelope.js.map +1 -1
- package/lib.commonjs/identify/identifyEvent.d.ts +5 -5
- package/lib.commonjs/identify/identifyEvent.d.ts.map +1 -1
- package/lib.commonjs/identify/identifyEvent.js +11 -0
- package/lib.commonjs/identify/identifyEvent.js.map +1 -1
- package/lib.commonjs/types/interfaces.d.ts +3 -0
- package/lib.commonjs/types/interfaces.d.ts.map +1 -1
- package/lib.commonjs/types/interfaces.js.map +1 -1
- package/lib.commonjs/utils/utils.d.ts +9 -2
- package/lib.commonjs/utils/utils.d.ts.map +1 -1
- package/lib.commonjs/utils/utils.js +87 -10
- package/lib.commonjs/utils/utils.js.map +1 -1
- package/lib.esm/convert/convertToNostr.d.ts +3 -2
- package/lib.esm/convert/convertToNostr.d.ts.map +1 -1
- package/lib.esm/convert/convertToNostr.js +401 -29
- package/lib.esm/convert/convertToNostr.js.map +1 -1
- package/lib.esm/convert/convertToSpasm.d.ts +4 -0
- package/lib.esm/convert/convertToSpasm.d.ts.map +1 -1
- package/lib.esm/convert/convertToSpasm.js +542 -19
- package/lib.esm/convert/convertToSpasm.js.map +1 -1
- package/lib.esm/convert/convertToSpasmEventEnvelope.d.ts.map +1 -1
- package/lib.esm/convert/convertToSpasmEventEnvelope.js.map +1 -1
- package/lib.esm/identify/identifyEvent.d.ts +5 -5
- package/lib.esm/identify/identifyEvent.d.ts.map +1 -1
- package/lib.esm/identify/identifyEvent.js +11 -0
- package/lib.esm/identify/identifyEvent.js.map +1 -1
- package/lib.esm/types/interfaces.d.ts +3 -0
- package/lib.esm/types/interfaces.d.ts.map +1 -1
- package/lib.esm/types/interfaces.js.map +1 -1
- package/lib.esm/utils/utils.d.ts +9 -2
- package/lib.esm/utils/utils.d.ts.map +1 -1
- package/lib.esm/utils/utils.js +78 -8
- package/lib.esm/utils/utils.js.map +1 -1
- package/package.json +1 -1
- package/src.ts/convert/convertToNostr.ts +523 -43
- package/src.ts/convert/convertToSpasm.ts +672 -32
- package/src.ts/convert/convertToSpasmEventEnvelope.ts +1 -3
- package/src.ts/identify/identifyEvent.ts +19 -5
- package/src.ts/types/interfaces.ts +9 -0
- package/src.ts/utils/utils.ts +112 -9
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { NostrEvent, NostrEventSignedOpened, UnknownEventV2 } from "../types/interfaces.js";
|
|
2
|
-
export declare const convertToNostr: (unknownEvent: UnknownEventV2) => NostrEvent | NostrEventSignedOpened | null;
|
|
1
|
+
import { NostrEvent, NostrEventSignedOpened, NostrSpasmEvent, NostrSpasmEventSignedOpened, SpasmEventV2, UnknownEventV2 } from "../types/interfaces.js";
|
|
2
|
+
export declare const convertToNostr: (unknownEvent: UnknownEventV2, nostrSpasmVersion?: "2.0.0") => NostrEvent | NostrEventSignedOpened | NostrSpasmEvent | NostrSpasmEventSignedOpened | null;
|
|
3
|
+
export declare const convertSpasmEventV2ToNostrSpasmV2: (spasmEventV2: SpasmEventV2) => NostrEvent | NostrEventSignedOpened | NostrSpasmEvent | NostrSpasmEventSignedOpened | null;
|
|
3
4
|
//# sourceMappingURL=convertToNostr.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertToNostr.d.ts","sourceRoot":"","sources":["../../src.ts/convert/convertToNostr.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"convertToNostr.d.ts","sourceRoot":"","sources":["../../src.ts/convert/convertToNostr.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,UAAU,EACV,sBAAsB,EACtB,eAAe,EACf,2BAA2B,EAQ3B,YAAY,EACZ,cAAc,EACf,MAAM,wBAAwB,CAAA;AAe/B,eAAO,MAAM,cAAc,iBACX,cAAc,sBACT,OAAO,KAE1B,UAAU,GACV,sBAAsB,GACtB,eAAe,GACf,2BAA2B,GAC3B,IAoBD,CAAA;AAED,eAAO,MAAM,iCAAiC,iBAC9B,YAAY,KAE1B,UAAU,GACV,sBAAsB,GACtB,eAAe,GACf,2BAA2B,GAC3B,IAsLD,CAAA"}
|
|
@@ -1,57 +1,426 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertToNostr = void 0;
|
|
3
|
+
exports.convertSpasmEventV2ToNostrSpasmV2 = exports.convertToNostr = void 0;
|
|
4
|
+
const js_sha256_v0_1 = require("js-sha256-v0");
|
|
5
|
+
const identifyEvent_js_1 = require("../identify/identifyEvent.js");
|
|
4
6
|
const nostrUtils_js_1 = require("../utils/nostrUtils.js");
|
|
5
7
|
const utils_js_1 = require("../utils/utils.js");
|
|
6
|
-
// import { convertToSpasm } from "./convertToSpasm.js"
|
|
7
8
|
// TODO convertManyToNostr()
|
|
8
|
-
const convertToNostr = (unknownEvent) => {
|
|
9
|
+
const convertToNostr = (unknownEvent, nostrSpasmVersion = "2.0.0") => {
|
|
10
|
+
// Already Nostr event
|
|
11
|
+
if ((0, identifyEvent_js_1.isNostrEvent)(unknownEvent)) {
|
|
12
|
+
return unknownEvent;
|
|
13
|
+
}
|
|
9
14
|
const spasmEventV2 = (0, utils_js_1.toBeSpasmEventV2)(unknownEvent);
|
|
10
15
|
if (!spasmEventV2)
|
|
11
16
|
return null;
|
|
12
|
-
|
|
13
|
-
|
|
17
|
+
if (spasmEventV2.type === "SpasmEventV2" &&
|
|
18
|
+
nostrSpasmVersion === "2.0.0") {
|
|
19
|
+
const NostrSpasmEventV2 = (0, exports.convertSpasmEventV2ToNostrSpasmV2)(spasmEventV2);
|
|
20
|
+
return NostrSpasmEventV2;
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
};
|
|
24
|
+
exports.convertToNostr = convertToNostr;
|
|
25
|
+
const convertSpasmEventV2ToNostrSpasmV2 = (spasmEventV2) => {
|
|
26
|
+
if (!("timestamp" in spasmEventV2) || !spasmEventV2.timestamp ||
|
|
27
|
+
!(0, utils_js_1.isStringOrNumber)(spasmEventV2.timestamp) ||
|
|
28
|
+
!Number(spasmEventV2.timestamp)) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
// const nostrEvent: Partial<NostrEventSignedOpened> = {
|
|
32
|
+
const nostrEvent = {
|
|
33
|
+
// Some Spasm events might have no content
|
|
34
|
+
content: "",
|
|
35
|
+
created_at: Number(spasmEventV2.timestamp),
|
|
36
|
+
// Kind and other values might be changed below
|
|
37
|
+
kind: 1,
|
|
38
|
+
id: "",
|
|
39
|
+
pubkey: "",
|
|
40
|
+
tags: [
|
|
41
|
+
// ["spasm_version","2.0.0"],
|
|
42
|
+
// ["nostr_spasm_version", "2.0.0"]
|
|
43
|
+
]
|
|
14
44
|
};
|
|
45
|
+
// content
|
|
15
46
|
if ("content" in spasmEventV2 && spasmEventV2.content &&
|
|
16
47
|
typeof (spasmEventV2.content) === "string") {
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
if ("timestamp" in spasmEventV2 && spasmEventV2.timestamp &&
|
|
20
|
-
(0, utils_js_1.isStringOrNumber)(spasmEventV2.timestamp) &&
|
|
21
|
-
Number(spasmEventV2.timestamp)) {
|
|
22
|
-
nostrEventPartial.created_at = Number(spasmEventV2.timestamp);
|
|
48
|
+
nostrEvent.content = spasmEventV2.content;
|
|
23
49
|
}
|
|
50
|
+
// kind
|
|
24
51
|
if ("action" in spasmEventV2 && spasmEventV2.action &&
|
|
25
52
|
(0, utils_js_1.isStringOrNumber)(spasmEventV2.action)) {
|
|
26
|
-
if (spasmEventV2.action === "post"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
53
|
+
if (spasmEventV2.action === "post") {
|
|
54
|
+
nostrEvent.kind = 1;
|
|
55
|
+
nostrEvent.tags?.push(["spasm_action", "post"]);
|
|
56
|
+
}
|
|
57
|
+
else if (spasmEventV2.action === "reply") {
|
|
58
|
+
nostrEvent.kind = 1;
|
|
59
|
+
nostrEvent.tags?.push(["spasm_action", "reply"]);
|
|
31
60
|
}
|
|
61
|
+
else if (spasmEventV2.action === "react") {
|
|
62
|
+
nostrEvent.kind = 1;
|
|
63
|
+
nostrEvent.tags?.push(["spasm_action", "react"]);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const nostrSigners = (0, utils_js_1.getAllNostrSigners)(spasmEventV2);
|
|
67
|
+
if (nostrSigners && (0, utils_js_1.isArrayOfStrings)(nostrSigners) &&
|
|
68
|
+
nostrSigners[0] && typeof (nostrSigners[0]) === "string" &&
|
|
69
|
+
(0, utils_js_1.isHex)(nostrSigners[0]) && nostrSigners[0].length === 64) {
|
|
70
|
+
nostrEvent.pubkey = nostrSigners[0];
|
|
32
71
|
}
|
|
72
|
+
// tags
|
|
33
73
|
if ("license" in spasmEventV2 && spasmEventV2.license &&
|
|
34
74
|
typeof (spasmEventV2.license) === "string") {
|
|
35
|
-
|
|
75
|
+
nostrEvent.tags?.push(["license", spasmEventV2.license]);
|
|
76
|
+
}
|
|
77
|
+
nostrEvent.tags?.push(["spasm_version", "2.0.0"], ["nostr_spasm_version", "2.0.0"]);
|
|
78
|
+
if ("categories" in spasmEventV2 && spasmEventV2.categories &&
|
|
79
|
+
(0, utils_js_1.isArrayWithValues)(spasmEventV2.categories)) {
|
|
80
|
+
spasmEventV2.categories.forEach(cat => {
|
|
81
|
+
const categoryTag = ["spasm_category"];
|
|
82
|
+
if ("name" in cat && cat.name && String(cat.name)) {
|
|
83
|
+
// TODO make a proper recursive function for categories
|
|
84
|
+
categoryTag.push(String(cat.name));
|
|
85
|
+
if ("sub" in cat && cat.sub &&
|
|
86
|
+
"name" in cat.sub && cat.sub.name &&
|
|
87
|
+
String(cat.sub.name)) {
|
|
88
|
+
categoryTag.push(String(cat.sub.name));
|
|
89
|
+
if ("sub" in cat.sub && cat.sub.sub &&
|
|
90
|
+
"name" in cat.sub.sub && cat.sub.sub.name &&
|
|
91
|
+
String(cat.sub.sub.name)) {
|
|
92
|
+
categoryTag.push(String(cat.sub.sub.name));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
nostrEvent.tags?.push(categoryTag);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if ("keywords" in spasmEventV2 && spasmEventV2.keywords &&
|
|
100
|
+
(0, utils_js_1.isArrayOfStrings)(spasmEventV2.keywords)) {
|
|
101
|
+
spasmEventV2.keywords.forEach(keyword => {
|
|
102
|
+
if (String(keyword)) {
|
|
103
|
+
nostrEvent.tags?.push(["t", String(keyword)]);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
if ("title" in spasmEventV2 && spasmEventV2.title &&
|
|
108
|
+
typeof (spasmEventV2.title) === "string") {
|
|
109
|
+
nostrEvent.tags?.push(["title", spasmEventV2.title]);
|
|
36
110
|
}
|
|
37
111
|
if ("parent" in spasmEventV2 && spasmEventV2.parent) {
|
|
38
112
|
if (spasmEventV2.parent.ids &&
|
|
39
113
|
(0, utils_js_1.isArrayWithValues)(spasmEventV2.parent.ids)) {
|
|
40
|
-
spasmEventV2.parent.ids.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
114
|
+
assembleAndPushIdTagMapped(spasmEventV2.parent.ids, nostrEvent.tags, "parent.ids", "0" // Spasm event can only have one parent event
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if ("references" in spasmEventV2 && spasmEventV2.references) {
|
|
119
|
+
spasmEventV2.references.forEach((ref, eventIndex) => {
|
|
120
|
+
if (ref.ids && (0, utils_js_1.isArrayWithValues)(ref.ids) &&
|
|
121
|
+
String(eventIndex)) {
|
|
122
|
+
assembleAndPushIdTagMapped(ref.ids, nostrEvent.tags, "references.ids", String(eventIndex));
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
if ("mentions" in spasmEventV2 && spasmEventV2.mentions) {
|
|
127
|
+
spasmEventV2.mentions.forEach((mention, mentionIndex) => {
|
|
128
|
+
if (mention.addresses &&
|
|
129
|
+
(0, utils_js_1.isArrayWithValues)(mention.addresses) &&
|
|
130
|
+
String(mentionIndex)) {
|
|
131
|
+
assembleAndPushAddressesTagMapped(mention.addresses, nostrEvent.tags, "mentions.addresses", String(mentionIndex));
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
if ("authors" in spasmEventV2 && spasmEventV2.authors) {
|
|
136
|
+
spasmEventV2.authors.forEach((author, authorIndex) => {
|
|
137
|
+
if (author.addresses &&
|
|
138
|
+
(0, utils_js_1.isArrayWithValues)(author.addresses) &&
|
|
139
|
+
String(authorIndex)) {
|
|
140
|
+
assembleAndPushAddressesTagMapped(author.addresses, nostrEvent.tags, "authors.addresses", String(authorIndex));
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
// TODO
|
|
145
|
+
// if (isNostrEvent(nostrEvent)) {
|
|
146
|
+
// return nostrEvent
|
|
147
|
+
// } else { return null }
|
|
148
|
+
return nostrEvent;
|
|
149
|
+
};
|
|
150
|
+
exports.convertSpasmEventV2ToNostrSpasmV2 = convertSpasmEventV2ToNostrSpasmV2;
|
|
151
|
+
const assembleAndPushIdTagMapped = (ids, tags, flag = "parent.ids", eventIndex = "0") => {
|
|
152
|
+
if (!ids || !(0, utils_js_1.isArrayWithValues)(ids)) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (!tags || !Array.isArray(tags)) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (!flag) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
if (!String(eventIndex)) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
ids.forEach((id, idIndex) => {
|
|
165
|
+
if (id.value && typeof (id.value) === "string") {
|
|
166
|
+
let value = id.value; // original value
|
|
167
|
+
let hosts = [];
|
|
168
|
+
let hostsAsOneString = "";
|
|
169
|
+
let relay = "";
|
|
170
|
+
let pubkey = "";
|
|
171
|
+
let path = "parent.ids";
|
|
172
|
+
let action = "reply";
|
|
173
|
+
// Event index for parent is always 0 because there
|
|
174
|
+
// can only be one parent event in Spasm event,
|
|
175
|
+
// other events are listed as references.
|
|
176
|
+
// let eventIndex: string = "0"
|
|
177
|
+
let formatName = "";
|
|
178
|
+
let formatVersion = "";
|
|
179
|
+
let marker = "";
|
|
180
|
+
if (flag === "references.ids") {
|
|
181
|
+
path = flag;
|
|
182
|
+
action = "mention";
|
|
183
|
+
}
|
|
184
|
+
if (id.format && (id.format.name === "nostr-hex" ||
|
|
185
|
+
id.format.name === "nostr-note" ||
|
|
186
|
+
id.format.name === "nostr-nevent")) {
|
|
187
|
+
value = (0, nostrUtils_js_1.toBeHex)(id.value);
|
|
188
|
+
}
|
|
189
|
+
if (id.pubkey && String(id.pubkey)) {
|
|
190
|
+
pubkey = String(id.pubkey);
|
|
191
|
+
if (pubkey.length === 63 && pubkey.startsWith("npub")) {
|
|
192
|
+
pubkey = (0, nostrUtils_js_1.toBeHex)(pubkey);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
const { newValue, method, original } = convertValueToNostrTagsMapping(value);
|
|
196
|
+
const { newValue: newPubkey, method: pubkeyMethod, original: pubkeyOriginal } = convertValueToNostrTagsMapping(pubkey);
|
|
197
|
+
if (id.hosts && (0, utils_js_1.isArrayWithValues)(id.hosts)) {
|
|
198
|
+
id.hosts.forEach(host => {
|
|
199
|
+
if (host.value && typeof (host.value) === "string") {
|
|
200
|
+
hosts.push(host.value);
|
|
47
201
|
}
|
|
48
|
-
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
if (hosts[0] && typeof (hosts[0]) === "string") {
|
|
205
|
+
relay = hosts[0];
|
|
206
|
+
}
|
|
207
|
+
if (id.marker && String(id.marker)) {
|
|
208
|
+
marker = String(id.marker);
|
|
209
|
+
}
|
|
210
|
+
if (id.format && id.format.name &&
|
|
211
|
+
String(id.format.name)) {
|
|
212
|
+
formatName = String(id.format.name);
|
|
213
|
+
}
|
|
214
|
+
if (id.format && id.format.version &&
|
|
215
|
+
String(id.format.version)) {
|
|
216
|
+
formatVersion = String(id.format.version);
|
|
217
|
+
}
|
|
218
|
+
if ((0, utils_js_1.isArrayOfStrings)(hosts)) {
|
|
219
|
+
hosts.forEach(host => {
|
|
220
|
+
const str = String(host);
|
|
221
|
+
if (str) {
|
|
222
|
+
if (hostsAsOneString.length > 0) {
|
|
223
|
+
hostsAsOneString += ",";
|
|
224
|
+
hostsAsOneString += str.trim();
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
hostsAsOneString = str.trim();
|
|
228
|
+
}
|
|
49
229
|
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
const finalTag = ["e", newValue, relay, action, newPubkey];
|
|
233
|
+
// Mapping (extra details about the tag)
|
|
234
|
+
const finalTagMapped = [
|
|
235
|
+
"tags_mapping", // tag name
|
|
236
|
+
"spasm_id_1", // mapping algorithm
|
|
237
|
+
"e", // tag name to map
|
|
238
|
+
newValue, // tag value to map
|
|
239
|
+
"se2", // target event type
|
|
240
|
+
path, // key (path) in SpasmEvent
|
|
241
|
+
String(eventIndex), // event index
|
|
242
|
+
String(idIndex), // id index
|
|
243
|
+
method, // method
|
|
244
|
+
original, // original value
|
|
245
|
+
formatName, // format name
|
|
246
|
+
formatVersion, // format version
|
|
247
|
+
marker, // Spasm marker
|
|
248
|
+
hostsAsOneString, // Spasm hosts
|
|
249
|
+
pubkeyMethod, // pubkey method
|
|
250
|
+
pubkeyOriginal // pubkey original value
|
|
251
|
+
];
|
|
252
|
+
tags.push(finalTag, finalTagMapped);
|
|
52
253
|
}
|
|
254
|
+
});
|
|
255
|
+
};
|
|
256
|
+
const assembleAndPushAddressesTagMapped = (addresses, tags, flag = "mentions.addresses", eventIndex = "0") => {
|
|
257
|
+
if (!addresses || !(0, utils_js_1.isArrayWithValues)(addresses)) {
|
|
258
|
+
return;
|
|
53
259
|
}
|
|
54
|
-
|
|
260
|
+
if (!tags || !Array.isArray(tags)) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
if (!flag) {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
if (!String(eventIndex)) {
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
addresses.forEach((address, addressIndex) => {
|
|
270
|
+
if (address.value && typeof (address.value) === "string") {
|
|
271
|
+
let tagName = "p";
|
|
272
|
+
let mapping_algorithm = "spasm_add_1";
|
|
273
|
+
let value = address.value; // original value
|
|
274
|
+
let hosts = [];
|
|
275
|
+
let hostsAsOneString = "";
|
|
276
|
+
let relay = "";
|
|
277
|
+
let path = "mentions.addresses";
|
|
278
|
+
// Event index for parent is always 0 because there
|
|
279
|
+
// can only be one parent event in Spasm event,
|
|
280
|
+
// other events are listed as references.
|
|
281
|
+
// let eventIndex: string = "0"
|
|
282
|
+
let formatName = "";
|
|
283
|
+
let formatVersion = "";
|
|
284
|
+
let marker = "";
|
|
285
|
+
if (flag === "mentions.addresses") {
|
|
286
|
+
path = flag;
|
|
287
|
+
tagName = "p";
|
|
288
|
+
mapping_algorithm = "spasm_add_1";
|
|
289
|
+
}
|
|
290
|
+
if (flag === "authors.addresses") {
|
|
291
|
+
path = flag;
|
|
292
|
+
tagName = "O";
|
|
293
|
+
mapping_algorithm = "spasm_aadd_1";
|
|
294
|
+
}
|
|
295
|
+
if (address.format && (address.format.name === "nostr-hex" ||
|
|
296
|
+
address.format.name === "nostr-npub")) {
|
|
297
|
+
value = (0, nostrUtils_js_1.toBeHex)(address.value);
|
|
298
|
+
}
|
|
299
|
+
const { newValue, method, original } = convertValueToNostrTagsMapping(value, mapping_algorithm);
|
|
300
|
+
if (address.hosts && (0, utils_js_1.isArrayWithValues)(address.hosts)) {
|
|
301
|
+
address.hosts.forEach(host => {
|
|
302
|
+
if (host.value && typeof (host.value) === "string") {
|
|
303
|
+
hosts.push(host.value);
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
if (hosts[0] && typeof (hosts[0]) === "string") {
|
|
308
|
+
relay = hosts[0];
|
|
309
|
+
}
|
|
310
|
+
if (address.marker && String(address.marker)) {
|
|
311
|
+
marker = String(address.marker);
|
|
312
|
+
}
|
|
313
|
+
if (address.format && address.format.name &&
|
|
314
|
+
String(address.format.name)) {
|
|
315
|
+
formatName = String(address.format.name);
|
|
316
|
+
}
|
|
317
|
+
if (address.format && address.format.version &&
|
|
318
|
+
String(address.format.version)) {
|
|
319
|
+
formatVersion = String(address.format.version);
|
|
320
|
+
}
|
|
321
|
+
if ((0, utils_js_1.isArrayOfStrings)(hosts)) {
|
|
322
|
+
hosts.forEach(host => {
|
|
323
|
+
const str = String(host);
|
|
324
|
+
if (str) {
|
|
325
|
+
if (hostsAsOneString.length > 0) {
|
|
326
|
+
hostsAsOneString += ",";
|
|
327
|
+
hostsAsOneString += str.trim();
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
hostsAsOneString = str.trim();
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
let finalTag = [];
|
|
336
|
+
if (tagName === "p") {
|
|
337
|
+
finalTag = ["p", newValue, relay];
|
|
338
|
+
}
|
|
339
|
+
else if (tagName === "O") {
|
|
340
|
+
finalTag = ["O", newValue, mapping_algorithm];
|
|
341
|
+
}
|
|
342
|
+
// Mapping (extra details about the tag)
|
|
343
|
+
const finalTagMapped = [
|
|
344
|
+
"tags_mapping", // tag name
|
|
345
|
+
// "spasm_add_1", // mapping algorithm
|
|
346
|
+
mapping_algorithm, // mapping algorithm
|
|
347
|
+
tagName, // tag name to map
|
|
348
|
+
newValue, // tag value to map
|
|
349
|
+
"se2", // target event type
|
|
350
|
+
path, // key (path) in SpasmEvent
|
|
351
|
+
String(eventIndex), // event index
|
|
352
|
+
String(addressIndex), // address index
|
|
353
|
+
method, // method
|
|
354
|
+
original, // original value
|
|
355
|
+
formatName, // format name
|
|
356
|
+
formatVersion, // format version
|
|
357
|
+
marker, // Spasm marker
|
|
358
|
+
hostsAsOneString, // Spasm hosts
|
|
359
|
+
];
|
|
360
|
+
tags.push(finalTag, finalTagMapped);
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
};
|
|
364
|
+
const convertValueToNostrTagsMapping = (value, algorithm) => {
|
|
365
|
+
let newValue = "";
|
|
366
|
+
let method = "";
|
|
367
|
+
let original = "";
|
|
368
|
+
if (!value)
|
|
369
|
+
return { newValue, method, original };
|
|
370
|
+
const str = String(value);
|
|
371
|
+
if (!str)
|
|
372
|
+
return { newValue, method, original };
|
|
373
|
+
if (typeof (str) !== "string") {
|
|
374
|
+
return { newValue, method, original };
|
|
375
|
+
}
|
|
376
|
+
// spasm_author
|
|
377
|
+
if (algorithm === "spasm_aadd_1") {
|
|
378
|
+
method = "slice.13";
|
|
379
|
+
newValue = "spasm_author:" + str;
|
|
380
|
+
original = "";
|
|
381
|
+
// Nostr hex
|
|
382
|
+
}
|
|
383
|
+
else if (str.length === 64 && (0, utils_js_1.isHex)(str)) {
|
|
384
|
+
method = "full";
|
|
385
|
+
newValue = str;
|
|
386
|
+
original = "";
|
|
387
|
+
// Ethereum pubkey
|
|
388
|
+
}
|
|
389
|
+
else if (str.length === 42 && str.startsWith("0x") &&
|
|
390
|
+
(0, utils_js_1.isHex)(str.slice(2))) {
|
|
391
|
+
method = "hex_to_eth_pub_1";
|
|
392
|
+
newValue = str.slice(2) + "657468657265756d2d707562";
|
|
393
|
+
original = "";
|
|
394
|
+
// spasmid01
|
|
395
|
+
}
|
|
396
|
+
else if (str.length === 73 && str.startsWith("spasmid01") &&
|
|
397
|
+
(0, utils_js_1.isHex)(str.slice(9))) {
|
|
398
|
+
method = "hex_to_spasmid01_1";
|
|
399
|
+
newValue = str.slice(9);
|
|
400
|
+
original = "";
|
|
401
|
+
// Nostr signature
|
|
402
|
+
}
|
|
403
|
+
else if (str.length === 128 && (0, utils_js_1.isHex)(str)) {
|
|
404
|
+
method = "slice064";
|
|
405
|
+
newValue = str.slice(0, 64);
|
|
406
|
+
original = str;
|
|
407
|
+
// Ethereum signature
|
|
408
|
+
}
|
|
409
|
+
else if (str.length === 132 && str.startsWith("0x") &&
|
|
410
|
+
(0, utils_js_1.isHex)(str.slice(2))) {
|
|
411
|
+
method = "slice266";
|
|
412
|
+
newValue = str.slice(2, 66);
|
|
413
|
+
original = str;
|
|
414
|
+
}
|
|
415
|
+
else {
|
|
416
|
+
const hashed = (0, js_sha256_v0_1.sha256)(str);
|
|
417
|
+
if (hashed && hashed.length === 64 &&
|
|
418
|
+
typeof (hashed) === "string") {
|
|
419
|
+
method = "sha256";
|
|
420
|
+
newValue = (0, js_sha256_v0_1.sha256)(str);
|
|
421
|
+
original = str;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
return { newValue, method, original };
|
|
55
425
|
};
|
|
56
|
-
exports.convertToNostr = convertToNostr;
|
|
57
426
|
//# sourceMappingURL=convertToNostr.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertToNostr.js","sourceRoot":"","sources":["../../src.ts/convert/convertToNostr.ts"],"names":[],"mappings":";;;AAWA,0DAA8C;AAC9C,gDAM0B;AAC1B,uDAAuD;AAGvD,4BAA4B;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"}
|
|
@@ -16,6 +16,10 @@ export declare const standardizeSpasmEventSiblingV2: (sibling: SpasmEventSibling
|
|
|
16
16
|
export declare const standardizeDmpEventV2: (event: DmpEvent) => SpasmEventV2 | null;
|
|
17
17
|
export declare const standardizeDmpEventSignedClosedV2: (event: DmpEventSignedClosed) => SpasmEventV2 | null;
|
|
18
18
|
export declare const standardizeDmpEventSignedOpenedV2: (event: DmpEventSignedOpened) => SpasmEventV2 | null;
|
|
19
|
+
export declare const getTagMappedDetails: (tag: string[], tags: string[][]) => string[] | null;
|
|
20
|
+
export declare const isMappedTag: (tag: string[], tags: string[][]) => boolean;
|
|
21
|
+
export declare const getOriginalFromValueAndMethod: (value: string | null, method?: string | null, original?: string | null) => string | null;
|
|
22
|
+
export declare const getOriginalValueFromTagMappedDetails: (tag: string[]) => string | null;
|
|
19
23
|
export declare const standardizeNostrEventV2: (event: NostrEvent) => SpasmEventV2 | null;
|
|
20
24
|
export declare const standardizeNostrSpasmEventV2: (event: NostrSpasmEvent) => SpasmEventV2 | null;
|
|
21
25
|
export declare const standardizeNostrEventSignedOpenedV2: (event: NostrEventSignedOpened) => SpasmEventV2 | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertToSpasm.d.ts","sourceRoot":"","sources":["../../src.ts/convert/convertToSpasm.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"convertToSpasm.d.ts","sourceRoot":"","sources":["../../src.ts/convert/convertToSpasm.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,QAAQ,EACR,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,sBAAsB,EACtB,eAAe,EACf,2BAA2B,EAC3B,cAAc,EAEd,cAAc,EACd,YAAY,EAMZ,mBAAmB,EAYnB,YAAY,EAMZ,0BAA0B,EAC1B,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,4BAA4B,EAC5B,4BAA4B,EAC5B,oBAAoB,EAEpB,wBAAwB,EAYz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