github.com/jonasnick/go-ethereum@v0.7.12-0.20150216215225-22176f05d387/cmd/mist/assets/ext/ethereum.js/lib/const.js (about) 1 /* 2 This file is part of ethereum.js. 3 4 ethereum.js is free software: you can redistribute it and/or modify 5 it under the terms of the GNU Lesser General Public License as published by 6 the Free Software Foundation, either version 3 of the License, or 7 (at your option) any later version. 8 9 ethereum.js is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU Lesser General Public License for more details. 13 14 You should have received a copy of the GNU Lesser General Public License 15 along with ethereum.js. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 /** @file const.js 18 * @authors: 19 * Marek Kotewicz <marek@ethdev.com> 20 * @date 2015 21 */ 22 23 /// required to define ETH_BIGNUMBER_ROUNDING_MODE 24 if (process.env.NODE_ENV !== 'build') { 25 var BigNumber = require('bignumber.js'); // jshint ignore:line 26 } 27 28 var ETH_UNITS = [ 29 'wei', 30 'Kwei', 31 'Mwei', 32 'Gwei', 33 'szabo', 34 'finney', 35 'ether', 36 'grand', 37 'Mether', 38 'Gether', 39 'Tether', 40 'Pether', 41 'Eether', 42 'Zether', 43 'Yether', 44 'Nether', 45 'Dether', 46 'Vether', 47 'Uether' 48 ]; 49 50 module.exports = { 51 ETH_PADDING: 32, 52 ETH_SIGNATURE_LENGTH: 4, 53 ETH_UNITS: ETH_UNITS, 54 ETH_BIGNUMBER_ROUNDING_MODE: { ROUNDING_MODE: BigNumber.ROUND_DOWN } 55 }; 56