feat: POW miner

This commit is contained in:
2023-08-18 00:35:48 +01:00
parent 667518a2df
commit 2a851c442d
14 changed files with 209 additions and 40 deletions

View File

@ -15,16 +15,17 @@ export function createNostrLink(prefix: NostrPrefix, id: string, relays?: string
type: prefix,
id,
relays,
kind, author,
kind,
author,
encode: () => {
if(prefix === NostrPrefix.Note || prefix === NostrPrefix.PublicKey) {
if (prefix === NostrPrefix.Note || prefix === NostrPrefix.PublicKey) {
return hexToBech32(prefix, id);
}
if(prefix === NostrPrefix.Address || prefix === NostrPrefix.Event || prefix === NostrPrefix.Profile) {
}
if (prefix === NostrPrefix.Address || prefix === NostrPrefix.Event || prefix === NostrPrefix.Profile) {
return encodeTLV(prefix, id, relays, kind, author);
}
return "";
}
},
} as NostrLink;
}