module
neo3.wallet.utils
NEO address utilities.
Functions
address_to_script_hash
(
address
)
(UInt160) — Convert the specified address to a script hash.is_valid_address
(
address
)
(bool) — Test if the provided address is a valid address.public_key_to_script_hash
(
public_key
)
(UInt160) — Convert the specified public key to a script hash.script_hash_to_address
(
script_hash
,address_version
)
(str) — Convert the specified script hash to an address.validate_address
(
address
,address_version
)
— Validate a given address. If address is not valid an exception will be raised.
function
neo3.wallet.utils.
address_to_script_hash
(
address
)
→ UInt160
Convert the specified address to a script hash.
Parameters
address
() — address to convert.
Raises
ValueError
— if the length of data (address value in bytes) is not valid.ValueError
— if the account version is not valid.
function
neo3.wallet.utils.
is_valid_address
(
address
)
→ bool
Test if the provided address is a valid address.
Parameters
address
() — an address.
function
neo3.wallet.utils.
public_key_to_script_hash
(
public_key
)
→ UInt160
Convert the specified public key to a script hash.
function
neo3.wallet.utils.
script_hash_to_address
(
script_hash
, address_version=53
)
→ str
Convert the specified script hash to an address.
Parameters
script_hash
() — script hash to convert.address_version
(, optional) — network protocol address version. Historically has been fixed to0x35
for MainNet and TestNet.Use thegetversion()
RPC method to query for its value.
function
neo3.wallet.utils.
validate_address
(
address
, address_version=53
)
Validate a given address. If address is not valid an exception will be raised.
Parameters
address
() — an address.address_version
(, optional) — network protocol address version. Historically has been fixed to0x35
for MainNet and TestNet.Use thegetversion()
RPC method to query for its value.
Raises
ValueError
— if the length of data(address value in bytes) is not valid.ValueError
— if the account version is not valid.