Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var web3 = require('web3');
console.log(web3.version);
var web3 = require('web3');
console.log(web3.version.api);
var web3 = require('web3');
console.log(web3.version.api);
var web3 = require('web3');
console.log(web3.version.api);
version ({ web3 }) {
return web3.version || Web3.version || version;
},
isBeta ({ web3 }) {
static _getWeb3(web3) {
if (web3 instanceof Web3) {
return web3;
}
if (typeof web3 === 'string') {
return new Web3(web3);
}
throw 'Invalid web3. Please provide an instanceof Web3(version: ' + Web3.version + ' )';
}
}
isBeta ({ web3 }) {
const web3Version = web3.version || Web3.version || version;
return web3Version.indexOf('beta') >= 0;
},
};
const last = unversionable.pop();
const count = unversionable.length;
unversionable = unversionable.join(', ') + `${count > 1 ? ',' : ''} and ${last}`;
} else {
unversionable = unversionable[0];
}
this.embark.logger.warn(`package${plural ? 's' : ''} ${unversionable} ${plural ? 'are' : 'is'} not versionable, please remove ${plural ? 'them' : 'it'} from this project's embark.json`);
}
this.versions = {};
let solcVersionInConfig = this.contractsConfig.versions["solc"];
this.versions['solc'] = solcVersionInConfig;
this.versions.web3 = web3.version;
Object.keys(this.versions).forEach(versionKey => {
if (!this.isVersionable(versionKey)) return;
const newVersion = this.versions[versionKey].trim();
if (newVersion !== this.versions[versionKey]) {
this.embark.logger.warn(__('There is a space in the version of {{versionKey}}. We corrected it for you ({{correction}}).', {versionKey: versionKey, correction: `"${this.versions[versionKey]}" => "${newVersion}"`}));
this.versions[versionKey] = newVersion;
}
});
}
function ENS (provider, address, Web3js) {
if (Web3js !== undefined) {
Web3 = Web3js;
}
if (!!/^0\./.exec(Web3.version || (new Web3(provider)).version.api)) {
return utils.construct(ENS_0, [provider, address]);
} else {
return utils.construct(ENS_1, [provider, address]);
}
}