import { AxiomV2ComputeQuery, AxiomV2DataQuery, Subquery } from "@axiom-crypto/tools"; import { DataSubqueryCount, QueryBuilderBaseConfig, BuiltQueryV2Base, QueryBuilderBaseInternalConfig } from "./types"; /** * Base class for building Axiom queries. This is a base class is used to eventually build a dataQuery and computeQuery into a * format that can be sent onchain. However, it requires QueryBuilderClient to build the client-facing pieces of the query. Most * users will want to use QueryBuilderClient instead of this class. */ export declare class QueryBuilderBase { readonly config: QueryBuilderBaseInternalConfig; protected builtQueryBase?: BuiltQueryV2Base; protected dataQuery?: Subquery[]; protected computeQuery?: AxiomV2ComputeQuery; protected dataSubqueryCount: DataSubqueryCount; constructor(config: QueryBuilderBaseConfig, dataQuery?: Subquery[], computeQuery?: AxiomV2ComputeQuery); protected configure(config: QueryBuilderBaseConfig): QueryBuilderBaseInternalConfig; /** * Gets the current set of unbuilt data subqueries * @returns Array of unbuilt data subqueries */ getDataQuery(): Subquery[] | undefined; /** * Gets the current compute query * @returns The current compute query */ getComputeQuery(): AxiomV2ComputeQuery | undefined; /** * Gets the current count of each type of data subquery * @returns Subquery counts */ getDataSubqueryCount(): DataSubqueryCount; /** * Gets the built Query. Built Query resets if any data is changed. * @returns The built Query; undefined if Query has not been built yet */ getBuiltQueryBase(): BuiltQueryV2Base | undefined; /** * Gets the hash of the querySchema of the computeQuery * @returns Query schema hash */ getQuerySchema(): string; /** * Gets the hash of the data query * @returns Data query hash */ getDataQueryHash(): string; getQueryHash(): string; setDataQuery(dataQuery: Subquery[]): void; setComputeQuery(computeQuery: AxiomV2ComputeQuery): void; setMock(mock: boolean): void; /** * Append a `Subquery[]` object to the current dataQuery * @param dataQuery A `Subquery[]` object to append */ append(dataSubqueries: Subquery[], skipValidate?: boolean): void; /** * Appends a single subquery to the current dataQuery * @param dataSubquery The data of the subquery to append * @param type (optional) The type of subquery to append. If not provided, the type will be * inferred from the keys of the subquery. */ appendDataSubquery(dataSubquery: Subquery): void; /** * Appends an already-built DataQuery. This is used when receiving an already-built DataQuery * from some other service. Setting this will override any currently appended subqueries. */ setBuiltDataQuery(dataQuery: AxiomV2DataQuery, skipValidate?: boolean): void; /** * Queries the required subquery data and builds the entire Query object into the format * that is required by the backend/ZK circuit * @param validate (optional) Runs validation on the Query before attempting to build it * @returns A built Query object */ buildBase(validate?: boolean): Promise; /** * @returns {boolean} Whether the query is valid or not */ validate(): Promise; private unsetBuiltQueryBase; private getDefaultResultLen; protected handleComputeQueryRequest(computeQuery: AxiomV2ComputeQuery): AxiomV2ComputeQuery; protected validateDataSubqueries(): Promise; protected validateComputeQuery(): Promise; protected validateSubqueryCount(): void; } //# sourceMappingURL=queryBuilderBase.d.ts.map