Manage Message

Methods related to dMessage data collection.

Retrieve dMessages by a user

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

Method

wallet.message.getReceived(i18nStrategy?:useLanguages)
ParameterTypeRequiredDescription
languageen, 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)
ParameterTypeRequiredDescription
messageIdStringβœ…Identification number of the message.
protocolStringβœ…Protocol name.
languageen-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)
ParameterTypeRequiredDescription
networkStringβœ…Protocol network of the message.
messageIdStringβœ…Identification number of the read message.

Read opt-in/ou status

Methods

wallet.message.blackListAddress(msgSender, tokenId)
wallet.message.unblackListAddress(msgSender, tokenId)
ParameterTypeRequiredDescription
msgSenderStringβœ…The wallet address of the related message issuer.
tokenIdStringβœ…Arianee NFT ID of the NFT.