steem-js icon indicating copy to clipboard operation
steem-js copied to clipboard

Are the docs out of date?

Open edukaded opened this issue 5 years ago • 4 comments

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!

edukaded avatar Jan 22 '20 20:01 edukaded

Could you share the script?

roadscape avatar Jan 23 '20 17:01 roadscape

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?

edukaded avatar Jan 24 '20 22:01 edukaded

Regarding list_votes, here is docs: https://developers.steem.io/apidefinitions/#database_api.list_votes

roadscape avatar Jan 29 '20 15:01 roadscape

Regarding getDiscussionsByPayout, could you please share the full script, including the definition of query param?

roadscape avatar Jan 29 '20 15:01 roadscape