We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
You can continue the conversation there. Go to discussion →
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
public boolean mintNFTByAmount(Web3j web3j, String contractAddress, int amount) { if (web3j == null) return false; String methodName = "mint"; String fromAddr = emptyAddress; Function function = new Function( methodName, Arrays.asList(new Uint256(amount)), Arrays.asList(new TypeReference() { }));
String data = FunctionEncoder.encode(function); Transaction transaction = Transaction.createEthCallTransaction(fromAddr, contractAddress, data); EthCall ethCall; try { ethCall = web3j.ethCall(transaction, DefaultBlockParameterName.LATEST).sendAsync().get(); //List<Type> results = FunctionReturnDecoder.decode(ethCall.getValue(), function.getOutputParameters()); } catch (InterruptedException | ExecutionException e) { e.printStackTrace(); } return true; } /** * 调用NFT的Mint方法根据合约有两种 * Function: mint(address _to, uint256 _mintAmount) ***/ public boolean mintNFTByAmountAndAddress(Web3j web3j, Credentials credentials, String contractAddress, int amount) { if (web3j == null) return false; if (credentials == null) return false; String methodName = "mint"; String fromAddr = emptyAddress; Function function = new Function( methodName, Arrays.asList(new Address(credentials.getAddress()), new Uint256(amount)), Arrays.asList(new TypeReference<Type>() { })); String data = FunctionEncoder.encode(function); Transaction transaction = Transaction.createEthCallTransaction(fromAddr, contractAddress, data); EthCall ethCall; try { ethCall = web3j.ethCall(transaction, DefaultBlockParameterName.LATEST).sendAsync().get(); //List<Type> results = FunctionReturnDecoder.decode(ethCall.getValue(), function.getOutputParameters()); } catch (InterruptedException | ExecutionException e) { e.printStackTrace(); } return true; }
have some problem for contract 721
The text was updated successfully, but these errors were encountered:
No branches or pull requests
public boolean mintNFTByAmount(Web3j web3j, String contractAddress, int amount) {
if (web3j == null) return false;
String methodName = "mint";
String fromAddr = emptyAddress;
Function function = new Function(
methodName,
Arrays.asList(new Uint256(amount)),
Arrays.asList(new TypeReference() {
}));
have some problem for contract 721
The text was updated successfully, but these errors were encountered: