Sign Message
public enum EVMBaseSignType: String {
case sign // stand for eth_sign
case personalSign = "personal_sign"
case typedSignV3 = "typed_data_sign_v3"
case typedSignV4 = "typed_data_sign_v4"
case typedSign = "typed_data_sign" // same as the latest, it's same as default v4 for now.
}Sign message
Sign
BloctoSDK.shared.evm.signMessage(
blockchain: .ethereum,
from: "0x...", // user address
message: "0x50...3A", // must be hex string with 0x prefix
signType: .sign) { [weak self] result in
guard let self = self else { return }
switch result {
case let .success(signature):
// handle signature here.
case let .failure(error):
// handle error here.
}
}Personal sign
Typed sign v3
Typed sign v4
Last updated
Was this helpful?