Fetching the ABI
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>"
}
},
it just retured ABI structure and Code Hash for selected account
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
get abi is now available independently of get code.