Giter Club home page Giter Club logo

Comments (1)

ricmoo avatar ricmoo commented on September 1, 2024

The gas price currently comes from the Ethereum network, but yes I should add the ability to override it for those wish to have finer grained control. Give me a day to think about the best way to support this in a more general way.

I think I will add a optional function to signers for getGasPrice(tx).

I would also like to add a feature where the gasPrice can be set to specific constants, in which case it will use the ethers gas oracle; for example "low" would use the current safe low value for the network. I still need to think more about this though, since it will greatly increase the traffic to my public API.

If you need something ASAP, for now, you can just create a custom signer, which will allow you to override this.

var ethers = require('ethers');
var meow = require('ethers-meow');

function CustomSigner(privateKey) {
    this.provider = ethers.providers.getDefaultProvider();

    var wallet = new ethers.Wallet(privateKey, this.provider);

    this.address = wallet.address;

    this.sendTransaction = function(tx) {
        tx.gasPrice = 25000000000;
        console.log(tx);
        return wallet.sendTransaction(tx);
    }
}

var customSigner = new CustomSigner('0x0123456789012345678901234567890123456789012345678901234567890123');

var manager = new meow.Manager(customSigner);

manager.giveBirth(1000);

from ethers-meow.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.