Documentation ¶
Overview ¶
Package neo provides an interface to NeoToken native contract. NEO token is special, it's not just a regular NEP-17 contract, it also provides access to chain-specific settings and implements committee voting system.
Index ¶
- Constants
- func BalanceOf(addr interop.Hash160) int
- func Decimals() int
- func GetAllCandidates() iterator.Iterator
- func GetCandidateVote(pub interop.PublicKey) int
- func GetCommittee() []interop.PublicKey
- func GetCommitteeAddress() interop.Hash160
- func GetGASPerBlock() int
- func GetNextBlockValidators() []interop.PublicKey
- func GetRegisterPrice() int
- func RegisterCandidate(pub interop.PublicKey) bool
- func SetGASPerBlock(amount int)
- func SetRegisterPrice(amount int)
- func Symbol() string
- func TotalSupply() int
- func Transfer(from, to interop.Hash160, amount int, data any) bool
- func UnclaimedGAS(addr interop.Hash160, end int) int
- func UnregisterCandidate(pub interop.PublicKey) bool
- func Vote(addr interop.Hash160, pub interop.PublicKey) bool
- type AccountState
- type Candidate
Constants ¶
const Hash = "\xf5\x63\xea\x40\xbc\x28\x3d\x4d\x0e\x05\xc4\x8e\xa3\x05\xb3\xf2\xa0\x73\x40\xef"
Hash represents NEO contract hash.
Variables ¶
This section is empty.
Functions ¶
func GetAllCandidates ¶
GetAllCandidates represents `getAllCandidates` method of NEO native contract. It returns Iterator over the whole set of Neo candidates sorted by public key bytes. Each iterator value can be cast to Candidate. Use iterator interop package to work with the returned Iterator.
func GetCandidateVote ¶
GetCandidateVote represents `getCandidateVote` method of NEO native contract. It returns -1 if the candidate hasn't been registered or voted for and the overall candidate votes otherwise.
func GetCommittee ¶
GetCommittee represents `getCommittee` method of NEO native contract.
func GetCommitteeAddress ¶
GetCommitteeAddress represents `getCommitteeAddress` method of NEO native contract.
func GetGASPerBlock ¶
func GetGASPerBlock() int
GetGASPerBlock represents `getGasPerBlock` method of NEO native contract.
func GetNextBlockValidators ¶
GetNextBlockValidators represents `getNextBlockValidators` method of NEO native contract.
func GetRegisterPrice ¶
func GetRegisterPrice() int
GetRegisterPrice represents `getRegisterPrice` method of NEO native contract.
func RegisterCandidate ¶
RegisterCandidate represents `registerCandidate` method of NEO native contract.
func SetGASPerBlock ¶
func SetGASPerBlock(amount int)
SetGASPerBlock represents `setGasPerBlock` method of NEO native contract.
func SetRegisterPrice ¶
func SetRegisterPrice(amount int)
SetRegisterPrice represents `setRegisterPrice` method of NEO native contract.
func TotalSupply ¶
func TotalSupply() int
TotalSupply represents `totalSupply` method of NEO native contract.
func UnclaimedGAS ¶
UnclaimedGAS represents `unclaimedGas` method of NEO native contract.
func UnregisterCandidate ¶
UnregisterCandidate represents `unregisterCandidate` method of NEO native contract.
Types ¶
type AccountState ¶
AccountState contains info about a NEO holder.
func GetAccountState ¶
func GetAccountState(addr interop.Hash160) *AccountState
GetAccountState represents `getAccountState` method of NEO native contract.
type Candidate ¶
Candidate represents a single native Neo candidate.
func GetCandidates ¶
func GetCandidates() []Candidate
GetCandidates represents `getCandidates` method of NEO native contract. It returns up to 256 candidates. Use GetAllCandidates in case if you need the whole set of candidates.