steem-js
steem-js copied to clipboard
Are the docs out of date?
I am getting a strange error. My code is literally taken right off the front page...
steem.api.getDiscussionsByPayout(query, function(err, result) {
console.log(err, result);
});
The error I get is
Error [RPCError]: Assert Exception:method_itr != api_itr->second.end(): Could not find method get_discussions_by_payout
at new RPCError (/home/username/Projects/steem-manager/node_modules/steem/lib/api/transports/http.js:43:106)
at /home/username/Projects/steem-manager/node_modules/steem/lib/api/transports/http.js:93:13
at processTicksAndRejections (internal/process/task_queues.js:94:5) {
name: 'RPCError',
code: -32002,
data: {
code: 10,
name: 'assert_exception',
message: 'Assert Exception',
stack: [ [Object] ]
}
}
Expected behavior
I expected that line of code to work, perhaps with a limit, (would be nice if query were documented somewhere)
Actual behavior
It threw the above error
How to reproduce
Run the sample code from the readme
Environment information
Ubuntu Bionic, Node 10
My guess is the docs are out of date and possibly the code. Is there a way to get a list of what is expected to work now days? Also is there someplace where query is documented? Thanks!
Could you share the script?
Actually the script was literally just that line, but it looks like there is quite a bit that's out of date. For example...
for(let name of names){
let results = await steem.api.getAccountVotesAsync(name);
console.debug("result: ",results);
}
result: {
error: {
code: -32000,
message: 'get_account_votes is no longer supported, for details see https://steemit.com/steemit/@steemitdev/additional-public-api-change (hivemind-alpha)'
}
}
https://steemit.com/steemit/@steemitdev/additional-public-api-change
getAccountVotes is no longer supported and I don't see anything for the suggested replacement of using database_api.list_votes
I'm not seeing a function that maps to this database_api.list_votes, and I don't see how to use steemjs to call it. Is there a tutorial I'm missing somewhere?
Regarding list_votes
, here is docs: https://developers.steem.io/apidefinitions/#database_api.list_votes
Regarding getDiscussionsByPayout
, could you please share the full script, including the definition of query
param?