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

# getStakeMinimumDelegation 사용법

> getStakeMinimumDelegation 사용 사례, 코드 예제, 요청 매개변수, 응답 구조 및 팁을 알아보세요.

[`getStakeMinimumDelegation`](https://www.helius.dev/docs/api-reference/rpc/http/getstakeminimumdelegation) RPC 메서드는 Solana 네트워크에서 새로운 [스테이크](https://www.helius.dev/blog/how-to-stake-solana) 위임을 생성하는 데 필요한 최소 람포트 수량을 반환합니다. 이 값은 네트워크 거버넌스 또는 업데이트로 인해 시간이 지남에 따라 변경될 수 있습니다.

## 일반적인 사용 사례

* **스테이크 금액 검증:** 새로운 스테이크 계정을 생성하거나 스테이크를 위임하기 전에 이 값을 확인하여 계획된 위임이 최소 요구 사항을 충족하는지 확인하세요.
* **스테이킹 UI/UX:** 스테이킹 인터페이스에서 사용자에게 최소 위임 금액을 표시하여 입력을 안내합니다.
* **자동 스테이킹 스크립트:** 자동 스테이킹 프로세스가 유효한 위임 금액을 사용하도록 보장합니다.

## 요청 매개변수

이 메서드는 하나의 선택적 매개변수를 갖습니다:

1. **`config`** (객체, 선택 사항): 다음 필드를 포함하는 구성 객체:
   * **`commitment`** (문자열, 선택 사항): 값을 쿼리할 때 사용할 [확인 수준](https://www.helius.dev/blog/solana-commitment-levels)을 지정합니다. 생략하면 RPC 노드의 기본 확정성이 사용됩니다(일반적으로 `finalized`).

## 응답 구조

JSON-RPC 응답의 `result` 필드는 다음을 포함하는 `RpcResponse` 객체입니다:

* **`context`** (객체): 다음 필드를 포함하는 `RpcResponseContext` 객체:
  * **`slot`** (`u64`): 데이터를 검색한 슬롯.
* **`value`** (`u64`): 람포트로 된 최소 스테이크 위임 금액.

**응답 예시:**

```json theme={"system"}
{
  "jsonrpc": "2.0",
  "result": {
    "context": { "slot": 123456789 },
    "value": 1000000000 // Represents 1 SOL, for example
  },
  "id": 1
}
```

## 예시

### 1. 현재 스테이크 최소 위임 획득

이 예시는 기본 확정성을 사용하여 현재 최소 스테이크 위임 금액을 가져옵니다.

<CodeGroup>
  ```bash cURL theme={"system"}
  # Replace <api-key> with your Helius API key
  curl https://mainnet.helius-rpc.com/?api-key=<api-key> -X POST -H "Content-Type: application/json" -d \
    '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "getStakeMinimumDelegation"
    }'
  ```

  ```javascript JavaScript (using @solana/web3.js) theme={"system"}
  // Replace <api-key> with your Helius API key
  const { Connection } = require('@solana/web3.js');

  async function getMinimumDelegation() {
    const connection = new Connection('https://mainnet.helius-rpc.com/?api-key=<api-key>');
    try {
      const minDelegation = await connection.getStakeMinimumDelegation();
      console.log(`Current minimum stake delegation: ${minDelegation} lamports`);
      // The raw response includes context:
      // const fullResponse = await connection.getStakeMinimumDelegation('confirmed'); // Example with commitment
      // console.log(JSON.stringify(fullResponse, null, 2));
    } catch (error) {
      console.error('Error fetching stake minimum delegation:', error);
    }
  }

  getMinimumDelegation();
  ```
</CodeGroup>

### 2. 특정 확정성을 가진 스테이크 최소 위임 획득

<CodeGroup>
  ```bash cURL theme={"system"}
  # Replace <api-key> with your Helius API key
  curl https://mainnet.helius-rpc.com/?api-key=<api-key> -X POST -H "Content-Type: application/json" -d \
    '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "getStakeMinimumDelegation",
      "params": [
        {
          "commitment": "confirmed"
        }
      ]
    }'
  ```

  ```javascript JavaScript (using @solana/web3.js) theme={"system"}
  // Replace <api-key> with your Helius API key
  const { Connection } = require('@solana/web3.js');

  async function getMinimumDelegationConfirmed() {
    const connection = new Connection('https://mainnet.helius-rpc.com/?api-key=<api-key>');
    try {
      const minDelegationResponse = await connection.getStakeMinimumDelegation('confirmed');
      console.log(`Confirmed minimum stake delegation: ${minDelegationResponse.value} lamports at slot ${minDelegationResponse.context.slot}`);
    } catch (error) {
      console.error('Error fetching confirmed stake minimum delegation:', error);
    }
  }

  getMinimumDelegationConfirmed();
  ```
</CodeGroup>

## 개발자 팁

* **람포트와 SOL:** 반환된 값은 람포트입니다. 1 SOL = 1,000,000,000 람포트임을 기억하세요.
* **동적 값:** 최소 위임 금액은 네트워크 매개변수에 의해 변경될 수 있습니다. 주기적으로 또는 중요한 작업 전에 이 값을 쿼리하는 것이 좋으며 하드코딩하지 않는 것이 좋습니다. 자세한 가이드를 통해 [스테이킹](https://www.helius.dev/blog/how-to-stake-solana)에 대해 알아보세요.
* **확인 수준:** 다른 확인 수준을 사용하면 반환된 값이 얼마나 최신인지를 영향을 줄 수 있습니다. `finalized`는 가장 신뢰할 수 있는 값을 제공하며, `processed`는 클러스터에서 완전히 확인되지 않은 더 새로운 값을 제공할 수 있습니다.

이 가이드는 Solana에서 최소 요구 스테이크 위임을 검색하기 위해 `getStakeMinimumDelegation` RPC 메서드를 효과적으로 사용하는 데 도움이 될 것입니다.
