setPendingTransactionCallback does not work. How to set callback on transaction received?
Hi :) I'm looking for a why to confirm transaction has got place with steem js library, maybe you know how to do it?
I want to create bot which do something after it receives money.
I thought this will give me opportunity to do this:
steem.api.setPendingTransactionCallback(cb, function(err, result) {
console.log(err, result);
});
But it throws error with:
Uncaught TypeError: Cannot read property 'api' of undefined at e.value (steem.min.js:formatted:6784) at WebSocket.
(steem.min.js:formatted:6709)
Than in the message from blockchain it gives me very long info starting with:
Error: 10 assert_exception: Assert Exception itr != _by_name.end(): no method with name 'set_pending_transaction_callback' {"name":"set_pending_transaction_callback","api":
Please give me advice I will follow you and upvote yor posts on SteemIt :)
I am also receiving the same exact error, did you find any work around?
same here
There is no more support ?
Hi guys, I manage to resolve my problem different and in my opinion a lot better way.
steem.api.getAccountHistoryAsync(steemAccountName, -1, limit) .then((res)=>{ // do sth }) .catch((err) => { throw new Error(err); });
And I just run this function whenever I want as some "refresh functionality" or you can do it in Interval.
I just get account history, filter upcoming transactions and then save the last transaction ID in Database. Next time when I check "if sth new happened" I get the transactionId saved in database and filter the most recent transactions.
Thanks to this solution even after short power down I am still synchronized with steem network.
This looks like a good workaround but it is quite similar to setInterval functionality.
Well in fact:
steem.api.setPendingTransactionCallback(cb, function(err, result) { console.log(err, result); });
has setTimeout under the hood :)