Message type - File
Enables sending single file or attachement as a message. You will need to pass the file as base64. Base64 is a method for encoding binary data into ASCII text.
- js
// userAlice.chat.send(recipient, message)
// This section focuses on customization parameters for 'message' object
const aliceMessagesBob = await userAlice.chat.send(recipient, {
type: 'File',
content: '{"content":"data:application/pdf;base64,JVBERi0xLjQKJ}',
});
Important
- Files less than 1 MB are currently supported.
Customization parameters
When sending a message, you can customize the following params
Param | Type | Subtype | Default | Remarks |
---|---|---|---|---|
recipient | string | - | - | Recipient supports a number of address format including wallet address, chain agnostic wallet address, NFT addresses or even chatid which is useful in groups |
message | object | - | - | Configuration for message to be sent |
- | message.type | File | Text | Type of message Content |
- | message.content | string | - | Message Content |
Note: Parameters
in this style
are mandatory.