steemit / steem-js

Steem.js the official JavaScript library for Steem blockchain
https://www.npmjs.com/package/steem
MIT License
472 stars 225 forks source link

Set Block Applied Callback always return null #268

Open Vik-BC opened 7 years ago

Vik-BC commented 7 years ago

Query works fine:

socket.send(JSON.stringify({ 
id: 1, method: 'call', 
"params": ["database_api","set_block_applied_callback",[1],] 
}));

But steem.api.setBlockAppliedCallback return "null"

steem.api.setBlockAppliedCallback(1, function(err, result) {
  console.log(err, result);
});
BartolomeoItaliano commented 7 years ago

I had got even worse problem, after first time it starts to throw Error:

Uncaught TypeError: Cannot read property 'api' of undefined at e.value (steem.min.js:5) at WebSocket. (steem.min.js:5) value @ steem.min.js:5 (anonymous) @ steem.min.js:5

I am doing something wrong or library is broken in that place?