@bsv/message-box-client 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/src/MessageBoxClient.js +4 -2
- package/dist/cjs/src/MessageBoxClient.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/MessageBoxClient.js +4 -2
- package/dist/esm/src/MessageBoxClient.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/MessageBoxClient.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +1 -1
- package/package.json +1 -1
- package/src/MessageBoxClient.ts +5 -3
package/package.json
CHANGED
package/src/MessageBoxClient.ts
CHANGED
|
@@ -877,7 +877,7 @@ export class MessageBoxClient {
|
|
|
877
877
|
const quote = await this.getMessageBoxQuote({
|
|
878
878
|
recipient: message.recipient,
|
|
879
879
|
messageBox: message.messageBox
|
|
880
|
-
})
|
|
880
|
+
}, overrideHost)
|
|
881
881
|
|
|
882
882
|
if (quote.recipientFee === -1) {
|
|
883
883
|
throw new Error('You have been blocked from sending messages to this recipient.')
|
|
@@ -1200,11 +1200,13 @@ export class MessageBoxClient {
|
|
|
1200
1200
|
* messages.forEach(msg => console.log(msg.sender, msg.body))
|
|
1201
1201
|
* // Payments included with messages are automatically received
|
|
1202
1202
|
*/
|
|
1203
|
-
async listMessages({ messageBox, host, originator, acceptPayments }: ListMessagesParams): Promise<PeerMessage[]> {
|
|
1203
|
+
async listMessages ({ messageBox, host, originator, acceptPayments }: ListMessagesParams): Promise<PeerMessage[]> {
|
|
1204
1204
|
if (typeof acceptPayments !== 'boolean') {
|
|
1205
1205
|
acceptPayments = true
|
|
1206
1206
|
}
|
|
1207
|
-
|
|
1207
|
+
if (typeof host !== 'string') {
|
|
1208
|
+
await this.assertInitialized()
|
|
1209
|
+
}
|
|
1208
1210
|
if (messageBox.trim() === '') {
|
|
1209
1211
|
throw new Error('MessageBox cannot be empty')
|
|
1210
1212
|
}
|