How to use the @truffle/provider.create function in @truffle/provider

To help you get started, we’ve selected a few @truffle/provider 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 trufflesuite / truffle / packages / core / lib / networks.js View on Github external
matchesNetwork: async function(network_id, network_options, callback) {
    const provider = Provider.create(network_options);

    const first = network_id + "";
    const second = network_options.network_id + "";

    if (first === second) return callback(null, true);

    const isFirstANumber = isNaN(parseInt(network_id)) === false;
    const isSecondANumber =
      isNaN(parseInt(network_options.network_id)) === false;

    // If both network ids are numbers, then they don't match, and we should quit.
    if (isFirstANumber && isSecondANumber) return callback(null, false);

    const interfaceAdapter = new InterfaceAdapter();
    const web3 = new Web3Shim({
      provider,
github sc-forks / solidity-coverage / plugins / resources / truffle.utils.js View on Github external
function setOuterConfigKeys(config, api, id){
  try {
    config.network_id = id;
    config.port = api.port;
    config.host = api.host;
    config.provider = TruffleProvider.create(config);
  } catch (err){}
}
github trufflesuite / truffle / packages / config / configDefaults.js View on Github external
get() {
        if (!configObject.network) {
          return null;
        }

        const options = configObject.network_config;
        options.verboseRpc = configObject.verboseRpc;

        return Provider.create(options);
      },
      set() {
github microsoft / vscode-azure-blockchain-ethereum / src / debugAdapter / web3Wrapper.ts View on Github external
public getProvider() {
        if (!this._cachedProvider) {
            const web3Provider = this.eth.currentProvider;
            const truffleProviderOptions = {
                provider: () => {
                    return web3Provider;
                },
            };
            this._cachedProvider = truffleProvider.create(truffleProviderOptions);
        }

        return this._cachedProvider;
    }
github trufflesuite / truffle / packages / core / lib / networks.js View on Github external
(network_name, finished) => {
        const provider = Provider.create(options.networks[network_name]);
        BlockchainUtils.asURI(provider, (err, uri) => {
          if (err) {
            result.failed.push(network_name);
          } else {
            result.uris[network_name] = uri;
          }
          finished();
        });
      },
      error => {

@truffle/provider

Beefed up provider module for Truffle

MIT
Latest version published 1 year ago

Package Health Score

55 / 100
Full package analysis