> For the complete documentation index, see [llms.txt](https://docs.finenex.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.finenex.net/application-apis/account.md).

# ServerWallet API

## Endpoint

> **Real Server :** [**https://api.finenex.net/wallet**](https://api.finenex.net/wallet)
>
> **Test Server :** [**https://test-api.finenex.net/wallet**](https://test-api.finenex.net/wallet)

### createAddress

Returns a new address. After generating a new private key in Server Wallet, Address, secretKey, and mnemonic are returned.

#### Parameters

| Name    | Type   | Description                                                                                         |
| ------- | ------ | --------------------------------------------------------------------------------------------------- |
| addInfo | String | <p>Address Information. This can be retrieved using the getAddressInfo API.<br>Max length : 200</p> |

#### Return Value

| Name      | Type   | Description                                                                                                                            |
| --------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| address   | String | Address                                                                                                                                |
| secretKey | String | It is used for authentication when requesting SignData to the Server Wallet. It cannot be viewed or exported, so it must be kept well. |
| mnemonic  | String | Used for address recovery if necessary                                                                                                 |

{% hint style="info" %}
A new secretKey is created when ImportAddress is called.
{% endhint %}

#### Example

```
{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "address": "0xce808360b37030c29bdf3eacbc6c8cda62c04c39",
            "mnemonic": "bulk tomorrow beauty tag fragile rough quit antique shock river powder ghost",
            "secretKey": "49d274d8fcbd00b862dbfb01a759d233"
        }
    }
}
```

### getAddressInfo

Return an address information.

#### Parameters

| Name    | Type   | Description |
| ------- | ------ | ----------- |
| address | String | Address     |

#### Return Value

| Name    | Type   | Description                                         |
| ------- | ------ | --------------------------------------------------- |
| address | String | Address                                             |
| addInfo | String | Address information saved when creating an address. |

#### Example

```
{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "address": "0xce808360b37030c29bdf3eacbc6c8cda62c04c39",
            "mnemonic": "My Test Address"
        }
    }
}
```

### exportAddress

Returns the mnemonic of a given address. if hashKey is not correct, it will return error.

#### Parameters

| Name         | Type   | Description                                       |
| ------------ | ------ | ------------------------------------------------- |
| address      | String | Address                                           |
| languageType | String | mnemonic language (Currently only "en" available) |
| tempKey      | String | tempKey for "exportAddress"                       |
| hashKey      | String | hash(tempKey \| secretKey)                        |

#### Return Value

| Name     | Type   | Description                             |
| -------- | ------ | --------------------------------------- |
| mnemonic | String | Used for address recovery if necessary. |

#### Example

```
{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "mnemonic": "bulk tomorrow beauty tag fragile rough quit antique shock river powder ghost"
        }
    }
}
```

### importAddress

Import an Address using mnemonic. Store private key in Server Wallet, and Address, secretKey, and mnemonic are returned.

#### Parameters

| Name         | Type   | Description                                                                                         |
| ------------ | ------ | --------------------------------------------------------------------------------------------------- |
| languageType | String | mnemonic language (Currently only "en" available)                                                   |
| mnemonic     | String | Mnemonic String                                                                                     |
| addInfo      | String | <p>Address Information. This can be retrieved using the getAddressInfo API.<br>Max length : 200</p> |

#### Return Value

| Name      | Type   | Description                                                                                                                            |
| --------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| address   | String | Address                                                                                                                                |
| secretKey | String | It is used for authentication when requesting SignData to the Server Wallet. It cannot be viewed or exported, so it must be kept well. |
| mnemonic  | String | Address can be restored using Mnemonic.                                                                                                |

#### Example

```
{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "address": "0xce808360b37030c29bdf3eacbc6c8cda62c04c39",
            "mnemonic": "bulk tomorrow beauty tag fragile rough quit antique shock river powder ghost",
            "secretKey": "49d274d8fcbd00b862dbfb01a759d233"
        }
    }
}
```

### importAddressWithPrivateKey

Import an Address using private key. Store private key in Server Wallet, and Address, secretKey are returned. Unlike importAddress , mnemonic is not returned.

#### Parameters

| Name       | Type   | Description                                                                                         |
| ---------- | ------ | --------------------------------------------------------------------------------------------------- |
| privateKey | String | private Key                                                                                         |
| addInfo    | String | <p>Address Information. This can be retrieved using the getAddressInfo API.<br>Max length : 200</p> |

#### Return Value

| Name      | Type   | Description                                                                                                                            |
| --------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| address   | String | Address (0x....)                                                                                                                       |
| secretKey | String | It is used for authentication when requesting SignData to the Server Wallet. It cannot be viewed or exported, so it must be kept well. |
| mnemonic  | String | empty.                                                                                                                                 |

#### Example

```
{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "address": "0xce808360b37030c29bdf3eacbc6c8cda62c04c39",
            "mnemonic": "",
            "secretKey": "49d274d8fcbd00b862dbfb01a759d233"
        }
    }
}
```

### getAddressTokenList

Returns a list of tokens held by address.

#### Parameters

| Name    | Type   | Description |
| ------- | ------ | ----------- |
| address | String | Address     |

#### Return Value

| Name            | Type       | Description                                                               |
| --------------- | ---------- | ------------------------------------------------------------------------- |
| address         | String     | Address                                                                   |
| contractAddress | String     | Contract address of token.                                                |
| symbol          | String     | Symbol of token.                                                          |
| tokenType       | String     | Type of token "ERC20", "ERC721", "ERC1155"                                |
| tokenId         | BigInteger | tokenId of ERC1155, In case of ERC20, ERC721 token, it is the blank.      |
| balance         | BigDecimal | Balance of token. In case of ERC1155 token, it is the balance of tokenId. |

#### Example

```
{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": { 
            [ 
                { 
                    "address": "0x39fdfdsfsdsdfsdf9sd0sfds9fsd0fsdgsd",
                    "contractAddress": "0xce808360b37030c29bdf3eacbc6c8cda62c04c39",
                    "symbol": "TOK1",
                    "tokenType": "ERC20",
                    "tokenId": "",
                    "balance": "10.292"
                },
                { 
                    "address": "0x39fdfdsfsdsdfsdf9sd0sfds9fsd0fsdgsd",
                    "contractAddress": "0xce808360b37030c29bdf3eacbc6c8cda62c04c39",
                    "symbol": "TOK2",
                    "tokenType": "ERC1155",
                    "tokenId": "2",
                    "balance": "10"
                }
            ]
        }
    }
}
```

### signData

Returns data signed with the private key of address to make a transaction.

#### Parameters

| Name    | Type   | Description                                       |
| ------- | ------ | ------------------------------------------------- |
| address | String | Address                                           |
| data    | String | Data to be signed. This is probably a hash value. |
| tempKey | String | tempKey for "signData"                            |
| hashKey | String | hash(tempKey \| secretKey)                        |

#### Return Value

| Name       | Type   | Description |
| ---------- | ------ | ----------- |
| signedData | String | Signed data |

#### Example

```
{
    "jsonrpc": "2.0",
    "id": "00456", 
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "signedData": "3043021f6741c7c4ec...ac6d7f7ba8350608"
        }
    }
}
```

###
