@bsv/message-box-client 1.2.0 → 1.2.1

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.0",
3
+ "version": "1.2.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -65,7 +65,7 @@
65
65
  "ts-standard": "^12.0.2",
66
66
  "ts2md": "^0.2.8",
67
67
  "tsconfig-to-dual-package": "^1.2.0",
68
- "typescript": "^5.7.3",
68
+ "typescript": "^5.8.3",
69
69
  "typescript-eslint": "^8.24.0",
70
70
  "webpack": "^5.98.0",
71
71
  "webpack-bundle-analyzer": "^4.10.2",
@@ -1200,7 +1200,10 @@ 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 }: ListMessagesParams): Promise<PeerMessage[]> {
1203
+ async listMessages({ messageBox, host, originator, acceptPayments }: ListMessagesParams): Promise<PeerMessage[]> {
1204
+ if (typeof acceptPayments !== 'boolean') {
1205
+ acceptPayments = true
1206
+ }
1204
1207
  await this.assertInitialized()
1205
1208
  if (messageBox.trim() === '') {
1206
1209
  throw new Error('MessageBox cannot be empty')
@@ -1293,7 +1296,7 @@ export class MessageBoxClient {
1293
1296
  }
1294
1297
 
1295
1298
  // Process payment if present - server now only stores recipient payments
1296
- if (paymentData?.tx != null && paymentData.outputs != null) {
1299
+ if (acceptPayments && paymentData?.tx != null && paymentData.outputs != null) {
1297
1300
  try {
1298
1301
  Logger.log(
1299
1302
  `[MB CLIENT] Processing recipient payment in message from ${String(message.sender)}…`
package/src/types.ts CHANGED
@@ -108,6 +108,7 @@ export interface ListMessagesParams {
108
108
  messageBox: string
109
109
  host?: string
110
110
  originator?: string
111
+ acceptPayments?: boolean
111
112
  }
112
113
 
113
114
  /**