check_has_key
Check if an address has a registered viewing key
Public, read-only queries against the Directory contract. No authentication required — works with a standard Web3 instance.
Signatures
# check_has_key
def check_has_key(w3: Web3, address: ChecksumAddress) -> bool
async def async_check_has_key(w3: AsyncWeb3, address: ChecksumAddress) -> bool
# get_key_hash
def get_key_hash(w3: Web3, address: ChecksumAddress) -> bytes
async def async_get_key_hash(w3: AsyncWeb3, address: ChecksumAddress) -> bytesParameters
Parameter
Type
Description
w3
Web3 / AsyncWeb3
Standard Web3 instance (no Seismic namespace required)
address
ChecksumAddress
Address to query
Returns
check_has_key—Trueif the address has a registered viewing keyget_key_hash— 32-bytekeccak256hash of the viewing key (zero bytes if no key registered)
Example
Notes
Both use plain
eth_call— no gas cost, no encryption neededThe key hash is used as the 4th topic in SRC20 Transfer and Approval events for filtering
See Also
register_viewing_key — Register a viewing key
get_viewing_key — Fetch your viewing key (authenticated)
Last updated

