> For the complete documentation index, see [llms.txt](https://docs.chiliz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chiliz.com/ko/gaebal/gibon/bangbeob-gaideu/jigap-janaeg-johoe.md).

# 지갑 잔액 조회하기

## 지갑의 CHZ 잔액이란?

지갑 잔액은 지갑이 보유한 특정 암호화폐의 총량을 말합니다. 프로젝트에 따라 단일 암호화폐 잔액이나 지갑이 보유한 모든 암호화폐의 잔액을 표시해야 할 수 있습니다.

마찬가지로, 지갑 자산은 암호화폐 지갑에 저장되고 관리되는 모든 형태의 암호화폐, 토큰, 디지털 자산을 말합니다.

## Moralis로 조회하는 방법

Moralis에는 활용할 수 있는 [Wallet API](https://moralis.com/api/wallet/)가 있으며, 지갑 잔액 사용 사례에 대한 코드 샘플도 제공합니다.

* [주소의 네이티브 잔액 가져오기](https://docs.moralis.io/web3-data-api/evm/wallet-api/how-to-get-the-balance-of-a-wallet)

코드 샘플을 수정하려면 Ethereum 참조를 Chiliz Chain의 ID인 `0x15b38`으로 교체합니다.

```typescript
import Moralis from "moralis";

const runApp = async() => {
  await Moralis.start({
    apiKey: "YOUR_API_KEY",
    // ...and any other configuration
  });

  const address = "0xYourWalletAddress";

  const chain = "0x15b38", // Chiliz Chain Mainnet용.
                           // Spicy Testnet은 "0x15b32"를 사용합니다.

  const response = await Moralis.EvmApi.balance.getNativeBalance({
    address,
    chain,
  });

  console.log(response.toJSON());
};

runApp();
```

## Tatum으로 조회하는 방법

Tatum에는 활용할 수 있는 포괄적인 [Data API](https://tatum.io/blockchain-api)가 있으며, 자산 조회 사용 사례에 대한 코드 샘플도 제공합니다.

* [지갑이 보유한 모든 자산 가져오기](https://docs.tatum.io/docs/get-all-assets-the-wallet-holds)

코드 샘플을 수정하려면 Ethereum 참조를 Chiliz Chain으로 교체합니다.

```typescript
import {TatumSDK, Network, Chiliz, ResponseDto, AddressBalance} from '@@tatumio/tatum'

const tatum = await TatumSDK.init<Chiliz>({network: Network.CHILIZ})

const balance: ResponseDto<AddressBalance[]> = await tatum.address.getBalance({
  addresses: ['0xYourWalletAddress'], // 주소로 교체하세요
})

console.log(balance.data)
```

## thirdweb으로 조회하는 방법

thirdweb은 문서 사이트에 영감으로 활용할 수 있는 짧은 코드 샘플을 여러 개 제공합니다.

* [지갑 잔액 가져오기](https://portal.thirdweb.com/connect/in-app-wallet/how-to/interact-with-wallets#get-wallet-balance)

[Chiliz에 맞게 수정된](https://thirdweb.com/chiliz-chain) 코드입니다.

```typescript
const sdk = new ThirdwebSDK("https://88888.rpc.thirdweb.com");
const walletAddress = "0xYourWalletAddress";

async function getWalletBalance() {
  try {
    const balance = await sdk.getBalance(walletAddress);
    console.log(`Balance of wallet ${walletAddress}: ${balance.displayValue} ${balance.symbol}`);
  } catch (error) {
    console.error("Error fetching wallet balance:", error);
  }
}

getWalletBalance();
```

## Nodit으로 조회하는 방법

Nodit은 [문서](https://developer.nodit.io/reference/chiliz-getnativebalancebyaccount)에서 다음 코드 샘플을 제공합니다.

```typescript
const url = 'https://web3.nodit.io/v1/chiliz/mainnet/native/getNativeBalanceByAccount';
const options = {
  method: 'POST',
  headers: {
    accept: 'application/json',
    'content-type': 'application/json',
    'X-API-KEY': 'nodit-demo'
  },
  body: JSON.stringify({accountAddress: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.chiliz.com/ko/gaebal/gibon/bangbeob-gaideu/jigap-janaeg-johoe.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
