Optional
rawEvent: NostrEventOptional
created_Encodes a bech32 id.
Rest
...args: []Rest
...args: []Rest
...args: []Rest
...args: []Optional
kindOptional
ndkThe relays that this event was received from and/or successfully published to.
The relay that this event was first received from.
Optional
sigGets the NIP-31 "alt" tag of the event.
Sets the NIP-31 "alt" tag of the event. Use this to set an alt tag so clients that don't handle a particular event kind can display something useful for users.
Returns the amount for this tier
Gets the NIP-33 "d" tag of the event.
Sets the NIP-33 "d" tag of the event.
Getter for the article image.
Setter for the article image.
The image to set for the article.
Checks if this tier is valid
Returns perks for this tier
Getter for the article's publication timestamp.
Setter for the article's publication timestamp.
The Unix timestamp to set for the article's publication date.
Sets a relay where content related to this tier can be found
URL of the relay
Returns the relay URLs for this tier
Getter for the article title.
Setter for the article title.
The title to set for the article.
Getter for the article's URL.
Setter for the article's URL.
The URL to set for the article.
Gets the verifier pubkey for this tier. This is the pubkey that will generate subscription payment receipts
Sets the verifier pubkey for this tier.
Adds an amount to this tier
Amount in the smallest unit of the currency (e.g. cents, msats)
Currency code. Use msat for millisatoshis
One of daily, weekly, monthly, quarterly, yearly
Provides the filter that will return matching events for this event.
The filter that will return matching events for this event
event = new NDKEvent(ndk, { kind: 30000, pubkey: 'pubkey', tags: [ ["d", "d-code"] ] });
event.filter(); // { "#a": ["30000:pubkey:d-code"] }
event = new NDKEvent(ndk, { kind: 1, pubkey: 'pubkey', id: "eventid" });
event.filter(); // { "#e": ["eventid"] }
Attempt to sign and then publish an NDKEvent to a given relaySet. If no relaySet is provided, the relaySet will be calculated by NDK.
Optional
relaySet: NDKRelaySet{NDKRelaySet} The relaySet to publish the even to.
Optional
timeoutMs: numberA promise that resolves to the relays the event was published to.
Returns the event as is.
Get the tags that can be used to reference this event from another event
Optional
marker: stringThe marker to use in the tag
Optional
skipAuthorTag: booleanThe NDKTag object referencing this event
event = new NDKEvent(ndk, { kind: 30000, pubkey: 'pubkey', tags: [ ["d", "d-code"] ] });
event.referenceTags(); // [["a", "30000:pubkey:d-code"], ["e", "parent-id"]]
event = new NDKEvent(ndk, { kind: 1, pubkey: 'pubkey', id: "eventid" });
event.referenceTags(); // [["e", "parent-id"]]
Sign the event if a signer is present.
It will generate tags. Repleacable events will have their created_at field set to the current time.
Optional
signer: NDKSigner{NDKSigner} The NDKSigner to use to sign the event
A Promise that resolves to the signature of the signed event.
Tag a user with an optional marker.
The user to tag.
Optional
marker: stringThe marker to use in the tag.
Tag a user with an optional marker.
The user to tag.
Optional
marker: stringThe marker to use in the tag.
Tag a user with an optional marker.
The event to tag.
Optional
marker: stringThe marker to use in the tag.
Optional
skipAuthorTag: booleanWhether to explicitly skip adding the author tag of the event.
reply.tag(opEvent, "reply");
// reply.tags => [["e", <id>, <relay>, "reply"]]
Get the tag that can be used to reference this event from another event.
Consider using referenceTags() instead (unless you have a good reason to use this)
Optional
marker: stringThe NDKTag object referencing this event
event = new NDKEvent(ndk, { kind: 30000, pubkey: 'pubkey', tags: [ ["d", "d-code"] ] });
event.tagReference(); // ["a", "30000:pubkey:d-code"]
event = new NDKEvent(ndk, { kind: 1, pubkey: 'pubkey', id: "eventid" });
event.tagReference(); // ["e", "eventid"]
Return a NostrEvent object, trying to fill in missing fields when possible, adding tags when necessary.
Optional
pubkey: string{string} The pubkey of the user who the event belongs to.
A promise that resolves to a NostrEvent.
Create a zap request for an existing event
The amount to zap in millisatoshis
Optional
comment: stringA comment to add to the zap request
Optional
extraTags: NDKTag[]Extra tags to add to the zap request
Optional
recipient: NDKUserThe zap recipient (optional for events)
Optional
signer: NDKSignerThe signer to use (will default to the NDK instance's signer)
Static
fromCreates a new NDKSubscriptionTier from an event
NDKSubscriptionTier
Generated using TypeDoc
Description
Implements NIP-88 (TBD)'s subscription tiers
This class will validate that incoming events are valid subscription tiers. Incomplete or invalid amounts will be ignored.
Example