import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _ from 'lodash';

import isRequired from '../utils/isRequired';
import delegateCalls from '../utils/delegateCalls';

/**
 * Abstract Contract holds a contract implementation to make calls to the blockchain but
 * also includes methods that interact with the off chain store. NOTE all methods that
 * the underlying contract implementation expose can be called directly from an Abstract contract.
 */

var AbstractContract =
/**
 * AbstractContract wraps an implementation instance to provide access to higher level
 * services such as an off chain store, as well as the functionality of the underlying
 * implementation.
 * @param {object} implementationInstance - Contract Implementation object to extend
 * @param {object} storeProviderInstance - StoreProvider wrapper object.
 */
function AbstractContract() {
  var implementationInstance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : isRequired('implementationInstance');
  var storeProviderInstance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isRequired('storeProviderInstance');

  _classCallCheck(this, AbstractContract);

  _initialiseProps.call(this);

  this._StoreProvider = storeProviderInstance;
  this._contractImplementation = implementationInstance;
  delegateCalls(this, implementationInstance);
}

/**
 * Set store provider instance.
 * @param {object} storeProviderInstance - instance of store provider wrapper.
 */
;

var _initialiseProps = function _initialiseProps() {
  var _this = this;

  this.setStoreProviderInstance = function (storeProviderInstance) {
    _this._StoreProvider = storeProviderInstance;
  };
};

export default AbstractContract;
//# sourceMappingURL=AbstractContract.js.map