4

Should I analyze all the blocks or are there some methods in the eosjs library?

  • you should start your own node, and set the history plugin to filter your action – Jimmy Guo Jul 12 '18 at 2:48
3

You can simply request a node to give you the action history of an account.

Using cleos:

cleos --url https://api1.eosdublin.io get actions <EOS account name>

Using eosjs:

const eosjs = require("eosjs")
const eos = eosjs({
  httpEndpoint: 'https://api1.eosdublin.io',
  chainId: 'aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906'
})

async function main() {
  const actions = (await eos.getActions('<EOS account name>')).actions
  console.log(actions.map(a => a.action_trace))
}

main().catch(error => {
  console.error(error)
  process.exit(1)
})
|improve this answer|||||
  • These actions are only system action of eosio, but not all contract actions. – Jimmy Guo Jul 14 '18 at 3:01
3
  1. Of course, eosjs provides method getActions. Here's an example:

    const Eos = require('eosjs');
    const api = new Eos({
        httpEndpoint: 'https://eos.greymass.com',
        chainId: 'aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906',
    });
    api.getActions('wangruixiwww').then(console.log);
    
  2. You can send direct request to some API like this

    https://eospark.com/api/account/wangruixiwww/actions?action_type=token&show_trx_small=0&show_trx_in=1&show_trx_out=1&page=1&size=50

|improve this answer|||||
  • Nice suggestion, but you would depend on a centralized source instead of being able to query it from any node on the network. – Andres Berrios Jul 14 '18 at 0:17
0

You can try another node: cleos -u https://api.eosnewyork.io get actions

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.