-
Notifications
You must be signed in to change notification settings - Fork 1
/
manual_add_script.txt
71 lines (66 loc) · 2.4 KB
/
manual_add_script.txt
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// ADD THIS TO node_modules/hivesigner/lib/index.js // after line 312
// custom methods start
}, {
key: 'subscribe',
value: function subscribe(follower, community, cb) {
var json = ['subscribe', { community: community }];
return this.customJson([], [follower], 'community', (0, _stringify2.default)(json), cb);
}
}, {
key: 'unsubscribe',
value: function unsubscribe(follower, community, cb) {
var json = ['unsubscribe', { community: community }];
return this.customJson([], [follower], 'community', (0, _stringify2.default)(json), cb);
}
}, {
key: 'flagPost',
value: function flagPost(account, author, community, permlink, notes, cb) {
var json = ['flagPost', {
community: community,
account: author,
permlink: permlink,
notes: notes
}];
return this.customJson([], [account], 'community', (0, _stringify2.default)(json), cb);
}
// after line 278
}, {
key: 'commentOptions',
value: function commentOptions(author, permlink, max_accepted_payout, percent_steem_dollars, allow_votes=true, allow_curation_rewards=true,cb) {
var params = {
author: author,
permlink: permlink,
max_accepted_payout: max_accepted_payout,
percent_steem_dollars: percent_steem_dollars,
allow_votes: allow_votes,
allow_curation_rewards: allow_curation_rewards,
extensions: []
};
return this.broadcast([['comment_options', params]], cb);
}
// custom methods end
// updated comment api
}, {
key: 'comment',
value: function comment(parentAuthor, parentPermlink, author, permlink, title, body, jsonMetadata, commentOptions='', cb) {
if (useHiveKeychain()) {
return window.hive_keychain.requestPost(author, title, body, parentPermlink, parentAuthor, jsonMetadata, permlink, commentOptions, function (response) {
if (response.error) return cb(response.error);
return cb(null, response);
});
}
var params = {
parent_author: parentAuthor,
parent_permlink: parentPermlink,
author: author,
permlink: permlink,
title: title,
body: body,
json_metadata: (0, _stringify2.default)(jsonMetadata),
};
if(commentOptions!==''){
return this.broadcast([['comment', params],['comment_options', commentOptions]], cb);
}else{
return this.broadcast([['comment', params]], cb);
}
}