Closed AyushBherwani1998 closed 3 years ago
Update, changing prefix to "\u{19}Ethereum Signed Message:\n\(data.count)".data(using: .utf8)!
works perfectly.
For eth_send_transaction, I'm following this steps
let data = try! JSONSerialization.data(withJSONObject: result, options: JSONSerialization.WritingOptions.prettyPrinted)
var signedData = self.privateKey.sign(digest: Hash.keccak256(data: data), curve: .secp256k1)!
signedData[64] += 27
interactor.approveRequest(id: id, result: "0x" + signedData.hexString).done{}.cauterize()
where result is WCEthereumTransaction
Can you create a pull request for the data.count
typo? eth_sendTransaction
requires wallet to send and return the transaction hash
Thanks for the help :)
I'll send a PR
@hewigovens can you help me with .signTypeData
. I see the trust core had the EIP721TypedData but it's not longer supported. I checked wallet core but was not able to find there. Can you point me to the right direction? Thanks
Got it, EthereumAbiValueEncoder.
Hey, I was trying to integrate the pod. I have followed the same steps taking a look at the sample. The PrivateKey.sign seems to generate invalid signature every time. I tried for eth_personal_sign and also for eth_send_transaction.
For eth_personal_sign, it says valid = false after approving the request, and for eth_send_transaction, it generates a invalid transaction hash. For eth_send_transaction, I did verify the values for transaction, and they were correct, still it was generating an invalid hash.
Snippet for eth_personal_sign
At first I thought there might be some issue with private key, but I tried to get the wallet address, and it was accurate. Thanks for help :)