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 the committee before new domain name can be registered.
Index ¶
- func AddRecord(name string, typ RecordType, data string)
- func BalanceOf(owner interop.Hash160) int
- func Decimals() int
- 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]interface{}
- func Register(name string, owner interop.Hash160, email string, ...) bool
- func Renew(name string) int
- func Resolve(name string, typ RecordType) []string
- func Roots() iterator.Iterator
- func SetAdmin(name string, admin interop.Hash160)
- func SetPrice(price int)
- 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 interface{}) bool
- func Update(nef []byte, manifest string)
- func UpdateSOA(name, email string, refresh, retry, expire, ttl int)
- func Version() int
- type NameState
- type RecordState
- type RecordType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRecord ¶ added in v0.12.0
func AddRecord(name string, typ RecordType, data string)
AddRecord adds new record of the specified type to the provided domain.
func DeleteRecords ¶ added in v0.12.0
func DeleteRecords(name string, typ RecordType)
DeleteRecords removes domain records with the specified type.
func GetAllRecords ¶ added in v0.11.0
GetAllRecords returns an Iterator with RecordState items for given name.
func GetRecords ¶ added in v0.12.0
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 provided domain name is available.
func Properties ¶
Properties returns domain name and 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 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 new record of the specified type to the provided domain.
func TotalSupply ¶
func TotalSupply() int
TotalSupply returns overall number of domains minted by the NeoNameService contract.
Types ¶
type RecordState ¶ added in v0.11.0
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 defined in [RFC 1035](https://tools.ietf.org/html/rfc1035)
const ( // AAAA represents IPv6 address record type. AAAA RecordType = 28 )
Record types defined in [RFC 3596](https://tools.ietf.org/html/rfc3596)