Directory
Manage viewing keys in the Directory genesis contract
Overview
Quick Start
Register a Viewing Key
from seismic_web3 import create_wallet_client, PrivateKey, Bytes32
from seismic_web3.src20 import register_viewing_key
import os
private_key = PrivateKey.from_hex_str(os.environ["PRIVATE_KEY"])
w3 = create_wallet_client("https://gcp-1.seismictest.net/rpc", private_key=private_key)
viewing_key = Bytes32(os.urandom(32))
tx_hash = register_viewing_key(
w3,
encryption=w3.seismic.encryption,
private_key=private_key,
key=viewing_key,
)
w3.eth.wait_for_transaction_receipt(tx_hash)
print("Key registered")Fetch Your Viewing Key
Check if Address Has Key
Functions
Key Management
Function
Description
Public Queries
Function
Description
Pure Helper
Function
Description
Directory Contract
Key Properties
Storage
Key Hash
Security
Common Workflows
First-Time Setup
Key Rotation
Async Operations
Gas Costs
Operation
Gas Cost (approx)
Notes
See Also
Last updated

