How to sign
How do I get a signature from the private key and the transaction information? thank you
Probably this piece of code will help you
var assembleTX = try your_transaction.assemble()
try Web3Signer.EIP155Signer.sign(transaction: &assembleTX, privateKey: your_private_key)
I need you to provide an ethereum signature method through custom message and private key, hope to give an example, but your reply function does not exist, thank you!
------------------ 原始邮件 ------------------ 发件人: "skywinder/web3swift" @.>; 发送时间: 2022年6月10日(星期五) 凌晨0:44 @.>; @.@.>; 主题: Re: [skywinder/web3swift] How to sign (Issue #580)
Probably this piece of code will help you ` var assembleTX = try your_transaction.assemble() try Web3Signer.EIP155Signer.sign(transaction: &assembleTX, privateKey: your_private_key)
`
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
you need to provide more information. What have you tried (post code). Are you trying to get the signature of a transaction that is already on chain, or a transaction that you are newly creating?
The method posted earlier is based on an older version for the library, for signing a transaction.
@dengbangquan
There is Web3Signer with two static functions that should fit. The first one is for signing transactions and the second if for signing Data objects:
Web3Signer.signTX(transaction: &transaction, ...)
Web3Signer.signPersonalMessage(someDataObject, ...)
@dengbangquan有
Web3Signer,有两个静态功能,应该适合。第一个用于签署交易,第二个用于签署Data对象:Web3Signer.signTX(transaction: &transaction, ...) Web3Signer.signPersonalMessage(someDataObject, ...)![]()
In this signPersonalMessage method, I need to build attachedKeystoreManager, but I only have one address. There is no way to build attachedKeystoreManager. Is there any other way to sign?