steem-js
steem-js copied to clipboard
How to get user wallet history?
Is there any optimal way (without scanning all account history) to get transfers list of user?
Did you ever find out a way to do this? I can't seem to figure it out either.
Dangit. getAccounts seems to have a transfer history, but it's empty regardless.
Would need that too, so that my bot can check for transfers... Does anybody else know a way? (Well without parsing the whole blockchain.... and subscribing to all changes... )
Steem-bot here on github, listens for transfers.
I'm baffled that no one jumps in to point this out, seems like everybody shrugs their shoulders as a major incompetence of the platform gets pointed out.
hey @kv-gits is there a reason why using getAccountHistory()
is not appropriate for you?
For anyone else looking into getting user wallet data you can filter the results of getAccountHistory()
to give you what you need. e.g
steem.api.getAccountHistory('username', -1, 100, (err, result) => {
let transfers = result.filter( tx => tx[1].op[0] === 'transfer' )
console.log(transfers)
});
Is there any way to get a full history of the user wallet history? Using getAccountHistory()
, it only fetches data of recent 30 days :(
hey @davetaeyang do you have an example you can show where you are only able to get recent 30 days? In my experience, I have been able to get all History back to account creation regardless of time. You can adjust the starting point as necessary and limit excpets up to 10,000.
steem.api.getAccountHistory(account, from, limit, function(err, result) {
console.log(err, result);
});
e.g Latest 100
steem.api.getAccountHistory('sambillingham', -1, 100, (err, result) => {
console.log(result)
});
e.g First 100
steem.api.getAccountHistory('sambillingham', 100, 100, (err, result) => {
console.log(result)
});
So from
counts from the oldest transaction, unless negative?
@antonchanning Yes in that 0 is account_create
and every action on your account will increment from there. However, you request data backwards in time from the from
value or from -1
which represents the most recent action.
Presumably if I have, say, the last 10 transaction, and I want the next 10 last transactions, I have to get the id of the oldest one from first ten I got and count from there.
Thanks so much! @Sambillingham
yeah @antonchanning that is correct. 👍
How do we get it without using a node?
Simply email Justin Sun and ask him which accounts are blacklisted today in his private database that his lawyers have called "equivalent to Frequent Flyer miles" and declared they can simply refuse to honour token transfers and balances.
Or don't, cos this whole "blockchain" is a blatant scam.
Thanks, it's not necessary anymore. I like your profile.