@bsv/sdk 1.8.8 → 1.8.9

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.
@@ -248,6 +248,7 @@ export interface KVStoreQuery {
248
248
  controller?: PubKeyHex;
249
249
  protocolID?: WalletProtocol;
250
250
  tags?: string[];
251
+ tagQueryMode?: "all" | "any";
251
252
  limit?: number;
252
253
  skip?: number;
253
254
  sortOrder?: "asc" | "desc";
@@ -256,6 +257,16 @@ export interface KVStoreQuery {
256
257
 
257
258
  See also: [PubKeyHex](./wallet.md#type-pubkeyhex), [WalletProtocol](./wallet.md#type-walletprotocol)
258
259
 
260
+ #### Property tagQueryMode
261
+
262
+ Controls tag matching behavior when tags are specified.
263
+ - 'all': Requires all specified tags to be present (default)
264
+ - 'any': Requires at least one of the specified tags to be present
265
+
266
+ ```ts
267
+ tagQueryMode?: "all" | "any"
268
+ ```
269
+
259
270
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
260
271
 
261
272
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsv/sdk",
3
- "version": "1.8.8",
3
+ "version": "1.8.9",
4
4
  "type": "module",
5
5
  "description": "BSV Blockchain Software Development Kit",
6
6
  "main": "dist/cjs/mod.js",
@@ -3,8 +3,10 @@
3
3
  import { AuthMessage, RequestedCertificateSet, Transport } from '../types.js'
4
4
  import * as Utils from '../../primitives/utils.js'
5
5
 
6
- // Only bind window.fetch in the browser
7
- const defaultFetch = typeof window !== 'undefined' ? fetch.bind(window) : fetch
6
+ const defaultFetch: typeof fetch =
7
+ typeof globalThis !== 'undefined' && typeof globalThis.fetch === 'function'
8
+ ? globalThis.fetch.bind(globalThis)
9
+ : fetch
8
10
 
9
11
  /**
10
12
  * Implements an HTTP-specific transport for handling Peer mutual authentication messages.
@@ -21,6 +23,12 @@ export class SimplifiedFetchTransport implements Transport {
21
23
  * @param fetchClient - A fetch implementation to use for HTTP requests (default: global fetch).
22
24
  */
23
25
  constructor (baseUrl: string, fetchClient = defaultFetch) {
26
+ if (typeof fetchClient !== 'function') {
27
+ throw new Error(
28
+ 'SimplifiedFetchTransport requires a fetch implementation. ' +
29
+ 'In environments without fetch, provide a polyfill or custom implementation.'
30
+ )
31
+ }
24
32
  this.fetchClient = fetchClient
25
33
  this.baseUrl = baseUrl
26
34
  }
@@ -2,8 +2,10 @@ import { Transaction } from '../transaction/index.js'
2
2
  import OverlayAdminTokenTemplate from './OverlayAdminTokenTemplate.js'
3
3
  import * as Utils from '../primitives/utils.js'
4
4
 
5
- // Only bind window.fetch in the browser
6
- const defaultFetch = typeof window !== 'undefined' ? fetch.bind(window) : fetch
5
+ const defaultFetch: typeof fetch =
6
+ typeof globalThis !== 'undefined' && typeof globalThis.fetch === 'function'
7
+ ? globalThis.fetch.bind(globalThis)
8
+ : fetch
7
9
 
8
10
  /**
9
11
  * The question asked to the Overlay Services Engine when a consumer of state wishes to look up information.
@@ -113,6 +115,12 @@ export class HTTPSOverlayLookupFacilitator implements OverlayLookupFacilitator {
113
115
  allowHTTP: boolean
114
116
 
115
117
  constructor (httpClient = defaultFetch, allowHTTP: boolean = false) {
118
+ if (typeof httpClient !== 'function') {
119
+ throw new Error(
120
+ 'HTTPSOverlayLookupFacilitator requires a fetch implementation. ' +
121
+ 'In environments without fetch, provide a polyfill or custom implementation.'
122
+ )
123
+ }
116
124
  this.fetchClient = httpClient
117
125
  this.allowHTTP = allowHTTP
118
126
  }