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

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 => {
  • These actions are only system action of eosio, but not all contract actions.
    – Jimmy Guo
    Jul 14 '18 at 3:01
  • @Andres : I am facing the error like rror TypeError: eosjs is not a function Jul 1 '20 at 12:53
  • @Andres : I tied with terminal "cleos get actions bob" it will give response, may I know what is actual problem Jul 1 '20 at 13:09
  • @Codebrekers this answer was written using version 16.0.9 of eosjs. Nowadays, with eosjs v20.0.0, the API is different. You should check the documentation here: developers.eos.io/manuals/eosjs/latest/index Jul 3 '20 at 20:28
  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',
  2. You can send direct request to some API like this


  • Nice suggestion, but you would depend on a centralized source instead of being able to query it from any node on the network. Jul 14 '18 at 0:17
  • @oxfn: it will give error like TypeError: Eos is not a constructor Jul 1 '20 at 13:06

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

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.