Open

Description
HI,
having used web3.js on the web, I'm using these libraries in the hope of finding the same functions.
However, I'm having trouble finding the equivalent for this code:
const hash = Web3.utils.soliditySha3(...message)
const signature = Web3.eth.accounts.sign(hash, privateKey).
My message is an array of String and Int.
I've tried with this :
let web3Rinkeby = Web3.InfuraRinkebyWeb3()
// discarded this part since I already have an address
let keystore = try! EthereumKeystoreV3(password: "")
let keystoreManager = KeystoreManager([keystore!])
web3Rinkeby.addKeystoreManager(keystoreManager)
let address = keystoreManager.addresses![0]
//
let data = message.data(using: .utf8)
let ethAddress = EthereumAddress(from: address)!
let signMsg = web3Rinkeby.wallet.signPersonalMessage(data!, account: ethAddress, password: "");
But the signature I receive at the end is nil.
Do you have any idea how I can do it? Considering that I already have a valid address and the privateKey.
Metadata
Metadata
Assignees
Labels
No labels
Activity