# 토큰 및 NFT 조회

### 계정 정보 조회 하기 <a href="#retrieve-account-information" id="retrieve-account-information"></a>

로그인이 성공적으로 완료된 이후에만 사용 가능한 기능입니다. 앱에서 사용하는 지갑의 계정 정보를 반환합니다.

```http
GET /v1/account?userId={userId}&walletId={walletId} HTTP/1.1
Host: sdk.wepin.io
X-API-KEY: ${APP_KEY}
X-API-DOMAIN: {APP_DOMAIN}
X-SDK-TYPE: {platform}_rest_api
Content-Type: application/json
Authorization: Bearer ${access_token}
```

#### Request

**Parameter**

<table><thead><tr><th width="136">Name</th><th width="105">Type</th><th width="371">Description</th><th>Required</th></tr></thead><tbody><tr><td>userId</td><td>String</td><td><a href="/pages/OuSeFTVsA0hkjyoAOvnH#login">로그인</a> 과정에서 받은 <code>userInfo</code>의 userId</td><td>O</td></tr><tr><td>walletId</td><td>String</td><td><a href="/pages/OuSeFTVsA0hkjyoAOvnH#login">로그인</a> 결과 받은 사용자 지갑 ID</td><td>O</td></tr></tbody></table>

#### Response

**Success Response**

<table><thead><tr><th width="145">Name</th><th width="204">Type</th><th>Description</th></tr></thead><tbody><tr><td>walletId</td><td>String</td><td>사용자 지갑 ID</td></tr><tr><td>accounts</td><td>Account(Object) []</td><td>조회 된 계정 리스트 (<code>Account</code>)</td></tr></tbody></table>

* `Account`

  * `accountId` *String*
    * 계정 고유 식별 번호
  * `accountTokenId` *String (Optional)*
    * 토큰 계정 고유 식별 번호. 토큰 계정인 경우에만 반환.
  * `address` *String*
    * 계정의 주소
  * `addressPath` *String*
    * 계정의 주소 경로
  * `label` *String*
    * 계정 라벨
  * `balance` *String*
    * 계정 잔액
  * `coinId` *Integer (Optional)*
    * 계정의 코인 정보 식별 번호. 네이티브 코인인 경우에만 반환.
  * `name` *String*
    * 계정의 코인 정보 이름
  * `network` *String*
    * 계정의 네트워크 이름
  * `symbol` *String*
    * 계정의 심볼
  * `decimals` *Integer*
    * 계정의 코인 데시멀 값
  * `contract` *String (Optional)*
    * 토큰 계정의 컨트랙트 주소. 토큰 계정인 경우에만 반환.
  * `iconUrl` *String*
    * 계정의 아이콘 이미지 URL
  * `ids` *String*
    * 계정의 코인 정보를 조회 하기 위한 식별 값

***Example***

```json
// Klaytn 메인 계정과 KCT(토큰) 계정이 있는 경우 
{
	"walletId": "999999999999999999999999999999999999999999999999999999999999999999",
  "accounts": [
    {
      "accountId": "90",
      "address": "0x9990000000000000000000000000000000000000",
      "addressPath": "m/44'/60'/0'/0/0",
      "coinId": 2,
      "symbol": "KLAY",
      "label": "KLAY-01",
      "name": "Klaytn",
      "network": "KLAYTN",
      "balance": "123407670918639753",
      "decimals": 18,
      "iconUrl": "<https://coin-img.wepin.io/coinlogo/klaytn.png>",
      "ids": "klay-token"
    },
    {
      "accountId": "90",
      "accountTokenId": "91",
      "address": "0x9990000000000000000000000000000000000000",
      "addressPath": "m/44'/60'/0'/0/0",
      "contract": "0x52CFDA3E278837d852C4315586C9464BE762647E",
      "symbol": "COSM",
      "label": "COSM",
      "name": "Cosmo Coin",
      "network": "KLAYTN",
      "balance": "20000000000000000",
      "decimals": 18,
      "iconUrl": "<https://coin-img.wepin.io/coinlogo/cosmo.png>",
      "ids": "cosmo-coin"
    }
  ]
}
```

***

### 계정 잔액 새로 고침 <a href="#refresh-account-balance" id="refresh-account-balance"></a>

계정의 잔액을 새로 고침 합니다. Front 서비스에서 새로 고침을 사용자의 요청에 의해 수행하는 경우, 1분 이내에 다시 요청하지 않도록 UI/UX를 제공할 것을 권장합니다.

```http
GET /v1/accountbalance/{accountId}/balance HTTP/1.1
Host: sdk.wepin.io
X-API-KEY: ${APP_KEY}
X-API-DOMAIN: {APP_DOMAIN}
X-SDK-TYPE: {platform}_rest_api
Content-Type: application/json
Authorization: Bearer ${access_token}
```

#### Request

**Parameter**

<table><thead><tr><th width="143">Name</th><th width="120">Type</th><th width="366">Description</th><th>Required</th></tr></thead><tbody><tr><td>accountId</td><td>String</td><td><a href="#undefined">계정 정보 조회</a> 시 받은 accountId</td><td>O</td></tr></tbody></table>

#### Response

**Success Response**

<table><thead><tr><th width="223">Name</th><th width="278">Type</th><th>Description</th></tr></thead><tbody><tr><td>balance</td><td>String</td><td>계정 잔액</td></tr><tr><td>decimals</td><td>Integer</td><td>계정의 데시멀 값</td></tr><tr><td>symbol</td><td>String</td><td>계정의 심볼</td></tr><tr><td>tokens</td><td>TokenBalance(Object) []</td><td>계정 토큰들의 잔액 리스트 (<code>TokenBalance</code>)</td></tr></tbody></table>

* `TokenBalance`

  * `balance` *String*
    * 토큰 계정 잔액
  * `decimals` *Integer*
    * 토큰 계정 데이멀 값
  * `symbol` *String*
    * 토큰 계정의 심볼
  * `contract` *String*
    * 토큰 계정의 컨트랙트 주소

***Example***

```json
{
	"balance": "123407670918639753",
  "decimals": 18,
  "symbol": "KLAY",
  "tokens": [
		{
		  "balance": "20000000000000000",
			"decimals": 18,
			"symbol": "COSM",
			"contract": "0x52CFDA3E278837d852C4315586C9464BE762647E"
		}
	]
}
```

***

### NFT 정보 조회 하기 <a href="#retrieve-nft-information" id="retrieve-nft-information"></a>

로그인이 성공적으로 완료된 이후에만 사용 가능한 기능입니다. 앱에서 사용하는 지갑의 NFT 정보를 반환합니다.

```http
GET /v1/nft?userId={userId}&walletId={walletId} HTTP/1.1
Host: sdk.wepin.io
X-API-KEY: ${APP_KEY}
X-API-DOMAIN: {APP_DOMAIN}
X-SDK-TYPE: {platform}_rest_api
Content-Type: application/json
Authorization: Bearer ${access_token}
```

#### Request

**Parameter**

<table><thead><tr><th width="144">Name</th><th width="99">Type</th><th width="401">Description</th><th>Required</th></tr></thead><tbody><tr><td>userId</td><td>String</td><td><a href="/pages/OuSeFTVsA0hkjyoAOvnH#login">로그인</a> 과정에서 받은 <code>userInfo</code>의 userId</td><td>O</td></tr><tr><td>walletId</td><td>String</td><td><a href="/pages/OuSeFTVsA0hkjyoAOvnH#login">로그인</a> 결과 받은 사용자 지갑 ID</td><td>O</td></tr></tbody></table>

#### Response

**Success Response**

<table><thead><tr><th width="140">Name</th><th width="203">Type</th><th>Description</th></tr></thead><tbody><tr><td>nfts</td><td>NFT(Object) []</td><td>조회 된 NFT 리스트 (<code>NFT</code>)</td></tr></tbody></table>

* `NFT`

  * `id` *String*
    * NFT 고유 식별 번호
  * `accountId` *String*
    * NFT 가 있는 계정 고유 식별 번호
  * `name` *String*
    * NFT 이름
  * `description` *String*
    * NFT 설명
  * ### `tokenId` *String*
  * `externalLink` *String*
    * NFT 외부 링크
  * `imageUrl` *String*
    * NFT 이미지 URL
  * `quantity` *Integer*
    * NFT 개수
  * `contentType` *Integer*
    * NFT 컨텐츠의 종류
    * `1` : image
    * `2` : video
  * `contract` *Object*
    * NFT contract 의 정보 (`NFTContract`)

  *Example*

  ```json
  {
  	"nfts": []
  }
  ```
* `NFTContract`
  * `address` *String*
    * NFT Contract address
  * `scheme` *Integer*
    * NFT Contract Scheme
    * `1` : ERC721
    * `2` : ERC1155
  * `description` *String*
    * NFT Contract 설명
  * `network` *String*
    * 네트워크
  * `externalLink` *String*
    * NFT Contract 외부 링크
  * `imageUrl` *String*
    * NFT Contract 이미지 URL

### NFT 정보 새로 고침 <a href="#refresh-nft-information" id="refresh-nft-information"></a>

NFT 정보를 새로 고침 합니다. Front 서비스에서 새로 고침을 사용자의 요청에 의해 수행하는 경우, 1분 이내에 다시 요청하지 않도록 UI/UX 를 제공할 것을 권장합니다.

```http
GET /v1/nft/refresh?userId={userId}&walletId={walletId} HTTP/1.1
Host: sdk.wepin.io
X-API-KEY: ${APP_KEY}
X-API-DOMAIN: {APP_DOMAIN}
X-SDK-TYPE: {platform}_rest_api
Content-Type: application/json
Authorization: Bearer ${access_token}
```

#### Request

**Parameter**

<table><thead><tr><th width="124">Name</th><th width="100">Type</th><th width="413">Description</th><th>Required</th></tr></thead><tbody><tr><td>userId</td><td>String</td><td><a href="/pages/OuSeFTVsA0hkjyoAOvnH#login">로그인</a> 과정에서 받은 <code>userInfo</code> 의 userId</td><td>O</td></tr><tr><td>walletId</td><td>String</td><td><a href="/pages/OuSeFTVsA0hkjyoAOvnH#login">로그인</a> 결과 받은 사용자 지갑 ID</td><td>O</td></tr></tbody></table>

#### Response

[NFT 정보 조회 하기](#nft) Response 와 동일 합니다.


---

# Agent Instructions: 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:

```
GET https://docs.wepin.io/restful-api/token-and-nft.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
