nut06

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: MIT Imports: 2 Imported by: 1

Documentation

Overview

Package nut06 contains structs as defined in NUT-06

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContactInfo added in v0.2.0

type ContactInfo struct {
	Method string `json:"method"`
	Info   string `json:"info"`
}

type MethodSetting

type MethodSetting struct {
	Method    string `json:"method"`
	Unit      string `json:"unit"`
	MinAmount uint64 `json:"min_amount,omitempty"`
	MaxAmount uint64 `json:"max_amount,omitempty"`
}

type MintInfo

type MintInfo struct {
	Name            string        `json:"name"`
	Pubkey          string        `json:"pubkey"`
	Version         string        `json:"version"`
	Description     string        `json:"description"`
	LongDescription string        `json:"description_long,omitempty"`
	Contact         []ContactInfo `json:"contact,omitempty"`
	Motd            string        `json:"motd,omitempty"`
	IconURL         string        `json:"icon_url,omitempty"`
	URLs            []string      `json:"urls,omitempty"`
	Time            int64         `json:"time,omitempty"`
	Nuts            Nuts          `json:"nuts"`
}

func (*MintInfo) UnmarshalJSON added in v0.2.0

func (mi *MintInfo) UnmarshalJSON(data []byte) error

custom unmarshal to ignore contact field if on old format

type NutSetting

type NutSetting struct {
	Methods  []MethodSetting `json:"methods"`
	Disabled bool            `json:"disabled"`
}

type Nuts added in v0.4.0

type Nuts struct {
	Nut04 NutSetting        `json:"4"`
	Nut05 NutSetting        `json:"5"`
	Nut07 Supported         `json:"7"`
	Nut08 Supported         `json:"8"`
	Nut09 Supported         `json:"9"`
	Nut10 Supported         `json:"10"`
	Nut11 Supported         `json:"11"`
	Nut12 Supported         `json:"12"`
	Nut14 Supported         `json:"14"`
	Nut15 *NutSetting       `json:"15,omitempty"`
	Nut17 nut17.InfoSetting `json:"17"`
}

func (*Nuts) UnmarshalJSON added in v0.4.0

func (nuts *Nuts) UnmarshalJSON(data []byte) error

custom unmarshaller because format to signal support for nut-15 changed. So it will first try to Unmarshal to new format and if there is an error it will try old format

type Supported added in v0.4.0

type Supported struct {
	Supported bool `json:"supported"`
}

Jump to

Keyboard shortcuts

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