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

# 에이전트를 위한 Helius 러스트 SDK

> AI 에이전트를 위한 Helius 러스트 SDK에 대한 완전한 가이드. DAS API, 트랜잭션, Helius Sender, 웹훅, Enhanced WebSockets, 스테이킹, Wallet API 및 전체 API 퀵 레퍼런스에 대한 비동기 러스트 바인딩.

[Helius Rust SDK](https://github.com/helius-labs/helius-rust-sdk)는 모든 Helius API에 대한 비동기 Rust 바인딩을 제공하여 고성능 에이전트 작업에 적합합니다.

* **크레이트**: `helius` (crates.io)
* **버전**: 1.x (`solana-client` 3.0, `solana-sdk` 3.0 사용)
* **런타임**: 비동기 (`tokio` 1.x)
* **러스트**: 1.85+ (에디션 2021)
* **HTTP 클라이언트**: `reqwest`
* **라이선스**: MIT

## 설치

```toml theme={"system"}
[dependencies]
helius = "1.0.0"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
solana-sdk = "3.0.0"
```

크레이트는 기본적으로 `native-tls`로 설정됩니다. OpenSSL을 사용할 수 없는 경우 유용한 순수-Rust TLS를 사용하려면 다음을 사용하십시오:

```toml theme={"system"}
helius = { version = "1.0.0", default-features = false, features = ["rustls"] }
```

## 빠른 시작

```rust theme={"system"}
use helius::error::Result;
use helius::types::*;
use helius::Helius;

#[tokio::main]
async fn main() -> Result<()> {
    let helius = Helius::new("YOUR_API_KEY", Cluster::MainnetBeta)?;

    // Get all NFTs owned by a wallet
    let assets = helius.rpc().get_assets_by_owner(GetAssetsByOwner {
        owner_address: "86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY".to_string(),
        page: 1,
        limit: Some(50),
        ..Default::default()
    }).await?;

    // Get transaction history (with token account activity)
    let txs = helius.rpc().get_transactions_for_address(
        "86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY".to_string(),
        GetTransactionsForAddressOptions {
            limit: Some(100),
            transaction_details: Some(TransactionDetails::Full),
            filters: Some(GetTransactionsFilters {
                token_accounts: Some(TokenAccountsFilter::BalanceChanged),
                ..Default::default()
            }),
            ..Default::default()
        },
    ).await?;

    // Send a transaction via Helius Sender (ultra-low latency)
    let sig = helius.send_smart_transaction_with_sender(
        SmartTransactionConfig {
            create_config: CreateSmartTransactionConfig {
                instructions: vec![transfer_instruction],
                signers: vec![wallet_signer],
                ..Default::default()
            },
            ..Default::default()
        },
        SenderSendOptions {
            region: "US_EAST".to_string(),
            ..Default::default()
        },
    ).await?;

    Ok(())
}
```

## 클라이언트 생성자

### `Helius::new` — 기본 동기 클라이언트

```rust theme={"system"}
let helius = Helius::new("YOUR_API_KEY", Cluster::MainnetBeta)?;
```

가장 간단한 생성자입니다. `.await`가 필요하지 않습니다. RPC 메서드, 웹훅, 향상된 트랜잭션, 스마트 트랜잭션 및 Wallet API를 제공합니다. 비동기 Solana 클라이언트 또는 WebSocket 지원이 없습니다.

### `Helius::new_async` — 전체 기능 비동기 클라이언트

```rust theme={"system"}
let helius = Helius::new_async("YOUR_API_KEY", Cluster::MainnetBeta).await?;
```

프로덕션에 권장됩니다. 비동기 Solana RPC 클라이언트와 향상된 WebSocket 스트리밍을 포함합니다. WebSocket 연결을 설정하기 때문에 `.await`가 필요합니다.

### `Helius::new_with_url` — 사용자 지정 RPC 엔드포인트

```rust theme={"system"}
let helius = Helius::new_with_url("http://localhost:8899")?;
```

전용 RPC 노드, 프록시 또는 로컬 개발에 사용됩니다. API 키가 필요하지 않습니다.

### `HeliusBuilder` — 고급 구성

```rust theme={"system"}
use helius::HeliusBuilder;

let helius = HeliusBuilder::new()
    .with_api_key("YOUR_API_KEY")?
    .with_cluster(Cluster::MainnetBeta)
    .with_async_solana()
    .with_websocket(None, None)
    .with_commitment(CommitmentConfig::confirmed())
    .build()
    .await?;
```

### `HeliusFactory` — 다중 클러스터

```rust theme={"system"}
let factory = HeliusFactory::new("YOUR_API_KEY");
let devnet_client = factory.create(Cluster::Devnet)?;
let mainnet_client = factory.create(Cluster::MainnetBeta)?;
```

### 내장된 Solana 클라이언트에 접근하기

```rust theme={"system"}
helius.connection()          // Sync SolanaRpcClient (Arc)
helius.async_connection()?   // Async SolanaRpcClient (requires new_async or HeliusBuilder)
helius.ws()                  // Enhanced WebSocket (Option)
helius.rpc()                 // Helius RpcClient (Arc)
helius.config()              // Config (Arc)
```

## 심층 분석

<CardGroup cols={2}>
  <Card title="모범 사례" icon="lightbulb" href="/docs/ko/agents/rust-sdk/best-practices">
    권장 패턴, 페이지네이션, 일반적인 실수 및 오류 처리
  </Card>

  <Card title="API 참조" icon="book" href="/docs/ko/agents/rust-sdk/api-reference">
    모든 카테고리에 대한 전체 메서드 목록
  </Card>
</CardGroup>

## 리소스

<CardGroup cols={2}>
  <Card title="GitHub 리포지토리" icon="github" href="https://github.com/helius-labs/helius-rust-sdk">
    소스 코드, 예제 및 이슈 추적
  </Card>

  <Card title="docs.rs" icon="book" href="https://docs.rs/helius/latest/helius/">
    docs.rs의 전체 API 문서
  </Card>

  <Card title="코드 예제" icon="code" href="https://github.com/helius-labs/helius-rust-sdk/tree/dev/examples">
    카테고리별로 정리된 모든 기능에 대한 작동 예제
  </Card>

  <Card title="마이그레이션 가이드 (0.x ~ 1.0)" icon="arrow-right" href="https://github.com/helius-labs/helius-rust-sdk/blob/main/MIGRATION.md">
    solana-sdk 1.x에서 3.0으로 업그레이드
  </Card>
</CardGroup>
