本文整理了Java中org.web3j.abi.datatypes.Address.getValue()
方法的一些代码示例,展示了Address.getValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Address.getValue()
方法的具体详情如下:
包路径:org.web3j.abi.datatypes.Address
类名称:Address
方法名:getValue
暂无
代码示例来源:origin: AppStoreFoundation/asf-sdk
@Override public Observable<Long> getNonce(Address address) {
return Observable.fromCallable(
() -> web3j.ethGetTransactionCount(address.getValue(), DefaultBlockParameterName.PENDING)
.send())
.map(ethGetTransactionCount -> ethGetTransactionCount.getTransactionCount()
.longValue());
}
代码示例来源:origin: AppStoreFoundation/asf-sdk
@Override
public String getContractAddressById(String fromAddress, int chainId, String contractId) {
List<Type> arguments = new ArrayList<>();
List<TypeReference<?>> returnValues = new ArrayList<>();
returnValues.add(new TypeReference<Address>() {
});
arguments.add(stringToBytes32(contractId));
Function getContractAddressById =
new Function("getContractAddressById", arguments, returnValues);
String encodedFunction = FunctionEncoder.encode(getContractAddressById);
Transaction ethCallTransaction = createEthCallTransaction(fromAddress,
proxyContractAddressProvider.getProxyContractAddress(chainId), encodedFunction);
try {
EthCall rawResponse = web3jProvider.get(chainId)
.ethCall(ethCallTransaction, DefaultBlockParameterName.LATEST)
.send();
if (!rawResponse.hasError()) {
List<Type> response = FunctionReturnDecoder.decode(rawResponse.getValue(),
getContractAddressById.getOutputParameters());
return ((Address) response.get(0)).getValue();
} else {
throw new RuntimeException(mapErrorToMessage(rawResponse.getError()));
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
内容来源于网络,如有侵权,请联系作者删除!