@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsv/message-box-client",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -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
- await this.assertInitialized()
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
  }