import { getSubgraphSdk } from "../utils/graphql";
export async function getOfferById(subgraphUrl, offerId, queryVars = {}) {
    const subgraphSdk = getSubgraphSdk(subgraphUrl);
    const { offer } = await subgraphSdk.getOfferByIdQuery({
        offerId: offerId.toString(),
        ...queryVars
    });
    return offer;
}
export async function getOffers(subgraphUrl, queryVars = {}) {
    const subgraphSdk = getSubgraphSdk(subgraphUrl);
    const { offers = [] } = await subgraphSdk.getOffersQuery({
        ...queryVars
    });
    return offers;
}
//# sourceMappingURL=subgraph.js.map