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

How to get user wallet history?

Open kv-gits opened this issue 7 years ago • 15 comments

Is there any optimal way (without scanning all account history) to get transfers list of user?

kv-gits avatar Nov 23 '17 17:11 kv-gits

Did you ever find out a way to do this? I can't seem to figure it out either.

jeffbernst avatar Jan 19 '18 22:01 jeffbernst

Dangit. getAccounts seems to have a transfer history, but it's empty regardless.

TwinkieWInkie avatar Jan 26 '18 18:01 TwinkieWInkie

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... )

MWFIAE avatar Jan 29 '18 15:01 MWFIAE

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.

TwinkieWInkie avatar Feb 11 '18 18:02 TwinkieWInkie

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)
});

Sambillingham avatar Mar 04 '18 16:03 Sambillingham

Is there any way to get a full history of the user wallet history? Using getAccountHistory(), it only fetches data of recent 30 days :(

davetaeyang avatar May 30 '18 13:05 davetaeyang

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)
});

Sambillingham avatar May 31 '18 08:05 Sambillingham

So from counts from the oldest transaction, unless negative?

toniwidmo avatar May 31 '18 09:05 toniwidmo

@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.

Sambillingham avatar May 31 '18 12:05 Sambillingham

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.

toniwidmo avatar May 31 '18 16:05 toniwidmo

Thanks so much! @Sambillingham

davetaeyang avatar Jun 01 '18 00:06 davetaeyang

yeah @antonchanning that is correct. 👍

Sambillingham avatar Jun 02 '18 08:06 Sambillingham

How do we get it without using a node?

berkantsoytas avatar Nov 29 '21 14:11 berkantsoytas

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.

ausbitbank avatar Feb 23 '22 09:02 ausbitbank

Thanks, it's not necessary anymore. I like your profile.

berkantsoytas avatar Feb 23 '22 11:02 berkantsoytas