Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client.broadcast.comment does not return a status #41

Open
redmrdev opened this issue Jan 31, 2019 · 3 comments
Open

client.broadcast.comment does not return a status #41

redmrdev opened this issue Jan 31, 2019 · 3 comments

Comments

@redmrdev
Copy link

hi, when I try to post a new post, I use this code:

var dsteem = require('dsteem');
var client = new dsteem.Client('https://api.steemit.com');
....

client.broadcast.comment({
category: "a1",
parent_author:parent_author,
parent_permlink:primaryTag,
author:author,
permlink:permlink,
title:title,
body:body,
json_metadata: JSON.stringify({ tags: ['test', 'test-2', 'test-3'] }),
last_update: "string",
created:new Date().toDateString(),
children: 7,
max_accepted_payout:'1000000.000 SBD',
percent_steem_dollars: 10000,
allow_replies: true,
allow_votes: true,
allow_curation_rewards: true,
//beneficiaries:[{ account: 'gastonve', weight: 1000 }]
extensions: [
[0, {
beneficiaries: [{
account: "gastonve",
weight: 1000
}]
}]
]
},key, (err, steemResponse) => {
if (err) {
console.log(err);
return res.status(500).send({ message: 'Error:' + err });
}
else {
return res.status(200).send({ message: steemResponse });
}
});

but this does not return any status. what am I missing? please let me know

@SirVeryBritish
Copy link

Hey @RubenMR I've got the same issue. Can you see your content on Steemit?

@redmrdev
Copy link
Author

Hey @SirVeryBritish, I can see the content even though that function does not return anything.
I used another function which run ok, by the way this needs username and password from user:

function post(req,res){
steem.setAccessToken(req.body.access_token);
console.log("access_token: ",req.body.access_token );
var parent_author="".toString();
var author=req.body.author;
var permlink=req.body.permlink;
permlink=permlink.toLowerCase();
var password=req.body.password;
var tag1=req.body.tag1;
var tag2=req.body.tag2;
var tag3=req.body.tag3;
var tags = { tags: [tag1,tag2,tag3] };
var primaryTag=req.body.primaryTag;
let otherTags ="b3";
var title=req.body.title;
var body=req.body.body;
var author_parent="";
var category= "my_Category";
var json_metadata=JSON.stringify({ tags: ['test', 'test-2', 'test-3'] });
var max_accepted_payout='1000000.000 SBD';
var percent_steem_dollars=10000;
var allow_replies=true;
var allow_votes=true;
var allow_curation_rewards=true;
var wif = steem2.auth.toWif(author, password, 'posting');
var STEEM_PLUS_FEED=15;

var beneficiaries = new Array();
beneficiaries.push({
account: 'account_x',
weight: 100*STEEM_PLUS_FEED
});
var operations = [
['comment',
{
parent_author: '',
parent_permlink:primaryTag,
author: author,
permlink: permlink,
title: title,
body: body,
json_metadata : JSON.stringify({
tags: tags,
app: 'apprsd'
})
}
],
['comment_options', {
author: author,
permlink: permlink,
max_accepted_payout: '100000.000 SBD',
percent_steem_dollars: 10000,
allow_votes: true,
allow_curation_rewards: true,
extensions: [
[0, {
beneficiaries: beneficiaries
}]
]
}]
];

steem2.broadcast.send(
{ operations: operations, extensions: [] },
{ posting: wif },
function(e, r) {
if(e)
{
return res.status(500).send({ message: 'Error occurrido al publicar ' + e });
}

	else
	{
		return res.status(200).send({ message: 'Publicado: ' + r });
	}
	
}

);
}

@SirVeryBritish
Copy link

@RubenMR Thanks for the response, I've found that #16 might be related to the issue I've experience with not seeing the new post. I've come to the conclusion that switching to steem-js was the best solution for myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants