Methods
# 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 |
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 |
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 |
Promise.<string>
Example
client.messages.unsubscribeFromChannel({channel_name: 'MU3GOZ2FMGHJLM5TTAJDQ5SNAHHRBC!'})
# viewAllMessageChannels() → {Promise.<ViewAllMessageChannelsResponse>}
View all message channels the wallet is subscribed to
Promise.<ViewAllMessageChannelsResponse>
# viewAllMessages() → {Promise.<ViewAllMessagesResponse>}
View all messages that the wallet contains
Promise.<ViewAllMessagesResponse>
# viewMyRestrictedAddresses() → {Promise.<ViewMyRestrictedAddressesResponse>}
View all addresses this wallet owns that have been restricted
Promise.<ViewMyRestrictedAddressesResponse>
# viewMyTaggedAddresses() → {Promise.<ViewMyTaggedAddressesResponse>}
View all addresses this wallet owns that have been tagged
Promise.<ViewMyTaggedAddressesResponse>