nameservice

package
v0.94.1-pre Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package nameservice provides interface to NameService native contract. It's a NEP-11 contract implementing a domain name service.

Index

Constants

View Source
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 BalanceOf

func BalanceOf(owner interop.Hash160) int

BalanceOf represents `balanceOf` 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

func IsAvailable(name string) bool

IsAvailable represents `isAvailable` method of NameService native contract.

func OwnerOf

func OwnerOf(tokenID string) interop.Hash160

OwnerOf represents `ownerOf` method of NameService native contract.

func Properties

func Properties(tokenID string) map[string]interface{}

Properties represents `properties` method of NameService native contract.

func Register

func Register(name string, owner interop.Hash160) bool

Register represents `register` method of NameService native contract.

func Renew

func Renew(name string) int

Renew represents `renew` method of NameService native contract.

func Resolve

func Resolve(name string, recType RecordType) []byte

Resolve represents `resolve` method of NameService native contract.

func SetAdmin

func SetAdmin(name string, admin interop.Hash160)

SetAdmin represents `setAdmin` 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 Tokens

func Tokens() iterator.Iterator

Tokens represents `tokens` method of NameService native contract.

func TokensOf

func TokensOf(addr interop.Hash160) iterator.Iterator

TokensOf represents `tokensOf` method of NameService native contract.

func TotalSupply

func TotalSupply() int

TotalSupply represents `totalSupply` method of NameService native contract.

func Transfer

func Transfer(to interop.Hash160, tokenID string) bool

Transfer represents `transfer` 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.

Jump to

Keyboard shortcuts

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