Construct the client
markets.*, account.*) can omit it. The first call into
trades.* will throw KashConfigError(BUNDLER_REQUIRED) if the
bundler wasn’t provided — explicit failure rather than silent.
Bundler presets — pick yours
Each preset is a vendor-tuned wrapper around the generic v0.7 bundler client. Subpath imports let your bundler keep its vendor-specific bytes out of consumers using a different vendor.bundler:
Derive the SmartAccount address
factory UserOp
fields auto-populate on the first trade so the deployment goes in
the same UserOp as the actual transaction. After that they stay
empty.
Place a trade — all-in-one
eth_estimateUserOperationGas
failure when the bundler URL is wrong. You can also explicitly probe
via await client.bundler.health().
First-trade-with-deployment
The first UserOp from a fresh SmartAccount carriesfactory +
factoryData so the EntryPoint deploys the account in the same
op. The SDK auto-detects this — you don’t pass anything special.
Subsequent UserOps elide the factory fields. Verification gas is
~5x higher on the deployment op (~600k vs ~100k); the SDK’s gas
estimate accounts for this automatically via the bundler’s
pm_estimateUserOperationGas (or the generic equivalent).
Power users — explicit UserOp lifecycle
client.trades.hashOf(userOp) is the canonical hash you sign over.
Recompute it after populating gas + fees and BEFORE signing —
otherwise the build-time hash is stale and the bundler will reject
the UserOp with AA24 signature error. The auto-prepare path
handles this; manual lifecycle users must remember the recompute.
What’s next
EOA quickstart
Vanilla EIP-1559, no bundler, lower per-trade overhead.
Error handling
Typed error hierarchy.
Cross-language parity
UserOp v0.7 hashes are byte-equal across the TS and Python SDKs by construction.