-
Notifications
You must be signed in to change notification settings - Fork 8
/
send-bch.html
38 lines (33 loc) · 940 Bytes
/
send-bch.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
<!doctype html>
<html>
<body>
<p>Send BCH</p>
<p>
<button id="badger-button">
Tip 1000 BCH Satoshis 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: "1000"
}
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>