Constructors
constructor
- new EventPublisher(signer, pubKey): EventPublisher
Properties
Private
Optional
#miner
Private
Optional
#pow
#pow?: number
Private
#pubKey
#pubKey: string
Private
#signer
Accessors
pubKey
- get pubKey(): string
Returns string
Methods
Private
#eb
- #eb(k): EventBuilder
Private
#sign
- #sign(eb): Promise<NostrEvent>
appData
- appData(data, id): Promise<NostrEvent>
bookmarks
- bookmarks(notes): Promise<NostrEvent>
contactList
- contactList(tags): Promise<NostrEvent>
createUnsigned
- createUnsigned(kind, content, fnHook): NotSignedNostrEvent
Parameters
content: string
fnHook: EventBuilderHook
decryptDm
- decryptDm(note): Promise<string>
Returns Promise<string>
decryptGeneric
- decryptGeneric(content, from): Promise<string>
Parameters
content: string
from: string
Returns Promise<string>
delete
- delete(id): Promise<NostrEvent>
generic
- generic(fnHook): Promise<NostrEvent>
giftWrap
- giftWrap(inner, explicitP?, powTarget?, powMiner?): Promise<NostrEvent>
Parameters
Optional
explicitP: string
Optional
powTarget: number
Optional
powMiner: PowMiner
metadata
- metadata(obj): Promise<NostrEvent>
muted
- muted(pub, priv): Promise<NostrEvent>
Parameters
pub: string[]
priv: string[]
nip42Auth
- nip42Auth(challenge, relay): Promise<NostrEvent>
Parameters
challenge: string
relay: string
nip4Decrypt
- nip4Decrypt(content, otherKey): Promise<string>
Parameters
content: string
otherKey: string
Returns Promise<string>
nip4Encrypt
- nip4Encrypt(content, otherKey): Promise<string>
Parameters
content: string
otherKey: string
Returns Promise<string>
note
- note(msg, fnExtra?): Promise<NostrEvent>
Parameters
msg: string
Optional
fnExtra: EventBuilderHook
pinned
- pinned(notes): Promise<NostrEvent>
pow
- pow(target, miner?): EventPublisher
react
- react(evRef, content?): Promise<NostrEvent>
relayList
- relayList(relays): Promise<NostrEvent>
reply
- reply(replyTo, msg, fnExtra?): Promise<NostrEvent>
Parameters
msg: string
Optional
fnExtra: EventBuilderHook
repost
- repost(note): Promise<NostrEvent>
sealRumor
- sealRumor(inner, toKey): Promise<NostrEvent>
sendDm
- sendDm(content, to): Promise<NostrEvent>
Parameters
content: string
to: string
supports
- supports(t): boolean
Returns boolean
unsealRumor
- unsealRumor(inner): Promise<NostrEvent>
unwrapGift
- unwrapGift(gift): Promise<NostrEvent>
zap
- zap(amount, author, relays, note?, msg?, fnExtra?): Promise<NostrEvent>
Parameters
amount: number
author: string
relays: string[]
Optional
msg: string
Optional
fnExtra: EventBuilderHook
Static
privateKey
- privateKey(privateKey): EventPublisher
Build a categorized bookmarks event with a given label