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

# TypeScript SDK API 参考

> Helius TypeScript SDK 中所有 API 方法的完整列表，按命名空间组织：DAS API、RPC V2、交易、增强交易、Webhooks、WebSockets、Staking、Wallet API、ZK Compression 和标准 Solana RPC。

[Helius TypeScript SDK](https://github.com/helius-labs/helius-sdk) 的完整方法参考。有关安装和入门，请参阅[TypeScript SDK 概述](/zh/agents/typescript-sdk)。

## 标准 Solana RPC

所有标准 Solana RPC 方法都可以直接在 `helius.*` 上通过对基础 `@solana/kit` Rpc 客户端的代理使用：

```typescript theme={"system"}
const balance = await helius.getBalance(address).send();
const blockhash = await helius.getLatestBlockhash().send();
const slot = await helius.getSlot().send();
```

属性 `helius.raw` 显式公开相同的 `Rpc` 客户端，在传递给需要标准 `Rpc` 对象的第三方库时很有用。

## DAS API（数字资产标准）

使用统一接口查询 NFT、压缩 NFT、同质代币和其他数字资产。

```typescript theme={"system"}
helius.getAsset({ id })                                    // Single asset by mint
helius.getAssetBatch({ ids })                              // Multiple assets
helius.getAssetsByOwner({ ownerAddress, page, limit })     // Assets by wallet
helius.getAssetsByAuthority({ authorityAddress })           // Assets by update authority
helius.getAssetsByCreator({ creatorAddress })               // Assets by creator
helius.getAssetsByGroup({ groupKey, groupValue })           // Assets by collection
helius.searchAssets({ ownerAddress, tokenType, ... })       // Flexible search
helius.getAssetProof({ id })                               // Merkle proof (cNFTs)
helius.getAssetProofBatch({ ids })                         // Batch Merkle proofs
helius.getTokenAccounts({ owner })                         // Token accounts
helius.getNftEditions({ id })                              // Print editions
helius.getSignaturesForAsset({ id })                       // Transaction history for asset
```

## RPC V2 方法

增强的 RPC 方法，支持服务器端分页、过滤和代币账户。

```typescript theme={"system"}
helius.getTransactionsForAddress([address, config])        // Transaction history (paginationToken)
helius.getProgramAccountsV2([programId, config])           // Program accounts (paginationKey)
helius.getTokenAccountsByOwnerV2([owner, filter?, config]) // Token accounts (paginationKey)
helius.getPriorityFeeEstimate({ accountKeys, options })    // Fee estimates
```

## 交易

构建和发送优化的交易，具有自动计算单元估算和优先费用。

```typescript theme={"system"}
helius.tx.sendSmartTransaction({ instructions, signers })  // Auto-optimized send
helius.tx.createSmartTransaction({ instructions, signers })// Build without sending
helius.tx.sendTransactionWithSender({ ..., region })       // Helius Sender (low latency)
```

## 增强交易

将原始交易解析为可读且带标签的格式。

```typescript theme={"system"}
helius.enhanced.getTransactions({ transactions })          // Parse by signatures
helius.enhanced.getTransactionsByAddress({ address })      // Parse by address
```

## Webhooks

为链上事件创建和管理实时 HTTP POST 通知。

```typescript theme={"system"}
helius.webhooks.create({ webhookURL, transactionTypes, accountAddresses })
helius.webhooks.get(webhookID)
helius.webhooks.getAll()
helius.webhooks.update(webhookID, params)
helius.webhooks.delete(webhookID)
```

## WebSockets

通过 WebSocket 连接流式传输实时区块链数据。

```typescript theme={"system"}
helius.ws.logsNotifications(filter, config)                // Transaction logs
helius.ws.accountNotifications(address, config)            // Account changes
helius.ws.signatureNotifications(signature, config)        // Tx confirmation
helius.ws.slotNotifications(config)                        // Slot updates
helius.ws.programNotifications(programId, config)          // Program account changes
helius.ws.close()                                          // Clean up connections
```

## Staking

将SOL委托给Helius验证者并管理委托账户。

```typescript theme={"system"}
helius.stake.createStakeTransaction(owner, amountSol)                          // Stake SOL
helius.stake.createUnstakeTransaction(ownerSigner, stakeAccount)               // Unstake
helius.stake.createWithdrawTransaction(withdrawAuth, stakeAcct, dest, lamports)// Withdraw
helius.stake.getHeliusStakeAccounts(wallet)                // List stake accounts
```

## Wallet API

通过REST端点查询钱包余额、交易历史、转账和身份信息。

```typescript theme={"system"}
helius.wallet.getBalances({ wallet })                      // Token balances
helius.wallet.getHistory({ wallet })                       // Transaction history
helius.wallet.getTransfers({ wallet })                     // Transfer history
helius.wallet.getIdentity({ wallet })                      // Known identity lookup
helius.wallet.getBatchIdentity({ addresses })              // Batch identity (max 100)
helius.wallet.getFundedBy({ wallet })                      // Funding source
```

## ZK Compression

使用压缩账户和代币以节省98%的链上存储成本。

```typescript theme={"system"}
helius.zk.getCompressedAccount({ address })                // Single compressed account
helius.zk.getCompressedAccountsByOwner({ owner })          // By owner
helius.zk.getCompressedTokenAccountsByOwner({ owner })     // Compressed tokens
helius.zk.getCompressedAccountProof({ hash })              // Merkle proof
helius.zk.getCompressedBalance({ address })                // Balance
helius.zk.getValidityProof({ hashes })                     // Validity proof
```
