java8, web3j:5.0.0
请教各位大佬
1:web3j如何解析solidity中的struct结构体数组? 2:web3j的4.5.5版本命令行工具无法生成带struct结构体的java包装类
solidity代码:
struct Nft {
uint256 a;
uint256 b;
}
java代码:
public static class NFT extends DynamicStruct {
public BigInteger a;
public BigInteger b;
public NFT(BigInteger a, BigInteger b) {
super(
new org.web3j.abi.datatypes.generated.Uint256(a),
new org.web3j.abi.datatypes.generated.Uint256(b));
this.a = a;
this.b = b;
}
public NFT(Uint256 a, Uint256 b) {
super(a, b);
this.a = b.getValue();
}
}
封装:
Function function = new Function(methodName, inputParameters, Arrays.asList(
new TypeReference<StaticArray1<NFT>>() {
}
));