Class

Messages

Messages()

Constructor

# new Messages()

View Source methods/messages/messages.ts, line 2

Methods

# clearMessages() → {Promise.<string>}

Delete current database of messages

View Source methods/messages/messages.ts, line 159

Promise.<string>

# sendMessage(params) → {Promise.<Array.<string>>}

Creates and broadcasts a message transaction to the network for a channel this wallet owns

Parameters:
Name Type Attributes Description
params
channel_name string

Name of the channel that you want to send a message with (message channel, administrator asset), if a non administrator asset name is given, the administrator '!' will be added to it

ipfs_hash string

The IPFS hash of the message

expire_time number <optional>

UTC timestamp of when the message expires

View Source methods/messages/messages.ts, line 141

Array of a transaction id

Promise.<Array.<string>>
Example
client.messages.sendMessage({
      channel: 'MU3GOZ2FMGHJLM5TTAJDQ5SNAHHRBC!',
      ipfs_hash: 'QmTqu3Lk3gmTsQVtjU7rYYM37EAW4xNmbuEAp2Mjr4AV7E',
      expire_time: 60
    })

# subscribeToChannel(params) → {Promise.<string>}

Subscribe to a certain message channel

Parameters:
Name Type Description
params
channel_name string

The channel name to subscribe to, it must end with '!' or have an '~' in the name

View Source methods/messages/messages.ts, line 115

Promise.<string>
Example
client.messages.subscribeToChannel({channel_name: 'MU3GOZ2FMGHJLM5TTAJDQ5SNAHHRBC!'})

# unsubscribeFromChannel(params) → {Promise.<string>}

Unsubscribe from a certain message channel

Parameters:
Name Type Description
params
channel_name string

The channel name to unsubscribe from, must end with '!' or have an '~' in the name

View Source methods/messages/messages.ts, line 125

Promise.<string>
Example
client.messages.unsubscribeFromChannel({channel_name: 'MU3GOZ2FMGHJLM5TTAJDQ5SNAHHRBC!'})

# viewAllMessageChannels() → {Promise.<ViewAllMessageChannelsResponse>}

View all message channels the wallet is subscribed to

View Source methods/messages/messages.ts, line 105

# viewAllMessages() → {Promise.<ViewAllMessagesResponse>}

View all messages that the wallet contains

View Source methods/messages/messages.ts, line 99

Promise.<ViewAllMessagesResponse>

# viewMyRestrictedAddresses() → {Promise.<ViewMyRestrictedAddressesResponse>}

View all addresses this wallet owns that have been restricted

View Source methods/messages/messages.ts, line 153

# viewMyTaggedAddresses() → {Promise.<ViewMyTaggedAddressesResponse>}

View all addresses this wallet owns that have been tagged

View Source methods/messages/messages.ts, line 147