Search in sources :

Example 1 with TokenGetNftInfosQuery

use of com.hederahashgraph.api.proto.java.TokenGetNftInfosQuery in project hedera-services by hashgraph.

the class GetTokenNftInfosAnswer method responseGiven.

@Override
public Response responseGiven(Query query, StateView view, ResponseCodeEnum validity, long cost) {
    TokenGetNftInfosQuery op = query.getTokenGetNftInfos();
    TokenGetNftInfosResponse.Builder response = TokenGetNftInfosResponse.newBuilder();
    ResponseType type = op.getHeader().getResponseType();
    if (type == COST_ANSWER) {
        response.setHeader(costAnswerHeader(NOT_SUPPORTED, 0L));
    } else {
        response.setHeader(answerOnlyHeader(NOT_SUPPORTED));
    }
    return Response.newBuilder().setTokenGetNftInfos(response).build();
}
Also used : TokenGetNftInfosQuery(com.hederahashgraph.api.proto.java.TokenGetNftInfosQuery) TokenGetNftInfosResponse(com.hederahashgraph.api.proto.java.TokenGetNftInfosResponse) ResponseType(com.hederahashgraph.api.proto.java.ResponseType)

Example 2 with TokenGetNftInfosQuery

use of com.hederahashgraph.api.proto.java.TokenGetNftInfosQuery in project hedera-services by hashgraph.

the class HapiGetTokenNftInfos method getTokenNftInfosQuery.

private Query getTokenNftInfosQuery(HapiApiSpec spec, Transaction payment, boolean costOnly) {
    var id = TxnUtils.asTokenId(token, spec);
    TokenGetNftInfosQuery getTokenNftInfosQuery = TokenGetNftInfosQuery.newBuilder().setHeader(costOnly ? answerCostHeader(payment) : answerHeader(payment)).setTokenID(id).setStart(start).setEnd(end).build();
    return Query.newBuilder().setTokenGetNftInfos(getTokenNftInfosQuery).build();
}
Also used : TokenGetNftInfosQuery(com.hederahashgraph.api.proto.java.TokenGetNftInfosQuery)

Aggregations

TokenGetNftInfosQuery (com.hederahashgraph.api.proto.java.TokenGetNftInfosQuery)2 ResponseType (com.hederahashgraph.api.proto.java.ResponseType)1 TokenGetNftInfosResponse (com.hederahashgraph.api.proto.java.TokenGetNftInfosResponse)1