mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-09 08:38:50 +00:00
Rename pubkeys to profiles (NIP-10)
This commit is contained in:
@@ -72,7 +72,7 @@ describe('parse NIP10-referenced events', () => {
|
|||||||
relays: []
|
relays: []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
pubkeys: [
|
profiles: [
|
||||||
{
|
{
|
||||||
pubkey:
|
pubkey:
|
||||||
'77ce56f89d1228f7ff3743ce1ad1b254857b9008564727ebd5a1f317362f6ca7',
|
'77ce56f89d1228f7ff3743ce1ad1b254857b9008564727ebd5a1f317362f6ca7',
|
||||||
@@ -137,7 +137,7 @@ describe('parse NIP10-referenced events', () => {
|
|||||||
relays: []
|
relays: []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
pubkeys: [
|
profiles: [
|
||||||
{
|
{
|
||||||
pubkey:
|
pubkey:
|
||||||
'77ce56f89d1228f7ff3743ce1ad1b254857b9008564727ebd5a1f317362f6ca7',
|
'77ce56f89d1228f7ff3743ce1ad1b254857b9008564727ebd5a1f317362f6ca7',
|
||||||
@@ -193,7 +193,7 @@ describe('parse NIP10-referenced events', () => {
|
|||||||
|
|
||||||
expect(nip10.parse(event)).toEqual({
|
expect(nip10.parse(event)).toEqual({
|
||||||
mentions: [],
|
mentions: [],
|
||||||
pubkeys: [
|
profiles: [
|
||||||
{
|
{
|
||||||
pubkey:
|
pubkey:
|
||||||
'77ce56f89d1228f7ff3743ce1ad1b254857b9008564727ebd5a1f317362f6ca7',
|
'77ce56f89d1228f7ff3743ce1ad1b254857b9008564727ebd5a1f317362f6ca7',
|
||||||
@@ -237,7 +237,7 @@ describe('parse NIP10-referenced events', () => {
|
|||||||
|
|
||||||
expect(nip10.parse(event)).toEqual({
|
expect(nip10.parse(event)).toEqual({
|
||||||
mentions: [],
|
mentions: [],
|
||||||
pubkeys: [
|
profiles: [
|
||||||
{
|
{
|
||||||
pubkey:
|
pubkey:
|
||||||
'534780e44da7b494485e85cd4cca6af4f6caa1627472432b6f2a4ece0e9e54ec',
|
'534780e44da7b494485e85cd4cca6af4f6caa1627472432b6f2a4ece0e9e54ec',
|
||||||
@@ -306,7 +306,7 @@ describe('parse NIP10-referenced events', () => {
|
|||||||
|
|
||||||
expect(nip10.parse(event)).toEqual({
|
expect(nip10.parse(event)).toEqual({
|
||||||
mentions: [],
|
mentions: [],
|
||||||
pubkeys: [
|
profiles: [
|
||||||
{
|
{
|
||||||
pubkey:
|
pubkey:
|
||||||
'a8c21fcd8aa1f4befba14d72fc7a012397732d30d8b3131af912642f3c726f52',
|
'a8c21fcd8aa1f4befba14d72fc7a012397732d30d8b3131af912642f3c726f52',
|
||||||
|
|||||||
6
nip10.ts
6
nip10.ts
@@ -20,7 +20,7 @@ export type NIP10Result = {
|
|||||||
/**
|
/**
|
||||||
* List of pubkeys that are involved in the thread in no particular order.
|
* List of pubkeys that are involved in the thread in no particular order.
|
||||||
*/
|
*/
|
||||||
pubkeys: ProfilePointer[]
|
profiles: ProfilePointer[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export function parse(event: Pick<Event, 'tags'>): NIP10Result {
|
export function parse(event: Pick<Event, 'tags'>): NIP10Result {
|
||||||
@@ -28,7 +28,7 @@ export function parse(event: Pick<Event, 'tags'>): NIP10Result {
|
|||||||
reply: undefined,
|
reply: undefined,
|
||||||
root: undefined,
|
root: undefined,
|
||||||
mentions: [],
|
mentions: [],
|
||||||
pubkeys: []
|
profiles: []
|
||||||
}
|
}
|
||||||
|
|
||||||
const eTags: string[][] = []
|
const eTags: string[][] = []
|
||||||
@@ -39,7 +39,7 @@ export function parse(event: Pick<Event, 'tags'>): NIP10Result {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (tag[0] === 'p' && tag[1]) {
|
if (tag[0] === 'p' && tag[1]) {
|
||||||
result.pubkeys.push({
|
result.profiles.push({
|
||||||
pubkey: tag[1],
|
pubkey: tag[1],
|
||||||
relays: tag[2] ? [tag[2]] : []
|
relays: tag[2] ? [tag[2]] : []
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user