diff --git a/dist/responder.js b/dist/responder.js index d38ea88..8fffe68 100644 --- a/dist/responder.js +++ b/dist/responder.js @@ -207,6 +207,33 @@ var Responder = function () { return _steem2.default.broadcast.voteAsync(wif, this.responderUsername, targetUsername, targetPermlink, votingWeight); } + }, { + key: 'resteem', + value: function resteem() { + var targetUsername = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.targetUsername; + var targetPermlink = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.targetPermlink; + + this._throwErrorIfNoKey(); + this._throwErrorIfNoPermlink(targetPermlink); + + var wif = this.postingKey || this.activeKey; + + var action = JSON.stringify(['reblog'], { + account: this.responserUsername, + author: targetUsername, + permlink: targetPermlink + }); + + return _steem2.default.broadcast.customJsonAsync(wif, [], [this.responderUsername], 'follow', action); + } + }, { + key: 'resteemOnMemo', + value: function resteemOnMemo() { + var customTargetUsername = extractUsernameFromLink(this.transferMemo); + var customTarget = extractPermlinkFromLink(this.transferMemo); + + return this.resteem(customTargetUsername, customTarget); + } }, { key: 'upvoteOnMemo', value: function upvoteOnMemo() { diff --git a/src/responder.js b/src/responder.js index 2d81cd6..3c764c7 100644 --- a/src/responder.js +++ b/src/responder.js @@ -219,6 +219,37 @@ export default class Responder { ); } + resteem( + targetUsername = this.targetUsername, + targetPermlink = this.targetPermlink + ) { + this._throwErrorIfNoKey(); + this._throwErrorIfNoPermlink(targetPermlink); + + const wif = this.postingKey || this.activeKey; + + const action = JSON.stringify(['reblog'], { + account: this.responserUsername, + author: targetUsername, + permlink: targetPermlink + }) + + return steem.broadcast.customJsonAsync( + wif, + [], + [this.responderUsername], + 'follow', + action + ) + } + + resteemOnMemo() { + const customTargetUsername = extractUsernameFromLink(this.transferMemo) + const customTarget = extractPermlinkFromLink(this.transferMemo) + + return this.resteem(customTargetUsername, customTarget) + } + upvoteOnMemo(votingPercentage = 100.0) { const customTargetUsername = extractUsernameFromLink(this.transferMemo); const customTargetPermlink = extractPermlinkFromLink(this.transferMemo);