mirror of
https://github.com/status-im/web3.js.git
synced 2025-02-23 11:38:12 +00:00
add build files
This commit is contained in:
parent
47412c3dbd
commit
2cd4f02e75
35
dist/ethereum.js
vendored
35
dist/ethereum.js
vendored
@ -1143,19 +1143,10 @@ Formats the output of a transaction to its proper values
|
|||||||
*/
|
*/
|
||||||
var outputTransactionFormatter = function(tx){
|
var outputTransactionFormatter = function(tx){
|
||||||
// transform to number
|
// transform to number
|
||||||
tx.gas = Number(tx.gas);
|
tx.gas = utils.toDecimal(tx.gas);
|
||||||
|
|
||||||
// gasPrice to bignumber
|
tx.gasPrice = utils.toBigNumber(tx.gasPrice);
|
||||||
if(typeof tx.gasPrice === 'string' && tx.gasPrice.indexOf('0x') === 0)
|
tx.value = utils.toBigNumber(tx.value);
|
||||||
tx.gasPrice = new BigNumber(tx.gasPrice, 16);
|
|
||||||
else
|
|
||||||
tx.gasPrice = new BigNumber(tx.gasPrice.toString(10), 10);
|
|
||||||
|
|
||||||
// value to bignumber
|
|
||||||
if(typeof tx.value === 'string' && tx.value.indexOf('0x') === 0)
|
|
||||||
tx.value = new BigNumber(tx.value, 16);
|
|
||||||
else
|
|
||||||
tx.value = new BigNumber(tx.value.toString(10), 10);
|
|
||||||
|
|
||||||
return tx;
|
return tx;
|
||||||
};
|
};
|
||||||
@ -1169,11 +1160,12 @@ Formats the output of a block to its proper values
|
|||||||
var outputBlockFormatter = function(block){
|
var outputBlockFormatter = function(block){
|
||||||
|
|
||||||
// transform to number
|
// transform to number
|
||||||
block.gasLimit = Number(block.gasLimit);
|
block.gasLimit = utils.toDecimal(block.gasLimit);
|
||||||
block.gasUsed = Number(block.gasUsed);
|
block.gasUsed = utils.toDecimal(block.gasUsed);
|
||||||
block.size = Number(block.size);
|
block.size = utils.toDecimal(block.size);
|
||||||
block.timestamp = Number(block.timestamp);
|
block.timestamp = utils.toDecimal(block.timestamp);
|
||||||
block.number = Number(block.number);
|
block.number = utils.toDecimal(block.number);
|
||||||
|
|
||||||
block.minGasPrice = utils.toBigNumber(block.minGasPrice);
|
block.minGasPrice = utils.toBigNumber(block.minGasPrice);
|
||||||
block.difficulty = utils.toBigNumber(block.difficulty);
|
block.difficulty = utils.toBigNumber(block.difficulty);
|
||||||
block.totalDifficulty = utils.toBigNumber(block.totalDifficulty);
|
block.totalDifficulty = utils.toBigNumber(block.totalDifficulty);
|
||||||
@ -1757,6 +1749,11 @@ var toEth = function (str) {
|
|||||||
|
|
||||||
|
|
||||||
var toDecimal = function (val) {
|
var toDecimal = function (val) {
|
||||||
|
|
||||||
|
// pass it through is its already a number
|
||||||
|
if(typeof val === 'number' || (typeof val === 'string' && val.indexOf('0x') === -1))
|
||||||
|
return val;
|
||||||
|
|
||||||
// remove 0x and place 0, if it's required
|
// remove 0x and place 0, if it's required
|
||||||
val = val.length > 2 ? val.substring(2) : "0";
|
val = val.length > 2 ? val.substring(2) : "0";
|
||||||
return (new BigNumber(val, 16).toString(10));
|
return (new BigNumber(val, 16).toString(10));
|
||||||
@ -2003,10 +2000,6 @@ module.exports = {
|
|||||||
* @date 2014
|
* @date 2014
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// if (process.env.NODE_ENV !== 'build') {
|
|
||||||
// var BigNumber = require('bignumber.js');
|
|
||||||
// }
|
|
||||||
|
|
||||||
var eth = require('./eth');
|
var eth = require('./eth');
|
||||||
var db = require('./db');
|
var db = require('./db');
|
||||||
var shh = require('./shh');
|
var shh = require('./shh');
|
||||||
|
8
dist/ethereum.js.map
vendored
8
dist/ethereum.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/ethereum.min.js
vendored
2
dist/ethereum.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user