web3-core-helpers
Advanced tools
Comparing version 1.8.2 to 1.9.0-rc.0
@@ -70,2 +70,5 @@ /* | ||
error.reason = event.reason; | ||
if (event.description) { | ||
error.description = event.description; | ||
} | ||
} | ||
@@ -72,0 +75,0 @@ return error; |
@@ -200,9 +200,13 @@ /* | ||
*/ | ||
var outputTransactionFormatter = function (tx) { | ||
if (tx.blockNumber !== null) | ||
tx.blockNumber = utils.hexToNumber(tx.blockNumber); | ||
if (tx.transactionIndex !== null) | ||
tx.transactionIndex = utils.hexToNumber(tx.transactionIndex); | ||
tx.nonce = utils.hexToNumber(tx.nonce); | ||
tx.gas = utils.hexToNumber(tx.gas); | ||
var outputTransactionFormatter = function (tx, hexFormat) { | ||
if (!hexFormat) { | ||
if (tx.blockNumber !== null) | ||
tx.blockNumber = utils.hexToNumber(tx.blockNumber); | ||
if (tx.transactionIndex !== null) | ||
tx.transactionIndex = utils.hexToNumber(tx.transactionIndex); | ||
tx.nonce = utils.hexToNumber(tx.nonce); | ||
tx.gas = utils.hexToNumber(tx.gas); | ||
if (tx.type) | ||
tx.type = utils.hexToNumber(tx.type); | ||
} | ||
if (tx.gasPrice) | ||
@@ -214,4 +218,2 @@ tx.gasPrice = outputBigNumberFormatter(tx.gasPrice); | ||
tx.maxPriorityFeePerGas = outputBigNumberFormatter(tx.maxPriorityFeePerGas); | ||
if (tx.type) | ||
tx.type = utils.hexToNumber(tx.type); | ||
tx.value = outputBigNumberFormatter(tx.value); | ||
@@ -269,10 +271,12 @@ if (tx.to && utils.isAddress(tx.to)) { // tx.to could be `0x0` or `null` while contract creation | ||
*/ | ||
var outputBlockFormatter = function (block) { | ||
// transform to number | ||
block.gasLimit = utils.hexToNumber(block.gasLimit); | ||
block.gasUsed = utils.hexToNumber(block.gasUsed); | ||
block.size = utils.hexToNumber(block.size); | ||
block.timestamp = utils.hexToNumber(block.timestamp); | ||
if (block.number !== null) | ||
block.number = utils.hexToNumber(block.number); | ||
var outputBlockFormatter = function (block, hexFormat) { | ||
if (!hexFormat) { | ||
// transform to number | ||
block.gasLimit = utils.hexToNumber(block.gasLimit); | ||
block.gasUsed = utils.hexToNumber(block.gasUsed); | ||
block.size = utils.hexToNumber(block.size); | ||
block.timestamp = utils.hexToNumber(block.timestamp); | ||
if (block.number !== null) | ||
block.number = utils.hexToNumber(block.number); | ||
} | ||
if (block.difficulty) | ||
@@ -285,3 +289,3 @@ block.difficulty = outputBigNumberFormatter(block.difficulty); | ||
if (!(typeof item === 'string')) | ||
return outputTransactionFormatter(item); | ||
return outputTransactionFormatter(item, hexFormat); | ||
}); | ||
@@ -288,0 +292,0 @@ } |
{ | ||
"name": "web3-core-helpers", | ||
"version": "1.8.2", | ||
"version": "1.9.0-rc.0", | ||
"description": "Web3 core tools helper for sub packages. This is an internal package.", | ||
@@ -17,4 +17,4 @@ "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-core-helpers", | ||
"dependencies": { | ||
"web3-eth-iban": "1.8.2", | ||
"web3-utils": "1.8.2" | ||
"web3-eth-iban": "1.9.0-rc.0", | ||
"web3-utils": "1.9.0-rc.0" | ||
}, | ||
@@ -26,3 +26,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "5442ce929ce1e2d33fd16afb0dd239a3d1f369f8" | ||
"gitHead": "c564ebe63f9bc15e8f8f9e50f690be534534a917" | ||
} |
@@ -76,2 +76,5 @@ /* | ||
error.reason = event.reason; | ||
if(event.description) { | ||
error.description = event.description; | ||
} | ||
} | ||
@@ -78,0 +81,0 @@ |
@@ -238,9 +238,13 @@ /* | ||
*/ | ||
var outputTransactionFormatter = function (tx) { | ||
if (tx.blockNumber !== null) | ||
tx.blockNumber = utils.hexToNumber(tx.blockNumber); | ||
if (tx.transactionIndex !== null) | ||
tx.transactionIndex = utils.hexToNumber(tx.transactionIndex); | ||
tx.nonce = utils.hexToNumber(tx.nonce); | ||
tx.gas = utils.hexToNumber(tx.gas); | ||
var outputTransactionFormatter = function (tx, hexFormat) { | ||
if (!hexFormat) { | ||
if (tx.blockNumber !== null) | ||
tx.blockNumber = utils.hexToNumber(tx.blockNumber); | ||
if (tx.transactionIndex !== null) | ||
tx.transactionIndex = utils.hexToNumber(tx.transactionIndex); | ||
tx.nonce = utils.hexToNumber(tx.nonce); | ||
tx.gas = utils.hexToNumber(tx.gas); | ||
if (tx.type) | ||
tx.type = utils.hexToNumber(tx.type); | ||
} | ||
if (tx.gasPrice) | ||
@@ -252,4 +256,2 @@ tx.gasPrice = outputBigNumberFormatter(tx.gasPrice); | ||
tx.maxPriorityFeePerGas = outputBigNumberFormatter(tx.maxPriorityFeePerGas); | ||
if (tx.type) | ||
tx.type = utils.hexToNumber(tx.type); | ||
tx.value = outputBigNumberFormatter(tx.value); | ||
@@ -315,11 +317,13 @@ | ||
*/ | ||
var outputBlockFormatter = function (block) { | ||
var outputBlockFormatter = function (block, hexFormat) { | ||
// transform to number | ||
block.gasLimit = utils.hexToNumber(block.gasLimit); | ||
block.gasUsed = utils.hexToNumber(block.gasUsed); | ||
block.size = utils.hexToNumber(block.size); | ||
block.timestamp = utils.hexToNumber(block.timestamp); | ||
if (block.number !== null) | ||
block.number = utils.hexToNumber(block.number); | ||
if (!hexFormat) { | ||
// transform to number | ||
block.gasLimit = utils.hexToNumber(block.gasLimit); | ||
block.gasUsed = utils.hexToNumber(block.gasUsed); | ||
block.size = utils.hexToNumber(block.size); | ||
block.timestamp = utils.hexToNumber(block.timestamp); | ||
if (block.number !== null) | ||
block.number = utils.hexToNumber(block.number); | ||
} | ||
@@ -334,3 +338,3 @@ if (block.difficulty) | ||
if (!(typeof item === 'string')) | ||
return outputTransactionFormatter(item); | ||
return outputTransactionFormatter(item, hexFormat); | ||
}); | ||
@@ -337,0 +341,0 @@ } |
@@ -37,3 +37,3 @@ /* | ||
static outputBlockFormatter(block: any): any; // TODO: Create Block interface | ||
static outputBlockFormatter(block: any, hexFormat?: boolean): any; // TODO: Create Block interface | ||
@@ -40,0 +40,0 @@ static txInputFormatter(txObject: any): any; |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
60916
1557
1
+ Addedweb3-eth-iban@1.9.0-rc.0(transitive)
+ Addedweb3-utils@1.9.0-rc.0(transitive)
- Removedweb3-eth-iban@1.8.2(transitive)
- Removedweb3-utils@1.8.2(transitive)
Updatedweb3-eth-iban@1.9.0-rc.0
Updatedweb3-utils@1.9.0-rc.0