# Device & Accrouts Info

## Get Device Info

Get the information about the current connected D'CENT biometric wallet device using `getDeviceInfo()` function.

### **Parameters**

None

### **Returns**

[`DeviceInfo`](#class-deviceinfo) - the current connected D'CENT biometric wallet device Information

#### class DeviceInfo

<table><thead><tr><th width="156.33333333333331">Name</th><th width="184">Type</th><th>Description</th></tr></thead><tbody><tr><td>label</td><td><code>String</code></td><td>Label of connected device</td></tr><tr><td>deviceId</td><td><code>String</code></td><td>Device Identifier of connected device</td></tr><tr><td>fwVersion</td><td><code>String</code></td><td>Firmware version of connected device</td></tr><tr><td>ksmVersion</td><td><code>String</code></td><td>KSM version fo connected device</td></tr><tr><td>state</td><td><code>State</code></td><td>State of connected device<br>D'CENT biometric wallet's state values are as follows.<br>- <code>init</code>, <code>ready</code>, <code>secure</code>, <code>locked_fp</code>, <code>locked_pin</code><br><strong>Only "<code>secure</code>" state dongle can be used.</strong></td></tr><tr><td>coinList</td><td><code>List&#x3C;CoinType></code></td><td>Supported coin list of connected device</td></tr></tbody></table>

**Example**

```java
DeviceInfo mDeviceInfo = mDcentmanager.getDeviceInfo();
```

## Set Device Label

Set the label name to the D'CENT biometric wallet using `setDeviceLabel()` function.(If you reboot your D'CENT, you can see the label name.)

**Parameters**

| Parameter | Type     | Description                                |
| --------- | -------- | ------------------------------------------ |
| label     | `String` | the label name of D'CENT biometric wallet. |

**Returns**

None

**Example**

```java
mDcentmanager.setDeviceLavel("newLabel");
```

## Get Account Info

Get the list of current accounts in the D'CENT biometric wallet using `getAccountInfo()` function.

**Parameters**

None

**Returns**

[`List<Account>`](https://github.com/DcentWallet/dcent-biometric-sdk-android/blob/main/doc/Account.md) - current account list in D'CENT biometric wallet.

**Example**

```java
List<Account> accountList = mDcentmanager.getAccountInfo()
```

## Create & Sync Account

Create or update accounts on the device.

If the account of the specified key path is already exist, the `syncAccount()` method do not create account just sync the account information. For example, if you want to change the label of account or modify the balance, you can use the `syncAccount()` method.

**(※ As of firmware version 2.9.2 or later, the D'CENT biometric wallet device does not support updating the balance.)**

**Parameters**

| Parameter | Type                                 | Description                           |
| --------- | ------------------------------------ | ------------------------------------- |
| accounts  | `List<SyncAccount>` \| `SyncAccount` | account list or account to be synced. |

**Returns**

`boolean` - sync result. true if you sync completely otherwise false.

**Example**

```java
  String labelOfAccount = "bitcoin_1" ; // account label
  String balanceOfAccount = "0 BTC" ; // balance of account. This string will be displayed on device.
  String keyPath = "m/44'/0'/0'/0/0/"; // key path of the account

  /* 
  Bitcoin account will be created.
  if bitcoin account is already created, the bitcoin account label and balance will be just modified.
  */
  SyncAccount syncAccount = new SyncAccount(CoinType.BITCOIN.getCoinGroup(),
  CoinType.BITCOIN.name(),
  labelOfAccount,
  balanceOfAccount,
  keyPath);
  mDcentmanager.syncAccount(syncAccount);
  
```
