neo¶
- class NEO¶
Bases:
object
A class used to represent the NEO native contract
- classmethod decimals() → int¶
Gets the amount of decimals used by NEO.
- Returns
the number 8.
- Return type
- classmethod totalSupply() → int¶
Gets the total token supply deployed in the system.
- Returns
the total token supply deployed in the system.
- Return type
- classmethod balanceOf(account: boa3.builtin.type.UInt160) → int¶
Get the current balance of an address.
- classmethod transfer(from_address: boa3.builtin.type.UInt160, to_address: boa3.builtin.type.UInt160, amount: int, data: Optional[Any] = None) → bool¶
Transfers an amount of GAS from one account to another
If the method succeeds, it will fire the Transfer event and must return true, even if the amount is 0, or from and to are the same address.
- Parameters
- Returns
whether the transfer was successful
- Return type
- Raises
Exception – raised if from_address or to_address length is not 20 or if amount is less than zero.
- classmethod get_gas_per_block() → int¶
Gets the amount of GAS generated in each block.
- Returns
the amount of GAS generated
- Return type
- classmethod unclaimed_gas(account: boa3.builtin.type.UInt160, end: int) → int¶
Gets the amount of unclaimed GAS in the specified account.
- classmethod register_candidate(pubkey: boa3.builtin.type.ECPoint) → bool¶
Registers as a candidate.
- classmethod unregister_candidate(pubkey: boa3.builtin.type.ECPoint) → bool¶
Unregisters as a candidate.
- classmethod vote(account: boa3.builtin.type.UInt160, vote_to: boa3.builtin.type.ECPoint) → bool¶
Votes for a candidate.
- classmethod get_all_candidates() → boa3.builtin.interop.iterator.Iterator¶
Gets the registered candidates iterator.
- Returns
all registered candidates
- Return type
- classmethod un_vote(account: boa3.builtin.type.UInt160) → bool¶
Removes the vote of the candidate voted. It would be the same as calling vote(account, None).
- Parameters
account (UInt160) – the account that is removing the vote
- classmethod get_candidates() → List[Tuple[boa3.builtin.type.ECPoint, int]]¶
Gets the list of all registered candidates.
- classmethod get_candidate_vote(pubkey: boa3.builtin.type.ECPoint) → int¶
Gets votes from specific candidate.
- Returns
Votes or -1 if it was not found.
- Return type
- classmethod get_committee() → List[boa3.builtin.type.ECPoint]¶
Gets all committee members list.
- Returns
all committee members
- Return type
List[ECPoint]
- classmethod get_next_block_validators() → List[boa3.builtin.type.ECPoint]¶
Gets validators list of the next block.
- Returns
the public keys of the validators
- Return type
List[ECPoint]
- classmethod get_account_state(account: boa3.builtin.type.UInt160) → boa3.builtin.contract.NeoAccountState¶
Gets the latest votes of the specified account.
- Parameters
account (UInt160) – the specified account
- Returns
the state of the account
- Return type