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

# SDK Options

> Use lightweight helpers to call the Gas API and Cashmere contracts.

## Cashmere Agent SDK

The official TypeScript SDK for programmatic and AI-agent-driven USDC transfers:

```bash theme={null}
npm install @cashmerelabs/cashmere-agent-sdk
```

```ts theme={null}
import { CashmereCCTP } from '@cashmerelabs/cashmere-agent-sdk';

const cctp = new CashmereCCTP({
  evm: { privateKey: process.env.EVM_PRIVATE_KEY },
});

// Simulate first
const sim = await cctp.simulate({ from: 'ethereum', to: 'arbitrum', amount: '100' });

// Then execute
const result = await cctp.transfer({
  from: 'ethereum',
  to: 'arbitrum',
  amount: '100',
  recipient: '0xDestinationAddress',
});
```

The SDK supports all 16 chains, CCTP V1/V2, and includes built-in tool schemas for [OpenAI Assistants, LangChain, and crewAI](/developers/agent-integration).

<Callout type="info">
  See the [Agent Integration](/developers/agent-integration) guide for AI framework-specific setup (LangChain, OpenAI function calling, crewAI).
</Callout>

***

## Direct Integration (No SDK)

You can also integrate without the SDK:

1. Call the [Gas API](/developers/backend-apis#gas-api-gascashmereexchange) to fetch fees and signatures.
2. Interact directly with the [`CashmereCCTP` contracts](/developers/smart-contracts).
3. Use the [Monitoring API](/developers/backend-apis#points--leaderboard-api-kapicashmereexchange) for analytics and monitoring.

<Callout type="info">
  This approach keeps client code transparent and portable across frameworks.
</Callout>

***

## Helper Snippets

### TypeScript Utility

```ts theme={null}
/**
 * Fetches a signed fee quote for Cashmere transferV2 transactions.
 */
export async function getTransferV2Quote({
  localDomain,
  destinationDomain,
  isNative,
}: {
  localDomain: number;
  destinationDomain: number;
  isNative: boolean;
}) {
  const res = await fetch(
    'https://gas.cashmere.exchange/getEcdsaSig_native?' +
      new URLSearchParams({
        localDomain: String(localDomain),
        destinationDomain: String(destinationDomain),
        isV2: 'true',
        isNative: String(isNative),
      })
  );
  if (!res.ok) throw new Error('Gas API error');
  return (await res.json()) as {
    fee: string;
    deadline: string;
    signature: string;
    isNative: boolean;
    cctpVersion: number;
  };
}
```

### Go Utility

```go theme={null}
package cashmere

import (
    "encoding/json"
    "fmt"
    "net/http"
)

type EcdsaQuote struct {
    Fee         string `json:"fee"`
    Deadline    string `json:"deadline"`
    Signature   string `json:"signature"`
    IsNative    bool   `json:"isNative"`
    CctpVersion int    `json:"cctpVersion"`
}

func GetECDSAQuote(local, dest int, isNative bool) (*EcdsaQuote, error) {
    url := fmt.Sprintf("https://gas.cashmere.exchange/getEcdsaSig_native?localDomain=%d&destinationDomain=%d&isV2=true&isNative=%t", local, dest, isNative)
    resp, err := http.Get(url)
    if err != nil {
        return nil, err
    }
    defer resp.Body.Close()

    if resp.StatusCode != http.StatusOK {
        return nil, fmt.Errorf("Gas API returned status %s", resp.Status)
    }

    var quote EcdsaQuote
    if err := json.NewDecoder(resp.Body).Decode(&quote); err != nil {
        return nil, err
    }
    return &quote, nil
}
```

### Rust (Solana Client)

```rust theme={null}
use anyhow::{bail, Result};
use reqwest;

pub async fn get_ed25519_quote(local: u32, dest: u32, is_native: bool) -> Result<Ed25519Quote> {
    let url = format!(
        "https://gas.cashmere.exchange/getEd25519Sig_native?localDomain={}&destinationDomain={}&isNative={}&version=2",
        local, dest, is_native
    );
    let resp = reqwest::get(&url).await?;
    if !resp.status().is_success() {
        bail!("gas api error: {}", resp.status());
    }
    Ok(resp.json::<Ed25519Quote>().await?)
}
```

`Ed25519Quote` should mirror the Gas API response fields (`signature`, `message`, `publicKey`, `fee`, `deadline`, `isNative`, `version`).

***

## Resources

* [@cashmerelabs/cashmere-agent-sdk on GitHub](https://github.com/cashmere-prod/cashmere-agent-sdk) — source code, issues, SKILL.md
* [@cashmerelabs/cashmere-agent-sdk on NPM](https://www.npmjs.com/package/@cashmerelabs/cashmere-agent-sdk) — published package
* [Agent Integration Guide](/developers/agent-integration) — LangChain, OpenAI, crewAI setup
* [Contract Addresses](/developers/contract-addresses) — all deployed addresses
