Socket
Socket
Sign inDemoInstall

web3-core-method

Package Overview
Dependencies
Maintainers
1
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web3-core-method - npm Package Compare versions

Comparing version 1.0.0-beta.12 to 1.0.0-beta.13

10

package.json
{
"name": "web3-core-method",
"version": "1.0.0-beta.12",
"version": "1.0.0-beta.13",
"description": "Creates the methods on the web3 modules. This is an internal package.",

@@ -10,7 +10,7 @@ "repository": "https://github.com/ethereum/web3.js/tree/master/packages/web3-core-method",

"underscore": "1.8.3",
"web3-core-helpers": "^1.0.0-beta.12",
"web3-core-promievent": "^1.0.0-beta.12",
"web3-core-subscriptions": "^1.0.0-beta.12",
"web3-utils": "^1.0.0-beta.12"
"web3-core-helpers": "^1.0.0-beta.13",
"web3-core-promievent": "^1.0.0-beta.13",
"web3-core-subscriptions": "^1.0.0-beta.13",
"web3-utils": "^1.0.0-beta.13"
}
}

@@ -230,3 +230,3 @@ /*

// fire "receipt" and confirmation events and resolve after
var checkConfirmation = function (err, block, sub) {
var checkConfirmation = function (err, blockHeader, sub, existingReceipt) {
if (!err) {

@@ -241,4 +241,4 @@ // create fake unsubscribe

}
method._ethereumCall.getTransactionReceipt(result)
// if we have a valid receipt we don't need to send a request
(existingReceipt ? promiEvent.resolve(existingReceipt) : method._ethereumCall.getTransactionReceipt(result))
// catch error from requesting receipt

@@ -376,8 +376,30 @@ .catch(function (err) {

// if provider allows PUB/SUB
if (_.isFunction(this.requestManager.provider.on)) {
method._ethereumCall.subscribe('newBlockHeaders', checkConfirmation);
} else {
intervalId = setInterval(checkConfirmation, 1000);
}
// start watching for confirmation depending on the support features of the provider
var startWatching = function() {
// if provider allows PUB/SUB
if (_.isFunction(this.requestManager.provider.on)) {
method._ethereumCall.subscribe('newBlockHeaders', checkConfirmation);
} else {
intervalId = setInterval(checkConfirmation, 1000);
}
}.bind(this);
// first check if we already have a confirmed transaction
method._ethereumCall.getTransactionReceipt(result)
.then(function(receipt) {
if (receipt && receipt.blockNumber) {
checkConfirmation(null, null, null, receipt);
if (defer.eventEmitter.listeners('confirmation').length > 0) {
setTimeout(function(){
// if the promised has not been resolved we must keep on watching for new Blocks
if (!promiseResolved) startWatching();
} ,1000);
}
}
else {
startWatching();
}
})
.catch(startWatching);
};

@@ -442,3 +464,2 @@

} else {
defer.eventEmitter.emit('transactionHash', result);

@@ -445,0 +466,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc