@bsv/sdk 1.8.5 → 1.8.6

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/sdk",
3
- "version": "1.8.5",
3
+ "version": "1.8.6",
4
4
  "type": "module",
5
5
  "description": "BSV Blockchain Software Development Kit",
6
6
  "main": "dist/cjs/mod.js",
@@ -146,9 +146,7 @@ export class HTTPSOverlayLookupFacilitator implements OverlayLookupFacilitator {
146
146
  const response: Response = await this.fetchClient(`${url}/lookup`, fco)
147
147
 
148
148
  if (!response.ok) throw new Error(`Failed to facilitate lookup (HTTP ${response.status})`)
149
- if (response.headers.get('content-type') === 'application/json') {
150
- return await response.json()
151
- } else {
149
+ if (response.headers.get('content-type') === 'application/octet-stream') {
152
150
  const payload = await response.arrayBuffer()
153
151
  const r = new Utils.Reader([...new Uint8Array(payload)])
154
152
  const nOutpoints = r.readVarIntNum()
@@ -176,6 +174,8 @@ export class HTTPSOverlayLookupFacilitator implements OverlayLookupFacilitator {
176
174
  beef: Transaction.fromBEEF(beef, x.txid).toBEEF()
177
175
  }))
178
176
  }
177
+ } else {
178
+ return await response.json()
179
179
  }
180
180
  } catch (e) {
181
181
  // Normalize timeouts to a consistent error message