Once your app is connected to Blocto wallet, it can send sign EVMBase message on behalf of the user, with the user's permission.
Currently we support these sign types:
publicenumEVMBaseSignType:String{case sign // stand for eth_signcase 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.}
When using sign type, please make sure input message is hex string with **0x**prefix.
We highly recommend you specify version when using typedSign. Because we can't make sure what version of Blocto Wallet app the user installed. When using **typedSign**we just use the latest version of typedSign, but the "latest" typedSign in user's current Blocto Wallet app might not match with the "latest" typedSign in BloctoSDK. In such case, it may lead to unexpected result.
Let's take Ethereum for example. Arbitrum, Optimism, BSC, Polygon and Avalanche use the same signMessage method as below.
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 inguardlet self = self else { return }switch result {caselet .success(signature):// handle signature here.caselet .failure(error):// handle error here. } }