eos icon indicating copy to clipboard operation
eos copied to clipboard

Fetching the ABI

Open jcalfee opened this issue 9 years ago • 3 comments

The eosjs has support for contract level messages. For this is it fetching ABI via get_code and using the types, structs, and actions. It does not use wast.. I suppose that over time it would be a waste to always return the code when it is not actually needed. So you might consider adjusting the api a bit..

  "get_code": {
    "brief": "Fetch smart contract code",
    "params": {
      "name": "Name"
    },
    "results": {
      "name": "Name",
      "wast": "String",
      "code_hash": "FixedBytes32",
      "abi": "Optional<Abi>"
    }
  },

jcalfee avatar Oct 14 '17 20:10 jcalfee

it just retured ABI structure and Code Hash for selected account

riotom avatar Mar 15 '18 13:03 riotom

The command line client filters it for you .. but in the API it returns everything.

Look at get_code_params and get_code_results

https://github.com/EOSIO/eos/blob/master/plugins/chain_plugin/include/eosio/chain_plugin/chain_plugin.hpp#L92-L102

jcalfee avatar Mar 15 '18 14:03 jcalfee

get abi is now available independently of get code.

jgiszczak avatar Jun 06 '18 16:06 jgiszczak