-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsend-slp-token.html
42 lines (37 loc) · 1.1 KB
/
send-slp-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 Simple Ledger Protocol Tokens</p>
<p>
<button id="badger-button">
Tip 5 Nakamoto SLP 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: 'df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb',
tokenProtocol: 'slp'
}
}
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>