classes/transport.js

'use strict';

/**
 * @class
 * @description The base class for all transports
 */

class Transport {
	/**
	 * @constructor
	 * @param {Object} [opts] General settings for the Transport
	 * @param {Adapter} adapter Adapter for which this is a plugin
	 */
	constructor(opts, adapter) {
		this._opts = opts;
		this._adapter = adapter;
	}

	/**
	 * @description Send a command to an address
	 * @param {Object} address The address the command will be sent to
	 * @param {Command} command The command to send
	 * @returns {Promise}
	 * @abstract
	 */
	send(address, command) {
		throw new Error('Must be implemented by subclass!');
	}
};


module.exports = Transport;