Documentation ¶
Overview ¶
Package nns contains non-divisible non-fungible NEP11-compatible token implementation. This token is a compatible analogue of C# Neo Name Service token and is aimed to serve as a domain name service for Neo smart-contracts, thus it's NeoNameService. This token can be minted with new domain name registration, the domain name itself is your NFT. Corresponding domain root must be added by committee before a new domain name can be registered.
Index ¶
- Constants
- func AddRecord(name string, typ RecordType, data string)
- func BalanceOf(owner interop.Hash160) int
- func Decimals() int
- func DeleteDomain(name string)
- func DeleteRecord(name string, typ RecordType, data string) bool
- func DeleteRecords(name string, typ RecordType)
- func GetAllRecords(name string) iterator.Iterator
- func GetPrice() int
- func GetRecords(name string, typ RecordType) []string
- func IsAvailable(name string) bool
- func OwnerOf(tokenID []byte) interop.Hash160
- func Properties(tokenID []byte) map[string]any
- func Register(name string, owner interop.Hash160, email string, ...) bool
- func Renew(name string) int64
- func Resolve(name string, typ RecordType) []string
- func Roots() iterator.Iterator
- func SetAdmin(name string, admin interop.Hash160)
- func SetPrice(price int64)
- func SetRecord(name string, typ RecordType, id byte, data string)
- func Symbol() string
- func Tokens() iterator.Iterator
- func TokensOf(owner interop.Hash160) iterator.Iterator
- func TotalSupply() int
- func Transfer(to interop.Hash160, tokenID []byte, data any) bool
- func Update(nef []byte, manifest string, data any)
- func UpdateSOA(name, email string, refresh, retry, expire, ttl int)
- func Version() int
- type NameState
- type RecordState
- type RecordType
Constants ¶
const ( FrostfsIDNNSTLDPermissionKey = "nns-allow-register-tld" FrostfsIDTLDRegistrationAllowed = "allow" )
const ( // Cnametgt is a special TXT record ensuring all created subdomains point to the global domain - the value of this variable. // It is guaranteed that two domains cannot point to the same global domain. Cnametgt = "cnametgt" )
const FrostfsIDNNSName = "frostfsid.frostfs"
Variables ¶
This section is empty.
Functions ¶
func AddRecord ¶
func AddRecord(name string, typ RecordType, data string)
AddRecord adds a new record of the specified type to the provided domain.
func DeleteDomain ¶ added in v0.20.0
func DeleteDomain(name string)
DeleteDomain deletes the domain with the given name.
func DeleteRecord ¶ added in v0.20.0
func DeleteRecord(name string, typ RecordType, data string) bool
DeleteRecord delete a record of the specified type by data in the provided domain. Returns false if the record was not found.
func DeleteRecords ¶
func DeleteRecords(name string, typ RecordType)
DeleteRecords removes domain records with the specified type.
func GetAllRecords ¶
GetAllRecords returns an Iterator with RecordState items for the given name.
func GetRecords ¶
func GetRecords(name string, typ RecordType) []string
GetRecords returns domain record of the specified type if it exists or an empty string if not.
func IsAvailable ¶
IsAvailable checks whether the provided domain name is available.
func Properties ¶
Properties returns a domain name and an expiration date of the specified domain.
func Register ¶
func Register(name string, owner interop.Hash160, email string, refresh, retry, expire, ttl int) bool
Register registers a new domain with the specified owner and name if it's available.
func Resolve ¶
func Resolve(name string, typ RecordType) []string
Resolve resolves given name (not more then three redirects are allowed).
func SetRecord ¶
func SetRecord(name string, typ RecordType, id byte, data string)
SetRecord adds a new record of the specified type to the provided domain.
func TotalSupply ¶
func TotalSupply() int
TotalSupply returns the overall number of domains minted by NeoNameService contract.
Types ¶
type RecordState ¶
type RecordState struct { Name string Type RecordType Data string ID byte }
RecordState is a type that registered entities are saved to.
type RecordType ¶
type RecordType byte
RecordType is domain name service record types.
const ( // A represents address record type. A RecordType = 1 // CNAME represents canonical name record type. CNAME RecordType = 5 // SOA represents start of authority record type. SOA RecordType = 6 // TXT represents text record type. TXT RecordType = 16 )
Record types are defined in [RFC 1035](https://tools.ietf.org/html/rfc1035)
const ( // AAAA represents IPv6 address record type. AAAA RecordType = 28 )
Record types are defined in [RFC 3596](https://tools.ietf.org/html/rfc3596)