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

wallet.message.getReceived(i18nStrategy?:useLanguages)
InputMandatoryTypeDescription
languageen, fr, es, etc...Language(s) to return.

Example:

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

Result: 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)
InputMandatoryTypeDescription
messageIdStringIdentification number of the message.
protocolStringProtocol name.
languageen-US, fr-FR...Language(s) returned in order of preference.

Result: 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)
ParameterMandatoryTypeDescription
networkStringProtocol network of the message.
messageIdStringIdentification number of the read message.

Read opt in/ou status

wallet.message.blackListAddress(msgSender, tokenId)
wallet.message.unblackListAddress(msgSender, tokenId)
ParameterMandatoryTypeDescription
msgSenderStringWallet address of the related message issuer.
tokenIdStringArianee NFT ID of the NFT.