> **Key takeaway:**  ☞   The renaming of "Ledger Live" to "Ledger Wallet" and\
>      "wallet" (in the hardware sense) to "signer" is still in progress.\
>      This page may contain legacy references that will be updated.

# Using the Account Module in Wallet API Core Client

The Account Module allows you to interact with the user's accounts. You can list accounts, request an account, and verify account addresses on a Ledger device through .

## Account Module Overview

Access the Account module via `walletApiClient.account`.

### Methods:

#### 1. List Accounts

Retrieve the list of accounts added by the user on the connected wallet. You can filter the accounts by currency IDs.

```javascript
walletApiClient.account.list(params?: { currencyIds?: string[] }): Promise<Account[]>
```

**Parameters**:

- `params` (optional): An object that may contain:
- `currencyIds` (optional): An array of strings specifying the currency IDs to filter accounts by.

**Returns**: A promise that resolves with an array of Account objects.

[**Required permission**:](https://developers.ledger.com/docs/ledger-live/discover/guides/wallet-api/appendix/manifest#permissions)
`account.list`

##### Example:

```javascript
async function listAccounts(walletApiClient) {
  try {
    const accounts = await walletApiClient.account.list();
    console.log("All Accounts:", accounts);

    const bitcoinAccounts = await walletApiClient.account.list({
      currencyIds: ["bitcoin"],
    });
    console.log("Bitcoin Accounts:", bitcoinAccounts);
  } catch (error) {
    console.error("Error listing accounts:", error);
  }
}
```

#### 2. Request Account

Prompt the user to select an account from the connected wallet. You can filter the accounts by currency IDs.

```javascript
walletApiClient.account.request(params?: { currencyIds?: string[] }): Promise<Account>
```

**Parameters**:

- `params` (optional): An object that may contain:
- `currencyIds` (optional): An array of strings specifying the currency IDs to filter accounts by. You can find currency IDs and token IDs in the [Ledger repository](https://github.com/LedgerHQ/ledger-live/blob/main/libs/ledgerjs/packages/cryptoassets/src/currencies.ts).

**Returns**: A promise that resolves with the selected Account object.

[**Required permission**:](https://developers.ledger.com/docs/ledger-live/discover/guides/wallet-api/appendix/manifest#permissions) `account.request`

##### Example:

```javascript
async function requestAccount(walletApiClient) {
  try {
    const account = await walletApiClient.account.request({
      currencyIds: ["ethereum"],
    });
    console.log("Selected account:", account);
  } catch (error) {
    console.error("Error requesting account:", error);
  }
}
```

#### 3. Verify Account Address

Allows the user to verify an account's address on their Ledger device through .

```javascript
walletApiClient.account.receive(accountId: string): Promise<string>
```

**Parameters**:

- `accountId` (required): The ID of the account whose address needs to be verified.

**Returns**: A promise that resolves with the verified address as a string.

[**Required permission**:](https://developers.ledger.com/docs/ledger-live/discover/guides/wallet-api/appendix/manifest#permissions)
`account.receive`

##### Example:

```javascript
async function verifyAccountAddress(walletApiClient, accountId) {
  try {
    const address = await walletApiClient.account.receive(accountId);
    console.log("Verified address:", address);
  } catch (error) {
    console.error("Error verifying account address:", error);
  }
}
```

## Handling Errors

Make sure to handle errors gracefully and provide appropriate feedback to the user. Additionally, always remember to disconnect the `WindowMessageTransport` when you're done interacting with the  API to free up resources.
