@renegade-fi/core
Version:
VanillaJS library for Renegade
16 lines • 645 B
JavaScript
import { ADMIN_OPEN_ORDERS_ROUTE } from "../constants.js";
import { BaseError } from "../errors/base.js";
import { getRelayerWithAdmin } from "../utils/http.js";
export async function getOpenOrders(config, parameters = {}) {
const { getBaseUrl } = config;
const url = new URL(getBaseUrl(ADMIN_OPEN_ORDERS_ROUTE));
if (parameters.matchingPool) {
url.searchParams.set("matching_pool", parameters.matchingPool);
}
const res = await getRelayerWithAdmin(config, url.toString());
if (!res.orders) {
throw new BaseError("No orders found");
}
return res.orders;
}
//# sourceMappingURL=getOpenOrders.js.map