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

# Tài liệu tham khảo API của TypeScript SDK

> Mọi phương thức Solana API trong Helius TypeScript SDK, được sắp xếp theo namespace — DAS API, RPC V2, giao dịch, webhook, WebSocket, staking và Nén ZK.

Tài liệu tham khảo đầy đủ về các phương thức của [Helius TypeScript SDK](https://github.com/helius-labs/helius-sdk). Để biết cách cài đặt và bắt đầu sử dụng, hãy xem [tổng quan về TypeScript SDK](/docs/vi/agents/typescript-sdk).

## RPC Solana tiêu chuẩn

Tất cả phương thức RPC Solana tiêu chuẩn đều khả dụng trực tiếp trên `helius.*` thông qua proxy đến máy khách Rpc `@solana/kit` bên dưới:

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

Thuộc tính `helius.raw` cung cấp trực tiếp cùng một máy khách `Rpc`, hữu ích khi truyền vào các thư viện bên thứ ba yêu cầu một đối tượng `Rpc` tiêu chuẩn.

## DAS API (Tiêu chuẩn tài sản kỹ thuật số)

Truy vấn NFT, NFT nén, token có thể thay thế và các tài sản kỹ thuật số khác bằng một giao diện thống nhất.

```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
```

## Các phương thức RPC V2

Các phương thức RPC nâng cao hỗ trợ phân trang, lọc và tài khoản token ở phía máy chủ.

```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
```

## Giao dịch

Tạo và gửi các giao dịch được tối ưu hóa với khả năng tự động ước tính đơn vị tính toán và phí ưu tiên.

```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)
```

## Giao dịch nâng cao

Phân tích giao dịch thô thành các định dạng dễ đọc và có nhãn.

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

## Webhook

Tạo và quản lý thông báo HTTP POST theo thời gian thực cho các sự kiện trên chuỗi.

```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)
```

## WebSocket

Truyền dữ liệu blockchain theo thời gian thực qua các kết nối 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

Stake SOL vào trình xác thực Helius và quản lý các tài khoản stake.

```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

Truy vấn số dư ví, lịch sử giao dịch, các lần chuyển tài sản và thông tin danh tính qua các endpoint 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
```

## Nén ZK

Làm việc với các tài khoản và token nén để giảm 98% chi phí lưu trữ trên chuỗi.

```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
```
