/** * Generate a payment transaction given, aka. `TransferTransaction` * * @param {string} logId * @param {TransactionId} paymentTransactionId * @param {AccountId} nodeId * @param {?ClientOperator} operator * @param {Hbar} paymentAmount * @returns {Promise} */ export function _makePaymentTransaction(logId: string, paymentTransactionId: TransactionId, nodeId: AccountId, operator: ClientOperator | null, paymentAmount: Hbar): Promise; /** * @typedef {import("../channel/Channel.js").default} Channel * @typedef {import("../PublicKey.js").default} PublicKey */ /** * @typedef {import("../client/Client.js").ClientOperator} ClientOperator * @typedef {import("../client/Client.js").default<*, *>} Client */ /** * This registry holds a bunch of callbacks for `fromProtobuf()` implementations * Since this is essentially aa cache, perhaps we should move this variable into the `Cache` * type for consistency? * * @type {Map Query<*>>} */ export const QUERY_REGISTRY: Map<"getByKey" | "getBySolidityID" | "contractCallLocal" | "contractGetInfo" | "contractGetBytecode" | "ContractGetRecords" | "cryptogetAccountBalance" | "cryptoGetAccountRecords" | "cryptoGetInfo" | "cryptoGetLiveHash" | "cryptoGetProxyStakers" | "fileGetContents" | "fileGetInfo" | "transactionGetReceipt" | "transactionGetRecord" | "transactionGetFastRecord" | "consensusGetTopicInfo" | "networkGetVersionInfo" | "tokenGetInfo" | "scheduleGetInfo" | "tokenGetAccountNftInfos" | "tokenGetNftInfo" | "tokenGetNftInfos" | "networkGetExecutionTime" | "accountDetails" | undefined, (query: HashgraphProto.proto.IQuery) => Query>; /** * Base class for all queries that can be submitted to Hedera. * * @abstract * @template OutputT * @augments {Executable} */ export default class Query extends Executable { /** * Deserialize a query from bytes. The bytes should be a `proto.Query`. * * @template T * @param {Uint8Array} bytes * @returns {Query} */ static fromBytes(bytes: Uint8Array): Query; constructor(); /** * The payment transaction ID * * @type {?TransactionId} */ _paymentTransactionId: TransactionId | null; /** * The payment transactions list where each index points to a different node * * @type {HashgraphProto.proto.ITransaction[]} */ _paymentTransactions: HashgraphProto.proto.ITransaction[]; /** * The amount being paid to the node for this query. * A user can set this field explicitly, or we'll query the value during execution. * * @type {?Hbar} */ _queryPayment: Hbar | null; /** * The maximum query payment a user is willing to pay. Unlike `Transaction.maxTransactionFee` * this field only exists in the SDK; there is no protobuf field equivalent. If and when * we query the actual cost of the query and the cost is greater than the max query payment * we'll throw a `MaxQueryPaymentExceeded` error. * * @type {?Hbar} */ _maxQueryPayment: Hbar | null; /** * This is strictly used for `_getLogId()` which requires a timestamp. The timestamp it typically * uses comes from the payment transaction ID, but that field is not set if this query is free. * For those occasions we use this timestamp field generated at query construction instead. * * @type {number} */ _timestamp: number; /** * Set an explicit payment amount for this query. * * The client will submit exactly this amount for the payment of this query. Hedera * will not return any remainder. * * @param {Hbar} queryPayment * @returns {this} */ setQueryPayment(queryPayment: Hbar): this; /** * Set the maximum payment allowable for this query. * * @param {Hbar} maxQueryPayment * @returns {this} */ setMaxQueryPayment(maxQueryPayment: Hbar): this; /** * Fetch the cost of this query from a consensus node * * @param {import("../client/Client.js").default} client * @returns {Promise} */ getCost(client: import("../client/Client.js").default): Promise; /** * Set he payment transaction explicitly * * @param {TransactionId} paymentTransactionId * @returns {this} */ setPaymentTransactionId(paymentTransactionId: TransactionId): this; /** * Get the payment transaction ID * * @returns {?TransactionId} */ get paymentTransactionId(): TransactionId | null; /** * Is payment required for this query. By default most queries require payment * so the default implementation returns true. * * @protected * @returns {boolean} */ protected _isPaymentRequired(): boolean; /** * Validate checksums of the query. * * @param {Client} client */ _validateChecksums(client: import("../client/Client.js").default): void; /** * Before we proceed exeuction, we need to do a couple checks * * @template MirrorChannelT * @param {import("../client/Client.js").default} client * @returns {Promise} */ _beforeExecute(client: import("../client/Client.js").default): Promise; /** * @abstract * @internal * @param {HashgraphProto.proto.IResponse} response * @returns {HashgraphProto.proto.IResponseHeader} */ _mapResponseHeader(response: HashgraphProto.proto.IResponse): HashgraphProto.proto.IResponseHeader; /** * @protected * @returns {HashgraphProto.proto.IQueryHeader} */ protected _makeRequestHeader(): HashgraphProto.proto.IQueryHeader; /** * @abstract * @internal * @param {HashgraphProto.proto.IQueryHeader} header * @returns {HashgraphProto.proto.IQuery} */ _onMakeRequest(header: HashgraphProto.proto.IQueryHeader): HashgraphProto.proto.IQuery; /** * @internal * @returns {HashgraphProto.proto.IQuery} */ _makeRequest(): HashgraphProto.proto.IQuery; /** * @param {HashgraphProto.proto.Query} request * @returns {Uint8Array} */ _requestToBytes(request: HashgraphProto.proto.Query): Uint8Array; /** * @param {HashgraphProto.proto.Response} response * @returns {Uint8Array} */ _responseToBytes(response: HashgraphProto.proto.Response): Uint8Array; } /** * Cache for the cost query constructor. This prevents cyclic dependencies. * * @type {((query: Query<*>) => import("./CostQuery.js").default<*>)[]} */ export const COST_QUERY: ((query: Query) => import("./CostQuery.js").default)[]; export type Channel = import("../channel/Channel.js").default; export type PublicKey = import("../PublicKey.js").default; export type ClientOperator = import("../client/Client.js").ClientOperator; export type Client = import("../client/Client.js").default; import TransactionId from "../transaction/TransactionId.js"; import AccountId from "../account/AccountId.js"; import Hbar from "../Hbar.js"; import * as HashgraphProto from "@hashgraph/proto"; import Executable from "../Executable.js";