Basic Wallet Setup
Complete wallet client setup with both sync and async variants
Prerequisites
# Install the SDK
pip install seismic-web3
# Set your private key (32 bytes hex, without 0x prefix)
export PRIVATE_KEY="your_64_char_hex_private_key"Synchronous Wallet Client
import os
from seismic_web3 import create_wallet_client, PrivateKey, SEISMIC_TESTNET
# Load private key from environment
private_key = PrivateKey.from_hex_str(os.environ["PRIVATE_KEY"])
# Method 1: Using chain config (recommended)
w3 = SEISMIC_TESTNET.wallet_client(private_key)
# Method 2: Using RPC URL directly
# w3 = create_wallet_client(
# "https://gcp-1.seismictest.net/rpc",
# private_key=private_key,
# )
# Verify connection
print(f"Connected to chain ID: {w3.eth.chain_id}")
print(f"Current block number: {w3.eth.block_number}")
print(f"Your address: {w3.eth.default_account}")
# Get TEE public key (required for encryption)
tee_pubkey = w3.seismic.get_tee_public_key()
print(f"TEE public key: {tee_pubkey.to_0x_hex()}")
# Check your balance
balance = w3.eth.get_balance(w3.eth.default_account)
print(f"Balance: {w3.from_wei(balance, 'ether')} ETH")Asynchronous Wallet Client
Custom Encryption Key
Error Handling
Expected Output
Common Variations
Using SANVIL Testnet
Multiple Clients (Multi-Account)
Connection Verification
Next Steps
See Also
Last updated

