feat: support kind 20
This commit is contained in:
parent
4205e32d0f
commit
4343765aba
30 changed files with 1221 additions and 712 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { Event, nip19 } from 'nostr-tools'
|
||||
|
||||
export const toHome = () => '/'
|
||||
export const toNote = (eventOrId: Event | string) => {
|
||||
export const toNote = (eventOrId: Pick<Event, 'id' | 'pubkey'> | string) => {
|
||||
if (typeof eventOrId === 'string') return `/notes/${eventOrId}`
|
||||
const nevent = nip19.neventEncode({ id: eventOrId.id, author: eventOrId.pubkey })
|
||||
return `/notes/${nevent}`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue