> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/creator/content-creator-ko/tutorials-and-examples/rewards/reward-claim-dispenser.md).

# 보상 수령 배포기

Rewards 캠페인에서 보상을 수령하는 착용 아이템 배포기와 에어드롭 상자입니다.

Decentraland Rewards 캠페인에서 플레이어에게 웨어러블을 제공합니다. 씬에는 클릭하여 보상을 받는 디스펜서, 버튼 디스펜서, 그리고 보상을 받을 수 있는 상자를 에어드롭하는 레버가 포함되어 있습니다.

## 프로젝트 정보

**관리자:** Decentraland

[소스 보기](https://github.com/decentraland/sdk7-goerli-plaza/tree/main/reward-claim)

**라이선스:** [Apache-2.0](https://github.com/decentraland/sdk7-goerli-plaza/blob/main/reward-claim/LICENSE). 재사용하기 전에 원본 저장소의 약관을 확인하세요. 코드와 에셋에 서로 다른 약관이 적용될 수 있습니다.

## 코드 살펴보기

이 링크는 특정 소스 스냅샷을 가리키므로, 상위 프로젝트의 개발이 계속되어도 설명을 유용하게 참고할 수 있습니다. 학습을 위한 참고 자료이며 보안 평가 자료는 아닙니다.

### 서명된 fetch로 보상 요청하기

`claimToken` 반복 클릭을 제한하고, 이번 세션에서 이미 성공적으로 보상을 받은 디스펜서는 건너뛰며, 플레이어에게 지갑이 있는지 확인합니다. `requestToken` 그런 다음 `signedFetch`.

**를 사용해 디스펜서 키, 현재 카탈리스트, 플레이어 주소를 Rewards 서버에 POST합니다.** 테스트는 기본적으로 활성화되어 있으며(`CONFIG_CLAIM_TESTING_ENABLED` src/config.ts `에서 설정), 번들에 포함된 테스트 캠페인을 사용합니다. 자체 캠페인을 사용하려면`ClaimConfig `에서 플레이스홀더 캠페인 ID와 디스펜서 키를 바꾸고 테스트를 비활성화하세요. 캠페인과 디스펜서를 만드는 방법은 Rewards 시작 가이드를 참조하세요.` claimToken

**소스 참고:**

* [`및` requestToken `프로젝트 맥락:`](https://github.com/decentraland/sdk7-goerli-plaza/blob/54a07775ee340f0ce22eb23280ef0e9c35f5e386/reward-claim/src/dispenser/claiming/claim.ts#L26-L99)
* [`ClaimConfig`](https://github.com/decentraland/sdk7-goerli-plaza/blob/54a07775ee340f0ce22eb23280ef0e9c35f5e386/reward-claim/src/dispenser/claiming/claimConfig.ts#L21-L34)

### Rewards 응답을 플레이어 피드백으로 표시하기

`processResponse` 는 캠페인을 사용할 수 없는 경우, 디스펜서의 재고가 없는 경우, 보상이 이미 배정된 경우, 보상을 성공적으로 받은 경우에 각각 다른 디스펜서 UI를 표시합니다. 시작되지 않은 캠페인, 비활성화된 캠페인, 종료된 캠페인은 같은 분기에서 처리합니다. 캠페인 설정에 `startDate` 또는 `endDate`가 설정된 경우에만 시작 전 또는 종료 화면을 표시하고, 그 외에는 일반 종료 화면을 표시합니다.

**프로젝트 맥락:** UI 상태는 `dispenserUi.tsx`에 정의되어 있습니다. 캠페인 시작일과 종료일은 캠페인 설정의 선택 항목입니다.

**소스 참고:**

* [`processResponse`](https://github.com/decentraland/sdk7-goerli-plaza/blob/54a07775ee340f0ce22eb23280ef0e9c35f5e386/reward-claim/src/dispenser/claiming/claim.ts#L101-L197)

### 캡차로 보상 요청 재시도하기

Rewards 서버가 캡차를 요청하면 `getCaptcha` 가 캡차 이미지를 가져와 디스펜서 UI에 표시합니다. 답을 제출하면 `claimToken` 이 캡차 ID와 답변을 포함해 다시 호출됩니다.

**프로젝트 맥락:** 캡차 필요 여부는 Rewards 대시보드에서 디스펜서별로 설정합니다.

**소스 참고:**

* [`getCaptcha`](https://github.com/decentraland/sdk7-goerli-plaza/blob/54a07775ee340f0ce22eb23280ef0e9c35f5e386/reward-claim/src/dispenser/claiming/claim.ts#L209-L216)
* [캡차 제출 버튼](https://github.com/decentraland/sdk7-goerli-plaza/blob/54a07775ee340f0ce22eb23280ef0e9c35f5e386/reward-claim/src/dispenser/claiming/ui/dispenserUi.tsx#L640-L643)

### 에어드롭된 상자에서 보상 받기

`randomCrateSpawn` 는 스테이지 영역의 임의 지점에 낙하산이 달린 상자를 떨어뜨립니다. `DropCrate` 는 아래쪽으로 레이캐스트해 지면을 찾고 상자를 트윈 애니메이션으로 지면에 내려놓습니다. 상자를 클릭하면 보상을 받고 상자는 사라집니다.

**프로젝트 맥락:** 크레이트 드롭은 다음에 의해 트리거됩니다. `Activate` Creator Hub 레버의 액션으로, 다음 위치에 있습니다. `main`.

**소스 참고:**

* [`randomCrateSpawn` 및 `SpawnCrate`](https://github.com/decentraland/sdk7-goerli-plaza/blob/54a07775ee340f0ce22eb23280ef0e9c35f5e386/reward-claim/src/crate.ts#L40-L119)
* [`DropCrate`](https://github.com/decentraland/sdk7-goerli-plaza/blob/54a07775ee340f0ce22eb23280ef0e9c35f5e386/reward-claim/src/crate.ts#L142-L189)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decentraland.org/creator/content-creator-ko/tutorials-and-examples/rewards/reward-claim-dispenser.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
