use of com.hederahashgraph.api.proto.java.QueryHeader in project hedera-services by hashgraph.
the class RequestBuilder method getFileGetContentBuilder.
public static Query getFileGetContentBuilder(Transaction payment, FileID fileID, ResponseType responseType) {
QueryHeader queryHeader = QueryHeader.newBuilder().setPayment(payment).setResponseType(responseType).build();
FileGetContentsQuery fileGetContentsQuery = FileGetContentsQuery.newBuilder().setHeader(queryHeader).setFileID(fileID).build();
return Query.newBuilder().setFileGetContents(fileGetContentsQuery).build();
}
use of com.hederahashgraph.api.proto.java.QueryHeader in project hedera-services by hashgraph.
the class RequestBuilder method getFileGetInfoBuilder.
/**
* Get file get info builder
*
* @param payment
* payment
* @param fileID
* file ID
* @param responseType
* response type
* @return query
*/
public static Query getFileGetInfoBuilder(Transaction payment, FileID fileID, ResponseType responseType) {
QueryHeader queryHeader = QueryHeader.newBuilder().setPayment(payment).setResponseType(responseType).build();
FileGetInfoQuery fileGetInfoQuery = FileGetInfoQuery.newBuilder().setHeader(queryHeader).setFileID(fileID).build();
return Query.newBuilder().setFileGetInfo(fileGetInfoQuery).build();
}
use of com.hederahashgraph.api.proto.java.QueryHeader in project hedera-services by hashgraph.
the class HapiGetTxnRecord method getRecordQuery.
private Query getRecordQuery(HapiApiSpec spec, Transaction payment, boolean costOnly) {
TransactionID txnId = useDefaultTxnId ? defaultTxnId : explicitTxnId.orElseGet(() -> spec.registry().getTxnId(txn));
if (lookupScheduledFromRegistryId) {
txnId = spec.registry().getTxnId(correspondingScheduledTxnId(creationName.get()));
} else {
if (scheduled) {
txnId = txnId.toBuilder().setScheduled(true).build();
}
}
QueryHeader header;
if (costOnly && omitPaymentHeaderOnCostAnswer) {
header = QueryHeader.newBuilder().setResponseType(COST_ANSWER).build();
} else {
header = costOnly ? answerCostHeader(payment) : answerHeader(payment);
}
TransactionGetRecordQuery getRecordQuery = TransactionGetRecordQuery.newBuilder().setHeader(header).setTransactionID(txnId).setIncludeDuplicates(requestDuplicates).setIncludeChildRecords(requestChildRecords).build();
return Query.newBuilder().setTransactionGetRecord(getRecordQuery).build();
}
Aggregations