From b911504233bbd4ab53bbe79285ea5696f55fc324 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 20 Dec 2023 14:51:10 -0800 Subject: [PATCH] fix: update headers for fetchAllOrders --- src/jobs/seaport-sync/utils.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/jobs/seaport-sync/utils.ts b/src/jobs/seaport-sync/utils.ts index c2574ac..6b13241 100644 --- a/src/jobs/seaport-sync/utils.ts +++ b/src/jobs/seaport-sync/utils.ts @@ -193,13 +193,19 @@ export const fetchAllOrders = async ( listedBefore: toTimestamp, }); + const headers: any = { + url, + "x-api-key": config.backfillOpenseaApiKey || "", + }; + + if (config.openseaApiUrl && config.openseaNftApiKey) { + headers["x-nft-api-key"] = config.openseaNftApiKey; + } + const options: AxiosRequestConfig = { method: "GET", url: config.openseaApiUrl || url, - headers: { - url, - "x-api-key": config.backfillOpenseaApiKey || "", - }, + headers, }; try {