mirror of
https://github.com/status-im/web3.js.git
synced 2025-02-23 11:38:12 +00:00
add currentProvidor and mist fixes
This commit is contained in:
parent
4228b02cd0
commit
3e49f56971
12
dist/web3-light.js
vendored
12
dist/web3-light.js
vendored
@ -1434,6 +1434,7 @@ var setupProperties = function (obj, properties) {
|
||||
/// setups web3 object, and it's in-browser executed methods
|
||||
var web3 = {};
|
||||
web3.providers = {};
|
||||
web3.currentProvider = null;
|
||||
web3.version = {};
|
||||
web3.version.api = version.version;
|
||||
web3.eth = {};
|
||||
@ -1459,6 +1460,7 @@ web3.shh.filter = function (fil) {
|
||||
web3.net = {};
|
||||
web3.db = {};
|
||||
web3.setProvider = function (provider) {
|
||||
this.currentProvider = provider;
|
||||
RequestManager.getInstance().setProvider(provider);
|
||||
};
|
||||
web3.reset = function () {
|
||||
@ -3033,7 +3035,8 @@ module.exports = SolidityFunction;
|
||||
|
||||
"use strict";
|
||||
|
||||
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; // jshint ignore:line
|
||||
// resolves the problem for electron/atom shell environments, which use node integration, but have no process variable available
|
||||
var XMLHttpRequest = (typeof window !== 'undefined' && window.XMLHttpRequest) ? window.XMLHttpRequest : require('xmlhttprequest').XMLHttpRequest; // jshint ignore:line
|
||||
var errors = require('./errors');
|
||||
|
||||
var HttpProvider = function (host) {
|
||||
@ -4505,11 +4508,14 @@ module.exports = {
|
||||
var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
|
||||
thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);
|
||||
}
|
||||
} else {
|
||||
} else if (thatWords.length > 0xffff) {
|
||||
// Copy one word at a time
|
||||
for (var i = 0; i < thatSigBytes; i += 4) {
|
||||
thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
|
||||
}
|
||||
} else {
|
||||
// Copy all words at once
|
||||
thisWords.push.apply(thisWords, thatWords);
|
||||
}
|
||||
this.sigBytes += thatSigBytes;
|
||||
|
||||
@ -5672,4 +5678,6 @@ module.exports = web3;
|
||||
|
||||
|
||||
},{"./lib/web3":9,"./lib/web3/contract":11,"./lib/web3/httpprovider":19,"./lib/web3/namereg":23,"./lib/web3/qtsync":26,"./lib/web3/transfer":29}]},{},["web3"])
|
||||
|
||||
|
||||
//# sourceMappingURL=web3-light.js.map
|
4
dist/web3-light.min.js
vendored
4
dist/web3-light.min.js
vendored
File diff suppressed because one or more lines are too long
12
dist/web3.js
vendored
12
dist/web3.js
vendored
@ -1434,6 +1434,7 @@ var setupProperties = function (obj, properties) {
|
||||
/// setups web3 object, and it's in-browser executed methods
|
||||
var web3 = {};
|
||||
web3.providers = {};
|
||||
web3.currentProvider = null;
|
||||
web3.version = {};
|
||||
web3.version.api = version.version;
|
||||
web3.eth = {};
|
||||
@ -1459,6 +1460,7 @@ web3.shh.filter = function (fil) {
|
||||
web3.net = {};
|
||||
web3.db = {};
|
||||
web3.setProvider = function (provider) {
|
||||
this.currentProvider = provider;
|
||||
RequestManager.getInstance().setProvider(provider);
|
||||
};
|
||||
web3.reset = function () {
|
||||
@ -3033,7 +3035,8 @@ module.exports = SolidityFunction;
|
||||
|
||||
"use strict";
|
||||
|
||||
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; // jshint ignore:line
|
||||
// resolves the problem for electron/atom shell environments, which use node integration, but have no process variable available
|
||||
var XMLHttpRequest = (typeof window !== 'undefined' && window.XMLHttpRequest) ? window.XMLHttpRequest : require('xmlhttprequest').XMLHttpRequest; // jshint ignore:line
|
||||
var errors = require('./errors');
|
||||
|
||||
var HttpProvider = function (host) {
|
||||
@ -4505,11 +4508,14 @@ module.exports = {
|
||||
var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
|
||||
thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);
|
||||
}
|
||||
} else {
|
||||
} else if (thatWords.length > 0xffff) {
|
||||
// Copy one word at a time
|
||||
for (var i = 0; i < thatSigBytes; i += 4) {
|
||||
thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
|
||||
}
|
||||
} else {
|
||||
// Copy all words at once
|
||||
thisWords.push.apply(thisWords, thatWords);
|
||||
}
|
||||
this.sigBytes += thatSigBytes;
|
||||
|
||||
@ -8351,4 +8357,6 @@ module.exports = web3;
|
||||
|
||||
|
||||
},{"./lib/web3":9,"./lib/web3/contract":11,"./lib/web3/httpprovider":19,"./lib/web3/namereg":23,"./lib/web3/qtsync":26,"./lib/web3/transfer":29}]},{},["web3"])
|
||||
|
||||
|
||||
//# sourceMappingURL=web3.js.map
|
8
dist/web3.js.map
vendored
8
dist/web3.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/web3.min.js
vendored
4
dist/web3.min.js
vendored
File diff suppressed because one or more lines are too long
@ -80,6 +80,7 @@ var setupProperties = function (obj, properties) {
|
||||
/// setups web3 object, and it's in-browser executed methods
|
||||
var web3 = {};
|
||||
web3.providers = {};
|
||||
web3.currentProvider = null;
|
||||
web3.version = {};
|
||||
web3.version.api = version.version;
|
||||
web3.eth = {};
|
||||
@ -105,6 +106,7 @@ web3.shh.filter = function (fil) {
|
||||
web3.net = {};
|
||||
web3.db = {};
|
||||
web3.setProvider = function (provider) {
|
||||
this.currentProvider = provider;
|
||||
RequestManager.getInstance().setProvider(provider);
|
||||
};
|
||||
web3.reset = function () {
|
||||
|
@ -24,7 +24,8 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; // jshint ignore:line
|
||||
// resolves the problem for electron/atom shell environments, which use node integration, but have no process variable available
|
||||
var XMLHttpRequest = (typeof window !== 'undefined' && window.XMLHttpRequest) ? window.XMLHttpRequest : require('xmlhttprequest').XMLHttpRequest; // jshint ignore:line
|
||||
var errors = require('./errors');
|
||||
|
||||
var HttpProvider = function (host) {
|
||||
|
@ -1,8 +1,28 @@
|
||||
/* jshint ignore:start */
|
||||
|
||||
if(typeof web3 === 'undefined') {
|
||||
web3 = require('web3');
|
||||
BigNumber = require('bignumber.js');
|
||||
|
||||
// Browser environment
|
||||
if(typeof window !== 'undefined') {
|
||||
|
||||
if(typeof window.web3 === 'undefined') {
|
||||
web3 = require('web3');
|
||||
BigNumber = require('bignumber.js');
|
||||
} else {
|
||||
web3 = window.web3;
|
||||
BigNumber = window.BigNumber
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Node environment
|
||||
if(typeof global !== 'undefined') {
|
||||
if(typeof global.web3 === 'undefined') {
|
||||
web3 = require('web3');
|
||||
BigNumber = require('bignumber.js');
|
||||
} else {
|
||||
web3 = global.web3;
|
||||
BigNumber = global.BigNumber
|
||||
}
|
||||
}
|
||||
|
||||
/* jshint ignore:end */
|
Loading…
x
Reference in New Issue
Block a user