@colony/colony-js-contract-loader-http
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -6,22 +6,31 @@ 'use strict'; | ||
}); | ||
exports.TrufflepigLoader = exports.EtherscanLoader = exports.ContractHttpLoader = undefined; | ||
var _ContractHttpLoader = require('./loaders/ContractHttpLoader'); | ||
var _HttpLoader = require('./loaders/HttpLoader'); | ||
var _ContractHttpLoader2 = _interopRequireDefault(_ContractHttpLoader); | ||
Object.defineProperty(exports, 'HttpLoader', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_HttpLoader).default; | ||
} | ||
}); | ||
var _EtherscanLoader = require('./loaders/EtherscanLoader'); | ||
var _EtherscanLoader2 = _interopRequireDefault(_EtherscanLoader); | ||
Object.defineProperty(exports, 'EtherscanLoader', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_EtherscanLoader).default; | ||
} | ||
}); | ||
var _TrufflepigLoader = require('./loaders/TrufflepigLoader'); | ||
var _TrufflepigLoader2 = _interopRequireDefault(_TrufflepigLoader); | ||
Object.defineProperty(exports, 'TrufflepigLoader', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_TrufflepigLoader).default; | ||
} | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports.default = _ContractHttpLoader2.default; | ||
exports.ContractHttpLoader = _ContractHttpLoader2.default; | ||
exports.EtherscanLoader = _EtherscanLoader2.default; | ||
exports.TrufflepigLoader = _TrufflepigLoader2.default; | ||
//# sourceMappingURL=index.js.map |
@@ -31,5 +31,5 @@ 'use strict'; | ||
var _ContractHttpLoader2 = require('./ContractHttpLoader'); | ||
var _HttpLoader2 = require('./HttpLoader'); | ||
var _ContractHttpLoader3 = _interopRequireDefault(_ContractHttpLoader2); | ||
var _HttpLoader3 = _interopRequireDefault(_HttpLoader2); | ||
@@ -75,4 +75,4 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var EtherscanLoader = function (_ContractHttpLoader) { | ||
(0, _inherits3.default)(EtherscanLoader, _ContractHttpLoader); | ||
var EtherscanLoader = function (_HttpLoader) { | ||
(0, _inherits3.default)(EtherscanLoader, _HttpLoader); | ||
@@ -92,5 +92,5 @@ function EtherscanLoader() { | ||
return EtherscanLoader; | ||
}(_ContractHttpLoader3.default); | ||
}(_HttpLoader3.default); | ||
exports.default = EtherscanLoader; | ||
//# sourceMappingURL=EtherscanLoader.js.map |
@@ -19,10 +19,2 @@ 'use strict'; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties'); | ||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
@@ -46,6 +38,8 @@ | ||
var _ContractHttpLoader2 = require('./ContractHttpLoader'); | ||
var _colonyJsContractLoader = require('@colony/colony-js-contract-loader'); | ||
var _ContractHttpLoader3 = _interopRequireDefault(_ContractHttpLoader2); | ||
var _HttpLoader2 = require('./HttpLoader'); | ||
var _HttpLoader3 = _interopRequireDefault(_HttpLoader2); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -57,49 +51,13 @@ | ||
function trufflepigTransform() { | ||
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
_ref$abi = _ref.abi, | ||
abi = _ref$abi === undefined ? [] : _ref$abi, | ||
bytecode = _ref.bytecode, | ||
_ref$networks = _ref.networks, | ||
networks = _ref$networks === undefined ? {} : _ref$networks; | ||
var TrufflepigLoader = function (_HttpLoader) { | ||
(0, _inherits3.default)(TrufflepigLoader, _HttpLoader); | ||
var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, | ||
networkId = _ref2.networkId; | ||
var address = void 0; | ||
var networkIds = Object.keys(networks); | ||
if (networkId && networkIds.length) { | ||
if (!networks[networkId]) throw new Error('Network ID ' + networkId + ' not found in contract'); | ||
address = networks[networkId].address; | ||
} else { | ||
var _ref3 = networks[parseInt(networkIds[networkIds.length - 1], 10)] || {}; | ||
// Pick the last network (assumed to be the most recent) | ||
address = _ref3.address; | ||
} | ||
return { | ||
abi: abi, | ||
address: address, | ||
bytecode: bytecode | ||
}; | ||
} | ||
var TrufflepigLoader = function (_ContractHttpLoader) { | ||
(0, _inherits3.default)(TrufflepigLoader, _ContractHttpLoader); | ||
function TrufflepigLoader() { | ||
var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
_ref$endpoint = _ref.endpoint, | ||
endpoint = _ref$endpoint === undefined ? DEFAULT_ENDPOINT : _ref$endpoint; | ||
var _ref4$transform = _ref4.transform, | ||
transform = _ref4$transform === undefined ? trufflepigTransform : _ref4$transform, | ||
_ref4$endpoint = _ref4.endpoint, | ||
endpoint = _ref4$endpoint === undefined ? DEFAULT_ENDPOINT : _ref4$endpoint, | ||
rest = (0, _objectWithoutProperties3.default)(_ref4, ['transform', 'endpoint']); | ||
(0, _classCallCheck3.default)(this, TrufflepigLoader); | ||
var _this = (0, _possibleConstructorReturn3.default)(this, (TrufflepigLoader.__proto__ || Object.getPrototypeOf(TrufflepigLoader)).call(this, (0, _extends3.default)({ transform: transform, endpoint: endpoint }, rest))); | ||
var _this = (0, _possibleConstructorReturn3.default)(this, (TrufflepigLoader.__proto__ || Object.getPrototypeOf(TrufflepigLoader)).call(this, { transform: _colonyJsContractLoader.truffleTransform, endpoint: endpoint })); | ||
@@ -117,3 +75,3 @@ var _this$_endpoint$split = _this._endpoint.split('/contracts'), | ||
value: function () { | ||
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(index) { | ||
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(index) { | ||
var response, accounts, addresses, address, privateKey; | ||
@@ -156,4 +114,4 @@ return _regenerator2.default.wrap(function _callee$(_context) { | ||
function getAccount(_x4) { | ||
return _ref5.apply(this, arguments); | ||
function getAccount(_x2) { | ||
return _ref2.apply(this, arguments); | ||
} | ||
@@ -165,5 +123,5 @@ | ||
return TrufflepigLoader; | ||
}(_ContractHttpLoader3.default); | ||
}(_HttpLoader3.default); | ||
exports.default = TrufflepigLoader; | ||
//# sourceMappingURL=TrufflepigLoader.js.map |
{ | ||
"name": "@colony/colony-js-contract-loader-http", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "Load Ethereum smart contract definitions/metadata over HTTP", | ||
@@ -46,5 +46,5 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@colony/colony-js-contract-loader": "^1.2.1", | ||
"@colony/colony-js-contract-loader": "^1.3.0", | ||
"assert": "^1.4.1", | ||
"babel-runtime": "^6.26.0", | ||
"browser-assert": "^1.2.1", | ||
"isomorphic-fetch": "^2.2.1" | ||
@@ -51,0 +51,0 @@ }, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
310557
2131
18
+ Addedassert@^1.4.1
+ Addedassert@1.5.1(transitive)
+ Addedinherits@2.0.3(transitive)
+ Addedutil@0.10.4(transitive)
- Removedbrowser-assert@^1.2.1
- Removedbrowser-assert@1.2.1(transitive)
- Removedinherits@2.0.4(transitive)