How to use the web3-core-method.MethodProxy function in web3-core-method

To help you get started, we’ve selected a few web3-core-method 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 / lib / module / AbstractWeb3Module.js View on Github external
this._currentProvider = this.providerResolver.resolve(provider, nodeNet);
        this._defaultAccount = options.defaultAccount ? toChecksumAddress(options.defaultAccount) : undefined;
        this._defaultBlock = options.defaultBlock || 'latest';
        this._transactionBlockTimeout = options.transactionBlockTimeout || 50;
        this._transactionConfirmationBlocks = options.transactionConfirmationBlocks || 0;
        this._transactionPollingTimeout = options.transactionPollingTimeout || 750;
        this._defaultGasPrice = options.defaultGasPrice;
        this._defaultGas = options.defaultGas;

        this.BatchRequest = () => {
            return new BatchRequest(this);
        };

        // TODO: Remove the MethodProxy after refactoring of the BatchRequest object
        if (methodFactory) {
            return new MethodProxy(this, methodFactory);
        }
    }
github ethereum / web3.js / packages / web3-core / src / AbstractWeb3Module.js View on Github external
this.givenProvider = ProviderDetector.detect();
        this._currentProvider = this.providerResolver.resolve(provider, nodeNet);
        this._defaultAccount = options.defaultAccount ? toChecksumAddress(options.defaultAccount) : undefined;
        this._defaultBlock = options.defaultBlock || 'latest';
        this._transactionBlockTimeout = options.transactionBlockTimeout || 50;
        this._transactionConfirmationBlocks = options.transactionConfirmationBlocks || 0;
        this._transactionPollingTimeout = options.transactionPollingTimeout || 750;
        this._defaultGasPrice = options.defaultGasPrice;
        this._defaultGas = options.defaultGas;

        this.BatchRequest = () => {
            return new BatchRequest(this);
        };

        if (methodFactory) {
            return new MethodProxy(this, methodFactory);
        }
    }