Skip adding ephemeral and dvm kinds to repository
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user