How to use the web3.version function in web3

To help you get started, we’ve selected a few web3 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ethereum / web3.js / test / node / app.js View on Github external
var web3 = require('web3');

console.log(web3.version);
github DurianStallSingapore / ZILMiner / test / node / app.js View on Github external
var web3 = require('web3');

console.log(web3.version.api);
github ethereum / aleth / node / app.js View on Github external
var web3 = require('web3');

console.log(web3.version.api);
github ethereum / solidity / node / app.js View on Github external
var web3 = require('web3');

console.log(web3.version.api);
github sc0Vu / vuethexplore / src / store / modules / blockchain.js View on Github external
version ({ web3 }) {
    return web3.version || Web3.version || version;
  },
  isBeta ({ web3 }) {
github OpenST / openst.js / lib / Contracts.js View on Github external
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 + ' )';
  }
}
github sc0Vu / vuethexplore / src / store / modules / blockchain.js View on Github external
isBeta ({ web3 }) {
    const web3Version = web3.version || Web3.version || version;

    return web3Version.indexOf('beta') >= 0;
  },
};
github embark-framework / embark / packages / stack / library-manager / src / index.js View on Github external
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;
      }
    });
  }
github ensdomains / ensjs / index.js View on Github external
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]);
  }
}