This works fine:
const provider = new Web3.providers.HttpProvider('http://localhost:8545');
const web3 = new Web3(provider);
await web3.eth.sign(message, address);
But when I switch to this provider:
const provider = new HDWalletProvider(mnemonic, "https://rinkeby.infura.io/<key>", 0 )
I get this error:
TypeError: self.signMessage is not a function
Anyone know what might be the issue?
Thanks!
edit I guess it's not implemented. Anyone know an alternative way to sign something using Infura?
HDWalletProvider
you're using, it looks like they simply don't implement it: github.com/trufflesuite/truffle-hdwallet-provider/blob/master/…. – user19510 Aug 24 '18 at 17:49