Skip adding ephemeral and dvm kinds to repository

This commit is contained in:
Jon Staab
2024-10-31 13:59:05 -07:00
parent c93d102c08
commit 5038046608
5 changed files with 13 additions and 4 deletions
+2
View File
@@ -1,4 +1,5 @@
import {kinds} from 'nostr-tools'
import {between} from '@welshman/lib'
export const isRegularKind = kinds.isRegularKind
export const isEphemeralKind = kinds.isEphemeralKind
@@ -6,6 +7,7 @@ export const isPlainReplaceableKind = kinds.isReplaceableKind
export const isParameterizedReplaceableKind = kinds.isParameterizedReplaceableKind
export const isReplaceableKind = (kind: number) =>
isPlainReplaceableKind(kind) || isParameterizedReplaceableKind(kind)
export const isDVMKind = (kind: number) => between([4999, 7001], kind)
export const PROFILE = 0
export const NOTE = 1
+2
View File
@@ -13,6 +13,7 @@ export const BOGUS_RELAY_URL = "bogus://welshman.relay"
export type RelayProfile = {
url: string
icon?: string
banner?: string
name?: string
pubkey?: string
contact?: string
@@ -21,6 +22,7 @@ export type RelayProfile = {
description?: string
supported_nips?: number[]
limitation?: {
min_pow_difficulty?: number
payment_required?: boolean
auth_required?: boolean
}
+5 -2
View File
@@ -1,6 +1,6 @@
import type {OmitStatics} from '@welshman/lib'
import {Fluent, uniqBy, mapVals, nth, nthEq, ensurePlural} from '@welshman/lib'
import {isRelayUrl, normalizeRelayUrl} from './Relay'
import {Fluent, uniq, uniqBy, mapVals, nth, nthEq, ensurePlural} from '@welshman/lib'
import {isRelayUrl, isShareableRelayUrl, normalizeRelayUrl} from './Relay'
import {Address, isContextAddress} from './Address'
import {GROUP, COMMUNITY} from './Kinds'
@@ -262,4 +262,7 @@ export const getAncestorTags = (tags: string[][]) => {
export const getAncestorTagValues = (tags: string[][]) =>
mapVals(tags => tags.map(nth(1)), getAncestorTags(tags))
export const getRelayHints = (tags: string[][]) =>
uniq(tags.flatMap(t => t.slice(2).filter(isShareableRelayUrl)))
export const uniqTags = (tags: string[][]) => uniqBy(t => t.join(":"), tags)