---
updatedAt: 2025-05-19T20:46:54.000Z
agentTools:
  projectIndex: https://docs.arianee.org/v2.0/llms.txt
---

# Manage Message

Methods related to dMessages data collection.

## Retrieve dMessages by a user

Retrieve the content and data of dMessages received by a user on a given chain type.

**Method**

```javascript
wallet.message.getReceived(i18nStrategy?:useLanguages)
```

| Input      | Mandatory | Type                      | Description            |
| :--------- | :-------- | :------------------------ | :--------------------- |
| `language` | ❌         | `en`, `fr`,  `es`, etc... | Language(s) to return. |

**Example:**

```javascript
const wallet = new Wallet({ chainType: 'mainnet' });
const myMessage = await wallet.message.getReceived();
await myMessage[0].readMessage();
```

**Result:** `promise` returns an `array` with message information.

```json Example
[{
    data: {
      id: '238153639',
      certificateId: '86429342',
      content: ArianeeMessageI18N,
      rawContent: ArianeeMessageI18N,
      imprint: 'TODO',
      isRead: true,
      protocol: { name: "testnet"; chainId: 77 }
      receiver: '0xa9bc90d24d0b8495043ab5857455444630028caf',
      sender: '0xb908b66915ecd1ec31e669adc9c71bdce44ec601',
      timestamp: 1682609160
    }
  }]
```

***

## Retrieve a dMessage

Retrieve a specific dMessage for a given protocol instance.

**Method**

```javascript
wallet.message.get(messageId, protocol, i18nStrategy?:useLanguages)
```

| Input       | Mandatory | Type                | Description                                  |
| :---------- | :-------- | :------------------ | :------------------------------------------- |
| `messageId` | ✅         | String              | Identification number of the message.        |
| `protocol`  | ✅         | String              | Protocol name.                               |
| `language`  | ❌         | `en-US`, `fr-FR`... | Language(s) returned in order of preference. |

**Result:** `promise` returns an `object` with the message information.

```json Example
{
    data: {
      id: '238153639',
      certificateId: '86429342',
      content: ArianeeMessageI18N,
      rawContent: ArianeeMessageI18N,
      imprint: 'TODO',
      isRead: true,
      protocol: { name: "testnet"; chainId: 77 }
      receiver: '0xa9bc90d24d0b8495043ab5857455444630028caf',
      sender: '0xb908b66915ecd1ec31e669adc9c71bdce44ec601',
      timestamp: 1682609160
    }
  }
```

***

## Mark dMessage as read

**Method:**

```javascript
wallet.message.readMessage(network, messageId)
```

| Parameter   | Mandatory | Type   | Description                                |
| ----------- | --------- | ------ | ------------------------------------------ |
| `network`   | ✅         | String | Protocol network of the message.           |
| `messageId` | ✅         | String | Identification number of the read message. |

***

## Read opt in/ou status

```javascript
wallet.message.blackListAddress(msgSender, tokenId)
```

```javascript
wallet.message.unblackListAddress(msgSender, tokenId)
```

| Parameter   | Mandatory | Type   | Description                                   |
| ----------- | --------- | ------ | --------------------------------------------- |
| `msgSender` | ✅         | String | Wallet address of the related message issuer. |
| `tokenId`   | ✅         | String | Arianee NFT ID of the NFT.                    |