# Methods

## BlockChains

### suspend fun getBlockChainInfo()

#### Description

Retrieves the chain information using the Chain ID.

#### Parameters

| name    | type | Description |
| ------- | ---- | ----------- |
| chainId | Long | Chain ID    |

#### Result

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

### suspend fun getContractInfo()

#### Description

Retrieves asset information using the Contract Address.

#### Parameters

| name            | type   | Description      |
| --------------- | ------ | ---------------- |
| chainId         | Long   | Chain ID         |
| contractAddress | String | Contract Address |

#### Result

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

### suspend fun getFncyInfo()

#### Description

Retrieves Fncy Chain information.

#### Result

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

### suspend fun getGasPrice()

#### Description

Retrieves Gas Price of the Chain.

#### Parameters

| name    | type | Description |
| ------- | ---- | ----------- |
| chainId | Long | Chain ID    |

#### Result

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

## Wallet

### suspend fun getWallet()

#### Description

Search user wallet

#### Result

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

### suspend fun getWalletAllBalance()

#### Description

Retrieves the amount of assets in the wallet.

#### Parameters

| name | type | Description |
| ---- | ---- | ----------- |
| wid  | Long | Wallet ID   |

#### Result

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

### suspend fun getAssetList()

#### Description

Retrieves the list of assets in the wallet (Fncy, Eth, Bsc, etc.).

#### Parameters

| name | type | Description |
| ---- | ---- | ----------- |
| wid  | Long | Wallet ID   |

#### Result

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

### suspend fun getAssetById()

#### Description

Retrieves the asset information for the wallet using the Asset ID.

#### Parameters

| name    | type | Description |
| ------- | ---- | ----------- |
| wid     | Long | Wallet ID   |
| assetId | Long | Asset ID    |

#### Result

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

### suspend fun getNFTList()

#### Description

Retrieves the list of NFTs in the wallet.

#### Parameters

| name     | type                                                                                                | Description                     |
| -------- | --------------------------------------------------------------------------------------------------- | ------------------------------- |
| wid      | Int                                                                                                 | Wallet ID                       |
| filter   | [NFTOption](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/etc#nftoption)? = null | NFT Search Options (hold, sell) |
| pageNo   | Int = 1                                                                                             | Page Number (Default: 1)        |
| pageSize | Int = 20                                                                                            | Page Size (Default: 1)          |

#### Result

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

### suspend fun getNFTById()

#### Description

Retrieves NFT unit information using nftId.

#### Parameters

| name  | type | Description |
| ----- | ---- | ----------- |
| wid   | Int  | Wallet ID   |
| nftId | Int  | nft ID      |

#### Result

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

### suspend fun makeWallet()

#### Description

Calls when requesting wallet creation.

#### Parameters

| name       | type   | Description     |
| ---------- | ------ | --------------- |
| walletName | String | Wallet Name     |
| pinNumber  | String | Wallet Password |

#### Result

`Result<Unit>`

### suspend fun getQuestionList()

#### Description

Retrieves a list of questions for wallet restoration.

#### Result

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

### suspend fun postRegisterRestorationKey()

#### Description

Registers the wallet's restore key (wallet recovery question/answer).

#### Parameters

| name        | type   | Description            |
| ----------- | ------ | ---------------------- |
| wid         | Int    | Wallet ID              |
| questionSeq | String | Recovery questions seq |
| answer      | String | Answers                |
| pinNumber   | String | Wallet Password        |

#### Result

`Result<Unit>`

### suspend fun checkWalletPinNumber()

#### Description

Checks the wallet password.

#### parameters

| name      | type   | Description     |
| --------- | ------ | --------------- |
| pinNumber | String | Wallet Password |

#### Result

`Result<Unit>`

### suspend fun checkResetAnswer()

#### Description

Checks the answers to the backup questions.

#### Parameters

| name   | type   | Description                 |
| ------ | ------ | --------------------------- |
| answer | String | Answers to Backup Questions |

#### Result

`Result<Unit>`

### suspend fun resetWalletPinNumber()

#### Description

Stores the new password for the wallet.

#### Parameters

| name         | type   | Description      |
| ------------ | ------ | ---------------- |
| oldPinNumber | String | Current Password |
| newPinNumber | String | New Password     |

#### Result

`Result<Unit>`

### suspend fun getResetQuestion()

#### Description

Retrieves the backup questions that users have registered for.

#### Result

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

### suspend fun postResetQuestion()

#### Description

Saves the answers to the backup questions that the user registered for, as well as the new pin number.

#### Parameters

| name         | type   | Description                 |
| ------------ | ------ | --------------------------- |
| answer       | String | Answers to Backup Questions |
| newPinNumber | String | New Password                |

#### Result

`Result<Unit>`

### suspend fun postResetPinNumber()

#### Description

Changes to the new password.

#### Parameters

| name         | type   | Description      |
| ------------ | ------ | ---------------- |
| oldPinNumber | String | Current Password |
| newPinNumber | String | New Password     |

#### Result

`Result<Unit>`

##

## Transaction

### suspend fun estimateTicket()

#### Description

Before creating a transfer ticket, it checks for transfer availability, nonce, gasLimit, etc.

#### Parameter

| name              | type                                                                                          | Description                 |
| ----------------- | --------------------------------------------------------------------------------------------- | --------------------------- |
| wid               | Long                                                                                          | Wallet ID                   |
| chainId           | Long                                                                                          | Chain ID                    |
| signatureType     | [TicketType](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/etc#tickettype) | Trasnfer Type               |
| toAddress         | String                                                                                        | Send to Address             |
| transferVal       | BigInteger                                                                                    | Quantity to Send (in wei)   |
| txGasPrice        | BigInteger = BigInteger.ZERO                                                                  | Gas Price                   |
| txInput           | String? = null                                                                                | Data Information            |
| contractAddress   | String? = null                                                                                | Enter if Contract Execution |
| assetId           | Long                                                                                          | Asset ID                    |
| nftId             | Long? = null                                                                                  | NFT ID                      |
| maxPriorityPerGas | BigInteger = BigInteger.ZERO                                                                  | Used for ETH Transfers      |
| maxFeePerGas      | BigInteger = BigInteger.ZERO                                                                  | Used for ETH Transfers      |

#### 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>Description</th><th data-hidden>설명</th><th data-hidden></th></tr></thead><tbody><tr><td>SIGNATURE_TYPE_FOR_ASSET_TRANSFER</td><td>Coin Trasnfer</td><td></td><td></td></tr><tr><td>SIGNATURE_TYPE_FOR_SMARTCONTRACT_EXECUTION</td><td>Execute SmartContract (Send Token)</td><td></td><td></td></tr><tr><td>SIGNATURE_TYPE_FOR_WALLETCONNECT</td><td>WalletConnect Only</td><td></td><td></td></tr></tbody></table>

#### Result

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

### suspend fun makeTicket()

#### Description

Creates a transfer ticket.

#### Parameters

| name              | type                                                                                          | Description                 |
| ----------------- | --------------------------------------------------------------------------------------------- | --------------------------- |
| wid               | Long                                                                                          | Wallet ID                   |
| chainId           | Long                                                                                          | Chain ID                    |
| signatureType     | [TicketType](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/etc#tickettype) | Transfer Type               |
| toAddress         | String                                                                                        | Send to Address             |
| transferVal       | BigInteger                                                                                    | Quantity to Send (in wei)   |
| txGasPrice        | BigInteger = BigInteger.ZERO                                                                  | Gas Price                   |
| txGasLimit        | BigInteger = BigInteger.ZERO                                                                  | Gas Limit                   |
| txInput           | String? = null                                                                                | Data Information            |
| contractAddress   | String? = null                                                                                | Enter if Contract Execution |
| assetId           | Long                                                                                          | Asset ID                    |
| nftId             | Long? = null                                                                                  | NFT ID                      |
| maxPriorityPerGas | BigInteger = BigInteger.ZERO                                                                  | Used for ETH Transfers      |
| maxFeePerGas      | BigInteger = BigInteger.ZERO                                                                  | Used for ETH Transfers      |

#### Result

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

### suspend fun getTicketInfo()

#### Description

Search ticket status

#### Parameters

| name       | type   | Description |
| ---------- | ------ | ----------- |
| ticketUuid | String | Ticket uuid |

#### Result

`Result<`[`FncyTicket`](https://docs.fncy.world/fncy-2.0.2-eng/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>Tickets Available for Transfer</td></tr><tr><td>TICKET_TRANSFER_SUCCESS</td><td>200</td><td>Successful Ticket Transfer</td></tr><tr><td>TICKET_TRANSFER_FAILED</td><td>301</td><td>Failed Ticket Trasnfer</td></tr><tr><td>TICKET_EXPIRED</td><td>403</td><td>Expired Tickets (5 minutes after creation)</td></tr><tr><td>TICKET_NOT_FOUND</td><td>404</td><td>Tickets that Don't Exist</td></tr></tbody></table>

### suspend fun sendTicket()

#### Description

Executes a ticket (transaction).

#### Parameters

| name       | type   | Description     |
| ---------- | ------ | --------------- |
| ticketUuid | String | Ticket uuid     |
| pinNumber  | String | Wallet Password |

#### Result

`Result<String>`

### suspend fun getTransferHistoryList()

#### Description

Searchs a list of transactions in the wallet.

#### Parameters

| name     | type                                                                                | Description                                                                       |
| -------- | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| wid      | Long                                                                                | Wallet ID                                                                         |
| assetId  | Long                                                                                | Asset ID                                                                          |
| pageNo   | Int = 1                                                                             | Page Number (Default: 1)                                                          |
| pageSize | Int = 20                                                                            | Page Size (Default: 20)                                                           |
| filter   | [InOut](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/etc#inout) | <p>InOut.All = All<br>InOut.Deposit = Deposit<br>InOut.Withdrawal = Withdraw </p> |

#### Result

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

### suspend fun getTransferHistoryDetail()

#### Description

Searches single transaction information.

#### Parameters

| name       | type | Description     |
| ---------- | ---- | --------------- |
| wid        | Long | Wallet ID       |
| historySeq | Long | Transaction Seq |

#### Result

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

### ETC

### suspend fun postWalletSign()

#### Description

Wallet Sign.

#### Parameters

| name       | type                                                                                                         | Description     |
| ---------- | ------------------------------------------------------------------------------------------------------------ | --------------- |
| wid        | Long                                                                                                         | Wallet ID       |
| dataToSign | String                                                                                                       | Data            |
| signType   | [SignType](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/etc#signtype) = SignType.EthSign | SignType        |
| pinNumber  | String                                                                                                       | Wallet Password |

#### Result

`Result<String>`
