Verify the signature on a plaintext string
The plaintext string can be signed through the signMessageV2 interface, and then the signature can be verified through this interface.
Usage
// Call directly
TronWeb.Trx.verifyMessageV2(message, signature)
// Called via the instantiated tronWeb object
tronWeb.trx.verifyMessageV2(message, signature)
Parameters
Parameter | Description | Data Type |
---|---|---|
message | the signed string | String |
signature | Signature to be verified | String |
Returns
String - the signed address in base58 format
Example
var str = "helloworld";
var signature = await tronWeb.trx.signMessageV2(messge);
var base58Address = await tronWeb.trx.verifyMessageV2(messge, signature);