create daemon
This commit is contained in:
18
thrower_daemon/node_modules/nostr-tools/lib/esm/nip11.js
generated
vendored
Normal file
18
thrower_daemon/node_modules/nostr-tools/lib/esm/nip11.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
// nip11.ts
|
||||
var _fetch;
|
||||
try {
|
||||
_fetch = fetch;
|
||||
} catch {
|
||||
}
|
||||
function useFetchImplementation(fetchImplementation) {
|
||||
_fetch = fetchImplementation;
|
||||
}
|
||||
async function fetchRelayInformation(url) {
|
||||
return await (await fetch(url.replace("ws://", "http://").replace("wss://", "https://"), {
|
||||
headers: { Accept: "application/nostr+json" }
|
||||
})).json();
|
||||
}
|
||||
export {
|
||||
fetchRelayInformation,
|
||||
useFetchImplementation
|
||||
};
|
||||
Reference in New Issue
Block a user