How to use the web3-core-method.PromiEvent 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 / packages / web3-eth-contract / src / proxies / MethodsProxy.js View on Github external
executeMethod(abiItemModel, methodArguments, requestType) {
        let method;

        try {
            method = this.createMethod(abiItemModel, methodArguments, requestType);
        } catch (error) {
            const promiEvent = new PromiEvent();

            method = this.methodFactory.createMethodByRequestType(abiItemModel, this.contract, requestType);
            method.setArguments(methodArguments);

            if (isFunction(method.callback)) {
                method.callback(error, null);
            }

            promiEvent.reject(error);
            promiEvent.emit('error', error);

            return promiEvent;
        }

        return method.execute();
    }
github ethereum / web3.js / modules / ethereum / src / contract / proxies / MethodsProxy.js View on Github external
executeMethod(abiItemModel, methodArguments, requestType) {
        let method;

        try {
            method = this.createMethod(abiItemModel, methodArguments, requestType);
        } catch (error) {
            const promiEvent = new PromiEvent();
            promiEvent.reject(error);
            promiEvent.emit('error', error);

            return promiEvent;
        }

        return method.execute();
    }