-
Notifications
You must be signed in to change notification settings - Fork 8
/
send-wormhole-token.html
42 lines (37 loc) · 1.08 KB
/
send-wormhole-token.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
<!doctype html>
<html>
<body>
<p>Send Wormhole Tokens</p>
<p>
<button id="badger-button">
Tip 5 Nakamoto Wormhole tokens to EatBCH
</button>
</p>
<script>
var badgerButton = document.getElementById("badger-button")
badgerButton.addEventListener('click', function(event) {
if (typeof web4bch !== 'undefined') {
web4bch = new Web4Bch(web4bch.currentProvider)
var txParams = {
to: "bitcoincash:pp8skudq3x5hzw8ew7vzsw8tn4k8wxsqsv0lt0mf3g",
from: web4bch.bch.defaultAccount,
value: "5",
sendTokenData: {
tokenId: 'qqqqqqqqqqqqqqqqqqqqqqqqqqqqqu08dsyxz98whc227',
tokenProtocol: 'wormhole'
}
}
web4bch.bch.sendTransaction(txParams, (err, res) => {
if (err) {
console.log('send err', err)
} else {
console.log('send success, transaction id:', res)
}
})
} else {
console.log("Ensure Badger Wallet is installed and unlocked, then refresh this page")
}
})
</script>
</body>
</html>