-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathindex.html
46 lines (46 loc) · 1.73 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Anchor Link - Transact</title>
<script src="https://unpkg.com/anchor-link@3"></script>
<script src="https://unpkg.com/anchor-link-browser-transport@3"></script>
<script>
// initialize the browser transport
const transport = new AnchorLinkBrowserTransport()
// initialize the link, this time we are using the TELOS chain
const link = new AnchorLink({
transport,
chains: [{
chainId: '4667b205c6838ef70ff7988f6e8257e8be0e1284a2f59699054a018f743b1d11',
nodeUrl: 'https://telos.greymass.com'
}]
})
// the EOSIO action we want to sign and broadcast
const action = {
account: 'eosio',
name: 'voteproducer',
authorization: [{
actor: '............1', // ............1 will be resolved to the signing accounts permission
permission: '............2' // ............2 will be resolved to the signing accounts authority
}],
data: {
voter: '............1',
proxy: 'coredevproxy',
producers: [],
}
}
// ask the user to sign the transaction and then broadcast to chain
function vote() {
link.transact({action})
.then((result) => {
document.body.innerHTML = `<h1>Thank you ${ result.signer.actor }!</h1>`
})
}
</script>
</head>
<body>
<button onclick="vote()">Vote for Greymass (and other core contributors to TELOS)!</button>
</body>
</html>