2017-10-26 18:06:34 +02:00
|
|
|
const ethUtil = require('ethereumjs-util')
|
|
|
|
const { conversionUtil, multiplyCurrencies } = require('../../conversion-util')
|
2017-10-18 21:23:35 +02:00
|
|
|
|
2017-10-26 18:06:34 +02:00
|
|
|
const MIN_GAS_PRICE_HEX = (100000000).toString(16)
|
|
|
|
const MIN_GAS_PRICE_DEC = '100000000'
|
2017-11-17 22:23:25 +01:00
|
|
|
const MIN_GAS_LIMIT_DEC = '21000'
|
|
|
|
const MIN_GAS_LIMIT_HEX = (parseInt(MIN_GAS_LIMIT_DEC)).toString(16)
|
2017-10-26 18:06:34 +02:00
|
|
|
|
|
|
|
const MIN_GAS_PRICE_GWEI = ethUtil.addHexPrefix(conversionUtil(MIN_GAS_PRICE_HEX, {
|
|
|
|
fromDenomination: 'WEI',
|
|
|
|
toDenomination: 'GWEI',
|
|
|
|
fromNumericBase: 'hex',
|
|
|
|
toNumericBase: 'hex',
|
2017-10-30 22:46:56 +01:00
|
|
|
numberOfDecimals: 1,
|
2017-10-26 18:06:34 +02:00
|
|
|
}))
|
|
|
|
|
2017-10-22 22:14:03 +02:00
|
|
|
const MIN_GAS_TOTAL = multiplyCurrencies(MIN_GAS_LIMIT_HEX, MIN_GAS_PRICE_HEX, {
|
2017-10-18 21:23:35 +02:00
|
|
|
toNumericBase: 'hex',
|
|
|
|
multiplicandBase: 16,
|
|
|
|
multiplierBase: 16,
|
|
|
|
})
|
|
|
|
|
2017-12-20 23:36:58 +01:00
|
|
|
const TOKEN_TRANSFER_FUNCTION_SIGNATURE = '0xa9059cbb'
|
|
|
|
|
2017-10-18 21:23:35 +02:00
|
|
|
module.exports = {
|
|
|
|
MIN_GAS_PRICE_GWEI,
|
2017-10-22 22:14:03 +02:00
|
|
|
MIN_GAS_PRICE_HEX,
|
|
|
|
MIN_GAS_PRICE_DEC,
|
|
|
|
MIN_GAS_LIMIT_HEX,
|
|
|
|
MIN_GAS_LIMIT_DEC,
|
2017-10-18 21:23:35 +02:00
|
|
|
MIN_GAS_TOTAL,
|
2017-12-20 23:36:58 +01:00
|
|
|
TOKEN_TRANSFER_FUNCTION_SIGNATURE,
|
2017-10-18 21:23:35 +02:00
|
|
|
}
|