xrpl-txdata
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -161,6 +161,7 @@ "use strict"; | ||
const cleanup = () => { | ||
var _a; | ||
clearTimeout(Timer); | ||
meta.resolved = true; | ||
this.EventBus.removeListener('result', onTx); | ||
this.EventBus.listeners('tx.' + TxHash).forEach(l => this.EventBus.removeListener('tx.' + TxHash, l)); | ||
(_a = this === null || this === void 0 ? void 0 : this.EventBus) === null || _a === void 0 ? void 0 : _a.removeListener('result', onTx); | ||
this.EventBus.listeners('tx.' + TxHash).forEach(l => { var _a; return (_a = this === null || this === void 0 ? void 0 : this.EventBus) === null || _a === void 0 ? void 0 : _a.removeListener('tx.' + TxHash, l); }); | ||
}; | ||
@@ -204,7 +205,7 @@ const ResolveFormatted = (eventResult, resolvedBy, host) => { | ||
const onTx = (r) => { | ||
var _a, _b; | ||
var _a, _b, _c; | ||
if (!meta.resolved && r.txHash === TxHash && | ||
typeof (r === null || r === void 0 ? void 0 : r.result) === 'object' && | ||
((((_a = this.FormatResult(r.result)) === null || _a === void 0 ? void 0 : _a.meta) || ((_b = this.FormatResult(r.result)) === null || _b === void 0 ? void 0 : _b.error)))) { | ||
this.EventBus.off('result', onTx); | ||
(_c = this === null || this === void 0 ? void 0 : this.EventBus) === null || _c === void 0 ? void 0 : _c.removeListener('result', onTx); | ||
ResolveFormatted(r.result, 'emitter', r.host); | ||
@@ -430,3 +431,4 @@ } | ||
process.nextTick(() => { | ||
this.EventBus.removeListener('xrpljson', onTx); | ||
var _a; | ||
(_a = this === null || this === void 0 ? void 0 : this.EventBus) === null || _a === void 0 ? void 0 : _a.removeListener('xrpljson', onTx); | ||
}); | ||
@@ -433,0 +435,0 @@ return resolve(r); |
{ | ||
"name": "xrpl-txdata", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "Fetch XRPL transaction by hash (+ meta & balances), awaits if required", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
47000
734