Comparing version 1.2.1 to 1.2.2
{ | ||
"name": "web3-eth", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Web3 module to interact with the Ethereum blockchain and smart contracts.", | ||
@@ -10,18 +10,26 @@ "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-eth", | ||
}, | ||
"types": "types/index.d.ts", | ||
"scripts": { | ||
"dtslint": "dtslint types --onlyTestTsNext" | ||
}, | ||
"main": "src/index.js", | ||
"dependencies": { | ||
"underscore": "1.9.1", | ||
"web3-core": "1.2.1", | ||
"web3-core-helpers": "1.2.1", | ||
"web3-core-method": "1.2.1", | ||
"web3-core-subscriptions": "1.2.1", | ||
"web3-eth-abi": "1.2.1", | ||
"web3-eth-accounts": "1.2.1", | ||
"web3-eth-contract": "1.2.1", | ||
"web3-eth-ens": "1.2.1", | ||
"web3-eth-iban": "1.2.1", | ||
"web3-eth-personal": "1.2.1", | ||
"web3-net": "1.2.1", | ||
"web3-utils": "1.2.1" | ||
"web3-core": "1.2.2", | ||
"web3-core-helpers": "1.2.2", | ||
"web3-core-method": "1.2.2", | ||
"web3-core-subscriptions": "1.2.2", | ||
"web3-eth-abi": "1.2.2", | ||
"web3-eth-accounts": "1.2.2", | ||
"web3-eth-contract": "1.2.2", | ||
"web3-eth-ens": "1.2.2", | ||
"web3-eth-iban": "1.2.2", | ||
"web3-eth-personal": "1.2.2", | ||
"web3-net": "1.2.2", | ||
"web3-utils": "1.2.2" | ||
}, | ||
"devDependencies": { | ||
"definitelytyped-header-parser": "^1.0.1", | ||
"dtslint": "0.4.2" | ||
} | ||
} |
@@ -27,3 +27,2 @@ # web3-eth | ||
## Usage | ||
@@ -38,6 +37,7 @@ | ||
## Types | ||
All the typescript typings are placed in the types folder. | ||
[docs]: http://web3js.readthedocs.io/en/1.0/ | ||
[repo]: https://github.com/ethereum/web3.js | ||
@@ -58,2 +58,6 @@ /* | ||
} | ||
if (genesis.hash === '0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a' && | ||
id === 5) { | ||
returnValue = 'goerli'; | ||
} | ||
if (genesis.hash === '0xa3c565fc15c7478862d50ccd6561e3c06b24cc509bf388941c25ea985ce32cb9' && | ||
@@ -60,0 +64,0 @@ id === 42) { |
118
src/index.js
@@ -84,3 +84,109 @@ /* | ||
var defaultBlock = 'latest'; | ||
var transactionBlockTimeout = 50; | ||
var transactionConfirmationBlocks = 24; | ||
var transactionPollingTimeout = 750; | ||
var defaultChain, defaultHardfork, defaultCommon; | ||
Object.defineProperty(this, 'defaultCommon', { | ||
get: function () { | ||
return defaultCommon; | ||
}, | ||
set: function (val) { | ||
defaultCommon = val; | ||
// also set on the Contract object | ||
_this.Contract.defaultCommon = defaultCommon; | ||
// update defaultBlock | ||
methods.forEach(function(method) { | ||
method.defaultCommon = defaultCommon; | ||
}); | ||
}, | ||
enumerable: true | ||
}); | ||
Object.defineProperty(this, 'defaultHardfork', { | ||
get: function () { | ||
return defaultHardfork; | ||
}, | ||
set: function (val) { | ||
defaultHardfork = val; | ||
// also set on the Contract object | ||
_this.Contract.defaultHardfork = defaultHardfork; | ||
// update defaultBlock | ||
methods.forEach(function(method) { | ||
method.defaultHardfork = defaultHardfork; | ||
}); | ||
}, | ||
enumerable: true | ||
}); | ||
Object.defineProperty(this, 'defaultChain', { | ||
get: function () { | ||
return defaultChain; | ||
}, | ||
set: function (val) { | ||
defaultChain = val; | ||
// also set on the Contract object | ||
_this.Contract.defaultChain = defaultChain; | ||
// update defaultBlock | ||
methods.forEach(function(method) { | ||
method.defaultChain = defaultChain; | ||
}); | ||
}, | ||
enumerable: true | ||
}); | ||
Object.defineProperty(this, 'transactionPollingTimeout', { | ||
get: function () { | ||
return transactionPollingTimeout; | ||
}, | ||
set: function (val) { | ||
transactionPollingTimeout = val; | ||
// also set on the Contract object | ||
_this.Contract.transactionPollingTimeout = transactionPollingTimeout; | ||
// update defaultBlock | ||
methods.forEach(function(method) { | ||
method.transactionPollingTimeout = transactionPollingTimeout; | ||
}); | ||
}, | ||
enumerable: true | ||
}); | ||
Object.defineProperty(this, 'transactionConfirmationBlocks', { | ||
get: function () { | ||
return transactionConfirmationBlocks; | ||
}, | ||
set: function (val) { | ||
transactionConfirmationBlocks = val; | ||
// also set on the Contract object | ||
_this.Contract.transactionConfirmationBlocks = transactionConfirmationBlocks; | ||
// update defaultBlock | ||
methods.forEach(function(method) { | ||
method.transactionConfirmationBlocks = transactionConfirmationBlocks; | ||
}); | ||
}, | ||
enumerable: true | ||
}); | ||
Object.defineProperty(this, 'transactionBlockTimeout', { | ||
get: function () { | ||
return transactionBlockTimeout; | ||
}, | ||
set: function (val) { | ||
transactionBlockTimeout = val; | ||
// also set on the Contract object | ||
_this.Contract.transactionBlockTimeout = transactionBlockTimeout; | ||
// update defaultBlock | ||
methods.forEach(function(method) { | ||
method.transactionBlockTimeout = transactionBlockTimeout; | ||
}); | ||
}, | ||
enumerable: true | ||
}); | ||
Object.defineProperty(this, 'defaultAccount', { | ||
@@ -177,2 +283,5 @@ get: function () { | ||
this.Contract.defaultBlock = this.defaultBlock; | ||
this.Contract.transactionBlockTimeout = this.transactionBlockTimeout; | ||
this.Contract.transactionConfirmationBlocks = this.transactionConfirmationBlocks; | ||
this.Contract.transactionPollingTimeout = this.transactionPollingTimeout; | ||
this.Contract.setProvider(this.currentProvider, this.accounts); | ||
@@ -373,2 +482,8 @@ | ||
}), | ||
new Method({ | ||
name: 'getChainId', | ||
call: 'eth_chainId', | ||
params: 0, | ||
outputFormatter: utils.hexToNumber | ||
}), | ||
@@ -461,2 +576,5 @@ // subscriptions | ||
method.defaultAccount = _this.defaultAccount; | ||
method.transactionBlockTimeout = _this.transactionBlockTimeout; | ||
method.transactionConfirmationBlocks = _this.transactionConfirmationBlocks; | ||
method.transactionPollingTimeout = _this.transactionPollingTimeout; | ||
}); | ||
@@ -463,0 +581,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55827
8
1555
2
1
+ Added@noble/hashes@1.5.0(transitive)
+ Added@types/bn.js@4.11.6(transitive)
+ Added@types/node@12.20.55(transitive)
+ Added@types/pbkdf2@3.1.2(transitive)
+ Added@types/secp256k1@4.0.6(transitive)
+ Addedbase-x@3.0.10(transitive)
+ Addedblakejs@1.2.1(transitive)
+ Addedbs58@4.0.1(transitive)
+ Addedbs58check@2.1.2(transitive)
+ Addedethereum-bloom-filters@1.2.0(transitive)
+ Addedethereum-cryptography@0.1.3(transitive)
+ Addedethereumjs-common@1.5.2(transitive)
+ Addedethereumjs-tx@2.1.2(transitive)
+ Addedethereumjs-util@6.2.1(transitive)
+ Addedethjs-util@0.1.6(transitive)
+ Addedhash.js@1.1.7(transitive)
+ Addedkeccak@3.0.4(transitive)
+ Addednode-addon-api@2.0.2(transitive)
+ Addednode-gyp-build@4.8.2(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedrlp@2.2.7(transitive)
+ Addedscrypt-js@3.0.1(transitive)
+ Addedsecp256k1@4.0.3(transitive)
+ Addedsetimmediate@1.0.5(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedweb3-core@1.2.2(transitive)
+ Addedweb3-core-helpers@1.2.2(transitive)
+ Addedweb3-core-method@1.2.2(transitive)
+ Addedweb3-core-promievent@1.2.2(transitive)
+ Addedweb3-core-requestmanager@1.2.2(transitive)
+ Addedweb3-core-subscriptions@1.2.2(transitive)
+ Addedweb3-eth-abi@1.2.2(transitive)
+ Addedweb3-eth-accounts@1.2.2(transitive)
+ Addedweb3-eth-contract@1.2.2(transitive)
+ Addedweb3-eth-ens@1.2.2(transitive)
+ Addedweb3-eth-iban@1.2.2(transitive)
+ Addedweb3-eth-personal@1.2.2(transitive)
+ Addedweb3-net@1.2.2(transitive)
+ Addedweb3-providers-http@1.2.2(transitive)
+ Addedweb3-providers-ipc@1.2.2(transitive)
+ Addedweb3-providers-ws@1.2.2(transitive)
+ Addedweb3-utils@1.2.2(transitive)
- Removedrandomhex@0.1.5(transitive)
- Removedscryptsy@2.1.0(transitive)
- Removedsemver@6.2.0(transitive)
- Removedweb3-core@1.2.1(transitive)
- Removedweb3-core-helpers@1.2.1(transitive)
- Removedweb3-core-method@1.2.1(transitive)
- Removedweb3-core-promievent@1.2.1(transitive)
- Removedweb3-core-requestmanager@1.2.1(transitive)
- Removedweb3-core-subscriptions@1.2.1(transitive)
- Removedweb3-eth-abi@1.2.1(transitive)
- Removedweb3-eth-accounts@1.2.1(transitive)
- Removedweb3-eth-contract@1.2.1(transitive)
- Removedweb3-eth-ens@1.2.1(transitive)
- Removedweb3-eth-iban@1.2.1(transitive)
- Removedweb3-eth-personal@1.2.1(transitive)
- Removedweb3-net@1.2.1(transitive)
- Removedweb3-providers-http@1.2.1(transitive)
- Removedweb3-providers-ipc@1.2.1(transitive)
- Removedweb3-providers-ws@1.2.1(transitive)
- Removedweb3-utils@1.2.1(transitive)
Updatedweb3-core@1.2.2
Updatedweb3-core-helpers@1.2.2
Updatedweb3-core-method@1.2.2
Updatedweb3-eth-abi@1.2.2
Updatedweb3-eth-accounts@1.2.2
Updatedweb3-eth-contract@1.2.2
Updatedweb3-eth-ens@1.2.2
Updatedweb3-eth-iban@1.2.2
Updatedweb3-eth-personal@1.2.2
Updatedweb3-net@1.2.2
Updatedweb3-utils@1.2.2