sdk

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InputToEventPointer

func InputToEventPointer(input string) *nostr.EventPointer

InputToEventPointer turns any note/nevent/hex input into a EventPointer (or nil).

func InputToProfile

func InputToProfile(ctx context.Context, input string) *nostr.ProfilePointer

InputToProfile turns any npub/nprofile/hex/nip05 input into a ProfilePointer (or nil).

Types

type Reference

type Reference struct {
	Text    string
	Start   int
	End     int
	Profile *nostr.ProfilePointer
	Event   *nostr.EventPointer
	Entity  *nostr.EntityPointer
}

func ParseReferences

func ParseReferences(evt *nostr.Event) []*Reference

ParseReferences parses both NIP-08 and NIP-27 references in a single unifying interface.

type Relay

type Relay struct {
	URL    string
	Inbox  bool
	Outbox bool
}

func FetchRelaysForPubkey

func FetchRelaysForPubkey(ctx context.Context, pool *nostr.SimplePool, pubkey string, extraRelays ...string) []Relay

func ParseRelaysFromKind10002

func ParseRelaysFromKind10002(evt *nostr.Event) []Relay

func ParseRelaysFromKind3

func ParseRelaysFromKind3(evt *nostr.Event) []Relay

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL