# ERC721 Token

### erc721\_getBalance

Return an address Token balance.

#### Parameters

| Name            | Type   | Description                |
| --------------- | ------ | -------------------------- |
| contractAddress | String | Contract address of token. |
| address         | String | Address                    |

#### Return Value

| Name    | Type       | Description               |
| ------- | ---------- | ------------------------- |
| balance | BigInteger | Token balance of address. |

#### Example

```json
{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "balance": "10"
        }
    }
}
```

### erc721\_getTokenUri

Return a minted tokenId URI.

#### Parameters

| Name            | Type       | Description                |
| --------------- | ---------- | -------------------------- |
| contractAddress | String     | Contract address of token. |
| address         | String     | Address                    |
| tokenId         | BigInteger | token id                   |

#### Return Value

| Name | Type   | Description        |
| ---- | ------ | ------------------ |
| uri  | String | minted tokenId uri |

#### Example

```json
{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "uri": "http://www.test.com"
        }
    }
}
```

### erc721\_mint

Create new token with uri data. Only the token owner can do this..

#### Parameters

| Name            | Type       | Description                                                                                                                                                                                                       |
| --------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| contractAddress | String     | Contract address of token                                                                                                                                                                                         |
| sender          | String     | Address of token owner                                                                                                                                                                                            |
| toAddress       | String     | Address for mint                                                                                                                                                                                                  |
| tokenId         | BigInteger | token id                                                                                                                                                                                                          |
| uri             | String     | <p>The uri data to store in the token.<br>Max length : 100</p>                                                                                                                                                    |
| tempKey         | String     | tempKey for "mint"                                                                                                                                                                                                |
| hashKey         | String     | hash(tempKey \| secretKey)                                                                                                                                                                                        |
| signature       | String     | sign( hash ( contractAddress \| sender \| toAddress \| tokenId \| uri \| tempKey \| hashKey ) ) by owner's privateKey using signData API                                                                          |
| gasPrice        | BigDecimal | gasPrice                                                                                                                                                                                                          |
| nonce           | BigInteger | nonce value. If it is null, it will be filled in automatically. If acceleration is needed, use the nonce value generated when performing the transaction and use a higher gasPrice than the previous transaction. |

#### Return Value

| Name          | Type       | Description    |
| ------------- | ---------- | -------------- |
| transactionId | String     | Transaction Id |
| nonce         | BigInteger | nonce value    |

{% hint style="info" %}
A transactionId is returned, but that doesn't mean it has been added to the Block yet. You should check that the status is 1 by using net\_getTransactionStatus.
{% endhint %}

#### Example

```json
{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "transactionId": "0xf7d37be47ce8b563b07aa5e81e17e9722bab2e71374d970a558b45c0ed51df7b",
            "nonce": 32
        }
    }
}
```

### erc721\_transfer

Transfer NFT owner from from-address to to-address.

#### Parameters

| Name            | Type       | Description                                                                                                                                                                                                       |
| --------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| contractAddress | String     | Contract address of token                                                                                                                                                                                         |
| sender          | String     | Sender address                                                                                                                                                                                                    |
| toAddress       | String     | To address                                                                                                                                                                                                        |
| tokenId         | BigInteger | Token Id                                                                                                                                                                                                          |
| tempKey         | String     | tempKey for "transfer"                                                                                                                                                                                            |
| hashKey         | String     | hash(tempKey \| fromAddress' secretKey)                                                                                                                                                                           |
| signature       | String     | sign( hash ( contractAddress \| sender \| toAddress \| tokenId \| tempKey \| hashKey ) ) by formAddress's privateKey using signData API                                                                           |
| gasPrice        | BigDecimal | gasPrice                                                                                                                                                                                                          |
| nonce           | BigInteger | nonce value. If it is null, it will be filled in automatically. If acceleration is needed, use the nonce value generated when performing the transaction and use a higher gasPrice than the previous transaction. |

#### Return Value

| Name          | Type       | Description    |
| ------------- | ---------- | -------------- |
| transactionId | String     | Transaction Id |
| none          | BigInteger | nonce value    |

{% hint style="info" %}
A transactionId is returned, but that doesn't mean it has been added to the Block yet. You should check that the status is 1 by using net\_getTransactionStatus.
{% endhint %}

#### Example

```json
{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "transactionId": "0xf7d37be47ce8b563b07aa5e81e17e9722bab2e71374d970a558b45c0ed51df7b",
            "noce": 32
        }
    }
}
```

### erc721\_transferFrom

Transfer NFT owner from from-address to to-address by spender address.

#### Parameters

| Name            | Type       | Description                                                                                                                                                                                                       |
| --------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| contractAddress | String     | Contract address of token                                                                                                                                                                                         |
| sender          | String     | Sender address                                                                                                                                                                                                    |
| fromAddress     | String     | From address                                                                                                                                                                                                      |
| toAddress       | String     | To address                                                                                                                                                                                                        |
| tokenId         | BigInteger | Token Id                                                                                                                                                                                                          |
| tempKey         | String     | tempKey for "transfer"                                                                                                                                                                                            |
| hashKey         | String     | hash(tempKey \| fromAddress' secretKey)                                                                                                                                                                           |
| signature       | String     | sign( hash ( contractAddress \| sender \| fromAddress \| toAddress \| tokenId \| tempKey \| hashKey ) ) by address's privateKey using signData API                                                                |
| gasPrice        | BigDecimal | gasPrice                                                                                                                                                                                                          |
| nonce           | BigInteger | nonce value. If it is null, it will be filled in automatically. If acceleration is needed, use the nonce value generated when performing the transaction and use a higher gasPrice than the previous transaction. |

#### Return Value

| Name          | Type       | Description    |
| ------------- | ---------- | -------------- |
| transactionId | String     | Transaction Id |
| nonce         | BigInteger | nonce value    |

{% hint style="info" %}
A transactionId is returned, but that doesn't mean it has been added to the Block yet. You should check that the status is 1 by using net\_getTransactionStatus.
{% endhint %}

#### Example

```json
{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "transactionId": "0xf7d37be47ce8b563b07aa5e81e17e9722bab2e71374d970a558b45c0ed51df7b",
            "nonce": 32
        }
    }
}
```

### erc721\_approve

Approve token from owner-address to spender-address.

#### Parameters

| Name            | Type       | Description                                                                                                                                                                                                       |
| --------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| contractAddress | String     | Contract address of token                                                                                                                                                                                         |
| sender          | String     | Sender address                                                                                                                                                                                                    |
| spender         | String     | Spender address                                                                                                                                                                                                   |
| tokenId         | BigInteger | Token Id                                                                                                                                                                                                          |
| tempKey         | String     | tempKey for "approve"                                                                                                                                                                                             |
| hashKey         | String     | hash(tempKey \| fromAddress' secretKey)                                                                                                                                                                           |
| signature       | String     | sign( hash ( contractAddress \| sender \| spender \| tokenId \| tempKey \| hashKey ) ) by formAddress's privateKey using signData API                                                                             |
| gasPrice        | BigDecimal | gasPrice                                                                                                                                                                                                          |
| nonce           | BigInteger | nonce value. If it is null, it will be filled in automatically. If acceleration is needed, use the nonce value generated when performing the transaction and use a higher gasPrice than the previous transaction. |

#### Return Value

| Name          | Type   | Description    |
| ------------- | ------ | -------------- |
| transactionId | String | Transaction Id |

{% hint style="info" %}
A transactionId is returned, but that doesn't mean it has been added to the Block yet. You should check that the status is 1 by using net\_getTransactionStatus.
{% endhint %}

#### Example

```json
{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "transactionId": "0xf7d37be47ce8b563b07aa5e81e17e9722bab2e71374d970a558b45c0ed51df7b",
            "nonce": 32
        }
    }
}
```

### erc721\_getApproved

Returns an allowed token spender from owner address.

#### Parameters

| Name            | Type       | Description                |
| --------------- | ---------- | -------------------------- |
| contractAddress | String     | Contract address of token. |
| tokenId         | BigInteger | Token Id                   |

#### Return Value

| Name    | Type   | Description       |
| ------- | ------ | ----------------- |
| address | String | Spender's address |

#### Example

```json
{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "address": "0x666cf9aed17a9dfb4ae91b80789dd99803568b11"
        }
    }
}
```
