Sign an EIP712 message
How to ask users to sign an EIP712 structured message.
Signing an EIP712 structured message is similar to signing a message.
The object that can ask the user his approval is called a Signer, once we've created a Signer object we can use the Signer to sign the EIP712 message.

Function

1
//Creating the signer
2
venlyConnect.createSigner();
3
​
4
//Asking the signer to sign a message.
5
signer.signEip712({
6
walletId: '<WALLET_ID>',
7
secretType: '<BLOCKCHAIN>',
8
data : <YOUR JSON STRUCTERED EIP712 DATA>
9
})
Copied!

Example

1
const signer = venlyConnect.createSigner();
2
​
3
signer.signEip712({
4
walletId: 'c8ec9954-fa1a-4682-9cf8-ef5c1015d1d1',
5
secretType: 'ETHEREUM',
6
data : {
7
"types": {
8
"EIP712Domain": [
9
{
10
"name": "name",
11
"type": "string"
12
},
13
{
14
"name": "version",
15
"type": "string"
16
},
17
{
18
"type": "address"
19
},
20
{
21
"name": "salt",
22
"type": "bytes32"
23
}
24
],
25
"MetaTransaction": [
26
{
27
"name": "nonce",
28
"type": "uint256"
29
},
30
{
31
"name": "from",
32
"type": "address"
33
},
34
{
35
"type": "bytes"
36
}
37
]
38
},
39
"name": "verifyingContract",
40
"name": "functionSignature",
41
"domain": {
42
"name": "Digimon",
43
"version": "1",
44
"verifyingContract": "0x0096100f27d5ed9a3455b54af3934df07b58b506",
45
"salt": "0x0000000000000000000000000000000000000000000000000000000000013881"
46
},
47
"primaryType": "MetaTransaction",
48
"message": {
49
"nonce": 0,
50
"from": "0xeB947ED047020F3C2982d35Ac2a8EbE8A7330282",
51
"functionSignature": "0xf242432a000000000000000000000000eb947ed047020f3c2982d35ac2a8ebe8a73302820000000000000000000000008fe26c6ff544bee01f41e6f87e6d0ead0ad274050000000000000000000000000000000000000000000000000000000000000065000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000"
52
}
53
}
54
​
55
})
Copied!

Returns

1
{
2
result: {
3
r: "0xc5e7a538a353c53e839ed0a2cf7b726806114b637ad1c527046adfc92fecf0d8"
4
s: "0x551041e78e3b3d4432f653d708965d34aceaf067255d9cc5970283b00d5f95e0"
5
signature: "0xc5e7a538a353c53e839ed0a2cf7b726806114b637ad1c527046adfc92fecf0d8551041e78e3b3d4432f653d708965d34aceaf067255d9cc5970283b00d5f95e01b"
6
v: "0x1b"
7
}
8
status: "SUCCESS"
9
}
Copied!

Function Reference

The function reference describes the different functions that are available in the Widget. For each function you can find the signature, it's parameters, and possible options documented.
​