signMessage
Sign a message
This function signs arbitrary data using a specific account.
1
signer.signMessage({
2
walletId: '71dec640-4eb8-4321-adb8-b79461573fc4',
3
secretType: 'ETHEREUM',
4
data : "I agree with terms and conditions"
5
})
Copied!

Signature

1
signer.signMessage(messageSignRequestDto, options?): Promise<SignerResult>
Copied!

Returns

1
Promise<SignerResult>
Copied!
1
{
2
"type" : "HEX_SIGNATURE",
3
"r" : "0xb91467e570a6466aa9e9876cbcd013baba02900b8979d43fe208a4a4f339f5fd",
4
"s" : "0x6007e74cd82e037b800186422fc2da167c747ef045e5d18a5f5d4300f8e1a029",
5
"v" : "0x1c",
6
"signature" : "0xb91467e570a6466aa9e9876cbcd013baba02900b8979d43fe208a4a4f339f5fd6007e74cd82e037b800186422fc2da167c747ef045e5d18a5f5d4300f8e1a0291c"
7
}
Copied!

Parameters

Parameter
Required
Description
True
Signature request you want to sign. For more info on how this request should look like, see messageSignRequestDto .
​options​
False
Redirect options you want to pass. Only available when using a REDIRECT signer​

Example

1
const signer = venlyConnect.createSigner();
2
​
3
signer.signMessage({
4
walletId: '71dec640-4eb8-4321-adb8-b79461573fc4',
5
secretType: 'ETHEREUM',
6
data : "I agree with terms and conditions"
7
}).then((signerResult) => {
8
if (signerResult.success) {
9
console.log(`Successfuly signed: ${signerResult.result.signature}`);
10
} else {
11
console.warn(`Something went wrong while signing the message`);
12
}
13
}).catch((reason) => {
14
console.log(error);
15
});
16
​
Copied!

Object Types

​