-
Notifications
You must be signed in to change notification settings - Fork 2
/
nice.js
34 lines (31 loc) · 808 Bytes
/
nice.js
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
const { promiseLoggedIn, promiseBrowserOpen } = require('./util/promise');
const { goto } = require('./util');
const { sendBitClout } = require('./transactions');
const AUTHOR_PUBLIC_KEY = (
'BC1YLhnr23db6y58uw56t7S8MSPdqNs4rpqGgqJ4rSDqvRuwraECkxj'
);
/**
* Send a little bit of BitClout to the author (if you're feeling nice) :)
*
* The nice settings are set on CloudNav.prototype.options.nice.
*
* @method
* @async
*/
module.exports = async function (parent) {
// Check browser state
await promiseLoggedIn(
promiseBrowserOpen(
Promise.resolve(parent)
)
);
current_url = parent.status.current_url;
try {
await sendBitClout(parent,
public_key=AUTHOR_PUBLIC_KEY,
amount=parent.options.nice.fee
)
} finally {
await goto(parent, current_url);
}
}