Manage Message
Methods related to dMessage data collection.
Retrieve Received dMessages
Retrieve the content and data of dMessages received by a user on a given chain type.
Method
wallet.message.getReceived(i18nStrategy?:useLanguages)| Parameter | Type | Required | Description |
|---|---|---|---|
language | en, fr, es, etc... | ❌ | Language(s) to return. |
const wallet = new Wallet({ chainType: 'mainnet' });
const myMessage = await wallet.message.getReceived();
await myMessage[0].readMessage();Return Payload
promise returns an array with message information.
[{
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
wallet.message.get(messageId, protocol, i18nStrategy?:useLanguages)| Parameter | Type | Required | Description |
|---|---|---|---|
messageId | String | ✅ | Identification number of the message. |
protocol | String | ✅ | Protocol name. |
language | en-US, fr-FR... | ❌ | Language(s) returned in order of preference. |
Return Payload
promise returns an object with the message information.
{
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
wallet.message.readMessage(network, messageId)| Parameter | Type | Required | Description |
|---|---|---|---|
network | String | ✅ | Protocol network of the message. |
messageId | String | ✅ | Identification number of the read message. |
Read opt-in/ou status
Methods
wallet.message.blackListAddress(msgSender, tokenId)wallet.message.unblackListAddress(msgSender, tokenId)| Parameter | Type | Required | Description |
|---|---|---|---|
msgSender | String | ✅ | The wallet address of the related message issuer. |
tokenId | String | ✅ | Arianee digital passport ID of the digital passport. |
Updated 5 months ago
