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

# ListElement

> 계정 잔액을 구성하는 보유 자산입니다. 모든 통화와 토큰이 각각 자체 행을 가지며, 이름과 달러 환산 가치를 큰 순서대로 표시합니다. 행은 뷰어가 어느 행을 탭했는지 알려 주므로 해당 항목에 대한 자체 화면을 열 수 있습니다. `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)의 [`Balances`](https://docs.whop.com/ko/elements/latest/wallet/balances) 안에 마운트됩니다. `accountId`와 `openHoldingOnSelect`는 `Wallet`에서 가져옵니다. props와 콜백은 생성 옵션 또는 React props로 전달합니다.

뷰 계층의 어디에나 마운트됩니다. `accountId`를 받아 자체 데이터를 불러오며, 클로저도 전달하면 행을 탭할 수 있게 됩니다. 루트는 `VStack`이므로 콘텐츠에 맞게 크기가 정해지고 주어진 너비를 채웁니다.

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

function Example() {
  return (
    <WhopElements elements={loadWhop()}>
      <Wallet /* options */>
        <Balances>
          <ListElement onBalanceSelected={(e) => console.log(e)} onAccountSelected={(e) => console.log(e)} onCreditsSelected={(e) => console.log(e)} />
        </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('list', {
    onBalanceSelected: (e) => console.log(e),
    onAccountSelected: (e) => console.log(e),
    onCreditsSelected: (e) => console.log(e)
  }).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 {
    var body: some View {
        ListElement(
            accountId: "biz_xxxx"
        ) { balance in
            print(balance.symbol)
        }
    }
}
```

예시 데이터입니다. [Playground 열기](https://docs.whop.com/ko/elements/latest/wallet/overview#playground).

[iPhone 시뮬레이터에서 실행 중인 ListElement](https://app.revyl.ai/embed/f128a268-f5e0-47c1-8919-86e4f04d6876?controls=0)

## Props

**accessToken** `string`

읽기에 사용되는 범위 지정 토큰입니다. 계정에는 `company:balance:read`가 필요하고, 사용자의 보유 자산 또는 소유 계정 목록에는 `user:balance:read`가 필요합니다. 서버에서 `POST /api/v1/access_tokens`로 발급하세요. 토큰이 없으면 뷰어 자신의 세션으로 읽으며, 이는 동일 출처에서만 작동합니다.

**includeOwnedAccounts** `boolean`

사용자의 `user_…` 계정에서 개인 계정 안의 보유 자산을 나열하는 대신, 개인 잔액과 그 뒤로 백엔드가 반환하는 모든 소유 계정을 나열합니다. 계정에서는 무시됩니다. 기본값은 `false`입니다.

**showSourceCurrency** `boolean`

각 행을 보유 통화(€4.20, 0.00000009 cbBTC)로 표시하고 그 아래에 달러 가치를 표시합니다. 기본적으로 꺼져 있으므로 모든 행이 달러로 표시됩니다. 기본값은 `false`입니다.

**showUsdEquivalent** `boolean`

자체 통화로 표시된 보유 자산 아래에 달러 가치를 유지합니다. `showSourceCurrency`가 켜져 있을 때만 적용됩니다. 기본값은 `true`입니다.

**showPersonalAccount** `boolean`

`includeOwnedAccounts`가 켜져 있을 때 개인 계정 행을 유지합니다. 앱에 열 수 있는 개인 계정이 없다면 끄세요. 기본값은 `true`입니다.

**maxItems** `number`

큰 순서대로 최대 이 개수만큼의 보유 자산 행을 표시합니다. 더 많은 항목이 있으면 목록에 Show all balances 컨트롤이 추가되어 나머지를 그 자리에서 펼칩니다. 설정하지 않으면 모든 보유 자산이 나열됩니다.

## 이벤트

생성 옵션 또는 React props로 콜백을 전달합니다.

### `onBalanceSelected`

`includeOwnedAccounts`가 꺼진 상태에서 보유 자산 행이 클릭되었습니다. `holding`은 합산된 달러 행이면 `usd`, 그 외에는 보유 자산 기호(`cbBTC`, `EUR`)입니다. `kind`는 세 가지 중 어느 것인지 알려 주므로 기호를 직접 분류하지 않고도 라우팅할 수 있습니다. 엘리먼트는 직접 페이지를 이동하지 않습니다.

**payload** `object`

**속성**

**holding** `string` *required*

**kind** `"usd" | "cash" | "asset"` *required*

### `onAccountSelected`

`includeOwnedAccounts`가 켜진 상태에서 계정 행이 클릭되었습니다. `accountId`는 개인 `user_…` 태그 또는 소유한 `biz_…` 태그이며, `kind`를 사용하면 이를 검사하지 않고도 라우팅할 수 있습니다. 엘리먼트는 직접 페이지를 이동하지 않습니다.

**payload** `object`

**속성**

**accountId** `string` *required*

**kind** `"personal" | "business"` *required*

### `onCreditsSelected`

Whop 크레딧 행이 클릭되었습니다. 크레딧은 Whop에서만 사용할 수 있고 출금할 수 없으므로 모든 보유 자산 행과 별도로 표시되며, 호스트가 자체 크레딧 화면을 엽니다. 엘리먼트는 직접 페이지를 이동하지 않습니다.

### `onLoaderStart`

로딩 스켈레톤이 처음 그려진 후, `onReady` 전에 실행됩니다.

### `onReady`

엘리먼트가 처음으로 완전히 그려진 후 실행됩니다.

### `onError`

엘리먼트가 로드에 실패하거나 충돌할 때 실행됩니다. 대체 화면은 계속 표시됩니다. 프로그래밍 방식으로 처리하려면 `code`를 사용하세요. `sourceKey`는 실패한 호스트 상태 소스를 식별합니다.

**e** `object`

**속성**

**message** `string` *required*

**code** `string`

**sourceKey** `string`

## 메서드

`create`가 반환한 핸들에서, 또는 React `ref`를 통해 호출합니다.

### `mount`

`target`에 엘리먼트를 마운트하고 로딩을 시작합니다. React 컴포넌트는 자동으로 마운트됩니다.

**매개변수**

**target** `string | HTMLElement` *required*

### `destroy`

엘리먼트를 제거하고 프레임과 구독을 해제합니다. 여러 번 호출해도 됩니다. React는 엘리먼트를 자동으로 제거합니다.

### `update`

마운트된 엘리먼트에 새 props를 병합합니다. React에서는 대신 컴포넌트 props를 변경하세요.

**매개변수**

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

## 스타일링

`appearance.classes`를 통해 다음 부분의 스타일을 지정합니다. 속성 이름은 카멜 케이스 또는 케밥 케이스를 사용하고 단위를 포함하세요. 페이지 스타일시트는 엘리먼트의 프레임에 적용되지 않습니다. 프레임워크는 각 선언을 삽입하기 전에 유효성을 검사합니다.

| 클래스 | 대상 |
| - | - |
| `.whop-ActivityRow` | 원장 활동 행 하나 — 아이콘, 제목, 타임스탬프, 금액 |
| `.whop-ActivitySurface` | 활동 피드 — 제목, 필터, 가져온 모든 행 |
| `.whop-BalanceBreakdownSurface` | 통화 잔액 총액, 구간 막대, 금액 행 |
| `.whop-BalanceRow` | 잔액 행 하나 — 아이콘, 이름, 가치, 셰브론 |
| `.whop-BalancesSurface` | 잔액 목록 — 보유 자산 또는 계정당 한 행 |
| `.whop-CashBalanceSurface` | 보유 자산 잔액 페이지 — 뒤로 가기, 제목, 금액, 분할, 작업, 활동 |
| `.whop-PlatformCreditsRow` | Whop 발행 크레딧 — Whop에서만 사용 가능하며 출금 불가 |

```ts theme={null}
const wallet = whop.wallet.create({
  appearance: {
    classes: {
      'whop-ActivityRow': { borderRadius: '8px', fontWeight: '600' },
      'whop-ActivitySurface': { borderRadius: '8px', fontWeight: '600' },
      'whop-BalanceBreakdownSurface': { borderRadius: '8px', fontWeight: '600' }
    }
  }
});

// 7 classes use this shape
wallet.update({
  appearance: { classes: { 'whop-ActivityRow': { fontWeight: '700' } } }
});
```

React에서는 `appearance`를 `<Wallet>`에 전달합니다. 전역으로 설정하려면 `WhopElements({ appearance })`를 사용하세요.

## 매개변수

**accountId** `String` *required*

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

**onBalanceSelected** `((WalletBalance) -\> Void)?`

뷰어가 탭한 행과 함께 호출됩니다. 생략하면 행이 셰브론 없이 렌더링되고 탭해도 아무 일도 일어나지 않습니다.

## `WalletBalance`

선택 시 반환되는 값:

* `id: String`: 행마다 고정된 값
* `symbol: String`: `USD`, `BTC`, …
* `displayName: String`: 행에 표시되는 이름
* `amountUsd: Decimal`: 행의 달러 환산 가치
* `isCrypto: Bool`: 법정 화폐가 아닌 암호화폐 보유 자산 여부

## 상태

잔액을 불러오는 동안 자리 표시자 행 두 개를 표시합니다. 확인할 수 없는 계정 ID는 `Couldn't load this account.`를 표시합니다. 잔액 읽기 자체가 실패하면 오류를 표시하지 않고 빈 목록을 렌더링합니다.

## 알아두면 좋은 점

* 자체적으로 스크롤되지 않으므로, 다른 콘텐츠와 한 화면을 공유할 때는 `ScrollView` 안에 넣으세요.
* 같은 계정의 총액과 그 변화를 보여 주는 [`BalanceElement`](https://docs.whop.com/ko/elements/latest/wallet/balances-balance#swift)와 함께 사용하세요.

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