Merge branch 'develop' into sandbox

Conflicts:
	dist/ethereum.js.map
	dist/ethereum.min.js
This commit is contained in:
Marek Kotewicz 2015-03-23 23:03:50 +01:00
commit a4e3645190
13 changed files with 3466 additions and 17 deletions

View File

@ -1,5 +1,7 @@
# Ethereum JavaScript API
[![Join the chat at https://gitter.im/ethereum/ethereum.js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ethereum/ethereum.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
This is the Ethereum compatible [JavaScript API](https://github.com/ethereum/wiki/wiki/JavaScript-API)
which implements the [Generic JSON RPC](https://github.com/ethereum/wiki/wiki/JSON-RPC) spec. It's available on npm as a node module, for bower and component as an embeddable js and as a meteor.js package.

3342
dist/ethereum-light.js vendored Normal file

File diff suppressed because it is too large Load Diff

69
dist/ethereum-light.js.map vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/ethereum-light.min.js vendored Normal file

File diff suppressed because one or more lines are too long

14
dist/ethereum.js vendored
View File

@ -540,7 +540,13 @@ module.exports = {
},{"./formatters":2}],4:[function(require,module,exports){
'use strict';
exports.XMLHttpRequest = window.XMLHttpRequest;
// go env doesn't have and need XMLHttpRequest
if (typeof XMLHttpRequest === 'undefined') {
exports.XMLHttpRequest = {};
} else {
exports.XMLHttpRequest = XMLHttpRequest; // jshint ignore:line
}
},{}],5:[function(require,module,exports){
/*
@ -1190,7 +1196,7 @@ var setupProperties = function (obj, properties) {
proto.set = function (val) {
return web3.manager.send({
method: property.setter,
params: [method.formatInput(val)]
params: [property.formatInput(val)]
});
};
}
@ -2340,6 +2346,8 @@ var inputTransactionFormatter = function (options){
* @returns {Object} transaction
*/
var outputTransactionFormatter = function (tx){
tx.blockNumber = utils.toDecimal(tx.blockNumber);
tx.transactionIndex = utils.toDecimal(tx.transactionIndex);
tx.gas = utils.toDecimal(tx.gas);
tx.gasPrice = utils.toBigNumber(tx.gasPrice);
tx.value = utils.toBigNumber(tx.value);
@ -2806,7 +2814,7 @@ module.exports = {
along with ethereum.js. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file method.js
* @file property.js
* @author Fabian Vogelsteller <fabian@frozeman.de>
* @date 2015
*/

10
dist/ethereum.js.map vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -3,7 +3,7 @@
<head>
<script type="text/javascript" src="js/bignumber.js/bignumber.min.js"></script>
<script type="text/javascript" src="../dist/ethereum.js"></script>
<script type="text/javascript" src="../dist/ethereum-light.js"></script>
<script type="text/javascript">
var web3 = require('ethereum.js');

View File

@ -20,6 +20,7 @@ var replace = require('gulp-replace');
var DEST = './dist/';
var src = 'index';
var dst = 'ethereum';
var lightDst = 'ethereum-light';
var browserifyOptions = {
debug: true,
@ -54,7 +55,22 @@ gulp.task('lint', function(){
.pipe(jshint.reporter('default'));
});
gulp.task('build', ['clean'], function () {
gulp.task('buildLight', ['clean'], function () {
return browserify(browserifyOptions)
.require('./' + src + '.js', {expose: 'ethereum.js'})
.ignore('bignumber.js')
.require('./lib/utils/browser-bn.js', {expose: 'bignumber.js'}) // fake bignumber.js
.add('./' + src + '.js')
.bundle()
.pipe(exorcist(path.join( DEST, lightDst + '.js.map')))
.pipe(source(lightDst + '.js'))
.pipe(gulp.dest( DEST ))
.pipe(streamify(uglify()))
.pipe(rename(lightDst + '.min.js'))
.pipe(gulp.dest( DEST ));
});
gulp.task('buildStandalone', ['clean'], function () {
return browserify(browserifyOptions)
.require('./' + src + '.js', {expose: 'ethereum.js'})
.require('bignumber.js') // expose it to dapp users
@ -73,8 +89,9 @@ gulp.task('watch', function() {
gulp.watch(['./lib/*.js'], ['lint', 'build']);
});
gulp.task('dev', ['versionReplace','bower', 'lint', 'build']);
gulp.task('default', ['dev']);
gulp.task('light', ['versionReplace','bower', 'lint', 'buildLight']);
gulp.task('standalone', ['versionReplace','bower', 'lint', 'buildStandalone']);
gulp.task('default', ['light', 'standalone']);
gulp.task('version', ['versionReplace']);

4
lib/utils/browser-bn.js Normal file
View File

@ -0,0 +1,4 @@
'use strict';
module.exports = BigNumber; // jshint ignore:line

View File

@ -1,3 +1,9 @@
'use strict';
exports.XMLHttpRequest = window.XMLHttpRequest;
// go env doesn't have and need XMLHttpRequest
if (typeof XMLHttpRequest === 'undefined') {
exports.XMLHttpRequest = {};
} else {
exports.XMLHttpRequest = XMLHttpRequest; // jshint ignore:line
}

View File

@ -105,7 +105,7 @@ var setupProperties = function (obj, properties) {
proto.set = function (val) {
return web3.manager.send({
method: property.setter,
params: [method.formatInput(val)]
params: [property.formatInput(val)]
});
};
}

View File

@ -15,7 +15,7 @@
along with ethereum.js. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file method.js
* @file property.js
* @author Fabian Vogelsteller <fabian@frozeman.de>
* @date 2015
*/