Documentation
¶
Overview ¶
Package nameservice provides interface to NameService native contract. It's a NEP-11 contract implementing a domain name service.
Index ¶
- Constants
- func AddRoot(root string)
- func BalanceOf(owner interop.Hash160) int
- func Decimals() int
- func DeleteRecord(name string, recType RecordType)
- func GetPrice() int
- func GetRecord(name string, recType RecordType) []byte
- func IsAvailable(name string) bool
- func OwnerOf(tokenID string) interop.Hash160
- func Properties(tokenID string) map[string]interface{}
- func Register(name string, owner interop.Hash160) bool
- func Renew(name string) int
- func Resolve(name string, recType RecordType) []byte
- func SetAdmin(name string, admin interop.Hash160)
- func SetPrice(price int)
- func SetRecord(name string, recType RecordType, data string)
- func Symbol() string
- func Tokens() iterator.Iterator
- func TokensOf(addr interop.Hash160) iterator.Iterator
- func TotalSupply() int
- func Transfer(to interop.Hash160, tokenID string) bool
- type RecordType
Constants ¶
const Hash = "\x6b\x59\x2b\x87\x66\xcc\x45\x8e\xfa\x7a\x90\x47\x56\x62\xcd\x92\x03\xcf\x8f\x7a"
Hash represents NameService contract hash.
Variables ¶
This section is empty.
Functions ¶
func AddRoot ¶
func AddRoot(root string)
AddRoot represents `addRoot` method of NameService native contract.
func Decimals ¶
func Decimals() int
Decimals represents `decimals` method of NameService native contract.
func DeleteRecord ¶
func DeleteRecord(name string, recType RecordType)
DeleteRecord represents `deleteRecord` method of NameService native contract.
func GetPrice ¶
func GetPrice() int
GetPrice represents `getPrice` method of NameService native contract.
func GetRecord ¶
func GetRecord(name string, recType RecordType) []byte
GetRecord represents `getRecord` method of NameService native contract. It returns `nil` if record is missing.
func IsAvailable ¶
IsAvailable represents `isAvailable` method of NameService native contract.
func Properties ¶
Properties represents `properties` method of NameService native contract.
func Resolve ¶
func Resolve(name string, recType RecordType) []byte
Resolve represents `resolve` method of NameService native contract.
func SetPrice ¶
func SetPrice(price int)
SetPrice represents `setPrice` method of NameService native contract.
func SetRecord ¶
func SetRecord(name string, recType RecordType, data string)
SetRecord represents `setRecord` method of NameService native contract.
func Symbol ¶
func Symbol() string
Symbol represents `symbol` method of NameService native contract.
func TotalSupply ¶
func TotalSupply() int
TotalSupply represents `totalSupply` method of NameService native contract.
Types ¶
type RecordType ¶
type RecordType byte
RecordType represents NameService record type.
const ( TypeA RecordType = 1 TypeCNAME RecordType = 5 TypeTXT RecordType = 16 TypeAAAA RecordType = 28 )
Various record type.