Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    George Spasov
    @Perseverance
    Hope you like it
    Pedro Maia Coelho
    @pm-coelho
    Hi
    I posted this question earlier on ethereum stack exchange and, I'm taking a look right now at ethers
    but upon this first reading I don't think I can generate the mnemonic protected by the passphrase
    I already done this with the bitcore mnemonic lib (the project I'm working on generates both ethereum and bitcoin hdwallets from the same mnemonic)
    and though about implementing the passphrase "concatenation" myself
    but if both web3 and ethers doesn't have this option I think it might be for a reason
    George Spasov
    @Perseverance
    I feel you are right, you can use mnemonic from seed(option in ethers). You can use your password as seed
    But it will give you collisions
    Pedro Maia Coelho
    @pm-coelho
    the objective was to allow the user to come to a site like https://mytokenwallet.com/bip39.html
    and with the same mnemonic + passphrase get the addresses for both coins
    I think I wont use the mnemonic + passphrase approach to generate the wallets and will stick to mnemonic
    thank you for the answers
    George Spasov
    @Perseverance
    Thanks, keep us posted what happened and do not hesitate to ask or answer questions here :smile:
    dtmle
    @dtmle
    Hi there, I saw this on github today
    const ethers = require('ethers');
    const mnemonic = await ethers.HDNode.entropyToMnemonic(ethers.utils.randomBytes(16));
    const wallet = Wallet.fromMnemonic(mnemonic);
    Where does the Wallet object come from?
    Thank you guys
    I mean stackoverflow whoops
    George Spasov
    @Perseverance
    I will update it sorry about that. It is ethers.Wallet
    @dtmle
    Updated the answer
    dtmle
    @dtmle
    Thank you very much George!
    George Spasov
    @Perseverance
    No worries keep us posted on what you are doing and do not hesitate to ask us more questions :)
    dtmle
    @dtmle
    I'm trying to write a wrapper for web3 that is compatible with mnemonic, private key, json keystore, ledger, trezor, digital bitbox.
    const initialize = function(network) {
      return new Promise((resolve, reject) => {
        //Make sure network is supplied
        if (network === undefined) {
          return reject(new Error("No network provided. Will not initialize."));
        }
        //Lazy load
        if (!web3) {
          //Check if injection is wanted
          if (network === "injection") {
            //Check if injection exists
            useInjection()
              .then(result => {
                return resolve(result);
              })
              //catch if injection does not exist
              .catch(err => {
                return reject(err);
              });
          } else {
            //Otherwise, initialize with network provided
            web3 = new Web3(network);
            return resolve(web3);
          }
        } else {
          //web3 already initialized error
          return reject(
            new Error(
              "Web3 already initialized. use setProvider() if trying to change providers."
            )
          );
        }
      });
    };
    George Spasov
    @Perseverance
    Have you checked ethers.js it has a lot of these things and the guy behind is quite the superstar IMO
    dtmle
    @dtmle
    I am definitely gonna look at it, it seems like itd be easier than using a bunch of different node packages
    Currently, my support for private key uses web3.eth.accounts.wallet.add(privateKey), but I don't know how to tackle mnemonic and the others quite yet
    George Spasov
    @Perseverance
    Absolutely, we are writing deployer based on it as opposed to the truffle one with web3
    dtmle
    @dtmle
    Thank you for the suggestion, this seems like the solution!!!
    Also, how do others write the documentation sites like this?:https://docs.ethers.io/ethers.js/html/
    Do I need to host it myself?
    George Spasov
    @Perseverance
    Google “ReadTheDocs”
    dtmle
    @dtmle
    Thank you very much George for all your help
    George Spasov
    @Perseverance
    👍
    dtmle
    @dtmle
    Hi, I am trying to deploy a contract using an infura node. I always get the error Invalid JSON RPC Response ""
    George Spasov
    @Perseverance
    Have you tried etherlime?
    dtmle
    @dtmle
    I know infura does not store private keys, so I've added the account using web3.eth.accounts.wallet.add(privKey).
    I have not, I will look at that
    George Spasov
    @Perseverance
    let me help:
    Check this and tell me if it helps
    dtmle
    @dtmle
    Thank you, so instead of using deploy() from web3 I'll use this? I would like to keep the number of packages to a minimum but this looks like it does the job cleaner than web3
    George Spasov
    @Perseverance
    Most of the things do a cleaner job than web3 :D
    dtmle
    @dtmle
    web3 is a joke of a library, but it does its job haha. I hate web3
    ctrlventure
    @ctrlventure
    @Perseverance Hi, i just saw your comment reply on stackexchange so here i am to see if you can help me out with the "TypeError: Cannot read property 'actions' of undefined" i'm getting on deploy
    George Spasov
    @Perseverance
    Let’s take this in private