feat: add marker param to toEventTag
This commit is contained in:
parent
a124d49a64
commit
bcab6b0f0e
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@snort/system-react",
|
"name": "@snort/system-react",
|
||||||
"version": "1.1.6",
|
"version": "1.1.7",
|
||||||
"description": "React hooks for @snort/system",
|
"description": "React hooks for @snort/system",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@snort/system",
|
"name": "@snort/system",
|
||||||
"version": "1.1.6",
|
"version": "1.1.7",
|
||||||
"description": "Snort nostr system package",
|
"description": "Snort nostr system package",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
@ -52,8 +52,16 @@ export class NostrLink implements ToNostrEventTag {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
toEventTag() {
|
toEventTag(marker?: string) {
|
||||||
const relayEntry = this.relays ? [this.relays[0]] : [];
|
const relayEntry = this.relays ? [this.relays[0]] : [];
|
||||||
|
|
||||||
|
if (marker) {
|
||||||
|
if (relayEntry.length === 0) {
|
||||||
|
relayEntry.push("");
|
||||||
|
}
|
||||||
|
relayEntry.push(marker);
|
||||||
|
}
|
||||||
|
|
||||||
if (this.type === NostrPrefix.PublicKey || this.type === NostrPrefix.Profile) {
|
if (this.type === NostrPrefix.PublicKey || this.type === NostrPrefix.Profile) {
|
||||||
return ["p", this.id, ...relayEntry];
|
return ["p", this.id, ...relayEntry];
|
||||||
} else if (this.type === NostrPrefix.Note || this.type === NostrPrefix.Event) {
|
} else if (this.type === NostrPrefix.Note || this.type === NostrPrefix.Event) {
|
||||||
|
Loading…
Reference in New Issue
Block a user