> ## 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.

# AgentBank Python SDK client reference

> Full method reference for the agentbank-py AgentBankClient — vault, analyst, intent, and attestation operations with Python code examples for Mantle.

The `agentbank-py` client exposes vault, analyst, intent, and attestation operations as direct methods. All methods are on the `AgentBankClient` instance — there are no sub-clients. Import the client and supporting types from `agentbank`:

```python theme={null}
from agentbank import AgentBankClient, Addresses, TEEKind, IntentStatus
```

## Vault

```python theme={null}
# Deposit (amount in wei)
tx = client.deposit(amount_wei=1000 * 10**18)

# Withdraw
tx = client.withdraw(amount_wei=500 * 10**18)

# Read TVL (returns int, wei)
tvl = client.get_tvl()

# Read shares balance
shares = client.get_shares("0x...")

# Estimated APY (returns float, e.g. 8.42)
apy = client.get_apy()
```

## Analyst

```python theme={null}
# Register
tx = client.register_analyst(metadata=b"")

# Deregister
tx = client.deregister_analyst()

# Post signal (reasoning string is auto-hashed with keccak256)
tx = client.post_signal(
    asset="0x...",
    direction=1,        # -1 short, 0 neutral, 1 long
    magnitude=750,      # bps
    reasoning="Bullish RSI divergence on 4H",
    ttl=7200,
)

# Query reputation
rep = client.get_reputation("0x...")
# rep.score, rep.total_signals, rep.profitable_signals, rep.avg_pnl_bps
```

## Intent

```python theme={null}
# Post intent
tx = client.post_intent(
    asset="0x...",
    amount_wei=10_000 * 10**18,
    min_apy_bps=500,
    max_drawdown_bps=200,
    duration=30 * 86400,
)

# Submit solver bid
tx = client.submit_bid(
    intent_id=42,
    tier_vault="0xC44C061D257Af305dEAea2eD093E878a615d856d",
    promised_apy=650,
    bond_amount=1000 * 10**18,
)

# Settle auction (callable by anyone after deadline)
tx = client.settle_auction(intent_id=42)

# List open intents
intents = client.get_open_intents(limit=50)
for i in intents:
    print(i.id, i.amount, IntentStatus(i.status).name)
```

## Attestation

```python theme={null}
# Verify a TEE run
tx = client.verify_run(
    kind=TEEKind.Phala,
    prompt_hash=b"..." ,   # 32 bytes
    output_hash=b"...",
    code_hash=b"...",
    signature=b"...",
)

# Check verification status
run_id = AgentBankClient.compute_run_id(prompt_hash, output_hash, code_hash)
verified = client.is_verified(run_id)

# Fetch full run record
run = client.get_attested_run(run_id)
# run.kind, run.verified, run.timestamp, run.attester_pub_key
```


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