EOSIO / eosio-java

EOSIO SDK for Java - API for integrating with EOSIO-based blockchains
https://eosio.github.io/eosio-java/
MIT License
127 stars 44 forks source link

Add support for action return values. #122

Closed opi-smccoole closed 3 years ago

opi-smccoole commented 3 years ago

Add two new methods to PushTransactionResponse and SendTransactionResponse.

public ArrayList<Object> getActionValues() - gets the action values for all actions in the response. There can be more response actions than input actions due to inline actions or notifications but input actions are returned first and in the same order as sent in the request. For this reason the ArrayList will contain null for any actions that do not have return values in order to maintain an 1-1 index.

public <T> T getActionValueAtIndex(int index, Class<T> clazz) throws IndexOutOfBoundsException, ClassCastException - convenience function to return the action value at the specified index, casting it to the anticipated class type. Exceptions are thrown for out of index or casting errors since null is a valid return if the action index requested did not have a return value.