Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nostr-tools

Package Overview
Dependencies
Maintainers
1
Versions
152
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nostr-tools - npm Package Compare versions

Comparing version 0.15.0 to 0.15.1

1

event.js

@@ -51,3 +51,2 @@ import {Buffer} from 'buffer'

export function verifySignature(event) {
if (!validateEvent(event)) return false
return secp256k1.schnorr.verify(event.sig, event.id, event.pubkey)

@@ -54,0 +53,0 @@ }

3

filter.js
export function matchFilter(filter, event) {
if (filter.id && event.id !== filter.id) return false
if (filter.kind && event.kind !== filter.kind) return false
if (filter.author && event.pubkey !== filter.author) return false
if (typeof filter.kind === 'number' && event.kind !== filter.kind) return false
if (filter.authors && filter.authors.indexOf(event.pubkey) === -1)

@@ -6,0 +5,0 @@ return false

@@ -7,2 +7,3 @@ import {generatePrivateKey, getPublicKey} from './keys'

signEvent,
validateEvent,
verifySignature,

@@ -19,2 +20,3 @@ serializeEvent,

signEvent,
validateEvent,
verifySignature,

@@ -21,0 +23,0 @@ serializeEvent,

{
"name": "nostr-tools",
"version": "0.15.0",
"version": "0.15.1",
"description": "Tools for making a Nostr client.",

@@ -5,0 +5,0 @@ "repository": {

@@ -5,3 +5,3 @@ /* global WebSocket */

import {verifySignature} from './event'
import {verifySignature, validateEvent} from './event'
import {matchFilters} from './filter'

@@ -97,3 +97,4 @@

if (
(await verifySignature(event)) &&
validateEvent(event) &&
verifySignature(event) &&
channels[channel] &&

@@ -100,0 +101,0 @@ matchFilters(openSubs[channel], event)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc