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

> ## Agent Instructions
> Treat these docs and the Whop MCP server as the source of truth for Whop API behavior. Don't infer endpoint behavior from marketing pages.
> MCP server: connect https://mcp.whop.com/mcp (streamable HTTP, browser sign-in, no API key in the client config) to search these docs and read or change live Whop data. Setup: https://docs.whop.com/developer/guides/ai_and_mcp.md
> Whop CLI: install with `curl -fsSL https://whop.com/install.sh | sh` to scaffold, run, and deploy Whop apps and websites. It acts on production, not the sandbox. Overview: https://docs.whop.com/cli/overview.md Agent mode: https://docs.whop.com/cli/agent-mode.md
> Hosting: Whop serves a site or app from the build `whop apps deploy` uploads, with rollbacks, secrets, and server logs. Guide: https://docs.whop.com/developer/websites/hosting.md
> Plugins: in Claude Code, run `/plugin marketplace add whopio/plugins`, then `/plugin install whop@whop`. Guide: https://docs.whop.com/developer/guides/plugins/claude-code.md Every agent tool: https://docs.whop.com/developer/ai/overview.md
> Environments: build and test in the sandbox (API `https://sandbox-api.whop.com/api/v1`, keys at https://sandbox.whop.com/dashboard/developer, SDK environment `Sandbox`; no real money). Production (API `https://api.whop.com/api/v1`, keys at https://whop.com/dashboard/developer, SDK environment `Production`, the SDK default) moves real money, so use it only at launch. The two share no accounts, keys, products, or webhooks, and their keys look identical: never mix them. Sandbox guide: https://docs.whop.com/developer/guides/sandbox.md Comparison: https://docs.whop.com/developer/quickstart.md
> API: send `Authorization: Bearer <API_KEY>` from your server only, and pin a dated version with the `Api-Version-Date` header. OpenAPI spec: https://api.whop.com/api/v1/openapi.json
> Which API: build on the Current API, whose pages live under https://docs.whop.com/api-reference/ (start at https://docs.whop.com/api-reference/overview.md). Pages under /api-reference/legacy/ are the Legacy API. Use one only when https://docs.whop.com/api-reference/stability.md lists the resource as Legacy-only.

# 잔액

> 계정 자금을 보여 주는 세 가지 뷰입니다. 잔액 뷰는 총액, 그 변화를 보여 주는 차트, 기간 선택기를 표시합니다. 목록 뷰는 총액을 구성하는 보유 자산을 달러 가치로 표시합니다. 내역 뷰는 자금 이동 컨트롤 없이 한 통화를 사용 가능, 대기 중, 리저브, 마이너스 금액으로 나눕니다. `openHoldingOnSelect`가 켜져 있으면 목록 행이 클릭을 보고하는 데 그치지 않고, 이 유닛의 캔버스(차트와 목록)를 해당 보유 자산의 잔액 페이지로 대체합니다.

> [!NOTE]
>
> 이 페이지는 `@whop/elements@1.10.0` 및 `@whop/elements-react@1.10.0`을 다룹니다.

*Since `v1.0.0`.*

[`Wallet`](https://docs.whop.com/ko/elements/latest/wallet/overview) 안에 마운트됩니다. 생성하여 핸들을 얻은 다음, 그 핸들에 엘리먼트를 마운트하세요. 하위 컨트롤러를 제거하려면 `destroy()`를 호출하세요. 새 핸들을 얻으려면 다시 생성하세요.

## 미리 보기

예시 데이터를 사용한 이 하위 컨트롤러의 기본 구성 실시간 인터랙티브 데모입니다:

뷰 계층의 어디에나 마운트됩니다. [`BalanceElement`](https://docs.whop.com/ko/elements/latest/wallet/balances-balance#swift)와 [`ListElement`](https://docs.whop.com/ko/elements/latest/wallet/balances-list#swift)는 서로 독립적이므로 하나만 사용하거나 한 화면에 둘 다 사용할 수 있습니다. 각각 `accountId`를 받아 자체 데이터를 불러옵니다.

## 미리 보기

예제 앱에서 iPhone으로 실행한 모습입니다:

[iPhone 시뮬레이터에서 실행 중인 BalanceElement](https://app.revyl.ai/embed/c1954726-8f9b-483d-9f50-247fa7bfb007?controls=0)

```tsx React theme={null}
import { WhopElements, Wallet, Balances, BalanceElement, BreakdownElement, ListElement } from "@whop/elements-react";
import { loadWhop } from "@whop/elements";

function Example() {
  return (
    <WhopElements elements={loadWhop()}>
      <Wallet /* options */>
        <Balances>
          <BalanceElement />
          <BreakdownElement />
          <ListElement />
        </Balances>
      </Wallet>
    </WhopElements>
  );
}
```

```html JavaScript theme={null}
<script src="https://cdn.whop.com/elements/amber/elements.js" data-whop-elements></script>
<script type="module">
  const wallet = window.WhopElements().wallet.create({ /* options */ });
  const balances = wallet.create('balances', { /* options */ });
  balances.create('balance').mount('#wallet-balances-balance');
  balances.create('breakdown').mount('#wallet-balances-breakdown');
  balances.create('list').mount('#wallet-balances-list');
</script>
```

```swift Swift theme={null}
import SwiftUI
import WhopElements

// WhopSDK.configure(tokenProvider:) runs once at app launch. See Getting started.
struct WalletScreen: View {
    let account = "biz_xxxx"

    var body: some View {
        ScrollView {
            VStack(spacing: 24) {
                BalanceElement(accountId: account)
                ListElement(accountId: account)
            }
            .padding()
        }
    }
}
```

## 옵션

`wallet.create('balances', { … })`에 전달하거나, React에서는 `<Balances>`의 props로 전달하세요. 부모가 주입하는 props는 여기에 나타나지 않습니다.

**accessToken** `string`

잔액 내역과 정산 정보를 읽는 데 사용되는 범위 지정 토큰입니다. 계정에는 `company:balance:read`가 필요합니다. 생략하면 뷰어의 동일 출처 세션이 사용됩니다.

**openHoldingOnSelect** `boolean`

행이 클릭되면 차트와 목록 대신 이 유닛의 보유 자산 잔액 페이지를 표시합니다. `balanceSelected`로 라우팅하는 호스트가 두 번째 화면에 가려지지 않도록 기본적으로 꺼져 있습니다. 기본값은 `false`입니다.

## 메서드

`wallet.create('balances', { … })`로 얻은 하위 핸들에서 호출합니다.

### `update`

하위 컨트롤러에 새 props와 콜백을 병합합니다.

**매개변수**

**options** `Partial\<BalancesSubOptions\>` *required*

### `destroy`

하위 컨트롤러와 그 엘리먼트를 파괴한 다음 전용 슬롯을 해제합니다. 이후 `create("balances")`를 호출하면 새로 시작됩니다.

## 매개변수

**accountId** `String` *required*

뷰가 자금을 읽을 계정입니다. `biz_` 접두사가 붙은 계정 ID를 사용하세요. `user_` 접두사가 붙은 사용자 ID는 뷰어 자신의 잔액을 읽으며, 계정 토큰이 아닌 뷰어 인증(`WhopSDK.configureWithOAuth`)이 필요합니다.

## 상태

각 뷰는 자체 상태를 관리하므로 서로의 렌더링을 막지 않습니다.

## 알아두면 좋은 점

* 상태를 공유하지 않고 독립적으로 로드되므로, 하나만 사용하거나 아래와 같이 둘 다 사용할 수 있습니다.
* 자세한 내용은 [`BalanceElement`](https://docs.whop.com/ko/elements/latest/wallet/balances-balance#swift)와 [`ListElement`](https://docs.whop.com/ko/elements/latest/wallet/balances-list#swift)를 참고하세요. [`ActivityElement`](https://docs.whop.com/ko/elements/latest/wallet/activity#swift)는 그 뒤에 있는 자금 이동 내역을 나열합니다.

> [!NOTE]
>
> 실행 시 `WhopSDK.configure(tokenProvider:)`를 한 번 호출하세요. 뷰는 토큰을 기다립니다. [시작하기](https://docs.whop.com/ko/elements/latest/getting-started.md)를 참고하세요. 테마는 `.whopTheme(_:)`로 적용합니다.

## 엘리먼트

이 하위 컨트롤러가 마운트하는 엘리먼트입니다. 각 엘리먼트에는 자체 페이지가 있습니다.

> [card] [BalanceElement](https://docs.whop.com/ko/elements/latest/wallet/balances-balance.md)
>
> 계정의 잔액과 그 변화를 보여 주는 차트입니다. 맨 위에는 총액과 변동폭이, 그 아래에는 차트가, 맨 아래에는 기간 버튼이 있습니다. 뷰어는 차트의 개별 지점을 읽고 기간을 직접 전환할 수 있습니다.

> [card] [BreakdownElement](https://docs.whop.com/ko/elements/latest/wallet/balances-breakdown.md)
>
> 한 통화의 총액을 사용 가능, 대기 중, 리저브, 마이너스 잔액으로 나누어 보여 줍니다. 값이 0인 행은 표시되지 않으며, 자금 이동 작업은 호스트가 담당하도록 이 화면에는 의도적으로 자금 이동 버튼이 없습니다.

> [card] [SettlementElement](https://docs.whop.com/ko/elements/latest/wallet/balances-settlement.md)
>
> Whop 대시보드에 표시되는 계정 잔액 세부 정보입니다. 사용 가능한 자금, 대기 중인 정산 날짜, 리저브 조건, 마이너스 잔액을 보여 줍니다. 550px 모달로 열리며 balances 핸들의 계정, 통화, 자격 증명을 사용합니다.

> [card] [ListElement](https://docs.whop.com/ko/elements/latest/wallet/balances-list.md)
>
> 계정 잔액을 구성하는 보유 자산입니다. 모든 통화와 토큰이 각각 자체 행을 가지며, 이름과 달러 환산 가치를 큰 순서대로 표시합니다. 행은 뷰어가 어느 행을 탭했는지 알려 주므로 해당 항목에 대한 자체 화면을 열 수 있습니다. `openHoldingOnSelect`가 켜져 있으면 행을 클릭할 때 이 유닛의 차트와 목록 대신 해당 보유 자산의 잔액 페이지가 표시됩니다.
