UNPKG

@renegade-fi/core

Version:
17 lines 679 B
import { ADMIN_ORDER_METADATA_ROUTE } from '../constants.js'; import { BaseError } from '../errors/base.js'; import { getRelayerWithAdmin } from '../utils/http.js'; export async function getOrderMetadata(config, parameters) { const { id } = parameters; const { getBaseUrl } = config; const url = new URL(getBaseUrl(ADMIN_ORDER_METADATA_ROUTE(id))); if (parameters.includeFillable) { url.searchParams.set('include_fillable', String(true)); } const res = await getRelayerWithAdmin(config, url.toString()); if (!res.order) { throw new BaseError('No order found'); } return res.order; } //# sourceMappingURL=getOrderMetadata.js.map