nip11

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: CC0-1.0, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RelayFees

type RelayFees struct {
	Admission []struct {
		Amount int    `json:"amount"`
		Unit   string `json:"unit"`
	} `json:"admission,omitempty"`
	Subscription []struct {
		Amount int    `json:"amount"`
		Unit   string `json:"unit"`
		Period int    `json:"period"`
	} `json:"subscription,omitempty"`
	Publication []struct {
		Kinds  []int  `json:"kinds"`
		Amount int    `json:"amount"`
		Unit   string `json:"unit"`
	} `json:"publication,omitempty"`
}

RelayFees defines the fee structure used for a paid relay.

type RelayInfo

type RelayInfo struct {
	Name           string       `json:"name"`
	Description    string       `json:"description"`
	PubKey         string       `json:"pubkey"`
	Contact        string       `json:"contact"`
	SupportedNIPs  number.List  `json:"supported_nips"`
	Software       string       `json:"software"`
	Version        string       `json:"version"`
	Limitation     *RelayLimits `json:"limitation,omitempty"`
	RelayCountries []string     `json:"relay_countries,omitempty"`
	LanguageTags   []string     `json:"language_tags,omitempty"`
	Tags           []string     `json:"tags,omitempty"`
	PostingPolicy  string       `json:"posting_policy,omitempty"`
	PaymentsURL    string       `json:"payments_url,omitempty"`
	Fees           *RelayFees   `json:"fees,omitempty"`
	Icon           string       `json:"icon"`
}

RelayInfo provides the information for a relay on the network as regards to versions, NIP support, contact, policies, and payment requirements.

todo: change the string slices into tag type

func (*RelayInfo) AddSupportedNIP

func (ri *RelayInfo) AddSupportedNIP(number int)

AddSupportedNIP appends a supported NIP number to a RelayInfo.

func (*RelayInfo) ToObject

func (ri *RelayInfo) ToObject() (o object.T)

type RelayLimits

type RelayLimits struct {
	MaxMessageLength int  `json:"max_message_length,omitempty"`
	MaxSubscriptions int  `json:"max_subscriptions,omitempty"`
	MaxFilters       int  `json:"max_filters,omitempty"`
	MaxLimit         int  `json:"max_limit,omitempty"`
	MaxSubidLength   int  `json:"max_subid_length,omitempty"`
	MaxEventTags     int  `json:"max_event_tags,omitempty"`
	MaxContentLength int  `json:"max_content_length,omitempty"`
	MinPowDifficulty int  `json:"min_pow_difficulty,omitempty"`
	AuthRequired     bool `json:"auth_required"`
	PaymentRequired  bool `json:"payment_required"`
	RestrictedWrites bool `json:"restricted_writes"`
}

RelayLimits specifies the various restrictions and limitations that apply to interactions with a given relay.

func (*RelayLimits) ToObject

func (ri *RelayLimits) ToObject() (o object.T)

Jump to

Keyboard shortcuts

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