> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kash.bot/llms.txt
> Use this file to discover all available pages before exploring further.

# Protocol SDK — overview

> @kashdao/protocol-sdk — non-custodial TypeScript SDK for the on-chain Kash protocol. BYO RPC, signer, bundler.

`@kashdao/protocol-sdk` is the **direct-to-chain** SDK for Kash. It
talks to the Kash protocol contracts on Base — no Kash backend,
no Kash REST API in the trade path, no Kash-controlled keys, no
Kash-sponsored gas. Trade execution is end-to-end self-custodied.

If you'd like a hosted, API-key-authed integration (typical retail
flow, fastest time to first trade), use [`@kashdao/sdk`](/developer-docs/rest-api/sdks/typescript)
instead. This page is for builders who run their own signing
infrastructure (market makers, AI agents, on-chain UIs).

## Trust model — zero custody, zero Kash dependency

The package never holds keys, never signs transactions, never
sponsors gas, and never reaches Kash-hosted infrastructure.
Everything required to use it lives on the consumer's side: their
RPC URL, their signer, (optionally) their bundler URL, their funded
address. Kash sees only what hits the public chain.

This is by design — the SDK is a strict library, not a service.
Code review for an audit only needs to verify what `@kashdao/protocol-sdk`
imports (today: `viem`, `zod`) and what it sends out
(`eth_sendRawTransaction` to your RPC; `eth_sendUserOperation` to
your bundler). No phone-home. No telemetry.

## Two trading modes — pick one

The SDK supports both wallet models the protocol allows.

| Mode                              | Factory                    | Best for                                                                                                                                              |
| --------------------------------- | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| **EOA** (vanilla EIP-1559)        | `createEoaClient`          | Market makers with existing tx-signing infra (web3signer, Fireblocks-direct, AWS-KMS, ethers/viem wallet). No bundler. Lowest per-trade overhead.     |
| **Smart Account** (ERC-4337 v0.7) | `createSmartAccountClient` | Self-custody UIs, AI-agent runners, retail-adjacent integrators that benefit from gasless onboarding via paymaster, social recovery, or session keys. |

Both modes are first-class peers. Both share the same on-chain read
surface. Both preserve the zero-custody trust story. You can use
one or both side-by-side.

## Supported chains

| Chain        | Chain ID | Status                                                           |
| ------------ | -------- | ---------------------------------------------------------------- |
| Base mainnet | 8453     | ⏳ Pre-deploy — `KashChainError(CHAIN_NOT_DEPLOYED)` until launch |
| Base Sepolia | 84532    | ✅ Live                                                           |
| Custom chain | any      | ✅ Via `customChain: CustomChain(...)` (Anvil / forks / dev)      |

Custom chains are an explicit escape hatch — supply your own chain
id, RPC URL, and contract address bundle. The static registry is
bypassed; Anvil deployments with non-canonical EntryPoint addresses
keep working.

## Install

```bash theme={null}
pnpm add @kashdao/protocol-sdk viem
# or: npm install @kashdao/protocol-sdk viem
```

`viem` is a **peer dependency** — bring your own. The SDK accepts
any `viem@^2.45.0` you have in your tree (so it doesn't drag a
duplicate `viem` into your bundler).

## Where to next

<CardGroup cols={2}>
  <Card title="Quickstart — EOA mode" icon="key" href="/developer-docs/protocol-sdk/quickstart-eoa">
    Vanilla EIP-1559 from a plain wallet. The canonical path for market makers.
  </Card>

  <Card title="Quickstart — Smart-account mode" icon="cube" href="/developer-docs/protocol-sdk/quickstart-smart-account">
    ERC-4337 v0.7 with a bundler. The canonical path for AA stacks.
  </Card>

  <Card title="Error handling" icon="circle-exclamation" href="/developer-docs/protocol-sdk/error-handling">
    Typed error hierarchy, retry policies, decoded revert hints.
  </Card>

  <Card title="Cross-language parity" icon="arrow-right-arrow-left" href="/developer-docs/protocol-sdk/cross-language-parity">
    How this SDK stays byte-equal with `kashdao-protocol-sdk` (Python). A position opened via either SDK can be closed via the other.
  </Card>

  <Card title="Python SDK" icon="python" href="/developer-docs/protocol-sdk-python/overview">
    Same protocol, same trust model, Python instead of TypeScript. The canonical Hummingbot integration path.
  </Card>
</CardGroup>
