use of com.hederahashgraph.api.proto.java.Query in project hedera-services by hashgraph.
the class HapiGetTokenNftInfo method lookupCostWith.
@Override
protected long lookupCostWith(HapiApiSpec spec, Transaction payment) throws Throwable {
Query query = getTokenNftInfoQuery(spec, payment, true);
Response response = spec.clients().getTokenSvcStub(targetNodeFor(spec), useTls).getTokenNftInfo(query);
return costFrom(response);
}
use of com.hederahashgraph.api.proto.java.Query in project hedera-services by hashgraph.
the class HapiGetTokenNftInfo method submitWith.
@Override
protected void submitWith(HapiApiSpec spec, Transaction payment) {
Query query = getTokenNftInfoQuery(spec, payment, false);
response = spec.clients().getTokenSvcStub(targetNodeFor(spec), useTls).getTokenNftInfo(query);
if (verboseLoggingOn) {
log.info("Info for '" + token + "': " + response.getTokenGetNftInfo().getNft());
}
}
use of com.hederahashgraph.api.proto.java.Query in project hedera-services by hashgraph.
the class HapiGetTokenNftInfos method lookupCostWith.
@Override
protected long lookupCostWith(HapiApiSpec spec, Transaction payment) throws Throwable {
Query query = getTokenNftInfosQuery(spec, payment, true);
Response response = spec.clients().getTokenSvcStub(targetNodeFor(spec), useTls).getTokenNftInfos(query);
return costFrom(response);
}
use of com.hederahashgraph.api.proto.java.Query in project hedera-services by hashgraph.
the class HapiGetTokenNftInfos method submitWith.
@Override
protected void submitWith(HapiApiSpec spec, Transaction payment) throws Throwable {
Query query = getTokenNftInfosQuery(spec, payment, false);
response = spec.clients().getTokenSvcStub(targetNodeFor(spec), useTls).getTokenNftInfos(query);
if (verboseLoggingOn) {
log.info("NftInfo for '" + token + "': ");
response.getTokenGetNftInfos().getNftsList().forEach(nft -> log.info(nft.toString()));
}
}
use of com.hederahashgraph.api.proto.java.Query in project hedera-services by hashgraph.
the class HapiGetAccountNftInfos method submitWith.
@Override
protected void submitWith(HapiApiSpec spec, Transaction payment) {
Query query = getAccountNftInfosQuery(spec, payment, false);
response = spec.clients().getTokenSvcStub(targetNodeFor(spec), useTls).getAccountNftInfos(query);
if (verboseLoggingOn) {
StringBuilder information = new StringBuilder("Nft information for '" + account + "': \n");
List<TokenNftInfo> nfts = response.getTokenGetAccountNftInfos().getNftsList();
information.append(Strings.join(nfts, '\n'));
log.info(information.toString());
}
}
Aggregations