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
151
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 1.7.0 to 1.7.1

12

lib/nostr.cjs.js

@@ -332,3 +332,4 @@ "use strict";

// relay.ts
function relayInit(url) {
function relayInit(url, options = {}) {
let { listTimeout = 3e3, getTimeout = 3e3 } = options;
var ws;

@@ -507,3 +508,3 @@ var openSubs = {};

resolve(events);
}, 1500);
}, listTimeout);
s.on("eose", () => {

@@ -523,3 +524,3 @@ s.unsub();

resolve(null);
}, 1500);
}, getTimeout);
s.on("event", (event) => {

@@ -590,3 +591,6 @@ s.unsub();

return existing;
const relay = relayInit(nm);
const relay = relayInit(nm, {
getTimeout: this.getTimeout * 0.9,
listTimeout: this.getTimeout * 0.9
});
this._conn[nm] = relay;

@@ -593,0 +597,0 @@ await relay.connect();

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

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

@@ -32,3 +32,6 @@ import {Relay, relayInit} from './relay'

const relay = relayInit(nm)
const relay = relayInit(nm, {
getTimeout: this.getTimeout * 0.9,
listTimeout: this.getTimeout * 0.9
})
this._conn[nm] = relay

@@ -35,0 +38,0 @@

@@ -38,3 +38,11 @@ /* global WebSocket */

export function relayInit(url: string): Relay {
export function relayInit(
url: string,
options: {
getTimeout?: number
listTimeout?: number
} = {}
): Relay {
let {listTimeout = 3000, getTimeout = 3000} = options
var ws: WebSocket

@@ -256,3 +264,3 @@ var openSubs: {[id: string]: {filters: Filter[]} & SubscriptionOptions} = {}

resolve(events)
}, 1500)
}, listTimeout)
s.on('eose', () => {

@@ -273,3 +281,3 @@ s.unsub()

resolve(null)
}, 1500)
}, getTimeout)
s.on('event', (event: Event) => {

@@ -276,0 +284,0 @@ s.unsub()

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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