I am trying to implement a Java interface to be able to call FA1.2 smart contract entrypoints programmatically. This is what I've got now:
public interface FA12
public JSONObject transfer(String from, String to, Integer value) throws Exception;
public JSONObject approve(String spender, Integer value) throws Exception;
public JSONObject getAllowance(String owner, String spender) throws Exception;
public JSONObject getBalance(String owner) throws Exception;
public JSONObject getTotalSupply(Integer total) throws Exception;
But I was told that these get operations should not return a value. Instead, I should use callbacks to get the results: Apparently I should call a VIEW entrypoint and supply to the view an address and a callback contract. That's not something trivial, even for an experienced developer as I am. What callback contract address should I use? One that I have deployed my own? All contracts have its own callback contract address?
I am having some difficulty while trying to understand the correct way to do it.
My goal here is just calling getBalance() to check how many tokens an address has in a mainnet deployed contract.
Please, any help will be appreciated. Thanks in advance.