@trezor/blockchain-link
Advanced tools
Comparing version 2.1.3-beta.4 to 2.1.3
@@ -0,1 +1,7 @@ | ||
# 2.1.3 | ||
### changes | ||
- revert part of backend selection refactoring (298e56ca992508ba0d5e1c0586d60d7a232eaa6a) | ||
# 2.1.2 | ||
@@ -2,0 +8,0 @@ |
@@ -18,2 +18,4 @@ /// <reference types="node" /> | ||
deferred: Deferred<any>[]; | ||
private throttleBlockEvent; | ||
private throttleBlockEventTimeout; | ||
constructor(settings: BlockchainSettings); | ||
@@ -20,0 +22,0 @@ getWorker(): Promise<Worker>; |
@@ -84,3 +84,14 @@ "use strict"; | ||
if (data.type === constants_1.RESPONSES.NOTIFICATION) { | ||
this.emit(data.payload.type, data.payload.payload); | ||
const notification = data.payload; | ||
if (notification.type === 'block') { | ||
if (this.throttleBlockEvent) | ||
clearTimeout(this.throttleBlockEvent); | ||
this.throttleBlockEvent = setTimeout(() => { | ||
this.emit(notification.type, notification.payload); | ||
this.throttleBlockEvent = undefined; | ||
}, this.throttleBlockEventTimeout); | ||
} | ||
else { | ||
this.emit(notification.type, notification.payload); | ||
} | ||
} | ||
@@ -99,2 +110,4 @@ }; | ||
this.settings = settings; | ||
this.throttleBlockEventTimeout = | ||
typeof settings.throttleBlockEvent === 'number' ? settings.throttleBlockEvent : 500; | ||
} | ||
@@ -101,0 +114,0 @@ async getWorker() { |
@@ -14,2 +14,3 @@ import type { SocksProxyAgentOptions } from 'socks-proxy-agent'; | ||
keepAlive?: boolean; | ||
throttleBlockEvent?: number; | ||
} | ||
@@ -16,0 +17,0 @@ export interface ServerInfo { |
{ | ||
"name": "@trezor/blockchain-link", | ||
"version": "2.1.3-beta.4", | ||
"version": "2.1.3", | ||
"author": "Trezor <info@trezor.io>", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/trezor/trezor-suite/packages/blockchain-link", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
230200
5911
1