nip11: omitempty all the things.

This commit is contained in:
fiatjaf
2025-08-25 07:32:21 -03:00
parent 926ed0830a
commit 6ab6b49940
2 changed files with 10 additions and 10 deletions

View File

@@ -6,8 +6,8 @@ import (
"net/http"
"time"
jsoniter "github.com/json-iterator/go"
"fiatjaf.com/nostr"
jsoniter "github.com/json-iterator/go"
)
// Fetch fetches the NIP-11 metadata for a relay.

View File

@@ -9,13 +9,13 @@ import (
type RelayInformationDocument struct {
URL string `json:"-"`
Name string `json:"name"`
Description string `json:"description"`
PubKey nostr.PubKey `json:"pubkey"`
Contact string `json:"contact"`
SupportedNIPs []any `json:"supported_nips"`
Software string `json:"software"`
Version string `json:"version"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
PubKey *nostr.PubKey `json:"pubkey,omitempty"`
Contact string `json:"contact,omitempty"`
SupportedNIPs []any `json:"supported_nips,omitempty"`
Software string `json:"software,omitempty"`
Version string `json:"version,omitempty"`
Limitation *RelayLimitationDocument `json:"limitation,omitempty"`
RelayCountries []string `json:"relay_countries,omitempty"`
@@ -25,8 +25,8 @@ type RelayInformationDocument struct {
PaymentsURL string `json:"payments_url,omitempty"`
Fees *RelayFeesDocument `json:"fees,omitempty"`
Retention []*RelayRetentionDocument `json:"retention,omitempty"`
Icon string `json:"icon"`
Banner string `json:"banner"`
Icon string `json:"icon,omitempty"`
Banner string `json:"banner,omitempty"`
}
func (info *RelayInformationDocument) AddSupportedNIP(number int) {