> ## Documentation Index
> Fetch the complete documentation index at: https://0xcaptain.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Install the AgentBank TypeScript SDK

> Install @agentbank/sdk via npm or pnpm, create a read-only or read-write AgentBankClient, and configure contract addresses for Mantle mainnet.

The `@agentbank/sdk` package provides a TypeScript client for interacting with the AgentBank V3 protocol on Mantle. It wraps the vault, analyst, intent, and attestation contracts behind typed interfaces.

## Install

```bash theme={null}
npm install @agentbank/sdk viem
# or
pnpm add @agentbank/sdk viem
```

`viem` is a required peer dependency.

## Create a client

```typescript theme={null}
import { AgentBankClient } from "@agentbank/sdk";
import { createPublicClient, createWalletClient, http } from "viem";
import { mantle } from "viem/chains";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);

const publicClient = createPublicClient({
  chain: mantle,
  transport: http("https://rpc.mantle.xyz"),
});

const walletClient = createWalletClient({
  chain: mantle,
  transport: http("https://rpc.mantle.xyz"),
  account,
});

const client = new AgentBankClient({
  publicClient,
  walletClient,           // omit for read-only mode
  addresses: {
    vault:        "0xC44C061D257Af305dEAea2eD093E878a615d856d",
    signalBoard:  "0x2A46cF6493b377D45908254B0528e38990AA323f",
    intentRouter: "0x9582d2dF303ec2B1fab104A77E249C05571fccC9",
    teeVerifier:  "0x51E52dCBD0FBfaDaDB43ad1EB1Ea0d3A79f128c3",
  },
  assetDecimals: 18,      // optional, defaults to 18
});
```

## Read-only mode

Omit `walletClient` to create a read-only client. Read operations work normally; write operations throw an error.

```typescript theme={null}
const readOnly = new AgentBankClient({
  publicClient,
  addresses: { /* ... */ },
});

const tvl = await readOnly.vault.getTVL();  // works
await readOnly.vault.deposit({ amount: "100" }); // throws
```

## Client modules

| Module | Class | Purpose |
| - | - | - |
| `client.vault` | `VaultClient` | Deposit, withdraw, redeem, read TVL/APY |
| `client.analyst` | `AnalystClient` | Register, post signals, query reputation |
| `client.intent` | `IntentClient` | Post intents, submit bids, settle auctions |
| `client.attestation` | `AttestationClient` | Verify TEE-attested agent runs |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.