Use this file to discover all available pages before exploring further.
EOA mode is the recommended path for Hummingbot strategies, Python
market makers, and any integration with its own EIP-1559 signer.
The signer IS the trading address — no SimpleAccount indirection,
no bundler relay, no ERC-4337 verification overhead.
import asyncioimport osfrom eth_account import Accountfrom kashdao_protocol_sdk import ( BuildBuyParams, create_eoa_client, usdc, viem_account_eoa_signer,)async def main() -> None: account = Account.from_key(os.environ["KASH_PRIVATE_KEY"]) signer = viem_account_eoa_signer(account) async with create_eoa_client( chain_id=84532, # Base Sepolia rpc=os.environ["BASE_SEPOLIA_RPC"], signer=signer, ) as client: # Read minimal market state. minimal = await client.markets.get(os.environ["KASH_MARKET"]) print(f"market has {minimal.num_outcomes} outcomes; status={minimal.status}") # All-in-one trade. # `BuildBuyParams.smart_account` is the shared field name # used by both EOA and SA modes — in EOA mode pass the EOA # address itself (the trader IS the signer). result = await client.trades.send.buy( os.environ["KASH_MARKET"], BuildBuyParams( smart_account=client.signer.owner_address, outcome=0, amount_usdc=usdc(10), # 10 USDC max_slippage_bps=50, # 0.5% ), ) print(result.transaction_hash, result.success, result.gas_used)asyncio.run(main())
async with (or await client.aclose()) is mandatory for clean
shutdown — the underlying httpx.AsyncClient and web3.py
WebSocket sessions need explicit teardown to avoid socket leaks
in long-running Hummingbot strategies.
Explicit control of signing — e.g. log + audit before signing.
client.trades.build_<action>(...) + hash_of(...)
Construct the unsigned tx, hash it, route to a remote signer.
Submit-time staleness guard (KashSignerError(STALE_SIGNED_TX))
matches the TS-SDK behaviour. Bypass via
EoaSubmitOptions(skip_staleness_check=True) if intentional.
The examples/eoa/ folder ships with three runnable scripts:
git clone https://github.com/KashDAO/protocol-sdk-pythoncd protocol-sdk-pythonpython -m venv .venv && source .venv/bin/activatepip install -e ".[dev]"# Set required env first; see each file's header for the env var list.python examples/eoa/01_quickstart.py # read-side only, safe to runpython examples/eoa/02_one_line_trade.py --confirm # broadcasts a real tx, gatedpython examples/eoa/03_error_handling.py # exercises the typed error hierarchy