Signed Reads
Encrypted eth_call that proves your identity to the contract
Why this matters
# This proves your identity to the contract
result = token.read.balanceOf()
# This does NOT — msg.sender will be 0x0
result = token.tread.balanceOf()What gets encrypted
Basic example
import os
from eth_abi import decode
from seismic_web3 import PrivateKey, SEISMIC_TESTNET, SRC20_ABI
pk = PrivateKey.from_hex_str(os.environ["PRIVATE_KEY"])
w3 = SEISMIC_TESTNET.wallet_client(pk)
token = w3.seismic.contract("0xYourTokenAddress", SRC20_ABI)
raw = token.read.balanceOf()
balance = decode(["uint256"], bytes(raw))[0]
print(balance)Low-level API
Async variant
See Also
Last updated

