-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
incluindo um pow de 10 para cada id de primeiro evento para novos pub…
…keys
- Loading branch information
1 parent
ad5e569
commit 8fc0da0
Showing
4 changed files
with
18 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
/// <reference lib="webworker" /> | ||
|
||
import { getEventHash, UnsignedEvent } from "nostr-tools"; | ||
import { getPow, minePow } from "nostr-tools/nip13"; | ||
import { UnsignedEvent } from "nostr-tools"; | ||
import { minePow } from "nostr-tools/nip13"; | ||
|
||
// include pow to event, some relays require it for first event of a new pubkey | ||
addEventListener('message', ({ data }) => { | ||
const powEvent = minePow(data as UnsignedEvent, getPow(getEventHash(data))); | ||
const powEvent = minePow(data as UnsignedEvent, 10); | ||
postMessage({ data: powEvent }); | ||
}); |