0

I'm making a Dapp with web3swift by matter inc. One method I come across is one of the web3.Personal extension:

public func signPersonalMessage(message: Data, from: 
    web3swift.EthereumAddress, password: String = default) -> 
    Result.Result<Data, web3swift.Web3Error>

I was trying like this:

let web3 = Web3.InfuraMainnetWeb3()
let res = web3.personal.signPersonalMessage(message: msgHash!, 
    from: self.keystore.getAddress()!, password: password)

but what I got was always a Web3ConnectionError. There must not be in the right way I guess. So, any tip to get a usable instance of web3.Personal, and to call the signPersonalMessage method? Thanks :)

By the way, Web3.Utils.signPersonalMessage method is not what I am looking for.

skywinder
  • 21,291
  • 15
  • 93
  • 123

1 Answers1

1

Please do check that you have a keystore attached to the web3 object. If there is no local keystore than the message is sent to the remote node for signing, but Infura nodes do not contain any private keys.

If a problem persists please open an issue on gitHub repo.

P.S. I'm the author of web3swift, so keeping all issues on github allows me to respond better

skywinder
  • 21,291
  • 15
  • 93
  • 123
Alexander
  • 11
  • 2