Since Web3J doesn't currently support ERC1155, is there a way to get the balance for a wallet? My guess is to use a function for this, but I can't seem to figure out how to get it to work.
Function function = new Function(
"balancedOf",
Arrays.asList(new Address(ethAddress), new Uint256(1)),
Arrays.asList(new org.web3j.abi.TypeReference<Bool>() {}));
String data = FunctionEncoder.encode(function);
Do I then create a transaction? Or do I use ethSendRawTransaction? balanceOf only has 2 input so I would expect to have to invoke it from a smartcontract, but I don't see a way to do it.
From reading the web3j docs, It seems that you can do the following:
The
response
object, fromorg.web3j.protocol.core.methods.response.EthCall
does the JSON-RPC call "eth_call" which only retrieves data form the blockchain.I believe this is the equivalent of doing in web3js the following: