获取opensea 数据及价格
https://api.opensea.io/api/v1/assets?order_direction
监听合约日志
Web3j web3 = Web3j.build(new HttpService("https://mainnet.infura.io/v3/" ));
Event event = new Event("NameRegistered",
Arrays.<TypeReference<?>>asList(
new TypeReference<Utf8String>(false) {
},
new TypeReference<Bytes32>(true) {
},
new TypeReference<Address>(true) {
},
new TypeReference<Uint256>(false) {
},
new TypeReference<Uint256>(false) {
}));
EthFilter filter = new EthFilter(DefaultBlockParameter.valueOf(new BigInteger( dictDataService.selectDictDataById(100L).getDictValue())),
DefaultBlockParameterName.LATEST, "xxx");
filter.addSingleTopic("xxx");
调用合约接口
本文介绍了如何通过调用OpenSea的API获取资产数据,并利用Web3j库监听以太坊合约的日志事件,具体涉及EthFilter和事件注册等关键步骤。

1320





