-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
example.html
42 lines (39 loc) · 1.44 KB
/
example.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
<html>
<head>
<script src="dogecoin.min.js"></script>
</head>
<body>
<img id="qrcode" src="" />
<script type="text/javascript">
( async () => {
Dogecoin.lookup( "DPsvmxqaJV15nqVnT9BiwYskVmQLozRKht", ( wallet ) => {
console.log( wallet );
} );
// OR...
// let wallet = await DogeCoin.lookup( "DPsvmxqaJV15nqVnT9BiwYskVmQLozRKht" );
Dogecoin.qrcode( "DPsvmxqaJV15nqVnT9BiwYskVmQLozRKht", ( data ) => {
console.log( "got qr code!", data );
var image = document.getElementById( "qrcode" );
image.src = URL.createObjectURL( data );
});
// OR...
// let qrcode = await DogeCoin.qrcode( "DPsvmxqaJV15nqVnT9BiwYskVmQLozRKht" );
// Listen for wallet balance updates
Dogecoin.listen( "DPsvmxqaJV15nqVnT9BiwYskVmQLozRKht", ( address, amount, extra ) => {
console.log( "Wallet balance update!", address, amount, extra );
});
// Listen to multiple wallets with the same event handler
// Dogecoin.listen( [ "address1", "address2", ... ], ( address, amount, extra ) => {
// console.log( "Wallet balance update!", address, amount );
// } );
// --- TODO ---
// Dogecoin.received( "DPsvmxqaJV15nqVnT9BiwYskVmQLozRKht", ( address, amount, extra ) => {
// console.log( "Received Doge!", address, amount );
// } );
// Dogecoin.sent( "DPsvmxqaJV15nqVnT9BiwYskVmQLozRKht", ( address, amount, extra ) => {
// console.log( "Sent Doge!", address, amount );
// } );
})();
</script>
</body>
</html>