Detect blossom support using supported_nips
This commit is contained in:
@@ -75,6 +75,7 @@ import {
|
|||||||
getThunkError,
|
getThunkError,
|
||||||
addRoomMember,
|
addRoomMember,
|
||||||
manageRelay,
|
manageRelay,
|
||||||
|
getRelay,
|
||||||
} from "@welshman/app"
|
} from "@welshman/app"
|
||||||
import {compressFile} from "@lib/html"
|
import {compressFile} from "@lib/html"
|
||||||
import type {SettingsValues, SpaceNotificationSettings} from "@app/core/state"
|
import type {SettingsValues, SpaceNotificationSettings} from "@app/core/state"
|
||||||
@@ -553,6 +554,12 @@ export const createInvoice = async ({
|
|||||||
export const normalizeBlossomUrl = (url: string) => normalizeUrl(url.replace(/^ws/, "http"))
|
export const normalizeBlossomUrl = (url: string) => normalizeUrl(url.replace(/^ws/, "http"))
|
||||||
|
|
||||||
export const fetchHasBlossomSupport = async (url: string) => {
|
export const fetchHasBlossomSupport = async (url: string) => {
|
||||||
|
const relay = getRelay(url)
|
||||||
|
|
||||||
|
if (relay?.supported_nips?.map(String).includes("BUD-02")) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
const server = normalizeBlossomUrl(url)
|
const server = normalizeBlossomUrl(url)
|
||||||
const $signer = signer.get() || Nip01Signer.ephemeral()
|
const $signer = signer.get() || Nip01Signer.ephemeral()
|
||||||
const headers: Record<string, string> = {
|
const headers: Record<string, string> = {
|
||||||
|
|||||||
Reference in New Issue
Block a user