UNPKG

fabric-network

Version:

SDK for writing node.js applications to interact with Hyperledger Fabric. This package encapsulates the APIs to connect to a Fabric network, submit transactions and perform queries against the ledger.

23 lines 709 B
"use strict"; /* * Copyright 2020 IBM All Rights Reserved. * * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", { value: true }); exports.SharedBlockListenerSession = void 0; class SharedBlockListenerSession { constructor(listener, eventSource) { this.listener = listener; this.eventSource = eventSource; } async start() { await this.eventSource.addBlockListener(this.listener); } close() { this.eventSource.removeBlockListener(this.listener); // Don't close the shared event source } } exports.SharedBlockListenerSession = SharedBlockListenerSession; //# sourceMappingURL=sharedblocklistenersession.js.map