Search in sources :

Example 1 with TokenGetAccountNftInfosQuery

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

the class HapiGetAccountNftInfos method getAccountNftInfosQuery.

private Query getAccountNftInfosQuery(HapiApiSpec spec, Transaction payment, boolean costOnly) {
    var id = TxnUtils.asId(account, spec);
    TokenGetAccountNftInfosQuery getAccountNftInfosQuery = TokenGetAccountNftInfosQuery.newBuilder().setHeader(costOnly ? answerCostHeader(payment) : answerHeader(payment)).setAccountID(id).setStart(start).setEnd(end).build();
    return Query.newBuilder().setTokenGetAccountNftInfos(getAccountNftInfosQuery).build();
}
Also used : TokenGetAccountNftInfosQuery(com.hederahashgraph.api.proto.java.TokenGetAccountNftInfosQuery)

Example 2 with TokenGetAccountNftInfosQuery

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

the class GetAccountNftInfosAnswer method responseGiven.

@Override
public Response responseGiven(Query query, StateView view, ResponseCodeEnum validity, long cost) {
    TokenGetAccountNftInfosQuery op = query.getTokenGetAccountNftInfos();
    TokenGetAccountNftInfosResponse.Builder response = TokenGetAccountNftInfosResponse.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().setTokenGetAccountNftInfos(response).build();
}
Also used : TokenGetAccountNftInfosResponse(com.hederahashgraph.api.proto.java.TokenGetAccountNftInfosResponse) TokenGetAccountNftInfosQuery(com.hederahashgraph.api.proto.java.TokenGetAccountNftInfosQuery) ResponseType(com.hederahashgraph.api.proto.java.ResponseType)

Aggregations

TokenGetAccountNftInfosQuery (com.hederahashgraph.api.proto.java.TokenGetAccountNftInfosQuery)2 ResponseType (com.hederahashgraph.api.proto.java.ResponseType)1 TokenGetAccountNftInfosResponse (com.hederahashgraph.api.proto.java.TokenGetAccountNftInfosResponse)1