@bsv/sdk 1.7.2 → 1.7.3
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/package.json +1 -1
- package/dist/cjs/src/overlay-tools/LookupResolver.js +3 -1
- package/dist/cjs/src/overlay-tools/LookupResolver.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/overlay-tools/LookupResolver.js +3 -1
- package/dist/esm/src/overlay-tools/LookupResolver.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/overlay-tools/LookupResolver.d.ts +1 -1
- package/dist/types/src/overlay-tools/LookupResolver.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +2 -2
- package/dist/umd/bundle.js.map +1 -1
- package/docs/reference/overlay-tools.md +1 -1
- package/package.json +1 -1
- package/src/overlay-tools/LookupResolver.ts +5 -2
|
@@ -324,7 +324,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
324
324
|
export class HTTPSOverlayLookupFacilitator implements OverlayLookupFacilitator {
|
|
325
325
|
fetchClient: typeof fetch;
|
|
326
326
|
allowHTTP: boolean;
|
|
327
|
-
constructor(httpClient =
|
|
327
|
+
constructor(httpClient = defaultFetch, allowHTTP: boolean = false)
|
|
328
328
|
async lookup(url: string, question: LookupQuestion, timeout: number = 5000): Promise<LookupAnswer>
|
|
329
329
|
}
|
|
330
330
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Transaction } from '../transaction/index.js'
|
|
2
2
|
import OverlayAdminTokenTemplate from './OverlayAdminTokenTemplate.js'
|
|
3
3
|
|
|
4
|
+
// Only bind window.fetch in the browser
|
|
5
|
+
const defaultFetch = typeof window !== 'undefined' ? fetch.bind(window) : fetch
|
|
6
|
+
|
|
4
7
|
/**
|
|
5
8
|
* The question asked to the Overlay Services Engine when a consumer of state wishes to look up information.
|
|
6
9
|
*/
|
|
@@ -108,7 +111,7 @@ export class HTTPSOverlayLookupFacilitator implements OverlayLookupFacilitator {
|
|
|
108
111
|
fetchClient: typeof fetch
|
|
109
112
|
allowHTTP: boolean
|
|
110
113
|
|
|
111
|
-
constructor (httpClient =
|
|
114
|
+
constructor (httpClient = defaultFetch, allowHTTP: boolean = false) {
|
|
112
115
|
this.fetchClient = httpClient
|
|
113
116
|
this.allowHTTP = allowHTTP
|
|
114
117
|
}
|
|
@@ -368,7 +371,7 @@ export default class LookupResolver {
|
|
|
368
371
|
}
|
|
369
372
|
|
|
370
373
|
/** Evict an arbitrary “oldest” entry from a Map (iteration order). */
|
|
371
|
-
private evictOldest<T>
|
|
374
|
+
private evictOldest<T>(m: Map<string, T>): void {
|
|
372
375
|
const firstKey = m.keys().next().value
|
|
373
376
|
if (firstKey !== undefined) m.delete(firstKey)
|
|
374
377
|
}
|