# Methods

## BlockChains

### suspend fun getBlockChainInfo()

#### 설명

체인 ID를 이용하여, 해당 체인 정보를 조회한다.

#### Parameters

| name    | type | 설명    |
| ------- | ---- | ----- |
| chainId | Long | 체인 ID |

#### Result

`Result<`[`FncyChainInfo`](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/domain#fncychaininfo)`>`

### suspend fun getContractInfo()

#### 설명

Contract Address를 이용해 자산 정보를 조회한다.

#### Parameters

| name            | type   | 설명         |
| --------------- | ------ | ---------- |
| chainId         | Long   | 체인 ID      |
| contractAddress | String | Contract주소 |

#### Result

`Result<List<`[`FncyAssetInfo`](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/domain#fncyassetinfo)`>?>`

### suspend fun getFncyInfo()

#### 설명

Fncy 체인 정보를 조회한다.

#### Result

`Result<`[`FncyCurrency`](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/domain#fncycurrency)`?>`

### suspend fun getGasPrice()

#### 설명

Chain의 Gas Price를 조회한다.

#### Parameters

| name    | type | 설명    |
| ------- | ---- | ----- |
| chainId | Long | 체인 ID |

#### Result

`Result<`[`FncyGasPrice`](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/domain#fncygasprice)`>`

## Wallet

### suspend fun getWallet()

#### 설명

사용자 지갑 조회

#### Result

`Result<`[`FncyWallet`](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/domain#fncywallet)`?>`

### suspend fun getWalletAllBalance()

#### 설명

지갑의 자산 금액 조회

#### Parameters

| name | type | 설명    |
| ---- | ---- | ----- |
| wid  | Long | 지갑 ID |

#### Result

`Result<`[`FncyBalance`](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/domain#fncybalance)`>`

### suspend fun getAssetList()

#### 설명

지갑의 자산 목록(Fncy, Eth, Bsc 등)을 조회힌다.

#### Parameters

| name | type | 설명    |
| ---- | ---- | ----- |
| wid  | Long | 지갑 ID |

#### Result

`Result<`[`PagingData`](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/etc#pagingdata-less-than-t-greater-than)`<List<`[`FncyAsset`](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/domain#fncyasset)`>?>>`

### suspend fun getAssetById()

#### 설명

자산 ID를 이용하여 지갑의 자산 정보를 가져온다.

#### Parameters

| name    | type | 설명    |
| ------- | ---- | ----- |
| wid     | Long | 지갑 ID |
| assetId | Long | 자산 ID |

#### Result

`Result<`[`FncyAsset`](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/domain#fncyasset)`?>`

### suspend fun getNFTList()

#### 설명

지갑의 NFT 목록을 가져온다.

#### Parameters

| name     | type                                                                                                | 설명                 |
| -------- | --------------------------------------------------------------------------------------------------- | ------------------ |
| wid      | Int                                                                                                 | 지갑 ID              |
| filter   | [NFTOption](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/etc#nftoption)? = null | NFT 조회 옵션(보유, 판매)  |
| pageNo   | Int = 1                                                                                             | 페이지 번호(Default: 1) |
| pageSize | Int = 20                                                                                            | 페이지 크기(Default: 1) |

#### Result

`Result<`[`PagingData`](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/etc#pagingdata-less-than-t-greater-than)`<List<`[`FncyNFT`](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/domain#fncynft)`>?>>`

### suspend fun getNFTById()

#### 설명

nftId를 이용하여 NFT 단건 정보를 조회한다.

#### Parameters

| name  | type | 설명     |
| ----- | ---- | ------ |
| wid   | Int  | 지갑 ID  |
| nftId | Int  | nft ID |

#### Result

Result<[FncyNFT](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/domain#fncynft)?>

### suspend fun makeWallet()

#### 설명

지갑생성을 요청할때 호출한다.

#### Parameters

| name       | type   | 설명      |
| ---------- | ------ | ------- |
| walletName | String | 지갑의 이름  |
| pinNumber  | String | 지갑 비밀번호 |

#### Result

`Result<Unit>`

### suspend fun getQuestionList()

#### 설명

지갑 복원용 질문 목록을 가져온다.

#### Result

`Result<`[`PagingData`](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/etc#pagingdata-less-than-t-greater-than)`<List<`[`FncyQuestion`](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/domain#fncyquestion)`>?>>`

### suspend fun postRegisterRestorationKey()

#### 설명

지갑의 복원키(지갑 복구 질문/답변)을 등록한다.

#### Parameters

| name        | type   | 설명         |
| ----------- | ------ | ---------- |
| wid         | Int    | 지갑 ID      |
| questionSeq | String | 복구용 질문 seq |
| answer      | String | 답변         |
| pinNumber   | String | 지갑 비밀번호    |

#### Result

`Result<Unit>`

### suspend fun checkWalletPinNumber()

#### 설명

지갑 비밀번호를 확인한다.

#### parameters

| name      | type   | 설명      |
| --------- | ------ | ------- |
| pinNumber | String | 지갑 비밀번호 |

#### Result

`Result<Unit>`

### suspend fun checkResetAnswer()

#### 설명

백업용 질문 답변을 확인한다.

#### Parameters

| name   | type   | 설명         |
| ------ | ------ | ---------- |
| answer | String | 백업용 질문의 답변 |

#### Result

`Result<Unit>`

### suspend fun resetWalletPinNumber()

#### 설명

지갑의 새 비밀번호를 저장한다.

#### Parameters

| name         | type   | 설명      |
| ------------ | ------ | ------- |
| oldPinNumber | String | 기존 비밀번호 |
| newPinNumber | String | 새 비밀번호  |

#### Result

`Result<Unit>`

### suspend fun getResetQuestion()

#### 설명

사용자가 등록한 백업용 질문을 가져온다.

#### Result

`Result<`[`FncyQuestion`](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/domain#fncyquestion)`>`

### suspend fun postResetQuestion()

#### 설명

사용자가 등록했던 백업용 질문의 답변과, 새 핀번호를 저장한다.

#### Parameters

| name         | type   | 설명         |
| ------------ | ------ | ---------- |
| answer       | String | 백업용 질문의 답변 |
| newPinNumber | String | 새 비밀번호     |

#### Result

`Result<Unit>`

### suspend fun postResetPinNumber()

#### 설명

새 비밀번호로 변경한다.

#### Parameters

| name         | type   | 설명      |
| ------------ | ------ | ------- |
| oldPinNumber | String | 현재 비밀번호 |
| newPinNumber | String | 새 비밀번호  |

#### Result

`Result<Unit>`

##

## Transaction

### suspend fun estimateTicket()

#### 설명

전송 티켓 생성하기 전에 전송 가능여부 확인 및 nonce, gasLimit등을 확인한다.

#### Parameter

| name              | type                                                                                          | 설명                |
| ----------------- | --------------------------------------------------------------------------------------------- | ----------------- |
| wid               | Long                                                                                          | 지갑 ID             |
| chainId           | Long                                                                                          | 체인 ID             |
| signatureType     | [TicketType](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/etc#tickettype) | 전송 타입             |
| toAddress         | String                                                                                        | 보낼 주소             |
| transferVal       | BigInteger                                                                                    | 보낼 수량(단위: wei)    |
| txGasPrice        | BigInteger = BigInteger.ZERO                                                                  | Gas Price         |
| txInput           | String? = null                                                                                | Data 정보           |
| contractAddress   | String? = null                                                                                | contract실행일 경우 입력 |
| assetId           | Long                                                                                          | Asset ID          |
| nftId             | Long? = null                                                                                  | NFT ID            |
| maxPriorityPerGas | BigInteger = BigInteger.ZERO                                                                  | ETH 전송일 경우 사용     |
| maxFeePerGas      | BigInteger = BigInteger.ZERO                                                                  | ETH 전송일 경우 사용     |

#### Chain ID

<table><thead><tr><th width="569">Chain</th><th>ID</th><th data-hidden></th></tr></thead><tbody><tr><td>Binanace Smart Chain(BSC)</td><td>1</td><td></td></tr><tr><td>Ethereum(ETH)</td><td>2</td><td></td></tr><tr><td>Fncy Chain (FNCY)</td><td>3</td><td></td></tr></tbody></table>

#### TicketType

<table><thead><tr><th width="479">Type</th><th>설명</th><th data-hidden>설명</th><th data-hidden></th></tr></thead><tbody><tr><td>SIGNATURE_TYPE_FOR_ASSET_TRANSFER</td><td>Coin전송</td><td></td><td></td></tr><tr><td>SIGNATURE_TYPE_FOR_SMARTCONTRACT_EXECUTION</td><td>SmartContract실행(Token전송)</td><td></td><td></td></tr><tr><td>SIGNATURE_TYPE_FOR_WALLETCONNECT</td><td>WalletConnect전용</td><td></td><td></td></tr></tbody></table>

#### Result

`Result<`[`FncyTicket`](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/domain#fncyticket)`>`

### suspend fun makeTicket()

#### 설명

전송 티켓을 생성한다.

#### Parameters

| name              | type                                                                                          | 설명                |
| ----------------- | --------------------------------------------------------------------------------------------- | ----------------- |
| wid               | Long                                                                                          | 지갑 ID             |
| chainId           | Long                                                                                          | 체인 ID             |
| signatureType     | [TicketType](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/etc#tickettype) | 전송 타입             |
| toAddress         | String                                                                                        | 보낼 주소             |
| transferVal       | BigInteger                                                                                    | 보낼 수량(단위: wei)    |
| txGasPrice        | BigInteger = BigInteger.ZERO                                                                  | Gas Price         |
| txGasLimit        | BigInteger = BigInteger.ZERO                                                                  | Gas Limit         |
| txInput           | String? = null                                                                                | Data 정보           |
| contractAddress   | String? = null                                                                                | contract실행일 경우 입력 |
| assetId           | Long                                                                                          | Asset ID          |
| nftId             | Long? = null                                                                                  | NFT ID            |
| maxPriorityPerGas | BigInteger = BigInteger.ZERO                                                                  | ETH 전송일 경우 사용     |
| maxFeePerGas      | BigInteger = BigInteger.ZERO                                                                  | ETH 전송일 경우 사용     |

#### Result

`Result<`[`FncyTransactionTicket`](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/domain#fncytrasactionticket)`>`

### suspend fun getTicketInfo()

#### 설명

티켓 상태 조회

#### Parameters

| name       | type   | 설명     |
| ---------- | ------ | ------ |
| ticketUuid | String | 티켓uuid |

#### Result

`Result<`[`FncyTicket`](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/domain#fncyticket)`>`

<table><thead><tr><th width="320.3333333333333">Code</th><th width="125">Number</th><th>Message</th></tr></thead><tbody><tr><td>TRANSFER_AVAILABLE</td><td>201</td><td>티켓 전송이 가능한 상태</td></tr><tr><td>TICKET_TRANSFER_SUCCESS</td><td>200</td><td>티켓 전송에 성공</td></tr><tr><td>TICKET_TRANSFER_FAILED</td><td>301</td><td>티켓전송에 실패</td></tr><tr><td>TICKET_EXPIRED</td><td>403</td><td>티켓이 만료됨 (생성 후 5분 경과)</td></tr><tr><td>TICKET_NOT_FOUND</td><td>404</td><td>존재하지 않는 티켓</td></tr></tbody></table>

### suspend fun sendTicket()

#### 설명

티켓(트랜잭션)을 실행한다.

#### Parameters

| name       | type   | 설명      |
| ---------- | ------ | ------- |
| ticketUuid | String | 티켓uuid  |
| pinNumber  | String | 지갑 비밀번호 |

#### Result

`Result<String>`

### suspend fun getTransferHistoryList()

#### 설명

지갑의 Transaction 목록을 조회한다.

#### Parameters

| name     | type                                                                                | 설명                                                                     |
| -------- | ----------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| wid      | Long                                                                                | 지갑 ID                                                                  |
| assetId  | Long                                                                                | 자산 ID                                                                  |
| pageNo   | Int = 1                                                                             | 페이지 번호(Default: 1)                                                     |
| pageSize | Int = 20                                                                            | 페이지 크기(Default: 20)                                                    |
| filter   | [InOut](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/etc#inout) | <p>InOut.All = 전체 <br>InOut.Deposit = 입금<br>InOut.Withdrawal = 출금 </p> |

#### Result

`Result<`[`PagingData`](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/etc#pagingdata-less-than-t-greater-than)`<List<`[`FncyTransaction`](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/domain#fncytransaction)`>?>>`

### suspend fun getTransferHistoryDetail()

#### 설명

Tranaction 단건 정보를 조회한다.

#### Parameters

| name       | type | 설명       |
| ---------- | ---- | -------- |
| wid        | Long | 지갑 ID    |
| historySeq | Long | 트랜잭션 Seq |

#### Result

`Result<`[`FncyTransaction`](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/domain#fncytransaction)`?>`

## 기타

### suspend fun postWalletSign()

#### 설명

지갑 Sign.

#### Parameters

| name       | type                                                                                                         | 설명       |
| ---------- | ------------------------------------------------------------------------------------------------------------ | -------- |
| wid        | Long                                                                                                         | 지갑 ID    |
| dataToSign | String                                                                                                       | Data     |
| signType   | [SignType](https://docs.fncy.world/fncy-2.0.2-kor/for-developers/wallet/sdk/etc#signtype) = SignType.EthSign | SignType |
| pinNumber  | String                                                                                                       | 지갑 비밀번호  |

#### Result

`Result<String>`
