How to use the web3-core-method.SendTransactionMethodModel.prototype 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 / models / ContractSendMethodModel.js View on Github external
this.funcName = '';
    this.signature = '';
    this.requestOptions = null;
    this.parameters = null;
    this.abiItem = abiItem;
}

ContractSendMethodModel.prototype.beforeExecution = function (web3Package) {
    // extend SendTransactionMethodModel beforeExecution (encoding and creation of tx object)
};

ContractSendMethodModel.prototype.afterExecution = function (web3Package) {
    // extend SendTransactionMethodModel afterExecution (decoding)
};

ContractSendMethodModel.prototype = Object.create(SendTransactionMethodModel.prototype);
ContractSendMethodModel.prototype.constructor = ContractSendMethodModel;
github ethereum / web3.js / packages / web3-eth-contract / src / models / SendMethodModel.js View on Github external
if (options.from) {
        from = this.utils.toChecksumAddress(formatters.inputAddressFormatter(options.from));
    }

    options.from = from || web3Package.contractOptions.from;
    options.gasPrice = gasPrice || web3Package.contractOptions.gasPrice;
    options.gas = options.gas || options.gasLimit || web3Package.contractOptions.gas;
    options.to = web3Package.contractOptions.address;

    // TODO replace with only gasLimit?
    delete options.gasLimit;

    return options;
};

SendMethodModel.prototype = Object.create(SendTransactionMethodModel.prototype);
SendMethodModel.prototype.constructor = SendMethodModel;

module.exports = SendMethodModel;
github ethereum / web3.js / packages / web3-eth-contract / src / models / SendMethodModel.js View on Github external
SendMethodModel.prototype.beforeExecution = function (web3Package) {
    this.parameters[0]['data'] = self.methodEncoder.encode(
        this.contractMethodParameters,
        this.abiItem,
        this.signature,
        web3Package.contractOptions.data
    );

    this.parameters[0] = this.getOrSetDefaultOptions(this.parameters[0], web3Package);

    SendTransactionMethodModel.prototype.beforeExecution.call(this, web3Package);
};